Contract 0xf0170366d0f9571c6d8959df97f1f038e7febad9

 
 
Txn Hash
Block
From
To
Value [Txn Fee]
0x3dcfb1dce2d5f1c7116f2fc8c6c3e0a4132d389d216832e10ce48aa79ca5cec482179122021-06-11 23:59:4842 days 21 hrs ago0xe0b6865d3afeb897d37760b2cec945949a27f52d IN  0xf0170366d0f9571c6d8959df97f1f038e7febad90 BNB0.001160765
0x341cd87a9252655122aeb93e6212198d5c0ee9ed1a6b6af6a801ae8470814e7982171532021-06-11 23:21:5142 days 22 hrs ago0x91ed096039aff8efa9864c22d5b616be3024b8d1 IN  0xf0170366d0f9571c6d8959df97f1f038e7febad90 BNB0.001160645
0x21e3956c1a3d599aa1cb130c04fa3361f37bc82686e08058e21cae397295bbf582169732021-06-11 23:12:5142 days 22 hrs ago0x8940d520ad6291558b73d2b66a617f5d04723f95 IN  0xf0170366d0f9571c6d8959df97f1f038e7febad90 BNB0.001160765
0xcb40ceb72fcb283aa2867d9d6298cfdc8d4d22cec04f07645ba3b30d706190f082161642021-06-11 22:32:2042 days 23 hrs ago0x79549b8f7e8a145b066971fb343b25b6a45a04be IN  0xf0170366d0f9571c6d8959df97f1f038e7febad90 BNB0.001181765
0x4152f76d5c62226c042bae531d5092c30e1ee0ee7a8e31dd678345f566a0a9a782161472021-06-11 22:31:2942 days 23 hrs ago0x79549b8f7e8a145b066971fb343b25b6a45a04be IN  0xf0170366d0f9571c6d8959df97f1f038e7febad90 BNB0.001181765
0x5b7fa7a0ece8adbaba2e53ea815d42d6ad99482410174f70f2a6e1bdb82f09ef82161252021-06-11 22:30:2342 days 23 hrs ago0x79549b8f7e8a145b066971fb343b25b6a45a04be IN  0xf0170366d0f9571c6d8959df97f1f038e7febad90 BNB0.001160765
0x61e69e520588dca3145208e7976ccf8e31f110e6de21bf39063fc8cc7430a8b482159212021-06-11 22:20:1142 days 23 hrs ago0xd75246a687d77072d726d96f07d5d6cc5310714d IN  0xf0170366d0f9571c6d8959df97f1f038e7febad90 BNB0.001181595
0x58d1c300cf8a350aae376fea6568d25f1c53c847e8f3284545437b8b512f589082159132021-06-11 22:19:4742 days 23 hrs ago0xd75246a687d77072d726d96f07d5d6cc5310714d IN  0xf0170366d0f9571c6d8959df97f1f038e7febad90 BNB0.00118171
0x551153f60bc556a094fd86e4f31131481dcf2c004d792fd894700b50dec76ff682159042021-06-11 22:19:2042 days 23 hrs ago0xd75246a687d77072d726d96f07d5d6cc5310714d IN  0xf0170366d0f9571c6d8959df97f1f038e7febad90 BNB0.00118171
0xbe4c78d67b8b05a31dc77b102e8a8a13d900d36a3c1ea098e405394e4d19b61f82158952021-06-11 22:18:5342 days 23 hrs ago0xd75246a687d77072d726d96f07d5d6cc5310714d IN  0xf0170366d0f9571c6d8959df97f1f038e7febad90 BNB0.001181715
0x144e03e693bb4bca6b793900605254332163730555ed84401d597c00a484fcd482158862021-06-11 22:18:2642 days 23 hrs ago0xd75246a687d77072d726d96f07d5d6cc5310714d IN  0xf0170366d0f9571c6d8959df97f1f038e7febad90 BNB0.00118171
0x8a98b84a87e5f877ddc408f32d0f0c684e112fc64a3a38749443dd7f09a90e7f82151432021-06-11 21:41:1743 days 14 mins ago0xfec58763fcd5df39dd78a454a8304f41209fd1b8 IN  0xf0170366d0f9571c6d8959df97f1f038e7febad90 BNB0.00110676
0xf6b97267647d40a61cbb7dcf3a9464ce9afec9c27a62d58e455b3dda0ce5799482149602021-06-11 21:32:0843 days 23 mins ago0x2fbfc7b89c861452a78b0072dfc8e87bfa09e833 IN  0xf0170366d0f9571c6d8959df97f1f038e7febad90 BNB0.001085715
0x6fdf2f76ebeb910015decc91cc58594530dc39566ac3af27497f35ec8a68fda482146632021-06-11 21:17:1443 days 38 mins ago0x1cf888ec811cc9909ece953b4f72660dae0ef4e7 IN  0xf0170366d0f9571c6d8959df97f1f038e7febad90 BNB0.001010645
0x47adfc545a6e04cb337567c3c7b663d00e1a1cc64a9efbd4bb515ba632a4cf9c82141552021-06-11 20:51:5043 days 1 hr ago0x490fe8b9aebfc2b4a8d2f38c7205c44fba0e299e IN  0xf0170366d0f9571c6d8959df97f1f038e7febad90 BNB0.001085765
0xb51709a4c9b76d48587ea06b4f9fd3a0c4c4354384471fd14b270484902620e582138662021-06-11 20:37:2343 days 1 hr ago0xdc138239e09ced146f8dac457fce3071ed7a3b0b IN  0xf0170366d0f9571c6d8959df97f1f038e7febad90 BNB0.001181765
0x12174576506aef192405db6faabd3cfbe3a0278ce3797c5e07f577a77e49b98782138202021-06-11 20:35:0543 days 1 hr ago0x4b45db682c5c4a50a7b4133a73d9d783f049eff2 IN  0xf0170366d0f9571c6d8959df97f1f038e7febad90 BNB0.00110676
0x54d09e5596a5328d20b07f970b5ead13f4f921f17f25afd06af3c3a179ba3b8882138122021-06-11 20:34:4143 days 1 hr ago0x4b45db682c5c4a50a7b4133a73d9d783f049eff2 IN  0xf0170366d0f9571c6d8959df97f1f038e7febad90 BNB0.00118176
0x493c2145ee19896b4c129e2513079c3fb8bc2a69c65b3180217c836473de3bf782138002021-06-11 20:34:0543 days 1 hr ago0x4b45db682c5c4a50a7b4133a73d9d783f049eff2 IN  0xf0170366d0f9571c6d8959df97f1f038e7febad90 BNB0.001181765
0x8309e6793e436d55e2fc92e71500a858bd833efa84909c815c610b623eb6604e82134432021-06-11 20:16:0843 days 1 hr ago0xf026ca7c69b2697964906d6dd510f54b8defc17d IN  0xf0170366d0f9571c6d8959df97f1f038e7febad90 BNB0.00118176
0x5c0a9d65a2159447ff377fa0940aafba5a43059927a9f046f9e3b967ba237ced82127552021-06-11 19:41:4043 days 2 hrs ago0x0be5353a3c3257d1164a8f0cb5b00fd81f4ef8a5 IN  0xf0170366d0f9571c6d8959df97f1f038e7febad90 BNB0.001160765
0x3eaf9a115e0185e6156ccf2dcbaa02c85a8956cb4048e8073117858df9e482ca82127302021-06-11 19:40:2543 days 2 hrs ago0xcc8b0d940f3c450593b06e92e74c96b7908765f1 IN  0xf0170366d0f9571c6d8959df97f1f038e7febad90 BNB0.00118176
0x9d3667ee263cc0c15f58c48190afa417ec3709ac07aba2dbb5c9b9fbbf9144ad82123452021-06-11 19:20:5643 days 2 hrs ago0xe3a738d9ae0db0d372b05af92643d763a4776025 IN  0xf0170366d0f9571c6d8959df97f1f038e7febad90 BNB0.001160715
0xb1eb41b8241e0da78b39262a3d82f6f386ab6c55b64c7f9646b7226a379df5b082120012021-06-11 19:03:4243 days 2 hrs ago0xdcdc9e0727f8cf5300b3f29b4f199377f52489eb IN  0xf0170366d0f9571c6d8959df97f1f038e7febad90 BNB0.00118171
0x6d8e6c6d57106f14b51e0209aecbae5d3477e00bc8e1326713c54388c380138382117372021-06-11 18:50:3043 days 3 hrs ago0x2fdd1bc8affb60bcd30b96f9838d1dedd6689998 IN  0xf0170366d0f9571c6d8959df97f1f038e7febad90 BNB0.001181645
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
MerlinMinter

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 1000 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 15 : MerlinMinter.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.4;

