ETH Price: $2,545.52 (-2.51%)

Contract

0x19A1b89A83B2729C5C3920e5719b01F80AF49621
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Post181344382023-09-14 12:11:35383 days ago1694693495IN
0x19A1b89A...80AF49621
0 ETH0.0002938610.71883449
Post181343692023-09-14 11:57:47383 days ago1694692667IN
0x19A1b89A...80AF49621
0 ETH0.0002887110.53107421
Post181341432023-09-14 11:12:23383 days ago1694689943IN
0x19A1b89A...80AF49621
0 ETH0.0002841610.36476011
Post181341202023-09-14 11:07:47383 days ago1694689667IN
0x19A1b89A...80AF49621
0 ETH0.0003450812.58693573
Post181324852023-09-14 5:38:23383 days ago1694669903IN
0x19A1b89A...80AF49621
0 ETH0.000268269.7084089
0x61010060181268212023-09-13 10:34:11384 days ago1694601251IN
 Create: MemswapERC20
0 ETH0.0698696226.36444224

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
MemswapERC20

Compiler Version
v0.8.19+commit.7dd6d404

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 9 : MemswapERC20.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

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

import {EIP712} from "../common/EIP712.sol";
import {PermitExecutor} from "../common/PermitExecutor.sol";
import {SignatureVerification} from "../common/SignatureVerification.sol";

import {ISolution} from "./interfaces/ISolution.sol";

