ETH Price: $2,587.41 (-1.24%)

Contract

0xde63C3b2C523eE0F39F4Cd5C81054B0ddA4BD31f

Overview

ETH Balance

18.942903045908226848 ETH

ETH Value

$49,013.00 (@ $2,587.41/ETH)

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Transfer Ownersh...1218359082024-06-24 23:09:53112 days ago1719270593IN
0xde63C3b2...ddA4BD31f
0 ETH0.0000051719650.1803722
0x600180551218318482024-06-24 20:54:33112 days ago1719262473IN
 Create: RainbowEthRewards
0 ETH0.0000450150750.06144412

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
1267094902024-10-15 18:42:371 hr ago1729017757
0xde63C3b2...ddA4BD31f
0.001357028770481 ETH
1267087182024-10-15 18:16:531 hr ago1729016213
0xde63C3b2...ddA4BD31f
0.002204018973408 ETH
1267086442024-10-15 18:14:251 hr ago1729016065
0xde63C3b2...ddA4BD31f
0.00136648400049 ETH
1267083392024-10-15 18:04:151 hr ago1729015455
0xde63C3b2...ddA4BD31f
0.001245184107281 ETH
1267040522024-10-15 15:41:214 hrs ago1729006881
0xde63C3b2...ddA4BD31f
0.001280788373486 ETH
1267026902024-10-15 14:55:574 hrs ago1729004157
0xde63C3b2...ddA4BD31f
0.000999674941501 ETH
1267024642024-10-15 14:48:254 hrs ago1729003705
0xde63C3b2...ddA4BD31f
0.002208991133717 ETH
1267021912024-10-15 14:39:195 hrs ago1729003159
0xde63C3b2...ddA4BD31f
0.001245184107281 ETH
1267004752024-10-15 13:42:076 hrs ago1728999727
0xde63C3b2...ddA4BD31f
0.000620481487473 ETH
1266999182024-10-15 13:23:336 hrs ago1728998613
0xde63C3b2...ddA4BD31f
0.001551203718683 ETH
1266990362024-10-15 12:54:096 hrs ago1728996849
0xde63C3b2...ddA4BD31f
0.000775601859341 ETH
1266982292024-10-15 12:27:157 hrs ago1728995235
0xde63C3b2...ddA4BD31f
0.001053953283581 ETH
1266982092024-10-15 12:26:357 hrs ago1728995195
0xde63C3b2...ddA4BD31f
0.001073736388244 ETH
1266966502024-10-15 11:34:378 hrs ago1728992077
0xde63C3b2...ddA4BD31f
0.000104587678029 ETH
1266965462024-10-15 11:31:098 hrs ago1728991869
0xde63C3b2...ddA4BD31f
0.001240962974946 ETH
1266948352024-10-15 10:34:079 hrs ago1728988447
0xde63C3b2...ddA4BD31f
0.000784450395908 ETH
1266908072024-10-15 8:19:5111 hrs ago1728980391
0xde63C3b2...ddA4BD31f
0.00428056927141 ETH
1266896222024-10-15 7:40:2112 hrs ago1728978021
0xde63C3b2...ddA4BD31f
0.00042752183087 ETH
1266890052024-10-15 7:19:4712 hrs ago1728976787
0xde63C3b2...ddA4BD31f
0.003955451562236 ETH
1266870952024-10-15 6:16:0713 hrs ago1728972967
0xde63C3b2...ddA4BD31f
0.000310240743736 ETH
1266820832024-10-15 3:29:0316 hrs ago1728962943
0xde63C3b2...ddA4BD31f
0.001894635962631 ETH
1266806662024-10-15 2:41:4917 hrs ago1728960109
0xde63C3b2...ddA4BD31f
0.00109959692972 ETH
1266801882024-10-15 2:25:5317 hrs ago1728959153
0xde63C3b2...ddA4BD31f
0.002499788036471 ETH
1266797142024-10-15 2:10:0517 hrs ago1728958205
0xde63C3b2...ddA4BD31f
0.001049217074202 ETH
1266764472024-10-15 0:21:1119 hrs ago1728951671
0xde63C3b2...ddA4BD31f
0.000653672987684 ETH
View All Internal Transactions

Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
RainbowEthRewards

Compiler Version
v0.8.23+commit.f704f362

Optimization Enabled:
Yes with 1000 runs

