ETH Price: $2,349.90 (-0.89%)

Contract

0xe8A4c1DC1E30E01b7D9471FE0422A60beE3fa36c

Overview

ETH Balance

0.0001 ETH

ETH Value

$0.23 (@ $2,349.90/ETH)

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Block
From
To
Withdraw Deposit4258562032026-01-27 19:02:365 days ago1769540556IN
0xe8A4c1DC...beE3fa36c
0 ETH0.000001590.020024
Withdraw Deposit4258525582026-01-27 18:47:285 days ago1769539648IN
0xe8A4c1DC...beE3fa36c
0 ETH0.000001490.020024
Withdraw Deposit4258525152026-01-27 18:47:175 days ago1769539637IN
0xe8A4c1DC...beE3fa36c
0 ETH0.000001570.020014
Withdraw Deposit4257695912026-01-27 13:03:166 days ago1769518996IN
0xe8A4c1DC...beE3fa36c
0 ETH0.000001620.020382
Withdraw Deposit4251511652026-01-25 18:11:387 days ago1769364698IN
0xe8A4c1DC...beE3fa36c
0 ETH0.000001480.020014
Withdraw Deposit4251499462026-01-25 18:06:327 days ago1769364392IN
0xe8A4c1DC...beE3fa36c
0 ETH0.000001480.020022
Withdraw Deposit4251498592026-01-25 18:06:117 days ago1769364371IN
0xe8A4c1DC...beE3fa36c
0 ETH0.000001590.020132
Withdraw Deposit4233058632026-01-20 9:59:0513 days ago1768903145IN
0xe8A4c1DC...beE3fa36c
0 ETH0.000001820.020074
Withdraw Deposit4042969742025-11-26 11:19:5068 days ago1764155990IN
0xe8A4c1DC...beE3fa36c
0 ETH0.000000780.01
Withdraw Deposit4042969612025-11-26 11:19:4768 days ago1764155987IN
0xe8A4c1DC...beE3fa36c
0 ETH0.000000780.01
Withdraw Deposit4042969452025-11-26 11:19:4368 days ago1764155983IN
0xe8A4c1DC...beE3fa36c
0 ETH0.000000780.01
Withdraw Deposit4042569682025-11-26 8:33:2768 days ago1764146007IN
0xe8A4c1DC...beE3fa36c
0 ETH0.000000790.010115
Withdraw Deposit4040080972025-11-25 15:17:3868 days ago1764083858IN
0xe8A4c1DC...beE3fa36c
0 ETH0.000003750.083166
Withdraw Deposit4040080972025-11-25 15:17:3868 days ago1764083858IN
0xe8A4c1DC...beE3fa36c
0 ETH0.000003750.083166
Withdraw Deposit4040080972025-11-25 15:17:3868 days ago1764083858IN
0xe8A4c1DC...beE3fa36c
0 ETH0.000006560.083166
Withdraw Deposit4040064702025-11-25 15:10:5268 days ago1764083452IN
0xe8A4c1DC...beE3fa36c
0 ETH0.000005230.115187
Withdraw Deposit4040064702025-11-25 15:10:5268 days ago1764083452IN
0xe8A4c1DC...beE3fa36c
0 ETH0.000009110.115187
Withdraw Deposit4039769572025-11-25 13:08:1569 days ago1764076095IN
0xe8A4c1DC...beE3fa36c
0 ETH0.000001270.015778
Withdraw Deposit4039688212025-11-25 12:34:2469 days ago1764074064IN
0xe8A4c1DC...beE3fa36c
0 ETH0.000000730.015042
Withdraw Deposit4039688212025-11-25 12:34:2469 days ago1764074064IN
0xe8A4c1DC...beE3fa36c
0 ETH0.000000730.015042
Withdraw Deposit4039688212025-11-25 12:34:2469 days ago1764074064IN
0xe8A4c1DC...beE3fa36c
0 ETH0.000001230.015042
Withdraw Deposit4039677482025-11-25 12:29:5769 days ago1764073797IN
0xe8A4c1DC...beE3fa36c
0 ETH0.000001520.01858
Withdraw Deposit4039671652025-11-25 12:27:3169 days ago1764073651IN
0xe8A4c1DC...beE3fa36c
0 ETH0.000001850.022828
Withdraw Deposit4016680522025-11-18 20:44:3275 days ago1763498672IN
0xe8A4c1DC...beE3fa36c
0 ETH0.000000970.01
Withdraw Deposit3916448342025-10-20 21:24:26104 days ago1760995466IN
0xe8A4c1DC...beE3fa36c
0 ETH0.000000970.01
View all transactions

Latest 8 internal transactions

Parent Transaction Hash Block From To
3763594352025-09-06 17:02:33148 days ago1757178153
0xe8A4c1DC...beE3fa36c
0.002 ETH
3763586082025-09-06 16:59:07148 days ago1757177947
0xe8A4c1DC...beE3fa36c
0.002 ETH
2023016082024-04-18 13:00:18655 days ago1713445218
0xe8A4c1DC...beE3fa36c
0.0001 ETH
2023015812024-04-18 13:00:11655 days ago1713445211
0xe8A4c1DC...beE3fa36c
0.0001 ETH
2023015682024-04-18 13:00:07655 days ago1713445207
0xe8A4c1DC...beE3fa36c
0.0001 ETH
2023015682024-04-18 13:00:07655 days ago1713445207
0xe8A4c1DC...beE3fa36c
0.0001 ETH
2022861022024-04-18 11:54:25655 days ago1713441265
0xe8A4c1DC...beE3fa36c
0.0001 ETH
2016476302024-04-16 14:49:38656 days ago1713278978
0xe8A4c1DC...beE3fa36c
0.0001 ETH

Cross-Chain Transactions
Loading...
Loading

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

Contract Name:
PeanutV4

Compiler Version
v0.8.23+commit.f704f362

Optimization Enabled:
Yes with 99999 runs

Other Settings:
paris EvmVersion

Contract Source Code (Solidity Standard Json-Input format)

// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.23;

//////////////////////////////////////////////////////////////////////////////////////
// @title   Peanut Protocol
// @notice  This contract is used to send non front-runnable link payments. These can
//          be erc20, erc721, erc1155 or just plain eth. The recipient address is arbitrary.
//          Links use asymmetric ECDSA encryption by default to be secure & enable trustless,
//          gasless claiming.
//          more at: https://peanut.to
// @version 0.4.4
// @author  Squirrel Labs
//////////////////////////////////////////////////////////////////////////////////////
//⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
//                         ⠀⠀⢀⣀⠀⠀⠀⠀⠀⠀
// ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣤⣶⣶⣦⣌⠙⠋⢡⣴⣶⡄⠀⠀
// ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠀⣿⣿⣿⡿⢋⣠⣶⣶⡌⠻⣿⠟⠀⠀
// ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣿⡆⠸⠟⢁⣴⣿⣿⣿⣿⣿⡦⠉⣴⡇⠀
// ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⣿⠟⠀⠰⣿⣿⣿⣿⣿⣿⠟⣠⡄⠹⠀⠀
// ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡀⢸⡿⢋⣤⣿⣄⠙⣿⣿⡿⠟⣡⣾⣿⣿⠀⠀⠀
// ⠀⠀⠀⠀⠀⠀⠀⠀⣠⣴⣾⠿⠀⢠⣾⣿⣿⣿⣦⠈⠉⢠⣾⣿⣿⣿⠏⠀⠀⠀
// ⠀⠀⠀⠀⣀⣤⣦⣄⠙⠋⣠⣴⣿⣿⣿⣿⠿⠛⢁⣴⣦⡄⠙⠛⠋⠁⠀⠀⠀⠀
// ⠀⠀⢀⣾⣿⣿⠟⢁⣴⣦⡈⠻⣿⣿⡿⠁⡀⠚⠛⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
// ⠀⠀⠘⣿⠟⢁⣴⣿⣿⣿⣿⣦⡈⠛⢁⣼⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
// ⠀⢰⡦⠀⢴⣿⣿⣿⣿⣿⣿⣿⠟⢀⠘⠿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
// ⠀⠘⢀⣶⡀⠻⣿⣿⣿⣿⡿⠋⣠⣿⣷⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
// ⠀⠀⢿⣿⣿⣦⡈⠻⣿⠟⢁⣼⣿⣿⠟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
// ⠀⠀⠈⠻⣿⣿⣿⠖⢀⠐⠿⠟⠋⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
// ⠀⠀⠀⠀⠈⠉⠁⠀⠀⠀⠀⠀
//
//////////////////////////////////////////////////////////////////////////////////////

import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol";
import {IL2ECO} from "../util/IL2ECO.sol";
import {IEIP3009} from "../util/IEIP3009.sol";