contract MemswapERC20 is
    ReentrancyGuard,
    PermitExecutor,
    SignatureVerification
{
    // --- Structs and enums ---

    struct Intent {
        // When isBuy = true:
        // amount = buy amount
        // endAmount = sell end amount
        // startAmountBps = sell start amount bps
        // expectedAmountBps = sell expected amount bps

        // When isBuy = false:
        // amount = sell amount
        // endAmount = buy end amount
        // startAmountBps = buy start amount bps
        // expectedAmountBps = buy expected amount bps

        // Exact output (isBuy = true) or exact input (isBuy = false)
        bool isBuy;
        address buyToken;
        address sellToken;
        address maker;
        // The address allowed to solve or authorize others to solve
        address solver;
        address source;
        uint16 feeBps;
        uint16 surplusBps;
        uint32 startTime;
        uint32 endTime;
        bool isPartiallyFillable;
        bool isSmartOrder;
        uint128 amount;
        uint128 endAmount;
        uint16 startAmountBps;
        uint16 expectedAmountBps;
        bytes signature;
    }

    struct IntentStatus {
        bool isPrevalidated;
        bool isCancelled;
        uint128 amountFilled;
    }

    struct Authorization {
        // When isBuy = true:
        // fillAmountToCheck = buy amount to fill
        // executeAmountToCheck = maximum sell amount pulled from user

        // When isBuy = false:
        // fillAmountToCheck = sell amount to fill
        // executeAmountToCheck = minimum buy amount pushed to user

        uint128 fillAmountToCheck;
        uint128 executeAmountToCheck;
        uint32 blockDeadline;
    }

    struct Solution {
        // When isBuy = true:
        // fillAmount = buy amount to fill

        // When isBuy = false:
        // fillAmount = sell amount to fill

        bytes data;
        uint128 fillAmount;
    }

    // --- Events ---

    event IntentCancelled(bytes32 indexed intentHash);
    event IntentPrevalidated(bytes32 indexed intentHash);
    event IntentSolved(
        bytes32 indexed intentHash,
        bool isBuy,
        address buyToken,
        address sellToken,
        address maker,
        address solver,
        uint128 buyAmount,
        uint128 sellAmount
    );
    event IntentsPosted();
    event NonceIncremented(address maker, uint256 newNonce);

    // --- Errors ---

    error AmountCheckFailed();
    error AuthorizationAmountMismatch();
    error AuthorizationIsExpired();
    error IntentCannotBePrevalidated();
    error IntentIsCancelled();
    error IntentIsExpired();
    error IntentIsFilled();
    error IntentIsNotPartiallyFillable();
    error IntentIsNotStarted();
    error InvalidFillAmount();
    error InvalidSolution();
    error InvalidStartAndEndTimes();
    error MerkleTreeTooLarge();
    error Unauthorized();
    error UnsuccessfulCall();

    // --- Fields ---

    bytes32 public immutable AUTHORIZATION_TYPEHASH;
    bytes32 public immutable INTENT_TYPEHASH;

    mapping(address => uint256) public nonce;
    mapping(bytes32 => bytes32) public intentPrivateData;
    mapping(bytes32 => IntentStatus) public intentStatus;
    mapping(bytes32 => Authorization) public authorization;

    // --- Constructor ---

    constructor() EIP712("MemswapERC20", "1.0") {
        AUTHORIZATION_TYPEHASH = keccak256(
            abi.encodePacked(
                "Authorization(",
                "bytes32 intentHash,",
                "address solver,",
                "uint128 fillAmountToCheck,",
                "uint128 executeAmountToCheck,",
                "uint32 blockDeadline",
                ")"
            )
        );

        INTENT_TYPEHASH = keccak256(
            abi.encodePacked(
                "Intent(",
                "bool isBuy,",
                "address buyToken,",
                "address sellToken,",
                "address maker,",
                "address solver,",
                "address source,",
                "uint16 feeBps,",
                "uint16 surplusBps,",
                "uint32 startTime,",
                "uint32 endTime,",
                "uint256 nonce,",
                "bool isPartiallyFillable,",
                "bool isSmartOrder,",
                "uint128 amount,",
                "uint128 endAmount,",
                "uint16 startAmountBps,",
                "uint16 expectedAmountBps",
                ")"
            )
        );
    }

    // Fallback

    receive() external payable {}

    // Public methods

    /**
     * @notice Authorize an address to solve particular intents
     *
     * @param intents Intents to solve
     * @param auths Authorizations
     * @param solver The address authorized to solve
     */
    function authorize(
        Intent[] calldata intents,
        Authorization[] calldata auths,
        address solver
    ) external {
        unchecked {
            uint256 intentsLength = intents.length;
            for (uint256 i; i < intentsLength; i++) {
                Intent calldata intent = intents[i];
                Authorization calldata auth = auths[i];

                if (intent.solver != msg.sender) {
                    revert Unauthorized();
                }

                bytes32 intentHash = getIntentHash(intent);
                bytes32 authId = keccak256(
                    abi.encodePacked(intentHash, solver)
                );
                authorization[authId] = auth;
            }
        }
    }

    /**
     * @notice Make intents available on-chain (this method doesn't do anything
     *         useful - it's only used as a mechanism for intent distribution)
     *
     * @custom:param intents Intents being made available
     */
    function post(
        /**
         * @custom:name intents
         */
        Intent[] calldata
    ) external {
        emit IntentsPosted();
    }

    /**
     * @notice Pre-validate an arbitrary number of intents (the signature of each
     *         intent will be checked, thus resulting in skipping verification on
     *         further attempts to solve the intent, unless the intent explicitly
     *         enforces checking the signature on every fill)
     *
     * @param intents Intents to validate
     */
    function prevalidate(Intent[] calldata intents) external {
        unchecked {
            uint256 intentsLength = intents.length;
            for (uint256 i; i < intentsLength; i++) {
                Intent calldata intent = intents[i];
                if (intent.isSmartOrder) {
                    revert IntentCannotBePrevalidated();
                }

                bytes32 intentHash = getIntentHash(intent);

                _prevalidateIntent(
                    intentHash,
                    intent.maker,
                    intent.isSmartOrder,
                    intent.signature
                );
                emit IntentPrevalidated(intentHash);
            }
        }
    }

    /**
     * @notice Cancel an arbitrary number of intents
     *
     * @param intents Intents to cancel
     */
    function cancel(Intent[] calldata intents) external {
        unchecked {
            uint256 intentsLength = intents.length;
            for (uint256 i; i < intentsLength; i++) {
                Intent calldata intent = intents[i];
                if (intent.maker != msg.sender) {
                    revert Unauthorized();
                }

                bytes32 intentHash = getIntentHash(intent);
                IntentStatus memory status = intentStatus[intentHash];
                status.isPrevalidated = false;
                status.isCancelled = true;

                intentStatus[intentHash] = status;
                emit IntentCancelled(intentHash);
            }
        }
    }

    /**
     * @notice Increment the nonce for `msg.sender`. This will result in
     *         the invalidation of any intents signed with a lower nonce
     *         than the latest value.
     */
    function incrementNonce() external {
        unchecked {
            uint256 newNonce = nonce[msg.sender] + 1;
            nonce[msg.sender] = newNonce;
            emit NonceIncremented(msg.sender, newNonce);
        }
    }

    /**
     * @notice Reveal intents by making available data assumed to not be publicly
     *         available (maker + signature prefix). This method should be called
     *         right before the solution transaction, ideally bundled, so that no
     *         details are revealed sooner than it should be.
     *
     * @param intents Intents to reveal
     */
    function reveal(Intent[] memory intents) external {
        unchecked {
            uint256 intentsLength = intents.length;
            for (uint256 i; i < intentsLength; i++) {
                Intent memory intent = intents[i];

                // Ensure the intent is valid
                bytes32 intentHash = getIntentHash(intent);
                _verifySignature(intentHash, intent.maker, intent.signature);

                // Extract the private data (intent + signature prefix)
                address maker = intent.maker;
                bytes12 signaturePrefix = bytes12(intent.signature);

                // Override the maker with the zero address to get the correct partial intent hash
                intent.maker = address(0);

                // Store the private data (intent + signature prefix)
                bytes32 partialIntentHash = getIntentHash(intent);
                intentPrivateData[partialIntentHash] = bytes32(
                    abi.encodePacked(maker, signaturePrefix)
                );
            }
        }
    }

    /**
     * @notice Solve intent
     *
     * @param intent Intent to solve
     * @param solution Solution
     * @param permits Permits to execute prior to the solution
     */
    function solve(
        Intent memory intent,
        Solution calldata solution,
        PermitExecutor.Permit[] calldata permits
    ) external payable nonReentrant executePermits(permits) {
        // Make any private data available
        _includePrivateData(intent);

        // Check authorization
        if (intent.solver != address(0) && intent.solver != msg.sender) {
            revert Unauthorized();
        }

        // Solve
        _solve(intent, solution, intent.isBuy ? type(uint128).max : 0);
    }

    /**
     * @notice Solve intent with authorization. Compared to the regular `solve`,
     *         this method allows solving intents of a different solver, as long
     *         as there's a valid authorization in-place for the current caller.
     *         The authorization will be checked via a storage slot.
     *
     * @param intent Intent to solve
     * @param solution Solution
     * @param permits Permits to execute prior to the solution
     */
    function solveWithOnChainAuthorizationCheck(
        Intent memory intent,
        Solution calldata solution,
        PermitExecutor.Permit[] calldata permits
    ) external payable nonReentrant executePermits(permits) {
        // Make any private data available
        _includePrivateData(intent);

        // Check authorization
        bytes32 intentHash = getIntentHash(intent);
        bytes32 authId = keccak256(abi.encodePacked(intentHash, msg.sender));
        Authorization memory auth = authorization[authId];
        _checkAuthorization(auth, solution.fillAmount);

        // Solve
        _solve(intent, solution, auth.executeAmountToCheck);
    }

    /**
     * @notice Solve intent with authorization. Compared to the regular `solve`,
     *         this method allows solving intents of a different solver, as long
     *         as there's a valid authorization in-place for the current caller.
     *         The authorization will be checked via a signature.
     *
     * @param intent Intent to solve
     * @param solution Solution for the intent
     * @param auth Authorization
     * @param authSignature Authorization signature
     * @param permits Permits to execute prior to the solution
     */
    function solveWithSignatureAuthorizationCheck(
        Intent memory intent,
        Solution calldata solution,
        Authorization calldata auth,
        bytes calldata authSignature,
        PermitExecutor.Permit[] calldata permits
    ) external payable nonReentrant executePermits(permits) {
        // Make any private data available
        _includePrivateData(intent);

        // Check authorization
        bytes32 intentHash = getIntentHash(intent);
        bytes32 authorizationHash = getAuthorizationHash(
            intentHash,
            msg.sender,
            auth
        );
        bytes32 digest = _getEIP712Hash(authorizationHash);
        _assertValidSignature(
            intent.solver,
            digest,
            digest,
            authSignature.length,
            authSignature
        );
        _checkAuthorization(auth, solution.fillAmount);

        // Solve
        _solve(intent, solution, auth.executeAmountToCheck);
    }

    // View methods

    /**
     * @notice Get the EIP712 struct hash for an authorization
     *
     * @param intentHash Intent EIP712 struct hash to authorize
     * @param solver Solver to authorize
     * @param auth Authorization details/conditions
     *
     * @return authorizationHash The EIP712 struct hash of the authorization
     */
    function getAuthorizationHash(
        bytes32 intentHash,
        address solver,
        Authorization memory auth
    ) public view returns (bytes32 authorizationHash) {
        authorizationHash = keccak256(
            abi.encode(
                AUTHORIZATION_TYPEHASH,
                intentHash,
                solver,
                auth.fillAmountToCheck,
                auth.executeAmountToCheck,
                auth.blockDeadline
            )
        );
    }

    /**
     * @notice Get the EIP712 struct hash for an intent
     *
     * @param intent Intent to compute the hash for
     *
     * @return intentHash The EIP712 struct hash of the intent
     */
    function getIntentHash(
        Intent memory intent
    ) public view returns (bytes32 intentHash) {
        intentHash = keccak256(
            bytes.concat(
                abi.encode(
                    INTENT_TYPEHASH,
                    intent.isBuy,
                    intent.buyToken,
                    intent.sellToken,
                    intent.maker,
                    intent.solver,
                    intent.source,
                    intent.feeBps,
                    intent.surplusBps,
                    intent.startTime,
                    intent.endTime,
                    nonce[intent.maker]
                ),
                abi.encode(
                    intent.isPartiallyFillable,
                    intent.isSmartOrder,
                    intent.amount,
                    intent.endAmount,
                    intent.startAmountBps,
                    intent.expectedAmountBps
                )
            )
        );
    }

    // Internal methods

    function _preProcess(
        Intent memory intent,
        uint128 amountToFill
    ) internal returns (uint128 actualAmountToFill) {
        bytes32 intentHash = getIntentHash(intent);

        // Verify start and end times

        if (intent.startTime > block.timestamp) {
            revert IntentIsNotStarted();
        }

        if (intent.endTime < block.timestamp) {
            revert IntentIsExpired();
        }

        if (intent.startTime >= intent.endTime) {
            revert InvalidStartAndEndTimes();
        }

        // Verify cancellation status and signature

        IntentStatus memory status = intentStatus[intentHash];

        if (status.isCancelled) {
            revert IntentIsCancelled();
        }

        if (!status.isPrevalidated) {
            _prevalidateIntent(
                intentHash,
                intent.maker,
                intent.isSmartOrder,
                intent.signature
            );
        }

        // Ensure there's still some amount left to be filled
        uint128 amountAvailable = intent.amount - status.amountFilled;
        if (amountAvailable == 0) {
            revert IntentIsFilled();
        }

        // Ensure non-partially-fillable intents are fully filled
        if (!intent.isPartiallyFillable && amountToFill < amountAvailable) {
            revert IntentIsNotPartiallyFillable();
        }

        // Compute the actual amount to fill
        actualAmountToFill = amountToFill > amountAvailable
            ? amountAvailable
            : amountToFill;
        if (actualAmountToFill == 0) {
            revert InvalidFillAmount();
        }

        // Update the storage
        intentStatus[intentHash].amountFilled += actualAmountToFill;

        if (intent.isBuy) {
            // When isBuy = true:
            // amount = buy amount
            // endAmount = sell end amount
            // startAmountBps = sell start amount bps
            // expectedAmountBps = sell expected amount bps

            uint128 endAmount = (intent.endAmount * actualAmountToFill) /
                intent.amount;
            uint128 startAmount = endAmount -
                (endAmount * intent.startAmountBps) /
                10000;

            //                                                      (now() - startTime)
            // maxAmount = startAmount + (endAmount - startAmount) ---------------------
            //                                                     (endTime - startTime)

            uint128 maxAmount = startAmount +
                ((endAmount - startAmount) *
                    (uint32(block.timestamp) - intent.startTime)) /
                (intent.endTime - intent.startTime);

            // Transfer inputs to solver
            _transferNativeOrERC20(
                intent.maker,
                msg.sender,
                intent.sellToken,
                maxAmount
            );
        } else {
            // When isBuy = false:
            // amount = sell amount
            // endAmount = buy end amount
            // startAmountBps = buy start amount bps
            // expectedAmountBps = buy expected amount bps

            // Transfer inputs to solver
            _transferNativeOrERC20(
                intent.maker,
                msg.sender,
                intent.sellToken,
                actualAmountToFill
            );
        }
    }

    function _postProcess(
        Intent memory intent,
        uint128 amountToFill,
        uint128 amountToCheck,
        uint128 makerBuyBalanceDiff,
        uint128 makerSellBalanceDiff,
        uint128 sourceBalanceDiff
    ) internal {
        bytes32 intentHash = getIntentHash(intent);

        if (intent.isBuy) {
            // When isBuy = true:
            // amount = buy amount
            // endAmount = sell end amount
            // startAmountBps = sell start amount bps
            // expectedAmountBps = sell expected amount bps

            uint128 endAmount = (intent.endAmount * amountToFill) /
                intent.amount;
            uint128 startAmount = endAmount -
                (endAmount * intent.startAmountBps) /
                10000;
            uint128 expectedAmount = endAmount -
                (endAmount * intent.expectedAmountBps) /
                10000;

            //                                                      (now() - startTime)
            // maxAmount = startAmount + (endAmount - startAmount) ---------------------
            //                                                     (endTime - startTime)

            uint128 maxAmount = startAmount +
                ((endAmount - startAmount) *
                    (uint32(block.timestamp) - intent.startTime)) /
                (intent.endTime - intent.startTime);

            uint128 executeAmount = makerSellBalanceDiff;

            // The amount to execute should be lower than the maximum allowed amount
            if (executeAmount > maxAmount) {
                revert InvalidSolution();
            }

            // The amount to execute should be lower than the check amount
            if (executeAmount > amountToCheck) {
                revert AmountCheckFailed();
            }

            // Compute total fees
            uint128 sourceFees;
            if (intent.source != address(0)) {
                // Fee
                if (intent.feeBps > 0) {
                    sourceFees += (executeAmount * intent.feeBps) / 10000;
                }

                // Surplus fee
                if (intent.surplusBps > 0 && executeAmount < expectedAmount) {
                    sourceFees +=
                        ((expectedAmount - executeAmount) * intent.surplusBps) /
                        10000;
                }
            }

            // Ensure the correct amount of fees were paid
            if (sourceBalanceDiff < sourceFees) {
                revert InvalidSolution();
            }

            // Ensure the maker got the correct amount of tokens
            if (makerBuyBalanceDiff < amountToFill) {
                revert InvalidSolution();
            }

            emit IntentSolved(
                intentHash,
                intent.isBuy,
                intent.buyToken,
                intent.sellToken,
                intent.maker,
                msg.sender,
                amountToFill,
                executeAmount
            );
        } else {
            // When isBuy = false:
            // amount = sell amount
            // endAmount = buy end amount
            // startAmountBps = buy start amount bps
            // expectedAmountBps = buy expected amount bps

            uint128 endAmount = (intent.endAmount * amountToFill) /
                intent.amount;
            uint128 startAmount = endAmount +
                (endAmount * intent.startAmountBps) /
                10000;
            uint128 expectedAmount = endAmount +
                (endAmount * intent.expectedAmountBps) /
                10000;

            //                                                      (now() - startTime)
            // minAmount = startAmount - (startAmount - endAmount) ---------------------
            //                                                     (endTime - startTime)

            uint128 minAmount = startAmount -
                ((startAmount - endAmount) *
                    (uint32(block.timestamp) - intent.startTime)) /
                (intent.endTime - intent.startTime);

            uint128 executeAmount = makerBuyBalanceDiff + sourceBalanceDiff;

            // The amount to execute should be greater than the minimum amount
            if (executeAmount < minAmount) {
                revert InvalidSolution();
            }

            // The amount to execute should be greater than the check amount
            if (executeAmount < amountToCheck) {
                revert AmountCheckFailed();
            }

            // Compute total fees
            uint128 sourceFees;
            if (intent.source != address(0)) {
                // Fee
                if (intent.feeBps > 0) {
                    sourceFees += (executeAmount * intent.feeBps) / 10000;
                }

                // Surplus fee
                if (intent.surplusBps > 0 && executeAmount > expectedAmount) {
                    sourceFees +=
                        ((executeAmount - expectedAmount) * intent.surplusBps) /
                        10000;
                }
            }

            // Ensure the correct amount of fees were paid
            if (sourceBalanceDiff < sourceFees) {
                revert InvalidSolution();
            }

            // Ensure the maker spent the correct amount of tokens
            if (makerSellBalanceDiff < amountToFill) {
                revert InvalidSolution();
            }

            emit IntentSolved(
                intentHash,
                intent.isBuy,
                intent.buyToken,
                intent.sellToken,
                intent.maker,
                msg.sender,
                executeAmount,
                amountToFill
            );
        }
    }

    /**
     * @dev Solve intent
     *
     * @param intent Intent to solve
     * @param solution Solution for the intent
     * @param amountToCheck The amount to check the solution against
     */
    function _solve(
        Intent memory intent,
        Solution calldata solution,
        uint128 amountToCheck
    ) internal {
        // Determine the token for which the amount is variable
        // - isBuy = true -> sellToken (exact output, variable input)
        // - isBuy = false -> buyToken (exact input, variable output)
        address relevantToken = intent.isBuy
            ? intent.sellToken
            : intent.buyToken;

        // Fetch the balances before the solution execution
        uint128 makerBuyBalanceBefore = _getBalanceNativeOrERC20(
            intent.buyToken,
            intent.maker
        );
        uint128 makerSellBalanceBefore = _getBalanceNativeOrERC20(
            intent.sellToken,
            intent.maker
        );
        uint128 sourceBalanceBefore = _getBalanceNativeOrERC20(
            relevantToken,
            intent.source
        );

        // Pre-process
        uint128 actualAmountToFill = _preProcess(intent, solution.fillAmount);

        // Solve
        ISolution(msg.sender).callback(
            intent,
            actualAmountToFill,
            solution.data
        );

        // Fetch the balances after the solution execution
        uint128 makerBuyBalanceAfter = _getBalanceNativeOrERC20(
            intent.buyToken,
            intent.maker
        );
        uint128 makerSellBalanceAfter = _getBalanceNativeOrERC20(
            intent.sellToken,
            intent.maker
        );
        uint128 sourceBalanceAfter = _getBalanceNativeOrERC20(
            relevantToken,
            intent.source
        );

        // Post-process
        _postProcess(
            intent,
            actualAmountToFill,
            amountToCheck,
            makerBuyBalanceAfter - makerBuyBalanceBefore,
            makerSellBalanceBefore - makerSellBalanceAfter,
            sourceBalanceAfter - sourceBalanceBefore
        );
    }

    /**
     * @dev Check an authorization
     *
     * @param auth Authorization to check
     * @param amount Amount to check the authorization against
     */
    function _checkAuthorization(
        Authorization memory auth,
        uint128 amount
    ) internal view {
        // Ensure the authorization is not expired
        if (auth.blockDeadline < block.number) {
            revert AuthorizationIsExpired();
        }

        // Ensure the amount to fill matches the authorized amount
        if (auth.fillAmountToCheck != amount) {
            revert AuthorizationAmountMismatch();
        }
    }

    /**
     * @dev Pre-validate an intent by checking its signature
     *
     * @param intentHash EIP712 intent struct hash to verify
     * @param maker The maker of the intent
     * @param isSmartOrder Whether the intent is a smart order
     * @param signature The signature of the intent
     */
    function _prevalidateIntent(
        bytes32 intentHash,
        address maker,
        bool isSmartOrder,
        bytes memory signature
    ) internal {
        _verifySignature(intentHash, maker, signature);

        // Mark the intent as validated if allowed
        if (!isSmartOrder) {
            intentStatus[intentHash].isPrevalidated = true;
        }
    }

    /**
     * @dev Make any private data available for an intent
     *
     * @param intent Intent to make private data available for
     */
    function _includePrivateData(Intent memory intent) internal view {
        if (intent.maker == address(0)) {
            bytes32 intentHash = getIntentHash(intent);
            bytes32 privateData = intentPrivateData[intentHash];

            // For byte conversions, right bits are stripped (we use `bytes20(...)`)
            address revealedMaker = address(uint160(bytes20(privateData)));
            // For numeric conversions, left bits are stripped (we use `uint96(uint256(...))`)
            bytes12 revealedSignaturePrefix = bytes12(
                uint96(uint256(privateData))
            );

            // Override the maker
            intent.maker = revealedMaker;

            // Override the signature prefix
            bytes memory signature = intent.signature;
            assembly {
                mstore(
                    add(signature, 0x20),
                    or(
                        and(
                            mload(add(signature, 0x20)),
                            not(shl(160, 0xffffffffffffffffffffffff))
                        ),
                        revealedSignaturePrefix
                    )
                )
            }
        }
    }

    /**
     * @dev Helper method to get the balance of native or ERC20 tokens
     *
     * @param token Token to get the balance for (native tokens are represented by the zero address)
     * @param owner Wallet to get the balance of
     *
     * @return balance The amount of `token` owned by `owner`
     */
    function _getBalanceNativeOrERC20(
        address token,
        address owner
    ) internal view returns (uint128 balance) {
        if (token == address(0)) {
            balance = uint128(owner.balance);
        } else {
            balance = uint128(IERC20(token).balanceOf(owner));
        }
    }

    /**
     * @dev Helper method for transferring native or ERC20 tokens
     *
     * @param from Transfer from this address
     * @param to Transfer to this address
     * @param token Token to transfer (native tokens are represented by the zero address)
     * @param amount Amount to transfer
     */
    function _transferNativeOrERC20(
        address from,
        address to,
        address token,
        uint256 amount
    ) internal {
        bool success;
        if (token == address(0)) {
            (success, ) = to.call{value: amount}("");
        } else {
            // First, attempt to transfer directly
            try IERC20(token).transferFrom(from, to, amount) {
                success = true;
            } catch {
                // Secondly, attempt to transfer via permit2
                _permit2TransferFrom(from, to, uint160(amount), token);
                success = true;
            }
        }

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

    // --- Overridden methods ---

    function _lookupBulkOrderTypehash(
        uint256 treeHeight
    ) internal pure override returns (bytes32 typeHash) {
        // keccak256("BatchIntent(Intent[2]...[2] tree)Intent(bool isBuy,address buyToken,address sellToken,address maker,address solver,address source,uint16 feeBps,uint16 surplusBps,uint32 startTime,uint32 endTime,uint256 nonce,bool isPartiallyFillable,bool isSmartOrder,uint128 amount,uint128 endAmount,uint16 startAmountBps,uint16 expectedAmountBps)")
        if (treeHeight == 1) {
            typeHash = 0x58d4087338a63742cea24efad814b65144758ee6edb9148c8f61ad0562c1329e;
        } else if (treeHeight == 2) {
            typeHash = 0x0878f598f63158b6b1466e231ae5736031cb6e962a3fd653bda920befa82a41f;
        } else if (treeHeight == 3) {
            typeHash = 0xf5abbef93a89a2459ef1253be2616f2b763753642ec411443f680d159689fd0a;
        } else if (treeHeight == 4) {
            typeHash = 0xe01b70bf04fd440cf9eeda8da244c05c8ba9923cd8a6c40abde6ca04ca6b146b;
        } else if (treeHeight == 5) {
            typeHash = 0xdde38fb5958e2413be9f3ea9eb5b363db19a383ba6f4be75e6d4d3b921ebad2d;
        } else if (treeHeight == 6) {
            typeHash = 0x041e26fd18116b69ee745f27fb646a42d6c3ddf1068121de5c06fa741ed757a8;
        } else if (treeHeight == 7) {
            typeHash = 0xc2a5fb33c1692c75d8c01bd597d8f34237076fcb987104c5d4f4758d95275ca2;
        } else if (treeHeight == 8) {
            typeHash = 0xda7951bbe464e4a840ca92a63adf783259535c0c4b06d782c86efafafffff9e2;
        } else {
            revert MerkleTreeTooLarge();
        }
    }
}

File 2 of 9 : ReentrancyGuard.sol
// 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;
    }
}

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

