Contract 0x7a1f47c8a26fd895228947ffc0482f3dd9c2ca29

 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xe0c5b662091ce8584795ee4868dbc1ba0ee002b12777c2d6ca691abbcdd4922aWithdraw517963062022-12-02 21:57:0411 mins ago0x4b941dc4f1024e305a82fd70a31425ab2fd5af7d IN  0x7a1f47c8a26fd895228947ffc0482f3dd9c2ca290 FTM0.001520882166
0xdb3b1ef2bd44606316d0a35441d476b3636be11324957078633f53e830b995bbClaim Reward Nft517955392022-12-02 21:32:5535 mins ago0x4d7a022ac73883e5075506501acbade0e433bf59 IN  0x7a1f47c8a26fd895228947ffc0482f3dd9c2ca290 FTM0.001850365443
0x83ca27bed5a574838713e156653308e748d7e35f50c9579553a1767839cbbaf4Deposit517953972022-12-02 21:28:1740 mins ago0xe13432ce2646ac9ecd3c43b94187e8560d614be6 IN  0x7a1f47c8a26fd895228947ffc0482f3dd9c2ca290 FTM0.001822007249
0xf4b0c22b7472a37ad07ac9def26a5dd6da399625653915b35cd4b1ed5427aee0Withdraw517953102022-12-02 21:25:3642 mins ago0xe13432ce2646ac9ecd3c43b94187e8560d614be6 IN  0x7a1f47c8a26fd895228947ffc0482f3dd9c2ca290 FTM0.001245993503
0xb15d7ecff3c9c6eded9bd74fe0746d937ad57ced227dee9869a9442284b5ea56Deposit517938302022-12-02 20:46:581 hr 21 mins ago0x54f42620a4db88cae8407982c30ce8331ce1097e IN  0x7a1f47c8a26fd895228947ffc0482f3dd9c2ca290 FTM0.001928468397
0x0228447fd63a5d35057fbd0ed0c5827252fd25adb11029d09b9f678fbddfcc49Claim Reward Nft517933362022-12-02 20:33:361 hr 34 mins ago0x480594322cc4c8d81011acfac430e330c7dbf43d IN  0x7a1f47c8a26fd895228947ffc0482f3dd9c2ca290 FTM0.00121423181
0xbc2ee954f3713a7e65b6440f76f163c89cb614ab815c7459d39ede41a52bd85fDeposit517911092022-12-02 19:26:452 hrs 41 mins ago0x3e7b8d12d4de6cb284a7d60bf92b462d2a6d6a2f IN  0x7a1f47c8a26fd895228947ffc0482f3dd9c2ca290 FTM0.08158048
0x632cd4f1b62b0d0046bcf9f34f3517c3973a34589df9307435ead39a2d92c4a5Deposit517910122022-12-02 19:25:072 hrs 43 mins ago0xab44fdad1c169eddecd7aa5c7ab90dcf62b1dae7 IN  0x7a1f47c8a26fd895228947ffc0482f3dd9c2ca290 FTM0.002122140543
0x3d352262a474f5268fdf3ff64aec2670acbc8498c1473d4e26f8ad35fde01ccaClaim Reward Nft517909502022-12-02 19:23:382 hrs 44 mins ago0xab44fdad1c169eddecd7aa5c7ab90dcf62b1dae7 IN  0x7a1f47c8a26fd895228947ffc0482f3dd9c2ca290 FTM0.001363451225
0x642f4debf43b480d80fd3c2def22ecc9983a1c278e9abb9f9bfe6e94fbca7823Withdraw517909452022-12-02 19:23:302 hrs 44 mins ago0xab44fdad1c169eddecd7aa5c7ab90dcf62b1dae7 IN  0x7a1f47c8a26fd895228947ffc0482f3dd9c2ca290 FTM0.001398772324
0xe8c1ed537994ca117724abae64c6c4c3fdf11f7ae2521a58fab8dd04e457b9d2Withdraw517908262022-12-02 19:20:532 hrs 47 mins ago0x3e7b8d12d4de6cb284a7d60bf92b462d2a6d6a2f IN  0x7a1f47c8a26fd895228947ffc0482f3dd9c2ca290 FTM0.05231412
0x53d266dab9f437becde276e5300dddab97949dfa457e0c5412e2199edd0a543fClaim Reward Nft517908222022-12-02 19:20:442 hrs 47 mins ago0x3e7b8d12d4de6cb284a7d60bf92b462d2a6d6a2f IN  0x7a1f47c8a26fd895228947ffc0482f3dd9c2ca290 FTM0.05099311
0x07abd35a4084538293a7beba55384e39d4e34d7e76504dd80d4fb3311098bf22Claim Reward Nft517870922022-12-02 18:00:134 hrs 8 mins ago0x60fb4b046b07ce529fb93598286339873d26dd0c IN  0x7a1f47c8a26fd895228947ffc0482f3dd9c2ca290 FTM0.005758614
0xd6d0de661d5a74a01e90fa690b8deba8d3bb8fe55390da32e5961a78acad43f6Deposit517864592022-12-02 17:46:064 hrs 22 mins ago0x54f42620a4db88cae8407982c30ce8331ce1097e IN  0x7a1f47c8a26fd895228947ffc0482f3dd9c2ca290 FTM0.003294791194
0xc00e4f2c8f36b88c0fe10cfa0fea74aac519bf3ed987dc72892040c88bf3437dWithdraw517863052022-12-02 17:42:034 hrs 26 mins ago0x59de163f158515973fd736e2faa7ad801c6f234b IN  0x7a1f47c8a26fd895228947ffc0482f3dd9c2ca290 FTM0.002723984274
0x435a5439d0a34031ed792c76a95e1150f704277b93fd3f0aa30ad7ce2c4f78e4Claim Reward Nft517862072022-12-02 17:40:064 hrs 28 mins ago0xb95d0b0cfe1c2063bfa6ef8358166f94e76b601a IN  0x7a1f47c8a26fd895228947ffc0482f3dd9c2ca290 FTM0.002309757361
0xacb10ae74e5d1dcdacd25803935e1160e5281b6dfb075e2ad004f04a61e7d5aaStake Nft517861242022-12-02 17:38:064 hrs 30 mins ago0xc42101367930cc03f1e36f5ca2e1e39ed58bf236 IN  0x7a1f47c8a26fd895228947ffc0482f3dd9c2ca290 FTM0.010781528917
0x7e3ebb1fc71dac6a1560d1a52d705d3cae4484c47933fae7b33cd35a36f29b85Claim Reward Nft517859992022-12-02 17:33:194 hrs 35 mins ago0xfb5cd8b2ed26bbb809c390b7efd3fe12cb353ba0 IN  0x7a1f47c8a26fd895228947ffc0482f3dd9c2ca290 FTM0.002282540165
0x5600a620c268b2004946fa45d38f96475ae0d03e52a23eaa2ec978d859d0fe09Claim Reward Nft517858152022-12-02 17:27:274 hrs 41 mins ago0xf3f56511de6161209ee00bf37cc5eaa9a9bd2d3e IN  0x7a1f47c8a26fd895228947ffc0482f3dd9c2ca290 FTM0.001674965157
0x9e5ab5e88595f2b44e7e7748bf0ee0862a615240f9dd78fb528aafbc08354135Claim Reward Nft517855312022-12-02 17:16:174 hrs 52 mins ago0x4e903022f7f685a41bf4dd55305b975bb45c9b82 IN  0x7a1f47c8a26fd895228947ffc0482f3dd9c2ca290 FTM0.002313337227
0xa0c587789ef916ff1a07fd4d26d175158976afde313dc7d3f10ca1b660b590b0Withdraw517843222022-12-02 16:45:535 hrs 22 mins ago0x474528283908e2548f44cd51d16976bce22ad8fc IN  0x7a1f47c8a26fd895228947ffc0482f3dd9c2ca290 FTM0.002484550239
0x10d019dc36197cc73f6ae720bbcb6e88d482050560887deff051db2a2e170eedClaim Reward Nft517842622022-12-02 16:44:415 hrs 23 mins ago0x4d7a022ac73883e5075506501acbade0e433bf59 IN  0x7a1f47c8a26fd895228947ffc0482f3dd9c2ca290 FTM0.00204761424
0x756460a1f204536bffa8c53277a67b38db74fa169fc7abfce2d62b70f679cd83Deposit517840632022-12-02 16:37:235 hrs 31 mins ago0xb370b84b9d9797dc01c21959916c9caa28cad800 IN  0x7a1f47c8a26fd895228947ffc0482f3dd9c2ca290 FTM0.003582851368
0x2eb34cd5902cc5b41441aad52486a0184552a06c8aab511c1e985bba10006bc3Withdraw517838982022-12-02 16:31:245 hrs 37 mins ago0xb370b84b9d9797dc01c21959916c9caa28cad800 IN  0x7a1f47c8a26fd895228947ffc0482f3dd9c2ca290 FTM0.004225564208
0x7b1f460f2e6033779b7d63388300ff5a14ab7d1d327557b1fdbbe1e24fe04396Withdraw517838572022-12-02 16:29:305 hrs 38 mins ago0xb370b84b9d9797dc01c21959916c9caa28cad800 IN  0x7a1f47c8a26fd895228947ffc0482f3dd9c2ca290 FTM0.002142665122
[ Download CSV Export 
Latest 1 internal transaction
Parent Txn Hash Block From To Value
0xd6c57af9f95bc5272f5e6350d4eb458469600974402832f8f697512aa4585585507530482022-11-11 1:26:5021 days 20 hrs ago 0xb9b22504b9071291e938e0e582934a82c4a4670c  Contract Creation0 FTM
[ Download CSV Export 
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.

Contract Source Code Verified (Exact Match)

Contract Name:
SmeltRewardPool

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 50 runs

Other Settings:
default evmVersion
File 1 of 15 : SmeltRewardPool.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "../interfaces/IBasedReceipt.sol";
import "../interfaces/IGodFootPrint.sol";




// Note that this pool has no minter key of SMELT (rewards).
// Instead, the governance will call SMELT distributeReward method and send reward to this pool at the beginning.
contract SmeltRewardPool is Ownable, IERC721Receiver, ReentrancyGuard {

    using SafeERC20 for IERC20;
    IERC20 immutable  smelt;
    IERC20 immutable stater;
   

    // governance
    address public operator;

    // Info of each user.
    struct UserInfo {
        uint256 amount; // How many tokens the user has provided.
        uint256 rewardDebt; // Deposit debt. See explanation below.
    }

    // Info of each ERC20 / ERC721 pool.
    struct PoolInfo {
        IERC20 token; // Address of token contract.
        IERC721 nft; // Address of nft contract.
        uint256 depositFee; // deposit fee 
        uint256 allocPoint; // How many allocation points assigned to this pool. SMELT to distribute.
        uint256 lastRewardTime; // Last time that SMELT distribution occurs.
        uint256 accSmeltPerShare; // Accumulated SMELT per share, times 1e18. See below.
        bool isStarted; // if lastRewardBlock has passed
        bool isNftPool; // help w staking to nft vs erc20 tokens
        bool givesReceipts; // help w staking to nft vs erc20 tokens
        address receiptToken; // receipt token this pool might emit

    }

    struct UserNfts
    {
        uint256[] ids;
        mapping(uint256 => uint256) indexStaked;
        uint256 totalNftsStaked;
    }

    // Info of each ERC20 pool.
    PoolInfo[] public poolInfo;
    // Info of each user that stakes tokens.
    mapping(uint256 => mapping(address => UserInfo)) public userInfo;

     // map of ERC721 Token stakers.
    mapping(uint256 => address) public stakerAddress;

    mapping(address => UserNfts) public stakedTokens;


    // Total allocation points. Must be the sum of all allocation points in all pools.
    uint256 public totalAllocPoint = 0;

    // The time when SMELT mining starts.
    uint256 immutable poolStartTime;

    // The time when SMELT mining ends.
    uint256 immutable poolEndTime;

    address immutable protocolFundAddress;


    uint256 constant smeltPerSecond = 0.00115 ether; // 80000 SMELT / (800d * 24h * 60min * 60s) ~ 100 SMELT / day
    uint256 constant runningTime = 700 days;



    event Deposit(address indexed user, uint256 indexed pid, uint256 amount);
    event Withdraw(address indexed user, uint256 indexed pid, uint256 amount);

    event StakedNft(address indexed user, uint256 indexed pid, uint256 _tokenIds);
    event UnstakedNft(address indexed user, uint256 indexed pid, uint256 _tokenIds);

    event RewardPaid(address indexed user, uint256 amount);
    event TeamMemberAllocationAdjusted(address indexed member, uint256 amount);
    event EmergencyWithdraw(address indexed user, uint256 indexed pid, uint256 amount);
    event EmergencyWithdrawNFT(address indexed user, uint256 indexed pid, uint256 amount);

    event OperatorTransferred(address indexed newOperator);



    function onERC721Received(address , address , uint256 , bytes memory) external pure override returns (bytes4){
    return bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"));
}

    constructor(
        address _smelt,
        address _stater,
        address _protocolFund,
        uint256 _poolStartTime
    ) {
        require(block.timestamp < _poolStartTime, "late");
        require(_smelt != address(0), "cant be uninitialized");
        require(_stater != address(0), "cant be uninitialized");
        require(_protocolFund != address(0), "cant be uninitialized");

        smelt = IERC20(_smelt);
        stater = IERC20(_stater);
        protocolFundAddress = _protocolFund;
        poolStartTime = _poolStartTime;
        poolEndTime = _poolStartTime + runningTime;
        operator = msg.sender;

    }


    modifier onlyOperator() {
        require(operator == msg.sender, "SmeltRewardPool: not operator");
        _;
    }

    //=============================================== public and external functions =================================
    // Returns ERC721 tokens staked by user
    function getStakedNfts(address _user) public view returns (uint256[] memory) {
            return stakedTokens[_user].ids;
        }

    // Return accumulate rewards over the given _from to _to block.
    function getGeneratedReward(uint256 _fromTime, uint256 _toTime) public view returns (uint256) {
        if (_fromTime >= _toTime) return 0;
        if (_toTime >= poolEndTime) {
            if (_fromTime >= poolEndTime) return 0;
            if (_fromTime <= poolStartTime) return (poolEndTime - poolStartTime) * smeltPerSecond;
            return (poolEndTime - _fromTime) * smeltPerSecond;
        } else {
            if (_toTime <= poolStartTime) return 0;
            if (_fromTime <= poolStartTime) return (_toTime - poolStartTime) * (smeltPerSecond);
            return (_toTime - _fromTime) * (smeltPerSecond);
        }
    }

    // View function to see pending SMELT on frontend.
    function pendingSMELT(uint256 _pid, address _user) external view returns (uint256) {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][_user];
        uint256 accSmeltPerShare = pool.accSmeltPerShare;
        uint256 tokenSupply = pool.token.balanceOf(address(this));
        if (block.timestamp > pool.lastRewardTime && tokenSupply != 0) {
            uint256 _generatedReward = getGeneratedReward(pool.lastRewardTime, block.timestamp);
            uint256 _multiplyHelper =  _generatedReward * (pool.allocPoint); // intermidiate var to avoid multiply and division calc errors
            uint256 _smeltReward = _multiplyHelper / (totalAllocPoint);
            accSmeltPerShare = accSmeltPerShare + (_smeltReward * (1e18) / (tokenSupply));
        }
        return user.amount * (accSmeltPerShare) / (1e18) - (user.rewardDebt);
    }
    // View function to see pending SMELT on frontend.
    function pendingSMELTNft(uint256 _pid, address _user) external view returns (uint256) {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][_user];
        uint256 accSmeltPerShare = pool.accSmeltPerShare;
        uint256 nftSupply = pool.nft.balanceOf(address(this));
        if (block.timestamp > pool.lastRewardTime && nftSupply != 0) {
            uint256 _generatedReward = getGeneratedReward(pool.lastRewardTime, block.timestamp);
            uint256 _multiplyHelper =  _generatedReward * (pool.allocPoint); // intermidiate var to avoid multiply and division calc errors
            uint256 _smeltReward = _multiplyHelper / (totalAllocPoint);
            accSmeltPerShare = accSmeltPerShare + (_smeltReward * (1e18) / (nftSupply));
        }
        return user.amount * (accSmeltPerShare) / (1e18) - (user.rewardDebt);
    }

    // Update reward variables for all pools. Be careful of gas spending!
    function massUpdatePools() public {
        uint256 length = poolInfo.length;
        for (uint256 pid = 0; pid < length; ++pid) {
            updatePool(pid);
        }
    }

    // Update reward variables of the given pool to be up-to-date.
    function updatePool(uint256 _pid) public {
        PoolInfo storage pool = poolInfo[_pid];
        if (block.timestamp <= pool.lastRewardTime) {
            return;
        }
        if (pool.isNftPool == true){
        uint256 nftSupply = pool.nft.balanceOf(address(this));
         if (nftSupply == 0) {
            pool.lastRewardTime = block.timestamp;
            return;
        }
         if (!pool.isStarted) {
            pool.isStarted = true;
            totalAllocPoint = totalAllocPoint + (pool.allocPoint);
        }

         if (totalAllocPoint > 0) {
            uint256 _generatedReward = getGeneratedReward(pool.lastRewardTime, block.timestamp);
            uint256 multiplyHelper = _generatedReward * (pool.allocPoint);
            uint256 _smeltReward = multiplyHelper / (totalAllocPoint);
            pool.accSmeltPerShare = pool.accSmeltPerShare + (_smeltReward * (1e18) / (nftSupply));
        } 
         pool.lastRewardTime = block.timestamp;
        }  else  {
            uint256 tokenSupply = pool.token.balanceOf(address(this));

            if (tokenSupply == 0) {
            pool.lastRewardTime = block.timestamp;
            return;
            }
            if (!pool.isStarted) {
            pool.isStarted = true;
            totalAllocPoint = totalAllocPoint + (pool.allocPoint);
            }
            if (totalAllocPoint > 0) {
            uint256 _generatedReward = getGeneratedReward(pool.lastRewardTime, block.timestamp);
            uint256 multiplyHelper = _generatedReward * (pool.allocPoint);
            uint256 _smeltReward = multiplyHelper / (totalAllocPoint);
            pool.accSmeltPerShare = pool.accSmeltPerShare + (_smeltReward * (1e18) / (tokenSupply));
        }
        pool.lastRewardTime = block.timestamp;
    }
    }
    // ============ Deposit & Withdraw ERC20 and ERC721 functionality

    function deposit(uint256 _pid, uint256 _amount) public nonReentrant  {
        address _sender = msg.sender;
        PoolInfo storage pool = poolInfo[_pid];
        require (pool.isNftPool == false , "Pool not for ERC721");      //==================make sure this is not nft pool
        UserInfo storage user = userInfo[_pid][_sender];
        updatePool(_pid);
        if (user.amount > 0) {
            // transfer rewards to user if any pending rewards
            uint256 _pending = user.amount * (pool.accSmeltPerShare) / (1e18) - (user.rewardDebt);
            if (_pending > 0) {
                // send pending reward to user, if rewards accumulating in _pending
                safeSmeltTransfer(_sender, _pending);
                emit RewardPaid(_sender, _pending);
            }
        }
        if (_amount > 0) {
            uint256 balanceBeforeTransfer = pool.token.balanceOf(address(this));
            pool.token.safeTransferFrom(_sender, address(this), _amount);
            require (pool.token.balanceOf(address(this)) == balanceBeforeTransfer + _amount, "check if tax on transfer");
            uint256 depositDebt = _amount * (pool.depositFee) / (10000);   
            user.amount = user.amount + (_amount - (depositDebt));
            pool.token.safeTransfer(protocolFundAddress, depositDebt);
            if (pool.givesReceipts == true) {
                IBasedReceipt(pool.receiptToken).mint(_sender, _amount);
            }
        }
        user.rewardDebt = user.amount * (pool.accSmeltPerShare) / (1e18);
        emit Deposit(_sender, _pid, _amount);
    }

    function StakeNft(uint256 _pid, uint256[] calldata _tokenIds) external nonReentrant {

        address _sender = msg.sender;
        PoolInfo storage pool = poolInfo[_pid];
        require (pool.isNftPool == true , "Pool not for ERC721");          //==============make sure we stake nfts in pools that support nft staking
        UserInfo storage user = userInfo[_pid][_sender];
        updatePool(_pid);
        if (user.amount > 0) {
            // transfer rewards to user if any pending rewards
            uint256 _pending = user.amount * (pool.accSmeltPerShare) / (1e18) - (user.rewardDebt);
            if (_pending > 0) {
                // send pending reward to user, if rewards accumulating in _pending
                safeSmeltTransfer(_sender, _pending);
                emit RewardPaid(_sender, _pending);
            }
        }
         if (_tokenIds.length > 0) {

            for (uint256 i = 0; i < _tokenIds.length; ++i) {
            require( pool.nft.ownerOf(_tokenIds[i]) == _sender,"not owner of token");
            pool.nft.safeTransferFrom(_sender, address(this),  _tokenIds[i]);

            stakerAddress[_tokenIds[i]] = _sender;

            stakedTokens[_sender].ids.push(_tokenIds[i]);
            stakedTokens[_sender].indexStaked[_tokenIds[i]] = stakedTokens[_sender].ids.length - 1 ;

            emit StakedNft(_sender, _pid, _tokenIds[i]);
            }
            user.amount = user.amount + _tokenIds.length;
            if (pool.givesReceipts == true) {
              IGodFootPrint(pool.receiptToken).mint(_sender, _tokenIds.length*10**18);
            }

        }
        user.rewardDebt = user.amount * (pool.accSmeltPerShare) / (1e18);
    }
    // Withdraw ERC721 tokens.
    function UnstakeNft(uint256 _pid, uint256[] calldata _tokenIds) external nonReentrant  {

        address _sender = msg.sender;
        PoolInfo storage pool = poolInfo[_pid];
         require (pool.isNftPool == true, "not NFT pool");         //==================make sure this is not nft pool
        UserInfo storage user = userInfo[_pid][_sender];
        updatePool(_pid);
        require(user.amount >= _tokenIds.length, "withdraw: not good");
        uint256 _pending = user.amount * (pool.accSmeltPerShare) / (1e18) - (user.rewardDebt);
        if (_pending > 0) {
            safeSmeltTransfer(_sender, _pending);
            emit RewardPaid(_sender, _pending);
        }
        if (_tokenIds.length > 0) {
           
            
            for (uint256 i = 0; i < _tokenIds.length; ++i) {
            
            require( stakerAddress[_tokenIds[i]] == _sender,"not deposited by you");
            unStakeNftsFromStatArray(_sender,stakedTokens[_sender].indexStaked[_tokenIds[i]]);
            stakerAddress[_tokenIds[i]] = address(0);
            
            pool.nft.safeTransferFrom(address(this), _sender, _tokenIds[i]);
            emit UnstakedNft(_sender, _pid, _tokenIds[i]);
            }
            user.amount = user.amount - _tokenIds.length;
            
            if (pool.givesReceipts == true) {
                IERC20 godsRcpt = IERC20(pool.receiptToken);
                require(godsRcpt.balanceOf(_sender)>= _tokenIds.length, "rcpt token amt < withdraw amt");
                ERC20Burnable(pool.receiptToken).burnFrom(_sender, _tokenIds.length*10**18);
            }

        }
        user.rewardDebt = user.amount * (pool.accSmeltPerShare) / (1e18);
    }
    // Withdraw tokens.
    function withdraw(uint256 _pid, uint256 _amount) public nonReentrant  {
        address _sender = msg.sender;
        PoolInfo storage pool = poolInfo[_pid];
            require (pool.isNftPool == false , "Pool not for ERC721");         //==================make sure this is not nft pool
        UserInfo storage user = userInfo[_pid][_sender];
            require(user.amount >= _amount, "withdraw: not good");
        updatePool(_pid);
        uint256 _pending = user.amount * (pool.accSmeltPerShare) / (1e18) - (user.rewardDebt);
        if (_pending > 0) {
            safeSmeltTransfer(_sender, _pending);
            emit RewardPaid(_sender, _pending);
        }
        if (_amount > 0) {
            user.amount = user.amount - (_amount);
            if (pool.givesReceipts == true) {
                IERC20 bsdRcpt = IERC20(pool.receiptToken);
                require(bsdRcpt.balanceOf(msg.sender)>= _amount, "rcpt token amt < withdraw amt");
                IBasedReceipt(pool.receiptToken).burnFrom(msg.sender, _amount);
            }
            
            pool.token.safeTransfer(_sender, _amount);

        }
        user.rewardDebt = user.amount * (pool.accSmeltPerShare) / (1e18);
        emit Withdraw(_sender, _pid, _amount);
    }

    function claimRewardNft(uint256 _pid) public nonReentrant {
        address _sender = msg.sender;
        PoolInfo storage pool = poolInfo[_pid];
        require (pool.isNftPool == true, "pool for ERC20");
        UserInfo storage user = userInfo[_pid][_sender];
        updatePool(_pid);
        uint256 _pending = user.amount * (pool.accSmeltPerShare) / (1e18) - (user.rewardDebt);
        if (_pending > 0) {
            safeSmeltTransfer(_sender, _pending);
            emit RewardPaid(_sender, _pending);
        }
        user.rewardDebt = user.amount * (pool.accSmeltPerShare) / (1e18);

    }

    // Withdraw without caring about rewards. EMERGENCY ONLY.
    function emergencyWithdraw(uint256 _pid) public {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][msg.sender];
        IERC20 bsdRcpt = IERC20(pool.receiptToken);
        uint256 _amount = user.amount;
        
        user.amount = 0;
        user.rewardDebt = 0;
        
        if (pool.givesReceipts == true) {
            require(bsdRcpt.balanceOf(msg.sender)>= _amount, "rcpt token amt < withdraw amt");
            IBasedReceipt(pool.receiptToken).burnFrom(msg.sender, _amount);
        }
        
        pool.token.safeTransfer(msg.sender, _amount);
        emit EmergencyWithdraw(msg.sender, _pid, _amount);
    }
    //============================================================================
    function emergencyUnstakeNFT(uint256 _pid) public {
        PoolInfo storage pool = poolInfo[_pid];
        address _sender = msg.sender;

        IERC20 godsRcpt = IERC20(pool.receiptToken);
        require (pool.isNftPool == true, "not NFT pool");   
        UserInfo storage user = userInfo[_pid][_sender];

        uint256[] memory userIds = stakedTokens[_sender].ids;

        user.amount = 0;
        user.rewardDebt = 0;

   for (uint256 i = 0; i < userIds.length; ++i) {
            require( stakerAddress[userIds[i]] == _sender,"not deposited by you");
            unStakeNftsFromStatArray(_sender,stakedTokens[_sender].indexStaked[userIds[i]]);
            stakerAddress[userIds[i]] = address(0);
            pool.nft.safeTransferFrom(address(this), _sender, userIds[i]);
            }
            if (pool.givesReceipts == true) {
                require(godsRcpt.balanceOf(_sender) >= userIds.length, "rcpt token amt < withdraw amt");
                ERC20Burnable(pool.receiptToken).burnFrom(_sender, userIds.length*10**18);
                }

        emit EmergencyWithdrawNFT(msg.sender, _pid, userIds.length);
    }


    // ============================================================= internal functions ===========================


    function checkPoolDuplicate(IERC20 _token) internal view {
        uint256 length = poolInfo.length;
        for (uint256 pid = 0; pid < length; ++pid) {
            require(poolInfo[pid].token != _token, "SmeltRewardPool: existing pool?");
        }
    }
    function nftCheckPoolDuplicate(IERC721 _nft) internal view {
        uint256 length = poolInfo.length;
        for (uint256 pid = 0; pid < length; ++pid) {
            require(poolInfo[pid].nft != _nft, "SmeltRewardPool: existing pool?");
        }
    }

   function unStakeNftsFromStatArray(address _sender,uint _index) internal
    {
        require(_index < stakedTokens[_sender].ids.length);
        uint256 length = stakedTokens[_sender].ids.length;
        stakedTokens[_sender].indexStaked[stakedTokens[_sender].ids[length-1]] = _index;
        stakedTokens[_sender].ids[_index] = stakedTokens[_sender].ids[length-1];
        stakedTokens[_sender].ids.pop();

    }
    // Safe SMELT transfer function, in case if rounding error causes pool to not have enough SMELTs.
    function safeSmeltTransfer(address _to, uint256 _amount) internal {
        require (smelt.balanceOf(address(this)) >= _amount, "not enough smelt in contract");
        smelt.safeTransfer(_to, _amount);
    }