contract PeanutV4 is IERC721Receiver, IERC1155Receiver, ReentrancyGuard {
    using SafeERC20 for IERC20;

    struct Deposit {
        address pubKey20; // (20 bytes) last 20 bytes of the hash of the public key for the deposit
        uint256 amount; // (32 bytes) amount of the asset being sent
        ///// tokenAddress, contractType, tokenId, claimed & timestamp are stored in a single 32 byte word
        address tokenAddress; // (20 bytes) address of the asset being sent. 0x0 for eth
        uint8 contractType; // (1 byte) 0 for eth, 1 for erc20, 2 for erc721, 3 for erc1155 4 for ECO-like rebasing erc20
        bool claimed; // (1 byte) has this deposit been claimed
        bool requiresMFA; // (1 byte) is additional auth (MFA) required?
        uint40 timestamp; // ( 5 bytes) timestamp of the deposit
        /////
        uint256 tokenId; // (32 bytes) id of the token being sent (if erc721 or erc1155)
        address senderAddress; // (20 bytes) address of the sender
        ///// slot for address-bound links data
        address recipient; // unless it's 0x00, only this address can claim the link
        uint40 reclaimableAfter; // for address-bound links, the sender is able to re-claim only after this timestamp
    } // 6 storage slots (32 byte each)

    // We may include this hash in peanut-specific signatures to make sure
    // that the message signed by the user has effects only in peanut contracts.
    bytes32 public constant PEANUT_SALT = 0x70adbbeba9d4f0c82e28dd574f15466f75df0543b65f24460fc445813b5d94e0; // keccak256("Konrad makes tokens go woosh tadam");

    bytes32 public constant ANYONE_WITHDRAWAL_MODE = 0x0000000000000000000000000000000000000000000000000000000000000000; // default. Any address can trigger the withdrawal function
    bytes32 public constant RECIPIENT_WITHDRAWAL_MODE = 0x2bb5bef2b248d3edba501ad918c3ab524cce2aea54d4c914414e1c4401dc4ff4; // keccak256("only recipient") - only the signed recipient can trigger the withdrawal function

    bytes32 public DOMAIN_SEPARATOR; // initialized in the constructor

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

    address public constant MFA_AUTHORIZER = 0x3B14D43Bf521EF7FD9600533bEB73B6e9178DE7C;

    struct EIP712Domain {
        string name;
        string version;
        uint256 chainId;
        address verifyingContract;
    }

    bytes32 public constant GASLESS_RECLAIM_TYPEHASH = keccak256("GaslessReclaim(uint256 depositIndex)");

    struct GaslessReclaim {
        uint256 depositIndex;
    }

    Deposit[] public deposits; // array of deposits
    address public ecoAddress; // address of the ECO token

    // events
    event DepositEvent(
        uint256 indexed _index, uint8 indexed _contractType, uint256 _amount, address indexed _senderAddress
    );
    event WithdrawEvent(
        uint256 indexed _index, uint8 indexed _contractType, uint256 _amount, address indexed _recipientAddress
    );
    event MessageEvent(string message);

    // constructor. Accepts ECO token address to prohibit ECO usage in normal
    // ERC20 deposits.
    // Initializes DOMAIN_SEPARATOR.
    // Wishes you a nutty day.
    constructor(address _ecoAddress) {
        emit MessageEvent("Hello World, have a nutty day!");
        ecoAddress = _ecoAddress;
        DOMAIN_SEPARATOR = hash(
            EIP712Domain({name: "Peanut", version: "4.2", chainId: block.chainid, verifyingContract: address(this)})
        );
    }

    function hash(EIP712Domain memory eip712Domain) internal pure returns (bytes32) {
        return keccak256(
            abi.encode(
                EIP712DOMAIN_TYPEHASH,
                keccak256(bytes(eip712Domain.name)),
                keccak256(bytes(eip712Domain.version)),
                eip712Domain.chainId,
                eip712Domain.verifyingContract
            )
        );
    }

    function hash(GaslessReclaim memory reclaim) internal pure returns (bytes32) {
        return keccak256(abi.encode(GASLESS_RECLAIM_TYPEHASH, reclaim.depositIndex));
    }

    /**
     * @notice Recover a EIP-712 signed gasless reclaim message
     * @param reclaim the reclaim request
     * @param signer the expected signer of the reclaim request
     * @param signature r-s-v if the signer is an EOA or any random bytes if the signer is a smart contract
     */
    function verifyGaslessReclaim(GaslessReclaim memory reclaim, address signer, bytes memory signature)
        internal
        view
    {
        // Note: we need to use `encodePacked` here instead of `encode`.
        bytes32 digest = keccak256(abi.encodePacked("\x19\x01", DOMAIN_SEPARATOR, hash(reclaim)));
        // By using SignatureChecker we support both EOAs and smart contract wallets
        bool valid = SignatureChecker.isValidSignatureNow(signer, digest, signature);
        require(valid, "INVALID SIGNATURE");
    }

    /**
     * @notice supportsInterface function
     *     @dev ERC165 interface detection
     *     @param _interfaceId bytes4 the interface identifier, as specified in ERC-165
     *     @return bool true if the contract implements the interface specified in _interfaceId
     */
    function supportsInterface(bytes4 _interfaceId) external pure override returns (bool) {
        return _interfaceId == type(IERC165).interfaceId || _interfaceId == type(IERC721Receiver).interfaceId
            || _interfaceId == type(IERC1155Receiver).interfaceId;
    }

    /*
     * A minimalistic function to make a deposit.
     * @deprecated makeCustomDeposit should be used for everything
     */
    function makeDeposit(
        address _tokenAddress,
        uint8 _contractType,
        uint256 _amount,
        uint256 _tokenId,
        address _pubKey20
    ) public payable nonReentrant returns (uint256) {
        _amount = _pullTokensViaApproval(
            _tokenAddress,
            _contractType,
            _amount,
            _tokenId
        );
        return _storeDeposit(
            _tokenAddress,
            _contractType,
            _amount,
            _tokenId,
            _pubKey20,
            msg.sender, // the sender is the onBehalfOf here
            false, // no MFA
            address(0), // no restrictions on the recipient
            0 // no restrictions on the recipient
        );
    }

    /*
     * Makes a minimalistic with MFA (requires an external authorisation to withdraw).
     * @deprecated makeCustomDeposit should be used for everything
     */
    function makeMFADeposit(
        address _tokenAddress,
        uint8 _contractType,
        uint256 _amount,
        uint256 _tokenId,
        address _pubKey20
    ) public payable nonReentrant returns (uint256) {
        _amount = _pullTokensViaApproval(
            _tokenAddress,
            _contractType,
            _amount,
            _tokenId
        );
        return _storeDeposit(
            _tokenAddress,
            _contractType,
            _amount,
            _tokenId,
            _pubKey20,
            msg.sender, // the sender is the onBehalfOf here
            true, // with MFA
            address(0), // no restrictions on the recipient
            0 // no restrictions on the recipient
        );
    }

    /*
     * Minimalistic function to make an MFA deposit and delegate ownership of the deposit.
     * @deprecated makeCustomDeposit should be used for everything
     */
    function makeSelflessMFADeposit(
        address _tokenAddress,
        uint8 _contractType,
        uint256 _amount,
        uint256 _tokenId,
        address _pubKey20,
        address _onBehalfOf
    ) public payable nonReentrant returns (uint256) {
        _amount = _pullTokensViaApproval(
            _tokenAddress,
            _contractType,
            _amount,
            _tokenId
        );
        return _storeDeposit(
            _tokenAddress,
            _contractType,
            _amount,
            _tokenId,
            _pubKey20,
            _onBehalfOf,
            true, // with MFA
            address(0), // no restrictions on the recipient
            0 // no restrictions on the recipient
        );
    }

    /*
     * Minimalistic function to make a deposit and delegate ownership.
     * @deprecated makeCustomDeposit should be used for everything
     */
    function makeSelflessDeposit(
        address _tokenAddress,
        uint8 _contractType,
        uint256 _amount,
        uint256 _tokenId,
        address _pubKey20,
        address _onBehalfOf
    ) public payable nonReentrant returns (uint256) {
        _amount = _pullTokensViaApproval(
            _tokenAddress,
            _contractType,
            _amount,
            _tokenId
        );
        return _storeDeposit(
            _tokenAddress,
            _contractType,
            _amount,
            _tokenId,
            _pubKey20,
            _onBehalfOf,
            false, // no MFA
            address(0), // no restrictions on the recipient
            0 // no restrictions on the recipient
        );
    }

    /**
     * The big main function that supports ALL possible scenarios of depositing. 
     * @dev For token deposits, allowance must be set before calling this function
     * @param _tokenAddress address of the token being sent. 0x0 for eth
     * @param _contractType uint8 for the type of contract being sent. 0 for eth, 1 for erc20, 2 for erc721, 3 for erc1155, 4 for ECO-like rebasing erc20
     * @param _amount uint256 of the amount of tokens being sent (if erc20)
     * @param _tokenId uint256 of the id of the token being sent if erc721 or erc1155
     * @param _pubKey20 last 20 bytes of the public key of the deposit signer
     * @param _onBehalfOf who will be able to reclaim the link if the private key is lost
     * @param _withMFA whether an external auhorisation is required for withdrawal
     * @param _recipient if not 0x00.00, only _recipient will be able to withdraw
     * @param _reclaimableAfter if _recipient is set, the sender will be able to reclaim only after this timestamp
     * @param _isGasless3009 if true, the deposit will be made via eip-3009, see makeDepositWithAuthorization funfction for more info
     * @param _args3009 all the arguments for an EIP-3009 deposit, used if _isGasless3009 is true. Encoded with abi.encode, this is: address (from), bytes32 (_nonce), uint256 (_validAfter), uint256 (_validBefore), uint8 (_v), bytes32 (_r), bytes32 (_s). Unfortunately we have to encode it this way, because else we get a stack too deep error (EVM supports max 16 variables on the stack). 
     * @return uint256 index of the deposit
    */
    function makeCustomDeposit(
        address _tokenAddress,
        uint8 _contractType,
        uint256 _amount,
        uint256 _tokenId,
        address _pubKey20,
        address _onBehalfOf,
        bool _withMFA,
        // arguments for address-bound deposits
        address _recipient,
        uint40 _reclaimableAfter,
        // arguments for 3009 
        bool _isGasless3009,
        bytes calldata _args3009
    ) public payable nonReentrant returns (uint256) {
        if (_isGasless3009) {
            require(_contractType == 1, "_contractType HAS TO BE 1 FOR 3009");
            _amount = _pullTokensVia3009Encoded(
                _tokenAddress,
                _amount,
                _pubKey20,
                _onBehalfOf,
                _args3009
            );
        } else {
            _amount = _pullTokensViaApproval(
                _tokenAddress,
                _contractType,
                _amount,
                _tokenId
            );
        }

        return _storeDeposit(
            _tokenAddress,
            _contractType,
            _amount,
            _tokenId,
            _pubKey20,
            _onBehalfOf,
            _withMFA,
            _recipient,
            _reclaimableAfter
        );
    }

    function _storeDeposit(
        address _tokenAddress,
        uint8 _contractType,
        uint256 _amount,
        uint256 _tokenId,
        address _pubKey20,
        address _onBehalfOf,
        bool _requiresMFA,
        address _recipient,
        uint40 _reclaimableAfter
    ) internal returns (uint256) {
        // create deposit
        deposits.push(
            Deposit({
                tokenAddress: _tokenAddress,
                contractType: _contractType,
                amount: _amount,
                tokenId: _tokenId,
                claimed: false,
                pubKey20: _pubKey20,
                senderAddress: _onBehalfOf,
                timestamp: uint40(block.timestamp),
                requiresMFA: _requiresMFA,
                recipient: _recipient,
                reclaimableAfter: _reclaimableAfter
            })
        );

        // emit the deposit event
        emit DepositEvent(deposits.length - 1, _contractType, _amount, _onBehalfOf);

        // return id of new deposit
        return deposits.length - 1;
    }

    /**
     * Pulls tokens from msg.sender via a standard approval.
     * @return IMPORTANT: returns the amount that has been actually deposited. MUST be used by the caller.
     */
    function _pullTokensViaApproval(
        address _tokenAddress,
        uint8 _contractType,
        uint256 _amount,
        uint256 _tokenId
    ) internal returns (uint256) {
        // check that the contract type is valid
        require(_contractType < 5, "INVALID CONTRACT TYPE");

        // handle deposit types
        if (_contractType == 0) {
            require(_amount == msg.value, "WRONG ETH AMOUNT");
        } else if (_contractType == 1) {
            // REMINDER: User must approve this contract to spend the tokens before calling this function
            // Unfortunately there's no way of doing this in just one transaction.
            // Wallet abstraction pls

            // If ECO is deposited as a normal ERC20 and then inflation is increased,
            // the recipient would get more tokens than what was deposited.
            require(_tokenAddress != ecoAddress, "ECO DEPOSITS MUST USE _contractType 4");

            IERC20 token = IERC20(_tokenAddress);

            // transfer the tokens to the contract
            token.safeTransferFrom(msg.sender, address(this), _amount);
        } else if (_contractType == 2) {
            // REMINDER: User must approve this contract to spend the tokens before calling this function.
            require(_amount == 1, "AMOUNT MUST BE 1 FOR ERC721");

            IERC721 token = IERC721(_tokenAddress);
            // require(token.ownerOf(_tokenId) == msg.sender, "Invalid token id");
            token.safeTransferFrom(msg.sender, address(this), _tokenId, "Internal transfer");
        } else if (_contractType == 3) {
            // REMINDER: User must approve this contract to spend the tokens before calling this function.

            IERC1155 token = IERC1155(_tokenAddress);
            token.safeTransferFrom(msg.sender, address(this), _tokenId, _amount, "Internal transfer");
        } else if (_contractType == 4) {
            // REMINDER: User must approve this contract to spend the tokens before calling this function
            IL2ECO token = IL2ECO(_tokenAddress);

            // transfer the tokens to the contract
            require(
                token.transferFrom(msg.sender, address(this), _amount), "TRANSFER FAILED. CHECK ALLOWANCE & BALANCE"
            );

            // calculate the rebase invariant amount to store in the deposits array
            _amount *= token.linearInflationMultiplier();
        }

        return _amount;
    }

    /**
     * Pulls the tokens via EIP-3009 according to the encoded data
     * Also validates that _onBehalfOf is the unpacked  _from.
     */
    function _pullTokensVia3009Encoded(
        address _tokenAddress,
        uint256 _amount,
        address _pubKey20,
        address _onBehalfOf,
        bytes calldata _encodedArgs
    ) internal returns (uint256) {
        address _from;
        bytes32 _nonce;
        uint256 _validAfter;
        uint256 _validBefore;
        uint8 _v;
        bytes32 _r;
        bytes32 _s;

        (_from, _nonce, _validAfter, _validBefore, _v, _r, _s) =
            abi.decode(_encodedArgs, (address, bytes32, uint256, uint256, uint8, bytes32, bytes32));

        require(_from == _onBehalfOf, "WRONG _onBehalfOf FOR EIP-3009");
        return _pullTokensVia3009(_tokenAddress, _from, _amount, _pubKey20, _nonce, _validAfter, _validBefore, _v, _r, _s);
    }

    /**
     * Performs a EIP-3009 transfer for tokens like USDC.
     * Reverts if the transfer failed.
     * Returns the amount of actually deposited tokens.
     */
    function _pullTokensVia3009(
        address _tokenAddress,
        address _from,
        uint256 _amount,
        address _pubKey20,
        bytes32 _nonce,
        uint256 _validAfter,
        uint256 _validBefore,
        uint8 _v,
        bytes32 _r,
        bytes32 _s
    ) internal returns(uint256) {
        // Recalculate the nonce.
        // If we don't include pubKey20 in the nonce, the link will be front-runnable
        bytes32 nonce = keccak256(abi.encodePacked(_pubKey20, _nonce));

        IEIP3009 token = IEIP3009(_tokenAddress);
        token.receiveWithAuthorization(
            _from,
            address(this), // to
            _amount,
            _validAfter,
            _validBefore,
            nonce,
            _v,
            _r,
            _s
        );
        
        return _amount;
    }

    /**
     * @notice Function to make a deposit with EIP-3009 authorization
     * @dev No need to pre-approve tokens!
     * @param _tokenAddress address of the token being sent
     * @param _from the depositor of the tokens
     * @param _amount uint256 of the amount of tokens being sent
     * @param _pubKey20 last 20 bytes of the public key of the deposit signer
     * @param _nonce a unique value
     * @param _validAfter deposit is valid only after this timestamp (in seconds)
     * @param _validBefore deposit is valid only before this timestamp (in seconds)
     * @param _v v of the signature
     * @param _r r of the signature
     * @param _s s of the signature
     * @return uint256 index of the deposit
     */
    function makeDepositWithAuthorization(
        address _tokenAddress,
        address _from,
        uint256 _amount,
        address _pubKey20,
        bytes32 _nonce,
        uint256 _validAfter,
        uint256 _validBefore,
        uint8 _v,
        bytes32 _r,
        bytes32 _s
    ) public nonReentrant returns (uint256) {
        // If ECO is deposited as a normal ERC20 and then inflation is increased,
        // the recipient would get more tokens than what was deposited.
        require(_tokenAddress != ecoAddress, "ECO must be be deposited via makeDeposit with tokenType 4");

        _pullTokensVia3009(
             _tokenAddress,
             _from,
             _amount,
             _pubKey20,
             _nonce,
            _validAfter,
            _validBefore,
            _v,
            _r,
            _s
        );

        return _storeDeposit(
            _tokenAddress,
            1, // contractType is always 1 here (ERC20)
            _amount,
            0, // it's alwasy ERC20, so tokenId doesn't matter
            _pubKey20,
            _from,
            false, // no MFA
            address(0), // no restrictions on the recipient
            0 // no restrictions on the recipient
        );
    }

    /**
     * @notice Erc721 token receiver function
     * @dev These functions are called by the token contracts when a token is sent to this contract
     */
    function onERC721Received(address _operator, address _from, uint256 _tokenId, bytes calldata _data)
        external
        override
        returns (bytes4)
    {
        if (_operator == address(this)) {
            return this.onERC721Received.selector;
        }
    }

    /**
     * @notice Erc1155 token receiver function
     * @dev These functions are called by the token contracts when a token is sent to this contract
     */
    function onERC1155Received(address _operator, address _from, uint256 _tokenId, uint256 _value, bytes calldata _data)
        external
        override
        returns (bytes4)
    {
        if (_operator == address(this)) {
            return this.onERC1155Received.selector;
        }
    }

    /**
     * @notice Erc1155 token receiver function
     * @dev These functions are called by the token contracts when a set of tokens is sent to this contract
     */
    function onERC1155BatchReceived(
        address _operator,
        address _from,
        uint256[] calldata _ids,
        uint256[] calldata _values,
        bytes calldata _data
    ) external override returns (bytes4) {
        if (_operator == address(this)) {
            return this.onERC1155BatchReceived.selector;
        }
     }

    /**
     * @notice Function to withdraw tokens. Can be called by anyone.
     * @return bool true if successful
     */
    function withdrawDeposit(
        uint256 _index,
        address _recipientAddress,
        bytes memory _signature
    ) external nonReentrant returns (bool) {
        return _withdrawDeposit(
            _index,
            _recipientAddress,
            ANYONE_WITHDRAWAL_MODE,
            _signature,
            false
        );
    }

    /**
     * @notice Function to withdraw tokens with MFA.
     * @return bool true if successful
     */
    function withdrawMFADeposit(
        uint256 _index,
        address _recipientAddress,
        bytes memory _signature,
        bytes memory _MFASignature
    ) external nonReentrant returns (bool) {
        // Verify the MFA signature
        bytes32 digest = ECDSA.toEthSignedMessageHash(
            keccak256(
                abi.encodePacked(
                    PEANUT_SALT,
                    block.chainid,
                    address(this),
                    _index,
                    _recipientAddress
                )
            )
        );
        address authorizationSigner = getSigner(digest, _MFASignature);
        require(authorizationSigner == MFA_AUTHORIZER, "WRONG MFA SIGNATURE");

        return _withdrawDeposit(
            _index,
            _recipientAddress,
            ANYONE_WITHDRAWAL_MODE,
            _signature,
            true
        );
    }

    /**
     * @notice Function to withdraw tokens. Must be called by the recipient.
     *         This is useful for 
     * @return bool true if successful
     */
    function withdrawDepositAsRecipient(
        uint256 _index,
        address _recipientAddress,
        bytes memory _signature
    ) external nonReentrant returns (bool) {
        require(_recipientAddress == msg.sender, "NOT THE RECIPIENT");

        return _withdrawDeposit(
            _index,
            _recipientAddress,
            RECIPIENT_WITHDRAWAL_MODE,
            _signature,
            false
        );
    }

    /**
     * @notice Function to withdraw a deposit. Withdraws the deposit to the recipient address.
     * @dev _recipientAddressHash is hash("\x19Ethereum Signed Message:\n32" + hash(_recipientAddress))
     * @dev The signature should be signed with the private key corresponding to the public key stored in the deposit
     * @dev We don't check the unhashed address for security reasons. It's preferable to sign a hash of the address.
     * @param _index uint256 index of the deposit
     * @param _recipientAddress address of the recipient
     * @param _extraData extra data that has to be signed by the user
     * @param _signature bytes signature of the recipient address (65 bytes)
     * @return bool true if successful
     */
    function _withdrawDeposit(
        uint256 _index,
        address _recipientAddress,
        bytes32 _extraData,
        bytes memory _signature,
        bool _authorized
    ) internal returns (bool) {
        // check that the deposit exists and that it isn't already withdrawn
        require(_index < deposits.length, "DEPOSIT INDEX DOES NOT EXIST");
        Deposit memory _deposit = deposits[_index];
        require(_deposit.claimed == false, "DEPOSIT ALREADY WITHDRAWN");
        
        // check that the signer is the same as the one stored in the deposit.
        // Signature may be empty for address-bound deposits.
        address depositSigner;
        if (_signature.length > 0) {
            // Compute the hash of the withdrawal message
            bytes32 _recipientAddressHash = ECDSA.toEthSignedMessageHash(
                keccak256(
                    abi.encodePacked(
                        PEANUT_SALT,
                        block.chainid,
                        address(this),
                        _index,
                        _recipientAddress,
                        _extraData
                    )
                )
            );
            depositSigner = getSigner(_recipientAddressHash, _signature);
        }
        require(!_deposit.requiresMFA || _authorized, "REQUIRES AUTHORIZATION");
        require(_deposit.pubKey20 == address(0) || depositSigner == _deposit.pubKey20, "WRONG SIGNATURE");
        require(_deposit.recipient == address(0) || _recipientAddress == _deposit.recipient, "WRONG RECIPIENT");

        // emit the withdraw event
        emit WithdrawEvent(_index, _deposit.contractType, _deposit.amount, _recipientAddress);

        // mark as claimed
        deposits[_index].claimed = true;

        // Deposit request is valid. Withdraw the deposit to the recipient address.
        if (_deposit.contractType == 0) {
            /// handle eth deposits
            (bool success,) = _recipientAddress.call{value: _deposit.amount}("");
            require(success, "Transfer failed");
        } else if (_deposit.contractType == 1) {
            /// handle erc20 deposits
            IERC20 token = IERC20(_deposit.tokenAddress);
            token.safeTransfer(_recipientAddress, _deposit.amount);
        } else if (_deposit.contractType == 2) {
            /// handle erc721 deposits
            IERC721 token = IERC721(_deposit.tokenAddress);
            token.safeTransferFrom(address(this), _recipientAddress, _deposit.tokenId);
        } else if (_deposit.contractType == 3) {
            /// handle erc1155 deposits
            IERC1155 token = IERC1155(_deposit.tokenAddress);
            token.safeTransferFrom(address(this), _recipientAddress, _deposit.tokenId, _deposit.amount, "");
        } else if (_deposit.contractType == 4) {
            /// handle rebasing erc20 deposits on l2
            IL2ECO token = IL2ECO(_deposit.tokenAddress);
            uint256 scaledAmount = _deposit.amount / token.linearInflationMultiplier();
            require(token.transfer(_deposit.senderAddress, scaledAmount), "TRANSFER FAILED");
        }

        return true;
    }

    /**
     * @notice Function to allow a sender to withdraw their deposit after 24 hours
     * @param _index uint256 index of the deposit
     * @param _senderAddress the address of the depositor
     * @return bool true if successful
     */
    function _withdrawDepositSender(uint256 _index, address _senderAddress) internal returns (bool) {
        // check that the deposit exists
        require(_index < deposits.length, "DEPOSIT INDEX DOES NOT EXIST");
        Deposit memory _deposit = deposits[_index];
        require(_deposit.claimed == false, "DEPOSIT ALREADY WITHDRAWN");
        // check that the sender is the one who made the deposit
        require(_deposit.senderAddress == _senderAddress, "NOT THE SENDER");
        // check timestamp for address-bound links
        if (_deposit.recipient != address(0)) {
            require(block.timestamp > _deposit.reclaimableAfter, "TOO EARLY TO RECLAIM");
        }

        // emit the withdraw event
        emit WithdrawEvent(_index, _deposit.contractType, _deposit.amount, _deposit.senderAddress);

        // Delete the deposit
        deposits[_index].claimed = true;

        if (_deposit.contractType == 0) {
            /// handle eth deposits
            (bool success,) = payable(_deposit.senderAddress).call{value: _deposit.amount}("");
            require(success, "FAILED TO WITHDRAW ETH TO SENDER");
        } else if (_deposit.contractType == 1) {
            /// handle erc20 deposits
            IERC20 token = IERC20(_deposit.tokenAddress);
            token.safeTransfer(_deposit.senderAddress, _deposit.amount);
        } else if (_deposit.contractType == 2) {
            /// handle erc721 deposits
            IERC721 token = IERC721(_deposit.tokenAddress);
            token.safeTransferFrom(address(this), _deposit.senderAddress, _deposit.tokenId);
        } else if (_deposit.contractType == 3) {
            /// handle erc1155 deposits
            IERC1155 token = IERC1155(_deposit.tokenAddress);
            token.safeTransferFrom(address(this), _deposit.senderAddress, _deposit.tokenId, _deposit.amount, "");
        } else if (_deposit.contractType == 4) {
            /// handle rebasing erc20 deposits on l2
            IL2ECO token = IL2ECO(_deposit.tokenAddress);
            uint256 scaledAmount = _deposit.amount / token.linearInflationMultiplier();
            require(token.transfer(_deposit.senderAddress, scaledAmount), "TRANSFER FAILED");
        }

        return true;
    }

    function withdrawDepositSender(uint256 _index) external nonReentrant returns (bool) {
        return _withdrawDepositSender(_index, msg.sender);
    }

    function withdrawDepositSenderGasless(GaslessReclaim calldata reclaim, address signer, bytes calldata signature)
        external
        nonReentrant
        returns (bool)
    {
        verifyGaslessReclaim(reclaim, signer, signature);
        return _withdrawDepositSender(reclaim.depositIndex, signer);
    }

    //// Some utility functions ////

    /**
     * @notice Gets the signer of a messageHash. Used for signature verification.
     * @dev Uses ECDSA.recover. On Frontend, use secp256k1 to sign the messageHash
     * @dev also remember to prepend the messageHash with "\x19Ethereum Signed Message:\n32"
     * @param messageHash bytes32 hash of the message
     * @param signature bytes signature of the message
     * @return address of the signer
     */
    function getSigner(bytes32 messageHash, bytes memory signature) public pure returns (address) {
        address signer = ECDSA.recover(messageHash, signature);
        return signer;
    }

    /**
     * @notice Simple way to get the total number of deposits
     * @return uint256 number of deposits
     */
    function getDepositCount() external view returns (uint256) {
        return deposits.length;
    }

    /**
     * @notice Simple way to get single deposit
     * @param _index uint256 index of the deposit
     * @return Deposit struct
     */
    function getDeposit(uint256 _index) external view returns (Deposit memory) {
        return deposits[_index];
    }

    /**
     * @notice Get all deposits in contract
     * @return Deposit[] array of deposits
     */
    function getAllDeposits() external view returns (Deposit[] memory) {
        return deposits;
    }

    /**
     * @notice Get all deposits for a given address
     * @param _address address of the deposits
     * @return Deposit[] array of deposits
     */
    function getAllDepositsForAddress(address _address) external view returns (Deposit[] memory) {
        uint256 count = 0;
        for (uint256 i = 0; i < deposits.length; i++) {
            if (deposits[i].senderAddress == _address) {
                count++;
            }
        }

        Deposit[] memory _deposits = new Deposit[](count);

        count = 0;
        // Second loop to populate the array
        for (uint256 i = 0; i < deposits.length; i++) {
            if (deposits[i].senderAddress == _address) {
                _deposits[count] = deposits[i];
                count++;
            }
        }
        return _deposits;
    }

    // and that's all! Have a nutty day!
}