File 4 of 9 : EIP712.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

contract EIP712 {
    // --- Public fields ---

    bytes32 public immutable DOMAIN_SEPARATOR;

    // --- Constructor ---

    constructor(bytes memory name, bytes memory version) {
        uint256 chainId;
        assembly {
            chainId := chainid()
        }

        DOMAIN_SEPARATOR = keccak256(
            abi.encode(
                keccak256(
                    "EIP712Domain("
                    "string name,"
                    "string version,"
                    "uint256 chainId,"
                    "address verifyingContract"
                    ")"
                ),
                keccak256(name),
                keccak256(version),
                chainId,
                address(this)
            )
        );
    }

    // --- Internal methods ---

    /**
     * @dev Get the EIP712 hash of a struct hash
     *
     * @param structHash Struct hash to get the EIP712 hash for
     *
     * @return eip712Hash The resulting EIP712 hash
     */
    function _getEIP712Hash(
        bytes32 structHash
    ) internal view returns (bytes32 eip712Hash) {
        eip712Hash = keccak256(
            abi.encodePacked(hex"1901", DOMAIN_SEPARATOR, structHash)
        );
    }
}

File 5 of 9 : IEIP2612.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

interface IEIP2612 {
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;
}

File 6 of 9 : IPermit2.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

interface IPermit2 {
    event Permit(
        address indexed owner,
        address indexed token,
        address indexed spender,
        uint160 amount,
        uint48 expiration,
        uint48 nonce
    );

    struct PermitDetails {
        address token;
        uint160 amount;
        uint48 expiration;
        uint48 nonce;
    }

    struct PermitSingle {
        PermitDetails details;
        address spender;
        uint256 sigDeadline;
    }

    function permit(
        address owner,
        PermitSingle memory permitSingle,
        bytes calldata signature
    ) external;

    function transferFrom(
        address from,
        address to,
        uint160 amount,
        address token
    ) external;
}

File 7 of 9 : PermitExecutor.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

import {IPermit2} from "./interfaces/IPermit2.sol";
import {IEIP2612} from "./interfaces/IEIP2612.sol";

contract PermitExecutor {
    // --- Structs and enums ---

    enum Kind {
        EIP2612,
        PERMIT2
    }

    struct Permit {
        Kind kind;
        bytes data;
    }

    // --- Public fields ---

    address public immutable permit2 =
        0x000000000022D473030F116dDEE9F6B43aC78BA3;

    // --- Modifiers ---

    /**
     * @dev Execute permits
     *
     * @param permits Permits to execute
     */
    modifier executePermits(Permit[] calldata permits) {
        unchecked {
            uint256 permitsLength = permits.length;
            for (uint256 i; i < permitsLength; i++) {
                Permit calldata permit = permits[i];
                if (permit.kind == Kind.EIP2612) {
                    (
                        address token,
                        address owner,
                        address spender,
                        uint256 value,
                        uint256 deadline,
                        uint8 v,
                        bytes32 r,
                        bytes32 s
                    ) = abi.decode(
                            permit.data,
                            (
                                address,
                                address,
                                address,
                                uint256,
                                uint256,
                                uint8,
                                bytes32,
                                bytes32
                            )
                        );

                    IEIP2612(token).permit(
                        owner,
                        spender,
                        value,
                        deadline,
                        v,
                        r,
                        s
                    );
                } else {
                    (
                        address owner,
                        IPermit2.PermitSingle memory permitSingle,
                        bytes memory signature
                    ) = abi.decode(
                            permit.data,
                            (address, IPermit2.PermitSingle, bytes)
                        );

                    IPermit2(permit2).permit(owner, permitSingle, signature);
                }
            }
        }

        _;
    }

    // --- Internal methods ---

    function _permit2TransferFrom(
        address from,
        address to,
        uint160 amount,
        address token
    ) internal {
        IPermit2(permit2).transferFrom(from, to, amount, token);
    }
}

File 8 of 9 : SignatureVerification.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

import {EIP712} from "./EIP712.sol";