//===================================== ONLY OPERATOR FUNCTIONS =======================================================

 // Add a new pool. Can only be called by operator.
    // @ _allocPoint - amount of smelt this pool will emit
    // @ _token - token that can be deposited into this pool
    function add(
        bool _isNftPool,
        IERC721 _nft,
        IERC20 _token,
        uint256 _depFee,
        uint256 _allocPoint,
        uint256 _lastRewardTime,
        bool _withUpdate,
        bool _givesReceipts,
        address _receiptToken
    ) public onlyOperator {
        require (_depFee < 10000, "cant be > 100%");
         if (_isNftPool) {
            _token = IERC20(0x0000000000000000000000000000000000000000);
            nftCheckPoolDuplicate(_nft);

        } else if (!_isNftPool)  {
            _nft = IERC721(0x0000000000000000000000000000000000000000);
            checkPoolDuplicate(_token);
        }

        if (_withUpdate) {
            massUpdatePools();
        }
        if (block.timestamp < poolStartTime) {
            // chef is sleeping
            if (_lastRewardTime == 0) {
                _lastRewardTime = poolStartTime;
            } else {
                if (_lastRewardTime < poolStartTime) {
                    _lastRewardTime = poolStartTime;
                }
            }
        } else {
            // chef is cooking
            if (_lastRewardTime == 0 || _lastRewardTime < block.timestamp) {
                _lastRewardTime = block.timestamp;
            }
        }

        bool _isStarted =
        (_lastRewardTime <= poolStartTime) ||
        (_lastRewardTime <= block.timestamp);
        poolInfo.push(PoolInfo({
        isNftPool : _isNftPool,
        token : _token,
        nft : _nft,
        depositFee: _depFee,
        allocPoint : _allocPoint,
        lastRewardTime : _lastRewardTime,
        accSmeltPerShare : 0,
        isStarted : _isStarted,
        givesReceipts: _givesReceipts,
        receiptToken: _receiptToken
        }));
        if (_isStarted) {
            totalAllocPoint = totalAllocPoint + (_allocPoint);
        }
    }
    // Cannot change deposit fee to insure everyone pays same dep fees!!!!
    // Update the given pool's SMELT allocation point. Can only be called by operator.
    function set(uint256 _pid, uint256 _allocPoint) public onlyOperator {
        massUpdatePools();
        PoolInfo storage pool = poolInfo[_pid];

        if (pool.isStarted) {
            totalAllocPoint = totalAllocPoint - (pool.allocPoint) + (
                _allocPoint
            );
        }
        pool.allocPoint = _allocPoint;
    }


 function setOperator(address _operator) external onlyOwner
  {
        operator = _operator;
        emit OperatorTransferred(_operator);
  }

  function governanceAllocationAdjustment(
        uint256 _pid,
        uint256 _amount,
        address _teamMember
    ) external onlyOperator {
        PoolInfo storage pool = poolInfo[_pid];
        require (pool.token == stater , "team pool only");         //==================make sure this is TEAM POOL ONLY
        UserInfo storage user = userInfo[_pid][_teamMember];
        updatePool(_pid);
        uint256 _pending = user.amount * (pool.accSmeltPerShare) / (1e18) - (user.rewardDebt);
        if (_pending > 0) {
            safeSmeltTransfer(protocolFundAddress, _pending);
            emit RewardPaid(protocolFundAddress, _pending);
        }
        if (_amount < user.amount){
            uint256 cut = user.amount - (_amount);
            stater.safeTransfer(protocolFundAddress, cut);
        } else if(_amount > user.amount) {
            uint256 bonus = _amount - (user.amount);
            stater.safeTransferFrom(protocolFundAddress, address(this), bonus);
        }
        user.amount = _amount;
        user.rewardDebt = user.amount * (pool.accSmeltPerShare) / (1e18);
        emit TeamMemberAllocationAdjusted(_teamMember, _amount);
    }
