ETH Price: $3,120.29 (-0.05%)

Contract

0x7eA62d046499468B41b8391e72FCD546F734ddC3
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Expire Tranche193103632024-02-26 7:51:11268 days ago1708933871IN
0x7eA62d04...6F734ddC3
0 ETH0.0015906330.71262717
Expire Tranche193103612024-02-26 7:50:47268 days ago1708933847IN
0x7eA62d04...6F734ddC3
0 ETH0.0015741530.39446127
Expire Tranche192935702024-02-23 23:29:11270 days ago1708730951IN
0x7eA62d04...6F734ddC3
0 ETH0.0011437433.240774
Expire Tranche192935702024-02-23 23:29:11270 days ago1708730951IN
0x7eA62d04...6F734ddC3
0 ETH0.0011422822.0557504
Expire Tranche192757452024-02-21 11:30:11272 days ago1708515011IN
0x7eA62d04...6F734ddC3
0 ETH0.0012690524.50330637
Expire Tranche192757432024-02-21 11:29:47272 days ago1708514987IN
0x7eA62d04...6F734ddC3
0 ETH0.0012959425.02264515
Expire Tranche192757422024-02-21 11:29:35272 days ago1708514975IN
0x7eA62d04...6F734ddC3
0 ETH0.0013372425.8250034
Claims182952912023-10-07 1:20:35410 days ago1696641635IN
0x7eA62d04...6F734ddC3
0 ETH0.000180545
Claims182731762023-10-03 23:07:47413 days ago1696374467IN
0x7eA62d04...6F734ddC3
0 ETH0.000710437.78882242
Claims179923262023-08-25 14:32:47452 days ago1692973967IN
0x7eA62d04...6F734ddC3
0 ETH0.0048157231.07439861
Claims179922752023-08-25 14:22:35452 days ago1692973355IN
0x7eA62d04...6F734ddC3
0 ETH0.0050129136.33548617
Claims178516132023-08-05 22:00:11472 days ago1691272811IN
0x7eA62d04...6F734ddC3
0 ETH0.0028921615.67009068
Claims175632342023-06-26 11:14:35512 days ago1687778075IN
0x7eA62d04...6F734ddC3
0 ETH0.003077612.39521928
Claims175201892023-06-20 10:02:35519 days ago1687255355IN
0x7eA62d04...6F734ddC3
0 ETH0.001095211.99698942
Claims175201892023-06-20 10:02:35519 days ago1687255355IN
0x7eA62d04...6F734ddC3
0 ETH0.0010948312
Claims175201892023-06-20 10:02:35519 days ago1687255355IN
0x7eA62d04...6F734ddC3
0 ETH0.0010949712
Claims175201892023-06-20 10:02:35519 days ago1687255355IN
0x7eA62d04...6F734ddC3
0 ETH0.0010950912
Claims174831142023-06-15 5:07:35524 days ago1686805655IN
0x7eA62d04...6F734ddC3
0 ETH0.0018721518.69691297
Claims174317892023-06-07 23:36:59531 days ago1686181019IN
0x7eA62d04...6F734ddC3
0 ETH0.0022199922.16320453
Claims173466592023-05-26 23:53:35543 days ago1685145215IN
0x7eA62d04...6F734ddC3
0 ETH0.0039547128.66272774
Claims173358472023-05-25 11:24:59544 days ago1685013899IN
0x7eA62d04...6F734ddC3
0 ETH0.0031615831.82622685
Claims173355752023-05-25 10:29:59544 days ago1685010599IN
0x7eA62d04...6F734ddC3
0 ETH0.0029759229.95423886
Claims173355572023-05-25 10:26:23545 days ago1685010383IN
0x7eA62d04...6F734ddC3
0 ETH0.0037445931.94122809
New Tranche173142942023-05-22 10:38:11547 days ago1684751891IN
0x7eA62d04...6F734ddC3
0 ETH0.0038433238
Claims171877512023-05-04 13:58:59565 days ago1683208739IN
0x7eA62d04...6F734ddC3
0 ETH0.0168134767.70835625
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0xAfEbA7f3...ed7B85917
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
Airdrop

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 7 : Airdrop.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.7.6;
pragma experimental ABIEncoderV2 ;

import "@openzeppelin/contracts/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "./Adminable.sol";

