MOVR Price: $21.32 (-4.08%)
Gas: 3 GWei

Contract

0x8d6cA235Fd71ffF6DF231B6a7823A90A7D40971F

Overview

MOVR Balance

Moonriver Chain LogoMoonriver Chain LogoMoonriver Chain Logo0 MOVR

MOVR Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
0x6080604021461752022-07-05 7:52:24632 days ago1657007544IN
 Create: RangoV1
0 MOVR0.011002442.5

Latest 25 internal transactions (View All)

Advanced mode:
Parent Txn Hash Block From To Value
44864072023-06-18 16:41:30283 days ago1687106490
0x8d6cA235...A7D40971F
20.85722871 MOVR
44586302023-06-14 18:45:06287 days ago1686768306
0x8d6cA235...A7D40971F
1 MOVR
44232402023-06-09 18:56:48292 days ago1686337008
0x8d6cA235...A7D40971F
3.23032129 MOVR
44232152023-06-09 18:51:48292 days ago1686336708
0x8d6cA235...A7D40971F
0.38046517 MOVR
44231722023-06-09 18:43:06292 days ago1686336186
0x8d6cA235...A7D40971F
3.495 MOVR
44231632023-06-09 18:41:12292 days ago1686336072
0x8d6cA235...A7D40971F
0.99785027 MOVR
44230742023-06-09 18:22:48292 days ago1686334968
0x8d6cA235...A7D40971F
1 MOVR
44178152023-06-09 0:34:12293 days ago1686270852
0x8d6cA235...A7D40971F
2.39770483 MOVR
44058352023-06-07 8:00:12295 days ago1686124812
0x8d6cA235...A7D40971F
1.15253431 MOVR
42924722023-05-22 5:45:36311 days ago1684734336
0x8d6cA235...A7D40971F
2.05 MOVR
42534762023-05-16 13:01:42316 days ago1684242102
0x8d6cA235...A7D40971F
1.8 MOVR
42534482023-05-16 12:55:06316 days ago1684241706
0x8d6cA235...A7D40971F
0.52329275 MOVR
42139032023-05-10 16:04:48322 days ago1683734688
0x8d6cA235...A7D40971F
0.1 MOVR
41697912023-05-04 3:57:36329 days ago1683172656
0x8d6cA235...A7D40971F
0.48975285 MOVR
40766532023-04-20 14:02:00342 days ago1681999320
0x8d6cA235...A7D40971F
0.41283523 MOVR
40283952023-04-13 16:00:30349 days ago1681401630
0x8d6cA235...A7D40971F
32.05291491 MOVR
40153482023-04-11 19:20:12351 days ago1681240812
0x8d6cA235...A7D40971F
1.2564423 MOVR
40153482023-04-11 19:20:12351 days ago1681240812
0x8d6cA235...A7D40971F
0.0012577 MOVR
40074572023-04-10 16:14:18352 days ago1681143258
0x8d6cA235...A7D40971F
1.5 MOVR
40026762023-04-09 23:46:00353 days ago1681083960
0x8d6cA235...A7D40971F
14.30665708 MOVR
39860392023-04-07 14:44:24355 days ago1680878664
0x8d6cA235...A7D40971F
4.10253138 MOVR
39713132023-04-05 11:45:00358 days ago1680695100
0x8d6cA235...A7D40971F
1 MOVR
39710372023-04-05 10:47:08358 days ago1680691628
0x8d6cA235...A7D40971F
1.08010906 MOVR
39707362023-04-05 9:44:36358 days ago1680687876
0x8d6cA235...A7D40971F
1 MOVR
39590532023-04-03 16:34:42359 days ago1680539682
0x8d6cA235...A7D40971F
2 MOVR
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
RangoV1

Compiler Version
v0.8.13+commit.abaa5c0e

Optimization Enabled:
Yes with 999999 runs

Other Settings:
default evmVersion, Unlicense license

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 21 : RangoV1.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.13;

import "../libs/BaseProxyContract.sol";
import "./bridges/cbridge/RangoCBridgeProxy.sol";
import "./bridges/thorchain/RangoThorchainProxy.sol";
import "./bridges/multichain/RangoMultichainProxy.sol";

/// @title The main contract that users interact with in the source chain
/// @author Uchiha Sasuke
/// @notice It contains all the required functions to swap on-chain or swap + bridge or swap + bridge + swap initiation in a single step
/// @dev To support a new bridge, it inherits from a proxy with the name of that bridge which adds extra function for that specific bridge
/// @dev There are some extra refund functions for admin to get the money back in case of any unwanted problem
/// @dev This contract is being seen via a transparent proxy from openzeppelin
contract RangoV1 is BaseProxyContract, RangoCBridgeProxy, RangoThorchainProxy, RangoMultichainProxy {

    /// @notice Initializes the state of all sub bridges contracts that RangoV1 inherited from
    /// @param _nativeWrappedAddress Address of wrapped token (WETH, WBNB, etc.) on the current chain
    /// @dev It is the initializer function of proxy pattern, and is equivalent to constructor for normal contracts
    function initialize(address _nativeWrappedAddress) public initializer {
        BaseProxyStorage storage baseProxyStorage = getBaseProxyContractStorage();
        CBridgeProxyStorage storage cbridgeProxyStorage = getCBridgeProxyStorage();
        ThorchainProxyStorage storage thorchainProxyStorage = getThorchainProxyStorage();
        MultichainProxyStorage storage multichainProxyStorage = getMultichainProxyStorage();
        baseProxyStorage.nativeWrappedAddress = _nativeWrappedAddress;
        baseProxyStorage.feeContractAddress = NULL_ADDRESS;
        cbridgeProxyStorage.rangoCBridgeAddress = NULL_ADDRESS;
        thorchainProxyStorage.rangoThorchainAddress = NULL_ADDRESS;
        multichainProxyStorage.rangoMultichainAddress = NULL_ADDRESS;
        __Ownable_init();
        __Pausable_init();
        __ReentrancyGuard_init();
    }

    /// @notice Enables the contract to receive native ETH token from other contracts including WETH contract
    receive() external payable { }

    /// @notice Returns the list of valid Rango contracts that can call other contracts for the security purpose
    /// @dev This contains the contracts that can call others via messaging protocols, and excludes DEX-only contracts such as Thorchain
    /// @return List of addresses of Rango contracts that can call other contracts
    function getValidRangoContracts() external view returns (address[] memory) {
        CBridgeProxyStorage storage cbridgeProxyStorage = getCBridgeProxyStorage();
        MultichainProxyStorage storage multichainProxyStorage = getMultichainProxyStorage();

        address[] memory whitelist = new address[](3);
        whitelist[0] = address(this);
        whitelist[1] = cbridgeProxyStorage.rangoCBridgeAddress;
        whitelist[2] = multichainProxyStorage.rangoMultichainAddress;

        return whitelist;
    }
}

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

pragma solidity ^0.8.0;

import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.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 OwnableUpgradeable is Initializable, ContextUpgradeable {
    address private _owner;

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    function __Ownable_init() internal onlyInitializing {
        __Ownable_init_unchained();
    }

    function __Ownable_init_unchained() internal onlyInitializing {
        _transferOwnership(_msgSender());
    }

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        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);
    }

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

File 3 of 21 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.2;

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

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

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

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

    /**
     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
     * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`.
     */
    modifier initializer() {
        bool isTopLevelCall = _setInitializedVersion(1);
        if (isTopLevelCall) {
            _initializing = true;
        }
        _;
        if (isTopLevelCall) {
            _initializing = false;
            emit Initialized(1);
        }
    }

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original
     * initialization step. This is essential to configure modules that are added through upgrades and that require
     * initialization.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     */
    modifier reinitializer(uint8 version) {
        bool isTopLevelCall = _setInitializedVersion(version);
        if (isTopLevelCall) {
            _initializing = true;
        }
        _;
        if (isTopLevelCall) {
            _initializing = false;
            emit Initialized(version);
        }
    }

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

    /**
     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
     * through proxies.
     */
    function _disableInitializers() internal virtual {
        _setInitializedVersion(type(uint8).max);
    }

    function _setInitializedVersion(uint8 version) private returns (bool) {
        // If the contract is initializing we ignore whether _initialized is set in order to support multiple
        // inheritance patterns, but we only do this in the context of a constructor, and for the lowest level
        // of initializers, because in other contexts the contract may have been reentered.
        if (_initializing) {
            require(
                version == 1 && !AddressUpgradeable.isContract(address(this)),
                "Initializable: contract is already initialized"
            );
            return false;
        } else {
            require(_initialized < version, "Initializable: contract is already initialized");
            _initialized = version;
            return true;
        }
    }
}

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

pragma solidity ^0.8.0;

import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.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 PausableUpgradeable is Initializable, ContextUpgradeable {
    /**
     * @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.
     */
    function __Pausable_init() internal onlyInitializing {
        __Pausable_init_unchained();
    }

    function __Pausable_init_unchained() internal onlyInitializing {
        _paused = false;
    }

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

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

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        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());
    }

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

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

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

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

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

    uint256 private _status;

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

    function __ReentrancyGuard_init_unchained() internal onlyInitializing {
        _status = _NOT_ENTERED;
    }

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

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

File 6 of 21 : IERC20Upgradeable.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 IERC20Upgradeable {
    /**
     * @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 : SafeERC20Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20Upgradeable.sol";
import "../../../utils/AddressUpgradeable.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 SafeERC20Upgradeable {
    using AddressUpgradeable for address;

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

    function safeTransferFrom(
        IERC20Upgradeable 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(
        IERC20Upgradeable 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(
        IERC20Upgradeable 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(
        IERC20Upgradeable 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));
        }
    }

    /**
     * @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(IERC20Upgradeable 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 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)

pragma solidity ^0.8.1;

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

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

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

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

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

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

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

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

File 10 of 21 : SafeMathUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (utils/math/SafeMath.sol)

pragma solidity ^0.8.0;

// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.

/**
 * @dev Wrappers over Solidity's arithmetic operations.
 *
 * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
 * now has built in overflow checking.
 */
library SafeMathUpgradeable {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
            // benefit is lost if 'b' is also tested.
            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
            if (a == 0) return (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a % b);
        }
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        return a + b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        return a * b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator.
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b <= a, errorMessage);
            return a - b;
        }
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a / b;
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a % b;
        }
    }
}

File 11 of 21 : RangoCBridgeModels.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.13;

library RangoCBridgeModels {
    struct RangoCBridgeInterChainMessage {
        uint64 dstChainId;
        bool bridgeNativeOut;
        address dexAddress;
        address fromToken;
        address toToken;
        uint amountOutMin;
        address[] path;
        uint deadline;
        bool nativeOut;
        address originalSender;
        address recipient;

        // Extra message
        bytes dAppMessage;
        address dAppSourceContract;
        address dAppDestContract;
    }
}

File 12 of 21 : RangoMultichainModels.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.13;

library RangoMultichainModels {
    enum MultichainBridgeType { OUT, OUT_UNDERLYING, OUT_NATIVE }
}

File 13 of 21 : BaseProxyContract.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.13;

import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/math/SafeMathUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import "../../interfaces/IWETH.sol";
import "../../interfaces/IThorchainRouter.sol";