import '@openzeppelin/contracts/utils/math/Math.sol';
import './interface/ISCVNFT.sol';
import './interface/IMerlinFarm.sol';
import './Minter.sol';

/**
 * The contract mints a random SCV NFT.
 * Users need to pay with an ERC20 `token` with certain `amount`
 * Random number generated from block.timestamp will be used to
 * choose a NFT spec
 */
contract MerlinMinter is Minter {
    IMerlinFarm public farm0 = IMerlinFarm(0xfF1Da0430C3C4afd6005c511cd5E271BE04f4738);
    IMerlinFarm public farm1 = IMerlinFarm(0x3b87475ac293eeed0e8bC25713Eb8242A9497C3F);

    constructor() Minter(8e18, 0x4B2EC7CECC80a9a7CFd537aa84F66c7DB50ABfde) {
      baseSpecId = 32;
      cpShare = 3;
    }

    /**
     * @dev Return the amount of ACS which sender holds in the vault
     */
    function amountInVault(address addr)
        public
        view
        override
        returns (uint256)
    {
        return Math.max(farm0.balanceOf(addr), farm1.balanceOf(addr));
    }
}

File 2 of 15 : Math.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a >= b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow, so we distribute
        return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2);
    }
}

File 3 of 15 : ISCVNFT.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import '@openzeppelin/contracts/token/ERC721/IERC721.sol';

