ETH Price: $2,682.66 (+2.32%)

Contract

0x5af2460902bfD79e54926931E61ee03937173beA
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

1 Internal Transaction found.

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Block
From
To
185768162023-11-15 10:52:23455 days ago1700045543  Contract Creation0 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
RealtMediatorAMB

Compiler Version
v0.8.18+commit.87f61d96

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 33 : RealtMediator.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.18;

import { ReentrancyGuardUpgradeable } from "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
import { UUPSUpgradeable } from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import { AccessControlUpgradeable } from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
import { EIP712Upgradeable } from "@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol";
import { ECDSAUpgradeable } from "@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol";

import { Safe } from "./Safe.sol";
import { BasicMediator } from "./BasicMediator.sol";
import { WhitelistExecutor } from "./WhitelistExecutor.sol";
import { IBridgeToken } from "./interfaces/IBridgeToken.sol";
import { IERC677Receiver } from "./interfaces/IERC677Receiver.sol";
import { Bytes } from "./libraries/Bytes.sol";
import { IERC3009 } from "./interfaces/IERC3009.sol";
import { IAMB } from "./interfaces/IAMB.sol";

contract RealtMediatorAMB is BasicMediator, WhitelistExecutor, UUPSUpgradeable, AccessControlUpgradeable, IERC677Receiver, EIP712Upgradeable, ReentrancyGuardUpgradeable {
    uint8 public constant VERSION = 1;
    bytes32 public constant OPERATOR_ROLE = 0x97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929; // keccak256("OPERATOR_ROLE");
    bytes32 public constant CREATE2_ROLE = 0x52bb4257e934f54697b64e15b38575f35c49751df7c56535f1ef6073d7102004; // keccak256("CREATE2_ROLE");
    mapping(address => address) private _tokenMapping;
    address private _propertyVault;
    address private _buyBack;
    bytes32 public constant BRIDGE_BATCH_DESTINATION_TYPEHASH = 0xc5aef48f0479b7f9e2039995fb836fd6d6595744dd05bf6818255128a712b1c4; // kecca256(BridgeBatchDestination(address destination,bytes32 hash))
    struct BatchTokenBridge {
        uint256 value;
        uint256 validAfter;
        uint256 validBefore;
        bytes32 nonce;
        IERC3009 token;
        address from;
        address to;
        uint8 v;
        bytes32 r;
        bytes32 s;
    }

    event ManualFix(bytes32 messageId);
    event BuyBackInitiated(bytes32 messageId);
    event TokenListSet(address[] localTokenList, address[] remoteTokenList);
    event TokenSet(address localToken, address remoteToken);

    constructor() {
        _disableInitializers();
    }

    function initialize(address owner_, address bridgeContract_, uint256 requestGasLimit_, uint256 batchTokenBridgeLimit_, address trustedIntermediary, address complianceRegistry_, address propertyVault_, address buyback_, address create2_) external reinitializer(VERSION) {
        __ReentrancyGuard_init();
        __UUPSUpgradeable_init();
        __AccessControl_init();
        __EIP712_init("REALT_MEDIATOR_AMB", "1");
        _grantRole(DEFAULT_ADMIN_ROLE, owner_);
        _grantRole(OPERATOR_ROLE, owner_);
        _grantRole(CREATE2_ROLE, create2_);
        __Mediator_init(bridgeContract_, requestGasLimit_, batchTokenBridgeLimit_);
        __Whitelist_init(trustedIntermediary, complianceRegistry_);
        _propertyVault = propertyVault_;
        _buyBack = buyback_;
    }

    // same as keccak256(abi.encode(data));
    function _keccakDataStruct(BatchTokenBridge[] calldata data) private pure returns (bytes32 output) {
        assembly {
            let size := add(0x40, mul(320, data.length))
            let ptr := mload(0x40)
            mstore(0x40, add(ptr, size))
            mstore(ptr, 0x0000000000000000000000000000000000000000000000000000000000000020)
            mstore(add(ptr, 0x20), data.length)
            calldatacopy(add(0x40, ptr), data.offset, size)
            output := keccak256(ptr, size)
        }
    }

    function batchBridgeWithDestination(
        BatchTokenBridge[] calldata data,
        address destination,
        bytes32 r,
        bytes32 vs
    ) external nonReentrant returns (bool) {
        (address from, address[] memory _localTokens, address[] memory _remoteTokens, uint256[] memory _amounts) = _receiveTokens(data);
        bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(
            BRIDGE_BATCH_DESTINATION_TYPEHASH,
            destination,
            _keccakDataStruct(data)
        )));
        require(ECDSAUpgradeable.recover(digest, r, vs) == from, "AM21");
        passMessage(from, destination, _localTokens, _remoteTokens, _amounts);
        return true;
    }

    /**
     * @notice batchBridge is a function that allows users to bridge tokens from one chain to another.
     * @dev batchBridge takes in an array of BatchTokenBridge structs, and a destination address. It then calls the _receiveTokens function to get the from address, local tokens, remote tokens, and amounts. Finally, it calls the passMessage function to bridge the tokens from one chain to another. 
     */
    function batchBridge(BatchTokenBridge[] calldata data) external nonReentrant returns (bool) {
        (address from, address[] memory _localTokens, address[] memory _remoteTokens, uint256[] memory _amounts) = _receiveTokens(data);
        passMessage(from, from, _localTokens, _remoteTokens, _amounts);
        return true;
    }

    /**
    * @dev Allow certain functions to be called only by the approved property vault
    * @notice Only Property Vault can pass this modifier
    */
    modifier onlyPropertyVault {
        assembly {
            if xor(sload(_propertyVault.slot), caller()) {
                let ptr := mload(0x40)
                // Revert with `Error("AM18")`
                mstore(ptr, 0x08c379a000000000000000000000000000000000000000000000000000000000)
                mstore(add(ptr, 0x04), 0x20) // String offset
                mstore(add(ptr, 0x24), 0x04) // Revert reason length
                mstore(add(ptr, 0x44), "AM18")
                revert(ptr, 0x48)
            }
        }
        _;
    }

    /**
     * @notice batchTransferFromVault is a function that allows the PropertyVault to transfer multiple tokens to a single destination address.
     * @dev batchTransferFromVault takes in an array of tokens, an array of amounts, and a destination address. It then iterates through the tokens and amounts and sends the tokens to the destination address.
     */
    function batchTransferFromVault(
        address[] calldata tokens,
        uint256[] calldata amounts,
        address destination
    ) external onlyPropertyVault returns (bool) {
        uint256 tokenBridged = tokens.length;
        for (uint256 i = 0; i < tokenBridged;) {
            _sendTokens(destination, tokens[i], amounts[i]);
            unchecked { ++i; }
        }
        return true;
    }

    /**
    * @dev Transfer tokens from the Vault to a destination address
    * @notice batchBridgeFromVault is a function that allows the PropertyVault to transfer multiple tokens to a single destination address on the destination chain.
    * @param tokens array of BridgeTokens contract addresses
    * @param amounts array of uint256 amounts of respective bridgeTokens contracts
    * @param destination address to transfer tokens to
    * @return true/false if successful
    */
    function batchBridgeFromVault(
        address[] calldata tokens,
        uint256[] calldata amounts,
        address destination
    ) external onlyPropertyVault returns (bool) {
        address[] memory _tokens = _checkTokens(tokens);
        passMessageVault(destination, _tokens, amounts);
        return true;
    }

    /**
    * @dev Sell tokens to the buyback operator on the destination chain.
    * @param data BatchTokenBridge[] array of BatchTokenBridge structs
    * @return true/false if successful
    */
    function batchBuyBackBridge(
        BatchTokenBridge[] calldata data
    ) external nonReentrant returns (bool) {
        address buyBack = _buyBack;
        assembly {
            // Revert if _buyBack = address(0)
            if iszero(buyBack) {
                let ptr := mload(0x40)
                // Revert with `Error("AM22")`
                mstore(ptr, 0x08c379a000000000000000000000000000000000000000000000000000000000)
                mstore(add(ptr, 0x04), 0x20) // String offset
                mstore(add(ptr, 0x24), 0x04) // Revert reason length
                mstore(add(ptr, 0x44), "AM22")
                revert(ptr, 0x48)
            }
        }
        (address from, address[] memory _localTokens, address[] memory _remoteTokens, uint256[] memory _amounts) = _receiveTokens(data);
        bytes32 _messageId = passMessage(from, buyBack, _localTokens, _remoteTokens, _amounts);
        emit BuyBackInitiated(_messageId);
        return true;
    }

    /**
    * @dev This function is called everytime a transferAndCall is attempted and the to parameter equal to this contract
    * 
    * @param from, address from which tokens are being transferred 
    * @param amount, amount of tokens being sent
    * @param data, calldata which contains the recipient of the transfer on the otherchain
    * @dev AM02, when no corresponding token is found for receiving the tokens
    * @dev AM03, when the input data size is not equal to 20 
    * @dev AM19, when the transferred amount is 0
    * 
    * @return bool if the transaction was successful 
    */
    function onTokenTransfer(
        address from,
        uint256 amount,
        bytes calldata data
    ) external override returns (bool) {
        require(data.length == 20, "AM03");
        require(amount > uint256(0), "AM19");
        address localTokenAddress = _msgSender();
        address otherSideTokenAddress = _tokenMapping[localTokenAddress];
        require(otherSideTokenAddress != address(0), "AM02");
        (address[] memory _localTokenAddress, address[] memory _remoteTokenAddress, uint256[] memory _amounts) = (new address[](1), new address[](1), new uint256[](1));
        (_localTokenAddress[0], _remoteTokenAddress[0], _amounts[0]) = (localTokenAddress, otherSideTokenAddress, amount);
        passMessage(from, Bytes.bytesToAddress(data), _localTokenAddress, _remoteTokenAddress, _amounts);
        return true;
    }

    /**
    * @dev Transfers proper amount of tokens from one side of bridge to another
    * @param data BatchTokenBridge[] calldata Array of TokenBridge structs
    * @dev AM02 When address for the local token is not found
    * @dev AM10 When msg.sender is not the bridge contract
    * @dev AM15 When sender of the tokens to be bridged is different than the one of the first array element
    * @dev AM19 When value of element from batch is 0
    * @return (from, localTokens, remoteTokens, _amounts) 
    *     -from address Address of sender
    *     -localTokens address[] memory An array of addresses of local Tokens
    *     -remoteTokens address[] memory An array of addresses of remote tokens 
    *     -_amounts uint256[] memory Amounts of tokens to be transferred
    */
    function _receiveTokens(BatchTokenBridge[] calldata data) private checkLength(data.length) returns (address, address[] memory, address[] memory, uint256[] memory) {
        uint256 tokenBridged = data.length;
        (address[] memory localTokens, address[] memory remoteTokens, uint256[] memory _amounts) = (new address[](tokenBridged), new address[](tokenBridged), new uint256[](tokenBridged));
        address from = data[0].from;
        BatchTokenBridge calldata c;
        address otherSideAddress;
        address localToken;
        for (uint256 i = 0; i < tokenBridged;) {
            c = data[i];
            require(c.to == address(this), "AM10");
            require(c.from == from, "AM15");
            require(c.value > uint256(0), "AM19");
            localToken = address(c.token);
            otherSideAddress = _tokenMapping[localToken];
            require(otherSideAddress != address(0), "AM02");
            c.token.transferWithAuthorization(c.from, c.to, c.value, c.validAfter, c.validBefore, c.nonce, c.v, c.r, c.s);
            (localTokens[i], remoteTokens[i], _amounts[i]) = (localToken, otherSideAddress, c.value);
            unchecked { ++i; }
        }
        return (from, localTokens, remoteTokens, _amounts);
    }

    /**
    * @dev modifier to check the length of a given array is lesser than a given maximum
    * @param len The length of the array
    *
    * @notice If the given length is greater than the maximum length (or zero) this reverts the transaction and prints AM04
    */
    modifier checkLength(uint256 len) {
        assembly {
            function printError(errorMsg) {
                let ptr := mload(0x40)
                mstore(ptr, 0x08c379a000000000000000000000000000000000000000000000000000000000)
                mstore(add(ptr, 0x04), 0x20) // string offset
                mstore(add(ptr, 0x24), 0x04) // revert reason length
                mstore(add(ptr, 0x44), errorMsg)
                revert(ptr, 0x48)
            }
            if iszero(len) {
                printError("AM04")
            }
            if gt(len, sload(_batchTokenBridgeLimit.slot)) {
                printError("AM04")
            }
        }
        _;
    }

    /**
    * @dev Checks if `keys` are valid token addresses and stores the valid addresses into `mapped`.
    * @param keys Array of token addresses to check.
    * @return mapped of the valid token values that were mapped from `keys`
    * @dev The array `mapped` is allocated on call and is the responsibility of the caller to free.
    * @dev Preconditions:
    *  1. 0 < `keys.length` <= `_batchTokenBridgeLimit`
    *  2. All `keys` address have a mapping in the `_tokenMapping` state variable.
    *  3.
    * @dev Postconditions:
    *  1. `mapped.length` == `keys.length`
    *  2. All mapped token addresses in `keys` are present and valid in `mapped`.
    * @dev AM02 When called with keys that do not have a mapping in the `_tokenMapping` state variable or if `mapped` is inaccessible.
    * @dev AM04 If the `keys.length` does not satisfy the preconditions.
    */
    function _checkTokens(address[] calldata keys) private view returns (address[] memory mapped) {
        assembly {
            let len := keys.length
            function allocate(length) -> pos {
                pos := mload(0x40)
                mstore(0x40, add(pos, length))
            }
            function printError(errorMsg) {
                let ptr := allocate(0x48)
                mstore(ptr, 0x08c379a000000000000000000000000000000000000000000000000000000000)
                mstore(add(ptr, 0x04), 0x20) // String offset
                mstore(add(ptr, 0x24), 0x04) // Revert reason length
                mstore(add(ptr, 0x44), errorMsg)
                revert(ptr, 0x48)
            }
            if iszero(len) {
                printError("AM04")
            }
            if gt(len, sload(_batchTokenBridgeLimit.slot)) {
                printError("AM04")
            }
            let dataStart := keys.offset
            mapped := allocate(add(0x20, mul(len, 0x20))) // allocate mapped memory
            mstore(mapped, len) // store array length
            let ptr := allocate(0x40)
            for {let i := 0} lt(i, len) {i := add(i, 1)} {
                mstore(ptr, calldataload(add(dataStart, mul(i, 0x20))))
                mstore(add(ptr, 0x20), _tokenMapping.slot)
                mstore(ptr, sload(keccak256(ptr, 0x40)))
                if iszero(mload(ptr)) {
                    printError("AM02")
                }
                // Store the value in the mapped array
                mstore(add(mapped, add(0x20, mul(0x20, i))), mload(ptr))
            }
        }
    }

    /**
    * @notice Passes payment with token denominations to a recipient through the bridge
    * @dev Encodes arguments and calls a function to pass the message to the bridge
    * @param _from Address of tokens sender 
    * @param _recipient Address of tokens recipient
    * @param _localTokens Array of addresses of tokens that are used to send the payment
    * @param _remoteTokens Array of address of tokens that the recipient will receive on the other chain
    * @param _amounts Array of amounts of tokens exchanged 
    * @return msgId bytes32 - The ID of the message sent by the bridge 
    */
    function passMessage(
        address _from,
        address _recipient,
        address[] memory _localTokens,
        address[] memory _remoteTokens,
        uint256[] memory _amounts
    ) override internal returns (bytes32) {
        bytes memory data = abi.encodeWithSelector(
            this.handleBridgedTokens.selector,
            _from,
            _recipient,
            _remoteTokens,
            _amounts
        );
        bytes32 msgId = bridgeContract().requireToPassMessage(
            address(this),
            data,
            requestGasLimit()
        );
        setMessageRecipient(msgId, _recipient);
        setMessageSender(msgId, _from);
        setMessageTokens(msgId, _localTokens);
        setMessageAmounts(msgId, _amounts);
        return msgId;
    }

    /**
    * @notice Passes payment with token denominations to a recipient through the bridge
    * @dev Encodes arguments and calls a function to pass the message to the bridge
    * @param _recipient Address of tokens recipient
    * @param _remoteTokens Array of address of tokens that the recipient will receive on the other chain
    * @param _amounts Array of amounts of tokens exchanged 
    */
    function passMessageVault(
        address _recipient,
        address[] memory _remoteTokens,
        uint256[] memory _amounts
    ) private {
        bytes memory data = abi.encodeWithSelector(
            this.handleBridgedTokensFromVault.selector,
            _recipient,
            _remoteTokens,
            _amounts);
        bridgeContract().requireToPassMessage(
            address(this),
            data,
            requestGasLimit()
        );
    }

    /**
     * @notice This function handles bridged tokens from one address to another.
     * @dev This function requires the `onlyMediator` modifier to be called. It takes in an address `from`, an address `recipient`, an array of addresses `tokens`, and an array of uint256 `amounts` as parameters. If the `from` address is the same as the `recipient` address, the `_whitelist` function is called with the `recipient` and `tokens` as parameters. A for loop is then used to iterate through the `tokens` array and the `_sendTokens` function is called with the `recipient`, `tokens[i]`, and `amounts[i]` as parameters.
     */
    function handleBridgedTokensFromVault(address recipient, address[] calldata tokens, uint256[] calldata amounts) external onlyMediator nonReentrant {
        bytes32 messageId = messageId();
        bool _success = _safeWhitelist(recipient, tokens);
        if (!_success) return saveVaultErrorState(messageId, recipient, tokens, amounts);
        uint256 tokenBridged = tokens.length;
        bytes memory transferData;
        bool transferSuccess;
        bytes memory returndata;
        bool transferDecodeResult;
        for (uint256 i = 0; i < tokenBridged;) {
            transferData = abi.encodeWithSelector(IBridgeToken.transfer.selector, recipient, amounts[i]); 
            (transferSuccess, returndata) = Safe.functionCall(tokens[i], transferData, 0x20);
            if (!transferSuccess) return saveVaultErrorState(messageId, recipient, tokens[i:], amounts[i:]);
            transferDecodeResult = Safe.abiDecodeBoolean(returndata);
            if (!transferDecodeResult) return saveVaultErrorState(messageId, recipient, tokens[i:], amounts[i:]);
            unchecked { ++i; }
        }
    }

    function retryVaultIssue(bytes32 messageId) external nonReentrant {
        require(!isPropertyVaultFixed(messageId), "AM09");
        propertyVaultIssueFixed(messageId);
        (address recipient, address[] memory tokens, uint256[] memory amounts) = (propertyVaultRecipient(messageId), propertyVaultTokens(messageId), propertyVaultAmounts(messageId));
        uint256 tokenBridged = tokens.length;
        require(tokenBridged > 0, "AM00");
        _whitelist(recipient, tokens);
        for (uint256 i = 0; i < tokenBridged;) {
            _sendTokens(recipient, tokens[i], amounts[i]);
            unchecked { ++i; }
        }
    }

    /**
     * @notice This function handles bridged tokens from one address to another.
     * @dev This function requires the `onlyMediator` modifier to be called. It takes in an address `from`, an address `recipient`, an array of addresses `tokens`, and an array of uint256 `amounts` as parameters. If the `from` address is the same as the `recipient` address, the `_whitelist` function is called with the `recipient` and `tokens` as parameters. A for loop is then used to iterate through the `tokens` array and the `_sendTokens` function is called with the `recipient`, `tokens[i]`, and `amounts[i]` as parameters.
     */
    function handleBridgedTokens(address from, address recipient, address[] calldata tokens, uint256[] calldata amounts) external onlyMediator {
        uint256 tokenBridged = tokens.length;
        if (from == recipient) _whitelist(recipient, tokens);
        for (uint256 i = 0; i < tokenBridged;) {
            _sendTokens(recipient, tokens[i], amounts[i]);
            unchecked { ++i; }
        }
    }

    /**
     * @notice This function is used to send tokens from one address to another.
     * @dev This function requires the IBridgeToken contract to be passed in as an argument. It then calls the transfer function of the IBridgeToken contract to transfer the specified amount of tokens to the specified address. 
     */
    function _sendTokens(address to, address token, uint256 amount) private {
        require(IBridgeToken(token).transfer(to, amount), "AM05");
    }

    /**
     * @dev recover lost user funds
     * @param token token to recover
     * @param to address that will receive the tokens
     * @param amount amount to recover
     */
    function withdrawTokenByAdmin(
        IBridgeToken token,
        address to,
        uint256 amount
    ) external onlyRole(DEFAULT_ADMIN_ROLE) {
        require(token.transfer(to, amount), "AM14");
    }

    /**
     * @dev recover lost user funds
     * @param messageId messageId to fix/resolve
     */
    function fixFailedMessageByAdmin(
        bytes32 messageId
    ) external onlyRole(DEFAULT_ADMIN_ROLE) {
        _fixFailedMessage(messageId);
        emit ManualFix(messageId);
    }

    /**
     * @dev Method to be called when a bridged message execution failed. It will generate a new message requesting to
     * fix/roll back the transferred assets on the other network.
     * @param _messageId id of the message which execution failed.
     */
    function requestFailedMessageFix(bytes32 _messageId) override external {
        require(!bridgeContract().messageCallStatus(_messageId), "AM11");
        require(
            bridgeContract().failedMessageReceiver(_messageId) == address(this), "AM12"
        );
        require(
            bridgeContract().failedMessageSender(_messageId) ==
                address(this), "AM13"
        );
        bytes memory data = abi.encodeWithSelector(this.fixFailedMessage.selector, _messageId);
        bridgeContract().requireToPassMessage(
            address(this),
            data,
            requestGasLimit()
        );
        emit FailedMessageRequest(_messageId);
    }

    /**
     * @dev Handles the request to fix transferred assets which bridged message execution failed on the other network.
     * It uses the information stored by passMessage method when the assets were initially transferred
     * @param _messageId id of the message which execution failed on the other network.
     */
    function fixFailedMessage(bytes32 _messageId) override external onlyMediator {
        _fixFailedMessage(_messageId);
    }

    function _fixFailedMessage(bytes32 _messageId) private {
        require(!messageFixed(_messageId), "AM09");
        setMessageFixed(_messageId);
        (address[] memory tokens, uint256[] memory amounts, address sender, address recipient) = (messageTokens(_messageId), messageAmounts(_messageId), messageSender(_messageId), messageRecipient(_messageId));
        uint256 len = tokens.length;
        require(len > 0, "AM00");
        if (sender == recipient) _whitelist(sender, tokens);
        for (uint256 i = 0; i < len;) {
            _sendTokens(sender, tokens[i], amounts[i]);
            unchecked { ++i; }
        }
    }

    /**
    * @notice Set the remote token address corresponding to a given local token address.
    * @dev Only operators or create2 contract can call this function 
    * @param localToken {address} The local token address
    * @param remoteToken {address} The remote token address corresponding to the local token
    * @return {bool} Whether the remote token address was set successfully
    **/
    function setToken(
        address localToken,
        address remoteToken
    )
        external returns (bool)
    {
        address msgSender = _msgSender();
        require(hasRole(CREATE2_ROLE, msgSender) || hasRole(OPERATOR_ROLE, msgSender), "AM24");
        _tokenMapping[localToken] = remoteToken;
        emit TokenSet(localToken, remoteToken);
        return true;
    }

    /**
    * @notice Set the set of remote token addresses corresponding to a given set of local token addresses.
    * @dev Only operators can call this function
    * @param _localTokenList {address[]} The list of local token addresses
    * @param _remoteTokenList {address[]} The list of remote token addresses
    **/
    function setTokens(
        address[] calldata _localTokenList,
        address[] calldata _remoteTokenList
    )
        external
        onlyRole(OPERATOR_ROLE)
    {
        uint256 length = _localTokenList.length;
        require(length == _remoteTokenList.length, "AM16");
        for (uint256 i = 0; i < length;) {
            _tokenMapping[_localTokenList[i]] = _remoteTokenList[i];
            unchecked { ++i; }
        }
        emit TokenListSet(_localTokenList, _remoteTokenList);
    }

    /**
    * @notice Set the property vault address.
    * @dev Only operators can call this function
    * @param newPropertyVault
    **/
    function setPropertyVault(
        address newPropertyVault
    )
        external
        onlyRole(OPERATOR_ROLE)
    {
        assembly {
            sstore(_propertyVault.slot, newPropertyVault)
        }
    }

    /**
    * @notice Set the buyback address.
    * @dev Only operators can call this function
    * @param newBuyBack
    **/
    function setBuyBack(
        address newBuyBack
    )
        external
        onlyRole(OPERATOR_ROLE)
    {
        assembly {
            sstore(_buyBack.slot, newBuyBack)
        }
    }

    /**
     * @notice This function returns the address of the token mapping for a given local token list.
     * @dev This function is used to get the address of the token mapping for a given local token list. It takes in an address of the local token list as an argument and returns the address of the token mapping. 
     */
    function getTokenMapping(
        address _localTokenList
    ) external view returns (address) {
        return _tokenMapping[_localTokenList];
    }

    /**
    * @notice Get the address of the PropertyVault
    * @dev This function returns the address of the PropertyVault
    * @return address - The address of the PropertyVault 
    */
    function getPropertyVault() external view returns (address) {
        return _propertyVault;
    }

    /**
    * @notice Get the address of the BuyBack contract 
    * @dev This function returns the address of the BuyBack contract 
    * @return address - The address of the BuyBack contract 
    */
    function getBuyBack() external view returns (address) {
        return _buyBack;
    }

    /* solhint-disable no-empty-blocks */
    /**
     * @notice This function allows the DEFAULT_ADMIN_ROLE to authorize an upgrade to a new implementation.
     * @dev This function should only be called by the DEFAULT_ADMIN_ROLE.
     */
    function _authorizeUpgrade(address /*newImplementation*/) override internal onlyRole(DEFAULT_ADMIN_ROLE) {}

    function _authAMB() override internal onlyRole(DEFAULT_ADMIN_ROLE) {}

    function _authWhitelist() override internal onlyRole(DEFAULT_ADMIN_ROLE) {}
    /* solhint-enable no-empty-blocks */
}