contract Airdrop is Adminable {
    using SafeERC20 for IERC20;
    using SafeMath for uint256;
    event TrancheAdded (uint256 tranchId, bytes32 merkleRoot, uint64 startTime, uint64 endTime, uint256 totalAmount);
    event Claimed(uint256 tranchId, address account, uint256 balance);
    event TrancheExpired (uint256 tranchId, uint expireAmount);
    struct Tranche {
        bytes32 merkleRoot;
        uint64 startTime;
        uint64 endTime;
        uint256 totalAmount;
        uint256 claimedAmount;
    }

    IERC20 public token;
    mapping(uint256 => Tranche) public tranches;
    mapping(uint256 => mapping(address => bool)) public claimed;
    uint256 public trancheIdx;

    constructor (IERC20 _token){
        admin = msg.sender;
        token = _token;
    }

    function newTranche(bytes32 merkleRoot, uint64 startTime, uint64 endTime, uint256 totalAmount) external onlyAdmin
    {
        require(endTime > block.timestamp, 'Incorrect endtime');
        uint trancheId = trancheIdx;
        tranches[trancheId] = Tranche(merkleRoot, startTime, endTime, totalAmount, 0);
        trancheIdx = trancheIdx.add(1);
        emit TrancheAdded(trancheId, merkleRoot, startTime, endTime, totalAmount);
    }

    function expireTranche(uint256 _trancheId) external onlyAdmin {
        Tranche memory tranche = tranches[_trancheId];
        require(block.timestamp > tranche.endTime, 'Not End');
        uint expireAmount = tranche.totalAmount.sub(tranche.claimedAmount);
        if (expireAmount > 0) {
            token.safeTransfer(admin, expireAmount);
        }
        delete tranches[_trancheId];
        emit TrancheExpired(_trancheId, expireAmount);
    }

    function claim(address account, uint256 _trancheId, uint256 _balance, bytes32[] calldata _merkleProof) external
    {
        _claim(account, _trancheId, _balance, _merkleProof);
        _disburse(account, _balance);
    }

    function claims(address account, uint256[] calldata _trancheIds, uint256[] calldata _balances, bytes32[][] calldata _merkleProofs) external {
        uint256 len = _trancheIds.length;
        require(len == _balances.length && len == _merkleProofs.length, "Mismatching inputs");
        uint256 totalBalance = 0;
        for (uint256 i = 0; i < len; i ++) {
            _claim(account, _trancheIds[i], _balances[i], _merkleProofs[i]);
            totalBalance = totalBalance.add(_balances[i]);
        }
        _disburse(account, totalBalance);
    }

    function verifyClaim(address account, uint256 _trancheId, uint256 _balance, bytes32[] calldata _merkleProof) external view returns (bool valid) {
        return _verifyClaim(account, tranches[_trancheId].merkleRoot, _balance, _merkleProof);
    }

    function _claim(address account, uint256 _trancheId, uint256 _balance, bytes32[] memory _merkleProof) private {
        require(_trancheId < trancheIdx, "Incorrect trancheId");
        require(tranches[_trancheId].startTime < block.timestamp, "Not Start");
        require(tranches[_trancheId].endTime > block.timestamp, "Expire");
        require(!claimed[_trancheId][account], "Already claimed");
        require(_verifyClaim(account, tranches[_trancheId].merkleRoot, _balance, _merkleProof), "Incorrect merkle proof");
        claimed[_trancheId][account] = true;
        tranches[_trancheId].claimedAmount = tranches[_trancheId].claimedAmount.add(_balance);
        emit Claimed(_trancheId, account, _balance);
    }

    function _verifyClaim(address account, bytes32 root, uint256 _balance, bytes32[] memory _merkleProof) private pure returns (bool valid) {
        bytes32 leaf = keccak256(abi.encodePacked(account, _balance));
        return MerkleProof.verify(_merkleProof, root, leaf);
    }

    function _disburse(address account, uint256 _balance) private {
        if (_balance > 0) {
            token.safeTransfer(account, _balance);
        } else {
            revert("No balance would be transferred");
        }
    }
}

File 2 of 7 : Adminable.sol
// SPDX-License-Identifier: BUSL-1.1


pragma solidity 0.7.6;

