Multi AFFECTION™
Address
0xCF138a83D739eE98D7A54159E94e5BFaa4B61988Functions

Code
[
	{
		"inputs": [],
		"stateMutability": "nonpayable",
		"type": "constructor"
	},
	{
		"inputs": [
			{
				"internalType": "address",
				"name": "_address",
				"type": "address"
			},
			{
				"internalType": "uint256",
				"name": "_loops",
				"type": "uint256"
			}
		],
		"name": "multiBuyWith",
		"outputs": [],
		"stateMutability": "nonpayable",
		"type": "function"
	},
	{
		"inputs": [
			{
				"internalType": "uint256",
				"name": "_loops",
				"type": "uint256"
			}
		],
		"name": "multiGenerate",
		"outputs": [],
		"stateMutability": "nonpayable",
		"type": "function"
	}
]// SPDX-License-Identifier: Affection
pragma solidity ^0.8.28;
interface IERC20 {
    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
    function transfer(address recipient, uint256 amount) external returns (bool);
    function approve(address _spender, uint256 _value) external returns (bool);
}
interface IAffection {
    function Generate() external returns (uint64);
    function BuyWithG5(uint256 amount) external;
    function BuyWithPI(uint256 amount) external;
    function BuyWithMATH(uint256 amount) external;
    function BuyWithFa(uint256 amount) external;
    function BuyWithFaung(uint256 amount) external;
}
contract MultiAffection {
    address AffectionAddress = address(0x24F0154C1dCe548AdF15da2098Fdd8B8A3B8151D);
    address G5Address = address(0x2fc636E7fDF9f3E8d61033103052079781a6e7D2);
    address PIAddress = address(0xA2262D7728C689526693aE893D0fD8a352C7073C);
    address MATHAddress = address(0xB680F0cc810317933F234f67EB6A9E923407f05D);
    address FaAddress = address(0x232a27AB6941281b3f474Fe5fF7Cc89816fB675A);
    address FaungAddress = address(0x73A19FaFb359faf519C9707b781dfdB88407d10d);
    IAffection Affection = IAffection(AffectionAddress);
    IERC20 G5Token = IERC20(G5Address);
    IERC20 PIToken = IERC20(PIAddress);
    IERC20 MATHToken = IERC20(MATHAddress);
    IERC20 FaToken = IERC20(FaAddress);
    IERC20 FaungToken = IERC20(FaungAddress);
    mapping(address => uint256) perLoop;
    constructor() {
        G5Token.approve(AffectionAddress, type(uint256).max);
        PIToken.approve(AffectionAddress, type(uint256).max);
        MATHToken.approve(AffectionAddress, type(uint256).max);
        FaToken.approve(AffectionAddress, type(uint256).max);
        FaungToken.approve(AffectionAddress, type(uint256).max);
        perLoop[G5Address] = 6 * 10 ** 17; // 0.6
        perLoop[PIAddress] = 1 * 10 ** 16; // 0.01
        perLoop[MATHAddress] = 3 * 10 ** 18; // 3
        perLoop[FaAddress] = 12 * 10 ** 18; // 12
        perLoop[FaungAddress] = 6 * 10 ** 18; // 6
    }
    function multiBuyWith(address _address, uint _loops) public {
        uint256 amount = _loops * 3  * 10 ** 18;
        multiGenerate(_loops);
        if (_address == G5Address) {
            G5Token.transferFrom(msg.sender, address(this), _loops * perLoop[_address]);
            Affection.BuyWithG5(amount);
        } else if (_address == PIAddress) {
            PIToken.transferFrom(msg.sender, address(this), _loops * perLoop[_address]);
            Affection.BuyWithPI(amount);
        } else if (_address == MATHAddress) {
            MATHToken.transferFrom(msg.sender, address(this), _loops * perLoop[_address]);
            Affection.BuyWithMATH(amount);
        } else if (_address == FaAddress) {
            FaToken.transferFrom(msg.sender, address(this), _loops * perLoop[_address]);
            Affection.BuyWithFa(amount);
        } else if (_address == FaungAddress) {
            FaungToken.transferFrom(msg.sender, address(this), _loops * perLoop[_address]);
            Affection.BuyWithFaung(amount);
        } else {
            require(perLoop[_address] > 0, "Check address");
        }
        IERC20(AffectionAddress).transfer(msg.sender, amount);
    }
    function multiGenerate(uint _loops) public {
        for (uint i = 0; i < _loops; i++)
            Affection.Generate();
    }
}Last updated
