ETH Price: $2,696.96 (-0.31%)

Contract

0x0D710512E100C171139D2Cf5708f22C680eccF52

Overview

ETH Balance

0 ETH

ETH Value

$0.00
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

Parent Transaction Hash Block From To
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
LayerZeroBridgeToken

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 1000000 runs

Other Settings:
default evmVersion, MIT license
File 1 of 24 : LayerZeroBridgeToken.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.12;

import "./utils/OFTCore.sol";
import "../../interfaces/IAgTokenSideChainMultiBridge.sol";
import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";

/// @title LayerZeroBridgeToken
/// @author Angle Labs, Inc., forked from https://github.com/LayerZero-Labs/solidity-examples/blob/main/contracts/token/oft/OFT.sol
/// @notice Contract to be deployed on a L2/sidechain for bridging an AgToken using a bridge intermediate token and LayerZero
contract LayerZeroBridgeToken is OFTCore, ERC20Upgradeable, PausableUpgradeable {
    /// @notice Address of the bridgeable token
    /// @dev Immutable
    IAgTokenSideChainMultiBridge public canonicalToken;

    // =============================== Errors ================================

    error InvalidAllowance();

    // ============================= Constructor ===================================

    /// @notice Initializes the contract
    /// @param _name Name of the token corresponding to this contract
    /// @param _symbol Symbol of the token corresponding to this contract
    /// @param _lzEndpoint Layer zero endpoint to pass messages
    /// @param _treasury Address of the treasury contract used for access control
    /// @param initialSupply Initial supply to mint to the canonical token address
    /// @dev The initial supply corresponds to the initial amount that could be bridged using this OFT
    function initialize(
        string memory _name,
        string memory _symbol,
        address _lzEndpoint,
        address _treasury,
        uint256 initialSupply
    ) external initializer {
        __ERC20_init_unchained(_name, _symbol);
        __LzAppUpgradeable_init(_lzEndpoint, _treasury);

        canonicalToken = IAgTokenSideChainMultiBridge(address(ITreasury(_treasury).stablecoin()));
        _approve(address(this), address(canonicalToken), type(uint256).max);
        _mint(address(canonicalToken), initialSupply);
    }

    /// @custom:oz-upgrades-unsafe-allow constructor
    constructor() initializer {}

    // ==================== External Permissionless Functions ======================

    /// @inheritdoc OFTCore
    function sendWithPermit(
        uint16 _dstChainId,
        bytes memory _toAddress,
        uint256 _amount,
        address payable _refundAddress,
        address _zroPaymentAddress,
        bytes memory _adapterParams,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) public payable override {
        canonicalToken.permit(msg.sender, address(this), _amount, deadline, v, r, s);
        send(_dstChainId, _toAddress, _amount, _refundAddress, _zroPaymentAddress, _adapterParams);
    }

    /// @inheritdoc OFTCore
    function withdraw(uint256 amount, address recipient) external override returns (uint256 amountMinted) {
        // Does not check allowances as transfers from `msg.sender`
        _transfer(msg.sender, address(this), amount);
        amountMinted = canonicalToken.swapIn(address(this), amount, recipient);
        uint256 leftover = balanceOf(address(this));
        if (leftover != 0) {
            _transfer(address(this), msg.sender, leftover);
        }
    }

    // ============================= Internal Functions ===================================

    /// @inheritdoc OFTCore
    function _debitFrom(
        uint16,
        bytes memory,
        uint256 _amount
    ) internal override whenNotPaused returns (uint256 amountSwapped) {
        // No need to use safeTransferFrom as we know this implementation reverts on failure
        canonicalToken.transferFrom(msg.sender, address(this), _amount);

        // Swap canonical for this bridge token. There may be some fees
        amountSwapped = canonicalToken.swapOut(address(this), _amount, address(this));
        _burn(address(this), amountSwapped);
    }

    /// @inheritdoc OFTCore
    function _debitCreditFrom(
        uint16,
        bytes memory,
        uint256 _amount
    ) internal override whenNotPaused returns (uint256) {
        _burn(msg.sender, _amount);
        return _amount;
    }

    /// @inheritdoc OFTCore
    function _creditTo(
        uint16,
        address _toAddress,
        uint256 _amount
    ) internal override whenNotPaused returns (uint256 amountMinted) {
        _mint(address(this), _amount);
        amountMinted = canonicalToken.swapIn(address(this), _amount, _toAddress);
        uint256 leftover = balanceOf(address(this));
        if (leftover != 0) {
            _transfer(address(this), _toAddress, leftover);
        }
    }

    // ======================= View Functions ================================

    /// @inheritdoc ERC165Upgradeable
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return
            interfaceId == type(IOFT).interfaceId ||
            interfaceId == type(IERC20).interfaceId ||
            super.supportsInterface(interfaceId);
    }

    // ======================= Governance Functions ================================

    /// @notice Mints the intermediate contract to the `canonicalToken`
    /// @dev Used to increase the bridging capacity
    function mint(uint256 amount) external onlyGovernorOrGuardian {
        _mint(address(canonicalToken), amount);
    }

    /// @notice Burns the intermediate contract from the `canonicalToken`
    /// @dev Used to decrease the bridging capacity
    function burn(uint256 amount) external onlyGovernorOrGuardian {
        _burn(address(canonicalToken), amount);
    }

    /// @notice Increases allowance of the `canonicalToken`
    function setupAllowance() public onlyGovernorOrGuardian {
        _approve(address(this), address(canonicalToken), type(uint256).max);
    }

    /// @notice Pauses bridging through the contract
    /// @param pause Future pause status
    function pauseSendTokens(bool pause) external onlyGovernorOrGuardian {
        pause ? _pause() : _unpause();
    }

    uint256[49] private __gap;
}