/// @title The base contract that RangoV1 and all its parents inherit to support refund, on-chain swap, and DEX whitelisting
/// @author Uchiha Sasuke
/// @notice It contains storage for whitelisted contracts, refund ERC20 and native tokens and on-chain swap
contract BaseProxyContract is PausableUpgradeable, OwnableUpgradeable, ReentrancyGuardUpgradeable {
    address payable constant NULL_ADDRESS = payable(0x0000000000000000000000000000000000000000);

    /// @notice The maximum possible percent of fee that Rango will receive from user times 10,000, so 300 = 3%
    /// @dev The real fee is calculated by smart routing off-chain, this field only limits the value to prevent mis-calculations
    uint constant MAX_FEE_PERCENT_x_10000 = 300;

    /// @notice The maximum possible percent of fee that third-party dApp will receive from user times 10,000, so 300 = 3%
    /// @dev The real fee is calculated by smart routing off-chain, this field only limits the value to prevent mis-calculations
    uint constant MAX_AFFILIATE_PERCENT_x_10000 = 300;

    using SafeMathUpgradeable for uint;

    /// @dev keccak256("exchange.rango.baseproxycontract")
    bytes32 internal constant BASE_PROXY_CONTRACT_NAMESPACE = hex"c23df90b6466cfd0cbf4f6a578f167d2f60ed56371b4746a3c5973c8543f4fd9";

    struct BaseProxyStorage {
        address payable feeContractAddress;
        address nativeWrappedAddress;
        mapping (address => bool) whitelistContracts;
    }

    /// @notice Rango received a fee reward
    /// @param token The address of received token, ZERO address for native
    /// @param wallet The address of receiver wallet
    /// @param amount The amount received as fee
    event FeeReward(address token, address wallet, uint amount);

    /// @notice Some money is sent to dApp wallet as affiliate reward
    /// @param token The address of received token, ZERO address for native
    /// @param wallet The address of receiver wallet
    /// @param amount The amount received as fee
    event AffiliateReward(address token, address wallet, uint amount);

    /// @notice A call to another dex or contract done and here is the result
    /// @param target The address of dex or contract that is called
    /// @param success A boolean indicating that the call was success or not
    /// @param returnData The response of function call
    event CallResult(address target, bool success, bytes returnData);

    /// @notice Output amount of a dex calls is logged
    /// @param _token The address of output token, ZERO address for native
    /// @param amount The amount of output
    event DexOutput(address _token, uint amount);

    /// @notice The output money (ERC20/Native) is sent to a wallet
    /// @param _token The token that is sent to a wallet, ZERO address for native
    /// @param _amount The sent amount
    /// @param _receiver The receiver wallet address
    /// @param _nativeOut means the output was native token
    /// @param _withdraw If true, indicates that we swapped WETH to ETH before sending the money and _nativeOut is also true
    event SendToken(address _token, uint256 _amount, address _receiver, bool _nativeOut, bool _withdraw);

    /// @notice Notifies that a new contract is whitelisted
    /// @param _factory The address of the contract
    event ContractWhitelisted(address _factory);

    /// @notice Notifies that a new contract is blacklisted
    /// @param _factory The address of the contract
    event ContractBlacklisted(address _factory);

    /// @notice Notifies that Rango's fee receiver address updated
    /// @param _oldAddress The previous fee wallet address
    /// @param _newAddress The new fee wallet address
    event FeeContractAddressUpdated(address _oldAddress, address _newAddress);

    /// @notice Notifies that admin manually refunded some money
    /// @param _token The address of refunded token, 0x000..00 address for native token
    /// @param _amount The amount that is refunded
    event Refunded(address _token, uint _amount);

    /// @notice The requested call data which is computed off-chain and passed to the contract
    /// @param target The dex contract address that should be called
    /// @param callData The required data field that should be give to the dex contract to perform swap
    struct Call { address payable target; bytes callData; }

    /// @notice General swap request which is given to us in all relevant functions
    /// @param fromToken The source token that is going to be swapped (in case of simple swap or swap + bridge) or the briding token (in case of solo bridge)
    /// @param toToken The output token of swapping. This is the output of DEX step and is also input of bridging step
    /// @param amountIn The amount of input token to be swapped
    /// @param feeIn The amount of fee charged by Rango
    /// @param affiliateIn The amount of fee charged by affiliator dApp
    /// @param affiliatorAddress The wallet address that the affiliator fee should be sent to
    struct SwapRequest {
        address fromToken;
        address toToken;
        uint amountIn;
        uint feeIn;
        uint affiliateIn;
        address payable affiliatorAddress;
    }

    /// @notice Adds a contract to the whitelisted DEXes that can be called
    /// @param _factory The address of the DEX
    function addWhitelist(address _factory) external onlyOwner {
        BaseProxyStorage storage baseProxyStorage = getBaseProxyContractStorage();
        baseProxyStorage.whitelistContracts[_factory] = true;

        emit ContractWhitelisted(_factory);
    }

    /// @notice Removes a contract from the whitelisted DEXes that can be called
    /// @param _factory The address of the DEX
    function removeWhitelist(address _factory) external onlyOwner {
        BaseProxyStorage storage baseProxyStorage = getBaseProxyContractStorage();
        require(baseProxyStorage.whitelistContracts[_factory], 'Factory not found');
        delete baseProxyStorage.whitelistContracts[_factory];

        emit ContractBlacklisted(_factory);
    }

    /// @notice Sets the wallet that receives Rango's fees from now on
    /// @param _address The receiver wallet address
    function updateFeeContractAddress(address payable _address) external onlyOwner {
        BaseProxyStorage storage baseProxyStorage = getBaseProxyContractStorage();

        address oldAddress = baseProxyStorage.feeContractAddress;
        baseProxyStorage.feeContractAddress = _address;

        emit FeeContractAddressUpdated(oldAddress, _address);
    }

    /// @notice Transfers an ERC20 token from this contract to msg.sender
    /// @dev This endpoint is to return money to a user if we didn't handle failure correctly and the money is still in the contract
    /// @dev Currently the money goes to admin and they should manually transfer it to a wallet later
    /// @param _tokenAddress The address of ERC20 token to be transferred
    /// @param _amount The amount of money that should be transfered
    function refund(address _tokenAddress, uint256 _amount) external onlyOwner {
        IERC20Upgradeable ercToken = IERC20Upgradeable(_tokenAddress);
        uint balance = ercToken.balanceOf(address(this));
        require(balance >= _amount, 'Insufficient balance');

        SafeERC20Upgradeable.safeTransfer(ercToken, msg.sender, _amount);

        emit Refunded(_tokenAddress, _amount);
    }

    /// @notice Transfers the native token from this contract to msg.sender
    /// @dev This endpoint is to return money to a user if we didn't handle failure correctly and the money is still in the contract
    /// @dev Currently the money goes to admin and they should manually transfer it to a wallet later
    /// @param _amount The amount of native token that should be transfered
    function refundNative(uint256 _amount) external onlyOwner {
        uint balance = address(this).balance;
        require(balance >= _amount, 'Insufficient balance');

        _sendToken(NULL_ADDRESS, _amount, msg.sender, true, false);

        emit Refunded(NULL_ADDRESS, _amount);
    }

    /// @notice Does a simple on-chain swap
    /// @param request The general swap request containing from/to token and fee/affiliate rewards
    /// @param calls The list of DEX calls
    /// @param nativeOut indicates that the output of swaps must be a native token
    /// @return The byte array result of all DEX calls
    function onChainSwaps(
        SwapRequest memory request,
        Call[] calldata calls,
        bool nativeOut
    ) external payable whenNotPaused nonReentrant returns (bytes[] memory) {
        (bytes[] memory result, uint outputAmount) = onChainSwapsInternal(request, calls);

        _sendToken(request.toToken, outputAmount, msg.sender, nativeOut, false);
        return result;
    }

    /// @notice Internal function to compute output amount of DEXes
    /// @param request The general swap request containing from/to token and fee/affiliate rewards
    /// @param calls The list of DEX calls
    /// @return The response of all DEX calls and the output amount of the whole process
    function onChainSwapsInternal(SwapRequest memory request, Call[] calldata calls) internal returns (bytes[] memory, uint) {

        uint toBalanceBefore = getBalanceOf(request.toToken);
        uint fromBalanceBefore = getBalanceOf(request.fromToken);

        bytes[] memory result = callSwapsAndFees(request, calls);

        uint toBalanceAfter = getBalanceOf(request.toToken);
        uint fromBalanceAfter = getBalanceOf(request.fromToken);

        if (request.fromToken != NULL_ADDRESS)
            require(fromBalanceAfter >= fromBalanceBefore, 'Source token balance on contract must not decrease after swap');
        else
            require(fromBalanceAfter >= fromBalanceBefore - msg.value, 'Source token balance on contract must not decrease after swap');

        uint secondaryBalance;
        if (calls.length > 0) {
            require(toBalanceAfter - toBalanceBefore > 0, "No balance found after swaps");

            secondaryBalance = toBalanceAfter - toBalanceBefore;
            emit DexOutput(request.toToken, secondaryBalance);
        } else {
            secondaryBalance = toBalanceAfter > toBalanceBefore ? toBalanceAfter - toBalanceBefore : request.amountIn;
        }

        return (result, secondaryBalance);
    }

    /// @notice Private function to handle fetching money from wallet to contract, reduce fee/affiliate, perform DEX calls
    /// @param request The general swap request containing from/to token and fee/affiliate rewards
    /// @param calls The list of DEX calls
    /// @dev It checks the whitelisting of all DEX addresses + having enough msg.value as input
    /// @dev It checks the max threshold for fee/affiliate
    /// @return The bytes of all DEX calls response
    function callSwapsAndFees(SwapRequest memory request, Call[] calldata calls) private returns (bytes[] memory) {
        bool isSourceNative = request.fromToken == NULL_ADDRESS;
        BaseProxyStorage storage baseProxyStorage = getBaseProxyContractStorage();
        
        // validate
        require(baseProxyStorage.feeContractAddress != NULL_ADDRESS, "Fee contract address not set");

        for(uint256 i = 0; i < calls.length; i++) {
            require(baseProxyStorage.whitelistContracts[calls[i].target], "Contact not whitelisted");
        }

        // Get all the money from user
        uint totalInputAmount = request.feeIn + request.affiliateIn + request.amountIn;
        if (isSourceNative)
            require(msg.value >= totalInputAmount, "Not enough ETH provided to contract");

        // Check max fee/affiliate is respected
        uint maxFee = totalInputAmount * MAX_FEE_PERCENT_x_10000 / 10000;
        uint maxAffiliate = totalInputAmount * MAX_AFFILIATE_PERCENT_x_10000 / 10000;
        require(request.feeIn <= maxFee, 'Requested fee exceeded max threshold');
        require(request.affiliateIn <= maxAffiliate, 'Requested affiliate reward exceeded max threshold');

        // Transfer from wallet to contract
        if (!isSourceNative) {
            for(uint256 i = 0; i < calls.length; i++) {
                approve(request.fromToken, calls[i].target, totalInputAmount);
            }

            uint balanceBefore = getBalanceOf(request.fromToken);
            SafeERC20Upgradeable.safeTransferFrom(IERC20Upgradeable(request.fromToken), msg.sender, address(this), totalInputAmount);
            uint balanceAfter = getBalanceOf(request.fromToken);

            if(balanceAfter > balanceBefore && balanceAfter - balanceBefore < totalInputAmount)
                revert("Deflationary tokens are not supported by Rango contract");
        }

        // Get Platform fee
        if (request.feeIn > 0) {
            _sendToken(request.fromToken, request.feeIn, baseProxyStorage.feeContractAddress, isSourceNative, false);
            emit FeeReward(request.fromToken, baseProxyStorage.feeContractAddress, request.feeIn);
        }

        // Get affiliator fee
        if (request.affiliateIn > 0) {
            require(request.affiliatorAddress != NULL_ADDRESS, "Invalid affiliatorAddress");
            _sendToken(request.fromToken, request.affiliateIn, request.affiliatorAddress, isSourceNative, false);
            emit AffiliateReward(request.fromToken, request.affiliatorAddress, request.affiliateIn);
        }

        bytes[] memory returnData = new bytes[](calls.length);
        for (uint256 i = 0; i < calls.length; i++) {
            (bool success, bytes memory ret) = isSourceNative
                ? calls[i].target.call{value: request.amountIn}(calls[i].callData)
                : calls[i].target.call(calls[i].callData);

            emit CallResult(calls[i].target, success, ret);
            if (!success)
                revert(_getRevertMsg(ret));
            returnData[i] = ret;
        }

        return returnData;
    }

    /// @notice Approves an ERC20 token to a contract to transfer from the current contract
    /// @param token The address of an ERC20 token
    /// @param to The contract address that should be approved
    /// @param value The amount that should be approved
    function approve(address token, address to, uint value) internal {
        SafeERC20Upgradeable.safeApprove(IERC20Upgradeable(token), to, 0);
        SafeERC20Upgradeable.safeIncreaseAllowance(IERC20Upgradeable(token), to, value);
    }

    /// @notice An internal function to send a token from the current contract to another contract or wallet
    /// @dev This function also can convert WETH to ETH before sending if _withdraw flat is set to true
    /// @dev To send native token _nativeOut param should be set to true, otherwise we assume it's an ERC20 transfer
    /// @param _token The token that is going to be sent to a wallet, ZERO address for native
    /// @param _amount The sent amount
    /// @param _receiver The receiver wallet address or contract
    /// @param _nativeOut means the output is native token
    /// @param _withdraw If true, indicates that we should swap WETH to ETH before sending the money and _nativeOut must also be true
    function _sendToken(
        address _token,
        uint256 _amount,
        address _receiver,
        bool _nativeOut,
        bool _withdraw
    ) internal {
        BaseProxyStorage storage baseProxyStorage = getBaseProxyContractStorage();
        emit SendToken(_token, _amount, _receiver, _nativeOut, _withdraw);

        if (_nativeOut) {
            if (_withdraw) {
                require(_token == baseProxyStorage.nativeWrappedAddress, "token mismatch");
                IWETH(baseProxyStorage.nativeWrappedAddress).withdraw(_amount);
            } else {
                require(_token == NULL_ADDRESS, 'Token address must be 0x00...0 for native out');
            }
            _sendNative(_receiver, _amount);
        } else {
            SafeERC20Upgradeable.safeTransfer(IERC20Upgradeable(_token), _receiver, _amount);
        }
    }

    /// @notice An internal function to send native token to a contract or wallet
    /// @param _receiver The address that will receive the native token
    /// @param _amount The amount of the native token that should be sent
    function _sendNative(address _receiver, uint _amount) internal {
        (bool sent, ) = _receiver.call{value: _amount}("");
        require(sent, "failed to send native");
    }


    /// @notice A utility function to fetch storage from a predefined random slot using assembly
    /// @return s The storage object
    function getBaseProxyContractStorage() internal pure returns (BaseProxyStorage storage s) {
        bytes32 namespace = BASE_PROXY_CONTRACT_NAMESPACE;
        // solhint-disable-next-line no-inline-assembly
        assembly {
            s.slot := namespace
        }
    }

    /// @notice To extract revert message from a DEX/contract call to represent to the end-user in the blockchain
    /// @param _returnData The resulting bytes of a failed call to a DEX or contract
    /// @return A string that describes what was the error
    function _getRevertMsg(bytes memory _returnData) internal pure returns (string memory) {
        // If the _res length is less than 68, then the transaction failed silently (without a revert message)
        if (_returnData.length < 68) return 'Transaction reverted silently';

        assembly {
            // Slice the sighash.
            _returnData := add(_returnData, 0x04)
        }
        return abi.decode(_returnData, (string)); // All that remains is the revert string
    }

    function getBalanceOf(address token) internal view returns (uint) {
        IERC20Upgradeable ercToken = IERC20Upgradeable(token);
        return token == NULL_ADDRESS ? address(this).balance : ercToken.balanceOf(address(this));
    }
}

File 14 of 21 : IRangoCBridge.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.13;

import "../../../bridges/cbridge/RangoCBridgeModels.sol";

/// @title An interface to RangoCBridge.sol contract to improve type hinting
/// @author Uchiha Sasuke
interface IRangoCBridge {

    /// @notice Executes a cBridgeIM call
    /// @param _fromToken The address of source token to bridge
    /// @param _inputAmount The amount of input to be bridged
    /// @param _receiverContract Our RangoCbridge.sol contract in the destination chain that will handle the destination logic
    /// @param _dstChainId The network id of destination chain, ex: 10 for optimism
    /// @param _nonce A nonce mechanism used by cBridge that is generated off-chain, it normally is the time.now()
    /// @param _maxSlippage The maximum tolerable slippage by user on cBridge side (The bridge is not 1-1 and may have slippage in big swaps)
    /// @param _sgnFee The fee amount (in native token) that cBridge IM charges for delivering the message
    /// @param imMessage Our custom interchain message that contains all the required info for the RangoCBridge.sol on the destination
    function cBridgeIM(
        address _fromToken,
        uint _inputAmount,
        address _receiverContract, // The receiver app contract address, not recipient
        uint64 _dstChainId,
        uint64 _nonce,
        uint32 _maxSlippage,
        uint _sgnFee,

        RangoCBridgeModels.RangoCBridgeInterChainMessage memory imMessage
    ) external payable;

    /// @notice Executes a bridging via cBridge
    /// @param _receiver The receiver address in the destination chain
    /// @param _token The token address to be bridged
    /// @param _amount The amount of the token to be bridged
    /// @param _dstChainId The network id of destination chain, ex: 10 for optimism
    /// @param _nonce A nonce mechanism used by cBridge that is generated off-chain, it normally is the time.now()
    /// @param _maxSlippage The maximum tolerable slippage by user on cBridge side (The bridge is not 1-1 and may have slippage in big swaps)
    function send(
        address _receiver,
        address _token,
        uint256 _amount,
        uint64 _dstChainId,
        uint64 _nonce,
        uint32 _maxSlippage
    ) external;

}

File 15 of 21 : RangoCBridgeProxy.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.13;

import "../../../libs/BaseProxyContract.sol";
import "./IRangoCBridge.sol";

