ETH Price: $3,816.20 (+5.49%)

Contract

0x22cE84A7F86662b78E49C6ec9E51D60FddE7b70A
Transaction Hash
Method
Block
From
To
Send1288791552024-12-05 0:04:4723 mins ago1733357087IN
Bitget Wallet: Swap Bridge
0 ETH0.0000036803460.00100044
Send1288685012024-12-04 18:09:396 hrs ago1733335779IN
Bitget Wallet: Swap Bridge
0 ETH0.0000021794490.00100233
Send1288671102024-12-04 17:23:177 hrs ago1733332997IN
Bitget Wallet: Swap Bridge
0 ETH0.0000022692970.00100419
Send V21288669832024-12-04 17:19:037 hrs ago1733332743IN
Bitget Wallet: Swap Bridge
0 ETH0.0000128488860.00100414
Relay1288666022024-12-04 17:06:217 hrs ago1733331981IN
Bitget Wallet: Swap Bridge
0 ETH0.0000016997890.00150629
Send1288662202024-12-04 16:53:377 hrs ago1733331217IN
Bitget Wallet: Swap Bridge
0 ETH0.0000014154260.00100358
Refund1288661772024-12-04 16:52:117 hrs ago1733331131IN
Bitget Wallet: Swap Bridge
0 ETH0.0000014641550.00100347
Send1288660922024-12-04 16:49:217 hrs ago1733330961IN
Bitget Wallet: Swap Bridge
0 ETH0.0000014845630.00100301
Send1288660052024-12-04 16:46:277 hrs ago1733330787IN
Bitget Wallet: Swap Bridge
0 ETH0.0000015241440.0010029
Relay1288657952024-12-04 16:39:277 hrs ago1733330367IN
Bitget Wallet: Swap Bridge
0 ETH0.0000017690210.00150406
Send1288653652024-12-04 16:25:078 hrs ago1733329507IN
Bitget Wallet: Swap Bridge
0 ETH0.000001907830.00100264
Send V21288598422024-12-04 13:21:0111 hrs ago1733318461IN
Bitget Wallet: Swap Bridge
0 ETH0.0000253724580.00110046
Send V21288579402024-12-04 12:17:3712 hrs ago1733314657IN
Bitget Wallet: Swap Bridge
0.009 ETH0.0000427400510.00100042
Relay1288559042024-12-04 11:09:4513 hrs ago1733310585IN
Bitget Wallet: Swap Bridge
0 ETH0.0000027091480.00150072
Send1288552972024-12-04 10:49:3113 hrs ago1733309371IN
Bitget Wallet: Swap Bridge
0 ETH0.0000027019660.00110043
Send V21288548602024-12-04 10:34:5713 hrs ago1733308497IN
Bitget Wallet: Swap Bridge
0.006578658178196 ETH0.0000150696140.00100035
Relay1288545102024-12-04 10:23:1714 hrs ago1733307797IN
Bitget Wallet: Swap Bridge
0 ETH0.000005928630.00150048
Send1288531022024-12-04 9:36:2114 hrs ago1733304981IN
Bitget Wallet: Swap Bridge
0 ETH0.0000033744230.0010004
Send1288517052024-12-04 8:49:4715 hrs ago1733302187IN
Bitget Wallet: Swap Bridge
0 ETH0.0000030259460.00100071
Send1288516722024-12-04 8:48:4115 hrs ago1733302121IN
Bitget Wallet: Swap Bridge
0 ETH0.0000022902750.00100073
Refund1288515652024-12-04 8:45:0715 hrs ago1733301907IN
Bitget Wallet: Swap Bridge
0 ETH0.0000022296290.00100078
Send V21288515242024-12-04 8:43:4515 hrs ago1733301825IN
Bitget Wallet: Swap Bridge
0.003622645103343 ETH0.0000084175120.00100079
Send1288509182024-12-04 8:23:3316 hrs ago1733300613IN
Bitget Wallet: Swap Bridge
0 ETH0.0000015223910.00110078
Relay V21288474492024-12-04 6:27:5517 hrs ago1733293675IN
Bitget Wallet: Swap Bridge
0 ETH0.0000068049730.00150113
Relay V21288474432024-12-04 6:27:4318 hrs ago1733293663IN
Bitget Wallet: Swap Bridge
0 ETH0.0000045958630.00150113
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
1288579402024-12-04 12:17:3712 hrs ago1733314657
Bitget Wallet: Swap Bridge
0.009 ETH
1288548602024-12-04 10:34:5713 hrs ago1733308497
Bitget Wallet: Swap Bridge
0.006578658178196 ETH
1288515242024-12-04 8:43:4515 hrs ago1733301825
Bitget Wallet: Swap Bridge
0.003622645103343 ETH
1288271222024-12-03 19:10:2129 hrs ago1733253021
Bitget Wallet: Swap Bridge
0.004531748117369 ETH
1288191222024-12-03 14:43:4133 hrs ago1733237021
Bitget Wallet: Swap Bridge
0.303939894633492 ETH
1288097432024-12-03 9:31:0338 hrs ago1733218263
Bitget Wallet: Swap Bridge
0.00319031526771 ETH
1288083762024-12-03 8:45:2939 hrs ago1733215529
Bitget Wallet: Swap Bridge
0.002991405369014 ETH
1288011962024-12-03 4:46:0943 hrs ago1733201169
Bitget Wallet: Swap Bridge
0.8 ETH
1287829892024-12-02 18:39:152 days ago1733164755
Bitget Wallet: Swap Bridge
0.03951162202004 ETH
1287821822024-12-02 18:12:212 days ago1733163141
Bitget Wallet: Swap Bridge
0.2 ETH
1287737622024-12-02 13:31:412 days ago1733146301
Bitget Wallet: Swap Bridge
0.011 ETH
1287677242024-12-02 10:10:252 days ago1733134225
Bitget Wallet: Swap Bridge
0.019973514555465 ETH
1287661542024-12-02 9:18:052 days ago1733131085
Bitget Wallet: Swap Bridge
0.07798598775138 ETH
1287633202024-12-02 7:43:372 days ago1733125417
Bitget Wallet: Swap Bridge
0.21 ETH
1287630702024-12-02 7:35:172 days ago1733124917
Bitget Wallet: Swap Bridge
0.015 ETH
1287430442024-12-01 20:27:453 days ago1733084865
Bitget Wallet: Swap Bridge
0.4 ETH
1287417872024-12-01 19:45:513 days ago1733082351
Bitget Wallet: Swap Bridge
0.2 ETH
1287417332024-12-01 19:44:033 days ago1733082243
Bitget Wallet: Swap Bridge
0.8 ETH
1287366652024-12-01 16:55:073 days ago1733072107
Bitget Wallet: Swap Bridge
0.015502313226918 ETH
1287358032024-12-01 16:26:233 days ago1733070383
Bitget Wallet: Swap Bridge
0.004149441442282 ETH
1287312052024-12-01 13:53:073 days ago1733061187
Bitget Wallet: Swap Bridge
0.003073042656909 ETH
1287310742024-12-01 13:48:453 days ago1733060925
Bitget Wallet: Swap Bridge
0.013127831568755 ETH
1287306682024-12-01 13:35:133 days ago1733060113
Bitget Wallet: Swap Bridge
0.134957782985704 ETH
1287214862024-12-01 8:29:093 days ago1733041749
Bitget Wallet: Swap Bridge
0.067766829072769 ETH
1287176212024-12-01 6:20:193 days ago1733034019
Bitget Wallet: Swap Bridge
1 ETH
View All Internal Transactions

Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
BKBridgeRouter

Compiler Version
v0.8.18+commit.87f61d96

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion
File 1 of 21 : BKBridgeRouter.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.18;

import './libs/BKBridgeHandler.sol';
import './interfaces/IBKBridgeRouter.sol';
import './BKBridgeAccess.sol';

contract BKBridgeRouter is IBKBridgeRouter, BKBridgeAccess {
    mapping(bytes32 => uint256) public orderStatus;
    mapping(bytes32 => uint256) public orderAmount;

    event BKBridge(
        uint256 indexed orderStatus,
        bytes32 indexed transferId,
        address vaultReceiver,
        address sender,
        address receiver,
        address srcToken,
        address dstToken,
        uint256 srcChainId,
        uint256 dstChainId,
        uint256 amount,
        uint256 timestamp
    );

    constructor(address _owner) BKBridgeAccess() {
        _checkZero(_owner);
        _transferOwnership(_owner);
    }

    receive() external payable {}

    function send(SignInfo calldata _signInfo, OrderInfo calldata _orderInfo)
        external
        payable
        whenNotPaused
        nonReentrant
        onlySender(_orderInfo.sender)
    {
        _checkSigner(_signInfo.nonce, _signInfo.signature, _orderInfo.transferId, _orderInfo.dstChainId);
        _checkVaultReceiver(_orderInfo.vaultReceiver);
        _checkVaultToken(_orderInfo.srcToken);
        HandlerCallBack memory _callback = BKBridgeHandler.send(_orderInfo, orderStatus, orderAmount);
        _emitEvent(_orderInfo, _callback);
    }

    function sendV1(SignInfo calldata _signInfo, OrderInfo calldata _orderInfo, SwapV1Info calldata _swapV1Info)
        external
        payable
        whenNotPaused
        nonReentrant
        onlySender(_orderInfo.sender)
    {
        _checkSigner(_signInfo.nonce, _signInfo.signature, _orderInfo.transferId, _orderInfo.dstChainId);
        _checkVaultReceiver(_orderInfo.vaultReceiver);
        _checkVaultToken(_swapV1Info.path[_swapV1Info.path.length - 1]);
        _checkRouter(_swapV1Info.bkSwapV1Router);
        _checkSwapReceiver(vault, _swapV1Info.to);
        HandlerCallBack memory _callback = BKBridgeHandler.sendV1(_orderInfo, _swapV1Info, orderStatus, orderAmount);
        _emitEvent(_orderInfo, _callback);
    }

    function sendV2(SignInfo calldata _signInfo, OrderInfo calldata _orderInfo, SwapV2Info calldata _swapV2Info)
        external
        payable
        whenNotPaused
        nonReentrant
        onlySender(_orderInfo.sender)
    {
        _checkSigner(_signInfo.nonce, _signInfo.signature, _orderInfo.transferId, _orderInfo.dstChainId);
        _checkVaultReceiver(_orderInfo.vaultReceiver);
        _checkVaultToken(_swapV2Info.toTokenAddress);
        _checkRouter(_swapV2Info.bkSwapV2Router);
        _checkSwapReceiver(vault, _swapV2Info.to);
        HandlerCallBack memory _callback = BKBridgeHandler.sendV2(_orderInfo, _swapV2Info, orderStatus, orderAmount);
        _emitEvent(_orderInfo, _callback);
    }

    function relay(SignInfo calldata _signInfo, OrderInfo calldata _orderInfo, uint256 _relayAmount)
        external
        payable
        whenNotPaused
        nonReentrant
        onlyRelayer
    {
        _checkSigner(_signInfo.nonce, _signInfo.signature, _orderInfo.transferId, _orderInfo.dstChainId);
        _checkVaultReceiver(_orderInfo.vaultReceiver);
        _checkVaultToken(_orderInfo.dstToken);
        HandlerCallBack memory _callback = BKBridgeHandler.relay(_orderInfo, _relayAmount, orderStatus);
        _emitEvent(_orderInfo, _callback);
    }

    function relayV1(
        SignInfo calldata _signInfo,
        OrderInfo calldata _orderInfo,
        SwapV1Info calldata _swapV1Info,
        uint256 _relayAmount
    ) external payable whenNotPaused nonReentrant onlyRelayer {
        _checkSigner(_signInfo.nonce, _signInfo.signature, _orderInfo.transferId, _orderInfo.dstChainId);
        _checkVaultReceiver(_orderInfo.vaultReceiver);
        _checkVaultToken(_swapV1Info.path[0]);
        _checkRouter(_swapV1Info.bkSwapV1Router);
        _checkSwapReceiver(_orderInfo.receiver, _swapV1Info.to);
        HandlerCallBack memory _callback = BKBridgeHandler.relayV1(_orderInfo, _swapV1Info, _relayAmount, orderStatus);
        _emitEvent(_orderInfo, _callback);
    }

    function relayV2(
        SignInfo calldata _signInfo,
        OrderInfo calldata _orderInfo,
        SwapV2Info calldata _swapV2Info,
        uint256 _relayAmount
    ) external payable whenNotPaused nonReentrant onlyRelayer {
        _checkSigner(_signInfo.nonce, _signInfo.signature, _orderInfo.transferId, _orderInfo.dstChainId);
        _checkVaultReceiver(_orderInfo.vaultReceiver);
        _checkVaultToken(_swapV2Info.fromTokenAddress);
        _checkRouter(_swapV2Info.bkSwapV2Router);
        _checkSwapReceiver(_orderInfo.receiver, _swapV2Info.to);
        HandlerCallBack memory _callback = BKBridgeHandler.relayV2(_orderInfo, _swapV2Info, _relayAmount, orderStatus);
        _emitEvent(_orderInfo, _callback);
    }

    function cancel(SignInfo calldata _signInfo, OrderInfo calldata _orderInfo)
        external
        payable
        whenNotPaused
        nonReentrant
        onlyRelayer
    {
        _checkSigner(_signInfo.nonce, _signInfo.signature, _orderInfo.transferId, _orderInfo.dstChainId);
        HandlerCallBack memory _callback = BKBridgeHandler.cancel(_orderInfo, orderStatus);
        _emitEvent(_orderInfo, _callback);
    }

    function refund(SignInfo calldata _signInfo, OrderInfo calldata _orderInfo, uint256 _refundAmount)
        external
        payable
        whenNotPaused
        nonReentrant
        onlyRelayer
    {
        _checkSigner(_signInfo.nonce, _signInfo.signature, _orderInfo.transferId, _orderInfo.dstChainId);
        HandlerCallBack memory _callback =
            BKBridgeHandler.refund(_orderInfo, _refundAmount, vaultToken, orderStatus, orderAmount);
        _emitEvent(_orderInfo, _callback);
    }

    function _emitEvent(OrderInfo calldata _orderInfo, HandlerCallBack memory _callback) internal {
        emit BKBridge(
            _callback.status,
            _orderInfo.transferId,
            _orderInfo.vaultReceiver,
            _orderInfo.sender,
            _orderInfo.receiver,
            _orderInfo.srcToken,
            _orderInfo.dstToken,
            block.chainid,
            _orderInfo.dstChainId,
            _callback.amount,
            _orderInfo.timestamp
        );
    }
}

