APE Price: $1.05 (+2.29%)

Contract

0x4D030e7D6Fc1Ea7ecead9D6D1e349c1E825C2f59

Overview

APE Balance

Apechain LogoApechain LogoApechain Logo508.36 APE

APE Value

$535.79 (@ $1.05/APE)
Transaction Hash
Method
Block
From
To
Withdraw81191282025-01-13 18:14:5715 hrs ago1736792097IN
0x4D030e7D...E825C2f59
0 APE0.0007991225.42069
Withdraw81055442025-01-13 14:30:1419 hrs ago1736778614IN
0x4D030e7D...E825C2f59
0 APE0.0007994525.42069
Withdraw76759902025-01-07 4:02:207 days ago1736222540IN
0x4D030e7D...E825C2f59
0 APE0.0007994225.42069
Withdraw75582242025-01-04 20:38:429 days ago1736023122IN
0x4D030e7D...E825C2f59
0 APE0.0007994225.42069
Withdraw75576572025-01-04 20:18:379 days ago1736021917IN
0x4D030e7D...E825C2f59
0 APE0.0007994525.42069
Withdraw75258912025-01-04 2:00:2110 days ago1735956021IN
0x4D030e7D...E825C2f59
0 APE0.0007994225.42069
Withdraw73933402024-12-31 18:19:1013 days ago1735669150IN
0x4D030e7D...E825C2f59
0 APE0.0007994525.42069
Withdraw73862612024-12-31 12:49:4913 days ago1735649389IN
0x4D030e7D...E825C2f59
0 APE0.0007994225.42069
Withdraw73525252024-12-30 13:39:5514 days ago1735565995IN
0x4D030e7D...E825C2f59
0 APE0.0007994525.42069
Withdraw73377702024-12-30 3:20:4915 days ago1735528849IN
0x4D030e7D...E825C2f59
0 APE0.0007994525.42069
Withdraw73209262024-12-29 17:11:4615 days ago1735492306IN
0x4D030e7D...E825C2f59
0 APE0.0007994225.42069
Withdraw72234382024-12-26 15:42:4018 days ago1735227760IN
0x4D030e7D...E825C2f59
0 APE0.0007994525.42069
Withdraw72182162024-12-26 11:07:1818 days ago1735211238IN
0x4D030e7D...E825C2f59
0 APE0.0007994225.42069
Withdraw72167812024-12-26 9:46:3118 days ago1735206391IN
0x4D030e7D...E825C2f59
0 APE0.0007994225.42069
Withdraw71936802024-12-25 17:43:0519 days ago1735148585IN
0x4D030e7D...E825C2f59
0 APE0.0007994525.42069
Withdraw71581002024-12-24 10:38:5520 days ago1735036735IN
0x4D030e7D...E825C2f59
0 APE0.0007994525.42069
Withdraw71419902024-12-23 21:22:3321 days ago1734988953IN
0x4D030e7D...E825C2f59
0 APE0.0007994525.42069
Withdraw71001992024-12-23 14:01:4121 days ago1734962501IN
0x4D030e7D...E825C2f59
0 APE0.0007994525.42069
Withdraw70841372024-12-23 11:49:0121 days ago1734954541IN
0x4D030e7D...E825C2f59
0 APE0.0007994525.42069
Withdraw70214802024-12-23 0:18:3022 days ago1734913110IN
0x4D030e7D...E825C2f59
0 APE0.0007994525.42069
Withdraw70078892024-12-22 20:34:4822 days ago1734899688IN
0x4D030e7D...E825C2f59
0 APE0.0007994225.42069
Withdraw69818862024-12-22 7:57:1223 days ago1734854232IN
0x4D030e7D...E825C2f59
0 APE0.0007994225.42069
Withdraw69726482024-12-22 0:42:2323 days ago1734828143IN
0x4D030e7D...E825C2f59
0 APE0.0007994525.42069
Withdraw69674662024-12-21 20:27:5823 days ago1734812878IN
0x4D030e7D...E825C2f59
0 APE0.0007994225.42069
Withdraw68844872024-12-19 18:47:1725 days ago1734634037IN
0x4D030e7D...E825C2f59
0 APE0.0007994525.42069
View all transactions

Latest 25 internal transactions (View All)

Parent Transaction Hash Block From To
81425942025-01-14 3:52:305 hrs ago1736826750
0x4D030e7D...E825C2f59
3 APE
81421482025-01-14 3:36:106 hrs ago1736825770
0x4D030e7D...E825C2f59
0.4 APE
81415402025-01-14 3:10:156 hrs ago1736824215
0x4D030e7D...E825C2f59
0.2 APE
81373752025-01-14 1:01:128 hrs ago1736816472
0x4D030e7D...E825C2f59
0.4 APE
81373102025-01-14 0:59:578 hrs ago1736816397
0x4D030e7D...E825C2f59
0.2 APE
81312572025-01-13 22:56:0510 hrs ago1736808965
0x4D030e7D...E825C2f59
0.2 APE
81310852025-01-13 22:51:2410 hrs ago1736808684
0x4D030e7D...E825C2f59
2 APE
81191282025-01-13 18:14:5715 hrs ago1736792097
0x4D030e7D...E825C2f59
0.04 APE
81189362025-01-13 18:10:0915 hrs ago1736791809
0x4D030e7D...E825C2f59
0.2 APE
81099322025-01-13 15:30:1318 hrs ago1736782213
0x4D030e7D...E825C2f59
0.2 APE
81055442025-01-13 14:30:1419 hrs ago1736778614
0x4D030e7D...E825C2f59
0.12 APE
81026672025-01-13 13:22:2220 hrs ago1736774542
0x4D030e7D...E825C2f59
0.4 APE
80995652025-01-13 12:01:0421 hrs ago1736769664
0x4D030e7D...E825C2f59
0.2 APE
80995522025-01-13 12:00:4221 hrs ago1736769642
0x4D030e7D...E825C2f59
0.2 APE
80984682025-01-13 11:35:0222 hrs ago1736768102
0x4D030e7D...E825C2f59
2 APE
80901282025-01-13 8:05:4125 hrs ago1736755541
0x4D030e7D...E825C2f59
2 APE
80901192025-01-13 8:05:1025 hrs ago1736755510
0x4D030e7D...E825C2f59
2 APE
80706522025-01-12 23:49:5233 hrs ago1736725792
0x4D030e7D...E825C2f59
0.2 APE
80574382025-01-12 19:20:5538 hrs ago1736709655
0x4D030e7D...E825C2f59
2 APE
80540602025-01-12 17:51:0739 hrs ago1736704267
0x4D030e7D...E825C2f59
8 APE
80487162025-01-12 15:59:2541 hrs ago1736697565
0x4D030e7D...E825C2f59
0.4 APE
80389472025-01-12 13:48:0243 hrs ago1736689682
0x4D030e7D...E825C2f59
2 APE
80334352025-01-12 11:26:1146 hrs ago1736681171
0x4D030e7D...E825C2f59
0.6 APE
80332152025-01-12 11:18:2746 hrs ago1736680707
0x4D030e7D...E825C2f59
0.2 APE
80317302025-01-12 10:24:2047 hrs ago1736677460
0x4D030e7D...E825C2f59
2 APE
View All Internal Transactions

Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ProtocolRewards