Other Settings:
paris EvmVersion
File 1 of 6 : RainbowEthRewards.sol
/*

                                                            ▐██▒           ███
                                            ,╓, ▄▄  ,▄▄▄,   .▄▄. ,╓, ▄▄▄   ██▌ ▄▄▄     ,▄▄▄,  ,╓╓   ╓╓   ,╓
                                            ██████ ███▀▀██⌐ ▐██⌐ ███▀▀███⌐ ████▀▀███ ╓██▀▀▀██▄`██▌ ▐██▌ ▐██
                                            ███    ▄▄█████▌ ▐██⌐ ██▌  ▐██▌ ██▌   ║██⌐███   ▓██ ╙██▄█▌██▄██⌐
                                            ██▌   ▐██▄▄███▌,▐██⌐ ██▌  ▐██▌ ███▓▄▄███ ╙██▄▄▄██▀  ║███¬╙███▌
                                            ╙╙└    ╙╙▀╙─╙▀▀└"╙╙` ╙╙└   ╙╙" ╙╙`╙╙▀▀└    ╙╙▀▀╙`    ╙╙└  ╙╙╙



                                            _," _   _"""ⁿ=-,  _
                                            ⌠            _    __"=.__
                                            ▐░......   _  _          "=._
                                            ▐░░░░░░░░░░░░░░░░.           "= _
                                            ╚╩╩╩╩╩╩δφφφφ░░░░░░░░░░░          >__
                                            ▐░░░░░░░░__ _ ╙╙╚╩φφ░░░░░░░        ^=_
                                            ▐░░░░░░░░░░░░░░░,░  `╙╠φ░░░░░░░       ⁿ
                                            ▐░░░░░░░░░░░░░░░░░░░░._ `╚Åφ░░░░░       " _
                                            ╚╠╠╠╠╠╠╠╬╬╬▒▒φ░░░░░░░░░░░░  ╙╠░░░░░       "
                                            ╚╝╝╝╝╝╝╝╬╬╬╠╢╬╠╬╠╬▒░░░░░░░░░░ "╚φ░░░░       ½_
                                            ▐░░░░░░░░░░;░╙╙╝╬╠╬╠╠▒▒░░░░░░░░_ ╚φ░░░░      "_
                                            ╚▒φφφ░░░░░░░░░░░░-╙╚╬╠╠╠╬▒░░░░░░░ `╠▒░░░░      ,
                                            ╞╬╬╬╠╠╠╬╬╬╬▒φ▒░░░░░░░╙╚╬╬╠╬▒▒░░░░░ .╙╠░░░░      ≥
                                            _▒░░░ΓΓ╙╙╙╚╩╬╠╬╠▒▒░░░░░░╙╬╬╠╬▒▒░░░░░' ╠▒░░░░     ≥
                                            `╙ⁿⁿ≈≈σ╓░ '╙╙╚╬╠╬▒░░░░░░╙╬╬╠╬▒░░░░░  ╠▒░░░░     [
                                                        _╙Θ░ ░╙╠╠╬╬▒░░░░░╬╠╠╠▒▒░░░░  ╠▒░░░░    '_
                                                        _╙φ░'╙╠╠╬▒░░░░░╟╠╠╠▒░░░░░ _╠▒░░░     ░_
                                                            _`φ ░╚╬╠╠▒░░░░║╠╠╠▒░░░░░.`╠░░░░     [
                                                            _╚░⌡╚╠╬╬▒░░░░╠╠╠╬▒░░░░░ ╠▒░░░░    ░
                                                                _╙░⌡╚╠╠╬▒░░░"▒╠╠╬▒░░░░ ⌠╠░░░░    ⌡_
                                                                ╠ ░╠╠╠╬▒░░░║╠╬╠╬▒░░░ _╠▒░░░     Γ
                                                                ▐░░░╠╠╠▒░░░╟╠╠╠╬▒░░░░ ╠▒░░░░    [
                                                                _░.░╠╠╠▒░░░▐╬╠╠╬▒░░░░[╠╬░░░░    │
                                                                _╙φ░╠╠╠╬▒░░▐╬╬╠╬╬▒░░░[╠╬░░░░  ░≥_
                                                                    ____ ____  __ _______ ____

*/

//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.23;

import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./IRainbowEthRewards.sol";
import {ReentrancyGuard} from "solmate/src/utils/ReentrancyGuard.sol";