interface ISCVNFT is IERC721 {
    function mint(address to, uint256 specId) external;
}

File 4 of 15 : IMerlinFarm.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

interface IMerlinFarm {
    function balanceOf(address _user)
        external
        view
        returns (uint256);
}

File 5 of 15 : Minter.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.4;

import '@openzeppelin/contracts/access/AccessControl.sol';
import '@openzeppelin/contracts/utils/Context.sol';
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';
import '@openzeppelin/contracts/security/Pausable.sol';

import './interface/ISCVNFT.sol';

/**
 * The contract mints a random SCV NFT.
 * Users need to pay with an ERC20 `token` with certain `amount`
 * Random number generated from block.timestamp will be used to
 * choose a NFT spec
 */
abstract contract Minter is Context, AccessControl, Pausable {
    using SafeERC20 for IERC20;

    // Roles
    bytes32 public constant PAUSER_ROLE = keccak256('PAUSER_ROLE');
    bytes32 public constant OPERATOR_ROLE = keccak256('OPERATOR_ROLE');

    uint256 public requiredTokenAmount;
    address public payBy;
    uint256 public price;
    address public nftToken;

    // for transferring the sales of NFTs
    address public scvReward;
    // how to split, base = 10
    uint32 public cpShare;
    address public cpReward;
    uint256 public baseSpecId;

    constructor(uint256 requiredTokenAmount_, address cpReward_) {
        _setupRole(DEFAULT_ADMIN_ROLE, _msgSender());
        _setupRole(OPERATOR_ROLE, _msgSender());
        _setupRole(PAUSER_ROLE, _msgSender());

        requiredTokenAmount = requiredTokenAmount_;

        // buy with token, default = BUSD
        payBy = 0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56;
        // 10 BUSD = 10 * 1e18
        price = 10 * 1e18;
        // the NFT to be minted
        nftToken = 0xFe3EeA9f826E56cA5702aaD50659D801E4Ea9320;
        // spec ID to start with
        baseSpecId = 14;

        cpShare = 3;
        cpReward = cpReward_;
        scvReward = 0x079a889eB69013d451EcF45377258948116e2b3e;
    }

    /**
     * @dev Return the amount of ACS which sender holds in the vault
     */
    function amountInVault(address addr) public view virtual returns (uint256);

    /**
     * @dev A very loose randomness for just bringing the users some
     * unbalanced supply of different types
     */
    function getRandomSpecId() private view returns (uint256) {
        bytes memory b = abi.encodePacked(block.timestamp, block.difficulty);
        uint256 seed = uint256(keccak256(b)) % 100;
        if (seed >= 95) {
            // 5%
            return 0;
        } else if (seed >= 80) {
            // 15%
            return 1;
        } else if (seed >= 50) {
            // 30%
            return 2;
        } else {
            // 50%
            return 3;
        }
    }

    /**
     * @dev Creates a new token for `msg.sender`. Its token ID will be automatically
     * assigned (and available on the emitted {IERC721-Transfer} event), and the token
     * URI autogenerated based on the base URI passed at construction.
     */
    function mint() public virtual whenNotPaused {
        require(
            amountInVault(_msgSender()) >= requiredTokenAmount,
            'not enough tokens'
        );

        IERC20 erc20 = IERC20(payBy);
        // transfer to counterparty
        uint256 amount0 = (price * cpShare) / 10;
        erc20.safeTransferFrom(_msgSender(), cpReward, amount0);
        // transfer the rest to SCV
        uint256 amount1 = price - amount0;
        erc20.safeTransferFrom(_msgSender(), scvReward, amount1);
        // calc the specId from 0~3 and add to baseSpecId
        uint256 specId = baseSpecId + getRandomSpecId();
        ISCVNFT(nftToken).mint(_msgSender(), specId);
    }

    /**
     * @dev Set a new required `amount` to accquire the NFT
     */
    function setRequiredTokenAmount(uint256 amount) public virtual {
        require(
            hasRole(OPERATOR_ROLE, _msgSender()),
            'must have operator role to change required amount'
        );
        requiredTokenAmount = amount;
    }

    /**
     * @dev Set a new required `amount` to accquire the NFT
     */
    function setBaseSpecId(uint256 baseSpecId_) public virtual {
        require(
            hasRole(OPERATOR_ROLE, _msgSender()),
            'must have operator role to change base spec Id'
        );
        baseSpecId = baseSpecId_;
    }

    /**
     * @dev Set a new required `amount` to accquire the NFT
     */
    function setPayByToken(address token) public virtual {
        require(
            hasRole(OPERATOR_ROLE, _msgSender()),
            'must have operator role to change amount'
        );
        payBy = token;
    }

    /**
     * @dev Set a new required `amount` to accquire the NFT
     */
    function setPrice(uint256 price_) public virtual {
        require(
            hasRole(OPERATOR_ROLE, _msgSender()),
            'must have operator role to change amount'
        );
        price = price_;
    }

    /**
     * @dev Set a new share for counterparty
     */
    function setCPShare(uint32 cpShare_) public virtual {
        require(
            hasRole(OPERATOR_ROLE, _msgSender()),
            'must have operator role to change cp share'
        );
        require(cpShare_ < 10, 'the number is 10 based');
        cpShare = cpShare_;
    }

    /**
     * @dev Set a new address for sharing with CP
     */
    function setCPReward(address cpReward_) public virtual {
        require(
            hasRole(OPERATOR_ROLE, _msgSender()),
            'must have operator role to change cp reward address'
        );
        cpReward = cpReward_;
    }

    /**
     * @dev Set a new address for SCV's share
     */
    function setSCVReward(address scvReward_) public virtual {
        require(
            hasRole(OPERATOR_ROLE, _msgSender()),
            'must have operator role to change cp reward address'
        );
        scvReward = scvReward_;
    }

    /**
     * @dev Set a new `nft` token address to mint the NFT
     */
    function setNFTToken(address nft) public virtual {
        require(
            hasRole(OPERATOR_ROLE, _msgSender()),
            'must have operator role to change nft token'
        );
        nftToken = nft;
    }

    function pause() public virtual {
        require(
            hasRole(PAUSER_ROLE, _msgSender()),
            'must have pauser role to pause'
        );
        _pause();
    }

    function unpause() public virtual {
        require(
            hasRole(PAUSER_ROLE, _msgSender()),
            'must have pauser role to unpause'
        );
        _unpause();
    }
}