abstract contract Adminable {
    address payable public admin;
    address payable public pendingAdmin;
    address payable public developer;

    event NewPendingAdmin(address oldPendingAdmin, address newPendingAdmin);

    event NewAdmin(address oldAdmin, address newAdmin);
    constructor () {
        developer = msg.sender;
    }

    modifier onlyAdmin() {
        require(msg.sender == admin, "caller must be admin");
        _;
    }
    modifier onlyAdminOrDeveloper() {
        require(msg.sender == admin || msg.sender == developer, "caller must be admin or developer");
        _;
    }

    function setPendingAdmin(address payable newPendingAdmin) external virtual onlyAdmin {
        // Save current value, if any, for inclusion in log
        address oldPendingAdmin = pendingAdmin;
        // Store pendingAdmin with value newPendingAdmin
        pendingAdmin = newPendingAdmin;
        // Emit NewPendingAdmin(oldPendingAdmin, newPendingAdmin)
        emit NewPendingAdmin(oldPendingAdmin, newPendingAdmin);
    }

    function acceptAdmin() external virtual {
        require(msg.sender == pendingAdmin, "only pendingAdmin can accept admin");
        // Save current values for inclusion in log
        address oldAdmin = admin;
        address oldPendingAdmin = pendingAdmin;
        // Store admin with value pendingAdmin
        admin = pendingAdmin;
        // Clear the pending value
        pendingAdmin = address(0);
        emit NewAdmin(oldAdmin, admin);
        emit NewPendingAdmin(oldPendingAdmin, pendingAdmin);
    }

}

File 3 of 7 : 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);
            }
        }
    }
}