contract RainbowEthRewards is IRainbowEthRewards, Ownable, ReentrancyGuard {

    // keccak256(abi.encodePacked("MERKLE_REWARDS_LEAF_HASH")) == 0xc25f889d60f4bc528f554912ac35e9e397b99db0e4dedf3f36bfbe75247f4c5a
    bytes32 public immutable LEAF_SALT = keccak256(abi.encodePacked("ETH_REWARDS"));
    bytes32 public override merkleRoot;
    uint256 public override currentTotalRewards;
    mapping(address => uint256) public override withdrawn;

    constructor() Ownable(msg.sender) {}

    /**
     * @dev Set a new merkleRoot and deposit the additional rewards
     */
    function setMerkleRoot(bytes32 _merkleRoot, uint256 totalRewards) external payable override onlyOwner {
        require(_merkleRoot != bytes32(0), "RainbowEthRewards: _merkleRoot must be non-zero");
        require(merkleRoot != _merkleRoot, "RainbowEthRewards: Must use new Merkle root");
        require(totalRewards > currentTotalRewards, "RainbowEthRewards: totalRewards must be > currentTotalRewards");

        uint256 additionalRewards;
        unchecked {
            additionalRewards = totalRewards - currentTotalRewards;
        }

        require(msg.value >= additionalRewards, "RainbowEthRewards: Insufficient ETH");

        currentTotalRewards = totalRewards;

        merkleRoot = _merkleRoot;
        emit MerkleRootSet(_merkleRoot, totalRewards);
    }

    /**
     * @dev Claim all available rewards for `account`.
     * @notice `totalAmount` must be the exact amount set in the latest `merkleRoot`.
     */
    function claim(address account, uint256 totalAmount, bytes32[] calldata proof) external override nonReentrant {
        // Verify Merkle proof
        bytes32 leaf = keccak256(bytes.concat(keccak256(abi.encode(LEAF_SALT, account, totalAmount))));
        require(MerkleProof.verifyCalldata(proof, merkleRoot, leaf), "RainbowEthRewards: Invalid proof");

        uint256 withdrawnAmount = withdrawn[account];
        require(totalAmount > withdrawnAmount, "RainbowEthRewards: totalAmount already withdrawn");

        withdrawn[account] = totalAmount;
        // Transfer the available amount
        uint256 availableAmount;
        unchecked {
            availableAmount = totalAmount - withdrawnAmount;
        }
        emit Claimed(account, availableAmount, totalAmount);

        //slither-disable-next-line arbitrary-send-eth
        (bool success, ) = account.call{value: availableAmount}("");
        require(success, "RainbowEthRewards: failed to send eth");
    }

    function rescueFunds(
        address _receiverAddress,
        uint256 _amount
    ) external onlyOwner {
        require(_receiverAddress != address(0), "RainbowEthRewards: invalid receiver address");
        (bool success, ) = _receiverAddress.call{value: _amount}("");
        require(success, "RainbowEthRewards: failed to send eth");
    }
}

File 2 of 6 : MerkleProof.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/MerkleProof.sol)

pragma solidity ^0.8.20;

/**
 * @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 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.
     */
    function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {
        return processProof(proof, leaf) == root;
    }

    /**
     * @dev Calldata version of {verify}
     */
    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.
     */
    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}
     */
    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.
     */
    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.
     */
    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).
     */
    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 proofLen = proof.length;
        uint256 totalHashes = proofFlags.length;

        // Check proof validity.
        if (leavesLen + proofLen != totalHashes + 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[](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 from 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) {
            if (proofPos != proofLen) {
                revert MerkleProofInvalidMultiproof();
            }
            unchecked {
                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.
     */
    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 proofLen = proof.length;
        uint256 totalHashes = proofFlags.length;

        // Check proof validity.
        if (leavesLen + proofLen != totalHashes + 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[](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 from 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) {
            if (proofPos != proofLen) {
                revert MerkleProofInvalidMultiproof();
            }
            unchecked {
                return hashes[totalHashes - 1];
            }
        } else if (leavesLen > 0) {
            return leaves[0];
        } else {
            return proof[0];
        }
    }

    /**
     * @dev Sorts the pair (a, b) and hashes the result.
     */
    function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) {
        return a < b ? _efficientHash(a, b) : _efficientHash(b, a);
    }

    /**
     * @dev Implementation of keccak256(abi.encode(a, b)) that doesn't allocate or expand memory.
     */
    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)
        }
    }
}

File 3 of 6 : Ownable.sol
// 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);
    }
}

File 4 of 6 : IRainbowEthRewards.sol
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.23;

interface IRainbowEthRewards {
    event Claimed(address indexed account, uint256 amount, uint256 totalAmount);
    event MerkleRootSet(bytes32 indexed merkleRoot, uint256 totalRewards);