File 2 of 24 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.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 = !_initializing;
        require(
            (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
            "Initializable: contract is already initialized"
        );
        _initialized = 1;
        if (isTopLevelCall) {
            _initializing = true;
        }
        _;
        if (isTopLevelCall) {
            _initializing = false;
            emit Initialized(1);
        }
    }

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * `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) {
        require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
        _initialized = version;
        _initializing = true;
        _;
        _initializing = false;
        emit Initialized(version);
    }

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

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

File 3 of 24 : PausableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (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 Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        _requireNotPaused();
        _;
    }

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

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

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

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

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

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

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

File 4 of 24 : ERC20Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/ERC20.sol)

pragma solidity ^0.8.0;

import "./IERC20Upgradeable.sol";
import "./extensions/IERC20MetadataUpgradeable.sol";
import "../../utils/ContextUpgradeable.sol";
import "../../proxy/utils/Initializable.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin Contracts guidelines: functions revert
 * instead returning `false` on failure. This behavior is nonetheless
 * conventional and does not conflict with the expectations of ERC20
 * applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {
    mapping(address => uint256) private _balances;

    mapping(address => mapping(address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * The default value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    function __ERC20_init(string memory name_, string memory symbol_) internal onlyInitializing {
        __ERC20_init_unchained(name_, symbol_);
    }

    function __ERC20_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5.05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the value {ERC20} uses, unless this function is
     * overridden;
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual override returns (uint8) {
        return 18;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address to, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _transfer(owner, to, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
     * `transferFrom`. This is semantically equivalent to an infinite approval.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * NOTE: Does not update the allowance if the current allowance
     * is the maximum `uint256`.
     *
     * Requirements:
     *
     * - `from` and `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     * - the caller must have allowance for ``from``'s tokens of at least
     * `amount`.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) public virtual override returns (bool) {
        address spender = _msgSender();
        _spendAllowance(from, spender, amount);
        _transfer(from, to, amount);
        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, allowance(owner, spender) + addedValue);
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        address owner = _msgSender();
        uint256 currentAllowance = allowance(owner, spender);
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(owner, spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    /**
     * @dev Moves `amount` of tokens from `from` to `to`.
     *
     * This internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     */
    function _transfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {
        require(from != address(0), "ERC20: transfer from the zero address");
        require(to != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(from, to, amount);

        uint256 fromBalance = _balances[from];
        require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[from] = fromBalance - amount;
        }
        _balances[to] += amount;

        emit Transfer(from, to, amount);

        _afterTokenTransfer(from, to, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply += amount;
        _balances[account] += amount;
        emit Transfer(address(0), account, amount);

        _afterTokenTransfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
        unchecked {
            _balances[account] = accountBalance - amount;
        }
        _totalSupply -= amount;

        emit Transfer(account, address(0), amount);

        _afterTokenTransfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @dev Updates `owner` s allowance for `spender` based on spent `amount`.
     *
     * Does not update the allowance amount in case of infinite allowance.
     * Revert if not enough allowance is available.
     *
     * Might emit an {Approval} event.
     */
    function _spendAllowance(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        uint256 currentAllowance = allowance(owner, spender);
        if (currentAllowance != type(uint256).max) {
            require(currentAllowance >= amount, "ERC20: insufficient allowance");
            unchecked {
                _approve(owner, spender, currentAllowance - amount);
            }
        }
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * has been transferred to `to`.
     * - when `from` is zero, `amount` tokens have been minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens have been burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}

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

File 5 of 24 : 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 6 of 24 : IERC20MetadataUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC20Upgradeable.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20MetadataUpgradeable is IERC20Upgradeable {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the symbol of the token.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

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

pragma solidity ^0.8.0;

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

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

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

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

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library 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
                /// @solidity memory-safe-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 9 of 24 : 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 24 : ERC165Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.sol";

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

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

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

File 11 of 24 : IERC165Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

File 14 of 24 : IOFTCore.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.12;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/utils/introspection/IERC165.sol";

/**
 * @dev Interface of the IOFT core standard
 * @dev Forked from https://github.com/LayerZero-Labs/solidity-examples/blob/main/contracts/token/oft/IOFTCore.sol
 */
interface IOFTCore is IERC165 {
    /// @notice Estimates send token `_tokenId` to (`_dstChainId`, `_toAddress`)
    /// @param _dstChainId L0 defined chain id to send tokens too
    /// @param _toAddress dynamic bytes array which contains the address to whom you are sending tokens to on the dstChain
    /// @param _amount amount of the tokens to transfer
    /// @param _useZro indicates to use zro to pay L0 fees
    /// @param _adapterParams flexible bytes array to indicate messaging adapter services in L0
    function estimateSendFee(
        uint16 _dstChainId,
        bytes calldata _toAddress,
        uint256 _amount,
        bool _useZro,
        bytes calldata _adapterParams
    ) external view returns (uint256 nativeFee, uint256 zroFee);

    /// @notice Sends `_amount` amount of token to (`_dstChainId`, `_toAddress`)
    /// @param _dstChainId the destination chain identifier
    /// @param _toAddress can be any size depending on the `dstChainId`.
    /// @param _amount the quantity of tokens in wei
    /// @param _refundAddress the address LayerZero refunds if too much message fee is sent
    /// @param _zroPaymentAddress set to address(0x0) if not paying in ZRO (LayerZero Token)
    /// @param _adapterParams is a flexible bytes array to indicate messaging adapter services
    function send(
        uint16 _dstChainId,
        bytes calldata _toAddress,
        uint256 _amount,
        address payable _refundAddress,
        address _zroPaymentAddress,
        bytes calldata _adapterParams
    ) external payable;

    /// @notice Sends `_amount` amount of credit to (`_dstChainId`, `_toAddress`)
    /// @param _dstChainId the destination chain identifier
    /// @param _toAddress can be any size depending on the `dstChainId`.
    /// @param _amount the quantity of credit to send in wei
    /// @param _refundAddress the address LayerZero refunds if too much message fee is sent
    /// @param _zroPaymentAddress set to address(0x0) if not paying in ZRO (LayerZero Token)
    /// @param _adapterParams is a flexible bytes array to indicate messaging adapter services
    function sendCredit(
        uint16 _dstChainId,
        bytes calldata _toAddress,
        uint256 _amount,
        address payable _refundAddress,
        address _zroPaymentAddress,
        bytes calldata _adapterParams
    ) external payable;

    /// @notice Sends `_amount` amount of token to (`_dstChainId`, `_toAddress`)
    /// @param _dstChainId The destination chain identifier
    /// @param _toAddress Can be any size depending on the `dstChainId`.
    /// @param _amount Quantity of tokens in wei
    /// @param _refundAddress Address LayerZero refunds if too much message fee is sent
    /// @param _zroPaymentAddress Set to address(0x0) if not paying in ZRO (LayerZero Token)
    /// @param _adapterParams Flexible bytes array to indicate messaging adapter services
    /// @param deadline Deadline parameter for the signature to be valid
    /// @dev The `v`, `r`, and `s` parameters are used as signature data
    function sendWithPermit(
        uint16 _dstChainId,
        bytes memory _toAddress,
        uint256 _amount,
        address payable _refundAddress,
        address _zroPaymentAddress,
        bytes memory _adapterParams,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external payable;

    /// @notice Withdraws amount of canonical token from the `msg.sender` balance and sends it to the recipient
    /// @param amount Amount to withdraw
    /// @param recipient Address to send the canonical token to
    /// @return The amount of canonical token sent
    function withdraw(uint256 amount, address recipient) external returns (uint256);

    /// @dev Emitted when `_amount` tokens are moved from the `_sender` to (`_dstChainId`, `_toAddress`)
    /// `_nonce` is the outbound nonce
    event SendToChain(
        address indexed _sender,
        uint16 indexed _dstChainId,
        bytes indexed _toAddress,
        uint256 _amount,
        uint64 _nonce
    );

    /// @dev Emitted when `_amount` tokens are received from `_srcChainId` into the `_toAddress` on the local chain.
    /// `_nonce` is the inbound nonce.
    event ReceiveFromChain(
        uint16 indexed _srcChainId,
        bytes indexed _srcAddress,
        address indexed _toAddress,
        uint256 _amount,
        uint64 _nonce
    );
}

/// @dev Interface of the OFT standard
interface IOFT is IOFTCore, IERC20 {

}

File 15 of 24 : NonblockingLzApp.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.12;

import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "../../../interfaces/external/layerZero/ILayerZeroReceiver.sol";
import "../../../interfaces/external/layerZero/ILayerZeroUserApplicationConfig.sol";
import "../../../interfaces/external/layerZero/ILayerZeroEndpoint.sol";
import "../../../interfaces/ITreasury.sol";

/// @title NonblockingLzApp
/// @author Angle Labs, Inc., forked from https://github.com/LayerZero-Labs/solidity-examples/
/// @notice Base contract for bridging using LayerZero
abstract contract NonblockingLzApp is Initializable, ILayerZeroReceiver, ILayerZeroUserApplicationConfig {
    /// @notice Layer Zero endpoint
    ILayerZeroEndpoint public lzEndpoint;

    /// @notice Maps chainIds to failed messages to retry them
    mapping(uint16 => mapping(bytes => mapping(uint64 => bytes32))) public failedMessages;

    /// @notice Maps chainIds to their OFT address
    mapping(uint16 => bytes) public trustedRemoteLookup;

    /// @notice Reference to the treasury contract to fetch access control
    address public treasury;

    /// @notice Maps pairs of (`to` chain, `packetType`) to the minimum amount of gas needed on the destination chain
    mapping(uint16 => mapping(uint16 => uint256)) public minDstGasLookup;

    /// @notice For future LayerZero compatibility
    address public precrime;

    // ================================== Events ===================================

    event SetTrustedRemote(uint16 _srcChainId, bytes _srcAddress);
    event MessageFailed(uint16 _srcChainId, bytes _srcAddress, uint64 _nonce, bytes _payload);

    // =============================== Errors ================================

    error NotGovernor();
    error NotGovernorOrGuardian();
    error InsufficientGas();
    error InvalidEndpoint();
    error InvalidSource();
    error InvalidCaller();
    error InvalidParams();
    error InvalidPayload();
    error ZeroAddress();

    // ============================= Constructor ===================================

    //solhint-disable-next-line
    function __LzAppUpgradeable_init(address _endpoint, address _treasury) internal {
        if (_endpoint == address(0) || _treasury == address(0)) revert ZeroAddress();
        lzEndpoint = ILayerZeroEndpoint(_endpoint);
        treasury = _treasury;
    }

    // =============================== Modifiers ===================================

    /// @notice Checks whether the `msg.sender` has the governor role or the guardian role
    modifier onlyGovernorOrGuardian() {
        if (!ITreasury(treasury).isGovernorOrGuardian(msg.sender)) revert NotGovernorOrGuardian();
        _;
    }

    // ==================== External Permissionless Functions ======================

    /// @notice Receives a message from the LZ endpoint and process it
    /// @param _srcChainId ChainId of the source chain - LayerZero standard
    /// @param _srcAddress Sender of the source chain
    /// @param _nonce Nounce of the message
    /// @param _payload Data: recipient address and amount
    function lzReceive(
        uint16 _srcChainId,
        bytes memory _srcAddress,
        uint64 _nonce,
        bytes memory _payload
    ) public virtual override {
        // lzReceive must be called by the endpoint for security
        if (msg.sender != address(lzEndpoint)) revert InvalidEndpoint();

        bytes memory trustedRemote = trustedRemoteLookup[_srcChainId];
        // if will still block the message pathway from (srcChainId, srcAddress). should not receive message from untrusted remote.
        if (_srcAddress.length != trustedRemote.length || keccak256(_srcAddress) != keccak256(trustedRemote))
            revert InvalidSource();

        _blockingLzReceive(_srcChainId, _srcAddress, _nonce, _payload);
    }

    /// @notice Retries a message that previously failed and was stored
    /// @param _srcChainId ChainId of the source chain - LayerZero standard
    /// @param _srcAddress Sender of the source chain
    /// @param _nonce Nounce of the message
    /// @param _payload Data: recipient address and amount
    function retryMessage(
        uint16 _srcChainId,
        bytes memory _srcAddress,
        uint64 _nonce,
        bytes memory _payload
    ) public payable virtual {
        // assert there is message to retry
        bytes32 payloadHash = failedMessages[_srcChainId][_srcAddress][_nonce];
        if (payloadHash == bytes32(0) || keccak256(_payload) != payloadHash) revert InvalidPayload();
        // clear the stored message
        failedMessages[_srcChainId][_srcAddress][_nonce] = bytes32(0);
        // execute the message. revert if it fails again
        _nonblockingLzReceive(_srcChainId, _srcAddress, _nonce, _payload);
    }

    // ============================= Internal Functions ===================================

    /// @notice Handles message receptions in a non blocking way
    /// @param _srcChainId ChainId of the source chain - LayerZero standard
    /// @param _srcAddress Sender of the source chain
    /// @param _nonce Nounce of the message
    /// @param _payload Data: recipient address and amount
    /// @dev public for the needs of try / catch but effectively internal
    function nonblockingLzReceive(
        uint16 _srcChainId,
        bytes memory _srcAddress,
        uint64 _nonce,
        bytes memory _payload
    ) public virtual {
        // only internal transaction
        if (msg.sender != address(this)) revert InvalidCaller();
        _nonblockingLzReceive(_srcChainId, _srcAddress, _nonce, _payload);
    }

    /// @notice Handles message receptions in a non blocking way
    /// @param _srcChainId ChainId of the source chain - LayerZero standard
    /// @param _srcAddress Sender of the source chain
    /// @param _nonce Nounce of the message
    /// @param _payload Data: recipient address and amount
    function _nonblockingLzReceive(
        uint16 _srcChainId,
        bytes memory _srcAddress,
        uint64 _nonce,
        bytes memory _payload
    ) internal virtual;

    /// @notice Handles message receptions in a blocking way
    /// @param _srcChainId ChainId of the source chain - LayerZero standard
    /// @param _srcAddress Sender of the source chain
    /// @param _nonce Nounce of the message
    /// @param _payload Data: recipient address and amount
    function _blockingLzReceive(
        uint16 _srcChainId,
        bytes memory _srcAddress,
        uint64 _nonce,
        bytes memory _payload
    ) internal {
        // try-catch all errors/exceptions
        try this.nonblockingLzReceive(_srcChainId, _srcAddress, _nonce, _payload) {
            // do nothing
        } catch {
            // error / exception
            failedMessages[_srcChainId][_srcAddress][_nonce] = keccak256(_payload);
            emit MessageFailed(_srcChainId, _srcAddress, _nonce, _payload);
        }
    }

    /// @notice Sends a message to the LZ endpoint and process it
    /// @param _dstChainId L0 defined chain id to send tokens too
    /// @param _payload Data: recipient address and amount
    /// @param _refundAddress Address LayerZero refunds if too much message fee is sent
    /// @param _zroPaymentAddress Set to address(0x0) if not paying in ZRO (LayerZero Token)
    /// @param _adapterParams Flexible bytes array to indicate messaging adapter services in L0
    function _lzSend(
        uint16 _dstChainId,
        bytes memory _payload,
        address payable _refundAddress,
        address _zroPaymentAddress,
        bytes memory _adapterParams
    ) internal virtual {
        bytes memory trustedRemote = trustedRemoteLookup[_dstChainId];
        if (trustedRemote.length == 0) revert InvalidSource();
        //solhint-disable-next-line
        lzEndpoint.send{ value: msg.value }(
            _dstChainId,
            trustedRemote,
            _payload,
            _refundAddress,
            _zroPaymentAddress,
            _adapterParams
        );
    }

    /// @notice Checks the gas limit of a given transaction
    function _checkGasLimit(
        uint16 _dstChainId,
        uint16 _type,
        bytes memory _adapterParams,
        uint256 _extraGas
    ) internal view virtual {
        uint256 minGasLimit = minDstGasLookup[_dstChainId][_type] + _extraGas;
        if (minGasLimit == 0 || minGasLimit > _getGasLimit(_adapterParams)) revert InsufficientGas();
    }

    /// @notice Gets the gas limit from the `_adapterParams` parameter
    function _getGasLimit(bytes memory _adapterParams) internal pure virtual returns (uint256 gasLimit) {
        if (_adapterParams.length < 34) revert InvalidParams();
        // solhint-disable-next-line
        assembly {
            gasLimit := mload(add(_adapterParams, 34))
        }
    }

    // ======================= Governance Functions ================================

    /// @notice Sets the corresponding address on an other chain.
    /// @param _srcChainId ChainId of the source chain - LayerZero standard
    /// @param _srcAddress Address on the source chain
    /// @dev Used for both receiving and sending message
    /// @dev There can only be one trusted source per chain
    /// @dev Allows owner to set it multiple times.
    function setTrustedRemote(uint16 _srcChainId, bytes calldata _srcAddress) external onlyGovernorOrGuardian {
        trustedRemoteLookup[_srcChainId] = _srcAddress;
        emit SetTrustedRemote(_srcChainId, _srcAddress);
    }

    /// @notice Fetches the default LZ config
    function getConfig(
        uint16 _version,
        uint16 _chainId,
        address,
        uint256 _configType
    ) external view returns (bytes memory) {
        return lzEndpoint.getConfig(_version, _chainId, address(this), _configType);
    }

    /// @notice Overrides the default LZ config
    function setConfig(
        uint16 _version,
        uint16 _chainId,
        uint256 _configType,
        bytes calldata _config
    ) external override onlyGovernorOrGuardian {
        lzEndpoint.setConfig(_version, _chainId, _configType, _config);
    }

    /// @notice Overrides the default LZ config
    function setSendVersion(uint16 _version) external override onlyGovernorOrGuardian {
        lzEndpoint.setSendVersion(_version);
    }

    /// @notice Overrides the default LZ config
    function setReceiveVersion(uint16 _version) external override onlyGovernorOrGuardian {
        lzEndpoint.setReceiveVersion(_version);
    }

    /// @notice Unpauses the receive functionalities
    function forceResumeReceive(
        uint16 _srcChainId,
        bytes calldata _srcAddress
    ) external override onlyGovernorOrGuardian {
        lzEndpoint.forceResumeReceive(_srcChainId, _srcAddress);
    }

    /// @notice Sets the minimum gas parameter for a packet type on a given chain
    function setMinDstGas(uint16 _dstChainId, uint16 _packetType, uint256 _minGas) external onlyGovernorOrGuardian {
        if (_minGas == 0) revert InvalidParams();
        minDstGasLookup[_dstChainId][_packetType] = _minGas;
    }

    /// @notice Sets the precrime variable
    function setPrecrime(address _precrime) external onlyGovernorOrGuardian {
        precrime = _precrime;
    }

    // ======================= View Functions ================================

    /// @notice Checks if the `_srcAddress` corresponds to the trusted source
    function isTrustedRemote(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (bool) {
        bytes memory trustedSource = trustedRemoteLookup[_srcChainId];
        return keccak256(trustedSource) == keccak256(_srcAddress);
    }

    uint256[44] private __gap;
}

File 16 of 24 : OFTCore.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.12;

import "./NonblockingLzApp.sol";
import "./IOFTCore.sol";
import "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol";

/// @title OFTCore
/// @author Forked from https://github.com/LayerZero-Labs/solidity-examples/blob/main/contracts/token/oft/OFTCore.sol
/// but with slight modifications from the Angle Labs, Inc. which added return values to the `_creditTo` and `_debitFrom` functions
/// @notice Base contract for bridging using LayerZero
abstract contract OFTCore is NonblockingLzApp, ERC165Upgradeable, IOFTCore {
    /// @notice Amount of additional gas specified
    uint256 public constant EXTRA_GAS = 200000;
    /// @notice Packet type for token transfer
    uint16 public constant PT_SEND = 0;

    /// @notice Whether to use custom parameters in transactions
    uint8 public useCustomAdapterParams;

    // ==================== External Permissionless Functions ======================

    /// @inheritdoc IOFTCore
    function sendWithPermit(
        uint16 _dstChainId,
        bytes memory _toAddress,
        uint256 _amount,
        address payable _refundAddress,
        address _zroPaymentAddress,
        bytes memory _adapterParams,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) public payable virtual;

    /// @inheritdoc IOFTCore
    function send(
        uint16 _dstChainId,
        bytes memory _toAddress,
        uint256 _amount,
        address payable _refundAddress,
        address _zroPaymentAddress,
        bytes memory _adapterParams
    ) public payable virtual {
        _checkAdapterParams(_dstChainId, PT_SEND, _adapterParams, EXTRA_GAS);
        _amount = _debitFrom(_dstChainId, _toAddress, _amount);

        bytes memory payload = abi.encode(_toAddress, _amount);
        _lzSend(_dstChainId, payload, _refundAddress, _zroPaymentAddress, _adapterParams);

        uint64 nonce = lzEndpoint.getOutboundNonce(_dstChainId, address(this));
        emit SendToChain(msg.sender, _dstChainId, _toAddress, _amount, nonce);
    }

    /// @inheritdoc IOFTCore
    function sendCredit(
        uint16 _dstChainId,
        bytes memory _toAddress,
        uint256 _amount,
        address payable _refundAddress,
        address _zroPaymentAddress,
        bytes memory _adapterParams
    ) public payable virtual {
        _checkAdapterParams(_dstChainId, PT_SEND, _adapterParams, EXTRA_GAS);
        _amount = _debitCreditFrom(_dstChainId, _toAddress, _amount);

        _send(_dstChainId, _toAddress, _amount, _refundAddress, _zroPaymentAddress, _adapterParams);
    }

    /// @inheritdoc IOFTCore
    function withdraw(uint256 amount, address recipient) external virtual returns (uint256);

    /// @notice Sets whether custom adapter parameters can be used or not
    function setUseCustomAdapterParams(uint8 _useCustomAdapterParams) public virtual onlyGovernorOrGuardian {
        useCustomAdapterParams = _useCustomAdapterParams;
    }

    // =========================== Internal Functions ==============================

    /// @notice Internal function to send `_amount` amount of token to (`_dstChainId`, `_toAddress`)
    /// @param _dstChainId the destination chain identifier
    /// @param _toAddress can be any size depending on the `dstChainId`.
    /// @param _amount the quantity of tokens in wei
    /// @param _refundAddress the address LayerZero refunds if too much message fee is sent
    /// @param _zroPaymentAddress set to address(0x0) if not paying in ZRO (LayerZero Token)
    /// @param _adapterParams is a flexible bytes array to indicate messaging adapter services
    /// @dev Accounting and checks should be performed beforehand
    function _send(
        uint16 _dstChainId,
        bytes memory _toAddress,
        uint256 _amount,
        address payable _refundAddress,
        address _zroPaymentAddress,
        bytes memory _adapterParams
    ) internal {
        bytes memory payload = abi.encode(_toAddress, _amount);
        _lzSend(_dstChainId, payload, _refundAddress, _zroPaymentAddress, _adapterParams);

        uint64 nonce = lzEndpoint.getOutboundNonce(_dstChainId, address(this));
        emit SendToChain(msg.sender, _dstChainId, _toAddress, _amount, nonce);
    }

    /// @inheritdoc NonblockingLzApp
    function _nonblockingLzReceive(
        uint16 _srcChainId,
        bytes memory _srcAddress,
        uint64 _nonce,
        bytes memory _payload
    ) internal virtual override {
        // decode and load the toAddress
        (bytes memory toAddressBytes, uint256 amount) = abi.decode(_payload, (bytes, uint256));
        address toAddress;
        //solhint-disable-next-line
        assembly {
            toAddress := mload(add(toAddressBytes, 20))
        }
        amount = _creditTo(_srcChainId, toAddress, amount);

        emit ReceiveFromChain(_srcChainId, _srcAddress, toAddress, amount, _nonce);
    }

    /// @notice Checks the adapter parameters given during the smart contract call
    function _checkAdapterParams(
        uint16 _dstChainId,
        uint16 _pkType,
        bytes memory _adapterParams,
        uint256 _extraGas
    ) internal virtual {
        if (useCustomAdapterParams > 0) _checkGasLimit(_dstChainId, _pkType, _adapterParams, _extraGas);
        else if (_adapterParams.length != 0) revert InvalidParams();
    }

    /// @notice Makes accountability when bridging from this contract using canonical token
    /// @param _dstChainId ChainId of the destination chain - LayerZero standard
    /// @param _toAddress Recipient on the destination chain
    /// @param _amount Amount to bridge
    function _debitFrom(
        uint16 _dstChainId,
        bytes memory _toAddress,
        uint256 _amount
    ) internal virtual returns (uint256);

    /// @notice Makes accountability when bridging from this contract's credit
    /// @param _dstChainId ChainId of the destination chain - LayerZero standard
    /// @param _toAddress Recipient on the destination chain
    /// @param _amount Amount to bridge
    function _debitCreditFrom(
        uint16 _dstChainId,
        bytes memory _toAddress,
        uint256 _amount
    ) internal virtual returns (uint256);

    /// @notice Makes accountability when bridging to this contract
    /// @param _srcChainId ChainId of the source chain - LayerZero standard
    /// @param _toAddress Recipient on this chain
    /// @param _amount Amount to bridge
    function _creditTo(uint16 _srcChainId, address _toAddress, uint256 _amount) internal virtual returns (uint256);

    // ========================== View Functions ===================================

    /// @inheritdoc ERC165Upgradeable
    function supportsInterface(
        bytes4 interfaceId
    ) public view virtual override(ERC165Upgradeable, IERC165) returns (bool) {
        return interfaceId == type(IOFTCore).interfaceId || super.supportsInterface(interfaceId);
    }

    /// @inheritdoc IOFTCore
    function estimateSendFee(
        uint16 _dstChainId,
        bytes memory _toAddress,
        uint256 _amount,
        bool _useZro,
        bytes memory _adapterParams
    ) public view virtual override returns (uint256 nativeFee, uint256 zroFee) {
        // mock the payload for send()
        bytes memory payload = abi.encode(_toAddress, _amount);
        return lzEndpoint.estimateFees(_dstChainId, address(this), payload, _useZro, _adapterParams);
    }

    uint256[49] private __gap;
}

File 17 of 24 : IAgToken.sol
// SPDX-License-Identifier: GPL-3.0

pragma solidity ^0.8.12;

import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";

/// @title IAgToken
/// @author Angle Labs, Inc.
/// @notice Interface for the stablecoins `AgToken` contracts
/// @dev This interface only contains functions of the `AgToken` contract which are called by other contracts
/// of this module or of the first module of the Angle Protocol
interface IAgToken is IERC20Upgradeable {
    // ======================= Minter Role Only Functions ===========================

    /// @notice Lets the `StableMaster` contract or another whitelisted contract mint agTokens
    /// @param account Address to mint to
    /// @param amount Amount to mint
    /// @dev The contracts allowed to issue agTokens are the `StableMaster` contract, `VaultManager` contracts
    /// associated to this stablecoin as well as the flash loan module (if activated) and potentially contracts
    /// whitelisted by governance
    function mint(address account, uint256 amount) external;

    /// @notice Burns `amount` tokens from a `burner` address after being asked to by `sender`
    /// @param amount Amount of tokens to burn
    /// @param burner Address to burn from
    /// @param sender Address which requested the burn from `burner`
    /// @dev This method is to be called by a contract with the minter right after being requested
    /// to do so by a `sender` address willing to burn tokens from another `burner` address
    /// @dev The method checks the allowance between the `sender` and the `burner`
    function burnFrom(
        uint256 amount,
        address burner,
        address sender
    ) external;

    /// @notice Burns `amount` tokens from a `burner` address
    /// @param amount Amount of tokens to burn
    /// @param burner Address to burn from
    /// @dev This method is to be called by a contract with a minter right on the AgToken after being
    /// requested to do so by an address willing to burn tokens from its address
    function burnSelf(uint256 amount, address burner) external;

    // ========================= Treasury Only Functions ===========================

    /// @notice Adds a minter in the contract
    /// @param minter Minter address to add
    /// @dev Zero address checks are performed directly in the `Treasury` contract
    function addMinter(address minter) external;

    /// @notice Removes a minter from the contract
    /// @param minter Minter address to remove
    /// @dev This function can also be called by a minter wishing to revoke itself
    function removeMinter(address minter) external;

    /// @notice Sets a new treasury contract
    /// @param _treasury New treasury address
    function setTreasury(address _treasury) external;

    // ========================= External functions ================================

    /// @notice Checks whether an address has the right to mint agTokens
    /// @param minter Address for which the minting right should be checked
    /// @return Whether the address has the right to mint agTokens or not
    function isMinter(address minter) external view returns (bool);

    /// @notice Get the associated treasury
    function treasury() external view returns (address);
}

File 18 of 24 : IAgTokenSideChainMultiBridge.sol
// SPDX-License-Identifier: GPL-3.0

pragma solidity ^0.8.12;

import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-IERC20PermitUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";

/// @title IAgTokenSideChainMultiBridge
/// @author Angle Labs, Inc.
/// @notice Interface for the canonical `AgToken` contracts
/// @dev This interface only contains functions useful for bridge tokens to interact with the canonical token
interface IAgTokenSideChainMultiBridge is IERC20PermitUpgradeable, IERC20Upgradeable {
    /// @notice Mints the canonical token from a supported bridge token
    /// @param bridgeToken Bridge token to use to mint
    /// @param amount Amount of bridge tokens to send
    /// @param to Address to which the stablecoin should be sent
    /// @return Amount of the canonical stablecoin actually minted
    /// @dev Some fees may be taken by the protocol depending on the token used and on the address calling
    function swapIn(
        address bridgeToken,
        uint256 amount,
        address to
    ) external returns (uint256);

    /// @notice Burns the canonical token in exchange for a bridge token
    /// @param bridgeToken Bridge token required
    /// @param amount Amount of canonical tokens to burn
    /// @param to Address to which the bridge token should be sent
    /// @return Amount of bridge tokens actually sent back
    /// @dev Some fees may be taken by the protocol depending on the token used and on the address calling
    function swapOut(
        address bridgeToken,
        uint256 amount,
        address to
    ) external returns (uint256);
}

File 19 of 24 : ICoreBorrow.sol
// SPDX-License-Identifier: GPL-3.0

pragma solidity ^0.8.12;

/// @title ICoreBorrow
/// @author Angle Labs, Inc.
/// @notice Interface for the `CoreBorrow` contract
/// @dev This interface only contains functions of the `CoreBorrow` contract which are called by other contracts
/// of this module
interface ICoreBorrow {
    /// @notice Checks if an address corresponds to a treasury of a stablecoin with a flash loan
    /// module initialized on it
    /// @param treasury Address to check
    /// @return Whether the address has the `FLASHLOANER_TREASURY_ROLE` or not
    function isFlashLoanerTreasury(address treasury) external view returns (bool);

    /// @notice Checks whether an address is governor of the Angle Protocol or not
    /// @param admin Address to check
    /// @return Whether the address has the `GOVERNOR_ROLE` or not
    function isGovernor(address admin) external view returns (bool);

    /// @notice Checks whether an address is governor or a guardian of the Angle Protocol or not
    /// @param admin Address to check
    /// @return Whether the address has the `GUARDIAN_ROLE` or not
    /// @dev Governance should make sure when adding a governor to also give this governor the guardian
    /// role by calling the `addGovernor` function
    function isGovernorOrGuardian(address admin) external view returns (bool);
}

File 20 of 24 : IFlashAngle.sol
// SPDX-License-Identifier: GPL-3.0

pragma solidity ^0.8.12;

import "./IAgToken.sol";
import "./ICoreBorrow.sol";

/// @title IFlashAngle
/// @author Angle Labs, Inc.
/// @notice Interface for the `FlashAngle` contract
/// @dev This interface only contains functions of the contract which are called by other contracts
/// of this module
interface IFlashAngle {
    /// @notice Reference to the `CoreBorrow` contract managing the FlashLoan module
    function core() external view returns (ICoreBorrow);

    /// @notice Sends the fees taken from flash loans to the treasury contract associated to the stablecoin
    /// @param stablecoin Stablecoin from which profits should be sent
    /// @return balance Amount of profits sent
    /// @dev This function can only be called by the treasury contract
    function accrueInterestToTreasury(IAgToken stablecoin) external returns (uint256 balance);

    /// @notice Adds support for a stablecoin
    /// @param _treasury Treasury associated to the stablecoin to add support for
    /// @dev This function can only be called by the `CoreBorrow` contract
    function addStablecoinSupport(address _treasury) external;

    /// @notice Removes support for a stablecoin
    /// @param _treasury Treasury associated to the stablecoin to remove support for
    /// @dev This function can only be called by the `CoreBorrow` contract
    function removeStablecoinSupport(address _treasury) external;

    /// @notice Sets a new core contract
    /// @param _core Core contract address to set
    /// @dev This function can only be called by the `CoreBorrow` contract
    function setCore(address _core) external;
}

File 21 of 24 : ITreasury.sol
// SPDX-License-Identifier: GPL-3.0

pragma solidity ^0.8.12;

import "./IAgToken.sol";
import "./ICoreBorrow.sol";
import "./IFlashAngle.sol";

/// @title ITreasury
/// @author Angle Labs, Inc.
/// @notice Interface for the `Treasury` contract
/// @dev This interface only contains functions of the `Treasury` which are called by other contracts
/// of this module
interface ITreasury {
    /// @notice Stablecoin handled by this `treasury` contract
    function stablecoin() external view returns (IAgToken);

    /// @notice Checks whether a given address has the  governor role
    /// @param admin Address to check
    /// @return Whether the address has the governor role
    /// @dev Access control is only kept in the `CoreBorrow` contract
    function isGovernor(address admin) external view returns (bool);

    /// @notice Checks whether a given address has the guardian or the governor role
    /// @param admin Address to check
    /// @return Whether the address has the guardian or the governor role
    /// @dev Access control is only kept in the `CoreBorrow` contract which means that this function
    /// queries the `CoreBorrow` contract
    function isGovernorOrGuardian(address admin) external view returns (bool);

    /// @notice Checks whether a given address has well been initialized in this contract
    /// as a `VaultManager`
    /// @param _vaultManager Address to check
    /// @return Whether the address has been initialized or not
    function isVaultManager(address _vaultManager) external view returns (bool);

    /// @notice Sets a new flash loan module for this stablecoin
    /// @param _flashLoanModule Reference to the new flash loan module
    /// @dev This function removes the minting right to the old flash loan module and grants
    /// it to the new module
    function setFlashLoanModule(address _flashLoanModule) external;
}

File 22 of 24 : ILayerZeroEndpoint.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.5.0;

import "./ILayerZeroUserApplicationConfig.sol";

interface ILayerZeroEndpoint is ILayerZeroUserApplicationConfig {
    // @notice send a LayerZero message to the specified address at a LayerZero endpoint.
    // @param _dstChainId - the destination chain identifier
    // @param _destination - the address on destination chain (in bytes). address length/format may vary by chains
    // @param _payload - a custom bytes payload to send to the destination contract
    // @param _refundAddress - if the source transaction is cheaper than the amount of value passed, refund the additional amount to this address
    // @param _zroPaymentAddress - the address of the ZRO token holder who would pay for the transaction
    // @param _adapterParams - parameters for custom functionality. e.g. receive airdropped native gas from the relayer on destination
    function send(
        uint16 _dstChainId,
        bytes calldata _destination,
        bytes calldata _payload,
        address payable _refundAddress,
        address _zroPaymentAddress,
        bytes calldata _adapterParams
    ) external payable;

    // @notice used by the messaging library to publish verified payload
    // @param _srcChainId - the source chain identifier
    // @param _srcAddress - the source contract (as bytes) at the source chain
    // @param _dstAddress - the address on destination chain
    // @param _nonce - the unbound message ordering nonce
    // @param _gasLimit - the gas limit for external contract execution
    // @param _payload - verified payload to send to the destination contract
    function receivePayload(
        uint16 _srcChainId,
        bytes calldata _srcAddress,
        address _dstAddress,
        uint64 _nonce,
        uint256 _gasLimit,
        bytes calldata _payload
    ) external;

    // @notice get the inboundNonce of a lzApp from a source chain which could be EVM or non-EVM chain
    // @param _srcChainId - the source chain identifier
    // @param _srcAddress - the source chain contract address
    function getInboundNonce(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (uint64);

    // @notice get the outboundNonce from this source chain which, consequently, is always an EVM
    // @param _srcAddress - the source chain contract address
    function getOutboundNonce(uint16 _dstChainId, address _srcAddress) external view returns (uint64);

    // @notice gets a quote in source native gas, for the amount that send() requires to pay for message delivery
    // @param _dstChainId - the destination chain identifier
    // @param _userApplication - the user app address on this EVM chain
    // @param _payload - the custom message to send over LayerZero
    // @param _payInZRO - if false, user app pays the protocol fee in native token
    // @param _adapterParam - parameters for the adapter service, e.g. send some dust native token to dstChain
    function estimateFees(
        uint16 _dstChainId,
        address _userApplication,
        bytes calldata _payload,
        bool _payInZRO,
        bytes calldata _adapterParam
    ) external view returns (uint256 nativeFee, uint256 zroFee);

    // @notice get this Endpoint's immutable source identifier
    function getChainId() external view returns (uint16);

    // @notice the interface to retry failed message on this Endpoint destination
    // @param _srcChainId - the source chain identifier
    // @param _srcAddress - the source chain contract address
    // @param _payload - the payload to be retried
    function retryPayload(
        uint16 _srcChainId,
        bytes calldata _srcAddress,
        bytes calldata _payload
    ) external;

    // @notice query if any STORED payload (message blocking) at the endpoint.
    // @param _srcChainId - the source chain identifier
    // @param _srcAddress - the source chain contract address
    function hasStoredPayload(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (bool);

    // @notice query if the _libraryAddress is valid for sending msgs.
    // @param _userApplication - the user app address on this EVM chain
    function getSendLibraryAddress(address _userApplication) external view returns (address);

    // @notice query if the _libraryAddress is valid for receiving msgs.
    // @param _userApplication - the user app address on this EVM chain
    function getReceiveLibraryAddress(address _userApplication) external view returns (address);

    // @notice query if the non-reentrancy guard for send() is on
    // @return true if the guard is on. false otherwise
    function isSendingPayload() external view returns (bool);

    // @notice query if the non-reentrancy guard for receive() is on
    // @return true if the guard is on. false otherwise
    function isReceivingPayload() external view returns (bool);

    // @notice get the configuration of the LayerZero messaging library of the specified version
    // @param _version - messaging library version
    // @param _chainId - the chainId for the pending config change
    // @param _userApplication - the contract address of the user application
    // @param _configType - type of configuration. every messaging library has its own convention.
    function getConfig(
        uint16 _version,
        uint16 _chainId,
        address _userApplication,
        uint256 _configType
    ) external view returns (bytes memory);

    // @notice get the send() LayerZero messaging library version
    // @param _userApplication - the contract address of the user application
    function getSendVersion(address _userApplication) external view returns (uint16);

    // @notice get the lzReceive() LayerZero messaging library version
    // @param _userApplication - the contract address of the user application
    function getReceiveVersion(address _userApplication) external view returns (uint16);
}

File 23 of 24 : ILayerZeroReceiver.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.5.0;

interface ILayerZeroReceiver {
    // @notice LayerZero endpoint will invoke this function to deliver the message on the destination
    // @param _srcChainId - the source endpoint identifier
    // @param _srcAddress - the source sending contract address from the source chain
    // @param _nonce - the ordered message nonce
    // @param _payload - the signed payload is the UA bytes has encoded to be sent
    function lzReceive(
        uint16 _srcChainId,
        bytes calldata _srcAddress,
        uint64 _nonce,
        bytes calldata _payload
    ) external;
}

File 24 of 24 : ILayerZeroUserApplicationConfig.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.5.0;

interface ILayerZeroUserApplicationConfig {
    // @notice set the configuration of the LayerZero messaging library of the specified version
    // @param _version - messaging library version
    // @param _chainId - the chainId for the pending config change
    // @param _configType - type of configuration. every messaging library has its own convention.
    // @param _config - configuration in the bytes. can encode arbitrary content.
    function setConfig(
        uint16 _version,
        uint16 _chainId,
        uint256 _configType,
        bytes calldata _config
    ) external;

    // @notice set the send() LayerZero messaging library version to _version
    // @param _version - new messaging library version
    function setSendVersion(uint16 _version) external;

    // @notice set the lzReceive() LayerZero messaging library version to _version
    // @param _version - new messaging library version
    function setReceiveVersion(uint16 _version) external;

    // @notice Only when the UA needs to resume the message flow in blocking mode and clear the stored payload
    // @param _srcChainId - the chainId of the source chain
    // @param _srcAddress - the contract address of the source contract at the source chain
    function forceResumeReceive(uint16 _srcChainId, bytes calldata _srcAddress) external;
}

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

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"InsufficientGas","type":"error"},{"inputs":[],"name":"InvalidAllowance","type":"error"},{"inputs":[],"name":"InvalidCaller","type":"error"},{"inputs":[],"name":"InvalidEndpoint","type":"error"},{"inputs":[],"name":"InvalidParams","type":"error"},{"inputs":[],"name":"InvalidPayload","type":"error"},{"inputs":[],"name":"InvalidSource","type":"error"},{"inputs":[],"name":"NotGovernor","type":"error"},{"inputs":[],"name":"NotGovernorOrGuardian","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"indexed":false,"internalType":"bytes","name":"_srcAddress","type":"bytes"},{"indexed":false,"internalType":"uint64","name":"_nonce","type":"uint64"},{"indexed":false,"internalType":"bytes","name":"_payload","type":"bytes"}],"name":"MessageFailed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"indexed":true,"internalType":"bytes","name":"_srcAddress","type":"bytes"},{"indexed":true,"internalType":"address","name":"_toAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"},{"indexed":false,"internalType":"uint64","name":"_nonce","type":"uint64"}],"name":"ReceiveFromChain","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_sender","type":"address"},{"indexed":true,"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"indexed":true,"internalType":"bytes","name":"_toAddress","type":"bytes"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"},{"indexed":false,"internalType":"uint64","name":"_nonce","type":"uint64"}],"name":"SendToChain","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"indexed":false,"internalType":"bytes","name":"_srcAddress","type":"bytes"}],"name":"SetTrustedRemote","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"EXTRA_GAS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PT_SEND","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"canonicalToken","outputs":[{"internalType":"contract IAgTokenSideChainMultiBridge","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"bytes","name":"_toAddress","type":"bytes"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"bool","name":"_useZro","type":"bool"},{"internalType":"bytes","name":"_adapterParams","type":"bytes"}],"name":"estimateSendFee","outputs":[{"internalType":"uint256","name":"nativeFee","type":"uint256"},{"internalType":"uint256","name":"zroFee","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"},{"internalType":"bytes","name":"","type":"bytes"},{"internalType":"uint64","name":"","type":"uint64"}],"name":"failedMessages","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"bytes","name":"_srcAddress","type":"bytes"}],"name":"forceResumeReceive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_version","type":"uint16"},{"internalType":"uint16","name":"_chainId","type":"uint16"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"_configType","type":"uint256"}],"name":"getConfig","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"address","name":"_lzEndpoint","type":"address"},{"internalType":"address","name":"_treasury","type":"address"},{"internalType":"uint256","name":"initialSupply","type":"uint256"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"bytes","name":"_srcAddress","type":"bytes"}],"name":"isTrustedRemote","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lzEndpoint","outputs":[{"internalType":"contract ILayerZeroEndpoint","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"bytes","name":"_srcAddress","type":"bytes"},{"internalType":"uint64","name":"_nonce","type":"uint64"},{"internalType":"bytes","name":"_payload","type":"bytes"}],"name":"lzReceive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"},{"internalType":"uint16","name":"","type":"uint16"}],"name":"minDstGasLookup","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"bytes","name":"_srcAddress","type":"bytes"},{"internalType":"uint64","name":"_nonce","type":"uint64"},{"internalType":"bytes","name":"_payload","type":"bytes"}],"name":"nonblockingLzReceive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"pause","type":"bool"}],"name":"pauseSendTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"precrime","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"bytes","name":"_srcAddress","type":"bytes"},{"internalType":"uint64","name":"_nonce","type":"uint64"},{"internalType":"bytes","name":"_payload","type":"bytes"}],"name":"retryMessage","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"bytes","name":"_toAddress","type":"bytes"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address payable","name":"_refundAddress","type":"address"},{"internalType":"address","name":"_zroPaymentAddress","type":"address"},{"internalType":"bytes","name":"_adapterParams","type":"bytes"}],"name":"send","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"bytes","name":"_toAddress","type":"bytes"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address payable","name":"_refundAddress","type":"address"},{"internalType":"address","name":"_zroPaymentAddress","type":"address"},{"internalType":"bytes","name":"_adapterParams","type":"bytes"}],"name":"sendCredit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"bytes","name":"_toAddress","type":"bytes"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address payable","name":"_refundAddress","type":"address"},{"internalType":"address","name":"_zroPaymentAddress","type":"address"},{"internalType":"bytes","name":"_adapterParams","type":"bytes"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"sendWithPermit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_version","type":"uint16"},{"internalType":"uint16","name":"_chainId","type":"uint16"},{"internalType":"uint256","name":"_configType","type":"uint256"},{"internalType":"bytes","name":"_config","type":"bytes"}],"name":"setConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"uint16","name":"_packetType","type":"uint16"},{"internalType":"uint256","name":"_minGas","type":"uint256"}],"name":"setMinDstGas","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_precrime","type":"address"}],"name":"setPrecrime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_version","type":"uint16"}],"name":"setReceiveVersion","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_version","type":"uint16"}],"name":"setSendVersion","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"bytes","name":"_srcAddress","type":"bytes"}],"name":"setTrustedRemote","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"_useCustomAdapterParams","type":"uint8"}],"name":"setUseCustomAdapterParams","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"setupAllowance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"}],"name":"trustedRemoteLookup","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"useCustomAdapterParams","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"name":"withdraw","outputs":[{"internalType":"uint256","name":"amountMinted","type":"uint256"}],"stateMutability":"nonpayable","type":"function"}]