// 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));
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/IERC20Permit.sol";
import "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(IERC20 token, address spender, uint256 value) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Compatible with tokens that require the approval to be set to
     * 0 before setting it to a non-zero value.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);

        if (!_callOptionalReturnBool(token, approvalCall)) {
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
            _callOptionalReturn(token, approvalCall);
        }
    }

    /**
     * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
     * Revert on invalid signature.
     */
    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

        (bool success, bytes memory returndata) = address(token).call(data);
        return
            success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
     * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
     * understand this adds an external call which potentially creates a reentrancy vulnerability.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 tokenId) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool approved) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);
}

File 5 of 19 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.0;

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
interface IERC721Receiver {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
     *
     * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC1155/IERC1155.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC1155 compliant contract, as defined in the
 * https://eips.ethereum.org/EIPS/eip-1155[EIP].
 *
 * _Available since v3.1._
 */
interface IERC1155 is IERC165 {
    /**
     * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
     */
    event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);

    /**
     * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
     * transfers.
     */
    event TransferBatch(
        address indexed operator,
        address indexed from,
        address indexed to,
        uint256[] ids,
        uint256[] values
    );

    /**
     * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
     * `approved`.
     */
    event ApprovalForAll(address indexed account, address indexed operator, bool approved);

    /**
     * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
     *
     * If an {URI} event was emitted for `id`, the standard
     * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
     * returned by {IERC1155MetadataURI-uri}.
     */
    event URI(string value, uint256 indexed id);

    /**
     * @dev Returns the amount of tokens of token type `id` owned by `account`.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function balanceOf(address account, uint256 id) external view returns (uint256);

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(
        address[] calldata accounts,
        uint256[] calldata ids
    ) external view returns (uint256[] memory);

    /**
     * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
     *
     * Emits an {ApprovalForAll} event.
     *
     * Requirements:
     *
     * - `operator` cannot be the caller.
     */
    function setApprovalForAll(address operator, bool approved) external;

    /**
     * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
     *
     * See {setApprovalForAll}.
     */
    function isApprovedForAll(address account, address operator) external view returns (bool);

    /**
     * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.
     * - `from` must have a balance of tokens of type `id` of at least `amount`.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes calldata data) external;

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] calldata ids,
        uint256[] calldata amounts,
        bytes calldata data
    ) external;
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

/**
 * @dev _Available since v3.1._
 */
interface IERC1155Receiver is IERC165 {
    /**
     * @dev Handles the receipt of a single ERC1155 token type. This function is
     * called at the end of a `safeTransferFrom` after the balance has been updated.
     *
     * NOTE: To accept the transfer, this must return
     * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
     * (i.e. 0xf23a6e61, or its own function selector).
     *
     * @param operator The address which initiated the transfer (i.e. msg.sender)
     * @param from The address which previously owned the token
     * @param id The ID of the token being transferred
     * @param value The amount of tokens being transferred
     * @param data Additional data with no specified format
     * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
     */
    function onERC1155Received(
        address operator,
        address from,
        uint256 id,
        uint256 value,
        bytes calldata data
    ) external returns (bytes4);

    /**
     * @dev Handles the receipt of a multiple ERC1155 token types. This function
     * is called at the end of a `safeBatchTransferFrom` after the balances have
     * been updated.
     *
     * NOTE: To accept the transfer(s), this must return
     * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
     * (i.e. 0xbc197c81, or its own function selector).
     *
     * @param operator The address which initiated the batch transfer (i.e. msg.sender)
     * @param from The address which previously owned the token
     * @param ids An array containing ids of each token being transferred (order and length must match values array)
     * @param values An array containing amounts of each token being transferred (order and length must match ids array)
     * @param data Additional data with no specified format
     * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed
     */
    function onERC1155BatchReceived(
        address operator,
        address from,
        uint256[] calldata ids,
        uint256[] calldata values,
        bytes calldata data
    ) external returns (bytes4);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;
    }