    function merkleRoot() external view returns (bytes32);
    function currentTotalRewards() external view returns (uint256);
    function withdrawn(address account) external view returns (uint256);
    function setMerkleRoot(bytes32 _merkleRoot, uint256 totalRewards) external payable;
    function claim(address account, uint256 totalAmount, bytes32[] calldata proof) external;
}

File 5 of 6 : ReentrancyGuard.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

/// @notice Gas optimized reentrancy protection for smart contracts.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/ReentrancyGuard.sol)
/// @author Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/security/ReentrancyGuard.sol)
abstract contract ReentrancyGuard {
    uint256 private locked = 1;

    modifier nonReentrant() virtual {
        require(locked == 1, "REENTRANCY");

        locked = 2;

        _;

        locked = 1;
    }
}

File 6 of 6 : Context.sol
// 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;
    }
}

Settings
{
  "remappings": [
    "@openzeppelin/=lib/openzeppelin-contracts/",
    "ds-test/=lib/solmate/lib/ds-test/src/",
    "forge-std/=lib/forge-std/src/",
    "solmate/=lib/solmate/",
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 1000
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "viaIR": false,
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalAmount","type":"uint256"}],"name":"Claimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"totalRewards","type":"uint256"}],"name":"MerkleRootSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"LEAF_SALT","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"totalAmount","type":"uint256"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"currentTotalRewards","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":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_receiverAddress","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"rescueFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_merkleRoot","type":"bytes32"},{"internalType":"uint256","name":"totalRewards","type":"uint256"}],"name":"setMerkleRoot","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"withdrawn","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