// future updates ability through multisig owner function calls
  function moveRewardsToUpdatedContract(
        IERC20 _token,
        uint256 _amount,
        address _to
    ) external onlyOwner {
        require(address(_token) == address(smelt), "reward token only");
        _token.safeTransfer(_to, _amount);
    }
  function governanceRecoverUnsupported(
        IERC20 _token,
        uint256 _amount,
        address _to
    ) external onlyOperator {
           if (block.timestamp < poolEndTime + 30 days) {
            require(_token != smelt, "reward token");
            uint256 length = poolInfo.length;
            for (uint256 pid = 0; pid < length; ++pid) {
                PoolInfo storage pool = poolInfo[pid];
                require(_token != pool.token, "pool.token");
            }
        }
        _token.safeTransfer(_to, _amount);
    }
  function governanceRecoverUnsupportedNft(
        IERC721 _token,
        uint256[] calldata _tokenIds,
        address _to
    ) external onlyOperator {
           if (block.timestamp < poolEndTime + 30 days) {
            uint256 length = poolInfo.length;
            for (uint256 pid = 0; pid < length; ++pid) {
                PoolInfo storage pool = poolInfo[pid];
                require(_token != pool.nft, "pool.nft");
            }
        }
         if (_tokenIds.length > 0) {
            for (uint256 i = 0; i < _tokenIds.length; ++i) {
            PoolInfo storage pool = poolInfo[i];
            pool.nft.safeTransferFrom(address(this), _to, _tokenIds[i]);
            }
         }
    }
}