File 6 of 15 : IERC721.sol
// SPDX-License-Identifier: MIT

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 7 of 15 : IERC165.sol
// SPDX-License-Identifier: MIT

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 8 of 15 : AccessControl.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    function hasRole(bytes32 role, address account) external view returns (bool);
    function getRoleAdmin(bytes32 role) external view returns (bytes32);
    function grantRole(bytes32 role, address account) external;
    function revokeRole(bytes32 role, address account) external;
    function renounceRole(bytes32 role, address account) external;
}

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it.
 */
abstract contract AccessControl is Context, IAccessControl, ERC165 {
    struct RoleData {
        mapping (address => bool) members;
        bytes32 adminRole;
    }

    mapping (bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with a standardized message including the required role.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{20}) is missing role (0x[0-9a-f]{32})$/
     *
     * _Available since v4.1._
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role, _msgSender());
        _;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IAccessControl).interfaceId
            || super.supportsInterface(interfaceId);
    }

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view override returns (bool) {
        return _roles[role].members[account];
    }

    /**
     * @dev Revert with a standard message if `account` is missing `role`.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{20}) is missing role (0x[0-9a-f]{32})$/
     */
    function _checkRole(bytes32 role, address account) internal view {
        if(!hasRole(role, account)) {
            revert(string(abi.encodePacked(
                "AccessControl: account ",
                Strings.toHexString(uint160(account), 20),
                " is missing role ",
                Strings.toHexString(uint256(role), 32)
            )));
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view override returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) public virtual override {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        emit RoleAdminChanged(role, getRoleAdmin(role), adminRole);
        _roles[role].adminRole = adminRole;
    }

    function _grantRole(bytes32 role, address account) private {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    function _revokeRole(bytes32 role, address account) private {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

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

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) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

File 10 of 15 : IERC20.sol
// SPDX-License-Identifier: MIT

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 `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, 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 `sender` to `recipient` 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 sender, address recipient, 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 11 of 15 : SafeERC20.sol
// SPDX-License-Identifier: MIT

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'
        // solhint-disable-next-line max-line-length
        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
            // solhint-disable-next-line max-line-length
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 12 of 15 : Pausable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor () {
        _paused = false;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        require(!paused(), "Pausable: paused");
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        require(paused(), "Pausable: not paused");
        _;
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}

File 13 of 15 : Strings.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant alphabet = "0123456789abcdef";

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = alphabet[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }

}

File 14 of 15 : ERC165.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

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

pragma solidity ^0.8.0;

/**
 * @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
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        // solhint-disable-next-line no-inline-assembly
        assembly { size := extcodesize(account) }
        return size > 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");

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (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");

        // solhint-disable-next-line avoid-low-level-calls
        (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");

        // solhint-disable-next-line avoid-low-level-calls
        (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");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private 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

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

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

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OPERATOR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAUSER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"amountInVault","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseSpecId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cpReward","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cpShare","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"farm0","outputs":[{"internalType":"contract IMerlinFarm","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"farm1","outputs":[{"internalType":"contract IMerlinFarm","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"nftToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"payBy","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"price","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"requiredTokenAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"scvReward","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"baseSpecId_","type":"uint256"}],"name":"setBaseSpecId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"cpReward_","type":"address"}],"name":"setCPReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"cpShare_","type":"uint32"}],"name":"setCPShare","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"nft","type":"address"}],"name":"setNFTToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"setPayByToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"price_","type":"uint256"}],"name":"setPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"setRequiredTokenAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"scvReward_","type":"address"}],"name":"setSCVReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6080604052600980546001600160a01b031990811673ff1da0430c3c4afd6005c511cd5e271be04f473817909155600a8054909116733b87475ac293eeed0e8bc25713eb8242a9497c3f1790553480156200005957600080fd5b506001805460ff19169055676f05b59d3b200000734b2ec7cecc80a9a7cfd537aa84f66c7db50abfde6200008f6000336200018e565b620000bb7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929336200018e565b620000e77f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a336200018e565b6002919091556003805473e9e7cea3dedca5984780bafc599bd69add087d566001600160a01b031991821617909155678ac7230489e800006004556005805473fe3eea9f826e56ca5702aad50659d801e4ea932090831617905560068054600780549093166001600160a01b03909416939093179091556001600160c01b03199091167403079a889eb69013d451ecf45377258948116e2b3e17905560206008556200023e565b6200019a82826200019e565b5050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166200019a576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620001fa3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b611b4b806200024e6000396000f3fe608060405234801561001057600080fd5b50600436106101f05760003560e01c80638456cb591161010f578063c43a5de5116100a2578063d547741f11610071578063d547741f14610441578063dbb1319d14610454578063e63ab1e914610467578063f5b541a61461048e57600080fd5b8063c43a5de5146103dc578063c7f06c30146103ef578063d06fcba814610402578063d22a4ed51461041557600080fd5b8063946fff17116100de578063946fff17146103a5578063a035b1fe146103b8578063a217fddf146103c1578063b755c368146103c957600080fd5b80638456cb591461034057806386494e3c1461034857806391b7f5ed1461035b57806391d148541461036e57600080fd5b80632f2ff15d1161018757806338b7f1d31161015657806338b7f1d3146103075780633f4ba83a1461031a5780635c975abb1461032257806365174cb21461032d57600080fd5b80632f2ff15d146102c557806331132ba7146102d8578063322061fe146102e157806336568abe146102f457600080fd5b80631cb76dd3116101c35780631cb76dd31461024d578063248a9ca31461027857806329d428ca146102a95780632e8ff714146102b257600080fd5b806301ffc9a7146101f557806306bb8b531461021d57806310e71a02146102325780631249c58b14610245575b600080fd5b6102086102033660046118fc565b6104b5565b60405190151581526020015b60405180910390f35b61023061022b3660046118b9565b61051e565b005b61023061024036600461187f565b6105c4565b61023061068f565b600954610260906001600160a01b031681565b6040516001600160a01b039091168152602001610214565b61029b6102863660046118b9565b60009081526020819052604090206001015490565b604051908152602001610214565b61029b60025481565b6102306102c03660046118b9565b610854565b6102306102d33660046118d1565b6108f5565b61029b60085481565b600654610260906001600160a01b031681565b6102306103023660046118d1565b610920565b61023061031536600461187f565b6109ac565b610230610a77565b60015460ff16610208565b61023061033b36600461193c565b610af7565b610230610c27565b600a54610260906001600160a01b031681565b6102306103693660046118b9565b610ca5565b61020861037c3660046118d1565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b600354610260906001600160a01b031681565b61029b60045481565b61029b600081565b6102306103d736600461187f565b610d31565b61029b6103ea36600461187f565b610dfc565b600754610260906001600160a01b031681565b600554610260906001600160a01b031681565b60065461042c90600160a01b900463ffffffff1681565b60405163ffffffff9091168152602001610214565b61023061044f3660046118d1565b610f01565b61023061046236600461187f565b610f27565b61029b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b61029b7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b92981565b60006001600160e01b031982167f7965db0b00000000000000000000000000000000000000000000000000000000148061051857507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316145b92915050565b6105487f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b9293361037c565b6105bf5760405162461bcd60e51b815260206004820152603160248201527f6d7573742068617665206f70657261746f7220726f6c6520746f206368616e6760448201527f6520726571756972656420616d6f756e7400000000000000000000000000000060648201526084015b60405180910390fd5b600255565b6105ee7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b9293361037c565b6106605760405162461bcd60e51b815260206004820152602b60248201527f6d7573742068617665206f70657261746f7220726f6c6520746f206368616e6760448201527f65206e667420746f6b656e00000000000000000000000000000000000000000060648201526084016105b6565b6005805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b60015460ff16156106e25760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a207061757365640000000000000000000000000000000060448201526064016105b6565b6002546106ee33610dfc565b101561073c5760405162461bcd60e51b815260206004820152601160248201527f6e6f7420656e6f75676820746f6b656e7300000000000000000000000000000060448201526064016105b6565b6003546006546004546001600160a01b0390921691600091600a9161076e91600160a01b900463ffffffff1690611a5c565b6107789190611a48565b9050610795336007546001600160a01b0385811692911684610fdd565b6000816004546107a59190611a7b565b90506107c2336006546001600160a01b0386811692911684610fdd565b60006107cc61106b565b6008546107d99190611a30565b6005549091506001600160a01b03166340c10f19336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101849052604401600060405180830381600087803b15801561083657600080fd5b505af115801561084a573d6000803e3d6000fd5b5050505050505050565b61087e7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b9293361037c565b6108f05760405162461bcd60e51b815260206004820152602e60248201527f6d7573742068617665206f70657261746f7220726f6c6520746f206368616e6760448201527f652062617365207370656320496400000000000000000000000000000000000060648201526084016105b6565b600855565b60008281526020819052604090206001015461091181336110f2565b61091b8383611170565b505050565b6001600160a01b038116331461099e5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c66000000000000000000000000000000000060648201526084016105b6565b6109a8828261120e565b5050565b6109d67f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b9293361037c565b610a485760405162461bcd60e51b815260206004820152603360248201527f6d7573742068617665206f70657261746f7220726f6c6520746f206368616e6760448201527f652063702072657761726420616464726573730000000000000000000000000060648201526084016105b6565b6006805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b610aa17f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a3361037c565b610aed5760405162461bcd60e51b815260206004820181905260248201527f6d75737420686176652070617573657220726f6c6520746f20756e706175736560448201526064016105b6565b610af561128d565b565b610b217f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b9293361037c565b610b935760405162461bcd60e51b815260206004820152602a60248201527f6d7573742068617665206f70657261746f7220726f6c6520746f206368616e6760448201527f652063702073686172650000000000000000000000000000000000000000000060648201526084016105b6565b600a8163ffffffff1610610be95760405162461bcd60e51b815260206004820152601660248201527f746865206e756d6265722069732031302062617365640000000000000000000060448201526064016105b6565b6006805463ffffffff909216600160a01b027fffffffffffffffff00000000ffffffffffffffffffffffffffffffffffffffff909216919091179055565b610c517f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a3361037c565b610c9d5760405162461bcd60e51b815260206004820152601e60248201527f6d75737420686176652070617573657220726f6c6520746f207061757365000060448201526064016105b6565b610af5611329565b610ccf7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b9293361037c565b610d2c5760405162461bcd60e51b815260206004820152602860248201527f6d7573742068617665206f70657261746f7220726f6c6520746f206368616e676044820152671948185b5bdd5b9d60c21b60648201526084016105b6565b600455565b610d5b7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b9293361037c565b610dcd5760405162461bcd60e51b815260206004820152603360248201527f6d7573742068617665206f70657261746f7220726f6c6520746f206368616e6760448201527f652063702072657761726420616464726573730000000000000000000000000060648201526084016105b6565b6007805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b6009546040516370a0823160e01b81526001600160a01b038381166004830152600092610518929116906370a082319060240160206040518083038186803b158015610e4757600080fd5b505afa158015610e5b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e7f9190611924565b600a546040516370a0823160e01b81526001600160a01b038681166004830152909116906370a082319060240160206040518083038186803b158015610ec457600080fd5b505afa158015610ed8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610efc9190611924565b6113af565b600082815260208190526040902060010154610f1d81336110f2565b61091b838361120e565b610f517f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b9293361037c565b610fae5760405162461bcd60e51b815260206004820152602860248201527f6d7573742068617665206f70657261746f7220726f6c6520746f206368616e676044820152671948185b5bdd5b9d60c21b60648201526084016105b6565b6003805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd000000000000000000000000000000000000000000000000000000001790526110659085906113c8565b50505050565b600080424460405160200161108a929190918252602082015260400190565b604051602081830303815290604052905060006064828051906020012060001c6110b49190611ad5565b9050605f81106110c75760009250505090565b605081106110d85760019250505090565b603281106110e95760029250505090565b60039250505090565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166109a85761112e816001600160a01b031660146114ad565b6111398360206114ad565b60405160200161114a92919061197c565b60408051601f198184030181529082905262461bcd60e51b82526105b6916004016119fd565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166109a8576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556111ca3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16156109a8576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60015460ff166112df5760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f742070617573656400000000000000000000000060448201526064016105b6565b6001805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b60015460ff161561137c5760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a207061757365640000000000000000000000000000000060448201526064016105b6565b6001805460ff1916811790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2583361130c565b6000818310156113bf57816113c1565b825b9392505050565b600061141d826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166116d49092919063ffffffff16565b80519091501561091b578080602001905181019061143b9190611899565b61091b5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016105b6565b606060006114bc836002611a5c565b6114c7906002611a30565b67ffffffffffffffff8111156114ed57634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015611517576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061155c57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053507f7800000000000000000000000000000000000000000000000000000000000000816001815181106115b557634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060006115d9846002611a5c565b6115e4906001611a30565b90505b6001811115611685577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061163357634e487b7160e01b600052603260045260246000fd5b1a60f81b82828151811061165757634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c9361167e81611abe565b90506115e7565b5083156113c15760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016105b6565b60606116e384846000856116eb565b949350505050565b6060824710156117635760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016105b6565b843b6117b15760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016105b6565b600080866001600160a01b031685876040516117cd9190611960565b60006040518083038185875af1925050503d806000811461180a576040519150601f19603f3d011682016040523d82523d6000602084013e61180f565b606091505b509150915061181f82828661182a565b979650505050505050565b606083156118395750816113c1565b8251156118495782518084602001fd5b8160405162461bcd60e51b81526004016105b691906119fd565b80356001600160a01b038116811461187a57600080fd5b919050565b600060208284031215611890578081fd5b6113c182611863565b6000602082840312156118aa578081fd5b815180151581146113c1578182fd5b6000602082840312156118ca578081fd5b5035919050565b600080604083850312156118e3578081fd5b823591506118f360208401611863565b90509250929050565b60006020828403121561190d578081fd5b81356001600160e01b0319811681146113c1578182fd5b600060208284031215611935578081fd5b5051919050565b60006020828403121561194d578081fd5b813563ffffffff811681146113c1578182fd5b60008251611972818460208701611a92565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516119b4816017850160208801611a92565b7f206973206d697373696e6720726f6c652000000000000000000000000000000060179184019182015283516119f1816028840160208801611a92565b01602801949350505050565b6020815260008251806020840152611a1c816040850160208701611a92565b601f01601f19169190910160400192915050565b60008219821115611a4357611a43611ae9565b500190565b600082611a5757611a57611aff565b500490565b6000816000190483118215151615611a7657611a76611ae9565b500290565b600082821015611a8d57611a8d611ae9565b500390565b60005b83811015611aad578181015183820152602001611a95565b838111156110655750506000910152565b600081611acd57611acd611ae9565b506000190190565b600082611ae457611ae4611aff565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fdfea2646970667358221220b927294375b4fbaa1215b60f383155f6d4ff7755a5e30985f7356eeff60451a664736f6c63430008040033

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
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.