Cryo Explorer Ethereum Mainnet

Address Contract Partially Verified

Address 0xfCd5798E448e4Cc016924Dc219C10740813D3A28
Balance 0 ETH
Nonce 1
Code Size 4704 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

4704 bytes
0x608060405234801561001057600080fd5b506004361061012c5760003560e01c806381f237b8116100ad578063b6b55f2511610071578063b6b55f25146102be578063b994cc45146102d1578063d723a3d2146102e4578063ee6649a114610320578063f2fde38b1461034357600080fd5b806381f237b81461025c5780638da5cb5b1461026f57806395ccea6714610280578063a66f42c014610293578063aa77a8091461029b57600080fd5b8063225b031d116100f4578063225b031d146101e5578063543e9dbf14610200578063575a86b21461022e5780636764120c14610241578063715018a61461025457600080fd5b806302fb0c5e146101315780630aa937671461015a57806310b11e141461016f578063150b7a021461018257806320f51707146101ba575b600080fd5b60025461014590600160a01b900460ff1681565b60405190151581526020015b60405180910390f35b61016d610168366004610e4d565b610356565b005b61016d61017d366004610e92565b6103d6565b6101a1610190366004610ec0565b630a85bd0160e11b95945050505050565b6040516001600160e01b03199091168152602001610151565b6005546101cd906001600160a01b031681565b6040516001600160a01b039091168152602001610151565b6101cd73111111111111111111111111111111111111111181565b61022061020e366004610f5f565b60066020526000908152604090205481565b604051908152602001610151565b6003546101cd906001600160a01b031681565b61016d61024f366004610f83565b610461565b61016d6104c1565b6004546101cd906001600160a01b031681565b6000546001600160a01b03166101cd565b61016d61028e366004610fa0565b6104d5565b61016d61065d565b6101456102a9366004610fcc565b60096020526000908152604090205460ff1681565b61016d6102cc366004610fcc565b610b5f565b6002546101cd906001600160a01b031681565b61030b6102f2366004610f5f565b6007602052600090815260409020805460019091015482565b60408051928352602083019190915201610151565b61014561032e366004610f5f565b60086020526000908152604090205460ff1681565b61016d610351366004610f5f565b610cbd565b61035e610d3b565b8161037c5760405163079f151f60e11b815260040160405180910390fd5b600082815260096020908152604091829020805460ff19168415159081179091558251858152918201527f73b1c57111c578f80a66c18ee5451bc79fdc3d6000261a4c89c070fb91bdd85891015b60405180910390a15050565b6103de610d3b565b6001600160a01b0382166104055760405163e6c4247b60e01b815260040160405180910390fd5b6001600160a01b038216600081815260086020908152604091829020805460ff19168515159081179091558251938452908301527ff9c4e47c60b7a9d21f5359984eeb75eec20ab7d5f5c633e2eb7780dc6191103591016103ca565b610469610d3b565b60028054821515600160a01b0260ff60a01b199091161790556040517f1aeaaae8f3dfe7571a27a3576558260788745acdc3b5bd1c09041614d4fdbef8906104b690831515815260200190565b60405180910390a150565b6104c9610d3b565b6104d36000610d95565b565b6104dd610d3b565b6104e5610de5565b6001600160a01b03821661050c5760405163e6c4247b60e01b815260040160405180910390fd5b6005546040516370a0823160e01b815230600482015282916001600160a01b0316906370a0823190602401602060405180830381865afa158015610554573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105789190610fe5565b101561059757604051631e9acf1760e31b815260040160405180910390fd5b60055460405163a9059cbb60e01b81526001600160a01b038481166004830152602482018490529091169063a9059cbb906044016020604051808303816000875af11580156105ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061060e9190610ffe565b50604080518281526001600160a01b03841660208201527f8353ffcac0876ad14e226d9783c04540bfebf13871e868157d2a391cad98e918910160405180910390a161065960018055565b5050565b610665610de5565b600254600160a01b900460ff1661068f576040516384c9906960e01b815260040160405180910390fd5b3360009081526008602052604090205460ff16156106c0576040516316e7880d60e11b815260040160405180910390fd5b33600090815260066020526040902054806106ee5760405163079f151f60e11b815260040160405180910390fd5b60008181526009602052604090205460ff161561071e57604051631ed71e4160e01b815260040160405180910390fd5b6004805460405163b4b5b48f60e01b81529182018390526000916001600160a01b039091169063b4b5b48f90602401606060405180830381865afa15801561076a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061078e919061101b565b905043816020015110156107b557604051631613b7eb60e01b815260040160405180910390fd5b33600090815260076020908152604080832081518083018352815481526001909101549281019290925260035481516379502c5560e01b815291519293926001600160a01b03909116916379502c559160048083019260e09291908290030181865afa158015610829573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061084d9190611085565b60035460405163064bc20960e01b81523360048201529192506000916001600160a01b039091169063064bc20990602401602060405180830381865afa15801561089b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108bf9190610fe5565b905081604001518110156108e657604051631e9acf1760e31b815260040160405180910390fd5b600354604051630cacd00160e11b81523360048201526000916001600160a01b031690631959a0029060240160c060405180830381865afa15801561092f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109539190611117565b90506000846020015111801561097157508360200151816060015111155b1561098f57604051631613b7eb60e01b815260040160405180910390fd5b604080518082018252838152436020808301918252336000908152600790915292832091518255516001909101558551612710906109ce9060646111b5565b6109d890856111b5565b6109e291906111d4565b905060006127108560600151836109f991906111b5565b610a0391906111d4565b90508015610a865760055460025460405163a9059cbb60e01b81526001600160a01b0391821660048201526024810184905291169063a9059cbb906044016020604051808303816000875af1158015610a60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a849190610ffe565b505b610a9081836111f6565b60055460405163a9059cbb60e01b8152336004820152602481018390529193506001600160a01b03169063a9059cbb906044016020604051808303816000875af1158015610ae2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b069190610ffe565b5060408051338152602081018490529081018290524360608201527f82f1a735a8f74841f96f5781d0def32cd252e61f6c5c5f9c6cfb3a18e12d71099060800160405180910390a150505050505050506104d360018055565b600480546040516331a9108f60e11b815291820183905233916001600160a01b0390911690636352211e90602401602060405180830381865afa158015610baa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bce919061120d565b6001600160a01b031614610bf55760405163ca5ae8a360e01b815260040160405180910390fd5b60048054604051632142170760e11b815233928101929092527311111111111111111111111111111111111111116024830152604482018390526001600160a01b0316906342842e0e90606401600060405180830381600087803b158015610c5c57600080fd5b505af1158015610c70573d6000803e3d6000fd5b505033600081815260066020908152604091829020869055815192835282018590527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c93500190506104b6565b610cc5610d3b565b6001600160a01b038116610d2f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b610d3881610d95565b50565b6000546001600160a01b031633146104d35760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610d26565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60026001541415610e385760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610d26565b6002600155565b8015158114610d3857600080fd5b60008060408385031215610e6057600080fd5b823591506020830135610e7281610e3f565b809150509250929050565b6001600160a01b0381168114610d3857600080fd5b60008060408385031215610ea557600080fd5b8235610eb081610e7d565b91506020830135610e7281610e3f565b600080600080600060808688031215610ed857600080fd5b8535610ee381610e7d565b94506020860135610ef381610e7d565b935060408601359250606086013567ffffffffffffffff80821115610f1757600080fd5b818801915088601f830112610f2b57600080fd5b813581811115610f3a57600080fd5b896020828501011115610f4c57600080fd5b9699959850939650602001949392505050565b600060208284031215610f7157600080fd5b8135610f7c81610e7d565b9392505050565b600060208284031215610f9557600080fd5b8135610f7c81610e3f565b60008060408385031215610fb357600080fd5b8235610fbe81610e7d565b946020939093013593505050565b600060208284031215610fde57600080fd5b5035919050565b600060208284031215610ff757600080fd5b5051919050565b60006020828403121561101057600080fd5b8151610f7c81610e3f565b60006060828403121561102d57600080fd5b6040516060810181811067ffffffffffffffff8211171561105e57634e487b7160e01b600052604160045260246000fd5b80604052508251815260208301516020820152604083015160408201528091505092915050565b600060e0828403121561109757600080fd5b60405160e0810181811067ffffffffffffffff821117156110c857634e487b7160e01b600052604160045260246000fd5b8060405250825181526020830151602082015260408301516040820152606083015160608201526080830151608082015260a083015160a082015260c083015160c08201528091505092915050565b600060c0828403121561112957600080fd5b60405160c0810181811067ffffffffffffffff8211171561115a57634e487b7160e01b600052604160045260246000fd5b8060405250825181526020830151602082015260408301516040820152606083015160608201526080830151608082015260a083015160a08201528091505092915050565b634e487b7160e01b600052601160045260246000fd5b60008160001904831182151516156111cf576111cf61119f565b500290565b6000826111f157634e487b7160e01b600052601260045260246000fd5b500490565b6000828210156112085761120861119f565b500390565b60006020828403121561121f57600080fd5b8151610f7c81610e7d56fea2646970667358221220799664f657bed89036dfb4de028c3f9948cb52b7cdfb0deefbed3b0cd4a02f6b64736f6c634300080c0033

