Contract 0xDBF04BEd11158a3a416A69EB01fBB742b710B612 1

 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x636195ebbd6ccb20826924f65c377a21dbead5af70736ab941beb7f60a0e28e90x6080604028981622021-11-08 3:18:07201 days 19 hrs ago0x904b5993fc92979eeedc19ccc58bed6b7216667c IN  Create: MerkleRedeem0 ETH0.046135308886 ETH
[ Download CSV Export 
Latest 18 internal transactions
Parent Txn Hash Block From To Value
0x22802afa4c7912cfb982eaf461e819ccae7bed5d35cd83ce804c5137e6b2efce128381592022-05-24 7:06:464 days 15 hrs ago 0x5fd7d6382de0d4c4a00b19ed10c11dfd96c27340 0xdbf04bed11158a3a416a69eb01fbb742b710b6120 ETH
0x8a9ef8e1ab5e692b6259d0ca27c22147829a202437a226babe178aed02b04a9d123779472022-05-18 7:41:2710 days 14 hrs ago 0x8223015ed5484ff66a9033f40931ae3dea22cb90 0xdbf04bed11158a3a416a69eb01fbb742b710b6120 ETH
0x73e261cba2d3989ca53afc0a6e47c5bf24d2b64becfe2413209f18f46a61efc4101803122022-04-20 11:52:5238 days 10 hrs ago 0x1640e85d93e6d92bf2c3fef776ace16b7017d05c 0xdbf04bed11158a3a416a69eb01fbb742b710b6120 ETH
0x9e72a74d387cc0513e32b8024f4e74212d1f245d880e5c24160f656420ca9c5a74175672022-03-04 21:16:5985 days 1 hr ago 0xfc10b6ce157735b42ce622361246c44327943cc2 0xdbf04bed11158a3a416a69eb01fbb742b710b6120 ETH
0x43a4a046b7272cdae896d60c64944909735ddccaea00adbfabc133b8b569bec969416922022-02-26 8:46:1691 days 13 hrs ago 0xe29632f4afe32ec92509f71eb3ba3843f4eb7a88 0xdbf04bed11158a3a416a69eb01fbb742b710b6120 ETH
0x889d3833f2948be5a829e33923976c0da4180f74d56f8464bc8e854ff48f4b1864627912022-02-20 14:12:2597 days 8 hrs ago 0x9b320ddb2ab2ed1b5ffa673f92ad42b40d921db8 0xdbf04bed11158a3a416a69eb01fbb742b710b6120 ETH
0x111fa2775eed30ac3e11392ab60b5e9a2e67d588b8e6786545309e93cfdff42959170872022-02-12 11:49:37105 days 10 hrs ago 0xe29632f4afe32ec92509f71eb3ba3843f4eb7a88 0xdbf04bed11158a3a416a69eb01fbb742b710b6120 ETH
0x121c8f2f135fab856c3d2e81ea0513afafa6cc7fb202308b352d37293231c3c354156042022-02-04 12:18:39113 days 10 hrs ago 0xa29bc5e0a0d12dc9928d0567cfabb258992346c6 0xdbf04bed11158a3a416a69eb01fbb742b710b6120 ETH
0x8f5b6ca5c546cd2768b93e0abccde2c1f76518c9141df9b129ea80837d15babe51871292022-01-28 23:57:24119 days 22 hrs ago 0xe29632f4afe32ec92509f71eb3ba3843f4eb7a88 0xdbf04bed11158a3a416a69eb01fbb742b710b6120 ETH
0x2ced1bed70b322fc02b4d27934ec7cf44c450d10071795146639a19d2b7d32ac48169252022-01-20 8:20:08128 days 14 hrs ago 0xd672a08a65071cc5c2b962e47cc1072957011094 0xdbf04bed11158a3a416a69eb01fbb742b710b6120 ETH
0x45eb0c7d186a06c95a99c4c05718c9920e20bde76c8669b81f78b231038b17e746611552022-01-15 7:47:18133 days 14 hrs ago 0xe29632f4afe32ec92509f71eb3ba3843f4eb7a88 0xdbf04bed11158a3a416a69eb01fbb742b710b6120 ETH
0x8e504befb175283c953c1ba0a00d083d9577e6897f5e8574a1fa2b7d8d70ab7342212972022-01-01 0:00:12147 days 22 hrs ago 0xe29632f4afe32ec92509f71eb3ba3843f4eb7a88 0xdbf04bed11158a3a416a69eb01fbb742b710b6120 ETH
0x7d39f337ed3840564338a5ceca4f9618628bfd1dee52d8e9e2be0dc992b41dbd39298522021-12-18 3:26:48161 days 18 hrs ago 0xe29632f4afe32ec92509f71eb3ba3843f4eb7a88 0xdbf04bed11158a3a416a69eb01fbb742b710b6120 ETH
0x3ed2fc8090a1e6a61364ceb511cbbd298d99d4872e4e57b4f08a3efd38d8212635470262021-12-04 0:32:51175 days 21 hrs ago 0xe29632f4afe32ec92509f71eb3ba3843f4eb7a88 0xdbf04bed11158a3a416a69eb01fbb742b710b6120 ETH
0x7608ccb724ac3208d350a3a1f34d10500a5ade4961cb09484c2ed6e008a8d12d31586842021-11-20 0:59:54189 days 21 hrs ago 0x863ba9f511f72efc0adb66ad81ead5558faf6d7c 0xdbf04bed11158a3a416a69eb01fbb742b710b6120 ETH
0xd60ff44940f6ed8bb5100b2c6b2ba2a37066a16cd3a9669a72ea4ea0bcc65c1f31579032021-11-20 0:07:59189 days 22 hrs ago 0xe29632f4afe32ec92509f71eb3ba3843f4eb7a88 0xdbf04bed11158a3a416a69eb01fbb742b710b6120 ETH
0x48b61f675e9af0a88f20ca0911c5bf23f0098642a2ec6867659e4c2fdad0f57728983062021-11-08 3:27:20201 days 18 hrs ago 0x904b5993fc92979eeedc19ccc58bed6b7216667c 0xdbf04bed11158a3a416a69eb01fbb742b710b6120 ETH
0xda2dad43025a82326e1ec3a036e7adfe30ad6ebace7ce92b4927824b7a989eff28981722021-11-08 3:18:07201 days 19 hrs ago 0x904b5993fc92979eeedc19ccc58bed6b7216667c 0xdbf04bed11158a3a416a69eb01fbb742b710b6120 ETH
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
MerkleRedeem

Compiler Version
v0.8.6+commit.11564f7e

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 8 : MerkleRedeem.sol
// SPDX-License-Identifier: GPL-3.0-or-later
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

pragma solidity 0.8.6;
pragma experimental ABIEncoderV2;

import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/cryptography/MerkleProofUpgradeable.sol";

contract MerkleRedeem is OwnableUpgradeable {
    using SafeERC20Upgradeable for IERC20Upgradeable;

    struct Claim {
        uint256 epoch;
        uint256 amount;
        bytes32[] merkleProof;
    }

    IERC20Upgradeable public token;

    event ClaimReward(address recipient, uint256 amount);
    event SeedAllocations(uint256 indexed epoch, bytes32 merkleRoot, uint256 totalAllocation);

    // Recorded epochs
    mapping(uint256 => bytes32) public epochMerkleRoots;
    mapping(uint256 => mapping(address => bool)) public claimed;

    function initialize(address token_) external initializer {
        __Ownable_init();
        token = IERC20Upgradeable(token_);
    }

    function seedAllocations(
        uint256 epoch,
        bytes32 merkleRoot,
        uint256 totalAllocation
    ) external onlyOwner {
        require(epochMerkleRoots[epoch] == bytes32(0), "Cannot rewrite merkle root");
        epochMerkleRoots[epoch] = merkleRoot;
        token.transferFrom(msg.sender, address(this), totalAllocation);
        emit SeedAllocations(epoch, merkleRoot, totalAllocation);
    }

    function claimEpoch(
        uint256 epoch,
        uint256 amount,
        bytes32[] memory merkleProof
    ) public {
        address recipient = msg.sender;
        require(!claimed[epoch][recipient], "Already claimed");
        require(verifyClaim(recipient, epoch, amount, merkleProof), "Incorrect merkle proof");

        claimed[epoch][recipient] = true;
        _disburse(recipient, amount);
    }

    function claimEpochs(Claim[] memory claims) public {
        address recipient = msg.sender;
        uint256 totalAmount = 0;
        Claim memory claim;
        for (uint256 i = 0; i < claims.length; i++) {
            claim = claims[i];
            if (claimed[claim.epoch][recipient]) {
                continue;
            }
            // require(!claimed[claim.epoch][recipient], "Already claimed");
            require(
                verifyClaim(recipient, claim.epoch, claim.amount, claim.merkleProof),
                "Incorrect merkle proof"
            );
            totalAmount += claim.amount;
            claimed[claim.epoch][recipient] = true;
        }
        _disburse(recipient, totalAmount);
    }

    function claimStatus(
        address account,
        uint256 begin,
        uint256 end
    ) external view returns (bool[] memory) {
        require(begin <= end, "Epochs must be specified in ascending order");
        uint256 size = 1 + end - begin;
        bool[] memory arr = new bool[](size);
        for (uint256 i = 0; i < size; i++) {
            arr[i] = claimed[begin + i][account];
        }
        return arr;
    }

    function merkleRoots(uint256 begin, uint256 end) external view returns (bytes32[] memory) {
        require(begin <= end, "Epochs must be specified in ascending order");
        uint256 size = 1 + end - begin;
        bytes32[] memory arr = new bytes32[](size);
        for (uint256 i = 0; i < size; i++) {
            arr[i] = epochMerkleRoots[begin + i];
        }
        return arr;
    }

    function verifyClaim(
        address recipient,
        uint256 epoch,
        uint256 amount,
        bytes32[] memory merkleProof
    ) public view returns (bool valid) {
        bytes32 leaf = keccak256(abi.encodePacked(recipient, amount));
        return MerkleProofUpgradeable.verify(merkleProof, epochMerkleRoots[epoch], leaf);
    }

    function _disburse(address recipient, uint256 amount) private {
        if (amount > 0) {
            emit ClaimReward(recipient, amount);
            token.safeTransfer(recipient, amount);
        }
    }
}

File 2 of 8 : OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.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 OwnableUpgradeable is Initializable, ContextUpgradeable {
    address private _owner;

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    function __Ownable_init() internal initializer {
        __Context_init_unchained();
        __Ownable_init_unchained();
    }

    function __Ownable_init_unchained() internal initializer {
        _setOwner(_msgSender());
    }

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

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

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _setOwner(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");
        _setOwner(newOwner);
    }

    function _setOwner(address newOwner) private {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
    uint256[49] private __gap;
}

File 3 of 8 : IERC20Upgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20Upgradeable {
    /**
     * @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 4 of 8 : SafeERC20Upgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC20Upgradeable.sol";
import "../../../utils/AddressUpgradeable.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 SafeERC20Upgradeable {
    using AddressUpgradeable for address;

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

    function safeTransferFrom(
        IERC20Upgradeable 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(
        IERC20Upgradeable token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IERC20Upgradeable 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(
        IERC20Upgradeable 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(IERC20Upgradeable token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

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

File 5 of 8 : MerkleProofUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev These functions deal with verification of Merkle Trees proofs.
 *
 * The proofs can be generated using the JavaScript library
 * https://github.com/miguelmota/merkletreejs[merkletreejs].
 * Note: the hashing algorithm should be keccak256 and pair sorting should be enabled.
 *
 * See `test/utils/cryptography/MerkleProof.test.js` for some examples.
 */
library MerkleProofUpgradeable {
    /**
     * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
     * defined by `root`. For this, a `proof` must be provided, containing
     * sibling hashes on the branch from the leaf to the root of the tree. Each
     * pair of leaves and each pair of pre-images are assumed to be sorted.
     */
    function verify(
        bytes32[] memory proof,
        bytes32 root,
        bytes32 leaf
    ) internal pure returns (bool) {
        bytes32 computedHash = leaf;

        for (uint256 i = 0; i < proof.length; i++) {
            bytes32 proofElement = proof[i];

            if (computedHash <= proofElement) {
                // Hash(current computed hash + current element of the proof)
                computedHash = keccak256(abi.encodePacked(computedHash, proofElement));
            } else {
                // Hash(current element of the proof + current computed hash)
                computedHash = keccak256(abi.encodePacked(proofElement, computedHash));
            }
        }

        // Check if the computed hash (root) is equal to the provided root
        return computedHash == root;
    }
}

File 6 of 8 : ContextUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";

/**
 * @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 ContextUpgradeable is Initializable {
    function __Context_init() internal initializer {
        __Context_init_unchained();
    }

    function __Context_init_unchained() internal initializer {
    }
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
    uint256[50] private __gap;
}

File 7 of 8 : Initializable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     */
    bool private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Modifier to protect an initializer function from being invoked twice.
     */
    modifier initializer() {
        require(_initializing || !_initialized, "Initializable: contract is already initialized");

        bool isTopLevelCall = !_initializing;
        if (isTopLevelCall) {
            _initializing = true;
            _initialized = true;
        }

        _;

        if (isTopLevelCall) {
            _initializing = false;
        }
    }
}

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

pragma solidity ^0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library AddressUpgradeable {
    /**
     * @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;
        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");

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

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

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

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

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

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

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

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

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

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

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

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

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ClaimReward","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"epoch","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"totalAllocation","type":"uint256"}],"name":"SeedAllocations","type":"event"},{"inputs":[{"internalType":"uint256","name":"epoch","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"name":"claimEpoch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"epoch","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"internalType":"struct MerkleRedeem.Claim[]","name":"claims","type":"tuple[]"}],"name":"claimEpochs","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"begin","type":"uint256"},{"internalType":"uint256","name":"end","type":"uint256"}],"name":"claimStatus","outputs":[{"internalType":"bool[]","name":"","type":"bool[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"claimed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"epochMerkleRoots","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token_","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"begin","type":"uint256"},{"internalType":"uint256","name":"end","type":"uint256"}],"name":"merkleRoots","outputs":[{"internalType":"bytes32[]","name":"","type":"bytes32[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"epoch","type":"uint256"},{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"internalType":"uint256","name":"totalAllocation","type":"uint256"}],"name":"seedAllocations","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20Upgradeable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"epoch","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"name":"verifyClaim","outputs":[{"internalType":"bool","name":"valid","type":"bool"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b5061150d806100206000396000f3fe608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063715018a61161008c578063c4d66de811610066578063c4d66de8146101ed578063eb0d07f514610200578063f2fde38b14610213578063fc0c546a1461022657600080fd5b8063715018a6146101925780638da5cb5b1461019a578063b179f7d9146101bf57600080fd5b8063120aa877146100d457806339436b001461011757806347fb23c1146101375780634cd488ab1461015757806359a214081461016c5780636ddcacba1461017f575b600080fd5b6101026100e236600461113c565b606760209081526000928352604080842090915290825290205460ff1681565b60405190151581526020015b60405180910390f35b61012a610125366004611194565b610239565b60405161010e9190611268565b61014a610145366004610f70565b610325565b60405161010e9190611222565b61016a610165366004611168565b610430565b005b61016a61017a366004611004565b610593565b61016a61018d3660046111b6565b6106d0565b61016a6107b5565b6033546001600160a01b03165b6040516001600160a01b03909116815260200161010e565b6101df6101cd366004611123565b60666020526000908152604090205481565b60405190815260200161010e565b61016a6101fb366004610f55565b6107eb565b61010261020e366004610fa3565b61087b565b61016a610221366004610f55565b6108e6565b6065546101a7906001600160a01b031681565b6060818311156102645760405162461bcd60e51b815260040161025b906112d3565b60405180910390fd5b60008361027284600161141f565b61027c9190611437565b905060008167ffffffffffffffff811115610299576102996114c1565b6040519080825280602002602001820160405280156102c2578160200160208202803683370190505b50905060005b8281101561031c57606660006102de838961141f565b8152602001908152602001600020548282815181106102ff576102ff6114ab565b6020908102919091010152806103148161147a565b9150506102c8565b50949350505050565b6060818311156103475760405162461bcd60e51b815260040161025b906112d3565b60008361035584600161141f565b61035f9190611437565b905060008167ffffffffffffffff81111561037c5761037c6114c1565b6040519080825280602002602001820160405280156103a5578160200160208202803683370190505b50905060005b8281101561042457606760006103c1838961141f565b8152602080820192909252604090810160009081206001600160a01b038b168252909252902054825160ff90911690839083908110610402576104026114ab565b911515602092830291909101909101528061041c8161147a565b9150506103ab565b509150505b9392505050565b6033546001600160a01b0316331461045a5760405162461bcd60e51b815260040161025b9061136c565b600083815260666020526040902054156104b65760405162461bcd60e51b815260206004820152601a60248201527f43616e6e6f742072657772697465206d65726b6c6520726f6f74000000000000604482015260640161025b565b6000838152606660205260409081902083905560655490516323b872dd60e01b8152336004820152306024820152604481018390526001600160a01b03909116906323b872dd90606401602060405180830381600087803b15801561051a57600080fd5b505af115801561052e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105529190611101565b50604080518381526020810183905284917f80fd593140ebdda5208720fa293db9100a84e66332607663cf37141d82d45798910160405180910390a2505050565b60408051606080820183526000808352602083018190529282015233919060005b84518110156106bf578481815181106105cf576105cf6114ab565b602090810291909101810151805160009081526067835260408082206001600160a01b0389168352909352919091205490925060ff161561060f576106ad565b6106278483600001518460200151856040015161087b565b61066c5760405162461bcd60e51b815260206004820152601660248201527524b731b7b93932b1ba1036b2b935b63290383937b7b360511b604482015260640161025b565b602082015161067b908461141f565b825160009081526067602090815260408083206001600160a01b03891684529091529020805460ff1916600117905592505b806106b78161147a565b9150506105b4565b506106ca8383610981565b50505050565b60008381526067602090815260408083203380855292529091205460ff161561072d5760405162461bcd60e51b815260206004820152600f60248201526e105b1c9958591e4818db185a5b5959608a1b604482015260640161025b565b6107398185858561087b565b61077e5760405162461bcd60e51b815260206004820152601660248201527524b731b7b93932b1ba1036b2b935b63290383937b7b360511b604482015260640161025b565b60008481526067602090815260408083206001600160a01b03851684529091529020805460ff191660011790556106ca8184610981565b6033546001600160a01b031633146107df5760405162461bcd60e51b815260040161025b9061136c565b6107e960006109e0565b565b600054610100900460ff1680610804575060005460ff16155b6108205760405162461bcd60e51b815260040161025b9061131e565b600054610100900460ff16158015610842576000805461ffff19166101011790555b61084a610a32565b606580546001600160a01b0319166001600160a01b0384161790558015610877576000805461ff00191690555b5050565b6040516bffffffffffffffffffffffff19606086901b1660208201526034810183905260009081906054016040516020818303038152906040528051906020012090506108dc83606660008881526020019081526020016000205483610aad565b9695505050505050565b6033546001600160a01b031633146109105760405162461bcd60e51b815260040161025b9061136c565b6001600160a01b0381166109755760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161025b565b61097e816109e0565b50565b801561087757604080516001600160a01b0384168152602081018390527fba8de60c3403ec381d1d484652ea1980e3c3e56359195c92525bff4ce47ad98e910160405180910390a1606554610877906001600160a01b03168383610b5c565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff1680610a4b575060005460ff16155b610a675760405162461bcd60e51b815260040161025b9061131e565b600054610100900460ff16158015610a89576000805461ffff19166101011790555b610a91610bb3565b610a99610c1d565b801561097e576000805461ff001916905550565b600081815b8551811015610b51576000868281518110610acf57610acf6114ab565b60200260200101519050808311610b11576040805160208101859052908101829052606001604051602081830303815290604052805190602001209250610b3e565b60408051602081018390529081018490526060016040516020818303038152906040528051906020012092505b5080610b498161147a565b915050610ab2565b509092149392505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610bae908490610c7d565b505050565b600054610100900460ff1680610bcc575060005460ff16155b610be85760405162461bcd60e51b815260040161025b9061131e565b600054610100900460ff16158015610a99576000805461ffff1916610101179055801561097e576000805461ff001916905550565b600054610100900460ff1680610c36575060005460ff16155b610c525760405162461bcd60e51b815260040161025b9061131e565b600054610100900460ff16158015610c74576000805461ffff19166101011790555b610a99336109e0565b6000610cd2826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610d4f9092919063ffffffff16565b805190915015610bae5780806020019051810190610cf09190611101565b610bae5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161025b565b6060610d5e8484600085610d66565b949350505050565b606082471015610dc75760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161025b565b843b610e155760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161025b565b600080866001600160a01b03168587604051610e319190611206565b60006040518083038185875af1925050503d8060008114610e6e576040519150601f19603f3d011682016040523d82523d6000602084013e610e73565b606091505b5091509150610e83828286610e8e565b979650505050505050565b60608315610e9d575081610429565b825115610ead5782518084602001fd5b8160405162461bcd60e51b815260040161025b91906112a0565b80356001600160a01b0381168114610ede57600080fd5b919050565b600082601f830112610ef457600080fd5b81356020610f09610f04836113fb565b6113ca565b80838252828201915082860187848660051b8901011115610f2957600080fd5b60005b85811015610f4857813584529284019290840190600101610f2c565b5090979650505050505050565b600060208284031215610f6757600080fd5b61042982610ec7565b600080600060608486031215610f8557600080fd5b610f8e84610ec7565b95602085013595506040909401359392505050565b60008060008060808587031215610fb957600080fd5b610fc285610ec7565b93506020850135925060408501359150606085013567ffffffffffffffff811115610fec57600080fd5b610ff887828801610ee3565b91505092959194509250565b6000602080838503121561101757600080fd5b823567ffffffffffffffff8082111561102f57600080fd5b818501915085601f83011261104357600080fd5b8135611051610f04826113fb565b80828252858201915085850189878560051b880101111561107157600080fd5b60005b848110156110f25781358681111561108b57600080fd5b87016060818d03601f19018113156110a257600080fd5b6110aa6113a1565b828b01358152604080840135828d01529183013591898311156110cc57600080fd5b6110da8f8d85870101610ee3565b90820152865250509287019290870190600101611074565b50909998505050505050505050565b60006020828403121561111357600080fd5b8151801515811461042957600080fd5b60006020828403121561113557600080fd5b5035919050565b6000806040838503121561114f57600080fd5b8235915061115f60208401610ec7565b90509250929050565b60008060006060848603121561117d57600080fd5b505081359360208301359350604090920135919050565b600080604083850312156111a757600080fd5b50508035926020909101359150565b6000806000606084860312156111cb57600080fd5b8335925060208401359150604084013567ffffffffffffffff8111156111f057600080fd5b6111fc86828701610ee3565b9150509250925092565b6000825161121881846020870161144e565b9190910192915050565b6020808252825182820181905260009190848201906040850190845b8181101561125c57835115158352928401929184019160010161123e565b50909695505050505050565b6020808252825182820181905260009190848201906040850190845b8181101561125c57835183529284019291840191600101611284565b60208152600082518060208401526112bf81604085016020870161144e565b601f01601f19169190910160400192915050565b6020808252602b908201527f45706f636873206d7573742062652073706563696669656420696e206173636560408201526a373234b7339037b93232b960a91b606082015260800190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6040516060810167ffffffffffffffff811182821017156113c4576113c46114c1565b60405290565b604051601f8201601f1916810167ffffffffffffffff811182821017156113f3576113f36114c1565b604052919050565b600067ffffffffffffffff821115611415576114156114c1565b5060051b60200190565b6000821982111561143257611432611495565b500190565b60008282101561144957611449611495565b500390565b60005b83811015611469578181015183820152602001611451565b838111156106ca5750506000910152565b600060001982141561148e5761148e611495565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fdfea26469706673582212203b1a1c8e4bdf65183797576b10340e893a200db637827fe8850c203c0e555d7364736f6c63430008060033

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.