File 2 of 33 : Enum.sol
// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity >=0.7.0 <0.9.0;

/// @title Enum - Collection of enums
/// @author Richard Meissner - <[email protected]>
contract Enum {
    enum Operation {Call, DelegateCall}
}

File 3 of 33 : AccessControlUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/AccessControl.sol)

pragma solidity ^0.8.0;

import "./IAccessControlUpgradeable.sol";
import "../utils/ContextUpgradeable.sol";
import "../utils/StringsUpgradeable.sol";
import "../utils/introspection/ERC165Upgradeable.sol";
import "../proxy/utils/Initializable.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 AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControlUpgradeable, ERC165Upgradeable {
    function __AccessControl_init() internal onlyInitializing {
    }

    function __AccessControl_init_unchained() internal onlyInitializing {
    }
    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(IAccessControlUpgradeable).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 ",
                        StringsUpgradeable.toHexString(account),
                        " is missing role ",
                        StringsUpgradeable.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());
        }
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}

File 4 of 33 : IAccessControlUpgradeable.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 IAccessControlUpgradeable {
    /**
     * @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;
}

File 5 of 33 : draft-IERC1822Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)

pragma solidity ^0.8.0;

/**
 * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified
 * proxy whose upgrades are fully controlled by the current implementation.
 */
interface IERC1822ProxiableUpgradeable {
    /**
     * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation
     * address.
     *
     * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
     * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
     * function revert if invoked through a proxy.
     */
    function proxiableUUID() external view returns (bytes32);
}

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

pragma solidity ^0.8.0;

/**
 * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.
 *
 * _Available since v4.8.3._
 */
interface IERC1967Upgradeable {
    /**
     * @dev Emitted when the implementation is upgraded.
     */
    event Upgraded(address indexed implementation);

    /**
     * @dev Emitted when the admin account has changed.
     */
    event AdminChanged(address previousAdmin, address newAdmin);

    /**
     * @dev Emitted when the beacon is changed.
     */
    event BeaconUpgraded(address indexed beacon);
}

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

pragma solidity ^0.8.0;

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

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

File 8 of 33 : IBeaconUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)

pragma solidity ^0.8.0;

/**
 * @dev This is the interface that {BeaconProxy} expects of its beacon.
 */
interface IBeaconUpgradeable {
    /**
     * @dev Must return an address that can be used as a delegate call target.
     *
     * {BeaconProxy} will check that this address is a contract.
     */
    function implementation() external view returns (address);
}

File 9 of 33 : ERC1967UpgradeUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/ERC1967/ERC1967Upgrade.sol)

pragma solidity ^0.8.2;

import "../beacon/IBeaconUpgradeable.sol";
import "../../interfaces/IERC1967Upgradeable.sol";
import "../../interfaces/draft-IERC1822Upgradeable.sol";
import "../../utils/AddressUpgradeable.sol";
import "../../utils/StorageSlotUpgradeable.sol";
import "../utils/Initializable.sol";

/**
 * @dev This abstract contract provides getters and event emitting update functions for
 * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.
 *
 * _Available since v4.1._
 */
abstract contract ERC1967UpgradeUpgradeable is Initializable, IERC1967Upgradeable {
    function __ERC1967Upgrade_init() internal onlyInitializing {
    }

    function __ERC1967Upgrade_init_unchained() internal onlyInitializing {
    }
    // This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1
    bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;

    /**
     * @dev Storage slot with the address of the current implementation.
     * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
     * validated in the constructor.
     */
    bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;

    /**
     * @dev Returns the current implementation address.
     */
    function _getImplementation() internal view returns (address) {
        return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;
    }

    /**
     * @dev Stores a new address in the EIP1967 implementation slot.
     */
    function _setImplementation(address newImplementation) private {
        require(AddressUpgradeable.isContract(newImplementation), "ERC1967: new implementation is not a contract");
        StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
    }

    /**
     * @dev Perform implementation upgrade
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeTo(address newImplementation) internal {
        _setImplementation(newImplementation);
        emit Upgraded(newImplementation);
    }

    /**
     * @dev Perform implementation upgrade with additional setup call.
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeToAndCall(address newImplementation, bytes memory data, bool forceCall) internal {
        _upgradeTo(newImplementation);
        if (data.length > 0 || forceCall) {
            AddressUpgradeable.functionDelegateCall(newImplementation, data);
        }
    }

    /**
     * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeToAndCallUUPS(address newImplementation, bytes memory data, bool forceCall) internal {
        // Upgrades from old implementations will perform a rollback test. This test requires the new
        // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing
        // this special case will break upgrade paths from old UUPS implementation to new ones.
        if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) {
            _setImplementation(newImplementation);
        } else {
            try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) {
                require(slot == _IMPLEMENTATION_SLOT, "ERC1967Upgrade: unsupported proxiableUUID");
            } catch {
                revert("ERC1967Upgrade: new implementation is not UUPS");
            }
            _upgradeToAndCall(newImplementation, data, forceCall);
        }
    }

    /**
     * @dev Storage slot with the admin of the contract.
     * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
     * validated in the constructor.
     */
    bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;

    /**
     * @dev Returns the current admin.
     */
    function _getAdmin() internal view returns (address) {
        return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value;
    }

    /**
     * @dev Stores a new address in the EIP1967 admin slot.
     */
    function _setAdmin(address newAdmin) private {
        require(newAdmin != address(0), "ERC1967: new admin is the zero address");
        StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin;
    }

    /**
     * @dev Changes the admin of the proxy.
     *
     * Emits an {AdminChanged} event.
     */
    function _changeAdmin(address newAdmin) internal {
        emit AdminChanged(_getAdmin(), newAdmin);
        _setAdmin(newAdmin);
    }

    /**
     * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.
     * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.
     */
    bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;

    /**
     * @dev Returns the current beacon.
     */
    function _getBeacon() internal view returns (address) {
        return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value;
    }

    /**
     * @dev Stores a new beacon in the EIP1967 beacon slot.
     */
    function _setBeacon(address newBeacon) private {
        require(AddressUpgradeable.isContract(newBeacon), "ERC1967: new beacon is not a contract");
        require(
            AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()),
            "ERC1967: beacon implementation is not a contract"
        );
        StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon;
    }

    /**
     * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does
     * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).
     *
     * Emits a {BeaconUpgraded} event.
     */
    function _upgradeBeaconToAndCall(address newBeacon, bytes memory data, bool forceCall) internal {
        _setBeacon(newBeacon);
        emit BeaconUpgraded(newBeacon);
        if (data.length > 0 || forceCall) {
            AddressUpgradeable.functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data);
        }
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

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

pragma solidity ^0.8.2;

import "../../utils/AddressUpgradeable.sol";

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
 * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
 * case an upgrade adds a module that needs to be initialized.
 *
 * For example:
 *
 * [.hljs-theme-light.nopadding]
 * ```solidity
 * contract MyToken is ERC20Upgradeable {
 *     function initialize() initializer public {
 *         __ERC20_init("MyToken", "MTK");
 *     }
 * }
 *
 * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
 *     function initializeV2() reinitializer(2) public {
 *         __ERC20Permit_init("MyToken");
 *     }
 * }
 * ```
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
 * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() {
 *     _disableInitializers();
 * }
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     * @custom:oz-retyped-from bool
     */
    uint8 private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Triggered when the contract has been initialized or reinitialized.
     */
    event Initialized(uint8 version);

    /**
     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
     * `onlyInitializing` functions can be used to initialize parent contracts.
     *
     * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
     * constructor.
     *
     * Emits an {Initialized} event.
     */
    modifier initializer() {
        bool isTopLevelCall = !_initializing;
        require(
            (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
            "Initializable: contract is already initialized"
        );
        _initialized = 1;
        if (isTopLevelCall) {
            _initializing = true;
        }
        _;
        if (isTopLevelCall) {
            _initializing = false;
            emit Initialized(1);
        }
    }

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * A reinitializer may be used after the original initialization step. This is essential to configure modules that
     * are added through upgrades and that require initialization.
     *
     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
     * cannot be nested. If one is invoked in the context of another, execution will revert.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     *
     * WARNING: setting the version to 255 will prevent any future reinitialization.
     *
     * Emits an {Initialized} event.
     */
    modifier reinitializer(uint8 version) {
        require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
        _initialized = version;
        _initializing = true;
        _;
        _initializing = false;
        emit Initialized(version);
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} and {reinitializer} modifiers, directly or indirectly.
     */
    modifier onlyInitializing() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }

    /**
     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
     * through proxies.
     *
     * Emits an {Initialized} event the first time it is successfully executed.
     */
    function _disableInitializers() internal virtual {
        require(!_initializing, "Initializable: contract is initializing");
        if (_initialized != type(uint8).max) {
            _initialized = type(uint8).max;
            emit Initialized(type(uint8).max);
        }
    }

    /**
     * @dev Returns the highest version that has been initialized. See {reinitializer}.
     */
    function _getInitializedVersion() internal view returns (uint8) {
        return _initialized;
    }

    /**
     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
     */
    function _isInitializing() internal view returns (bool) {
        return _initializing;
    }
}

File 11 of 33 : UUPSUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/UUPSUpgradeable.sol)

pragma solidity ^0.8.0;

import "../../interfaces/draft-IERC1822Upgradeable.sol";
import "../ERC1967/ERC1967UpgradeUpgradeable.sol";
import "./Initializable.sol";

/**
 * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an
 * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.
 *
 * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is
 * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing
 * `UUPSUpgradeable` with a custom implementation of upgrades.
 *
 * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.
 *
 * _Available since v4.1._
 */
abstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable {
    function __UUPSUpgradeable_init() internal onlyInitializing {
    }

    function __UUPSUpgradeable_init_unchained() internal onlyInitializing {
    }
    /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment
    address private immutable __self = address(this);

    /**
     * @dev Check that the execution is being performed through a delegatecall call and that the execution context is
     * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case
     * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a
     * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to
     * fail.
     */
    modifier onlyProxy() {
        require(address(this) != __self, "Function must be called through delegatecall");
        require(_getImplementation() == __self, "Function must be called through active proxy");
        _;
    }

    /**
     * @dev Check that the execution is not being performed through a delegate call. This allows a function to be
     * callable on the implementing contract but not through proxies.
     */
    modifier notDelegated() {
        require(address(this) == __self, "UUPSUpgradeable: must not be called through delegatecall");
        _;
    }

    /**
     * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the
     * implementation. It is used to validate the implementation's compatibility when performing an upgrade.
     *
     * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
     * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
     * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.
     */
    function proxiableUUID() external view virtual override notDelegated returns (bytes32) {
        return _IMPLEMENTATION_SLOT;
    }

    /**
     * @dev Upgrade the implementation of the proxy to `newImplementation`.
     *
     * Calls {_authorizeUpgrade}.
     *
     * Emits an {Upgraded} event.
     *
     * @custom:oz-upgrades-unsafe-allow-reachable delegatecall
     */
    function upgradeTo(address newImplementation) public virtual onlyProxy {
        _authorizeUpgrade(newImplementation);
        _upgradeToAndCallUUPS(newImplementation, new bytes(0), false);
    }

    /**
     * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call
     * encoded in `data`.
     *
     * Calls {_authorizeUpgrade}.
     *
     * Emits an {Upgraded} event.
     *
     * @custom:oz-upgrades-unsafe-allow-reachable delegatecall
     */
    function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual onlyProxy {
        _authorizeUpgrade(newImplementation);
        _upgradeToAndCallUUPS(newImplementation, data, true);
    }

    /**
     * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by
     * {upgradeTo} and {upgradeToAndCall}.
     *
     * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.
     *
     * ```solidity
     * function _authorizeUpgrade(address) internal override onlyOwner {}
     * ```
     */
    function _authorizeUpgrade(address newImplementation) internal virtual;

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

File 12 of 33 : ReentrancyGuardUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";

/**
 * @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 ReentrancyGuardUpgradeable is Initializable {
    // 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;

    function __ReentrancyGuard_init() internal onlyInitializing {
        __ReentrancyGuard_init_unchained();
    }

    function __ReentrancyGuard_init_unchained() internal onlyInitializing {
        _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;
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}

File 13 of 33 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

File 14 of 33 : ContextUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";

/**
 * @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 ContextUpgradeable is Initializable {
    function __Context_init() internal onlyInitializing {
    }

    function __Context_init_unchained() internal onlyInitializing {
    }
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

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

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

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

pragma solidity ^0.8.0;

import "../StringsUpgradeable.sol";

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

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

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

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

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

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

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

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

        return (signer, RecoverError.NoError);
    }

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

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

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

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

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

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

pragma solidity ^0.8.8;

import "./ECDSAUpgradeable.sol";
import "../../interfaces/IERC5267Upgradeable.sol";
import "../../proxy/utils/Initializable.sol";

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

    /// @custom:oz-renamed-from _HASHED_NAME
    bytes32 private _hashedName;
    /// @custom:oz-renamed-from _HASHED_VERSION
    bytes32 private _hashedVersion;

    string private _name;
    string private _version;

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

    function __EIP712_init_unchained(string memory name, string memory version) internal onlyInitializing {
        _name = name;
        _version = version;

        // Reset prior values in storage if upgrading
        _hashedName = 0;
        _hashedVersion = 0;
    }

    /**
     * @dev Returns the domain separator for the current chain.
     */
    function _domainSeparatorV4() internal view returns (bytes32) {
        return _buildDomainSeparator();
    }

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

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

    /**
     * @dev See {EIP-5267}.
     *
     * _Available since v4.9._
     */
    function eip712Domain()
        public
        view
        virtual
        override
        returns (
            bytes1 fields,
            string memory name,
            string memory version,
            uint256 chainId,
            address verifyingContract,
            bytes32 salt,
            uint256[] memory extensions
        )
    {
        // If the hashed name and version in storage are non-zero, the contract hasn't been properly initialized
        // and the EIP712 domain is not reliable, as it will be missing name and version.
        require(_hashedName == 0 && _hashedVersion == 0, "EIP712: Uninitialized");

        return (
            hex"0f", // 01111
            _EIP712Name(),
            _EIP712Version(),
            block.chainid,
            address(this),
            bytes32(0),
            new uint256[](0)
        );
    }

    /**
     * @dev The name parameter for the EIP712 domain.
     *
     * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs
     * are a concern.
     */
    function _EIP712Name() internal virtual view returns (string memory) {
        return _name;
    }

    /**
     * @dev The version parameter for the EIP712 domain.
     *
     * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs
     * are a concern.
     */
    function _EIP712Version() internal virtual view returns (string memory) {
        return _version;
    }

    /**
     * @dev The hash of the name parameter for the EIP712 domain.
     *
     * NOTE: In previous versions this function was virtual. In this version you should override `_EIP712Name` instead.
     */
    function _EIP712NameHash() internal view returns (bytes32) {
        string memory name = _EIP712Name();
        if (bytes(name).length > 0) {
            return keccak256(bytes(name));
        } else {
            // If the name is empty, the contract may have been upgraded without initializing the new storage.
            // We return the name hash in storage if non-zero, otherwise we assume the name is empty by design.
            bytes32 hashedName = _hashedName;
            if (hashedName != 0) {
                return hashedName;
            } else {
                return keccak256("");
            }
        }
    }

    /**
     * @dev The hash of the version parameter for the EIP712 domain.
     *
     * NOTE: In previous versions this function was virtual. In this version you should override `_EIP712Version` instead.
     */
    function _EIP712VersionHash() internal view returns (bytes32) {
        string memory version = _EIP712Version();
        if (bytes(version).length > 0) {
            return keccak256(bytes(version));
        } else {
            // If the version is empty, the contract may have been upgraded without initializing the new storage.
            // We return the version hash in storage if non-zero, otherwise we assume the version is empty by design.
            bytes32 hashedVersion = _hashedVersion;
            if (hashedVersion != 0) {
                return hashedVersion;
            } else {
                return keccak256("");
            }
        }
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[48] private __gap;
}

File 17 of 33 : ERC165Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.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 ERC165Upgradeable is Initializable, IERC165Upgradeable {
    function __ERC165_init() internal onlyInitializing {
    }

    function __ERC165_init_unchained() internal onlyInitializing {
    }
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165Upgradeable).interfaceId;
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

File 18 of 33 : IERC165Upgradeable.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 IERC165Upgradeable {
    /**
     * @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);
}

File 19 of 33 : MathUpgradeable.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 MathUpgradeable {
    enum Rounding {
        Down, // Toward negative infinity
        Up, // Toward infinity
        Zero // Toward zero
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 20 of 33 : SignedMathUpgradeable.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 SignedMathUpgradeable {
    /**
     * @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);
        }
    }
}

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

pragma solidity ^0.8.0;

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

    struct BooleanSlot {
        bool value;
    }

    struct Bytes32Slot {
        bytes32 value;
    }

    struct Uint256Slot {
        uint256 value;
    }

    struct StringSlot {
        string value;
    }

    struct BytesSlot {
        bytes value;
    }

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

import "./math/MathUpgradeable.sol";
import "./math/SignedMathUpgradeable.sol";

/**
 * @dev String operations.
 */
library StringsUpgradeable {
    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 = MathUpgradeable.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(SignedMathUpgradeable.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, MathUpgradeable.log256(value) + 1);
        }
    }

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

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

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

File 23 of 33 : AMBMediator.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.18;

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

/**
* @title AMBMediator
* @dev Basic storage and methods needed by mediators to interact with AMB bridge.
*/
abstract contract AMBMediator {
    IAMB private _bridgeContract;
    uint256 private _requestGasLimit;
    uint256 internal _batchTokenBridgeLimit;

    event BridgeContractSet(IAMB omnibridge);
    // after EIP2929, call to warmed contract address costs 100 instead of 2600
    // https://github.com/omni/tokenbridge-contracts/blob/908a48107919d4ab127f9af07d44d47eac91547e/contracts/upgradeable_contracts/arbitrary_message/MessageDelivery.sol#L13C4-L14
    uint256 private constant MIN_GAS_PER_CALL = 100;

    /**
     * @notice Initializes the mediator contract with the bridge contract address, request gas limit, and batch token bridge limit.
     * @dev The bridge contract address is stored in the _bridgeContract variable, the request gas limit is stored in the _requestGasLimit variable, and the batch token bridge limit is stored in the _batchTokenBridgeLimit variable.
     */
    // solhint-disable-next-line func-name-mixedcase
    function __Mediator_init(
        address bridgeContract_,
        uint256 requestGasLimit_,
        uint256 batchTokenBridgeLimit_
    ) internal {
        _bridgeContract = IAMB(bridgeContract_);
        require(requestGasLimit_ >= MIN_GAS_PER_CALL && requestGasLimit_ <= IAMB(bridgeContract_).maxGasPerTx(), "AM23");
        _requestGasLimit = requestGasLimit_;
        _batchTokenBridgeLimit = batchTokenBridgeLimit_;
        emit BridgeContractSet(IAMB(bridgeContract_));
    }

    /**
    * @dev Throws if caller on the other side is not an associated mediator.
    */
    modifier onlyMediator {
        require(msg.sender == address(_bridgeContract), "AM07");
        require(messageSender() == address(this), "AM08");
        _;
    }

    modifier onlyAuthorized() {
        _authAMB();
        _;
    }

    function _authAMB() internal virtual;

    /**
    * @dev Sets the AMB bridge contract address. Only the owner can call this method.
    * @param bridgeContract_ the address of the bridge contract.
    */
    function setBridgeContract(IAMB bridgeContract_) external onlyAuthorized {
        _bridgeContract = bridgeContract_;
        emit BridgeContractSet(bridgeContract_);
    }
    /**
    * @dev Sets the number of tokens in a single transaction that can be bridged
    * Only the owner can call this method.
    * @param batchTokenBridgeLimit_ the number of tokens allowed per transaction
    */
    function setBatchTokenBridgeLimit(uint256 batchTokenBridgeLimit_) external onlyAuthorized {
        _batchTokenBridgeLimit = batchTokenBridgeLimit_;
    }

    /**
    * @dev Sets the gas limit to be used in the message execution by the AMB bridge on the other network.
    * This value can't exceed the parameter maxGasPerTx defined on the AMB bridge.
    * Only the owner can call this method.
    * @param requestGasLimit_ the gas limit for the message execution.
    */
    function setRequestGasLimit(uint256 requestGasLimit_) external onlyAuthorized {
        require(requestGasLimit_ >= MIN_GAS_PER_CALL && requestGasLimit_ <= maxGasPerTx(), "AM23");
        _requestGasLimit = requestGasLimit_;
    }

    /**
    * @dev Get the AMB interface for the bridge contract address
    * @return AMB interface for the bridge contract address
    */
    function bridgeContract() internal view returns (IAMB) {
        return _bridgeContract;
    }

    /**
    * @dev Get the AMB interface for the bridge contract address
    * @return AMB interface for the bridge contract address
    */
    function getBridgeContract() external view returns (IAMB) {
        return _bridgeContract;
    }

    /** 
    * @dev Tells the number of tokens in a single transaction that can be bridged
    * @return the number of tokens that can possibly be bridged in a single transaction
    */
    function getBatchTokenBridgeLimit() external view returns (uint256) {
        return _batchTokenBridgeLimit;
    }

    /**
    * @dev Tells the gas limit to be used in the message execution by the AMB bridge on the other network.
    * @return the gas limit for the message execution.
    */
    function requestGasLimit() internal view returns (uint256) {
        return _requestGasLimit;
    }

    /**
    * @dev Tells the gas limit to be used in the message execution by the AMB bridge on the other network.
    * @return the gas limit for the message execution.
    */
    function getRequestGasLimit() external view returns (uint256) {
        return _requestGasLimit;
    }

    /**
    * @dev Tells the address that generated the message on the other network that is currently being executed by
    * the AMB bridge.
    * @return the address of the message sender.
    */
    function messageSender() internal view returns (address) {
        return _bridgeContract.messageSender();
    }

    function messageId() internal view returns (bytes32) {
        return _bridgeContract.messageId();
    }

    /**
    * @dev Tells the maximum gas limit that a message can use on its execution by the AMB bridge on the other network.
    * @return the maximum gas limit value.
    */
    function maxGasPerTx() internal view returns (uint256) {
        return _bridgeContract.maxGasPerTx();
    }

    /* Reserved slots for future use: https://docs.openzeppelin.com/sdk/2.5/writing-contracts.html#modifying-your-contracts */
    uint256[47] private ______gap;
}

File 24 of 33 : BasicMediator.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.18;

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

abstract contract BasicMediator is AMBMediator {
    event FailedMessageRequest(bytes32 messageId);

    mapping(bytes32 => bool) internal _propertyVaultFixed;
    mapping(bytes32 => address) internal _propertyVaultRecipient;
    mapping(bytes32 => uint256[]) internal _propertyVaultAmounts;
    mapping(bytes32 => address[]) internal _propertyVaultTokens;

    mapping(bytes32 => address) private _messageRecipient;
    mapping(bytes32 => address) private _messageSender;
    mapping(bytes32 => address[]) private _messageTokens;
    mapping(bytes32 => uint256[]) private _messageAmounts;
    mapping(bytes32 => bool) private _messageFixed;

    function getBridgeInterfacesVersion() external view returns (uint64, uint64, uint64) {
        return bridgeContract().getBridgeInterfacesVersion();
    }

    function getBridgeMode() external view returns (bytes4) {
        return bridgeContract().getBridgeMode(); // bytes4(keccak256(abi.encodePacked("arbitrary-message-bridge-core")))
    }

    function isPropertyVaultFixed(bytes32 messageId) internal view returns (bool) {
        return _propertyVaultFixed[messageId];
    }

    function propertyVaultIssueFixed(bytes32 messageId) internal {
        _propertyVaultFixed[messageId] = true;
    }

    function saveVaultErrorState(bytes32 messageId, address recipient, address[] calldata tokens, uint256[] calldata amounts) internal {
        _propertyVaultRecipient[messageId] = recipient;
        _propertyVaultTokens[messageId] = tokens;
        _propertyVaultAmounts[messageId] = amounts;
    }

    function setMessageSender(bytes32 _msgId, address _sender) internal {
        _messageSender[_msgId] = _sender;
    }

    function propertyVaultRecipient(bytes32 _msgId) internal view returns (address) {
        return _propertyVaultRecipient[_msgId];
    }

    function propertyVaultTokens(bytes32 _msgId) internal view returns (address[] memory) {
        return _propertyVaultTokens[_msgId];
    }

    function propertyVaultAmounts(bytes32 _msgId) internal view returns (uint256[] memory) {
        return _propertyVaultAmounts[_msgId];
    }

    /**
     * @notice messageSender() function is used to retrieve the address of the sender of a message.
     * @dev messageSender() function takes a bytes32 message ID as an argument and returns the address of the sender of the message. 
     */
    function messageSender(bytes32 _msgId) internal view returns (address) {
        return _messageSender[_msgId];
    }

    /**
     * @notice This function sets the recipient of a message.
     * @dev This function sets the recipient of a message by taking in a message ID and an address.
     */
    function setMessageRecipient(bytes32 _msgId, address _recipient) internal {
        _messageRecipient[_msgId] = _recipient;
    }

    /**
     * @notice messageRecipient() returns the address of the recipient of a message
     * @dev messageRecipient() takes a bytes32 message ID as an argument and returns the address of the recipient of the message. 
     */
    function messageRecipient(bytes32 _msgId) internal view returns (address) {
        return _messageRecipient[_msgId];
    }

    /**
     * @notice setMessageTokens() sets the tokens associated with a message.
     * @dev This function sets the tokens associated with a message. It takes two parameters, a bytes32 message ID and an address array of tokens. It stores the tokens in the _messageTokens mapping.
     */
    function setMessageTokens(bytes32 _msgId, address[] memory _tokens) internal {
        _messageTokens[_msgId] = _tokens;
    }

    /**
     * @notice messageTokens() function
     * 
     * @dev This function returns an array of addresses associated with a given message ID.
     * 
     * @param _msgId bytes32 - The message ID associated with the addresses.
     * 
     * @return address[] memory - An array of addresses associated with the given message ID.
     */
    function messageTokens(bytes32 _msgId) internal view returns (address[] memory) {
        return _messageTokens[_msgId];
    }

    /**
     * @notice setMessageAmounts() sets the amounts associated with a message
     * 
     * @dev This function sets the amounts associated with a message. It takes two parameters:
     * 
     * - _msgId: The message ID
     * - _amounts: An array of uint256 values
     */
    function setMessageAmounts(bytes32 _msgId, uint256[] memory _amounts) internal {
        _messageAmounts[_msgId] = _amounts;
    }

    /**
     * @notice messageAmounts() is a function that returns an array of uint256 values associated with a given message ID.
     * @dev messageAmounts() takes a bytes32 message ID as an argument and returns an array of uint256 values associated with that message ID. 
     */
    function messageAmounts(bytes32 _msgId) internal view returns (uint256[] memory) {
        return _messageAmounts[_msgId];
    }

    /**
     * @notice Sets the message fixed status to true for the given message ID
     * @dev This function is used to set the message fixed status to true for the given message ID
     * @param _msgId The message ID to set the fixed status for
     */
    function setMessageFixed(bytes32 _msgId) internal {
        _messageFixed[_msgId] = true;
    }

    /**
     * @notice messageFixed() is a function that checks if a message has been fixed.
     * @dev messageFixed() takes a bytes32 _msgId as an argument and returns a boolean. It checks if the message has been fixed by looking up the _messageFixed mapping.
     */
    function messageFixed(bytes32 _msgId) internal view returns (bool) {
        return _messageFixed[_msgId];
    }

    /**
     * @notice getMessageFixed() allows a user to check if a message has been fixed.
     * @dev getMessageFixed() takes a bytes32 _msgId as an argument and returns a boolean.
     */
    function getMessageFixed(bytes32 _msgId) external view returns (bool) {
        return _messageFixed[_msgId];
    }

    function getPropertyVaultFailData(bytes32 _msgId) external view returns (bool, address, address[] memory,uint256[] memory) {
        return (_propertyVaultFixed[_msgId], _propertyVaultRecipient[_msgId], _propertyVaultTokens[_msgId], _propertyVaultAmounts[_msgId]);
    }

    /**
     * @notice requestFailedMessageFix
     * 
     * @dev This function is used to fix a failed message request. It takes a bytes32 _msgId as an argument and attempts to fix the failed message request. 
     */
    function requestFailedMessageFix(bytes32 _msgId) external virtual;

    /**
     * @notice This function fixes a failed message.
     * @dev This function is used to fix a failed message. It takes a bytes32 _msgId as an argument.
     */
    function fixFailedMessage(bytes32 _msgId) external virtual;

    /**
     * @notice passMessage is a function that allows a user to send a message to a recipient.
     * @dev The function takes in four parameters: _from, _recipient, _localTokens, _remoteTokens, and _values. 
     * _from is the address of the sender, _recipient is the address of the recipient, _localTokens is an array of addresses of local tokens, 
     * _remoteTokens is an array of addresses of remote tokens, and _values is an array of uint256 values. 
     * The function returns a bytes32 value. 
     */
    function passMessage(address _from, address _recipient, address[] memory _localTokens, address[] memory _remoteTokens, uint256[] memory _values) internal virtual returns (bytes32);

    /* Reserved slots for future use: https://docs.openzeppelin.com/sdk/2.5/writing-contracts.html#modifying-your-contracts */
    uint256[41] private ______gap;
}

File 25 of 33 : IAMB.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.18;

interface IAMB {
    /**
     * @notice getBridgeInterfacesVersion() returns the bridge mode of the currently used bridge.
     * @dev getBridgeInterfacesVersion() is a view function that returns the bridge mode of the currently used bridge. It is an external function and does not modify the state of the contract.
     */
    function getBridgeInterfacesVersion() external view returns (uint64, uint64, uint64);
    /**
     * @notice getBridgeMode() returns the bridge mode of the currently used bridge.
     * @dev getBridgeMode() is a view function that returns the bridge mode of the currently used bridge. It is an external function and does not modify the state of the contract.
     */
    function getBridgeMode() external view returns (bytes4);
    /**
     * @notice messageSender() returns the address of the sender of the current message.
     * @dev messageSender() is a view function that returns the address of the sender of the current message. It is an external function and does not modify the state of the contract.
     */
    function messageSender() external view returns (address);

    /**
     * @notice This function returns the maximum gas allowed for a single transaction.
     * @dev This function is used to prevent transactions from consuming too much gas.
     */
    function maxGasPerTx() external view returns (uint256);

    /**
     * @notice This function returns the transaction hash of the current transaction.
     * @dev This function is used to get the transaction hash of the current transaction. It is an external view function and returns a bytes32.
     */
    function transactionHash() external view returns (bytes32);

    /**
     * @notice messageSourceChainId() returns the chain ID of the source chain of the message
     * @dev messageSourceChainId() is a view function that returns the chain ID of the source chain of the message. This is used to verify the origin of the message.
     */
    function messageSourceChainId() external view returns (bytes32);

    /**
     * @notice messageCallStatus() is a function that returns a boolean value based on the messageId passed as an argument.
     * @dev messageCallStatus() takes a bytes32 type argument and returns a boolean value. It is used to check the status of a message call.
     */
    function messageCallStatus(bytes32 _messageId) external view returns (bool);

    /**
     * @dev Returns the data hash of a failed message.
     * @param _messageId The ID of the message.
     * @return The data hash of the failed message.
     */
    function failedMessageDataHash(
        bytes32 _messageId
    ) external view returns (bytes32);

    /**
     * @notice failedMessageReceiver() is a function that returns the address of the failed message receiver.
     * @dev This function takes in a messageId as an argument and returns the address of the failed message receiver.
     */
    function failedMessageReceiver(
        bytes32 _messageId
    ) external view returns (address);

    /**
     * @dev Returns the address of the message sender if the message failed.
     * @param _messageId The message ID.
     * @return The address of the message sender.
     */
    function failedMessageSender(
        bytes32 _messageId
    ) external view returns (address);

    /**
     * @notice This function requires a message to be passed to a contract.
     * @dev This function requires a message to be passed to a contract. It takes in an address of the contract, the data to be passed, and the gas to be used. It returns a bytes32.
     */
    function requireToPassMessage(
        address _contract,
        bytes calldata _data,
        uint256 _gas
    ) external returns (bytes32);

    function requireToConfirmMessage(
        address _contract,
        bytes calldata _data,
        uint256 _gas
    ) external returns (bytes32);

    /**
     * @dev This function requires a bytes32 _requestSelector and a bytes calldata _data to get information.
     * @param _requestSelector The bytes32 request selector.
     * @param _data The bytes calldata.
     * @return The bytes32 of the requested information.
     */
    function requireToGetInformation(
        bytes32 _requestSelector,
        bytes calldata _data
    ) external returns (bytes32);

    /**
     * @notice This function returns the source chain ID.
     * @dev This function is used to get the source chain ID. It is an external view function and returns a uint256.
     */
    function sourceChainId() external view returns (uint256);

    /**
     * destinationChainId()
     *
     * @dev This function returns the ID of the destination chain.
     *
     * @return uint256 - The ID of the destination chain.
     */
    function destinationChainId() external view returns (uint256);

    function messageId() external view returns (bytes32);
}

File 26 of 33 : IBridgeToken.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.18;

interface IBridgeToken {
  /**
   * @notice This function returns the ruleId and the associated value for a given ruleId.
   * @dev This function is used to retrieve the ruleId and the associated value for a given ruleId. The function takes a uint256 ruleId as an argument and returns a uint256 ruleId and a uint256 value.
   */
  function rule(uint256 ruleId) external view returns (uint256, uint256);
  /**
   * @dev Function to view the balance of an address
   * @param who The address to view the balance of
   * @return uint256 The balance of the address
   */
  function balanceOf(address who) external view returns (uint256);
  /**
   * @notice This function allows a user to transfer tokens from one address to another.
   * @dev The transferFrom function is used to transfer tokens from one address to another. It takes three parameters: 
   * from (the address of the sender), to (the address of the recipient), and value (the amount of tokens to be transferred). 
   * The function returns a boolean value indicating whether the transfer was successful or not. 
   */
  function transferFrom(address from, address to, uint256 value) external returns (bool);
  /**
   * @dev Function to transfer tokens to a specified address
   * @param to The address of the recipient
   * @param value The amount of tokens to be transferred
   * @return A boolean that indicates whether the transfer was successful or not
   */
  function transfer(address to, uint256 value) external returns (bool);
}

File 27 of 33 : IComplianceRegistry.sol
// SPDX-License-Identifier: CNU

/*
    Copyright (c) 2019 Mt Pelerin Group Ltd

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License version 3
    as published by the Free Software Foundation with the addition of the
    following permission added to Section 15 as permitted in Section 7(a):
    FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY
    MT PELERIN GROUP LTD. MT PELERIN GROUP LTD DISCLAIMS THE WARRANTY OF NON INFRINGEMENT
    OF THIRD PARTY RIGHTS

    This program is distributed in the hope that it will be useful, but
    WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
    or FITNESS FOR A PARTICULAR PURPOSE.
    See the GNU Affero General Public License for more details.
    You should have received a copy of the GNU Affero General Public License
    along with this program; if not, see http://www.gnu.org/licenses or write to
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
    Boston, MA, 02110-1301 USA, or download the license from the following URL:
    https://www.gnu.org/licenses/agpl-3.0.fr.html

    The interactive user interfaces in modified source and object code versions
    of this program must display Appropriate Legal Notices, as required under
    Section 5 of the GNU Affero General Public License.

    You can be released from the requirements of the license by purchasing
    a commercial license. Buying such a license is mandatory as soon as you
    develop commercial activities involving Mt Pelerin Group Ltd software without
    disclosing the source code of your own applications.
    These activities include: offering paid services based/using this product to customers,
    using this product in any application, distributing this product with a closed
    source product.

    For more information, please contact Mt Pelerin Group Ltd at this
    address: [email protected]
*/

pragma solidity 0.8.18;

/**
 * @title IComplianceRegistry
 * @dev IComplianceRegistry interface
 **/
interface IComplianceRegistry {
  /**
   * @notice This function returns the userId and the address of the user.
   * @dev This function takes in an array of trusted intermediaries and an address as parameters. It then returns the userId and the address of the user.
   */
  function userId(address[] calldata _trustedIntermediaries, address _address) 
    external view returns (uint256, address);
  /**
   * @notice This function allows a trusted intermediary to set the attributes of a user.
   * @dev The _trustedIntermediary parameter is the address of the trusted intermediary. The _userId parameter is the ID of the user. The _keys parameter is an array of uint256 values that represent the attributes of the user.
   */
  function attributes(address _trustedIntermediary, uint256 _userId, uint256[] calldata _keys) 
    external view returns (uint256[] memory);
  /**
   * @notice This function is used to register a user with the given address and attributes.
   * @dev The function takes in an address and two arrays of uint256 values. The first array contains the keys for the attributes and the second array contains the values for the attributes. The function stores the address and the attributes in the mapping.
   */
  function registerUser(
    address _address, 
    uint256[] calldata _attributeKeys, 
    uint256[] calldata _attributeValues
  ) external;
  /**
   * @notice updateUserAttributes() allows a user to update their attributes.
   * @dev updateUserAttributes() takes in a userId, an array of attribute keys, and an array of attribute values. The function then updates the user's attributes with the given values.
   */
  function updateUserAttributes(
    uint256 _userId, 
    uint256[] calldata _attributeKeys, 
    uint256[] calldata _attributeValues
  ) external;
}

File 28 of 33 : IERC3009.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.18;

interface IERC3009 {
   /**
    * @notice transferWithAuthorization allows a user to transfer funds from one address to another with authorization.
    * @dev This function requires the sender to provide a valid signature, a valid time window, and a unique nonce.
    * The signature is generated using the ECDSA algorithm and the sender's private key.
    * The valid time window is used to ensure that the transaction is valid only within the specified time frame.
    * The unique nonce is used to prevent replay attacks.
    */
   function transferWithAuthorization(
    address from,
    address to,
    uint256 value,
    uint256 validAfter,
    uint256 validBefore,
    bytes32 nonce,
    uint8 v,
    bytes32 r,
    bytes32 s
  ) external;
}

File 29 of 33 : IERC677Receiver.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.18;

interface IERC677Receiver {
  function onTokenTransfer(address from, uint256 amount, bytes calldata data) external returns (bool);
}

File 30 of 33 : IGnosisSafe.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.18;

import { Enum } from "@gnosis.pm/safe-contracts/contracts/common/Enum.sol";

interface IGnosisSafe {
  /**
   * @notice Executes a transaction with the given parameters.
   * @dev This function is used to execute a transaction with the given parameters. It takes in the address of the recipient, the value to be sent, the data to be sent, the operation to be performed, the safe transaction gas, the base gas, the gas price, the gas token, the refund receiver, and the signatures. It returns a boolean indicating the success of the transaction.
   */
  function execTransaction(
    address to,
    uint256 value,
    bytes calldata data,
    Enum.Operation operation,
    uint256 safeTxGas,
    uint256 baseGas,
    uint256 gasPrice,
    address gasToken,
    address payable refundReceiver,
    bytes memory signatures
  ) external payable returns (bool success);
}

File 31 of 33 : Bytes.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.18;
/**
 * @title Bytes
 * @dev Helper methods to transform bytes to other solidity types.
 */
library Bytes {
    /**
    * @dev Truncate bytes array if its size is more than 20 bytes.
    * NOTE: Similar to the bytesToBytes32 function, make sure that _bytes is not shorter than 20 bytes.
    * @param _bytes to be converted to address type
    * @return addr included in the firsts 20 bytes of the bytes array in parameter.
    */
    function bytesToAddress(bytes memory _bytes) internal pure returns (address addr) {
        assembly {
            addr := mload(add(_bytes, 20))
        }
    }
}

File 32 of 33 : Safe.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.18;

// This library enables reentrancy, please protect with a nonReentrant
library Safe {
    uint256 private constant TRUE = 0x0000000000000000000000000000000000000000000000000000000000000001;

    function functionCall(
        address target,
        bytes memory data,
        uint256 expectedLength
    ) internal returns (bool, bytes memory) {
        (bool success, bytes memory returndata) = target.call{value: 0}(data);
        return verifyCallResultFromTarget(success, returndata, expectedLength);
    }

    function functionStaticCall(
        address target,
        bytes memory data,
        uint256 expectedLength
    ) internal view returns (bool, bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(success, returndata, expectedLength);
    }

    function verifyCallResultFromTarget(
        bool success,
        bytes memory returndata,
        uint256 expectedLength
    ) internal pure returns (bool, bytes memory) {
        return (success && returndata.length == expectedLength, returndata);
    }

    function abiDecodeUint256Address(
        bytes memory returndata
    ) internal pure returns (bool b, uint256 u, address a) {
        assembly {
            let _address := mload(add(returndata, 0x40))
            if lt(_address, 0x0000000000000000000000010000000000000000000000000000000000000000) {
                b := TRUE
                u := mload(add(returndata, 0x20))
                a := _address
            }
        }
    }

    function abiDecodeBoolean(
        bytes memory returndata
    ) internal pure returns (bool b) {
        assembly {
            let test := mload(add(returndata, 0x20))
            if lt(test, 0x0000000000000000000000000000000000000000000000000000000000000002) {
                b := test
            }
        }
    }

    function abiDecodeUint256Array(
        bytes memory returndata,
        uint256 expectedLength
    ) internal pure returns (bool b) {
        assembly {
            if and(eq(mload(add(returndata, 0x20)), 0x0000000000000000000000000000000000000000000000000000000000000020), eq(mload(add(returndata, 0x40)), expectedLength)) {
                b := TRUE
            }
        }
    }
}

File 33 of 33 : WhitelistExecutor.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.18;

import { IGnosisSafe } from "./interfaces/IGnosisSafe.sol";
import { Enum } from "@gnosis.pm/safe-contracts/contracts/common/Enum.sol";
import { IComplianceRegistry } from "./interfaces/IComplianceRegistry.sol";
import { IBridgeToken } from "./interfaces/IBridgeToken.sol";
import { Safe } from "./Safe.sol";

abstract contract WhitelistExecutor {
    bytes4 private constant UPDATE_USER = IComplianceRegistry.updateUserAttributes.selector;
    bytes4 private constant REGISTER_USER = IComplianceRegistry.registerUser.selector;
    address private _trustedIntermediary;
    IComplianceRegistry private _complianceRegistry;

    event TrustedIntermediaryUpdated(address newTrustedIntermediary);
    event ComplianceRegistryUpdated(IComplianceRegistry newComplianceRegistry);

    // solhint-disable-next-line func-name-mixedcase
    function __Whitelist_init(address trustedIntermediary_, address complianceRegistry_) internal {
        _trustedIntermediary = trustedIntermediary_;
        _complianceRegistry = IComplianceRegistry(complianceRegistry_);
        emit TrustedIntermediaryUpdated(trustedIntermediary_);
        emit ComplianceRegistryUpdated(IComplianceRegistry(complianceRegistry_));
    }

    function _contractSignature() private view returns (bytes memory s) {
        assembly {
            s := mload(0x40)
            mstore(0x40, add(s, 0x61))
            mstore(s, 0x41)
            mstore(add(s, 0x20), address())
            mstore(add(s, 0x41), 0x01)
        }
    }

    /// @param account user address
    /// @param tokens tokens addresses to whitelist
    function _whitelist(address account, address[] memory tokens) internal {
      address trusted = _trustedIntermediary;
      address[] memory intermediaries = new address[](1);
      intermediaries[0] = trusted;
      IComplianceRegistry compliance = _complianceRegistry;
      // Check if the user is already registered
      (uint256 userId,) = compliance.userId(intermediaries, account);
      uint256 length = tokens.length;
      (uint256[] memory tokenIds, uint256[] memory attributeValues) = _getTokenIds(tokens, length);
      // If the user is not registered, register the user with tokenIds and attributeValues
      if (userId == 0) {
        _staticRegisterUser(account, tokenIds, attributeValues, trusted, address(compliance));
      } else {
        uint256[] memory isWhitelistedValues = compliance.attributes(trusted, userId, tokenIds);
        for (uint256 i = 0; i < length;) {
          if (isWhitelistedValues[i] == 0) {
            _staticUpdateUserAttributes(userId, tokenIds, attributeValues, trusted, address(compliance));
            return;
          }
          unchecked { ++i; }
        }
      }
    }

    function _registerUpdateUser(address account, uint256[] memory tokenIds, uint256[] memory attributeValues, uint256 userId, address trusted, address compliance) private returns (bool) {
      uint256 length = tokenIds.length;
      if (userId == 0) {
        return _safeRegisterUser(account, tokenIds, attributeValues, trusted, address(compliance));
      } else {
        (bool successAttributes, bytes memory returndata) = Safe.functionStaticCall(address(compliance), abi.encodeWithSelector(IComplianceRegistry.attributes.selector, trusted, userId, tokenIds), 0x40 + 0x20 * length);
        if (!successAttributes) return false;
        bool canDecodeSafely = Safe.abiDecodeUint256Array(returndata, length);
        if (!canDecodeSafely) return false;
        uint256[] memory isWhitelistedValues = abi.decode(returndata, (uint256[]));
            for (uint256 i = 0; i < length;) {
              if (isWhitelistedValues[i] == 0) {
                return _safeUpdateUserAttributes(userId, tokenIds, attributeValues, trusted, address(compliance));
              }
              unchecked { ++i; }
            }
            return true;
      }
    }
    /// @param account user address
    /// @param tokens tokens addresses to whitelist
    function _safeWhitelist(address account, address[] memory tokens) internal returns (bool) {
      address trusted = _trustedIntermediary;
      address[] memory intermediaries = new address[](1);
      intermediaries[0] = trusted;
      IComplianceRegistry compliance = _complianceRegistry;
      // Check if the user is already registered
      (bool userIdSuccess, bytes memory result) = Safe.functionStaticCall(address(compliance), abi.encodeWithSelector(IComplianceRegistry.userId.selector, intermediaries, account), 0x40);
      if (!userIdSuccess) return false;
      (bool decodeSafe, uint256 userId,) = Safe.abiDecodeUint256Address(result);
      if (!decodeSafe) return false;
      (bool successTokenIds, uint256[] memory tokenIds, uint256[] memory attributeValues) = _safeGetTokenIds(tokens, tokens.length);
      if (!successTokenIds) return false;
      // If the user is not registered, register the user with tokenIds and attributeValues
      return _registerUpdateUser(account, tokenIds, attributeValues, userId, trusted, address(compliance));
    }

 /**
    * @notice Update a user's attribute keys or values in the contract
    * @dev Submits a transaction to the trustedIntermediary to query for the user's attributes. 
    * @param _userId The user id to be updated
    * @param _attributeKeys The array of attribute keys for the user, indexed by the attribute index
    * @param _attributeValues The array of attribute values for the user, indexed by the attribute index
    * @param trusted The address of the trusted intermediary contract 
    * @param compliance The address of the compliance contract
    */
    function _safeUpdateUserAttributes(
    uint256 _userId, 
    uint256[] memory _attributeKeys, 
    uint256[] memory _attributeValues,
    address trusted,
    address compliance
  ) private returns (bool) {
    bytes memory encodedUpdateUserSelector = abi.encodeWithSelector(UPDATE_USER, _userId, _attributeKeys, _attributeValues);
    bytes memory execTransaction = abi.encodeWithSelector(IGnosisSafe.execTransaction.selector, compliance,0,encodedUpdateUserSelector,Enum.Operation.Call,0,0,0,address(0),payable(address(0)),_contractSignature());
    (bool s,) = Safe.functionCall(trusted, execTransaction, 0x20);
    return s;
  }

  /**
  * @notice Register an address to the contract as a user.
  * @dev Submits a transaction to the trustedIntermediary to registger a user. 
  * @param _address The address of the user to be registered
  * @param _attributeKeys The array of attribute keys for the user, indexed by the attribute index
  * @param _attributeValues The array of attribute values for the user, indexed
  * @param trusted The address of the trusted intermediary contract 
  * @param compliance The address of the compliance contract
  */
  function _safeRegisterUser(
    address _address,
    uint256[] memory _attributeKeys,
    uint256[] memory _attributeValues,
    address trusted,
    address compliance
  ) private returns (bool) {
    bytes memory encodedRegisterSelector = abi.encodeWithSelector(REGISTER_USER, _address, _attributeKeys, _attributeValues);
    bytes memory execTransaction = abi.encodeWithSelector(IGnosisSafe.execTransaction.selector, compliance,0,encodedRegisterSelector,Enum.Operation.Call,0,0,0,address(0),payable(address(0)),_contractSignature());
    (bool success,) = Safe.functionCall(trusted, execTransaction, 0x20);
    return success;
  }

    /**
    * @notice Update a user's attribute keys or values in the contract
    * @dev Submits a transaction to the trustedIntermediary to query for the user's attributes. 
    * @param _userId The user id to be updated
    * @param _attributeKeys The array of attribute keys for the user, indexed by the attribute index
    * @param _attributeValues The array of attribute values for the user, indexed by the attribute index
    * @param trusted The address of the trusted intermediary contract 
    * @param compliance The address of the compliance contract
    */
    function _staticUpdateUserAttributes(
    uint256 _userId, 
    uint256[] memory _attributeKeys, 
    uint256[] memory _attributeValues,
    address trusted,
    address compliance
  ) private {
    bytes memory encodedUpdateUserSelector = abi.encodeWithSelector(UPDATE_USER, _userId, _attributeKeys, _attributeValues);
    _execTransaction(IGnosisSafe(trusted),compliance,0,encodedUpdateUserSelector,Enum.Operation.Call,0,0,0,address(0),payable(address(0)),_contractSignature());
  }

  /**
  * @notice Register an address to the contract as a user.
  * @dev Submits a transaction to the trustedIntermediary to registger a user. 
  * @param _address The address of the user to be registered
  * @param _attributeKeys The array of attribute keys for the user, indexed by the attribute index
  * @param _attributeValues The array of attribute values for the user, indexed
  * @param trusted The address of the trusted intermediary contract 
  * @param compliance The address of the compliance contract
  */
  function _staticRegisterUser(
    address _address,
    uint256[] memory _attributeKeys,
    uint256[] memory _attributeValues,
    address trusted,
    address compliance
  ) private {
    bytes memory encodedRegisterSelector = abi.encodeWithSelector(REGISTER_USER, _address, _attributeKeys, _attributeValues);
    _execTransaction(IGnosisSafe(trusted),compliance,0,encodedRegisterSelector,Enum.Operation.Call,0,0,0,address(0),payable(address(0)),_contractSignature());
  }

  /**
   * @notice Executes a transaction on the Gnosis Safe contract.
   * @dev This function is used to execute a transaction on the Gnosis Safe contract.
   * @param target The Gnosis Safe contract instance.
   * @param to The address to send the transaction to.
   * @param value The amount of Ether to send.
   * @param data The data to send with the transaction.
   * @param operation The type of operation to execute.
   * @param safeTxGas The amount of gas to use for the transaction.
   * @param baseGas The base amount of gas to use for the transaction.
   * @param gasPrice The gas price to use for the transaction.
   * @param gasToken The address of the token to use for the gas.
   * @param refundReceiver The address to receive any refunds.
   * @param signatures The signatures required to execute the transaction.
   */
  function _execTransaction(
    IGnosisSafe target,
    address to,
    uint256 value,
    bytes memory data,
    Enum.Operation operation,
    uint256 safeTxGas,
    uint256 baseGas,
    uint256 gasPrice,
    address gasToken,
    address payable refundReceiver,
    bytes memory signatures
  ) private {
    require(target.execTransaction(
      to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, signatures
    ), "AM20");
  }

  function _getTokenIds(address[] memory tokens, uint256 length) private view returns (uint256[] memory, uint256[] memory) {
    uint256[] memory tokenIds = new uint256[](length);
    uint256[] memory attributeValues = new uint256[](length);
    uint256 ruleNumber;
    uint256 tokenId;
    for (uint256 i = 0; i < length;) { 
      (ruleNumber, tokenId) = IBridgeToken(tokens[i]).rule(0); // token address => tokenId (attributeKeys)
      // Rule 11: User Attribute Valid Rule
      // https://github.com/MtPelerin/bridge-v2/blob/master/docs/RuleEngine.md#rules-index
      require(ruleNumber == 11, "AM17");
      (tokenIds[i], attributeValues[i]) = (tokenId, 1);
      unchecked { ++i; }
    }
    return (tokenIds, attributeValues);
  }

  function _safeGetTokenIds(address[] memory tokens, uint256 length) private view returns (bool, uint256[] memory, uint256[] memory) {
    uint256[] memory tokenIds = new uint256[](length);
    uint256[] memory attributeValues = new uint256[](length);
    uint256 ruleNumber;
    uint256 tokenId;
    bool success;
    bytes memory returndata;
    for (uint256 i = 0; i < length;) { 
      (success, returndata) = Safe.functionStaticCall(tokens[i], abi.encodeWithSelector(IBridgeToken.rule.selector, 0), 0x40);
      if (!success) return (false, tokenIds, attributeValues);
      (ruleNumber, tokenId) = abi.decode(returndata, (uint256, uint256));
      // Rule 11: User Attribute Valid Rule
      // https://github.com/MtPelerin/bridge-v2/blob/master/docs/RuleEngine.md#rules-index
      if (ruleNumber != 11) return (false, tokenIds, attributeValues);
      (tokenIds[i], attributeValues[i]) = (tokenId, 1);
      unchecked { ++i; }
    }
    return (true, tokenIds, attributeValues);
  }

  /// @param trustedIntermediary_ new address of trustedIntermediary in case of modifying KYC operator
  function setTrustedIntermediary(address trustedIntermediary_) external {
    _authWhitelist();
    _trustedIntermediary = trustedIntermediary_;
    emit TrustedIntermediaryUpdated(trustedIntermediary_);
  }

  /// @return _trustedIntermediary the address of GnosisSafe wallet which is the KYC operator
  function trustedIntermediary() external view returns (address) {
    return _trustedIntermediary;
  }

  /// @param complianceRegistry_ new address of complianceRegistry
  function setComplianceRegistry(IComplianceRegistry complianceRegistry_) external {
    _authWhitelist();
    _complianceRegistry = complianceRegistry_;
    emit ComplianceRegistryUpdated(complianceRegistry_);
  }

  /// @return _complianceRegistry ComplianceRegistry contract 
  function complianceRegistry() external view returns (IComplianceRegistry) {
    return _complianceRegistry;
  }

  /// @return contractSignature which is the signature of the contract to sign execTransaction 
  function contractSignature() external view returns (bytes memory) {
    return _contractSignature();
  }

  /**
   * @notice This function is used to authorize whitelisted addresses to access the contract.
   * @dev This function is used to authorize whitelisted addresses to access the contract. It is called by the owner of the contract to add or remove addresses from the whitelist.
   */
  function _authWhitelist() internal virtual;

  /**
   * @dev This empty reserved space is put in place to allow future versions to add new
   * variables without shifting down storage in the inheritance chain.
   * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
   */
  uint256[48] private __gap;
}

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

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract IAMB","name":"omnibridge","type":"address"}],"name":"BridgeContractSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"messageId","type":"bytes32"}],"name":"BuyBackInitiated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract IComplianceRegistry","name":"newComplianceRegistry","type":"address"}],"name":"ComplianceRegistryUpdated","type":"event"},{"anonymous":false,"inputs":[],"name":"EIP712DomainChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"messageId","type":"bytes32"}],"name":"FailedMessageRequest","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"messageId","type":"bytes32"}],"name":"ManualFix","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address[]","name":"localTokenList","type":"address[]"},{"indexed":false,"internalType":"address[]","name":"remoteTokenList","type":"address[]"}],"name":"TokenListSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"localToken","type":"address"},{"indexed":false,"internalType":"address","name":"remoteToken","type":"address"}],"name":"TokenSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newTrustedIntermediary","type":"address"}],"name":"TrustedIntermediaryUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"inputs":[],"name":"BRIDGE_BATCH_DESTINATION_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CREATE2_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OPERATOR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VERSION","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"validAfter","type":"uint256"},{"internalType":"uint256","name":"validBefore","type":"uint256"},{"internalType":"bytes32","name":"nonce","type":"bytes32"},{"internalType":"contract IERC3009","name":"token","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct RealtMediatorAMB.BatchTokenBridge[]","name":"data","type":"tuple[]"}],"name":"batchBridge","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"address","name":"destination","type":"address"}],"name":"batchBridgeFromVault","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"validAfter","type":"uint256"},{"internalType":"uint256","name":"validBefore","type":"uint256"},{"internalType":"bytes32","name":"nonce","type":"bytes32"},{"internalType":"contract IERC3009","name":"token","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct RealtMediatorAMB.BatchTokenBridge[]","name":"data","type":"tuple[]"},{"internalType":"address","name":"destination","type":"address"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"vs","type":"bytes32"}],"name":"batchBridgeWithDestination","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"validAfter","type":"uint256"},{"internalType":"uint256","name":"validBefore","type":"uint256"},{"internalType":"bytes32","name":"nonce","type":"bytes32"},{"internalType":"contract IERC3009","name":"token","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct RealtMediatorAMB.BatchTokenBridge[]","name":"data","type":"tuple[]"}],"name":"batchBuyBackBridge","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"address","name":"destination","type":"address"}],"name":"batchTransferFromVault","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"complianceRegistry","outputs":[{"internalType":"contract IComplianceRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractSignature","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"eip712Domain","outputs":[{"internalType":"bytes1","name":"fields","type":"bytes1"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"version","type":"string"},{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"address","name":"verifyingContract","type":"address"},{"internalType":"bytes32","name":"salt","type":"bytes32"},{"internalType":"uint256[]","name":"extensions","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_messageId","type":"bytes32"}],"name":"fixFailedMessage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"messageId","type":"bytes32"}],"name":"fixFailedMessageByAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getBatchTokenBridgeLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBridgeContract","outputs":[{"internalType":"contract IAMB","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBridgeInterfacesVersion","outputs":[{"internalType":"uint64","name":"","type":"uint64"},{"internalType":"uint64","name":"","type":"uint64"},{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBridgeMode","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBuyBack","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_msgId","type":"bytes32"}],"name":"getMessageFixed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPropertyVault","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_msgId","type":"bytes32"}],"name":"getPropertyVaultFailData","outputs":[{"internalType":"bool","name":"","type":"bool"},{"internalType":"address","name":"","type":"address"},{"internalType":"address[]","name":"","type":"address[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRequestGasLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_localTokenList","type":"address"}],"name":"getTokenMapping","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"handleBridgedTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"handleBridgedTokensFromVault","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner_","type":"address"},{"internalType":"address","name":"bridgeContract_","type":"address"},{"internalType":"uint256","name":"requestGasLimit_","type":"uint256"},{"internalType":"uint256","name":"batchTokenBridgeLimit_","type":"uint256"},{"internalType":"address","name":"trustedIntermediary","type":"address"},{"internalType":"address","name":"complianceRegistry_","type":"address"},{"internalType":"address","name":"propertyVault_","type":"address"},{"internalType":"address","name":"buyback_","type":"address"},{"internalType":"address","name":"create2_","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"onTokenTransfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_messageId","type":"bytes32"}],"name":"requestFailedMessageFix","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"messageId","type":"bytes32"}],"name":"retryVaultIssue","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"batchTokenBridgeLimit_","type":"uint256"}],"name":"setBatchTokenBridgeLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IAMB","name":"bridgeContract_","type":"address"}],"name":"setBridgeContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newBuyBack","type":"address"}],"name":"setBuyBack","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IComplianceRegistry","name":"complianceRegistry_","type":"address"}],"name":"setComplianceRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newPropertyVault","type":"address"}],"name":"setPropertyVault","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"requestGasLimit_","type":"uint256"}],"name":"setRequestGasLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"localToken","type":"address"},{"internalType":"address","name":"remoteToken","type":"address"}],"name":"setToken","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_localTokenList","type":"address[]"},{"internalType":"address[]","name":"_remoteTokenList","type":"address[]"}],"name":"setTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"trustedIntermediary_","type":"address"}],"name":"setTrustedIntermediary","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"trustedIntermediary","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"contract IBridgeToken","name":"token","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawTokenByAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60a0604052306080523480156200001557600080fd5b506200002062000026565b620000e7565b609654610100900460ff1615620000935760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60965460ff90811614620000e5576096805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b608051615c976200011f600039600081816110fe0152818161113e015281816115ca0152818161160a01526116990152615c976000f3fe6080604052600436106102e45760003560e01c806361702e6611610190578063b5f19b05116100dc578063cfa1edbd11610095578063f3b837911161006f578063f3b837911461096c578063f5b541a61461098c578063fb642c35146109ae578063ffa1ad74146109cd57600080fd5b8063cfa1edbd146108f8578063d547741f14610918578063ea6d7f1d1461093857600080fd5b8063b5f19b0514610819578063b66df0311461082e578063bad35df614610868578063c209fc4d14610898578063cac89c5c146108b8578063cee2f35d146108d657600080fd5b806391d1485411610149578063a217fddf11610123578063a217fddf1461079f578063a4acfed5146107b4578063a4c0ed36146107e4578063b1729b041461080457600080fd5b806391d14854146107205780639a4a4395146107405780639cb7595a1461076057600080fd5b806361702e66146106455780636766c128146106655780637060e908146106855780637f13d934146106a55780637f56929c146106d957806384b0196e146106f857600080fd5b80632f2ff15d1161024f57806342f5b4d21161020857806352d1902d116101e257806352d1902d146105d257806355d8b703146105e75780635ea3323514610607578063605f40cd1461062757600080fd5b806342f5b4d214610571578063437764df146105915780634f1ef286146105bf57600080fd5b80632f2ff15d146104b157806336568abe146104d15780633659cfe6146104f15780633d4aa9a914610511578063401f9bc61461053157806342cfc8451461055157600080fd5b806319eb97fd116102a157806319eb97fd146103c05780631da26a8b146103e0578063248a9ca31461040057806324ccbf7f1461043f5780632981f8651461045f5780632b696a5d1461047f57600080fd5b806301ffc9a7146102e957806302765e331461031e5780630294d56d1461033e5780630950d515146103605780630b26cf6614610380578063145e49a6146103a0575b600080fd5b3480156102f557600080fd5b50610309610304366004614c04565b6109f4565b60405190151581526020015b60405180910390f35b34801561032a57600080fd5b50610309610339366004614c7a565b610a2b565b34801561034a57600080fd5b5061035e610359366004614cfd565b610ad1565b005b34801561036c57600080fd5b5061035e61037b366004614cfd565b610b1d565b34801561038c57600080fd5b5061035e61039b366004614d16565b610b8b565b3480156103ac57600080fd5b5061035e6103bb366004614cfd565b610be8565b3480156103cc57600080fd5b506103096103db366004614d78565b610d2f565b3480156103ec57600080fd5b506103096103fb366004614db9565b610dee565b34801561040c57600080fd5b5061043161041b366004614cfd565b600090815261015f602052604090206001015490565b604051908152602001610315565b34801561044b57600080fd5b5061035e61045a366004614d16565b610ee0565b34801561046b57600080fd5b5061030961047a366004614df2565b610f36565b34801561048b57600080fd5b506064546001600160a01b03165b6040516001600160a01b039091168152602001610315565b3480156104bd57600080fd5b5061035e6104cc366004614e58565b61104b565b3480156104dd57600080fd5b5061035e6104ec366004614e58565b611076565b3480156104fd57600080fd5b5061035e61050c366004614d16565b6110f4565b34801561051d57600080fd5b5061035e61052c366004614e7d565b6111d0565b34801561053d57600080fd5b5061035e61054c366004614ebe565b611289565b34801561055d57600080fd5b5061035e61056c366004614f52565b61138d565b34801561057d57600080fd5b5061030961058c366004614c7a565b6114bb565b34801561059d57600080fd5b506105a661154d565b6040516001600160e01b03199091168152602001610315565b61035e6105cd366004615003565b6115c0565b3480156105de57600080fd5b5061043161168c565b3480156105f357600080fd5b5061035e610602366004614d16565b61173f565b34801561061357600080fd5b5061035e6106223660046150aa565b61175e565b34801561063357600080fd5b506000546001600160a01b0316610499565b34801561065157600080fd5b5061035e61066036600461512c565b61196b565b34801561067157600080fd5b5061035e610680366004614d16565b611b4a565b34801561069157600080fd5b506103096106a0366004614d78565b611b69565b3480156106b157600080fd5b506104317fc5aef48f0479b7f9e2039995fb836fd6d6595744dd05bf6818255128a712b1c481565b3480156106e557600080fd5b506101f9546001600160a01b0316610499565b34801561070457600080fd5b5061070d611bac565b6040516103159796959493929190615261565b34801561072c57600080fd5b5061030961073b366004614e58565b611c4c565b34801561074c57600080fd5b5061035e61075b366004614cfd565b611c78565b34801561076c57600080fd5b50610775611f8a565b604080516001600160401b0394851681529284166020840152921691810191909152606001610315565b3480156107ab57600080fd5b50610431600081565b3480156107c057600080fd5b506107d46107cf366004614cfd565b61200d565b604051610315949392919061530a565b3480156107f057600080fd5b506103096107ff366004615348565b612103565b34801561081057600080fd5b50600154610431565b34801561082557600080fd5b50600254610431565b34801561083a57600080fd5b50610499610849366004614d16565b6001600160a01b0390811660009081526101f760205260409020541690565b34801561087457600080fd5b50610309610883366004614cfd565b6000908152603a602052604090205460ff1690565b3480156108a457600080fd5b5061035e6108b3366004614cfd565b61230d565b3480156108c457600080fd5b506065546001600160a01b0316610499565b3480156108e257600080fd5b506108eb61231a565b60405161031591906153d0565b34801561090457600080fd5b5061035e610913366004614d16565b612341565b34801561092457600080fd5b5061035e610933366004614e58565b612397565b34801561094457600080fd5b506104317f52bb4257e934f54697b64e15b38575f35c49751df7c56535f1ef6073d710200481565b34801561097857600080fd5b5061035e610987366004614cfd565b6123bd565b34801561099857600080fd5b50610431600080516020615c1b83398151915281565b3480156109ba57600080fd5b506101f8546001600160a01b0316610499565b3480156109d957600080fd5b506109e2600181565b60405160ff9091168152602001610315565b60006001600160e01b03198216637965db0b60e01b1480610a2557506301ffc9a760e01b6001600160e01b03198316145b92915050565b6000336101f8541815610a645760405162461bcd60e51b81526020600482015260046024820152630829a62760e31b6044820152604881fd5b8460005b81811015610ac157610ab984898984818110610a8657610a866153e3565b9050602002016020810190610a9b9190614d16565b888885818110610aad57610aad6153e3565b90506020020135612417565b600101610a68565b5060019150505b95945050505050565b6000610adc816124bf565b610ae5826124c9565b6040518281527f816598dcb0fa419978fe652d84fac0c9a1e3972014bfc5dd17737f5847bfcb02906020015b60405180910390a15050565b6000546001600160a01b03163314610b505760405162461bcd60e51b8152600401610b47906153f9565b60405180910390fd5b30610b59612629565b6001600160a01b031614610b7f5760405162461bcd60e51b8152600401610b4790615417565b610b88816124c9565b50565b610b936126a1565b600080546001600160a01b0319166001600160a01b0383169081179091556040519081527fad098d6e912c08ed9aa3ee6ca9529da44a959d4c6251c6b8b088af216c1e3506906020015b60405180910390a150565b610bf06126ac565b60008181526032602052604090205460ff1615610c385760405162461bcd60e51b8152600401610b4790602080825260049082015263414d303960e01b604082015260600190565b610c57816000908152603260205260409020805460ff19166001179055565b600081815260336020526040812054819081906001600160a01b0316610c7c85612707565b610c8586612773565b8151929550909350915080610cc55760405162461bcd60e51b8152600401610b47906020808252600490820152630414d30360e41b604082015260600190565b610ccf84846127d4565b60005b81811015610d1f57610d1785858381518110610cf057610cf06153e3565b6020026020010151858481518110610d0a57610d0a6153e3565b6020026020010151612417565b600101610cd2565b5050505050610b8860016101c555565b6000610d396126ac565b6101f9546001600160a01b031680610d775760405162461bcd60e51b815260206004820152600460248201526320a6991960e11b6044820152604881fd5b600080600080610d8788886129a9565b93509350935093506000610d9e8587868686612e04565b90507f87821ee1dd81cfc42a110ae2105d82691622db762d11dda32be7b51f5d73c06581604051610dd191815260200190565b60405180910390a160019650505050505050610a2560016101c555565b600033610e1b7f52bb4257e934f54697b64e15b38575f35c49751df7c56535f1ef6073d710200482611c4c565b80610e395750610e39600080516020615c1b83398151915282611c4c565b610e6e5760405162461bcd60e51b8152600401610b479060208082526004908201526310534c8d60e21b604082015260600190565b6001600160a01b0384811660008181526101f7602090815260409182902080546001600160a01b031916948816948517905581519283528201929092527f0dd664a155dd89526bb019e22b00291bb7ca9d07ba3ec4a1a76b410da9797ceb910160405180910390a15060019392505050565b610ee86126a1565b606580546001600160a01b0319166001600160a01b0383169081179091556040519081527f98747757e5f0cf8ed88f5be95bf1fa9539ff10e55b2db045066f0bd3479052dc90602001610bdd565b6000610f406126ac565b600080600080610f508a8a6129a9565b93509350935093506000610fd37fc5aef48f0479b7f9e2039995fb836fd6d6595744dd05bf6818255128a712b1c460001b8a610f8c8e8e612f57565b604051602001610fb8939291909283526001600160a01b03919091166020830152604082015260600190565b60405160208183030381529060405280519060200120612f83565b9050846001600160a01b0316610fea828a8a612fb0565b6001600160a01b0316146110295760405162461bcd60e51b8152600401610b4790602080825260049082015263414d323160e01b604082015260600190565b611036858a868686612e04565b50600195505050505050610ac860016101c555565b600082815261015f6020526040902060010154611067816124bf565b6110718383612fd6565b505050565b6001600160a01b03811633146110e65760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610b47565b6110f0828261305d565b5050565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016300361113c5760405162461bcd60e51b8152600401610b4790615435565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316611185600080516020615bfb833981519152546001600160a01b031690565b6001600160a01b0316146111ab5760405162461bcd60e51b8152600401610b4790615481565b6111b4816130c5565b60408051600080825260208201909252610b88918391906130d0565b60006111db816124bf565b60405163a9059cbb60e01b81526001600160a01b0384811660048301526024820184905285169063a9059cbb906044016020604051808303816000875af115801561122a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061124e91906154cd565b6112835760405162461bcd60e51b8152600401610b479060208082526004908201526310534c4d60e21b604082015260600190565b50505050565b6000546001600160a01b031633146112b35760405162461bcd60e51b8152600401610b47906153f9565b306112bc612629565b6001600160a01b0316146112e25760405162461bcd60e51b8152600401610b4790615417565b826001600160a01b038087169088160361133357611333868686808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506127d492505050565b60005b818110156113835761137b87878784818110611354576113546153e3565b90506020020160208101906113699190614d16565b868685818110610aad57610aad6153e3565b600101611336565b5050505050505050565b600080516020615c1b8339815191526113a5816124bf565b838281146113de5760405162461bcd60e51b8152600401610b479060208082526004908201526320a6989b60e11b604082015260600190565b60005b81811015611475578484828181106113fb576113fb6153e3565b90506020020160208101906114109190614d16565b6101f76000898985818110611427576114276153e3565b905060200201602081019061143c9190614d16565b6001600160a01b039081168252602082019290925260400160002080546001600160a01b031916929091169190911790556001016113e1565b507fb524fc8b0c9d6ccb2f744f3f87a16acf66dec5ac24ebf9084dbc226c29c80fdc868686866040516114ab949392919061552d565b60405180910390a1505050505050565b6000336101f85418156114f45760405162461bcd60e51b81526020600482015260046024820152630829a62760e31b6044820152604881fd5b6000611500878761323b565b9050611540838287878080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061332192505050565b5060019695505050505050565b600080546001600160a01b03166001600160a01b031663437764df6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611597573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115bb9190615554565b905090565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036116085760405162461bcd60e51b8152600401610b4790615435565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316611651600080516020615bfb833981519152546001600160a01b031690565b6001600160a01b0316146116775760405162461bcd60e51b8152600401610b4790615481565b611680826130c5565b6110f0828260016130d0565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461172c5760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401610b47565b50600080516020615bfb83398151915290565b600080516020615c1b833981519152611757816124bf565b506101f855565b6000546001600160a01b031633146117885760405162461bcd60e51b8152600401610b47906153f9565b30611791612629565b6001600160a01b0316146117b75760405162461bcd60e51b8152600401610b4790615417565b6117bf6126ac565b60006117c9613400565b9050600061180a8787878080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061347892505050565b9050806118265761181f8288888888886135c3565b5050611959565b84606060008181805b858110156119505763a9059cbb60e01b8d8b8b84818110611852576118526153e3565b6040516001600160a01b039094166024850152602002919091013560448301525060640160408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915294506118dc8c8c838181106118bf576118bf6153e3565b90506020020160208101906118d49190614d16565b866020613619565b90945092508361192157611914888e8e8e859080926118fd93929190615571565b8e8e8790809261190f93929190615571565b6135c3565b5050505050505050611959565b61192a8361369a565b91508161194857611914888e8e8e859080926118fd93929190615571565b60010161182f565b50505050505050505b61196460016101c555565b5050505050565b609654600190610100900460ff1615801561198d575060965460ff8083169116105b6119f05760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610b47565b6096805461ffff191660ff831617610100179055611a0c6136b4565b611a146136e5565b611a1c6136e5565b611a69604051806040016040528060128152602001712922a0a62a2fa6a2a224a0aa27a92fa0a6a160711b815250604051806040016040528060018152602001603160f81b81525061370c565b611a7460008b612fd6565b611a8c600080516020615c1b8339815191528b612fd6565b611ab67f52bb4257e934f54697b64e15b38575f35c49751df7c56535f1ef6073d710200483612fd6565b611ac189898961373d565b611acb868661384a565b6101f880546001600160a01b038681166001600160a01b0319928316179092556101f98054928616929091169190911790556096805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150505050505050505050565b600080516020615c1b833981519152611b62816124bf565b506101f955565b6000611b736126ac565b600080600080611b8387876129a9565b9350935093509350611b988485858585612e04565b506001945050505050610a2560016101c555565b600060608060008060006060610191546000801b148015611bce575061019254155b611c125760405162461bcd60e51b81526020600482015260156024820152741152540dcc4c8e88155b9a5b9a5d1a585b1a5e9959605a1b6044820152606401610b47565b611c1a6138e4565b611c22613977565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b600091825261015f602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6000546040516332c2284360e21b8152600481018390526001600160a01b039091169063cb08a10c90602401602060405180830381865afa158015611cc1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ce591906154cd565b15611d1b5760405162461bcd60e51b8152600401610b4790602080825260049082015263414d313160e01b604082015260600190565b30611d2e6000546001600160a01b031690565b6001600160a01b0316633f9a8e7e836040518263ffffffff1660e01b8152600401611d5b91815260200190565b602060405180830381865afa158015611d78573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d9c919061559f565b6001600160a01b031614611ddb5760405162461bcd60e51b8152600401610b479060208082526004908201526320a6989960e11b604082015260600190565b30611dee6000546001600160a01b031690565b6001600160a01b0316634a610b04836040518263ffffffff1660e01b8152600401611e1b91815260200190565b602060405180830381865afa158015611e38573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e5c919061559f565b6001600160a01b031614611e9b5760405162461bcd60e51b8152600401610b4790602080825260049082015263414d313360e01b604082015260600190565b6040805160248082018490528251808303909101815260449091019091526020810180516001600160e01b0316630950d51560e01b1790526000546001600160a01b03166001600160a01b031663dc8601b33083611ef860015490565b6040518463ffffffff1660e01b8152600401611f16939291906155bc565b6020604051808303816000875af1158015611f35573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f5991906155f0565b506040518281527fd78fa0a0c39d07809c25c7ad80f18b134bab69f123261247025e0a6ed815065390602001610b11565b6000806000611fa16000546001600160a01b031690565b6001600160a01b0316639cb7595a6040518163ffffffff1660e01b8152600401606060405180830381865afa158015611fde573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120029190615625565b925092509250909192565b6000818152603260209081526040808320546033835281842054603584528285206034855283862081548551818802810188019096528086528796606096879660ff16956001600160a01b0316949392909184919083018282801561209b57602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161207d575b50505050509150808054806020026020016040519081016040528092919081815260200182805480156120ed57602002820191906000526020600020905b8154815260200190600101908083116120d9575b5050505050905093509350935093509193509193565b60006014821461213e5760405162461bcd60e51b8152600401610b4790602080825260049082015263414d303360e01b604082015260600190565b600084116121775760405162461bcd60e51b8152600401610b4790602080825260049082015263414d313960e01b604082015260600190565b3360008181526101f760205260409020546001600160a01b0316806121c75760405162461bcd60e51b8152600401610b479060208082526004908201526320a6981960e11b604082015260600190565b6040805160018082528183019092526000918291829160208083019080368337505060408051600180825281830190925291506020808301908036833750506040805160018082528183019092529150602080830190803683370190505092509250925084848a85600081518110612241576122416153e3565b602002602001018560008151811061225b5761225b6153e3565b6020026020010185600081518110612275576122756153e3565b6020026020010183815250836001600160a01b03166001600160a01b0316815250836001600160a01b03166001600160a01b03168152505050506122fa8a6122f28a8a8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061398792505050565b858585612e04565b506001955050505050505b949350505050565b6123156126a1565b600255565b60606115bb6060604051905060618101604052604181523060208201526001604182015290565b6123496126a1565b606480546001600160a01b0319166001600160a01b0383169081179091556040519081527facedbb427c2ee2d2bc122be66c57a084f951a0647a71df5259a3951fbedc82e290602001610bdd565b600082815261015f60205260409020600101546123b3816124bf565b611071838361305d565b6123c56126a1565b606481101580156123dd57506123d961398e565b8111155b6124125760405162461bcd60e51b8152600401610b4790602080825260049082015263414d323360e01b604082015260600190565b600155565b60405163a9059cbb60e01b81526001600160a01b0384811660048301526024820183905283169063a9059cbb906044016020604051808303816000875af1158015612466573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061248a91906154cd565b6110715760405162461bcd60e51b8152600401610b4790602080825260049082015263414d303560e01b604082015260600190565b610b8881336139e2565b6000818152603a602052604090205460ff16156125115760405162461bcd60e51b8152600401610b4790602080825260049082015263414d303960e01b604082015260600190565b612530816000908152603a60205260409020805460ff19166001179055565b60008060008061253f85613a3b565b61254886613aa5565b6000878152603760205260409020546001600160a01b03166000888152603660205260409020546001600160a01b0316835193975091955093509150806125ba5760405162461bcd60e51b8152600401610b47906020808252600490820152630414d30360e41b604082015260600190565b816001600160a01b0316836001600160a01b0316036125dd576125dd83866127d4565b60005b8181101561262057612618848783815181106125fe576125fe6153e3565b6020026020010151878481518110610d0a57610d0a6153e3565b6001016125e0565b50505050505050565b60008060009054906101000a90046001600160a01b03166001600160a01b031663d67bdd256040518163ffffffff1660e01b8152600401602060405180830381865afa15801561267d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115bb919061559f565b6000610b88816124bf565b60026101c554036126ff5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b47565b60026101c555565b60008181526035602090815260409182902080548351818402810184019094528084526060939283018282801561276757602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612749575b50505050509050919050565b60008181526034602090815260409182902080548351818402810184019094528084526060939283018282801561276757602002820191906000526020600020905b8154815260200190600101908083116127b55750505050509050919050565b6064546040805160018082528183019092526001600160a01b0390921691600091602080830190803683370190505090508181600081518110612819576128196153e3565b6001600160a01b039283166020918202929092010152606554604051636778887360e01b8152911690600090829063677888739061285d9086908a90600401615668565b6040805180830381865afa158015612879573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061289d9190615692565b5085519091506000806128b08884613b05565b91509150836000036128ce576128c98983838a89613cbe565b612996565b6040516326d5750160e01b81526000906001600160a01b038716906326d5750190612901908b90899088906004016156b7565b600060405180830381865afa15801561291e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261294691908101906156de565b905060005b8481101561298157818181518110612965576129656153e3565b602002602001015160000361298e576129818685858c8b613d51565b5050505050505050505050565b60010161294b565b505050505050505050565b60016101c555565b600060608080846129da565b60405162461bcd60e51b81526020600482015260046024820152816044820152604881fd5b806129ef576129ef6310534c0d60e21b6129b5565b600254811115612a0957612a096310534c0d60e21b6129b5565b8560008080836001600160401b03811115612a2657612a26614fbd565b604051908082528060200260200182016040528015612a4f578160200160208202803683370190505b50846001600160401b03811115612a6857612a68614fbd565b604051908082528060200260200182016040528015612a91578160200160208202803683370190505b50856001600160401b03811115612aaa57612aaa614fbd565b604051908082528060200260200182016040528015612ad3578160200160208202803683370190505b5092509250925060008b8b6000818110612aef57612aef6153e3565b9050610140020160a0016020810190612b089190614d16565b90503660008060005b88811015612dec578f8f82818110612b2b57612b2b6153e3565b61014002919091019450309050612b4860e0860160c08701614d16565b6001600160a01b031614612b875760405162461bcd60e51b8152600401610b47906020808252600490820152630414d31360e41b604082015260600190565b6001600160a01b038516612ba160c0860160a08701614d16565b6001600160a01b031614612be05760405162461bcd60e51b8152600401610b4790602080825260049082015263414d313560e01b604082015260600190565b8335612c175760405162461bcd60e51b8152600401610b4790602080825260049082015263414d313960e01b604082015260600190565b612c2760a0850160808601614d16565b6001600160a01b0380821660009081526101f76020526040902054169350915082612c7d5760405162461bcd60e51b8152600401610b479060208082526004908201526320a6981960e11b604082015260600190565b612c8d60a0850160808601614d16565b6001600160a01b031663e3ee160e612cab60c0870160a08801614d16565b612cbb60e0880160c08901614d16565b8735602089013560408a013560608b0135612cdd6101008d0160e08e01615783565b6040516001600160e01b031960e08a901b1681526001600160a01b03978816600482015296909516602487015260448601939093526064850191909152608484015260a483015260ff1660c482015261010087013560e482015261012087013561010482015261012401600060405180830381600087803b158015612d6157600080fd5b505af1158015612d75573d6000803e3d6000fd5b50505050818385600001358a8481518110612d9257612d926153e3565b602002602001018a8581518110612dab57612dab6153e3565b602002602001018a8681518110612dc457612dc46153e3565b60209081029190910101929092526001600160a01b0392831690915291169052600101612b11565b50929e959d50939b5091995092975050505050505050565b60008063401f9bc660e01b87878686604051602401612e2694939291906157a6565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915290506000612e6e6000546001600160a01b031690565b6001600160a01b031663dc8601b33084612e8760015490565b6040518463ffffffff1660e01b8152600401612ea5939291906155bc565b6020604051808303816000875af1158015612ec4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ee891906155f0565b600081815260366020526040902080546001600160a01b0319166001600160a01b038a161790559050600081815260376020526040902080546001600160a01b0319166001600160a01b038a16179055612f428187613d70565b612f4c8185613d8f565b979650505050505050565b600081610140026040016040518181016040526020815283602082015281858260400137209392505050565b6000610a25612f90613dae565b8360405161190160f01b8152600281019290925260228201526042902090565b6000806000612fc0868686613db8565b91509150612fcd81613de3565b50949350505050565b612fe08282611c4c565b6110f057600082815261015f602090815260408083206001600160a01b03851684529091529020805460ff191660011790556130193390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6130678282611c4c565b156110f057600082815261015f602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60006110f0816124bf565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156131035761107183613f2d565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561315d575060408051601f3d908101601f1916820190925261315a918101906155f0565b60015b6131c05760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610b47565b600080516020615bfb833981519152811461322f5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610b47565b50611071838383613fc9565b606081613270565b604080516048810190915262461bcd60e51b81526020600482015260046024820152816044820152604881fd5b80613285576132856310534c0d60e21b613243565b60025481111561329f5761329f6310534c0d60e21b613243565b836132b66020830260200160408051918201905290565b92508183526132cb6040808051918201905290565b60005b83811015613317576020810283013582526101f76020830152604082205482528151613304576133046320a6981960e11b613243565b81516020808302870101526001016132ce565b5050505092915050565b6000635ea3323560e01b848484604051602401613340939291906157d2565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915290506133866000546001600160a01b031690565b6001600160a01b031663dc8601b3308361339f60015490565b6040518463ffffffff1660e01b81526004016133bd939291906155bc565b6020604051808303816000875af11580156133dc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061196491906155f0565b60008060009054906101000a90046001600160a01b03166001600160a01b031663669f618b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015613454573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115bb91906155f0565b6064546040805160018082528183019092526000926001600160a01b0316918391906020808301908036833701905050905081816000815181106134be576134be6153e3565b6001600160a01b0392831660209182029290920101526065546040519116906000908190613539908490636778887360e01b906135019088908d90602401615668565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b03199094169390931790925290613fee565b915091508161355057600095505050505050610a25565b60008061355c83614048565b509150915081613576576000975050505050505050610a25565b60008060006135868c8d51614075565b925092509250826135a45760009a5050505050505050505050610a25565b6135b28d8383878e8d614204565b9d9c50505050505050505050505050565b600086815260336020908152604080832080546001600160a01b0319166001600160a01b038a16179055603590915290206135ff908585614aaf565b506000868152603460205260409020612620908383614b0e565b60006060600080866001600160a01b031660008760405161363a9190615808565b60006040518083038185875af1925050503d8060008114613677576040519150601f19603f3d011682016040523d82523d6000602084013e61367c565b606091505b509150915061368c828287614348565b935093505050935093915050565b6000602082015160028110156136ae578091505b50919050565b609654610100900460ff166136db5760405162461bcd60e51b8152600401610b4790615824565b6136e3614362565b565b609654610100900460ff166136e35760405162461bcd60e51b8152600401610b4790615824565b609654610100900460ff166137335760405162461bcd60e51b8152600401610b4790615824565b6110f08282614389565b600080546001600160a01b0319166001600160a01b038516179055606482108015906137ca5750826001600160a01b031663e5789d036040518163ffffffff1660e01b8152600401602060405180830381865afa1580156137a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137c691906155f0565b8211155b6137ff5760405162461bcd60e51b8152600401610b4790602080825260049082015263414d323360e01b604082015260600190565b600182905560028190556040516001600160a01b03841681527fad098d6e912c08ed9aa3ee6ca9529da44a959d4c6251c6b8b088af216c1e35069060200160405180910390a1505050565b606480546001600160a01b038481166001600160a01b0319928316811790935560658054918516919092161790556040519081527facedbb427c2ee2d2bc122be66c57a084f951a0647a71df5259a3951fbedc82e29060200160405180910390a16040516001600160a01b03821681527f98747757e5f0cf8ed88f5be95bf1fa9539ff10e55b2db045066f0bd3479052dc90602001610b11565b606061019380546138f49061586f565b80601f01602080910402602001604051908101604052809291908181526020018280546139209061586f565b801561396d5780601f106139425761010080835404028352916020019161396d565b820191906000526020600020905b81548152906001019060200180831161395057829003601f168201915b5050505050905090565b606061019480546138f49061586f565b6014015190565b60008060009054906101000a90046001600160a01b03166001600160a01b031663e5789d036040518163ffffffff1660e01b8152600401602060405180830381865afa158015613454573d6000803e3d6000fd5b6139ec8282611c4c565b6110f0576139f9816143dc565b613a048360206143ee565b604051602001613a159291906158a3565b60408051601f198184030181529082905262461bcd60e51b8252610b47916004016153d0565b600081815260386020908152604091829020805483518184028101840190945280845260609392830182828015612767576020028201919060005260206000209081546001600160a01b031681526001909101906020018083116127495750505050509050919050565b60008181526039602090815260409182902080548351818402810184019094528084526060939283018282801561276757602002820191906000526020600020908154815260200190600101908083116127b55750505050509050919050565b6060806000836001600160401b03811115613b2257613b22614fbd565b604051908082528060200260200182016040528015613b4b578160200160208202803683370190505b5090506000846001600160401b03811115613b6857613b68614fbd565b604051908082528060200260200182016040528015613b91578160200160208202803683370190505b50905060008060005b87811015613cad57888181518110613bb457613bb46153e3565b60200260200101516001600160a01b031663db18af6c60006040518263ffffffff1660e01b8152600401613bea91815260200190565b6040805180830381865afa158015613c06573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613c2a9190615918565b9093509150600b8314613c685760405162461bcd60e51b8152600401610b4790602080825260049082015263414d313760e01b604082015260600190565b816001868381518110613c7d57613c7d6153e3565b60200260200101868481518110613c9657613c966153e3565b602090810291909101019190915252600101613b9a565b5092945090925050505b9250929050565b60006394e2692a60e01b868686604051602401613cdd9392919061593c565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091529050613d498383600084818080808080613d446060604051905060618101604052604181523060208201526001604182015290565b614590565b505050505050565b600063f175fb9860e01b868686604051602401613cdd93929190615960565b6000828152603860209081526040909120825161107192840190614b49565b6000828152603960209081526040909120825161107192840190614b9e565b60006115bb614646565b6000806001600160ff1b03831681613dd560ff86901c601b61598f565b905061368c878288856146ba565b6000816004811115613df757613df76159a2565b03613dff5750565b6001816004811115613e1357613e136159a2565b03613e605760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610b47565b6002816004811115613e7457613e746159a2565b03613ec15760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610b47565b6003816004811115613ed557613ed56159a2565b03610b885760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610b47565b6001600160a01b0381163b613f9a5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610b47565b600080516020615bfb83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b613fd28361477e565b600082511180613fdf5750805b156110715761128383836147be565b60006060600080866001600160a01b03168660405161400d9190615808565b600060405180830381855afa9150503d8060008114613677576040519150601f19603f3d011682016040523d82523d6000602084013e61367c565b60008060006040840151600160a01b81101561406d5760019350602085015192508091505b509193909250565b60006060806000846001600160401b0381111561409457614094614fbd565b6040519080825280602002602001820160405280156140bd578160200160208202803683370190505b5090506000856001600160401b038111156140da576140da614fbd565b604051908082528060200260200182016040528015614103578160200160208202803683370190505b5090506000806000606060005b8a8110156141ed576141538c828151811061412d5761412d6153e3565b6020908102919091010151604051600060248201526336c62bdb60e21b90604401613501565b9093509150826141725750600098509496509294506141fd9350505050565b818060200190518101906141869190615918565b9095509350600b85146141a85750600098509496509294506141fd9350505050565b8360018883815181106141bd576141bd6153e3565b602002602001018884815181106141d6576141d66153e3565b602090810291909101019190915252600101614110565b5060019850949650929450505050505b9250925092565b84516000908482036142255761421d88888887876147e3565b91505061433e565b600080614298856326d5750160e01b888a8d604051602401614249939291906156b7565b60408051601f19818403018152919052602080820180516001600160e01b03166001600160e01b031990941693909317909252906142889087906159b8565b61429390604061598f565b613fee565b91509150816142ad576000935050505061433e565b60006142b982856148d9565b9050806142cd57600094505050505061433e565b6000828060200190518101906142e391906156de565b905060005b8581101561433357818181518110614302576143026153e3565b602002602001015160000361432b5761431e8a8d8d8c8c6148f8565b965050505050505061433e565b6001016142e8565b506001955050505050505b9695505050505050565b600060608480156143595750828451145b95939450505050565b609654610100900460ff166129a15760405162461bcd60e51b8152600401610b4790615824565b609654610100900460ff166143b05760405162461bcd60e51b8152600401610b4790615824565b6101936143bd8382615a15565b506101946143cb8282615a15565b505060006101918190556101925550565b6060610a256001600160a01b03831660145b606060006143fd8360026159b8565b61440890600261598f565b6001600160401b0381111561441f5761441f614fbd565b6040519080825280601f01601f191660200182016040528015614449576020820181803683370190505b509050600360fc1b81600081518110614464576144646153e3565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110614493576144936153e3565b60200101906001600160f81b031916908160001a90535060006144b78460026159b8565b6144c290600161598f565b90505b600181111561453a576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106144f6576144f66153e3565b1a60f81b82828151811061450c5761450c6153e3565b60200101906001600160f81b031916908160001a90535060049490941c9361453381615ad4565b90506144c5565b5083156145895760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610b47565b9392505050565b60405163353b090160e11b81526001600160a01b038c1690636a761202906145ce908d908d908d908d908d908d908d908d908d908d90600401615b0d565b6020604051808303816000875af11580156145ed573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061461191906154cd565b6129815760405162461bcd60e51b8152600401610b47906020808252600490820152630414d32360e41b604082015260600190565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f614671614918565b614679614976565b60408051602081019490945283019190915260608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156146f15750600090506003614775565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015614745573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661476e57600060019250925050614775565b9150600090505b94509492505050565b61478781613f2d565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606145898383604051806060016040528060278152602001615c3b602791396149a8565b6000806394e2692a60e01b8787876040516024016148039392919061593c565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091529050600063353b090160e11b84828481808080808061486f6060604051905060618101604052604181523060208201526001604182015290565b6040516024016148889a99989796959493929190615b80565b604051602081830303815290604052906001600160e01b0319166020820180516001600160e01b038381831617835250505050905060006148cb86836020613619565b509998505050505050505050565b600081604084015114602080850151141615610a255750600192915050565b60008063f175fb9860e01b87878760405160240161480393929190615960565b6000806149236138e4565b80519091501561493a578051602090910120919050565b61019154801561494a5792915050565b7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4709250505090565b5090565b600080614981613977565b805190915015614998578051602090910120919050565b61019254801561494a5792915050565b6060600080856001600160a01b0316856040516149c59190615808565b600060405180830381855af49150503d8060008114614a00576040519150601f19603f3d011682016040523d82523d6000602084013e614a05565b606091505b509150915061433e8683838760608315614a80578251600003614a79576001600160a01b0385163b614a795760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610b47565b5081612305565b6123058383815115614a955781518083602001fd5b8060405162461bcd60e51b8152600401610b4791906153d0565b828054828255906000526020600020908101928215614b02579160200282015b82811115614b025781546001600160a01b0319166001600160a01b03843516178255602090920191600190910190614acf565b50614972929150614bd9565b828054828255906000526020600020908101928215614b02579160200282015b82811115614b02578235825591602001919060010190614b2e565b828054828255906000526020600020908101928215614b02579160200282015b82811115614b0257825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190614b69565b828054828255906000526020600020908101928215614b02579160200282015b82811115614b02578251825591602001919060010190614bbe565b5b808211156149725760008155600101614bda565b6001600160e01b031981168114610b8857600080fd5b600060208284031215614c1657600080fd5b813561458981614bee565b60008083601f840112614c3357600080fd5b5081356001600160401b03811115614c4a57600080fd5b6020830191508360208260051b8501011115613cb757600080fd5b6001600160a01b0381168114610b8857600080fd5b600080600080600060608688031215614c9257600080fd5b85356001600160401b0380821115614ca957600080fd5b614cb589838a01614c21565b90975095506020880135915080821115614cce57600080fd5b50614cdb88828901614c21565b9094509250506040860135614cef81614c65565b809150509295509295909350565b600060208284031215614d0f57600080fd5b5035919050565b600060208284031215614d2857600080fd5b813561458981614c65565b60008083601f840112614d4557600080fd5b5081356001600160401b03811115614d5c57600080fd5b60208301915083602061014083028501011115613cb757600080fd5b60008060208385031215614d8b57600080fd5b82356001600160401b03811115614da157600080fd5b614dad85828601614d33565b90969095509350505050565b60008060408385031215614dcc57600080fd5b8235614dd781614c65565b91506020830135614de781614c65565b809150509250929050565b600080600080600060808688031215614e0a57600080fd5b85356001600160401b03811115614e2057600080fd5b614e2c88828901614d33565b9096509450506020860135614e4081614c65565b94979396509394604081013594506060013592915050565b60008060408385031215614e6b57600080fd5b823591506020830135614de781614c65565b600080600060608486031215614e9257600080fd5b8335614e9d81614c65565b92506020840135614ead81614c65565b929592945050506040919091013590565b60008060008060008060808789031215614ed757600080fd5b8635614ee281614c65565b95506020870135614ef281614c65565b945060408701356001600160401b0380821115614f0e57600080fd5b614f1a8a838b01614c21565b90965094506060890135915080821115614f3357600080fd5b50614f4089828a01614c21565b979a9699509497509295939492505050565b60008060008060408587031215614f6857600080fd5b84356001600160401b0380821115614f7f57600080fd5b614f8b88838901614c21565b90965094506020870135915080821115614fa457600080fd5b50614fb187828801614c21565b95989497509550505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715614ffb57614ffb614fbd565b604052919050565b6000806040838503121561501657600080fd5b823561502181614c65565b91506020838101356001600160401b038082111561503e57600080fd5b818601915086601f83011261505257600080fd5b81358181111561506457615064614fbd565b615076601f8201601f19168501614fd3565b9150808252878482850101111561508c57600080fd5b80848401858401376000848284010152508093505050509250929050565b6000806000806000606086880312156150c257600080fd5b85356150cd81614c65565b945060208601356001600160401b03808211156150e957600080fd5b6150f589838a01614c21565b9096509450604088013591508082111561510e57600080fd5b5061511b88828901614c21565b969995985093965092949392505050565b60008060008060008060008060006101208a8c03121561514b57600080fd5b893561515681614c65565b985060208a013561516681614c65565b975060408a0135965060608a0135955060808a013561518481614c65565b945060a08a013561519481614c65565b935060c08a01356151a481614c65565b925060e08a01356151b481614c65565b91506101008a01356151c581614c65565b809150509295985092959850929598565b60005b838110156151f15781810151838201526020016151d9565b50506000910152565b600081518084526152128160208601602086016151d6565b601f01601f19169290920160200192915050565b600081518084526020808501945080840160005b838110156152565781518752958201959082019060010161523a565b509495945050505050565b60ff60f81b8816815260e06020820152600061528060e08301896151fa565b828103604084015261529281896151fa565b606084018890526001600160a01b038716608085015260a0840186905283810360c085015290506152c38185615226565b9a9950505050505050505050565b600081518084526020808501945080840160005b838110156152565781516001600160a01b0316875295820195908201906001016152e5565b84151581526001600160a01b0384166020820152608060408201819052600090615336908301856152d1565b8281036060840152612f4c8185615226565b6000806000806060858703121561535e57600080fd5b843561536981614c65565b93506020850135925060408501356001600160401b038082111561538c57600080fd5b818701915087601f8301126153a057600080fd5b8135818111156153af57600080fd5b8860208285010111156153c157600080fd5b95989497505060200194505050565b60208152600061458960208301846151fa565b634e487b7160e01b600052603260045260246000fd5b602080825260049082015263414d303760e01b604082015260600190565b6020808252600490820152630829a60760e31b604082015260600190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b6000602082840312156154df57600080fd5b8151801515811461458957600080fd5b8183526000602080850194508260005b8581101561525657813561551281614c65565b6001600160a01b0316875295820195908201906001016154ff565b6040815260006155416040830186886154ef565b8281036020840152612f4c8185876154ef565b60006020828403121561556657600080fd5b815161458981614bee565b6000808585111561558157600080fd5b8386111561558e57600080fd5b5050600583901b0193919092039150565b6000602082840312156155b157600080fd5b815161458981614c65565b6001600160a01b03841681526060602082018190526000906155e0908301856151fa565b9050826040830152949350505050565b60006020828403121561560257600080fd5b5051919050565b80516001600160401b038116811461562057600080fd5b919050565b60008060006060848603121561563a57600080fd5b61564384615609565b925061565160208501615609565b915061565f60408501615609565b90509250925092565b60408152600061567b60408301856152d1565b905060018060a01b03831660208301529392505050565b600080604083850312156156a557600080fd5b825191506020830151614de781614c65565b60018060a01b0384168152826020820152606060408201526000610ac86060830184615226565b600060208083850312156156f157600080fd5b82516001600160401b038082111561570857600080fd5b818501915085601f83011261571c57600080fd5b81518181111561572e5761572e614fbd565b8060051b915061573f848301614fd3565b818152918301840191848101908884111561575957600080fd5b938501935b838510156157775784518252938501939085019061575e565b98975050505050505050565b60006020828403121561579557600080fd5b813560ff8116811461458957600080fd5b6001600160a01b03858116825284166020820152608060408201819052600090615336908301856152d1565b6001600160a01b03841681526060602082018190526000906157f6908301856152d1565b828103604084015261433e8185615226565b6000825161581a8184602087016151d6565b9190910192915050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600181811c9082168061588357607f821691505b6020821081036136ae57634e487b7160e01b600052602260045260246000fd5b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516158db8160178501602088016151d6565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161590c8160288401602088016151d6565b01602801949350505050565b6000806040838503121561592b57600080fd5b505080516020909101519092909150565b6001600160a01b03841681526060602082018190526000906157f690830185615226565b8381526060602082015260006157f66060830185615226565b634e487b7160e01b600052601160045260246000fd5b80820180821115610a2557610a25615979565b634e487b7160e01b600052602160045260246000fd5b8082028115828204841417610a2557610a25615979565b601f82111561107157600081815260208120601f850160051c810160208610156159f65750805b601f850160051c820191505b81811015613d4957828155600101615a02565b81516001600160401b03811115615a2e57615a2e614fbd565b615a4281615a3c845461586f565b846159cf565b602080601f831160018114615a775760008415615a5f5750858301515b600019600386901b1c1916600185901b178555613d49565b600085815260208120601f198616915b82811015615aa657888601518255948401946001909101908401615a87565b5085821015615ac45787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600081615ae357615ae3615979565b506000190190565b60028110615b0957634e487b7160e01b600052602160045260246000fd5b9052565b6001600160a01b038b81168252602082018b905261014060408301819052600091615b3a8483018d6151fa565b9150615b49606085018c615aeb565b8960808501528860a08501528760c085015280871660e0850152808616610100850152508281036101208401526135b281856151fa565b6001600160a01b038b8116825260ff8b16602083015261014060408301819052600091615baf8483018d6151fa565b9150615bbe606085018c615aeb565b60ff8a8116608086015289811660a0860152881660c085015286811660e085015285166101008401528281036101208401526135b281856151fa56fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201da49eeb9643b2e18e6d137a8f85bd63265aa4268c4c4f7c7a13346657dfb4ee64736f6c63430008120033

