false
true
0

Contract Address Details

0x79D1Ce697509D75D79c6cA8f9232ee6ca6Df379a

Contract Name
SwitchPLSFlow
Creator
0xf3b5e2–b7ead4 at 0xfc803c–a7dc56
Balance
0 PLS ( )
Tokens
Fetching tokens...
Transactions
27 Transactions
Transfers
30 Transfers
Gas Used
5,423,923
Last Balance Update
26041743
Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
This contract has been verified via Sourcify. View contract in Sourcify repository
Contract name:
SwitchPLSFlow




Optimization enabled
true
Compiler version
v0.8.20+commit.a1b79de6




Optimization runs
999
EVM Version
shanghai




Verified at
2026-03-10T06:29:46.545758Z

Constructor Arguments

00000000000000000000000079925587be77c25b292c0eca6fedd3a3f07916f900000000000000000000000099999d19ec98f936934e029e63d1c0a127a15207000000000000000000000000a1077a294dde1b09bb078844df40758a5d0f9a27

Arg [0] (address) : 0x79925587be77c25b292c0eca6fedd3a3f07916f9
Arg [1] (address) : 0x99999d19ec98f936934e029e63d1c0a127a15207
Arg [2] (address) : 0xa1077a294dde1b09bb078844df40758a5d0f9a27

              

src/SwitchPLSFlow.sol

// SPDX-License-Identifier: GPL-3.0-only
pragma solidity ^0.8.0;

import "./interface/IERC20.sol";
import "./interface/IERC1271.sol";
import "./interface/IWETH.sol";
import "./interface/ISwitchRouter.sol";
import "./interface/ISwitchLimitOrder.sol";
import "./lib/SafeERC20.sol";
import "./lib/Maintainable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
/**
 * @title SwitchPLSFlow
 * @notice Enables native PLS limit orders on SwitchLimitOrder.
 *
 *         Users send PLS in a single transaction. This contract:
 *           1. Wraps PLS → WPLS
 *           2. Approves SwitchLimitOrder + SwitchRouter for WPLS
 *           3. Stores the order so it can be filled by SwitchLimitOrder
 *           4. Implements ERC-1271 so SwitchLimitOrder can validate this
 *              contract as the "maker" of the order
 *
 *         This contract becomes the `maker` in the EIP-712 order struct.
 *         The user's address is stored as `originalMaker` and set as the
 *         `recipient` so output tokens always go to the user.
 *
 *         Cancellation: only the originalMaker can cancel, which unwraps
 *         WPLS → PLS and returns it.
 *
 *         The EIP-712 domain MUST match SwitchLimitOrder's domain exactly:
 *           { name: "SwitchLimitOrder", version: "2", chainId, verifyingContract }
 *         where verifyingContract = address of the SwitchLimitOrder contract
 *         (NOT address(this)). We compute the domain separator manually to
 *         ensure the digest matches what SwitchLimitOrder computes.
 */