/// @title The functions that allow users to perform a cbridge call with or without some arbitrary DEX calls
/// @author Uchiha Sasuke
/// @notice It contains functions to call cbridge.send for simple transfers or Celer IM for cross-chain messaging
/// @dev This contract only handles the DEX part and calls RangoCBridge.sol functions via contact call to perform the bridiging step
contract RangoCBridgeProxy is BaseProxyContract {

    /// @dev keccak256("exchange.rango.cbridge.proxy")
    bytes32 internal constant RANGO_CBRIDGE_PROXY_NAMESPACE = hex"e9cf4febccbfad5ef15964f91cb6c48fe594747e386f28fc2b067ddf16f1ed5d";

    struct CBridgeProxyStorage {
        address rangoCBridgeAddress;
    }

    /// @notice Notifies that the RangoCBridge.sol contract address is updated
    /// @param _oldAddress The previous deployed address
    /// @param _newAddress The new deployed address
    event RangoCBridgeAddressUpdated(address _oldAddress, address _newAddress);

    /// @notice Updates the address of deployed RangoCBridge.sol contract
    /// @param _address The address
    function updateRangoCBridgeAddress(address _address) external onlyOwner {
        CBridgeProxyStorage storage cbridgeProxyStorage = getCBridgeProxyStorage();

        address oldAddress = cbridgeProxyStorage.rangoCBridgeAddress;
        cbridgeProxyStorage.rangoCBridgeAddress = _address;

        emit RangoCBridgeAddressUpdated(oldAddress, _address);
    }

    /// @notice Executes a DEX (arbitrary) call + a cBridge send function
    /// @param request The general swap request containing from/to token and fee/affiliate rewards
    /// @param calls The list of DEX calls, if this list is empty, it means that there is no DEX call and we are only bridging
    /// @param _receiver The receiver address in the destination chain
    /// @param _dstChainId The network id of destination chain, ex: 10 for optimism
    /// @param _nonce A nonce mechanism used by cBridge that is generated off-chain, it normally is the time.now()
    /// @param _maxSlippage The maximum tolerable slippage by user on cBridge side (The bridge is not 1-1 and may have slippage in big swaps)
    /// @dev The cbridge part is handled in the RangoCBridge.sol contract
    /// @dev If this function is success, user will automatically receive the fund in the destination in his/her wallet (_receiver)
    /// @dev If bridge is out of liquidity somehow after submiting this transaction and success, user must sign a refund transaction which is not currently present here, will be supported soon
    function cBridgeSend(
        SwapRequest memory request,
        Call[] calldata calls,

        // cbridge params
        address _receiver,
        uint64 _dstChainId,
        uint64 _nonce,
        uint32 _maxSlippage
    ) external payable whenNotPaused nonReentrant {
        CBridgeProxyStorage storage cbridgeProxyStorage = getCBridgeProxyStorage();
        require(cbridgeProxyStorage.rangoCBridgeAddress != NULL_ADDRESS, 'cBridge address in Rango contract not set');

        bool isNative = request.fromToken == NULL_ADDRESS;
        uint minimumRequiredValue = isNative ? request.feeIn + request.affiliateIn + request.amountIn : 0;
        require(msg.value >= minimumRequiredValue, 'Send more ETH to cover input amount');

        (, uint out) = onChainSwapsInternal(request, calls);
        approve(request.toToken, cbridgeProxyStorage.rangoCBridgeAddress, out);

        IRangoCBridge(cbridgeProxyStorage.rangoCBridgeAddress)
            .send(_receiver, request.toToken, out, _dstChainId, _nonce, _maxSlippage);
    }

    /// @notice Executes a DEX (arbitrary) call + a cBridge IM function
    /// @dev The cbridge part is handled in the RangoCBridge.sol contract
    /// @param request The general swap request containing from/to token and fee/affiliate rewards
    /// @param calls The list of DEX calls, if this list is empty, it means that there is no DEX call and we are only bridging
    /// @param _receiverContract Our RangoCbridge.sol contract in the destination chain that will handle the destination logic
    /// @param _dstChainId The network id of destination chain, ex: 10 for optimism
    /// @param _nonce A nonce mechanism used by cBridge that is generated off-chain, it normally is the time.now()
    /// @param _maxSlippage The maximum tolerable slippage by user on cBridge side (The bridge is not 1-1 and may have slippage in big swaps)
    /// @param _sgnFee The fee amount (in native token) that cBridge IM charges for delivering the message
    /// @param imMessage Our custom interchain message that contains all the required info for the RangoCBridge.sol on the destination
    /// @dev The msg.value should at least be _sgnFee + (input + fee + affiliate) if input is native token
    /**
     * @dev Here is the overall flow for a cross-chain dApp that integrates Rango + cBridgeIM:
     * Example case: RangoSea is an imaginary cross-chain OpenSea that users can lock their NFT on BSC to get 100 BNB
     * and convert it to FTM to buy another NFT there, all in one TX.
     * RangoSea contract = RS
     * Rango contract = R
     *
     * 1. RangoSea server asks Rango for a quote of 100 BSC.BNB to Fantom.FTM and embeds the message (imMessage.dAppMessage) that should be received by RS on destination
     * 2. User signs sellNFTandBuyCrosschain on RS
     * 3. RS executes their own logic and locks the NFT, gets 100 BNB and calls R with the hex from step 1 (which is cBridgeIM function call)
     * 4. R on source chain does the required swap/bridge
     * 5. R on destination receives the message via Celer network (by calling RangoCBridge.executeMessageWithTransfer on dest) and does other Rango internal stuff on destination to have the final FTM
     * 6. R on dest sends fund to RS on dest and calls their handler function for message handling and passes imMessage.dAppMessage to it
     * 7. RS on destination has the money and the message it needs to buy the NFT on destination and if it is still available it will be purchased
     *
     * Failure scenarios:
     * If cBridge does not have enough liquidity later:
     * 1. Celer network will call (RangoCBridge on source chain).executeMessageWithTransferRefund function
     * 2. RangoCbridge will refund money to the RS contract on source and ask it to handle refund to their own users
     *
     * If something on the destination fails:
     * 1. Celer network will call (RangoCBridge on dest chain).executeMessageWithTransferFallback function
     * 2. R on dest sends fund to RS on dest with refund reason, again RS should send it to your user if you like
     *
     * Hint: The dAppMessage part is arbitrary, if it's not set. The scenario is the same as above but without RS being in. In this case Rango will refund to the end-user.
     * Here is the celer IM docs: https://im-docs.celer.network/
     */
    function cBridgeIM(
        SwapRequest memory request,
        Call[] calldata calls,

        address _receiverContract, // The receiver app contract address, not recipient
        uint64 _dstChainId,
        uint64 _nonce,
        uint32 _maxSlippage,
        uint _sgnFee,

        RangoCBridgeModels.RangoCBridgeInterChainMessage memory imMessage
    ) external payable whenNotPaused nonReentrant {
        CBridgeProxyStorage storage cbridgeProxyStorage = getCBridgeProxyStorage();
        require(cbridgeProxyStorage.rangoCBridgeAddress != NULL_ADDRESS, 'cBridge address in Rango contract not set');

        bool isNative = request.fromToken == NULL_ADDRESS;
        uint minimumRequiredValue = (isNative ? request.feeIn + request.affiliateIn + request.amountIn : 0) + _sgnFee;
        require(msg.value >= minimumRequiredValue, 'Send more ETH to cover sgnFee + input amount');

        (, uint out) = onChainSwapsInternal(request, calls);
        approve(request.toToken, cbridgeProxyStorage.rangoCBridgeAddress, out);

        IRangoCBridge(cbridgeProxyStorage.rangoCBridgeAddress).cBridgeIM{value: _sgnFee}(
            request.toToken,
            out,
            _receiverContract,
            _dstChainId,
            _nonce,
            _maxSlippage,
            _sgnFee,
            imMessage
        );
    }


    /// @notice A utility function to fetch storage from a predefined random slot using assembly
    /// @return s The storage object
    function getCBridgeProxyStorage() internal pure returns (CBridgeProxyStorage storage s) {
        bytes32 namespace = RANGO_CBRIDGE_PROXY_NAMESPACE;
        // solhint-disable-next-line no-inline-assembly
        assembly {
            s.slot := namespace
        }
    }
}

File 16 of 21 : IRangoMultichain.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.13;

import "../../../bridges/multichain/RangoMultichainModels.sol";

/// @title An interface to RangoMultichain.sol contract to improve type hinting
/// @author Uchiha Sasuke
interface IRangoMultichain {

    /// @notice Executes a MultichainOrg bridge call
    /// @param _actionType The type of bridge action which indicates the name of the function of MultichainOrg contract to be called
    /// @param _fromToken The address of bridging token
    /// @param _underlyingToken For _actionType = OUT_UNDERLYING, it's the address of the underlying token
    /// @param _inputAmount The amount of the token to be bridged
    /// @param multichainRouter Address of MultichainOrg contract on the current chain
    /// @param _receiverAddress The address of end-user on the destination
    /// @param _receiverChainID The network id of destination chain
    function multichainBridge(
        RangoMultichainModels.MultichainBridgeType _actionType,
        address _fromToken,
        address _underlyingToken,
        uint _inputAmount,
        address multichainRouter,
        address _receiverAddress,
        uint _receiverChainID
    ) external payable;

}

File 17 of 21 : RangoMultichainProxy.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.13;

import "../../../libs/BaseProxyContract.sol";
import "./IRangoMultichain.sol";

/// @title The functions that allow users to perform a MultichainOrg call with or without some arbitrary DEX calls
/// @author Uchiha Sasuke
/// @notice It contains functions to call MultichainOrg bridge
/// @dev This contract only handles the DEX part and calls RangoMultichain.sol functions via contact call to perform the bridiging step
contract RangoMultichainProxy is BaseProxyContract {

    /// @dev keccak256("exchange.rango.multichain.proxy")
    bytes32 internal constant RANGO_MULTICHAIN_PROXY_NAMESPACE = hex"ed7d91da7fb046892c2413e11ecc409c17b784b916ff0fd3fa2d512c567da864";

    struct MultichainProxyStorage {
        address rangoMultichainAddress;
    }

    /// @notice Notifies that the RangoMultichain.sol contract address is updated
    /// @param _oldAddress The previous deployed address
    /// @param _newAddress The new deployed address
    event RangoMultichainAddressUpdated(address _oldAddress, address _newAddress);

    /// @notice The request object for MultichainOrg bridge call
    /// @param _actionType The type of bridge action which indicates the name of the function of MultichainOrg contract to be called
    /// @param _underlyingToken For _actionType = OUT_UNDERLYING, it's the address of the underlying token
    /// @param _multichainRouter Address of MultichainOrg contract on the current chain
    /// @param _receiverAddress The address of end-user on the destination
    /// @param _receiverChainID The network id of destination chain
    struct MultichainBridgeRequest {
        RangoMultichainModels.MultichainBridgeType _actionType;
        address _underlyingToken;
        address _multichainRouter;
        address _receiverAddress;
        uint _receiverChainID;
    }

    /// @notice Updates the address of deployed RangoMultichain.sol contract
    /// @param _address The address
    function updateRangoMultichainAddress(address _address) external onlyOwner {
        MultichainProxyStorage storage multichainProxyStorage = getMultichainProxyStorage();

        address oldAddress = multichainProxyStorage.rangoMultichainAddress;
        multichainProxyStorage.rangoMultichainAddress = _address;

        emit RangoMultichainAddressUpdated(oldAddress, _address);
    }

    /// @notice Executes a DEX (arbitrary) call + a MultichainOrg bridge call
    /// @dev The cbridge part is handled in the RangoMultichain.sol contract
    /// @param request The general swap request containing from/to token and fee/affiliate rewards
    /// @param calls The list of DEX calls, if this list is empty, it means that there is no DEX call and we are only bridging
    /// @param bridgeRequest required data for the bridging step, including the destination chain and recipient wallet address
    function multichainBridge(
        SwapRequest memory request,
        Call[] calldata calls,
        MultichainBridgeRequest memory bridgeRequest
    ) external payable whenNotPaused nonReentrant {
        MultichainProxyStorage storage multichainProxyStorage = getMultichainProxyStorage();
        require(multichainProxyStorage.rangoMultichainAddress != NULL_ADDRESS, 'Multichain address in Rango contract not set');

        bool isNative = request.fromToken == NULL_ADDRESS;
        uint minimumRequiredValue = isNative ? request.feeIn + request.affiliateIn + request.amountIn : 0;
        require(msg.value >= minimumRequiredValue, 'Send more ETH to cover input amount + fee');

        (, uint out) = onChainSwapsInternal(request, calls);
        if (request.toToken != NULL_ADDRESS)
            approve(request.toToken, multichainProxyStorage.rangoMultichainAddress, out);

        uint value = request.toToken == NULL_ADDRESS ? (out > 0 ? out : request.amountIn) : 0;

        IRangoMultichain(multichainProxyStorage.rangoMultichainAddress).multichainBridge{value: value}(
            bridgeRequest._actionType,
            request.toToken,
            bridgeRequest._underlyingToken,
            out,
            bridgeRequest._multichainRouter,
            bridgeRequest._receiverAddress,
            bridgeRequest._receiverChainID
        );
    }

    /// @notice A utility function to fetch storage from a predefined random slot using assembly
    /// @return s The storage object
    function getMultichainProxyStorage() internal pure returns (MultichainProxyStorage storage s) {
        bytes32 namespace = RANGO_MULTICHAIN_PROXY_NAMESPACE;
        // solhint-disable-next-line no-inline-assembly
        assembly {
            s.slot := namespace
        }
    }
}

File 18 of 21 : IRangoThorchain.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.13;

/// @title Interface to interact with RangoThorchain contract.
/// @author Thinking Particle
interface IRangoThorchain {
    /// @notice Defines parameters used for swapIn functionality on thorchain router.
    /// @param token The token contract address (if token is native, should be 0x0000000000000000000000000000000000000000)
    /// @param amount The amount of token to be swapped. It should be positive and if token is native, msg.value should be bigger than amount.
    /// @param tcRouter The router contract address of Thorchain. This cannot be hardcoded because Thorchain can upgrade its router and the address might change.
    /// @param tcVault The vault address of Thorchain. This cannot be hardcoded because Thorchain rotates vaults.
    /// @param thorchainMemo The transaction memo used by Thorchain which contains the thorchain swap data. More info: https://dev.thorchain.org/thorchain-dev/memos
    /// @param expiration The expiration block number. If the tx is included after this block, it will be reverted.
    function swapInToThorchain(
        address token,
        uint amount,
        address tcRouter,
        address tcVault,
        string calldata thorchainMemo,
        uint expiration
    ) external payable;

}