// Copied from Seaport's source code
abstract contract SignatureVerification is EIP712 {
    // --- Errors ---

    error InvalidSignature();

    // --- Virtual methods ---

    function _lookupBulkOrderTypehash(
        uint256 treeHeight
    ) internal pure virtual returns (bytes32 typeHash);

    // --- Internal methods ---

    function _verifySignature(
        bytes32 intentHash,
        address signer,
        bytes memory signature
    ) internal view {
        // Skip signature verification if the signer is the caller
        if (signer == msg.sender) {
            return;
        }

        bytes32 originalDigest = _getEIP712Hash(intentHash);
        uint256 originalSignatureLength = signature.length;

        bytes32 digest;
        if (_isValidBulkOrderSize(originalSignatureLength)) {
            (intentHash) = _computeBulkOrderProof(signature, intentHash);
            digest = _getEIP712Hash(intentHash);
        } else {
            digest = originalDigest;
        }

        _assertValidSignature(
            signer,
            digest,
            originalDigest,
            originalSignatureLength,
            signature
        );
    }

    function _isValidBulkOrderSize(
        uint256 signatureLength
    ) internal pure returns (bool validLength) {
        // Utilize assembly to validate the length:
        // (64 + x) + 3 + 32y where (0 <= x <= 1) and (1 <= y <= 24)
        assembly {
            validLength := and(
                lt(sub(signatureLength, 0x63), 0x2e2),
                lt(and(add(signatureLength, 0x1d), 0x1f), 0x2)
            )
        }
    }

    function _computeBulkOrderProof(
        bytes memory proofAndSignature,
        bytes32 leaf
    ) internal pure returns (bytes32 bulkOrderHash) {
        // Declare arguments for the root hash and the height of the proof
        bytes32 root;
        uint256 height;

        // Utilize assembly to efficiently derive the root hash using the proof
        assembly {
            // Retrieve the length of the proof, key, and signature combined
            let fullLength := mload(proofAndSignature)

            // If proofAndSignature has odd length, it is a compact signature with 64 bytes
            let signatureLength := sub(65, and(fullLength, 1))

            // Derive height (or depth of tree) with signature and proof length
            height := shr(0x5, sub(fullLength, signatureLength))

            // Update the length in memory to only include the signature
            mstore(proofAndSignature, signatureLength)

            // Derive the pointer for the key using the signature length
            let keyPtr := add(proofAndSignature, add(0x20, signatureLength))

            // Retrieve the three-byte key using the derived pointer
            let key := shr(0xe8, mload(keyPtr))

            // Retrieve pointer to first proof element by applying a constant for the key size to the derived key pointer
            let proof := add(keyPtr, 0x3)

            // Compute level 1
            let scratchPtr1 := shl(0x5, and(key, 1))
            mstore(scratchPtr1, leaf)
            mstore(xor(scratchPtr1, 0x20), mload(proof))

            // Compute remaining proofs
            for {
                let i := 1
            } lt(i, height) {
                i := add(i, 1)
            } {
                proof := add(proof, 0x20)
                let scratchPtr := shl(0x5, and(shr(i, key), 1))
                mstore(scratchPtr, keccak256(0, 0x40))
                mstore(xor(scratchPtr, 0x20), mload(proof))
            }

            // Compute root hash
            root := keccak256(0, 0x40)
        }

        // Retrieve appropriate typehash constant based on height.
        bytes32 rootTypeHash = _lookupBulkOrderTypehash(height);

        // Use the typehash and the root hash to derive final bulk order hash
        assembly {
            mstore(0, rootTypeHash)
            mstore(0x20, root)
            bulkOrderHash := keccak256(0, 0x40)
        }
    }

    function _assertValidSignature(
        address signer,
        bytes32 digest,
        bytes32 originalDigest,
        uint256 originalSignatureLength,
        bytes memory signature
    ) internal view {
        // Declare value for ecrecover equality or 1271 call success status
        bool success;

        // Utilize assembly to perform optimized signature verification check
        assembly {
            // Ensure that first word of scratch space is empty
            mstore(0, 0)

            // Get the length of the signature.
            let signatureLength := mload(signature)

            // Get the pointer to the value preceding the signature length
            // This will be used for temporary memory overrides - either the signature head for isValidSignature or the digest for ecrecover
            let wordBeforeSignaturePtr := sub(signature, 0x20)

            // Cache the current value behind the signature to restore it later
            let cachedWordBeforeSignature := mload(wordBeforeSignaturePtr)

            // Declare lenDiff + recoveredSigner scope to manage stack pressure
            {
                // Take the difference between the max ECDSA signature length and the actual signature length (overflow desired for any values > 65)
                // If the diff is not 0 or 1, it is not a valid ECDSA signature - move on to EIP1271 check
                let lenDiff := sub(65, signatureLength)

                // Declare variable for recovered signer
                let recoveredSigner

                // If diff is 0 or 1, it may be an ECDSA signature
                // Try to recover signer
                if iszero(gt(lenDiff, 1)) {
                    // Read the signature `s` value
                    let originalSignatureS := mload(add(signature, 0x40))

                    // Read the first byte of the word after `s`
                    // If the signature is 65 bytes, this will be the real `v` value
                    // If not, it will need to be modified - doing it this way saves an extra condition.
                    let v := byte(0, mload(add(signature, 0x60)))

                    // If lenDiff is 1, parse 64-byte signature as ECDSA
                    if lenDiff {
                        // Extract yParity from highest bit of vs and add 27 to get v
                        v := add(shr(0xff, originalSignatureS), 27)

                        // Extract canonical s from vs, all but the highest bit
                        // Temporarily overwrite the original `s` value in the signature
                        mstore(
                            add(signature, 0x40),
                            and(
                                originalSignatureS,
                                0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
                            )
                        )
                    }
                    // Temporarily overwrite the signature length with `v` to conform to the expected input for ecrecover
                    mstore(signature, v)

                    // Temporarily overwrite the word before the length with `digest` to conform to the expected input for ecrecover
                    mstore(wordBeforeSignaturePtr, digest)

                    // Attempt to recover the signer for the given signature
                    // Do not check the call status as ecrecover will return a null address if the signature is invalid
                    pop(
                        staticcall(
                            gas(),
                            0x1, // Call ecrecover precompile
                            wordBeforeSignaturePtr, // Use data memory location
                            0x80, // Size of digest, v, r, and s
                            0, // Write result to scratch space
                            0x20 // Provide size of returned result
                        )
                    )

                    // Restore cached word before signature
                    mstore(wordBeforeSignaturePtr, cachedWordBeforeSignature)

                    // Restore cached signature length
                    mstore(signature, signatureLength)

                    // Restore cached signature `s` value
                    mstore(add(signature, 0x40), originalSignatureS)

                    // Read the recovered signer from the buffer given as return space for ecrecover
                    recoveredSigner := mload(0)
                }

                // Set success to true if the signature provided was a valid
                // ECDSA signature and the signer is not the null address
                // Use gt instead of direct as success is used outside of assembly
                success := and(eq(signer, recoveredSigner), gt(signer, 0))
            }

            // If the signature was not verified with ecrecover, try EIP1271
            if iszero(success) {
                // Reset the original signature length
                mstore(signature, originalSignatureLength)

                // Temporarily overwrite the word before the signature length and use it as the
                // head of the signature input to `isValidSignature`, which has a value of 64
                mstore(wordBeforeSignaturePtr, 0x40)

                // Get pointer to use for the selector of `isValidSignature`
                let selectorPtr := sub(signature, 0x44)

                // Cache the value currently stored at the selector pointer
                let cachedWordOverwrittenBySelector := mload(selectorPtr)

                // Cache the value currently stored at the digest pointer
                let cachedWordOverwrittenByDigest := mload(sub(signature, 0x40))

                // Write the selector first, since it overlaps the digest
                mstore(selectorPtr, 0x44)

                // Next, write the original digest
                mstore(sub(signature, 0x40), originalDigest)

                // Call signer with `isValidSignature` to validate signature
                success := staticcall(
                    gas(),
                    signer,
                    selectorPtr,
                    add(originalSignatureLength, 0x64),
                    0,
                    0x20
                )

                // Determine if the signature is valid on successful calls
                if success {
                    // If first word of scratch space does not contain EIP-1271 signature selector, revert
                    if iszero(
                        eq(
                            mload(0),
                            0x1626ba7e00000000000000000000000000000000000000000000000000000000
                        )
                    ) {
                        success := 0
                    }
                }

                // Restore the cached values overwritten by selector, digest and signature head
                mstore(wordBeforeSignaturePtr, cachedWordBeforeSignature)
                mstore(selectorPtr, cachedWordOverwrittenBySelector)
                mstore(sub(signature, 0x40), cachedWordOverwrittenByDigest)
            }
        }

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

File 9 of 9 : ISolution.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

import {MemswapERC20} from "../MemswapERC20.sol";

interface ISolution {
    function callback(
        MemswapERC20.Intent memory intent,
        uint128 amountToFill,
        bytes memory data
    ) external;
}

Settings
{
  "viaIR": true,
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AmountCheckFailed","type":"error"},{"inputs":[],"name":"AuthorizationAmountMismatch","type":"error"},{"inputs":[],"name":"AuthorizationIsExpired","type":"error"},{"inputs":[],"name":"IntentCannotBePrevalidated","type":"error"},{"inputs":[],"name":"IntentIsCancelled","type":"error"},{"inputs":[],"name":"IntentIsExpired","type":"error"},{"inputs":[],"name":"IntentIsFilled","type":"error"},{"inputs":[],"name":"IntentIsNotPartiallyFillable","type":"error"},{"inputs":[],"name":"IntentIsNotStarted","type":"error"},{"inputs":[],"name":"InvalidFillAmount","type":"error"},{"inputs":[],"name":"InvalidSignature","type":"error"},{"inputs":[],"name":"InvalidSolution","type":"error"},{"inputs":[],"name":"InvalidStartAndEndTimes","type":"error"},{"inputs":[],"name":"MerkleTreeTooLarge","type":"error"},{"inputs":[],"name":"Unauthorized","type":"error"},{"inputs":[],"name":"UnsuccessfulCall","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"intentHash","type":"bytes32"}],"name":"IntentCancelled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"intentHash","type":"bytes32"}],"name":"IntentPrevalidated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"intentHash","type":"bytes32"},{"indexed":false,"internalType":"bool","name":"isBuy","type":"bool"},{"indexed":false,"internalType":"address","name":"buyToken","type":"address"},{"indexed":false,"internalType":"address","name":"sellToken","type":"address"},{"indexed":false,"internalType":"address","name":"maker","type":"address"},{"indexed":false,"internalType":"address","name":"solver","type":"address"},{"indexed":false,"internalType":"uint128","name":"buyAmount","type":"uint128"},{"indexed":false,"internalType":"uint128","name":"sellAmount","type":"uint128"}],"name":"IntentSolved","type":"event"},{"anonymous":false,"inputs":[],"name":"IntentsPosted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"maker","type":"address"},{"indexed":false,"internalType":"uint256","name":"newNonce","type":"uint256"}],"name":"NonceIncremented","type":"event"},{"inputs":[],"name":"AUTHORIZATION_TYPEHASH","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":"INTENT_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"authorization","outputs":[{"internalType":"uint128","name":"fillAmountToCheck","type":"uint128"},{"internalType":"uint128","name":"executeAmountToCheck","type":"uint128"},{"internalType":"uint32","name":"blockDeadline","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"bool","name":"isBuy","type":"bool"},{"internalType":"address","name":"buyToken","type":"address"},{"internalType":"address","name":"sellToken","type":"address"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"solver","type":"address"},{"internalType":"address","name":"source","type":"address"},{"internalType":"uint16","name":"feeBps","type":"uint16"},{"internalType":"uint16","name":"surplusBps","type":"uint16"},{"internalType":"uint32","name":"startTime","type":"uint32"},{"internalType":"uint32","name":"endTime","type":"uint32"},{"internalType":"bool","name":"isPartiallyFillable","type":"bool"},{"internalType":"bool","name":"isSmartOrder","type":"bool"},{"internalType":"uint128","name":"amount","type":"uint128"},{"internalType":"uint128","name":"endAmount","type":"uint128"},{"internalType":"uint16","name":"startAmountBps","type":"uint16"},{"internalType":"uint16","name":"expectedAmountBps","type":"uint16"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct MemswapERC20.Intent[]","name":"intents","type":"tuple[]"},{"components":[{"internalType":"uint128","name":"fillAmountToCheck","type":"uint128"},{"internalType":"uint128","name":"executeAmountToCheck","type":"uint128"},{"internalType":"uint32","name":"blockDeadline","type":"uint32"}],"internalType":"struct MemswapERC20.Authorization[]","name":"auths","type":"tuple[]"},{"internalType":"address","name":"solver","type":"address"}],"name":"authorize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"bool","name":"isBuy","type":"bool"},{"internalType":"address","name":"buyToken","type":"address"},{"internalType":"address","name":"sellToken","type":"address"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"solver","type":"address"},{"internalType":"address","name":"source","type":"address"},{"internalType":"uint16","name":"feeBps","type":"uint16"},{"internalType":"uint16","name":"surplusBps","type":"uint16"},{"internalType":"uint32","name":"startTime","type":"uint32"},{"internalType":"uint32","name":"endTime","type":"uint32"},{"internalType":"bool","name":"isPartiallyFillable","type":"bool"},{"internalType":"bool","name":"isSmartOrder","type":"bool"},{"internalType":"uint128","name":"amount","type":"uint128"},{"internalType":"uint128","name":"endAmount","type":"uint128"},{"internalType":"uint16","name":"startAmountBps","type":"uint16"},{"internalType":"uint16","name":"expectedAmountBps","type":"uint16"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct MemswapERC20.Intent[]","name":"intents","type":"tuple[]"}],"name":"cancel","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"intentHash","type":"bytes32"},{"internalType":"address","name":"solver","type":"address"},{"components":[{"internalType":"uint128","name":"fillAmountToCheck","type":"uint128"},{"internalType":"uint128","name":"executeAmountToCheck","type":"uint128"},{"internalType":"uint32","name":"blockDeadline","type":"uint32"}],"internalType":"struct MemswapERC20.Authorization","name":"auth","type":"tuple"}],"name":"getAuthorizationHash","outputs":[{"internalType":"bytes32","name":"authorizationHash","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"bool","name":"isBuy","type":"bool"},{"internalType":"address","name":"buyToken","type":"address"},{"internalType":"address","name":"sellToken","type":"address"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"solver","type":"address"},{"internalType":"address","name":"source","type":"address"},{"internalType":"uint16","name":"feeBps","type":"uint16"},{"internalType":"uint16","name":"surplusBps","type":"uint16"},{"internalType":"uint32","name":"startTime","type":"uint32"},{"internalType":"uint32","name":"endTime","type":"uint32"},{"internalType":"bool","name":"isPartiallyFillable","type":"bool"},{"internalType":"bool","name":"isSmartOrder","type":"bool"},{"internalType":"uint128","name":"amount","type":"uint128"},{"internalType":"uint128","name":"endAmount","type":"uint128"},{"internalType":"uint16","name":"startAmountBps","type":"uint16"},{"internalType":"uint16","name":"expectedAmountBps","type":"uint16"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct MemswapERC20.Intent","name":"intent","type":"tuple"}],"name":"getIntentHash","outputs":[{"internalType":"bytes32","name":"intentHash","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"incrementNonce","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"intentPrivateData","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"intentStatus","outputs":[{"internalType":"bool","name":"isPrevalidated","type":"bool"},{"internalType":"bool","name":"isCancelled","type":"bool"},{"internalType":"uint128","name":"amountFilled","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nonce","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"permit2","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"bool","name":"isBuy","type":"bool"},{"internalType":"address","name":"buyToken","type":"address"},{"internalType":"address","name":"sellToken","type":"address"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"solver","type":"address"},{"internalType":"address","name":"source","type":"address"},{"internalType":"uint16","name":"feeBps","type":"uint16"},{"internalType":"uint16","name":"surplusBps","type":"uint16"},{"internalType":"uint32","name":"startTime","type":"uint32"},{"internalType":"uint32","name":"endTime","type":"uint32"},{"internalType":"bool","name":"isPartiallyFillable","type":"bool"},{"internalType":"bool","name":"isSmartOrder","type":"bool"},{"internalType":"uint128","name":"amount","type":"uint128"},{"internalType":"uint128","name":"endAmount","type":"uint128"},{"internalType":"uint16","name":"startAmountBps","type":"uint16"},{"internalType":"uint16","name":"expectedAmountBps","type":"uint16"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct MemswapERC20.Intent[]","name":"","type":"tuple[]"}],"name":"post","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"bool","name":"isBuy","type":"bool"},{"internalType":"address","name":"buyToken","type":"address"},{"internalType":"address","name":"sellToken","type":"address"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"solver","type":"address"},{"internalType":"address","name":"source","type":"address"},{"internalType":"uint16","name":"feeBps","type":"uint16"},{"internalType":"uint16","name":"surplusBps","type":"uint16"},{"internalType":"uint32","name":"startTime","type":"uint32"},{"internalType":"uint32","name":"endTime","type":"uint32"},{"internalType":"bool","name":"isPartiallyFillable","type":"bool"},{"internalType":"bool","name":"isSmartOrder","type":"bool"},{"internalType":"uint128","name":"amount","type":"uint128"},{"internalType":"uint128","name":"endAmount","type":"uint128"},{"internalType":"uint16","name":"startAmountBps","type":"uint16"},{"internalType":"uint16","name":"expectedAmountBps","type":"uint16"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct MemswapERC20.Intent[]","name":"intents","type":"tuple[]"}],"name":"prevalidate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"bool","name":"isBuy","type":"bool"},{"internalType":"address","name":"buyToken","type":"address"},{"internalType":"address","name":"sellToken","type":"address"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"solver","type":"address"},{"internalType":"address","name":"source","type":"address"},{"internalType":"uint16","name":"feeBps","type":"uint16"},{"internalType":"uint16","name":"surplusBps","type":"uint16"},{"internalType":"uint32","name":"startTime","type":"uint32"},{"internalType":"uint32","name":"endTime","type":"uint32"},{"internalType":"bool","name":"isPartiallyFillable","type":"bool"},{"internalType":"bool","name":"isSmartOrder","type":"bool"},{"internalType":"uint128","name":"amount","type":"uint128"},{"internalType":"uint128","name":"endAmount","type":"uint128"},{"internalType":"uint16","name":"startAmountBps","type":"uint16"},{"internalType":"uint16","name":"expectedAmountBps","type":"uint16"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct MemswapERC20.Intent[]","name":"intents","type":"tuple[]"}],"name":"reveal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"bool","name":"isBuy","type":"bool"},{"internalType":"address","name":"buyToken","type":"address"},{"internalType":"address","name":"sellToken","type":"address"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"solver","type":"address"},{"internalType":"address","name":"source","type":"address"},{"internalType":"uint16","name":"feeBps","type":"uint16"},{"internalType":"uint16","name":"surplusBps","type":"uint16"},{"internalType":"uint32","name":"startTime","type":"uint32"},{"internalType":"uint32","name":"endTime","type":"uint32"},{"internalType":"bool","name":"isPartiallyFillable","type":"bool"},{"internalType":"bool","name":"isSmartOrder","type":"bool"},{"internalType":"uint128","name":"amount","type":"uint128"},{"internalType":"uint128","name":"endAmount","type":"uint128"},{"internalType":"uint16","name":"startAmountBps","type":"uint16"},{"internalType":"uint16","name":"expectedAmountBps","type":"uint16"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct MemswapERC20.Intent","name":"intent","type":"tuple"},{"components":[{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"uint128","name":"fillAmount","type":"uint128"}],"internalType":"struct MemswapERC20.Solution","name":"solution","type":"tuple"},{"components":[{"internalType":"enum PermitExecutor.Kind","name":"kind","type":"uint8"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct PermitExecutor.Permit[]","name":"permits","type":"tuple[]"}],"name":"solve","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"bool","name":"isBuy","type":"bool"},{"internalType":"address","name":"buyToken","type":"address"},{"internalType":"address","name":"sellToken","type":"address"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"solver","type":"address"},{"internalType":"address","name":"source","type":"address"},{"internalType":"uint16","name":"feeBps","type":"uint16"},{"internalType":"uint16","name":"surplusBps","type":"uint16"},{"internalType":"uint32","name":"startTime","type":"uint32"},{"internalType":"uint32","name":"endTime","type":"uint32"},{"internalType":"bool","name":"isPartiallyFillable","type":"bool"},{"internalType":"bool","name":"isSmartOrder","type":"bool"},{"internalType":"uint128","name":"amount","type":"uint128"},{"internalType":"uint128","name":"endAmount","type":"uint128"},{"internalType":"uint16","name":"startAmountBps","type":"uint16"},{"internalType":"uint16","name":"expectedAmountBps","type":"uint16"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct MemswapERC20.Intent","name":"intent","type":"tuple"},{"components":[{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"uint128","name":"fillAmount","type":"uint128"}],"internalType":"struct MemswapERC20.Solution","name":"solution","type":"tuple"},{"components":[{"internalType":"enum PermitExecutor.Kind","name":"kind","type":"uint8"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct PermitExecutor.Permit[]","name":"permits","type":"tuple[]"}],"name":"solveWithOnChainAuthorizationCheck","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"bool","name":"isBuy","type":"bool"},{"internalType":"address","name":"buyToken","type":"address"},{"internalType":"address","name":"sellToken","type":"address"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"solver","type":"address"},{"internalType":"address","name":"source","type":"address"},{"internalType":"uint16","name":"feeBps","type":"uint16"},{"internalType":"uint16","name":"surplusBps","type":"uint16"},{"internalType":"uint32","name":"startTime","type":"uint32"},{"internalType":"uint32","name":"endTime","type":"uint32"},{"internalType":"bool","name":"isPartiallyFillable","type":"bool"},{"internalType":"bool","name":"isSmartOrder","type":"bool"},{"internalType":"uint128","name":"amount","type":"uint128"},{"internalType":"uint128","name":"endAmount","type":"uint128"},{"internalType":"uint16","name":"startAmountBps","type":"uint16"},{"internalType":"uint16","name":"expectedAmountBps","type":"uint16"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct MemswapERC20.Intent","name":"intent","type":"tuple"},{"components":[{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"uint128","name":"fillAmount","type":"uint128"}],"internalType":"struct MemswapERC20.Solution","name":"solution","type":"tuple"},{"components":[{"internalType":"uint128","name":"fillAmountToCheck","type":"uint128"},{"internalType":"uint128","name":"executeAmountToCheck","type":"uint128"},{"internalType":"uint32","name":"blockDeadline","type":"uint32"}],"internalType":"struct MemswapERC20.Authorization","name":"auth","type":"tuple"},{"internalType":"bytes","name":"authSignature","type":"bytes"},{"components":[{"internalType":"enum PermitExecutor.Kind","name":"kind","type":"uint8"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct PermitExecutor.Permit[]","name":"permits","type":"tuple[]"}],"name":"solveWithSignatureAuthorizationCheck","outputs":[],"stateMutability":"payable","type":"function"},{"stateMutability":"payable","type":"receive"}]