    function _nonReentrantAfter() private {
        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == _ENTERED;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/cryptography/SignatureChecker.sol)

pragma solidity ^0.8.0;

import "./ECDSA.sol";
import "../../interfaces/IERC1271.sol";

/**
 * @dev Signature verification helper that can be used instead of `ECDSA.recover` to seamlessly support both ECDSA
 * signatures from externally owned accounts (EOAs) as well as ERC1271 signatures from smart contract wallets like
 * Argent and Gnosis Safe.
 *
 * _Available since v4.1._
 */
library SignatureChecker {
    /**
     * @dev Checks if a signature is valid for a given signer and data hash. If the signer is a smart contract, the
     * signature is validated against that smart contract using ERC1271, otherwise it's validated using `ECDSA.recover`.
     *
     * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus
     * change through time. It could return true at block N and false at block N+1 (or the opposite).
     */
    function isValidSignatureNow(address signer, bytes32 hash, bytes memory signature) internal view returns (bool) {
        (address recovered, ECDSA.RecoverError error) = ECDSA.tryRecover(hash, signature);
        return
            (error == ECDSA.RecoverError.NoError && recovered == signer) ||
            isValidERC1271SignatureNow(signer, hash, signature);
    }

    /**
     * @dev Checks if a signature is valid for a given signer and data hash. The signature is validated
     * against the signer smart contract using ERC1271.
     *
     * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus
     * change through time. It could return true at block N and false at block N+1 (or the opposite).
     */
    function isValidERC1271SignatureNow(
        address signer,
        bytes32 hash,
        bytes memory signature
    ) internal view returns (bool) {
        (bool success, bytes memory result) = signer.staticcall(
            abi.encodeWithSelector(IERC1271.isValidSignature.selector, hash, signature)
        );
        return (success &&
            result.length >= 32 &&
            abi.decode(result, (bytes32)) == bytes32(IERC1271.isValidSignature.selector));
    }
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

interface IL2ECO is IERC20 {
    function linearInflationMultiplier() external view returns (uint256);
}

pragma solidity ^0.8.23;

interface IEIP3009 {
    /**
     * @notice Execute a transfer with a signed authorization
     * @param from          Payer's address (Authorizer)
     * @param to            Payee's address
     * @param value         Amount to be transferred
     * @param validAfter    The time after which this is valid (unix time)
     * @param validBefore   The time before which this is valid (unix time)
     * @param nonce         Unique nonce
     * @param v             v of the signature
     * @param r             r of the signature
     * @param s             s of the signature
     */
    function transferWithAuthorization(
        address from,
        address to,
        uint256 value,
        uint256 validAfter,
        uint256 validBefore,
        bytes32 nonce,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @notice Receive a transfer with a signed authorization from the payer
     * @dev This has an additional check to ensure that the payee's address
     * matches the caller of this function to prevent front-running attacks.
     * @param from          Payer's address (Authorizer)
     * @param to            Payee's address
     * @param value         Amount to be transferred
     * @param validAfter    The time after which this is valid (unix time)
     * @param validBefore   The time before which this is valid (unix time)
     * @param nonce         Unique nonce
     * @param v             v of the signature
     * @param r             r of the signature
     * @param s             s of the signature
     */
    function receiveWithAuthorization(
        address from,
        address to,
        uint256 value,
        uint256 validAfter,
        uint256 validBefore,
        bytes32 nonce,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @notice Attempt to cancel an authorization
     * @dev Works only if the authorization is not yet used.
     * @param authorizer    Authorizer's address
     * @param nonce         Nonce of the authorization
     * @param v             v of the signature
     * @param r             r of the signature
     * @param s             s of the signature
     */
    function cancelAuthorization(address authorizer, bytes32 nonce, uint8 v, bytes32 r, bytes32 s) external;
}

// 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));
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 amount) external returns (bool);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     *
     * Furthermore, `isContract` will also return true if the target contract within
     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
     * which only has an effect at the end of a transaction.
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC1271.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC1271 standard signature validation method for
 * contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271].
 *
 * _Available since v4.1._
 */
interface IERC1271 {
    /**
     * @dev Should return whether the signature provided is valid for the provided data
     * @param hash      Hash of the data to be signed
     * @param signature Signature byte array associated with _data
     */
    function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue);
}

// 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);
        }
    }
}