File 19 of 21 : RangoThorchainProxy.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.13;

import "../../../libs/BaseProxyContract.sol";
import "./IRangoThorchain.sol";

/// @title thorchain proxy logic
/// @author Thinking Particle
/// @dev This contract stores the address of the RangoThorchain contract and implements the logic for interacting with it. This contract can swap the given input token to another token and then pass the output to the RangoThorchain contract.
/// @notice This contract can swap the token to another token before passing it to thorchain for another swap.
contract RangoThorchainProxy is BaseProxyContract {

    // @dev keccak256("exchange.rango.thorchain.proxy")
    bytes32 internal constant RANGO_THORCHAIN_PROXY_NAMESPACE = hex"2d408556142e9c30601bb067c0631f1a23ffac1d1598afa3da595c26103e4966";

    /// @notice stores the address of RangoThorchain contract
    struct ThorchainProxyStorage {
        address rangoThorchainAddress;
    }

    /// @notice Notifies that the RangoThorchain.sol contract address is updated
    /// @param _oldAddress The previous deployed address
    /// @param _newAddress The new deployed address
    event RangoThorchainAddressUpdated(address _oldAddress, address _newAddress);

    /// @notice updates RangoThorchain contract address, only callable by the owner.
    function updateRangoThorchainAddress(address _address) external onlyOwner {
        ThorchainProxyStorage storage thorchainProxyStorage = getThorchainProxyStorage();

        address oldAddress = thorchainProxyStorage.rangoThorchainAddress;
        thorchainProxyStorage.rangoThorchainAddress = _address;

        emit RangoThorchainAddressUpdated(oldAddress, _address);
    }

    /// @notice Swap tokens if necessary, then pass it to RangoThorchain
    /// @dev Swap tokens if necessary, then pass it to RangoThorchain. If no swap is required (calls.length==0) the provided token is passed to RangoThorchain without change.
    /// @param request The swap information used to check input and output token addresses and balances, as well as the fees if any. Together with calls param, determines the swap logic before passing to Thorchain.
    /// @param calls The contract call data that is used to swap (can be empty if no swap is needed). Together with request param, determines the swap logic before passing to Thorchain.
    /// @param tcRouter The router contract address of Thorchain. This cannot be hardcoded because Thorchain can upgrade its router and the address might change.
    /// @param tcVault The vault address of Thorchain. This cannot be hardcoded because Thorchain rotates vaults.
    /// @param thorchainMemo The transaction memo used by Thorchain which contains the thorchain swap data. More info: https://dev.thorchain.org/thorchain-dev/memos
    /// @param expiration The expiration block number. If the tx is included after this block, it will be reverted.
    function swapInToThorchain(
        SwapRequest memory request,
        Call[] calldata calls,

        address tcRouter,
        address tcVault,
        string calldata thorchainMemo,
        uint expiration
    ) external payable whenNotPaused nonReentrant {
        ThorchainProxyStorage storage thorchainProxyStorage = getThorchainProxyStorage();
        require(thorchainProxyStorage.rangoThorchainAddress != NULL_ADDRESS, 'Thorchain wrapper address in Rango contract not set');

        (, uint out) = onChainSwapsInternal(request, calls);
        uint value = 0;
        if (request.toToken != NULL_ADDRESS) {
            approve(request.toToken, thorchainProxyStorage.rangoThorchainAddress, out);
        } else {
            value = out;
        }

        IRangoThorchain(thorchainProxyStorage.rangoThorchainAddress).swapInToThorchain{value : value}(
            request.toToken,
            out,
            tcRouter,
            tcVault,
            thorchainMemo,
            expiration
        );
    }

    /// @notice reads the storage using namespace
    /// @return s the stored value for ThorchainProxyStorage using the namespace
    function getThorchainProxyStorage() internal pure returns (ThorchainProxyStorage storage s) {
        bytes32 namespace = RANGO_THORCHAIN_PROXY_NAMESPACE;
        // solhint-disable-next-line no-inline-assembly
        assembly {
            s.slot := namespace
        }
    }
}

File 20 of 21 : IThorchainRouter.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;

/// @dev based on thorchain router https://gitlab.com/thorchain/ethereum/eth-router/-/blob/29b59c2d6c6fc7a65d6bbc0f80d90694ac4122f8/contracts/THORChain_Aggregator.sol#L12
interface IThorchainRouter {
    /// @param vault The vault address of Thorchain. This cannot be hardcoded because Thorchain rotates vaults.
    /// @param asset The token contract address (if token is native, should be 0x0000000000000000000000000000000000000000)
    /// @param amount The amount of token to be swapped. It should be positive and if token is native, msg.value should be bigger than amount.
    /// @param memo The transaction memo used by Thorchain which contains the thorchain swap data. More info: https://dev.thorchain.org/thorchain-dev/memos
    /// @param expiration The expiration block number. If the tx is included after this block, it will be reverted.
    function depositWithExpiry(
        address payable vault,
        address asset,
        uint amount,
        string calldata memo,
        uint expiration
    ) external payable;
}

File 21 of 21 : IWETH.sol
// SPDX-License-Identifier: GPL-3.0-only

pragma solidity 0.8.13;

interface IWETH {
    function deposit() external payable;

    function withdraw(uint256) external;
}

Settings
{
  "evmVersion": "london",
  "libraries": {},
  "metadata": {
    "bytecodeHash": "ipfs",
    "useLiteralContent": true
  },
  "optimizer": {
    "enabled": true,
    "runs": 999999
  },
  "remappings": [],
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"address","name":"wallet","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"AffiliateReward","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"target","type":"address"},{"indexed":false,"internalType":"bool","name":"success","type":"bool"},{"indexed":false,"internalType":"bytes","name":"returnData","type":"bytes"}],"name":"CallResult","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_factory","type":"address"}],"name":"ContractBlacklisted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_factory","type":"address"}],"name":"ContractWhitelisted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"DexOutput","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_oldAddress","type":"address"},{"indexed":false,"internalType":"address","name":"_newAddress","type":"address"}],"name":"FeeContractAddressUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"address","name":"wallet","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"FeeReward","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","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":"_oldAddress","type":"address"},{"indexed":false,"internalType":"address","name":"_newAddress","type":"address"}],"name":"RangoCBridgeAddressUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_oldAddress","type":"address"},{"indexed":false,"internalType":"address","name":"_newAddress","type":"address"}],"name":"RangoMultichainAddressUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_oldAddress","type":"address"},{"indexed":false,"internalType":"address","name":"_newAddress","type":"address"}],"name":"RangoThorchainAddressUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_token","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"Refunded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_token","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"},{"indexed":false,"internalType":"address","name":"_receiver","type":"address"},{"indexed":false,"internalType":"bool","name":"_nativeOut","type":"bool"},{"indexed":false,"internalType":"bool","name":"_withdraw","type":"bool"}],"name":"SendToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[{"internalType":"address","name":"_factory","type":"address"}],"name":"addWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"fromToken","type":"address"},{"internalType":"address","name":"toToken","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"feeIn","type":"uint256"},{"internalType":"uint256","name":"affiliateIn","type":"uint256"},{"internalType":"address payable","name":"affiliatorAddress","type":"address"}],"internalType":"struct BaseProxyContract.SwapRequest","name":"request","type":"tuple"},{"components":[{"internalType":"address payable","name":"target","type":"address"},{"internalType":"bytes","name":"callData","type":"bytes"}],"internalType":"struct BaseProxyContract.Call[]","name":"calls","type":"tuple[]"},{"internalType":"address","name":"_receiverContract","type":"address"},{"internalType":"uint64","name":"_dstChainId","type":"uint64"},{"internalType":"uint64","name":"_nonce","type":"uint64"},{"internalType":"uint32","name":"_maxSlippage","type":"uint32"},{"internalType":"uint256","name":"_sgnFee","type":"uint256"},{"components":[{"internalType":"uint64","name":"dstChainId","type":"uint64"},{"internalType":"bool","name":"bridgeNativeOut","type":"bool"},{"internalType":"address","name":"dexAddress","type":"address"},{"internalType":"address","name":"fromToken","type":"address"},{"internalType":"address","name":"toToken","type":"address"},{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"bool","name":"nativeOut","type":"bool"},{"internalType":"address","name":"originalSender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"bytes","name":"dAppMessage","type":"bytes"},{"internalType":"address","name":"dAppSourceContract","type":"address"},{"internalType":"address","name":"dAppDestContract","type":"address"}],"internalType":"struct RangoCBridgeModels.RangoCBridgeInterChainMessage","name":"imMessage","type":"tuple"}],"name":"cBridgeIM","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"fromToken","type":"address"},{"internalType":"address","name":"toToken","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"feeIn","type":"uint256"},{"internalType":"uint256","name":"affiliateIn","type":"uint256"},{"internalType":"address payable","name":"affiliatorAddress","type":"address"}],"internalType":"struct BaseProxyContract.SwapRequest","name":"request","type":"tuple"},{"components":[{"internalType":"address payable","name":"target","type":"address"},{"internalType":"bytes","name":"callData","type":"bytes"}],"internalType":"struct BaseProxyContract.Call[]","name":"calls","type":"tuple[]"},{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"uint64","name":"_dstChainId","type":"uint64"},{"internalType":"uint64","name":"_nonce","type":"uint64"},{"internalType":"uint32","name":"_maxSlippage","type":"uint32"}],"name":"cBridgeSend","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"getValidRangoContracts","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_nativeWrappedAddress","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"fromToken","type":"address"},{"internalType":"address","name":"toToken","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"feeIn","type":"uint256"},{"internalType":"uint256","name":"affiliateIn","type":"uint256"},{"internalType":"address payable","name":"affiliatorAddress","type":"address"}],"internalType":"struct BaseProxyContract.SwapRequest","name":"request","type":"tuple"},{"components":[{"internalType":"address payable","name":"target","type":"address"},{"internalType":"bytes","name":"callData","type":"bytes"}],"internalType":"struct BaseProxyContract.Call[]","name":"calls","type":"tuple[]"},{"components":[{"internalType":"enum RangoMultichainModels.MultichainBridgeType","name":"_actionType","type":"uint8"},{"internalType":"address","name":"_underlyingToken","type":"address"},{"internalType":"address","name":"_multichainRouter","type":"address"},{"internalType":"address","name":"_receiverAddress","type":"address"},{"internalType":"uint256","name":"_receiverChainID","type":"uint256"}],"internalType":"struct RangoMultichainProxy.MultichainBridgeRequest","name":"bridgeRequest","type":"tuple"}],"name":"multichainBridge","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"fromToken","type":"address"},{"internalType":"address","name":"toToken","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"feeIn","type":"uint256"},{"internalType":"uint256","name":"affiliateIn","type":"uint256"},{"internalType":"address payable","name":"affiliatorAddress","type":"address"}],"internalType":"struct BaseProxyContract.SwapRequest","name":"request","type":"tuple"},{"components":[{"internalType":"address payable","name":"target","type":"address"},{"internalType":"bytes","name":"callData","type":"bytes"}],"internalType":"struct BaseProxyContract.Call[]","name":"calls","type":"tuple[]"},{"internalType":"bool","name":"nativeOut","type":"bool"}],"name":"onChainSwaps","outputs":[{"internalType":"bytes[]","name":"","type":"bytes[]"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAddress","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"refund","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"refundNative","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_factory","type":"address"}],"name":"removeWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"fromToken","type":"address"},{"internalType":"address","name":"toToken","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"feeIn","type":"uint256"},{"internalType":"uint256","name":"affiliateIn","type":"uint256"},{"internalType":"address payable","name":"affiliatorAddress","type":"address"}],"internalType":"struct BaseProxyContract.SwapRequest","name":"request","type":"tuple"},{"components":[{"internalType":"address payable","name":"target","type":"address"},{"internalType":"bytes","name":"callData","type":"bytes"}],"internalType":"struct BaseProxyContract.Call[]","name":"calls","type":"tuple[]"},{"internalType":"address","name":"tcRouter","type":"address"},{"internalType":"address","name":"tcVault","type":"address"},{"internalType":"string","name":"thorchainMemo","type":"string"},{"internalType":"uint256","name":"expiration","type":"uint256"}],"name":"swapInToThorchain","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"_address","type":"address"}],"name":"updateFeeContractAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"updateRangoCBridgeAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"updateRangoMultichainAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"updateRangoThorchainAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