610100604081815234620004785762000018826200047d565b600c825260208201916b04d656d7377617045524332360a41b835281519262000041846200047d565b600384526020840190620312e360ec1b8252600092600184556e22d473030f116ddee9f6b43ac78ba3608052519020935190209180519260208401947f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f86528285015260608401524660808401523060a084015260a0835260c083019160018060401b03948484108685111762000464578383528451902060a05260e08401936d082eae8d0dee4d2f4c2e8d2dedc560931b85527f6279746573333220696e74656e74486173682c0000000000000000000000000060ee8201526e1859191c995cdcc81cdbdb1d995c8b608a1b94856101018301527f75696e743132382066696c6c416d6f756e74546f436865636b2c00000000000061011083015261012a907f75696e743132382065786563757465416d6f756e74546f436865636b2c000000828401527f75696e74333220626c6f636b446561646c696e65000000000000000000000000610147840152602960f81b908161015b850152607c87526101608401968088108a891117620004505787875251902060c05266092dce8cadce8560cb1b61018084019081526a189bdbdb081a5cd09d5e4b60aa1b610187850152701859191c995cdcc8189d5e551bdad95b8b607a1b610192850152711859191c995cdcc81cd95b1b151bdad95b8b60721b6101a38501526d1859191c995cdcc81b585ad95c8b60921b6101b58501526101c38401979097526e1859191c995cdcc81cdbdd5c98d94b608a1b6101d28401526d1d5a5b9d0c4d88199959509c1ccb60921b6101e1840152711d5a5b9d0c4d881cdd5c9c1b1d5cd09c1ccb60721b6101ef840152701d5a5b9d0ccc881cdd185c9d151a5b594b607a1b6102018401526e1d5a5b9d0ccc88195b99151a5b594b608a1b6102128401526d1d5a5b9d0c8d4d881b9bdb98d94b60921b6102218401527f626f6f6c2069735061727469616c6c7946696c6c61626c652c0000000000000061022f84015271189bdbdb081a5cd4db585c9d13dc99195c8b60721b6102488401526e1d5a5b9d0c4c8e08185b5bdd5b9d0b608a1b61025a840152711d5a5b9d0c4c8e08195b99105b5bdd5b9d0b60721b6102698401527f75696e743136207374617274416d6f756e744270732c0000000000000000000061027b8401527f75696e743136206578706563746564416d6f756e7442707300000000000000006102918401526102a983015284526102c001948511838610176200043c575083905251902060e052612e409081620004b082396080518181816105e90152818161068401528181610828015281816119670152612c18015260a05181818161071a0152611359015260c051818181610cae0152611a94015260e051818181610e640152611bf90152f35b634e487b7160e01b81526041600452602490fd5b634e487b7160e01b86526041600452602486fd5b634e487b7160e01b82526041600452602482fd5b600080fd5b604081019081106001600160401b038211176200049957604052565b634e487b7160e01b600052604160045260246000fdfe6080604052600436101561001b575b361561001957600080fd5b005b60003560e01c80630aba30a41461014b57806312261ee71461014657806319550834146101415780633644e5151461013c5780633c1274a9146101375780634cd6d7bf1461013257806354c4adb01461012d5780635a0f88b5146101285780635c6741c0146101235780635d819fb91461011e578063627cdcb91461011957806370ae92d214610114578063733965121461010f5780637339a8451461010a578063870897a81461010557806395f9a56814610100578063a41d34c2146100fb578063b082a274146100f65763e0e00abe0361000e57610e87565b610e4c565b610e17565b610deb565b610d72565b610cd1565b610c96565b610c59565b610bff565b610b84565b610ae7565b610a5a565b610903565b6108cc565b61073d565b610702565b6106b3565b61066e565b6104d9565b634e487b7160e01b600052604160045260246000fd5b6001600160401b03811161017957604052565b610150565b606081019081106001600160401b0382111761017957604052565b608081019081106001600160401b0382111761017957604052565b90601f801991011681019081106001600160401b0382111761017957604052565b6040519061022082018281106001600160401b0382111761017957604052565b801515036101ff57565b600080fd5b359061020f826101f5565b565b6001600160a01b038116036101ff57565b6044359061020f82610211565b359061020f82610211565b359061ffff821682036101ff57565b63ffffffff8116036101ff57565b359061020f82610249565b6001600160801b038116036101ff57565b359061020f82610262565b6001600160401b03811161017957601f01601f191660200190565b9291926102a58261027e565b916102b360405193846101b4565b8294818452818301116101ff578281602093846000960137010152565b9080601f830112156101ff578160206102eb93359101610299565b90565b9190610220838203126101ff576103036101d5565b9261030d81610204565b845261031b6020820161022f565b602085015261032c6040820161022f565b604085015261033d6060820161022f565b606085015261034e6080820161022f565b608085015261035f60a0820161022f565b60a085015261037060c0820161023a565b60c085015261038160e0820161023a565b60e0850152610100610394818301610257565b908501526101206103a6818301610257565b908501526101406103b8818301610204565b908501526101606103ca818301610204565b908501526101806103dc818301610273565b908501526101a06103ee818301610273565b908501526101c061040081830161023a565b908501526101e061041281830161023a565b9085015261020091828201356001600160401b0381116101ff5761043692016102d0565b90830152565b908160409103126101ff5790565b9181601f840112156101ff578235916001600160401b0383116101ff576020808501948460051b0101116101ff57565b60606003198201126101ff576001600160401b03916004358381116101ff57826104a6916004016102ee565b926024358181116101ff57836104be9160040161043c565b926044359182116101ff576104d59160040161044a565b9091565b6104e23661047a565b6104ea611774565b60005b818110610508576104fe848661171f565b6100196001600055565b61051381838561149d565b61051c816114df565b610525816114bf565b6105c35761053a8160206105429301906110c7565b810190611683565b95979690956001600160a01b03959186169492939290853b156101ff576000978795899561058a946040519d8e9b8c9a8b9963d505accf60e01b8b52169116600489016116e3565b03925af19182156105be576001926105a5575b505b016104ed565b806105b26105b892610166565b80610663565b3861059d565b611677565b6105d48160206105dc9301906110c7565b8101906114ff565b9291906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811690813b156101ff5760008094610637604051988996879586946302b67b5760e41b8652166004850161160d565b03925af19182156105be57600192610650575b5061059f565b806105b261065d92610166565b3861064a565b60009103126101ff57565b346101ff5760003660031901126101ff576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b346101ff5760203660031901126101ff5760043560005260046020526060604060002063ffffffff6001825492015416604051916001600160801b038116835260801c60208301526040820152f35b346101ff5760003660031901126101ff5760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b6107463661047a565b61074e611774565b60005b818110610762576104fe84866117ca565b61076d81838561149d565b610776816114df565b61077f816114bf565b61080a5761053a8160206107949301906110c7565b95979690956001600160a01b03959186169492939290853b156101ff57600097879589956107dc946040519d8e9b8c9a8b9963d505accf60e01b8b52169116600489016116e3565b03925af19182156105be576001926107f7575b505b01610751565b806105b261080492610166565b386107ef565b6105d481602061081b9301906110c7565b9291906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811690813b156101ff5760008094610876604051988996879586946302b67b5760e41b8652166004850161160d565b03925af19182156105be5760019261088f575b506107f1565b806105b261089c92610166565b38610889565b60206003198201126101ff57600435906001600160401b0382116101ff576104d59160040161044a565b346101ff576108da366108a2565b50507f885219efc9c165ee279e724b7a458993563c40c118ba9c802b7933209c550d0f600080a1005b346101ff57610911366108a2565b60005b81811061091d57005b610928818385610f60565b903361094561093960608501610f98565b6001600160a01b031690565b03610a1c5761095f61095a60019336906102ee565b611b3a565b6109f161097e610979836000526003602052604060002090565b6110f9565b600081526001602082015261099d836000526003602052604060002090565b81518154602084015160409094015162010000600160901b0360109190911b1661ff0094151560081b9490941691151560ff1671ffffffffffffffffffffffffffffffffffff199091161717919091179055565b7fc08eb64db16a39d2848960af04e3f16fb404d9d436a9f0e9d7d0d4854715c9dc600080a201610914565b6040516282b42960e81b8152600490fd5b9181601f840112156101ff578235916001600160401b0383116101ff57602083818601950101116101ff57565b60e03660031901126101ff576001600160401b036004358181116101ff57610a869036906004016102ee565b6024358281116101ff57610a9e90369060040161043c565b9060603660431901126101ff5760a4358381116101ff57610ac3903690600401610a2d565b9060c4359485116101ff57610adf61001995369060040161044a565b949093611872565b346101ff5760203660031901126101ff57600435600052600360205260606040600020546001600160801b036040519160ff81161515835260ff8160081c161515602084015260101c166040820152f35b60609060431901126101ff5760405190610b518261017e565b81604435610b5e81610262565b8152606435610b6c81610262565b6020820152604060843591610b8083610249565b0152565b346101ff5760a03660031901126101ff57602435610ba181610211565b60603660431901126101ff57610bf760209160405190610bc08261017e565b604435610bcc81610262565b8252606435610bda81610262565b84830152608435610bea81610249565b6040830152600435611a68565b604051908152f35b346101ff57600080600319360112610c565733815260016020527fa82a649bbd060c9099cd7b7326e2b0dc9e9af0836480e0f849dc9eaa79710b3b604080832060018154018091558151903382526020820152a180f35b80fd5b346101ff5760203660031901126101ff57600435610c7681610211565b60018060a01b031660005260016020526020604060002054604051908152f35b346101ff5760003660031901126101ff5760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b346101ff576020806003193601126101ff576001600160401b036004358181116101ff57366023820112156101ff57806004013591808311610179578260051b9060405193610d22868401866101b4565b84528484019060248093850101933685116101ff57838101925b858410610d4c576100198761118e565b83358381116101ff578891610d6783928836918701016102ee565b815201930192610d3c565b346101ff5760603660031901126101ff576001600160401b036004358181116101ff57610da390369060040161044a565b91602435918183116101ff57366023840112156101ff5782600401359182116101ff5736602460608402850101116101ff57610019936024610de3610222565b94019161100c565b346101ff5760203660031901126101ff5760043560005260026020526020604060002054604051908152f35b346101ff5760203660031901126101ff576004356001600160401b0381116101ff57610bf761095a60209236906004016102ee565b346101ff5760003660031901126101ff5760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b346101ff57610e95366108a2565b60005b818110610ea157005b610eac818385610f60565b906101608201918235610ebe816101f5565b610f3857610f0d600193610ed561095a36856102ee565b92610f06610eff610ef3606084013594610eee86610211565b6110bd565b926102008101906110c7565b3691610299565b91846129c9565b7f06f928bcb1999ef5ebc1304d6413f6707b9426be38a7eb9fba9088be80999d54600080a201610e98565b6040516351cc7fa360e11b8152600490fd5b634e487b7160e01b600052603260045260246000fd5b9190811015610f835760051b8101359061021e19813603018212156101ff570190565b610f4a565b9190811015610f83576060020190565b356102eb81610211565b356102eb81610262565b6040600163ffffffff926001600160801b038535610fc981610262565b166001600160801b031981818454161783556020870135610fe981610262565b60801b1617815501920135610ffd81610249565b1663ffffffff19825416179055565b929093919360005b81811061102357505050505050565b61102e818387610f60565b9061103a818589610f88565b913361104b61093960808401610f98565b03610a1c576001926110b261106761095a6110b79436906102ee565b604080516020810192835260608b901b6001600160601b0319169181019190915261109f81605481015b03601f1981018352826101b4565b5190206000526004602052604060002090565b610fac565b01611014565b356102eb816101f5565b903590601e19813603018212156101ff57018035906001600160401b0382116101ff576020019181360383136101ff57565b906040516111068161017e565b60406001600160801b0382945460ff81161515845260ff8160081c161515602085015260101c16910152565b90602082519201516bffffffffffffffffffffffff60a01b9081811693600c811061115c57505050565b600c0360031b82901b16169150565b60208151910151906020811061117f575090565b6000199060200360031b1b1690565b80516000805b8281106111a15750505050565b8351811015610f8357600190602061126061124f828460051b890101519261124a6111cb85611b3a565b9161109161121860608801976111f96111ea8a5160018060a01b031690565b96610200830197885191611267565b88518c90611211906001600160a01b03169751611132565b9952611b3a565b60405160609590951b6001600160601b0319169285019283526001600160a01b03199097166014830152839160200190565b61116b565b916000526002602052604060002090565b5501611194565b9291906001600160a01b03811633146113415761128384611347565b8251916102e26062198401106002601d8501601f1610161561133457600195868416806041039160059160401990870101821c92808852870160209283820151928460238560e81c94019460e31c169081528484519118528a925b858410611314575050505061020f9697506112fd604060002092612c92565b6000525261130e6040600020611347565b90611395565b848c9101938584821c841b166040600020815286865191185201926112de565b61020f9495508190611395565b50509050565b604051602081019161190160f01b83527f0000000000000000000000000000000000000000000000000000000000000000602283015260428201526042815261138f81610199565b51902090565b9290936000938480528151601f1983019586519782604103908293600183111561144a575b505050508114811515169586156113eb575b505050505050156113d957565b604051638baa579f60e01b8152600490fd5b909192809495965083526040865260206000604319850193846064815197603f19019889519a604484528a5201915afa9586611430575b5252523880808080806113cc565b6000516374eca2c160e11b01156114225760009650611422565b909192935060408601918251936060880151861a90611483575b8752895260208460808b60015afa5089895285525251388080806113ba565b506001600160ff1b038416835260ff84901c601b01611464565b9190811015610f835760051b81013590603e19813603018212156101ff570190565b600211156114c957565b634e487b7160e01b600052602160045260246000fd5b3560028110156101ff5790565b359065ffffffffffff821682036101ff57565b918282039261010084126101ff57803561151881610211565b93601f190160c081126101ff576080604051916115348361017e565b126101ff5760405161154581610199565b602083013561155381610211565b8152604083013561156381610211565b6020820152611574606084016114ec565b6040820152611585608084016114ec565b6060820152815261159860a0830161022f565b602082015260c082013560408201529260e08201356001600160401b0381116101ff576102eb92016102d0565b60005b8381106115d85750506000910152565b81810151838201526020016115c8565b90602091611601815180928185528580860191016115c5565b601f01601f1916010190565b906102eb939260409160018060a01b03809116845281518181511660208601528160208201511684860152606065ffffffffffff9182868201511682880152015116608085015260208201511660a0840152015160c0820152610100908160e082015201906115e8565b6040513d6000823e3d90fd5b9190826101009103126101ff57813561169b81610211565b9160208101356116aa81610211565b9160408201356116b981610211565b9160608101359160808201359160a081013560ff811681036101ff579160e060c083013592013590565b9360ff929897969360c0969260e087019a60018060a01b0380921688521660208701526040860152606085015216608083015260a08201520152565b611728816129f6565b60808101516001600160a01b03168015159081611769575b50610a1c57805161020f92906000901561176357506001600160801b0391611f6b565b91611f6b565b905033141538611740565b600260005414611785576002600055565b60405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606490fd5b61020f916117d7826129f6565b6117e082611b3a565b60408051602081019283523360601b6001600160601b0319169181019190915261180d8160548101611091565b519020600052600460205260406000206040516118298161017e565b61186a82549163ffffffff60016001600160801b03958686168452602084019560801c8652015416604082015260208501359061186582610262565b61297f565b511691611f6b565b909192939594611880611774565b60005b8181106118a15750506118979495506119e1565b61020f6001600055565b6118ac81838a61149d565b6118b5816114df565b6118be816114bf565b6119495761053a8160206118d39301906110c7565b95979690956001600160a01b03959186169492939290853b156101ff576000978795899561191b946040519d8e9b8c9a8b9963d505accf60e01b8b52169116600489016116e3565b03925af19182156105be57600192611936575b505b01611883565b806105b261194392610166565b3861192e565b6105d481602061195a9301906110c7565b9291906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811690813b156101ff57600080946119b5604051988996879586946302b67b5760e41b8652166004850161160d565b03925af19182156105be576001926119ce575b50611930565b806105b26119db92610166565b386119c8565b91611a3c9061020f946119f3856129f6565b611a18611a13611a0287611b3a565b611a0b36610b38565b903390611a68565b611347565b60808601516001600160a01b0316928190611a369036908590610299565b93611395565b611a566020820135611a4d81610262565b61186536610b38565b60643591611a6383610262565b611f6b565b916001600160801b039063ffffffff6040838351169360208401511692015116916040519360208501957f00000000000000000000000000000000000000000000000000000000000000008752604086015260018060a01b03166060850152608084015260a083015260c082015260c0815260e081018181106001600160401b038211176101795760405251902090565b602061020f919392936040519481611b1a87935180928680870191016115c5565b8201611b2e825180938680850191016115c5565b010380855201836101b4565b611d6690611b488151151590565b6020820151611d61906001600160a01b03166040840151909290611c91906001600160a01b031660608601516001600160a01b031660808701516001600160a01b031660a08801516001600160a01b031660c089015161ffff1660e08a015161ffff1691611bbe6101008c015163ffffffff1690565b93611bd16101208d015163ffffffff1690565b6001600160a01b038716600090815260016020526040902090969054976040519c8d9b8c60207f0000000000000000000000000000000000000000000000000000000000000000910190815290151560208201526001600160a01b0391821660408201529181166060830152918216608082015291811660a083015290911660c082015261ffff91821660e082015291166101008201526101808101949392909163ffffffff1661012083015263ffffffff166101408201526101600152565b03611ca4601f19918281018552846101b4565b6101408401511515611d55611cbd610160870151151590565b95611cd36101808201516001600160801b031690565b90611ce96101a08201516001600160801b031690565b611d096101e0611cff6101c085015161ffff1690565b93015161ffff1690565b92604051998a96602088019492909695919360a09460c087019815158752151560208701526001600160801b03809216604087015216606085015261ffff809216608085015216910152565b039081018452836101b4565b611af9565b6020815191012090565b908060209392818452848401376000828201840152601f01601f1916010190565b611f2a611f186102eb9694959360608452611db160608501825115159052565b60208101516001600160a01b0316608085015260408101516001600160a01b031660a085015260608101516001600160a01b031660c085015260808101516001600160a01b031660e085015260a08101516001600160a01b03166101008581019190915260c082015191611e2e610120938488019061ffff169052565b611f0460e082015192611e4a61014094858a019061ffff169052565b82015193611e6361016095868a019063ffffffff169052565b82015192611e7c61018094858a019063ffffffff169052565b82015193611e916101a095868a019015159052565b82015192611ea66101c094858a019015159052565b82015193611ec26101e095868a01906001600160801b03169052565b82015192611ede61020094858a01906001600160801b03169052565b82015193611ef561022095868a019061ffff169052565b82015161ffff16610240880152565b0151906102608501526102808401906115e8565b6001600160801b039095166020830152565b6040818503910152611d70565b634e487b7160e01b600052601160045260246000fd5b6001600160801b039182169082160391908211611f6657565b611f37565b91611f768351151590565b156120e65760408301516001600160a01b03165b6020840180519092906001600160a01b0316606086018051909391611fb9916001600160a01b03165b90612a58565b604087018051919291611fdf906001600160a01b031686516001600160a01b0316611fb3565b9160a0890195611ffe611ff8885160018060a01b031690565b83612a58565b9761201e61201761201160208d01610fa2565b8d61218b565b9a806110c7565b333b156101ff578b8d6120486000936040519586948594631a0ed8d160e01b865260048601611d91565b038183335af180156105be576120d3575b50516001600160a01b031681516001600160a01b031661207891612a58565b92516001600160a01b031690516001600160a01b031661209791612a58565b95516001600160a01b03166120ab91612a58565b926120b591611f4d565b936120bf91611f4d565b936120c991611f4d565b9361020f956124fe565b806105b26120e092610166565b38612059565b60208301516001600160a01b0316611f8a565b906001600160801b03809216918211611f6657565b9190916001600160801b0380809416911601918211611f6657565b9190916001600160801b0380809416911602918216918203611f6657565b906001600160801b0380911691821561215f57160490565b634e487b7160e01b600052601260045260246000fd5b63ffffffff9182169082160391908211611f6657565b91909161219781611b3a565b926101008201906121ac825163ffffffff1690565b63ffffffff9081429116116124ec576101208401426121db6121d2835163ffffffff1690565b63ffffffff1690565b106124da57835163ffffffff16826121fa6121d2845163ffffffff1690565b911610156124c857612219610979886000526003602052604060002090565b936122276020860151151590565b6124b65761223c6122388651151590565b1590565b61248a575b610180860161227061225a82516001600160801b031690565b6040978801516001600160801b03165b90611f4d565b6001600160801b03958682168015612479576122936122386101408c0151151590565b8061246e575b61245d57818816111561245657505b8099868216908115612445576122cb61230c916000526003602052604060002090565b6122e9846122e483546001600160801b039060101c1690565b61210e565b62010000600160901b0382549160101b169062010000600160901b031916179055565b88511561240a57506101a08801516001600160801b03169061232d91612129565b90516001600160801b031661234191612147565b926101c08701516123539061ffff1690565b61ffff166123619085612129565b6127106001600160801b039091160461237a9085611f4d565b938461238591611f4d565b9082516123959063ffffffff1690565b6123a0914216612175565b63ffffffff166123af91612129565b915163ffffffff16905163ffffffff166123c891612175565b63ffffffff166123d791612147565b6123e09161210e565b60608401519092906001600160a01b03169301516001600160a01b03169116903361020f93612b32565b96935050505084925061243d915061242e606061020f96015160018060a01b031690565b9201516001600160a01b031690565b903390612b32565b885163251a5d1160e21b8152600490fd5b90506122a8565b8851634f2ffed760e01b8152600490fd5b508088831610612299565b885163dbce013760e01b8152600490fd5b60608601516124b1906001600160a01b03166101608801511515610200890151918b6129c9565b612241565b60405163460f1ebb60e11b8152600490fd5b604051630622b8b560e51b8152600490fd5b6040516340db9d8d60e11b8152600490fd5b60405163643dd89f60e11b8152600490fd5b92909161250a84611b3a565b956125158551151590565b156127d45761255161253b856125366101a08901516001600160801b031690565b612129565b6101808701516001600160801b03165b90612147565b61263a61262e61259761259161258061257a6125736101c08d015161ffff1690565b61ffff1690565b86612129565b6001600160801b0361271091160490565b84611f4d565b6126288961254b6121d26125d3856125cd6125c76125806125c16125736101e08a015161ffff1690565b8d612129565b8b611f4d565b99611f4d565b61262261261761012061260b6101008801946126056121d26125f9885163ffffffff1690565b63ffffffff4216612175565b90612129565b96015163ffffffff1690565b915163ffffffff1690565b90612175565b9061210e565b6001600160801b031690565b6001600160801b039384891691821161271c57841681116127c25760a08701518492839260009290918b916001600160a01b031661272e575b5050501691161061271c5780831691161061271c576127177fd679f241c9b017989dca9965106722596136570d66d77dd583041b64d696a349936126b78451151590565b602085810151604080880151606098890151825195151586526001600160a01b039384169486019490945282169084015216948101949094523360808501526001600160801b0392831660a085015290911660c0830152819060e0820190565b0390a2565b60405163d9c1988f60e01b8152600490fd5b61ffff61274060c08d015161ffff1690565b16806127a3575b5060e08b019261275c612573855161ffff1690565b15159081612797575b50156126735761278f93926126056125736127866126289561258095611f4d565b925161ffff1690565b388981612673565b90508582161138612765565b6127bb9194506125806127b69184612129565b6120f9565b9238612747565b604051635b5f663960e11b8152600490fd5b846128748261286e61283861283261258061282c6125736101c08d9f9c9d61280e612822916125366101a08e01516001600160801b031690565b6101808c01516001600160801b031661254b565b99015161ffff1690565b87612129565b8561210e565b61226a8a61254b6121d26125d36128676128616125806125c16125736101e089015161ffff1690565b8b61210e565b9986611f4d565b9661210e565b946001600160801b0393848088169216821061271c57841681106127c25760a0870151849283926000929091906001600160a01b03166128f2575b50501691161061271c5780851691161061271c576127177fd679f241c9b017989dca9965106722596136570d66d77dd583041b64d696a349936126b78451151590565b61ffff61290460c08c015161ffff1690565b1680612965575b508860e08b0192612921612573855161ffff1690565b15159081612959575b50612936575b506128af565b61295193926126056125736127866126289561258095611f4d565b388088612930565b9050858316103861292a565b6129789193506125806127b6918b612129565b913861290b565b63ffffffff60408201511643116129b7576001600160801b03809151169116036129a557565b6040516359208f8d60e01b8152600490fd5b6040516301a8648f60e51b8152600490fd5b926129d49184611267565b156129dc5750565b60005260036020526040600020600160ff19825416179055565b60608101805190916001600160a01b0391821615612a1357505050565b61020081612a22602093611b3a565b60005260028352604060002054948560601c9052015101916bffffffffffffffffffffffff60a01b9060a01b1690825116179052565b6001600160a01b03908116919082612a7a57506001600160801b039150311690565b602460209260405194859384926370a0823160e01b84521660048301525afa80156105be57600090612ab5575b6001600160801b0391501690565b6020823d8211612ae5575b81612acd602093836101b4565b81010312610c5657506001600160801b039051612aa7565b3d9150612ac0565b908160209103126101ff57516102eb816101f5565b3d15612b2d573d90612b138261027e565b91612b2160405193846101b4565b82523d6000602084013e565b606090565b9091906001600160a01b03808316600081612b78575050505050600080809381935af1612b5d612b02565b505b15612b6657565b6040516322092f2f60e11b8152600490fd5b6040516323b872dd60e01b81526001600160a01b03858116600483015287166024820152604481018890529495939491602091839160649183915af19081612bde575b50612bd257612bcb941691612c0c565b6001612b5f565b50505050506001612b5f565b612bfe9060203d8111612c05575b612bf681836101b4565b810190612aed565b5038612bbb565b503d612bec565b90926001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081169390929091843b156101ff5760009484869281608496816040519b8c9a8b99631b63c28b60e11b8b521660048a01521660248801521660448601521660648401525af180156105be57612c895750565b61020f90610166565b60018103612cbf57507f58d4087338a63742cea24efad814b65144758ee6edb9148c8f61ad0562c1329e90565b60028103612cec57507f0878f598f63158b6b1466e231ae5736031cb6e962a3fd653bda920befa82a41f90565b60038103612d1957507ff5abbef93a89a2459ef1253be2616f2b763753642ec411443f680d159689fd0a90565b60048103612d4657507fe01b70bf04fd440cf9eeda8da244c05c8ba9923cd8a6c40abde6ca04ca6b146b90565b60058103612d7357507fdde38fb5958e2413be9f3ea9eb5b363db19a383ba6f4be75e6d4d3b921ebad2d90565b60068103612da057507f041e26fd18116b69ee745f27fb646a42d6c3ddf1068121de5c06fa741ed757a890565b60078103612dcd57507fc2a5fb33c1692c75d8c01bd597d8f34237076fcb987104c5d4f4758d95275ca290565b600803612df8577fda7951bbe464e4a840ca92a63adf783259535c0c4b06d782c86efafafffff9e290565b6040516343d8a7b560e01b8152600490fdfea2646970667358221220c2177fb6247edad032ddade938a5ba7959315fddd3ad3af029cf5cdf2db9f97664736f6c63430008130033