contract SwitchPLSFlow is IERC1271, Maintainable, ReentrancyGuard {
    using SafeERC20 for IERC20;

    // ═══════════════════════════════════════════════════════════════════════════
    // CONSTANTS
    // ═══════════════════════════════════════════════════════════════════════════

    bytes4 private constant ERC1271_MAGIC = 0x1626ba7e;

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

    bytes32 public constant LIMIT_ORDER_TYPEHASH = keccak256(
        "LimitOrder(address maker,address tokenIn,address tokenOut,uint256 amountIn,uint256 minAmountOut,uint256 deadline,uint256 nonce,bool feeOnOutput,address recipient,bool unwrapOutput,address partnerAddress)"
    );

    // ═══════════════════════════════════════════════════════════════════════════
    // IMMUTABLES
    // ═══════════════════════════════════════════════════════════════════════════

    address public immutable SWITCH_LIMIT_ORDER;
    address public immutable SWITCH_ROUTER;
    address public immutable WNATIVE;

    /// @notice EIP-712 domain separator matching SwitchLimitOrder's domain
    ///         Uses SWITCH_LIMIT_ORDER as verifyingContract (not address(this))
    bytes32 public immutable LIMIT_ORDER_DOMAIN_SEPARATOR;

    // ═══════════════════════════════════════════════════════════════════════════
    // STATE
    // ═══════════════════════════════════════════════════════════════════════════

    /// @notice Order data stored for ERC-1271 validation and cancellation
    struct PLSOrder {
        address originalMaker;  // The user who deposited PLS
        address tokenOut;       // Output token
        uint256 amountIn;       // WPLS amount (= PLS deposited)
        uint256 minAmountOut;   // Minimum output for the user
        uint256 deadline;       // Order expiry (0 = never)
        bool    feeOnOutput;    // Fee placement preference
        bool    unwrapOutput;   // Whether to unwrap output WPLS → PLS
        bool    active;         // false = cancelled or filled
        address partnerAddress; // Partner to receive 50% of fees (address(0) = no partner)
    }

    /// @notice nonce → order details
    mapping(uint256 => PLSOrder) public orders;

    /// @notice Tracks valid order digests for ERC-1271 validation
    mapping(bytes32 => bool) public validOrderDigests;

    /// @notice Global auto-incrementing nonce counter (prevents collisions in orders[] mapping)
    uint256 public globalNonceCounter;

    // ═══════════════════════════════════════════════════════════════════════════
    // EVENTS
    // ═══════════════════════════════════════════════════════════════════════════

    event PLSOrderCreated(
        address indexed originalMaker,
        uint256 indexed nonce,
        address tokenOut,
        uint256 amountIn,
        uint256 minAmountOut,
        uint256 deadline
    );

    event PLSOrderCancelled(
        address indexed originalMaker,
        uint256 indexed nonce,
        uint256 refundAmount
    );

    // ═══════════════════════════════════════════════════════════════════════════
    // ERRORS
    // ═══════════════════════════════════════════════════════════════════════════

    error ZeroAmount();
    error InvalidToken();
    error OrderNotActive();
    error NotOrderOwner();
    error TransferFailed();

    // ═══════════════════════════════════════════════════════════════════════════
    // CONSTRUCTOR
    // ═══════════════════════════════════════════════════════════════════════════

    /**
     * @param _switchLimitOrder Address of the SwitchLimitOrder contract
     * @param _switchRouter     Address of the SwitchRouter contract
     * @param _wnative          Address of WPLS
     *
     * @dev We compute the EIP-712 domain separator manually using
     *      SWITCH_LIMIT_ORDER as verifyingContract so that the digests
     *      stored here match exactly what SwitchLimitOrder computes.
     *      (OpenZeppelin's EIP712 base would use address(this) instead,
     *      which would cause a domain mismatch.)
     */
    constructor(
        address _switchLimitOrder,
        address _switchRouter,
        address _wnative
    ) {
        require(_switchLimitOrder != address(0), "Invalid limit order");
        require(_switchRouter != address(0), "Invalid router");
        require(_wnative != address(0), "Invalid WNATIVE");

        SWITCH_LIMIT_ORDER = _switchLimitOrder;
        SWITCH_ROUTER = _switchRouter;
        WNATIVE = _wnative;

        // Build the domain separator using SwitchLimitOrder's address
        // so digests match what SwitchLimitOrder.sol computes
        LIMIT_ORDER_DOMAIN_SEPARATOR = keccak256(abi.encode(
            EIP712_DOMAIN_TYPEHASH,
            keccak256(bytes("SwitchLimitOrder")),
            keccak256(bytes("2")),
            block.chainid,
            _switchLimitOrder   // verifyingContract = SwitchLimitOrder, NOT address(this)
        ));

        // Pre-approve WPLS for SwitchLimitOrder (pulls during feeOnInput fills)
        IERC20(_wnative).approve(_switchLimitOrder, type(uint256).max);
        // Pre-approve WPLS for SwitchRouter (pulls during feeOnOutput fills via goSwitchFrom)
        IERC20(_wnative).approve(_switchRouter, type(uint256).max);
    }

    // ═══════════════════════════════════════════════════════════════════════════
    // CREATE ORDER
    // ═══════════════════════════════════════════════════════════════════════════

    /**
     * @notice Create a native PLS limit order in a single transaction.
     *         Wraps PLS → WPLS and stores the order for filling.
     *
     * @param tokenOut      The token the user wants to receive
     * @param minAmountOut  Minimum amount of tokenOut the user accepts
     * @param deadline      Unix timestamp expiry (0 = no expiry)
     * @param feeOnOutput   Whether protocol fee is taken from output
     * @param unwrapOutput  Whether to unwrap WPLS → PLS if tokenOut is WPLS
     * @return nonce        The nonce assigned to this order
     */
    function createOrder(
        address tokenOut,
        uint256 minAmountOut,
        uint256 deadline,
        bool feeOnOutput,
        bool unwrapOutput,
        address partnerAddress
    ) external payable nonReentrant returns (uint256 nonce) {
        if (msg.value == 0) revert ZeroAmount();
        if (tokenOut == address(0) || tokenOut == WNATIVE && !unwrapOutput) {
            // tokenOut can be WNATIVE only if unwrapOutput is true (user wants PLS back)
            // Otherwise this would be WPLS→WPLS which makes no sense
            if (tokenOut == WNATIVE && !unwrapOutput) revert InvalidToken();
        }

        // Wrap PLS → WPLS
        IWETH(WNATIVE).deposit{value: msg.value}();

        // Assign nonce (global to prevent storage collisions between users)
        nonce = globalNonceCounter++;

        // The order recipient is always the original user
        address recipient = msg.sender;

        // Store order
        orders[nonce] = PLSOrder({
            originalMaker: msg.sender,
            tokenOut: tokenOut,
            amountIn: msg.value,
            minAmountOut: minAmountOut,
            deadline: deadline,
            feeOnOutput: feeOnOutput,
            unwrapOutput: unwrapOutput,
            active: true,
            partnerAddress: partnerAddress
        });

        // Compute and store the EIP-712 digest for ERC-1271 validation
        bytes32 structHash = keccak256(abi.encode(
            LIMIT_ORDER_TYPEHASH,
            address(this),   // maker = this contract
            WNATIVE,         // tokenIn = WPLS
            tokenOut,
            msg.value,       // amountIn
            minAmountOut,
            deadline,
            nonce,
            feeOnOutput,
            recipient,
            unwrapOutput,
            partnerAddress
        ));
        bytes32 digest = keccak256(abi.encodePacked(
            "\x19\x01", LIMIT_ORDER_DOMAIN_SEPARATOR, structHash
        ));
        validOrderDigests[digest] = true;

        // Announce on the LimitOrder contract so the backend indexes it
        ISwitchLimitOrder(SWITCH_LIMIT_ORDER).placeOrder(
            ISwitchLimitOrder.LimitOrder({
                maker: address(this),
                tokenIn: WNATIVE,
                tokenOut: tokenOut,
                amountIn: msg.value,
                minAmountOut: minAmountOut,
                deadline: deadline,
                nonce: nonce,
                feeOnOutput: feeOnOutput,
                recipient: recipient,
                unwrapOutput: unwrapOutput,
                partnerAddress: partnerAddress
            }),
            ""  // No ECDSA signature — PLSFlow uses ERC-1271
        );

        emit PLSOrderCreated(msg.sender, nonce, tokenOut, msg.value, minAmountOut, deadline);
    }

    // ═══════════════════════════════════════════════════════════════════════════
    // CANCEL ORDER
    // ═══════════════════════════════════════════════════════════════════════════

    /**
     * @notice Cancel a PLS order and reclaim funds.
     *         Unwraps WPLS → PLS and sends back to the original maker.
     *         Also invalidates the nonce on SwitchLimitOrder to prevent filling.
     *
     * @param nonce The nonce of the order to cancel
     */
    function cancelOrder(uint256 nonce) external nonReentrant {
        PLSOrder storage order = orders[nonce];
        if (!order.active) revert OrderNotActive();
        if (order.originalMaker != msg.sender) revert NotOrderOwner();

        order.active = false;

        // Invalidate digest for ERC-1271
        bytes32 structHash = keccak256(abi.encode(
            LIMIT_ORDER_TYPEHASH,
            address(this),
            WNATIVE,
            order.tokenOut,
            order.amountIn,
            order.minAmountOut,
            order.deadline,
            nonce,
            order.feeOnOutput,
            msg.sender,       // recipient = originalMaker
            order.unwrapOutput,
            order.partnerAddress
        ));
        bytes32 digest = keccak256(abi.encodePacked(
            "\x19\x01", LIMIT_ORDER_DOMAIN_SEPARATOR, structHash
        ));
        validOrderDigests[digest] = false;

        // Refund: unwrap WPLS → PLS and send to user
        uint256 refundAmount = order.amountIn;

        // Check we still have the WPLS (it may have been partially or fully filled)
        uint256 wplsBal = IERC20(WNATIVE).balanceOf(address(this));
        if (refundAmount > wplsBal) {
            refundAmount = wplsBal;
        }

        if (refundAmount > 0) {
            IWETH(WNATIVE).withdraw(refundAmount);
            (bool ok, ) = payable(msg.sender).call{value: refundAmount}("");
            if (!ok) revert TransferFailed();
        }

        emit PLSOrderCancelled(msg.sender, nonce, refundAmount);
    }

    // ═══════════════════════════════════════════════════════════════════════════
    // ERC-1271: SIGNATURE VALIDATION
    // ═══════════════════════════════════════════════════════════════════════════

    /**
     * @notice Validates a signature for ERC-1271.
     *         SwitchLimitOrder calls this when the order's maker is a contract.
     *         We check that the digest matches a stored valid order.
     *
     * @param hash       The EIP-712 typed data hash
     * @param signature  Unused (we validate via stored digests, not signatures)
     * @return magicValue ERC-1271 magic value if valid, 0x00000000 if not
     */
    function isValidSignature(
        bytes32 hash,
        bytes calldata signature
    ) external view override returns (bytes4) {
        // Silence unused variable warning
        signature;

        if (validOrderDigests[hash]) {
            return ERC1271_MAGIC;
        }
        return bytes4(0);
    }

    // ═══════════════════════════════════════════════════════════════════════════
    // VIEW FUNCTIONS
    // ═══════════════════════════════════════════════════════════════════════════

    function getOrder(uint256 nonce) external view returns (PLSOrder memory) {
        return orders[nonce];
    }

    function getGlobalNonce() external view returns (uint256) {
        return globalNonceCounter;
    }

    // ═══════════════════════════════════════════════════════════════════════════
    // EMERGENCY
    // ═══════════════════════════════════════════════════════════════════════════

    function recoverTokens(address _token, uint256 _amount) external onlyMaintainer {
        IERC20(_token).safeTransfer(msg.sender, _amount);
    }

    function recoverNative(uint256 _amount) external onlyMaintainer {
        (bool ok, ) = payable(msg.sender).call{value: _amount}("");
        require(ok, "Native transfer failed");
    }

    receive() external payable {}
}
        

/introspection/IERC165.sol

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

pragma solidity ^0.8.0;

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

/introspection/ERC165.sol

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

pragma solidity ^0.8.0;

import "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}
          

/

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/access/AccessControl.sol";

/**
 * @dev Contract module which extends the basic access control mechanism of Ownable
 * to include many maintainers, whom only the owner (DEFAULT_ADMIN_ROLE) may add and
 * remove.
 *
 * By default, the owner account will be the one that deploys the contract. This can
 * later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available this modifier:
 * `onlyMaintainer`, which can be applied to your functions to restrict their use to
 * the accounts with the role of maintainer.
 */

abstract contract Maintainable is Context, AccessControl {
    bytes32 public constant MAINTAINER_ROLE = keccak256("MAINTAINER_ROLE");

    constructor() {
        address msgSender = _msgSender();
        // members of the DEFAULT_ADMIN_ROLE alone may revoke and grant role membership
        _setupRole(DEFAULT_ADMIN_ROLE, msgSender);
        _setupRole(MAINTAINER_ROLE, msgSender);
    }

    function addMaintainer(address addedMaintainer) public virtual {
        grantRole(MAINTAINER_ROLE, addedMaintainer);
    }

    function removeMaintainer(address removedMaintainer) public virtual {
        revokeRole(MAINTAINER_ROLE, removedMaintainer);
    }

    function renounceRole(bytes32 role) public virtual {
        address msgSender = _msgSender();
        renounceRole(role, msgSender);
    }

    function transferOwnership(address newOwner) public virtual {
        address msgSender = _msgSender();
        grantRole(DEFAULT_ADMIN_ROLE, newOwner);
        renounceRole(DEFAULT_ADMIN_ROLE, msgSender);
    }

    modifier onlyMaintainer() {
        address msgSender = _msgSender();
        require(hasRole(MAINTAINER_ROLE, msgSender), "Maintainable: Caller is not a maintainer");
        _;
    }
}
          

