Source Code
Latest 25 from a total of 49,607 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Claim | 23527467 | 32 hrs ago | IN | 0 ETH | 0.00006489 | ||||
Claim | 23527467 | 32 hrs ago | IN | 0 ETH | 0.00006489 | ||||
Claim | 23525740 | 38 hrs ago | IN | 0 ETH | 0.0000409 | ||||
Claim | 23521625 | 2 days ago | IN | 0 ETH | 0.0000722 | ||||
Claim | 23521625 | 2 days ago | IN | 0 ETH | 0.00006085 | ||||
Claim | 23521625 | 2 days ago | IN | 0 ETH | 0.00006085 | ||||
Claim | 23521625 | 2 days ago | IN | 0 ETH | 0.00003593 | ||||
Claim | 23521625 | 2 days ago | IN | 0 ETH | 0.00005656 | ||||
Claim | 23489347 | 6 days ago | IN | 0 ETH | 0.00008943 | ||||
Claim | 23489343 | 6 days ago | IN | 0 ETH | 0.00008915 | ||||
Claim | 23489342 | 6 days ago | IN | 0 ETH | 0.0000883 | ||||
Claim | 23489340 | 6 days ago | IN | 0 ETH | 0.00008978 | ||||
Claim | 23489337 | 6 days ago | IN | 0 ETH | 0.00008675 | ||||
Claim | 23489334 | 6 days ago | IN | 0 ETH | 0.00008874 | ||||
Claim | 23488542 | 6 days ago | IN | 0 ETH | 0.00008839 | ||||
Claim | 23488368 | 6 days ago | IN | 0 ETH | 0.00010313 | ||||
Claim | 23488349 | 6 days ago | IN | 0 ETH | 0.00011079 | ||||
Claim | 23488053 | 6 days ago | IN | 0 ETH | 0.00009305 | ||||
Claim | 23488053 | 6 days ago | IN | 0 ETH | 0.00009303 | ||||
Claim | 23488027 | 6 days ago | IN | 0 ETH | 0.00008915 | ||||
Claim | 23488009 | 6 days ago | IN | 0 ETH | 0.00008242 | ||||
Claim | 23487976 | 6 days ago | IN | 0 ETH | 0.00008649 | ||||
Claim | 23487975 | 6 days ago | IN | 0 ETH | 0.00008696 | ||||
Claim | 23487973 | 6 days ago | IN | 0 ETH | 0.00008793 | ||||
Claim | 23487959 | 6 days ago | IN | 0 ETH | 0.00008874 |
Latest 1 internal transaction
Advanced mode:
Parent Transaction Hash | Method | Block |
From
|
To
|
|||
---|---|---|---|---|---|---|---|
0x61010060 | 23362432 | 24 days ago | Contract Creation | 0 ETH |
Cross-Chain Transactions
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x89fC3007...425182d52 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
TokenDistributor
Compiler Version
v0.8.19+commit.7dd6d404
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.19; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; /** * @title TokenDistributor - Merkle tree based token distribution contract * @notice This contract allows users to claim tokens based on merkle proofs * @dev The contract uses merkle trees to efficiently distribute tokens to a large number of recipients * Only the operator can set the merkle root and start time * Only the owner can withdraw remaining tokens after the distribution period ends */ contract TokenDistributor is ReentrancyGuard { using SafeERC20 for IERC20; /// @notice Distribution period duration (14 days) uint256 public constant DURATION = 14 days; /// @notice Maximum allowed start time offset from current time (90 days) uint256 public constant MAX_START_TIME = 90 days; // ============ Immutable Variables ============ /// @notice Address of the token being distributed address public immutable token; /// @notice Init Total amount of tokens to be distributed uint256 public immutable initialTotalAmount; /// @notice Address authorized to set merkle root and start time address public immutable operator; /// @notice Address authorized to withdraw remaining tokens address public immutable owner; // ============ Mutable State Variables ============ /// @notice Merkle root hash for validating claims bytes32 public merkleRoot; /// @notice Total amount of tokens claimed uint256 public totalClaimed; /// @notice Timestamp when the distribution starts /// @notice Timestamp when the distribution ends /// @dev Packed together to save storage slot and reduce gas cost uint64 public startTime; uint64 public endTime; /// @notice Mapping of addresses to their claimed amounts mapping(address => uint256) public claimedAmounts; // Custom errors for gas-efficient error handling error AlreadyStarted(); // It has already started error InvalidAmount(); // Amount cannot be zero error InvalidProof(); // Invalid merkle proof error InvalidRoot(); // Invalid merkle root error InvalidTime(); // Invalid timestamp error NoRoot(); // Merkle root not set error NoTokens(); // No tokens available error OnlyOperator(); // Only operator can call this function error OnlyOwner(); // Only owner can call this function error StartTimeNotSet(); // Start time not set error TooEarly(); // Distribution hasn't started yet error TooLate(); // Distribution has ended /// @notice Emitted when start time is set event TimeSet(uint64 startTime, uint64 endTime); /// @notice Emitted when merkle root is set event MerkleRootSet(bytes32 merkleRoot); /// @notice Emitted when tokens are claimed event Claimed(address indexed account, uint256 amount); /// @notice Emitted when remaining tokens are withdrawn event Withdrawn(address to, uint256 amount); /// @notice Restricts access to operator only modifier onlyOperator() { if (msg.sender != operator) revert OnlyOperator(); _; } /// @notice Restricts access to owner only modifier onlyOwner() { if (msg.sender != owner) revert OnlyOwner(); _; } /// @notice Initialize distributor contract /// @param _owner Owner address who can withdraw remaining tokens /// @param _operator Operator address who can set merkle root and start time /// @param _token Token address to be distributed /// @param _initialTotalAmount Initial Total amount of tokens to be distributed constructor(address _owner, address _operator, address _token, uint256 _initialTotalAmount) { owner = _owner; operator = _operator; token = _token; initialTotalAmount = _initialTotalAmount; } /// @notice Set airdrop start time /// @dev Can be called multiple times by the operator with the following restrictions: /// 1. Cannot be set if distribution has already started /// 2. Start time must be greater than current block timestamp /// 3. Start time must be less than or equal to current time + 90 days /// 4. Can be set multiple times as long as distribution hasn't started /// @param _startTime Start timestamp (must be in the future but within MAX_START_TIME) function setTime(uint256 _startTime) external onlyOperator { if (_startTime <= block.timestamp) revert InvalidTime(); if (_startTime > block.timestamp + MAX_START_TIME) revert InvalidTime(); if (block.timestamp >= startTime && startTime > 0) revert AlreadyStarted(); startTime = uint64(_startTime); endTime = uint64(_startTime + DURATION); emit TimeSet(startTime, endTime); } /// @notice Set merkle root for claim validation /// @dev Can be called multiple times by the operator to update the merkle root /// @param _merkleRoot Merkle root hash function setMerkleRoot(bytes32 _merkleRoot) external onlyOperator { if (_merkleRoot == bytes32(0)) revert InvalidRoot(); merkleRoot = _merkleRoot; emit MerkleRootSet(_merkleRoot); } /// @notice Withdraw remaining tokens after distribution ends /// @dev Can only be called by owner after the distribution period ends or not set the startTime function withdraw() external onlyOwner { // Check if distribution has ended or not set the startTime if (block.timestamp <= endTime) revert InvalidTime(); uint256 balance = IERC20(token).balanceOf(address(this)); if (balance == 0) revert NoTokens(); IERC20(token).safeTransfer(msg.sender, balance); emit Withdrawn(msg.sender, balance); } /// @notice Claim reward tokens using merkle proof /// @dev Supports single claim (when root set once) or incremental distributions /// by adjusting maxAmount without resetting previous claims /// @param maxAmount Maximum claimable amount for this address (from merkle tree) /// @param proof Merkle proof to validate the claim function claim(uint256 maxAmount, bytes32[] calldata proof) external nonReentrant { // Validate distribution state if (startTime == 0) revert StartTimeNotSet(); if (block.timestamp < startTime) revert TooEarly(); if (block.timestamp > endTime) revert TooLate(); if (merkleRoot == bytes32(0)) revert NoRoot(); // Check if user has already claimed the maximum amount uint256 claimedAmount = claimedAmounts[msg.sender]; if (maxAmount <= claimedAmount) revert InvalidAmount(); // Verify merkle proof bytes32 leaf = keccak256(abi.encodePacked(msg.sender, maxAmount)); if (!MerkleProof.verify(proof, merkleRoot, leaf)) revert InvalidProof(); // Calculate pending amount to claim uint256 pendingAmount; unchecked { pendingAmount = maxAmount - claimedAmount; // Safe: maxAmount > claimedAmount verified above } // Update claimed amount before transfer (CEI pattern) claimedAmounts[msg.sender] = maxAmount; // Update total claimed amount totalClaimed += pendingAmount; // Transfer tokens to claimant IERC20(token).safeTransfer(msg.sender, pendingAmount); emit Claimed(msg.sender, pendingAmount); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be _NOT_ENTERED require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; import "../extensions/draft-IERC20Permit.sol"; import "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove( IERC20 token, address spender, uint256 value ) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance( IERC20 token, address spender, uint256 value ) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } function safePermit( IERC20Permit token, address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) internal { uint256 nonceBefore = token.nonces(owner); token.permit(owner, spender, value, deadline, v, r, s); uint256 nonceAfter = token.nonces(owner); require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed"); } /** * @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 require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @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 * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "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"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, 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) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, 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) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // 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 /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/MerkleProof.sol) pragma solidity ^0.8.0; /** * @dev These functions deal with verification of Merkle Tree proofs. * * The tree and the proofs can be generated using our * https://github.com/OpenZeppelin/merkle-tree[JavaScript library]. * You will find a quickstart guide in the readme. * * WARNING: You should avoid using leaf values that are 64 bytes long prior to * hashing, or use a hash function other than keccak256 for hashing leaves. * This is because the concatenation of a sorted pair of internal nodes in * the merkle tree could be reinterpreted as a leaf value. * OpenZeppelin's JavaScript library generates merkle trees that are safe * against this attack out of the box. */ 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) { return processProof(proof, leaf) == root; } /** * @dev Calldata version of {verify} * * _Available since v4.7._ */ function verifyCalldata( bytes32[] calldata proof, bytes32 root, bytes32 leaf ) internal pure returns (bool) { return processProofCalldata(proof, leaf) == root; } /** * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt * hash matches the root of the tree. When processing the proof, the pairs * of leafs & pre-images are assumed to be sorted. * * _Available since v4.4._ */ function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { computedHash = _hashPair(computedHash, proof[i]); } return computedHash; } /** * @dev Calldata version of {processProof} * * _Available since v4.7._ */ function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { computedHash = _hashPair(computedHash, proof[i]); } return computedHash; } /** * @dev Returns true if the `leaves` can be simultaneously proven to be a part of a merkle tree defined by * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}. * * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details. * * _Available since v4.7._ */ function multiProofVerify( bytes32[] memory proof, bool[] memory proofFlags, bytes32 root, bytes32[] memory leaves ) internal pure returns (bool) { return processMultiProof(proof, proofFlags, leaves) == root; } /** * @dev Calldata version of {multiProofVerify} * * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details. * * _Available since v4.7._ */ function multiProofVerifyCalldata( bytes32[] calldata proof, bool[] calldata proofFlags, bytes32 root, bytes32[] memory leaves ) internal pure returns (bool) { return processMultiProofCalldata(proof, proofFlags, leaves) == root; } /** * @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction * proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another * leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false * respectively. * * CAUTION: Not all merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree * is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the * tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer). * * _Available since v4.7._ */ function processMultiProof( bytes32[] memory proof, bool[] memory proofFlags, bytes32[] memory leaves ) internal pure returns (bytes32 merkleRoot) { // This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of // the merkle tree. uint256 leavesLen = leaves.length; uint256 totalHashes = proofFlags.length; // Check proof validity. require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof"); // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop". bytes32[] memory hashes = new bytes32[](totalHashes); uint256 leafPos = 0; uint256 hashPos = 0; uint256 proofPos = 0; // At each step, we compute the next hash using two values: // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we // get the next hash. // - depending on the flag, either another value for the "main queue" (merging branches) or an element from the // `proof` array. for (uint256 i = 0; i < totalHashes; i++) { bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]; bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++]; hashes[i] = _hashPair(a, b); } if (totalHashes > 0) { return hashes[totalHashes - 1]; } else if (leavesLen > 0) { return leaves[0]; } else { return proof[0]; } } /** * @dev Calldata version of {processMultiProof}. * * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details. * * _Available since v4.7._ */ function processMultiProofCalldata( bytes32[] calldata proof, bool[] calldata proofFlags, bytes32[] memory leaves ) internal pure returns (bytes32 merkleRoot) { // This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of // the merkle tree. uint256 leavesLen = leaves.length; uint256 totalHashes = proofFlags.length; // Check proof validity. require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof"); // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop". bytes32[] memory hashes = new bytes32[](totalHashes); uint256 leafPos = 0; uint256 hashPos = 0; uint256 proofPos = 0; // At each step, we compute the next hash using two values: // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we // get the next hash. // - depending on the flag, either another value for the "main queue" (merging branches) or an element from the // `proof` array. for (uint256 i = 0; i < totalHashes; i++) { bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]; bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++]; hashes[i] = _hashPair(a, b); } if (totalHashes > 0) { return hashes[totalHashes - 1]; } else if (leavesLen > 0) { return leaves[0]; } else { return proof[0]; } } function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) { return a < b ? _efficientHash(a, b) : _efficientHash(b, a); } function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) { /// @solidity memory-safe-assembly assembly { mstore(0x00, a) mstore(0x20, b) value := keccak256(0x00, 0x40) } } }
{ "remappings": [ "@forge-std/=lib/forge-std/src/", "@openzeppelin/=lib/openzeppelin-contracts/", "ds-test/=lib/forge-std/lib/ds-test/src/", "forge-gas-snapshot/=lib/forge-gas-snapshot/src/", "forge-std/=lib/forge-std/src/", "openzeppelin-contracts/=lib/openzeppelin-contracts/" ], "optimizer": { "enabled": true, "runs": 10000 }, "evmVersion": "paris", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_operator","type":"address"},{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_initialTotalAmount","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadyStarted","type":"error"},{"inputs":[],"name":"InvalidAmount","type":"error"},{"inputs":[],"name":"InvalidProof","type":"error"},{"inputs":[],"name":"InvalidRoot","type":"error"},{"inputs":[],"name":"InvalidTime","type":"error"},{"inputs":[],"name":"NoRoot","type":"error"},{"inputs":[],"name":"NoTokens","type":"error"},{"inputs":[],"name":"OnlyOperator","type":"error"},{"inputs":[],"name":"OnlyOwner","type":"error"},{"inputs":[],"name":"StartTimeNotSet","type":"error"},{"inputs":[],"name":"TooEarly","type":"error"},{"inputs":[],"name":"TooLate","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Claimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"merkleRoot","type":"bytes32"}],"name":"MerkleRootSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"startTime","type":"uint64"},{"indexed":false,"internalType":"uint64","name":"endTime","type":"uint64"}],"name":"TimeSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[],"name":"DURATION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_START_TIME","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"maxAmount","type":"uint256"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"claimedAmounts","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"endTime","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"initialTotalAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"merkleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"operator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_merkleRoot","type":"bytes32"}],"name":"setMerkleRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_startTime","type":"uint256"}],"name":"setTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startTime","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalClaimed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
0x61010060405234801561001157600080fd5b506040516112f83803806112f883398101604081905261003091610073565b60016000556001600160a01b0393841660e05291831660c05290911660805260a0526100be565b80516001600160a01b038116811461006e57600080fd5b919050565b6000806000806080858703121561008957600080fd5b61009285610057565b93506100a060208601610057565b92506100ae60408601610057565b6060959095015193969295505050565b60805160a05160c05160e0516111d76101216000396000818161022101526107c001526000818161018e015281816105a401526109e4015260006102520152600081816102820152818161051e01528181610899015261096f01526111d76000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806371417b321161009757806393ad14601161006657806393ad146014610243578063c46e6f671461024d578063d54ad2a114610274578063fc0c546a1461027d57600080fd5b806371417b32146101d557806378e97925146101f55780637cb64759146102095780638da5cb5b1461021c57600080fd5b80633197cbb6116100d35780633197cbb6146101355780633beb26c41461016e5780633ccfd60b14610181578063570ca7351461018957600080fd5b80631be05289146100fa5780632eb4a7ab146101175780632f52ebb714610120575b600080fd5b6101046212750081565b6040519081526020015b60405180910390f35b61010460015481565b61013361012e366004610f5e565b6102a4565b005b6003546101559068010000000000000000900467ffffffffffffffff1681565b60405167ffffffffffffffff909116815260200161010e565b61013361017c366004610fdd565b61058c565b6101336107a8565b6101b07f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161010e565b6101046101e3366004610ff6565b60046020526000908152604090205481565b6003546101559067ffffffffffffffff1681565b610133610217366004610fdd565b6109cc565b6101b07f000000000000000000000000000000000000000000000000000000000000000081565b6101046276a70081565b6101047f000000000000000000000000000000000000000000000000000000000000000081565b61010460025481565b6101b07f000000000000000000000000000000000000000000000000000000000000000081565b6102ac610aa7565b60035467ffffffffffffffff166000036102f2576040517f376aab0100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60035467ffffffffffffffff16421015610338576040517f085de62500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60035468010000000000000000900467ffffffffffffffff1642111561038a576040517fecdd1c2900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001546103c3576040517fcccc270000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3360009081526004602052604090205480841161040c576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517fffffffffffffffffffffffffffffffffffffffff0000000000000000000000003360601b166020820152603481018590526000906054016040516020818303038152906040528051906020012090506104a0848480806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250506001549150849050610b1f565b6104d6576040517f09bde33900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b33600090815260046020526040812086905560028054848803928392916104fe90849061105b565b90915550610545905073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000163383610b35565b60405181815233907fd8138f8a3f377c5259ca548e70e4c2de94f129f5a11036a15b69513cba2b426a9060200160405180910390a25050506105876001600055565b505050565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016146105fb576040517f27e1f1e500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b428111610634576040517f6f7eac2600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6106416276a7004261105b565b81111561067a576040517f6f7eac2600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60035467ffffffffffffffff1642108015906106a1575060035467ffffffffffffffff1615155b156106d8576040517f1fbde44500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600380547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff8316179055610719621275008261105b565b6003805467ffffffffffffffff928316680100000000000000009081027fffffffffffffffffffffffffffffffff0000000000000000ffffffffffffffff831681179384905560408051918616938616939093178152920490921660208201527fc9b314c8a07c5f83e76af625ee63e74d2ec57a51f82a471792a9799bda395e4091015b60405180910390a150565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610817576040517f5fc483c500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60035468010000000000000000900467ffffffffffffffff164211610868576040517f6f7eac2600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa1580156108f5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610919919061106e565b905080600003610955576040517fdf95788300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61099673ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000163383610b35565b60408051338152602081018390527f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5910161079d565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610a3b576040517f27e1f1e500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80610a72576040517f504570e300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60018190556040518181527f42cbc405e4dbf1b691e85b9a34b08ecfcf7a9ad9078bf4d645ccfa1fac11c10b9060200161079d565b600260005403610b18576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b6002600055565b600082610b2c8584610bc2565b14949350505050565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052610587908490610c11565b600081815b8451811015610c0757610bf382868381518110610be657610be6611087565b6020026020010151610d1d565b915080610bff816110b6565b915050610bc7565b5090505b92915050565b6000610c73826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16610d4f9092919063ffffffff16565b8051909150156105875780806020019051810190610c9191906110ee565b610587576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610b0f565b6000818310610d39576000828152602084905260409020610d48565b60008381526020839052604090205b9392505050565b6060610d5e8484600085610d66565b949350505050565b606082471015610df8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610b0f565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051610e219190611134565b60006040518083038185875af1925050503d8060008114610e5e576040519150601f19603f3d011682016040523d82523d6000602084013e610e63565b606091505b5091509150610e7487838387610e7f565b979650505050505050565b60608315610f15578251600003610f0e5773ffffffffffffffffffffffffffffffffffffffff85163b610f0e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610b0f565b5081610d5e565b610d5e8383815115610f2a5781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0f9190611150565b600080600060408486031215610f7357600080fd5b83359250602084013567ffffffffffffffff80821115610f9257600080fd5b818601915086601f830112610fa657600080fd5b813581811115610fb557600080fd5b8760208260051b8501011115610fca57600080fd5b6020830194508093505050509250925092565b600060208284031215610fef57600080fd5b5035919050565b60006020828403121561100857600080fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610d4857600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b80820180821115610c0b57610c0b61102c565b60006020828403121561108057600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036110e7576110e761102c565b5060010190565b60006020828403121561110057600080fd5b81518015158114610d4857600080fd5b60005b8381101561112b578181015183820152602001611113565b50506000910152565b60008251611146818460208701611110565b9190910192915050565b602081526000825180602084015261116f816040850160208701611110565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fea264697066735822122023273454cea535b1283ba2fc7cab4dd99d3ec817f3ee0341717ff055aa8e508664736f6c63430008130033000000000000000000000000abd12e0e0987133b6f457640ec1b74790202f4ef0000000000000000000000007a39c61adbd6d4767d858da6ce2ae3253780ea2e000000000000000000000000f0db65d17e30a966c2ae6a21f6bba71cea6e9754000000000000000000000000000000000000000000022692484ce19d09000000
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806371417b321161009757806393ad14601161006657806393ad146014610243578063c46e6f671461024d578063d54ad2a114610274578063fc0c546a1461027d57600080fd5b806371417b32146101d557806378e97925146101f55780637cb64759146102095780638da5cb5b1461021c57600080fd5b80633197cbb6116100d35780633197cbb6146101355780633beb26c41461016e5780633ccfd60b14610181578063570ca7351461018957600080fd5b80631be05289146100fa5780632eb4a7ab146101175780632f52ebb714610120575b600080fd5b6101046212750081565b6040519081526020015b60405180910390f35b61010460015481565b61013361012e366004610f5e565b6102a4565b005b6003546101559068010000000000000000900467ffffffffffffffff1681565b60405167ffffffffffffffff909116815260200161010e565b61013361017c366004610fdd565b61058c565b6101336107a8565b6101b07f0000000000000000000000007a39c61adbd6d4767d858da6ce2ae3253780ea2e81565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161010e565b6101046101e3366004610ff6565b60046020526000908152604090205481565b6003546101559067ffffffffffffffff1681565b610133610217366004610fdd565b6109cc565b6101b07f000000000000000000000000abd12e0e0987133b6f457640ec1b74790202f4ef81565b6101046276a70081565b6101047f000000000000000000000000000000000000000000022692484ce19d0900000081565b61010460025481565b6101b07f000000000000000000000000f0db65d17e30a966c2ae6a21f6bba71cea6e975481565b6102ac610aa7565b60035467ffffffffffffffff166000036102f2576040517f376aab0100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60035467ffffffffffffffff16421015610338576040517f085de62500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60035468010000000000000000900467ffffffffffffffff1642111561038a576040517fecdd1c2900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001546103c3576040517fcccc270000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3360009081526004602052604090205480841161040c576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517fffffffffffffffffffffffffffffffffffffffff0000000000000000000000003360601b166020820152603481018590526000906054016040516020818303038152906040528051906020012090506104a0848480806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250506001549150849050610b1f565b6104d6576040517f09bde33900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b33600090815260046020526040812086905560028054848803928392916104fe90849061105b565b90915550610545905073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000f0db65d17e30a966c2ae6a21f6bba71cea6e9754163383610b35565b60405181815233907fd8138f8a3f377c5259ca548e70e4c2de94f129f5a11036a15b69513cba2b426a9060200160405180910390a25050506105876001600055565b505050565b3373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000007a39c61adbd6d4767d858da6ce2ae3253780ea2e16146105fb576040517f27e1f1e500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b428111610634576040517f6f7eac2600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6106416276a7004261105b565b81111561067a576040517f6f7eac2600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60035467ffffffffffffffff1642108015906106a1575060035467ffffffffffffffff1615155b156106d8576040517f1fbde44500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600380547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff8316179055610719621275008261105b565b6003805467ffffffffffffffff928316680100000000000000009081027fffffffffffffffffffffffffffffffff0000000000000000ffffffffffffffff831681179384905560408051918616938616939093178152920490921660208201527fc9b314c8a07c5f83e76af625ee63e74d2ec57a51f82a471792a9799bda395e4091015b60405180910390a150565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000abd12e0e0987133b6f457640ec1b74790202f4ef1614610817576040517f5fc483c500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60035468010000000000000000900467ffffffffffffffff164211610868576040517f6f7eac2600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f000000000000000000000000f0db65d17e30a966c2ae6a21f6bba71cea6e975473ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa1580156108f5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610919919061106e565b905080600003610955576040517fdf95788300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61099673ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000f0db65d17e30a966c2ae6a21f6bba71cea6e9754163383610b35565b60408051338152602081018390527f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5910161079d565b3373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000007a39c61adbd6d4767d858da6ce2ae3253780ea2e1614610a3b576040517f27e1f1e500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80610a72576040517f504570e300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60018190556040518181527f42cbc405e4dbf1b691e85b9a34b08ecfcf7a9ad9078bf4d645ccfa1fac11c10b9060200161079d565b600260005403610b18576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b6002600055565b600082610b2c8584610bc2565b14949350505050565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052610587908490610c11565b600081815b8451811015610c0757610bf382868381518110610be657610be6611087565b6020026020010151610d1d565b915080610bff816110b6565b915050610bc7565b5090505b92915050565b6000610c73826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16610d4f9092919063ffffffff16565b8051909150156105875780806020019051810190610c9191906110ee565b610587576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610b0f565b6000818310610d39576000828152602084905260409020610d48565b60008381526020839052604090205b9392505050565b6060610d5e8484600085610d66565b949350505050565b606082471015610df8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610b0f565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051610e219190611134565b60006040518083038185875af1925050503d8060008114610e5e576040519150601f19603f3d011682016040523d82523d6000602084013e610e63565b606091505b5091509150610e7487838387610e7f565b979650505050505050565b60608315610f15578251600003610f0e5773ffffffffffffffffffffffffffffffffffffffff85163b610f0e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610b0f565b5081610d5e565b610d5e8383815115610f2a5781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0f9190611150565b600080600060408486031215610f7357600080fd5b83359250602084013567ffffffffffffffff80821115610f9257600080fd5b818601915086601f830112610fa657600080fd5b813581811115610fb557600080fd5b8760208260051b8501011115610fca57600080fd5b6020830194508093505050509250925092565b600060208284031215610fef57600080fd5b5035919050565b60006020828403121561100857600080fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610d4857600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b80820180821115610c0b57610c0b61102c565b60006020828403121561108057600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036110e7576110e761102c565b5060010190565b60006020828403121561110057600080fd5b81518015158114610d4857600080fd5b60005b8381101561112b578181015183820152602001611113565b50506000910152565b60008251611146818460208701611110565b9190910192915050565b602081526000825180602084015261116f816040850160208701611110565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fea264697066735822122023273454cea535b1283ba2fc7cab4dd99d3ec817f3ee0341717ff055aa8e508664736f6c63430008130033
Deployed Bytecode Sourcemap
673:6867:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;812:42;;847:7;812:42;;;;;160:25:7;;;148:2;133:18;812:42:0;;;;;;;;1575:25;;;;;;6251:1287;;;;;;:::i;:::-;;:::i;:::-;;1895:21;;;;;;;;;;;;;;;1240:18:7;1228:31;;;1210:50;;1198:2;1183:18;1895:21:0;1066:200:7;4502:429:0;;;;;;:::i;:::-;;:::i;5501:392::-;;;:::i;1321:33::-;;;;;;;;1632:42:7;1620:55;;;1602:74;;1590:2;1575:18;1321:33:0;1456:226:7;1985:49:0;;;;;;:::i;:::-;;;;;;;;;;;;;;1866:23;;;;;;;;;5118:210;;;;;;:::i;:::-;;:::i;1425:30::-;;;;;939:48;;980:7;939:48;;1202:43;;;;;1654:27;;;;;;1103:30;;;;;6251:1287;2261:21:1;:19;:21::i;:::-;6386:9:0::1;::::0;::::1;;;:14:::0;6382:44:::1;;6409:17;;;;;;;;;;;;;;6382:44;6458:9;::::0;::::1;;6440:15;:27;6436:50;;;6476:10;;;;;;;;;;;;;;6436:50;6518:7;::::0;;;::::1;;;6500:15;:25;6496:47;;;6534:9;;;;;;;;;;;;;;6496:47;6557:10;::::0;6553:45:::1;;6590:8;;;;;;;;;;;;;;6553:45;6712:10;6673:21;6697:26:::0;;;:14:::1;:26;::::0;;;;;6737;;::::1;6733:54;;6772:15;;;;;;;;;;;;;;6733:54;6854:39;::::0;2376:66:7;6871:10:0::1;2363:2:7::0;2359:15;2355:88;6854:39:0::1;::::0;::::1;2343:101:7::0;2460:12;;;2453:28;;;6829:12:0::1;::::0;2497::7;;6854:39:0::1;;;;;;;;;;;;6844:50;;;;;;6829:65;;6909:43;6928:5;;6909:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;::::0;;;;-1:-1:-1;;6935:10:0::1;::::0;;-1:-1:-1;6947:4:0;;-1:-1:-1;6909:18:0::1;:43::i;:::-;6904:71;;6961:14;;;;;;;;;;;;;;6904:71;7276:10;7031:21;7261:26:::0;;;:14:::1;:26;::::0;;;;:38;;;7349:12:::1;:29:::0;;7102:25;;::::1;::::0;;;7349:12;:29:::1;::::0;7102:25;;7349:29:::1;:::i;:::-;::::0;;;-1:-1:-1;7428:53:0::1;::::0;-1:-1:-1;7428:26:0::1;7435:5;7428:26;7455:10;7467:13:::0;7428:26:::1;:53::i;:::-;7497:34;::::0;160:25:7;;;7505:10:0::1;::::0;7497:34:::1;::::0;148:2:7;133:18;7497:34:0::1;;;;;;;6333:1205;;;2303:20:1::0;1716:1;2809:7;:22;2629:209;2303:20;6251:1287:0;;;:::o;4502:429::-;3217:10;:22;3231:8;3217:22;;3213:49;;3248:14;;;;;;;;;;;;;;3213:49;4589:15:::1;4575:10;:29;4571:55;;4613:13;;;;;;;;;;;;;;4571:55;4653:32;980:7;4653:15;:32;:::i;:::-;4640:10;:45;4636:71;;;4694:13;;;;;;;;;;;;;;4636:71;4740:9;::::0;::::1;;4721:15;:28;::::0;::::1;::::0;:45:::1;;-1:-1:-1::0;4753:9:0::1;::::0;::::1;;:13:::0;;4721:45:::1;4717:74;;;4775:16;;;;;;;;;;;;;;4717:74;4802:9;:30:::0;;;::::1;;::::0;::::1;;::::0;;4859:21:::1;847:7;4802:30:::0;4859:21:::1;:::i;:::-;4842:7;:39:::0;;::::1;::::0;;::::1;::::0;;;::::1;::::0;;::::1;::::0;::::1;::::0;;;;4897:27:::1;::::0;;4905:9;;;;;;;;;;3046:34:7;;4916:7:0;::::1;::::0;;::::1;3111:2:7::0;3096:18;;3089:43;4897:27:0::1;::::0;2982:18:7;4897:27:0::1;;;;;;;;4502:429:::0;:::o;5501:392::-;3368:10;:19;3382:5;3368:19;;3364:43;;3396:11;;;;;;;;;;;;;;3364:43;5641:7:::1;::::0;;;::::1;;;5622:15;:26;5618:52;;5657:13;;;;;;;;;;;;;;5618:52;5699:38;::::0;;;;5731:4:::1;5699:38;::::0;::::1;1602:74:7::0;5681:15:0::1;::::0;5706:5:::1;5699:23;;::::0;::::1;::::0;1575:18:7;;5699:38:0::1;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;5681:56;;5751:7;5762:1;5751:12:::0;5747:35:::1;;5772:10;;;;;;;;;;;;;;5747:35;5793:47;:26;5800:5;5793:26;5820:10;5832:7:::0;5793:26:::1;:47::i;:::-;5856:30;::::0;;5866:10:::1;3506:74:7::0;;3611:2;3596:18;;3589:34;;;5856:30:0::1;::::0;3479:18:7;5856:30:0::1;3332:297:7::0;5118:210:0;3217:10;:22;3231:8;3217:22;;3213:49;;3248:14;;;;;;;;;;;;;;3213:49;5198:11;5194:51:::1;;5232:13;;;;;;;;;;;;;;5194:51;5255:10;:24:::0;;;5295:26:::1;::::0;160:25:7;;;5295:26:0::1;::::0;148:2:7;133:18;5295:26:0::1;14:177:7::0;2336:287:1;1759:1;2468:7;;:19;2460:63;;;;;;;3836:2:7;2460:63:1;;;3818:21:7;3875:2;3855:18;;;3848:30;3914:33;3894:18;;;3887:61;3965:18;;2460:63:1;;;;;;;;;1759:1;2598:7;:18;2336:287::o;1156:184:6:-;1277:4;1329;1300:25;1313:5;1320:4;1300:12;:25::i;:::-;:33;;1156:184;-1:-1:-1;;;;1156:184:6:o;763:205:4:-;902:58;;;3536:42:7;3524:55;;902:58:4;;;3506:74:7;3596:18;;;;3589:34;;;902:58:4;;;;;;;;;;3479:18:7;;;;902:58:4;;;;;;;;;;925:23;902:58;;;875:86;;895:5;;875:19;:86::i;1994:290:6:-;2077:7;2119:4;2077:7;2133:116;2157:5;:12;2153:1;:16;2133:116;;;2205:33;2215:12;2229:5;2235:1;2229:8;;;;;;;;:::i;:::-;;;;;;;2205:9;:33::i;:::-;2190:48;-1:-1:-1;2171:3:6;;;;:::i;:::-;;;;2133:116;;;-1:-1:-1;2265:12:6;-1:-1:-1;1994:290:6;;;;;:::o;3747:706:4:-;4166:23;4192:69;4220:4;4192:69;;;;;;;;;;;;;;;;;4200:5;4192:27;;;;:69;;;;;:::i;:::-;4275:17;;4166:95;;-1:-1:-1;4275:21:4;4271:176;;4370:10;4359:30;;;;;;;;;;;;:::i;:::-;4351:85;;;;;;;4867:2:7;4351:85:4;;;4849:21:7;4906:2;4886:18;;;4879:30;4945:34;4925:18;;;4918:62;5016:12;4996:18;;;4989:40;5046:19;;4351:85:4;4665:406:7;8879:147:6;8942:7;8972:1;8968;:5;:51;;9100:13;9191:15;;;9226:4;9219:15;;;9272:4;9256:21;;8968:51;;;9100:13;9191:15;;;9226:4;9219:15;;;9272:4;9256:21;;8976:20;8961:58;8879:147;-1:-1:-1;;;8879:147:6:o;3873:223:5:-;4006:12;4037:52;4059:6;4067:4;4073:1;4076:12;4037:21;:52::i;:::-;4030:59;3873:223;-1:-1:-1;;;;3873:223:5:o;4960:446::-;5125:12;5182:5;5157:21;:30;;5149:81;;;;;;;5278:2:7;5149:81:5;;;5260:21:7;5317:2;5297:18;;;5290:30;5356:34;5336:18;;;5329:62;5427:8;5407:18;;;5400:36;5453:19;;5149:81:5;5076:402:7;5149:81:5;5241:12;5255:23;5282:6;:11;;5301:5;5308:4;5282:31;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5240:73;;;;5330:69;5357:6;5365:7;5374:10;5386:12;5330:26;:69::i;:::-;5323:76;4960:446;-1:-1:-1;;;;;;;4960:446:5:o;7466:628::-;7646:12;7674:7;7670:418;;;7701:10;:17;7722:1;7701:22;7697:286;;1465:19;;;;7908:60;;;;;;;6232:2:7;7908:60:5;;;6214:21:7;6271:2;6251:18;;;6244:30;6310:31;6290:18;;;6283:59;6359:18;;7908:60:5;6030:353:7;7908:60:5;-1:-1:-1;8003:10:5;7996:17;;7670:418;8044:33;8052:10;8064:12;8775:17;;:21;8771:379;;9003:10;8997:17;9059:15;9046:10;9042:2;9038:19;9031:44;8771:379;9126:12;9119:20;;;;;;;;;;;:::i;378:683:7:-;473:6;481;489;542:2;530:9;521:7;517:23;513:32;510:52;;;558:1;555;548:12;510:52;594:9;581:23;571:33;;655:2;644:9;640:18;627:32;678:18;719:2;711:6;708:14;705:34;;;735:1;732;725:12;705:34;773:6;762:9;758:22;748:32;;818:7;811:4;807:2;803:13;799:27;789:55;;840:1;837;830:12;789:55;880:2;867:16;906:2;898:6;895:14;892:34;;;922:1;919;912:12;892:34;975:7;970:2;960:6;957:1;953:14;949:2;945:23;941:32;938:45;935:65;;;996:1;993;986:12;935:65;1027:2;1023;1019:11;1009:21;;1049:6;1039:16;;;;;378:683;;;;;:::o;1271:180::-;1330:6;1383:2;1371:9;1362:7;1358:23;1354:32;1351:52;;;1399:1;1396;1389:12;1351:52;-1:-1:-1;1422:23:7;;1271:180;-1:-1:-1;1271:180:7:o;1687:309::-;1746:6;1799:2;1787:9;1778:7;1774:23;1770:32;1767:52;;;1815:1;1812;1805:12;1767:52;1854:9;1841:23;1904:42;1897:5;1893:54;1886:5;1883:65;1873:93;;1962:1;1959;1952:12;2520:184;2572:77;2569:1;2562:88;2669:4;2666:1;2659:15;2693:4;2690:1;2683:15;2709:125;2774:9;;;2795:10;;;2792:36;;;2808:18;;:::i;3143:184::-;3213:6;3266:2;3254:9;3245:7;3241:23;3237:32;3234:52;;;3282:1;3279;3272:12;3234:52;-1:-1:-1;3305:16:7;;3143:184;-1:-1:-1;3143:184:7:o;3994:::-;4046:77;4043:1;4036:88;4143:4;4140:1;4133:15;4167:4;4164:1;4157:15;4183:195;4222:3;4253:66;4246:5;4243:77;4240:103;;4323:18;;:::i;:::-;-1:-1:-1;4370:1:7;4359:13;;4183:195::o;4383:277::-;4450:6;4503:2;4491:9;4482:7;4478:23;4474:32;4471:52;;;4519:1;4516;4509:12;4471:52;4551:9;4545:16;4604:5;4597:13;4590:21;4583:5;4580:32;4570:60;;4626:1;4623;4616:12;5483:250;5568:1;5578:113;5592:6;5589:1;5586:13;5578:113;;;5668:11;;;5662:18;5649:11;;;5642:39;5614:2;5607:10;5578:113;;;-1:-1:-1;;5725:1:7;5707:16;;5700:27;5483:250::o;5738:287::-;5867:3;5905:6;5899:13;5921:66;5980:6;5975:3;5968:4;5960:6;5956:17;5921:66;:::i;:::-;6003:16;;;;;5738:287;-1:-1:-1;;5738:287:7:o;6388:455::-;6537:2;6526:9;6519:21;6500:4;6569:6;6563:13;6612:6;6607:2;6596:9;6592:18;6585:34;6628:79;6700:6;6695:2;6684:9;6680:18;6675:2;6667:6;6663:15;6628:79;:::i;:::-;6759:2;6747:15;6764:66;6743:88;6728:104;;;;6834:2;6724:113;;6388:455;-1:-1:-1;;6388:455:7:o
Swarm Source
ipfs://23273454cea535b1283ba2fc7cab4dd99d3ec817f3ee0341717ff055aa8e5086
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ 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.