// 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/=lib/openzeppelin-contracts/",
    "@helix-foundation/=lib/",
    "@forge-std/=lib/forge-std/src/",
    "create3-factory/=lib/create3-factory/",
    "currency/=lib/currency/contracts/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
    "forge-std/=lib/forge-std/src/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "openzeppelin/=lib/openzeppelin-contracts/contracts/",
    "solmate/=lib/create3-factory/lib/solmate/src/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 99999
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "libraries": {}
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_ecoAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_index","type":"uint256"},{"indexed":true,"internalType":"uint8","name":"_contractType","type":"uint8"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"_senderAddress","type":"address"}],"name":"DepositEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"message","type":"string"}],"name":"MessageEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_index","type":"uint256"},{"indexed":true,"internalType":"uint8","name":"_contractType","type":"uint8"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"_recipientAddress","type":"address"}],"name":"WithdrawEvent","type":"event"},{"inputs":[],"name":"ANYONE_WITHDRAWAL_MODE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EIP712DOMAIN_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"GASLESS_RECLAIM_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MFA_AUTHORIZER","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PEANUT_SALT","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"RECIPIENT_WITHDRAWAL_MODE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"deposits","outputs":[{"internalType":"address","name":"pubKey20","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint8","name":"contractType","type":"uint8"},{"internalType":"bool","name":"claimed","type":"bool"},{"internalType":"bool","name":"requiresMFA","type":"bool"},{"internalType":"uint40","name":"timestamp","type":"uint40"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"senderAddress","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint40","name":"reclaimableAfter","type":"uint40"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ecoAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAllDeposits","outputs":[{"components":[{"internalType":"address","name":"pubKey20","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint8","name":"contractType","type":"uint8"},{"internalType":"bool","name":"claimed","type":"bool"},{"internalType":"bool","name":"requiresMFA","type":"bool"},{"internalType":"uint40","name":"timestamp","type":"uint40"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"senderAddress","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint40","name":"reclaimableAfter","type":"uint40"}],"internalType":"struct PeanutV4.Deposit[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"getAllDepositsForAddress","outputs":[{"components":[{"internalType":"address","name":"pubKey20","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint8","name":"contractType","type":"uint8"},{"internalType":"bool","name":"claimed","type":"bool"},{"internalType":"bool","name":"requiresMFA","type":"bool"},{"internalType":"uint40","name":"timestamp","type":"uint40"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"senderAddress","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint40","name":"reclaimableAfter","type":"uint40"}],"internalType":"struct PeanutV4.Deposit[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"}],"name":"getDeposit","outputs":[{"components":[{"internalType":"address","name":"pubKey20","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint8","name":"contractType","type":"uint8"},{"internalType":"bool","name":"claimed","type":"bool"},{"internalType":"bool","name":"requiresMFA","type":"bool"},{"internalType":"uint40","name":"timestamp","type":"uint40"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"senderAddress","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint40","name":"reclaimableAfter","type":"uint40"}],"internalType":"struct PeanutV4.Deposit","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDepositCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"messageHash","type":"bytes32"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"getSigner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAddress","type":"address"},{"internalType":"uint8","name":"_contractType","type":"uint8"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"address","name":"_pubKey20","type":"address"},{"internalType":"address","name":"_onBehalfOf","type":"address"},{"internalType":"bool","name":"_withMFA","type":"bool"},{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint40","name":"_reclaimableAfter","type":"uint40"},{"internalType":"bool","name":"_isGasless3009","type":"bool"},{"internalType":"bytes","name":"_args3009","type":"bytes"}],"name":"makeCustomDeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAddress","type":"address"},{"internalType":"uint8","name":"_contractType","type":"uint8"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"address","name":"_pubKey20","type":"address"}],"name":"makeDeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAddress","type":"address"},{"internalType":"address","name":"_from","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_pubKey20","type":"address"},{"internalType":"bytes32","name":"_nonce","type":"bytes32"},{"internalType":"uint256","name":"_validAfter","type":"uint256"},{"internalType":"uint256","name":"_validBefore","type":"uint256"},{"internalType":"uint8","name":"_v","type":"uint8"},{"internalType":"bytes32","name":"_r","type":"bytes32"},{"internalType":"bytes32","name":"_s","type":"bytes32"}],"name":"makeDepositWithAuthorization","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAddress","type":"address"},{"internalType":"uint8","name":"_contractType","type":"uint8"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"address","name":"_pubKey20","type":"address"}],"name":"makeMFADeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAddress","type":"address"},{"internalType":"uint8","name":"_contractType","type":"uint8"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"address","name":"_pubKey20","type":"address"},{"internalType":"address","name":"_onBehalfOf","type":"address"}],"name":"makeSelflessDeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAddress","type":"address"},{"internalType":"uint8","name":"_contractType","type":"uint8"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"address","name":"_pubKey20","type":"address"},{"internalType":"address","name":"_onBehalfOf","type":"address"}],"name":"makeSelflessMFADeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_operator","type":"address"},{"internalType":"address","name":"_from","type":"address"},{"internalType":"uint256[]","name":"_ids","type":"uint256[]"},{"internalType":"uint256[]","name":"_values","type":"uint256[]"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"onERC1155BatchReceived","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_operator","type":"address"},{"internalType":"address","name":"_from","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_operator","type":"address"},{"internalType":"address","name":"_from","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"_interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"},{"internalType":"address","name":"_recipientAddress","type":"address"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"withdrawDeposit","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"},{"internalType":"address","name":"_recipientAddress","type":"address"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"withdrawDepositAsRecipient","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"}],"name":"withdrawDepositSender","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"depositIndex","type":"uint256"}],"internalType":"struct PeanutV4.GaslessReclaim","name":"reclaim","type":"tuple"},{"internalType":"address","name":"signer","type":"address"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"withdrawDepositSenderGasless","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"},{"internalType":"address","name":"_recipientAddress","type":"address"},{"internalType":"bytes","name":"_signature","type":"bytes"},{"internalType":"bytes","name":"_MFASignature","type":"bytes"}],"name":"withdrawMFADeposit","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]

0x60806040523480156200001157600080fd5b5060405162004990380380620049908339810160408190526200003491620001bf565b60016000556040517f7ba22a0cbd3226111d8a61812ff4cd1934aace2147b8c59de1ecc9975f7af218906200009a906020808252601e908201527f48656c6c6f20576f726c642c20686176652061206e7574747920646179210000604082015260600190565b60405180910390a1600380546001600160a01b0319166001600160a01b0383161781556040805160c081018252600660808201908152651419585b9d5d60d21b60a0830152815281518083018352928352621a171960e91b6020808501919091528101929092524690820152306060820152620001179062000121565b60015550620001f1565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f82600001518051906020012083602001518051906020012084604001518560600151604051602001620001a29594939291909485526020850193909352604084019190915260608301526001600160a01b0316608082015260a00190565b604051602081830303815290604052805190602001209050919050565b600060208284031215620001d257600080fd5b81516001600160a01b0381168114620001ea57600080fd5b9392505050565b61478f80620002016000396000f3fe6080604052600436106101c25760003560e01c8063988eeb0d116100f7578063c46b090a11610095578063f23a6e6111610064578063f23a6e6114610597578063f3478011146105b7578063f7b2ec0d146105ca578063f9c4faf9146105ea57600080fd5b8063c46b090a14610507578063c49f91d31461053b578063c4a33a451461056f578063d3f3f5ea1461058257600080fd5b8063a6b08e26116100d1578063a6b08e261461044f578063b02c43d014610483578063bc197c81146104ba578063c38318c7146104da57600080fd5b8063988eeb0d146103c657806398cdcaad146103ee5780639f9fb9681461042257600080fd5b80635dbd09ac11610164578063867205461161013e57806386720546146103695780638b338b6914610389578063900121a61461039e5780639363a141146103b157600080fd5b80635dbd09ac146102d757806368961ecb146102f75780637f59d1731461034957600080fd5b8063150b7a02116101a0578063150b7a021461023c578063280355611461028d578063325c8a8f146102ae5780633644e515146102c157600080fd5b806301ffc9a7146101c7578063035e50d3146101fc5780630f15b5ce1461021c575b600080fd5b3480156101d357600080fd5b506101e76101e2366004613a0c565b61060a565b60405190151581526020015b60405180910390f35b34801561020857600080fd5b506101e7610217366004613b55565b6106ef565b34801561022857600080fd5b506101e7610237366004613b55565b61071a565b34801561024857600080fd5b5061025c610257366004613bf0565b6107d6565b6040517fffffffff0000000000000000000000000000000000000000000000000000000090911681526020016101f3565b6102a061029b366004613c74565b610821565b6040519081526020016101f3565b6102a06102bc366004613cd1565b610858565b3480156102cd57600080fd5b506102a060015481565b3480156102e357600080fd5b506101e76102f2366004613d3f565b610899565b34801561030357600080fd5b506003546103249073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101f3565b34801561035557600080fd5b506101e7610364366004613daa565b610911565b34801561037557600080fd5b506101e7610384366004613e2a565b610a9e565b34801561039557600080fd5b506102a0600081565b6102a06103ac366004613cd1565b610ac3565b3480156103bd57600080fd5b506002546102a0565b3480156103d257600080fd5b50610324733b14d43bf521ef7fd9600533beb73b6e9178de7c81565b3480156103fa57600080fd5b506102a07f07627fa7bed07e8f6f08a646ac88d8aa5905c79bd48a02844697030b488dc0be81565b34801561042e57600080fd5b5061044261043d366004613e2a565b610aee565b6040516101f39190613f52565b34801561045b57600080fd5b506102a07f70adbbeba9d4f0c82e28dd574f15466f75df0543b65f24460fc445813b5d94e081565b34801561048f57600080fd5b506104a361049e366004613e2a565b610c78565b6040516101f39b9a99989796959493929190613f61565b3480156104c657600080fd5b5061025c6104d5366004614026565b610d62565b3480156104e657600080fd5b506104fa6104f53660046140e5565b610db0565b6040516101f39190614102565b34801561051357600080fd5b506102a07f2bb5bef2b248d3edba501ad918c3ab524cce2aea54d4c914414e1c4401dc4ff481565b34801561054757600080fd5b506102a07f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81565b6102a061057d36600461417f565b6110c6565b34801561058e57600080fd5b506104fa6111ba565b3480156105a357600080fd5b5061025c6105b236600461426b565b61130f565b6102a06105c5366004613c74565b611355565b3480156105d657600080fd5b506103246105e53660046142e7565b611380565b3480156105f657600080fd5b506102a061060536600461432e565b61138d565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000148061069d57507fffffffff0000000000000000000000000000000000000000000000000000000082167f150b7a0200000000000000000000000000000000000000000000000000000000145b806106e957507fffffffff0000000000000000000000000000000000000000000000000000000082167f4e2312e000000000000000000000000000000000000000000000000000000000145b92915050565b60006106f9611484565b6107078484600085816114f7565b90506107136001600055565b9392505050565b6000610724611484565b73ffffffffffffffffffffffffffffffffffffffff831633146107a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f4e4f542054484520524543495049454e5400000000000000000000000000000060448201526064015b60405180910390fd5b61070784847f2bb5bef2b248d3edba501ad918c3ab524cce2aea54d4c914414e1c4401dc4ff48560006114f7565b60003073ffffffffffffffffffffffffffffffffffffffff87160361081857507f150b7a02000000000000000000000000000000000000000000000000000000005b95945050505050565b600061082b611484565b61083786868686611e1d565b935061084c868686868633600160008061230a565b90506108186001600055565b6000610862611484565b61086e87878787611e1d565b9450610883878787878787600160008061230a565b905061088f6001600055565b9695505050505050565b60006108a3611484565b6108f26108b5368790038701876143c4565b8585858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061264892505050565b6108fd85358561276e565b90506109096001600055565b949350505050565b600061091b611484565b604080517f70adbbeba9d4f0c82e28dd574f15466f75df0543b65f24460fc445813b5d94e0602082015246918101919091527fffffffffffffffffffffffffffffffffffffffff00000000000000000000000030606090811b8216818401526074830188905286901b1660948201526000906109de9060a8015b604051602081830303815290604052805190602001207f19457468657265756d205369676e6564204d6573736167653a0a3332000000006000908152601c91909152603c902090565b905060006109ec8285611380565b905073ffffffffffffffffffffffffffffffffffffffff8116733b14d43bf521ef7fd9600533beb73b6e9178de7c14610a81576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f57524f4e47204d4641205349474e415455524500000000000000000000000000604482015260640161079f565b610a90878760008860016114f7565b925050506109096001600055565b6000610aa8611484565b610ab2823361276e565b9050610abe6001600055565b919050565b6000610acd611484565b610ad987878787611e1d565b9450610883878787878787600080600061230a565b6040805161016081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810182905261014081019190915260028281548110610b5a57610b5a614406565b600091825260209182902060408051610160810182526006909302909101805473ffffffffffffffffffffffffffffffffffffffff908116845260018201549484019490945260028101548085169284019290925260ff7401000000000000000000000000000000000000000080840482166060860152750100000000000000000000000000000000000000000084048216151560808601527601000000000000000000000000000000000000000000008404909116151560a085015264ffffffffff77010000000000000000000000000000000000000000000000909304831660c0850152600382015460e08501526004820154851661010085015260059091015493841661012084015290920490911661014082015292915050565b60028181548110610c8857600080fd5b600091825260209091206006909102018054600182015460028301546003840154600485015460059095015473ffffffffffffffffffffffffffffffffffffffff948516965092948285169460ff740100000000000000000000000000000000000000008086048216967501000000000000000000000000000000000000000000870483169676010000000000000000000000000000000000000000000081049093169564ffffffffff7701000000000000000000000000000000000000000000000090940484169590949081169390821692909104168b565b60003073ffffffffffffffffffffffffffffffffffffffff8a1603610da457507fbc197c81000000000000000000000000000000000000000000000000000000005b98975050505050505050565b60606000805b600254811015610e2f578373ffffffffffffffffffffffffffffffffffffffff1660028281548110610dea57610dea614406565b600091825260209091206004600690920201015473ffffffffffffffffffffffffffffffffffffffff1603610e275781610e2381614464565b9250505b600101610db6565b5060008167ffffffffffffffff811115610e4b57610e4b613a7b565b604051908082528060200260200182016040528015610ef057816020015b604080516101608101825260008082526020808301829052928201819052606082018190526080820181905260a0820181905260c0820181905260e082018190526101008201819052610120820181905261014082015282527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff909201910181610e695790505b5090506000915060005b6002548110156110be578473ffffffffffffffffffffffffffffffffffffffff1660028281548110610f2e57610f2e614406565b600091825260209091206004600690920201015473ffffffffffffffffffffffffffffffffffffffff16036110b65760028181548110610f7057610f70614406565b600091825260209182902060408051610160810182526006909302909101805473ffffffffffffffffffffffffffffffffffffffff908116845260018201549484019490945260028101548085169284019290925260ff7401000000000000000000000000000000000000000080840482166060860152750100000000000000000000000000000000000000000084048216151560808601527601000000000000000000000000000000000000000000008404909116151560a085015264ffffffffff77010000000000000000000000000000000000000000000000909304831660c0850152600382015460e085015260048201548516610100850152600590910154938416610120840152909204909116610140820152825183908590811061109c5761109c614406565b602002602001018190525082806110b290614464565b9350505b600101610efa565b509392505050565b60006110d0611484565b831561117e578b60ff16600114611169576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f5f636f6e7472616374547970652048415320544f204245203120464f5220333060448201527f3039000000000000000000000000000000000000000000000000000000000000606482015260840161079f565b6111778d8c8b8b8787612f6a565b9a5061118d565b61118a8d8d8d8d611e1d565b9a505b61119e8d8d8d8d8d8d8d8d8d61230a565b90506111aa6001600055565b9c9b505050505050505050505050565b60606002805480602002602001604051908101604052809291908181526020016000905b82821015611306576000848152602090819020604080516101608101825260068602909201805473ffffffffffffffffffffffffffffffffffffffff9081168452600180830154858701526002830154808316948601949094527401000000000000000000000000000000000000000080850460ff908116606088015275010000000000000000000000000000000000000000008604811615156080880152760100000000000000000000000000000000000000000000860416151560a08701527701000000000000000000000000000000000000000000000090940464ffffffffff90811660c0870152600384015460e0870152600484015483166101008701526005909301549182166101208601529290041661014083015290835290920191016111de565b50505050905090565b60003073ffffffffffffffffffffffffffffffffffffffff88160361088f57507ff23a6e610000000000000000000000000000000000000000000000000000000061088f565b600061135f611484565b61136b86868686611e1d565b935061084c868686868633600080600061230a565b6000806109098484613036565b6000611397611484565b60035473ffffffffffffffffffffffffffffffffffffffff908116908c1603611442576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603960248201527f45434f206d757374206265206265206465706f736974656420766961206d616b60448201527f654465706f736974207769746820746f6b656e54797065203400000000000000606482015260840161079f565b6114548b8b8b8b8b8b8b8b8b8b613052565b5061146a8b60018b60008c8f600080600061230a565b90506114766001600055565b9a9950505050505050505050565b6002600054036114f0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161079f565b6002600055565b6002546000908610611565576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f4445504f53495420494e44455820444f4553204e4f5420455849535400000000604482015260640161079f565b60006002878154811061157a5761157a614406565b600091825260209182902060408051610160810182526006909302909101805473ffffffffffffffffffffffffffffffffffffffff908116845260018201549484019490945260028101548085169284019290925260ff740100000000000000000000000000000000000000008084048216606086015275010000000000000000000000000000000000000000008404821615801560808701527601000000000000000000000000000000000000000000008504909216151560a086015264ffffffffff77010000000000000000000000000000000000000000000000909404841660c0860152600383015460e08601526004830154861661010086015260059092015494851661012085015293041661014082015291506116f8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4445504f53495420414c52454144592057495448445241574e00000000000000604482015260640161079f565b83516000901561179757604080517f70adbbeba9d4f0c82e28dd574f15466f75df0543b65f24460fc445813b5d94e0602082015246918101919091527fffffffffffffffffffffffffffffffffffffffff00000000000000000000000030606090811b821681840152607483018b905289901b16609482015260a881018790526000906117879060c801610995565b90506117938187611380565b9150505b8160a0015115806117a55750835b61180b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f524551554952455320415554484f52495a4154494f4e00000000000000000000604482015260640161079f565b815173ffffffffffffffffffffffffffffffffffffffff1615806118485750815173ffffffffffffffffffffffffffffffffffffffff8281169116145b6118ae576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f57524f4e47205349474e41545552450000000000000000000000000000000000604482015260640161079f565b61012082015173ffffffffffffffffffffffffffffffffffffffff161580611906575081610120015173ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff16145b61196c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f57524f4e4720524543495049454e540000000000000000000000000000000000604482015260640161079f565b8673ffffffffffffffffffffffffffffffffffffffff16826060015160ff16897f235d68982221ffd040e3bd99e15b4685603afab51b957b8745963fe82cc6d4d685602001516040516119c191815260200190565b60405180910390a46001600289815481106119de576119de614406565b906000526020600020906006020160020160156101000a81548160ff021916908315150217905550816060015160ff16600003611ae657602082015160405160009173ffffffffffffffffffffffffffffffffffffffff8a16918381818185875af1925050503d8060008114611a70576040519150601f19603f3d011682016040523d82523d6000602084013e611a75565b606091505b5050905080611ae0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f5472616e73666572206661696c65640000000000000000000000000000000000604482015260640161079f565b50611e0f565b816060015160ff16600103611b225760408201516020830151611ae09073ffffffffffffffffffffffffffffffffffffffff8316908a90613197565b816060015160ff16600203611bd35760408281015160e084015191517f42842e0e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8a81166024830152604482019390935290918216906342842e0e906064015b600060405180830381600087803b158015611bb557600080fd5b505af1158015611bc9573d6000803e3d6000fd5b5050505050611e0f565b816060015160ff16600303611c6c5760408281015160e0840151602085015192517ff242432a00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8b811660248301526044820192909252606481019390935260a06084840152600060a484015290919082169063f242432a9060c401611b9b565b816060015160ff16600403611e0f5760008260400151905060008173ffffffffffffffffffffffffffffffffffffffff1663113c0ab46040518163ffffffff1660e01b8152600401602060405180830381865afa158015611cd1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cf5919061449c565b8460200151611d0491906144b5565b6101008501516040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff91821660048201526024810183905291925083169063a9059cbb906044016020604051808303816000875af1158015611d82573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611da691906144f0565b611e0c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f5452414e53464552204641494c45440000000000000000000000000000000000604482015260640161079f565b50505b506001979650505050505050565b600060058460ff1610611e8c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f494e56414c494420434f4e545241435420545950450000000000000000000000604482015260640161079f565b8360ff16600003611f0557348314611f00576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f57524f4e472045544820414d4f554e5400000000000000000000000000000000604482015260640161079f565b612301565b8360ff16600103611fe45760035473ffffffffffffffffffffffffffffffffffffffff90811690861603611fbb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45434f204445504f53495453204d55535420555345205f636f6e74726163745460448201527f7970652034000000000000000000000000000000000000000000000000000000606482015260840161079f565b84611fde73ffffffffffffffffffffffffffffffffffffffff8216333087613270565b50612301565b8360ff166002036120e95782600114612059576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f414d4f554e54204d555354204245203120464f52204552433732310000000000604482015260640161079f565b6040517fb88d4fde000000000000000000000000000000000000000000000000000000008152859073ffffffffffffffffffffffffffffffffffffffff82169063b88d4fde906120b19033903090889060040161450d565b600060405180830381600087803b1580156120cb57600080fd5b505af11580156120df573d6000803e3d6000fd5b5050505050612301565b8360ff1660030361214e576040517ff242432a000000000000000000000000000000000000000000000000000000008152859073ffffffffffffffffffffffffffffffffffffffff82169063f242432a906120b1903390309088908a90600401614576565b8360ff16600403612301576040517f23b872dd00000000000000000000000000000000000000000000000000000000815233600482015230602482015260448101849052859073ffffffffffffffffffffffffffffffffffffffff8216906323b872dd906064016020604051808303816000875af11580156121d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121f891906144f0565b612284576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5452414e53464552204641494c45442e20434845434b20414c4c4f57414e434560448201527f20262042414c414e434500000000000000000000000000000000000000000000606482015260840161079f565b8073ffffffffffffffffffffffffffffffffffffffff1663113c0ab46040518163ffffffff1660e01b8152600401602060405180830381865afa1580156122cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122f3919061449c565b6122fd90856145e5565b9350505b50909392505050565b600060026040518061016001604052808873ffffffffffffffffffffffffffffffffffffffff1681526020018a81526020018c73ffffffffffffffffffffffffffffffffffffffff1681526020018b60ff16815260200160001515815260200186151581526020014264ffffffffff1681526020018981526020018773ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1681526020018464ffffffffff16815250908060018154018082558091505060019003906000526020600020906006020160009091909190915060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001015560408201518160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060608201518160020160146101000a81548160ff021916908360ff16021790555060808201518160020160156101000a81548160ff02191690831515021790555060a08201518160020160166101000a81548160ff02191690831515021790555060c08201518160020160176101000a81548164ffffffffff021916908364ffffffffff16021790555060e082015181600301556101008201518160040160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506101208201518160050160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506101408201518160050160146101000a81548164ffffffffff021916908364ffffffffff16021790555050508473ffffffffffffffffffffffffffffffffffffffff168960ff16600160028054905061260691906145fc565b6040518b81527f6cfb6f205ed755f233c83bfe7f03aee5e1d993139ce47aead6d4fe25f7ec30669060200160405180910390a4600254611476906001906145fc565b60006001546126a08551604080517f07627fa7bed07e8f6f08a646ac88d8aa5905c79bd48a02844697030b488dc0be602080830191909152818301939093528151808203830181526060909101909152805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810192909252604282015260620160405160208183030381529060405280519060200120905060006126fe8483856132d4565b905080612767576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f494e56414c4944205349474e4154555245000000000000000000000000000000604482015260640161079f565b5050505050565b60025460009083106127dc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f4445504f53495420494e44455820444f4553204e4f5420455849535400000000604482015260640161079f565b6000600284815481106127f1576127f1614406565b600091825260209182902060408051610160810182526006909302909101805473ffffffffffffffffffffffffffffffffffffffff908116845260018201549484019490945260028101548085169284019290925260ff740100000000000000000000000000000000000000008084048216606086015275010000000000000000000000000000000000000000008404821615801560808701527601000000000000000000000000000000000000000000008504909216151560a086015264ffffffffff77010000000000000000000000000000000000000000000000909404841660c0860152600383015460e086015260048301548616610100860152600590920154948516610120850152930416610140820152915061296f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4445504f53495420414c52454144592057495448445241574e00000000000000604482015260640161079f565b8273ffffffffffffffffffffffffffffffffffffffff1681610100015173ffffffffffffffffffffffffffffffffffffffff1614612a09576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f4e4f54205448452053454e444552000000000000000000000000000000000000604482015260640161079f565b61012081015173ffffffffffffffffffffffffffffffffffffffff1615612a9f5780610140015164ffffffffff164211612a9f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f544f4f204541524c5920544f205245434c41494d000000000000000000000000604482015260640161079f565b80610100015173ffffffffffffffffffffffffffffffffffffffff16816060015160ff16857f235d68982221ffd040e3bd99e15b4685603afab51b957b8745963fe82cc6d4d68460200151604051612af991815260200190565b60405180910390a4600160028581548110612b1657612b16614406565b906000526020600020906006020160020160156101000a81548160ff021916908315150217905550806060015160ff16600003612c2657600081610100015173ffffffffffffffffffffffffffffffffffffffff16826020015160405160006040518083038185875af1925050503d8060008114612bb0576040519150601f19603f3d011682016040523d82523d6000602084013e612bb5565b606091505b5050905080612c20576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4641494c454420544f2057495448445241572045544820544f2053454e444552604482015260640161079f565b50612f60565b806060015160ff16600103612c665760408101516101008201516020830151612c209173ffffffffffffffffffffffffffffffffffffffff841691613197565b806060015160ff16600203612d1e5760408181015161010083015160e084015192517f42842e0e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff918216602482015260448101939093529091908216906342842e0e906064015b600060405180830381600087803b158015612d0057600080fd5b505af1158015612d14573d6000803e3d6000fd5b5050505050612f60565b806060015160ff16600303612dbd5760408082015161010083015160e0840151602085015193517ff242432a00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff92831660248201526044810191909152606481019390935260a06084840152600060a484015290919082169063f242432a9060c401612ce6565b806060015160ff16600403612f605760008160400151905060008173ffffffffffffffffffffffffffffffffffffffff1663113c0ab46040518163ffffffff1660e01b8152600401602060405180830381865afa158015612e22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e46919061449c565b8360200151612e5591906144b5565b6101008401516040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff91821660048201526024810183905291925083169063a9059cbb906044016020604051808303816000875af1158015612ed3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ef791906144f0565b612f5d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f5452414e53464552204641494c45440000000000000000000000000000000000604482015260640161079f565b50505b5060019392505050565b600080808080808080612f7f898b018b61460f565b959c50939a50919850965094509250905073ffffffffffffffffffffffffffffffffffffffff808816908c1614613012576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f57524f4e47205f6f6e426568616c664f6620464f52204549502d333030390000604482015260640161079f565b6130248e888f8f8a8a8a8a8a8a613052565b9e9d5050505050505050505050505050565b60008060006130458585613345565b915091506110be8161338a565b6040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606089901b166020820152603481018790526000908190605401604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529082905280516020909101207fef55bec600000000000000000000000000000000000000000000000000000000825273ffffffffffffffffffffffffffffffffffffffff8d81166004840152306024840152604483018d9052606483018a90526084830189905260a4830182905260ff881660c484015260e4830187905261010483018690529092508d919082169063ef55bec69061012401600060405180830381600087803b15801561316e57600080fd5b505af1158015613182573d6000803e3d6000fd5b509c9f9e505050505050505050505050505050565b60405173ffffffffffffffffffffffffffffffffffffffff831660248201526044810182905261326b9084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152613540565b505050565b60405173ffffffffffffffffffffffffffffffffffffffff808516602483015283166044820152606481018290526132ce9085907f23b872dd00000000000000000000000000000000000000000000000000000000906084016131e9565b50505050565b60008060006132e38585613345565b909250905060008160048111156132fc576132fc614674565b14801561333457508573ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b8061088f575061088f86868661364f565b600080825160410361337b5760208301516040840151606085015160001a61336f878285856137ac565b94509450505050613383565b506000905060025b9250929050565b600081600481111561339e5761339e614674565b036133a65750565b60018160048111156133ba576133ba614674565b03613421576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161079f565b600281600481111561343557613435614674565b0361349c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161079f565b60038160048111156134b0576134b0614674565b0361353d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161079f565b50565b60006135a2826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff1661389b9092919063ffffffff16565b90508051600014806135c35750808060200190518101906135c391906144f0565b61326b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f74207375636365656400000000000000000000000000000000000000000000606482015260840161079f565b60008060008573ffffffffffffffffffffffffffffffffffffffff16631626ba7e60e01b8686604051602401613686929190614711565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090941693909317909252905161370f919061472a565b600060405180830381855afa9150503d806000811461374a576040519150601f19603f3d011682016040523d82523d6000602084013e61374f565b606091505b509150915081801561376357506020815110155b801561088f575080517f1626ba7e00000000000000000000000000000000000000000000000000000000906137a1908301602090810190840161449c565b149695505050505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156137e35750600090506003613892565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613837573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811661388b57600060019250925050613892565b9150600090505b94509492505050565b60606109098484600085856000808673ffffffffffffffffffffffffffffffffffffffff1685876040516138cf919061472a565b60006040518083038185875af1925050503d806000811461390c576040519150601f19603f3d011682016040523d82523d6000602084013e613911565b606091505b50915091506139228783838761392d565b979650505050505050565b606083156139c35782516000036139bc5773ffffffffffffffffffffffffffffffffffffffff85163b6139bc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161079f565b5081610909565b61090983838151156139d85781518083602001fd5b806040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079f9190614746565b600060208284031215613a1e57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461071357600080fd5b73ffffffffffffffffffffffffffffffffffffffff8116811461353d57600080fd5b8035610abe81613a4e565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f830112613abb57600080fd5b813567ffffffffffffffff80821115613ad657613ad6613a7b565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908282118183101715613b1c57613b1c613a7b565b81604052838152866020858801011115613b3557600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080600060608486031215613b6a57600080fd5b833592506020840135613b7c81613a4e565b9150604084013567ffffffffffffffff811115613b9857600080fd5b613ba486828701613aaa565b9150509250925092565b60008083601f840112613bc057600080fd5b50813567ffffffffffffffff811115613bd857600080fd5b60208301915083602082850101111561338357600080fd5b600080600080600060808688031215613c0857600080fd5b8535613c1381613a4e565b94506020860135613c2381613a4e565b935060408601359250606086013567ffffffffffffffff811115613c4657600080fd5b613c5288828901613bae565b969995985093965092949392505050565b803560ff81168114610abe57600080fd5b600080600080600060a08688031215613c8c57600080fd5b8535613c9781613a4e565b9450613ca560208701613c63565b935060408601359250606086013591506080860135613cc381613a4e565b809150509295509295909350565b60008060008060008060c08789031215613cea57600080fd5b8635613cf581613a4e565b9550613d0360208801613c63565b945060408701359350606087013592506080870135613d2181613a4e565b915060a0870135613d3181613a4e565b809150509295509295509295565b6000806000808486036060811215613d5657600080fd5b6020811215613d6457600080fd5b508493506020850135613d7681613a4e565b9250604085013567ffffffffffffffff811115613d9257600080fd5b613d9e87828801613bae565b95989497509550505050565b60008060008060808587031215613dc057600080fd5b843593506020850135613dd281613a4e565b9250604085013567ffffffffffffffff80821115613def57600080fd5b613dfb88838901613aaa565b93506060870135915080821115613e1157600080fd5b50613e1e87828801613aaa565b91505092959194509250565b600060208284031215613e3c57600080fd5b5035919050565b805173ffffffffffffffffffffffffffffffffffffffff168252602081015160208301526040810151613e8e604084018273ffffffffffffffffffffffffffffffffffffffff169052565b506060810151613ea3606084018260ff169052565b506080810151613eb7608084018215159052565b5060a0810151613ecb60a084018215159052565b5060c0810151613ee460c084018264ffffffffff169052565b5060e081015160e083015261010080820151613f178285018273ffffffffffffffffffffffffffffffffffffffff169052565b50506101208181015173ffffffffffffffffffffffffffffffffffffffff16908301526101408082015164ffffffffff8116828501526132ce565b61016081016106e98284613e43565b73ffffffffffffffffffffffffffffffffffffffff8c81168252602082018c90528a8116604083015260ff8a166060830152881515608083015287151560a083015264ffffffffff871660c083015260e08201869052848116610100830152831661012082015261016081016111aa61014083018464ffffffffff169052565b60008083601f840112613ff357600080fd5b50813567ffffffffffffffff81111561400b57600080fd5b6020830191508360208260051b850101111561338357600080fd5b60008060008060008060008060a0898b03121561404257600080fd5b883561404d81613a4e565b9750602089013561405d81613a4e565b9650604089013567ffffffffffffffff8082111561407a57600080fd5b6140868c838d01613fe1565b909850965060608b013591508082111561409f57600080fd5b6140ab8c838d01613fe1565b909650945060808b01359150808211156140c457600080fd5b506140d18b828c01613bae565b999c989b5096995094979396929594505050565b6000602082840312156140f757600080fd5b813561071381613a4e565b6020808252825182820181905260009190848201906040850190845b8181101561414557614131838551613e43565b92840192610160929092019160010161411e565b50909695505050505050565b801515811461353d57600080fd5b8035610abe81614151565b803564ffffffffff81168114610abe57600080fd5b6000806000806000806000806000806000806101608d8f0312156141a257600080fd5b6141ac8d35613a4e565b8c359b506141bc60208e01613c63565b9a5060408d0135995060608d013598506141d960808e0135613a4e565b60808d013597506141ec60a08e01613a70565b96506141fa60c08e0161415f565b955061420860e08e01613a70565b94506142176101008e0161416a565b93506142266101208e0161415f565b925067ffffffffffffffff6101408e0135111561424257600080fd5b6142538e6101408f01358f01613bae565b81935080925050509295989b509295989b509295989b565b60008060008060008060a0878903121561428457600080fd5b863561428f81613a4e565b9550602087013561429f81613a4e565b94506040870135935060608701359250608087013567ffffffffffffffff8111156142c957600080fd5b6142d589828a01613bae565b979a9699509497509295939492505050565b600080604083850312156142fa57600080fd5b82359150602083013567ffffffffffffffff81111561431857600080fd5b61432485828601613aaa565b9150509250929050565b6000806000806000806000806000806101408b8d03121561434e57600080fd5b8a3561435981613a4e565b995060208b013561436981613a4e565b985060408b0135975060608b013561438081613a4e565b965060808b0135955060a08b0135945060c08b013593506143a360e08c01613c63565b92506101008b013591506101208b013590509295989b9194979a5092959850565b6000602082840312156143d657600080fd5b6040516020810181811067ffffffffffffffff821117156143f9576143f9613a7b565b6040529135825250919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361449557614495614435565b5060010190565b6000602082840312156144ae57600080fd5b5051919050565b6000826144eb577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60006020828403121561450257600080fd5b815161071381614151565b600073ffffffffffffffffffffffffffffffffffffffff80861683528085166020840152508260408301526080606083015261081860808301601181527f496e7465726e616c207472616e73666572000000000000000000000000000000602082015260400190565b600073ffffffffffffffffffffffffffffffffffffffff808716835280861660208401525083604083015282606083015260a0608083015261088f60a08301601181527f496e7465726e616c207472616e73666572000000000000000000000000000000602082015260400190565b80820281158282048414176106e9576106e9614435565b818103818111156106e9576106e9614435565b600080600080600080600060e0888a03121561462a57600080fd5b873561463581613a4e565b965060208801359550604088013594506060880135935061465860808901613c63565b925060a0880135915060c0880135905092959891949750929550565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60005b838110156146be5781810151838201526020016146a6565b50506000910152565b600081518084526146df8160208601602086016146a3565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b82815260406020820152600061090960408301846146c7565b6000825161473c8184602087016146a3565b9190910192915050565b60208152600061071360208301846146c756fea2646970667358221220a536934c56325c5b0e23d7b65ac25b14e1342b4f2478131aac6fb95fea02396e64736f6c634300081700330000000000000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x6080604052600436106101c25760003560e01c8063988eeb0d116100f7578063c46b090a11610095578063f23a6e6111610064578063f23a6e6114610597578063f3478011146105b7578063f7b2ec0d146105ca578063f9c4faf9146105ea57600080fd5b8063c46b090a14610507578063c49f91d31461053b578063c4a33a451461056f578063d3f3f5ea1461058257600080fd5b8063a6b08e26116100d1578063a6b08e261461044f578063b02c43d014610483578063bc197c81146104ba578063c38318c7146104da57600080fd5b8063988eeb0d146103c657806398cdcaad146103ee5780639f9fb9681461042257600080fd5b80635dbd09ac11610164578063867205461161013e57806386720546146103695780638b338b6914610389578063900121a61461039e5780639363a141146103b157600080fd5b80635dbd09ac146102d757806368961ecb146102f75780637f59d1731461034957600080fd5b8063150b7a02116101a0578063150b7a021461023c578063280355611461028d578063325c8a8f146102ae5780633644e515146102c157600080fd5b806301ffc9a7146101c7578063035e50d3146101fc5780630f15b5ce1461021c575b600080fd5b3480156101d357600080fd5b506101e76101e2366004613a0c565b61060a565b60405190151581526020015b60405180910390f35b34801561020857600080fd5b506101e7610217366004613b55565b6106ef565b34801561022857600080fd5b506101e7610237366004613b55565b61071a565b34801561024857600080fd5b5061025c610257366004613bf0565b6107d6565b6040517fffffffff0000000000000000000000000000000000000000000000000000000090911681526020016101f3565b6102a061029b366004613c74565b610821565b6040519081526020016101f3565b6102a06102bc366004613cd1565b610858565b3480156102cd57600080fd5b506102a060015481565b3480156102e357600080fd5b506101e76102f2366004613d3f565b610899565b34801561030357600080fd5b506003546103249073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101f3565b34801561035557600080fd5b506101e7610364366004613daa565b610911565b34801561037557600080fd5b506101e7610384366004613e2a565b610a9e565b34801561039557600080fd5b506102a0600081565b6102a06103ac366004613cd1565b610ac3565b3480156103bd57600080fd5b506002546102a0565b3480156103d257600080fd5b50610324733b14d43bf521ef7fd9600533beb73b6e9178de7c81565b3480156103fa57600080fd5b506102a07f07627fa7bed07e8f6f08a646ac88d8aa5905c79bd48a02844697030b488dc0be81565b34801561042e57600080fd5b5061044261043d366004613e2a565b610aee565b6040516101f39190613f52565b34801561045b57600080fd5b506102a07f70adbbeba9d4f0c82e28dd574f15466f75df0543b65f24460fc445813b5d94e081565b34801561048f57600080fd5b506104a361049e366004613e2a565b610c78565b6040516101f39b9a99989796959493929190613f61565b3480156104c657600080fd5b5061025c6104d5366004614026565b610d62565b3480156104e657600080fd5b506104fa6104f53660046140e5565b610db0565b6040516101f39190614102565b34801561051357600080fd5b506102a07f2bb5bef2b248d3edba501ad918c3ab524cce2aea54d4c914414e1c4401dc4ff481565b34801561054757600080fd5b506102a07f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81565b6102a061057d36600461417f565b6110c6565b34801561058e57600080fd5b506104fa6111ba565b3480156105a357600080fd5b5061025c6105b236600461426b565b61130f565b6102a06105c5366004613c74565b611355565b3480156105d657600080fd5b506103246105e53660046142e7565b611380565b3480156105f657600080fd5b506102a061060536600461432e565b61138d565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000148061069d57507fffffffff0000000000000000000000000000000000000000000000000000000082167f150b7a0200000000000000000000000000000000000000000000000000000000145b806106e957507fffffffff0000000000000000000000000000000000000000000000000000000082167f4e2312e000000000000000000000000000000000000000000000000000000000145b92915050565b60006106f9611484565b6107078484600085816114f7565b90506107136001600055565b9392505050565b6000610724611484565b73ffffffffffffffffffffffffffffffffffffffff831633146107a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f4e4f542054484520524543495049454e5400000000000000000000000000000060448201526064015b60405180910390fd5b61070784847f2bb5bef2b248d3edba501ad918c3ab524cce2aea54d4c914414e1c4401dc4ff48560006114f7565b60003073ffffffffffffffffffffffffffffffffffffffff87160361081857507f150b7a02000000000000000000000000000000000000000000000000000000005b95945050505050565b600061082b611484565b61083786868686611e1d565b935061084c868686868633600160008061230a565b90506108186001600055565b6000610862611484565b61086e87878787611e1d565b9450610883878787878787600160008061230a565b905061088f6001600055565b9695505050505050565b60006108a3611484565b6108f26108b5368790038701876143c4565b8585858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061264892505050565b6108fd85358561276e565b90506109096001600055565b949350505050565b600061091b611484565b604080517f70adbbeba9d4f0c82e28dd574f15466f75df0543b65f24460fc445813b5d94e0602082015246918101919091527fffffffffffffffffffffffffffffffffffffffff00000000000000000000000030606090811b8216818401526074830188905286901b1660948201526000906109de9060a8015b604051602081830303815290604052805190602001207f19457468657265756d205369676e6564204d6573736167653a0a3332000000006000908152601c91909152603c902090565b905060006109ec8285611380565b905073ffffffffffffffffffffffffffffffffffffffff8116733b14d43bf521ef7fd9600533beb73b6e9178de7c14610a81576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f57524f4e47204d4641205349474e415455524500000000000000000000000000604482015260640161079f565b610a90878760008860016114f7565b925050506109096001600055565b6000610aa8611484565b610ab2823361276e565b9050610abe6001600055565b919050565b6000610acd611484565b610ad987878787611e1d565b9450610883878787878787600080600061230a565b6040805161016081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810182905261014081019190915260028281548110610b5a57610b5a614406565b600091825260209182902060408051610160810182526006909302909101805473ffffffffffffffffffffffffffffffffffffffff908116845260018201549484019490945260028101548085169284019290925260ff7401000000000000000000000000000000000000000080840482166060860152750100000000000000000000000000000000000000000084048216151560808601527601000000000000000000000000000000000000000000008404909116151560a085015264ffffffffff77010000000000000000000000000000000000000000000000909304831660c0850152600382015460e08501526004820154851661010085015260059091015493841661012084015290920490911661014082015292915050565b60028181548110610c8857600080fd5b600091825260209091206006909102018054600182015460028301546003840154600485015460059095015473ffffffffffffffffffffffffffffffffffffffff948516965092948285169460ff740100000000000000000000000000000000000000008086048216967501000000000000000000000000000000000000000000870483169676010000000000000000000000000000000000000000000081049093169564ffffffffff7701000000000000000000000000000000000000000000000090940484169590949081169390821692909104168b565b60003073ffffffffffffffffffffffffffffffffffffffff8a1603610da457507fbc197c81000000000000000000000000000000000000000000000000000000005b98975050505050505050565b60606000805b600254811015610e2f578373ffffffffffffffffffffffffffffffffffffffff1660028281548110610dea57610dea614406565b600091825260209091206004600690920201015473ffffffffffffffffffffffffffffffffffffffff1603610e275781610e2381614464565b9250505b600101610db6565b5060008167ffffffffffffffff811115610e4b57610e4b613a7b565b604051908082528060200260200182016040528015610ef057816020015b604080516101608101825260008082526020808301829052928201819052606082018190526080820181905260a0820181905260c0820181905260e082018190526101008201819052610120820181905261014082015282527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff909201910181610e695790505b5090506000915060005b6002548110156110be578473ffffffffffffffffffffffffffffffffffffffff1660028281548110610f2e57610f2e614406565b600091825260209091206004600690920201015473ffffffffffffffffffffffffffffffffffffffff16036110b65760028181548110610f7057610f70614406565b600091825260209182902060408051610160810182526006909302909101805473ffffffffffffffffffffffffffffffffffffffff908116845260018201549484019490945260028101548085169284019290925260ff7401000000000000000000000000000000000000000080840482166060860152750100000000000000000000000000000000000000000084048216151560808601527601000000000000000000000000000000000000000000008404909116151560a085015264ffffffffff77010000000000000000000000000000000000000000000000909304831660c0850152600382015460e085015260048201548516610100850152600590910154938416610120840152909204909116610140820152825183908590811061109c5761109c614406565b602002602001018190525082806110b290614464565b9350505b600101610efa565b509392505050565b60006110d0611484565b831561117e578b60ff16600114611169576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f5f636f6e7472616374547970652048415320544f204245203120464f5220333060448201527f3039000000000000000000000000000000000000000000000000000000000000606482015260840161079f565b6111778d8c8b8b8787612f6a565b9a5061118d565b61118a8d8d8d8d611e1d565b9a505b61119e8d8d8d8d8d8d8d8d8d61230a565b90506111aa6001600055565b9c9b505050505050505050505050565b60606002805480602002602001604051908101604052809291908181526020016000905b82821015611306576000848152602090819020604080516101608101825260068602909201805473ffffffffffffffffffffffffffffffffffffffff9081168452600180830154858701526002830154808316948601949094527401000000000000000000000000000000000000000080850460ff908116606088015275010000000000000000000000000000000000000000008604811615156080880152760100000000000000000000000000000000000000000000860416151560a08701527701000000000000000000000000000000000000000000000090940464ffffffffff90811660c0870152600384015460e0870152600484015483166101008701526005909301549182166101208601529290041661014083015290835290920191016111de565b50505050905090565b60003073ffffffffffffffffffffffffffffffffffffffff88160361088f57507ff23a6e610000000000000000000000000000000000000000000000000000000061088f565b600061135f611484565b61136b86868686611e1d565b935061084c868686868633600080600061230a565b6000806109098484613036565b6000611397611484565b60035473ffffffffffffffffffffffffffffffffffffffff908116908c1603611442576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603960248201527f45434f206d757374206265206265206465706f736974656420766961206d616b60448201527f654465706f736974207769746820746f6b656e54797065203400000000000000606482015260840161079f565b6114548b8b8b8b8b8b8b8b8b8b613052565b5061146a8b60018b60008c8f600080600061230a565b90506114766001600055565b9a9950505050505050505050565b6002600054036114f0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161079f565b6002600055565b6002546000908610611565576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f4445504f53495420494e44455820444f4553204e4f5420455849535400000000604482015260640161079f565b60006002878154811061157a5761157a614406565b600091825260209182902060408051610160810182526006909302909101805473ffffffffffffffffffffffffffffffffffffffff908116845260018201549484019490945260028101548085169284019290925260ff740100000000000000000000000000000000000000008084048216606086015275010000000000000000000000000000000000000000008404821615801560808701527601000000000000000000000000000000000000000000008504909216151560a086015264ffffffffff77010000000000000000000000000000000000000000000000909404841660c0860152600383015460e08601526004830154861661010086015260059092015494851661012085015293041661014082015291506116f8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4445504f53495420414c52454144592057495448445241574e00000000000000604482015260640161079f565b83516000901561179757604080517f70adbbeba9d4f0c82e28dd574f15466f75df0543b65f24460fc445813b5d94e0602082015246918101919091527fffffffffffffffffffffffffffffffffffffffff00000000000000000000000030606090811b821681840152607483018b905289901b16609482015260a881018790526000906117879060c801610995565b90506117938187611380565b9150505b8160a0015115806117a55750835b61180b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f524551554952455320415554484f52495a4154494f4e00000000000000000000604482015260640161079f565b815173ffffffffffffffffffffffffffffffffffffffff1615806118485750815173ffffffffffffffffffffffffffffffffffffffff8281169116145b6118ae576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f57524f4e47205349474e41545552450000000000000000000000000000000000604482015260640161079f565b61012082015173ffffffffffffffffffffffffffffffffffffffff161580611906575081610120015173ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff16145b61196c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f57524f4e4720524543495049454e540000000000000000000000000000000000604482015260640161079f565b8673ffffffffffffffffffffffffffffffffffffffff16826060015160ff16897f235d68982221ffd040e3bd99e15b4685603afab51b957b8745963fe82cc6d4d685602001516040516119c191815260200190565b60405180910390a46001600289815481106119de576119de614406565b906000526020600020906006020160020160156101000a81548160ff021916908315150217905550816060015160ff16600003611ae657602082015160405160009173ffffffffffffffffffffffffffffffffffffffff8a16918381818185875af1925050503d8060008114611a70576040519150601f19603f3d011682016040523d82523d6000602084013e611a75565b606091505b5050905080611ae0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f5472616e73666572206661696c65640000000000000000000000000000000000604482015260640161079f565b50611e0f565b816060015160ff16600103611b225760408201516020830151611ae09073ffffffffffffffffffffffffffffffffffffffff8316908a90613197565b816060015160ff16600203611bd35760408281015160e084015191517f42842e0e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8a81166024830152604482019390935290918216906342842e0e906064015b600060405180830381600087803b158015611bb557600080fd5b505af1158015611bc9573d6000803e3d6000fd5b5050505050611e0f565b816060015160ff16600303611c6c5760408281015160e0840151602085015192517ff242432a00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8b811660248301526044820192909252606481019390935260a06084840152600060a484015290919082169063f242432a9060c401611b9b565b816060015160ff16600403611e0f5760008260400151905060008173ffffffffffffffffffffffffffffffffffffffff1663113c0ab46040518163ffffffff1660e01b8152600401602060405180830381865afa158015611cd1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cf5919061449c565b8460200151611d0491906144b5565b6101008501516040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff91821660048201526024810183905291925083169063a9059cbb906044016020604051808303816000875af1158015611d82573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611da691906144f0565b611e0c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f5452414e53464552204641494c45440000000000000000000000000000000000604482015260640161079f565b50505b506001979650505050505050565b600060058460ff1610611e8c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f494e56414c494420434f4e545241435420545950450000000000000000000000604482015260640161079f565b8360ff16600003611f0557348314611f00576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f57524f4e472045544820414d4f554e5400000000000000000000000000000000604482015260640161079f565b612301565b8360ff16600103611fe45760035473ffffffffffffffffffffffffffffffffffffffff90811690861603611fbb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45434f204445504f53495453204d55535420555345205f636f6e74726163745460448201527f7970652034000000000000000000000000000000000000000000000000000000606482015260840161079f565b84611fde73ffffffffffffffffffffffffffffffffffffffff8216333087613270565b50612301565b8360ff166002036120e95782600114612059576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f414d4f554e54204d555354204245203120464f52204552433732310000000000604482015260640161079f565b6040517fb88d4fde000000000000000000000000000000000000000000000000000000008152859073ffffffffffffffffffffffffffffffffffffffff82169063b88d4fde906120b19033903090889060040161450d565b600060405180830381600087803b1580156120cb57600080fd5b505af11580156120df573d6000803e3d6000fd5b5050505050612301565b8360ff1660030361214e576040517ff242432a000000000000000000000000000000000000000000000000000000008152859073ffffffffffffffffffffffffffffffffffffffff82169063f242432a906120b1903390309088908a90600401614576565b8360ff16600403612301576040517f23b872dd00000000000000000000000000000000000000000000000000000000815233600482015230602482015260448101849052859073ffffffffffffffffffffffffffffffffffffffff8216906323b872dd906064016020604051808303816000875af11580156121d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121f891906144f0565b612284576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5452414e53464552204641494c45442e20434845434b20414c4c4f57414e434560448201527f20262042414c414e434500000000000000000000000000000000000000000000606482015260840161079f565b8073ffffffffffffffffffffffffffffffffffffffff1663113c0ab46040518163ffffffff1660e01b8152600401602060405180830381865afa1580156122cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122f3919061449c565b6122fd90856145e5565b9350505b50909392505050565b600060026040518061016001604052808873ffffffffffffffffffffffffffffffffffffffff1681526020018a81526020018c73ffffffffffffffffffffffffffffffffffffffff1681526020018b60ff16815260200160001515815260200186151581526020014264ffffffffff1681526020018981526020018773ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1681526020018464ffffffffff16815250908060018154018082558091505060019003906000526020600020906006020160009091909190915060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001015560408201518160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060608201518160020160146101000a81548160ff021916908360ff16021790555060808201518160020160156101000a81548160ff02191690831515021790555060a08201518160020160166101000a81548160ff02191690831515021790555060c08201518160020160176101000a81548164ffffffffff021916908364ffffffffff16021790555060e082015181600301556101008201518160040160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506101208201518160050160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506101408201518160050160146101000a81548164ffffffffff021916908364ffffffffff16021790555050508473ffffffffffffffffffffffffffffffffffffffff168960ff16600160028054905061260691906145fc565b6040518b81527f6cfb6f205ed755f233c83bfe7f03aee5e1d993139ce47aead6d4fe25f7ec30669060200160405180910390a4600254611476906001906145fc565b60006001546126a08551604080517f07627fa7bed07e8f6f08a646ac88d8aa5905c79bd48a02844697030b488dc0be602080830191909152818301939093528151808203830181526060909101909152805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810192909252604282015260620160405160208183030381529060405280519060200120905060006126fe8483856132d4565b905080612767576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f494e56414c4944205349474e4154555245000000000000000000000000000000604482015260640161079f565b5050505050565b60025460009083106127dc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f4445504f53495420494e44455820444f4553204e4f5420455849535400000000604482015260640161079f565b6000600284815481106127f1576127f1614406565b600091825260209182902060408051610160810182526006909302909101805473ffffffffffffffffffffffffffffffffffffffff908116845260018201549484019490945260028101548085169284019290925260ff740100000000000000000000000000000000000000008084048216606086015275010000000000000000000000000000000000000000008404821615801560808701527601000000000000000000000000000000000000000000008504909216151560a086015264ffffffffff77010000000000000000000000000000000000000000000000909404841660c0860152600383015460e086015260048301548616610100860152600590920154948516610120850152930416610140820152915061296f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4445504f53495420414c52454144592057495448445241574e00000000000000604482015260640161079f565b8273ffffffffffffffffffffffffffffffffffffffff1681610100015173ffffffffffffffffffffffffffffffffffffffff1614612a09576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f4e4f54205448452053454e444552000000000000000000000000000000000000604482015260640161079f565b61012081015173ffffffffffffffffffffffffffffffffffffffff1615612a9f5780610140015164ffffffffff164211612a9f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f544f4f204541524c5920544f205245434c41494d000000000000000000000000604482015260640161079f565b80610100015173ffffffffffffffffffffffffffffffffffffffff16816060015160ff16857f235d68982221ffd040e3bd99e15b4685603afab51b957b8745963fe82cc6d4d68460200151604051612af991815260200190565b60405180910390a4600160028581548110612b1657612b16614406565b906000526020600020906006020160020160156101000a81548160ff021916908315150217905550806060015160ff16600003612c2657600081610100015173ffffffffffffffffffffffffffffffffffffffff16826020015160405160006040518083038185875af1925050503d8060008114612bb0576040519150601f19603f3d011682016040523d82523d6000602084013e612bb5565b606091505b5050905080612c20576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4641494c454420544f2057495448445241572045544820544f2053454e444552604482015260640161079f565b50612f60565b806060015160ff16600103612c665760408101516101008201516020830151612c209173ffffffffffffffffffffffffffffffffffffffff841691613197565b806060015160ff16600203612d1e5760408181015161010083015160e084015192517f42842e0e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff918216602482015260448101939093529091908216906342842e0e906064015b600060405180830381600087803b158015612d0057600080fd5b505af1158015612d14573d6000803e3d6000fd5b5050505050612f60565b806060015160ff16600303612dbd5760408082015161010083015160e0840151602085015193517ff242432a00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff92831660248201526044810191909152606481019390935260a06084840152600060a484015290919082169063f242432a9060c401612ce6565b806060015160ff16600403612f605760008160400151905060008173ffffffffffffffffffffffffffffffffffffffff1663113c0ab46040518163ffffffff1660e01b8152600401602060405180830381865afa158015612e22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e46919061449c565b8360200151612e5591906144b5565b6101008401516040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff91821660048201526024810183905291925083169063a9059cbb906044016020604051808303816000875af1158015612ed3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ef791906144f0565b612f5d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f5452414e53464552204641494c45440000000000000000000000000000000000604482015260640161079f565b50505b5060019392505050565b600080808080808080612f7f898b018b61460f565b959c50939a50919850965094509250905073ffffffffffffffffffffffffffffffffffffffff808816908c1614613012576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f57524f4e47205f6f6e426568616c664f6620464f52204549502d333030390000604482015260640161079f565b6130248e888f8f8a8a8a8a8a8a613052565b9e9d5050505050505050505050505050565b60008060006130458585613345565b915091506110be8161338a565b6040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606089901b166020820152603481018790526000908190605401604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529082905280516020909101207fef55bec600000000000000000000000000000000000000000000000000000000825273ffffffffffffffffffffffffffffffffffffffff8d81166004840152306024840152604483018d9052606483018a90526084830189905260a4830182905260ff881660c484015260e4830187905261010483018690529092508d919082169063ef55bec69061012401600060405180830381600087803b15801561316e57600080fd5b505af1158015613182573d6000803e3d6000fd5b509c9f9e505050505050505050505050505050565b60405173ffffffffffffffffffffffffffffffffffffffff831660248201526044810182905261326b9084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152613540565b505050565b60405173ffffffffffffffffffffffffffffffffffffffff808516602483015283166044820152606481018290526132ce9085907f23b872dd00000000000000000000000000000000000000000000000000000000906084016131e9565b50505050565b60008060006132e38585613345565b909250905060008160048111156132fc576132fc614674565b14801561333457508573ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b8061088f575061088f86868661364f565b600080825160410361337b5760208301516040840151606085015160001a61336f878285856137ac565b94509450505050613383565b506000905060025b9250929050565b600081600481111561339e5761339e614674565b036133a65750565b60018160048111156133ba576133ba614674565b03613421576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161079f565b600281600481111561343557613435614674565b0361349c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161079f565b60038160048111156134b0576134b0614674565b0361353d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161079f565b50565b60006135a2826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff1661389b9092919063ffffffff16565b90508051600014806135c35750808060200190518101906135c391906144f0565b61326b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f74207375636365656400000000000000000000000000000000000000000000606482015260840161079f565b60008060008573ffffffffffffffffffffffffffffffffffffffff16631626ba7e60e01b8686604051602401613686929190614711565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090941693909317909252905161370f919061472a565b600060405180830381855afa9150503d806000811461374a576040519150601f19603f3d011682016040523d82523d6000602084013e61374f565b606091505b509150915081801561376357506020815110155b801561088f575080517f1626ba7e00000000000000000000000000000000000000000000000000000000906137a1908301602090810190840161449c565b149695505050505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156137e35750600090506003613892565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613837573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811661388b57600060019250925050613892565b9150600090505b94509492505050565b60606109098484600085856000808673ffffffffffffffffffffffffffffffffffffffff1685876040516138cf919061472a565b60006040518083038185875af1925050503d806000811461390c576040519150601f19603f3d011682016040523d82523d6000602084013e613911565b606091505b50915091506139228783838761392d565b979650505050505050565b606083156139c35782516000036139bc5773ffffffffffffffffffffffffffffffffffffffff85163b6139bc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161079f565b5081610909565b61090983838151156139d85781518083602001fd5b806040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079f9190614746565b600060208284031215613a1e57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461071357600080fd5b73ffffffffffffffffffffffffffffffffffffffff8116811461353d57600080fd5b8035610abe81613a4e565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f830112613abb57600080fd5b813567ffffffffffffffff80821115613ad657613ad6613a7b565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908282118183101715613b1c57613b1c613a7b565b81604052838152866020858801011115613b3557600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080600060608486031215613b6a57600080fd5b833592506020840135613b7c81613a4e565b9150604084013567ffffffffffffffff811115613b9857600080fd5b613ba486828701613aaa565b9150509250925092565b60008083601f840112613bc057600080fd5b50813567ffffffffffffffff811115613bd857600080fd5b60208301915083602082850101111561338357600080fd5b600080600080600060808688031215613c0857600080fd5b8535613c1381613a4e565b94506020860135613c2381613a4e565b935060408601359250606086013567ffffffffffffffff811115613c4657600080fd5b613c5288828901613bae565b969995985093965092949392505050565b803560ff81168114610abe57600080fd5b600080600080600060a08688031215613c8c57600080fd5b8535613c9781613a4e565b9450613ca560208701613c63565b935060408601359250606086013591506080860135613cc381613a4e565b809150509295509295909350565b60008060008060008060c08789031215613cea57600080fd5b8635613cf581613a4e565b9550613d0360208801613c63565b945060408701359350606087013592506080870135613d2181613a4e565b915060a0870135613d3181613a4e565b809150509295509295509295565b6000806000808486036060811215613d5657600080fd5b6020811215613d6457600080fd5b508493506020850135613d7681613a4e565b9250604085013567ffffffffffffffff811115613d9257600080fd5b613d9e87828801613bae565b95989497509550505050565b60008060008060808587031215613dc057600080fd5b843593506020850135613dd281613a4e565b9250604085013567ffffffffffffffff80821115613def57600080fd5b613dfb88838901613aaa565b93506060870135915080821115613e1157600080fd5b50613e1e87828801613aaa565b91505092959194509250565b600060208284031215613e3c57600080fd5b5035919050565b805173ffffffffffffffffffffffffffffffffffffffff168252602081015160208301526040810151613e8e604084018273ffffffffffffffffffffffffffffffffffffffff169052565b506060810151613ea3606084018260ff169052565b506080810151613eb7608084018215159052565b5060a0810151613ecb60a084018215159052565b5060c0810151613ee460c084018264ffffffffff169052565b5060e081015160e083015261010080820151613f178285018273ffffffffffffffffffffffffffffffffffffffff169052565b50506101208181015173ffffffffffffffffffffffffffffffffffffffff16908301526101408082015164ffffffffff8116828501526132ce565b61016081016106e98284613e43565b73ffffffffffffffffffffffffffffffffffffffff8c81168252602082018c90528a8116604083015260ff8a166060830152881515608083015287151560a083015264ffffffffff871660c083015260e08201869052848116610100830152831661012082015261016081016111aa61014083018464ffffffffff169052565b60008083601f840112613ff357600080fd5b50813567ffffffffffffffff81111561400b57600080fd5b6020830191508360208260051b850101111561338357600080fd5b60008060008060008060008060a0898b03121561404257600080fd5b883561404d81613a4e565b9750602089013561405d81613a4e565b9650604089013567ffffffffffffffff8082111561407a57600080fd5b6140868c838d01613fe1565b909850965060608b013591508082111561409f57600080fd5b6140ab8c838d01613fe1565b909650945060808b01359150808211156140c457600080fd5b506140d18b828c01613bae565b999c989b5096995094979396929594505050565b6000602082840312156140f757600080fd5b813561071381613a4e565b6020808252825182820181905260009190848201906040850190845b8181101561414557614131838551613e43565b92840192610160929092019160010161411e565b50909695505050505050565b801515811461353d57600080fd5b8035610abe81614151565b803564ffffffffff81168114610abe57600080fd5b6000806000806000806000806000806000806101608d8f0312156141a257600080fd5b6141ac8d35613a4e565b8c359b506141bc60208e01613c63565b9a5060408d0135995060608d013598506141d960808e0135613a4e565b60808d013597506141ec60a08e01613a70565b96506141fa60c08e0161415f565b955061420860e08e01613a70565b94506142176101008e0161416a565b93506142266101208e0161415f565b925067ffffffffffffffff6101408e0135111561424257600080fd5b6142538e6101408f01358f01613bae565b81935080925050509295989b509295989b509295989b565b60008060008060008060a0878903121561428457600080fd5b863561428f81613a4e565b9550602087013561429f81613a4e565b94506040870135935060608701359250608087013567ffffffffffffffff8111156142c957600080fd5b6142d589828a01613bae565b979a9699509497509295939492505050565b600080604083850312156142fa57600080fd5b82359150602083013567ffffffffffffffff81111561431857600080fd5b61432485828601613aaa565b9150509250929050565b6000806000806000806000806000806101408b8d03121561434e57600080fd5b8a3561435981613a4e565b995060208b013561436981613a4e565b985060408b0135975060608b013561438081613a4e565b965060808b0135955060a08b0135945060c08b013593506143a360e08c01613c63565b92506101008b013591506101208b013590509295989b9194979a5092959850565b6000602082840312156143d657600080fd5b6040516020810181811067ffffffffffffffff821117156143f9576143f9613a7b565b6040529135825250919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361449557614495614435565b5060010190565b6000602082840312156144ae57600080fd5b5051919050565b6000826144eb577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60006020828403121561450257600080fd5b815161071381614151565b600073ffffffffffffffffffffffffffffffffffffffff80861683528085166020840152508260408301526080606083015261081860808301601181527f496e7465726e616c207472616e73666572000000000000000000000000000000602082015260400190565b600073ffffffffffffffffffffffffffffffffffffffff808716835280861660208401525083604083015282606083015260a0608083015261088f60a08301601181527f496e7465726e616c207472616e73666572000000000000000000000000000000602082015260400190565b80820281158282048414176106e9576106e9614435565b818103818111156106e9576106e9614435565b600080600080600080600060e0888a03121561462a57600080fd5b873561463581613a4e565b965060208801359550604088013594506060880135935061465860808901613c63565b925060a0880135915060c0880135905092959891949750929550565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60005b838110156146be5781810151838201526020016146a6565b50506000910152565b600081518084526146df8160208601602086016146a3565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b82815260406020820152600061090960408301846146c7565b6000825161473c8184602087016146a3565b9190910192915050565b60208152600061071360208301846146c756fea2646970667358221220a536934c56325c5b0e23d7b65ac25b14e1342b4f2478131aac6fb95fea02396e64736f6c63430008170033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]
[ 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.