Deployed Bytecode

0x6080604052600436106102e45760003560e01c806361702e6611610190578063b5f19b05116100dc578063cfa1edbd11610095578063f3b837911161006f578063f3b837911461096c578063f5b541a61461098c578063fb642c35146109ae578063ffa1ad74146109cd57600080fd5b8063cfa1edbd146108f8578063d547741f14610918578063ea6d7f1d1461093857600080fd5b8063b5f19b0514610819578063b66df0311461082e578063bad35df614610868578063c209fc4d14610898578063cac89c5c146108b8578063cee2f35d146108d657600080fd5b806391d1485411610149578063a217fddf11610123578063a217fddf1461079f578063a4acfed5146107b4578063a4c0ed36146107e4578063b1729b041461080457600080fd5b806391d14854146107205780639a4a4395146107405780639cb7595a1461076057600080fd5b806361702e66146106455780636766c128146106655780637060e908146106855780637f13d934146106a55780637f56929c146106d957806384b0196e146106f857600080fd5b80632f2ff15d1161024f57806342f5b4d21161020857806352d1902d116101e257806352d1902d146105d257806355d8b703146105e75780635ea3323514610607578063605f40cd1461062757600080fd5b806342f5b4d214610571578063437764df146105915780634f1ef286146105bf57600080fd5b80632f2ff15d146104b157806336568abe146104d15780633659cfe6146104f15780633d4aa9a914610511578063401f9bc61461053157806342cfc8451461055157600080fd5b806319eb97fd116102a157806319eb97fd146103c05780631da26a8b146103e0578063248a9ca31461040057806324ccbf7f1461043f5780632981f8651461045f5780632b696a5d1461047f57600080fd5b806301ffc9a7146102e957806302765e331461031e5780630294d56d1461033e5780630950d515146103605780630b26cf6614610380578063145e49a6146103a0575b600080fd5b3480156102f557600080fd5b50610309610304366004614c04565b6109f4565b60405190151581526020015b60405180910390f35b34801561032a57600080fd5b50610309610339366004614c7a565b610a2b565b34801561034a57600080fd5b5061035e610359366004614cfd565b610ad1565b005b34801561036c57600080fd5b5061035e61037b366004614cfd565b610b1d565b34801561038c57600080fd5b5061035e61039b366004614d16565b610b8b565b3480156103ac57600080fd5b5061035e6103bb366004614cfd565b610be8565b3480156103cc57600080fd5b506103096103db366004614d78565b610d2f565b3480156103ec57600080fd5b506103096103fb366004614db9565b610dee565b34801561040c57600080fd5b5061043161041b366004614cfd565b600090815261015f602052604090206001015490565b604051908152602001610315565b34801561044b57600080fd5b5061035e61045a366004614d16565b610ee0565b34801561046b57600080fd5b5061030961047a366004614df2565b610f36565b34801561048b57600080fd5b506064546001600160a01b03165b6040516001600160a01b039091168152602001610315565b3480156104bd57600080fd5b5061035e6104cc366004614e58565b61104b565b3480156104dd57600080fd5b5061035e6104ec366004614e58565b611076565b3480156104fd57600080fd5b5061035e61050c366004614d16565b6110f4565b34801561051d57600080fd5b5061035e61052c366004614e7d565b6111d0565b34801561053d57600080fd5b5061035e61054c366004614ebe565b611289565b34801561055d57600080fd5b5061035e61056c366004614f52565b61138d565b34801561057d57600080fd5b5061030961058c366004614c7a565b6114bb565b34801561059d57600080fd5b506105a661154d565b6040516001600160e01b03199091168152602001610315565b61035e6105cd366004615003565b6115c0565b3480156105de57600080fd5b5061043161168c565b3480156105f357600080fd5b5061035e610602366004614d16565b61173f565b34801561061357600080fd5b5061035e6106223660046150aa565b61175e565b34801561063357600080fd5b506000546001600160a01b0316610499565b34801561065157600080fd5b5061035e61066036600461512c565b61196b565b34801561067157600080fd5b5061035e610680366004614d16565b611b4a565b34801561069157600080fd5b506103096106a0366004614d78565b611b69565b3480156106b157600080fd5b506104317fc5aef48f0479b7f9e2039995fb836fd6d6595744dd05bf6818255128a712b1c481565b3480156106e557600080fd5b506101f9546001600160a01b0316610499565b34801561070457600080fd5b5061070d611bac565b6040516103159796959493929190615261565b34801561072c57600080fd5b5061030961073b366004614e58565b611c4c565b34801561074c57600080fd5b5061035e61075b366004614cfd565b611c78565b34801561076c57600080fd5b50610775611f8a565b604080516001600160401b0394851681529284166020840152921691810191909152606001610315565b3480156107ab57600080fd5b50610431600081565b3480156107c057600080fd5b506107d46107cf366004614cfd565b61200d565b604051610315949392919061530a565b3480156107f057600080fd5b506103096107ff366004615348565b612103565b34801561081057600080fd5b50600154610431565b34801561082557600080fd5b50600254610431565b34801561083a57600080fd5b50610499610849366004614d16565b6001600160a01b0390811660009081526101f760205260409020541690565b34801561087457600080fd5b50610309610883366004614cfd565b6000908152603a602052604090205460ff1690565b3480156108a457600080fd5b5061035e6108b3366004614cfd565b61230d565b3480156108c457600080fd5b506065546001600160a01b0316610499565b3480156108e257600080fd5b506108eb61231a565b60405161031591906153d0565b34801561090457600080fd5b5061035e610913366004614d16565b612341565b34801561092457600080fd5b5061035e610933366004614e58565b612397565b34801561094457600080fd5b506104317f52bb4257e934f54697b64e15b38575f35c49751df7c56535f1ef6073d710200481565b34801561097857600080fd5b5061035e610987366004614cfd565b6123bd565b34801561099857600080fd5b50610431600080516020615c1b83398151915281565b3480156109ba57600080fd5b506101f8546001600160a01b0316610499565b3480156109d957600080fd5b506109e2600181565b60405160ff9091168152602001610315565b60006001600160e01b03198216637965db0b60e01b1480610a2557506301ffc9a760e01b6001600160e01b03198316145b92915050565b6000336101f8541815610a645760405162461bcd60e51b81526020600482015260046024820152630829a62760e31b6044820152604881fd5b8460005b81811015610ac157610ab984898984818110610a8657610a866153e3565b9050602002016020810190610a9b9190614d16565b888885818110610aad57610aad6153e3565b90506020020135612417565b600101610a68565b5060019150505b95945050505050565b6000610adc816124bf565b610ae5826124c9565b6040518281527f816598dcb0fa419978fe652d84fac0c9a1e3972014bfc5dd17737f5847bfcb02906020015b60405180910390a15050565b6000546001600160a01b03163314610b505760405162461bcd60e51b8152600401610b47906153f9565b60405180910390fd5b30610b59612629565b6001600160a01b031614610b7f5760405162461bcd60e51b8152600401610b4790615417565b610b88816124c9565b50565b610b936126a1565b600080546001600160a01b0319166001600160a01b0383169081179091556040519081527fad098d6e912c08ed9aa3ee6ca9529da44a959d4c6251c6b8b088af216c1e3506906020015b60405180910390a150565b610bf06126ac565b60008181526032602052604090205460ff1615610c385760405162461bcd60e51b8152600401610b4790602080825260049082015263414d303960e01b604082015260600190565b610c57816000908152603260205260409020805460ff19166001179055565b600081815260336020526040812054819081906001600160a01b0316610c7c85612707565b610c8586612773565b8151929550909350915080610cc55760405162461bcd60e51b8152600401610b47906020808252600490820152630414d30360e41b604082015260600190565b610ccf84846127d4565b60005b81811015610d1f57610d1785858381518110610cf057610cf06153e3565b6020026020010151858481518110610d0a57610d0a6153e3565b6020026020010151612417565b600101610cd2565b5050505050610b8860016101c555565b6000610d396126ac565b6101f9546001600160a01b031680610d775760405162461bcd60e51b815260206004820152600460248201526320a6991960e11b6044820152604881fd5b600080600080610d8788886129a9565b93509350935093506000610d9e8587868686612e04565b90507f87821ee1dd81cfc42a110ae2105d82691622db762d11dda32be7b51f5d73c06581604051610dd191815260200190565b60405180910390a160019650505050505050610a2560016101c555565b600033610e1b7f52bb4257e934f54697b64e15b38575f35c49751df7c56535f1ef6073d710200482611c4c565b80610e395750610e39600080516020615c1b83398151915282611c4c565b610e6e5760405162461bcd60e51b8152600401610b479060208082526004908201526310534c8d60e21b604082015260600190565b6001600160a01b0384811660008181526101f7602090815260409182902080546001600160a01b031916948816948517905581519283528201929092527f0dd664a155dd89526bb019e22b00291bb7ca9d07ba3ec4a1a76b410da9797ceb910160405180910390a15060019392505050565b610ee86126a1565b606580546001600160a01b0319166001600160a01b0383169081179091556040519081527f98747757e5f0cf8ed88f5be95bf1fa9539ff10e55b2db045066f0bd3479052dc90602001610bdd565b6000610f406126ac565b600080600080610f508a8a6129a9565b93509350935093506000610fd37fc5aef48f0479b7f9e2039995fb836fd6d6595744dd05bf6818255128a712b1c460001b8a610f8c8e8e612f57565b604051602001610fb8939291909283526001600160a01b03919091166020830152604082015260600190565b60405160208183030381529060405280519060200120612f83565b9050846001600160a01b0316610fea828a8a612fb0565b6001600160a01b0316146110295760405162461bcd60e51b8152600401610b4790602080825260049082015263414d323160e01b604082015260600190565b611036858a868686612e04565b50600195505050505050610ac860016101c555565b600082815261015f6020526040902060010154611067816124bf565b6110718383612fd6565b505050565b6001600160a01b03811633146110e65760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610b47565b6110f0828261305d565b5050565b6001600160a01b037f0000000000000000000000005af2460902bfd79e54926931e61ee03937173bea16300361113c5760405162461bcd60e51b8152600401610b4790615435565b7f0000000000000000000000005af2460902bfd79e54926931e61ee03937173bea6001600160a01b0316611185600080516020615bfb833981519152546001600160a01b031690565b6001600160a01b0316146111ab5760405162461bcd60e51b8152600401610b4790615481565b6111b4816130c5565b60408051600080825260208201909252610b88918391906130d0565b60006111db816124bf565b60405163a9059cbb60e01b81526001600160a01b0384811660048301526024820184905285169063a9059cbb906044016020604051808303816000875af115801561122a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061124e91906154cd565b6112835760405162461bcd60e51b8152600401610b479060208082526004908201526310534c4d60e21b604082015260600190565b50505050565b6000546001600160a01b031633146112b35760405162461bcd60e51b8152600401610b47906153f9565b306112bc612629565b6001600160a01b0316146112e25760405162461bcd60e51b8152600401610b4790615417565b826001600160a01b038087169088160361133357611333868686808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506127d492505050565b60005b818110156113835761137b87878784818110611354576113546153e3565b90506020020160208101906113699190614d16565b868685818110610aad57610aad6153e3565b600101611336565b5050505050505050565b600080516020615c1b8339815191526113a5816124bf565b838281146113de5760405162461bcd60e51b8152600401610b479060208082526004908201526320a6989b60e11b604082015260600190565b60005b81811015611475578484828181106113fb576113fb6153e3565b90506020020160208101906114109190614d16565b6101f76000898985818110611427576114276153e3565b905060200201602081019061143c9190614d16565b6001600160a01b039081168252602082019290925260400160002080546001600160a01b031916929091169190911790556001016113e1565b507fb524fc8b0c9d6ccb2f744f3f87a16acf66dec5ac24ebf9084dbc226c29c80fdc868686866040516114ab949392919061552d565b60405180910390a1505050505050565b6000336101f85418156114f45760405162461bcd60e51b81526020600482015260046024820152630829a62760e31b6044820152604881fd5b6000611500878761323b565b9050611540838287878080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061332192505050565b5060019695505050505050565b600080546001600160a01b03166001600160a01b031663437764df6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611597573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115bb9190615554565b905090565b6001600160a01b037f0000000000000000000000005af2460902bfd79e54926931e61ee03937173bea1630036116085760405162461bcd60e51b8152600401610b4790615435565b7f0000000000000000000000005af2460902bfd79e54926931e61ee03937173bea6001600160a01b0316611651600080516020615bfb833981519152546001600160a01b031690565b6001600160a01b0316146116775760405162461bcd60e51b8152600401610b4790615481565b611680826130c5565b6110f0828260016130d0565b6000306001600160a01b037f0000000000000000000000005af2460902bfd79e54926931e61ee03937173bea161461172c5760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401610b47565b50600080516020615bfb83398151915290565b600080516020615c1b833981519152611757816124bf565b506101f855565b6000546001600160a01b031633146117885760405162461bcd60e51b8152600401610b47906153f9565b30611791612629565b6001600160a01b0316146117b75760405162461bcd60e51b8152600401610b4790615417565b6117bf6126ac565b60006117c9613400565b9050600061180a8787878080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061347892505050565b9050806118265761181f8288888888886135c3565b5050611959565b84606060008181805b858110156119505763a9059cbb60e01b8d8b8b84818110611852576118526153e3565b6040516001600160a01b039094166024850152602002919091013560448301525060640160408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915294506118dc8c8c838181106118bf576118bf6153e3565b90506020020160208101906118d49190614d16565b866020613619565b90945092508361192157611914888e8e8e859080926118fd93929190615571565b8e8e8790809261190f93929190615571565b6135c3565b5050505050505050611959565b61192a8361369a565b91508161194857611914888e8e8e859080926118fd93929190615571565b60010161182f565b50505050505050505b61196460016101c555565b5050505050565b609654600190610100900460ff1615801561198d575060965460ff8083169116105b6119f05760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610b47565b6096805461ffff191660ff831617610100179055611a0c6136b4565b611a146136e5565b611a1c6136e5565b611a69604051806040016040528060128152602001712922a0a62a2fa6a2a224a0aa27a92fa0a6a160711b815250604051806040016040528060018152602001603160f81b81525061370c565b611a7460008b612fd6565b611a8c600080516020615c1b8339815191528b612fd6565b611ab67f52bb4257e934f54697b64e15b38575f35c49751df7c56535f1ef6073d710200483612fd6565b611ac189898961373d565b611acb868661384a565b6101f880546001600160a01b038681166001600160a01b0319928316179092556101f98054928616929091169190911790556096805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150505050505050505050565b600080516020615c1b833981519152611b62816124bf565b506101f955565b6000611b736126ac565b600080600080611b8387876129a9565b9350935093509350611b988485858585612e04565b506001945050505050610a2560016101c555565b600060608060008060006060610191546000801b148015611bce575061019254155b611c125760405162461bcd60e51b81526020600482015260156024820152741152540dcc4c8e88155b9a5b9a5d1a585b1a5e9959605a1b6044820152606401610b47565b611c1a6138e4565b611c22613977565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b600091825261015f602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6000546040516332c2284360e21b8152600481018390526001600160a01b039091169063cb08a10c90602401602060405180830381865afa158015611cc1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ce591906154cd565b15611d1b5760405162461bcd60e51b8152600401610b4790602080825260049082015263414d313160e01b604082015260600190565b30611d2e6000546001600160a01b031690565b6001600160a01b0316633f9a8e7e836040518263ffffffff1660e01b8152600401611d5b91815260200190565b602060405180830381865afa158015611d78573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d9c919061559f565b6001600160a01b031614611ddb5760405162461bcd60e51b8152600401610b479060208082526004908201526320a6989960e11b604082015260600190565b30611dee6000546001600160a01b031690565b6001600160a01b0316634a610b04836040518263ffffffff1660e01b8152600401611e1b91815260200190565b602060405180830381865afa158015611e38573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e5c919061559f565b6001600160a01b031614611e9b5760405162461bcd60e51b8152600401610b4790602080825260049082015263414d313360e01b604082015260600190565b6040805160248082018490528251808303909101815260449091019091526020810180516001600160e01b0316630950d51560e01b1790526000546001600160a01b03166001600160a01b031663dc8601b33083611ef860015490565b6040518463ffffffff1660e01b8152600401611f16939291906155bc565b6020604051808303816000875af1158015611f35573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f5991906155f0565b506040518281527fd78fa0a0c39d07809c25c7ad80f18b134bab69f123261247025e0a6ed815065390602001610b11565b6000806000611fa16000546001600160a01b031690565b6001600160a01b0316639cb7595a6040518163ffffffff1660e01b8152600401606060405180830381865afa158015611fde573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120029190615625565b925092509250909192565b6000818152603260209081526040808320546033835281842054603584528285206034855283862081548551818802810188019096528086528796606096879660ff16956001600160a01b0316949392909184919083018282801561209b57602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161207d575b50505050509150808054806020026020016040519081016040528092919081815260200182805480156120ed57602002820191906000526020600020905b8154815260200190600101908083116120d9575b5050505050905093509350935093509193509193565b60006014821461213e5760405162461bcd60e51b8152600401610b4790602080825260049082015263414d303360e01b604082015260600190565b600084116121775760405162461bcd60e51b8152600401610b4790602080825260049082015263414d313960e01b604082015260600190565b3360008181526101f760205260409020546001600160a01b0316806121c75760405162461bcd60e51b8152600401610b479060208082526004908201526320a6981960e11b604082015260600190565b6040805160018082528183019092526000918291829160208083019080368337505060408051600180825281830190925291506020808301908036833750506040805160018082528183019092529150602080830190803683370190505092509250925084848a85600081518110612241576122416153e3565b602002602001018560008151811061225b5761225b6153e3565b6020026020010185600081518110612275576122756153e3565b6020026020010183815250836001600160a01b03166001600160a01b0316815250836001600160a01b03166001600160a01b03168152505050506122fa8a6122f28a8a8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061398792505050565b858585612e04565b506001955050505050505b949350505050565b6123156126a1565b600255565b60606115bb6060604051905060618101604052604181523060208201526001604182015290565b6123496126a1565b606480546001600160a01b0319166001600160a01b0383169081179091556040519081527facedbb427c2ee2d2bc122be66c57a084f951a0647a71df5259a3951fbedc82e290602001610bdd565b600082815261015f60205260409020600101546123b3816124bf565b611071838361305d565b6123c56126a1565b606481101580156123dd57506123d961398e565b8111155b6124125760405162461bcd60e51b8152600401610b4790602080825260049082015263414d323360e01b604082015260600190565b600155565b60405163a9059cbb60e01b81526001600160a01b0384811660048301526024820183905283169063a9059cbb906044016020604051808303816000875af1158015612466573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061248a91906154cd565b6110715760405162461bcd60e51b8152600401610b4790602080825260049082015263414d303560e01b604082015260600190565b610b8881336139e2565b6000818152603a602052604090205460ff16156125115760405162461bcd60e51b8152600401610b4790602080825260049082015263414d303960e01b604082015260600190565b612530816000908152603a60205260409020805460ff19166001179055565b60008060008061253f85613a3b565b61254886613aa5565b6000878152603760205260409020546001600160a01b03166000888152603660205260409020546001600160a01b0316835193975091955093509150806125ba5760405162461bcd60e51b8152600401610b47906020808252600490820152630414d30360e41b604082015260600190565b816001600160a01b0316836001600160a01b0316036125dd576125dd83866127d4565b60005b8181101561262057612618848783815181106125fe576125fe6153e3565b6020026020010151878481518110610d0a57610d0a6153e3565b6001016125e0565b50505050505050565b60008060009054906101000a90046001600160a01b03166001600160a01b031663d67bdd256040518163ffffffff1660e01b8152600401602060405180830381865afa15801561267d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115bb919061559f565b6000610b88816124bf565b60026101c554036126ff5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b47565b60026101c555565b60008181526035602090815260409182902080548351818402810184019094528084526060939283018282801561276757602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612749575b50505050509050919050565b60008181526034602090815260409182902080548351818402810184019094528084526060939283018282801561276757602002820191906000526020600020905b8154815260200190600101908083116127b55750505050509050919050565b6064546040805160018082528183019092526001600160a01b0390921691600091602080830190803683370190505090508181600081518110612819576128196153e3565b6001600160a01b039283166020918202929092010152606554604051636778887360e01b8152911690600090829063677888739061285d9086908a90600401615668565b6040805180830381865afa158015612879573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061289d9190615692565b5085519091506000806128b08884613b05565b91509150836000036128ce576128c98983838a89613cbe565b612996565b6040516326d5750160e01b81526000906001600160a01b038716906326d5750190612901908b90899088906004016156b7565b600060405180830381865afa15801561291e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261294691908101906156de565b905060005b8481101561298157818181518110612965576129656153e3565b602002602001015160000361298e576129818685858c8b613d51565b5050505050505050505050565b60010161294b565b505050505050505050565b60016101c555565b600060608080846129da565b60405162461bcd60e51b81526020600482015260046024820152816044820152604881fd5b806129ef576129ef6310534c0d60e21b6129b5565b600254811115612a0957612a096310534c0d60e21b6129b5565b8560008080836001600160401b03811115612a2657612a26614fbd565b604051908082528060200260200182016040528015612a4f578160200160208202803683370190505b50846001600160401b03811115612a6857612a68614fbd565b604051908082528060200260200182016040528015612a91578160200160208202803683370190505b50856001600160401b03811115612aaa57612aaa614fbd565b604051908082528060200260200182016040528015612ad3578160200160208202803683370190505b5092509250925060008b8b6000818110612aef57612aef6153e3565b9050610140020160a0016020810190612b089190614d16565b90503660008060005b88811015612dec578f8f82818110612b2b57612b2b6153e3565b61014002919091019450309050612b4860e0860160c08701614d16565b6001600160a01b031614612b875760405162461bcd60e51b8152600401610b47906020808252600490820152630414d31360e41b604082015260600190565b6001600160a01b038516612ba160c0860160a08701614d16565b6001600160a01b031614612be05760405162461bcd60e51b8152600401610b4790602080825260049082015263414d313560e01b604082015260600190565b8335612c175760405162461bcd60e51b8152600401610b4790602080825260049082015263414d313960e01b604082015260600190565b612c2760a0850160808601614d16565b6001600160a01b0380821660009081526101f76020526040902054169350915082612c7d5760405162461bcd60e51b8152600401610b479060208082526004908201526320a6981960e11b604082015260600190565b612c8d60a0850160808601614d16565b6001600160a01b031663e3ee160e612cab60c0870160a08801614d16565b612cbb60e0880160c08901614d16565b8735602089013560408a013560608b0135612cdd6101008d0160e08e01615783565b6040516001600160e01b031960e08a901b1681526001600160a01b03978816600482015296909516602487015260448601939093526064850191909152608484015260a483015260ff1660c482015261010087013560e482015261012087013561010482015261012401600060405180830381600087803b158015612d6157600080fd5b505af1158015612d75573d6000803e3d6000fd5b50505050818385600001358a8481518110612d9257612d926153e3565b602002602001018a8581518110612dab57612dab6153e3565b602002602001018a8681518110612dc457612dc46153e3565b60209081029190910101929092526001600160a01b0392831690915291169052600101612b11565b50929e959d50939b5091995092975050505050505050565b60008063401f9bc660e01b87878686604051602401612e2694939291906157a6565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915290506000612e6e6000546001600160a01b031690565b6001600160a01b031663dc8601b33084612e8760015490565b6040518463ffffffff1660e01b8152600401612ea5939291906155bc565b6020604051808303816000875af1158015612ec4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ee891906155f0565b600081815260366020526040902080546001600160a01b0319166001600160a01b038a161790559050600081815260376020526040902080546001600160a01b0319166001600160a01b038a16179055612f428187613d70565b612f4c8185613d8f565b979650505050505050565b600081610140026040016040518181016040526020815283602082015281858260400137209392505050565b6000610a25612f90613dae565b8360405161190160f01b8152600281019290925260228201526042902090565b6000806000612fc0868686613db8565b91509150612fcd81613de3565b50949350505050565b612fe08282611c4c565b6110f057600082815261015f602090815260408083206001600160a01b03851684529091529020805460ff191660011790556130193390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6130678282611c4c565b156110f057600082815261015f602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60006110f0816124bf565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156131035761107183613f2d565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561315d575060408051601f3d908101601f1916820190925261315a918101906155f0565b60015b6131c05760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610b47565b600080516020615bfb833981519152811461322f5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610b47565b50611071838383613fc9565b606081613270565b604080516048810190915262461bcd60e51b81526020600482015260046024820152816044820152604881fd5b80613285576132856310534c0d60e21b613243565b60025481111561329f5761329f6310534c0d60e21b613243565b836132b66020830260200160408051918201905290565b92508183526132cb6040808051918201905290565b60005b83811015613317576020810283013582526101f76020830152604082205482528151613304576133046320a6981960e11b613243565b81516020808302870101526001016132ce565b5050505092915050565b6000635ea3323560e01b848484604051602401613340939291906157d2565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915290506133866000546001600160a01b031690565b6001600160a01b031663dc8601b3308361339f60015490565b6040518463ffffffff1660e01b81526004016133bd939291906155bc565b6020604051808303816000875af11580156133dc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061196491906155f0565b60008060009054906101000a90046001600160a01b03166001600160a01b031663669f618b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015613454573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115bb91906155f0565b6064546040805160018082528183019092526000926001600160a01b0316918391906020808301908036833701905050905081816000815181106134be576134be6153e3565b6001600160a01b0392831660209182029290920101526065546040519116906000908190613539908490636778887360e01b906135019088908d90602401615668565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b03199094169390931790925290613fee565b915091508161355057600095505050505050610a25565b60008061355c83614048565b509150915081613576576000975050505050505050610a25565b60008060006135868c8d51614075565b925092509250826135a45760009a5050505050505050505050610a25565b6135b28d8383878e8d614204565b9d9c50505050505050505050505050565b600086815260336020908152604080832080546001600160a01b0319166001600160a01b038a16179055603590915290206135ff908585614aaf565b506000868152603460205260409020612620908383614b0e565b60006060600080866001600160a01b031660008760405161363a9190615808565b60006040518083038185875af1925050503d8060008114613677576040519150601f19603f3d011682016040523d82523d6000602084013e61367c565b606091505b509150915061368c828287614348565b935093505050935093915050565b6000602082015160028110156136ae578091505b50919050565b609654610100900460ff166136db5760405162461bcd60e51b8152600401610b4790615824565b6136e3614362565b565b609654610100900460ff166136e35760405162461bcd60e51b8152600401610b4790615824565b609654610100900460ff166137335760405162461bcd60e51b8152600401610b4790615824565b6110f08282614389565b600080546001600160a01b0319166001600160a01b038516179055606482108015906137ca5750826001600160a01b031663e5789d036040518163ffffffff1660e01b8152600401602060405180830381865afa1580156137a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137c691906155f0565b8211155b6137ff5760405162461bcd60e51b8152600401610b4790602080825260049082015263414d323360e01b604082015260600190565b600182905560028190556040516001600160a01b03841681527fad098d6e912c08ed9aa3ee6ca9529da44a959d4c6251c6b8b088af216c1e35069060200160405180910390a1505050565b606480546001600160a01b038481166001600160a01b0319928316811790935560658054918516919092161790556040519081527facedbb427c2ee2d2bc122be66c57a084f951a0647a71df5259a3951fbedc82e29060200160405180910390a16040516001600160a01b03821681527f98747757e5f0cf8ed88f5be95bf1fa9539ff10e55b2db045066f0bd3479052dc90602001610b11565b606061019380546138f49061586f565b80601f01602080910402602001604051908101604052809291908181526020018280546139209061586f565b801561396d5780601f106139425761010080835404028352916020019161396d565b820191906000526020600020905b81548152906001019060200180831161395057829003601f168201915b5050505050905090565b606061019480546138f49061586f565b6014015190565b60008060009054906101000a90046001600160a01b03166001600160a01b031663e5789d036040518163ffffffff1660e01b8152600401602060405180830381865afa158015613454573d6000803e3d6000fd5b6139ec8282611c4c565b6110f0576139f9816143dc565b613a048360206143ee565b604051602001613a159291906158a3565b60408051601f198184030181529082905262461bcd60e51b8252610b47916004016153d0565b600081815260386020908152604091829020805483518184028101840190945280845260609392830182828015612767576020028201919060005260206000209081546001600160a01b031681526001909101906020018083116127495750505050509050919050565b60008181526039602090815260409182902080548351818402810184019094528084526060939283018282801561276757602002820191906000526020600020908154815260200190600101908083116127b55750505050509050919050565b6060806000836001600160401b03811115613b2257613b22614fbd565b604051908082528060200260200182016040528015613b4b578160200160208202803683370190505b5090506000846001600160401b03811115613b6857613b68614fbd565b604051908082528060200260200182016040528015613b91578160200160208202803683370190505b50905060008060005b87811015613cad57888181518110613bb457613bb46153e3565b60200260200101516001600160a01b031663db18af6c60006040518263ffffffff1660e01b8152600401613bea91815260200190565b6040805180830381865afa158015613c06573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613c2a9190615918565b9093509150600b8314613c685760405162461bcd60e51b8152600401610b4790602080825260049082015263414d313760e01b604082015260600190565b816001868381518110613c7d57613c7d6153e3565b60200260200101868481518110613c9657613c966153e3565b602090810291909101019190915252600101613b9a565b5092945090925050505b9250929050565b60006394e2692a60e01b868686604051602401613cdd9392919061593c565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091529050613d498383600084818080808080613d446060604051905060618101604052604181523060208201526001604182015290565b614590565b505050505050565b600063f175fb9860e01b868686604051602401613cdd93929190615960565b6000828152603860209081526040909120825161107192840190614b49565b6000828152603960209081526040909120825161107192840190614b9e565b60006115bb614646565b6000806001600160ff1b03831681613dd560ff86901c601b61598f565b905061368c878288856146ba565b6000816004811115613df757613df76159a2565b03613dff5750565b6001816004811115613e1357613e136159a2565b03613e605760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610b47565b6002816004811115613e7457613e746159a2565b03613ec15760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610b47565b6003816004811115613ed557613ed56159a2565b03610b885760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610b47565b6001600160a01b0381163b613f9a5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610b47565b600080516020615bfb83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b613fd28361477e565b600082511180613fdf5750805b156110715761128383836147be565b60006060600080866001600160a01b03168660405161400d9190615808565b600060405180830381855afa9150503d8060008114613677576040519150601f19603f3d011682016040523d82523d6000602084013e61367c565b60008060006040840151600160a01b81101561406d5760019350602085015192508091505b509193909250565b60006060806000846001600160401b0381111561409457614094614fbd565b6040519080825280602002602001820160405280156140bd578160200160208202803683370190505b5090506000856001600160401b038111156140da576140da614fbd565b604051908082528060200260200182016040528015614103578160200160208202803683370190505b5090506000806000606060005b8a8110156141ed576141538c828151811061412d5761412d6153e3565b6020908102919091010151604051600060248201526336c62bdb60e21b90604401613501565b9093509150826141725750600098509496509294506141fd9350505050565b818060200190518101906141869190615918565b9095509350600b85146141a85750600098509496509294506141fd9350505050565b8360018883815181106141bd576141bd6153e3565b602002602001018884815181106141d6576141d66153e3565b602090810291909101019190915252600101614110565b5060019850949650929450505050505b9250925092565b84516000908482036142255761421d88888887876147e3565b91505061433e565b600080614298856326d5750160e01b888a8d604051602401614249939291906156b7565b60408051601f19818403018152919052602080820180516001600160e01b03166001600160e01b031990941693909317909252906142889087906159b8565b61429390604061598f565b613fee565b91509150816142ad576000935050505061433e565b60006142b982856148d9565b9050806142cd57600094505050505061433e565b6000828060200190518101906142e391906156de565b905060005b8581101561433357818181518110614302576143026153e3565b602002602001015160000361432b5761431e8a8d8d8c8c6148f8565b965050505050505061433e565b6001016142e8565b506001955050505050505b9695505050505050565b600060608480156143595750828451145b95939450505050565b609654610100900460ff166129a15760405162461bcd60e51b8152600401610b4790615824565b609654610100900460ff166143b05760405162461bcd60e51b8152600401610b4790615824565b6101936143bd8382615a15565b506101946143cb8282615a15565b505060006101918190556101925550565b6060610a256001600160a01b03831660145b606060006143fd8360026159b8565b61440890600261598f565b6001600160401b0381111561441f5761441f614fbd565b6040519080825280601f01601f191660200182016040528015614449576020820181803683370190505b509050600360fc1b81600081518110614464576144646153e3565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110614493576144936153e3565b60200101906001600160f81b031916908160001a90535060006144b78460026159b8565b6144c290600161598f565b90505b600181111561453a576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106144f6576144f66153e3565b1a60f81b82828151811061450c5761450c6153e3565b60200101906001600160f81b031916908160001a90535060049490941c9361453381615ad4565b90506144c5565b5083156145895760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610b47565b9392505050565b60405163353b090160e11b81526001600160a01b038c1690636a761202906145ce908d908d908d908d908d908d908d908d908d908d90600401615b0d565b6020604051808303816000875af11580156145ed573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061461191906154cd565b6129815760405162461bcd60e51b8152600401610b47906020808252600490820152630414d32360e41b604082015260600190565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f614671614918565b614679614976565b60408051602081019490945283019190915260608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156146f15750600090506003614775565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015614745573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661476e57600060019250925050614775565b9150600090505b94509492505050565b61478781613f2d565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606145898383604051806060016040528060278152602001615c3b602791396149a8565b6000806394e2692a60e01b8787876040516024016148039392919061593c565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091529050600063353b090160e11b84828481808080808061486f6060604051905060618101604052604181523060208201526001604182015290565b6040516024016148889a99989796959493929190615b80565b604051602081830303815290604052906001600160e01b0319166020820180516001600160e01b038381831617835250505050905060006148cb86836020613619565b509998505050505050505050565b600081604084015114602080850151141615610a255750600192915050565b60008063f175fb9860e01b87878760405160240161480393929190615960565b6000806149236138e4565b80519091501561493a578051602090910120919050565b61019154801561494a5792915050565b7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4709250505090565b5090565b600080614981613977565b805190915015614998578051602090910120919050565b61019254801561494a5792915050565b6060600080856001600160a01b0316856040516149c59190615808565b600060405180830381855af49150503d8060008114614a00576040519150601f19603f3d011682016040523d82523d6000602084013e614a05565b606091505b509150915061433e8683838760608315614a80578251600003614a79576001600160a01b0385163b614a795760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610b47565b5081612305565b6123058383815115614a955781518083602001fd5b8060405162461bcd60e51b8152600401610b4791906153d0565b828054828255906000526020600020908101928215614b02579160200282015b82811115614b025781546001600160a01b0319166001600160a01b03843516178255602090920191600190910190614acf565b50614972929150614bd9565b828054828255906000526020600020908101928215614b02579160200282015b82811115614b02578235825591602001919060010190614b2e565b828054828255906000526020600020908101928215614b02579160200282015b82811115614b0257825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190614b69565b828054828255906000526020600020908101928215614b02579160200282015b82811115614b02578251825591602001919060010190614bbe565b5b808211156149725760008155600101614bda565b6001600160e01b031981168114610b8857600080fd5b600060208284031215614c1657600080fd5b813561458981614bee565b60008083601f840112614c3357600080fd5b5081356001600160401b03811115614c4a57600080fd5b6020830191508360208260051b8501011115613cb757600080fd5b6001600160a01b0381168114610b8857600080fd5b600080600080600060608688031215614c9257600080fd5b85356001600160401b0380821115614ca957600080fd5b614cb589838a01614c21565b90975095506020880135915080821115614cce57600080fd5b50614cdb88828901614c21565b9094509250506040860135614cef81614c65565b809150509295509295909350565b600060208284031215614d0f57600080fd5b5035919050565b600060208284031215614d2857600080fd5b813561458981614c65565b60008083601f840112614d4557600080fd5b5081356001600160401b03811115614d5c57600080fd5b60208301915083602061014083028501011115613cb757600080fd5b60008060208385031215614d8b57600080fd5b82356001600160401b03811115614da157600080fd5b614dad85828601614d33565b90969095509350505050565b60008060408385031215614dcc57600080fd5b8235614dd781614c65565b91506020830135614de781614c65565b809150509250929050565b600080600080600060808688031215614e0a57600080fd5b85356001600160401b03811115614e2057600080fd5b614e2c88828901614d33565b9096509450506020860135614e4081614c65565b94979396509394604081013594506060013592915050565b60008060408385031215614e6b57600080fd5b823591506020830135614de781614c65565b600080600060608486031215614e9257600080fd5b8335614e9d81614c65565b92506020840135614ead81614c65565b929592945050506040919091013590565b60008060008060008060808789031215614ed757600080fd5b8635614ee281614c65565b95506020870135614ef281614c65565b945060408701356001600160401b0380821115614f0e57600080fd5b614f1a8a838b01614c21565b90965094506060890135915080821115614f3357600080fd5b50614f4089828a01614c21565b979a9699509497509295939492505050565b60008060008060408587031215614f6857600080fd5b84356001600160401b0380821115614f7f57600080fd5b614f8b88838901614c21565b90965094506020870135915080821115614fa457600080fd5b50614fb187828801614c21565b95989497509550505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715614ffb57614ffb614fbd565b604052919050565b6000806040838503121561501657600080fd5b823561502181614c65565b91506020838101356001600160401b038082111561503e57600080fd5b818601915086601f83011261505257600080fd5b81358181111561506457615064614fbd565b615076601f8201601f19168501614fd3565b9150808252878482850101111561508c57600080fd5b80848401858401376000848284010152508093505050509250929050565b6000806000806000606086880312156150c257600080fd5b85356150cd81614c65565b945060208601356001600160401b03808211156150e957600080fd5b6150f589838a01614c21565b9096509450604088013591508082111561510e57600080fd5b5061511b88828901614c21565b969995985093965092949392505050565b60008060008060008060008060006101208a8c03121561514b57600080fd5b893561515681614c65565b985060208a013561516681614c65565b975060408a0135965060608a0135955060808a013561518481614c65565b945060a08a013561519481614c65565b935060c08a01356151a481614c65565b925060e08a01356151b481614c65565b91506101008a01356151c581614c65565b809150509295985092959850929598565b60005b838110156151f15781810151838201526020016151d9565b50506000910152565b600081518084526152128160208601602086016151d6565b601f01601f19169290920160200192915050565b600081518084526020808501945080840160005b838110156152565781518752958201959082019060010161523a565b509495945050505050565b60ff60f81b8816815260e06020820152600061528060e08301896151fa565b828103604084015261529281896151fa565b606084018890526001600160a01b038716608085015260a0840186905283810360c085015290506152c38185615226565b9a9950505050505050505050565b600081518084526020808501945080840160005b838110156152565781516001600160a01b0316875295820195908201906001016152e5565b84151581526001600160a01b0384166020820152608060408201819052600090615336908301856152d1565b8281036060840152612f4c8185615226565b6000806000806060858703121561535e57600080fd5b843561536981614c65565b93506020850135925060408501356001600160401b038082111561538c57600080fd5b818701915087601f8301126153a057600080fd5b8135818111156153af57600080fd5b8860208285010111156153c157600080fd5b95989497505060200194505050565b60208152600061458960208301846151fa565b634e487b7160e01b600052603260045260246000fd5b602080825260049082015263414d303760e01b604082015260600190565b6020808252600490820152630829a60760e31b604082015260600190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b6000602082840312156154df57600080fd5b8151801515811461458957600080fd5b8183526000602080850194508260005b8581101561525657813561551281614c65565b6001600160a01b0316875295820195908201906001016154ff565b6040815260006155416040830186886154ef565b8281036020840152612f4c8185876154ef565b60006020828403121561556657600080fd5b815161458981614bee565b6000808585111561558157600080fd5b8386111561558e57600080fd5b5050600583901b0193919092039150565b6000602082840312156155b157600080fd5b815161458981614c65565b6001600160a01b03841681526060602082018190526000906155e0908301856151fa565b9050826040830152949350505050565b60006020828403121561560257600080fd5b5051919050565b80516001600160401b038116811461562057600080fd5b919050565b60008060006060848603121561563a57600080fd5b61564384615609565b925061565160208501615609565b915061565f60408501615609565b90509250925092565b60408152600061567b60408301856152d1565b905060018060a01b03831660208301529392505050565b600080604083850312156156a557600080fd5b825191506020830151614de781614c65565b60018060a01b0384168152826020820152606060408201526000610ac86060830184615226565b600060208083850312156156f157600080fd5b82516001600160401b038082111561570857600080fd5b818501915085601f83011261571c57600080fd5b81518181111561572e5761572e614fbd565b8060051b915061573f848301614fd3565b818152918301840191848101908884111561575957600080fd5b938501935b838510156157775784518252938501939085019061575e565b98975050505050505050565b60006020828403121561579557600080fd5b813560ff8116811461458957600080fd5b6001600160a01b03858116825284166020820152608060408201819052600090615336908301856152d1565b6001600160a01b03841681526060602082018190526000906157f6908301856152d1565b828103604084015261433e8185615226565b6000825161581a8184602087016151d6565b9190910192915050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600181811c9082168061588357607f821691505b6020821081036136ae57634e487b7160e01b600052602260045260246000fd5b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516158db8160178501602088016151d6565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161590c8160288401602088016151d6565b01602801949350505050565b6000806040838503121561592b57600080fd5b505080516020909101519092909150565b6001600160a01b03841681526060602082018190526000906157f690830185615226565b8381526060602082015260006157f66060830185615226565b634e487b7160e01b600052601160045260246000fd5b80820180821115610a2557610a25615979565b634e487b7160e01b600052602160045260246000fd5b8082028115828204841417610a2557610a25615979565b601f82111561107157600081815260208120601f850160051c810160208610156159f65750805b601f850160051c820191505b81811015613d4957828155600101615a02565b81516001600160401b03811115615a2e57615a2e614fbd565b615a4281615a3c845461586f565b846159cf565b602080601f831160018114615a775760008415615a5f5750858301515b600019600386901b1c1916600185901b178555613d49565b600085815260208120601f198616915b82811015615aa657888601518255948401946001909101908401615a87565b5085821015615ac45787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600081615ae357615ae3615979565b506000190190565b60028110615b0957634e487b7160e01b600052602160045260246000fd5b9052565b6001600160a01b038b81168252602082018b905261014060408301819052600091615b3a8483018d6151fa565b9150615b49606085018c615aeb565b8960808501528860a08501528760c085015280871660e0850152808616610100850152508281036101208401526135b281856151fa565b6001600160a01b038b8116825260ff8b16602083015261014060408301819052600091615baf8483018d6151fa565b9150615bbe606085018c615aeb565b60ff8a8116608086015289811660a0860152881660c085015286811660e085015285166101008401528281036101208401526135b281856151fa56fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201da49eeb9643b2e18e6d137a8f85bd63265aa4268c4c4f7c7a13346657dfb4ee64736f6c63430008120033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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