File 2 of 15 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) external returns (bool);

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);
}

File 3 of 15 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 4 of 15 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool _approved) external;

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes calldata data
    ) external;
}

File 5 of 15 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.0;

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
interface IERC721Receiver {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
     *
     * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

File 6 of 15 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 7 of 15 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;

        _;

        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
}

File 8 of 15 : IBasedReceipt.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

interface IBasedReceipt {
    function mint(address recipient, uint256 amount) external returns (bool);

    function burn(uint256 amount) external;

    function burnFrom(address from, uint256 amount) external;
   
}

File 9 of 15 : IGodFootPrint.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";



/**
 * @dev Interface of the OFT standard
 */
interface IGodFootPrint {
    /**
     * @dev send `_amount` amount of token to (`_dstChainId`, `_toAddress`)
     * `_toAddress` can be any size depending on the `dstChainId`.
     * `_amount` the quantity of tokens in wei
     * `_refundAddress` the address LayerZero refunds if too much message fee is sent
     * `_zroPaymentAddress` set to address(0x0) if not paying in ZRO (LayerZero Token)
     * `_adapterParams` is a flexible bytes array to indicate messaging adapter services
     */
    function send(uint16 _dstChainId, bytes calldata _toAddress, uint _amount, address payable _refundAddress, address _zroPaymentAddress, bytes calldata _adapterParams) external payable;

    /**
     * @dev send `_amount` amount of token to (`_dstChainId`, `_toAddress`) from `_from`
     * `_dstChainId` the destination chain identifier
     * `_toAddress` can be any size depending on the `dstChainId`.
     * `_amount` the quantity of tokens in wei
     * `_refundAddress` the address LayerZero refunds if too much message fee is sent
     * `_zroPaymentAddress` set to address(0x0) if not paying in ZRO (LayerZero Token)
     * `_adapterParams` is a flexible bytes array to indicate messaging adapter services
     */
    function sendFrom(address _from, uint16 _dstChainId, bytes calldata _toAddress, uint _amount, address payable _refundAddress, address _zroPaymentAddress, bytes calldata _adapterParams) external payable;

    /**
     * @dev returns the type of OFT
     */
    function getType() external returns (uint);

    function mint(address recipient_, uint256 amount_) external returns (bool);
   

    /**
     * @dev returns the total amount of tokens across all chains
     */
    function getGlobalSupply() external returns (uint);

    /**
     * @dev Emitted when `_amount` tokens are moved from the `_sender` to (`_dstChainId`, `_toAddress`)
     * `_nonce` is the outbound nonce
     */
    event SendToChain(address indexed _sender, uint16 indexed _dstChainId, bytes indexed _toAddress, uint _amount, uint64 _nonce);

    /**
     * @dev Emitted when `_amount` tokens are received from `_srcChainId` into the `_toAddress` on the local chain.
     `_nonce` is the inbound nonce.
     */
    event ReceiveFromChain(uint16 _srcChainId, address _toAddress, uint _amount, uint64 _nonce);
}

File 10 of 15 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 11 of 15 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

File 12 of 15 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

File 13 of 15 : ERC20Burnable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/extensions/ERC20Burnable.sol)

pragma solidity ^0.8.0;

import "../ERC20.sol";
import "../../../utils/Context.sol";

/**
 * @dev Extension of {ERC20} that allows token holders to destroy both their own
 * tokens and those that they have an allowance for, in a way that can be
 * recognized off-chain (via event analysis).
 */