/

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

import "./IERC20.sol";

interface IWETH is IERC20 {
    function withdraw(uint256 amount) external;

    function deposit() external payable;
}
          

/

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


struct Query {
    address adapter;
    address tokenIn;
    address tokenOut;
    uint256 amountOut;
}
struct Offer {
    bytes amounts;
    bytes adapters;
    bytes path;
    uint256 gasEstimate;
}
struct FormattedOffer {
    uint256[] amounts;
    address[] adapters;
    address[] path;
    uint256 gasEstimate;
}
struct Trade {
    uint256 amountIn;
    uint256 amountOut;
    address[] path;
    address[] adapters;
}

struct HopAdapterAllocation {
    address adapter;
    uint256 amountIn;
}

struct HopAllocation {
    address tokenIn;
    address tokenOut;
    HopAdapterAllocation[] legs;
}

struct RouteAllocation {
    uint256 amountIn;
    HopAllocation[] hops;
}

interface ISwitchRouter {

    event UpdatedAdapters(address[] _newAdapters);
    event UpdatedMinFee(uint256 _oldMinFee, uint256 _newMinFee);
    event UpdatedFeeClaimer(address _oldFeeClaimer, address _newFeeClaimer);
    event Switched(address indexed _tokenIn, address indexed _tokenOut, uint256 _amountIn, uint256 _amountOut, address _partnerAddress);
    event UpdatedFeeExempt(address indexed account, bool exempt);

    // admin
    function setAdapters(address[] memory _adapters) external;
    function setFeeClaimer(address _claimer) external;
    function setMinFee(uint256 _fee) external;
    function setFeeExempt(address account, bool exempt) external;
    function setMinFeeExempt(address account, bool exempt) external;
    function setFeeExemptBatch(address[] calldata accounts, bool[] calldata flags) external;
    function adaptersCount() external view returns (uint256);
    function ADAPTERS(uint256 index) external view returns (address);
    function MIN_FEE() external view returns (uint256);
    function MIN_FEE_EXEMPT(address account) external view returns (bool);
    function FEE_CLAIMER() external view returns (address);
    function FEE_EXEMPT(address account) external view returns (bool);

    // query

    function queryAdapter(
        uint256 _amountIn,
        address _tokenIn,
        address _tokenOut,
        uint8 _index
    ) external returns (uint256);

    function queryNoSplit(
        uint256 _amountIn,
        address _tokenIn,
        address _tokenOut,
        uint8[] calldata _options
    ) external view returns (Query memory);

    function queryNoSplit(
        uint256 _amountIn,
        address _tokenIn,
        address _tokenOut
    ) external view returns (Query memory);

    function findBestPathWithGas(
        uint256 _amountIn,
        address _tokenIn,
        address _tokenOut,
        uint256 _maxSteps,
        uint256 _gasPrice
    ) external view returns (FormattedOffer memory);

    function findBestPath(
        uint256 _amountIn,
        address _tokenIn,
        address _tokenOut,
        uint256 _maxSteps
    ) external view returns (FormattedOffer memory);

    function findBestPathRange(
        uint256 _amountIn,
        address _tokenIn,
        address _tokenOut,
        uint256 _maxSteps,
        uint256 _trustedStart,
        uint256 _trustedCount
    ) external view returns (FormattedOffer memory);

    function findBestPathRangeWithGas(
        uint256 _amountIn,
        address _tokenIn,
        address _tokenOut,
        uint256 _maxSteps,
        uint256 _gasPrice,
        uint256 _trustedStart,
        uint256 _trustedCount
    ) external view returns (FormattedOffer memory);

    function queryAdaptersRange(
        uint256 _amountIn,
        address _tokenIn,
        address _tokenOut,
        uint256 _start,
        uint256 _count
    ) external view returns (Query[] memory results);

    function quoteSplit(Trade[] calldata _trades) external view returns (uint256 totalOut);

    // Unified swap function
    function goSwitch(
        RouteAllocation[] calldata _routes,
        address _to,
        uint256 _minTotalAmountOut,
        uint256 _fee,
        bool _feeOnOutput,
        bool _unwrapOutput,
        address _partnerAddress
    ) external payable;

    // Pull-from-payer swap (only callable by the limit order contract)
    function goSwitchFrom(
        address _payer,
        RouteAllocation[] calldata _routes,
        address _to,
        uint256 _minTotalAmountOut,
        bool _unwrapOutput
    ) external;

    // Pull tokens from a payer to a recipient (only callable by the limit order contract)
    function pullTokens(
        address _token,
        address _from,
        address _to,
        uint256 _amount
    ) external;

    function LIMIT_ORDER_CONTRACT() external view returns (address);
}
          

/

// SPDX-License-Identifier: GPL-3.0-only
pragma solidity ^0.8.0;

interface ISwitchLimitOrder {
    struct LimitOrder {
        address maker;
        address tokenIn;
        address tokenOut;
        uint256 amountIn;
        uint256 minAmountOut;
        uint256 deadline;
        uint256 nonce;
        bool feeOnOutput;
        address recipient;
        bool unwrapOutput;
        address partnerAddress;
    }

    function placeOrder(LimitOrder calldata order, bytes calldata signature) external;
}
          

/

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

interface IERC20 {
    event Approval(address, address, uint256);
    event Transfer(address, address, uint256);

    function name() external view returns (string memory);

    function decimals() external view returns (uint8);

    function transferFrom(
        address,
        address,
        uint256
    ) external returns (bool);

    function allowance(address, address) external view returns (uint256);

    function approve(address, uint256) external returns (bool);

    function transfer(address, uint256) external returns (bool);

    function balanceOf(address) external view returns (uint256);

    function nonces(address) external view returns (uint256); // Only tokens that support permit

    function permit(
        address,
        address,
        uint256,
        uint256,
        uint8,
        bytes32,
        bytes32
    ) external; // Only tokens that support permit

    function swap(address, uint256) external; // Only Avalanche bridge tokens

    function swapSupply(address) external view returns (uint256); // Only Avalanche bridge tokens

    function totalSupply() external view returns (uint256);
}
          

/

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

/**
 * @dev Interface for ERC-1271: Standard Signature Validation Method for Contracts.
 *      See https://eips.ethereum.org/EIPS/eip-1271
 */
interface IERC1271 {
    /**
     * @dev Returns `0x1626ba7e` if the signature is valid for the given hash.
     */
    function isValidSignature(
        bytes32 hash,
        bytes calldata signature
    ) external view returns (bytes4);
}
          

/math/SignedMath.sol

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

pragma solidity ^0.8.0;

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

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

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

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

/math/Math.sol

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/Strings.sol

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

/Context.sol

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

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}
          

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

/IAccessControl.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)

pragma solidity ^0.8.0;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {AccessControl-_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) external;
}
          

/AccessControl.sol

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

pragma solidity ^0.8.0;

import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```solidity
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```solidity
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}
 * to enforce additional security measures for this role.
 */