Verified Source Code Partial Match

Compiler: v0.8.12+commit.f00d7308 EVM: istanbul Optimization: Yes (200 runs)
Booster.sol 190 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.12;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";

struct UserInfo {
    uint256 amount;
    uint256 rewardDebt;
    uint256 rewardBalance;
    uint256 lastClaim;
    uint256 sumTaxed;
    uint256 parentTaxed;
}

struct Configuration {
    uint256 orderLockingHeight;
    uint256 depositThreshold;
    uint256 claimThreshold;
    uint256 claimCharge;
    uint256 commissionRatio;
    uint256 cooldown;
    uint256 withdrawalCharge;
}

interface IMasterChef {

    function pendingDai(address user) external view returns (uint256);

    function userInfo(address user) external view returns (UserInfo memory);

    function config() external view returns (Configuration memory);

    function highestParent() external view returns (address);
}

struct Data {
    uint256 boostRate;
    uint256 validBlock;
    uint256 initBlock;
}

interface IMedal is IERC721 {

    function tokenData(uint256 tokenId) external view returns (Data memory);
}

/// @title Booster
/// @notice Handles deposit of Elite Medals to boost DAI rewards from MasterChef
contract Booster is Ownable, ReentrancyGuard, IERC721Receiver {

    struct BoostInfo {
        uint256 pendingDai;
        uint256 lastClaim;
    }

    address public constant BLACK = 0x1111111111111111111111111111111111111111;
    address public highestParent;
    bool public active;

    IMasterChef public masterChef;
    IMedal public medal;
    IERC20 public Dai;

    mapping(address => uint256) public medalInfo;
    mapping(address => BoostInfo) public boostInfo;
    mapping(address => bool) public disableUser;
    mapping(uint256 => bool) public disableNFT;

    /// @dev Errors
    error InvalidAddress();
    error InsufficientBalance();
    error Unauthorized();
    error NFTNotOwned();
    error InvalidNFT();
    error ClaimTooEarly();
    error InactiveContract();
    error DisabledUser();
    error DisabledNFT();

    event Deposit(address from, uint256 tokenId);
    event Boost(address from, uint256 amount, uint256 parentAmount, uint256 number);
    event Withdraw(uint256 amount, address to);
    event UpdateActive(bool state);
    event UpdateDisableUser(address from, bool state);
    event UpdateDisableNFT(uint256 tokenId, bool state);

    constructor(address _owner, address _masterChef, address _medal, address _dai) {
        masterChef = IMasterChef(_masterChef);
        medal = IMedal(_medal);
        Dai = IERC20(_dai);
        active = true;

        highestParent = masterChef.highestParent();

        _transferOwnership(_owner);
    }

    /// @notice Deposit an NFT to enable boosting
    function deposit(uint256 tokenId) external {
        if (medal.ownerOf(tokenId) != msg.sender) revert NFTNotOwned();

        medal.safeTransferFrom(msg.sender, BLACK, tokenId);
        medalInfo[msg.sender] = tokenId;

        emit Deposit(msg.sender, tokenId);
    }

    /// @notice Claim and boost DAI rewards
    function boost() external nonReentrant {
        if (!active) revert InactiveContract();
        if (disableUser[msg.sender]) revert DisabledUser();

        uint256 tokenId = medalInfo[msg.sender];
        if (tokenId == 0) revert InvalidNFT();
        if (disableNFT[tokenId]) revert DisabledNFT();

        Data memory data = medal.tokenData(tokenId);
        if (data.validBlock < block.number) revert ClaimTooEarly();

        BoostInfo memory info = boostInfo[msg.sender];
        Configuration memory cfg = masterChef.config();

        uint256 pendingDai = masterChef.pendingDai(msg.sender);
        if (pendingDai < cfg.claimThreshold) revert InsufficientBalance();

        UserInfo memory userInfo = masterChef.userInfo(msg.sender);
        if (info.lastClaim > 0 && userInfo.lastClaim <= info.lastClaim) {
            revert ClaimTooEarly();
        }

        boostInfo[msg.sender] = BoostInfo({
            pendingDai: pendingDai,
            lastClaim: block.number
        });

        uint256 amount = (pendingDai * (data.boostRate * 100)) / 10000;
        uint256 parentAmount = amount * cfg.claimCharge / 10000;

        if (parentAmount > 0) Dai.transfer(highestParent, parentAmount);
        amount = amount - parentAmount;
        Dai.transfer(msg.sender, amount);

        emit Boost(msg.sender,  amount, parentAmount, block.number);
    }

    /// @notice Emergency withdraw DAI from contract
    function emergencyWithdraw( address to, uint256 amount) external onlyOwner nonReentrant {
        if (to == address(0)) revert InvalidAddress();
        if (Dai.balanceOf(address(this)) < amount) revert InsufficientBalance();

        Dai.transfer(to, amount);

        emit Withdraw(amount, to);
    }

    function updateActive(bool state) external onlyOwner {
        active = state;

        emit UpdateActive(state);
    }

    function updateDisableUser(address from, bool state) external onlyOwner {
        if (from == address(0)) revert InvalidAddress();
        disableUser[from] = state;

        emit UpdateDisableUser(from, state);
    }

    function updateDisableNFT(uint256 tokenId, bool state) external onlyOwner {
        if (tokenId == 0) revert InvalidNFT();
        disableNFT[tokenId] = state;

        emit UpdateDisableNFT(tokenId, state);
    }

    // Required to accept ERC721 safe transfers
    function onERC721Received(
        address,
        address,
        uint256,
        bytes calldata
    ) external pure override returns (bytes4) {
        return IERC721Receiver.onERC721Received.selector;
    }

}
ReentrancyGuard.sol 69 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (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() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

    function _nonReentrantAfter() private {
        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
}
IERC20.sol 82 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @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);

    /**
     * @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);
}
IERC721.sol 145 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (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`.
     *
     * 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;

    /**
     * @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 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: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
     * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
     * understand this adds an external call which potentially creates a reentrancy vulnerability.
     *
     * 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 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 the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @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);
}
IERC721Receiver.sol 27 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (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 `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}
Ownable.sol 83 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (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 Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        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);
    }
}
IERC165.sol 25 lines
// 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);
}
Context.sol 24 lines
// 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;
    }
}

Read Contract

BLACK 0x225b031d → address
Dai 0x20f51707 → address
active 0x02fb0c5e → bool
boostInfo 0xd723a3d2 → uint256, uint256
disableNFT 0xaa77a809 → bool
disableUser 0xee6649a1 → bool
highestParent 0xb994cc45 → address
masterChef 0x575a86b2 → address
medal 0x81f237b8 → address
medalInfo 0x543e9dbf → uint256
onERC721Received 0x150b7a02 → bytes4
owner 0x8da5cb5b → address

Write Contract 8 functions

These functions modify contract state and require a wallet transaction to execute.

boost 0xa66f42c0
No parameters
deposit 0xb6b55f25
uint256 tokenId
emergencyWithdraw 0x95ccea67
address to
uint256 amount
renounceOwnership 0x715018a6
No parameters
transferOwnership 0xf2fde38b
address newOwner
updateActive 0x6764120c
bool state
updateDisableNFT 0x0aa93767
uint256 tokenId
bool state
updateDisableUser 0x10b11e14
address from
bool state

Token Balances (1)

View Transfers →
DAI 0.5241

Recent Transactions

No transactions found for this address