Deployed Bytecode

0x6080604052600436101561001b575b361561001957600080fd5b005b60003560e01c80630aba30a41461014b57806312261ee71461014657806319550834146101415780633644e5151461013c5780633c1274a9146101375780634cd6d7bf1461013257806354c4adb01461012d5780635a0f88b5146101285780635c6741c0146101235780635d819fb91461011e578063627cdcb91461011957806370ae92d214610114578063733965121461010f5780637339a8451461010a578063870897a81461010557806395f9a56814610100578063a41d34c2146100fb578063b082a274146100f65763e0e00abe0361000e57610e87565b610e4c565b610e17565b610deb565b610d72565b610cd1565b610c96565b610c59565b610bff565b610b84565b610ae7565b610a5a565b610903565b6108cc565b61073d565b610702565b6106b3565b61066e565b6104d9565b634e487b7160e01b600052604160045260246000fd5b6001600160401b03811161017957604052565b610150565b606081019081106001600160401b0382111761017957604052565b608081019081106001600160401b0382111761017957604052565b90601f801991011681019081106001600160401b0382111761017957604052565b6040519061022082018281106001600160401b0382111761017957604052565b801515036101ff57565b600080fd5b359061020f826101f5565b565b6001600160a01b038116036101ff57565b6044359061020f82610211565b359061020f82610211565b359061ffff821682036101ff57565b63ffffffff8116036101ff57565b359061020f82610249565b6001600160801b038116036101ff57565b359061020f82610262565b6001600160401b03811161017957601f01601f191660200190565b9291926102a58261027e565b916102b360405193846101b4565b8294818452818301116101ff578281602093846000960137010152565b9080601f830112156101ff578160206102eb93359101610299565b90565b9190610220838203126101ff576103036101d5565b9261030d81610204565b845261031b6020820161022f565b602085015261032c6040820161022f565b604085015261033d6060820161022f565b606085015261034e6080820161022f565b608085015261035f60a0820161022f565b60a085015261037060c0820161023a565b60c085015261038160e0820161023a565b60e0850152610100610394818301610257565b908501526101206103a6818301610257565b908501526101406103b8818301610204565b908501526101606103ca818301610204565b908501526101806103dc818301610273565b908501526101a06103ee818301610273565b908501526101c061040081830161023a565b908501526101e061041281830161023a565b9085015261020091828201356001600160401b0381116101ff5761043692016102d0565b90830152565b908160409103126101ff5790565b9181601f840112156101ff578235916001600160401b0383116101ff576020808501948460051b0101116101ff57565b60606003198201126101ff576001600160401b03916004358381116101ff57826104a6916004016102ee565b926024358181116101ff57836104be9160040161043c565b926044359182116101ff576104d59160040161044a565b9091565b6104e23661047a565b6104ea611774565b60005b818110610508576104fe848661171f565b6100196001600055565b61051381838561149d565b61051c816114df565b610525816114bf565b6105c35761053a8160206105429301906110c7565b810190611683565b95979690956001600160a01b03959186169492939290853b156101ff576000978795899561058a946040519d8e9b8c9a8b9963d505accf60e01b8b52169116600489016116e3565b03925af19182156105be576001926105a5575b505b016104ed565b806105b26105b892610166565b80610663565b3861059d565b611677565b6105d48160206105dc9301906110c7565b8101906114ff565b9291906001600160a01b037f000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba3811690813b156101ff5760008094610637604051988996879586946302b67b5760e41b8652166004850161160d565b03925af19182156105be57600192610650575b5061059f565b806105b261065d92610166565b3861064a565b60009103126101ff57565b346101ff5760003660031901126101ff576040517f000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba36001600160a01b03168152602090f35b346101ff5760203660031901126101ff5760043560005260046020526060604060002063ffffffff6001825492015416604051916001600160801b038116835260801c60208301526040820152f35b346101ff5760003660031901126101ff5760206040517f8d71ae526dc923b9d6078faeddab0a70fbe006083988a4ea5b1a3497b4b8c3588152f35b6107463661047a565b61074e611774565b60005b818110610762576104fe84866117ca565b61076d81838561149d565b610776816114df565b61077f816114bf565b61080a5761053a8160206107949301906110c7565b95979690956001600160a01b03959186169492939290853b156101ff57600097879589956107dc946040519d8e9b8c9a8b9963d505accf60e01b8b52169116600489016116e3565b03925af19182156105be576001926107f7575b505b01610751565b806105b261080492610166565b386107ef565b6105d481602061081b9301906110c7565b9291906001600160a01b037f000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba3811690813b156101ff5760008094610876604051988996879586946302b67b5760e41b8652166004850161160d565b03925af19182156105be5760019261088f575b506107f1565b806105b261089c92610166565b38610889565b60206003198201126101ff57600435906001600160401b0382116101ff576104d59160040161044a565b346101ff576108da366108a2565b50507f885219efc9c165ee279e724b7a458993563c40c118ba9c802b7933209c550d0f600080a1005b346101ff57610911366108a2565b60005b81811061091d57005b610928818385610f60565b903361094561093960608501610f98565b6001600160a01b031690565b03610a1c5761095f61095a60019336906102ee565b611b3a565b6109f161097e610979836000526003602052604060002090565b6110f9565b600081526001602082015261099d836000526003602052604060002090565b81518154602084015160409094015162010000600160901b0360109190911b1661ff0094151560081b9490941691151560ff1671ffffffffffffffffffffffffffffffffffff199091161717919091179055565b7fc08eb64db16a39d2848960af04e3f16fb404d9d436a9f0e9d7d0d4854715c9dc600080a201610914565b6040516282b42960e81b8152600490fd5b9181601f840112156101ff578235916001600160401b0383116101ff57602083818601950101116101ff57565b60e03660031901126101ff576001600160401b036004358181116101ff57610a869036906004016102ee565b6024358281116101ff57610a9e90369060040161043c565b9060603660431901126101ff5760a4358381116101ff57610ac3903690600401610a2d565b9060c4359485116101ff57610adf61001995369060040161044a565b949093611872565b346101ff5760203660031901126101ff57600435600052600360205260606040600020546001600160801b036040519160ff81161515835260ff8160081c161515602084015260101c166040820152f35b60609060431901126101ff5760405190610b518261017e565b81604435610b5e81610262565b8152606435610b6c81610262565b6020820152604060843591610b8083610249565b0152565b346101ff5760a03660031901126101ff57602435610ba181610211565b60603660431901126101ff57610bf760209160405190610bc08261017e565b604435610bcc81610262565b8252606435610bda81610262565b84830152608435610bea81610249565b6040830152600435611a68565b604051908152f35b346101ff57600080600319360112610c565733815260016020527fa82a649bbd060c9099cd7b7326e2b0dc9e9af0836480e0f849dc9eaa79710b3b604080832060018154018091558151903382526020820152a180f35b80fd5b346101ff5760203660031901126101ff57600435610c7681610211565b60018060a01b031660005260016020526020604060002054604051908152f35b346101ff5760003660031901126101ff5760206040517f5b46e06289f35bceae663c2005b96c52539f0baa5a52a2c628d348b311f5f51e8152f35b346101ff576020806003193601126101ff576001600160401b036004358181116101ff57366023820112156101ff57806004013591808311610179578260051b9060405193610d22868401866101b4565b84528484019060248093850101933685116101ff57838101925b858410610d4c576100198761118e565b83358381116101ff578891610d6783928836918701016102ee565b815201930192610d3c565b346101ff5760603660031901126101ff576001600160401b036004358181116101ff57610da390369060040161044a565b91602435918183116101ff57366023840112156101ff5782600401359182116101ff5736602460608402850101116101ff57610019936024610de3610222565b94019161100c565b346101ff5760203660031901126101ff5760043560005260026020526020604060002054604051908152f35b346101ff5760203660031901126101ff576004356001600160401b0381116101ff57610bf761095a60209236906004016102ee565b346101ff5760003660031901126101ff5760206040517fd3836dfb2cb2478e2a15d8f66ac98715ca1b8e970f6587331ce95692b6313b218152f35b346101ff57610e95366108a2565b60005b818110610ea157005b610eac818385610f60565b906101608201918235610ebe816101f5565b610f3857610f0d600193610ed561095a36856102ee565b92610f06610eff610ef3606084013594610eee86610211565b6110bd565b926102008101906110c7565b3691610299565b91846129c9565b7f06f928bcb1999ef5ebc1304d6413f6707b9426be38a7eb9fba9088be80999d54600080a201610e98565b6040516351cc7fa360e11b8152600490fd5b634e487b7160e01b600052603260045260246000fd5b9190811015610f835760051b8101359061021e19813603018212156101ff570190565b610f4a565b9190811015610f83576060020190565b356102eb81610211565b356102eb81610262565b6040600163ffffffff926001600160801b038535610fc981610262565b166001600160801b031981818454161783556020870135610fe981610262565b60801b1617815501920135610ffd81610249565b1663ffffffff19825416179055565b929093919360005b81811061102357505050505050565b61102e818387610f60565b9061103a818589610f88565b913361104b61093960808401610f98565b03610a1c576001926110b261106761095a6110b79436906102ee565b604080516020810192835260608b901b6001600160601b0319169181019190915261109f81605481015b03601f1981018352826101b4565b5190206000526004602052604060002090565b610fac565b01611014565b356102eb816101f5565b903590601e19813603018212156101ff57018035906001600160401b0382116101ff576020019181360383136101ff57565b906040516111068161017e565b60406001600160801b0382945460ff81161515845260ff8160081c161515602085015260101c16910152565b90602082519201516bffffffffffffffffffffffff60a01b9081811693600c811061115c57505050565b600c0360031b82901b16169150565b60208151910151906020811061117f575090565b6000199060200360031b1b1690565b80516000805b8281106111a15750505050565b8351811015610f8357600190602061126061124f828460051b890101519261124a6111cb85611b3a565b9161109161121860608801976111f96111ea8a5160018060a01b031690565b96610200830197885191611267565b88518c90611211906001600160a01b03169751611132565b9952611b3a565b60405160609590951b6001600160601b0319169285019283526001600160a01b03199097166014830152839160200190565b61116b565b916000526002602052604060002090565b5501611194565b9291906001600160a01b03811633146113415761128384611347565b8251916102e26062198401106002601d8501601f1610161561133457600195868416806041039160059160401990870101821c92808852870160209283820151928460238560e81c94019460e31c169081528484519118528a925b858410611314575050505061020f9697506112fd604060002092612c92565b6000525261130e6040600020611347565b90611395565b848c9101938584821c841b166040600020815286865191185201926112de565b61020f9495508190611395565b50509050565b604051602081019161190160f01b83527f8d71ae526dc923b9d6078faeddab0a70fbe006083988a4ea5b1a3497b4b8c358602283015260428201526042815261138f81610199565b51902090565b9290936000938480528151601f1983019586519782604103908293600183111561144a575b505050508114811515169586156113eb575b505050505050156113d957565b604051638baa579f60e01b8152600490fd5b909192809495965083526040865260206000604319850193846064815197603f19019889519a604484528a5201915afa9586611430575b5252523880808080806113cc565b6000516374eca2c160e11b01156114225760009650611422565b909192935060408601918251936060880151861a90611483575b8752895260208460808b60015afa5089895285525251388080806113ba565b506001600160ff1b038416835260ff84901c601b01611464565b9190811015610f835760051b81013590603e19813603018212156101ff570190565b600211156114c957565b634e487b7160e01b600052602160045260246000fd5b3560028110156101ff5790565b359065ffffffffffff821682036101ff57565b918282039261010084126101ff57803561151881610211565b93601f190160c081126101ff576080604051916115348361017e565b126101ff5760405161154581610199565b602083013561155381610211565b8152604083013561156381610211565b6020820152611574606084016114ec565b6040820152611585608084016114ec565b6060820152815261159860a0830161022f565b602082015260c082013560408201529260e08201356001600160401b0381116101ff576102eb92016102d0565b60005b8381106115d85750506000910152565b81810151838201526020016115c8565b90602091611601815180928185528580860191016115c5565b601f01601f1916010190565b906102eb939260409160018060a01b03809116845281518181511660208601528160208201511684860152606065ffffffffffff9182868201511682880152015116608085015260208201511660a0840152015160c0820152610100908160e082015201906115e8565b6040513d6000823e3d90fd5b9190826101009103126101ff57813561169b81610211565b9160208101356116aa81610211565b9160408201356116b981610211565b9160608101359160808201359160a081013560ff811681036101ff579160e060c083013592013590565b9360ff929897969360c0969260e087019a60018060a01b0380921688521660208701526040860152606085015216608083015260a08201520152565b611728816129f6565b60808101516001600160a01b03168015159081611769575b50610a1c57805161020f92906000901561176357506001600160801b0391611f6b565b91611f6b565b905033141538611740565b600260005414611785576002600055565b60405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606490fd5b61020f916117d7826129f6565b6117e082611b3a565b60408051602081019283523360601b6001600160601b0319169181019190915261180d8160548101611091565b519020600052600460205260406000206040516118298161017e565b61186a82549163ffffffff60016001600160801b03958686168452602084019560801c8652015416604082015260208501359061186582610262565b61297f565b511691611f6b565b909192939594611880611774565b60005b8181106118a15750506118979495506119e1565b61020f6001600055565b6118ac81838a61149d565b6118b5816114df565b6118be816114bf565b6119495761053a8160206118d39301906110c7565b95979690956001600160a01b03959186169492939290853b156101ff576000978795899561191b946040519d8e9b8c9a8b9963d505accf60e01b8b52169116600489016116e3565b03925af19182156105be57600192611936575b505b01611883565b806105b261194392610166565b3861192e565b6105d481602061195a9301906110c7565b9291906001600160a01b037f000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba3811690813b156101ff57600080946119b5604051988996879586946302b67b5760e41b8652166004850161160d565b03925af19182156105be576001926119ce575b50611930565b806105b26119db92610166565b386119c8565b91611a3c9061020f946119f3856129f6565b611a18611a13611a0287611b3a565b611a0b36610b38565b903390611a68565b611347565b60808601516001600160a01b0316928190611a369036908590610299565b93611395565b611a566020820135611a4d81610262565b61186536610b38565b60643591611a6383610262565b611f6b565b916001600160801b039063ffffffff6040838351169360208401511692015116916040519360208501957f5b46e06289f35bceae663c2005b96c52539f0baa5a52a2c628d348b311f5f51e8752604086015260018060a01b03166060850152608084015260a083015260c082015260c0815260e081018181106001600160401b038211176101795760405251902090565b602061020f919392936040519481611b1a87935180928680870191016115c5565b8201611b2e825180938680850191016115c5565b010380855201836101b4565b611d6690611b488151151590565b6020820151611d61906001600160a01b03166040840151909290611c91906001600160a01b031660608601516001600160a01b031660808701516001600160a01b031660a08801516001600160a01b031660c089015161ffff1660e08a015161ffff1691611bbe6101008c015163ffffffff1690565b93611bd16101208d015163ffffffff1690565b6001600160a01b038716600090815260016020526040902090969054976040519c8d9b8c60207fd3836dfb2cb2478e2a15d8f66ac98715ca1b8e970f6587331ce95692b6313b21910190815290151560208201526001600160a01b0391821660408201529181166060830152918216608082015291811660a083015290911660c082015261ffff91821660e082015291166101008201526101808101949392909163ffffffff1661012083015263ffffffff166101408201526101600152565b03611ca4601f19918281018552846101b4565b6101408401511515611d55611cbd610160870151151590565b95611cd36101808201516001600160801b031690565b90611ce96101a08201516001600160801b031690565b611d096101e0611cff6101c085015161ffff1690565b93015161ffff1690565b92604051998a96602088019492909695919360a09460c087019815158752151560208701526001600160801b03809216604087015216606085015261ffff809216608085015216910152565b039081018452836101b4565b611af9565b6020815191012090565b908060209392818452848401376000828201840152601f01601f1916010190565b611f2a611f186102eb9694959360608452611db160608501825115159052565b60208101516001600160a01b0316608085015260408101516001600160a01b031660a085015260608101516001600160a01b031660c085015260808101516001600160a01b031660e085015260a08101516001600160a01b03166101008581019190915260c082015191611e2e610120938488019061ffff169052565b611f0460e082015192611e4a61014094858a019061ffff169052565b82015193611e6361016095868a019063ffffffff169052565b82015192611e7c61018094858a019063ffffffff169052565b82015193611e916101a095868a019015159052565b82015192611ea66101c094858a019015159052565b82015193611ec26101e095868a01906001600160801b03169052565b82015192611ede61020094858a01906001600160801b03169052565b82015193611ef561022095868a019061ffff169052565b82015161ffff16610240880152565b0151906102608501526102808401906115e8565b6001600160801b039095166020830152565b6040818503910152611d70565b634e487b7160e01b600052601160045260246000fd5b6001600160801b039182169082160391908211611f6657565b611f37565b91611f768351151590565b156120e65760408301516001600160a01b03165b6020840180519092906001600160a01b0316606086018051909391611fb9916001600160a01b03165b90612a58565b604087018051919291611fdf906001600160a01b031686516001600160a01b0316611fb3565b9160a0890195611ffe611ff8885160018060a01b031690565b83612a58565b9761201e61201761201160208d01610fa2565b8d61218b565b9a806110c7565b333b156101ff578b8d6120486000936040519586948594631a0ed8d160e01b865260048601611d91565b038183335af180156105be576120d3575b50516001600160a01b031681516001600160a01b031661207891612a58565b92516001600160a01b031690516001600160a01b031661209791612a58565b95516001600160a01b03166120ab91612a58565b926120b591611f4d565b936120bf91611f4d565b936120c991611f4d565b9361020f956124fe565b806105b26120e092610166565b38612059565b60208301516001600160a01b0316611f8a565b906001600160801b03809216918211611f6657565b9190916001600160801b0380809416911601918211611f6657565b9190916001600160801b0380809416911602918216918203611f6657565b906001600160801b0380911691821561215f57160490565b634e487b7160e01b600052601260045260246000fd5b63ffffffff9182169082160391908211611f6657565b91909161219781611b3a565b926101008201906121ac825163ffffffff1690565b63ffffffff9081429116116124ec576101208401426121db6121d2835163ffffffff1690565b63ffffffff1690565b106124da57835163ffffffff16826121fa6121d2845163ffffffff1690565b911610156124c857612219610979886000526003602052604060002090565b936122276020860151151590565b6124b65761223c6122388651151590565b1590565b61248a575b610180860161227061225a82516001600160801b031690565b6040978801516001600160801b03165b90611f4d565b6001600160801b03958682168015612479576122936122386101408c0151151590565b8061246e575b61245d57818816111561245657505b8099868216908115612445576122cb61230c916000526003602052604060002090565b6122e9846122e483546001600160801b039060101c1690565b61210e565b62010000600160901b0382549160101b169062010000600160901b031916179055565b88511561240a57506101a08801516001600160801b03169061232d91612129565b90516001600160801b031661234191612147565b926101c08701516123539061ffff1690565b61ffff166123619085612129565b6127106001600160801b039091160461237a9085611f4d565b938461238591611f4d565b9082516123959063ffffffff1690565b6123a0914216612175565b63ffffffff166123af91612129565b915163ffffffff16905163ffffffff166123c891612175565b63ffffffff166123d791612147565b6123e09161210e565b60608401519092906001600160a01b03169301516001600160a01b03169116903361020f93612b32565b96935050505084925061243d915061242e606061020f96015160018060a01b031690565b9201516001600160a01b031690565b903390612b32565b885163251a5d1160e21b8152600490fd5b90506122a8565b8851634f2ffed760e01b8152600490fd5b508088831610612299565b885163dbce013760e01b8152600490fd5b60608601516124b1906001600160a01b03166101608801511515610200890151918b6129c9565b612241565b60405163460f1ebb60e11b8152600490fd5b604051630622b8b560e51b8152600490fd5b6040516340db9d8d60e11b8152600490fd5b60405163643dd89f60e11b8152600490fd5b92909161250a84611b3a565b956125158551151590565b156127d45761255161253b856125366101a08901516001600160801b031690565b612129565b6101808701516001600160801b03165b90612147565b61263a61262e61259761259161258061257a6125736101c08d015161ffff1690565b61ffff1690565b86612129565b6001600160801b0361271091160490565b84611f4d565b6126288961254b6121d26125d3856125cd6125c76125806125c16125736101e08a015161ffff1690565b8d612129565b8b611f4d565b99611f4d565b61262261261761012061260b6101008801946126056121d26125f9885163ffffffff1690565b63ffffffff4216612175565b90612129565b96015163ffffffff1690565b915163ffffffff1690565b90612175565b9061210e565b6001600160801b031690565b6001600160801b039384891691821161271c57841681116127c25760a08701518492839260009290918b916001600160a01b031661272e575b5050501691161061271c5780831691161061271c576127177fd679f241c9b017989dca9965106722596136570d66d77dd583041b64d696a349936126b78451151590565b602085810151604080880151606098890151825195151586526001600160a01b039384169486019490945282169084015216948101949094523360808501526001600160801b0392831660a085015290911660c0830152819060e0820190565b0390a2565b60405163d9c1988f60e01b8152600490fd5b61ffff61274060c08d015161ffff1690565b16806127a3575b5060e08b019261275c612573855161ffff1690565b15159081612797575b50156126735761278f93926126056125736127866126289561258095611f4d565b925161ffff1690565b388981612673565b90508582161138612765565b6127bb9194506125806127b69184612129565b6120f9565b9238612747565b604051635b5f663960e11b8152600490fd5b846128748261286e61283861283261258061282c6125736101c08d9f9c9d61280e612822916125366101a08e01516001600160801b031690565b6101808c01516001600160801b031661254b565b99015161ffff1690565b87612129565b8561210e565b61226a8a61254b6121d26125d36128676128616125806125c16125736101e089015161ffff1690565b8b61210e565b9986611f4d565b9661210e565b946001600160801b0393848088169216821061271c57841681106127c25760a0870151849283926000929091906001600160a01b03166128f2575b50501691161061271c5780851691161061271c576127177fd679f241c9b017989dca9965106722596136570d66d77dd583041b64d696a349936126b78451151590565b61ffff61290460c08c015161ffff1690565b1680612965575b508860e08b0192612921612573855161ffff1690565b15159081612959575b50612936575b506128af565b61295193926126056125736127866126289561258095611f4d565b388088612930565b9050858316103861292a565b6129789193506125806127b6918b612129565b913861290b565b63ffffffff60408201511643116129b7576001600160801b03809151169116036129a557565b6040516359208f8d60e01b8152600490fd5b6040516301a8648f60e51b8152600490fd5b926129d49184611267565b156129dc5750565b60005260036020526040600020600160ff19825416179055565b60608101805190916001600160a01b0391821615612a1357505050565b61020081612a22602093611b3a565b60005260028352604060002054948560601c9052015101916bffffffffffffffffffffffff60a01b9060a01b1690825116179052565b6001600160a01b03908116919082612a7a57506001600160801b039150311690565b602460209260405194859384926370a0823160e01b84521660048301525afa80156105be57600090612ab5575b6001600160801b0391501690565b6020823d8211612ae5575b81612acd602093836101b4565b81010312610c5657506001600160801b039051612aa7565b3d9150612ac0565b908160209103126101ff57516102eb816101f5565b3d15612b2d573d90612b138261027e565b91612b2160405193846101b4565b82523d6000602084013e565b606090565b9091906001600160a01b03808316600081612b78575050505050600080809381935af1612b5d612b02565b505b15612b6657565b6040516322092f2f60e11b8152600490fd5b6040516323b872dd60e01b81526001600160a01b03858116600483015287166024820152604481018890529495939491602091839160649183915af19081612bde575b50612bd257612bcb941691612c0c565b6001612b5f565b50505050506001612b5f565b612bfe9060203d8111612c05575b612bf681836101b4565b810190612aed565b5038612bbb565b503d612bec565b90926001600160a01b037f000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba381169390929091843b156101ff5760009484869281608496816040519b8c9a8b99631b63c28b60e11b8b521660048a01521660248801521660448601521660648401525af180156105be57612c895750565b61020f90610166565b60018103612cbf57507f58d4087338a63742cea24efad814b65144758ee6edb9148c8f61ad0562c1329e90565b60028103612cec57507f0878f598f63158b6b1466e231ae5736031cb6e962a3fd653bda920befa82a41f90565b60038103612d1957507ff5abbef93a89a2459ef1253be2616f2b763753642ec411443f680d159689fd0a90565b60048103612d4657507fe01b70bf04fd440cf9eeda8da244c05c8ba9923cd8a6c40abde6ca04ca6b146b90565b60058103612d7357507fdde38fb5958e2413be9f3ea9eb5b363db19a383ba6f4be75e6d4d3b921ebad2d90565b60068103612da057507f041e26fd18116b69ee745f27fb646a42d6c3ddf1068121de5c06fa741ed757a890565b60078103612dcd57507fc2a5fb33c1692c75d8c01bd597d8f34237076fcb987104c5d4f4758d95275ca290565b600803612df8577fda7951bbe464e4a840ca92a63adf783259535c0c4b06d782c86efafafffff9e290565b6040516343d8a7b560e01b8152600490fdfea2646970667358221220c2177fb6247edad032ddade938a5ba7959315fddd3ad3af029cf5cdf2db9f97664736f6c63430008130033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.