ETH Price: $3,422.62 (+3.08%)

Contract

0x08c317D3F9D05B84cBA33876F1DbC7617954C2F0
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Claim202512722024-07-07 1:11:47139 days ago1720314707IN
0x08c317D3...17954C2F0
0 ETH0.000097911.27627449
Claim201337942024-06-20 15:20:11156 days ago1718896811IN
0x08c317D3...17954C2F0
0 ETH0.0008607911.21924117
Claim201315882024-06-20 7:56:23156 days ago1718870183IN
0x08c317D3...17954C2F0
0 ETH0.000744089.69834425
Claim195968382024-04-06 12:58:59231 days ago1712408339IN
0x08c317D3...17954C2F0
0 ETH0.00161217.18279378
Claim192868422024-02-23 0:52:47274 days ago1708649567IN
0x08c317D3...17954C2F0
0 ETH0.0044713147.65077763
Claim191484512024-02-03 14:33:59294 days ago1706970839IN
0x08c317D3...17954C2F0
0 ETH0.0016515317.60231446
Claim191370642024-02-02 0:09:59295 days ago1706832599IN
0x08c317D3...17954C2F0
0 ETH0.0014245118.57477228
Claim185516172023-11-11 22:17:59377 days ago1699741079IN
0x08c317D3...17954C2F0
0 ETH0.0016221227.2
Claim185425682023-11-10 15:53:59379 days ago1699631639IN
0x08c317D3...17954C2F0
0 ETH0.0030656539.95742647
Claim175166322023-06-19 22:03:59522 days ago1687212239IN
0x08c317D3...17954C2F0
0 ETH0.0007355412.3379073
Claim174987372023-06-17 9:48:59525 days ago1686995339IN
0x08c317D3...17954C2F0
0 ETH0.0011318114.75389657
Claim171825282023-05-03 20:21:23570 days ago1683145283IN
0x08c317D3...17954C2F0
0 ETH0.0068385789.12163218
Claim171198602023-04-25 0:58:11578 days ago1682384291IN
0x08c317D3...17954C2F0
0 ETH0.0020443734.28138112
Claim170344412023-04-12 21:00:47591 days ago1681333247IN
0x08c317D3...17954C2F0
0 ETH0.0021165622.55387229
Claim170274682023-04-11 21:22:59592 days ago1681248179IN
0x08c317D3...17954C2F0
0 ETH0.0020785227.08711196
Claim170230572023-04-11 6:22:35592 days ago1681194155IN
0x08c317D3...17954C2F0
0 ETH0.00125321
Claim169898332023-04-06 13:23:11597 days ago1680787391IN
0x08c317D3...17954C2F0
0 ETH0.0028501830.38800878
Claim169812832023-04-05 8:04:35598 days ago1680681875IN
0x08c317D3...17954C2F0
0 ETH0.001630527.34605503
Claim167709502023-03-06 17:59:23628 days ago1678125563IN
0x08c317D3...17954C2F0
0 ETH0.0043606546.47148449
Claim167349732023-03-01 16:31:59633 days ago1677688319IN
0x08c317D3...17954C2F0
0 ETH0.0047995962.53945031
Claim167205872023-02-27 16:01:47635 days ago1677513707IN
0x08c317D3...17954C2F0
0 ETH0.0042204255
Claim166270342023-02-14 12:37:47648 days ago1676378267IN
0x08c317D3...17954C2F0
0 ETH0.0013447117.52638201
Claim165856472023-02-08 17:48:59654 days ago1675878539IN
0x08c317D3...17954C2F0
0 ETH0.0029753638.76342801
Claim165353222023-02-01 17:01:35661 days ago1675270895IN
0x08c317D3...17954C2F0
0 ETH0.0019181225
Claim164972602023-01-27 9:29:23666 days ago1674811763IN
0x08c317D3...17954C2F0
0 ETH0.0010271113.37966472
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
PendleMerkleDistributor

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 8 : PendleMerkleDistributor.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.7.6;
pragma abicoder v2;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/cryptography/MerkleProof.sol";
import "../periphery/BoringOwnable.sol";
import "../libraries/TokenUtilsLib.sol";