600180556a4554485f5245574152445360a81b60c052600b60a05260cb6040527f4408bff3e83a27e39d6e8cd8f8cb730bc99e05f512f775628b27688fa7935f9c60805234801561004f57600080fd5b50338061007657604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b61007f81610085565b506100d5565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b608051610b5c6100f7600039600081816101c6015261026a0152610b5c6000f3fe6080604052600436106100b15760003560e01c806378e3214f116100695780638da5cb5b1161004e5780638da5cb5b1461018c5780639d5f9174146101b4578063f2fde38b146101e857600080fd5b806378e3214f146101595780637c382d0b1461017957600080fd5b80633d13f8741161009a5780633d13f874146100f55780636ef6109214610117578063715018a61461014457600080fd5b80632a6ce866146100b65780632eb4a7ab146100df575b600080fd5b3480156100c257600080fd5b506100cc60035481565b6040519081526020015b60405180910390f35b3480156100eb57600080fd5b506100cc60025481565b34801561010157600080fd5b50610115610110366004610a06565b610208565b005b34801561012357600080fd5b506100cc610132366004610a90565b60046020526000908152604090205481565b34801561015057600080fd5b506101156104e3565b34801561016557600080fd5b50610115610174366004610aab565b6104f7565b610115610187366004610ad5565b610631565b34801561019857600080fd5b506000546040516001600160a01b0390911681526020016100d6565b3480156101c057600080fd5b506100cc7f000000000000000000000000000000000000000000000000000000000000000081565b3480156101f457600080fd5b50610115610203366004610a90565b610859565b60015460011461025f5760405162461bcd60e51b815260206004820152600a60248201527f5245454e5452414e43590000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b6002600155604080517f000000000000000000000000000000000000000000000000000000000000000060208201526001600160a01b038616918101919091526060810184905260009060800160408051601f19818403018152828252805160209182012090830152016040516020818303038152906040528051906020012090506102ef8383600254846108b0565b61033b5760405162461bcd60e51b815260206004820181905260248201527f5261696e626f77457468526577617264733a20496e76616c69642070726f6f666044820152606401610256565b6001600160a01b0385166000908152600460205260409020548085116103c95760405162461bcd60e51b815260206004820152603060248201527f5261696e626f77457468526577617264733a20746f74616c416d6f756e74206160448201527f6c72656164792077697468647261776e000000000000000000000000000000006064820152608401610256565b6001600160a01b03861660008181526004602090815260409182902088905581518489038082529181018990529092917f987d620f307ff6b94d58743cb7a7509f24071586a77759b77c2d4e29f75a2f9a910160405180910390a26000876001600160a01b03168260405160006040518083038185875af1925050503d8060008114610471576040519150601f19603f3d011682016040523d82523d6000602084013e610476565b606091505b50509050806104d55760405162461bcd60e51b815260206004820152602560248201527f5261696e626f77457468526577617264733a206661696c656420746f2073656e6044820152640c840cae8d60db1b6064820152608401610256565b505060018055505050505050565b6104eb6108c8565b6104f5600061090e565b565b6104ff6108c8565b6001600160a01b03821661057b5760405162461bcd60e51b815260206004820152602b60248201527f5261696e626f77457468526577617264733a20696e76616c696420726563656960448201527f76657220616464726573730000000000000000000000000000000000000000006064820152608401610256565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146105c8576040519150601f19603f3d011682016040523d82523d6000602084013e6105cd565b606091505b505090508061062c5760405162461bcd60e51b815260206004820152602560248201527f5261696e626f77457468526577617264733a206661696c656420746f2073656e6044820152640c840cae8d60db1b6064820152608401610256565b505050565b6106396108c8565b816106ac5760405162461bcd60e51b815260206004820152602f60248201527f5261696e626f77457468526577617264733a205f6d65726b6c65526f6f74206d60448201527f757374206265206e6f6e2d7a65726f00000000000000000000000000000000006064820152608401610256565b81600254036107235760405162461bcd60e51b815260206004820152602b60248201527f5261696e626f77457468526577617264733a204d75737420757365206e65772060448201527f4d65726b6c6520726f6f740000000000000000000000000000000000000000006064820152608401610256565b600354811161079a5760405162461bcd60e51b815260206004820152603d60248201527f5261696e626f77457468526577617264733a20746f74616c526577617264732060448201527f6d757374206265203e2063757272656e74546f74616c526577617264730000006064820152608401610256565b6003548103348111156108155760405162461bcd60e51b815260206004820152602360248201527f5261696e626f77457468526577617264733a20496e73756666696369656e742060448201527f45544800000000000000000000000000000000000000000000000000000000006064820152608401610256565b6003829055600283905560405182815283907fc34c51f14a1ba51ad7984f0e9ce0ef7a0e18364f76ba670ee057653f719d9a699060200160405180910390a2505050565b6108616108c8565b6001600160a01b0381166108a4576040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260006004820152602401610256565b6108ad8161090e565b50565b6000826108be868685610976565b1495945050505050565b6000546001600160a01b031633146104f5576040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152602401610256565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600081815b848110156109af576109a58287878481811061099957610999610af7565b905060200201356109b8565b915060010161097b565b50949350505050565b60008183106109d45760008281526020849052604090206109e3565b60008381526020839052604090205b9392505050565b80356001600160a01b0381168114610a0157600080fd5b919050565b60008060008060608587031215610a1c57600080fd5b610a25856109ea565b935060208501359250604085013567ffffffffffffffff80821115610a4957600080fd5b818701915087601f830112610a5d57600080fd5b813581811115610a6c57600080fd5b8860208260051b8501011115610a8157600080fd5b95989497505060200194505050565b600060208284031215610aa257600080fd5b6109e3826109ea565b60008060408385031215610abe57600080fd5b610ac7836109ea565b946020939093013593505050565b60008060408385031215610ae857600080fd5b50508035926020909101359150565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fdfea2646970667358221220a899d2c9f218331b133c9b9dbbacdf6970b96800e8b989e1f1fd7058cdddb8d364736f6c63430008170033

Deployed Bytecode