File 4 of 7 : 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 5 of 7 : 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 6 of 7 : 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 7 of 7 : 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;
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tranchId","type":"uint256"},{"indexed":false,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"balance","type":"uint256"}],"name":"Claimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"NewAdmin","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldPendingAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newPendingAdmin","type":"address"}],"name":"NewPendingAdmin","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tranchId","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"indexed":false,"internalType":"uint64","name":"startTime","type":"uint64"},{"indexed":false,"internalType":"uint64","name":"endTime","type":"uint64"},{"indexed":false,"internalType":"uint256","name":"totalAmount","type":"uint256"}],"name":"TrancheAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tranchId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"expireAmount","type":"uint256"}],"name":"TrancheExpired","type":"event"},{"inputs":[],"name":"acceptAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"admin","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"_trancheId","type":"uint256"},{"internalType":"uint256","name":"_balance","type":"uint256"},{"internalType":"bytes32[]","name":"_merkleProof","type":"bytes32[]"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","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":"address","name":"account","type":"address"},{"internalType":"uint256[]","name":"_trancheIds","type":"uint256[]"},{"internalType":"uint256[]","name":"_balances","type":"uint256[]"},{"internalType":"bytes32[][]","name":"_merkleProofs","type":"bytes32[][]"}],"name":"claims","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"developer","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_trancheId","type":"uint256"}],"name":"expireTranche","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"internalType":"uint64","name":"startTime","type":"uint64"},{"internalType":"uint64","name":"endTime","type":"uint64"},{"internalType":"uint256","name":"totalAmount","type":"uint256"}],"name":"newTranche","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pendingAdmin","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address payable","name":"newPendingAdmin","type":"address"}],"name":"setPendingAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"trancheIdx","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tranches","outputs":[{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"internalType":"uint64","name":"startTime","type":"uint64"},{"internalType":"uint64","name":"endTime","type":"uint64"},{"internalType":"uint256","name":"totalAmount","type":"uint256"},{"internalType":"uint256","name":"claimedAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"_trancheId","type":"uint256"},{"internalType":"uint256","name":"_balance","type":"uint256"},{"internalType":"bytes32[]","name":"_merkleProof","type":"bytes32[]"}],"name":"verifyClaim","outputs":[{"internalType":"bool","name":"valid","type":"bool"}],"stateMutability":"view","type":"function"}]

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c80638c593fbf1161008c578063d5efd20a11610066578063d5efd20a146101c4578063eb0d07f5146101d7578063f851a440146101ea578063fc0c546a146101f2576100ea565b80638c593fbf14610196578063ca4b208b146101a9578063d5735122146101b1576100ea565b8063172bd6de116100c8578063172bd6de14610137578063267822471461014a57806326c259621461015f5780634dd18bf514610183576100ea565b80630876bc80146100ef5780630e18b6811461010d578063120aa87714610117575b600080fd5b6100f76101fa565b60405161010491906113af565b60405180910390f35b610115610200565b005b61012a610125366004611198565b610300565b60405161010491906111fd565b6101156101453660046110d6565b610320565b610152610370565b60405161010491906111e9565b61017261016d366004611180565b61037f565b604051610104959493929190611208565b610115610191366004611012565b6103ba565b6101156101a436600461113d565b610473565b6101526105f3565b6101156101bf36600461102e565b610602565b6101156101d2366004611180565b6106fd565b61012a6101e53660046110d6565b610884565b6101526108db565b6101526108ea565b60065481565b6001546001600160a01b031633146102495760405162461bcd60e51b81526004018080602001828103825260228152602001806114706022913960400191505060405180910390fd5b60008054600180546001600160a01b038082166001600160a01b031980861682179687905590921690925560408051938316808552949092166020840152815190927ff9ffabca9c8276e99321725bcb43fb076a6c66a54b7f21c4e8146d8519b417dc92908290030190a1600154604080516001600160a01b038085168252909216602083015280517fca4f2f25d0898edd99413412fb94012f9e54ec8142f9b093e7720646a95b16a99281900390910190a15050565b600560209081526000928352604080842090915290825290205460ff1681565b61035f8585858585808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506108f992505050565b6103698584610aad565b5050505050565b6001546001600160a01b031681565b600460205260009081526040902080546001820154600283015460039093015491926001600160401b0380831693600160401b909304169185565b6000546001600160a01b03163314610410576040805162461bcd60e51b815260206004820152601460248201527331b0b63632b91036bab9ba1031329030b236b4b760611b604482015290519081900360640190fd5b600180546001600160a01b038381166001600160a01b0319831681179093556040805191909216808252602082019390935281517fca4f2f25d0898edd99413412fb94012f9e54ec8142f9b093e7720646a95b16a9929181900390910190a15050565b6000546001600160a01b031633146104c9576040805162461bcd60e51b815260206004820152601460248201527331b0b63632b91036bab9ba1031329030b236b4b760611b604482015290519081900360640190fd5b42826001600160401b0316116104fa5760405162461bcd60e51b81526004016104f190611384565b60405180910390fd5b600680546040805160a0810182528781526001600160401b038088166020808401918252888316848601908152606085018981526000608087018181528982526004909452969096209451855591516001808601805494518616600160401b026fffffffffffffffff0000000000000000199390961667ffffffffffffffff19909516949094179190911693909317909155925160028301559151600390910155915490916105a99190610aeb565b6006556040517f968bad38b8df86ae3cada01f760301ebb2788931075ddfc0402d619fca5ff58a906105e490839088908890889088906113d7565b60405180910390a15050505050565b6002546001600160a01b031681565b84838114801561061157508082145b61062d5760405162461bcd60e51b81526004016104f190611358565b6000805b828110156106e7576106b88a8a8a8481811061064957fe5b9050602002013589898581811061065c57fe5b9050602002013588888681811061066f57fe5b90506020028101906106819190611411565b808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506108f992505050565b6106dd8787838181106106c757fe5b9050602002013583610aeb90919063ffffffff16565b9150600101610631565b506106f28982610aad565b505050505050505050565b6000546001600160a01b03163314610753576040805162461bcd60e51b815260206004820152601460248201527331b0b63632b91036bab9ba1031329030b236b4b760611b604482015290519081900360640190fd5b600081815260046020908152604091829020825160a0810184528154815260018201546001600160401b0380821694830194909452600160401b9004909216928201839052600281015460608301526003015460808201529042116107ca5760405162461bcd60e51b81526004016104f1906112e7565b60006107e782608001518360600151610b4c90919063ffffffff16565b9050801561080c5760005460035461080c916001600160a01b03918216911683610ba9565b6000838152600460205260408082208281556001810180546fffffffffffffffffffffffffffffffff191690556002810183905560030191909155517f060e2b3a5cc13dc722cd8480a81cfc19f590da5d72b6918a7fee89f5e4ae35b5906108779085908490611403565b60405180910390a1505050565b600084815260046020908152604080832054815185840281810185019093528581526108d1938a9389929189918991829190850190849080828437600092019190915250610c0092505050565b9695505050505050565b6000546001600160a01b031681565b6003546001600160a01b031681565b600654831061091a5760405162461bcd60e51b81526004016104f190611308565b600083815260046020526040902060010154426001600160401b03909116106109555760405162461bcd60e51b81526004016104f190611335565b60008381526004602052604090206001015442600160401b9091046001600160401b0316116109965760405162461bcd60e51b81526004016104f190611267565b60008381526005602090815260408083206001600160a01b038816845290915290205460ff16156109d95760405162461bcd60e51b81526004016104f190611287565b6000838152600460205260409020546109f59085908484610c00565b610a115760405162461bcd60e51b81526004016104f190611237565b60008381526005602090815260408083206001600160a01b03881684528252808320805460ff191660011790558583526004909152902060030154610a569083610aeb565b6000848152600460205260409081902060030191909155517f4ec90e965519d92681267467f775ada5bd214aa92c0dc93d90a5e880ce9ed02690610a9f908590879086906113b8565b60405180910390a150505050565b8015610acf57600354610aca906001600160a01b03168383610ba9565b610ae7565b60405162461bcd60e51b81526004016104f1906112b0565b5050565b600082820183811015610b45576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b600082821115610ba3576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610bfb908490610c39565b505050565b6000808584604051602001610c169291906111c7565b6040516020818303038152906040528051906020012090506108d1838683610cea565b6000610c8e826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610d939092919063ffffffff16565b805190915015610bfb57808060200190516020811015610cad57600080fd5b5051610bfb5760405162461bcd60e51b815260040180806020018281038252602a8152602001806114b8602a913960400191505060405180910390fd5b600081815b8551811015610d88576000868281518110610d0657fe5b60200260200101519050808311610d4d5782816040516020018083815260200182815260200192505050604051602081830303815290604052805190602001209250610d7f565b808360405160200180838152602001828152602001925050506040516020818303038152906040528051906020012092505b50600101610cef565b509092149392505050565b6060610da28484600085610daa565b949350505050565b606082471015610deb5760405162461bcd60e51b81526004018080602001828103825260268152602001806114926026913960400191505060405180910390fd5b610df485610f05565b610e45576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b600080866001600160a01b031685876040518082805190602001908083835b60208310610e835780518252601f199092019160209182019101610e64565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114610ee5576040519150601f19603f3d011682016040523d82523d6000602084013e610eea565b606091505b5091509150610efa828286610f0f565b979650505050505050565b803b15155b919050565b60608315610f1e575081610b45565b825115610f2e5782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f78578181015183820152602001610f60565b50505050905090810190601f168015610fa55780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b60008083601f840112610fc4578182fd5b5081356001600160401b03811115610fda578182fd5b6020830191508360208083028501011115610ff457600080fd5b9250929050565b80356001600160401b0381168114610f0a57600080fd5b600060208284031215611023578081fd5b8135610b4581611457565b60008060008060008060006080888a031215611048578283fd5b873561105381611457565b965060208801356001600160401b038082111561106e578485fd5b61107a8b838c01610fb3565b909850965060408a0135915080821115611092578485fd5b61109e8b838c01610fb3565b909650945060608a01359150808211156110b6578384fd5b506110c38a828b01610fb3565b989b979a50959850939692959293505050565b6000806000806000608086880312156110ed578081fd5b85356110f881611457565b9450602086013593506040860135925060608601356001600160401b03811115611120578182fd5b61112c88828901610fb3565b969995985093965092949392505050565b60008060008060808587031215611152578384fd5b8435935061116260208601610ffb565b925061117060408601610ffb565b9396929550929360600135925050565b600060208284031215611191578081fd5b5035919050565b600080604083850312156111aa578182fd5b8235915060208301356111bc81611457565b809150509250929050565b60609290921b6bffffffffffffffffffffffff19168252601482015260340190565b6001600160a01b0391909116815260200190565b901515815260200190565b9485526001600160401b0393841660208601529190921660408401526060830191909152608082015260a00190565b60208082526016908201527524b731b7b93932b1ba1036b2b935b63290383937b7b360511b604082015260600190565b60208082526006908201526545787069726560d01b604082015260600190565b6020808252600f908201526e105b1c9958591e4818db185a5b5959608a1b604082015260600190565b6020808252601f908201527f4e6f2062616c616e636520776f756c64206265207472616e7366657272656400604082015260600190565b602080825260079082015266139bdd08115b9960ca1b604082015260600190565b602080825260139082015272125b98dbdc9c9958dd081d1c985b98da195259606a1b604082015260600190565b602080825260099082015268139bdd0814dd185c9d60ba1b604082015260600190565b6020808252601290820152714d69736d61746368696e6720696e7075747360701b604082015260600190565b602080825260119082015270496e636f727265637420656e6474696d6560781b604082015260600190565b90815260200190565b9283526001600160a01b03919091166020830152604082015260600190565b94855260208501939093526001600160401b039182166040850152166060830152608082015260a00190565b918252602082015260400190565b6000808335601e19843603018112611427578283fd5b8301803591506001600160401b03821115611440578283fd5b6020908101925081023603821315610ff457600080fd5b6001600160a01b038116811461146c57600080fd5b5056fe6f6e6c792070656e64696e6741646d696e2063616e206163636570742061646d696e416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c5361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a2646970667358221220e73d971b0e06dd744edeb26a32f9c5db2e755f07274986c902ce0ef2658ceb2a64736f6c63430007060033

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.