contract PendleMerkleDistributor is BoringOwnable {
    using TokenUtils for IERC20;
    using SafeMath for uint256;

    struct IncentiveData {
        uint32 epochBegin;
        uint32 epochEnd;
        uint192 total;
        // sum 256 bits
    }

    address public immutable rewardToken;
    bytes32 public merkleRoot;
    mapping(address => uint256) public claimedAmount;

    event Claimed(address indexed user, uint256 amount);

    constructor(address _rewardToken) BoringOwnable() {
        rewardToken = _rewardToken;
    }

    function setNewRootAndFund(bytes32 newRoot, uint256 amountToFund) external onlyOwner {
        merkleRoot = newRoot;
        if (amountToFund > 0) {
            fund(amountToFund);
        }
    }

    function fund(uint256 amount) public {
        IERC20(rewardToken).safeTransferFrom(msg.sender, address(this), amount);
    }

    function withdraw(uint256 amount) external onlyOwner {
        IERC20(rewardToken).safeTransfer(msg.sender, amount);
    }

    function claim(
        address user,
        uint256 totalAmount,
        bytes32[] calldata merkleProof
    ) external returns (uint256 amountOut) {
        // no reentrancy protection needed

        bytes32 node = keccak256(abi.encodePacked(user, totalAmount));
        require(MerkleProof.verify(merkleProof, merkleRoot, node), "INVALID_PROOF");

        amountOut = totalAmount.sub(claimedAmount[user]);
        claimedAmount[user] = claimedAmount[user].add(amountOut);

        emit Claimed(user, amountOut);
        IERC20(rewardToken).safeTransfer(user, amountOut);
    }
}

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

pragma solidity >=0.6.0 <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 3 of 8 : MerkleProof.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev These functions deal with verification of Merkle trees (hash trees),
 */