Compiler Version
v0.8.25+commit.b61c2a91

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
File 1 of 10 : ProtocolRewards.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";
import {IProtocolRewards} from "./interfaces/IProtocolRewards.sol";

/// @title ProtocolRewards
/// @notice Manager of deposits & withdrawals for protocol rewards
contract ProtocolRewards is IProtocolRewards, EIP712 {
    /// @notice The EIP-712 typehash for gasless withdraws
    bytes32 public constant WITHDRAW_TYPEHASH = keccak256("Withdraw(address from,address to,uint256 amount,uint256 nonce,uint256 deadline)");

    /// @notice An account's balance
    mapping(address => uint256) public balanceOf;

    /// @notice An account's nonce for gasless withdraws
    mapping(address => uint256) public nonces;

    constructor() payable EIP712("ProtocolRewards", "1") {}

    /// @notice The total amount of ETH held in the contract
    function totalSupply() external view returns (uint256) {
        return address(this).balance;
    }

    /// @notice Generic function to deposit ETH for a recipient, with an optional comment
    /// @param to Address to deposit to
    /// @param to Reason system reason for deposit (used for indexing)
    /// @param comment Optional comment as reason for deposit
    function deposit(address to, bytes4 reason, string calldata comment) external payable {
        if (to == address(0)) {
            revert ADDRESS_ZERO();
        }

        balanceOf[to] += msg.value;

        emit Deposit(msg.sender, to, reason, msg.value, comment);
    }

    /// @notice Generic function to deposit ETH for multiple recipients, with an optional comment
    /// @param recipients recipients to send the amount to, array aligns with amounts
    /// @param amounts amounts to send to each recipient, array aligns with recipients
    /// @param reasons optional bytes4 hash for indexing
    /// @param comment Optional comment to include with mint
    function depositBatch(address[] calldata recipients, uint256[] calldata amounts, bytes4[] calldata reasons, string calldata comment) external payable {
        uint256 numRecipients = recipients.length;

        if (numRecipients != amounts.length || numRecipients != reasons.length) {
            revert ARRAY_LENGTH_MISMATCH();
        }

        uint256 expectedTotalValue;

        for (uint256 i; i < numRecipients; ) {
            expectedTotalValue += amounts[i];

            unchecked {
                ++i;
            }
        }

        if (msg.value != expectedTotalValue) {
            revert INVALID_DEPOSIT();
        }

        address currentRecipient;
        uint256 currentAmount;

        for (uint256 i; i < numRecipients; ) {
            currentRecipient = recipients[i];
            currentAmount = amounts[i];

            if (currentRecipient == address(0)) {
                revert ADDRESS_ZERO();
            }

            balanceOf[currentRecipient] += currentAmount;

            emit Deposit(msg.sender, currentRecipient, reasons[i], currentAmount, comment);

            unchecked {
                ++i;
            }
        }
    }

    /// @notice Used by ERC-721 & ERC-1155 contracts to deposit protocol rewards
    /// @param creator Creator for NFT rewards
    /// @param creatorReward Creator reward amount
    /// @param createReferral Creator referral
    /// @param createReferralReward Creator referral reward
    /// @param mintReferral Mint referral user
    /// @param mintReferralReward Mint referral amount
    /// @param firstMinter First minter reward
    /// @param firstMinterReward First minter reward amount
    /// @param freee FREEE recipient
    /// @param freeeReward FREEE amount
    function depositRewards(
        address creator,
        uint256 creatorReward,
        address createReferral,
        uint256 createReferralReward,
        address mintReferral,
        uint256 mintReferralReward,
        address firstMinter,
        uint256 firstMinterReward,
        address freee,
        uint256 freeeReward
    ) external payable {
        if (msg.value != (creatorReward + createReferralReward + mintReferralReward + firstMinterReward + freeeReward)) {
            revert INVALID_DEPOSIT();
        }

        unchecked {
            if (creator != address(0)) {
                balanceOf[creator] += creatorReward;
            }
            if (createReferral != address(0)) {
                balanceOf[createReferral] += createReferralReward;
            }
            if (mintReferral != address(0)) {
                balanceOf[mintReferral] += mintReferralReward;
            }
            if (firstMinter != address(0)) {
                balanceOf[firstMinter] += firstMinterReward;
            }
            if (freee != address(0)) {
                balanceOf[freee] += freeeReward;
            }
        }

        emit RewardsDeposit(
            creator,
            createReferral,
            mintReferral,
            firstMinter,
            freee,
            msg.sender,
            creatorReward,
            createReferralReward,
            mintReferralReward,
            firstMinterReward,
            freeeReward
        );
    }

    /// @notice Withdraw protocol rewards
    /// @param to Withdraws from msg.sender to this address
    /// @param amount Amount to withdraw (0 for total balance)
    function withdraw(address to, uint256 amount) external {
        if (to == address(0)) {
            revert ADDRESS_ZERO();
        }

        address owner = msg.sender;

        if (amount > balanceOf[owner]) {
            revert INVALID_WITHDRAW();
        }

        if (amount == 0) {
            amount = balanceOf[owner];
        }

        balanceOf[owner] -= amount;

        emit Withdraw(owner, to, amount);

        (bool success, ) = to.call{value: amount}("");

        if (!success) {
            revert TRANSFER_FAILED();
        }
    }

    /// @notice Withdraw rewards on behalf of an address
    /// @param to The address to withdraw for
    /// @param amount The amount to withdraw (0 for total balance)
    function withdrawFor(address to, uint256 amount) external {
        if (to == address(0)) {
            revert ADDRESS_ZERO();
        }

        if (amount > balanceOf[to]) {
            revert INVALID_WITHDRAW();
        }

        if (amount == 0) {
            amount = balanceOf[to];
        }

        balanceOf[to] -= amount;

        emit Withdraw(to, to, amount);

        (bool success, ) = to.call{value: amount}("");

        if (!success) {
            revert TRANSFER_FAILED();
        }
    }

    /// @notice Execute a withdraw of protocol rewards via signature
    /// @param from Withdraw from this address
    /// @param to Withdraw to this address
    /// @param amount Amount to withdraw (0 for total balance)
    /// @param deadline Deadline for the signature to be valid
    /// @param v V component of signature
    /// @param r R component of signature
    /// @param s S component of signature
    function withdrawWithSig(address from, address to, uint256 amount, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external {
        if (block.timestamp > deadline) {
            revert SIGNATURE_DEADLINE_EXPIRED();
        }

        bytes32 withdrawHash;

        unchecked {
            withdrawHash = keccak256(abi.encode(WITHDRAW_TYPEHASH, from, to, amount, nonces[from]++, deadline));
        }

        bytes32 digest = _hashTypedDataV4(withdrawHash);

        address recoveredAddress = ecrecover(digest, v, r, s);

        if (recoveredAddress == address(0) || recoveredAddress != from) {
            revert INVALID_SIGNATURE();
        }

        if (to == address(0)) {
            revert ADDRESS_ZERO();
        }

        if (amount > balanceOf[from]) {
            revert INVALID_WITHDRAW();
        }

        if (amount == 0) {
            amount = balanceOf[from];
        }

        balanceOf[from] -= amount;

        emit Withdraw(from, to, amount);

        (bool success, ) = to.call{value: amount}("");

        if (!success) {
            revert TRANSFER_FAILED();
        }
    }
}

File 2 of 10 : EIP712.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/cryptography/EIP712.sol)