abstract contract AccessControl is Context, IAccessControl, ERC165 {
    struct RoleData {
        mapping(address => bool) members;
        bytes32 adminRole;
    }

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with a standardized message including the required role.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     *
     * _Available since v4.1._
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role);
        _;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view virtual override returns (bool) {
        return _roles[role].members[account];
    }

    /**
     * @dev Revert with a standard message if `_msgSender()` is missing `role`.
     * Overriding this function changes the behavior of the {onlyRole} modifier.
     *
     * Format of the revert message is described in {_checkRole}.
     *
     * _Available since v4.6._
     */
    function _checkRole(bytes32 role) internal view virtual {
        _checkRole(role, _msgSender());
    }

    /**
     * @dev Revert with a standard message if `account` is missing `role`.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     */
    function _checkRole(bytes32 role, address account) internal view virtual {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        Strings.toHexString(account),
                        " is missing role ",
                        Strings.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleGranted} event.
     */
    function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleRevoked} event.
     */
    function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been revoked `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     *
     * May emit a {RoleRevoked} event.
     */
    function renounceRole(bytes32 role, address account) public virtual override {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * May emit a {RoleGranted} event.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     *
     * NOTE: This function is deprecated in favor of {_grantRole}.
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        bytes32 previousAdminRole = getRoleAdmin(role);
        _roles[role].adminRole = adminRole;
        emit RoleAdminChanged(role, previousAdminRole, adminRole);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleGranted} event.
     */
    function _grantRole(bytes32 role, address account) internal virtual {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleRevoked} event.
     */
    function _revokeRole(bytes32 role, address account) internal virtual {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}
          

/

// This is a simplified version of OpenZepplin's SafeERC20 library
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
pragma experimental ABIEncoderV2;

import "../interface/IERC20.sol";

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

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        // solhint-disable-next-line max-line-length
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

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

        // A Solidity high level call has three parts:
        //  1. The target address is checked to verify it contains contract code
        //  2. The call itself is made, and success asserted
        //  3. The return value is decoded, which in turn checks the size of the returned data.
        // solhint-disable-next-line max-line-length

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = address(token).call(data);
        require(success, "SafeERC20: low-level call failed");

        if (returndata.length > 0) {
            // Return data is optional
            // solhint-disable-next-line max-line-length
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}
          

Compiler Settings

{"remappings":[":@openzeppelin/contracts/=dependencies/openzeppelin-contracts/contracts/",":ds-test/=dependencies/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/",":erc4626-tests/=dependencies/openzeppelin-contracts/lib/erc4626-tests/",":forge-std/=dependencies/forge-std/src/",":openzeppelin-contracts/=dependencies/openzeppelin-contracts/",":openzeppelin/=dependencies/openzeppelin-contracts/contracts/"],"optimizer":{"runs":999,"enabled":true},"metadata":{"bytecodeHash":"ipfs"},"libraries":{},"evmVersion":"shanghai","compilationTarget":{"src/SwitchPLSFlow.sol":"SwitchPLSFlow"}}
              

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_switchLimitOrder","internalType":"address"},{"type":"address","name":"_switchRouter","internalType":"address"},{"type":"address","name":"_wnative","internalType":"address"}]},{"type":"error","name":"InvalidToken","inputs":[]},{"type":"error","name":"NotOrderOwner","inputs":[]},{"type":"error","name":"OrderNotActive","inputs":[]},{"type":"error","name":"TransferFailed","inputs":[]},{"type":"error","name":"ZeroAmount","inputs":[]},{"type":"event","name":"PLSOrderCancelled","inputs":[{"type":"address","name":"originalMaker","internalType":"address","indexed":true},{"type":"uint256","name":"nonce","internalType":"uint256","indexed":true},{"type":"uint256","name":"refundAmount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"PLSOrderCreated","inputs":[{"type":"address","name":"originalMaker","internalType":"address","indexed":true},{"type":"uint256","name":"nonce","internalType":"uint256","indexed":true},{"type":"address","name":"tokenOut","internalType":"address","indexed":false},{"type":"uint256","name":"amountIn","internalType":"uint256","indexed":false},{"type":"uint256","name":"minAmountOut","internalType":"uint256","indexed":false},{"type":"uint256","name":"deadline","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"RoleAdminChanged","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32","indexed":true},{"type":"bytes32","name":"previousAdminRole","internalType":"bytes32","indexed":true},{"type":"bytes32","name":"newAdminRole","internalType":"bytes32","indexed":true}],"anonymous":false},{"type":"event","name":"RoleGranted","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32","indexed":true},{"type":"address","name":"account","internalType":"address","indexed":true},{"type":"address","name":"sender","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"RoleRevoked","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32","indexed":true},{"type":"address","name":"account","internalType":"address","indexed":true},{"type":"address","name":"sender","internalType":"address","indexed":true}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"DEFAULT_ADMIN_ROLE","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"LIMIT_ORDER_DOMAIN_SEPARATOR","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"LIMIT_ORDER_TYPEHASH","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"MAINTAINER_ROLE","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"SWITCH_LIMIT_ORDER","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"SWITCH_ROUTER","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"WNATIVE","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addMaintainer","inputs":[{"type":"address","name":"addedMaintainer","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"cancelOrder","inputs":[{"type":"uint256","name":"nonce","internalType":"uint256"}]},{"type":"function","stateMutability":"payable","outputs":[{"type":"uint256","name":"nonce","internalType":"uint256"}],"name":"createOrder","inputs":[{"type":"address","name":"tokenOut","internalType":"address"},{"type":"uint256","name":"minAmountOut","internalType":"uint256"},{"type":"uint256","name":"deadline","internalType":"uint256"},{"type":"bool","name":"feeOnOutput","internalType":"bool"},{"type":"bool","name":"unwrapOutput","internalType":"bool"},{"type":"address","name":"partnerAddress","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getGlobalNonce","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple","name":"","internalType":"struct SwitchPLSFlow.PLSOrder","components":[{"type":"address","name":"originalMaker","internalType":"address"},{"type":"address","name":"tokenOut","internalType":"address"},{"type":"uint256","name":"amountIn","internalType":"uint256"},{"type":"uint256","name":"minAmountOut","internalType":"uint256"},{"type":"uint256","name":"deadline","internalType":"uint256"},{"type":"bool","name":"feeOnOutput","internalType":"bool"},{"type":"bool","name":"unwrapOutput","internalType":"bool"},{"type":"bool","name":"active","internalType":"bool"},{"type":"address","name":"partnerAddress","internalType":"address"}]}],"name":"getOrder","inputs":[{"type":"uint256","name":"nonce","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"getRoleAdmin","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"globalNonceCounter","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"grantRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"hasRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes4","name":"","internalType":"bytes4"}],"name":"isValidSignature","inputs":[{"type":"bytes32","name":"hash","internalType":"bytes32"},{"type":"bytes","name":"signature","internalType":"bytes"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"originalMaker","internalType":"address"},{"type":"address","name":"tokenOut","internalType":"address"},{"type":"uint256","name":"amountIn","internalType":"uint256"},{"type":"uint256","name":"minAmountOut","internalType":"uint256"},{"type":"uint256","name":"deadline","internalType":"uint256"},{"type":"bool","name":"feeOnOutput","internalType":"bool"},{"type":"bool","name":"unwrapOutput","internalType":"bool"},{"type":"bool","name":"active","internalType":"bool"},{"type":"address","name":"partnerAddress","internalType":"address"}],"name":"orders","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"recoverNative","inputs":[{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"recoverTokens","inputs":[{"type":"address","name":"_token","internalType":"address"},{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"removeMaintainer","inputs":[{"type":"address","name":"removedMaintainer","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"revokeRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"supportsInterface","inputs":[{"type":"bytes4","name":"interfaceId","internalType":"bytes4"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"validOrderDigests","inputs":[{"type":"bytes32","name":"","internalType":"bytes32"}]},{"type":"receive","stateMutability":"payable"}]
              

Contract Creation Code

0x61010060405234801562000011575f80fd5b50604051620024d6380380620024d6833981016040819052620000349162000427565b33620000415f826200035d565b6200006d7f339759585899103d2ace64958e37e18ccb0504652c81d4a1b8aa80fe2126ab95826200035d565b50600180556001600160a01b038316620000ce5760405162461bcd60e51b815260206004820152601360248201527f496e76616c6964206c696d6974206f726465720000000000000000000000000060448201526064015b60405180910390fd5b6001600160a01b038216620001175760405162461bcd60e51b815260206004820152600e60248201526d24b73b30b634b2103937baba32b960911b6044820152606401620000c5565b6001600160a01b038116620001615760405162461bcd60e51b815260206004820152600f60248201526e496e76616c696420574e415449564560881b6044820152606401620000c5565b6001600160a01b0380841660805282811660a052811660c052604080518082018252601081526f29bbb4ba31b42634b6b4ba27b93232b960811b6020918201528151808301835260018152601960f91b90820152905162000253917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f917fe62cbe700c929b45302bc06029a85badee409414151f470b59ef18975112456b917fad7c5bef027816a800da1736444fb58a807ef4c9603b7848673f7e3a68eb14a59146918991019485526020850193909352604084019190915260608301526001600160a01b0316608082015260a00190565b60408051808303601f1901815290829052805160209091012060e05263095ea7b360e01b81526001600160a01b0384811660048301525f19602483015282169063095ea7b3906044016020604051808303815f875af1158015620002b9573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190620002df91906200046e565b5060405163095ea7b360e01b81526001600160a01b0383811660048301525f19602483015282169063095ea7b3906044016020604051808303815f875af11580156200032d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906200035391906200046e565b5050505062000496565b6200036982826200036d565b5050565b5f828152602081815260408083206001600160a01b038516845290915290205460ff1662000369575f828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620003c73390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b80516001600160a01b038116811462000422575f80fd5b919050565b5f805f606084860312156200043a575f80fd5b62000445846200040b565b925062000455602085016200040b565b915062000465604085016200040b565b90509250925092565b5f602082840312156200047f575f80fd5b815180151581146200048f575f80fd5b9392505050565b60805160a05160c05160e051611fbf620005175f395f81816106a001528181610b2e01526111d201525f818161050b01528181610a8201528181610bc101528181610c7501528181610e2701528181610e6b01528181610ee101528181611106015261123e01525f61075801525f81816106f201526112de0152611fbf5ff3fe6080604052600436106101a7575f3560e01c806392163b4b116100e7578063d547741f11610087578063f2fde38b11610062578063f2fde38b146106c2578063f7742bde146106e1578063f874225414610714578063fc4a2bca14610747575f80fd5b8063d547741f14610651578063d8baf7cf14610670578063f2e48d2f1461068f575f80fd5b8063aa055086116100c2578063aa055086146104c8578063aede3693146104db578063b381cf40146104fa578063d09ef24114610545575f80fd5b806392163b4b146103ce578063a217fddf146103e2578063a85c38ef146103f5575f80fd5b8063514fcac7116101525780636c879b151161012d5780636c879b151461032a578063837a6ee2146103585780638bb9c5bf1461036d57806391d148541461038c575f80fd5b8063514fcac7146102b957806354dd5f74146102d85780636b453c1f1461030b575f80fd5b8063248a9ca311610182578063248a9ca31461023f5780632f2ff15d1461027b57806336568abe1461029a575f80fd5b806301ffc9a7146101b2578063069c9fae146101e65780631626ba7e14610207575f80fd5b366101ae57005b5f80fd5b3480156101bd575f80fd5b506101d16101cc366004611ac7565b61077a565b60405190151581526020015b60405180910390f35b3480156101f1575f80fd5b50610205610200366004611b09565b6107e2565b005b348015610212575f80fd5b50610226610221366004611b31565b61088e565b6040516001600160e01b031990911681526020016101dd565b34801561024a575f80fd5b5061026d610259366004611ba6565b5f9081526020819052604090206001015490565b6040519081526020016101dd565b348015610286575f80fd5b50610205610295366004611bbd565b6108d5565b3480156102a5575f80fd5b506102056102b4366004611bbd565b6108f9565b3480156102c4575f80fd5b506102056102d3366004611ba6565b610985565b3480156102e3575f80fd5b5061026d7fccb76b500ea7c6e283a0d8452ef3953b5ef22b66ec9fc9cfcf16c278cc0c621081565b348015610316575f80fd5b50610205610325366004611be7565b610d9d565b348015610335575f80fd5b506101d1610344366004611ba6565b60036020525f908152604090205460ff1681565b348015610363575f80fd5b5061026d60045481565b348015610378575f80fd5b50610205610387366004611ba6565b610dc7565b348015610397575f80fd5b506101d16103a6366004611bbd565b5f918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b3480156103d9575f80fd5b5060045461026d565b3480156103ed575f80fd5b5061026d5f81565b348015610400575f80fd5b5061047261040f366004611ba6565b600260208190525f91825260409091208054600182015492820154600383015460048401546005909401546001600160a01b0393841695841694929391929160ff8083169261010081048216926201000082049092169163010000009091041689565b604080516001600160a01b039a8b168152988a1660208a015288019690965260608701949094526080860192909252151560a0850152151560c0840152151560e0830152909116610100820152610120016101dd565b61026d6104d6366004611c0d565b610dd2565b3480156104e6575f80fd5b506102056104f5366004611ba6565b6113a9565b348015610505575f80fd5b5061052d7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101dd565b348015610550575f80fd5b5061064461055f366004611ba6565b60408051610120810182525f80825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052610100810191909152505f9081526002602081815260409283902083516101208101855281546001600160a01b03908116825260018301548116938201939093529281015493830193909352600383015460608301526004830154608083015260059092015460ff808216151560a08401526101008083048216151560c0850152620100008304909116151560e084015263010000009091049092169181019190915290565b6040516101dd9190611c73565b34801561065c575f80fd5b5061020561066b366004611bbd565b6114cc565b34801561067b575f80fd5b5061020561068a366004611be7565b6114f0565b34801561069a575f80fd5b5061026d7f000000000000000000000000000000000000000000000000000000000000000081565b3480156106cd575f80fd5b506102056106dc366004611be7565b61151a565b3480156106ec575f80fd5b5061052d7f000000000000000000000000000000000000000000000000000000000000000081565b34801561071f575f80fd5b5061026d7f339759585899103d2ace64958e37e18ccb0504652c81d4a1b8aa80fe2126ab9581565b348015610752575f80fd5b5061052d7f000000000000000000000000000000000000000000000000000000000000000081565b5f6001600160e01b031982167f7965db0b0000000000000000000000000000000000000000000000000000000014806107dc57507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316145b92915050565b335f8181527fa54247010af6b3693b80aceddfad12e077c5de3571e6243fada502635f0d7d39602052604090205460ff166108755760405162461bcd60e51b815260206004820152602860248201527f4d61696e7461696e61626c653a2043616c6c6572206973206e6f742061206d6160448201526734b73a30b4b732b960c11b60648201526084015b60405180910390fd5b6108896001600160a01b038416338461152f565b505050565b5f8381526003602052604081205460ff16156108cb57507f1626ba7e000000000000000000000000000000000000000000000000000000006108ce565b505f5b9392505050565b5f828152602081905260409020600101546108ef816115af565b61088983836115b9565b6001600160a01b03811633146109775760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161086c565b6109818282611655565b5050565b61098d6116d2565b5f818152600260205260409020600581015462010000900460ff166109de576040517f1d4ecc5b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80546001600160a01b03163314610a21576040517ff6412b5a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60058101805462ff0000198116918290556001830154600284015460038501546004860154604080517fccb76b500ea7c6e283a0d8452ef3953b5ef22b66ec9fc9cfcf16c278cc0c6210602082015230918101919091526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166060830152948516608082015260a081019390935260c083019190915260e082015261010080820187905260ff9384161515610120830152336101408301528404909216151561016083015263010000009092049091166101808201525f906101a00160408051601f1981840301815290829052805160209182012061190160f01b918301919091527f000000000000000000000000000000000000000000000000000000000000000060228301526042820181905291505f9060620160408051808303601f1901815282825280516020918201205f8181526003909252918120805460ff1916905560028601547f70a0823100000000000000000000000000000000000000000000000000000000845230600485015291935090917f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015610c0e573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610c329190611d08565b905080821115610c40578091505b8115610d55576040517f2e1a7d4d000000000000000000000000000000000000000000000000000000008152600481018390527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690632e1a7d4d906024015f604051808303815f87803b158015610cbe575f80fd5b505af1158015610cd0573d5f803e3d5ffd5b50506040515f925033915084908381818185875af1925050503d805f8114610d13576040519150601f19603f3d011682016040523d82523d5f602084013e610d18565b606091505b5050905080610d53576040517f90b8ec1800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505b604051828152869033907f188951e7eee0ea12a9b74aa8aebdcc3deb0476c87fa3024c013b1c3210f87fb29060200160405180910390a35050505050610d9a60018055565b50565b610d9a7f339759585899103d2ace64958e37e18ccb0504652c81d4a1b8aa80fe2126ab95826108d5565b3361098182826108f9565b5f610ddb6116d2565b345f03610e14576040517f1f2a200500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0387161580610e6457507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316876001600160a01b0316148015610e64575082155b15610edf577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316876001600160a01b0316148015610ea8575082155b15610edf576040517fc1ab6dc100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004015f604051808303818588803b158015610f38575f80fd5b505af1158015610f4a573d5f803e3d5ffd5b505060048054935091505f9050610f6083611d33565b9190505590505f339050604051806101200160405280336001600160a01b03168152602001896001600160a01b0316815260200134815260200188815260200187815260200186151581526020018515158152602001600115158152602001846001600160a01b031681525060025f8481526020019081526020015f205f820151815f015f6101000a8154816001600160a01b0302191690836001600160a01b031602179055506020820151816001015f6101000a8154816001600160a01b0302191690836001600160a01b0316021790555060408201518160020155606082015181600301556080820151816004015560a0820151816005015f6101000a81548160ff02191690831515021790555060c08201518160050160016101000a81548160ff02191690831515021790555060e08201518160050160026101000a81548160ff0219169083151502179055506101008201518160050160036101000a8154816001600160a01b0302191690836001600160a01b031602179055509050505f7fccb76b500ea7c6e283a0d8452ef3953b5ef22b66ec9fc9cfcf16c278cc0c6210307f00000000000000000000000000000000000000000000000000000000000000008b348c8c898d8a8e8e6040516020016111aa9c9b9a999897969594939291909b8c526001600160a01b039a8b1660208d0152988a1660408c015296891660608b015260808a019590955260a089019390935260c088019190915260e0870152151561010086015283166101208501521515610140840152166101608201526101800190565b60408051601f1981840301815290829052805160209182012061190160f01b918301919091527f000000000000000000000000000000000000000000000000000000000000000060228301526042820181905291505f9060620160408051601f1981840301815282825280516020918201205f81815260038352839020805460ff19166001179055610160840183523084527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03908116928501929092528d821684840152346060850152608084018d905260a084018c905260c084018890528a151560e085015286821661010085015289151561012085015288821661014085015291517fa8b5aaf40000000000000000000000000000000000000000000000000000000081529193507f0000000000000000000000000000000000000000000000000000000000000000169163a8b5aaf4916113129190600401611d4b565b5f604051808303815f87803b158015611329575f80fd5b505af115801561133b573d5f803e3d5ffd5b5050604080516001600160a01b038e1681523460208201529081018c9052606081018b90528692503391507f82ef01d3363c17d25610477396722762f9d330000c99ed458b3ef17200a316199060800160405180910390a350505061139f60018055565b9695505050505050565b335f8181527fa54247010af6b3693b80aceddfad12e077c5de3571e6243fada502635f0d7d39602052604090205460ff166114375760405162461bcd60e51b815260206004820152602860248201527f4d61696e7461696e61626c653a2043616c6c6572206973206e6f742061206d6160448201526734b73a30b4b732b960c11b606482015260840161086c565b6040515f90339084908381818185875af1925050503d805f8114611476576040519150601f19603f3d011682016040523d82523d5f602084013e61147b565b606091505b50509050806108895760405162461bcd60e51b815260206004820152601660248201527f4e6174697665207472616e73666572206661696c656400000000000000000000604482015260640161086c565b5f828152602081905260409020600101546114e6816115af565b6108898383611655565b610d9a7f339759585899103d2ace64958e37e18ccb0504652c81d4a1b8aa80fe2126ab95826114cc565b336115255f836108d5565b6109815f826108f9565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb0000000000000000000000000000000000000000000000000000000017905261088990849061172b565b610d9a8133611868565b5f828152602081815260408083206001600160a01b038516845290915290205460ff16610981575f828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556116113390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b5f828152602081815260408083206001600160a01b038516845290915290205460ff1615610981575f828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6002600154036117245760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161086c565b6002600155565b5f80836001600160a01b0316836040516117459190611e3a565b5f604051808303815f865af19150503d805f811461177e576040519150601f19603f3d011682016040523d82523d5f602084013e611783565b606091505b5091509150816117d55760405162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015260640161086c565b80511561186257808060200190518101906117f09190611e55565b6118625760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f74207375636365656400000000000000000000000000000000000000000000606482015260840161086c565b50505050565b5f828152602081815260408083206001600160a01b038516845290915290205460ff1661098157611898816118da565b6118a38360206118ec565b6040516020016118b4929190611e70565b60408051601f198184030181529082905262461bcd60e51b825261086c91600401611ef0565b60606107dc6001600160a01b03831660145b60605f6118fa836002611f22565b611905906002611f39565b67ffffffffffffffff81111561191d5761191d611f4c565b6040519080825280601f01601f191660200182016040528015611947576020820181803683370190505b5090507f3000000000000000000000000000000000000000000000000000000000000000815f8151811061197d5761197d611f60565b60200101906001600160f81b03191690815f1a9053507f7800000000000000000000000000000000000000000000000000000000000000816001815181106119c7576119c7611f60565b60200101906001600160f81b03191690815f1a9053505f6119e9846002611f22565b6119f4906001611f39565b90505b6001811115611a78577f303132333435363738396162636465660000000000000000000000000000000085600f1660108110611a3557611a35611f60565b1a60f81b828281518110611a4b57611a4b611f60565b60200101906001600160f81b03191690815f1a90535060049490941c93611a7181611f74565b90506119f7565b5083156108ce5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161086c565b5f60208284031215611ad7575f80fd5b81356001600160e01b0319811681146108ce575f80fd5b80356001600160a01b0381168114611b04575f80fd5b919050565b5f8060408385031215611b1a575f80fd5b611b2383611aee565b946020939093013593505050565b5f805f60408486031215611b43575f80fd5b83359250602084013567ffffffffffffffff80821115611b61575f80fd5b818601915086601f830112611b74575f80fd5b813581811115611b82575f80fd5b876020828501011115611b93575f80fd5b6020830194508093505050509250925092565b5f60208284031215611bb6575f80fd5b5035919050565b5f8060408385031215611bce575f80fd5b82359150611bde60208401611aee565b90509250929050565b5f60208284031215611bf7575f80fd5b6108ce82611aee565b8015158114610d9a575f80fd5b5f805f805f8060c08789031215611c22575f80fd5b611c2b87611aee565b955060208701359450604087013593506060870135611c4981611c00565b92506080870135611c5981611c00565b9150611c6760a08801611aee565b90509295509295509295565b5f610120820190506001600160a01b038084511683528060208501511660208401525060408301516040830152606083015160608301526080830151608083015260a0830151611cc760a084018215159052565b5060c0830151611cdb60c084018215159052565b5060e0830151611cef60e084018215159052565b50610100928301516001600160a01b0316919092015290565b5f60208284031215611d18575f80fd5b5051919050565b634e487b7160e01b5f52601160045260245ffd5b5f60018201611d4457611d44611d1f565b5060010190565b81516001600160a01b031681525f6101806020840151611d7660208501826001600160a01b03169052565b506040840151611d9160408501826001600160a01b03169052565b50606084015160608401526080840151608084015260a084015160a084015260c084015160c084015260e0840151611dcd60e085018215159052565b50610100848101516001600160a01b0390811691850191909152610120808601511515908501526101409485015116938301939093525061016081018290525f910190815260200190565b5f5b83811015611e32578181015183820152602001611e1a565b50505f910152565b5f8251611e4b818460208701611e18565b9190910192915050565b5f60208284031215611e65575f80fd5b81516108ce81611c00565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081525f8351611ea7816017850160208801611e18565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611ee4816028840160208801611e18565b01602801949350505050565b602081525f8251806020840152611f0e816040850160208701611e18565b601f01601f19169190910160400192915050565b80820281158282048414176107dc576107dc611d1f565b808201808211156107dc576107dc611d1f565b634e487b7160e01b5f52604160045260245ffd5b634e487b7160e01b5f52603260045260245ffd5b5f81611f8257611f82611d1f565b505f19019056fea2646970667358221220971b4a02dcae525f70be7bb1a97e405cb9a89b6d2a960c1151b7773349d8173364736f6c6343000814003300000000000000000000000079925587be77c25b292c0eca6fedd3a3f07916f900000000000000000000000099999d19ec98f936934e029e63d1c0a127a15207000000000000000000000000a1077a294dde1b09bb078844df40758a5d0f9a27

Deployed ByteCode

0x6080604052600436106101a7575f3560e01c806392163b4b116100e7578063d547741f11610087578063f2fde38b11610062578063f2fde38b146106c2578063f7742bde146106e1578063f874225414610714578063fc4a2bca14610747575f80fd5b8063d547741f14610651578063d8baf7cf14610670578063f2e48d2f1461068f575f80fd5b8063aa055086116100c2578063aa055086146104c8578063aede3693146104db578063b381cf40146104fa578063d09ef24114610545575f80fd5b806392163b4b146103ce578063a217fddf146103e2578063a85c38ef146103f5575f80fd5b8063514fcac7116101525780636c879b151161012d5780636c879b151461032a578063837a6ee2146103585780638bb9c5bf1461036d57806391d148541461038c575f80fd5b8063514fcac7146102b957806354dd5f74146102d85780636b453c1f1461030b575f80fd5b8063248a9ca311610182578063248a9ca31461023f5780632f2ff15d1461027b57806336568abe1461029a575f80fd5b806301ffc9a7146101b2578063069c9fae146101e65780631626ba7e14610207575f80fd5b366101ae57005b5f80fd5b3480156101bd575f80fd5b506101d16101cc366004611ac7565b61077a565b60405190151581526020015b60405180910390f35b3480156101f1575f80fd5b50610205610200366004611b09565b6107e2565b005b348015610212575f80fd5b50610226610221366004611b31565b61088e565b6040516001600160e01b031990911681526020016101dd565b34801561024a575f80fd5b5061026d610259366004611ba6565b5f9081526020819052604090206001015490565b6040519081526020016101dd565b348015610286575f80fd5b50610205610295366004611bbd565b6108d5565b3480156102a5575f80fd5b506102056102b4366004611bbd565b6108f9565b3480156102c4575f80fd5b506102056102d3366004611ba6565b610985565b3480156102e3575f80fd5b5061026d7fccb76b500ea7c6e283a0d8452ef3953b5ef22b66ec9fc9cfcf16c278cc0c621081565b348015610316575f80fd5b50610205610325366004611be7565b610d9d565b348015610335575f80fd5b506101d1610344366004611ba6565b60036020525f908152604090205460ff1681565b348015610363575f80fd5b5061026d60045481565b348015610378575f80fd5b50610205610387366004611ba6565b610dc7565b348015610397575f80fd5b506101d16103a6366004611bbd565b5f918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b3480156103d9575f80fd5b5060045461026d565b3480156103ed575f80fd5b5061026d5f81565b348015610400575f80fd5b5061047261040f366004611ba6565b600260208190525f91825260409091208054600182015492820154600383015460048401546005909401546001600160a01b0393841695841694929391929160ff8083169261010081048216926201000082049092169163010000009091041689565b604080516001600160a01b039a8b168152988a1660208a015288019690965260608701949094526080860192909252151560a0850152151560c0840152151560e0830152909116610100820152610120016101dd565b61026d6104d6366004611c0d565b610dd2565b3480156104e6575f80fd5b506102056104f5366004611ba6565b6113a9565b348015610505575f80fd5b5061052d7f000000000000000000000000a1077a294dde1b09bb078844df40758a5d0f9a2781565b6040516001600160a01b0390911681526020016101dd565b348015610550575f80fd5b5061064461055f366004611ba6565b60408051610120810182525f80825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052610100810191909152505f9081526002602081815260409283902083516101208101855281546001600160a01b03908116825260018301548116938201939093529281015493830193909352600383015460608301526004830154608083015260059092015460ff808216151560a08401526101008083048216151560c0850152620100008304909116151560e084015263010000009091049092169181019190915290565b6040516101dd9190611c73565b34801561065c575f80fd5b5061020561066b366004611bbd565b6114cc565b34801561067b575f80fd5b5061020561068a366004611be7565b6114f0565b34801561069a575f80fd5b5061026d7f2d065ceb108e6c2017760dbddefc525eb80ef062da45e717c8b000118f34ce3e81565b3480156106cd575f80fd5b506102056106dc366004611be7565b61151a565b3480156106ec575f80fd5b5061052d7f00000000000000000000000079925587be77c25b292c0eca6fedd3a3f07916f981565b34801561071f575f80fd5b5061026d7f339759585899103d2ace64958e37e18ccb0504652c81d4a1b8aa80fe2126ab9581565b348015610752575f80fd5b5061052d7f00000000000000000000000099999d19ec98f936934e029e63d1c0a127a1520781565b5f6001600160e01b031982167f7965db0b0000000000000000000000000000000000000000000000000000000014806107dc57507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316145b92915050565b335f8181527fa54247010af6b3693b80aceddfad12e077c5de3571e6243fada502635f0d7d39602052604090205460ff166108755760405162461bcd60e51b815260206004820152602860248201527f4d61696e7461696e61626c653a2043616c6c6572206973206e6f742061206d6160448201526734b73a30b4b732b960c11b60648201526084015b60405180910390fd5b6108896001600160a01b038416338461152f565b505050565b5f8381526003602052604081205460ff16156108cb57507f1626ba7e000000000000000000000000000000000000000000000000000000006108ce565b505f5b9392505050565b5f828152602081905260409020600101546108ef816115af565b61088983836115b9565b6001600160a01b03811633146109775760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161086c565b6109818282611655565b5050565b61098d6116d2565b5f818152600260205260409020600581015462010000900460ff166109de576040517f1d4ecc5b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80546001600160a01b03163314610a21576040517ff6412b5a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60058101805462ff0000198116918290556001830154600284015460038501546004860154604080517fccb76b500ea7c6e283a0d8452ef3953b5ef22b66ec9fc9cfcf16c278cc0c6210602082015230918101919091526001600160a01b037f000000000000000000000000a1077a294dde1b09bb078844df40758a5d0f9a2781166060830152948516608082015260a081019390935260c083019190915260e082015261010080820187905260ff9384161515610120830152336101408301528404909216151561016083015263010000009092049091166101808201525f906101a00160408051601f1981840301815290829052805160209182012061190160f01b918301919091527f2d065ceb108e6c2017760dbddefc525eb80ef062da45e717c8b000118f34ce3e60228301526042820181905291505f9060620160408051808303601f1901815282825280516020918201205f8181526003909252918120805460ff1916905560028601547f70a0823100000000000000000000000000000000000000000000000000000000845230600485015291935090917f000000000000000000000000a1077a294dde1b09bb078844df40758a5d0f9a276001600160a01b0316906370a0823190602401602060405180830381865afa158015610c0e573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610c329190611d08565b905080821115610c40578091505b8115610d55576040517f2e1a7d4d000000000000000000000000000000000000000000000000000000008152600481018390527f000000000000000000000000a1077a294dde1b09bb078844df40758a5d0f9a276001600160a01b031690632e1a7d4d906024015f604051808303815f87803b158015610cbe575f80fd5b505af1158015610cd0573d5f803e3d5ffd5b50506040515f925033915084908381818185875af1925050503d805f8114610d13576040519150601f19603f3d011682016040523d82523d5f602084013e610d18565b606091505b5050905080610d53576040517f90b8ec1800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505b604051828152869033907f188951e7eee0ea12a9b74aa8aebdcc3deb0476c87fa3024c013b1c3210f87fb29060200160405180910390a35050505050610d9a60018055565b50565b610d9a7f339759585899103d2ace64958e37e18ccb0504652c81d4a1b8aa80fe2126ab95826108d5565b3361098182826108f9565b5f610ddb6116d2565b345f03610e14576040517f1f2a200500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0387161580610e6457507f000000000000000000000000a1077a294dde1b09bb078844df40758a5d0f9a276001600160a01b0316876001600160a01b0316148015610e64575082155b15610edf577f000000000000000000000000a1077a294dde1b09bb078844df40758a5d0f9a276001600160a01b0316876001600160a01b0316148015610ea8575082155b15610edf576040517fc1ab6dc100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000a1077a294dde1b09bb078844df40758a5d0f9a276001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004015f604051808303818588803b158015610f38575f80fd5b505af1158015610f4a573d5f803e3d5ffd5b505060048054935091505f9050610f6083611d33565b9190505590505f339050604051806101200160405280336001600160a01b03168152602001896001600160a01b0316815260200134815260200188815260200187815260200186151581526020018515158152602001600115158152602001846001600160a01b031681525060025f8481526020019081526020015f205f820151815f015f6101000a8154816001600160a01b0302191690836001600160a01b031602179055506020820151816001015f6101000a8154816001600160a01b0302191690836001600160a01b0316021790555060408201518160020155606082015181600301556080820151816004015560a0820151816005015f6101000a81548160ff02191690831515021790555060c08201518160050160016101000a81548160ff02191690831515021790555060e08201518160050160026101000a81548160ff0219169083151502179055506101008201518160050160036101000a8154816001600160a01b0302191690836001600160a01b031602179055509050505f7fccb76b500ea7c6e283a0d8452ef3953b5ef22b66ec9fc9cfcf16c278cc0c6210307f000000000000000000000000a1077a294dde1b09bb078844df40758a5d0f9a278b348c8c898d8a8e8e6040516020016111aa9c9b9a999897969594939291909b8c526001600160a01b039a8b1660208d0152988a1660408c015296891660608b015260808a019590955260a089019390935260c088019190915260e0870152151561010086015283166101208501521515610140840152166101608201526101800190565b60408051601f1981840301815290829052805160209182012061190160f01b918301919091527f2d065ceb108e6c2017760dbddefc525eb80ef062da45e717c8b000118f34ce3e60228301526042820181905291505f9060620160408051601f1981840301815282825280516020918201205f81815260038352839020805460ff19166001179055610160840183523084527f000000000000000000000000a1077a294dde1b09bb078844df40758a5d0f9a276001600160a01b03908116928501929092528d821684840152346060850152608084018d905260a084018c905260c084018890528a151560e085015286821661010085015289151561012085015288821661014085015291517fa8b5aaf40000000000000000000000000000000000000000000000000000000081529193507f00000000000000000000000079925587be77c25b292c0eca6fedd3a3f07916f9169163a8b5aaf4916113129190600401611d4b565b5f604051808303815f87803b158015611329575f80fd5b505af115801561133b573d5f803e3d5ffd5b5050604080516001600160a01b038e1681523460208201529081018c9052606081018b90528692503391507f82ef01d3363c17d25610477396722762f9d330000c99ed458b3ef17200a316199060800160405180910390a350505061139f60018055565b9695505050505050565b335f8181527fa54247010af6b3693b80aceddfad12e077c5de3571e6243fada502635f0d7d39602052604090205460ff166114375760405162461bcd60e51b815260206004820152602860248201527f4d61696e7461696e61626c653a2043616c6c6572206973206e6f742061206d6160448201526734b73a30b4b732b960c11b606482015260840161086c565b6040515f90339084908381818185875af1925050503d805f8114611476576040519150601f19603f3d011682016040523d82523d5f602084013e61147b565b606091505b50509050806108895760405162461bcd60e51b815260206004820152601660248201527f4e6174697665207472616e73666572206661696c656400000000000000000000604482015260640161086c565b5f828152602081905260409020600101546114e6816115af565b6108898383611655565b610d9a7f339759585899103d2ace64958e37e18ccb0504652c81d4a1b8aa80fe2126ab95826114cc565b336115255f836108d5565b6109815f826108f9565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb0000000000000000000000000000000000000000000000000000000017905261088990849061172b565b610d9a8133611868565b5f828152602081815260408083206001600160a01b038516845290915290205460ff16610981575f828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556116113390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b5f828152602081815260408083206001600160a01b038516845290915290205460ff1615610981575f828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6002600154036117245760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161086c565b6002600155565b5f80836001600160a01b0316836040516117459190611e3a565b5f604051808303815f865af19150503d805f811461177e576040519150601f19603f3d011682016040523d82523d5f602084013e611783565b606091505b5091509150816117d55760405162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015260640161086c565b80511561186257808060200190518101906117f09190611e55565b6118625760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f74207375636365656400000000000000000000000000000000000000000000606482015260840161086c565b50505050565b5f828152602081815260408083206001600160a01b038516845290915290205460ff1661098157611898816118da565b6118a38360206118ec565b6040516020016118b4929190611e70565b60408051601f198184030181529082905262461bcd60e51b825261086c91600401611ef0565b60606107dc6001600160a01b03831660145b60605f6118fa836002611f22565b611905906002611f39565b67ffffffffffffffff81111561191d5761191d611f4c565b6040519080825280601f01601f191660200182016040528015611947576020820181803683370190505b5090507f3000000000000000000000000000000000000000000000000000000000000000815f8151811061197d5761197d611f60565b60200101906001600160f81b03191690815f1a9053507f7800000000000000000000000000000000000000000000000000000000000000816001815181106119c7576119c7611f60565b60200101906001600160f81b03191690815f1a9053505f6119e9846002611f22565b6119f4906001611f39565b90505b6001811115611a78577f303132333435363738396162636465660000000000000000000000000000000085600f1660108110611a3557611a35611f60565b1a60f81b828281518110611a4b57611a4b611f60565b60200101906001600160f81b03191690815f1a90535060049490941c93611a7181611f74565b90506119f7565b5083156108ce5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161086c565b5f60208284031215611ad7575f80fd5b81356001600160e01b0319811681146108ce575f80fd5b80356001600160a01b0381168114611b04575f80fd5b919050565b5f8060408385031215611b1a575f80fd5b611b2383611aee565b946020939093013593505050565b5f805f60408486031215611b43575f80fd5b83359250602084013567ffffffffffffffff80821115611b61575f80fd5b818601915086601f830112611b74575f80fd5b813581811115611b82575f80fd5b876020828501011115611b93575f80fd5b6020830194508093505050509250925092565b5f60208284031215611bb6575f80fd5b5035919050565b5f8060408385031215611bce575f80fd5b82359150611bde60208401611aee565b90509250929050565b5f60208284031215611bf7575f80fd5b6108ce82611aee565b8015158114610d9a575f80fd5b5f805f805f8060c08789031215611c22575f80fd5b611c2b87611aee565b955060208701359450604087013593506060870135611c4981611c00565b92506080870135611c5981611c00565b9150611c6760a08801611aee565b90509295509295509295565b5f610120820190506001600160a01b038084511683528060208501511660208401525060408301516040830152606083015160608301526080830151608083015260a0830151611cc760a084018215159052565b5060c0830151611cdb60c084018215159052565b5060e0830151611cef60e084018215159052565b50610100928301516001600160a01b0316919092015290565b5f60208284031215611d18575f80fd5b5051919050565b634e487b7160e01b5f52601160045260245ffd5b5f60018201611d4457611d44611d1f565b5060010190565b81516001600160a01b031681525f6101806020840151611d7660208501826001600160a01b03169052565b506040840151611d9160408501826001600160a01b03169052565b50606084015160608401526080840151608084015260a084015160a084015260c084015160c084015260e0840151611dcd60e085018215159052565b50610100848101516001600160a01b0390811691850191909152610120808601511515908501526101409485015116938301939093525061016081018290525f910190815260200190565b5f5b83811015611e32578181015183820152602001611e1a565b50505f910152565b5f8251611e4b818460208701611e18565b9190910192915050565b5f60208284031215611e65575f80fd5b81516108ce81611c00565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081525f8351611ea7816017850160208801611e18565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611ee4816028840160208801611e18565b01602801949350505050565b602081525f8251806020840152611f0e816040850160208701611e18565b601f01601f19169190910160400192915050565b80820281158282048414176107dc576107dc611d1f565b808201808211156107dc576107dc611d1f565b634e487b7160e01b5f52604160045260245ffd5b634e487b7160e01b5f52603260045260245ffd5b5f81611f8257611f82611d1f565b505f19019056fea2646970667358221220971b4a02dcae525f70be7bb1a97e405cb9a89b6d2a960c1151b7773349d8173364736f6c63430008140033