0x6080604052600436106100b15760003560e01c806378e3214f116100695780638da5cb5b1161004e5780638da5cb5b1461018c5780639d5f9174146101b4578063f2fde38b146101e857600080fd5b806378e3214f146101595780637c382d0b1461017957600080fd5b80633d13f8741161009a5780633d13f874146100f55780636ef6109214610117578063715018a61461014457600080fd5b80632a6ce866146100b65780632eb4a7ab146100df575b600080fd5b3480156100c257600080fd5b506100cc60035481565b6040519081526020015b60405180910390f35b3480156100eb57600080fd5b506100cc60025481565b34801561010157600080fd5b50610115610110366004610a06565b610208565b005b34801561012357600080fd5b506100cc610132366004610a90565b60046020526000908152604090205481565b34801561015057600080fd5b506101156104e3565b34801561016557600080fd5b50610115610174366004610aab565b6104f7565b610115610187366004610ad5565b610631565b34801561019857600080fd5b506000546040516001600160a01b0390911681526020016100d6565b3480156101c057600080fd5b506100cc7f4408bff3e83a27e39d6e8cd8f8cb730bc99e05f512f775628b27688fa7935f9c81565b3480156101f457600080fd5b50610115610203366004610a90565b610859565b60015460011461025f5760405162461bcd60e51b815260206004820152600a60248201527f5245454e5452414e43590000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b6002600155604080517f4408bff3e83a27e39d6e8cd8f8cb730bc99e05f512f775628b27688fa7935f9c60208201526001600160a01b038616918101919091526060810184905260009060800160408051601f19818403018152828252805160209182012090830152016040516020818303038152906040528051906020012090506102ef8383600254846108b0565b61033b5760405162461bcd60e51b815260206004820181905260248201527f5261696e626f77457468526577617264733a20496e76616c69642070726f6f666044820152606401610256565b6001600160a01b0385166000908152600460205260409020548085116103c95760405162461bcd60e51b815260206004820152603060248201527f5261696e626f77457468526577617264733a20746f74616c416d6f756e74206160448201527f6c72656164792077697468647261776e000000000000000000000000000000006064820152608401610256565b6001600160a01b03861660008181526004602090815260409182902088905581518489038082529181018990529092917f987d620f307ff6b94d58743cb7a7509f24071586a77759b77c2d4e29f75a2f9a910160405180910390a26000876001600160a01b03168260405160006040518083038185875af1925050503d8060008114610471576040519150601f19603f3d011682016040523d82523d6000602084013e610476565b606091505b50509050806104d55760405162461bcd60e51b815260206004820152602560248201527f5261696e626f77457468526577617264733a206661696c656420746f2073656e6044820152640c840cae8d60db1b6064820152608401610256565b505060018055505050505050565b6104eb6108c8565b6104f5600061090e565b565b6104ff6108c8565b6001600160a01b03821661057b5760405162461bcd60e51b815260206004820152602b60248201527f5261696e626f77457468526577617264733a20696e76616c696420726563656960448201527f76657220616464726573730000000000000000000000000000000000000000006064820152608401610256565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146105c8576040519150601f19603f3d011682016040523d82523d6000602084013e6105cd565b606091505b505090508061062c5760405162461bcd60e51b815260206004820152602560248201527f5261696e626f77457468526577617264733a206661696c656420746f2073656e6044820152640c840cae8d60db1b6064820152608401610256565b505050565b6106396108c8565b816106ac5760405162461bcd60e51b815260206004820152602f60248201527f5261696e626f77457468526577617264733a205f6d65726b6c65526f6f74206d60448201527f757374206265206e6f6e2d7a65726f00000000000000000000000000000000006064820152608401610256565b81600254036107235760405162461bcd60e51b815260206004820152602b60248201527f5261696e626f77457468526577617264733a204d75737420757365206e65772060448201527f4d65726b6c6520726f6f740000000000000000000000000000000000000000006064820152608401610256565b600354811161079a5760405162461bcd60e51b815260206004820152603d60248201527f5261696e626f77457468526577617264733a20746f74616c526577617264732060448201527f6d757374206265203e2063757272656e74546f74616c526577617264730000006064820152608401610256565b6003548103348111156108155760405162461bcd60e51b815260206004820152602360248201527f5261696e626f77457468526577617264733a20496e73756666696369656e742060448201527f45544800000000000000000000000000000000000000000000000000000000006064820152608401610256565b6003829055600283905560405182815283907fc34c51f14a1ba51ad7984f0e9ce0ef7a0e18364f76ba670ee057653f719d9a699060200160405180910390a2505050565b6108616108c8565b6001600160a01b0381166108a4576040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260006004820152602401610256565b6108ad8161090e565b50565b6000826108be868685610976565b1495945050505050565b6000546001600160a01b031633146104f5576040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152602401610256565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600081815b848110156109af576109a58287878481811061099957610999610af7565b905060200201356109b8565b915060010161097b565b50949350505050565b60008183106109d45760008281526020849052604090206109e3565b60008381526020839052604090205b9392505050565b80356001600160a01b0381168114610a0157600080fd5b919050565b60008060008060608587031215610a1c57600080fd5b610a25856109ea565b935060208501359250604085013567ffffffffffffffff80821115610a4957600080fd5b818701915087601f830112610a5d57600080fd5b813581811115610a6c57600080fd5b8860208260051b8501011115610a8157600080fd5b95989497505060200194505050565b600060208284031215610aa257600080fd5b6109e3826109ea565b60008060408385031215610abe57600080fd5b610ac7836109ea565b946020939093013593505050565b60008060408385031215610ae857600080fd5b50508035926020909101359150565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fdfea2646970667358221220a899d2c9f218331b133c9b9dbbacdf6970b96800e8b989e1f1fd7058cdddb8d364736f6c63430008170033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
[ 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.