pragma solidity ^0.8.8;

import "./ECDSA.sol";
import "../ShortStrings.sol";
import "../../interfaces/IERC5267.sol";

/**
 * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.
 *
 * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,
 * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding
 * they need in their contracts using a combination of `abi.encode` and `keccak256`.
 *
 * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding
 * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA
 * ({_hashTypedDataV4}).
 *
 * The implementation of the domain separator was designed to be as efficient as possible while still properly updating
 * the chain id to protect against replay attacks on an eventual fork of the chain.
 *
 * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method
 * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].
 *
 * NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain
 * separator of the implementation contract. This will cause the `_domainSeparatorV4` function to always rebuild the
 * separator from the immutable values, which is cheaper than accessing a cached version in cold storage.
 *
 * _Available since v3.4._
 *
 * @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment
 */
abstract contract EIP712 is IERC5267 {
    using ShortStrings for *;

    bytes32 private constant _TYPE_HASH =
        keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)");

    // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to
    // invalidate the cached domain separator if the chain id changes.
    bytes32 private immutable _cachedDomainSeparator;
    uint256 private immutable _cachedChainId;
    address private immutable _cachedThis;

    bytes32 private immutable _hashedName;
    bytes32 private immutable _hashedVersion;

    ShortString private immutable _name;
    ShortString private immutable _version;
    string private _nameFallback;
    string private _versionFallback;

    /**
     * @dev Initializes the domain separator and parameter caches.
     *
     * The meaning of `name` and `version` is specified in
     * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:
     *
     * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.
     * - `version`: the current major version of the signing domain.
     *
     * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart
     * contract upgrade].
     */
    constructor(string memory name, string memory version) {
        _name = name.toShortStringWithFallback(_nameFallback);
        _version = version.toShortStringWithFallback(_versionFallback);
        _hashedName = keccak256(bytes(name));
        _hashedVersion = keccak256(bytes(version));

        _cachedChainId = block.chainid;
        _cachedDomainSeparator = _buildDomainSeparator();
        _cachedThis = address(this);
    }

    /**
     * @dev Returns the domain separator for the current chain.
     */
    function _domainSeparatorV4() internal view returns (bytes32) {
        if (address(this) == _cachedThis && block.chainid == _cachedChainId) {
            return _cachedDomainSeparator;
        } else {
            return _buildDomainSeparator();
        }
    }

    function _buildDomainSeparator() private view returns (bytes32) {
        return keccak256(abi.encode(_TYPE_HASH, _hashedName, _hashedVersion, block.chainid, address(this)));
    }

    /**
     * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this
     * function returns the hash of the fully encoded EIP712 message for this domain.
     *
     * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:
     *
     * ```solidity
     * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(
     *     keccak256("Mail(address to,string contents)"),
     *     mailTo,
     *     keccak256(bytes(mailContents))
     * )));
     * address signer = ECDSA.recover(digest, signature);
     * ```
     */
    function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {
        return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);
    }

    /**
     * @dev See {EIP-5267}.
     *
     * _Available since v4.9._
     */
    function eip712Domain()
        public
        view
        virtual
        override
        returns (
            bytes1 fields,
            string memory name,
            string memory version,
            uint256 chainId,
            address verifyingContract,
            bytes32 salt,
            uint256[] memory extensions
        )
    {
        return (
            hex"0f", // 01111
            _name.toStringWithFallback(_nameFallback),
            _version.toStringWithFallback(_versionFallback),
            block.chainid,
            address(this),
            bytes32(0),
            new uint256[](0)
        );
    }
}

File 3 of 10 : IProtocolRewards.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

/// @title IProtocolRewards
/// @notice The interface for deposits & withdrawals for Protocol Rewards
interface IProtocolRewards {
    /// @notice Rewards Deposit Event
    /// @param creator Creator for NFT rewards
    /// @param createReferral Creator referral
    /// @param mintReferral Mint referral user
    /// @param firstMinter First minter reward recipient
    /// @param freee FREEE recipient
    /// @param from The caller of the deposit
    /// @param creatorReward Creator reward amount
    /// @param createReferralReward Creator referral reward
    /// @param mintReferralReward Mint referral amount
    /// @param firstMinterReward First minter reward amount
    /// @param freeeReward FREEE amount
    event RewardsDeposit(
        address indexed creator,
        address indexed createReferral,
        address indexed mintReferral,
        address firstMinter,
        address freee,
        address from,
        uint256 creatorReward,
        uint256 createReferralReward,
        uint256 mintReferralReward,
        uint256 firstMinterReward,
        uint256 freeeReward
    );

    /// @notice Deposit Event
    /// @param from From user
    /// @param to To user (within contract)
    /// @param reason Optional bytes4 reason for indexing
    /// @param amount Amount of deposit
    /// @param comment Optional user comment
    event Deposit(address indexed from, address indexed to, bytes4 indexed reason, uint256 amount, string comment);

    /// @notice Withdraw Event
    /// @param from From user
    /// @param to To user (within contract)
    /// @param amount Amount of deposit
    event Withdraw(address indexed from, address indexed to, uint256 amount);

    /// @notice Cannot send to address zero
    error ADDRESS_ZERO();

    /// @notice Function argument array length mismatch
    error ARRAY_LENGTH_MISMATCH();

    /// @notice Invalid deposit
    error INVALID_DEPOSIT();

    /// @notice Invalid signature for deposit
    error INVALID_SIGNATURE();

    /// @notice Invalid withdraw
    error INVALID_WITHDRAW();

    /// @notice Signature for withdraw is too old and has expired
    error SIGNATURE_DEADLINE_EXPIRED();

    /// @notice Low-level ETH transfer has failed
    error TRANSFER_FAILED();

    /// @notice Generic function to deposit ETH for a recipient, with an optional comment
    /// @param to Address to deposit to
    /// @param to Reason system reason for deposit (used for indexing)
    /// @param comment Optional comment as reason for deposit
    function deposit(address to, bytes4 why, string calldata comment) external payable;

    /// @notice Generic function to deposit ETH for multiple recipients, with an optional comment
    /// @param recipients recipients to send the amount to, array aligns with amounts
    /// @param amounts amounts to send to each recipient, array aligns with recipients
    /// @param reasons optional bytes4 hash for indexing
    /// @param comment Optional comment to include with mint
    function depositBatch(address[] calldata recipients, uint256[] calldata amounts, bytes4[] calldata reasons, string calldata comment) external payable;