abstract contract ERC20Burnable is Context, ERC20 {
    /**
     * @dev Destroys `amount` tokens from the caller.
     *
     * See {ERC20-_burn}.
     */
    function burn(uint256 amount) public virtual {
        _burn(_msgSender(), amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, deducting from the caller's
     * allowance.
     *
     * See {ERC20-_burn} and {ERC20-allowance}.
     *
     * Requirements:
     *
     * - the caller must have allowance for ``accounts``'s tokens of at least
     * `amount`.
     */
    function burnFrom(address account, uint256 amount) public virtual {
        _spendAllowance(account, _msgSender(), amount);
        _burn(account, amount);
    }
}

File 14 of 15 : ERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/ERC20.sol)

pragma solidity ^0.8.0;

import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/Context.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin Contracts guidelines: functions revert
 * instead returning `false` on failure. This behavior is nonetheless
 * conventional and does not conflict with the expectations of ERC20
 * applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20, IERC20Metadata {
    mapping(address => uint256) private _balances;

    mapping(address => mapping(address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * The default value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5.05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the value {ERC20} uses, unless this function is
     * overridden;
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual override returns (uint8) {
        return 18;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address to, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _transfer(owner, to, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
     * `transferFrom`. This is semantically equivalent to an infinite approval.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * NOTE: Does not update the allowance if the current allowance
     * is the maximum `uint256`.
     *
     * Requirements:
     *
     * - `from` and `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     * - the caller must have allowance for ``from``'s tokens of at least
     * `amount`.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) public virtual override returns (bool) {
        address spender = _msgSender();
        _spendAllowance(from, spender, amount);
        _transfer(from, to, amount);
        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, _allowances[owner][spender] + addedValue);
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        address owner = _msgSender();
        uint256 currentAllowance = _allowances[owner][spender];
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(owner, spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    /**
     * @dev Moves `amount` of tokens from `sender` to `recipient`.
     *
     * This internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     */
    function _transfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {
        require(from != address(0), "ERC20: transfer from the zero address");
        require(to != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(from, to, amount);

        uint256 fromBalance = _balances[from];
        require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[from] = fromBalance - amount;
        }
        _balances[to] += amount;

        emit Transfer(from, to, amount);

        _afterTokenTransfer(from, to, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply += amount;
        _balances[account] += amount;
        emit Transfer(address(0), account, amount);

        _afterTokenTransfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
        unchecked {
            _balances[account] = accountBalance - amount;
        }
        _totalSupply -= amount;

        emit Transfer(account, address(0), amount);

        _afterTokenTransfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @dev Spend `amount` form the allowance of `owner` toward `spender`.
     *
     * Does not update the allowance amount in case of infinite allowance.
     * Revert if not enough allowance is available.
     *
     * Might emit an {Approval} event.
     */
    function _spendAllowance(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        uint256 currentAllowance = allowance(owner, spender);
        if (currentAllowance != type(uint256).max) {
            require(currentAllowance >= amount, "ERC20: insufficient allowance");
            unchecked {
                _approve(owner, spender, currentAllowance - amount);
            }
        }
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * has been transferred to `to`.
     * - when `from` is zero, `amount` tokens have been minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens have been burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}
}

File 15 of 15 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the symbol of the token.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 50
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_smelt","type":"address"},{"internalType":"address","name":"_stater","type":"address"},{"internalType":"address","name":"_protocolFund","type":"address"},{"internalType":"uint256","name":"_poolStartTime","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"EmergencyWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"EmergencyWithdrawNFT","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newOperator","type":"address"}],"name":"OperatorTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RewardPaid","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_tokenIds","type":"uint256"}],"name":"StakedNft","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"member","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TeamMemberAllocationAdjusted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_tokenIds","type":"uint256"}],"name":"UnstakedNft","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"StakeNft","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"UnstakeNft","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_isNftPool","type":"bool"},{"internalType":"contract IERC721","name":"_nft","type":"address"},{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"uint256","name":"_depFee","type":"uint256"},{"internalType":"uint256","name":"_allocPoint","type":"uint256"},{"internalType":"uint256","name":"_lastRewardTime","type":"uint256"},{"internalType":"bool","name":"_withUpdate","type":"bool"},{"internalType":"bool","name":"_givesReceipts","type":"bool"},{"internalType":"address","name":"_receiptToken","type":"address"}],"name":"add","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"claimRewardNft","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"emergencyUnstakeNFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_fromTime","type":"uint256"},{"internalType":"uint256","name":"_toTime","type":"uint256"}],"name":"getGeneratedReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getStakedNfts","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_teamMember","type":"address"}],"name":"governanceAllocationAdjustment","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"governanceRecoverUnsupported","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC721","name":"_token","type":"address"},{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"},{"internalType":"address","name":"_to","type":"address"}],"name":"governanceRecoverUnsupportedNft","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"massUpdatePools","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"moveRewardsToUpdatedContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"operator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"pendingSMELT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"pendingSMELTNft","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolInfo","outputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"contract IERC721","name":"nft","type":"address"},{"internalType":"uint256","name":"depositFee","type":"uint256"},{"internalType":"uint256","name":"allocPoint","type":"uint256"},{"internalType":"uint256","name":"lastRewardTime","type":"uint256"},{"internalType":"uint256","name":"accSmeltPerShare","type":"uint256"},{"internalType":"bool","name":"isStarted","type":"bool"},{"internalType":"bool","name":"isNftPool","type":"bool"},{"internalType":"bool","name":"givesReceipts","type":"bool"},{"internalType":"address","name":"receiptToken","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_allocPoint","type":"uint256"}],"name":"set","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_operator","type":"address"}],"name":"setOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"stakedTokens","outputs":[{"internalType":"uint256","name":"totalNftsStaked","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"stakerAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAllocPoint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"updatePool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"userInfo","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"rewardDebt","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

61012060405260006007553480156200001757600080fd5b50604051620041d4380380620041d48339810160408190526200003a916200021d565b6200004533620001b0565b600180554281116200008c5760405162461bcd60e51b815260040162000083906020808252600490820152636c61746560e01b604082015260600190565b60405180910390fd5b6001600160a01b038416620000d35760405162461bcd60e51b81526020600482015260156024820152600080516020620041b4833981519152604482015260640162000083565b6001600160a01b0383166200011a5760405162461bcd60e51b81526020600482015260156024820152600080516020620041b4833981519152604482015260640162000083565b6001600160a01b038216620001615760405162461bcd60e51b81526020600482015260156024820152600080516020620041b4833981519152604482015260640162000083565b6001600160a01b0380851660805283811660a05282166101005260c08190526200019063039ada00826200026f565b60e0525050600280546001600160a01b0319163317905550620002969050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b03811681146200021857600080fd5b919050565b600080600080608085870312156200023457600080fd5b6200023f8562000200565b93506200024f6020860162000200565b92506200025f6040860162000200565b6060959095015193969295505050565b600082198211156200029157634e487b7160e01b600052601160045260246000fd5b500190565b60805160a05160c05160e05161010051613e386200037c600039600081816121350152818161215c015281816121f60152818161226a0152612be901526000818161075b01528181610782015281816108040152818161084701528181610ff10152612d5a0152600081816107b1015281816107e30152818161086d0152818161089c015281816108ce015281816111e401528181611211015281816112390152818161126101526112a101526000818161205b015281816121d4015261224801526000818161102201528181611f920152818161301501526130f50152613e386000f3fe608060405234801561001057600080fd5b506004361061017a5760003560e01c80638da5cb5b116100d45780638da5cb5b1461033a57806393f1a40b146103425780639406704514610389578063a01b9318146103b2578063a07c6fe1146103c5578063a5b39cfb146103d8578063b0bc5cf1146103fb578063b2ef11261461040e578063b3ab15fb14610421578063c4cdbf6814610434578063ccc61a2614610447578063e2bbb1581461045a578063f294fc951461046d578063f2fde38b14610480578063feece0ab1461049357600080fd5b8063018cb0421461017f578063150b7a02146101945780631526fe27146101e957806317caf6f11461025b5780631ab06ee514610272578063231f0c6a14610285578063441a3e701461029857806351eb05a6146102ab5780635312ea8e146102be57806354575af4146102d1578063570ca735146102e45780635a9f4df414610304578063630b5ba114610317578063715018a61461031f57806373aea40814610327575b600080fd5b61019261018d366004613646565b6104b3565b005b6101cb6101a236600461368a565b7f150b7a023d4804d13e8c85fb27262cb750cf6ba9f9dd3bb30d90f482ceeb4b1f949350505050565b6040516001600160e01b031990911681526020015b60405180910390f35b6101fc6101f7366004613646565b61063c565b604080516001600160a01b039b8c168152998b1660208b01528901979097526060880195909552608087019390935260a0860191909152151560c0850152151560e08401521515610100830152909116610120820152610140016101e0565b61026460075481565b6040519081526020016101e0565b610192610280366004613769565b6106b9565b610264610293366004613769565b610748565b6101926102a6366004613769565b61090b565b6101926102b9366004613646565b610c21565b6101926102cc366004613646565b610de7565b6101926102df36600461378b565b610fc2565b6002546102f7906001600160a01b031681565b6040516101e091906137cd565b6101926103123660046137ef565b61113e565b61019261149a565b6101926114c1565b610264610335366004613890565b6114fc565b6102f7611680565b610374610350366004613890565b60046020908152600092835260408084209091529082529020805460019091015482565b604080519283526020830191909152016101e0565b6102f7610397366004613646565b6005602052600090815260409020546001600160a01b031681565b6101926103c036600461390b565b61168f565b6101926103d3366004613646565b611b4e565b6102646103e6366004613956565b60066020526000908152604090206002015481565b61019261040936600461378b565b611f61565b61019261041c366004613973565b612005565b61019261042f366004613956565b612303565b610264610442366004613890565b61237c565b61019261045536600461390b565b6123f4565b610192610468366004613769565b612900565b61019261047b3660046139a1565b612d2b565b61019261048e366004613956565b612ef0565b6104a66104a1366004613956565b612f90565b6040516101e09190613a08565b600260015414156104df5760405162461bcd60e51b81526004016104d690613a4c565b60405180910390fd5b6002600155600380543391600091849081106104fd576104fd613a83565b906000526020600020906007020190508060060160019054906101000a900460ff16151560011515146105635760405162461bcd60e51b815260206004820152600e60248201526d0706f6f6c20666f722045524332360941b60448201526064016104d6565b60008381526004602090815260408083206001600160a01b0386168452909152902061058e84610c21565b60008160010154670de0b6b3a7640000846005015484600001546105b29190613aaf565b6105bc9190613ace565b6105c69190613af0565b9050801561060a576105d88482612ffc565b836001600160a01b0316600080516020613de38339815191528260405161060191815260200190565b60405180910390a25b60058301548254670de0b6b3a76400009161062491613aaf565b61062e9190613ace565b600192830155508055505050565b6003818154811061064c57600080fd5b600091825260209091206007909102018054600182015460028301546003840154600485015460058601546006909601546001600160a01b039586169750938516959294919390929160ff808316926101008104821692620100008204909216916301000000909104168a565b6002546001600160a01b031633146106e35760405162461bcd60e51b81526004016104d690613b07565b6106eb61149a565b60006003838154811061070057610700613a83565b60009182526020909120600790910201600681015490915060ff1615610741578181600301546007546107339190613af0565b61073d9190613b3e565b6007555b6003015550565b600081831061075957506000610905565b7f0000000000000000000000000000000000000000000000000000000000000000821061086b577f000000000000000000000000000000000000000000000000000000000000000083106107af57506000610905565b7f0000000000000000000000000000000000000000000000000000000000000000831161083957660415eb3d7de0006108287f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000613af0565b6108329190613aaf565b9050610905565b660415eb3d7de000610828847f0000000000000000000000000000000000000000000000000000000000000000613af0565b7f0000000000000000000000000000000000000000000000000000000000000000821161089a57506000610905565b7f000000000000000000000000000000000000000000000000000000000000000083116108f357660415eb3d7de0006108287f000000000000000000000000000000000000000000000000000000000000000084613af0565b660415eb3d7de0006108288484613af0565b92915050565b6002600154141561092e5760405162461bcd60e51b81526004016104d690613a4c565b60026001556003805433916000918590811061094c5761094c613a83565b600091825260209091206007909102016006810154909150610100900460ff16156109895760405162461bcd60e51b81526004016104d690613b56565b60008481526004602090815260408083206001600160a01b0386168452909152902080548411156109cc5760405162461bcd60e51b81526004016104d690613b83565b6109d585610c21565b60008160010154670de0b6b3a7640000846005015484600001546109f99190613aaf565b610a039190613ace565b610a0d9190613af0565b90508015610a5157610a1f8482612ffc565b836001600160a01b0316600080516020613de383398151915282604051610a4891815260200190565b60405180910390a25b8415610bac578154610a64908690613af0565b8255600683015462010000900460ff16151560011415610b965760068301546040516370a0823160e01b815263010000009091046001600160a01b031690869082906370a0823190610aba9033906004016137cd565b60206040518083038186803b158015610ad257600080fd5b505afa158015610ae6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b0a9190613baf565b1015610b285760405162461bcd60e51b81526004016104d690613bc8565b600684015460405163079cc67960e41b815263010000009091046001600160a01b0316906379cc679090610b629033908a90600401613bff565b600060405180830381600087803b158015610b7c57600080fd5b505af1158015610b90573d6000803e3d6000fd5b50505050505b8254610bac906001600160a01b03168587613118565b60058301548254670de0b6b3a764000091610bc691613aaf565b610bd09190613ace565b600183015560405185815286906001600160a01b038616907ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b5689060200160405180910390a350506001805550505050565b600060038281548110610c3657610c36613a83565b9060005260206000209060070201905080600401544211610c55575050565b600681015460ff61010090910416151560011415610db35760018101546040516370a0823160e01b81526000916001600160a01b0316906370a0823190610ca09030906004016137cd565b60206040518083038186803b158015610cb857600080fd5b505afa158015610ccc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cf09190613baf565b905080610d0257504260049091015550565b600682015460ff16610d335760068201805460ff191660011790556003820154600754610d2f9190613b3e565b6007555b60075415610da8576000610d4b836004015442610748565b90506000836003015482610d5f9190613aaf565b9050600060075482610d719190613ace565b905083610d8682670de0b6b3a7640000613aaf565b610d909190613ace565b8560050154610d9f9190613b3e565b60058601555050505b504260048201555050565b80546040516370a0823160e01b81526000916001600160a01b0316906370a0823190610ca09030906004016137cd565b5050565b600060038281548110610dfc57610dfc613a83565b60009182526020808320858452600482526040808520338652909252908320600792909202016006810180548354858555600180860196909655915492955092936001600160a01b0363010000009094049390931692909162010000900460ff1615151415610f6e576040516370a0823160e01b815281906001600160a01b038416906370a0823190610e939033906004016137cd565b60206040518083038186803b158015610eab57600080fd5b505afa158015610ebf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ee39190613baf565b1015610f015760405162461bcd60e51b81526004016104d690613bc8565b600684015460405163079cc67960e41b815263010000009091046001600160a01b0316906379cc679090610f3b9033908590600401613bff565b600060405180830381600087803b158015610f5557600080fd5b505af1158015610f69573d6000803e3d6000fd5b505050505b8354610f84906001600160a01b03163383613118565b604051818152859033907fbb757047c2b5f3974fe26b7c10f732e7bce710b0952a71082702781e62ae05959060200160405180910390a35050505050565b6002546001600160a01b03163314610fec5760405162461bcd60e51b81526004016104d690613b07565b6110197f000000000000000000000000000000000000000000000000000000000000000062278d00613b3e565b421015611125577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b031614156110915760405162461bcd60e51b815260206004820152600c60248201526b3932bbb0b932103a37b5b2b760a11b60448201526064016104d6565b60035460005b81811015611122576000600382815481106110b4576110b4613a83565b6000918252602090912060079091020180549091506001600160a01b03878116911614156111115760405162461bcd60e51b815260206004820152600a6024820152693837b7b6173a37b5b2b760b11b60448201526064016104d6565b5061111b81613c18565b9050611097565b50505b6111396001600160a01b0384168284613118565b505050565b6002546001600160a01b031633146111685760405162461bcd60e51b81526004016104d690613b07565b61271086106111aa5760405162461bcd60e51b815260206004820152600e60248201526d63616e74206265203e203130302560901b60448201526064016104d6565b88156111c257600096506111bd8861316e565b6111d4565b886111d457600097506111d4876131e4565b82156111e2576111e261149a565b7f00000000000000000000000000000000000000000000000000000000000000004210156112885783611237577f0000000000000000000000000000000000000000000000000000000000000000935061129d565b7f0000000000000000000000000000000000000000000000000000000000000000841015611283577f000000000000000000000000000000000000000000000000000000000000000093505b61129d565b83158061129457504284105b1561129d574293505b60007f0000000000000000000000000000000000000000000000000000000000000000851115806112ce5750428511155b905060036040518061014001604052808a6001600160a01b031681526020018b6001600160a01b031681526020018981526020018881526020018781526020016000815260200183151581526020018c151581526020018515158152602001846001600160a01b0316815250908060018154018082558091505060019003906000526020600020906007020160009091909190915060008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060408201518160020155606082015181600301556080820151816004015560a0820151816005015560c08201518160060160006101000a81548160ff02191690831515021790555060e08201518160060160016101000a81548160ff0219169083151502179055506101008201518160060160026101000a81548160ff0219169083151502179055506101208201518160060160036101000a8154816001600160a01b0302191690836001600160a01b031602179055505050801561148e578560075461148a9190613b3e565b6007555b50505050505050505050565b60035460005b81811015610de3576114b181610c21565b6114ba81613c18565b90506114a0565b336114ca611680565b6001600160a01b0316146114f05760405162461bcd60e51b81526004016104d690613c33565b6114fa6000613257565b565b6000806003848154811061151257611512613a83565b60009182526020808320878452600480835260408086206001600160a01b03808b16885294528086206005600790960290930194850154600186015491516370a0823160e01b815295975092959294929316916370a0823191611577913091016137cd565b60206040518083038186803b15801561158f57600080fd5b505afa1580156115a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115c79190613baf565b90508360040154421180156115db57508015155b156116455760006115f0856004015442610748565b905060008560030154826116049190613aaf565b90506000600754826116169190613ace565b90508361162b82670de0b6b3a7640000613aaf565b6116359190613ace565b61163f9086613b3e565b94505050505b60018301548354670de0b6b3a764000090611661908590613aaf565b61166b9190613ace565b6116759190613af0565b979650505050505050565b6000546001600160a01b031690565b600260015414156116b25760405162461bcd60e51b81526004016104d690613a4c565b6002600155600380543391600091869081106116d0576116d0613a83565b906000526020600020906007020190508060060160019054906101000a900460ff16151560011515146117155760405162461bcd60e51b81526004016104d690613c68565b60008581526004602090815260408083206001600160a01b0386168452909152902061174086610c21565b80548411156117615760405162461bcd60e51b81526004016104d690613b83565b60008160010154670de0b6b3a7640000846005015484600001546117859190613aaf565b61178f9190613ace565b6117999190613af0565b905080156117dd576117ab8482612ffc565b836001600160a01b0316600080516020613de3833981519152826040516117d491815260200190565b60405180910390a25b8415611b1a5760005b858110156119ca57846001600160a01b03166005600089898581811061180e5761180e613a83565b60209081029290920135835250810191909152604001600020546001600160a01b03161461184e5760405162461bcd60e51b81526004016104d690613c8e565b6001600160a01b038516600090815260066020526040812061189d918791600101908a8a8681811061188257611882613a83565b905060200201358152602001908152602001600020546132a7565b6000600560008989858181106118b5576118b5613a83565b6020908102929092013583525081019190915260400160002080546001600160a01b0319166001600160a01b039283161790556001850154166342842e0e30878a8a8681811061190757611907613a83565b905060200201356040518463ffffffff1660e01b815260040161192c93929190613cbc565b600060405180830381600087803b15801561194657600080fd5b505af115801561195a573d6000803e3d6000fd5b5050505087856001600160a01b03167f46390c98202d07ccea0f7e324248fc8132ca146857642537eb71fb0708982e7889898581811061199c5761199c613a83565b905060200201356040516119b291815260200190565b60405180910390a36119c381613c18565b90506117e6565b5081546119d8908690613af0565b8255600683015462010000900460ff16151560011415611b1a5760068301546040516370a0823160e01b815263010000009091046001600160a01b031690869082906370a0823190611a2e9089906004016137cd565b60206040518083038186803b158015611a4657600080fd5b505afa158015611a5a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a7e9190613baf565b1015611a9c5760405162461bcd60e51b81526004016104d690613bc8565b6006840154630100000090046001600160a01b03166379cc679086611ac989670de0b6b3a7640000613aaf565b6040518363ffffffff1660e01b8152600401611ae6929190613bff565b600060405180830381600087803b158015611b0057600080fd5b505af1158015611b14573d6000803e3d6000fd5b50505050505b60058301548254670de0b6b3a764000091611b3491613aaf565b611b3e9190613ace565b6001928301555080555050505050565b600060038281548110611b6357611b63613a83565b6000918252602090912060079091020160068101549091503390630100000081046001600160a01b031690600161010090910460ff16151514611bb85760405162461bcd60e51b81526004016104d690613c68565b60008481526004602090815260408083206001600160a01b03861684528252808320600683528184208054835181860281018601909452808452919493909190830182828015611c2757602002820191906000526020600020905b815481526020019060010190808311611c13575b50506000808755600187018190559394505050505b8151811015611dd357846001600160a01b031660056000848481518110611c6557611c65613a83565b6020908102919091018101518252810191909152604001600020546001600160a01b031614611ca65760405162461bcd60e51b81526004016104d690613c8e565b6001600160a01b03851660009081526006602052604081208351611cf892889260010191869086908110611cdc57611cdc613a83565b60200260200101518152602001908152602001600020546132a7565b600060056000848481518110611d1057611d10613a83565b602090810291909101810151825281019190915260400160002080546001600160a01b0319166001600160a01b03928316179055600187015483519116906342842e0e9030908890869086908110611d6a57611d6a613a83565b60200260200101516040518463ffffffff1660e01b8152600401611d9093929190613cbc565b600060405180830381600087803b158015611daa57600080fd5b505af1158015611dbe573d6000803e3d6000fd5b5050505080611dcc90613c18565b9050611c3c565b50600685015462010000900460ff16151560011415611f145780516040516370a0823160e01b81526001600160a01b038516906370a0823190611e1a9088906004016137cd565b60206040518083038186803b158015611e3257600080fd5b505afa158015611e46573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e6a9190613baf565b1015611e885760405162461bcd60e51b81526004016104d690613bc8565b8460060160039054906101000a90046001600160a01b03166001600160a01b03166379cc6790858351670de0b6b3a7640000611ec49190613aaf565b6040518363ffffffff1660e01b8152600401611ee1929190613bff565b600060405180830381600087803b158015611efb57600080fd5b505af1158015611f0f573d6000803e3d6000fd5b505050505b85336001600160a01b03167f7d1311274556b75a7f44e72f2617bfeca6a6faaf3a764078ecdd93fe806a5c8a8351604051611f5191815260200190565b60405180910390a3505050505050565b33611f6a611680565b6001600160a01b031614611f905760405162461bcd60e51b81526004016104d690613c33565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b0316146111255760405162461bcd60e51b815260206004820152601160248201527072657761726420746f6b656e206f6e6c7960781b60448201526064016104d6565b6002546001600160a01b0316331461202f5760405162461bcd60e51b81526004016104d690613b07565b60006003848154811061204457612044613a83565b6000918252602090912060079091020180549091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b039081169116146120c55760405162461bcd60e51b815260206004820152600e60248201526d7465616d20706f6f6c206f6e6c7960901b60448201526064016104d6565b60008481526004602090815260408083206001600160a01b038616845290915290206120f085610c21565b60008160010154670de0b6b3a7640000846005015484600001546121149190613aaf565b61211e9190613ace565b6121289190613af0565b905080156121ac5761215a7f000000000000000000000000000000000000000000000000000000000000000082612ffc565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316600080516020613de3833981519152826040516121a391815260200190565b60405180910390a25b81548510156122215781546000906121c5908790613af0565b905061221b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000167f000000000000000000000000000000000000000000000000000000000000000083613118565b50612292565b81548511156122925781546000906122399087613af0565b90506122906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000167f000000000000000000000000000000000000000000000000000000000000000030846133e0565b505b8482556005830154670de0b6b3a7640000906122ae9087613aaf565b6122b89190613ace565b60018301556040518581526001600160a01b038516907f6db053d439fb609663f6c71cadd15ab9085c2c0b01ef1490335143035f46abf39060200160405180910390a2505050505050565b3361230c611680565b6001600160a01b0316146123325760405162461bcd60e51b81526004016104d690613c33565b600280546001600160a01b0319166001600160a01b0383169081179091556040517fd9ec371c83643af6346f7cf8c691b485a6bb6fc53044884640999e91268c00f890600090a250565b6000806003848154811061239257612392613a83565b60009182526020808320878452600480835260408086206001600160a01b03808b16885294528086206005600790960290930194850154855491516370a0823160e01b815295975092959294929316916370a0823191611577913091016137cd565b600260015414156124175760405162461bcd60e51b81526004016104d690613a4c565b60026001556003805433916000918690811061243557612435613a83565b906000526020600020906007020190508060060160019054906101000a900460ff161515600115151461247a5760405162461bcd60e51b81526004016104d690613b56565b60008581526004602090815260408083206001600160a01b038616845290915290206124a586610c21565b80541561252a5760008160010154670de0b6b3a7640000846005015484600001546124d09190613aaf565b6124da9190613ace565b6124e49190613af0565b90508015612528576124f68482612ffc565b836001600160a01b0316600080516020613de38339815191528260405161251f91815260200190565b60405180910390a25b505b83156128cd5760005b848110156128075760018301546001600160a01b038086169116636352211e88888581811061256457612564613a83565b905060200201356040518263ffffffff1660e01b815260040161258991815260200190565b60206040518083038186803b1580156125a157600080fd5b505afa1580156125b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125d99190613ce0565b6001600160a01b0316146126245760405162461bcd60e51b81526020600482015260126024820152713737ba1037bbb732b91037b3103a37b5b2b760711b60448201526064016104d6565b60018301546001600160a01b03166342842e0e853089898681811061264b5761264b613a83565b905060200201356040518463ffffffff1660e01b815260040161267093929190613cbc565b600060405180830381600087803b15801561268a57600080fd5b505af115801561269e573d6000803e3d6000fd5b5050505083600560008888858181106126b9576126b9613a83565b60209081029290920135835250818101929092526040908101600090812080546001600160a01b0319166001600160a01b0395861617905592871683526006909152902086868381811061270f5761270f613a83565b83546001818101865560009586526020808720938102959095013592909101919091556001600160a01b03881684526006909252506040909120546127549190613af0565b6001600160a01b03851660009081526006602052604081206001019088888581811061278257612782613a83565b9050602002013581526020019081526020016000208190555086846001600160a01b03167fcd48031a9eff1fe010946746d05ca7a709a50e4340e6f4808f0cd70871f58d848888858181106127d9576127d9613a83565b905060200201356040516127ef91815260200190565b60405180910390a361280081613c18565b9050612533565b508054612815908590613b3e565b8155600682015462010000900460ff161515600114156128cd576006820154630100000090046001600160a01b03166340c10f198461285c87670de0b6b3a7640000613aaf565b6040518363ffffffff1660e01b8152600401612879929190613bff565b602060405180830381600087803b15801561289357600080fd5b505af11580156128a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128cb9190613cfd565b505b60058201548154670de0b6b3a7640000916128e791613aaf565b6128f19190613ace565b60019182015580555050505050565b600260015414156129235760405162461bcd60e51b81526004016104d690613a4c565b60026001556003805433916000918590811061294157612941613a83565b600091825260209091206007909102016006810154909150610100900460ff161561297e5760405162461bcd60e51b81526004016104d690613b56565b60008481526004602090815260408083206001600160a01b038616845290915290206129a985610c21565b805415612a2e5760008160010154670de0b6b3a7640000846005015484600001546129d49190613aaf565b6129de9190613ace565b6129e89190613af0565b90508015612a2c576129fa8482612ffc565b836001600160a01b0316600080516020613de383398151915282604051612a2391815260200190565b60405180910390a25b505b8315612cb75781546040516370a0823160e01b81526000916001600160a01b0316906370a0823190612a649030906004016137cd565b60206040518083038186803b158015612a7c57600080fd5b505afa158015612a90573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ab49190613baf565b8354909150612ace906001600160a01b03168530886133e0565b612ad88582613b3e565b83546040516370a0823160e01b81526001600160a01b03909116906370a0823190612b079030906004016137cd565b60206040518083038186803b158015612b1f57600080fd5b505afa158015612b33573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b579190613baf565b14612b9f5760405162461bcd60e51b815260206004820152601860248201527731b432b1b59034b3103a30bc1037b7103a3930b739b332b960411b60448201526064016104d6565b6000612710846002015487612bb49190613aaf565b612bbe9190613ace565b9050612bca8187613af0565b8354612bd69190613b3e565b83558354612c0e906001600160a01b03167f000000000000000000000000000000000000000000000000000000000000000083613118565b600684015462010000900460ff16151560011415612cb45760068401546040516340c10f1960e01b815263010000009091046001600160a01b0316906340c10f1990612c609088908a90600401613bff565b602060405180830381600087803b158015612c7a57600080fd5b505af1158015612c8e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612cb29190613cfd565b505b50505b60058201548154670de0b6b3a764000091612cd191613aaf565b612cdb9190613ace565b600182015560405184815285906001600160a01b038516907f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a159060200160405180910390a3505060018055505050565b6002546001600160a01b03163314612d555760405162461bcd60e51b81526004016104d690613b07565b612d827f000000000000000000000000000000000000000000000000000000000000000062278d00613b3e565b421015612e1f5760035460005b81811015612e1c57600060038281548110612dac57612dac613a83565b600091825260209091206001600790920201908101549091506001600160a01b0388811691161415612e0b5760405162461bcd60e51b81526020600482015260086024820152671c1bdbdb0b9b999d60c21b60448201526064016104d6565b50612e1581613c18565b9050612d8f565b50505b8115612eea5760005b82811015612ee857600060038281548110612e4557612e45613a83565b6000918252602090912060079091020160018101549091506001600160a01b03166342842e0e3085888887818110612e7f57612e7f613a83565b905060200201356040518463ffffffff1660e01b8152600401612ea493929190613cbc565b600060405180830381600087803b158015612ebe57600080fd5b505af1158015612ed2573d6000803e3d6000fd5b505050505080612ee190613c18565b9050612e28565b505b50505050565b33612ef9611680565b6001600160a01b031614612f1f5760405162461bcd60e51b81526004016104d690613c33565b6001600160a01b038116612f845760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104d6565b612f8d81613257565b50565b6001600160a01b038116600090815260066020908152604091829020805483518184028101840190945280845260609392830182828015612ff057602002820191906000526020600020905b815481526020019060010190808311612fdc575b50505050509050919050565b6040516370a0823160e01b815281906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a082319061304a9030906004016137cd565b60206040518083038186803b15801561306257600080fd5b505afa158015613076573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061309a9190613baf565b10156130e85760405162461bcd60e51b815260206004820152601c60248201527f6e6f7420656e6f75676820736d656c7420696e20636f6e74726163740000000060448201526064016104d6565b610de36001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001683835b6111398363a9059cbb60e01b8484604051602401613137929190613bff565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152613401565b60035460005b8181101561113957826001600160a01b03166003828154811061319957613199613a83565b60009182526020909120600160079092020101546001600160a01b031614156131d45760405162461bcd60e51b81526004016104d690613d1a565b6131dd81613c18565b9050613174565b60035460005b8181101561113957826001600160a01b03166003828154811061320f5761320f613a83565b60009182526020909120600790910201546001600160a01b031614156132475760405162461bcd60e51b81526004016104d690613d1a565b61325081613c18565b90506131ea565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03821660009081526006602052604090205481106132cb57600080fd5b6001600160a01b0382166000908152600660205260408120805491839160018082019291906132fa9086613af0565b8154811061330a5761330a613a83565b600091825260208083209091015483528281019390935260409182018120939093556001600160a01b03861683526006909152902061334a600183613af0565b8154811061335a5761335a613a83565b60009182526020808320909101546001600160a01b03861683526006909152604090912080548490811061339057613390613a83565b60009182526020808320909101929092556001600160a01b03851681526006909152604090208054806133c5576133c5613d51565b60019003818190600052602060002001600090559055505050565b612eea846323b872dd60e01b85858560405160240161313793929190613cbc565b6000613456826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166134d39092919063ffffffff16565b80519091501561113957808060200190518101906134749190613cfd565b6111395760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016104d6565b60606134e284846000856134ec565b90505b9392505050565b60608247101561354d5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016104d6565b6001600160a01b0385163b6135a45760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016104d6565b600080866001600160a01b031685876040516135c09190613d93565b60006040518083038185875af1925050503d80600081146135fd576040519150601f19603f3d011682016040523d82523d6000602084013e613602565b606091505b50915091506116758282866060831561361c5750816134e5565b82511561362c5782518084602001fd5b8160405162461bcd60e51b81526004016104d69190613daf565b60006020828403121561365857600080fd5b5035919050565b6001600160a01b0381168114612f8d57600080fd5b634e487b7160e01b600052604160045260246000fd5b600080600080608085870312156136a057600080fd5b84356136ab8161365f565b935060208501356136bb8161365f565b92506040850135915060608501356001600160401b03808211156136de57600080fd5b818701915087601f8301126136f257600080fd5b81358181111561370457613704613674565b604051601f8201601f19908116603f0116810190838211818310171561372c5761372c613674565b816040528281528a602084870101111561374557600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b6000806040838503121561377c57600080fd5b50508035926020909101359150565b6000806000606084860312156137a057600080fd5b83356137ab8161365f565b92506020840135915060408401356137c28161365f565b809150509250925092565b6001600160a01b0391909116815260200190565b8015158114612f8d57600080fd5b60008060008060008060008060006101208a8c03121561380e57600080fd5b8935613819816137e1565b985060208a01356138298161365f565b975060408a01356138398161365f565b965060608a0135955060808a0135945060a08a0135935060c08a013561385e816137e1565b925060e08a013561386e816137e1565b91506101008a013561387f8161365f565b809150509295985092959850929598565b600080604083850312156138a357600080fd5b8235915060208301356138b58161365f565b809150509250929050565b60008083601f8401126138d257600080fd5b5081356001600160401b038111156138e957600080fd5b6020830191508360208260051b850101111561390457600080fd5b9250929050565b60008060006040848603121561392057600080fd5b8335925060208401356001600160401b0381111561393d57600080fd5b613949868287016138c0565b9497909650939450505050565b60006020828403121561396857600080fd5b81356134e58161365f565b60008060006060848603121561398857600080fd5b833592506020840135915060408401356137c28161365f565b600080600080606085870312156139b757600080fd5b84356139c28161365f565b935060208501356001600160401b038111156139dd57600080fd5b6139e9878288016138c0565b90945092505060408501356139fd8161365f565b939692955090935050565b6020808252825182820181905260009190848201906040850190845b81811015613a4057835183529284019291840191600101613a24565b50909695505050505050565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000816000190483118215151615613ac957613ac9613a99565b500290565b600082613aeb57634e487b7160e01b600052601260045260246000fd5b500490565b600082821015613b0257613b02613a99565b500390565b6020808252601d908201527f536d656c74526577617264506f6f6c3a206e6f74206f70657261746f72000000604082015260600190565b60008219821115613b5157613b51613a99565b500190565b602080825260139082015272506f6f6c206e6f7420666f722045524337323160681b604082015260600190565b6020808252601290820152711dda5d1a191c985dce881b9bdd0819dbdbd960721b604082015260600190565b600060208284031215613bc157600080fd5b5051919050565b6020808252601d908201527f7263707420746f6b656e20616d74203c20776974686472617720616d74000000604082015260600190565b6001600160a01b03929092168252602082015260400190565b6000600019821415613c2c57613c2c613a99565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252600c908201526b1b9bdd08139195081c1bdbdb60a21b604082015260600190565b6020808252601490820152736e6f74206465706f736974656420627920796f7560601b604082015260600190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b600060208284031215613cf257600080fd5b81516134e58161365f565b600060208284031215613d0f57600080fd5b81516134e5816137e1565b6020808252601f908201527f536d656c74526577617264506f6f6c3a206578697374696e6720706f6f6c3f00604082015260600190565b634e487b7160e01b600052603160045260246000fd5b60005b83811015613d82578181015183820152602001613d6a565b83811115612eea5750506000910152565b60008251613da5818460208701613d67565b9190910192915050565b6020815260008251806020840152613dce816040850160208701613d67565b601f01601f1916919091016040019291505056fee2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e0486a26469706673582212202eb334061da388b7b3e8f10aff8641dd96325810905f8d1a62ebf44dc5e470d564736f6c6343000809003363616e7420626520756e696e697469616c697a65640000000000000000000000000000000000000000000000141faa507855e56396eadbd25ec82656755cd61e0000000000000000000000005706d4d6694d22a11d98678db9d461eadbee7e410000000000000000000000000a10dad90b9c6fb8b87bff3857a4b012890c53a500000000000000000000000000000000000000000000000000000000636dbf4f

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000141faa507855e56396eadbd25ec82656755cd61e0000000000000000000000005706d4d6694d22a11d98678db9d461eadbee7e410000000000000000000000000a10dad90b9c6fb8b87bff3857a4b012890c53a500000000000000000000000000000000000000000000000000000000636dbf4f

-----Decoded View---------------
Arg [0] : _smelt (address): 0x141faa507855e56396eadbd25ec82656755cd61e
Arg [1] : _stater (address): 0x5706d4d6694d22a11d98678db9d461eadbee7e41
Arg [2] : _protocolFund (address): 0x0a10dad90b9c6fb8b87bff3857a4b012890c53a5
Arg [3] : _poolStartTime (uint256): 1668136783

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 000000000000000000000000141faa507855e56396eadbd25ec82656755cd61e
Arg [1] : 0000000000000000000000005706d4d6694d22a11d98678db9d461eadbee7e41
Arg [2] : 0000000000000000000000000a10dad90b9c6fb8b87bff3857a4b012890c53a5
Arg [3] : 00000000000000000000000000000000000000000000000000000000636dbf4f


Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Validator ID :
0 FTM

Amount Staked
0

Amount Delegated
0

Staking Total
0

Staking Start Epoch
0

Staking Start Time
0

Proof of Importance
0

Origination Score
0

Validation Score
0

Active
0

Online
0

Downtime
0 s
Address Amount claimed Rewards Created On Epoch Created On
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.