60806040523480156200001157600080fd5b50600054610100900460ff1615808015620000335750600054600160ff909116105b8062000063575062000050306200013d60201b6200253a1760201c565b15801562000063575060005460ff166001145b620000cb5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805460ff191660011790558015620000ef576000805461ff0019166101001790555b801562000136576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b506200014c565b6001600160a01b03163b151590565b6147cc806200015c6000396000f3fe6080604052600436106102fb5760003560e01c806370a082311161018f578063c9aba0aa116100e1578063e09e911e1161008a578063eed33cef11610064578063eed33cef14610944578063f187892214610957578063f5ecbdbc1461097757600080fd5b8063e09e911e146108f5578063eb8d72b71461090a578063ed629c5c1461092a57600080fd5b8063d1deba1f116100bb578063d1deba1f1461086f578063dd62ed3e14610882578063df2a5b3b146108d557600080fd5b8063c9aba0aa14610801578063cbed8b9c14610821578063ceb76b551461084157600080fd5b806395d89b4111610143578063a9059cbb1161011d578063a9059cbb1461078e578063b353aaa7146107ae578063baf3292d146107e157600080fd5b806395d89b4114610739578063a0712d681461074e578063a457c2d71461076e57600080fd5b806385edd8ae1161017457806385edd8ae146106c15780638cfd8f5c146106d4578063950c8a741461070c57600080fd5b806370a082311461065e5780637533d788146106a157600080fd5b80632a205e3d116102535780634c42899a116101fc5780636147def2116101d65780636147def2146105cc57806361d027b3146105ec57806366ad5c8a1461063e57600080fd5b80634c42899a1461053d5780635b8c41e6146105655780635c975abb146105b457600080fd5b80633d8b38f61161022d5780633d8b38f6146104dd57806342966c68146104fd57806342d65a8d1461051d57600080fd5b80632a205e3d14610466578063313ce5671461049b57806339509351146104bd57600080fd5b8063095ea7b3116102b557806318160ddd1161028f57806318160ddd1461041a5780631d82e9c71461042f57806323b872dd1461044657600080fd5b8063095ea7b3146103c757806310ddb137146103e757806310f958251461040757600080fd5b806301ffc9a7116102e657806301ffc9a71461035557806306fdde031461038557806307e0db17146103a757600080fd5b80621d356714610300578062f714ce14610322575b600080fd5b34801561030c57600080fd5b5061032061031b366004613969565b610997565b005b34801561032e57600080fd5b5061034261033d366004613a1f565b610af5565b6040519081526020015b60405180910390f35b34801561036157600080fd5b50610375610370366004613a4f565b610bd1565b604051901515815260200161034c565b34801561039157600080fd5b5061039a610c58565b60405161034c9190613aff565b3480156103b357600080fd5b506103206103c2366004613b12565b610cea565b3480156103d357600080fd5b506103756103e2366004613b2d565b610e3b565b3480156103f357600080fd5b50610320610402366004613b12565b610e53565b610320610415366004613b59565b610f7a565b34801561042657600080fd5b5060ca54610342565b34801561043b57600080fd5b5061034262030d4081565b34801561045257600080fd5b50610375610461366004613bff565b610fad565b34801561047257600080fd5b50610486610481366004613c4e565b610fd3565b6040805192835260208301919091520161034c565b3480156104a757600080fd5b5060125b60405160ff909116815260200161034c565b3480156104c957600080fd5b506103756104d8366004613b2d565b6110cb565b3480156104e957600080fd5b506103756104f8366004613d2a565b611117565b34801561050957600080fd5b50610320610518366004613d7d565b6111e3565b34801561052957600080fd5b50610320610538366004613d2a565b6112d2565b34801561054957600080fd5b50610552600081565b60405161ffff909116815260200161034c565b34801561057157600080fd5b50610342610580366004613d96565b6001602090815260009384526040808520845180860184018051928152908401958401959095209452929052825290205481565b3480156105c057600080fd5b5060fa5460ff16610375565b3480156105d857600080fd5b506103206105e7366004613e09565b611430565b3480156105f857600080fd5b506003546106199073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161034c565b34801561064a57600080fd5b50610320610659366004613969565b61152c565b34801561066a57600080fd5b50610342610679366004613e24565b73ffffffffffffffffffffffffffffffffffffffff16600090815260c8602052604090205490565b3480156106ad57600080fd5b5061039a6106bc366004613b12565b611577565b6103206106cf366004613e41565b611611565b3480156106e057600080fd5b506103426106ef366004613f10565b600460209081526000928352604080842090915290825290205481565b34801561071857600080fd5b506005546106199073ffffffffffffffffffffffffffffffffffffffff1681565b34801561074557600080fd5b5061039a6116da565b34801561075a57600080fd5b50610320610769366004613d7d565b6116e9565b34801561077a57600080fd5b50610375610789366004613b2d565b6117d5565b34801561079a57600080fd5b506103756107a9366004613b2d565b6118b6565b3480156107ba57600080fd5b506000546106199062010000900473ffffffffffffffffffffffffffffffffffffffff1681565b3480156107ed57600080fd5b506103206107fc366004613e24565b6118c4565b34801561080d57600080fd5b5061032061081c366004613f43565b6119d3565b34801561082d57600080fd5b5061032061083c366004613fd4565b611c79565b34801561084d57600080fd5b5061012c546106199073ffffffffffffffffffffffffffffffffffffffff1681565b61032061087d366004613969565b611ddd565b34801561088e57600080fd5b5061034261089d366004614043565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260c96020908152604080832093909416825291909152205490565b3480156108e157600080fd5b506103206108f0366004614071565b611ec3565b34801561090157600080fd5b50610320611fec565b34801561091657600080fd5b50610320610925366004613d2a565b6120fc565b34801561093657600080fd5b506064546104ab9060ff1681565b610320610952366004613b59565b612223565b34801561096357600080fd5b506103206109723660046140ad565b612380565b34801561098357600080fd5b5061039a6109923660046140ca565b61245d565b60005462010000900473ffffffffffffffffffffffffffffffffffffffff1633146109ee576040517ff1cbb56700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61ffff841660009081526002602052604081208054610a0c90614117565b80601f0160208091040260200160405190810160405280929190818152602001828054610a3890614117565b8015610a855780601f10610a5a57610100808354040283529160200191610a85565b820191906000526020600020905b815481529060010190602001808311610a6857829003601f168201915b5050505050905080518451141580610aab57508080519060200120848051906020012014155b15610ae2576040517f8154374b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610aee85858585612556565b5050505050565b6000610b02333085612661565b61012c546040517f151dd7550000000000000000000000000000000000000000000000000000000081523060048201526024810185905273ffffffffffffffffffffffffffffffffffffffff84811660448301529091169063151dd755906064016020604051808303816000875af1158015610b82573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba6919061416a565b30600090815260c860205260409020549091508015610bca57610bca303383612661565b5092915050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082161580610c4357507fffffffff0000000000000000000000000000000000000000000000000000000082167f36372b0700000000000000000000000000000000000000000000000000000000145b80610c525750610c5282612914565b92915050565b606060cb8054610c6790614117565b80601f0160208091040260200160405190810160405280929190818152602001828054610c9390614117565b8015610ce05780601f10610cb557610100808354040283529160200191610ce0565b820191906000526020600020905b815481529060010190602001808311610cc357829003601f168201915b5050505050905090565b6003546040517f521d4de900000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063521d4de990602401602060405180830381865afa158015610d58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d7c9190614183565b610db2576040517f99e120bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000546040517f07e0db1700000000000000000000000000000000000000000000000000000000815261ffff831660048201526201000090910473ffffffffffffffffffffffffffffffffffffffff16906307e0db17906024015b600060405180830381600087803b158015610e2757600080fd5b505af1158015610aee573d6000803e3d6000fd5b600033610e498185856129ab565b5060019392505050565b6003546040517f521d4de900000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063521d4de990602401602060405180830381865afa158015610ec1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ee59190614183565b610f1b576040517f99e120bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000546040517f10ddb13700000000000000000000000000000000000000000000000000000000815261ffff831660048201526201000090910473ffffffffffffffffffffffffffffffffffffffff16906310ddb13790602401610e0d565b610f8a8660008362030d40612b5f565b610f95868686612bb4565b9350610fa5868686868686612bc8565b505050505050565b600033610fbb858285612bdd565b610fc6858585612661565b60019150505b9392505050565b60008060008686604051602001610feb9291906141a0565b604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0018152908290526000547f40a7bb1000000000000000000000000000000000000000000000000000000000835290925062010000900473ffffffffffffffffffffffffffffffffffffffff16906340a7bb109061107c908b90309086908b908b906004016141c2565b6040805180830381865afa158015611098573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110bc9190614221565b92509250509550959350505050565b33600081815260c96020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168452909152812054909190610e499082908690611112908790614274565b6129ab565b61ffff83166000908152600260205260408120805482919061113890614117565b80601f016020809104026020016040519081016040528092919081815260200182805461116490614117565b80156111b15780601f10611186576101008083540402835291602001916111b1565b820191906000526020600020905b81548152906001019060200180831161119457829003601f168201915b5050505050905083836040516111c8929190614287565b60405180910390208180519060200120149150509392505050565b6003546040517f521d4de900000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063521d4de990602401602060405180830381865afa158015611251573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112759190614183565b6112ab576040517f99e120bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61012c546112cf9073ffffffffffffffffffffffffffffffffffffffff1682612cae565b50565b6003546040517f521d4de900000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063521d4de990602401602060405180830381865afa158015611340573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113649190614183565b61139a576040517f99e120bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000546040517f42d65a8d0000000000000000000000000000000000000000000000000000000081526201000090910473ffffffffffffffffffffffffffffffffffffffff16906342d65a8d906113f9908690869086906004016142e0565b600060405180830381600087803b15801561141357600080fd5b505af1158015611427573d6000803e3d6000fd5b50505050505050565b6003546040517f521d4de900000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063521d4de990602401602060405180830381865afa15801561149e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c29190614183565b6114f8576040517f99e120bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b606480547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff92909216919091179055565b333014611565576040517f48f5c3ed00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61157184848484612e98565b50505050565b6002602052600090815260409020805461159090614117565b80601f01602080910402602001604051908101604052809291908181526020018280546115bc90614117565b80156116095780601f106115de57610100808354040283529160200191611609565b820191906000526020600020905b8154815290600101906020018083116115ec57829003601f168201915b505050505081565b61012c546040517fd505accf000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018a90526064810186905260ff8516608482015260a4810184905260c4810183905273ffffffffffffffffffffffffffffffffffffffff9091169063d505accf9060e401600060405180830381600087803b1580156116a857600080fd5b505af11580156116bc573d6000803e3d6000fd5b505050506116ce8a8a8a8a8a8a612223565b50505050505050505050565b606060cc8054610c6790614117565b6003546040517f521d4de900000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063521d4de990602401602060405180830381865afa158015611757573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061177b9190614183565b6117b1576040517f99e120bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61012c546112cf9073ffffffffffffffffffffffffffffffffffffffff1682612f43565b33600081815260c96020908152604080832073ffffffffffffffffffffffffffffffffffffffff871684529091528120549091908381101561189e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f00000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6118ab82868684036129ab565b506001949350505050565b600033610e49818585612661565b6003546040517f521d4de900000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063521d4de990602401602060405180830381865afa158015611932573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119569190614183565b61198c576040517f99e120bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b600054610100900460ff16158080156119f35750600054600160ff909116105b80611a0d5750303b158015611a0d575060005460ff166001145b611a99576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401611895565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558015611af757600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b611b018686613063565b611b0b8484613113565b8273ffffffffffffffffffffffffffffffffffffffff1663e9cbd8226040518163ffffffff1660e01b8152600401602060405180830381865afa158015611b56573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b7a91906142fe565b61012c80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff929092169182179055611beb9030907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6129ab565b61012c54611c0f9073ffffffffffffffffffffffffffffffffffffffff1683612f43565b8015610fa557600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050505050565b6003546040517f521d4de900000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063521d4de990602401602060405180830381865afa158015611ce7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d0b9190614183565b611d41576040517f99e120bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000546040517fcbed8b9c0000000000000000000000000000000000000000000000000000000081526201000090910473ffffffffffffffffffffffffffffffffffffffff169063cbed8b9c90611da4908890889088908890889060040161431b565b600060405180830381600087803b158015611dbe57600080fd5b505af1158015611dd2573d6000803e3d6000fd5b505050505050505050565b61ffff84166000908152600160205260408082209051611dfe908690614354565b908152604080516020928190038301902067ffffffffffffffff8616600090815292529020549050801580611e395750815160208301208114155b15611e70576040517f7c6953f900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61ffff85166000908152600160205260408082209051611e91908790614354565b908152604080516020928190038301902067ffffffffffffffff871660009081529252902055610aee85858585612e98565b6003546040517f521d4de900000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063521d4de990602401602060405180830381865afa158015611f31573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f559190614183565b611f8b576040517f99e120bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600003611fc5576040517fa86b651200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61ffff92831660009081526004602090815260408083209490951682529290925291902055565b6003546040517f521d4de900000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063521d4de990602401602060405180830381865afa15801561205a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061207e9190614183565b6120b4576040517f99e120bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61012c546120fa90309073ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6129ab565b565b6003546040517f521d4de900000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063521d4de990602401602060405180830381865afa15801561216a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061218e9190614183565b6121c4576040517f99e120bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61ffff831660009081526002602052604090206121e28284836143b6565b507ffa41487ad5d6728f0b19276fa1eddc16558578f5109fc39d2dc33c3230470dab838383604051612216939291906142e0565b60405180910390a1505050565b6122338660008362030d40612b5f565b61223e8686866131f6565b9350600085856040516020016122559291906141a0565b60405160208183030381529060405290506122738782868686613352565b600080546040517f7a14574800000000000000000000000000000000000000000000000000000000815261ffff8a1660048201523060248201526201000090910473ffffffffffffffffffffffffffffffffffffffff1690637a14574890604401602060405180830381865afa1580156122f1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061231591906144d0565b9050866040516123259190614354565b6040805191829003822088835267ffffffffffffffff841660208401529161ffff8b169133917f024797cc77ce15dc717112d54fb1df125fdfd8c81344fb046c5e074427ce1543910160405180910390a45050505050505050565b6003546040517f521d4de900000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063521d4de990602401602060405180830381865afa1580156123ee573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124129190614183565b612448576040517f99e120bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80612455576112cf6134cc565b6112cf613549565b6000546040517ff5ecbdbc00000000000000000000000000000000000000000000000000000000815261ffff8087166004830152851660248201523060448201526064810183905260609162010000900473ffffffffffffffffffffffffffffffffffffffff169063f5ecbdbc90608401600060405180830381865afa1580156124eb573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052612531919081019061453a565b95945050505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b6040517f66ad5c8a00000000000000000000000000000000000000000000000000000000815230906366ad5c8a9061259890879087908790879060040161456f565b600060405180830381600087803b1580156125b257600080fd5b505af19250505080156125c3575060015b611571578080519060200120600160008661ffff1661ffff168152602001908152602001600020846040516125f89190614354565b90815260408051918290036020908101832067ffffffffffffffff87166000908152915220919091557fe6f254030bcb01ffd20558175c13fcaed6d1520be7becee4c961b65f79243b0d9061265490869086908690869061456f565b60405180910390a1611571565b73ffffffffffffffffffffffffffffffffffffffff8316612704576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401611895565b73ffffffffffffffffffffffffffffffffffffffff82166127a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401611895565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260c860205260409020548181101561285d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152608401611895565b73ffffffffffffffffffffffffffffffffffffffff808516600090815260c860205260408082208585039055918516815290812080548492906128a1908490614274565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161290791815260200190565b60405180910390a3611571565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f5110f697000000000000000000000000000000000000000000000000000000001480610c5257507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610c52565b73ffffffffffffffffffffffffffffffffffffffff8316612a4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401611895565b73ffffffffffffffffffffffffffffffffffffffff8216612af0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152608401611895565b73ffffffffffffffffffffffffffffffffffffffff838116600081815260c9602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b60645460ff1615612b7b57612b76848484846135a4565b611571565b815115611571576040517fa86b651200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000612bbe61361f565b610bca3383612cae565b600085856040516020016122559291906141a0565b73ffffffffffffffffffffffffffffffffffffffff838116600090815260c960209081526040808320938616835292905220547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146115715781811015612ca1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401611895565b61157184848484036129ab565b73ffffffffffffffffffffffffffffffffffffffff8216612d51576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401611895565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260c8602052604090205481811015612e07576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f63650000000000000000000000000000000000000000000000000000000000006064820152608401611895565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260c860205260408120838303905560ca8054849290612e439084906145ae565b909155505060405182815260009073ffffffffffffffffffffffffffffffffffffffff8516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602001612b52565b505050565b60008082806020019051810190612eaf91906145c1565b60148201519193509150612ec487828461368c565b91508073ffffffffffffffffffffffffffffffffffffffff1686604051612eeb9190614354565b6040805191829003822085835267ffffffffffffffff891660208401529161ffff8b16917f64e10c37f404d128982dce114f5d233c14c5c7f6d8db93099e3d99dacb9e27ba910160405180910390a450505050505050565b73ffffffffffffffffffffffffffffffffffffffff8216612fc0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401611895565b8060ca6000828254612fd29190614274565b909155505073ffffffffffffffffffffffffffffffffffffffff8216600090815260c860205260408120805483929061300c908490614274565b909155505060405181815273ffffffffffffffffffffffffffffffffffffffff8316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b600054610100900460ff166130fa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401611895565b60cb6131068382614608565b5060cc612e938282614608565b73ffffffffffffffffffffffffffffffffffffffff8216158061314a575073ffffffffffffffffffffffffffffffffffffffff8116155b15613181576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080547fffffffffffffffffffff0000000000000000000000000000000000000000ffff166201000073ffffffffffffffffffffffffffffffffffffffff94851602179055600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909216179055565b600061320061361f565b61012c546040517f23b872dd0000000000000000000000000000000000000000000000000000000081523360048201523060248201526044810184905273ffffffffffffffffffffffffffffffffffffffff909116906323b872dd906064016020604051808303816000875af115801561327e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132a29190614183565b5061012c546040517fd44ad63f000000000000000000000000000000000000000000000000000000008152306004820181905260248201859052604482015273ffffffffffffffffffffffffffffffffffffffff9091169063d44ad63f906064016020604051808303816000875af1158015613322573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613346919061416a565b9050610fcc3082612cae565b61ffff85166000908152600260205260408120805461337090614117565b80601f016020809104026020016040519081016040528092919081815260200182805461339c90614117565b80156133e95780601f106133be576101008083540402835291602001916133e9565b820191906000526020600020905b8154815290600101906020018083116133cc57829003601f168201915b50505050509050805160000361342b576040517f8154374b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000546040517fc58031000000000000000000000000000000000000000000000000000000000081526201000090910473ffffffffffffffffffffffffffffffffffffffff169063c5803100903490613492908a9086908b908b908b908b90600401614722565b6000604051808303818588803b1580156134ab57600080fd5b505af11580156134bf573d6000803e3d6000fd5b5050505050505050505050565b6134d4613770565b60fa80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390a1565b61355161361f565b60fa80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861351f3390565b61ffff80851660009081526004602090815260408083209387168352929052908120546135d2908390614274565b90508015806135e857506135e5836137dc565b81115b15610aee576040517f1c26714c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fa5460ff16156120fa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a20706175736564000000000000000000000000000000006044820152606401611895565b600061369661361f565b6136a03083612f43565b61012c546040517f151dd7550000000000000000000000000000000000000000000000000000000081523060048201526024810184905273ffffffffffffffffffffffffffffffffffffffff85811660448301529091169063151dd755906064016020604051808303816000875af1158015613720573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613744919061416a565b30600090815260c86020526040902054909150801561376857613768308583612661565b509392505050565b60fa5460ff166120fa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5061757361626c653a206e6f74207061757365640000000000000000000000006044820152606401611895565b600060228251101561381a576040517fa86b651200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506022015190565b803561ffff8116811461383457600080fd5b919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156138af576138af613839565b604052919050565b600067ffffffffffffffff8211156138d1576138d1613839565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b600082601f83011261390e57600080fd5b813561392161391c826138b7565b613868565b81815284602083860101111561393657600080fd5b816020850160208301376000918101602001919091529392505050565b67ffffffffffffffff811681146112cf57600080fd5b6000806000806080858703121561397f57600080fd5b61398885613822565b9350602085013567ffffffffffffffff808211156139a557600080fd5b6139b1888389016138fd565b9450604087013591506139c382613953565b909250606086013590808211156139d957600080fd5b506139e6878288016138fd565b91505092959194509250565b73ffffffffffffffffffffffffffffffffffffffff811681146112cf57600080fd5b8035613834816139f2565b60008060408385031215613a3257600080fd5b823591506020830135613a44816139f2565b809150509250929050565b600060208284031215613a6157600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610fcc57600080fd5b60005b83811015613aac578181015183820152602001613a94565b50506000910152565b60008151808452613acd816020860160208601613a91565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610fcc6020830184613ab5565b600060208284031215613b2457600080fd5b610fcc82613822565b60008060408385031215613b4057600080fd5b8235613b4b816139f2565b946020939093013593505050565b60008060008060008060c08789031215613b7257600080fd5b613b7b87613822565b9550602087013567ffffffffffffffff80821115613b9857600080fd5b613ba48a838b016138fd565b96506040890135955060608901359150613bbd826139f2565b909350608088013590613bcf826139f2565b90925060a08801359080821115613be557600080fd5b50613bf289828a016138fd565b9150509295509295509295565b600080600060608486031215613c1457600080fd5b8335613c1f816139f2565b92506020840135613c2f816139f2565b929592945050506040919091013590565b80151581146112cf57600080fd5b600080600080600060a08688031215613c6657600080fd5b613c6f86613822565b9450602086013567ffffffffffffffff80821115613c8c57600080fd5b613c9889838a016138fd565b95506040880135945060608801359150613cb182613c40565b90925060808701359080821115613cc757600080fd5b50613cd4888289016138fd565b9150509295509295909350565b60008083601f840112613cf357600080fd5b50813567ffffffffffffffff811115613d0b57600080fd5b602083019150836020828501011115613d2357600080fd5b9250929050565b600080600060408486031215613d3f57600080fd5b613d4884613822565b9250602084013567ffffffffffffffff811115613d6457600080fd5b613d7086828701613ce1565b9497909650939450505050565b600060208284031215613d8f57600080fd5b5035919050565b600080600060608486031215613dab57600080fd5b613db484613822565b9250602084013567ffffffffffffffff811115613dd057600080fd5b613ddc868287016138fd565b9250506040840135613ded81613953565b809150509250925092565b803560ff8116811461383457600080fd5b600060208284031215613e1b57600080fd5b610fcc82613df8565b600060208284031215613e3657600080fd5b8135610fcc816139f2565b6000806000806000806000806000806101408b8d031215613e6157600080fd5b613e6a8b613822565b995060208b013567ffffffffffffffff80821115613e8757600080fd5b613e938e838f016138fd565b9a5060408d01359950613ea860608e01613a14565b9850613eb660808e01613a14565b975060a08d0135915080821115613ecc57600080fd5b50613ed98d828e016138fd565b95505060c08b01359350613eef60e08c01613df8565b92506101008b013591506101208b013590509295989b9194979a5092959850565b60008060408385031215613f2357600080fd5b613f2c83613822565b9150613f3a60208401613822565b90509250929050565b600080600080600060a08688031215613f5b57600080fd5b853567ffffffffffffffff80821115613f7357600080fd5b613f7f89838a016138fd565b96506020880135915080821115613f9557600080fd5b50613fa2888289016138fd565b9450506040860135613fb3816139f2565b92506060860135613fc3816139f2565b949793965091946080013592915050565b600080600080600060808688031215613fec57600080fd5b613ff586613822565b945061400360208701613822565b935060408601359250606086013567ffffffffffffffff81111561402657600080fd5b61403288828901613ce1565b969995985093965092949392505050565b6000806040838503121561405657600080fd5b8235614061816139f2565b91506020830135613a44816139f2565b60008060006060848603121561408657600080fd5b61408f84613822565b925061409d60208501613822565b9150604084013590509250925092565b6000602082840312156140bf57600080fd5b8135610fcc81613c40565b600080600080608085870312156140e057600080fd5b6140e985613822565b93506140f760208601613822565b92506040850135614107816139f2565b9396929550929360600135925050565b600181811c9082168061412b57607f821691505b602082108103614164577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b60006020828403121561417c57600080fd5b5051919050565b60006020828403121561419557600080fd5b8151610fcc81613c40565b6040815260006141b36040830185613ab5565b90508260208301529392505050565b61ffff8616815273ffffffffffffffffffffffffffffffffffffffff8516602082015260a0604082015260006141fb60a0830186613ab5565b841515606084015282810360808401526142158185613ab5565b98975050505050505050565b6000806040838503121561423457600080fd5b505080516020909101519092909150565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b80820180821115610c5257610c52614245565b8183823760009101908152919050565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b61ffff84168152604060208201526000612531604083018486614297565b60006020828403121561431057600080fd5b8151610fcc816139f2565b600061ffff808816835280871660208401525084604083015260806060830152614349608083018486614297565b979650505050505050565b60008251614366818460208701613a91565b9190910192915050565b601f821115612e9357600081815260208120601f850160051c810160208610156143975750805b601f850160051c820191505b81811015610fa5578281556001016143a3565b67ffffffffffffffff8311156143ce576143ce613839565b6143e2836143dc8354614117565b83614370565b6000601f84116001811461443457600085156143fe5750838201355b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600387901b1c1916600186901b178355610aee565b6000838152602090207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0861690835b828110156144835786850135825560209485019460019092019101614463565b50868210156144be577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88860031b161c19848701351681555b505060018560011b0183555050505050565b6000602082840312156144e257600080fd5b8151610fcc81613953565b600082601f8301126144fe57600080fd5b815161450c61391c826138b7565b81815284602083860101111561452157600080fd5b614532826020830160208701613a91565b949350505050565b60006020828403121561454c57600080fd5b815167ffffffffffffffff81111561456357600080fd5b614532848285016144ed565b61ffff8516815260806020820152600061458c6080830186613ab5565b67ffffffffffffffff8516604084015282810360608401526143498185613ab5565b81810381811115610c5257610c52614245565b600080604083850312156145d457600080fd5b825167ffffffffffffffff8111156145eb57600080fd5b6145f7858286016144ed565b925050602083015190509250929050565b815167ffffffffffffffff81111561462257614622613839565b614636816146308454614117565b84614370565b602080601f83116001811461468957600084156146535750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555610fa5565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b828110156146d6578886015182559484019460019091019084016146b7565b508582101561471257878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b61ffff8716815260c06020820152600061473f60c0830188613ab5565b82810360408401526147518188613ab5565b73ffffffffffffffffffffffffffffffffffffffff87811660608601528616608085015283810360a085015290506147898185613ab5565b999850505050505050505056fea26469706673582212202767c9b592155f672de23952e4bfd392bb4f7858cceb2ac2977220ca3b97676164736f6c63430008110033