608060405234801561001057600080fd5b50614f3d806100206000396000f3fe6080604052600436106101485760003560e01c8063984accae116100c0578063e8b98cdc11610074578063ed9656f711610059578063ed9656f714610343578063f2fde38b14610356578063f80f5dd51461037657600080fd5b8063e8b98cdc1461031d578063eb74d1851461033057600080fd5b8063a60fdfb6116100a5578063a60fdfb6146102bd578063c4d66de8146102dd578063ceeb5489146102fd57600080fd5b8063984accae1461027b5780639fae52e61461029d57600080fd5b80635c975abb1161011757806378c8cda7116100fc57806378c8cda7146102065780638c27630d146102265780638da5cb5b1461024657600080fd5b80635c975abb146101c9578063715018a6146101f157600080fd5b80630b320d95146101545780631a347f5d14610169578063264e037a14610189578063410085df146101a957600080fd5b3661014f57005b600080fd5b610167610162366004614212565b610396565b005b34801561017557600080fd5b50610167610184366004614402565b610714565b34801561019557600080fd5b506101676101a4366004614402565b61083c565b3480156101b557600080fd5b506101676101c436600461441f565b61095b565b3480156101d557600080fd5b5060335460ff1660405190151581526020015b60405180910390f35b3480156101fd57600080fd5b50610167610b3b565b34801561021257600080fd5b50610167610221366004614402565b610bc8565b34801561023257600080fd5b50610167610241366004614402565b610d9f565b34801561025257600080fd5b5060655460405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101e8565b34801561028757600080fd5b50610290610ebe565b6040516101e8919061444b565b3480156102a957600080fd5b506101676102b83660046144a5565b610fe2565b6102d06102cb3660046144be565b611115565b6040516101e8919061459c565b3480156102e957600080fd5b506101676102f8366004614402565b61122e565b34801561030957600080fd5b50610167610318366004614402565b6113f2565b61016761032b36600461461c565b611511565b61016761033e36600461470d565b6118e9565b6101676103513660046147f2565b611b9b565b34801561036257600080fd5b50610167610371366004614402565b611f20565b34801561038257600080fd5b50610167610391366004614402565b612050565b60335460ff1615610408576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a207061757365640000000000000000000000000000000060448201526064015b60405180910390fd5b600260975403610474576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016103ff565b60026097557fe9cf4febccbfad5ef15964f91cb6c48fe594747e386f28fc2b067ddf16f1ed5d805473ffffffffffffffffffffffffffffffffffffffff1661053e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f63427269646765206164647265737320696e2052616e676f20636f6e7472616360448201527f74206e6f7420736574000000000000000000000000000000000000000000000060648201526084016103ff565b895173ffffffffffffffffffffffffffffffffffffffff161560008482610566576000610589565b8c604001518d608001518e6060015161057f91906148be565b61058991906148be565b61059391906148be565b905080341015610625576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f53656e64206d6f72652045544820746f20636f7665722073676e466565202b2060448201527f696e70757420616d6f756e74000000000000000000000000000000000000000060648201526084016103ff565b60006106328d8d8d612191565b60208f0151865491935061065e92509073ffffffffffffffffffffffffffffffffffffffff1683612444565b8360000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635465f9f5878f60200151848e8e8e8e8e8e6040518a63ffffffff1660e01b81526004016106ce989796959493929190614927565b6000604051808303818588803b1580156106e757600080fd5b505af11580156106fb573d6000803e3d6000fd5b5050600160975550505050505050505050505050505050565b60655473ffffffffffffffffffffffffffffffffffffffff163314610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103ff565b7fc23df90b6466cfd0cbf4f6a578f167d2f60ed56371b4746a3c5973c8543f4fd9805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117845560408051929093168083526020830191909152917f1c7cb0cdc9ba781f9745f3e24b6de0c45db97bf81b2091dfbcc45e9fdd1c1d1391015b60405180910390a1505050565b60655473ffffffffffffffffffffffffffffffffffffffff1633146108bd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103ff565b7fe9cf4febccbfad5ef15964f91cb6c48fe594747e386f28fc2b067ddf16f1ed5d805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117845560408051929093168083526020830191909152917f68893781f5159598b8f9249a447a49f9817d59d48444fdc01f6bc00418c035d7910161082f565b60655473ffffffffffffffffffffffffffffffffffffffff1633146109dc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103ff565b6040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152829060009073ffffffffffffffffffffffffffffffffffffffff8316906370a0823190602401602060405180830381865afa158015610a4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6f9190614b44565b905082811015610adb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f496e73756666696369656e742062616c616e636500000000000000000000000060448201526064016103ff565b610ae6823385612460565b6040805173ffffffffffffffffffffffffffffffffffffffff86168152602081018590527fd7dee2702d63ad89917b6a4da9981c90c4d24f8c2bdfd64c604ecae57d8d0651910160405180910390a150505050565b60655473ffffffffffffffffffffffffffffffffffffffff163314610bbc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103ff565b610bc66000612534565b565b60655473ffffffffffffffffffffffffffffffffffffffff163314610c49576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103ff565b73ffffffffffffffffffffffffffffffffffffffff811660009081527fc23df90b6466cfd0cbf4f6a578f167d2f60ed56371b4746a3c5973c8543f4fdb60205260409020547fc23df90b6466cfd0cbf4f6a578f167d2f60ed56371b4746a3c5973c8543f4fd99060ff16610d19576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f466163746f7279206e6f7420666f756e6400000000000000000000000000000060448201526064016103ff565b73ffffffffffffffffffffffffffffffffffffffff8216600081815260028301602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905590519182527ffb00f7adc91459b5048ecdc60b783959a583bafb1e3041f3e1f017540a0e47d391015b60405180910390a15050565b60655473ffffffffffffffffffffffffffffffffffffffff163314610e20576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103ff565b7fed7d91da7fb046892c2413e11ecc409c17b784b916ff0fd3fa2d512c567da864805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117845560408051929093168083526020830191909152917faa779eacfbe610fe15a952f7c7dd2a74fd25a1725720e506d0b73d66af2fca0a910161082f565b604080516003808252608082019092526060917fe9cf4febccbfad5ef15964f91cb6c48fe594747e386f28fc2b067ddf16f1ed5d917fed7d91da7fb046892c2413e11ecc409c17b784b916ff0fd3fa2d512c567da86491600091906020820186803683370190505090503081600081518110610f3c57610f3c614b5d565b73ffffffffffffffffffffffffffffffffffffffff92831660209182029290920101528354825191169082906001908110610f7957610f79614b5d565b73ffffffffffffffffffffffffffffffffffffffff92831660209182029290920101528254825191169082906002908110610fb657610fb6614b5d565b73ffffffffffffffffffffffffffffffffffffffff909216602092830291909101909101529392505050565b60655473ffffffffffffffffffffffffffffffffffffffff163314611063576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103ff565b47818110156110ce576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f496e73756666696369656e742062616c616e636500000000000000000000000060448201526064016103ff565b6110de60008333600160006125ab565b6040805160008152602081018490527fd7dee2702d63ad89917b6a4da9981c90c4d24f8c2bdfd64c604ecae57d8d06519101610d93565b606061112360335460ff1690565b1561118a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a207061757365640000000000000000000000000000000060448201526064016103ff565b6002609754036111f6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016103ff565b6002609755600080611209878787612191565b9150915061121f876020015182338760006125ab565b50600160975595945050505050565b600061123a6001612818565b9050801561126f57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b7fc23df90b6466cfd0cbf4f6a578f167d2f60ed56371b4746a3c5973c8543f4fda80547fffffffffffffffffffffffff000000000000000000000000000000000000000090811673ffffffffffffffffffffffffffffffffffffffff8516179091557fc23df90b6466cfd0cbf4f6a578f167d2f60ed56371b4746a3c5973c8543f4fd98054821681557fe9cf4febccbfad5ef15964f91cb6c48fe594747e386f28fc2b067ddf16f1ed5d8054831681557f2d408556142e9c30601bb067c0631f1a23ffac1d1598afa3da595c26103e49668054841681557fed7d91da7fb046892c2413e11ecc409c17b784b916ff0fd3fa2d512c567da86480549094168455919290919061137b6129a3565b611383612a42565b61138b612ae1565b5050505080156113ee57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249890602001610d93565b5050565b60655473ffffffffffffffffffffffffffffffffffffffff163314611473576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103ff565b7f2d408556142e9c30601bb067c0631f1a23ffac1d1598afa3da595c26103e4966805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117845560408051929093168083526020830191909152917fa0ac4525a841c5df5b487fe49e87dc64d2349ab7136d92edc097ea2c66a4385f910161082f565b60335460ff161561157e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a207061757365640000000000000000000000000000000060448201526064016103ff565b6002609754036115ea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016103ff565b60026097557fed7d91da7fb046892c2413e11ecc409c17b784b916ff0fd3fa2d512c567da864805473ffffffffffffffffffffffffffffffffffffffff166116b4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f4d756c7469636861696e206164647265737320696e2052616e676f20636f6e7460448201527f72616374206e6f7420736574000000000000000000000000000000000000000060648201526084016103ff565b845173ffffffffffffffffffffffffffffffffffffffff16156000816116db5760006116fe565b8660400151876080015188606001516116f491906148be565b6116fe91906148be565b905080341015611790576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f53656e64206d6f72652045544820746f20636f76657220696e70757420616d6f60448201527f756e74202b20666565000000000000000000000000000000000000000000000060648201526084016103ff565b600061179d888888612191565b60208a015190925073ffffffffffffffffffffffffffffffffffffffff161590506117ea57602088015184546117ea919073ffffffffffffffffffffffffffffffffffffffff1683612444565b602088015160009073ffffffffffffffffffffffffffffffffffffffff1615611814576000611828565b60008211611826578860400151611828565b815b855487516020808d0151908a01516040808c015160608d015160808e015192517ff5e9348a00000000000000000000000000000000000000000000000000000000815297985073ffffffffffffffffffffffffffffffffffffffff9096169663f5e9348a9689966118a7969095909490938c9390929190600401614b8c565b6000604051808303818588803b1580156118c057600080fd5b505af11580156118d4573d6000803e3d6000fd5b50506001609755505050505050505050505050565b60335460ff1615611956576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a207061757365640000000000000000000000000000000060448201526064016103ff565b6002609754036119c2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016103ff565b60026097557f2d408556142e9c30601bb067c0631f1a23ffac1d1598afa3da595c26103e4966805473ffffffffffffffffffffffffffffffffffffffff16611a8c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603360248201527f54686f72636861696e2077726170706572206164647265737320696e2052616e60448201527f676f20636f6e7472616374206e6f74207365740000000000000000000000000060648201526084016103ff565b6000611a998a8a8a612191565b60208c01519092506000915073ffffffffffffffffffffffffffffffffffffffff1615611aed5760208b01518354611ae8919073ffffffffffffffffffffffffffffffffffffffff1684612444565b611af0565b50805b825460208c01516040517f2d3cfc3300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90921691632d3cfc33918491611b57919087908e908e908e908e908e90600401614c0e565b6000604051808303818588803b158015611b7057600080fd5b505af1158015611b84573d6000803e3d6000fd5b505060016097555050505050505050505050505050565b60335460ff1615611c08576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a207061757365640000000000000000000000000000000060448201526064016103ff565b600260975403611c74576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016103ff565b60026097557fe9cf4febccbfad5ef15964f91cb6c48fe594747e386f28fc2b067ddf16f1ed5d805473ffffffffffffffffffffffffffffffffffffffff16611d3e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f63427269646765206164647265737320696e2052616e676f20636f6e7472616360448201527f74206e6f7420736574000000000000000000000000000000000000000000000060648201526084016103ff565b875173ffffffffffffffffffffffffffffffffffffffff1615600081611d65576000611d88565b89604001518a608001518b60600151611d7e91906148be565b611d8891906148be565b905080341015611e1a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f53656e64206d6f72652045544820746f20636f76657220696e70757420616d6f60448201527f756e74000000000000000000000000000000000000000000000000000000000060648201526084016103ff565b6000611e278b8b8b612191565b60208d01518654919350611e5392509073ffffffffffffffffffffffffffffffffffffffff1683612444565b835460208c01516040517fa5977fbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8b8116600483015291821660248201526044810184905267ffffffffffffffff808b1660648301528916608482015263ffffffff881660a482015291169063a5977fbb9060c401600060405180830381600087803b158015611ef657600080fd5b505af1158015611f0a573d6000803e3d6000fd5b5050600160975550505050505050505050505050565b60655473ffffffffffffffffffffffffffffffffffffffff163314611fa1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103ff565b73ffffffffffffffffffffffffffffffffffffffff8116612044576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016103ff565b61204d81612534565b50565b60655473ffffffffffffffffffffffffffffffffffffffff1633146120d1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103ff565b73ffffffffffffffffffffffffffffffffffffffff811660008181527fc23df90b6466cfd0cbf4f6a578f167d2f60ed56371b4746a3c5973c8543f4fdb602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905590519182527fc23df90b6466cfd0cbf4f6a578f167d2f60ed56371b4746a3c5973c8543f4fd9917fb7269578552456138d47dc37471d94886205143f138387446eff0148047965f69101610d93565b60606000806121a38660200151612b80565b905060006121b48760000151612b80565b905060006121c3888888612c3b565b905060006121d48960200151612b80565b905060006121e58a60000151612b80565b8a5190915073ffffffffffffffffffffffffffffffffffffffff161561229a5783811015612295576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603d60248201527f536f7572636520746f6b656e2062616c616e6365206f6e20636f6e747261637460448201527f206d757374206e6f74206465637265617365206166746572207377617000000060648201526084016103ff565b612333565b6122a43485614c9d565b811015612333576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603d60248201527f536f7572636520746f6b656e2062616c616e6365206f6e20636f6e747261637460448201527f206d757374206e6f74206465637265617365206166746572207377617000000060648201526084016103ff565b600088156124155760006123478785614c9d565b116123ae576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f4e6f2062616c616e636520666f756e642061667465722073776170730000000060448201526064016103ff565b6123b88684614c9d565b6020808d01516040805173ffffffffffffffffffffffffffffffffffffffff90921682529181018390529192507f2f2a0be2ceea0e98188f8c78d4b07b127323c860cd38aa66270036b4792171e6910160405180910390a1612433565b858311612426578a60400151612430565b6124308684614c9d565b90505b929a92995091975050505050505050565b612450838360006135bb565b61245b83838361373d565b505050565b60405173ffffffffffffffffffffffffffffffffffffffff831660248201526044810182905261245b9084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152613841565b6065805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6040805173ffffffffffffffffffffffffffffffffffffffff8781168252602082018790528516818301528315156060820152821515608082015290517fc23df90b6466cfd0cbf4f6a578f167d2f60ed56371b4746a3c5973c8543f4fd9917fbc5ba848d4a4b8ebad0f5104ceb00e5ef597fe76fecfc967fb39801515271fa7919081900360a00190a1821561280557811561275257600181015473ffffffffffffffffffffffffffffffffffffffff8781169116146126c7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f746f6b656e206d69736d6174636800000000000000000000000000000000000060448201526064016103ff565b60018101546040517f2e1a7d4d0000000000000000000000000000000000000000000000000000000081526004810187905273ffffffffffffffffffffffffffffffffffffffff90911690632e1a7d4d90602401600060405180830381600087803b15801561273557600080fd5b505af1158015612749573d6000803e3d6000fd5b505050506127f6565b73ffffffffffffffffffffffffffffffffffffffff8616156127f6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f546f6b656e2061646472657373206d75737420626520307830302e2e2e30206660448201527f6f72206e6174697665206f75740000000000000000000000000000000000000060648201526084016103ff565b612800848661394d565b612810565b612810868587612460565b505050505050565b60008054610100900460ff16156128cf578160ff16600114801561283b5750303b155b6128c7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016103ff565b506000919050565b60005460ff808416911610612966576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016103ff565b50600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff92909216919091179055600190565b919050565b600054610100900460ff16612a3a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016103ff565b610bc6613a17565b600054610100900460ff16612ad9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016103ff565b610bc6613ab7565b600054610100900460ff16612b78576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016103ff565b610bc6613b78565b60008173ffffffffffffffffffffffffffffffffffffffff811615612c32576040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8216906370a0823190602401602060405180830381865afa158015612c09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c2d9190614b44565b612c34565b475b9392505050565b82517fc23df90b6466cfd0cbf4f6a578f167d2f60ed56371b4746a3c5973c8543f4fd9805460609273ffffffffffffffffffffffffffffffffffffffff90811615929116612ce5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f46656520636f6e74726163742061646472657373206e6f74207365740000000060448201526064016103ff565b60005b84811015612dca57816002016000878784818110612d0857612d08614b5d565b9050602002810190612d1a9190614cb4565b612d28906020810190614402565b73ffffffffffffffffffffffffffffffffffffffff16815260208101919091526040016000205460ff16612db8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f436f6e74616374206e6f742077686974656c697374656400000000000000000060448201526064016103ff565b80612dc281614cf2565b915050612ce8565b506000866040015187608001518860600151612de691906148be565b612df091906148be565b90508215612e885780341015612e88576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f4e6f7420656e6f756768204554482070726f766964656420746f20636f6e747260448201527f616374000000000000000000000000000000000000000000000000000000000060648201526084016103ff565b6000612710612e9961012c84614d2a565b612ea39190614d67565b90506000612710612eb661012c85614d2a565b612ec09190614d67565b90508189606001511115612f55576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f52657175657374656420666565206578636565646564206d617820746872657360448201527f686f6c640000000000000000000000000000000000000000000000000000000060648201526084016103ff565b8089608001511115612fe9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603160248201527f52657175657374656420616666696c696174652072657761726420657863656560448201527f646564206d6178207468726573686f6c6400000000000000000000000000000060648201526084016103ff565b846131235760005b87811015613049578951613037908a8a8481811061301157613011614b5d565b90506020028101906130239190614cb4565b613031906020810190614402565b86612444565b8061304181614cf2565b915050612ff1565b5060006130598a60000151612b80565b905061306b8a60000151333087613c16565b600061307a8b60000151612b80565b905081811180156130935750846130918383614c9d565b105b15613120576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f4465666c6174696f6e61727920746f6b656e7320617265206e6f74207375707060448201527f6f727465642062792052616e676f20636f6e747261637400000000000000000060648201526084016103ff565b50505b6060890151156131bc57885160608a0151855461315a92919073ffffffffffffffffffffffffffffffffffffffff168860006125ab565b885184546060808c01516040805173ffffffffffffffffffffffffffffffffffffffff95861681529490931660208501528383015290517f715e76729ba81a946e254c4ba6488670b429b63e79b2b4cd7f0a969dd7ecbd819281900390910190a15b6080890151156132c45760a089015173ffffffffffffffffffffffffffffffffffffffff16613247576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f496e76616c696420616666696c6961746f72416464726573730000000000000060448201526064016103ff565b61326189600001518a608001518b60a001518860006125ab565b885160a08a015160808b01516040805173ffffffffffffffffffffffffffffffffffffffff948516815293909216602084015282820152517fbd8658de9f5922c925df42ff357f621af85a2047dff46d23443decd2cdc74b429181900360600190a15b60008767ffffffffffffffff8111156132df576132df613ed9565b60405190808252806020026020018201604052801561331257816020015b60608152602001906001900390816132fd5790505b50905060005b888110156135ad57600080886133f8578b8b8481811061333a5761333a614b5d565b905060200281019061334c9190614cb4565b61335a906020810190614402565b73ffffffffffffffffffffffffffffffffffffffff168c8c8581811061338257613382614b5d565b90506020028101906133949190614cb4565b6133a2906020810190614da2565b6040516133b0929190614e07565b6000604051808303816000865af19150503d80600081146133ed576040519150601f19603f3d011682016040523d82523d6000602084013e6133f2565b606091505b506134c9565b8b8b8481811061340a5761340a614b5d565b905060200281019061341c9190614cb4565b61342a906020810190614402565b73ffffffffffffffffffffffffffffffffffffffff168d604001518d8d8681811061345757613457614b5d565b90506020028101906134699190614cb4565b613477906020810190614da2565b604051613485929190614e07565b60006040518083038185875af1925050503d80600081146134c2576040519150601f19603f3d011682016040523d82523d6000602084013e6134c7565b606091505b505b915091507f2fc0d44e6ef6b3e7707cacd3cc326511198c3d1598c65dd54be5a9e37ce02f128c8c8581811061350057613500614b5d565b90506020028101906135129190614cb4565b613520906020810190614402565b838360405161353193929190614e17565b60405180910390a18161357a5761354781613c74565b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ff9190614e57565b8084848151811061358d5761358d614b5d565b6020026020010181905250505080806135a590614cf2565b915050613318565b509998505050505050505050565b80158061365b57506040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff838116602483015284169063dd62ed3e90604401602060405180830381865afa158015613635573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136599190614b44565b155b6136e7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527f20746f206e6f6e2d7a65726f20616c6c6f77616e63650000000000000000000060648201526084016103ff565b60405173ffffffffffffffffffffffffffffffffffffffff831660248201526044810182905261245b9084907f095ea7b300000000000000000000000000000000000000000000000000000000906064016124b2565b6040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa1580156137b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137d89190614b44565b6137e291906148be565b60405173ffffffffffffffffffffffffffffffffffffffff851660248201526044810182905290915061383b9085907f095ea7b300000000000000000000000000000000000000000000000000000000906064016124b2565b50505050565b60006138a3826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16613cd99092919063ffffffff16565b80519091501561245b57808060200190518101906138c19190614e6a565b61245b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016103ff565b60008273ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d80600081146139a7576040519150601f19603f3d011682016040523d82523d6000602084013e6139ac565b606091505b505090508061245b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f6661696c656420746f2073656e64206e6174697665000000000000000000000060448201526064016103ff565b600054610100900460ff16613aae576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016103ff565b610bc633612534565b600054610100900460ff16613b4e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016103ff565b603380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055565b600054610100900460ff16613c0f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016103ff565b6001609755565b60405173ffffffffffffffffffffffffffffffffffffffff8085166024830152831660448201526064810182905261383b9085907f23b872dd00000000000000000000000000000000000000000000000000000000906084016124b2565b6060604482511015613cb957505060408051808201909152601d81527f5472616e73616374696f6e2072657665727465642073696c656e746c79000000602082015290565b60048201915081806020019051810190613cd39190614e87565b92915050565b6060613ce88484600085613cf0565b949350505050565b606082471015613d82576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016103ff565b73ffffffffffffffffffffffffffffffffffffffff85163b613e00576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016103ff565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051613e299190614ef5565b60006040518083038185875af1925050503d8060008114613e66576040519150601f19603f3d011682016040523d82523d6000602084013e613e6b565b606091505b5091509150613e7b828286613e86565b979650505050505050565b60608315613e95575081612c34565b825115613ea55782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ff9190614e57565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040516101c0810167ffffffffffffffff81118282101715613f2c57613f2c613ed9565b60405290565b60405160a0810167ffffffffffffffff81118282101715613f2c57613f2c613ed9565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715613f9c57613f9c613ed9565b604052919050565b73ffffffffffffffffffffffffffffffffffffffff8116811461204d57600080fd5b803561299e81613fa4565b600060c08284031215613fe357600080fd5b60405160c0810181811067ffffffffffffffff8211171561400657614006613ed9565b604052905080823561401781613fa4565b8152602083013561402781613fa4565b8060208301525060408301356040820152606083013560608201526080830135608082015260a083013561405a81613fa4565b60a0919091015292915050565b60008083601f84011261407957600080fd5b50813567ffffffffffffffff81111561409157600080fd5b6020830191508360208260051b85010111156140ac57600080fd5b9250929050565b803567ffffffffffffffff8116811461299e57600080fd5b803563ffffffff8116811461299e57600080fd5b801515811461204d57600080fd5b803561299e816140df565b600082601f83011261410957600080fd5b8135602067ffffffffffffffff82111561412557614125613ed9565b8160051b614134828201613f55565b928352848101820192828101908785111561414e57600080fd5b83870192505b84831015613e7b57823561416781613fa4565b82529183019190830190614154565b600067ffffffffffffffff82111561419057614190613ed9565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b600082601f8301126141cd57600080fd5b81356141e06141db82614176565b613f55565b8181528460208386010111156141f557600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060008060008060006101a08a8c03121561423157600080fd5b61423b8b8b613fd1565b985060c08a013567ffffffffffffffff8082111561425857600080fd5b6142648d838e01614067565b909a50985060e08c0135915061427982613fa4565b8197506142896101008d016140b3565b96506142986101208d016140b3565b95506142a76101408d016140cb565b94506101608c013593506101808c01359150808211156142c657600080fd5b908b01906101c0828e0312156142db57600080fd5b6142e3613f08565b6142ec836140b3565b81526142fa602084016140ed565b602082015261430b60408401613fc6565b604082015261431c60608401613fc6565b606082015261432d60808401613fc6565b608082015260a083013560a082015260c08301358281111561434e57600080fd5b61435a8f8286016140f8565b60c08301525060e083013560e082015261437761010084016140ed565b61010082015261438a6101208401613fc6565b61012082015261439d6101408401613fc6565b610140820152610160830135828111156143b657600080fd5b6143c28f8286016141bc565b610160830152506143d66101808401613fc6565b6101808201526143e96101a08401613fc6565b6101a08201528093505050509295985092959850929598565b60006020828403121561441457600080fd5b8135612c3481613fa4565b6000806040838503121561443257600080fd5b823561443d81613fa4565b946020939093013593505050565b6020808252825182820181905260009190848201906040850190845b8181101561449957835173ffffffffffffffffffffffffffffffffffffffff1683529284019291840191600101614467565b50909695505050505050565b6000602082840312156144b757600080fd5b5035919050565b60008060008061010085870312156144d557600080fd5b6144df8686613fd1565b935060c085013567ffffffffffffffff8111156144fb57600080fd5b61450787828801614067565b90945092505060e085013561451b816140df565b939692955090935050565b60005b83811015614541578181015183820152602001614529565b8381111561383b5750506000910152565b6000815180845261456a816020860160208601614526565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561460f577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08886030184526145fd858351614552565b945092850192908501906001016145c3565b5092979650505050505050565b60008060008084860361018081121561463457600080fd5b61463e8787613fd1565b945060c086013567ffffffffffffffff81111561465a57600080fd5b61466688828901614067565b90955093505060a07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff208201121561469c57600080fd5b506146a5613f32565b60e0860135600381106146b757600080fd5b81526101008601356146c881613fa4565b60208201526101208601356146dc81613fa4565b60408201526101408601356146f081613fa4565b606082015261016095909501356080860152509194909350909190565b600080600080600080600080610160898b03121561472a57600080fd5b6147348a8a613fd1565b975060c089013567ffffffffffffffff8082111561475157600080fd5b61475d8c838d01614067565b909950975060e08b0135915061477282613fa4565b9095506101008a01359061478582613fa4565b9094506101208a0135908082111561479c57600080fd5b818b0191508b601f8301126147b057600080fd5b8135818111156147bf57600080fd5b8c60208285010111156147d157600080fd5b60208301955080945050505061014089013590509295985092959890939650565b6000806000806000806000610160888a03121561480e57600080fd5b6148188989613fd1565b965060c088013567ffffffffffffffff81111561483457600080fd5b6148408a828b01614067565b90975095505060e088013561485481613fa4565b935061486361010089016140b3565b925061487261012089016140b3565b915061488161014089016140cb565b905092959891949750929550565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082198211156148d1576148d161488f565b500190565b600081518084526020808501945080840160005b8381101561491c57815173ffffffffffffffffffffffffffffffffffffffff16875295820195908201906001016148ea565b509495945050505050565b600061010073ffffffffffffffffffffffffffffffffffffffff808c1684528a6020850152808a1660408501525067ffffffffffffffff808916606085015280881660808501525063ffffffff861660a08401528460c08401528060e084015261499d818401855167ffffffffffffffff169052565b60208401516101206149b28186018315159052565b604086015191506101406149dd8187018473ffffffffffffffffffffffffffffffffffffffff169052565b60608701519250610160614a088188018573ffffffffffffffffffffffffffffffffffffffff169052565b60808801519350610180614a338189018673ffffffffffffffffffffffffffffffffffffffff169052565b60a08901516101a08981019190915260c08a01516101c0808b01529550614a5e6102c08a01876148d6565b60e08b01516101e08b0152968a015115156102008a0152848a015173ffffffffffffffffffffffffffffffffffffffff9081166102208b0152848b0151166102408a0152828a01518988037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00016102608b0152969550614ade8688614552565b9650818a01519550614b096102808a018773ffffffffffffffffffffffffffffffffffffffff169052565b89015173ffffffffffffffffffffffffffffffffffffffff81166102a08a01529450614b359350505050565b509a9950505050505050505050565b600060208284031215614b5657600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60e0810160038910614bc7577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b97815273ffffffffffffffffffffffffffffffffffffffff968716602082015294861660408601526060850193909352908416608084015290921660a082015260c0015290565b600073ffffffffffffffffffffffffffffffffffffffff808a168352886020840152808816604084015280871660608401525060c060808301528360c0830152838560e0840137600060e0858401015260e07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f86011683010190508260a083015298975050505050505050565b600082821015614caf57614caf61488f565b500390565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc1833603018112614ce857600080fd5b9190910192915050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203614d2357614d2361488f565b5060010190565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615614d6257614d6261488f565b500290565b600082614d9d577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112614dd757600080fd5b83018035915067ffffffffffffffff821115614df257600080fd5b6020019150368190038213156140ac57600080fd5b8183823760009101908152919050565b73ffffffffffffffffffffffffffffffffffffffff841681528215156020820152606060408201526000614e4e6060830184614552565b95945050505050565b602081526000612c346020830184614552565b600060208284031215614e7c57600080fd5b8151612c34816140df565b600060208284031215614e9957600080fd5b815167ffffffffffffffff811115614eb057600080fd5b8201601f81018413614ec157600080fd5b8051614ecf6141db82614176565b818152856020838501011115614ee457600080fd5b614e4e826020830160208601614526565b60008251614ce881846020870161452656fea2646970667358221220d7ef24b907a20ce976254f4990d37ead54c26409b692ce676cd3fbc0976e603664736f6c634300080d0033

