Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00Latest 25 from a total of 113 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Claim | 22618255 | 270 days ago | IN | 0 ETH | 0.00040482 | ||||
| Claim | 22616575 | 270 days ago | IN | 0 ETH | 0.00066068 | ||||
| Claim | 22615551 | 270 days ago | IN | 0 ETH | 0.00014322 | ||||
| Claim | 22615492 | 270 days ago | IN | 0 ETH | 0.00022342 | ||||
| Claim | 22615467 | 270 days ago | IN | 0 ETH | 0.0002143 | ||||
| Claim | 22614010 | 270 days ago | IN | 0 ETH | 0.00012388 | ||||
| Claim | 22613256 | 271 days ago | IN | 0 ETH | 0.00009462 | ||||
| Claim | 22611476 | 271 days ago | IN | 0 ETH | 0.00012997 | ||||
| Claim | 22611341 | 271 days ago | IN | 0 ETH | 0.00014941 | ||||
| Claim | 22609936 | 271 days ago | IN | 0 ETH | 0.00016211 | ||||
| Claim | 22609727 | 271 days ago | IN | 0 ETH | 0.00012121 | ||||
| Claim | 22609714 | 271 days ago | IN | 0 ETH | 0.00009565 | ||||
| Claim | 22608610 | 271 days ago | IN | 0 ETH | 0.00005673 | ||||
| Claim | 22608535 | 271 days ago | IN | 0 ETH | 0.00012447 | ||||
| Claim | 22605530 | 272 days ago | IN | 0 ETH | 0.0001397 | ||||
| Claim | 22599732 | 272 days ago | IN | 0 ETH | 0.00014703 | ||||
| Claim | 22598008 | 273 days ago | IN | 0 ETH | 0.0002161 | ||||
| Claim | 22597764 | 273 days ago | IN | 0 ETH | 0.0001778 | ||||
| Claim | 22597244 | 273 days ago | IN | 0 ETH | 0.00031115 | ||||
| Claim | 22597172 | 273 days ago | IN | 0 ETH | 0.00044607 | ||||
| Claim | 22594864 | 273 days ago | IN | 0 ETH | 0.00032936 | ||||
| Claim | 22593915 | 273 days ago | IN | 0 ETH | 0.00024212 | ||||
| Claim | 22591512 | 274 days ago | IN | 0 ETH | 0.00038323 | ||||
| Claim | 22591440 | 274 days ago | IN | 0 ETH | 0.00045089 | ||||
| Claim | 22589882 | 274 days ago | IN | 0 ETH | 0.0003145 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
BaoClaim
Compiler Version
v0.8.28+commit.7893614a
Optimization Enabled:
No with 200 runs
Other Settings:
cancun EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.28;
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
/**
* @title BaoClaim
* @notice A Merkle-based claim contract that allows whitelisted users to claim tokens during a fixed period.
* Unclaimed tokens can be swept to a multisig after the claim window ends.
*/
contract BaoClaim is Ownable, ReentrancyGuard {
using SafeERC20 for IERC20;
/*//////////////////////////////////////////////////////////////////////////
ERRORS
//////////////////////////////////////////////////////////////////////////*/
error ClaimNotStarted();
error ClaimEnded();
error AlreadyClaimed();
error InvalidProof();
error InsufficientBalance();
error ClaimNotOver();
error NothingToSweep();
error InvalidDates();
error ClaimWindowActive();
/*//////////////////////////////////////////////////////////////////////////
CONSTANTS
//////////////////////////////////////////////////////////////////////////*/
uint256 public constant CLAIM_AMOUNT = 10581 * 1e18;
/*//////////////////////////////////////////////////////////////////////////
STORAGE
//////////////////////////////////////////////////////////////////////////*/
bytes32 public merkleRoot;
IERC20 public token;
uint256 public startDate;
uint256 public endDate;
address public multisig;
mapping(address => bool) public hasClaimed;
/*//////////////////////////////////////////////////////////////////////////
EVENTS
//////////////////////////////////////////////////////////////////////////*/
event Claimed(address indexed claimer);
event Sweep(address indexed to, uint256 amount);
/*//////////////////////////////////////////////////////////////////////////
CONSTRUCTOR
//////////////////////////////////////////////////////////////////////////*/
/**
* @notice Initializes the BaoClaim contract.
* @param _merkleRoot Root of the Merkle tree with eligible addresses.
* @param _startDate Timestamp when claiming starts.
* @param _endDate Timestamp when claiming ends.
* @param _multisig Address to receive unclaimed tokens after the claim period.
* @param _token Address of claimable token.
*/
constructor(bytes32 _merkleRoot, uint256 _startDate, uint256 _endDate, address _multisig, address _token)
Ownable(_multisig)
{
if (_startDate >= _endDate) revert InvalidDates();
merkleRoot = _merkleRoot;
token = IERC20(_token);
startDate = _startDate;
endDate = _endDate;
multisig = _multisig;
}
/*//////////////////////////////////////////////////////////////////////////
CLAIM FUNCTION
//////////////////////////////////////////////////////////////////////////*/
/**
* @notice Allows eligible users to claim tokens using a valid Merkle proof.
* @param merkleProof Array of hashes that prove the sender is in the Merkle tree.
*/
function claim(bytes32[] calldata merkleProof) external nonReentrant {
if (block.timestamp < startDate) revert ClaimNotStarted();
if (block.timestamp > endDate) revert ClaimEnded();
if (hasClaimed[msg.sender]) revert AlreadyClaimed();
bytes32 leaf = keccak256(abi.encodePacked(msg.sender));
bool valid = MerkleProof.verify(merkleProof, merkleRoot, leaf);
if (!valid) revert InvalidProof();
hasClaimed[msg.sender] = true;
if (token.balanceOf(address(this)) < CLAIM_AMOUNT) revert InsufficientBalance();
token.safeTransfer(msg.sender, CLAIM_AMOUNT);
emit Claimed(msg.sender);
}
/*//////////////////////////////////////////////////////////////////////////
SWEEP FUNCTION
//////////////////////////////////////////////////////////////////////////*/
/**
* @notice Allows the owner to sweep unclaimed tokens to the multisig after the claim period ends.
*/
function sweep() external onlyOwner nonReentrant {
if (block.timestamp <= endDate) revert ClaimNotOver();
uint256 balance = token.balanceOf(address(this));
if (balance == 0) revert NothingToSweep();
token.safeTransfer(multisig, balance);
emit Sweep(multisig, balance);
}
/*//////////////////////////////////////////////////////////////////////////
ADMIN CONFIGURATION
//////////////////////////////////////////////////////////////////////////*/
/**
* @notice Sets a new Merkle root.
* @param _newRoot New Merkle root hash.
*/
function setMerkleRoot(bytes32 _newRoot) external onlyOwner {
if (block.timestamp >= startDate && block.timestamp <= endDate) {
revert ClaimWindowActive();
}
merkleRoot = _newRoot;
}
/**
* @notice Updates the start and end date for the claim window.
* @param _startDate New start timestamp.
* @param _endDate New end timestamp.
*/
function setDates(uint256 _startDate, uint256 _endDate) external onlyOwner {
if (_startDate >= _endDate) revert InvalidDates();
if (block.timestamp >= startDate && block.timestamp <= endDate) {
revert ClaimWindowActive();
}
startDate = _startDate;
endDate = _endDate;
}
/**
* @notice Updates the multisig address that receives unclaimed tokens.
* @param _multisig New multisig address.
*/
function setMultisig(address _multisig) external onlyOwner {
multisig = _multisig;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/MerkleProof.sol)
// This file was procedurally generated from scripts/generate/templates/MerkleProof.js.
pragma solidity ^0.8.20;
import {Hashes} from "./Hashes.sol";
/**
* @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.
*
* IMPORTANT: Consider memory side-effects when using custom hashing functions
* that access memory in an unsafe way.
*
* NOTE: This library supports proof verification for merkle trees built using
* custom _commutative_ hashing functions (i.e. `H(a, b) == H(b, a)`). Proving
* leaf inclusion in trees built using non-commutative hashing functions requires
* additional logic that is not supported by this library.
*/
library MerkleProof {
/**
*@dev The multiproof provided is not valid.
*/
error MerkleProofInvalidMultiproof();
/**
* @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.
*
* This version handles proofs in memory with the default hashing function.
*/
function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {
return processProof(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 leaves & pre-images are assumed to be sorted.
*
* This version handles proofs in memory with the default hashing function.
*/
function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
computedHash = Hashes.commutativeKeccak256(computedHash, proof[i]);
}
return computedHash;
}
/**
* @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.
*
* This version handles proofs in memory with a custom hashing function.
*/
function verify(
bytes32[] memory proof,
bytes32 root,
bytes32 leaf,
function(bytes32, bytes32) view returns (bytes32) hasher
) internal view returns (bool) {
return processProof(proof, leaf, hasher) == 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 leaves & pre-images are assumed to be sorted.
*
* This version handles proofs in memory with a custom hashing function.
*/
function processProof(
bytes32[] memory proof,
bytes32 leaf,
function(bytes32, bytes32) view returns (bytes32) hasher
) internal view returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
computedHash = hasher(computedHash, proof[i]);
}
return computedHash;
}
/**
* @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.
*
* This version handles proofs in calldata with the default hashing function.
*/
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 leaves & pre-images are assumed to be sorted.
*
* This version handles proofs in calldata with the default hashing function.
*/
function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
computedHash = Hashes.commutativeKeccak256(computedHash, proof[i]);
}
return computedHash;
}
/**
* @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.
*
* This version handles proofs in calldata with a custom hashing function.
*/
function verifyCalldata(
bytes32[] calldata proof,
bytes32 root,
bytes32 leaf,
function(bytes32, bytes32) view returns (bytes32) hasher
) internal view returns (bool) {
return processProofCalldata(proof, leaf, hasher) == 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 leaves & pre-images are assumed to be sorted.
*
* This version handles proofs in calldata with a custom hashing function.
*/
function processProofCalldata(
bytes32[] calldata proof,
bytes32 leaf,
function(bytes32, bytes32) view returns (bytes32) hasher
) internal view returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
computedHash = hasher(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}.
*
* This version handles multiproofs in memory with the default hashing function.
*
* CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details.
*
* NOTE: Consider the case where `root == proof[0] && leaves.length == 0` as it will return `true`.
* The `leaves` must be validated independently. See {processMultiProof}.
*/
function multiProofVerify(
bytes32[] memory proof,
bool[] memory proofFlags,
bytes32 root,
bytes32[] memory leaves
) internal pure returns (bool) {
return processMultiProof(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.
*
* This version handles multiproofs in memory with the default hashing function.
*
* 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).
*
* NOTE: The _empty set_ (i.e. the case where `proof.length == 1 && leaves.length == 0`) is considered a no-op,
* and therefore a valid multiproof (i.e. it returns `proof[0]`). Consider disallowing this case if you're not
* validating the leaves elsewhere.
*/
function processMultiProof(
bytes32[] memory proof,
bool[] memory proofFlags,
bytes32[] memory leaves
) internal pure returns (bytes32 merkleRoot) {
// This function rebuilds 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 proofFlagsLen = proofFlags.length;
// Check proof validity.
if (leavesLen + proof.length != proofFlagsLen + 1) {
revert MerkleProofInvalidMultiproof();
}
// 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[](proofFlagsLen);
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 from the "main queue" (merging branches) or an element from the
// `proof` array.
for (uint256 i = 0; i < proofFlagsLen; i++) {
bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
bytes32 b = proofFlags[i]
? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])
: proof[proofPos++];
hashes[i] = Hashes.commutativeKeccak256(a, b);
}
if (proofFlagsLen > 0) {
if (proofPos != proof.length) {
revert MerkleProofInvalidMultiproof();
}
unchecked {
return hashes[proofFlagsLen - 1];
}
} else if (leavesLen > 0) {
return leaves[0];
} else {
return proof[0];
}
}
/**
* @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}.
*
* This version handles multiproofs in memory with a custom hashing function.
*
* CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details.
*
* NOTE: Consider the case where `root == proof[0] && leaves.length == 0` as it will return `true`.
* The `leaves` must be validated independently. See {processMultiProof}.
*/
function multiProofVerify(
bytes32[] memory proof,
bool[] memory proofFlags,
bytes32 root,
bytes32[] memory leaves,
function(bytes32, bytes32) view returns (bytes32) hasher
) internal view returns (bool) {
return processMultiProof(proof, proofFlags, leaves, hasher) == 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.
*
* This version handles multiproofs in memory with a custom hashing function.
*
* 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).
*
* NOTE: The _empty set_ (i.e. the case where `proof.length == 1 && leaves.length == 0`) is considered a no-op,
* and therefore a valid multiproof (i.e. it returns `proof[0]`). Consider disallowing this case if you're not
* validating the leaves elsewhere.
*/
function processMultiProof(
bytes32[] memory proof,
bool[] memory proofFlags,
bytes32[] memory leaves,
function(bytes32, bytes32) view returns (bytes32) hasher
) internal view returns (bytes32 merkleRoot) {
// This function rebuilds 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 proofFlagsLen = proofFlags.length;
// Check proof validity.
if (leavesLen + proof.length != proofFlagsLen + 1) {
revert MerkleProofInvalidMultiproof();
}
// 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[](proofFlagsLen);
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 from the "main queue" (merging branches) or an element from the
// `proof` array.
for (uint256 i = 0; i < proofFlagsLen; i++) {
bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
bytes32 b = proofFlags[i]
? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])
: proof[proofPos++];
hashes[i] = hasher(a, b);
}
if (proofFlagsLen > 0) {
if (proofPos != proof.length) {
revert MerkleProofInvalidMultiproof();
}
unchecked {
return hashes[proofFlagsLen - 1];
}
} else if (leavesLen > 0) {
return leaves[0];
} else {
return proof[0];
}
}
/**
* @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}.
*
* This version handles multiproofs in calldata with the default hashing function.
*
* CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details.
*
* NOTE: Consider the case where `root == proof[0] && leaves.length == 0` as it will return `true`.
* The `leaves` must be validated independently. See {processMultiProofCalldata}.
*/
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.
*
* This version handles multiproofs in calldata with the default hashing function.
*
* 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).
*
* NOTE: The _empty set_ (i.e. the case where `proof.length == 1 && leaves.length == 0`) is considered a no-op,
* and therefore a valid multiproof (i.e. it returns `proof[0]`). Consider disallowing this case if you're not
* validating the leaves elsewhere.
*/
function processMultiProofCalldata(
bytes32[] calldata proof,
bool[] calldata proofFlags,
bytes32[] memory leaves
) internal pure returns (bytes32 merkleRoot) {
// This function rebuilds 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 proofFlagsLen = proofFlags.length;
// Check proof validity.
if (leavesLen + proof.length != proofFlagsLen + 1) {
revert MerkleProofInvalidMultiproof();
}
// 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[](proofFlagsLen);
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 from the "main queue" (merging branches) or an element from the
// `proof` array.
for (uint256 i = 0; i < proofFlagsLen; i++) {
bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
bytes32 b = proofFlags[i]
? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])
: proof[proofPos++];
hashes[i] = Hashes.commutativeKeccak256(a, b);
}
if (proofFlagsLen > 0) {
if (proofPos != proof.length) {
revert MerkleProofInvalidMultiproof();
}
unchecked {
return hashes[proofFlagsLen - 1];
}
} else if (leavesLen > 0) {
return leaves[0];
} else {
return proof[0];
}
}
/**
* @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}.
*
* This version handles multiproofs in calldata with a custom hashing function.
*
* CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details.
*
* NOTE: Consider the case where `root == proof[0] && leaves.length == 0` as it will return `true`.
* The `leaves` must be validated independently. See {processMultiProofCalldata}.
*/
function multiProofVerifyCalldata(
bytes32[] calldata proof,
bool[] calldata proofFlags,
bytes32 root,
bytes32[] memory leaves,
function(bytes32, bytes32) view returns (bytes32) hasher
) internal view returns (bool) {
return processMultiProofCalldata(proof, proofFlags, leaves, hasher) == 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.
*
* This version handles multiproofs in calldata with a custom hashing function.
*
* 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).
*
* NOTE: The _empty set_ (i.e. the case where `proof.length == 1 && leaves.length == 0`) is considered a no-op,
* and therefore a valid multiproof (i.e. it returns `proof[0]`). Consider disallowing this case if you're not
* validating the leaves elsewhere.
*/
function processMultiProofCalldata(
bytes32[] calldata proof,
bool[] calldata proofFlags,
bytes32[] memory leaves,
function(bytes32, bytes32) view returns (bytes32) hasher
) internal view returns (bytes32 merkleRoot) {
// This function rebuilds 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 proofFlagsLen = proofFlags.length;
// Check proof validity.
if (leavesLen + proof.length != proofFlagsLen + 1) {
revert MerkleProofInvalidMultiproof();
}
// 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[](proofFlagsLen);
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 from the "main queue" (merging branches) or an element from the
// `proof` array.
for (uint256 i = 0; i < proofFlagsLen; i++) {
bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
bytes32 b = proofFlags[i]
? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])
: proof[proofPos++];
hashes[i] = hasher(a, b);
}
if (proofFlagsLen > 0) {
if (proofPos != proof.length) {
revert MerkleProofInvalidMultiproof();
}
unchecked {
return hashes[proofFlagsLen - 1];
}
} else if (leavesLen > 0) {
return leaves[0];
} else {
return proof[0];
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
import {Context} from "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* The initial owner is set to the address provided by the deployer. This can
* later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
constructor(address initialOwner) {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC-20 standard as defined in the ERC.
*/
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 value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of 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 value) 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 a `value` amount of tokens 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 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` 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 value) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.3.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../IERC20.sol";
import {IERC1363} from "../../../interfaces/IERC1363.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC-20 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 {
/**
* @dev An operation with an ERC-20 token failed.
*/
error SafeERC20FailedOperation(address token);
/**
* @dev Indicates a failed `decreaseAllowance` request.
*/
error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);
/**
* @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));
}
/**
* @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
* calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
*/
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));
}
/**
* @dev Variant of {safeTransfer} that returns a bool instead of reverting if the operation is not successful.
*/
function trySafeTransfer(IERC20 token, address to, uint256 value) internal returns (bool) {
return _callOptionalReturnBool(token, abi.encodeCall(token.transfer, (to, value)));
}
/**
* @dev Variant of {safeTransferFrom} that returns a bool instead of reverting if the operation is not successful.
*/
function trySafeTransferFrom(IERC20 token, address from, address to, uint256 value) internal returns (bool) {
return _callOptionalReturnBool(token, abi.encodeCall(token.transferFrom, (from, to, value)));
}
/**
* @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*
* IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
* smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
* this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
* that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
*/
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
forceApprove(token, spender, oldAllowance + value);
}
/**
* @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
* value, non-reverting calls are assumed to be successful.
*
* IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
* smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
* this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
* that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
*/
function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
unchecked {
uint256 currentAllowance = token.allowance(address(this), spender);
if (currentAllowance < requestedDecrease) {
revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
}
forceApprove(token, spender, currentAllowance - requestedDecrease);
}
}
/**
* @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
* to be set to zero before setting it to a non-zero value, such as USDT.
*
* NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function
* only sets the "standard" allowance. Any temporary allowance will remain active, in addition to the value being
* set here.
*/
function forceApprove(IERC20 token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
_callOptionalReturn(token, approvalCall);
}
}
/**
* @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no
* code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* Reverts if the returned value is other than `true`.
*/
function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
if (to.code.length == 0) {
safeTransfer(token, to, value);
} else if (!token.transferAndCall(to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target
* has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* Reverts if the returned value is other than `true`.
*/
function transferFromAndCallRelaxed(
IERC1363 token,
address from,
address to,
uint256 value,
bytes memory data
) internal {
if (to.code.length == 0) {
safeTransferFrom(token, from, to, value);
} else if (!token.transferFromAndCall(from, to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no
* code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.
* Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}
* once without retrying, and relies on the returned value to be true.
*
* Reverts if the returned value is other than `true`.
*/
function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
if (to.code.length == 0) {
forceApprove(token, to, value);
} else if (!token.approveAndCall(to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @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).
*
* This is a variant of {_callOptionalReturnBool} that reverts if call fails to meet the requirements.
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
uint256 returnSize;
uint256 returnValue;
assembly ("memory-safe") {
let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
// bubble errors
if iszero(success) {
let ptr := mload(0x40)
returndatacopy(ptr, 0, returndatasize())
revert(ptr, returndatasize())
}
returnSize := returndatasize()
returnValue := mload(0)
}
if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @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).
*
* This is a variant of {_callOptionalReturn} that silently catches all reverts and returns a bool instead.
*/
function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
bool success;
uint256 returnSize;
uint256 returnValue;
assembly ("memory-safe") {
success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
returnSize := returndatasize()
returnValue := mload(0)
}
return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/ReentrancyGuard.sol)
pragma solidity ^0.8.20;
/**
* @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 EIP-1153 (transient storage) is available on the chain you're deploying at,
* consider using {ReentrancyGuardTransient} instead.
*
* 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;
/**
* @dev Unauthorized reentrant call.
*/
error ReentrancyGuardReentrantCall();
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
if (_status == ENTERED) {
revert ReentrancyGuardReentrantCall();
}
// 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;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == ENTERED;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.3.0) (utils/cryptography/Hashes.sol)
pragma solidity ^0.8.20;
/**
* @dev Library of standard hash functions.
*
* _Available since v5.1._
*/
library Hashes {
/**
* @dev Commutative Keccak256 hash of a sorted pair of bytes32. Frequently used when working with merkle proofs.
*
* NOTE: Equivalent to the `standardNodeHash` in our https://github.com/OpenZeppelin/merkle-tree[JavaScript library].
*/
function commutativeKeccak256(bytes32 a, bytes32 b) internal pure returns (bytes32) {
return a < b ? efficientKeccak256(a, b) : efficientKeccak256(b, a);
}
/**
* @dev Implementation of keccak256(abi.encode(a, b)) that doesn't allocate or expand memory.
*/
function efficientKeccak256(bytes32 a, bytes32 b) internal pure returns (bytes32 value) {
assembly ("memory-safe") {
mstore(0x00, a)
mstore(0x20, b)
value := keccak256(0x00, 0x40)
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1363.sol)
pragma solidity ^0.8.20;
import {IERC20} from "./IERC20.sol";
import {IERC165} from "./IERC165.sol";
/**
* @title IERC1363
* @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].
*
* Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract
* after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction.
*/
interface IERC1363 is IERC20, IERC165 {
/*
* Note: the ERC-165 identifier for this interface is 0xb0202a11.
* 0xb0202a11 ===
* bytes4(keccak256('transferAndCall(address,uint256)')) ^
* bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^
* bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^
* bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^
* bytes4(keccak256('approveAndCall(address,uint256)')) ^
* bytes4(keccak256('approveAndCall(address,uint256,bytes)'))
*/
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferAndCall(address to, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @param data Additional data with no specified format, sent in call to `to`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param from The address which you want to send tokens from.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferFromAndCall(address from, address to, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param from The address which you want to send tokens from.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @param data Additional data with no specified format, sent in call to `to`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function approveAndCall(address spender, uint256 value) external returns (bool);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
* @param data Additional data with no specified format, sent in call to `spender`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../token/ERC20/IERC20.sol";// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)
pragma solidity ^0.8.20;
import {IERC165} from "../utils/introspection/IERC165.sol";// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC-165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[ERC].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}{
"remappings": [
"openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/",
"@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
"erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
"forge-std/=lib/forge-std/src/",
"halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/"
],
"optimizer": {
"enabled": false,
"runs": 200
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "cancun",
"viaIR": false,
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"bytes32","name":"_merkleRoot","type":"bytes32"},{"internalType":"uint256","name":"_startDate","type":"uint256"},{"internalType":"uint256","name":"_endDate","type":"uint256"},{"internalType":"address","name":"_multisig","type":"address"},{"internalType":"address","name":"_token","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadyClaimed","type":"error"},{"inputs":[],"name":"ClaimEnded","type":"error"},{"inputs":[],"name":"ClaimNotOver","type":"error"},{"inputs":[],"name":"ClaimNotStarted","type":"error"},{"inputs":[],"name":"ClaimWindowActive","type":"error"},{"inputs":[],"name":"InsufficientBalance","type":"error"},{"inputs":[],"name":"InvalidDates","type":"error"},{"inputs":[],"name":"InvalidProof","type":"error"},{"inputs":[],"name":"NothingToSweep","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"claimer","type":"address"}],"name":"Claimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Sweep","type":"event"},{"inputs":[],"name":"CLAIM_AMOUNT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"endDate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"hasClaimed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"merkleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"multisig","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_startDate","type":"uint256"},{"internalType":"uint256","name":"_endDate","type":"uint256"}],"name":"setDates","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_newRoot","type":"bytes32"}],"name":"setMerkleRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_multisig","type":"address"}],"name":"setMultisig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startDate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"sweep","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
608060405234801561000f575f5ffd5b5060405161162338038061162383398181016040528101906100319190610316565b815f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036100a2575f6040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600401610099919061039c565b60405180910390fd5b6100b18161019160201b60201c565b50600180819055508284106100f2576040517fd937486c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b846002819055508060035f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555083600481905550826005819055508160065f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050505050506103b5565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f5ffd5b5f819050919050565b61026881610256565b8114610272575f5ffd5b50565b5f815190506102838161025f565b92915050565b5f819050919050565b61029b81610289565b81146102a5575f5ffd5b50565b5f815190506102b681610292565b92915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6102e5826102bc565b9050919050565b6102f5816102db565b81146102ff575f5ffd5b50565b5f81519050610310816102ec565b92915050565b5f5f5f5f5f60a0868803121561032f5761032e610252565b5b5f61033c88828901610275565b955050602061034d888289016102a8565b945050604061035e888289016102a8565b935050606061036f88828901610302565b925050608061038088828901610302565b9150509295509295909350565b610396816102db565b82525050565b5f6020820190506103af5f83018461038d565b92915050565b611261806103c25f395ff3fe608060405234801561000f575f5ffd5b50600436106100f3575f3560e01c80637cb6475911610095578063dedf141e11610064578063dedf141e14610227578063f2fde38b14610243578063f3283fba1461025f578063fc0c546a1461027b576100f3565b80637cb64759146101b35780638da5cb5b146101cf578063b391c508146101ed578063c24a0f8b14610209576100f3565b806335faa416116100d157806335faa416146101515780634783c35b1461015b578063715018a61461017957806373b2e80e14610183576100f3565b80630b97bc86146100f7578063270ef385146101155780632eb4a7ab14610133575b5f5ffd5b6100ff610299565b60405161010c9190610e2a565b60405180910390f35b61011d61029f565b60405161012a9190610e2a565b60405180910390f35b61013b6102ad565b6040516101489190610e5b565b60405180910390f35b6101596102b3565b005b6101636104ba565b6040516101709190610eb3565b60405180910390f35b6101816104df565b005b61019d60048036038101906101989190610efe565b6104f2565b6040516101aa9190610f43565b60405180910390f35b6101cd60048036038101906101c89190610f86565b61050f565b005b6101d761056c565b6040516101e49190610eb3565b60405180910390f35b61020760048036038101906102029190611012565b610593565b005b61021161091d565b60405161021e9190610e2a565b60405180910390f35b610241600480360381019061023c9190611087565b610923565b005b61025d60048036038101906102589190610efe565b6109c1565b005b61027960048036038101906102749190610efe565b610a45565b005b610283610a90565b6040516102909190611120565b60405180910390f35b60045481565b69023d98df6f759834000081565b60025481565b6102bb610ab5565b6102c3610b3c565b60055442116102fe576040517f76b6125a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f60035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016103599190610eb3565b602060405180830381865afa158015610374573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610398919061114d565b90505f81036103d3576040517f351261fc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61044060065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff168260035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b829092919063ffffffff16565b60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fab2246061d7b0dd3631d037e3f6da75782ae489eeb9f6af878a4b25df9b07c77826040516104a79190610e2a565b60405180910390a2506104b8610c01565b565b60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6104e7610ab5565b6104f05f610c0a565b565b6007602052805f5260405f205f915054906101000a900460ff1681565b610517610ab5565b600454421015801561052b57506005544211155b15610562576040517f9938be4400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060028190555050565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b61059b610b3c565b6004544210156105d7576040517fb0e9ce1e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600554421115610613576040517f4f184b7e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60075f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff1615610694576040517f646cf55800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f336040516020016106a691906111bd565b6040516020818303038152906040528051906020012090505f61070c8484808060200260200160405190810160405280939291908181526020018383602002808284375f81840152601f19601f8201169050808301925050505050505060025484610ccb565b905080610745576040517f09bde33900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600160075f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff02191690831515021790555069023d98df6f759834000060035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016107ff9190610eb3565b602060405180830381865afa15801561081a573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061083e919061114d565b1015610876576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6108cc3369023d98df6f759834000060035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b829092919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167fb449c24d261a59627b537c8c41c57ab559f4205c56bea745ff61c5521bece21460405160405180910390a25050610919610c01565b5050565b60055481565b61092b610ab5565b808210610964576040517fd937486c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600454421015801561097857506005544211155b156109af576040517f9938be4400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81600481905550806005819055505050565b6109c9610ab5565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610a39575f6040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600401610a309190610eb3565b60405180910390fd5b610a4281610c0a565b50565b610a4d610ab5565b8060065f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610abd610ce1565b73ffffffffffffffffffffffffffffffffffffffff16610adb61056c565b73ffffffffffffffffffffffffffffffffffffffff1614610b3a57610afe610ce1565b6040517f118cdaa7000000000000000000000000000000000000000000000000000000008152600401610b319190610eb3565b60405180910390fd5b565b600260015403610b78576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600181905550565b610bfc838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8585604051602401610bb59291906111d7565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050610ce8565b505050565b60018081905550565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f82610cd78584610d83565b1490509392505050565b5f33905090565b5f5f60205f8451602086015f885af180610d07576040513d5f823e3d81fd5b3d92505f519150505f8214610d20576001811415610d3b565b5f8473ffffffffffffffffffffffffffffffffffffffff163b145b15610d7d57836040517f5274afe7000000000000000000000000000000000000000000000000000000008152600401610d749190610eb3565b60405180910390fd5b50505050565b5f5f8290505f5f90505b8451811015610dc957610dba82868381518110610dad57610dac6111fe565b5b6020026020010151610dd4565b91508080600101915050610d8d565b508091505092915050565b5f818310610deb57610de68284610dfe565b610df6565b610df58383610dfe565b5b905092915050565b5f825f528160205260405f20905092915050565b5f819050919050565b610e2481610e12565b82525050565b5f602082019050610e3d5f830184610e1b565b92915050565b5f819050919050565b610e5581610e43565b82525050565b5f602082019050610e6e5f830184610e4c565b92915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f610e9d82610e74565b9050919050565b610ead81610e93565b82525050565b5f602082019050610ec65f830184610ea4565b92915050565b5f5ffd5b5f5ffd5b610edd81610e93565b8114610ee7575f5ffd5b50565b5f81359050610ef881610ed4565b92915050565b5f60208284031215610f1357610f12610ecc565b5b5f610f2084828501610eea565b91505092915050565b5f8115159050919050565b610f3d81610f29565b82525050565b5f602082019050610f565f830184610f34565b92915050565b610f6581610e43565b8114610f6f575f5ffd5b50565b5f81359050610f8081610f5c565b92915050565b5f60208284031215610f9b57610f9a610ecc565b5b5f610fa884828501610f72565b91505092915050565b5f5ffd5b5f5ffd5b5f5ffd5b5f5f83601f840112610fd257610fd1610fb1565b5b8235905067ffffffffffffffff811115610fef57610fee610fb5565b5b60208301915083602082028301111561100b5761100a610fb9565b5b9250929050565b5f5f6020838503121561102857611027610ecc565b5b5f83013567ffffffffffffffff81111561104557611044610ed0565b5b61105185828601610fbd565b92509250509250929050565b61106681610e12565b8114611070575f5ffd5b50565b5f813590506110818161105d565b92915050565b5f5f6040838503121561109d5761109c610ecc565b5b5f6110aa85828601611073565b92505060206110bb85828601611073565b9150509250929050565b5f819050919050565b5f6110e86110e36110de84610e74565b6110c5565b610e74565b9050919050565b5f6110f9826110ce565b9050919050565b5f61110a826110ef565b9050919050565b61111a81611100565b82525050565b5f6020820190506111335f830184611111565b92915050565b5f815190506111478161105d565b92915050565b5f6020828403121561116257611161610ecc565b5b5f61116f84828501611139565b91505092915050565b5f8160601b9050919050565b5f61118e82611178565b9050919050565b5f61119f82611184565b9050919050565b6111b76111b282610e93565b611195565b82525050565b5f6111c882846111a6565b60148201915081905092915050565b5f6040820190506111ea5f830185610ea4565b6111f76020830184610e1b565b9392505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffdfea264697066735822122060fb757397448cbb2d47901e32f53d68fb2835c33f598f0ea7d2accbf094c82c64736f6c634300081c003371faa1285a27e55d40a910ae6f35112cc04799967ba8e2cc8f34ed4c0966779600000000000000000000000000000000000000000000000000000000681bd7e000000000000000000000000000000000000000000000000000000000682512600000000000000000000000003dfc49e5112005179da613bde5973229082dac35000000000000000000000000ce391315b414d4c7555956120461d21808a69f3a
Deployed Bytecode
0x608060405234801561000f575f5ffd5b50600436106100f3575f3560e01c80637cb6475911610095578063dedf141e11610064578063dedf141e14610227578063f2fde38b14610243578063f3283fba1461025f578063fc0c546a1461027b576100f3565b80637cb64759146101b35780638da5cb5b146101cf578063b391c508146101ed578063c24a0f8b14610209576100f3565b806335faa416116100d157806335faa416146101515780634783c35b1461015b578063715018a61461017957806373b2e80e14610183576100f3565b80630b97bc86146100f7578063270ef385146101155780632eb4a7ab14610133575b5f5ffd5b6100ff610299565b60405161010c9190610e2a565b60405180910390f35b61011d61029f565b60405161012a9190610e2a565b60405180910390f35b61013b6102ad565b6040516101489190610e5b565b60405180910390f35b6101596102b3565b005b6101636104ba565b6040516101709190610eb3565b60405180910390f35b6101816104df565b005b61019d60048036038101906101989190610efe565b6104f2565b6040516101aa9190610f43565b60405180910390f35b6101cd60048036038101906101c89190610f86565b61050f565b005b6101d761056c565b6040516101e49190610eb3565b60405180910390f35b61020760048036038101906102029190611012565b610593565b005b61021161091d565b60405161021e9190610e2a565b60405180910390f35b610241600480360381019061023c9190611087565b610923565b005b61025d60048036038101906102589190610efe565b6109c1565b005b61027960048036038101906102749190610efe565b610a45565b005b610283610a90565b6040516102909190611120565b60405180910390f35b60045481565b69023d98df6f759834000081565b60025481565b6102bb610ab5565b6102c3610b3c565b60055442116102fe576040517f76b6125a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f60035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016103599190610eb3565b602060405180830381865afa158015610374573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610398919061114d565b90505f81036103d3576040517f351261fc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61044060065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff168260035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b829092919063ffffffff16565b60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fab2246061d7b0dd3631d037e3f6da75782ae489eeb9f6af878a4b25df9b07c77826040516104a79190610e2a565b60405180910390a2506104b8610c01565b565b60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6104e7610ab5565b6104f05f610c0a565b565b6007602052805f5260405f205f915054906101000a900460ff1681565b610517610ab5565b600454421015801561052b57506005544211155b15610562576040517f9938be4400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060028190555050565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b61059b610b3c565b6004544210156105d7576040517fb0e9ce1e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600554421115610613576040517f4f184b7e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60075f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff1615610694576040517f646cf55800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f336040516020016106a691906111bd565b6040516020818303038152906040528051906020012090505f61070c8484808060200260200160405190810160405280939291908181526020018383602002808284375f81840152601f19601f8201169050808301925050505050505060025484610ccb565b905080610745576040517f09bde33900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600160075f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff02191690831515021790555069023d98df6f759834000060035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016107ff9190610eb3565b602060405180830381865afa15801561081a573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061083e919061114d565b1015610876576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6108cc3369023d98df6f759834000060035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b829092919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167fb449c24d261a59627b537c8c41c57ab559f4205c56bea745ff61c5521bece21460405160405180910390a25050610919610c01565b5050565b60055481565b61092b610ab5565b808210610964576040517fd937486c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600454421015801561097857506005544211155b156109af576040517f9938be4400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81600481905550806005819055505050565b6109c9610ab5565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610a39575f6040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600401610a309190610eb3565b60405180910390fd5b610a4281610c0a565b50565b610a4d610ab5565b8060065f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610abd610ce1565b73ffffffffffffffffffffffffffffffffffffffff16610adb61056c565b73ffffffffffffffffffffffffffffffffffffffff1614610b3a57610afe610ce1565b6040517f118cdaa7000000000000000000000000000000000000000000000000000000008152600401610b319190610eb3565b60405180910390fd5b565b600260015403610b78576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600181905550565b610bfc838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8585604051602401610bb59291906111d7565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050610ce8565b505050565b60018081905550565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f82610cd78584610d83565b1490509392505050565b5f33905090565b5f5f60205f8451602086015f885af180610d07576040513d5f823e3d81fd5b3d92505f519150505f8214610d20576001811415610d3b565b5f8473ffffffffffffffffffffffffffffffffffffffff163b145b15610d7d57836040517f5274afe7000000000000000000000000000000000000000000000000000000008152600401610d749190610eb3565b60405180910390fd5b50505050565b5f5f8290505f5f90505b8451811015610dc957610dba82868381518110610dad57610dac6111fe565b5b6020026020010151610dd4565b91508080600101915050610d8d565b508091505092915050565b5f818310610deb57610de68284610dfe565b610df6565b610df58383610dfe565b5b905092915050565b5f825f528160205260405f20905092915050565b5f819050919050565b610e2481610e12565b82525050565b5f602082019050610e3d5f830184610e1b565b92915050565b5f819050919050565b610e5581610e43565b82525050565b5f602082019050610e6e5f830184610e4c565b92915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f610e9d82610e74565b9050919050565b610ead81610e93565b82525050565b5f602082019050610ec65f830184610ea4565b92915050565b5f5ffd5b5f5ffd5b610edd81610e93565b8114610ee7575f5ffd5b50565b5f81359050610ef881610ed4565b92915050565b5f60208284031215610f1357610f12610ecc565b5b5f610f2084828501610eea565b91505092915050565b5f8115159050919050565b610f3d81610f29565b82525050565b5f602082019050610f565f830184610f34565b92915050565b610f6581610e43565b8114610f6f575f5ffd5b50565b5f81359050610f8081610f5c565b92915050565b5f60208284031215610f9b57610f9a610ecc565b5b5f610fa884828501610f72565b91505092915050565b5f5ffd5b5f5ffd5b5f5ffd5b5f5f83601f840112610fd257610fd1610fb1565b5b8235905067ffffffffffffffff811115610fef57610fee610fb5565b5b60208301915083602082028301111561100b5761100a610fb9565b5b9250929050565b5f5f6020838503121561102857611027610ecc565b5b5f83013567ffffffffffffffff81111561104557611044610ed0565b5b61105185828601610fbd565b92509250509250929050565b61106681610e12565b8114611070575f5ffd5b50565b5f813590506110818161105d565b92915050565b5f5f6040838503121561109d5761109c610ecc565b5b5f6110aa85828601611073565b92505060206110bb85828601611073565b9150509250929050565b5f819050919050565b5f6110e86110e36110de84610e74565b6110c5565b610e74565b9050919050565b5f6110f9826110ce565b9050919050565b5f61110a826110ef565b9050919050565b61111a81611100565b82525050565b5f6020820190506111335f830184611111565b92915050565b5f815190506111478161105d565b92915050565b5f6020828403121561116257611161610ecc565b5b5f61116f84828501611139565b91505092915050565b5f8160601b9050919050565b5f61118e82611178565b9050919050565b5f61119f82611184565b9050919050565b6111b76111b282610e93565b611195565b82525050565b5f6111c882846111a6565b60148201915081905092915050565b5f6040820190506111ea5f830185610ea4565b6111f76020830184610e1b565b9392505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffdfea264697066735822122060fb757397448cbb2d47901e32f53d68fb2835c33f598f0ea7d2accbf094c82c64736f6c634300081c0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
71faa1285a27e55d40a910ae6f35112cc04799967ba8e2cc8f34ed4c0966779600000000000000000000000000000000000000000000000000000000681bd7e000000000000000000000000000000000000000000000000000000000682512600000000000000000000000003dfc49e5112005179da613bde5973229082dac35000000000000000000000000ce391315b414d4c7555956120461d21808a69f3a
-----Decoded View---------------
Arg [0] : _merkleRoot (bytes32): 0x71faa1285a27e55d40a910ae6f35112cc04799967ba8e2cc8f34ed4c09667796
Arg [1] : _startDate (uint256): 1746655200
Arg [2] : _endDate (uint256): 1747260000
Arg [3] : _multisig (address): 0x3dFc49e5112005179Da613BdE5973229082dAc35
Arg [4] : _token (address): 0xCe391315b414D4c7555956120461D21808A69F3A
-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 71faa1285a27e55d40a910ae6f35112cc04799967ba8e2cc8f34ed4c09667796
Arg [1] : 00000000000000000000000000000000000000000000000000000000681bd7e0
Arg [2] : 0000000000000000000000000000000000000000000000000000000068251260
Arg [3] : 0000000000000000000000003dfc49e5112005179da613bde5973229082dac35
Arg [4] : 000000000000000000000000ce391315b414d4c7555956120461d21808a69f3a
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 33 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
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.