    /// @notice Used by ERC-721 & ERC-1155 contracts to deposit protocol rewards
    /// @param creator Creator for NFT rewards
    /// @param creatorReward Creator reward amount
    /// @param createReferral Creator referral
    /// @param createReferralReward Creator referral reward
    /// @param mintReferral Mint referral user
    /// @param mintReferralReward Mint referral amount
    /// @param firstMinter First minter reward
    /// @param firstMinterReward First minter reward amount
    /// @param freee FREEE recipient
    /// @param freeeReward FREEE amount
    function depositRewards(
        address creator,
        uint256 creatorReward,
        address createReferral,
        uint256 createReferralReward,
        address mintReferral,
        uint256 mintReferralReward,
        address firstMinter,
        uint256 firstMinterReward,
        address freee,
        uint256 freeeReward
    ) external payable;

    /// @notice Withdraw protocol rewards
    /// @param to Withdraws from msg.sender to this address
    /// @param amount amount to withdraw
    function withdraw(address to, uint256 amount) external;

    /// @notice Execute a withdraw of protocol rewards via signature
    /// @param from Withdraw from this address
    /// @param to Withdraw to this address
    /// @param amount Amount to withdraw
    /// @param deadline Deadline for the signature to be valid
    /// @param v V component of signature
    /// @param r R component of signature
    /// @param s S component of signature
    function withdrawWithSig(address from, address to, uint256 amount, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external;
}

File 4 of 10 : ECDSA.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "../Strings.sol";

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSA {
    enum RecoverError {
        NoError,
        InvalidSignature,
        InvalidSignatureLength,
        InvalidSignatureS,
        InvalidSignatureV // Deprecated in v4.8
    }

    function _throwError(RecoverError error) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert("ECDSA: invalid signature");
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert("ECDSA: invalid signature length");
        } else if (error == RecoverError.InvalidSignatureS) {
            revert("ECDSA: invalid signature 's' value");
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature` or error string. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     *
     * Documentation for signature generation:
     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
        if (signature.length == 65) {
            bytes32 r;
            bytes32 s;
            uint8 v;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            /// @solidity memory-safe-assembly
            assembly {
                r := mload(add(signature, 0x20))
                s := mload(add(signature, 0x40))
                v := byte(0, mload(add(signature, 0x60)))
            }
            return tryRecover(hash, v, r, s);
        } else {
            return (address(0), RecoverError.InvalidSignatureLength);
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, signature);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError) {
        bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
        uint8 v = uint8((uint256(vs) >> 255) + 27);
        return tryRecover(hash, v, r, s);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
     *
     * _Available since v4.2._
     */
    function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, r, vs);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,
     * `r` and `s` signature fields separately.
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address, RecoverError) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
            return (address(0), RecoverError.InvalidSignatureS);
        }

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        if (signer == address(0)) {
            return (address(0), RecoverError.InvalidSignature);
        }

        return (signer, RecoverError.NoError);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, v, r, s);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32 message) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, "\x19Ethereum Signed Message:\n32")
            mstore(0x1c, hash)
            message := keccak256(0x00, 0x3c)
        }
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from `s`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
    }

    /**
     * @dev Returns an Ethereum Signed Typed Data, created from a
     * `domainSeparator` and a `structHash`. This produces hash corresponding
     * to the one signed with the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
     * JSON-RPC method as part of EIP-712.
     *
     * See {recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 data) {
        /// @solidity memory-safe-assembly
        assembly {
            let ptr := mload(0x40)
            mstore(ptr, "\x19\x01")
            mstore(add(ptr, 0x02), domainSeparator)
            mstore(add(ptr, 0x22), structHash)
            data := keccak256(ptr, 0x42)
        }
    }

    /**
     * @dev Returns an Ethereum Signed Data with intended validator, created from a
     * `validator` and `data` according to the version 0 of EIP-191.
     *
     * See {recover}.
     */
    function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x00", validator, data));
    }
}

File 5 of 10 : ShortStrings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/ShortStrings.sol)

pragma solidity ^0.8.8;

import "./StorageSlot.sol";

// | string  | 0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA   |
// | length  | 0x                                                              BB |
type ShortString is bytes32;

/**
 * @dev This library provides functions to convert short memory strings
 * into a `ShortString` type that can be used as an immutable variable.
 *
 * Strings of arbitrary length can be optimized using this library if
 * they are short enough (up to 31 bytes) by packing them with their
 * length (1 byte) in a single EVM word (32 bytes). Additionally, a
 * fallback mechanism can be used for every other case.
 *
 * Usage example:
 *
 * ```solidity
 * contract Named {
 *     using ShortStrings for *;
 *
 *     ShortString private immutable _name;
 *     string private _nameFallback;
 *
 *     constructor(string memory contractName) {
 *         _name = contractName.toShortStringWithFallback(_nameFallback);
 *     }
 *
 *     function name() external view returns (string memory) {
 *         return _name.toStringWithFallback(_nameFallback);
 *     }
 * }
 * ```
 */
library ShortStrings {
    // Used as an identifier for strings longer than 31 bytes.
    bytes32 private constant _FALLBACK_SENTINEL = 0x00000000000000000000000000000000000000000000000000000000000000FF;

    error StringTooLong(string str);
    error InvalidShortString();

    /**
     * @dev Encode a string of at most 31 chars into a `ShortString`.
     *
     * This will trigger a `StringTooLong` error is the input string is too long.
     */
    function toShortString(string memory str) internal pure returns (ShortString) {
        bytes memory bstr = bytes(str);
        if (bstr.length > 31) {
            revert StringTooLong(str);
        }
        return ShortString.wrap(bytes32(uint256(bytes32(bstr)) | bstr.length));
    }

    /**
     * @dev Decode a `ShortString` back to a "normal" string.
     */
    function toString(ShortString sstr) internal pure returns (string memory) {
        uint256 len = byteLength(sstr);
        // using `new string(len)` would work locally but is not memory safe.
        string memory str = new string(32);
        /// @solidity memory-safe-assembly
        assembly {
            mstore(str, len)
            mstore(add(str, 0x20), sstr)
        }
        return str;
    }

    /**
     * @dev Return the length of a `ShortString`.
     */
    function byteLength(ShortString sstr) internal pure returns (uint256) {
        uint256 result = uint256(ShortString.unwrap(sstr)) & 0xFF;
        if (result > 31) {
            revert InvalidShortString();
        }
        return result;
    }

    /**
     * @dev Encode a string into a `ShortString`, or write it to storage if it is too long.
     */
    function toShortStringWithFallback(string memory value, string storage store) internal returns (ShortString) {
        if (bytes(value).length < 32) {
            return toShortString(value);
        } else {
            StorageSlot.getStringSlot(store).value = value;
            return ShortString.wrap(_FALLBACK_SENTINEL);
        }
    }

    /**
     * @dev Decode a string that was encoded to `ShortString` or written to storage using {setWithFallback}.
     */
    function toStringWithFallback(ShortString value, string storage store) internal pure returns (string memory) {
        if (ShortString.unwrap(value) != _FALLBACK_SENTINEL) {
            return toString(value);
        } else {
            return store;
        }
    }

    /**
     * @dev Return the length of a string that was encoded to `ShortString` or written to storage using {setWithFallback}.
     *
     * WARNING: This will return the "byte length" of the string. This may not reflect the actual length in terms of
     * actual characters as the UTF-8 encoding of a single character can span over multiple bytes.
     */
    function byteLengthWithFallback(ShortString value, string storage store) internal view returns (uint256) {
        if (ShortString.unwrap(value) != _FALLBACK_SENTINEL) {
            return byteLength(value);
        } else {
            return bytes(store).length;
        }
    }
}

File 6 of 10 : IERC5267.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC5267.sol)

pragma solidity ^0.8.0;

interface IERC5267 {
    /**
     * @dev MAY be emitted to signal that the domain could have changed.
     */
    event EIP712DomainChanged();

    /**
     * @dev returns the fields and values that describe the domain separator used by this contract for EIP-712
     * signature.
     */
    function eip712Domain()
        external
        view
        returns (
            bytes1 fields,
            string memory name,
            string memory version,
            uint256 chainId,
            address verifyingContract,
            bytes32 salt,
            uint256[] memory extensions
        );
}

File 7 of 10 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

import "./math/Math.sol";
import "./math/SignedMath.sol";

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _SYMBOLS = "0123456789abcdef";
    uint8 private constant _ADDRESS_LENGTH = 20;

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        unchecked {
            uint256 length = Math.log10(value) + 1;
            string memory buffer = new string(length);
            uint256 ptr;
            /// @solidity memory-safe-assembly
            assembly {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                /// @solidity memory-safe-assembly
                assembly {
                    mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `int256` to its ASCII `string` decimal representation.
     */
    function toString(int256 value) internal pure returns (string memory) {
        return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value))));
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        unchecked {
            return toHexString(value, Math.log256(value) + 1);
        }
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
    }

    /**
     * @dev Returns true if the two strings are equal.
     */
    function equal(string memory a, string memory b) internal pure returns (bool) {
        return keccak256(bytes(a)) == keccak256(bytes(b));
    }
}

File 8 of 10 : StorageSlot.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/StorageSlot.sol)
// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.

pragma solidity ^0.8.0;

/**
 * @dev Library for reading and writing primitive types to specific storage slots.
 *
 * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
 * This library helps with reading and writing to such slots without the need for inline assembly.
 *
 * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
 *
 * Example usage to set ERC1967 implementation slot:
 * ```solidity
 * contract ERC1967 {
 *     bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
 *
 *     function _getImplementation() internal view returns (address) {
 *         return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
 *     }
 *
 *     function _setImplementation(address newImplementation) internal {
 *         require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");
 *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
 *     }
 * }
 * ```
 *
 * _Available since v4.1 for `address`, `bool`, `bytes32`, `uint256`._
 * _Available since v4.9 for `string`, `bytes`._
 */
library StorageSlot {
    struct AddressSlot {
        address value;
    }

    struct BooleanSlot {
        bool value;
    }

    struct Bytes32Slot {
        bytes32 value;
    }

    struct Uint256Slot {
        uint256 value;
    }

    struct StringSlot {
        string value;
    }

    struct BytesSlot {
        bytes value;
    }

    /**
     * @dev Returns an `AddressSlot` with member `value` located at `slot`.
     */
    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BooleanSlot` with member `value` located at `slot`.
     */
    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
     */
    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Uint256Slot` with member `value` located at `slot`.
     */
    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `StringSlot` with member `value` located at `slot`.
     */
    function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `StringSlot` representation of the string storage pointer `store`.
     */
    function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := store.slot
        }
    }

    /**
     * @dev Returns an `BytesSlot` with member `value` located at `slot`.
     */
    function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.
     */
    function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := store.slot
        }
    }
}

File 9 of 10 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    enum Rounding {
        Down, // Toward negative infinity
        Up, // Toward infinity
        Zero // Toward zero
    }

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
     * with further edits by Uniswap Labs also under MIT license.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod0 := mul(x, y)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                // Solidity will revert if denominator == 0, unlike the div opcode on its own.
                // The surrounding unchecked block does not change this fact.
                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1, "Math: mulDiv overflow");

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
            // See https://cs.stackexchange.com/q/138556/92363.

            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 twos = denominator & (~denominator + 1);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
            // in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10 ** 64) {
                value /= 10 ** 64;
                result += 64;
            }
            if (value >= 10 ** 32) {
                value /= 10 ** 32;
                result += 32;
            }
            if (value >= 10 ** 16) {
                value /= 10 ** 16;
                result += 16;
            }
            if (value >= 10 ** 8) {
                value /= 10 ** 8;
                result += 8;
            }
            if (value >= 10 ** 4) {
                value /= 10 ** 4;
                result += 4;
            }
            if (value >= 10 ** 2) {
                value /= 10 ** 2;
                result += 2;
            }
            if (value >= 10 ** 1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256, rounded down, of a positive value.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
        }
    }
}

File 10 of 10 : SignedMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard signed math utilities missing in the Solidity language.
 */
library SignedMath {
    /**
     * @dev Returns the largest of two signed numbers.
     */
    function max(int256 a, int256 b) internal pure returns (int256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two signed numbers.
     */
    function min(int256 a, int256 b) internal pure returns (int256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two signed numbers without overflow.
     * The result is rounded towards zero.
     */
    function average(int256 a, int256 b) internal pure returns (int256) {
        // Formula from the book "Hacker's Delight"
        int256 x = (a & b) + ((a ^ b) >> 1);
        return x + (int256(uint256(x) >> 255) & (a ^ b));
    }

    /**
     * @dev Returns the absolute unsigned value of a signed value.
     */
    function abs(int256 n) internal pure returns (uint256) {
        unchecked {
            // must be unchecked in order to support `n = type(int256).min`
            return uint256(n >= 0 ? n : -n);
        }
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"payable","type":"constructor"},{"inputs":[],"name":"ADDRESS_ZERO","type":"error"},{"inputs":[],"name":"ARRAY_LENGTH_MISMATCH","type":"error"},{"inputs":[],"name":"INVALID_DEPOSIT","type":"error"},{"inputs":[],"name":"INVALID_SIGNATURE","type":"error"},{"inputs":[],"name":"INVALID_WITHDRAW","type":"error"},{"inputs":[],"name":"InvalidShortString","type":"error"},{"inputs":[],"name":"SIGNATURE_DEADLINE_EXPIRED","type":"error"},{"inputs":[{"internalType":"string","name":"str","type":"string"}],"name":"StringTooLong","type":"error"},{"inputs":[],"name":"TRANSFER_FAILED","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"bytes4","name":"reason","type":"bytes4"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"string","name":"comment","type":"string"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[],"name":"EIP712DomainChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"creator","type":"address"},{"indexed":true,"internalType":"address","name":"createReferral","type":"address"},{"indexed":true,"internalType":"address","name":"mintReferral","type":"address"},{"indexed":false,"internalType":"address","name":"firstMinter","type":"address"},{"indexed":false,"internalType":"address","name":"freee","type":"address"},{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"creatorReward","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"createReferralReward","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"mintReferralReward","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"firstMinterReward","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"freeeReward","type":"uint256"}],"name":"RewardsDeposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"WITHDRAW_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"bytes4","name":"reason","type":"bytes4"},{"internalType":"string","name":"comment","type":"string"}],"name":"deposit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address[]","name":"recipients","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes4[]","name":"reasons","type":"bytes4[]"},{"internalType":"string","name":"comment","type":"string"}],"name":"depositBatch","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"creator","type":"address"},{"internalType":"uint256","name":"creatorReward","type":"uint256"},{"internalType":"address","name":"createReferral","type":"address"},{"internalType":"uint256","name":"createReferralReward","type":"uint256"},{"internalType":"address","name":"mintReferral","type":"address"},{"internalType":"uint256","name":"mintReferralReward","type":"uint256"},{"internalType":"address","name":"firstMinter","type":"address"},{"internalType":"uint256","name":"firstMinterReward","type":"uint256"},{"internalType":"address","name":"freee","type":"address"},{"internalType":"uint256","name":"freeeReward","type":"uint256"}],"name":"depositRewards","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"eip712Domain","outputs":[{"internalType":"bytes1","name":"fields","type":"bytes1"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"version","type":"string"},{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"address","name":"verifyingContract","type":"address"},{"internalType":"bytes32","name":"salt","type":"bytes32"},{"internalType":"uint256[]","name":"extensions","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"withdrawWithSig","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6101608060405261000f81610144565b600f8152602081016e50726f746f636f6c5265776172647360881b81526040519161003983610144565b6001835260208301603160f81b81526100518261015f565b926101209384526100618561031e565b92610140938452519020938460e05251902091610100938385524660a0526040519360208501917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f8352604086015260608501524660808501523060a085015260a0845260c084019380851060018060401b0386111761012e57846040525190206080523060c052610fa993846104b9853960805184610e81015260a05184610f4d015260c05184610e4b015260e05184610ed001525183610ef6015251826106e40152518161070e0152f35b634e487b7160e01b600052604160045260246000fd5b604081019081106001600160401b0382111761012e57604052565b805160209190828110156101f9575090601f82511161019a578082519201519080831061018b57501790565b82600019910360031b1b161790565b90604051809263305a27a960e01b82528060048301528251908160248401526000935b8285106101e0575050604492506000838284010152601f80199101168101030190fd5b84810182015186860160440152938101938593506101bd565b6001600160401b03811161012e576000928354926001938481811c91168015610314575b8382101461030057601f81116102cd575b5081601f841160011461026a5750928293918392869461025f575b50501b916000199060031b1c191617905560ff90565b015192503880610249565b919083601f1981168780528488209488905b888383106102b3575050501061029a575b505050811b01905560ff90565b015160001960f88460031b161c1916905538808061028d565b85870151885590960195948501948793509081019061027c565b85805284601f848820920160051c820191601f860160051c015b8281106102f557505061022e565b8781550185906102e7565b634e487b7160e01b86526022600452602486fd5b90607f169061021d565b8051602090818110156103a75750601f825111610348578082519201519080831061018b57501790565b90604051809263305a27a960e01b82528060048301528251908160248401526000935b82851061038e575050604492506000838284010152601f80199101168101030190fd5b848101820151868601604401529381019385935061036b565b9192916001600160401b03811161012e5760019182548381811c911680156104ae575b8282101461049857601f8111610462575b5080601f831160011461041857508192939460009261040d575b5050600019600383901b1c191690821b17905560ff90565b0151905038806103f5565b90601f198316958460005282600020926000905b88821061044b575050838596971061029a57505050811b01905560ff90565b80878596829496860151815501950193019061042c565b8360005283601f83600020920160051c820191601f850160051c015b82811061048c5750506103db565b6000815501849061047e565b634e487b7160e01b600052602260045260246000fd5b90607f16906103ca56fe60806040908082526004918236101561001757600080fd5b60009260e0928435841c90816318160ddd14610a5b57508063300def951461089c57806370a082311461086457806376c5d758146108295780637ecebe00146107ed57806384b0196e146106cc578063c27e9794146104a6578063db518db2146103f6578063f3fef3a31461030e578063f7f8266f146102415763faa3516f146100a057600080fd5b61014036600319011261023d576100b5610ad9565b602435936001600160a01b03604435818116959394939086900361023957606435608435978389168099036102355760a4359260c435978589168099036102315760e43595610104359181831680930361022d5761012435996101298b6101248b6101248c6101248d8d610b55565b610b55565b340361021f575092610100989592818f8f8f9e9b98957f90e8cce6b15b450d1e56e9ef986d1cd376838a90944336c02886ca12b9e6ebd79e9b98169e8f80610209575b50806101f3575b50806101dd575b508a6101c7575b826101b1575b5051988952602089015233908801526060870152608086015260a085015260c0840152820152a480f35b828152600260205220888154019055818f610187565b8a81526002602052818120888154019055610181565b815260026020528181208781540190558f61017a565b825260026020528282208781540190558f610173565b835260026020528383208781540190558f61016c565b845163534e04af60e01b8152fd5b8d80fd5b8b80fd5b8980fd5b8780fd5b8380fd5b848383606036600319011261030a57610258610ad9565b6024359263ffffffff60e01b84168094036103065760443567ffffffffffffffff81116103025761028c9036908501610aab565b6001600160a01b03909316939092919084156102f457507f5b769452a2090142e059af5137c5b92a3e966cfb03b794cd01ac195d196c0001916102ee9185885260026020528088206102df348254610b55565b90555191829133953484610b78565b0390a480f35b90516366e7950960e01b8152fd5b8580fd5b8480fd5b8280fd5b5091503461030a578060031936011261030a57610329610ad9565b602435906001600160a01b03811680156103e65733865260026020528386205483116103d65785838194938294938394156103c3575b3384526002602052878420610375848254610bfa565b905587518381527f9b1bfa7fa9ee420a16e124f794c35ac9f90472acc99140eb2f6447c714cad8eb60203392a35af16103ac610c07565b50156103b6578280f35b51631fa55c0760e11b8152fd5b338452600260205287842054925061035f565b505050516311c1730160e31b8152fd5b505050516366e7950960e01b8152fd5b5091503461030a578060031936011261030a57610411610ad9565b602435906001600160a01b03811680156103e65780865260026020528386205483116103d6578583819493829493839415610493575b808452600260205287842061045d848254610bfa565b9055807f9b1bfa7fa9ee420a16e124f794c35ac9f90472acc99140eb2f6447c714cad8eb60208a51868152a35af16103ac610c07565b8084526002602052878420549250610447565b50913461023d578060031936011261023d576104c0610ad9565b90602435906001600160a01b03808316919082840361023957604435906064356084359060ff82168092036106c85783978142116106b8578392918c95948b9216968787528260209760038952209182549260018401905583519289898501957f7b35c0715842c169bbf11116e8d20b2e74dacbd860d36ad5e47c3d88c15be55b87528501528a606085015287608085015260a084015260c083015260c08252810181811067ffffffffffffffff8211176106a5579260428c8f946080948a97835251902061058d610e48565b91519161190160f01b83526002830152602282015220908c519182528482015260a4358c82015260c435606082015282805260015afa1561069b57895116838115918215610690575b50506106805783156106705782895260028252868920548111610660579388959193869593869586951561064e575b7f9b1bfa7fa9ee420a16e124f794c35ac9f90472acc99140eb2f6447c714cad8eb90828752600281528a872061063c878254610bfa565b90558a51868152a35af16103ac610c07565b81865260028152898620549450610605565b86516311c1730160e31b81528890fd5b86516366e7950960e01b81528890fd5b8651631468054760e31b81528890fd5b1415905083386105d6565b87513d8b823e3d90fd5b634e487b7160e01b8e5260418d5260248efd5b895163cddf40ed60e01b81528b90fd5b8a80fd5b509192346107ea57806003193601126107ea576107087f0000000000000000000000000000000000000000000000000000000000000000610c47565b906107327f0000000000000000000000000000000000000000000000000000000000000000610d6f565b92805193602093602086019686881067ffffffffffffffff8911176107d7575095939061078d83602092878b99965286865261078082519a8b9a600f60f81b8c5280878d01528b0190610aef565b91898303908a0152610aef565b924660608801523060808801528460a088015286840360c088015251928381520193925b8281106107c057505050500390f35b8351855286955093810193928101926001016107b1565b634e487b7160e01b855260419052602484fd5b80fd5b8483346108255760203660031901126108255760209181906001600160a01b03610815610ad9565b1681526003845220549051908152f35b5080fd5b848334610825578160031936011261082557602090517f7b35c0715842c169bbf11116e8d20b2e74dacbd860d36ad5e47c3d88c15be55b8152f35b8483346108255760203660031901126108255760209181906001600160a01b0361088c610ad9565b1681526002845220549051908152f35b848383608036600319011261030a5767ffffffffffffffff8135818111610306576108ca9036908401610a75565b602493919335838111610a57576108e49036908401610a75565b959093604435818111610a53576108fe9036908601610a75565b91606435908111610235576109169036908701610aab565b989094818114801590610a49575b610a39578a8b5b838a848310610a19575050503403610a09578a5b81811061094a578b80f35b61095581838c610b2f565b356001600160a01b0381169190829003610a055761097481858c610b2f565b359180156109f557878e828152600260205220610992848254610b55565b905561099f828888610b2f565b359063ffffffff60e01b82168092036109f1576001937f5b769452a2090142e059af5137c5b92a3e966cfb03b794cd01ac195d196c00018f8c6109e88d51928392339684610b78565b0390a40161093f565b8e80fd5b87516366e7950960e01b81528a90fd5b8c80fd5b845163534e04af60e01b81528790fd5b92610a2b83610a329360019596610b2f565b3590610b55565b910161092b565b8451634456f5e960e11b81528790fd5b5083811415610924565b8880fd5b8680fd5b859034610825578160031936011261082557602090478152f35b9181601f84011215610aa65782359167ffffffffffffffff8311610aa6576020808501948460051b010111610aa657565b600080fd5b9181601f84011215610aa65782359167ffffffffffffffff8311610aa65760208381860195010111610aa657565b600435906001600160a01b0382168203610aa657565b919082519283825260005b848110610b1b575050826000602080949584010152601f8019910116010190565b602081830181015184830182015201610afa565b9190811015610b3f5760051b0190565b634e487b7160e01b600052603260045260246000fd5b91908201809211610b6257565b634e487b7160e01b600052601160045260246000fd5b91926060938192845260406020850152816040850152848401376000828201840152601f01601f1916010190565b6040810190811067ffffffffffffffff821117610bc257604052565b634e487b7160e01b600052604160045260246000fd5b90601f8019910116810190811067ffffffffffffffff821117610bc257604052565b91908203918211610b6257565b3d15610c42573d9067ffffffffffffffff8211610bc25760405191610c36601f8201601f191660200184610bd8565b82523d6000602084013e565b606090565b60ff8114610c855760ff811690601f8211610c735760405191610c6983610ba6565b8252602082015290565b604051632cd44ac360e21b8152600490fd5b50604051600080549060018260011c9060018416938415610d65575b6020948584108114610d515783875286949392918115610d315750600114610cd5575b5050610cd292500382610bd8565b90565b60008080527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e56395935091905b818310610d19575050610cd293508201013880610cc4565b85548784018501529485019486945091830191610d01565b915050610cd294925060ff191682840152151560051b8201013880610cc4565b634e487b7160e01b85526022600452602485fd5b91607f1691610ca1565b60ff8114610d915760ff811690601f8211610c735760405191610c6983610ba6565b506040516000600190600154918260011c9060018416938415610e3e575b6020948584108114610d515783875286949392918115610d315750600114610ddf575050610cd292500382610bd8565b9093915060016000527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6936000915b818310610e26575050610cd293508201013880610cc4565b85548784018501529485019486945091830191610e0e565b91607f1691610daf565b307f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03161480610f4a575b15610ea3577f000000000000000000000000000000000000000000000000000000000000000090565b60405160208101907f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f82527f000000000000000000000000000000000000000000000000000000000000000060408201527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260a0815260c0810181811067ffffffffffffffff821117610bc25760405251902090565b507f00000000000000000000000000000000000000000000000000000000000000004614610e7a56fea2646970667358221220269b0c184428ae7c106b0ed19f32d1378714ca47a5387a79030742816e5e81c864736f6c63430008190033

Deployed Bytecode

0x60806040908082526004918236101561001757600080fd5b60009260e0928435841c90816318160ddd14610a5b57508063300def951461089c57806370a082311461086457806376c5d758146108295780637ecebe00146107ed57806384b0196e146106cc578063c27e9794146104a6578063db518db2146103f6578063f3fef3a31461030e578063f7f8266f146102415763faa3516f146100a057600080fd5b61014036600319011261023d576100b5610ad9565b602435936001600160a01b03604435818116959394939086900361023957606435608435978389168099036102355760a4359260c435978589168099036102315760e43595610104359181831680930361022d5761012435996101298b6101248b6101248c6101248d8d610b55565b610b55565b340361021f575092610100989592818f8f8f9e9b98957f90e8cce6b15b450d1e56e9ef986d1cd376838a90944336c02886ca12b9e6ebd79e9b98169e8f80610209575b50806101f3575b50806101dd575b508a6101c7575b826101b1575b5051988952602089015233908801526060870152608086015260a085015260c0840152820152a480f35b828152600260205220888154019055818f610187565b8a81526002602052818120888154019055610181565b815260026020528181208781540190558f61017a565b825260026020528282208781540190558f610173565b835260026020528383208781540190558f61016c565b845163534e04af60e01b8152fd5b8d80fd5b8b80fd5b8980fd5b8780fd5b8380fd5b848383606036600319011261030a57610258610ad9565b6024359263ffffffff60e01b84168094036103065760443567ffffffffffffffff81116103025761028c9036908501610aab565b6001600160a01b03909316939092919084156102f457507f5b769452a2090142e059af5137c5b92a3e966cfb03b794cd01ac195d196c0001916102ee9185885260026020528088206102df348254610b55565b90555191829133953484610b78565b0390a480f35b90516366e7950960e01b8152fd5b8580fd5b8480fd5b8280fd5b5091503461030a578060031936011261030a57610329610ad9565b602435906001600160a01b03811680156103e65733865260026020528386205483116103d65785838194938294938394156103c3575b3384526002602052878420610375848254610bfa565b905587518381527f9b1bfa7fa9ee420a16e124f794c35ac9f90472acc99140eb2f6447c714cad8eb60203392a35af16103ac610c07565b50156103b6578280f35b51631fa55c0760e11b8152fd5b338452600260205287842054925061035f565b505050516311c1730160e31b8152fd5b505050516366e7950960e01b8152fd5b5091503461030a578060031936011261030a57610411610ad9565b602435906001600160a01b03811680156103e65780865260026020528386205483116103d6578583819493829493839415610493575b808452600260205287842061045d848254610bfa565b9055807f9b1bfa7fa9ee420a16e124f794c35ac9f90472acc99140eb2f6447c714cad8eb60208a51868152a35af16103ac610c07565b8084526002602052878420549250610447565b50913461023d578060031936011261023d576104c0610ad9565b90602435906001600160a01b03808316919082840361023957604435906064356084359060ff82168092036106c85783978142116106b8578392918c95948b9216968787528260209760038952209182549260018401905583519289898501957f7b35c0715842c169bbf11116e8d20b2e74dacbd860d36ad5e47c3d88c15be55b87528501528a606085015287608085015260a084015260c083015260c08252810181811067ffffffffffffffff8211176106a5579260428c8f946080948a97835251902061058d610e48565b91519161190160f01b83526002830152602282015220908c519182528482015260a4358c82015260c435606082015282805260015afa1561069b57895116838115918215610690575b50506106805783156106705782895260028252868920548111610660579388959193869593869586951561064e575b7f9b1bfa7fa9ee420a16e124f794c35ac9f90472acc99140eb2f6447c714cad8eb90828752600281528a872061063c878254610bfa565b90558a51868152a35af16103ac610c07565b81865260028152898620549450610605565b86516311c1730160e31b81528890fd5b86516366e7950960e01b81528890fd5b8651631468054760e31b81528890fd5b1415905083386105d6565b87513d8b823e3d90fd5b634e487b7160e01b8e5260418d5260248efd5b895163cddf40ed60e01b81528b90fd5b8a80fd5b509192346107ea57806003193601126107ea576107087f50726f746f636f6c52657761726473000000000000000000000000000000000f610c47565b906107327f3100000000000000000000000000000000000000000000000000000000000001610d6f565b92805193602093602086019686881067ffffffffffffffff8911176107d7575095939061078d83602092878b99965286865261078082519a8b9a600f60f81b8c5280878d01528b0190610aef565b91898303908a0152610aef565b924660608801523060808801528460a088015286840360c088015251928381520193925b8281106107c057505050500390f35b8351855286955093810193928101926001016107b1565b634e487b7160e01b855260419052602484fd5b80fd5b8483346108255760203660031901126108255760209181906001600160a01b03610815610ad9565b1681526003845220549051908152f35b5080fd5b848334610825578160031936011261082557602090517f7b35c0715842c169bbf11116e8d20b2e74dacbd860d36ad5e47c3d88c15be55b8152f35b8483346108255760203660031901126108255760209181906001600160a01b0361088c610ad9565b1681526002845220549051908152f35b848383608036600319011261030a5767ffffffffffffffff8135818111610306576108ca9036908401610a75565b602493919335838111610a57576108e49036908401610a75565b959093604435818111610a53576108fe9036908601610a75565b91606435908111610235576109169036908701610aab565b989094818114801590610a49575b610a39578a8b5b838a848310610a19575050503403610a09578a5b81811061094a578b80f35b61095581838c610b2f565b356001600160a01b0381169190829003610a055761097481858c610b2f565b359180156109f557878e828152600260205220610992848254610b55565b905561099f828888610b2f565b359063ffffffff60e01b82168092036109f1576001937f5b769452a2090142e059af5137c5b92a3e966cfb03b794cd01ac195d196c00018f8c6109e88d51928392339684610b78565b0390a40161093f565b8e80fd5b87516366e7950960e01b81528a90fd5b8c80fd5b845163534e04af60e01b81528790fd5b92610a2b83610a329360019596610b2f565b3590610b55565b910161092b565b8451634456f5e960e11b81528790fd5b5083811415610924565b8880fd5b8680fd5b859034610825578160031936011261082557602090478152f35b9181601f84011215610aa65782359167ffffffffffffffff8311610aa6576020808501948460051b010111610aa657565b600080fd5b9181601f84011215610aa65782359167ffffffffffffffff8311610aa65760208381860195010111610aa657565b600435906001600160a01b0382168203610aa657565b919082519283825260005b848110610b1b575050826000602080949584010152601f8019910116010190565b602081830181015184830182015201610afa565b9190811015610b3f5760051b0190565b634e487b7160e01b600052603260045260246000fd5b91908201809211610b6257565b634e487b7160e01b600052601160045260246000fd5b91926060938192845260406020850152816040850152848401376000828201840152601f01601f1916010190565b6040810190811067ffffffffffffffff821117610bc257604052565b634e487b7160e01b600052604160045260246000fd5b90601f8019910116810190811067ffffffffffffffff821117610bc257604052565b91908203918211610b6257565b3d15610c42573d9067ffffffffffffffff8211610bc25760405191610c36601f8201601f191660200184610bd8565b82523d6000602084013e565b606090565b60ff8114610c855760ff811690601f8211610c735760405191610c6983610ba6565b8252602082015290565b604051632cd44ac360e21b8152600490fd5b50604051600080549060018260011c9060018416938415610d65575b6020948584108114610d515783875286949392918115610d315750600114610cd5575b5050610cd292500382610bd8565b90565b60008080527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e56395935091905b818310610d19575050610cd293508201013880610cc4565b85548784018501529485019486945091830191610d01565b915050610cd294925060ff191682840152151560051b8201013880610cc4565b634e487b7160e01b85526022600452602485fd5b91607f1691610ca1565b60ff8114610d915760ff811690601f8211610c735760405191610c6983610ba6565b506040516000600190600154918260011c9060018416938415610e3e575b6020948584108114610d515783875286949392918115610d315750600114610ddf575050610cd292500382610bd8565b9093915060016000527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6936000915b818310610e26575050610cd293508201013880610cc4565b85548784018501529485019486945091830191610e0e565b91607f1691610daf565b307f0000000000000000000000004d030e7d6fc1ea7ecead9d6d1e349c1e825c2f596001600160a01b03161480610f4a575b15610ea3577fc3a5860d055d2cad7a74368840d44ebfb268e6d540786c44f6ef4857baa4174e90565b60405160208101907f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f82527f2c4679fa3806a63bb76094fb31a249690e22248001692948fa20c105d49b623b60408201527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260a0815260c0810181811067ffffffffffffffff821117610bc25760405251902090565b507f00000000000000000000000000000000000000000000000000000000000081734614610e7a56fea2646970667358221220269b0c184428ae7c106b0ed19f32d1378714ca47a5387a79030742816e5e81c864736f6c63430008190033

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.