File 2 of 21 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 3 of 21 : Pausable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor() {
        _paused = false;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        _requireNotPaused();
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        _requirePaused();
        _;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        require(!paused(), "Pausable: paused");
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        require(paused(), "Pausable: not paused");
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}

File 4 of 21 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

        _;

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

File 5 of 21 : draft-IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity ^0.8.0;

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

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

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

File 6 of 21 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

File 7 of 21 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

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

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

    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

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

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

    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

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

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

File 8 of 21 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [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://diligence.consensys.net/posts/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.5.11/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 functionCall(target, data, "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");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(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)
    {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(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)
    {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason 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 {
            // 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 9 of 21 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

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

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

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

pragma solidity ^0.8.0;

import "../Strings.sol";

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

    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");
        } else if (error == RecoverError.InvalidSignatureV) {
            revert("ECDSA: invalid signature 'v' 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 (v != 27 && v != 28) {
            return (address(0), RecoverError.InvalidSignatureV);
        }

        // 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) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
    }

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

    /**
     * @dev Returns an Ethereum Signed Typed Data, created from a
     * `domainSeparator` and a `structHash`. This produces hash corresponding
     * to the one signed with the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
     * JSON-RPC method as part of EIP-712.
     *
     * See {recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
    }
}

File 11 of 21 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_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) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @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] = _HEX_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);
    }
}

File 12 of 21 : BKBridgeAccess.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.18;

import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/security/Pausable.sol';
import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';
import '@openzeppelin/contracts/security/ReentrancyGuard.sol';
import '@openzeppelin/contracts/utils/cryptography/ECDSA.sol';
import './libs/TransferHelper.sol';
import './interfaces/IBKBridgeAccess.sol';
import './interfaces/IBKBridgeErrors.sol';

contract BKBridgeAccess is IBKBridgeAccess, IBKBridgeErrors, Ownable, Pausable, ReentrancyGuard {
    using ECDSA for bytes32;
    using SafeERC20 for IERC20;

    address public safe;
    address public operator;
    address public signer;
    address public vault;
    address public vaultToken;
    mapping(address => bool) public isRelayer;
    mapping(address => bool) public isRouter;
    mapping(uint256 => uint256) private nonceBitmap;

    event RescueETH(address recipient, uint256 amount);
    event RescueERC20(address asset, address recipient, uint256 amount);
    event SetSafe(address newSafe);
    event SetOperator(address newOperator);
    event SetSigner(address newSigner);
    event SetVault(address newVault);
    event SetVaultToken(address newValutToken);
    event SetRelayers(address[] relayers, bool isTrue);
    event SetRouters(address[] routers, bool isTrue);

    modifier onlyOperator() {
        _checkOperator();
        _;
    }

    modifier onlySender(address _orderSender) {
        _checkSender(_orderSender);
        _;
    }

    modifier onlyRelayer() {
        _checkRelayer();
        _;
    }

    function setAccess(AccessType _accessType, bytes calldata _inputs) external onlyOwner {
        if (_accessType > AccessType.SET_ROUTERS) {
            revert AccessTypeNotAvailable();
        }
        if (_accessType <= AccessType.SET_VAULT_TOKEN) {
            address addr = abi.decode(_inputs, (address));
            _checkZero(addr);

            if (_accessType == AccessType.SET_SAFE) {
                safe = addr;
                emit SetSafe(addr);
            } else if (_accessType == AccessType.SET_OPERATOR) {
                operator = addr;
                emit SetOperator(addr);
            } else if (_accessType == AccessType.SET_SINGER) {
                signer = addr;
                emit SetSigner(addr);
            } else if (_accessType == AccessType.SET_VAULT) {
                vault = addr;
                emit SetVault(addr);
            } else if (_accessType == AccessType.SET_VAULT_TOKEN) {
                vaultToken = addr;
                emit SetVaultToken(addr);
            }
        } else {
            (address[] memory addrs, bool isTrue) = abi.decode(_inputs, (address[], bool));

            bool isSetRelayer = _accessType == AccessType.SET_RELAYERS;
            uint256 length = addrs.length;
            for (uint256 i = 0; i < length;) {
                address addr = addrs[i];
                _checkZero(addr);

                if (isSetRelayer) {
                    isRelayer[addr] = isTrue;
                } else {
                    isRouter[addr] = isTrue;
                }
                unchecked {
                    ++i;
                }
            }
            if (isSetRelayer) {
                emit SetRelayers(addrs, isTrue);
            } else {
                emit SetRouters(addrs, isTrue);
            }
        }
    }

    function checkBridgeReady() external view returns (bool) {
        if (safe == address(0)) {
            revert NotSafe();
        } else if (operator == address(0)) {
            revert NotOperator();
        } else if (signer == address(0)) {
            revert NotSigner();
        } else if (vault == address(0)) {
            revert NotVault();
        } else if (vaultToken == address(0)) {
            revert NotVaultToken();
        }
        return true;
    }

    function pause() external onlyOperator {
        _pause();
    }

    function unpause() external onlyOperator {
        _unpause();
    }

    function rescueERC20(address asset) external onlyOperator {
        _checkZero(safe);
        uint256 amount = IERC20(asset).balanceOf(address(this));
        TransferHelper.safeTransfer(asset, safe, amount);
        emit RescueERC20(asset, safe, amount);
    }

    function rescueETH() external onlyOperator {
        _checkZero(safe);
        uint256 amount = address(this).balance;
        TransferHelper.safeTransferETH(safe, amount);
        emit RescueETH(safe, amount);
    }

    function _checkOperator() internal view {
        if (msg.sender != operator) {
            revert NotOperator();
        }
    }

    function _checkSender(address orderSender) internal view {
        if (msg.sender != orderSender) {
            revert NotSender();
        }
    }

    function _checkRelayer() internal view {
        if (!isRelayer[msg.sender]) {
            revert NotRelayer();
        }
    }

    function _checkZero(address _address) internal pure {
        if (_address == address(0)) {
            revert InvalidAddress();
        }
    }

    function _checkVaultToken(address _vaultToken) internal view {
        if (_vaultToken != vaultToken) {
            revert NotVaultToken();
        }
    }

    function _checkVaultReceiver(address _vaultReceiver) internal view {
        if (_vaultReceiver != vault) {
            revert NotVault();
        }
    }

    function _checkSwapReceiver(address _targetReceiver, address _swapReceiver) internal pure {
        if (_targetReceiver != _swapReceiver) {
            revert SwapReceiverMisMatch();
        }
    }

    function _checkRouter(address _router) internal view {
        if (!isRouter[_router]) {
            revert NotRouter();
        }
    }

    function _checkSigner(uint256 _nonce, bytes calldata _signature, bytes32 _transferId, uint256 _dstChainId) internal {
        _useUnorderedNonce(_nonce);

        bytes32 msgHash = keccak256(abi.encodePacked(_nonce, block.chainid, address(this), msg.sender, _transferId, _dstChainId));

        bytes32 finalMsgHash = msgHash.toEthSignedMessageHash();

        address signer_ = finalMsgHash.recover(_signature);

        if (signer_ != signer) {
            revert NotSigner();
        }
    }

    /// @notice Checks whether a nonce is taken and sets the bit at the bit position in the bitmap at the word position
    /// @param nonce The nonce to spend
    function _useUnorderedNonce(uint256 nonce) internal {
        (uint256 wordPos, uint256 bitPos) = bitmapPositions(nonce);
        uint256 bit = 1 << bitPos;
        uint256 flipped = nonceBitmap[wordPos] ^= bit;

        if (flipped & bit == 0) revert InvalidNonce();
    }

    /// @notice Returns the index of the bitmap and the bit position within the bitmap. Used for unordered nonces
    /// @param nonce The nonce to get the associated word and bit positions
    /// @return wordPos The word position or index into the nonceBitmap
    /// @return bitPos The bit position
    /// @dev The first 248 bits of the nonce value is the index of the desired bitmap
    /// @dev The last 8 bits of the nonce value is the position of the bit in the bitmap
    function bitmapPositions(uint256 nonce) internal pure returns (uint256 wordPos, uint256 bitPos) {
        wordPos = uint248(nonce >> 8);
        bitPos = uint8(nonce);
    }
}

File 13 of 21 : IBKBridgeAccess.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.18;

import {AccessType} from './IBKBridgeParams.sol';

interface IBKBridgeAccess {
    function setAccess(AccessType _accessType, bytes calldata _inputs) external;

    function checkBridgeReady() external view returns (bool);

    function pause() external;

    function unpause() external;

    function rescueETH() external;

    function rescueERC20(address asset) external;

    // function paused() external view returns(bool);

    // function transferOwnership(address newOwner) external;

    // function owner() external view returns(address);

    // function safe() external view returns(address);

    // function operator() external view returns(address);

    // function signer() external view returns(address);

    // function vault() external view returns(address);

    // function vaultToken() external view returns(address);

    // function isRelayer(address _addr) external view returns(bool);

    // function isRouter(address _addr) external view returns(bool);
}

File 14 of 21 : IBKBridgeErrors.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.18;

interface IBKBridgeErrors {
    error AccessTypeNotAvailable();
    error TransferFailed();
    error InvalidAddress();
    error InvalidNonce();
    error NotSafe();
    error NotOperator();
    error NotSigner();
    error NotVault();
    error NotVaultToken();
    error NotSender();
    error NotRelayer();
    error NotRouter();
    error OrderAlreadyExist();
    error OrderNotSend();
    error OrderAlreadySend();
    error EthBalanceNotEnough();
    error WrongVaultReceiveToken();
    error WrongRefundAmount();
    error WrongRelayAmount();
    error SwapInsuffenceOutPut();
    error SwapReceiverMisMatch();
}

File 15 of 21 : IBKBridgeParams.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.18;

enum AccessType {
    SET_SAFE,
    SET_OPERATOR,
    SET_SINGER,
    SET_VAULT,
    SET_VAULT_TOKEN,
    SET_RELAYERS,
    SET_ROUTERS
}

struct SignInfo {
    uint256 nonce;
    bytes signature;
}

struct OrderInfo {
    address vaultReceiver;
    bytes32 transferId;
    address sender;
    address receiver;
    address srcToken;
    address dstToken;
    uint256 srcChainId;
    uint256 dstChainId;
    uint256 amount;
    uint256 timestamp;
}

struct SwapV1Info {
    address bkSwapV1Router;
    address handlerAddress;
    address router;
    address[] path;
    uint24[] poolFee;
    uint256 amountIn;
    uint256 minAmountOut;
    address to;
}

struct SwapV2Info {
    address bkSwapV2Router;
    address fromTokenAddress;
    address toTokenAddress;
    address to;
    uint256 amountInTotal;
    uint256 minAmountOut;
    bytes data;
}

struct HandlerCallBack {
    uint256 amount;
    uint256 status;
}

File 16 of 21 : IBKBridgeRouter.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.18;

import {SignInfo, OrderInfo, SwapV1Info, SwapV2Info, HandlerCallBack} from './IBKBridgeParams.sol';

interface IBKBridgeRouter {
    function orderStatus(bytes32 _key) external view returns (uint256);
    function orderAmount(bytes32 _key) external view returns (uint256);

    function send(SignInfo calldata _signInfo, OrderInfo calldata _orderInfo) external payable;

    function sendV1(SignInfo calldata _signInfo, OrderInfo calldata _orderInfo, SwapV1Info calldata _swapV1Info)
        external
        payable;

    function sendV2(SignInfo calldata _signInfo, OrderInfo calldata _orderInfo, SwapV2Info calldata _swapV2Info)
        external
        payable;

    function relay(SignInfo calldata _signInfo, OrderInfo calldata _orderInfo, uint256 _relayAmount) external payable;

    function relayV1(
        SignInfo calldata _signInfo,
        OrderInfo calldata _orderInfo,
        SwapV1Info calldata _swapV1Info,
        uint256 _relayAmount
    ) external payable;

    function relayV2(
        SignInfo calldata _signInfo,
        OrderInfo calldata _orderInfo,
        SwapV2Info calldata _swapV2Info,
        uint256 _relayAmount
    ) external payable;

    function cancel(SignInfo calldata _signInfo, OrderInfo calldata _orderInfo) external payable;

    function refund(SignInfo calldata _signInfo, OrderInfo calldata _orderInfo, uint256 _refundAmount)
        external
        payable;
}

File 17 of 21 : IBKSwap.sol
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.17;

interface IBKSwap {
    function swap(
        address payable _handlerAddress,
        address _router,
        address[] memory _path,
        uint24[] memory _poolFee,
        uint256 _amountIn,
        uint256 _minAmountOut,
        address _to
    ) external payable returns (uint256);
}

File 18 of 21 : IBKSwapRouter.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.17;

interface IBKSwapRouter {
    struct SwapParams {
        address fromTokenAddress;
        uint256 amountInTotal;
        bytes data;
    }

    function swap(SwapParams calldata swapParams) external payable;
}

File 19 of 21 : BKBridgeHandler.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.18;

import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';
import '../interfaces/swap/IBKSwap.sol';
import '../interfaces/swap/IBKSwapRouter.sol';
import './TransferHelper.sol';
import './BKBridgeKey.sol';
import '../interfaces/IBKBridgeErrors.sol';
import {OrderInfo, SignInfo, SwapV1Info, SwapV2Info, HandlerCallBack} from '../interfaces/IBKBridgeParams.sol';

library BKBridgeHandler {
    using SafeERC20 for IERC20;

    uint256 private constant _INEXIST = 0;
    uint256 private constant _SEND = 1;
    uint256 private constant _RELAY = 2;
    uint256 private constant _CANCEL = 3;
    uint256 private constant _REFUND = 4;

    function send(
        OrderInfo calldata _orderInfo,
        mapping(bytes32 => uint256) storage orderStatus,
        mapping(bytes32 => uint256) storage orderAmount
    ) external returns (HandlerCallBack memory callback) {
        bytes32 key = BKBridgeKey.keyOf(_orderInfo);
        if (orderStatus[key] != _INEXIST) {
            revert IBKBridgeErrors.OrderAlreadyExist();
        }

        IERC20 iVaultToken = IERC20(_orderInfo.srcToken);
        uint256 vaultBeforeBalance = iVaultToken.balanceOf(_orderInfo.vaultReceiver);

        orderAmount[key] = _orderInfo.amount;
        orderStatus[key] = _SEND;
        TransferHelper.safeTransferFrom(_orderInfo.srcToken, msg.sender, _orderInfo.vaultReceiver, _orderInfo.amount);

        if (iVaultToken.balanceOf(_orderInfo.vaultReceiver) - vaultBeforeBalance != _orderInfo.amount) {
            revert IBKBridgeErrors.WrongVaultReceiveToken();
        }

        callback.amount = _orderInfo.amount;
        callback.status = _SEND;
    }

    function sendV1(
        OrderInfo calldata _orderInfo,
        SwapV1Info calldata _swapV1Info,
        mapping(bytes32 => uint256) storage orderStatus,
        mapping(bytes32 => uint256) storage orderAmount
    ) external returns (HandlerCallBack memory callback) {
        address swapTokenOut = _swapV1Info.path[_swapV1Info.path.length - 1];
        bytes32 key = BKBridgeKey.keyOf(_orderInfo);
        if (orderStatus[key] != _INEXIST) {
            revert IBKBridgeErrors.OrderAlreadyExist();
        }

        IERC20 iSwapTokenOut = IERC20(swapTokenOut);
        uint256 vaultBeforeBalance = iSwapTokenOut.balanceOf(_orderInfo.vaultReceiver);

        orderStatus[key] = _SEND;
        _bridgeForSwapV1(_swapV1Info);

        uint256 valutTokenAmount = iSwapTokenOut.balanceOf(_orderInfo.vaultReceiver) - vaultBeforeBalance;
        if (valutTokenAmount < _swapV1Info.minAmountOut) {
            revert IBKBridgeErrors.WrongVaultReceiveToken();
        }

        orderAmount[key] = valutTokenAmount;

        callback.amount = valutTokenAmount;
        callback.status = _SEND;
    }

    function sendV2(
        OrderInfo calldata _orderInfo,
        SwapV2Info calldata _swapV2Info,
        mapping(bytes32 => uint256) storage orderStatus,
        mapping(bytes32 => uint256) storage orderAmount
    ) external returns (HandlerCallBack memory callback) {
        bytes32 key = BKBridgeKey.keyOf(_orderInfo);
        if (orderStatus[key] != _INEXIST) {
            revert IBKBridgeErrors.OrderAlreadyExist();
        }

        IERC20 iSwapTokenOut = IERC20(_swapV2Info.toTokenAddress);
        uint256 vaultBeforeBalance = iSwapTokenOut.balanceOf(_orderInfo.vaultReceiver);

        orderStatus[key] = _SEND;
        _bridgeForSwapV2(_swapV2Info);

        uint256 valutTokenAmount = iSwapTokenOut.balanceOf(_orderInfo.vaultReceiver) - vaultBeforeBalance;
        if (valutTokenAmount < _swapV2Info.minAmountOut) {
            revert IBKBridgeErrors.WrongVaultReceiveToken();
        }

        orderAmount[key] = valutTokenAmount;
        
        callback.amount = valutTokenAmount;
        callback.status = _SEND;
    }

    function relay(OrderInfo calldata _orderInfo, uint256 _relayAmount, mapping(bytes32 => uint256) storage orderStatus)
        external
        returns (HandlerCallBack memory callback)
    {
        bytes32 key = BKBridgeKey.keyOf(_orderInfo);
        if (orderStatus[key] != _INEXIST) {
            revert IBKBridgeErrors.OrderAlreadyExist();
        }
        IERC20 iVaultToken = IERC20(_orderInfo.dstToken);
        uint256 vaultBeforeBalance = iVaultToken.balanceOf(msg.sender);

        orderStatus[key] = _RELAY;
        TransferHelper.safeTransferFrom(_orderInfo.dstToken, msg.sender, _orderInfo.receiver, _relayAmount);
        if (vaultBeforeBalance - iVaultToken.balanceOf(msg.sender) != _relayAmount) {
            revert IBKBridgeErrors.WrongRelayAmount();
        }

        callback.amount = _relayAmount;
        callback.status = _RELAY;
    }

    function relayV1(
        OrderInfo calldata _orderInfo,
        SwapV1Info calldata _swapV1Info,
        uint256 _relayAmount,
        mapping(bytes32 => uint256) storage orderStatus
    ) external returns (HandlerCallBack memory callback) {
        address swapTokenIn = _swapV1Info.path[0];
        bytes32 key = BKBridgeKey.keyOf(_orderInfo);
        if (orderStatus[key] != _INEXIST) {
            revert IBKBridgeErrors.OrderAlreadyExist();
        }

        IERC20 iSwapTokenIn = IERC20(swapTokenIn);
        uint256 vaultBeforeBalance = iSwapTokenIn.balanceOf(msg.sender);

        address SwapTokenOutAddress = _swapV1Info.path[_swapV1Info.path.length - 1];
        uint256 receiverBeforeBalance; 
        if(TransferHelper.isETH(SwapTokenOutAddress)) {
            receiverBeforeBalance = _orderInfo.receiver.balance;
        } else {
            receiverBeforeBalance = IERC20(SwapTokenOutAddress).balanceOf(_orderInfo.receiver);
        }

        orderStatus[key] = _RELAY;
        _bridgeForSwapV1(_swapV1Info);

        uint256 valutTokenAmount = vaultBeforeBalance - iSwapTokenIn.balanceOf(msg.sender);
        if (_relayAmount != valutTokenAmount) {
            revert IBKBridgeErrors.WrongRelayAmount();
        }

        if(TransferHelper.isETH(SwapTokenOutAddress)) {
            if ((_orderInfo.receiver.balance - receiverBeforeBalance) < _swapV1Info.minAmountOut) {
                revert IBKBridgeErrors.SwapInsuffenceOutPut();
            } 
        } else {
            if ((IERC20(SwapTokenOutAddress).balanceOf(_orderInfo.receiver) - receiverBeforeBalance) < _swapV1Info.minAmountOut) {
                revert IBKBridgeErrors.SwapInsuffenceOutPut();
            } 
        }

        callback.amount = _relayAmount;
        callback.status = _RELAY;
    }

    function relayV2(
        OrderInfo calldata _orderInfo,
        SwapV2Info calldata _swapV2Info,
        uint256 _relayAmount,
        mapping(bytes32 => uint256) storage orderStatus
    ) external returns (HandlerCallBack memory callback) {
        bytes32 key = BKBridgeKey.keyOf(_orderInfo);
        if (orderStatus[key] != _INEXIST) {
            revert IBKBridgeErrors.OrderAlreadyExist();
        }

        IERC20 iSwapTokenIn = IERC20(_swapV2Info.fromTokenAddress);
        uint256 vaultBeforeBalance = iSwapTokenIn.balanceOf(msg.sender);

        address SwapTokenOutAddress = _swapV2Info.toTokenAddress;
        uint256 receiverBeforeBalance; 
        if(TransferHelper.isETH(SwapTokenOutAddress)) {
            receiverBeforeBalance = _orderInfo.receiver.balance;
        } else {
            receiverBeforeBalance = IERC20(SwapTokenOutAddress).balanceOf(_orderInfo.receiver);
        }
        
        orderStatus[key] = _RELAY;
        _bridgeForSwapV2(_swapV2Info);

        uint256 valutTokenAmount = vaultBeforeBalance - iSwapTokenIn.balanceOf(msg.sender);
        if (_relayAmount != valutTokenAmount) {
            revert IBKBridgeErrors.WrongRelayAmount();
        }

        if(TransferHelper.isETH(SwapTokenOutAddress)) {
            if ((_orderInfo.receiver.balance - receiverBeforeBalance) < _swapV2Info.minAmountOut) {
                revert IBKBridgeErrors.SwapInsuffenceOutPut();
            } 
        } else {
            if ((IERC20(SwapTokenOutAddress).balanceOf(_orderInfo.receiver) - receiverBeforeBalance) < _swapV2Info.minAmountOut) {
                revert IBKBridgeErrors.SwapInsuffenceOutPut();
            } 
        }

        callback.amount = _relayAmount;
        callback.status = _RELAY;
    }

    function cancel(OrderInfo calldata _orderInfo, mapping(bytes32 => uint256) storage orderStatus)
        external
        returns (HandlerCallBack memory callback)
    {
        bytes32 key = BKBridgeKey.keyOf(_orderInfo);
        if (orderStatus[key] != _INEXIST) {
            revert IBKBridgeErrors.OrderAlreadyExist();
        }

        orderStatus[key] = _CANCEL;
        callback.amount = 0;
        callback.status = _CANCEL;
    }

    function refund(
        OrderInfo calldata _orderInfo,
        uint256 _refundAmount,
        address _vaultToken,
        mapping(bytes32 => uint256) storage orderStatus,
        mapping(bytes32 => uint256) storage orderAmount
    ) external returns (HandlerCallBack memory callback) {
        bytes32 key = BKBridgeKey.keyOf(_orderInfo);
        if (orderStatus[key] != _SEND) {
            revert IBKBridgeErrors.OrderNotSend();
        }
        if (_refundAmount > orderAmount[key]) {
            revert IBKBridgeErrors.WrongRefundAmount();
        }
        orderAmount[key] = 0;
        orderStatus[key] = _REFUND;
        TransferHelper.safeTransferFrom(_vaultToken, msg.sender, _orderInfo.sender, _refundAmount);
        callback.amount = _refundAmount;
        callback.status = _REFUND;
    }

    function _bridgeForSwapV1(SwapV1Info calldata _swapV1Info) internal {
        address swapTokenIn = _swapV1Info.path[0];

        if (TransferHelper.isETH(swapTokenIn)) {
            if (msg.value < _swapV1Info.amountIn) {
                revert IBKBridgeErrors.EthBalanceNotEnough();
            }
        } else {
            TransferHelper.safeTransferFrom(swapTokenIn, msg.sender, address(this), _swapV1Info.amountIn);
            TransferHelper.approveMax(IERC20(swapTokenIn), _swapV1Info.bkSwapV1Router, _swapV1Info.amountIn);
        }

        IBKSwap(_swapV1Info.bkSwapV1Router).swap{value: msg.value}(
            payable(_swapV1Info.handlerAddress),
            _swapV1Info.router,
            _swapV1Info.path,
            _swapV1Info.poolFee,
            _swapV1Info.amountIn,
            _swapV1Info.minAmountOut,
            _swapV1Info.to
        );
    }

    function _bridgeForSwapV2(SwapV2Info calldata _swapV2Info) internal {
        address swapTokenIn = _swapV2Info.fromTokenAddress;
        if (TransferHelper.isETH(swapTokenIn)) {
            if (msg.value < _swapV2Info.amountInTotal) {
                revert IBKBridgeErrors.EthBalanceNotEnough();
            }
        } else {
            TransferHelper.safeTransferFrom(swapTokenIn, msg.sender, address(this), _swapV2Info.amountInTotal);
            TransferHelper.approveMax(IERC20(swapTokenIn), _swapV2Info.bkSwapV2Router, _swapV2Info.amountInTotal);
        }

        IBKSwapRouter(_swapV2Info.bkSwapV2Router).swap{value: msg.value}(
            IBKSwapRouter.SwapParams(_swapV2Info.fromTokenAddress, _swapV2Info.amountInTotal, _swapV2Info.data)
        );
    }
}

File 20 of 21 : BKBridgeKey.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.18;

import {OrderInfo} from '../interfaces/IBKBridgeParams.sol';

library BKBridgeKey {
    bytes16 internal constant BRIDGE_SALT0 = 'BitKeep bridge';
    bytes16 internal constant BRIDGE_SALT1 = 'Version 1.0.0';

    function keyOf(OrderInfo calldata _orderInfo) internal pure returns (bytes32 key) {
        key = keccak256(
            abi.encodePacked(
                _orderInfo.transferId,
                _orderInfo.vaultReceiver,
                _orderInfo.sender,
                _orderInfo.receiver,
                _orderInfo.srcToken,
                BRIDGE_SALT0,
                _orderInfo.dstToken,
                _orderInfo.srcChainId,
                _orderInfo.dstChainId,
                BRIDGE_SALT1,
                _orderInfo.amount,
                _orderInfo.timestamp
            )
        );
    }
}

File 21 of 21 : TransferHelper.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.18;

import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';

library TransferHelper {
    using SafeERC20 for IERC20;

    /// @notice Transfers tokens from the targeted address to the given destination
    /// @notice Errors with 'STF' if transfer fails
    /// @param token The contract address of the token to be transferred
    /// @param from The originating address from which the tokens will be transferred
    /// @param to The destination address of the transfer
    /// @param value The amount to be transferred
    function safeTransferFrom(address token, address from, address to, uint256 value) internal {
        (bool success, bytes memory data) =
            token.call(abi.encodeWithSelector(IERC20.transferFrom.selector, from, to, value));
        require(success && (data.length == 0 || abi.decode(data, (bool))), 'STF');
    }

    /// @notice Transfers tokens from msg.sender to a recipient
    /// @dev Errors with ST if transfer fails
    /// @param token The contract address of the token which will be transferred
    /// @param to The recipient of the transfer
    /// @param value The value of the transfer
    function safeTransfer(address token, address to, uint256 value) internal {
        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(IERC20.transfer.selector, to, value));
        require(success && (data.length == 0 || abi.decode(data, (bool))), 'ST');
    }

    /// @notice Approves the stipulated contract to spend the given allowance in the given token
    /// @dev Errors with 'SA' if transfer fails
    /// @param token The contract address of the token to be approved
    /// @param to The target of the approval
    /// @param value The amount of the given token the target will be allowed to spend
    function safeApprove(address token, address to, uint256 value) internal {
        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(IERC20.approve.selector, to, value));
        require(success && (data.length == 0 || abi.decode(data, (bool))), 'SA');
    }

    /// @notice Transfers ETH to the recipient address
    /// @dev Fails with `STE`
    /// @param to The destination of the transfer
    /// @param value The value to be transferred
    function safeTransferETH(address to, uint256 value) internal {
        (bool success,) = to.call{value: value}(new bytes(0));
        require(success, 'STE');
    }

    function approveMax(IERC20 _token, address _spender, uint256 _amount) internal {
        uint256 allowance = _token.allowance(address(this), address(_spender));
        if (allowance < _amount) {
            if (allowance > 0) {
                _token.safeApprove(address(_spender), 0);
            }
            _token.safeApprove(address(_spender), type(uint256).max);
        }
    }

    function isETH(address _tokenAddress) internal pure returns (bool) {
        return (_tokenAddress == 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)
            || (_tokenAddress == 0x0000000000000000000000000000000000000000);
    }
}

Settings
{
  "optimizer": {
    "enabled": false,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {
    "contracts/libs/BKBridgeHandler.sol": {
      "BKBridgeHandler": "0xa5237a040ee649a4f670102fc6aab87c235b6428"
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AccessTypeNotAvailable","type":"error"},{"inputs":[],"name":"EthBalanceNotEnough","type":"error"},{"inputs":[],"name":"InvalidAddress","type":"error"},{"inputs":[],"name":"InvalidNonce","type":"error"},{"inputs":[],"name":"NotOperator","type":"error"},{"inputs":[],"name":"NotRelayer","type":"error"},{"inputs":[],"name":"NotRouter","type":"error"},{"inputs":[],"name":"NotSafe","type":"error"},{"inputs":[],"name":"NotSender","type":"error"},{"inputs":[],"name":"NotSigner","type":"error"},{"inputs":[],"name":"NotVault","type":"error"},{"inputs":[],"name":"NotVaultToken","type":"error"},{"inputs":[],"name":"OrderAlreadyExist","type":"error"},{"inputs":[],"name":"OrderAlreadySend","type":"error"},{"inputs":[],"name":"OrderNotSend","type":"error"},{"inputs":[],"name":"SwapInsuffenceOutPut","type":"error"},{"inputs":[],"name":"SwapReceiverMisMatch","type":"error"},{"inputs":[],"name":"TransferFailed","type":"error"},{"inputs":[],"name":"WrongRefundAmount","type":"error"},{"inputs":[],"name":"WrongRelayAmount","type":"error"},{"inputs":[],"name":"WrongVaultReceiveToken","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"orderStatus","type":"uint256"},{"indexed":true,"internalType":"bytes32","name":"transferId","type":"bytes32"},{"indexed":false,"internalType":"address","name":"vaultReceiver","type":"address"},{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"address","name":"srcToken","type":"address"},{"indexed":false,"internalType":"address","name":"dstToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"srcChainId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"dstChainId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"BKBridge","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"asset","type":"address"},{"indexed":false,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RescueERC20","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RescueETH","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newOperator","type":"address"}],"name":"SetOperator","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address[]","name":"relayers","type":"address[]"},{"indexed":false,"internalType":"bool","name":"isTrue","type":"bool"}],"name":"SetRelayers","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address[]","name":"routers","type":"address[]"},{"indexed":false,"internalType":"bool","name":"isTrue","type":"bool"}],"name":"SetRouters","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newSafe","type":"address"}],"name":"SetSafe","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newSigner","type":"address"}],"name":"SetSigner","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newVault","type":"address"}],"name":"SetVault","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newValutToken","type":"address"}],"name":"SetVaultToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[{"components":[{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct SignInfo","name":"_signInfo","type":"tuple"},{"components":[{"internalType":"address","name":"vaultReceiver","type":"address"},{"internalType":"bytes32","name":"transferId","type":"bytes32"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"srcToken","type":"address"},{"internalType":"address","name":"dstToken","type":"address"},{"internalType":"uint256","name":"srcChainId","type":"uint256"},{"internalType":"uint256","name":"dstChainId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"}],"internalType":"struct OrderInfo","name":"_orderInfo","type":"tuple"}],"name":"cancel","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"checkBridgeReady","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isRelayer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isRouter","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"operator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"orderAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"orderStatus","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct SignInfo","name":"_signInfo","type":"tuple"},{"components":[{"internalType":"address","name":"vaultReceiver","type":"address"},{"internalType":"bytes32","name":"transferId","type":"bytes32"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"srcToken","type":"address"},{"internalType":"address","name":"dstToken","type":"address"},{"internalType":"uint256","name":"srcChainId","type":"uint256"},{"internalType":"uint256","name":"dstChainId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"}],"internalType":"struct OrderInfo","name":"_orderInfo","type":"tuple"},{"internalType":"uint256","name":"_refundAmount","type":"uint256"}],"name":"refund","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct SignInfo","name":"_signInfo","type":"tuple"},{"components":[{"internalType":"address","name":"vaultReceiver","type":"address"},{"internalType":"bytes32","name":"transferId","type":"bytes32"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"srcToken","type":"address"},{"internalType":"address","name":"dstToken","type":"address"},{"internalType":"uint256","name":"srcChainId","type":"uint256"},{"internalType":"uint256","name":"dstChainId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"}],"internalType":"struct OrderInfo","name":"_orderInfo","type":"tuple"},{"internalType":"uint256","name":"_relayAmount","type":"uint256"}],"name":"relay","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct SignInfo","name":"_signInfo","type":"tuple"},{"components":[{"internalType":"address","name":"vaultReceiver","type":"address"},{"internalType":"bytes32","name":"transferId","type":"bytes32"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"srcToken","type":"address"},{"internalType":"address","name":"dstToken","type":"address"},{"internalType":"uint256","name":"srcChainId","type":"uint256"},{"internalType":"uint256","name":"dstChainId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"}],"internalType":"struct OrderInfo","name":"_orderInfo","type":"tuple"},{"components":[{"internalType":"address","name":"bkSwapV1Router","type":"address"},{"internalType":"address","name":"handlerAddress","type":"address"},{"internalType":"address","name":"router","type":"address"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"poolFee","type":"uint24[]"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"internalType":"struct SwapV1Info","name":"_swapV1Info","type":"tuple"},{"internalType":"uint256","name":"_relayAmount","type":"uint256"}],"name":"relayV1","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct SignInfo","name":"_signInfo","type":"tuple"},{"components":[{"internalType":"address","name":"vaultReceiver","type":"address"},{"internalType":"bytes32","name":"transferId","type":"bytes32"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"srcToken","type":"address"},{"internalType":"address","name":"dstToken","type":"address"},{"internalType":"uint256","name":"srcChainId","type":"uint256"},{"internalType":"uint256","name":"dstChainId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"}],"internalType":"struct OrderInfo","name":"_orderInfo","type":"tuple"},{"components":[{"internalType":"address","name":"bkSwapV2Router","type":"address"},{"internalType":"address","name":"fromTokenAddress","type":"address"},{"internalType":"address","name":"toTokenAddress","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amountInTotal","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct SwapV2Info","name":"_swapV2Info","type":"tuple"},{"internalType":"uint256","name":"_relayAmount","type":"uint256"}],"name":"relayV2","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"}],"name":"rescueERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rescueETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"safe","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct SignInfo","name":"_signInfo","type":"tuple"},{"components":[{"internalType":"address","name":"vaultReceiver","type":"address"},{"internalType":"bytes32","name":"transferId","type":"bytes32"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"srcToken","type":"address"},{"internalType":"address","name":"dstToken","type":"address"},{"internalType":"uint256","name":"srcChainId","type":"uint256"},{"internalType":"uint256","name":"dstChainId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"}],"internalType":"struct OrderInfo","name":"_orderInfo","type":"tuple"}],"name":"send","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct SignInfo","name":"_signInfo","type":"tuple"},{"components":[{"internalType":"address","name":"vaultReceiver","type":"address"},{"internalType":"bytes32","name":"transferId","type":"bytes32"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"srcToken","type":"address"},{"internalType":"address","name":"dstToken","type":"address"},{"internalType":"uint256","name":"srcChainId","type":"uint256"},{"internalType":"uint256","name":"dstChainId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"}],"internalType":"struct OrderInfo","name":"_orderInfo","type":"tuple"},{"components":[{"internalType":"address","name":"bkSwapV1Router","type":"address"},{"internalType":"address","name":"handlerAddress","type":"address"},{"internalType":"address","name":"router","type":"address"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint24[]","name":"poolFee","type":"uint24[]"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"internalType":"struct SwapV1Info","name":"_swapV1Info","type":"tuple"}],"name":"sendV1","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct SignInfo","name":"_signInfo","type":"tuple"},{"components":[{"internalType":"address","name":"vaultReceiver","type":"address"},{"internalType":"bytes32","name":"transferId","type":"bytes32"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"srcToken","type":"address"},{"internalType":"address","name":"dstToken","type":"address"},{"internalType":"uint256","name":"srcChainId","type":"uint256"},{"internalType":"uint256","name":"dstChainId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"}],"internalType":"struct OrderInfo","name":"_orderInfo","type":"tuple"},{"components":[{"internalType":"address","name":"bkSwapV2Router","type":"address"},{"internalType":"address","name":"fromTokenAddress","type":"address"},{"internalType":"address","name":"toTokenAddress","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amountInTotal","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct SwapV2Info","name":"_swapV2Info","type":"tuple"}],"name":"sendV2","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"enum AccessType","name":"_accessType","type":"uint8"},{"internalType":"bytes","name":"_inputs","type":"bytes"}],"name":"setAccess","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"signer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"vault","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vaultToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

60806040523480156200001157600080fd5b5060405162004dc638038062004dc6833981810160405281019062000037919062000241565b620000576200004b620000a160201b60201c565b620000a960201b60201c565b60008060146101000a81548160ff0219169083151502179055506001808190555062000089816200016d60201b60201c565b6200009a81620000a960201b60201c565b5062000273565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603620001d4576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006200020982620001dc565b9050919050565b6200021b81620001fc565b81146200022757600080fd5b50565b6000815190506200023b8162000210565b92915050565b6000602082840312156200025a5762000259620001d7565b5b60006200026a848285016200022a565b91505092915050565b614b4380620002836000396000f3fe6080604052600436106101a05760003560e01c8063715018a6116100ec578063ccec37161161008a578063f3d7d28211610064578063f3d7d2821461050f578063f5861d7e1461054c578063fbfa77cf14610568578063ff7542d114610593576101a7565b8063ccec3716146104a1578063ec85c96e146104ca578063f2fde38b146104e6576101a7565b806388a4e81f116100c657806388a4e81f146104225780638da5cb5b1461043e5780638f8ec09114610469578063cb77418f14610485576101a7565b8063715018a6146103b75780638456cb59146103ce578063857c7ad6146103e5576101a7565b80632dff692d11610159578063570ca73511610133578063570ca7351461030d5780635c975abb14610338578063703bafd51461036357806370a50b7f1461038e576101a7565b80632dff692d1461027c5780633f4ba83a146102b9578063541d5548146102d0576101a7565b80631448ffc4146101ac578063186f0354146101c8578063187a3401146101f357806320800a001461020f578063238ac93314610226578063292be67214610251576101a7565b366101a757005b600080fd5b6101c660048036038101906101c19190612e16565b6105af565b005b3480156101d457600080fd5b506101dd6106f1565b6040516101ea9190612ec8565b60405180910390f35b61020d60048036038101906102089190612f02565b610717565b005b34801561021b57600080fd5b506102246108b4565b005b34801561023257600080fd5b5061023b610976565b6040516102489190612ec8565b60405180910390f35b34801561025d57600080fd5b5061026661099c565b6040516102739190612fbf565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190613010565b610c4c565b6040516102b0919061304c565b60405180910390f35b3480156102c557600080fd5b506102ce610c64565b005b3480156102dc57600080fd5b506102f760048036038101906102f29190613093565b610c76565b6040516103049190612fbf565b60405180910390f35b34801561031957600080fd5b50610322610c96565b60405161032f9190612ec8565b60405180910390f35b34801561034457600080fd5b5061034d610cbc565b60405161035a9190612fbf565b60405180910390f35b34801561036f57600080fd5b50610378610cd2565b6040516103859190612ec8565b60405180910390f35b34801561039a57600080fd5b506103b560048036038101906103b0919061314a565b610cf8565b005b3480156103c357600080fd5b506103cc6112c3565b005b3480156103da57600080fd5b506103e36112d7565b005b3480156103f157600080fd5b5061040c60048036038101906104079190613010565b6112e9565b604051610419919061304c565b60405180910390f35b61043c600480360381019061043791906131aa565b611301565b005b34801561044a57600080fd5b50610453611467565b6040516104609190612ec8565b60405180910390f35b610483600480360381019061047e91906131aa565b611490565b005b61049f600480360381019061049a9190613227565b6115a8565b005b3480156104ad57600080fd5b506104c860048036038101906104c39190613093565b6117aa565b005b6104e460048036038101906104df9190612e16565b6118e9565b005b3480156104f257600080fd5b5061050d60048036038101906105089190613093565b611a3a565b005b34801561051b57600080fd5b5061053660048036038101906105319190613093565b611abd565b6040516105439190612fbf565b60405180910390f35b610566600480360381019061056191906132b4565b611add565b005b34801561057457600080fd5b5061057d611c9e565b60405161058a9190612ec8565b60405180910390f35b6105ad60048036038101906105a89190613356565b611cc4565b005b6105b7611e86565b6002600154036105fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f390613440565b60405180910390fd5b600260018190555061060c611ed0565b6106338360000135848060200190610624919061346f565b85602001358660e00135611f55565b600073a5237a040ee649a4f670102fc6aab87c235b642863bcabb7178484600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a600b6040518663ffffffff1660e01b8152600401610698959493929190613685565b6040805180830381865af41580156106b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106d891906137d3565b90506106e4838261208c565b5060018081905550505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61071f611e86565b600260015403610764576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161075b90613440565b60405180910390fd5b6002600181905550610774611ed0565b61079b846000013585806020019061078c919061346f565b86602001358760e00135611f55565b6107b68360000160208101906107b19190613093565b612148565b6107d18260200160208101906107cc9190613093565b6121d2565b6107ec8260000160208101906107e79190613093565b61225c565b61081a8360600160208101906108029190613093565b8360600160208101906108159190613093565b6122e2565b600073a5237a040ee649a4f670102fc6aab87c235b642863047fe78a858585600a6040518563ffffffff1660e01b815260040161085a9493929190613995565b6040805180830381865af4158015610876573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061089a91906137d3565b90506108a6848261208c565b506001808190555050505050565b6108bc61234b565b6108e7600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166123d4565b6000479050610918600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168261243d565b7f77f67778e9529a2fd2147ffb2b10ca2e0d1efd8cb925e1f1d5702e39c5fa8da6600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168260405161096b9291906139e5565b60405180910390a150565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603610a25576040517f9dc4246e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603610aad576040517f7c214f0400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603610b35576040517fa1b035c800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603610bbd576040517f62df054500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603610c45576040517f2b4a00b100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001905090565b600a6020528060005260406000206000915090505481565b610c6c61234b565b610c7461253d565b565b60076020528060005260406000206000915054906101000a900460ff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060149054906101000a900460ff16905090565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610d0061259f565b600680811115610d1357610d12613a0e565b5b836006811115610d2657610d25613a0e565b5b1115610d5e576040517f32d217fe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60046006811115610d7257610d71613a0e565b5b836006811115610d8557610d84613a0e565b5b116110f95760008282810190610d9b9190613a7b565b9050610da6816123d4565b60006006811115610dba57610db9613a0e565b5b846006811115610dcd57610dcc613a0e565b5b03610e4f5780600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f1fe31fe2d50f271a00240eb544ccc3b6eb76a5eb07f16a4d30accfebdef858cb81604051610e429190612ec8565b60405180910390a16110f3565b60016006811115610e6357610e62613a0e565b5b846006811115610e7657610e75613a0e565b5b03610ef85780600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fdbebfba65bd6398fb722063efc10c99f624f9cd8ba657201056af918a676d5ee81604051610eeb9190612ec8565b60405180910390a16110f2565b60026006811115610f0c57610f0b613a0e565b5b846006811115610f1f57610f1e613a0e565b5b03610fa15780600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fbb10aee7ef5a307b8097c6a7f2892b909ff1736fd24a6a5260640c185f7153b681604051610f949190612ec8565b60405180910390a16110f1565b60036006811115610fb557610fb4613a0e565b5b846006811115610fc857610fc7613a0e565b5b0361104a5780600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fd459c7242e23d490831b5676a611c4342d899d28f342d89ae80793e56a930f308160405161103d9190612ec8565b60405180910390a16110f0565b6004600681111561105e5761105d613a0e565b5b84600681111561107157611070613a0e565b5b036110ef5780600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f9dbe0de26387c95817a8feab73f4e9005737391ab66af810e3550e988d929c67816040516110e69190612ec8565b60405180910390a15b5b5b5b5b506112be565b600080838381019061110b9190613b97565b9150915060006005600681111561112557611124613a0e565b5b86600681111561113857611137613a0e565b5b14905060008351905060005b8181101561123a57600085828151811061116157611160613bf3565b5b60200260200101519050611174816123d4565b83156111d65784600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555061122e565b84600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b81600101915050611144565b50811561127f577fe99529546836e35538b5c398257046939516498ca881b0dfa5eb03b40d5c3cc38484604051611272929190613ce0565b60405180910390a16112b9565b7f7a64cbf1e6dd9bc542e071870e693656a204442daefb19085e1830e0d645f78b84846040516112b0929190613ce0565b60405180910390a15b505050505b505050565b6112cb61259f565b6112d5600061261d565b565b6112df61234b565b6112e76126e1565b565b600b6020528060005260406000206000915090505481565b611309611e86565b60026001540361134e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134590613440565b60405180910390fd5b60026001819055508060400160208101906113699190613093565b61137281612744565b611399836000013584806020019061138a919061346f565b85602001358660e00135611f55565b6113b48260000160208101906113af9190613093565b612148565b6113cf8260800160208101906113ca9190613093565b6121d2565b600073a5237a040ee649a4f670102fc6aab87c235b6428639c2427de84600a600b6040518463ffffffff1660e01b815260040161140e93929190613d10565b6040805180830381865af415801561142a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061144e91906137d3565b905061145a838261208c565b5050600180819055505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b611498611e86565b6002600154036114dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114d490613440565b60405180910390fd5b60026001819055506114ed611ed0565b6115148260000135838060200190611505919061346f565b84602001358560e00135611f55565b600073a5237a040ee649a4f670102fc6aab87c235b64286319f46b8d83600a6040518363ffffffff1660e01b8152600401611550929190613d4a565b6040805180830381865af415801561156c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061159091906137d3565b905061159c828261208c565b50600180819055505050565b6115b0611e86565b6002600154036115f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115ec90613440565b60405180910390fd5b60026001819055508160400160208101906116109190613093565b61161981612744565b6116408460000135858060200190611631919061346f565b86602001358760e00135611f55565b61165b8360000160208101906116569190613093565b612148565b6116b682806060019061166e9190613d75565b60018580606001906116809190613d75565b905061168c9190613e07565b81811061169c5761169b613bf3565b5b90506020020160208101906116b19190613093565b6121d2565b6116d18260000160208101906116cc9190613093565b61225c565b61170f600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168360e001602081019061170a9190613093565b6122e2565b600073a5237a040ee649a4f670102fc6aab87c235b64286318d40c1f8585600a600b6040518563ffffffff1660e01b81526004016117509493929190614197565b6040805180830381865af415801561176c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061179091906137d3565b905061179c848261208c565b505060018081905550505050565b6117b261234b565b6117dd600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166123d4565b60008173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016118189190612ec8565b602060405180830381865afa158015611835573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061185991906141e7565b905061188882600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836127ac565b7f9b793652de97f04c5168920587bad4b1c6345295a8f5ad31c59ff946a26f91d282600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040516118dd93929190614214565b60405180910390a15050565b6118f1611e86565b600260015403611936576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192d90613440565b60405180910390fd5b6002600181905550611946611ed0565b61196d836000013584806020019061195e919061346f565b85602001358660e00135611f55565b6119888260000160208101906119839190613093565b612148565b6119a38260a001602081019061199e9190613093565b6121d2565b600073a5237a040ee649a4f670102fc6aab87c235b6428633472ecd08484600a6040518463ffffffff1660e01b81526004016119e19392919061424b565b6040805180830381865af41580156119fd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a2191906137d3565b9050611a2d838261208c565b5060018081905550505050565b611a4261259f565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611ab1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aa8906142f7565b60405180910390fd5b611aba8161261d565b50565b60086020528060005260406000206000915054906101000a900460ff1681565b611ae5611e86565b600260015403611b2a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b2190613440565b60405180910390fd5b6002600181905550611b3a611ed0565b611b618460000135858060200190611b52919061346f565b86602001358760e00135611f55565b611b7c836000016020810190611b779190613093565b612148565b611bbb828060600190611b8f9190613d75565b6000818110611ba157611ba0613bf3565b5b9050602002016020810190611bb69190613093565b6121d2565b611bd6826000016020810190611bd19190613093565b61225c565b611c04836060016020810190611bec9190613093565b8360e0016020810190611bff9190613093565b6122e2565b600073a5237a040ee649a4f670102fc6aab87c235b642863bbde56ed858585600a6040518563ffffffff1660e01b8152600401611c449493929190614317565b6040805180830381865af4158015611c60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c8491906137d3565b9050611c90848261208c565b506001808190555050505050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b611ccc611e86565b600260015403611d11576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d0890613440565b60405180910390fd5b6002600181905550816040016020810190611d2c9190613093565b611d3581612744565b611d5c8460000135858060200190611d4d919061346f565b86602001358760e00135611f55565b611d77836000016020810190611d729190613093565b612148565b611d92826040016020810190611d8d9190613093565b6121d2565b611dad826000016020810190611da89190613093565b61225c565b611deb600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836060016020810190611de69190613093565b6122e2565b600073a5237a040ee649a4f670102fc6aab87c235b642863d97bd5d58585600a600b6040518563ffffffff1660e01b8152600401611e2c9493929190614367565b6040805180830381865af4158015611e48573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e6c91906137d3565b9050611e78848261208c565b505060018081905550505050565b611e8e610cbc565b15611ece576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ec590614403565b60405180910390fd5b565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611f53576040517fc64891a500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b611f5e85612901565b6000854630338686604051602001611f7b969594939291906144ad565b6040516020818303038152906040528051906020012090506000611f9e82612981565b90506000611ff987878080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050836129b190919063ffffffff16565b9050600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614612082576040517fa1b035c800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050505050505050565b816020013581602001517f8ef23af58b418171e290a5dc439b3323c6ffe2261498014cd0d2a8152d93057b8460000160208101906120ca9190613093565b8560400160208101906120dd9190613093565b8660600160208101906120f09190613093565b8760800160208101906121039190613093565b8860a00160208101906121169190613093565b468a60e001358a600001518c610120013560405161213c9998979695949392919061451d565b60405180910390a35050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146121cf576040517f62df054500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614612259576040517f2b4a00b100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50565b600860008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166122df576040517f9165520100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50565b8073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614612347576040517ff4bd3b2a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146123d2576040517f7c214f0400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361243a576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50565b60008273ffffffffffffffffffffffffffffffffffffffff1682600067ffffffffffffffff811115612472576124716136f3565b5b6040519080825280601f01601f1916602001820160405280156124a45781602001600182028036833780820191505090505b506040516124b2919061461b565b60006040518083038185875af1925050503d80600081146124ef576040519150601f19603f3d011682016040523d82523d6000602084013e6124f4565b606091505b5050905080612538576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161252f9061467e565b60405180910390fd5b505050565b6125456129d8565b60008060146101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa612588612a21565b6040516125959190612ec8565b60405180910390a1565b6125a7612a21565b73ffffffffffffffffffffffffffffffffffffffff166125c5611467565b73ffffffffffffffffffffffffffffffffffffffff161461261b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612612906146ea565b60405180910390fd5b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6126e9611e86565b6001600060146101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861272d612a21565b60405161273a9190612ec8565b60405180910390a1565b8073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146127a9576040517fb2c3aa6b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50565b6000808473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60e01b85856040516024016127e19291906139e5565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505060405161284b919061461b565b6000604051808303816000865af19150503d8060008114612888576040519150601f19603f3d011682016040523d82523d6000602084013e61288d565b606091505b50915091508180156128bb57506000815114806128ba5750808060200190518101906128b9919061471f565b5b5b6128fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128f190614798565b60405180910390fd5b5050505050565b60008061290d83612a29565b915091506000816001901b905060008160096000868152602001908152602001600020600082825418925050819055905060008282160361297a576040517f756688fe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050505050565b600081604051602001612994919061480f565b604051602081830303815290604052805190602001209050919050565b60008060006129c08585612a5f565b915091506129cd81612ab0565b819250505092915050565b6129e0610cbc565b612a1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a1690614881565b60405180910390fd5b565b600033905090565b600080600883901c7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1691508260ff169050915091565b6000806041835103612aa05760008060006020860151925060408601519150606086015160001a9050612a9487828585612c7c565b94509450505050612aa9565b60006002915091505b9250929050565b60006004811115612ac457612ac3613a0e565b5b816004811115612ad757612ad6613a0e565b5b0315612c795760016004811115612af157612af0613a0e565b5b816004811115612b0457612b03613a0e565b5b03612b44576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b3b906148ed565b60405180910390fd5b60026004811115612b5857612b57613a0e565b5b816004811115612b6b57612b6a613a0e565b5b03612bab576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612ba290614959565b60405180910390fd5b60036004811115612bbf57612bbe613a0e565b5b816004811115612bd257612bd1613a0e565b5b03612c12576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c09906149eb565b60405180910390fd5b600480811115612c2557612c24613a0e565b5b816004811115612c3857612c37613a0e565b5b03612c78576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c6f90614a7d565b60405180910390fd5b5b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08360001c1115612cb7576000600391509150612d7f565b601b8560ff1614158015612ccf5750601c8560ff1614155b15612ce1576000600491509150612d7f565b600060018787878760405160008152602001604052604051612d069493929190614ac8565b6020604051602081039080840390855afa158015612d28573d6000803e3d6000fd5b505050602060405103519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603612d7657600060019250925050612d7f565b80600092509250505b94509492505050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600060408284031215612db757612db6612d9c565b5b81905092915050565b60006101408284031215612dd757612dd6612d9c565b5b81905092915050565b6000819050919050565b612df381612de0565b8114612dfe57600080fd5b50565b600081359050612e1081612dea565b92915050565b60008060006101808486031215612e3057612e2f612d92565b5b600084013567ffffffffffffffff811115612e4e57612e4d612d97565b5b612e5a86828701612da1565b9350506020612e6b86828701612dc0565b925050610160612e7d86828701612e01565b9150509250925092565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612eb282612e87565b9050919050565b612ec281612ea7565b82525050565b6000602082019050612edd6000830184612eb9565b92915050565b600060e08284031215612ef957612ef8612d9c565b5b81905092915050565b6000806000806101a08587031215612f1d57612f1c612d92565b5b600085013567ffffffffffffffff811115612f3b57612f3a612d97565b5b612f4787828801612da1565b9450506020612f5887828801612dc0565b93505061016085013567ffffffffffffffff811115612f7a57612f79612d97565b5b612f8687828801612ee3565b925050610180612f9887828801612e01565b91505092959194509250565b60008115159050919050565b612fb981612fa4565b82525050565b6000602082019050612fd46000830184612fb0565b92915050565b6000819050919050565b612fed81612fda565b8114612ff857600080fd5b50565b60008135905061300a81612fe4565b92915050565b60006020828403121561302657613025612d92565b5b600061303484828501612ffb565b91505092915050565b61304681612de0565b82525050565b6000602082019050613061600083018461303d565b92915050565b61307081612ea7565b811461307b57600080fd5b50565b60008135905061308d81613067565b92915050565b6000602082840312156130a9576130a8612d92565b5b60006130b78482850161307e565b91505092915050565b600781106130cd57600080fd5b50565b6000813590506130df816130c0565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f84011261310a576131096130e5565b5b8235905067ffffffffffffffff811115613127576131266130ea565b5b602083019150836001820283011115613143576131426130ef565b5b9250929050565b60008060006040848603121561316357613162612d92565b5b6000613171868287016130d0565b935050602084013567ffffffffffffffff81111561319257613191612d97565b5b61319e868287016130f4565b92509250509250925092565b60008061016083850312156131c2576131c1612d92565b5b600083013567ffffffffffffffff8111156131e0576131df612d97565b5b6131ec85828601612da1565b92505060206131fd85828601612dc0565b9150509250929050565b6000610100828403121561321e5761321d612d9c565b5b81905092915050565b6000806000610180848603121561324157613240612d92565b5b600084013567ffffffffffffffff81111561325f5761325e612d97565b5b61326b86828701612da1565b935050602061327c86828701612dc0565b92505061016084013567ffffffffffffffff81111561329e5761329d612d97565b5b6132aa86828701613207565b9150509250925092565b6000806000806101a085870312156132cf576132ce612d92565b5b600085013567ffffffffffffffff8111156132ed576132ec612d97565b5b6132f987828801612da1565b945050602061330a87828801612dc0565b93505061016085013567ffffffffffffffff81111561332c5761332b612d97565b5b61333887828801613207565b92505061018061334a87828801612e01565b91505092959194509250565b600080600061018084860312156133705761336f612d92565b5b600084013567ffffffffffffffff81111561338e5761338d612d97565b5b61339a86828701612da1565b93505060206133ab86828701612dc0565b92505061016084013567ffffffffffffffff8111156133cd576133cc612d97565b5b6133d986828701612ee3565b9150509250925092565b600082825260208201905092915050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b600061342a601f836133e3565b9150613435826133f4565b602082019050919050565b600060208201905081810360008301526134598161341d565b9050919050565b600080fd5b600080fd5b600080fd5b6000808335600160200384360303811261348c5761348b613460565b5b80840192508235915067ffffffffffffffff8211156134ae576134ad613465565b5b6020830192506001820236038313156134ca576134c961346a565b5b509250929050565b60006134e1602084018461307e565b905092915050565b6134f281612ea7565b82525050565b60006135076020840184612ffb565b905092915050565b61351881612fda565b82525050565b600061352d6020840184612e01565b905092915050565b61353e81612de0565b82525050565b610140820161355660008301836134d2565b61356360008501826134e9565b5061357160208301836134f8565b61357e602085018261350f565b5061358c60408301836134d2565b61359960408501826134e9565b506135a760608301836134d2565b6135b460608501826134e9565b506135c260808301836134d2565b6135cf60808501826134e9565b506135dd60a08301836134d2565b6135ea60a08501826134e9565b506135f860c083018361351e565b61360560c0850182613535565b5061361360e083018361351e565b61362060e0850182613535565b5061362f61010083018361351e565b61363d610100850182613535565b5061364c61012083018361351e565b61365a610120850182613535565b50505050565b61366981612de0565b82525050565b61367881612ea7565b82525050565b8082525050565b60006101c08201905061369b6000830188613544565b6136a9610140830187613660565b6136b761016083018661366f565b6136c561018083018561367e565b6136d36101a083018461367e565b9695505050505050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61372b826136e2565b810181811067ffffffffffffffff8211171561374a576137496136f3565b5b80604052505050565b600061375d612d88565b90506137698282613722565b919050565b60008151905061377d81612dea565b92915050565b600060408284031215613799576137986136dd565b5b6137a36040613753565b905060006137b38482850161376e565b60008301525060206137c78482850161376e565b60208301525092915050565b6000604082840312156137e9576137e8612d92565b5b60006137f784828501613783565b91505092915050565b600080fd5b600080fd5b600080fd5b6000808335600160200384360303811261382c5761382b61380a565b5b83810192508235915060208301925067ffffffffffffffff82111561385457613853613800565b5b60018202360383131561386a57613869613805565b5b509250929050565b600082825260208201905092915050565b82818337600083830152505050565b600061389e8385613872565b93506138ab838584613883565b6138b4836136e2565b840190509392505050565b600060e083016138d260008401846134d2565b6138df60008601826134e9565b506138ed60208401846134d2565b6138fa60208601826134e9565b5061390860408401846134d2565b61391560408601826134e9565b5061392360608401846134d2565b61393060608601826134e9565b5061393e608084018461351e565b61394b6080860182613535565b5061395960a084018461351e565b61396660a0860182613535565b5061397460c084018461380f565b85830360c0870152613987838284613892565b925050508091505092915050565b60006101a0820190506139ab6000830187613544565b8181036101408301526139be81866138bf565b90506139ce610160830185613660565b6139dc61018083018461367e565b95945050505050565b60006040820190506139fa6000830185612eb9565b613a07602083018461303d565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6000613a4882612e87565b9050919050565b613a5881613a3d565b8114613a6357600080fd5b50565b600081359050613a7581613a4f565b92915050565b600060208284031215613a9157613a90612d92565b5b6000613a9f84828501613a66565b91505092915050565b600067ffffffffffffffff821115613ac357613ac26136f3565b5b602082029050602081019050919050565b6000613ae7613ae284613aa8565b613753565b90508083825260208201905060208402830185811115613b0a57613b096130ef565b5b835b81811015613b335780613b1f888261307e565b845260208401935050602081019050613b0c565b5050509392505050565b600082601f830112613b5257613b516130e5565b5b8135613b62848260208601613ad4565b91505092915050565b613b7481612fa4565b8114613b7f57600080fd5b50565b600081359050613b9181613b6b565b92915050565b60008060408385031215613bae57613bad612d92565b5b600083013567ffffffffffffffff811115613bcc57613bcb612d97565b5b613bd885828601613b3d565b9250506020613be985828601613b82565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613c5781612ea7565b82525050565b6000613c698383613c4e565b60208301905092915050565b6000602082019050919050565b6000613c8d82613c22565b613c978185613c2d565b9350613ca283613c3e565b8060005b83811015613cd3578151613cba8882613c5d565b9750613cc583613c75565b925050600181019050613ca6565b5085935050505092915050565b60006040820190508181036000830152613cfa8185613c82565b9050613d096020830184612fb0565b9392505050565b600061018082019050613d266000830186613544565b613d3461014083018561367e565b613d4261016083018461367e565b949350505050565b600061016082019050613d606000830185613544565b613d6e61014083018461367e565b9392505050565b60008083356001602003843603038112613d9257613d91613460565b5b80840192508235915067ffffffffffffffff821115613db457613db3613465565b5b602083019250602082023603831315613dd057613dcf61346a565b5b509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000613e1282612de0565b9150613e1d83612de0565b9250828203905081811115613e3557613e34613dd8565b5b92915050565b60008083356001602003843603038112613e5857613e5761380a565b5b83810192508235915060208301925067ffffffffffffffff821115613e8057613e7f613800565b5b602082023603831315613e9657613e95613805565b5b509250929050565b600082825260208201905092915050565b6000819050919050565b6000613ec583836134e9565b60208301905092915050565b6000602082019050919050565b6000613eea8385613e9e565b9350613ef582613eaf565b8060005b85811015613f2e57613f0b82846134d2565b613f158882613eb9565b9750613f2083613ed1565b925050600181019050613ef9565b5085925050509392505050565b60008083356001602003843603038112613f5857613f5761380a565b5b83810192508235915060208301925067ffffffffffffffff821115613f8057613f7f613800565b5b602082023603831315613f9657613f95613805565b5b509250929050565b600082825260208201905092915050565b6000819050919050565b600062ffffff82169050919050565b613fd181613fb9565b82525050565b6000613fe38383613fc8565b60208301905092915050565b613ff881613fb9565b811461400357600080fd5b50565b60008135905061401581613fef565b92915050565b600061402a6020840184614006565b905092915050565b6000602082019050919050565b600061404b8385613f9e565b935061405682613faf565b8060005b8581101561408f5761406c828461401b565b6140768882613fd7565b975061408183614032565b92505060018101905061405a565b5085925050509392505050565b600061010083016140b060008401846134d2565b6140bd60008601826134e9565b506140cb60208401846134d2565b6140d860208601826134e9565b506140e660408401846134d2565b6140f360408601826134e9565b506141016060840184613e3b565b8583036060870152614114838284613ede565b925050506141256080840184613f3b565b858303608087015261413883828461403f565b9250505061414960a084018461351e565b61415660a0860182613535565b5061416460c084018461351e565b61417160c0860182613535565b5061417f60e08401846134d2565b61418c60e08601826134e9565b508091505092915050565b60006101a0820190506141ad6000830187613544565b8181036101408301526141c0818661409c565b90506141d061016083018561367e565b6141de61018083018461367e565b95945050505050565b6000602082840312156141fd576141fc612d92565b5b600061420b8482850161376e565b91505092915050565b60006060820190506142296000830186612eb9565b6142366020830185612eb9565b614243604083018461303d565b949350505050565b6000610180820190506142616000830186613544565b61426f610140830185613660565b61427d61016083018461367e565b949350505050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006142e16026836133e3565b91506142ec82614285565b604082019050919050565b60006020820190508181036000830152614310816142d4565b9050919050565b60006101a08201905061432d6000830187613544565b818103610140830152614340818661409c565b9050614350610160830185613660565b61435e61018083018461367e565b95945050505050565b60006101a08201905061437d6000830187613544565b81810361014083015261439081866138bf565b90506143a061016083018561367e565b6143ae61018083018461367e565b95945050505050565b7f5061757361626c653a2070617573656400000000000000000000000000000000600082015250565b60006143ed6010836133e3565b91506143f8826143b7565b602082019050919050565b6000602082019050818103600083015261441c816143e0565b9050919050565b6000819050919050565b61443e61443982612de0565b614423565b82525050565b60008160601b9050919050565b600061445c82614444565b9050919050565b600061446e82614451565b9050919050565b61448661448182612ea7565b614463565b82525050565b6000819050919050565b6144a76144a282612fda565b61448c565b82525050565b60006144b9828961442d565b6020820191506144c9828861442d565b6020820191506144d98287614475565b6014820191506144e98286614475565b6014820191506144f98285614496565b602082019150614509828461442d565b602082019150819050979650505050505050565b600061012082019050614533600083018c612eb9565b614540602083018b612eb9565b61454d604083018a612eb9565b61455a6060830189612eb9565b6145676080830188612eb9565b61457460a083018761303d565b61458160c083018661303d565b61458e60e083018561303d565b61459c61010083018461303d565b9a9950505050505050505050565b600081519050919050565b600081905092915050565b60005b838110156145de5780820151818401526020810190506145c3565b60008484015250505050565b60006145f5826145aa565b6145ff81856145b5565b935061460f8185602086016145c0565b80840191505092915050565b600061462782846145ea565b915081905092915050565b7f5354450000000000000000000000000000000000000000000000000000000000600082015250565b60006146686003836133e3565b915061467382614632565b602082019050919050565b600060208201905081810360008301526146978161465b565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006146d46020836133e3565b91506146df8261469e565b602082019050919050565b60006020820190508181036000830152614703816146c7565b9050919050565b60008151905061471981613b6b565b92915050565b60006020828403121561473557614734612d92565b5b60006147438482850161470a565b91505092915050565b7f5354000000000000000000000000000000000000000000000000000000000000600082015250565b60006147826002836133e3565b915061478d8261474c565b602082019050919050565b600060208201905081810360008301526147b181614775565b9050919050565b600081905092915050565b7f19457468657265756d205369676e6564204d6573736167653a0a333200000000600082015250565b60006147f9601c836147b8565b9150614804826147c3565b601c82019050919050565b600061481a826147ec565b91506148268284614496565b60208201915081905092915050565b7f5061757361626c653a206e6f7420706175736564000000000000000000000000600082015250565b600061486b6014836133e3565b915061487682614835565b602082019050919050565b6000602082019050818103600083015261489a8161485e565b9050919050565b7f45434453413a20696e76616c6964207369676e61747572650000000000000000600082015250565b60006148d76018836133e3565b91506148e2826148a1565b602082019050919050565b60006020820190508181036000830152614906816148ca565b9050919050565b7f45434453413a20696e76616c6964207369676e6174757265206c656e67746800600082015250565b6000614943601f836133e3565b915061494e8261490d565b602082019050919050565b6000602082019050818103600083015261497281614936565b9050919050565b7f45434453413a20696e76616c6964207369676e6174757265202773272076616c60008201527f7565000000000000000000000000000000000000000000000000000000000000602082015250565b60006149d56022836133e3565b91506149e082614979565b604082019050919050565b60006020820190508181036000830152614a04816149c8565b9050919050565b7f45434453413a20696e76616c6964207369676e6174757265202776272076616c60008201527f7565000000000000000000000000000000000000000000000000000000000000602082015250565b6000614a676022836133e3565b9150614a7282614a0b565b604082019050919050565b60006020820190508181036000830152614a9681614a5a565b9050919050565b614aa681612fda565b82525050565b600060ff82169050919050565b614ac281614aac565b82525050565b6000608082019050614add6000830187614a9d565b614aea6020830186614ab9565b614af76040830185614a9d565b614b046060830184614a9d565b9594505050505056fea2646970667358221220f44fa4ce7962304367f09bad051ae9b8c48f8270eb28646f4a67c2bb6f81c02264736f6c63430008120033000000000000000000000000d96ae67955de94caac04efc8edb857557dd67c2b

Deployed Bytecode

0x6080604052600436106101a05760003560e01c8063715018a6116100ec578063ccec37161161008a578063f3d7d28211610064578063f3d7d2821461050f578063f5861d7e1461054c578063fbfa77cf14610568578063ff7542d114610593576101a7565b8063ccec3716146104a1578063ec85c96e146104ca578063f2fde38b146104e6576101a7565b806388a4e81f116100c657806388a4e81f146104225780638da5cb5b1461043e5780638f8ec09114610469578063cb77418f14610485576101a7565b8063715018a6146103b75780638456cb59146103ce578063857c7ad6146103e5576101a7565b80632dff692d11610159578063570ca73511610133578063570ca7351461030d5780635c975abb14610338578063703bafd51461036357806370a50b7f1461038e576101a7565b80632dff692d1461027c5780633f4ba83a146102b9578063541d5548146102d0576101a7565b80631448ffc4146101ac578063186f0354146101c8578063187a3401146101f357806320800a001461020f578063238ac93314610226578063292be67214610251576101a7565b366101a757005b600080fd5b6101c660048036038101906101c19190612e16565b6105af565b005b3480156101d457600080fd5b506101dd6106f1565b6040516101ea9190612ec8565b60405180910390f35b61020d60048036038101906102089190612f02565b610717565b005b34801561021b57600080fd5b506102246108b4565b005b34801561023257600080fd5b5061023b610976565b6040516102489190612ec8565b60405180910390f35b34801561025d57600080fd5b5061026661099c565b6040516102739190612fbf565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190613010565b610c4c565b6040516102b0919061304c565b60405180910390f35b3480156102c557600080fd5b506102ce610c64565b005b3480156102dc57600080fd5b506102f760048036038101906102f29190613093565b610c76565b6040516103049190612fbf565b60405180910390f35b34801561031957600080fd5b50610322610c96565b60405161032f9190612ec8565b60405180910390f35b34801561034457600080fd5b5061034d610cbc565b60405161035a9190612fbf565b60405180910390f35b34801561036f57600080fd5b50610378610cd2565b6040516103859190612ec8565b60405180910390f35b34801561039a57600080fd5b506103b560048036038101906103b0919061314a565b610cf8565b005b3480156103c357600080fd5b506103cc6112c3565b005b3480156103da57600080fd5b506103e36112d7565b005b3480156103f157600080fd5b5061040c60048036038101906104079190613010565b6112e9565b604051610419919061304c565b60405180910390f35b61043c600480360381019061043791906131aa565b611301565b005b34801561044a57600080fd5b50610453611467565b6040516104609190612ec8565b60405180910390f35b610483600480360381019061047e91906131aa565b611490565b005b61049f600480360381019061049a9190613227565b6115a8565b005b3480156104ad57600080fd5b506104c860048036038101906104c39190613093565b6117aa565b005b6104e460048036038101906104df9190612e16565b6118e9565b005b3480156104f257600080fd5b5061050d60048036038101906105089190613093565b611a3a565b005b34801561051b57600080fd5b5061053660048036038101906105319190613093565b611abd565b6040516105439190612fbf565b60405180910390f35b610566600480360381019061056191906132b4565b611add565b005b34801561057457600080fd5b5061057d611c9e565b60405161058a9190612ec8565b60405180910390f35b6105ad60048036038101906105a89190613356565b611cc4565b005b6105b7611e86565b6002600154036105fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f390613440565b60405180910390fd5b600260018190555061060c611ed0565b6106338360000135848060200190610624919061346f565b85602001358660e00135611f55565b600073a5237a040ee649a4f670102fc6aab87c235b642863bcabb7178484600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a600b6040518663ffffffff1660e01b8152600401610698959493929190613685565b6040805180830381865af41580156106b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106d891906137d3565b90506106e4838261208c565b5060018081905550505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61071f611e86565b600260015403610764576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161075b90613440565b60405180910390fd5b6002600181905550610774611ed0565b61079b846000013585806020019061078c919061346f565b86602001358760e00135611f55565b6107b68360000160208101906107b19190613093565b612148565b6107d18260200160208101906107cc9190613093565b6121d2565b6107ec8260000160208101906107e79190613093565b61225c565b61081a8360600160208101906108029190613093565b8360600160208101906108159190613093565b6122e2565b600073a5237a040ee649a4f670102fc6aab87c235b642863047fe78a858585600a6040518563ffffffff1660e01b815260040161085a9493929190613995565b6040805180830381865af4158015610876573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061089a91906137d3565b90506108a6848261208c565b506001808190555050505050565b6108bc61234b565b6108e7600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166123d4565b6000479050610918600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168261243d565b7f77f67778e9529a2fd2147ffb2b10ca2e0d1efd8cb925e1f1d5702e39c5fa8da6600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168260405161096b9291906139e5565b60405180910390a150565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603610a25576040517f9dc4246e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603610aad576040517f7c214f0400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603610b35576040517fa1b035c800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603610bbd576040517f62df054500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603610c45576040517f2b4a00b100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001905090565b600a6020528060005260406000206000915090505481565b610c6c61234b565b610c7461253d565b565b60076020528060005260406000206000915054906101000a900460ff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060149054906101000a900460ff16905090565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610d0061259f565b600680811115610d1357610d12613a0e565b5b836006811115610d2657610d25613a0e565b5b1115610d5e576040517f32d217fe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60046006811115610d7257610d71613a0e565b5b836006811115610d8557610d84613a0e565b5b116110f95760008282810190610d9b9190613a7b565b9050610da6816123d4565b60006006811115610dba57610db9613a0e565b5b846006811115610dcd57610dcc613a0e565b5b03610e4f5780600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f1fe31fe2d50f271a00240eb544ccc3b6eb76a5eb07f16a4d30accfebdef858cb81604051610e429190612ec8565b60405180910390a16110f3565b60016006811115610e6357610e62613a0e565b5b846006811115610e7657610e75613a0e565b5b03610ef85780600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fdbebfba65bd6398fb722063efc10c99f624f9cd8ba657201056af918a676d5ee81604051610eeb9190612ec8565b60405180910390a16110f2565b60026006811115610f0c57610f0b613a0e565b5b846006811115610f1f57610f1e613a0e565b5b03610fa15780600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fbb10aee7ef5a307b8097c6a7f2892b909ff1736fd24a6a5260640c185f7153b681604051610f949190612ec8565b60405180910390a16110f1565b60036006811115610fb557610fb4613a0e565b5b846006811115610fc857610fc7613a0e565b5b0361104a5780600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fd459c7242e23d490831b5676a611c4342d899d28f342d89ae80793e56a930f308160405161103d9190612ec8565b60405180910390a16110f0565b6004600681111561105e5761105d613a0e565b5b84600681111561107157611070613a0e565b5b036110ef5780600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f9dbe0de26387c95817a8feab73f4e9005737391ab66af810e3550e988d929c67816040516110e69190612ec8565b60405180910390a15b5b5b5b5b506112be565b600080838381019061110b9190613b97565b9150915060006005600681111561112557611124613a0e565b5b86600681111561113857611137613a0e565b5b14905060008351905060005b8181101561123a57600085828151811061116157611160613bf3565b5b60200260200101519050611174816123d4565b83156111d65784600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555061122e565b84600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b81600101915050611144565b50811561127f577fe99529546836e35538b5c398257046939516498ca881b0dfa5eb03b40d5c3cc38484604051611272929190613ce0565b60405180910390a16112b9565b7f7a64cbf1e6dd9bc542e071870e693656a204442daefb19085e1830e0d645f78b84846040516112b0929190613ce0565b60405180910390a15b505050505b505050565b6112cb61259f565b6112d5600061261d565b565b6112df61234b565b6112e76126e1565b565b600b6020528060005260406000206000915090505481565b611309611e86565b60026001540361134e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134590613440565b60405180910390fd5b60026001819055508060400160208101906113699190613093565b61137281612744565b611399836000013584806020019061138a919061346f565b85602001358660e00135611f55565b6113b48260000160208101906113af9190613093565b612148565b6113cf8260800160208101906113ca9190613093565b6121d2565b600073a5237a040ee649a4f670102fc6aab87c235b6428639c2427de84600a600b6040518463ffffffff1660e01b815260040161140e93929190613d10565b6040805180830381865af415801561142a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061144e91906137d3565b905061145a838261208c565b5050600180819055505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b611498611e86565b6002600154036114dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114d490613440565b60405180910390fd5b60026001819055506114ed611ed0565b6115148260000135838060200190611505919061346f565b84602001358560e00135611f55565b600073a5237a040ee649a4f670102fc6aab87c235b64286319f46b8d83600a6040518363ffffffff1660e01b8152600401611550929190613d4a565b6040805180830381865af415801561156c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061159091906137d3565b905061159c828261208c565b50600180819055505050565b6115b0611e86565b6002600154036115f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115ec90613440565b60405180910390fd5b60026001819055508160400160208101906116109190613093565b61161981612744565b6116408460000135858060200190611631919061346f565b86602001358760e00135611f55565b61165b8360000160208101906116569190613093565b612148565b6116b682806060019061166e9190613d75565b60018580606001906116809190613d75565b905061168c9190613e07565b81811061169c5761169b613bf3565b5b90506020020160208101906116b19190613093565b6121d2565b6116d18260000160208101906116cc9190613093565b61225c565b61170f600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168360e001602081019061170a9190613093565b6122e2565b600073a5237a040ee649a4f670102fc6aab87c235b64286318d40c1f8585600a600b6040518563ffffffff1660e01b81526004016117509493929190614197565b6040805180830381865af415801561176c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061179091906137d3565b905061179c848261208c565b505060018081905550505050565b6117b261234b565b6117dd600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166123d4565b60008173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016118189190612ec8565b602060405180830381865afa158015611835573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061185991906141e7565b905061188882600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836127ac565b7f9b793652de97f04c5168920587bad4b1c6345295a8f5ad31c59ff946a26f91d282600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040516118dd93929190614214565b60405180910390a15050565b6118f1611e86565b600260015403611936576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192d90613440565b60405180910390fd5b6002600181905550611946611ed0565b61196d836000013584806020019061195e919061346f565b85602001358660e00135611f55565b6119888260000160208101906119839190613093565b612148565b6119a38260a001602081019061199e9190613093565b6121d2565b600073a5237a040ee649a4f670102fc6aab87c235b6428633472ecd08484600a6040518463ffffffff1660e01b81526004016119e19392919061424b565b6040805180830381865af41580156119fd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a2191906137d3565b9050611a2d838261208c565b5060018081905550505050565b611a4261259f565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611ab1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aa8906142f7565b60405180910390fd5b611aba8161261d565b50565b60086020528060005260406000206000915054906101000a900460ff1681565b611ae5611e86565b600260015403611b2a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b2190613440565b60405180910390fd5b6002600181905550611b3a611ed0565b611b618460000135858060200190611b52919061346f565b86602001358760e00135611f55565b611b7c836000016020810190611b779190613093565b612148565b611bbb828060600190611b8f9190613d75565b6000818110611ba157611ba0613bf3565b5b9050602002016020810190611bb69190613093565b6121d2565b611bd6826000016020810190611bd19190613093565b61225c565b611c04836060016020810190611bec9190613093565b8360e0016020810190611bff9190613093565b6122e2565b600073a5237a040ee649a4f670102fc6aab87c235b642863bbde56ed858585600a6040518563ffffffff1660e01b8152600401611c449493929190614317565b6040805180830381865af4158015611c60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c8491906137d3565b9050611c90848261208c565b506001808190555050505050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b611ccc611e86565b600260015403611d11576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d0890613440565b60405180910390fd5b6002600181905550816040016020810190611d2c9190613093565b611d3581612744565b611d5c8460000135858060200190611d4d919061346f565b86602001358760e00135611f55565b611d77836000016020810190611d729190613093565b612148565b611d92826040016020810190611d8d9190613093565b6121d2565b611dad826000016020810190611da89190613093565b61225c565b611deb600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836060016020810190611de69190613093565b6122e2565b600073a5237a040ee649a4f670102fc6aab87c235b642863d97bd5d58585600a600b6040518563ffffffff1660e01b8152600401611e2c9493929190614367565b6040805180830381865af4158015611e48573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e6c91906137d3565b9050611e78848261208c565b505060018081905550505050565b611e8e610cbc565b15611ece576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ec590614403565b60405180910390fd5b565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611f53576040517fc64891a500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b611f5e85612901565b6000854630338686604051602001611f7b969594939291906144ad565b6040516020818303038152906040528051906020012090506000611f9e82612981565b90506000611ff987878080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050836129b190919063ffffffff16565b9050600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614612082576040517fa1b035c800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050505050505050565b816020013581602001517f8ef23af58b418171e290a5dc439b3323c6ffe2261498014cd0d2a8152d93057b8460000160208101906120ca9190613093565b8560400160208101906120dd9190613093565b8660600160208101906120f09190613093565b8760800160208101906121039190613093565b8860a00160208101906121169190613093565b468a60e001358a600001518c610120013560405161213c9998979695949392919061451d565b60405180910390a35050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146121cf576040517f62df054500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614612259576040517f2b4a00b100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50565b600860008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166122df576040517f9165520100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50565b8073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614612347576040517ff4bd3b2a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146123d2576040517f7c214f0400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361243a576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50565b60008273ffffffffffffffffffffffffffffffffffffffff1682600067ffffffffffffffff811115612472576124716136f3565b5b6040519080825280601f01601f1916602001820160405280156124a45781602001600182028036833780820191505090505b506040516124b2919061461b565b60006040518083038185875af1925050503d80600081146124ef576040519150601f19603f3d011682016040523d82523d6000602084013e6124f4565b606091505b5050905080612538576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161252f9061467e565b60405180910390fd5b505050565b6125456129d8565b60008060146101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa612588612a21565b6040516125959190612ec8565b60405180910390a1565b6125a7612a21565b73ffffffffffffffffffffffffffffffffffffffff166125c5611467565b73ffffffffffffffffffffffffffffffffffffffff161461261b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612612906146ea565b60405180910390fd5b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6126e9611e86565b6001600060146101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861272d612a21565b60405161273a9190612ec8565b60405180910390a1565b8073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146127a9576040517fb2c3aa6b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50565b6000808473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60e01b85856040516024016127e19291906139e5565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505060405161284b919061461b565b6000604051808303816000865af19150503d8060008114612888576040519150601f19603f3d011682016040523d82523d6000602084013e61288d565b606091505b50915091508180156128bb57506000815114806128ba5750808060200190518101906128b9919061471f565b5b5b6128fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128f190614798565b60405180910390fd5b5050505050565b60008061290d83612a29565b915091506000816001901b905060008160096000868152602001908152602001600020600082825418925050819055905060008282160361297a576040517f756688fe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050505050565b600081604051602001612994919061480f565b604051602081830303815290604052805190602001209050919050565b60008060006129c08585612a5f565b915091506129cd81612ab0565b819250505092915050565b6129e0610cbc565b612a1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a1690614881565b60405180910390fd5b565b600033905090565b600080600883901c7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1691508260ff169050915091565b6000806041835103612aa05760008060006020860151925060408601519150606086015160001a9050612a9487828585612c7c565b94509450505050612aa9565b60006002915091505b9250929050565b60006004811115612ac457612ac3613a0e565b5b816004811115612ad757612ad6613a0e565b5b0315612c795760016004811115612af157612af0613a0e565b5b816004811115612b0457612b03613a0e565b5b03612b44576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b3b906148ed565b60405180910390fd5b60026004811115612b5857612b57613a0e565b5b816004811115612b6b57612b6a613a0e565b5b03612bab576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612ba290614959565b60405180910390fd5b60036004811115612bbf57612bbe613a0e565b5b816004811115612bd257612bd1613a0e565b5b03612c12576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c09906149eb565b60405180910390fd5b600480811115612c2557612c24613a0e565b5b816004811115612c3857612c37613a0e565b5b03612c78576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c6f90614a7d565b60405180910390fd5b5b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08360001c1115612cb7576000600391509150612d7f565b601b8560ff1614158015612ccf5750601c8560ff1614155b15612ce1576000600491509150612d7f565b600060018787878760405160008152602001604052604051612d069493929190614ac8565b6020604051602081039080840390855afa158015612d28573d6000803e3d6000fd5b505050602060405103519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603612d7657600060019250925050612d7f565b80600092509250505b94509492505050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600060408284031215612db757612db6612d9c565b5b81905092915050565b60006101408284031215612dd757612dd6612d9c565b5b81905092915050565b6000819050919050565b612df381612de0565b8114612dfe57600080fd5b50565b600081359050612e1081612dea565b92915050565b60008060006101808486031215612e3057612e2f612d92565b5b600084013567ffffffffffffffff811115612e4e57612e4d612d97565b5b612e5a86828701612da1565b9350506020612e6b86828701612dc0565b925050610160612e7d86828701612e01565b9150509250925092565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612eb282612e87565b9050919050565b612ec281612ea7565b82525050565b6000602082019050612edd6000830184612eb9565b92915050565b600060e08284031215612ef957612ef8612d9c565b5b81905092915050565b6000806000806101a08587031215612f1d57612f1c612d92565b5b600085013567ffffffffffffffff811115612f3b57612f3a612d97565b5b612f4787828801612da1565b9450506020612f5887828801612dc0565b93505061016085013567ffffffffffffffff811115612f7a57612f79612d97565b5b612f8687828801612ee3565b925050610180612f9887828801612e01565b91505092959194509250565b60008115159050919050565b612fb981612fa4565b82525050565b6000602082019050612fd46000830184612fb0565b92915050565b6000819050919050565b612fed81612fda565b8114612ff857600080fd5b50565b60008135905061300a81612fe4565b92915050565b60006020828403121561302657613025612d92565b5b600061303484828501612ffb565b91505092915050565b61304681612de0565b82525050565b6000602082019050613061600083018461303d565b92915050565b61307081612ea7565b811461307b57600080fd5b50565b60008135905061308d81613067565b92915050565b6000602082840312156130a9576130a8612d92565b5b60006130b78482850161307e565b91505092915050565b600781106130cd57600080fd5b50565b6000813590506130df816130c0565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f84011261310a576131096130e5565b5b8235905067ffffffffffffffff811115613127576131266130ea565b5b602083019150836001820283011115613143576131426130ef565b5b9250929050565b60008060006040848603121561316357613162612d92565b5b6000613171868287016130d0565b935050602084013567ffffffffffffffff81111561319257613191612d97565b5b61319e868287016130f4565b92509250509250925092565b60008061016083850312156131c2576131c1612d92565b5b600083013567ffffffffffffffff8111156131e0576131df612d97565b5b6131ec85828601612da1565b92505060206131fd85828601612dc0565b9150509250929050565b6000610100828403121561321e5761321d612d9c565b5b81905092915050565b6000806000610180848603121561324157613240612d92565b5b600084013567ffffffffffffffff81111561325f5761325e612d97565b5b61326b86828701612da1565b935050602061327c86828701612dc0565b92505061016084013567ffffffffffffffff81111561329e5761329d612d97565b5b6132aa86828701613207565b9150509250925092565b6000806000806101a085870312156132cf576132ce612d92565b5b600085013567ffffffffffffffff8111156132ed576132ec612d97565b5b6132f987828801612da1565b945050602061330a87828801612dc0565b93505061016085013567ffffffffffffffff81111561332c5761332b612d97565b5b61333887828801613207565b92505061018061334a87828801612e01565b91505092959194509250565b600080600061018084860312156133705761336f612d92565b5b600084013567ffffffffffffffff81111561338e5761338d612d97565b5b61339a86828701612da1565b93505060206133ab86828701612dc0565b92505061016084013567ffffffffffffffff8111156133cd576133cc612d97565b5b6133d986828701612ee3565b9150509250925092565b600082825260208201905092915050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b600061342a601f836133e3565b9150613435826133f4565b602082019050919050565b600060208201905081810360008301526134598161341d565b9050919050565b600080fd5b600080fd5b600080fd5b6000808335600160200384360303811261348c5761348b613460565b5b80840192508235915067ffffffffffffffff8211156134ae576134ad613465565b5b6020830192506001820236038313156134ca576134c961346a565b5b509250929050565b60006134e1602084018461307e565b905092915050565b6134f281612ea7565b82525050565b60006135076020840184612ffb565b905092915050565b61351881612fda565b82525050565b600061352d6020840184612e01565b905092915050565b61353e81612de0565b82525050565b610140820161355660008301836134d2565b61356360008501826134e9565b5061357160208301836134f8565b61357e602085018261350f565b5061358c60408301836134d2565b61359960408501826134e9565b506135a760608301836134d2565b6135b460608501826134e9565b506135c260808301836134d2565b6135cf60808501826134e9565b506135dd60a08301836134d2565b6135ea60a08501826134e9565b506135f860c083018361351e565b61360560c0850182613535565b5061361360e083018361351e565b61362060e0850182613535565b5061362f61010083018361351e565b61363d610100850182613535565b5061364c61012083018361351e565b61365a610120850182613535565b50505050565b61366981612de0565b82525050565b61367881612ea7565b82525050565b8082525050565b60006101c08201905061369b6000830188613544565b6136a9610140830187613660565b6136b761016083018661366f565b6136c561018083018561367e565b6136d36101a083018461367e565b9695505050505050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61372b826136e2565b810181811067ffffffffffffffff8211171561374a576137496136f3565b5b80604052505050565b600061375d612d88565b90506137698282613722565b919050565b60008151905061377d81612dea565b92915050565b600060408284031215613799576137986136dd565b5b6137a36040613753565b905060006137b38482850161376e565b60008301525060206137c78482850161376e565b60208301525092915050565b6000604082840312156137e9576137e8612d92565b5b60006137f784828501613783565b91505092915050565b600080fd5b600080fd5b600080fd5b6000808335600160200384360303811261382c5761382b61380a565b5b83810192508235915060208301925067ffffffffffffffff82111561385457613853613800565b5b60018202360383131561386a57613869613805565b5b509250929050565b600082825260208201905092915050565b82818337600083830152505050565b600061389e8385613872565b93506138ab838584613883565b6138b4836136e2565b840190509392505050565b600060e083016138d260008401846134d2565b6138df60008601826134e9565b506138ed60208401846134d2565b6138fa60208601826134e9565b5061390860408401846134d2565b61391560408601826134e9565b5061392360608401846134d2565b61393060608601826134e9565b5061393e608084018461351e565b61394b6080860182613535565b5061395960a084018461351e565b61396660a0860182613535565b5061397460c084018461380f565b85830360c0870152613987838284613892565b925050508091505092915050565b60006101a0820190506139ab6000830187613544565b8181036101408301526139be81866138bf565b90506139ce610160830185613660565b6139dc61018083018461367e565b95945050505050565b60006040820190506139fa6000830185612eb9565b613a07602083018461303d565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6000613a4882612e87565b9050919050565b613a5881613a3d565b8114613a6357600080fd5b50565b600081359050613a7581613a4f565b92915050565b600060208284031215613a9157613a90612d92565b5b6000613a9f84828501613a66565b91505092915050565b600067ffffffffffffffff821115613ac357613ac26136f3565b5b602082029050602081019050919050565b6000613ae7613ae284613aa8565b613753565b90508083825260208201905060208402830185811115613b0a57613b096130ef565b5b835b81811015613b335780613b1f888261307e565b845260208401935050602081019050613b0c565b5050509392505050565b600082601f830112613b5257613b516130e5565b5b8135613b62848260208601613ad4565b91505092915050565b613b7481612fa4565b8114613b7f57600080fd5b50565b600081359050613b9181613b6b565b92915050565b60008060408385031215613bae57613bad612d92565b5b600083013567ffffffffffffffff811115613bcc57613bcb612d97565b5b613bd885828601613b3d565b9250506020613be985828601613b82565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613c5781612ea7565b82525050565b6000613c698383613c4e565b60208301905092915050565b6000602082019050919050565b6000613c8d82613c22565b613c978185613c2d565b9350613ca283613c3e565b8060005b83811015613cd3578151613cba8882613c5d565b9750613cc583613c75565b925050600181019050613ca6565b5085935050505092915050565b60006040820190508181036000830152613cfa8185613c82565b9050613d096020830184612fb0565b9392505050565b600061018082019050613d266000830186613544565b613d3461014083018561367e565b613d4261016083018461367e565b949350505050565b600061016082019050613d606000830185613544565b613d6e61014083018461367e565b9392505050565b60008083356001602003843603038112613d9257613d91613460565b5b80840192508235915067ffffffffffffffff821115613db457613db3613465565b5b602083019250602082023603831315613dd057613dcf61346a565b5b509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000613e1282612de0565b9150613e1d83612de0565b9250828203905081811115613e3557613e34613dd8565b5b92915050565b60008083356001602003843603038112613e5857613e5761380a565b5b83810192508235915060208301925067ffffffffffffffff821115613e8057613e7f613800565b5b602082023603831315613e9657613e95613805565b5b509250929050565b600082825260208201905092915050565b6000819050919050565b6000613ec583836134e9565b60208301905092915050565b6000602082019050919050565b6000613eea8385613e9e565b9350613ef582613eaf565b8060005b85811015613f2e57613f0b82846134d2565b613f158882613eb9565b9750613f2083613ed1565b925050600181019050613ef9565b5085925050509392505050565b60008083356001602003843603038112613f5857613f5761380a565b5b83810192508235915060208301925067ffffffffffffffff821115613f8057613f7f613800565b5b602082023603831315613f9657613f95613805565b5b509250929050565b600082825260208201905092915050565b6000819050919050565b600062ffffff82169050919050565b613fd181613fb9565b82525050565b6000613fe38383613fc8565b60208301905092915050565b613ff881613fb9565b811461400357600080fd5b50565b60008135905061401581613fef565b92915050565b600061402a6020840184614006565b905092915050565b6000602082019050919050565b600061404b8385613f9e565b935061405682613faf565b8060005b8581101561408f5761406c828461401b565b6140768882613fd7565b975061408183614032565b92505060018101905061405a565b5085925050509392505050565b600061010083016140b060008401846134d2565b6140bd60008601826134e9565b506140cb60208401846134d2565b6140d860208601826134e9565b506140e660408401846134d2565b6140f360408601826134e9565b506141016060840184613e3b565b8583036060870152614114838284613ede565b925050506141256080840184613f3b565b858303608087015261413883828461403f565b9250505061414960a084018461351e565b61415660a0860182613535565b5061416460c084018461351e565b61417160c0860182613535565b5061417f60e08401846134d2565b61418c60e08601826134e9565b508091505092915050565b60006101a0820190506141ad6000830187613544565b8181036101408301526141c0818661409c565b90506141d061016083018561367e565b6141de61018083018461367e565b95945050505050565b6000602082840312156141fd576141fc612d92565b5b600061420b8482850161376e565b91505092915050565b60006060820190506142296000830186612eb9565b6142366020830185612eb9565b614243604083018461303d565b949350505050565b6000610180820190506142616000830186613544565b61426f610140830185613660565b61427d61016083018461367e565b949350505050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006142e16026836133e3565b91506142ec82614285565b604082019050919050565b60006020820190508181036000830152614310816142d4565b9050919050565b60006101a08201905061432d6000830187613544565b818103610140830152614340818661409c565b9050614350610160830185613660565b61435e61018083018461367e565b95945050505050565b60006101a08201905061437d6000830187613544565b81810361014083015261439081866138bf565b90506143a061016083018561367e565b6143ae61018083018461367e565b95945050505050565b7f5061757361626c653a2070617573656400000000000000000000000000000000600082015250565b60006143ed6010836133e3565b91506143f8826143b7565b602082019050919050565b6000602082019050818103600083015261441c816143e0565b9050919050565b6000819050919050565b61443e61443982612de0565b614423565b82525050565b60008160601b9050919050565b600061445c82614444565b9050919050565b600061446e82614451565b9050919050565b61448661448182612ea7565b614463565b82525050565b6000819050919050565b6144a76144a282612fda565b61448c565b82525050565b60006144b9828961442d565b6020820191506144c9828861442d565b6020820191506144d98287614475565b6014820191506144e98286614475565b6014820191506144f98285614496565b602082019150614509828461442d565b602082019150819050979650505050505050565b600061012082019050614533600083018c612eb9565b614540602083018b612eb9565b61454d604083018a612eb9565b61455a6060830189612eb9565b6145676080830188612eb9565b61457460a083018761303d565b61458160c083018661303d565b61458e60e083018561303d565b61459c61010083018461303d565b9a9950505050505050505050565b600081519050919050565b600081905092915050565b60005b838110156145de5780820151818401526020810190506145c3565b60008484015250505050565b60006145f5826145aa565b6145ff81856145b5565b935061460f8185602086016145c0565b80840191505092915050565b600061462782846145ea565b915081905092915050565b7f5354450000000000000000000000000000000000000000000000000000000000600082015250565b60006146686003836133e3565b915061467382614632565b602082019050919050565b600060208201905081810360008301526146978161465b565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006146d46020836133e3565b91506146df8261469e565b602082019050919050565b60006020820190508181036000830152614703816146c7565b9050919050565b60008151905061471981613b6b565b92915050565b60006020828403121561473557614734612d92565b5b60006147438482850161470a565b91505092915050565b7f5354000000000000000000000000000000000000000000000000000000000000600082015250565b60006147826002836133e3565b915061478d8261474c565b602082019050919050565b600060208201905081810360008301526147b181614775565b9050919050565b600081905092915050565b7f19457468657265756d205369676e6564204d6573736167653a0a333200000000600082015250565b60006147f9601c836147b8565b9150614804826147c3565b601c82019050919050565b600061481a826147ec565b91506148268284614496565b60208201915081905092915050565b7f5061757361626c653a206e6f7420706175736564000000000000000000000000600082015250565b600061486b6014836133e3565b915061487682614835565b602082019050919050565b6000602082019050818103600083015261489a8161485e565b9050919050565b7f45434453413a20696e76616c6964207369676e61747572650000000000000000600082015250565b60006148d76018836133e3565b91506148e2826148a1565b602082019050919050565b60006020820190508181036000830152614906816148ca565b9050919050565b7f45434453413a20696e76616c6964207369676e6174757265206c656e67746800600082015250565b6000614943601f836133e3565b915061494e8261490d565b602082019050919050565b6000602082019050818103600083015261497281614936565b9050919050565b7f45434453413a20696e76616c6964207369676e6174757265202773272076616c60008201527f7565000000000000000000000000000000000000000000000000000000000000602082015250565b60006149d56022836133e3565b91506149e082614979565b604082019050919050565b60006020820190508181036000830152614a04816149c8565b9050919050565b7f45434453413a20696e76616c6964207369676e6174757265202776272076616c60008201527f7565000000000000000000000000000000000000000000000000000000000000602082015250565b6000614a676022836133e3565b9150614a7282614a0b565b604082019050919050565b60006020820190508181036000830152614a9681614a5a565b9050919050565b614aa681612fda565b82525050565b600060ff82169050919050565b614ac281614aac565b82525050565b6000608082019050614add6000830187614a9d565b614aea6020830186614ab9565b614af76040830185614a9d565b614b046060830184614a9d565b9594505050505056fea2646970667358221220f44fa4ce7962304367f09bad051ae9b8c48f8270eb28646f4a67c2bb6f81c02264736f6c63430008120033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000d96ae67955de94caac04efc8edb857557dd67c2b

-----Decoded View---------------
Arg [0] : _owner (address): 0xd96aE67955De94cAaC04efc8EDB857557dd67C2B

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000d96ae67955de94caac04efc8edb857557dd67c2b


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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