library MerkleProof {
    /**
     * @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 4 of 8 : BoringOwnable.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.7.6;

// Audit on 5-Jan-2021 by Keno and BoringCrypto
// Source: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol + Claimable.sol
// Edited by BoringCrypto

contract BoringOwnableData {
    address public owner;
    address public pendingOwner;
}

contract BoringOwnable is BoringOwnableData {
    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    constructor(){
        owner = msg.sender;
    }

    /// @notice Transfers ownership to `newOwner`. Either directly or claimable by the new pending owner.
    /// Can only be invoked by the current `owner`.
    /// @param newOwner Address of the new owner.
    /// @param direct True if `newOwner` should be set immediately. False if `newOwner` needs to use `claimOwnership`.
    /// @param renounce Allows the `newOwner` to be `address(0)` if `direct` and `renounce` is True. Has no effect otherwise.
    function transferOwnership(
        address newOwner,
        bool direct,
        bool renounce
    ) public onlyOwner {
        if (direct) {
            // Checks
            require(newOwner != address(0) || renounce, "Ownable: zero address");

            // Effects
            emit OwnershipTransferred(owner, newOwner);
            owner = newOwner;
            pendingOwner = address(0);
        } else {
            // Effects
            pendingOwner = newOwner;
        }
    }

    /// @notice Needs to be called by `pendingOwner` to claim ownership.
    function claimOwnership() public {
        address _pendingOwner = pendingOwner;

        // Checks
        require(msg.sender == _pendingOwner, "Ownable: caller != pending owner");

        // Effects
        emit OwnershipTransferred(owner, _pendingOwner);
        owner = _pendingOwner;
        pendingOwner = address(0);
    }

    /// @notice Only allows the `owner` to execute the function.
    modifier onlyOwner() {
        require(msg.sender == owner, "Ownable: caller is not the owner");
        _;
    }
}

File 5 of 8 : TokenUtilsLib.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.7.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";

library TokenUtils {
    using SafeERC20 for IERC20;

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        token.safeTransfer(to, value);
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        token.safeTransferFrom(from, to, value);
    }

    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        token.approve(spender, 0);
        token.approve(spender, value);
    }

    function infinityApprove(IERC20 token, address spender) internal {
        if (token.allowance(address(this), spender) <= type(uint256).max / 2) {
            safeApprove(token, spender, type(uint256).max);
        }
    }

    function requireERC20(address tokenAddr) internal view {
        require(IERC20(tokenAddr).totalSupply() > 0, "INVALID_ERC20");
    }

    function requireERC20(IERC20 token) internal view {
        require(token.totalSupply() > 0, "INVALID_ERC20");
    }
}

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

pragma solidity >=0.6.0 <0.8.0;

import "./IERC20.sol";
import "../../math/SafeMath.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 SafeMath for uint256;
    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).add(value);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
        _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 7 of 8 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        uint256 c = a + b;
        if (c < a) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b > a) return (false, 0);
        return (true, a - b);
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) return (true, 0);
        uint256 c = a * b;
        if (c / a != b) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b == 0) return (false, 0);
        return (true, a / b);
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b == 0) return (false, 0);
        return (true, a % b);
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");
        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b <= a, "SafeMath: subtraction overflow");
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        if (a == 0) return 0;
        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");
        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b > 0, "SafeMath: division by zero");
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b > 0, "SafeMath: modulo by zero");
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        return a - b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryDiv}.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a % b;
    }
}

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

pragma solidity >=0.6.2 <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": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_rewardToken","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Claimed","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"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"totalAmount","type":"uint256"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"name":"claim","outputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"claimedAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"fund","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"merkleRoot","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":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"newRoot","type":"bytes32"},{"internalType":"uint256","name":"amountToFund","type":"uint256"}],"name":"setNewRootAndFund","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"},{"internalType":"bool","name":"direct","type":"bool"},{"internalType":"bool","name":"renounce","type":"bool"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60a060405234801561001057600080fd5b50604051610e6b380380610e6b83398101604081905261002f91610058565b60008054336001600160a01b031990911617905560601b6001600160601b031916608052610086565b600060208284031215610069578081fd5b81516001600160a01b038116811461007f578182fd5b9392505050565b60805160601c610db96100b26000398061033352806104a3528061062852806106615250610db96000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c80634e71e0c8116100715780634e71e0c81461011a5780638da5cb5b14610122578063929bc68914610137578063ca1d209d1461014a578063e30c39781461015d578063f7c618c114610165576100a9565b806304e86903146100ae578063078dfbe7146100d75780632e1a7d4d146100ec5780632eb4a7ab146100ff5780633d13f87414610107575b600080fd5b6100c16100bc366004610bb4565b61016d565b6040516100ce9190610d03565b60405180910390f35b6100ea6100e5366004610bce565b61017f565b005b6100ea6100fa366004610cb5565b6102c7565b6100c161035d565b6100c1610115366004610c10565b610363565b6100ea6104d3565b61012a610595565b6040516100ce9190610cef565b6100ea610145366004610c94565b6105a4565b6100ea610158366004610cb5565b61061b565b61012a610650565b61012a61065f565b60036020526000908152604090205481565b6000546001600160a01b031633146101de576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b81156102a6576001600160a01b0383161515806101f85750805b610241576040805162461bcd60e51b81526020600482015260156024820152744f776e61626c653a207a65726f206164647265737360581b604482015290519081900360640190fd5b600080546040516001600160a01b03808716939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0385166001600160a01b0319918216179091556001805490911690556102c2565b600180546001600160a01b0319166001600160a01b0385161790555b505050565b6000546001600160a01b03163314610326576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b61035a6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163383610683565b50565b60025481565b6000808585604051602001610379929190610ccd565b6040516020818303038152906040528051906020012090506103d2848480806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250506002549150849050610697565b6103f75760405162461bcd60e51b81526004016103ee90610d0c565b60405180910390fd5b6001600160a01b03861660009081526003602052604090205461041b908690610742565b6001600160a01b038716600090815260036020526040902054909250610441908361079f565b6001600160a01b038716600081815260036020526040908190209290925590517fd8138f8a3f377c5259ca548e70e4c2de94f129f5a11036a15b69513cba2b426a9061048e908590610d03565b60405180910390a26104ca6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168784610683565b50949350505050565b6001546001600160a01b0316338114610533576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c657220213d2070656e64696e67206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b039092166001600160a01b0319928316179055600180549091169055565b6000546001600160a01b031681565b6000546001600160a01b03163314610603576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b60028290558015610617576106178161061b565b5050565b61035a6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163330846107f9565b6001546001600160a01b031681565b7f000000000000000000000000000000000000000000000000000000000000000081565b6102c26001600160a01b0384168383610814565b600081815b85518110156107355760008682815181106106b357fe5b602002602001015190508083116106fa578281604051602001808381526020018281526020019250505060405160208183030381529060405280519060200120925061072c565b808360405160200180838152602001828152602001925050506040516020818303038152906040528051906020012092505b5060010161069c565b50831490505b9392505050565b600082821115610799576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60008282018381101561073b576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b61080e6001600160a01b038516848484610866565b50505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526102c29084906108bc565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b17905261080e9085905b6000610911826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661096d9092919063ffffffff16565b8051909150156102c25780806020019051602081101561093057600080fd5b50516102c25760405162461bcd60e51b815260040180806020018281038252602a815260200180610d5a602a913960400191505060405180910390fd5b606061097c8484600085610984565b949350505050565b6060824710156109c55760405162461bcd60e51b8152600401808060200182810382526026815260200180610d346026913960400191505060405180910390fd5b6109ce85610adf565b610a1f576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b600080866001600160a01b031685876040518082805190602001908083835b60208310610a5d5780518252601f199092019160209182019101610a3e565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114610abf576040519150601f19603f3d011682016040523d82523d6000602084013e610ac4565b606091505b5091509150610ad4828286610ae9565b979650505050505050565b803b15155b919050565b60608315610af857508161073b565b825115610b085782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610b52578181015183820152602001610b3a565b50505050905090810190601f168015610b7f5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b80356001600160a01b0381168114610ae457600080fd5b80358015158114610ae457600080fd5b600060208284031215610bc5578081fd5b61073b82610b8d565b600080600060608486031215610be2578182fd5b610beb84610b8d565b9250610bf960208501610ba4565b9150610c0760408501610ba4565b90509250925092565b60008060008060608587031215610c25578081fd5b610c2e85610b8d565b935060208501359250604085013567ffffffffffffffff80821115610c51578283fd5b818701915087601f830112610c64578283fd5b813581811115610c72578384fd5b8860208083028501011115610c85578384fd5b95989497505060200194505050565b60008060408385031215610ca6578182fd5b50508035926020909101359150565b600060208284031215610cc6578081fd5b5035919050565b60609290921b6bffffffffffffffffffffffff19168252601482015260340190565b6001600160a01b0391909116815260200190565b90815260200190565b6020808252600d908201526c24a72b20a624a22fa82927a7a360991b60408201526060019056fe416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c5361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a2646970667358221220b82e26182735c5d2df7a4c17c1168991e64262995bdbffcd228874147742c37a64736f6c63430007060033000000000000000000000000808507121b80c02388fad14726482e061b8da827

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80634e71e0c8116100715780634e71e0c81461011a5780638da5cb5b14610122578063929bc68914610137578063ca1d209d1461014a578063e30c39781461015d578063f7c618c114610165576100a9565b806304e86903146100ae578063078dfbe7146100d75780632e1a7d4d146100ec5780632eb4a7ab146100ff5780633d13f87414610107575b600080fd5b6100c16100bc366004610bb4565b61016d565b6040516100ce9190610d03565b60405180910390f35b6100ea6100e5366004610bce565b61017f565b005b6100ea6100fa366004610cb5565b6102c7565b6100c161035d565b6100c1610115366004610c10565b610363565b6100ea6104d3565b61012a610595565b6040516100ce9190610cef565b6100ea610145366004610c94565b6105a4565b6100ea610158366004610cb5565b61061b565b61012a610650565b61012a61065f565b60036020526000908152604090205481565b6000546001600160a01b031633146101de576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b81156102a6576001600160a01b0383161515806101f85750805b610241576040805162461bcd60e51b81526020600482015260156024820152744f776e61626c653a207a65726f206164647265737360581b604482015290519081900360640190fd5b600080546040516001600160a01b03808716939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0385166001600160a01b0319918216179091556001805490911690556102c2565b600180546001600160a01b0319166001600160a01b0385161790555b505050565b6000546001600160a01b03163314610326576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b61035a6001600160a01b037f000000000000000000000000808507121b80c02388fad14726482e061b8da827163383610683565b50565b60025481565b6000808585604051602001610379929190610ccd565b6040516020818303038152906040528051906020012090506103d2848480806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250506002549150849050610697565b6103f75760405162461bcd60e51b81526004016103ee90610d0c565b60405180910390fd5b6001600160a01b03861660009081526003602052604090205461041b908690610742565b6001600160a01b038716600090815260036020526040902054909250610441908361079f565b6001600160a01b038716600081815260036020526040908190209290925590517fd8138f8a3f377c5259ca548e70e4c2de94f129f5a11036a15b69513cba2b426a9061048e908590610d03565b60405180910390a26104ca6001600160a01b037f000000000000000000000000808507121b80c02388fad14726482e061b8da827168784610683565b50949350505050565b6001546001600160a01b0316338114610533576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c657220213d2070656e64696e67206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b039092166001600160a01b0319928316179055600180549091169055565b6000546001600160a01b031681565b6000546001600160a01b03163314610603576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b60028290558015610617576106178161061b565b5050565b61035a6001600160a01b037f000000000000000000000000808507121b80c02388fad14726482e061b8da827163330846107f9565b6001546001600160a01b031681565b7f000000000000000000000000808507121b80c02388fad14726482e061b8da82781565b6102c26001600160a01b0384168383610814565b600081815b85518110156107355760008682815181106106b357fe5b602002602001015190508083116106fa578281604051602001808381526020018281526020019250505060405160208183030381529060405280519060200120925061072c565b808360405160200180838152602001828152602001925050506040516020818303038152906040528051906020012092505b5060010161069c565b50831490505b9392505050565b600082821115610799576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60008282018381101561073b576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b61080e6001600160a01b038516848484610866565b50505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526102c29084906108bc565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b17905261080e9085905b6000610911826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661096d9092919063ffffffff16565b8051909150156102c25780806020019051602081101561093057600080fd5b50516102c25760405162461bcd60e51b815260040180806020018281038252602a815260200180610d5a602a913960400191505060405180910390fd5b606061097c8484600085610984565b949350505050565b6060824710156109c55760405162461bcd60e51b8152600401808060200182810382526026815260200180610d346026913960400191505060405180910390fd5b6109ce85610adf565b610a1f576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b600080866001600160a01b031685876040518082805190602001908083835b60208310610a5d5780518252601f199092019160209182019101610a3e565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114610abf576040519150601f19603f3d011682016040523d82523d6000602084013e610ac4565b606091505b5091509150610ad4828286610ae9565b979650505050505050565b803b15155b919050565b60608315610af857508161073b565b825115610b085782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610b52578181015183820152602001610b3a565b50505050905090810190601f168015610b7f5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b80356001600160a01b0381168114610ae457600080fd5b80358015158114610ae457600080fd5b600060208284031215610bc5578081fd5b61073b82610b8d565b600080600060608486031215610be2578182fd5b610beb84610b8d565b9250610bf960208501610ba4565b9150610c0760408501610ba4565b90509250925092565b60008060008060608587031215610c25578081fd5b610c2e85610b8d565b935060208501359250604085013567ffffffffffffffff80821115610c51578283fd5b818701915087601f830112610c64578283fd5b813581811115610c72578384fd5b8860208083028501011115610c85578384fd5b95989497505060200194505050565b60008060408385031215610ca6578182fd5b50508035926020909101359150565b600060208284031215610cc6578081fd5b5035919050565b60609290921b6bffffffffffffffffffffffff19168252601482015260340190565b6001600160a01b0391909116815260200190565b90815260200190565b6020808252600d908201526c24a72b20a624a22fa82927a7a360991b60408201526060019056fe416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c5361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a2646970667358221220b82e26182735c5d2df7a4c17c1168991e64262995bdbffcd228874147742c37a64736f6c63430007060033

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

000000000000000000000000808507121b80c02388fad14726482e061b8da827

-----Decoded View---------------
Arg [0] : _rewardToken (address): 0x808507121B80c02388fAd14726482e061B8da827

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000808507121b80c02388fad14726482e061b8da827


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.