Deployed Bytecode

0x6080604052600436106101485760003560e01c8063984accae116100c0578063e8b98cdc11610074578063ed9656f711610059578063ed9656f714610343578063f2fde38b14610356578063f80f5dd51461037657600080fd5b8063e8b98cdc1461031d578063eb74d1851461033057600080fd5b8063a60fdfb6116100a5578063a60fdfb6146102bd578063c4d66de8146102dd578063ceeb5489146102fd57600080fd5b8063984accae1461027b5780639fae52e61461029d57600080fd5b80635c975abb1161011757806378c8cda7116100fc57806378c8cda7146102065780638c27630d146102265780638da5cb5b1461024657600080fd5b80635c975abb146101c9578063715018a6146101f157600080fd5b80630b320d95146101545780631a347f5d14610169578063264e037a14610189578063410085df146101a957600080fd5b3661014f57005b600080fd5b610167610162366004614212565b610396565b005b34801561017557600080fd5b50610167610184366004614402565b610714565b34801561019557600080fd5b506101676101a4366004614402565b61083c565b3480156101b557600080fd5b506101676101c436600461441f565b61095b565b3480156101d557600080fd5b5060335460ff1660405190151581526020015b60405180910390f35b3480156101fd57600080fd5b50610167610b3b565b34801561021257600080fd5b50610167610221366004614402565b610bc8565b34801561023257600080fd5b50610167610241366004614402565b610d9f565b34801561025257600080fd5b5060655460405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101e8565b34801561028757600080fd5b50610290610ebe565b6040516101e8919061444b565b3480156102a957600080fd5b506101676102b83660046144a5565b610fe2565b6102d06102cb3660046144be565b611115565b6040516101e8919061459c565b3480156102e957600080fd5b506101676102f8366004614402565b61122e565b34801561030957600080fd5b50610167610318366004614402565b6113f2565b61016761032b36600461461c565b611511565b61016761033e36600461470d565b6118e9565b6101676103513660046147f2565b611b9b565b34801561036257600080fd5b50610167610371366004614402565b611f20565b34801561038257600080fd5b50610167610391366004614402565b612050565b60335460ff1615610408576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a207061757365640000000000000000000000000000000060448201526064015b60405180910390fd5b600260975403610474576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016103ff565b60026097557fe9cf4febccbfad5ef15964f91cb6c48fe594747e386f28fc2b067ddf16f1ed5d805473ffffffffffffffffffffffffffffffffffffffff1661053e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f63427269646765206164647265737320696e2052616e676f20636f6e7472616360448201527f74206e6f7420736574000000000000000000000000000000000000000000000060648201526084016103ff565b895173ffffffffffffffffffffffffffffffffffffffff161560008482610566576000610589565b8c604001518d608001518e6060015161057f91906148be565b61058991906148be565b61059391906148be565b905080341015610625576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f53656e64206d6f72652045544820746f20636f7665722073676e466565202b2060448201527f696e70757420616d6f756e74000000000000000000000000000000000000000060648201526084016103ff565b60006106328d8d8d612191565b60208f0151865491935061065e92509073ffffffffffffffffffffffffffffffffffffffff1683612444565b8360000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635465f9f5878f60200151848e8e8e8e8e8e6040518a63ffffffff1660e01b81526004016106ce989796959493929190614927565b6000604051808303818588803b1580156106e757600080fd5b505af11580156106fb573d6000803e3d6000fd5b5050600160975550505050505050505050505050505050565b60655473ffffffffffffffffffffffffffffffffffffffff163314610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103ff565b7fc23df90b6466cfd0cbf4f6a578f167d2f60ed56371b4746a3c5973c8543f4fd9805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117845560408051929093168083526020830191909152917f1c7cb0cdc9ba781f9745f3e24b6de0c45db97bf81b2091dfbcc45e9fdd1c1d1391015b60405180910390a1505050565b60655473ffffffffffffffffffffffffffffffffffffffff1633146108bd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103ff565b7fe9cf4febccbfad5ef15964f91cb6c48fe594747e386f28fc2b067ddf16f1ed5d805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117845560408051929093168083526020830191909152917f68893781f5159598b8f9249a447a49f9817d59d48444fdc01f6bc00418c035d7910161082f565b60655473ffffffffffffffffffffffffffffffffffffffff1633146109dc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103ff565b6040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152829060009073ffffffffffffffffffffffffffffffffffffffff8316906370a0823190602401602060405180830381865afa158015610a4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6f9190614b44565b905082811015610adb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f496e73756666696369656e742062616c616e636500000000000000000000000060448201526064016103ff565b610ae6823385612460565b6040805173ffffffffffffffffffffffffffffffffffffffff86168152602081018590527fd7dee2702d63ad89917b6a4da9981c90c4d24f8c2bdfd64c604ecae57d8d0651910160405180910390a150505050565b60655473ffffffffffffffffffffffffffffffffffffffff163314610bbc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103ff565b610bc66000612534565b565b60655473ffffffffffffffffffffffffffffffffffffffff163314610c49576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103ff565b73ffffffffffffffffffffffffffffffffffffffff811660009081527fc23df90b6466cfd0cbf4f6a578f167d2f60ed56371b4746a3c5973c8543f4fdb60205260409020547fc23df90b6466cfd0cbf4f6a578f167d2f60ed56371b4746a3c5973c8543f4fd99060ff16610d19576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f466163746f7279206e6f7420666f756e6400000000000000000000000000000060448201526064016103ff565b73ffffffffffffffffffffffffffffffffffffffff8216600081815260028301602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905590519182527ffb00f7adc91459b5048ecdc60b783959a583bafb1e3041f3e1f017540a0e47d391015b60405180910390a15050565b60655473ffffffffffffffffffffffffffffffffffffffff163314610e20576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103ff565b7fed7d91da7fb046892c2413e11ecc409c17b784b916ff0fd3fa2d512c567da864805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117845560408051929093168083526020830191909152917faa779eacfbe610fe15a952f7c7dd2a74fd25a1725720e506d0b73d66af2fca0a910161082f565b604080516003808252608082019092526060917fe9cf4febccbfad5ef15964f91cb6c48fe594747e386f28fc2b067ddf16f1ed5d917fed7d91da7fb046892c2413e11ecc409c17b784b916ff0fd3fa2d512c567da86491600091906020820186803683370190505090503081600081518110610f3c57610f3c614b5d565b73ffffffffffffffffffffffffffffffffffffffff92831660209182029290920101528354825191169082906001908110610f7957610f79614b5d565b73ffffffffffffffffffffffffffffffffffffffff92831660209182029290920101528254825191169082906002908110610fb657610fb6614b5d565b73ffffffffffffffffffffffffffffffffffffffff909216602092830291909101909101529392505050565b60655473ffffffffffffffffffffffffffffffffffffffff163314611063576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103ff565b47818110156110ce576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f496e73756666696369656e742062616c616e636500000000000000000000000060448201526064016103ff565b6110de60008333600160006125ab565b6040805160008152602081018490527fd7dee2702d63ad89917b6a4da9981c90c4d24f8c2bdfd64c604ecae57d8d06519101610d93565b606061112360335460ff1690565b1561118a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a207061757365640000000000000000000000000000000060448201526064016103ff565b6002609754036111f6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016103ff565b6002609755600080611209878787612191565b9150915061121f876020015182338760006125ab565b50600160975595945050505050565b600061123a6001612818565b9050801561126f57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b7fc23df90b6466cfd0cbf4f6a578f167d2f60ed56371b4746a3c5973c8543f4fda80547fffffffffffffffffffffffff000000000000000000000000000000000000000090811673ffffffffffffffffffffffffffffffffffffffff8516179091557fc23df90b6466cfd0cbf4f6a578f167d2f60ed56371b4746a3c5973c8543f4fd98054821681557fe9cf4febccbfad5ef15964f91cb6c48fe594747e386f28fc2b067ddf16f1ed5d8054831681557f2d408556142e9c30601bb067c0631f1a23ffac1d1598afa3da595c26103e49668054841681557fed7d91da7fb046892c2413e11ecc409c17b784b916ff0fd3fa2d512c567da86480549094168455919290919061137b6129a3565b611383612a42565b61138b612ae1565b5050505080156113ee57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249890602001610d93565b5050565b60655473ffffffffffffffffffffffffffffffffffffffff163314611473576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103ff565b7f2d408556142e9c30601bb067c0631f1a23ffac1d1598afa3da595c26103e4966805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117845560408051929093168083526020830191909152917fa0ac4525a841c5df5b487fe49e87dc64d2349ab7136d92edc097ea2c66a4385f910161082f565b60335460ff161561157e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a207061757365640000000000000000000000000000000060448201526064016103ff565b6002609754036115ea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016103ff565b60026097557fed7d91da7fb046892c2413e11ecc409c17b784b916ff0fd3fa2d512c567da864805473ffffffffffffffffffffffffffffffffffffffff166116b4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f4d756c7469636861696e206164647265737320696e2052616e676f20636f6e7460448201527f72616374206e6f7420736574000000000000000000000000000000000000000060648201526084016103ff565b845173ffffffffffffffffffffffffffffffffffffffff16156000816116db5760006116fe565b8660400151876080015188606001516116f491906148be565b6116fe91906148be565b905080341015611790576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f53656e64206d6f72652045544820746f20636f76657220696e70757420616d6f60448201527f756e74202b20666565000000000000000000000000000000000000000000000060648201526084016103ff565b600061179d888888612191565b60208a015190925073ffffffffffffffffffffffffffffffffffffffff161590506117ea57602088015184546117ea919073ffffffffffffffffffffffffffffffffffffffff1683612444565b602088015160009073ffffffffffffffffffffffffffffffffffffffff1615611814576000611828565b60008211611826578860400151611828565b815b855487516020808d0151908a01516040808c015160608d015160808e015192517ff5e9348a00000000000000000000000000000000000000000000000000000000815297985073ffffffffffffffffffffffffffffffffffffffff9096169663f5e9348a9689966118a7969095909490938c9390929190600401614b8c565b6000604051808303818588803b1580156118c057600080fd5b505af11580156118d4573d6000803e3d6000fd5b50506001609755505050505050505050505050565b60335460ff1615611956576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a207061757365640000000000000000000000000000000060448201526064016103ff565b6002609754036119c2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016103ff565b60026097557f2d408556142e9c30601bb067c0631f1a23ffac1d1598afa3da595c26103e4966805473ffffffffffffffffffffffffffffffffffffffff16611a8c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603360248201527f54686f72636861696e2077726170706572206164647265737320696e2052616e60448201527f676f20636f6e7472616374206e6f74207365740000000000000000000000000060648201526084016103ff565b6000611a998a8a8a612191565b60208c01519092506000915073ffffffffffffffffffffffffffffffffffffffff1615611aed5760208b01518354611ae8919073ffffffffffffffffffffffffffffffffffffffff1684612444565b611af0565b50805b825460208c01516040517f2d3cfc3300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90921691632d3cfc33918491611b57919087908e908e908e908e908e90600401614c0e565b6000604051808303818588803b158015611b7057600080fd5b505af1158015611b84573d6000803e3d6000fd5b505060016097555050505050505050505050505050565b60335460ff1615611c08576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a207061757365640000000000000000000000000000000060448201526064016103ff565b600260975403611c74576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016103ff565b60026097557fe9cf4febccbfad5ef15964f91cb6c48fe594747e386f28fc2b067ddf16f1ed5d805473ffffffffffffffffffffffffffffffffffffffff16611d3e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f63427269646765206164647265737320696e2052616e676f20636f6e7472616360448201527f74206e6f7420736574000000000000000000000000000000000000000000000060648201526084016103ff565b875173ffffffffffffffffffffffffffffffffffffffff1615600081611d65576000611d88565b89604001518a608001518b60600151611d7e91906148be565b611d8891906148be565b905080341015611e1a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f53656e64206d6f72652045544820746f20636f76657220696e70757420616d6f60448201527f756e74000000000000000000000000000000000000000000000000000000000060648201526084016103ff565b6000611e278b8b8b612191565b60208d01518654919350611e5392509073ffffffffffffffffffffffffffffffffffffffff1683612444565b835460208c01516040517fa5977fbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8b8116600483015291821660248201526044810184905267ffffffffffffffff808b1660648301528916608482015263ffffffff881660a482015291169063a5977fbb9060c401600060405180830381600087803b158015611ef657600080fd5b505af1158015611f0a573d6000803e3d6000fd5b5050600160975550505050505050505050505050565b60655473ffffffffffffffffffffffffffffffffffffffff163314611fa1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103ff565b73ffffffffffffffffffffffffffffffffffffffff8116612044576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016103ff565b61204d81612534565b50565b60655473ffffffffffffffffffffffffffffffffffffffff1633146120d1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103ff565b73ffffffffffffffffffffffffffffffffffffffff811660008181527fc23df90b6466cfd0cbf4f6a578f167d2f60ed56371b4746a3c5973c8543f4fdb602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905590519182527fc23df90b6466cfd0cbf4f6a578f167d2f60ed56371b4746a3c5973c8543f4fd9917fb7269578552456138d47dc37471d94886205143f138387446eff0148047965f69101610d93565b60606000806121a38660200151612b80565b905060006121b48760000151612b80565b905060006121c3888888612c3b565b905060006121d48960200151612b80565b905060006121e58a60000151612b80565b8a5190915073ffffffffffffffffffffffffffffffffffffffff161561229a5783811015612295576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603d60248201527f536f7572636520746f6b656e2062616c616e6365206f6e20636f6e747261637460448201527f206d757374206e6f74206465637265617365206166746572207377617000000060648201526084016103ff565b612333565b6122a43485614c9d565b811015612333576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603d60248201527f536f7572636520746f6b656e2062616c616e6365206f6e20636f6e747261637460448201527f206d757374206e6f74206465637265617365206166746572207377617000000060648201526084016103ff565b600088156124155760006123478785614c9d565b116123ae576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f4e6f2062616c616e636520666f756e642061667465722073776170730000000060448201526064016103ff565b6123b88684614c9d565b6020808d01516040805173ffffffffffffffffffffffffffffffffffffffff90921682529181018390529192507f2f2a0be2ceea0e98188f8c78d4b07b127323c860cd38aa66270036b4792171e6910160405180910390a1612433565b858311612426578a60400151612430565b6124308684614c9d565b90505b929a92995091975050505050505050565b612450838360006135bb565b61245b83838361373d565b505050565b60405173ffffffffffffffffffffffffffffffffffffffff831660248201526044810182905261245b9084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152613841565b6065805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6040805173ffffffffffffffffffffffffffffffffffffffff8781168252602082018790528516818301528315156060820152821515608082015290517fc23df90b6466cfd0cbf4f6a578f167d2f60ed56371b4746a3c5973c8543f4fd9917fbc5ba848d4a4b8ebad0f5104ceb00e5ef597fe76fecfc967fb39801515271fa7919081900360a00190a1821561280557811561275257600181015473ffffffffffffffffffffffffffffffffffffffff8781169116146126c7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f746f6b656e206d69736d6174636800000000000000000000000000000000000060448201526064016103ff565b60018101546040517f2e1a7d4d0000000000000000000000000000000000000000000000000000000081526004810187905273ffffffffffffffffffffffffffffffffffffffff90911690632e1a7d4d90602401600060405180830381600087803b15801561273557600080fd5b505af1158015612749573d6000803e3d6000fd5b505050506127f6565b73ffffffffffffffffffffffffffffffffffffffff8616156127f6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f546f6b656e2061646472657373206d75737420626520307830302e2e2e30206660448201527f6f72206e6174697665206f75740000000000000000000000000000000000000060648201526084016103ff565b612800848661394d565b612810565b612810868587612460565b505050505050565b60008054610100900460ff16156128cf578160ff16600114801561283b5750303b155b6128c7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016103ff565b506000919050565b60005460ff808416911610612966576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016103ff565b50600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff92909216919091179055600190565b919050565b600054610100900460ff16612a3a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016103ff565b610bc6613a17565b600054610100900460ff16612ad9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016103ff565b610bc6613ab7565b600054610100900460ff16612b78576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016103ff565b610bc6613b78565b60008173ffffffffffffffffffffffffffffffffffffffff811615612c32576040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8216906370a0823190602401602060405180830381865afa158015612c09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c2d9190614b44565b612c34565b475b9392505050565b82517fc23df90b6466cfd0cbf4f6a578f167d2f60ed56371b4746a3c5973c8543f4fd9805460609273ffffffffffffffffffffffffffffffffffffffff90811615929116612ce5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f46656520636f6e74726163742061646472657373206e6f74207365740000000060448201526064016103ff565b60005b84811015612dca57816002016000878784818110612d0857612d08614b5d565b9050602002810190612d1a9190614cb4565b612d28906020810190614402565b73ffffffffffffffffffffffffffffffffffffffff16815260208101919091526040016000205460ff16612db8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f436f6e74616374206e6f742077686974656c697374656400000000000000000060448201526064016103ff565b80612dc281614cf2565b915050612ce8565b506000866040015187608001518860600151612de691906148be565b612df091906148be565b90508215612e885780341015612e88576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f4e6f7420656e6f756768204554482070726f766964656420746f20636f6e747260448201527f616374000000000000000000000000000000000000000000000000000000000060648201526084016103ff565b6000612710612e9961012c84614d2a565b612ea39190614d67565b90506000612710612eb661012c85614d2a565b612ec09190614d67565b90508189606001511115612f55576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f52657175657374656420666565206578636565646564206d617820746872657360448201527f686f6c640000000000000000000000000000000000000000000000000000000060648201526084016103ff565b8089608001511115612fe9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603160248201527f52657175657374656420616666696c696174652072657761726420657863656560448201527f646564206d6178207468726573686f6c6400000000000000000000000000000060648201526084016103ff565b846131235760005b87811015613049578951613037908a8a8481811061301157613011614b5d565b90506020028101906130239190614cb4565b613031906020810190614402565b86612444565b8061304181614cf2565b915050612ff1565b5060006130598a60000151612b80565b905061306b8a60000151333087613c16565b600061307a8b60000151612b80565b905081811180156130935750846130918383614c9d565b105b15613120576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f4465666c6174696f6e61727920746f6b656e7320617265206e6f74207375707060448201527f6f727465642062792052616e676f20636f6e747261637400000000000000000060648201526084016103ff565b50505b6060890151156131bc57885160608a0151855461315a92919073ffffffffffffffffffffffffffffffffffffffff168860006125ab565b885184546060808c01516040805173ffffffffffffffffffffffffffffffffffffffff95861681529490931660208501528383015290517f715e76729ba81a946e254c4ba6488670b429b63e79b2b4cd7f0a969dd7ecbd819281900390910190a15b6080890151156132c45760a089015173ffffffffffffffffffffffffffffffffffffffff16613247576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f496e76616c696420616666696c6961746f72416464726573730000000000000060448201526064016103ff565b61326189600001518a608001518b60a001518860006125ab565b885160a08a015160808b01516040805173ffffffffffffffffffffffffffffffffffffffff948516815293909216602084015282820152517fbd8658de9f5922c925df42ff357f621af85a2047dff46d23443decd2cdc74b429181900360600190a15b60008767ffffffffffffffff8111156132df576132df613ed9565b60405190808252806020026020018201604052801561331257816020015b60608152602001906001900390816132fd5790505b50905060005b888110156135ad57600080886133f8578b8b8481811061333a5761333a614b5d565b905060200281019061334c9190614cb4565b61335a906020810190614402565b73ffffffffffffffffffffffffffffffffffffffff168c8c8581811061338257613382614b5d565b90506020028101906133949190614cb4565b6133a2906020810190614da2565b6040516133b0929190614e07565b6000604051808303816000865af19150503d80600081146133ed576040519150601f19603f3d011682016040523d82523d6000602084013e6133f2565b606091505b506134c9565b8b8b8481811061340a5761340a614b5d565b905060200281019061341c9190614cb4565b61342a906020810190614402565b73ffffffffffffffffffffffffffffffffffffffff168d604001518d8d8681811061345757613457614b5d565b90506020028101906134699190614cb4565b613477906020810190614da2565b604051613485929190614e07565b60006040518083038185875af1925050503d80600081146134c2576040519150601f19603f3d011682016040523d82523d6000602084013e6134c7565b606091505b505b915091507f2fc0d44e6ef6b3e7707cacd3cc326511198c3d1598c65dd54be5a9e37ce02f128c8c8581811061350057613500614b5d565b90506020028101906135129190614cb4565b613520906020810190614402565b838360405161353193929190614e17565b60405180910390a18161357a5761354781613c74565b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ff9190614e57565b8084848151811061358d5761358d614b5d565b6020026020010181905250505080806135a590614cf2565b915050613318565b509998505050505050505050565b80158061365b57506040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff838116602483015284169063dd62ed3e90604401602060405180830381865afa158015613635573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136599190614b44565b155b6136e7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527f20746f206e6f6e2d7a65726f20616c6c6f77616e63650000000000000000000060648201526084016103ff565b60405173ffffffffffffffffffffffffffffffffffffffff831660248201526044810182905261245b9084907f095ea7b300000000000000000000000000000000000000000000000000000000906064016124b2565b6040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa1580156137b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137d89190614b44565b6137e291906148be565b60405173ffffffffffffffffffffffffffffffffffffffff851660248201526044810182905290915061383b9085907f095ea7b300000000000000000000000000000000000000000000000000000000906064016124b2565b50505050565b60006138a3826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16613cd99092919063ffffffff16565b80519091501561245b57808060200190518101906138c19190614e6a565b61245b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016103ff565b60008273ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d80600081146139a7576040519150601f19603f3d011682016040523d82523d6000602084013e6139ac565b606091505b505090508061245b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f6661696c656420746f2073656e64206e6174697665000000000000000000000060448201526064016103ff565b600054610100900460ff16613aae576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016103ff565b610bc633612534565b600054610100900460ff16613b4e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016103ff565b603380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055565b600054610100900460ff16613c0f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016103ff565b6001609755565b60405173ffffffffffffffffffffffffffffffffffffffff8085166024830152831660448201526064810182905261383b9085907f23b872dd00000000000000000000000000000000000000000000000000000000906084016124b2565b6060604482511015613cb957505060408051808201909152601d81527f5472616e73616374696f6e2072657665727465642073696c656e746c79000000602082015290565b60048201915081806020019051810190613cd39190614e87565b92915050565b6060613ce88484600085613cf0565b949350505050565b606082471015613d82576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016103ff565b73ffffffffffffffffffffffffffffffffffffffff85163b613e00576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016103ff565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051613e299190614ef5565b60006040518083038185875af1925050503d8060008114613e66576040519150601f19603f3d011682016040523d82523d6000602084013e613e6b565b606091505b5091509150613e7b828286613e86565b979650505050505050565b60608315613e95575081612c34565b825115613ea55782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ff9190614e57565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040516101c0810167ffffffffffffffff81118282101715613f2c57613f2c613ed9565b60405290565b60405160a0810167ffffffffffffffff81118282101715613f2c57613f2c613ed9565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715613f9c57613f9c613ed9565b604052919050565b73ffffffffffffffffffffffffffffffffffffffff8116811461204d57600080fd5b803561299e81613fa4565b600060c08284031215613fe357600080fd5b60405160c0810181811067ffffffffffffffff8211171561400657614006613ed9565b604052905080823561401781613fa4565b8152602083013561402781613fa4565b8060208301525060408301356040820152606083013560608201526080830135608082015260a083013561405a81613fa4565b60a0919091015292915050565b60008083601f84011261407957600080fd5b50813567ffffffffffffffff81111561409157600080fd5b6020830191508360208260051b85010111156140ac57600080fd5b9250929050565b803567ffffffffffffffff8116811461299e57600080fd5b803563ffffffff8116811461299e57600080fd5b801515811461204d57600080fd5b803561299e816140df565b600082601f83011261410957600080fd5b8135602067ffffffffffffffff82111561412557614125613ed9565b8160051b614134828201613f55565b928352848101820192828101908785111561414e57600080fd5b83870192505b84831015613e7b57823561416781613fa4565b82529183019190830190614154565b600067ffffffffffffffff82111561419057614190613ed9565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b600082601f8301126141cd57600080fd5b81356141e06141db82614176565b613f55565b8181528460208386010111156141f557600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060008060008060006101a08a8c03121561423157600080fd5b61423b8b8b613fd1565b985060c08a013567ffffffffffffffff8082111561425857600080fd5b6142648d838e01614067565b909a50985060e08c0135915061427982613fa4565b8197506142896101008d016140b3565b96506142986101208d016140b3565b95506142a76101408d016140cb565b94506101608c013593506101808c01359150808211156142c657600080fd5b908b01906101c0828e0312156142db57600080fd5b6142e3613f08565b6142ec836140b3565b81526142fa602084016140ed565b602082015261430b60408401613fc6565b604082015261431c60608401613fc6565b606082015261432d60808401613fc6565b608082015260a083013560a082015260c08301358281111561434e57600080fd5b61435a8f8286016140f8565b60c08301525060e083013560e082015261437761010084016140ed565b61010082015261438a6101208401613fc6565b61012082015261439d6101408401613fc6565b610140820152610160830135828111156143b657600080fd5b6143c28f8286016141bc565b610160830152506143d66101808401613fc6565b6101808201526143e96101a08401613fc6565b6101a08201528093505050509295985092959850929598565b60006020828403121561441457600080fd5b8135612c3481613fa4565b6000806040838503121561443257600080fd5b823561443d81613fa4565b946020939093013593505050565b6020808252825182820181905260009190848201906040850190845b8181101561449957835173ffffffffffffffffffffffffffffffffffffffff1683529284019291840191600101614467565b50909695505050505050565b6000602082840312156144b757600080fd5b5035919050565b60008060008061010085870312156144d557600080fd5b6144df8686613fd1565b935060c085013567ffffffffffffffff8111156144fb57600080fd5b61450787828801614067565b90945092505060e085013561451b816140df565b939692955090935050565b60005b83811015614541578181015183820152602001614529565b8381111561383b5750506000910152565b6000815180845261456a816020860160208601614526565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561460f577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08886030184526145fd858351614552565b945092850192908501906001016145c3565b5092979650505050505050565b60008060008084860361018081121561463457600080fd5b61463e8787613fd1565b945060c086013567ffffffffffffffff81111561465a57600080fd5b61466688828901614067565b90955093505060a07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff208201121561469c57600080fd5b506146a5613f32565b60e0860135600381106146b757600080fd5b81526101008601356146c881613fa4565b60208201526101208601356146dc81613fa4565b60408201526101408601356146f081613fa4565b606082015261016095909501356080860152509194909350909190565b600080600080600080600080610160898b03121561472a57600080fd5b6147348a8a613fd1565b975060c089013567ffffffffffffffff8082111561475157600080fd5b61475d8c838d01614067565b909950975060e08b0135915061477282613fa4565b9095506101008a01359061478582613fa4565b9094506101208a0135908082111561479c57600080fd5b818b0191508b601f8301126147b057600080fd5b8135818111156147bf57600080fd5b8c60208285010111156147d157600080fd5b60208301955080945050505061014089013590509295985092959890939650565b6000806000806000806000610160888a03121561480e57600080fd5b6148188989613fd1565b965060c088013567ffffffffffffffff81111561483457600080fd5b6148408a828b01614067565b90975095505060e088013561485481613fa4565b935061486361010089016140b3565b925061487261012089016140b3565b915061488161014089016140cb565b905092959891949750929550565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082198211156148d1576148d161488f565b500190565b600081518084526020808501945080840160005b8381101561491c57815173ffffffffffffffffffffffffffffffffffffffff16875295820195908201906001016148ea565b509495945050505050565b600061010073ffffffffffffffffffffffffffffffffffffffff808c1684528a6020850152808a1660408501525067ffffffffffffffff808916606085015280881660808501525063ffffffff861660a08401528460c08401528060e084015261499d818401855167ffffffffffffffff169052565b60208401516101206149b28186018315159052565b604086015191506101406149dd8187018473ffffffffffffffffffffffffffffffffffffffff169052565b60608701519250610160614a088188018573ffffffffffffffffffffffffffffffffffffffff169052565b60808801519350610180614a338189018673ffffffffffffffffffffffffffffffffffffffff169052565b60a08901516101a08981019190915260c08a01516101c0808b01529550614a5e6102c08a01876148d6565b60e08b01516101e08b0152968a015115156102008a0152848a015173ffffffffffffffffffffffffffffffffffffffff9081166102208b0152848b0151166102408a0152828a01518988037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00016102608b0152969550614ade8688614552565b9650818a01519550614b096102808a018773ffffffffffffffffffffffffffffffffffffffff169052565b89015173ffffffffffffffffffffffffffffffffffffffff81166102a08a01529450614b359350505050565b509a9950505050505050505050565b600060208284031215614b5657600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60e0810160038910614bc7577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b97815273ffffffffffffffffffffffffffffffffffffffff968716602082015294861660408601526060850193909352908416608084015290921660a082015260c0015290565b600073ffffffffffffffffffffffffffffffffffffffff808a168352886020840152808816604084015280871660608401525060c060808301528360c0830152838560e0840137600060e0858401015260e07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f86011683010190508260a083015298975050505050505050565b600082821015614caf57614caf61488f565b500390565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc1833603018112614ce857600080fd5b9190910192915050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203614d2357614d2361488f565b5060010190565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615614d6257614d6261488f565b500290565b600082614d9d577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112614dd757600080fd5b83018035915067ffffffffffffffff821115614df257600080fd5b6020019150368190038213156140ac57600080fd5b8183823760009101908152919050565b73ffffffffffffffffffffffffffffffffffffffff841681528215156020820152606060408201526000614e4e6060830184614552565b95945050505050565b602081526000612c346020830184614552565b600060208284031215614e7c57600080fd5b8151612c34816140df565b600060208284031215614e9957600080fd5b815167ffffffffffffffff811115614eb057600080fd5b8201601f81018413614ec157600080fd5b8051614ecf6141db82614176565b818152856020838501011115614ee457600080fd5b614e4e826020830160208601614526565b60008251614ce881846020870161452656fea2646970667358221220d7ef24b907a20ce976254f4990d37ead54c26409b692ce676cd3fbc0976e603664736f6c634300080d0033

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

Txn 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.