Deployed Bytecode

0x6080604052600436106102fb5760003560e01c806370a082311161018f578063c9aba0aa116100e1578063e09e911e1161008a578063eed33cef11610064578063eed33cef14610944578063f187892214610957578063f5ecbdbc1461097757600080fd5b8063e09e911e146108f5578063eb8d72b71461090a578063ed629c5c1461092a57600080fd5b8063d1deba1f116100bb578063d1deba1f1461086f578063dd62ed3e14610882578063df2a5b3b146108d557600080fd5b8063c9aba0aa14610801578063cbed8b9c14610821578063ceb76b551461084157600080fd5b806395d89b4111610143578063a9059cbb1161011d578063a9059cbb1461078e578063b353aaa7146107ae578063baf3292d146107e157600080fd5b806395d89b4114610739578063a0712d681461074e578063a457c2d71461076e57600080fd5b806385edd8ae1161017457806385edd8ae146106c15780638cfd8f5c146106d4578063950c8a741461070c57600080fd5b806370a082311461065e5780637533d788146106a157600080fd5b80632a205e3d116102535780634c42899a116101fc5780636147def2116101d65780636147def2146105cc57806361d027b3146105ec57806366ad5c8a1461063e57600080fd5b80634c42899a1461053d5780635b8c41e6146105655780635c975abb146105b457600080fd5b80633d8b38f61161022d5780633d8b38f6146104dd57806342966c68146104fd57806342d65a8d1461051d57600080fd5b80632a205e3d14610466578063313ce5671461049b57806339509351146104bd57600080fd5b8063095ea7b3116102b557806318160ddd1161028f57806318160ddd1461041a5780631d82e9c71461042f57806323b872dd1461044657600080fd5b8063095ea7b3146103c757806310ddb137146103e757806310f958251461040757600080fd5b806301ffc9a7116102e657806301ffc9a71461035557806306fdde031461038557806307e0db17146103a757600080fd5b80621d356714610300578062f714ce14610322575b600080fd5b34801561030c57600080fd5b5061032061031b366004613969565b610997565b005b34801561032e57600080fd5b5061034261033d366004613a1f565b610af5565b6040519081526020015b60405180910390f35b34801561036157600080fd5b50610375610370366004613a4f565b610bd1565b604051901515815260200161034c565b34801561039157600080fd5b5061039a610c58565b60405161034c9190613aff565b3480156103b357600080fd5b506103206103c2366004613b12565b610cea565b3480156103d357600080fd5b506103756103e2366004613b2d565b610e3b565b3480156103f357600080fd5b50610320610402366004613b12565b610e53565b610320610415366004613b59565b610f7a565b34801561042657600080fd5b5060ca54610342565b34801561043b57600080fd5b5061034262030d4081565b34801561045257600080fd5b50610375610461366004613bff565b610fad565b34801561047257600080fd5b50610486610481366004613c4e565b610fd3565b6040805192835260208301919091520161034c565b3480156104a757600080fd5b5060125b60405160ff909116815260200161034c565b3480156104c957600080fd5b506103756104d8366004613b2d565b6110cb565b3480156104e957600080fd5b506103756104f8366004613d2a565b611117565b34801561050957600080fd5b50610320610518366004613d7d565b6111e3565b34801561052957600080fd5b50610320610538366004613d2a565b6112d2565b34801561054957600080fd5b50610552600081565b60405161ffff909116815260200161034c565b34801561057157600080fd5b50610342610580366004613d96565b6001602090815260009384526040808520845180860184018051928152908401958401959095209452929052825290205481565b3480156105c057600080fd5b5060fa5460ff16610375565b3480156105d857600080fd5b506103206105e7366004613e09565b611430565b3480156105f857600080fd5b506003546106199073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161034c565b34801561064a57600080fd5b50610320610659366004613969565b61152c565b34801561066a57600080fd5b50610342610679366004613e24565b73ffffffffffffffffffffffffffffffffffffffff16600090815260c8602052604090205490565b3480156106ad57600080fd5b5061039a6106bc366004613b12565b611577565b6103206106cf366004613e41565b611611565b3480156106e057600080fd5b506103426106ef366004613f10565b600460209081526000928352604080842090915290825290205481565b34801561071857600080fd5b506005546106199073ffffffffffffffffffffffffffffffffffffffff1681565b34801561074557600080fd5b5061039a6116da565b34801561075a57600080fd5b50610320610769366004613d7d565b6116e9565b34801561077a57600080fd5b50610375610789366004613b2d565b6117d5565b34801561079a57600080fd5b506103756107a9366004613b2d565b6118b6565b3480156107ba57600080fd5b506000546106199062010000900473ffffffffffffffffffffffffffffffffffffffff1681565b3480156107ed57600080fd5b506103206107fc366004613e24565b6118c4565b34801561080d57600080fd5b5061032061081c366004613f43565b6119d3565b34801561082d57600080fd5b5061032061083c366004613fd4565b611c79565b34801561084d57600080fd5b5061012c546106199073ffffffffffffffffffffffffffffffffffffffff1681565b61032061087d366004613969565b611ddd565b34801561088e57600080fd5b5061034261089d366004614043565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260c96020908152604080832093909416825291909152205490565b3480156108e157600080fd5b506103206108f0366004614071565b611ec3565b34801561090157600080fd5b50610320611fec565b34801561091657600080fd5b50610320610925366004613d2a565b6120fc565b34801561093657600080fd5b506064546104ab9060ff1681565b610320610952366004613b59565b612223565b34801561096357600080fd5b506103206109723660046140ad565b612380565b34801561098357600080fd5b5061039a6109923660046140ca565b61245d565b60005462010000900473ffffffffffffffffffffffffffffffffffffffff1633146109ee576040517ff1cbb56700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61ffff841660009081526002602052604081208054610a0c90614117565b80601f0160208091040260200160405190810160405280929190818152602001828054610a3890614117565b8015610a855780601f10610a5a57610100808354040283529160200191610a85565b820191906000526020600020905b815481529060010190602001808311610a6857829003601f168201915b5050505050905080518451141580610aab57508080519060200120848051906020012014155b15610ae2576040517f8154374b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610aee85858585612556565b5050505050565b6000610b02333085612661565b61012c546040517f151dd7550000000000000000000000000000000000000000000000000000000081523060048201526024810185905273ffffffffffffffffffffffffffffffffffffffff84811660448301529091169063151dd755906064016020604051808303816000875af1158015610b82573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba6919061416a565b30600090815260c860205260409020549091508015610bca57610bca303383612661565b5092915050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082161580610c4357507fffffffff0000000000000000000000000000000000000000000000000000000082167f36372b0700000000000000000000000000000000000000000000000000000000145b80610c525750610c5282612914565b92915050565b606060cb8054610c6790614117565b80601f0160208091040260200160405190810160405280929190818152602001828054610c9390614117565b8015610ce05780601f10610cb557610100808354040283529160200191610ce0565b820191906000526020600020905b815481529060010190602001808311610cc357829003601f168201915b5050505050905090565b6003546040517f521d4de900000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063521d4de990602401602060405180830381865afa158015610d58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d7c9190614183565b610db2576040517f99e120bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000546040517f07e0db1700000000000000000000000000000000000000000000000000000000815261ffff831660048201526201000090910473ffffffffffffffffffffffffffffffffffffffff16906307e0db17906024015b600060405180830381600087803b158015610e2757600080fd5b505af1158015610aee573d6000803e3d6000fd5b600033610e498185856129ab565b5060019392505050565b6003546040517f521d4de900000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063521d4de990602401602060405180830381865afa158015610ec1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ee59190614183565b610f1b576040517f99e120bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000546040517f10ddb13700000000000000000000000000000000000000000000000000000000815261ffff831660048201526201000090910473ffffffffffffffffffffffffffffffffffffffff16906310ddb13790602401610e0d565b610f8a8660008362030d40612b5f565b610f95868686612bb4565b9350610fa5868686868686612bc8565b505050505050565b600033610fbb858285612bdd565b610fc6858585612661565b60019150505b9392505050565b60008060008686604051602001610feb9291906141a0565b604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0018152908290526000547f40a7bb1000000000000000000000000000000000000000000000000000000000835290925062010000900473ffffffffffffffffffffffffffffffffffffffff16906340a7bb109061107c908b90309086908b908b906004016141c2565b6040805180830381865afa158015611098573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110bc9190614221565b92509250509550959350505050565b33600081815260c96020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168452909152812054909190610e499082908690611112908790614274565b6129ab565b61ffff83166000908152600260205260408120805482919061113890614117565b80601f016020809104026020016040519081016040528092919081815260200182805461116490614117565b80156111b15780601f10611186576101008083540402835291602001916111b1565b820191906000526020600020905b81548152906001019060200180831161119457829003601f168201915b5050505050905083836040516111c8929190614287565b60405180910390208180519060200120149150509392505050565b6003546040517f521d4de900000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063521d4de990602401602060405180830381865afa158015611251573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112759190614183565b6112ab576040517f99e120bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61012c546112cf9073ffffffffffffffffffffffffffffffffffffffff1682612cae565b50565b6003546040517f521d4de900000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063521d4de990602401602060405180830381865afa158015611340573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113649190614183565b61139a576040517f99e120bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000546040517f42d65a8d0000000000000000000000000000000000000000000000000000000081526201000090910473ffffffffffffffffffffffffffffffffffffffff16906342d65a8d906113f9908690869086906004016142e0565b600060405180830381600087803b15801561141357600080fd5b505af1158015611427573d6000803e3d6000fd5b50505050505050565b6003546040517f521d4de900000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063521d4de990602401602060405180830381865afa15801561149e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c29190614183565b6114f8576040517f99e120bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b606480547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff92909216919091179055565b333014611565576040517f48f5c3ed00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61157184848484612e98565b50505050565b6002602052600090815260409020805461159090614117565b80601f01602080910402602001604051908101604052809291908181526020018280546115bc90614117565b80156116095780601f106115de57610100808354040283529160200191611609565b820191906000526020600020905b8154815290600101906020018083116115ec57829003601f168201915b505050505081565b61012c546040517fd505accf000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018a90526064810186905260ff8516608482015260a4810184905260c4810183905273ffffffffffffffffffffffffffffffffffffffff9091169063d505accf9060e401600060405180830381600087803b1580156116a857600080fd5b505af11580156116bc573d6000803e3d6000fd5b505050506116ce8a8a8a8a8a8a612223565b50505050505050505050565b606060cc8054610c6790614117565b6003546040517f521d4de900000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063521d4de990602401602060405180830381865afa158015611757573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061177b9190614183565b6117b1576040517f99e120bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61012c546112cf9073ffffffffffffffffffffffffffffffffffffffff1682612f43565b33600081815260c96020908152604080832073ffffffffffffffffffffffffffffffffffffffff871684529091528120549091908381101561189e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f00000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6118ab82868684036129ab565b506001949350505050565b600033610e49818585612661565b6003546040517f521d4de900000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063521d4de990602401602060405180830381865afa158015611932573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119569190614183565b61198c576040517f99e120bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b600054610100900460ff16158080156119f35750600054600160ff909116105b80611a0d5750303b158015611a0d575060005460ff166001145b611a99576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401611895565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558015611af757600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b611b018686613063565b611b0b8484613113565b8273ffffffffffffffffffffffffffffffffffffffff1663e9cbd8226040518163ffffffff1660e01b8152600401602060405180830381865afa158015611b56573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b7a91906142fe565b61012c80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff929092169182179055611beb9030907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6129ab565b61012c54611c0f9073ffffffffffffffffffffffffffffffffffffffff1683612f43565b8015610fa557600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050505050565b6003546040517f521d4de900000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063521d4de990602401602060405180830381865afa158015611ce7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d0b9190614183565b611d41576040517f99e120bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000546040517fcbed8b9c0000000000000000000000000000000000000000000000000000000081526201000090910473ffffffffffffffffffffffffffffffffffffffff169063cbed8b9c90611da4908890889088908890889060040161431b565b600060405180830381600087803b158015611dbe57600080fd5b505af1158015611dd2573d6000803e3d6000fd5b505050505050505050565b61ffff84166000908152600160205260408082209051611dfe908690614354565b908152604080516020928190038301902067ffffffffffffffff8616600090815292529020549050801580611e395750815160208301208114155b15611e70576040517f7c6953f900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61ffff85166000908152600160205260408082209051611e91908790614354565b908152604080516020928190038301902067ffffffffffffffff871660009081529252902055610aee85858585612e98565b6003546040517f521d4de900000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063521d4de990602401602060405180830381865afa158015611f31573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f559190614183565b611f8b576040517f99e120bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600003611fc5576040517fa86b651200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61ffff92831660009081526004602090815260408083209490951682529290925291902055565b6003546040517f521d4de900000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063521d4de990602401602060405180830381865afa15801561205a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061207e9190614183565b6120b4576040517f99e120bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61012c546120fa90309073ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6129ab565b565b6003546040517f521d4de900000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063521d4de990602401602060405180830381865afa15801561216a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061218e9190614183565b6121c4576040517f99e120bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61ffff831660009081526002602052604090206121e28284836143b6565b507ffa41487ad5d6728f0b19276fa1eddc16558578f5109fc39d2dc33c3230470dab838383604051612216939291906142e0565b60405180910390a1505050565b6122338660008362030d40612b5f565b61223e8686866131f6565b9350600085856040516020016122559291906141a0565b60405160208183030381529060405290506122738782868686613352565b600080546040517f7a14574800000000000000000000000000000000000000000000000000000000815261ffff8a1660048201523060248201526201000090910473ffffffffffffffffffffffffffffffffffffffff1690637a14574890604401602060405180830381865afa1580156122f1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061231591906144d0565b9050866040516123259190614354565b6040805191829003822088835267ffffffffffffffff841660208401529161ffff8b169133917f024797cc77ce15dc717112d54fb1df125fdfd8c81344fb046c5e074427ce1543910160405180910390a45050505050505050565b6003546040517f521d4de900000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063521d4de990602401602060405180830381865afa1580156123ee573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124129190614183565b612448576040517f99e120bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80612455576112cf6134cc565b6112cf613549565b6000546040517ff5ecbdbc00000000000000000000000000000000000000000000000000000000815261ffff8087166004830152851660248201523060448201526064810183905260609162010000900473ffffffffffffffffffffffffffffffffffffffff169063f5ecbdbc90608401600060405180830381865afa1580156124eb573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052612531919081019061453a565b95945050505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b6040517f66ad5c8a00000000000000000000000000000000000000000000000000000000815230906366ad5c8a9061259890879087908790879060040161456f565b600060405180830381600087803b1580156125b257600080fd5b505af19250505080156125c3575060015b611571578080519060200120600160008661ffff1661ffff168152602001908152602001600020846040516125f89190614354565b90815260408051918290036020908101832067ffffffffffffffff87166000908152915220919091557fe6f254030bcb01ffd20558175c13fcaed6d1520be7becee4c961b65f79243b0d9061265490869086908690869061456f565b60405180910390a1611571565b73ffffffffffffffffffffffffffffffffffffffff8316612704576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401611895565b73ffffffffffffffffffffffffffffffffffffffff82166127a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401611895565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260c860205260409020548181101561285d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152608401611895565b73ffffffffffffffffffffffffffffffffffffffff808516600090815260c860205260408082208585039055918516815290812080548492906128a1908490614274565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161290791815260200190565b60405180910390a3611571565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f5110f697000000000000000000000000000000000000000000000000000000001480610c5257507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610c52565b73ffffffffffffffffffffffffffffffffffffffff8316612a4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401611895565b73ffffffffffffffffffffffffffffffffffffffff8216612af0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152608401611895565b73ffffffffffffffffffffffffffffffffffffffff838116600081815260c9602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b60645460ff1615612b7b57612b76848484846135a4565b611571565b815115611571576040517fa86b651200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000612bbe61361f565b610bca3383612cae565b600085856040516020016122559291906141a0565b73ffffffffffffffffffffffffffffffffffffffff838116600090815260c960209081526040808320938616835292905220547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146115715781811015612ca1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401611895565b61157184848484036129ab565b73ffffffffffffffffffffffffffffffffffffffff8216612d51576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401611895565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260c8602052604090205481811015612e07576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f63650000000000000000000000000000000000000000000000000000000000006064820152608401611895565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260c860205260408120838303905560ca8054849290612e439084906145ae565b909155505060405182815260009073ffffffffffffffffffffffffffffffffffffffff8516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602001612b52565b505050565b60008082806020019051810190612eaf91906145c1565b60148201519193509150612ec487828461368c565b91508073ffffffffffffffffffffffffffffffffffffffff1686604051612eeb9190614354565b6040805191829003822085835267ffffffffffffffff891660208401529161ffff8b16917f64e10c37f404d128982dce114f5d233c14c5c7f6d8db93099e3d99dacb9e27ba910160405180910390a450505050505050565b73ffffffffffffffffffffffffffffffffffffffff8216612fc0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401611895565b8060ca6000828254612fd29190614274565b909155505073ffffffffffffffffffffffffffffffffffffffff8216600090815260c860205260408120805483929061300c908490614274565b909155505060405181815273ffffffffffffffffffffffffffffffffffffffff8316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b600054610100900460ff166130fa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401611895565b60cb6131068382614608565b5060cc612e938282614608565b73ffffffffffffffffffffffffffffffffffffffff8216158061314a575073ffffffffffffffffffffffffffffffffffffffff8116155b15613181576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080547fffffffffffffffffffff0000000000000000000000000000000000000000ffff166201000073ffffffffffffffffffffffffffffffffffffffff94851602179055600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909216179055565b600061320061361f565b61012c546040517f23b872dd0000000000000000000000000000000000000000000000000000000081523360048201523060248201526044810184905273ffffffffffffffffffffffffffffffffffffffff909116906323b872dd906064016020604051808303816000875af115801561327e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132a29190614183565b5061012c546040517fd44ad63f000000000000000000000000000000000000000000000000000000008152306004820181905260248201859052604482015273ffffffffffffffffffffffffffffffffffffffff9091169063d44ad63f906064016020604051808303816000875af1158015613322573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613346919061416a565b9050610fcc3082612cae565b61ffff85166000908152600260205260408120805461337090614117565b80601f016020809104026020016040519081016040528092919081815260200182805461339c90614117565b80156133e95780601f106133be576101008083540402835291602001916133e9565b820191906000526020600020905b8154815290600101906020018083116133cc57829003601f168201915b50505050509050805160000361342b576040517f8154374b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000546040517fc58031000000000000000000000000000000000000000000000000000000000081526201000090910473ffffffffffffffffffffffffffffffffffffffff169063c5803100903490613492908a9086908b908b908b908b90600401614722565b6000604051808303818588803b1580156134ab57600080fd5b505af11580156134bf573d6000803e3d6000fd5b5050505050505050505050565b6134d4613770565b60fa80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390a1565b61355161361f565b60fa80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861351f3390565b61ffff80851660009081526004602090815260408083209387168352929052908120546135d2908390614274565b90508015806135e857506135e5836137dc565b81115b15610aee576040517f1c26714c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fa5460ff16156120fa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a20706175736564000000000000000000000000000000006044820152606401611895565b600061369661361f565b6136a03083612f43565b61012c546040517f151dd7550000000000000000000000000000000000000000000000000000000081523060048201526024810184905273ffffffffffffffffffffffffffffffffffffffff85811660448301529091169063151dd755906064016020604051808303816000875af1158015613720573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613744919061416a565b30600090815260c86020526040902054909150801561376857613768308583612661565b509392505050565b60fa5460ff166120fa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5061757361626c653a206e6f74207061757365640000000000000000000000006044820152606401611895565b600060228251101561381a576040517fa86b651200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506022015190565b803561ffff8116811461383457600080fd5b919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156138af576138af613839565b604052919050565b600067ffffffffffffffff8211156138d1576138d1613839565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b600082601f83011261390e57600080fd5b813561392161391c826138b7565b613868565b81815284602083860101111561393657600080fd5b816020850160208301376000918101602001919091529392505050565b67ffffffffffffffff811681146112cf57600080fd5b6000806000806080858703121561397f57600080fd5b61398885613822565b9350602085013567ffffffffffffffff808211156139a557600080fd5b6139b1888389016138fd565b9450604087013591506139c382613953565b909250606086013590808211156139d957600080fd5b506139e6878288016138fd565b91505092959194509250565b73ffffffffffffffffffffffffffffffffffffffff811681146112cf57600080fd5b8035613834816139f2565b60008060408385031215613a3257600080fd5b823591506020830135613a44816139f2565b809150509250929050565b600060208284031215613a6157600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610fcc57600080fd5b60005b83811015613aac578181015183820152602001613a94565b50506000910152565b60008151808452613acd816020860160208601613a91565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610fcc6020830184613ab5565b600060208284031215613b2457600080fd5b610fcc82613822565b60008060408385031215613b4057600080fd5b8235613b4b816139f2565b946020939093013593505050565b60008060008060008060c08789031215613b7257600080fd5b613b7b87613822565b9550602087013567ffffffffffffffff80821115613b9857600080fd5b613ba48a838b016138fd565b96506040890135955060608901359150613bbd826139f2565b909350608088013590613bcf826139f2565b90925060a08801359080821115613be557600080fd5b50613bf289828a016138fd565b9150509295509295509295565b600080600060608486031215613c1457600080fd5b8335613c1f816139f2565b92506020840135613c2f816139f2565b929592945050506040919091013590565b80151581146112cf57600080fd5b600080600080600060a08688031215613c6657600080fd5b613c6f86613822565b9450602086013567ffffffffffffffff80821115613c8c57600080fd5b613c9889838a016138fd565b95506040880135945060608801359150613cb182613c40565b90925060808701359080821115613cc757600080fd5b50613cd4888289016138fd565b9150509295509295909350565b60008083601f840112613cf357600080fd5b50813567ffffffffffffffff811115613d0b57600080fd5b602083019150836020828501011115613d2357600080fd5b9250929050565b600080600060408486031215613d3f57600080fd5b613d4884613822565b9250602084013567ffffffffffffffff811115613d6457600080fd5b613d7086828701613ce1565b9497909650939450505050565b600060208284031215613d8f57600080fd5b5035919050565b600080600060608486031215613dab57600080fd5b613db484613822565b9250602084013567ffffffffffffffff811115613dd057600080fd5b613ddc868287016138fd565b9250506040840135613ded81613953565b809150509250925092565b803560ff8116811461383457600080fd5b600060208284031215613e1b57600080fd5b610fcc82613df8565b600060208284031215613e3657600080fd5b8135610fcc816139f2565b6000806000806000806000806000806101408b8d031215613e6157600080fd5b613e6a8b613822565b995060208b013567ffffffffffffffff80821115613e8757600080fd5b613e938e838f016138fd565b9a5060408d01359950613ea860608e01613a14565b9850613eb660808e01613a14565b975060a08d0135915080821115613ecc57600080fd5b50613ed98d828e016138fd565b95505060c08b01359350613eef60e08c01613df8565b92506101008b013591506101208b013590509295989b9194979a5092959850565b60008060408385031215613f2357600080fd5b613f2c83613822565b9150613f3a60208401613822565b90509250929050565b600080600080600060a08688031215613f5b57600080fd5b853567ffffffffffffffff80821115613f7357600080fd5b613f7f89838a016138fd565b96506020880135915080821115613f9557600080fd5b50613fa2888289016138fd565b9450506040860135613fb3816139f2565b92506060860135613fc3816139f2565b949793965091946080013592915050565b600080600080600060808688031215613fec57600080fd5b613ff586613822565b945061400360208701613822565b935060408601359250606086013567ffffffffffffffff81111561402657600080fd5b61403288828901613ce1565b969995985093965092949392505050565b6000806040838503121561405657600080fd5b8235614061816139f2565b91506020830135613a44816139f2565b60008060006060848603121561408657600080fd5b61408f84613822565b925061409d60208501613822565b9150604084013590509250925092565b6000602082840312156140bf57600080fd5b8135610fcc81613c40565b600080600080608085870312156140e057600080fd5b6140e985613822565b93506140f760208601613822565b92506040850135614107816139f2565b9396929550929360600135925050565b600181811c9082168061412b57607f821691505b602082108103614164577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b60006020828403121561417c57600080fd5b5051919050565b60006020828403121561419557600080fd5b8151610fcc81613c40565b6040815260006141b36040830185613ab5565b90508260208301529392505050565b61ffff8616815273ffffffffffffffffffffffffffffffffffffffff8516602082015260a0604082015260006141fb60a0830186613ab5565b841515606084015282810360808401526142158185613ab5565b98975050505050505050565b6000806040838503121561423457600080fd5b505080516020909101519092909150565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b80820180821115610c5257610c52614245565b8183823760009101908152919050565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b61ffff84168152604060208201526000612531604083018486614297565b60006020828403121561431057600080fd5b8151610fcc816139f2565b600061ffff808816835280871660208401525084604083015260806060830152614349608083018486614297565b979650505050505050565b60008251614366818460208701613a91565b9190910192915050565b601f821115612e9357600081815260208120601f850160051c810160208610156143975750805b601f850160051c820191505b81811015610fa5578281556001016143a3565b67ffffffffffffffff8311156143ce576143ce613839565b6143e2836143dc8354614117565b83614370565b6000601f84116001811461443457600085156143fe5750838201355b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600387901b1c1916600186901b178355610aee565b6000838152602090207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0861690835b828110156144835786850135825560209485019460019092019101614463565b50868210156144be577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88860031b161c19848701351681555b505060018560011b0183555050505050565b6000602082840312156144e257600080fd5b8151610fcc81613953565b600082601f8301126144fe57600080fd5b815161450c61391c826138b7565b81815284602083860101111561452157600080fd5b614532826020830160208701613a91565b949350505050565b60006020828403121561454c57600080fd5b815167ffffffffffffffff81111561456357600080fd5b614532848285016144ed565b61ffff8516815260806020820152600061458c6080830186613ab5565b67ffffffffffffffff8516604084015282810360608401526143498185613ab5565b81810381811115610c5257610c52614245565b600080604083850312156145d457600080fd5b825167ffffffffffffffff8111156145eb57600080fd5b6145f7858286016144ed565b925050602083015190509250929050565b815167ffffffffffffffff81111561462257614622613839565b614636816146308454614117565b84614370565b602080601f83116001811461468957600084156146535750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555610fa5565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b828110156146d6578886015182559484019460019091019084016146b7565b508582101561471257878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b61ffff8716815260c06020820152600061473f60c0830188613ab5565b82810360408401526147518188613ab5565b73ffffffffffffffffffffffffffffffffffffffff87811660608601528616608085015283810360a085015290506147898185613ab5565b999850505050505050505056fea26469706673582212202767c9b592155f672de23952e4bfd392bb4f7858cceb2ac2977220ca3b97676164736f6c63430008110033

Block Transaction Gas Used Reward
view all blocks sequenced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits

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.