ETH Price: $2,711.46 (+0.06%)

Contract

0xdF9080B6BfE4630a97A0655C0016E0e9B43a7C68
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

1 address found via
Transaction Hash
Method
Block
From
To
Send From217994602025-02-08 4:38:238 days ago1738989503IN
Aura: auraBal Proxy OFT
0.00044966 ETH0.001956823.55527287
Send From217150702025-01-27 9:49:1119 days ago1737971351IN
Aura: auraBal Proxy OFT
0.0003045 ETH0.000203344.77731866
Send From217150692025-01-27 9:48:5919 days ago1737971339IN
Aura: auraBal Proxy OFT
0.0003045 ETH0.002514444.74089778
Send From216958532025-01-24 17:27:4722 days ago1737739667IN
Aura: auraBal Proxy OFT
0.00029406 ETH0.0070418313.71944686
Send From216958392025-01-24 17:24:5922 days ago1737739499IN
Aura: auraBal Proxy OFT
0.00036958 ETH0.0086116816.6183974
Send From216930932025-01-24 8:13:5922 days ago1737706439IN
Aura: auraBal Proxy OFT
0.00028545 ETH0.00206073.9
Send From216710162025-01-21 6:16:4726 days ago1737440207IN
Aura: auraBal Proxy OFT
0.00035973 ETH0.005204379.17067293
Send From215594112025-01-05 16:16:1141 days ago1736093771IN
Aura: auraBal Proxy OFT
0.00030251 ETH0.0052337110.00058809
Send From215543392025-01-04 23:16:1142 days ago1736032571IN
Aura: auraBal Proxy OFT
0.00030251 ETH0.002759625.4
Send From215406342025-01-03 1:20:3544 days ago1735867235IN
Aura: auraBal Proxy OFT
0.00036268 ETH0.004691098.67993717
Send From215280162025-01-01 7:06:5945 days ago1735715219IN
Aura: auraBal Proxy OFT
0.00028025 ETH0.001772043.52935433
Send From214836842024-12-26 2:33:5952 days ago1735180439IN
Aura: auraBal Proxy OFT
0.00030648 ETH0.002127784.10331959
Send From214795922024-12-25 12:49:1152 days ago1735130951IN
Aura: auraBal Proxy OFT
0.00030648 ETH0.002447834.83520449
Send From214784082024-12-25 8:51:1152 days ago1735116671IN
Aura: auraBal Proxy OFT
0.00030648 ETH0.001763283.36943045
Send From214465032024-12-20 21:45:1157 days ago1734731111IN
Aura: auraBal Proxy OFT
0.00028789 ETH0.0057239410.56296944
Send From214096942024-12-15 18:26:1162 days ago1734287171IN
Aura: auraBal Proxy OFT
0.00028391 ETH0.004086838.07271254
Send From214040792024-12-14 23:36:3563 days ago1734219395IN
Aura: auraBal Proxy OFT
0.00025518 ETH0.003841947.48534273
Send From213918462024-12-13 6:37:4765 days ago1734071867IN
Aura: auraBal Proxy OFT
0.00025224 ETH0.0066216311.52904785
Send From213482882024-12-07 4:39:4771 days ago1733546387IN
Aura: auraBal Proxy OFT
0.00025698 ETH0.0062433411.55206761
Send From213225922024-12-03 14:31:4774 days ago1733236307IN
Aura: auraBal Proxy OFT
0.00050375 ETH0.0159307730.35659581
Send From212861002024-11-28 12:07:5979 days ago1732795679IN
Aura: auraBal Proxy OFT
0.00028047 ETH0.00491019.29286169
Send From212596972024-11-24 19:28:5983 days ago1732476539IN
Aura: auraBal Proxy OFT
0.00029007 ETH0.0050583910.11500445
Send From212520432024-11-23 17:50:2384 days ago1732384223IN
Aura: auraBal Proxy OFT
0.00036436 ETH0.0098623719.03191529
Send From212412592024-11-22 5:43:3586 days ago1732254215IN
Aura: auraBal Proxy OFT
0.00036143 ETH0.0061494111.53082682
Send From211531872024-11-09 22:48:5998 days ago1731192539IN
Aura: auraBal Proxy OFT
0.00040853 ETH0.0075051914.02049603
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block
From
To
218357872025-02-13 6:30:473 days ago1739428247
Aura: auraBal Proxy OFT
0.00080319 ETH
218357872025-02-13 6:30:473 days ago1739428247
Aura: auraBal Proxy OFT
0.00080319 ETH
218357872025-02-13 6:30:473 days ago1739428247
Aura: auraBal Proxy OFT
0.00080319 ETH
218357872025-02-13 6:30:473 days ago1739428247
Aura: auraBal Proxy OFT
0.00080319 ETH
218357872025-02-13 6:30:473 days ago1739428247
Aura: auraBal Proxy OFT
0.00072178 ETH
218357872025-02-13 6:30:473 days ago1739428247
Aura: auraBal Proxy OFT
0.00072178 ETH
218357872025-02-13 6:30:473 days ago1739428247
Aura: auraBal Proxy OFT
0.00072178 ETH
218357872025-02-13 6:30:473 days ago1739428247
Aura: auraBal Proxy OFT
0.00072178 ETH
218357872025-02-13 6:30:473 days ago1739428247
Aura: auraBal Proxy OFT
0.00073196 ETH
218357872025-02-13 6:30:473 days ago1739428247
Aura: auraBal Proxy OFT
0.00073196 ETH
218357872025-02-13 6:30:473 days ago1739428247
Aura: auraBal Proxy OFT
0.00073196 ETH
218357872025-02-13 6:30:473 days ago1739428247
Aura: auraBal Proxy OFT
0.00073196 ETH
218071782025-02-09 6:30:357 days ago1739082635
Aura: auraBal Proxy OFT
0.00080294 ETH
218071782025-02-09 6:30:357 days ago1739082635
Aura: auraBal Proxy OFT
0.00080294 ETH
218071782025-02-09 6:30:357 days ago1739082635
Aura: auraBal Proxy OFT
0.00080294 ETH
218071782025-02-09 6:30:357 days ago1739082635
Aura: auraBal Proxy OFT
0.00080294 ETH
218071782025-02-09 6:30:357 days ago1739082635
Aura: auraBal Proxy OFT
0.00072134 ETH
218071782025-02-09 6:30:357 days ago1739082635
Aura: auraBal Proxy OFT
0.00072134 ETH
218071782025-02-09 6:30:357 days ago1739082635
Aura: auraBal Proxy OFT
0.00072134 ETH
218071782025-02-09 6:30:357 days ago1739082635
Aura: auraBal Proxy OFT
0.00072134 ETH
218071782025-02-09 6:30:357 days ago1739082635
Aura: auraBal Proxy OFT
0.00072646 ETH
218071782025-02-09 6:30:357 days ago1739082635
Aura: auraBal Proxy OFT
0.00072646 ETH
218071782025-02-09 6:30:357 days ago1739082635
Aura: auraBal Proxy OFT
0.00072646 ETH
218071782025-02-09 6:30:357 days ago1739082635
Aura: auraBal Proxy OFT
0.00072646 ETH
217994602025-02-08 4:38:238 days ago1738989503
Aura: auraBal Proxy OFT
0.00044966 ETH
View All Internal Transactions
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0xab07f027...D007B6764
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
AuraBalProxyOFT

Compiler Version
v0.8.11+commit.d7f03943

Optimization Enabled:
Yes with 800 runs

Other Settings:
default evmVersion
File 1 of 27 : AuraBalProxyOFT.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.11;

import { IERC20 } from "@openzeppelin/contracts-0.8/token/ERC20/IERC20.sol";
import { ReentrancyGuard } from "@openzeppelin/contracts-0.8/security/ReentrancyGuard.sol";
import { SafeERC20 } from "@openzeppelin/contracts-0.8/token/ERC20/utils/SafeERC20.sol";
import { IGenericVault } from "../interfaces/IGenericVault.sol";
import { IVirtualRewards } from "../interfaces/IVirtualRewards.sol";
import { CrossChainConfig } from "./CrossChainConfig.sol";
import { PausableProxyOFT } from "./PausableProxyOFT.sol";
import { IProxyOFT } from "../layerzero/token/oft/extension/IProxyOFT.sol";
import { AuraMath } from "../utils/AuraMath.sol";

/**
 * @title AuraBalProxyOFT
 * @author AuraFinance
 * @dev   Send and receive auraBAL to and from all the sidechains.
 *        all auraBAL sat in this bridge will be staked in the auraBAL
 *        compounder and rewards distributed to the L2 staking contracts
 */
contract AuraBalProxyOFT is PausableProxyOFT, CrossChainConfig, ReentrancyGuard {
    using SafeERC20 for IERC20;
    using AuraMath for uint256;

    /* -------------------------------------------------------------------
       Types 
    ------------------------------------------------------------------- */

    struct HarvestToken {
        address token;
        uint256 rewards;
    }

    /* -------------------------------------------------------------------
       Storage 
    ------------------------------------------------------------------- */

    /// @dev auraBAL compounder vault contract address
    address public vault;

    /// @dev Internally tracking of total auraBAL supply bridged
    uint256 public internalTotalSupply;

    /// @dev Harvest src chain IDs array
    uint16[] public harvestSrcChainIds;

    /// @dev token address mapped to amount
    mapping(address => uint256) public totalClaimable;

    /// @dev token address mapped srcChainId mapped to amount claimable
    mapping(address => mapping(uint16 => uint256)) public claimable;

    /// @dev srcChainId mapped to reward receiver
    mapping(uint16 => address) public rewardReceiver;

    /// @dev Authorized harvesters
    mapping(address => bool) public authorizedHarvesters;

    /// @dev Token to OFT
    mapping(address => address) public ofts;

    /* -------------------------------------------------------------------
       Events 
    ------------------------------------------------------------------- */

    /**
     * @dev Emitted when harvest rewards.
     * @param caller The caller
     * @param totalUnderlyingSum The total amount of auraBal staked on all sidechains.
     */
    event Harvest(address indexed caller, uint256 totalUnderlyingSum);

    /* -------------------------------------------------------------------
       Constructor 
    ------------------------------------------------------------------- */

    /**
     * @dev Constructs the AuraBalProxyOFT contract
     * @param _lzEndpoint   LayerZero endpoint contract
     * @param _token        The proxied token (auraBAL)
     * @param _vault        The AuraBal compounder vault
     * @param _guardian     The pause guardian address
     * @param _sudo         The super user address
     * @param _inflowLimit  Initial inflow limit per epoch
     */
    constructor(
        address _lzEndpoint,
        address _token,
        address _vault,
        address _guardian,
        address _sudo,
        uint256 _inflowLimit
    ) PausableProxyOFT(_token, _sudo, _inflowLimit) {
        vault = _vault;

        _initializeLzApp(_lzEndpoint);
        _initializePauseGuardian(_guardian);

        IERC20(_token).safeApprove(_vault, type(uint256).max);
    }

    /* -------------------------------------------------------------------
       Setter functions 
    ------------------------------------------------------------------- */

    /**
     * @dev Sets the configuration for a given source chain ID and selector.
     * @param _srcChainId The source chain ID.
     * @param _selector The selector.
     * @param _adapterParams The adapter params.
     */
    function setAdapterParams(
        uint16 _srcChainId,
        bytes32 _selector,
        bytes memory _adapterParams
    ) external override onlyOwner {
        _setAdapterParams(_srcChainId, _selector, _adapterParams);
    }

    /**
     * @dev Set reward receiver for src chain
     * @param _srcChainId The source chain ID
     * @param _receiver The receiver address
     */
    function setRewardReceiver(uint16 _srcChainId, address _receiver) external onlyOwner {
        rewardReceiver[_srcChainId] = _receiver;
    }

    /**
     * @dev Adds or remove an address from the harvesters' whitelist
     * @param _harvester address of the authorized harvester
     * @param _authorized Whether to add or remove harvester
     */
    function updateAuthorizedHarvesters(address _harvester, bool _authorized) external onlyOwner {
        authorizedHarvesters[_harvester] = _authorized;
    }

    /**
     * @dev Set OFT for token
     * @param _token Token contract address
     * @param _oft OFT contract address
     */
    function setOFT(address _token, address _oft) external onlyOwner {
        ofts[_token] = _oft;
    }

    /**
     * @dev Set srcChainIds to loop through for harvest
     * @param _srcChainIds Source chain IDs
     */
    function setHarvestSrcChainIds(uint16[] memory _srcChainIds) external onlyOwner {
        delete harvestSrcChainIds;

        uint256 len = _srcChainIds.length;
        for (uint256 i = 0; i < len; i++) {
            harvestSrcChainIds.push(_srcChainIds[i]);
        }
    }

    /* -------------------------------------------------------------------
       View functions 
    ------------------------------------------------------------------- */

    /**
     * @dev returns the circulating amount of tokens on current chain
     */
    function circulatingSupply() public view override returns (uint256) {
        return innerToken.totalSupply() - internalTotalSupply;
    }

    /* -------------------------------------------------------------------
       Credit/Debit 
    ------------------------------------------------------------------- */

    /**
     * @dev Override debitFrom to include a stake call after
     * @param _from From address
     * @param _srcChainId Source chain ID
     * @param _toAddress Address to send to
     * @param _amount Amount to send
     */
    function _debitFrom(
        address _from,
        uint16 _srcChainId,
        bytes memory _toAddress,
        uint256 _amount
    ) internal override returns (uint256) {
        uint256 amount = super._debitFrom(_from, _srcChainId, _toAddress, _amount);
        amount = _stakeAll();
        internalTotalSupply += amount;
        return amount;
    }

    /**
     * @dev Override _creditTo to include a withdraw from vault before
     * @param _srcChainId Source chain ID
     * @param _toAddress Address to credit to
     * @param _amount Amount to credit
     */
    function _creditTo(
        uint16 _srcChainId,
        address _toAddress,
        uint256 _amount
    ) internal override returns (uint256) {
        _withdraw(_amount);
        uint256 amount = super._creditTo(_srcChainId, _toAddress, _amount);
        internalTotalSupply -= amount;
        return amount;
    }

    /* -------------------------------------------------------------------
       Harvest Rewards 
    ------------------------------------------------------------------- */

    /**
     * @dev Harvest rewards from the compounder and distribute them to the source chains
     *
     *      Collect the amount of auraBAL that is staked on each source chain (L2). Then
     *      trigger a harvest on the vault which calculates the amount of auraBAL that has
     *      been earned since the last claim and the amount of extra rewards. These rewards
     *      are then lazily distributed to the src chains proportionally.
     *
     *      Lazily meaning the claimable values are just added to a claimable mapping for
     *      processing latest via processClaimable
     *
     * @param _totalUnderlying Array of totalUnderlying auraBAL staked on the source chain
     * @param _totalUnderlyingSum Sum of values in _totalUnderlying array
     */
    function harvest(uint256[] memory _totalUnderlying, uint256 _totalUnderlyingSum) external {
        require(authorizedHarvesters[msg.sender], "!harvester");

        uint256 srcChainIdsLen = harvestSrcChainIds.length;
        require(srcChainIdsLen == _totalUnderlying.length, "!parity");

        HarvestToken[] memory harvestTokens = _processHarvestableTokens();

        // For each chain we are sending rewards to loop through the harvestable
        // tokens and add the proportional rewards to the claimable mapping
        //
        // Keep track of the sum of the totalUnderlying to verify the user input
        // _totalUnderlyingSum is correct
        uint256 harvestTokenslen = harvestTokens.length;
        for (uint256 j = 0; j < harvestTokenslen; j++) {
            HarvestToken memory harvestToken = harvestTokens[j];
            uint256 totalHarvested = 0;
            uint256 accUnderlying = 0;

            for (uint256 i = 0; i < srcChainIdsLen; i++) {
                uint256 totalUnderlying = _totalUnderlying[i];
                uint256 amount = harvestToken.rewards.mul(totalUnderlying).div(_totalUnderlyingSum);

                totalHarvested += amount;
                accUnderlying += totalUnderlying;

                claimable[harvestToken.token][harvestSrcChainIds[i]] += amount;
            }

            totalClaimable[harvestToken.token] += totalHarvested;

            if (j + 1 == harvestTokenslen) {
                // We only need to emit this event and run this require
                // at the end of the last loop as it is the same for each
                require(accUnderlying == _totalUnderlyingSum, "!sum");
                emit Harvest(msg.sender, _totalUnderlyingSum);
            }
        }
    }

    /**
     * @dev Process claimable rewards
     * @param _token The token to process
     * @param _srcChainId The source chain ID
     * @param _zroPaymentAddress The LayerZero ZRO payment address
     */
    function processClaimable(
        address _token,
        uint16 _srcChainId,
        address _zroPaymentAddress
    ) external payable whenNotPaused nonReentrant {
        address receiver = rewardReceiver[_srcChainId];
        uint256 reward = claimable[_token][_srcChainId];
        address oft = ofts[_token];

        require(receiver != address(0), "0");
        require(reward > 0, "!reward");
        require(oft != address(0), "!oft");

        claimable[_token][_srcChainId] = 0;
        totalClaimable[_token] -= reward;

        bytes memory adapterParams = getAdapterParams[_srcChainId][
            keccak256(
                abi.encodeWithSignature("processClaimable(address,uint16,address)", _token, _srcChainId, address(0))
            )
        ];

        if (_token == address(innerToken)) {
            require(oft == address(this), "!oft");
            // The token is this inner token so we need to call the internal
            // bridge mint/burn functions rather than sendFrom
            internalTotalSupply += reward;
            _lzSend(
                _srcChainId,
                abi.encode(PT_SEND, abi.encodePacked(receiver), reward),
                payable(msg.sender),
                _zroPaymentAddress,
                adapterParams,
                msg.value
            );

            emit SendToChain(_srcChainId, address(this), abi.encode(receiver), reward);
        } else {
            // The token is one that this contract holds a balance of eg $AURA
            // bridge it to the L2 via it's proxy OFT contracts
            IERC20(_token).safeIncreaseAllowance(oft, reward);
            IProxyOFT(oft).sendFrom{ value: msg.value }(
                address(this),
                _srcChainId,
                abi.encodePacked(receiver),
                reward,
                payable(msg.sender),
                _zroPaymentAddress,
                adapterParams
            );
        }
    }

    /* -------------------------------------------------------------------
      Vault Wrapper 
    ------------------------------------------------------------------- */

    /**
     * @notice Execute a function on the vault
     * @dev    In order to account for the withdrawalPenalty this contract needs
     *         To be the owner of the auraBAL vault. Therefore it needs to be
     *         able to call vault owner functions. Rather than wrapping each
     *         function we can just use an execute pointing at the vault
     */
    function vaultExecute(uint256 _value, bytes calldata _data) external onlyOwner returns (bool, bytes memory) {
        (bool success, bytes memory result) = vault.call{ value: _value }(_data);
        require(success, "!success");

        return (success, result);
    }

    /* -------------------------------------------------------------------
      Overrides 
    ------------------------------------------------------------------- */

    /**
     * @notice Rescues the specified amount of tokens from the bridge and transfers them to the specified address.
     * @dev This function is only callable by the sudo address.
     * @param _token The address of the token to be rescued.
     * @param _to The address to which the tokens should be transferred.
     * @param _amount The amount of tokens to be rescued.
     */
    function rescue(
        address _token,
        address _to,
        uint256 _amount
    ) external override {
        require(msg.sender == sudo, "!sudo");

        // Adjust the internalTotalSupply. This means we have to harvest and process
        // any rewards if we want to rescue the entire underlyingBalance of the bridge
        // otherwise this will underflow
        if (_token == address(innerToken)) {
            internalTotalSupply -= _amount;
            _withdraw(_amount);
        }

        IERC20(_token).safeTransfer(_to, _amount);
    }

    /* -------------------------------------------------------------------
      Internal 
    ------------------------------------------------------------------- */

    /**
     * @dev Withdraw from the vault
     * @param amount Amount to withdraw
     */
    function _withdraw(uint256 amount) internal {
        // Cache withdrawalPenalty so we can reset it
        uint256 withdrawalPenalty = IGenericVault(vault).withdrawalPenalty();
        IGenericVault(vault).setWithdrawalPenalty(0);
        // Process withdraw with 0 penalty
        uint256 withdrawn = IGenericVault(vault).withdraw(amount, address(this), address(this));
        // reset withdrawalPenalty
        IGenericVault(vault).setWithdrawalPenalty(withdrawalPenalty);
        require(withdrawn >= amount, "!withdrawn");
    }

    /**
     * @dev Stake all auraBAL in vault
     */
    function _stakeAll() internal returns (uint256) {
        uint256 amount = innerToken.balanceOf(address(this));
        IGenericVault(vault).deposit(amount, address(this));
        return amount;
    }

    /**
     * @dev Process harvestable tokens
     *      Grabs the amount of rewards for each reward token and returns an array of harvestTokens
     */
    function _processHarvestableTokens() internal returns (HarvestToken[] memory harvestTokens) {
        // Set up an array to contain all the tokens that need to be harvested
        // this will be all the extra rewards tokens and auraBAL
        uint256 extraRewardsLength = IGenericVault(vault).extraRewardsLength();
        harvestTokens = new HarvestToken[](extraRewardsLength + 1);

        // Add auraBAL as the first reward token to be harvested
        //
        // To calculate rewards we need to know the delta between auraBAL on the sidechains
        // and the auraBAL available on this bridge contract.
        //
        // - internalTotalSupply: auraBAL supply transferred to L2s
        // - underlyingBalance:   auraBAL balance of the bridge in the vault
        // - totalClaimable:      auraBAL that is claimable since the last harvest
        uint256 underlyingBalance = IGenericVault(vault).balanceOfUnderlying(address(this));
        uint256 rewards = underlyingBalance - internalTotalSupply - totalClaimable[address(innerToken)];
        harvestTokens[0] = HarvestToken(address(innerToken), rewards);

        // Loop through the extra reward token on the vault and add them to the
        // harvestTokens array for processing
        for (uint256 i = 0; i < extraRewardsLength; i++) {
            address extraRewards = IGenericVault(vault).extraRewards(i);
            address rewardToken = IVirtualRewards(extraRewards).rewardToken();
            IVirtualRewards(extraRewards).getReward();
            uint256 balance = IERC20(rewardToken).balanceOf(address(this));
            // Part of the balance is sat in the contract waiting to be claimable.
            // Subtract that from the current balance to get the newly harvested rewards
            uint256 rewardAmount = balance.sub(totalClaimable[rewardToken]);
            harvestTokens[i + 1] = HarvestToken(rewardToken, rewardAmount);
        }
    }
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

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

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

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

File 3 of 27 : Pausable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)

pragma solidity ^0.8.0;

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

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

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

    bool private _paused;

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

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

        _;

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

File 5 of 27 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @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 `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, 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 `sender` to `recipient` 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 sender,
        address recipient,
        uint256 amount
    ) external returns (bool);

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

File 6 of 27 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../../../utils/Address.sol";

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

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

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

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

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

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

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

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

File 7 of 27 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)

pragma solidity ^0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

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

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

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

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

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

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

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

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

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

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

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

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

File 8 of 27 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

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

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

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

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

File 10 of 27 : 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 11 of 27 : IGenericVault.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.11;

interface IGenericVault {
    function withdraw(
        uint256 _assets,
        address _receiver,
        address _owner
    ) external returns (uint256 _withdrawn);

    function withdrawAll(address _to) external returns (uint256 withdrawn);

    function depositAll(address _to) external returns (uint256 _shares);

    function deposit(uint256 _amount, address _receiver) external returns (uint256 _shares);

    function harvest() external;

    function balanceOfUnderlying(address user) external view returns (uint256 amount);

    function totalUnderlying() external view returns (uint256 total);

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

    function underlying() external view returns (address);

    function strategy() external view returns (address);

    function platform() external view returns (address);

    function setPlatform(address _platform) external;

    function setPlatformFee(uint256 _fee) external;

    function setCallIncentive(uint256 _incentive) external;

    function setWithdrawalPenalty(uint256 _penalty) external;

    function setApprovals() external;

    function callIncentive() external view returns (uint256);

    function withdrawalPenalty() external view returns (uint256);

    function platformFee() external view returns (uint256);

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

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

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

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

    function transferFrom(
        address from,
        address to,
        uint256 value
    ) external returns (bool);

    function extraRewardsLength() external view returns (uint256);

    function extraRewards(uint256) external view returns (address);
}

File 12 of 27 : IVirtualRewards.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.11;

interface IVirtualRewardFactory {
    function createVirtualReward(
        address,
        address,
        address
    ) external returns (address);
}

interface IVirtualRewards {
    function queueNewRewards(uint256) external;

    function rewardToken() external view returns (address);

    function getReward() external;
}

File 13 of 27 : ILayerZeroEndpoint.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.11;

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 14 of 27 : ILayerZeroReceiver.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.11;

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 15 of 27 : ILayerZeroUserApplicationConfig.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.11;

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

File 16 of 27 : LzApp.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.11;

import "@openzeppelin/contracts-0.8/access/Ownable.sol";
import "../interfaces/ILayerZeroReceiver.sol";
import "../interfaces/ILayerZeroUserApplicationConfig.sol";
import "../interfaces/ILayerZeroEndpoint.sol";
import "../util/BytesLib.sol";

/*
 * a generic LzReceiver implementation
 */
abstract contract LzApp is Ownable, ILayerZeroReceiver, ILayerZeroUserApplicationConfig {
    using BytesLib for bytes;

    // ua can not send payload larger than this by default, but it can be changed by the ua owner
    uint256 public constant DEFAULT_PAYLOAD_SIZE_LIMIT = 10000;

    ILayerZeroEndpoint public lzEndpoint;
    mapping(uint16 => bytes) public trustedRemoteLookup;
    mapping(uint16 => mapping(uint16 => uint256)) public minDstGasLookup;
    mapping(uint16 => uint256) public payloadSizeLimitLookup;
    address public precrime;

    event SetPrecrime(address precrime);
    event SetTrustedRemote(uint16 _remoteChainId, bytes _path);
    event SetTrustedRemoteAddress(uint16 _remoteChainId, bytes _remoteAddress);
    event SetMinDstGas(uint16 _dstChainId, uint16 _type, uint256 _minDstGas);

    function _initializeLzApp(address _endpoint) internal {
        require(address(lzEndpoint) == address(0), "already initialized");
        require(_endpoint != address(0), "endpoint=0");
        lzEndpoint = ILayerZeroEndpoint(_endpoint);
    }

    function lzReceive(
        uint16 _srcChainId,
        bytes calldata _srcAddress,
        uint64 _nonce,
        bytes calldata _payload
    ) public virtual override {
        // lzReceive must be called by the endpoint for security
        require(_msgSender() == address(lzEndpoint), "LzApp: invalid endpoint caller");

        bytes memory trustedRemote = trustedRemoteLookup[_srcChainId];
        // if will still block the message pathway from (srcChainId, srcAddress).
        // should not receive message from untrusted remote.
        require(
            _srcAddress.length == trustedRemote.length &&
                trustedRemote.length > 0 &&
                keccak256(_srcAddress) == keccak256(trustedRemote),
            "LzApp: invalid source sending contract"
        );

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

    // abstract function - the default behaviour of LayerZero is blocking.
    // See: NonblockingLzApp if you dont need to enforce ordered messaging
    function _blockingLzReceive(
        uint16 _srcChainId,
        bytes memory _srcAddress,
        uint64 _nonce,
        bytes memory _payload
    ) internal virtual;

    function _lzSend(
        uint16 _dstChainId,
        bytes memory _payload,
        address payable _refundAddress,
        address _zroPaymentAddress,
        bytes memory _adapterParams,
        uint256 _nativeFee
    ) internal virtual {
        bytes memory trustedRemote = trustedRemoteLookup[_dstChainId];
        require(trustedRemote.length != 0, "LzApp: destination chain is not a trusted source");
        _checkPayloadSize(_dstChainId, _payload.length);
        lzEndpoint.send{ value: _nativeFee }(
            _dstChainId,
            trustedRemote,
            _payload,
            _refundAddress,
            _zroPaymentAddress,
            _adapterParams
        );
    }

    function _checkGasLimit(
        uint16 _dstChainId,
        uint16 _type,
        bytes memory _adapterParams,
        uint256 _extraGas
    ) internal view virtual {
        uint256 providedGasLimit = _getGasLimit(_adapterParams);
        uint256 minGasLimit = minDstGasLookup[_dstChainId][_type] + _extraGas;
        require(minGasLimit > 0, "LzApp: minGasLimit not set");
        require(providedGasLimit >= minGasLimit, "LzApp: gas limit is too low");
    }

    function _getGasLimit(bytes memory _adapterParams) internal pure virtual returns (uint256 gasLimit) {
        require(_adapterParams.length >= 34, "LzApp: invalid adapterParams");
        assembly {
            gasLimit := mload(add(_adapterParams, 34))
        }
    }

    function _checkPayloadSize(uint16 _dstChainId, uint256 _payloadSize) internal view virtual {
        uint256 payloadSizeLimit = payloadSizeLimitLookup[_dstChainId];
        if (payloadSizeLimit == 0) {
            // use default if not set
            payloadSizeLimit = DEFAULT_PAYLOAD_SIZE_LIMIT;
        }
        require(_payloadSize <= payloadSizeLimit, "LzApp: payload size is too large");
    }

    //---------------------------UserApplication config----------------------------------------
    function getConfig(
        uint16 _version,
        uint16 _chainId,
        address,
        uint256 _configType
    ) external view returns (bytes memory) {
        return lzEndpoint.getConfig(_version, _chainId, address(this), _configType);
    }

    // generic config for LayerZero user Application
    function setConfig(
        uint16 _version,
        uint16 _chainId,
        uint256 _configType,
        bytes calldata _config
    ) external override onlyOwner {
        lzEndpoint.setConfig(_version, _chainId, _configType, _config);
    }

    function setSendVersion(uint16 _version) external override onlyOwner {
        lzEndpoint.setSendVersion(_version);
    }

    function setReceiveVersion(uint16 _version) external override onlyOwner {
        lzEndpoint.setReceiveVersion(_version);
    }

    function forceResumeReceive(uint16 _srcChainId, bytes calldata _srcAddress) external override onlyOwner {
        lzEndpoint.forceResumeReceive(_srcChainId, _srcAddress);
    }

    // _path = abi.encodePacked(remoteAddress, localAddress)
    // this function set the trusted path for the cross-chain communication
    function setTrustedRemote(uint16 _srcChainId, bytes calldata _path) external onlyOwner {
        trustedRemoteLookup[_srcChainId] = _path;
        emit SetTrustedRemote(_srcChainId, _path);
    }

    function setTrustedRemoteAddress(uint16 _remoteChainId, bytes calldata _remoteAddress) external onlyOwner {
        trustedRemoteLookup[_remoteChainId] = abi.encodePacked(_remoteAddress, address(this));
        emit SetTrustedRemoteAddress(_remoteChainId, _remoteAddress);
    }

    function getTrustedRemoteAddress(uint16 _remoteChainId) external view returns (bytes memory) {
        bytes memory path = trustedRemoteLookup[_remoteChainId];
        require(path.length != 0, "LzApp: no trusted path record");
        return path.slice(0, path.length - 20); // the last 20 bytes should be address(this)
    }

    function setPrecrime(address _precrime) external onlyOwner {
        precrime = _precrime;
        emit SetPrecrime(_precrime);
    }

    function setMinDstGas(
        uint16 _dstChainId,
        uint16 _packetType,
        uint256 _minGas
    ) external onlyOwner {
        require(_minGas > 0, "LzApp: invalid minGas");
        minDstGasLookup[_dstChainId][_packetType] = _minGas;
        emit SetMinDstGas(_dstChainId, _packetType, _minGas);
    }

    // if the size is 0, it means default size limit
    function setPayloadSizeLimit(uint16 _dstChainId, uint256 _size) external onlyOwner {
        payloadSizeLimitLookup[_dstChainId] = _size;
    }

    //--------------------------- VIEW FUNCTION ----------------------------------------
    function isTrustedRemote(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (bool) {
        bytes memory trustedSource = trustedRemoteLookup[_srcChainId];
        return keccak256(trustedSource) == keccak256(_srcAddress);
    }
}

File 17 of 27 : NonblockingLzApp.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.11;

import "./LzApp.sol";
import "../util/ExcessivelySafeCall.sol";

/*
 * the default LayerZero messaging behaviour is blocking, i.e. any failed message will block the channel
 * this abstract class try-catch all fail messages and store locally for future retry. hence, non-blocking
 * NOTE: if the srcAddress is not configured properly,
 * it will still block the message pathway from (srcChainId, srcAddress)
 */
abstract contract NonblockingLzApp is LzApp {
    using ExcessivelySafeCall for address;

    mapping(uint16 => mapping(bytes => mapping(uint64 => bytes32))) public failedMessages;

    event MessageFailed(uint16 _srcChainId, bytes _srcAddress, uint64 _nonce, bytes _payload, bytes _reason);
    event RetryMessageSuccess(uint16 _srcChainId, bytes _srcAddress, uint64 _nonce, bytes32 _payloadHash);

    // overriding the virtual function in LzReceiver
    function _blockingLzReceive(
        uint16 _srcChainId,
        bytes memory _srcAddress,
        uint64 _nonce,
        bytes memory _payload
    ) internal virtual override {
        (bool success, bytes memory reason) = address(this).excessivelySafeCall(
            gasleft(),
            150,
            abi.encodeWithSelector(this.nonblockingLzReceive.selector, _srcChainId, _srcAddress, _nonce, _payload)
        );
        // try-catch all errors/exceptions
        if (!success) {
            _storeFailedMessage(_srcChainId, _srcAddress, _nonce, _payload, reason);
        }
    }

    function _storeFailedMessage(
        uint16 _srcChainId,
        bytes memory _srcAddress,
        uint64 _nonce,
        bytes memory _payload,
        bytes memory _reason
    ) internal virtual {
        failedMessages[_srcChainId][_srcAddress][_nonce] = keccak256(_payload);
        emit MessageFailed(_srcChainId, _srcAddress, _nonce, _payload, _reason);
    }

    function nonblockingLzReceive(
        uint16 _srcChainId,
        bytes calldata _srcAddress,
        uint64 _nonce,
        bytes calldata _payload
    ) public virtual {
        // only internal transaction
        require(_msgSender() == address(this), "NonblockingLzApp: caller must be LzApp");
        _nonblockingLzReceive(_srcChainId, _srcAddress, _nonce, _payload);
    }

    //@notice override this function
    function _nonblockingLzReceive(
        uint16 _srcChainId,
        bytes memory _srcAddress,
        uint64 _nonce,
        bytes memory _payload
    ) internal virtual;

    function retryMessage(
        uint16 _srcChainId,
        bytes calldata _srcAddress,
        uint64 _nonce,
        bytes calldata _payload
    ) public payable virtual {
        // assert there is message to retry
        bytes32 payloadHash = failedMessages[_srcChainId][_srcAddress][_nonce];
        require(payloadHash != bytes32(0), "NonblockingLzApp: no stored message");
        require(keccak256(_payload) == payloadHash, "NonblockingLzApp: invalid payload");
        // clear the stored message
        failedMessages[_srcChainId][_srcAddress][_nonce] = bytes32(0);
        // execute the message. revert if it fails again
        _nonblockingLzReceive(_srcChainId, _srcAddress, _nonce, _payload);
        emit RetryMessageSuccess(_srcChainId, _srcAddress, _nonce, payloadHash);
    }
}

File 18 of 27 : IProxyOFT.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.11;

import "../IOFTCore.sol";

/**
 * @dev Interface of the ProxyOFT standard
 */
interface IProxyOFT is IOFTCore {
    function innerToken() external view returns (address);
}

File 19 of 27 : ProxyOFT.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.11;

import "../OFTCore.sol";
import "@openzeppelin/contracts-0.8/token/ERC20/utils/SafeERC20.sol";

contract ProxyOFT is OFTCore {
    using SafeERC20 for IERC20;

    IERC20 internal immutable innerToken;

    constructor(address _token) {
        innerToken = IERC20(_token);
    }

    function circulatingSupply() public view virtual override returns (uint256) {
        unchecked {
            return innerToken.totalSupply() - innerToken.balanceOf(address(this));
        }
    }

    function token() public view virtual override returns (address) {
        return address(innerToken);
    }

    function _debitFrom(
        address _from,
        uint16,
        bytes memory,
        uint256 _amount
    ) internal virtual override returns (uint256) {
        require(_from == _msgSender(), "ProxyOFT: owner is not send caller");
        uint256 before = innerToken.balanceOf(address(this));
        innerToken.safeTransferFrom(_from, address(this), _amount);
        return innerToken.balanceOf(address(this)) - before;
    }

    function _creditTo(
        uint16,
        address _toAddress,
        uint256 _amount
    ) internal virtual override returns (uint256) {
        uint256 before = innerToken.balanceOf(_toAddress);
        innerToken.safeTransfer(_toAddress, _amount);
        return innerToken.balanceOf(_toAddress) - before;
    }
}

File 20 of 27 : IOFTCore.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.11;

import "@openzeppelin/contracts-0.8/utils/introspection/IERC165.sol";

/**
 * @dev Interface of the IOFT core standard
 */
interface IOFTCore is IERC165 {
    /**
     * @dev estimate send token `_tokenId` to (`_dstChainId`, `_toAddress`)
     * _dstChainId - L0 defined chain id to send tokens too
     * _toAddress - dynamic bytes array which contains the address to whom you are sending tokens to on the dstChain
     * _amount - amount of the tokens to transfer
     * _useZro - indicates to use zro to pay L0 fees
     * _adapterParam - 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);

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

    /**
     * @dev returns the circulating amount of tokens on current chain
     */
    function circulatingSupply() external view returns (uint256);

    /**
     * @dev returns the address of the ERC20 token
     */
    function token() external view returns (address);

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

    /**
     * @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, address indexed _to, uint256 _amount);

    event SetUseCustomAdapterParams(bool _useCustomAdapterParams);
}

File 21 of 27 : OFTCore.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.11;

import "../../lzApp/NonblockingLzApp.sol";
import "./IOFTCore.sol";
import "@openzeppelin/contracts-0.8/utils/introspection/ERC165.sol";

abstract contract OFTCore is NonblockingLzApp, ERC165, IOFTCore {
    using BytesLib for bytes;

    uint256 public constant NO_EXTRA_GAS = 0;

    // packet type
    uint16 public constant PT_SEND = 0;

    bool public useCustomAdapterParams;

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

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

    function sendFrom(
        address _from,
        uint16 _dstChainId,
        bytes calldata _toAddress,
        uint256 _amount,
        address payable _refundAddress,
        address _zroPaymentAddress,
        bytes calldata _adapterParams
    ) public payable virtual override {
        _send(_from, _dstChainId, _toAddress, _amount, _refundAddress, _zroPaymentAddress, _adapterParams);
    }

    function setUseCustomAdapterParams(bool _useCustomAdapterParams) public virtual onlyOwner {
        useCustomAdapterParams = _useCustomAdapterParams;
        emit SetUseCustomAdapterParams(_useCustomAdapterParams);
    }

    function _nonblockingLzReceive(
        uint16 _srcChainId,
        bytes memory _srcAddress,
        uint64 _nonce,
        bytes memory _payload
    ) internal virtual override {
        uint16 packetType;
        assembly {
            packetType := mload(add(_payload, 32))
        }

        if (packetType == PT_SEND) {
            _sendAck(_srcChainId, _srcAddress, _nonce, _payload);
        } else {
            revert("OFTCore: unknown packet type");
        }
    }

    function _send(
        address _from,
        uint16 _dstChainId,
        bytes memory _toAddress,
        uint256 _amount,
        address payable _refundAddress,
        address _zroPaymentAddress,
        bytes memory _adapterParams
    ) internal virtual {
        _checkAdapterParams(_dstChainId, PT_SEND, _adapterParams, NO_EXTRA_GAS);

        uint256 amount = _debitFrom(_from, _dstChainId, _toAddress, _amount);

        bytes memory lzPayload = abi.encode(PT_SEND, _toAddress, amount);
        _lzSend(_dstChainId, lzPayload, _refundAddress, _zroPaymentAddress, _adapterParams, msg.value);

        emit SendToChain(_dstChainId, _from, _toAddress, amount);
    }

    function _sendAck(
        uint16 _srcChainId,
        bytes memory,
        uint64,
        bytes memory _payload
    ) internal virtual {
        (, bytes memory toAddressBytes, uint256 amount) = abi.decode(_payload, (uint16, bytes, uint256));

        address to = toAddressBytes.toAddress(0);

        amount = _creditTo(_srcChainId, to, amount);
        emit ReceiveFromChain(_srcChainId, to, amount);
    }

    function _checkAdapterParams(
        uint16 _dstChainId,
        uint16 _pkType,
        bytes memory _adapterParams,
        uint256 _extraGas
    ) internal virtual {
        if (useCustomAdapterParams) {
            _checkGasLimit(_dstChainId, _pkType, _adapterParams, _extraGas);
        } else {
            require(_adapterParams.length == 0, "OFTCore: _adapterParams must be empty.");
        }
    }

    function _debitFrom(
        address _from,
        uint16 _dstChainId,
        bytes memory _toAddress,
        uint256 _amount
    ) internal virtual returns (uint256);

    function _creditTo(
        uint16 _srcChainId,
        address _toAddress,
        uint256 _amount
    ) internal virtual returns (uint256);
}

File 22 of 27 : BytesLib.sol
// SPDX-License-Identifier: Unlicense
/*
 * @title Solidity Bytes Arrays Utils
 * @author Gonçalo Sá <[email protected]>
 *
 * @dev Bytes tightly packed arrays utility library for ethereum contracts written in Solidity.
 *      The library lets you concatenate, slice and type cast bytes arrays both in memory and storage.
 */
pragma solidity 0.8.11;

library BytesLib {
    function concat(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bytes memory) {
        bytes memory tempBytes;

        assembly {
            // Get a location of some free memory and store it in tempBytes as
            // Solidity does for memory variables.
            tempBytes := mload(0x40)

            // Store the length of the first bytes array at the beginning of
            // the memory for tempBytes.
            let length := mload(_preBytes)
            mstore(tempBytes, length)

            // Maintain a memory counter for the current write location in the
            // temp bytes array by adding the 32 bytes for the array length to
            // the starting location.
            let mc := add(tempBytes, 0x20)
            // Stop copying when the memory counter reaches the length of the
            // first bytes array.
            let end := add(mc, length)

            for {
                // Initialize a copy counter to the start of the _preBytes data,
                // 32 bytes into its memory.
                let cc := add(_preBytes, 0x20)
            } lt(mc, end) {
                // Increase both counters by 32 bytes each iteration.
                mc := add(mc, 0x20)
                cc := add(cc, 0x20)
            } {
                // Write the _preBytes data into the tempBytes memory 32 bytes
                // at a time.
                mstore(mc, mload(cc))
            }

            // Add the length of _postBytes to the current length of tempBytes
            // and store it as the new length in the first 32 bytes of the
            // tempBytes memory.
            length := mload(_postBytes)
            mstore(tempBytes, add(length, mload(tempBytes)))

            // Move the memory counter back from a multiple of 0x20 to the
            // actual end of the _preBytes data.
            mc := end
            // Stop copying when the memory counter reaches the new combined
            // length of the arrays.
            end := add(mc, length)

            for {
                let cc := add(_postBytes, 0x20)
            } lt(mc, end) {
                mc := add(mc, 0x20)
                cc := add(cc, 0x20)
            } {
                mstore(mc, mload(cc))
            }

            // Update the free-memory pointer by padding our last write location
            // to 32 bytes: add 31 bytes to the end of tempBytes to move to the
            // next 32 byte block, then round down to the nearest multiple of
            // 32. If the sum of the length of the two arrays is zero then add
            // one before rounding down to leave a blank 32 bytes (the length block with 0).
            mstore(
                0x40,
                and(
                    add(add(end, iszero(add(length, mload(_preBytes)))), 31),
                    not(31) // Round down to the nearest 32 bytes.
                )
            )
        }

        return tempBytes;
    }

    function concatStorage(bytes storage _preBytes, bytes memory _postBytes) internal {
        assembly {
            // Read the first 32 bytes of _preBytes storage, which is the length
            // of the array. (We don't need to use the offset into the slot
            // because arrays use the entire slot.)
            let fslot := sload(_preBytes.slot)
            // Arrays of 31 bytes or less have an even value in their slot,
            // while longer arrays have an odd value. The actual length is
            // the slot divided by two for odd values, and the lowest order
            // byte divided by two for even values.
            // If the slot is even, bitwise and the slot with 255 and divide by
            // two to get the length. If the slot is odd, bitwise and the slot
            // with -1 and divide by two.
            let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)
            let mlength := mload(_postBytes)
            let newlength := add(slength, mlength)
            // slength can contain both the length and contents of the array
            // if length < 32 bytes so let's prepare for that
            // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage
            switch add(lt(slength, 32), lt(newlength, 32))
            case 2 {
                // Since the new array still fits in the slot, we just need to
                // update the contents of the slot.
                // uint256(bytes_storage) = uint256(bytes_storage) + uint256(bytes_memory) + new_length
                sstore(
                    _preBytes.slot,
                    // all the modifications to the slot are inside this
                    // next block
                    add(
                        // we can just add to the slot contents because the
                        // bytes we want to change are the LSBs
                        fslot,
                        add(
                            mul(
                                div(
                                    // load the bytes from memory
                                    mload(add(_postBytes, 0x20)),
                                    // zero all bytes to the right
                                    exp(0x100, sub(32, mlength))
                                ),
                                // and now shift left the number of bytes to
                                // leave space for the length in the slot
                                exp(0x100, sub(32, newlength))
                            ),
                            // increase length by the double of the memory
                            // bytes length
                            mul(mlength, 2)
                        )
                    )
                )
            }
            case 1 {
                // The stored value fits in the slot, but the combined value
                // will exceed it.
                // get the keccak hash to get the contents of the array
                mstore(0x0, _preBytes.slot)
                let sc := add(keccak256(0x0, 0x20), div(slength, 32))

                // save new length
                sstore(_preBytes.slot, add(mul(newlength, 2), 1))

                // The contents of the _postBytes array start 32 bytes into
                // the structure. Our first read should obtain the `submod`
                // bytes that can fit into the unused space in the last word
                // of the stored array. To get this, we read 32 bytes starting
                // from `submod`, so the data we read overlaps with the array
                // contents by `submod` bytes. Masking the lowest-order
                // `submod` bytes allows us to add that value directly to the
                // stored value.

                let submod := sub(32, slength)
                let mc := add(_postBytes, submod)
                let end := add(_postBytes, mlength)
                let mask := sub(exp(0x100, submod), 1)

                sstore(
                    sc,
                    add(
                        and(fslot, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00),
                        and(mload(mc), mask)
                    )
                )

                for {
                    mc := add(mc, 0x20)
                    sc := add(sc, 1)
                } lt(mc, end) {
                    sc := add(sc, 1)
                    mc := add(mc, 0x20)
                } {
                    sstore(sc, mload(mc))
                }

                mask := exp(0x100, sub(mc, end))

                sstore(sc, mul(div(mload(mc), mask), mask))
            }
            default {
                // get the keccak hash to get the contents of the array
                mstore(0x0, _preBytes.slot)
                // Start copying to the last used word of the stored array.
                let sc := add(keccak256(0x0, 0x20), div(slength, 32))

                // save new length
                sstore(_preBytes.slot, add(mul(newlength, 2), 1))

                // Copy over the first `submod` bytes of the new data as in
                // case 1 above.
                let slengthmod := mod(slength, 32)
                let mlengthmod := mod(mlength, 32)
                let submod := sub(32, slengthmod)
                let mc := add(_postBytes, submod)
                let end := add(_postBytes, mlength)
                let mask := sub(exp(0x100, submod), 1)

                sstore(sc, add(sload(sc), and(mload(mc), mask)))

                for {
                    sc := add(sc, 1)
                    mc := add(mc, 0x20)
                } lt(mc, end) {
                    sc := add(sc, 1)
                    mc := add(mc, 0x20)
                } {
                    sstore(sc, mload(mc))
                }

                mask := exp(0x100, sub(mc, end))

                sstore(sc, mul(div(mload(mc), mask), mask))
            }
        }
    }

    function slice(
        bytes memory _bytes,
        uint256 _start,
        uint256 _length
    ) internal pure returns (bytes memory) {
        require(_length + 31 >= _length, "slice_overflow");
        require(_bytes.length >= _start + _length, "slice_outOfBounds");

        bytes memory tempBytes;

        assembly {
            switch iszero(_length)
            case 0 {
                // Get a location of some free memory and store it in tempBytes as
                // Solidity does for memory variables.
                tempBytes := mload(0x40)

                // The first word of the slice result is potentially a partial
                // word read from the original array. To read it, we calculate
                // the length of that partial word and start copying that many
                // bytes into the array. The first word we copy will start with
                // data we don't care about, but the last `lengthmod` bytes will
                // land at the beginning of the contents of the new array. When
                // we're done copying, we overwrite the full first word with
                // the actual length of the slice.
                let lengthmod := and(_length, 31)

                // The multiplication in the next line is necessary
                // because when slicing multiples of 32 bytes (lengthmod == 0)
                // the following copy loop was copying the origin's length
                // and then ending prematurely not copying everything it should.
                let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod)))
                let end := add(mc, _length)

                for {
                    // The multiplication in the next line has the same exact purpose
                    // as the one above.
                    let cc := add(add(add(_bytes, lengthmod), mul(0x20, iszero(lengthmod))), _start)
                } lt(mc, end) {
                    mc := add(mc, 0x20)
                    cc := add(cc, 0x20)
                } {
                    mstore(mc, mload(cc))
                }

                mstore(tempBytes, _length)

                //update free-memory pointer
                //allocating the array padded to 32 bytes like the compiler does now
                mstore(0x40, and(add(mc, 31), not(31)))
            }
            //if we want a zero-length slice let's just return a zero-length array
            default {
                tempBytes := mload(0x40)
                //zero out the 32 bytes slice we are about to return
                //we need to do it because Solidity does not garbage collect
                mstore(tempBytes, 0)

                mstore(0x40, add(tempBytes, 0x20))
            }
        }

        return tempBytes;
    }

    function toAddress(bytes memory _bytes, uint256 _start) internal pure returns (address) {
        require(_bytes.length >= _start + 20, "toAddress_outOfBounds");
        address tempAddress;

        assembly {
            tempAddress := div(mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000)
        }

        return tempAddress;
    }

    function toUint8(bytes memory _bytes, uint256 _start) internal pure returns (uint8) {
        require(_bytes.length >= _start + 1, "toUint8_outOfBounds");
        uint8 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0x1), _start))
        }

        return tempUint;
    }

    function toUint16(bytes memory _bytes, uint256 _start) internal pure returns (uint16) {
        require(_bytes.length >= _start + 2, "toUint16_outOfBounds");
        uint16 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0x2), _start))
        }

        return tempUint;
    }

    function toUint32(bytes memory _bytes, uint256 _start) internal pure returns (uint32) {
        require(_bytes.length >= _start + 4, "toUint32_outOfBounds");
        uint32 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0x4), _start))
        }

        return tempUint;
    }

    function toUint64(bytes memory _bytes, uint256 _start) internal pure returns (uint64) {
        require(_bytes.length >= _start + 8, "toUint64_outOfBounds");
        uint64 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0x8), _start))
        }

        return tempUint;
    }

    function toUint96(bytes memory _bytes, uint256 _start) internal pure returns (uint96) {
        require(_bytes.length >= _start + 12, "toUint96_outOfBounds");
        uint96 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0xc), _start))
        }

        return tempUint;
    }

    function toUint128(bytes memory _bytes, uint256 _start) internal pure returns (uint128) {
        require(_bytes.length >= _start + 16, "toUint128_outOfBounds");
        uint128 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0x10), _start))
        }

        return tempUint;
    }

    function toUint256(bytes memory _bytes, uint256 _start) internal pure returns (uint256) {
        require(_bytes.length >= _start + 32, "toUint256_outOfBounds");
        uint256 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0x20), _start))
        }

        return tempUint;
    }

    function toBytes32(bytes memory _bytes, uint256 _start) internal pure returns (bytes32) {
        require(_bytes.length >= _start + 32, "toBytes32_outOfBounds");
        bytes32 tempBytes32;

        assembly {
            tempBytes32 := mload(add(add(_bytes, 0x20), _start))
        }

        return tempBytes32;
    }

    function equal(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bool) {
        bool success = true;

        assembly {
            let length := mload(_preBytes)

            // if lengths don't match the arrays are not equal
            switch eq(length, mload(_postBytes))
            case 1 {
                // cb is a circuit breaker in the for loop since there's
                //  no said feature for inline assembly loops
                // cb = 1 - don't breaker
                // cb = 0 - break
                let cb := 1

                let mc := add(_preBytes, 0x20)
                let end := add(mc, length)

                for {
                    let cc := add(_postBytes, 0x20)
                    // the next line is the loop condition:
                    // while(uint256(mc < end) + cb == 2)
                } eq(add(lt(mc, end), cb), 2) {
                    mc := add(mc, 0x20)
                    cc := add(cc, 0x20)
                } {
                    // if any of these checks fails then arrays are not equal
                    if iszero(eq(mload(mc), mload(cc))) {
                        // unsuccess:
                        success := 0
                        cb := 0
                    }
                }
            }
            default {
                // unsuccess:
                success := 0
            }
        }

        return success;
    }

    function equalStorage(bytes storage _preBytes, bytes memory _postBytes) internal view returns (bool) {
        bool success = true;

        assembly {
            // we know _preBytes_offset is 0
            let fslot := sload(_preBytes.slot)
            // Decode the length of the stored array like in concatStorage().
            let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)
            let mlength := mload(_postBytes)

            // if lengths don't match the arrays are not equal
            switch eq(slength, mlength)
            case 1 {
                // slength can contain both the length and contents of the array
                // if length < 32 bytes so let's prepare for that
                // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage
                if iszero(iszero(slength)) {
                    switch lt(slength, 32)
                    case 1 {
                        // blank the last byte which is the length
                        fslot := mul(div(fslot, 0x100), 0x100)

                        if iszero(eq(fslot, mload(add(_postBytes, 0x20)))) {
                            // unsuccess:
                            success := 0
                        }
                    }
                    default {
                        // cb is a circuit breaker in the for loop since there's
                        //  no said feature for inline assembly loops
                        // cb = 1 - don't breaker
                        // cb = 0 - break
                        let cb := 1

                        // get the keccak hash to get the contents of the array
                        mstore(0x0, _preBytes.slot)
                        let sc := keccak256(0x0, 0x20)

                        let mc := add(_postBytes, 0x20)
                        let end := add(mc, mlength)

                        // the next line is the loop condition:
                        // while(uint256(mc < end) + cb == 2)
                        for {

                        } eq(add(lt(mc, end), cb), 2) {
                            sc := add(sc, 1)
                            mc := add(mc, 0x20)
                        } {
                            if iszero(eq(sload(sc), mload(mc))) {
                                // unsuccess:
                                success := 0
                                cb := 0
                            }
                        }
                    }
                }
            }
            default {
                // unsuccess:
                success := 0
            }
        }

        return success;
    }
}

File 23 of 27 : ExcessivelySafeCall.sol
// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity 0.8.11;

library ExcessivelySafeCall {
    uint256 constant LOW_28_MASK = 0x00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff;

    /// @notice Use when you _really_ really _really_ don't trust the called
    /// contract. This prevents the called contract from causing reversion of
    /// the caller in as many ways as we can.
    /// @dev The main difference between this and a solidity low-level call is
    /// that we limit the number of bytes that the callee can cause to be
    /// copied to caller memory. This prevents stupid things like malicious
    /// contracts returning 10,000,000 bytes causing a local OOG when copying
    /// to memory.
    /// @param _target The address to call
    /// @param _gas The amount of gas to forward to the remote contract
    /// @param _maxCopy The maximum number of bytes of returndata to copy
    /// to memory.
    /// @param _calldata The data to send to the remote contract
    /// @return success and returndata, as `.call()`. Returndata is capped to
    /// `_maxCopy` bytes.
    function excessivelySafeCall(
        address _target,
        uint256 _gas,
        uint16 _maxCopy,
        bytes memory _calldata
    ) internal returns (bool, bytes memory) {
        // set up for assembly call
        uint256 _toCopy;
        bool _success;
        bytes memory _returnData = new bytes(_maxCopy);
        // dispatch message to recipient
        // by assembly calling "handle" function
        // we call via assembly to avoid memcopying a very large returndata
        // returned by a malicious contract
        assembly {
            _success := call(
                _gas, // gas
                _target, // recipient
                0, // ether value
                add(_calldata, 0x20), // inloc
                mload(_calldata), // inlen
                0, // outloc
                0 // outlen
            )
            // limit our copy to 256 bytes
            _toCopy := returndatasize()
            if gt(_toCopy, _maxCopy) {
                _toCopy := _maxCopy
            }
            // Store the length of the copied bytes
            mstore(_returnData, _toCopy)
            // copy the bytes from returndata[0:_toCopy]
            returndatacopy(add(_returnData, 0x20), 0, _toCopy)
        }
        return (_success, _returnData);
    }

    /// @notice Use when you _really_ really _really_ don't trust the called
    /// contract. This prevents the called contract from causing reversion of
    /// the caller in as many ways as we can.
    /// @dev The main difference between this and a solidity low-level call is
    /// that we limit the number of bytes that the callee can cause to be
    /// copied to caller memory. This prevents stupid things like malicious
    /// contracts returning 10,000,000 bytes causing a local OOG when copying
    /// to memory.
    /// @param _target The address to call
    /// @param _gas The amount of gas to forward to the remote contract
    /// @param _maxCopy The maximum number of bytes of returndata to copy
    /// to memory.
    /// @param _calldata The data to send to the remote contract
    /// @return success and returndata, as `.call()`. Returndata is capped to
    /// `_maxCopy` bytes.
    function excessivelySafeStaticCall(
        address _target,
        uint256 _gas,
        uint16 _maxCopy,
        bytes memory _calldata
    ) internal view returns (bool, bytes memory) {
        // set up for assembly call
        uint256 _toCopy;
        bool _success;
        bytes memory _returnData = new bytes(_maxCopy);
        // dispatch message to recipient
        // by assembly calling "handle" function
        // we call via assembly to avoid memcopying a very large returndata
        // returned by a malicious contract
        assembly {
            _success := staticcall(
                _gas, // gas
                _target, // recipient
                add(_calldata, 0x20), // inloc
                mload(_calldata), // inlen
                0, // outloc
                0 // outlen
            )
            // limit our copy to 256 bytes
            _toCopy := returndatasize()
            if gt(_toCopy, _maxCopy) {
                _toCopy := _maxCopy
            }
            // Store the length of the copied bytes
            mstore(_returnData, _toCopy)
            // copy the bytes from returndata[0:_toCopy]
            returndatacopy(add(_returnData, 0x20), 0, _toCopy)
        }
        return (_success, _returnData);
    }

    /**
     * @notice Swaps function selectors in encoded contract calls
     * @dev Allows reuse of encoded calldata for functions with identical
     * argument types but different names. It simply swaps out the first 4 bytes
     * for the new selector. This function modifies memory in place, and should
     * only be used with caution.
     * @param _newSelector The new 4-byte selector
     * @param _buf The encoded contract args
     */
    function swapSelector(bytes4 _newSelector, bytes memory _buf) internal pure {
        require(_buf.length >= 4);
        uint256 _mask = LOW_28_MASK;
        assembly {
            // load the first word of
            let _word := mload(add(_buf, 0x20))
            // mask out the top 4 bytes
            // /x
            _word := and(_word, _mask)
            _word := or(_newSelector, _word)
            mstore(add(_buf, 0x20), _word)
        }
    }
}

File 24 of 27 : CrossChainConfig.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.11;

/**
 * @title   Cross Chain Config
 * @author  AuraFinance
 * @dev     Setter/Getter logic for cross chain layer zero config
 */
abstract contract CrossChainConfig {
    /// @dev srcChainId mapped to selector and configuration
    mapping(uint16 => mapping(bytes32 => bytes)) public getAdapterParams;

    /* -------------------------------------------------------------------
       Events 
    ------------------------------------------------------------------- */

    /**
     * @dev Emitted a configuration is set for a given source chain id.
     * @param srcChainId    The source chain ID.
     * @param selector      The selector.
     * @param adapterParams The configuration.
     */
    event SetAdapterParams(uint16 indexed srcChainId, bytes32 selector, bytes adapterParams);

    /**
     * @dev Sets the configuration for a given source chain ID and selector.
     * @param _srcChainId The source chain ID.
     * @param _selector The selector.
     * @param _adapterParams The adapter params.
     */
    function setAdapterParams(
        uint16 _srcChainId,
        bytes32 _selector,
        bytes memory _adapterParams
    ) external virtual;

    function _setAdapterParams(
        uint16 _srcChainId,
        bytes32 _selector,
        bytes memory _adapterParams
    ) internal {
        getAdapterParams[_srcChainId][_selector] = _adapterParams;
        emit SetAdapterParams(_srcChainId, _selector, _adapterParams);
    }
}

File 25 of 27 : PausableProxyOFT.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.11;

import { IERC20 } from "@openzeppelin/contracts-0.8/token/ERC20/IERC20.sol";
import { SafeERC20 } from "@openzeppelin/contracts-0.8/token/ERC20/utils/SafeERC20.sol";
import { ProxyOFT } from "../layerzero/token/oft/extension/ProxyOFT.sol";
import { PauseGuardian } from "./PauseGuardian.sol";
import { AuraMath } from "../utils/AuraMath.sol";
import { BytesLib } from "../layerzero/util/BytesLib.sol";

/**
 * @title PausableProxyOFT
 * @author  AuraFinance
 * @notice Extension to the ProxyOFT standard that allows a `guardian` address to perform  an emergency pause.
 *  - When paused all messages received are added to a queue to be processed after `queueDelay` time has passed.
 *  - When paused no messages can be sent via `sendFrom`.
 */
contract PausableProxyOFT is ProxyOFT, PauseGuardian {
    using AuraMath for uint256;
    using SafeERC20 for IERC20;
    using BytesLib for bytes;

    /* -------------------------------------------------------------------
       Storage 
    ------------------------------------------------------------------- */

    /// @dev Duration of each inflow epoch
    uint256 public constant epochDuration = 7 days;

    /// @dev Addres of super user
    address public immutable sudo;

    /// @dev Transfer inflow limit per epoch
    uint256 public inflowLimit;

    /// @dev Queue delay
    uint256 public queueDelay;

    /// @dev Epoch mapped to transfer outflow
    mapping(uint256 => uint256) public outflow;

    /// @dev Epoch mapped to transfer inflow
    mapping(uint256 => uint256) public inflow;

    /// @dev Transfer queue
    mapping(bytes32 => bool) public queue;

    /* -------------------------------------------------------------------
       Events 
    ------------------------------------------------------------------- */

    /**
     * @param epoch       The epoch
     * @param srcChainId  The source chain
     * @param to          Address to transfer to
     * @param amount      Amount to transfer
     * @param timestamp   Time the transfer was queued
     */
    event QueuedFromChain(uint256 epoch, uint16 srcChainId, address to, uint256 amount, uint256 timestamp);

    /**
     * @param token Token address
     * @param to Send to address
     * @param amount Amount to send
     */
    event Rescue(address token, address to, uint256 amount);

    /* -------------------------------------------------------------------
       Constructor 
    ------------------------------------------------------------------- */

    /**
     * @param _token        Proxy token (eg AURA or auraBAL)
     * @param _sudo         The super user address
     * @param _token        Proxy token (eg AURA or auraBAL)
     * @param _sudo         Super user
     * @param _inflowLimit  Initial inflow limit per epoch
     */
    constructor(
        address _token,
        address _sudo,
        uint256 _inflowLimit
    ) ProxyOFT(_token) {
        sudo = _sudo;
        inflowLimit = _inflowLimit;
        queueDelay = 7 days;
    }

    /* -------------------------------------------------------------------
       Setters 
    ------------------------------------------------------------------- */

    /**
     * @dev   Amount of time that a transfer has to sit in the queue until
     *        it can be processed
     * @param _delay Queue delay
     */
    function setQueueDelay(uint256 _delay) external onlyOwner {
        queueDelay = _delay;
    }

    /**
     * @dev Set the inflow limit per epoch
     * @param _limit Inflow limit per epoch
     */
    function setInflowLimit(uint256 _limit) external onlyOwner {
        inflowLimit = _limit;
    }

    /* -------------------------------------------------------------------
       View 
    ------------------------------------------------------------------- */

    /**
     * @dev Get current epoch
     */
    function getCurrentEpoch() external view returns (uint256) {
        return _getCurrentEpoch();
    }

    /* -------------------------------------------------------------------
       Core 
    ------------------------------------------------------------------- */

    /**
     * @dev Override sendFrom to add pause modifier
     */
    function sendFrom(
        address _from,
        uint16 _dstChainId,
        bytes calldata _toAddress,
        uint256 _amount,
        address payable _refundAddress,
        address _zroPaymentAddress,
        bytes calldata _adapterParams
    ) public payable override whenNotPaused {
        outflow[_getCurrentEpoch()] += _amount;
        super.sendFrom(_from, _dstChainId, _toAddress, _amount, _refundAddress, _zroPaymentAddress, _adapterParams);
    }

    /**
     * @dev Override _sendAck on OFTCore
     *
     * Add functionality to
     * 1) Pause the bridge
     * 2) Add an inflow limit safety net. This safety net should never get hit in
     *    normal market operations. It's intended to mitigate risk in case of a
     *    doomsday event.
     */
    function _sendAck(
        uint16 _srcChainId,
        bytes memory, /* _srcAddress */
        uint64, /*  _nonce */
        bytes memory _payload
    ) internal override {
        (, bytes memory toAddressBytes, uint256 amount) = abi.decode(_payload, (uint16, bytes, uint256));
        address to = toAddressBytes.toAddress(0);
        _safeCreditTo(_srcChainId, to, amount);
    }

    function _safeCreditTo(
        uint16 _srcChainId,
        address _to,
        uint256 _amount
    ) internal {
        uint256 epoch = _getCurrentEpoch();
        uint256 currInflow = inflow[epoch];
        uint256 newInflow = currInflow.add(_amount);
        inflow[epoch] = newInflow;

        if (_getNetInflow(newInflow, outflow[epoch]) > inflowLimit || paused()) {
            // If the net inflow is greater than the limit for this epoch OR the bridge
            // is currently paused we send each transfer to a queue for delayed processing.
            // In the case of a doomsday event this limits the exposure to the bridge.
            queue[keccak256(abi.encode(epoch, _srcChainId, _to, _amount, block.timestamp))] = true;
            emit QueuedFromChain(epoch, _srcChainId, _to, _amount, block.timestamp);
        } else {
            // Process the transfer as normal
            _amount = _creditTo(_srcChainId, _to, _amount);
            emit ReceiveFromChain(_srcChainId, _to, _amount);
        }
    }

    /**
     * @dev Process a queued transfer
     *      Transfer has to be a valid root and the queue delay has to have passed
     * @param _epoch        Epoch
     * @param _srcChainId   Source chain ID
     * @param _to           Address to transfer to
     * @param _amount       Amount to transfer
     * @param _timestamp    Time when this transfer was queued
     */
    function processQueued(
        uint256 _epoch,
        uint16 _srcChainId,
        address _to,
        uint256 _amount,
        uint256 _timestamp
    ) external whenNotPaused {
        bytes32 queueRoot = keccak256(abi.encode(_epoch, _srcChainId, _to, _amount, _timestamp));
        require(queue[queueRoot], "!root");
        require(block.timestamp > _timestamp.add(queueDelay), "!timestamp");
        // Process the queued send
        queue[queueRoot] = false;
        uint256 amount = _creditTo(_srcChainId, _to, _amount);
        emit ReceiveFromChain(_srcChainId, _to, amount);
    }

    /**
     * @dev In a doomsday bridge scenario there may be a case where funds need to be
     *      rescued.
     * @param _token Token address
     * @param _to Send to address
     * @param _amount Amount to send
     */
    function rescue(
        address _token,
        address _to,
        uint256 _amount
    ) external virtual {
        require(msg.sender == sudo, "!sudo");
        IERC20(_token).safeTransfer(_to, _amount);
        emit Rescue(_token, _to, _amount);
    }

    /* -------------------------------------------------------------------
       Internal 
    ------------------------------------------------------------------- */

    /**
     * @dev Get current epoch
     */
    function _getCurrentEpoch() internal view returns (uint256) {
        return block.timestamp.div(epochDuration);
    }

    /**
     * @dev Get net inflow
     * @param _inflow   Inflow amount
     * @param _outflow  Outflow amount
     */
    function _getNetInflow(uint256 _inflow, uint256 _outflow) internal pure returns (uint256 netInflow) {
        if (_inflow > _outflow) {
            netInflow = _inflow.sub(_outflow);
        }
    }
}

File 26 of 27 : PauseGuardian.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.11;

import { Pausable } from "@openzeppelin/contracts-0.8/security/Pausable.sol";

/**
 * @title PauseGuardian
 * @author AuraFinance
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized immutable guardian address.
 */
contract PauseGuardian is Pausable {
    /* -------------------------------------------------------------------
       Storage 
    ------------------------------------------------------------------- */

    /// @dev The guardian address
    address public guardian;

    /* -------------------------------------------------------------------
       Initialize       
    ------------------------------------------------------------------- */
    /**
     * @dev Constructs the PauseGuardian contract
     * @param _guardian   The pause guardian address
     */

    function _initializePauseGuardian(address _guardian) internal {
        require(guardian == address(0), "already initialized");
        require(_guardian != address(0), "guardian=0");
        guardian = _guardian;
    }

    /* -------------------------------------------------------------------
       Modifiers 
    ------------------------------------------------------------------- */

    modifier onlyGuardian() {
        require(msg.sender == guardian, "!guardian");
        _;
    }

    /* -------------------------------------------------------------------
       Core 
    ------------------------------------------------------------------- */

    /**
     * @notice This function pauses the contract.
     * @dev This function can only be called by the 'guardian'.
     */
    function pause() external onlyGuardian {
        _pause();
    }

    /**
     * @notice This function is used to unpause the contract.
     * @dev This function can only be called by the 'guardian' of the contract.
     */
    function unpause() external onlyGuardian {
        _unpause();
    }
}

File 27 of 27 : AuraMath.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.11;

/// @notice A library for performing overflow-/underflow-safe math,
/// updated with awesomeness from of DappHub (https://github.com/dapphub/ds-math).
library AuraMath {
    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
        c = a + b;
    }

    function sub(uint256 a, uint256 b) internal pure returns (uint256 c) {
        c = a - b;
    }

    function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
        c = a * b;
    }

    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return a / b;
    }

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

    function to224(uint256 a) internal pure returns (uint224 c) {
        require(a <= type(uint224).max, "AuraMath: uint224 Overflow");
        c = uint224(a);
    }

    function to128(uint256 a) internal pure returns (uint128 c) {
        require(a <= type(uint128).max, "AuraMath: uint128 Overflow");
        c = uint128(a);
    }

    function to112(uint256 a) internal pure returns (uint112 c) {
        require(a <= type(uint112).max, "AuraMath: uint112 Overflow");
        c = uint112(a);
    }

    function to96(uint256 a) internal pure returns (uint96 c) {
        require(a <= type(uint96).max, "AuraMath: uint96 Overflow");
        c = uint96(a);
    }

    function to32(uint256 a) internal pure returns (uint32 c) {
        require(a <= type(uint32).max, "AuraMath: uint32 Overflow");
        c = uint32(a);
    }
}

/// @notice A library for performing overflow-/underflow-safe addition and subtraction on uint32.
library AuraMath32 {
    function sub(uint32 a, uint32 b) internal pure returns (uint32 c) {
        c = a - b;
    }
}

/// @notice A library for performing overflow-/underflow-safe addition and subtraction on uint112.
library AuraMath112 {
    function add(uint112 a, uint112 b) internal pure returns (uint112 c) {
        c = a + b;
    }

    function sub(uint112 a, uint112 b) internal pure returns (uint112 c) {
        c = a - b;
    }
}

/// @notice A library for performing overflow-/underflow-safe addition and subtraction on uint224.
library AuraMath224 {
    function add(uint224 a, uint224 b) internal pure returns (uint224 c) {
        c = a + b;
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_lzEndpoint","type":"address"},{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_vault","type":"address"},{"internalType":"address","name":"_guardian","type":"address"},{"internalType":"address","name":"_sudo","type":"address"},{"internalType":"uint256","name":"_inflowLimit","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":false,"internalType":"uint256","name":"totalUnderlyingSum","type":"uint256"}],"name":"Harvest","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"},{"indexed":false,"internalType":"bytes","name":"_reason","type":"bytes"}],"name":"MessageFailed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"epoch","type":"uint256"},{"indexed":false,"internalType":"uint16","name":"srcChainId","type":"uint16"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"QueuedFromChain","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"indexed":true,"internalType":"address","name":"_to","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"ReceiveFromChain","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Rescue","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":"bytes32","name":"_payloadHash","type":"bytes32"}],"name":"RetryMessageSuccess","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":false,"internalType":"bytes","name":"_toAddress","type":"bytes"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"SendToChain","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint16","name":"srcChainId","type":"uint16"},{"indexed":false,"internalType":"bytes32","name":"selector","type":"bytes32"},{"indexed":false,"internalType":"bytes","name":"adapterParams","type":"bytes"}],"name":"SetAdapterParams","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"indexed":false,"internalType":"uint16","name":"_type","type":"uint16"},{"indexed":false,"internalType":"uint256","name":"_minDstGas","type":"uint256"}],"name":"SetMinDstGas","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"precrime","type":"address"}],"name":"SetPrecrime","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"_remoteChainId","type":"uint16"},{"indexed":false,"internalType":"bytes","name":"_path","type":"bytes"}],"name":"SetTrustedRemote","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"_remoteChainId","type":"uint16"},{"indexed":false,"internalType":"bytes","name":"_remoteAddress","type":"bytes"}],"name":"SetTrustedRemoteAddress","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"_useCustomAdapterParams","type":"bool"}],"name":"SetUseCustomAdapterParams","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"DEFAULT_PAYLOAD_SIZE_LIMIT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NO_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":"","type":"address"}],"name":"authorizedHarvesters","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"circulatingSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint16","name":"","type":"uint16"}],"name":"claimable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"epochDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","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":"","type":"uint16"},{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"getAdapterParams","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","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":[],"name":"getCurrentEpoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_remoteChainId","type":"uint16"}],"name":"getTrustedRemoteAddress","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"guardian","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_totalUnderlying","type":"uint256[]"},{"internalType":"uint256","name":"_totalUnderlyingSum","type":"uint256"}],"name":"harvest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"harvestSrcChainIds","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"inflow","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"inflowLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"internalTotalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","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":"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":"address","name":"","type":"address"}],"name":"ofts","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"outflow","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"}],"name":"payloadSizeLimitLookup","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"precrime","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"address","name":"_zroPaymentAddress","type":"address"}],"name":"processClaimable","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_epoch","type":"uint256"},{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_timestamp","type":"uint256"}],"name":"processQueued","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"queue","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"queueDelay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"rescue","outputs":[],"stateMutability":"nonpayable","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":"","type":"uint16"}],"name":"rewardReceiver","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"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":"sendFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"bytes32","name":"_selector","type":"bytes32"},{"internalType":"bytes","name":"_adapterParams","type":"bytes"}],"name":"setAdapterParams","outputs":[],"stateMutability":"nonpayable","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":"_srcChainIds","type":"uint16[]"}],"name":"setHarvestSrcChainIds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_limit","type":"uint256"}],"name":"setInflowLimit","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":"_token","type":"address"},{"internalType":"address","name":"_oft","type":"address"}],"name":"setOFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"uint256","name":"_size","type":"uint256"}],"name":"setPayloadSizeLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_precrime","type":"address"}],"name":"setPrecrime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_delay","type":"uint256"}],"name":"setQueueDelay","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_version","type":"uint16"}],"name":"setReceiveVersion","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"address","name":"_receiver","type":"address"}],"name":"setRewardReceiver","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":"_path","type":"bytes"}],"name":"setTrustedRemote","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_remoteChainId","type":"uint16"},{"internalType":"bytes","name":"_remoteAddress","type":"bytes"}],"name":"setTrustedRemoteAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_useCustomAdapterParams","type":"bool"}],"name":"setUseCustomAdapterParams","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sudo","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"totalClaimable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"}],"name":"trustedRemoteLookup","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_harvester","type":"address"},{"internalType":"bool","name":"_authorized","type":"bool"}],"name":"updateAuthorizedHarvesters","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"useCustomAdapterParams","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vault","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"vaultExecute","outputs":[{"internalType":"bool","name":"","type":"bool"},{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"nonpayable","type":"function"}]

Deployed Bytecode

0x6080604052600436106104135760003560e01c806366566efd11610228578063baf3292d11610128578063eab45d9c116100bb578063f5ecbdbc1161008a578063fbfa77cf1161006f578063fbfa77cf14610ccb578063fc0c546a14610ceb578063fe67ec9514610d1e57600080fd5b8063f5ecbdbc14610c7b578063f7ff67a014610c9b57600080fd5b8063eab45d9c14610c01578063eb8d72b714610c21578063ed629c5c14610c41578063f2fde38b14610c5b57600080fd5b8063d1deba1f116100f7578063d1deba1f14610b62578063d445d88814610b75578063df2a5b3b14610bad578063e77c48e914610bcd57600080fd5b8063baf3292d14610adf578063c446183414610aff578063cb13f57914610b15578063cbed8b9c14610b4257600080fd5b80639358928b116101bb578063a6c3d1651161018a578063b353aaa71161016f578063b353aaa714610a94578063b72973da14610ab4578063b97dd9e214610aca57600080fd5b8063a6c3d16514610a54578063a7f43c3214610a7457600080fd5b80639358928b146109ec578063950c8a7414610a015780639f38369a14610a215780639ffb630414610a4157600080fd5b80637c10dea6116101f75780637c10dea6146109515780638456cb59146109815780638cfd8f5c146109965780638da5cb5b146109ce57600080fd5b806366566efd146108e657806366ad5c8a146108fc578063715018a61461091c5780637533d7881461093157600080fd5b80633f1f4fa4116103335780634c0e5864116102c657806354984f95116102955780635b8c41e61161027a5780635b8c41e6146108645780635c975abb146108b357806364eb1a2b146108d057600080fd5b806354984f951461080e578063594fceb41461082e57600080fd5b80634c0e5864146107af5780634c42899a146107cf5780634ff0876a146107e457806351905636146107fb57600080fd5b80634511ee99116103025780634511ee99146106f7578063452a932014610724578063495def16146107625780634b7288591461078f57600080fd5b80633f1f4fa4146106805780633f4ba83a146106ad57806342d65a8d146106c257806344770515146106e257600080fd5b8063139bae17116103ab5780632a205e3d1161037a5780632a205e3d146105eb5780633b797935146106205780633d8b38f6146106405780633dc31d191461066057600080fd5b8063139bae171461055057806314bb9955146105705780631dfce5c61461059057806320ff430b146105cb57600080fd5b8063095acd37116103e7578063095acd37146104c25780630df37483146104f05780630f8d1d281461051057806310ddb1371461053057600080fd5b80621d35671461041857806301ffc9a71461043a5780630766394a1461046f57806307e0db17146104a2575b600080fd5b34801561042457600080fd5b50610438610433366004614cdc565b610d54565b005b34801561044657600080fd5b5061045a610455366004614d72565b610f87565b60405190151581526020015b60405180910390f35b34801561047b57600080fd5b5061048f61048a366004614d9c565b610fbe565b60405161ffff9091168152602001610466565b3480156104ae57600080fd5b506104386104bd366004614db5565b610ff6565b3480156104ce57600080fd5b506104e26104dd366004614dd2565b6110a3565b604051610466929190614e76565b3480156104fc57600080fd5b5061043861050b366004614e91565b6111b5565b34801561051c57600080fd5b5061043861052b366004614f28565b611214565b34801561053c57600080fd5b5061043861054b366004614db5565b6114cd565b34801561055c57600080fd5b5061043861056b366004614fd9565b611549565b34801561057c57600080fd5b5061043861058b366004614d9c565b6115c5565b34801561059c57600080fd5b506105bd6105ab366004615012565b60126020526000908152604090205481565b604051908152602001610466565b3480156105d757600080fd5b506104386105e636600461502f565b611612565b3480156105f757600080fd5b5061060b61060636600461507e565b6116fe565b60408051928352602083019190915201610466565b34801561062c57600080fd5b5061043861063b366004615198565b6117b4565b34801561064c57600080fd5b5061045a61065b3660046151f1565b611807565b34801561066c57600080fd5b5061043861067b36600461522d565b6118d4565b34801561068c57600080fd5b506105bd61069b366004614db5565b60046020526000908152604090205481565b3480156106b957600080fd5b50610438611947565b3480156106ce57600080fd5b506104386106dd3660046151f1565b61199d565b3480156106ee57600080fd5b506105bd600081565b34801561070357600080fd5b50610717610712366004614e91565b611a47565b604051610466919061525b565b34801561073057600080fd5b5060075461074a906201000090046001600160a01b031681565b6040516001600160a01b039091168152602001610466565b34801561076e57600080fd5b506105bd61077d366004614d9c565b600a6020526000908152604090205481565b34801561079b57600080fd5b506104386107aa36600461526e565b611aec565b3480156107bb57600080fd5b506104386107ca36600461528c565b611b62565b3480156107db57600080fd5b5061048f600081565b3480156107f057600080fd5b506105bd62093a8081565b6104386108093660046152de565b611d27565b34801561081a57600080fd5b506104386108293660046153a8565b611dbe565b34801561083a57600080fd5b5061074a610849366004614db5565b6014602052600090815260409020546001600160a01b031681565b34801561087057600080fd5b506105bd61087f366004615437565b6006602090815260009384526040808520845180860184018051928152908401958401959095209452929052825290205481565b3480156108bf57600080fd5b50600754610100900460ff1661045a565b3480156108dc57600080fd5b506105bd60095481565b3480156108f257600080fd5b506105bd60105481565b34801561090857600080fd5b50610438610917366004614cdc565b611e8a565b34801561092857600080fd5b50610438611f75565b34801561093d57600080fd5b5061071761094c366004614db5565b611fc7565b34801561095d57600080fd5b5061045a61096c366004614d9c565b600c6020526000908152604090205460ff1681565b34801561098d57600080fd5b50610438611fe0565b3480156109a257600080fd5b506105bd6109b1366004615497565b600360209081526000928352604080842090915290825290205481565b3480156109da57600080fd5b506000546001600160a01b031661074a565b3480156109f857600080fd5b506105bd612034565b348015610a0d57600080fd5b5060055461074a906001600160a01b031681565b348015610a2d57600080fd5b50610717610a3c366004614db5565b6120ca565b610438610a4f3660046154c5565b6121da565b348015610a6057600080fd5b50610438610a6f3660046151f1565b6126e1565b348015610a8057600080fd5b50610438610a8f366004614d9c565b6127b4565b348015610aa057600080fd5b5060015461074a906001600160a01b031681565b348015610ac057600080fd5b506105bd60085481565b348015610ad657600080fd5b506105bd612801565b348015610aeb57600080fd5b50610438610afa366004615012565b61280b565b348015610b0b57600080fd5b506105bd61271081565b348015610b2157600080fd5b506105bd610b30366004614d9c565b600b6020526000908152604090205481565b348015610b4e57600080fd5b50610438610b5d366004615510565b6128a8565b610438610b70366004614cdc565b612956565b348015610b8157600080fd5b506105bd610b90366004615583565b601360209081526000928352604080842090915290825290205481565b348015610bb957600080fd5b50610438610bc83660046155a1565b612b6e565b348015610bd957600080fd5b5061074a7f000000000000000000000000b370ebd7ded0c87b4509ff6f13f07b7f1693bf4681565b348015610c0d57600080fd5b50610438610c1c3660046155d1565b612c68565b348015610c2d57600080fd5b50610438610c3c3660046151f1565b612cf1565b348015610c4d57600080fd5b5060075461045a9060ff1681565b348015610c6757600080fd5b50610438610c76366004615012565b612d8b565b348015610c8757600080fd5b50610717610c963660046155ee565b612e5b565b348015610ca757600080fd5b5061045a610cb6366004615012565b60156020526000908152604090205460ff1681565b348015610cd757600080fd5b50600f5461074a906001600160a01b031681565b348015610cf757600080fd5b507f000000000000000000000000616e8bfa43f920657b3497dbf40d6b1a02d4608d61074a565b348015610d2a57600080fd5b5061074a610d39366004615012565b6016602052600090815260409020546001600160a01b031681565b6001546001600160a01b0316336001600160a01b031614610dbc5760405162461bcd60e51b815260206004820152601e60248201527f4c7a4170703a20696e76616c696420656e64706f696e742063616c6c6572000060448201526064015b60405180910390fd5b61ffff861660009081526002602052604081208054610dda9061563f565b80601f0160208091040260200160405190810160405280929190818152602001828054610e069061563f565b8015610e535780601f10610e2857610100808354040283529160200191610e53565b820191906000526020600020905b815481529060010190602001808311610e3657829003601f168201915b50505050509050805186869050148015610e6e575060008151115b8015610e96575080516020820120604051610e8c9088908890615674565b6040518091039020145b610f085760405162461bcd60e51b815260206004820152602660248201527f4c7a4170703a20696e76616c696420736f757263652073656e64696e6720636f60448201527f6e747261637400000000000000000000000000000000000000000000000000006064820152608401610db3565b610f7e8787878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8a018190048102820181019092528881528a93509150889088908190840183828082843760009201919091525061305492505050565b50505050505050565b60006001600160e01b03198216630a72677560e11b1480610fb857506301ffc9a760e01b6001600160e01b03198316145b92915050565b60118181548110610fce57600080fd5b9060005260206000209060109182820401919006600202915054906101000a900461ffff1681565b6000546001600160a01b0316331461103e5760405162461bcd60e51b81526020600482018190526024820152600080516020615bc18339815191526044820152606401610db3565b6001546040516307e0db1760e01b815261ffff831660048201526001600160a01b03909116906307e0db17906024015b600060405180830381600087803b15801561108857600080fd5b505af115801561109c573d6000803e3d6000fd5b5050505050565b600080546060906001600160a01b031633146110ef5760405162461bcd60e51b81526020600482018190526024820152600080516020615bc18339815191526044820152606401610db3565b600f5460405160009182916001600160a01b039091169088906111159089908990615674565b60006040518083038185875af1925050503d8060008114611152576040519150601f19603f3d011682016040523d82523d6000602084013e611157565b606091505b5091509150816111a95760405162461bcd60e51b815260206004820152600860248201527f21737563636573730000000000000000000000000000000000000000000000006044820152606401610db3565b90969095509350505050565b6000546001600160a01b031633146111fd5760405162461bcd60e51b81526020600482018190526024820152600080516020615bc18339815191526044820152606401610db3565b61ffff909116600090815260046020526040902055565b3360009081526015602052604090205460ff166112735760405162461bcd60e51b815260206004820152600a60248201527f21686172766573746572000000000000000000000000000000000000000000006044820152606401610db3565b601154825181146112c65760405162461bcd60e51b815260206004820152600760248201527f21706172697479000000000000000000000000000000000000000000000000006044820152606401610db3565b60006112d06130cd565b805190915060005b818110156114c55760008382815181106112f4576112f4615684565b6020026020010151905060008060005b878110156113ff5760008a828151811061132057611320615684565b60200260200101519050600061134d8b61134784896020015161350690919063ffffffff16565b90613512565b905061135981866156b0565b945061136582856156b0565b86516001600160a01b031660009081526013602052604081206011805493975084939192918790811061139a5761139a615684565b90600052602060002090601091828204019190066002029054906101000a900461ffff1661ffff1661ffff16815260200190815260200160002060008282546113e391906156b0565b92505081905550505080806113f7906156c8565b915050611304565b5082516001600160a01b0316600090815260126020526040812080548492906114299084906156b0565b9091555085905061143b8560016156b0565b14156114af578781146114795760405162461bcd60e51b8152600401610db3906020808252600490820152632173756d60e01b604082015260600190565b60405188815233907fc9695243a805adb74c91f28311176c65b417e842d5699893cef56d18bfa48cba9060200160405180910390a25b50505080806114bd906156c8565b9150506112d8565b505050505050565b6000546001600160a01b031633146115155760405162461bcd60e51b81526020600482018190526024820152600080516020615bc18339815191526044820152606401610db3565b6001546040516310ddb13760e01b815261ffff831660048201526001600160a01b03909116906310ddb1379060240161106e565b6000546001600160a01b031633146115915760405162461bcd60e51b81526020600482018190526024820152600080516020615bc18339815191526044820152606401610db3565b61ffff91909116600090815260146020526040902080546001600160a01b0319166001600160a01b03909216919091179055565b6000546001600160a01b0316331461160d5760405162461bcd60e51b81526020600482018190526024820152600080516020615bc18339815191526044820152606401610db3565b600855565b336001600160a01b037f000000000000000000000000b370ebd7ded0c87b4509ff6f13f07b7f1693bf46161461168a5760405162461bcd60e51b815260206004820152600560248201527f217375646f0000000000000000000000000000000000000000000000000000006044820152606401610db3565b7f000000000000000000000000616e8bfa43f920657b3497dbf40d6b1a02d4608d6001600160a01b0316836001600160a01b031614156116e55780601060008282546116d691906156e3565b909155506116e590508161351e565b6116f96001600160a01b0384168383613719565b505050565b60008060008089898960405160200161171a9493929190615723565b60408051601f198184030181529082905260015463040a7bb160e41b83529092506001600160a01b0316906340a7bb1090611763908d90309086908c908c908c90600401615752565b6040805180830381865afa15801561177f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117a391906157a6565b925092505097509795505050505050565b6000546001600160a01b031633146117fc5760405162461bcd60e51b81526020600482018190526024820152600080516020615bc18339815191526044820152606401610db3565b6116f9838383613749565b61ffff8316600090815260026020526040812080548291906118289061563f565b80601f01602080910402602001604051908101604052809291908181526020018280546118549061563f565b80156118a15780601f10611876576101008083540402835291602001916118a1565b820191906000526020600020905b81548152906001019060200180831161188457829003601f168201915b5050505050905083836040516118b8929190615674565b60405180910390208180519060200120149150505b9392505050565b6000546001600160a01b0316331461191c5760405162461bcd60e51b81526020600482018190526024820152600080516020615bc18339815191526044820152606401610db3565b6001600160a01b03919091166000908152601560205260409020805460ff1916911515919091179055565b6007546201000090046001600160a01b031633146119935760405162461bcd60e51b815260206004820152600960248201526810b3bab0b93234b0b760b91b6044820152606401610db3565b61199b6137b9565b565b6000546001600160a01b031633146119e55760405162461bcd60e51b81526020600482018190526024820152600080516020615bc18339815191526044820152606401610db3565b6001546040516342d65a8d60e01b81526001600160a01b03909116906342d65a8d90611a19908690869086906004016157ca565b600060405180830381600087803b158015611a3357600080fd5b505af1158015610f7e573d6000803e3d6000fd5b600d60209081526000928352604080842090915290825290208054611a6b9061563f565b80601f0160208091040260200160405190810160405280929190818152602001828054611a979061563f565b8015611ae45780601f10611ab957610100808354040283529160200191611ae4565b820191906000526020600020905b815481529060010190602001808311611ac757829003601f168201915b505050505081565b6000546001600160a01b03163314611b345760405162461bcd60e51b81526020600482018190526024820152600080516020615bc18339815191526044820152606401610db3565b6001600160a01b03918216600090815260166020526040902080546001600160a01b03191691909216179055565b600754610100900460ff1615611bad5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610db3565b60408051602080820188905261ffff8716828401526001600160a01b03861660608301526080820185905260a08083018590528351808403909101815260c090920183528151918101919091206000818152600c9092529190205460ff16611c575760405162461bcd60e51b815260206004820152600560248201527f21726f6f740000000000000000000000000000000000000000000000000000006044820152606401610db3565b600954611c6590839061385b565b4211611cb35760405162461bcd60e51b815260206004820152600a60248201527f2174696d657374616d70000000000000000000000000000000000000000000006044820152606401610db3565b6000818152600c60205260408120805460ff19169055611cd4868686613867565b9050846001600160a01b03168661ffff167fbf551ec93859b170f9b2141bd9298bf3f64322c6f7beb2543a0cb669834118bf83604051611d1691815260200190565b60405180910390a350505050505050565b600754610100900460ff1615611d725760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610db3565b84600a6000611d7f6138a1565b81526020019081526020016000206000828254611d9c91906156b0565b90915550611db390508989898989898989896138b0565b505050505050505050565b6000546001600160a01b03163314611e065760405162461bcd60e51b81526020600482018190526024820152600080516020615bc18339815191526044820152606401610db3565b611e1260116000614b34565b805160005b818110156116f9576011838281518110611e3357611e33615684565b602090810291909101810151825460018101845560009384529190922060108204018054600f9092166002026101000a61ffff81810219909316929093169290920217905580611e82816156c8565b915050611e17565b333014611eff5760405162461bcd60e51b815260206004820152602660248201527f4e6f6e626c6f636b696e674c7a4170703a2063616c6c6572206d75737420626560448201527f204c7a41707000000000000000000000000000000000000000000000000000006064820152608401610db3565b6114c58686868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f89018190048102820181019092528781528993509150879087908190840183828082843760009201919091525061392a92505050565b6000546001600160a01b03163314611fbd5760405162461bcd60e51b81526020600482018190526024820152600080516020615bc18339815191526044820152606401610db3565b61199b6000613991565b60026020526000908152604090208054611a6b9061563f565b6007546201000090046001600160a01b0316331461202c5760405162461bcd60e51b815260206004820152600960248201526810b3bab0b93234b0b760b91b6044820152606401610db3565b61199b6139e1565b60006010547f000000000000000000000000616e8bfa43f920657b3497dbf40d6b1a02d4608d6001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612097573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120bb91906157e8565b6120c591906156e3565b905090565b61ffff81166000908152600260205260408120805460609291906120ed9061563f565b80601f01602080910402602001604051908101604052809291908181526020018280546121199061563f565b80156121665780601f1061213b57610100808354040283529160200191612166565b820191906000526020600020905b81548152906001019060200180831161214957829003601f168201915b505050505090508051600014156121bf5760405162461bcd60e51b815260206004820152601d60248201527f4c7a4170703a206e6f20747275737465642070617468207265636f72640000006044820152606401610db3565b6118cd6000601483516121d291906156e3565b839190613a63565b600754610100900460ff16156122255760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610db3565b6002600e5414156122785760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610db3565b6002600e5561ffff82166000818152601460209081526040808320546001600160a01b0388811680865260138552838620968652958452828520549585526016909352922054918116929116826122f55760405162461bcd60e51b81526020600482015260016024820152600360fc1b6044820152606401610db3565b600082116123455760405162461bcd60e51b815260206004820152600760248201527f21726577617264000000000000000000000000000000000000000000000000006044820152606401610db3565b6001600160a01b0381166123845760405162461bcd60e51b8152600401610db390602080825260049082015263085bd99d60e21b604082015260600190565b6001600160a01b038616600081815260136020908152604080832061ffff8a16845282528083208390559282526012905290812080548492906123c89084906156e3565b909155505061ffff85166000818152600d6020908152604080832081516001600160a01b038c16602482015260448101959095526064808601859052825180870390910181526084909501825284830180516001600160e01b03166327fed8c160e21b1781529451909420835292905290812080546124469061563f565b80601f01602080910402602001604051908101604052809291908181526020018280546124729061563f565b80156124bf5780601f10612494576101008083540402835291602001916124bf565b820191906000526020600020905b8154815290600101906020018083116124a257829003601f168201915b505050505090507f000000000000000000000000616e8bfa43f920657b3497dbf40d6b1a02d4608d6001600160a01b0316876001600160a01b0316141561261c576001600160a01b03821630146125415760405162461bcd60e51b8152600401610db390602080825260049082015263085bd99d60e21b604082015260600190565b826010600082825461255391906156b0565b909155505060408051606086901b6bffffffffffffffffffffffff1916602082015281516014818303018152603482019092526125b591889161259d916000918890605401615801565b60405160208183030381529060405233888534613b8b565b604080516001600160a01b0386166020820152309161ffff8916917f39a4c66499bcf4b56d79f0dde8ed7a9d4925a0df55825206b2b8531e202be0d0910160408051601f198184030181529082905261260f91889061582e565b60405180910390a36126d3565b6126306001600160a01b0388168385613d22565b816001600160a01b031663519056363430898860405160200161266b919060609190911b6bffffffffffffffffffffffff1916815260140190565b60405160208183030381529060405288338c896040518963ffffffff1660e01b81526004016126a09796959493929190615850565b6000604051808303818588803b1580156126b957600080fd5b505af11580156126cd573d6000803e3d6000fd5b50505050505b50506001600e555050505050565b6000546001600160a01b031633146127295760405162461bcd60e51b81526020600482018190526024820152600080516020615bc18339815191526044820152606401610db3565b81813060405160200161273e939291906158b4565b60408051601f1981840301815291815261ffff8516600090815260026020908152919020825161277393919290910190614b59565b507f8c0400cfe2d1199b1a725c78960bcc2a344d869b80590d0f2bd005db15a572ce8383836040516127a7939291906157ca565b60405180910390a1505050565b6000546001600160a01b031633146127fc5760405162461bcd60e51b81526020600482018190526024820152600080516020615bc18339815191526044820152606401610db3565b600955565b60006120c56138a1565b6000546001600160a01b031633146128535760405162461bcd60e51b81526020600482018190526024820152600080516020615bc18339815191526044820152606401610db3565b600580546001600160a01b0319166001600160a01b0383169081179091556040519081527f5db758e995a17ec1ad84bdef7e8c3293a0bd6179bcce400dff5d4c3d87db726b906020015b60405180910390a150565b6000546001600160a01b031633146128f05760405162461bcd60e51b81526020600482018190526024820152600080516020615bc18339815191526044820152606401610db3565b6001546040516332fb62e760e21b81526001600160a01b039091169063cbed8b9c9061292890889088908890889088906004016158da565b600060405180830381600087803b15801561294257600080fd5b505af1158015611db3573d6000803e3d6000fd5b61ffff861660009081526006602052604080822090516129799088908890615674565b908152604080516020928190038301902067ffffffffffffffff8716600090815292529020549050806129fa5760405162461bcd60e51b815260206004820152602360248201527f4e6f6e626c6f636b696e674c7a4170703a206e6f2073746f726564206d65737360448201526261676560e81b6064820152608401610db3565b808383604051612a0b929190615674565b604051809103902014612a6a5760405162461bcd60e51b815260206004820152602160248201527f4e6f6e626c6f636b696e674c7a4170703a20696e76616c6964207061796c6f616044820152601960fa1b6064820152608401610db3565b61ffff87166000908152600660205260408082209051612a8d9089908990615674565b908152604080516020928190038301812067ffffffffffffffff8916600090815290845282902093909355601f88018290048202830182019052868252612b26918991899089908190840183828082843760009201919091525050604080516020601f8a018190048102820181019092528881528a93509150889088908190840183828082843760009201919091525061392a92505050565b7fc264d91f3adc5588250e1551f547752ca0cfa8f6b530d243b9f9f4cab10ea8e58787878785604051612b5d959493929190615908565b60405180910390a150505050505050565b6000546001600160a01b03163314612bb65760405162461bcd60e51b81526020600482018190526024820152600080516020615bc18339815191526044820152606401610db3565b60008111612c065760405162461bcd60e51b815260206004820152601560248201527f4c7a4170703a20696e76616c6964206d696e47617300000000000000000000006044820152606401610db3565b61ffff83811660008181526003602090815260408083209487168084529482529182902085905581519283528201929092529081018290527f9d5c7c0b934da8fefa9c7760c98383778a12dfbfc0c3b3106518f43fb9508ac0906060016127a7565b6000546001600160a01b03163314612cb05760405162461bcd60e51b81526020600482018190526024820152600080516020615bc18339815191526044820152606401610db3565b6007805460ff19168215159081179091556040519081527f1584ad594a70cbe1e6515592e1272a987d922b097ead875069cebe8b40c004a49060200161289d565b6000546001600160a01b03163314612d395760405162461bcd60e51b81526020600482018190526024820152600080516020615bc18339815191526044820152606401610db3565b61ffff83166000908152600260205260409020612d57908383614bdd565b507ffa41487ad5d6728f0b19276fa1eddc16558578f5109fc39d2dc33c3230470dab8383836040516127a7939291906157ca565b6000546001600160a01b03163314612dd35760405162461bcd60e51b81526020600482018190526024820152600080516020615bc18339815191526044820152606401610db3565b6001600160a01b038116612e4f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610db3565b612e5881613991565b50565b600154604051633d7b2f6f60e21b815261ffff808716600483015285166024820152306044820152606481018390526060916001600160a01b03169063f5ecbdbc90608401600060405180830381865afa158015612ebd573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612ee59190810190615989565b95945050505050565b801580612f685750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa158015612f42573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f6691906157e8565b155b612fda5760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527f20746f206e6f6e2d7a65726f20616c6c6f77616e6365000000000000000000006064820152608401610db3565b6040516001600160a01b0383166024820152604481018290526116f990849063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152613dda565b606061304c8484600085613ebf565b949350505050565b6000806130b75a60966366ad5c8a60e01b8989898960405160240161307c94939291906159be565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915230929190613ffe565b91509150816114c5576114c58686868685614089565b60606000600f60009054906101000a90046001600160a01b03166001600160a01b031663d55a23f46040518163ffffffff1660e01b8152600401602060405180830381865afa158015613124573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061314891906157e8565b90506131558160016156b0565b67ffffffffffffffff81111561316d5761316d614ebd565b6040519080825280602002602001820160405280156131b257816020015b604080518082019091526000808252602082015281526020019060019003908161318b5790505b50600f54604051633af9e66960e01b81523060048201529193506000916001600160a01b0390911690633af9e66990602401602060405180830381865afa158015613201573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061322591906157e8565b6001600160a01b037f000000000000000000000000616e8bfa43f920657b3497dbf40d6b1a02d4608d16600090815260126020526040812054601054929350909161327090846156e3565b61327a91906156e3565b905060405180604001604052807f000000000000000000000000616e8bfa43f920657b3497dbf40d6b1a02d4608d6001600160a01b0316815260200182815250846000815181106132cd576132cd615684565b602002602001018190525060005b838110156134ff57600f54604051632061aa2360e11b8152600481018390526000916001600160a01b0316906340c3544690602401602060405180830381865afa15801561332d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061335191906159fd565b90506000816001600160a01b031663f7c618c16040518163ffffffff1660e01b8152600401602060405180830381865afa158015613393573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133b791906159fd565b9050816001600160a01b0316633d18b9126040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156133f457600080fd5b505af1158015613408573d6000803e3d6000fd5b50506040516370a0823160e01b8152306004820152600092506001600160a01b03841691506370a0823190602401602060405180830381865afa158015613453573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061347791906157e8565b6001600160a01b0383166000908152601260205260408120549192509061349f908390614127565b90506040518060400160405280846001600160a01b0316815260200182815250898660016134cd91906156b0565b815181106134dd576134dd615684565b60200260200101819052505050505080806134f7906156c8565b9150506132db565b5050505090565b60006118cd8284615a1a565b60006118cd8284615a39565b600f546040805163a2468c1960e01b815290516000926001600160a01b03169163a2468c199160048083019260209291908290030181865afa158015613568573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061358c91906157e8565b600f54604051637faaa6c160e01b8152600060048201529192506001600160a01b031690637faaa6c190602401600060405180830381600087803b1580156135d357600080fd5b505af11580156135e7573d6000803e3d6000fd5b5050600f54604051632d182be560e21b81526004810186905230602482018190526044820152600093506001600160a01b03909116915063b460af94906064016020604051808303816000875af1158015613646573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061366a91906157e8565b600f54604051637faaa6c160e01b8152600481018590529192506001600160a01b031690637faaa6c190602401600060405180830381600087803b1580156136b157600080fd5b505af11580156136c5573d6000803e3d6000fd5b50505050828110156116f95760405162461bcd60e51b815260206004820152600a60248201527f2177697468647261776e000000000000000000000000000000000000000000006044820152606401610db3565b6040516001600160a01b0383166024820152604481018290526116f990849063a9059cbb60e01b90606401613006565b61ffff83166000908152600d602090815260408083208584528252909120825161377592840190614b59565b508261ffff167f27b2a73dad2edfd34e81c66132b9deaeb44b501067b2a055f30c52aab5efe32183836040516137ac929190615a5b565b60405180910390a2505050565b600754610100900460ff166138105760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f74207061757365640000000000000000000000006044820152606401610db3565b6007805461ff00191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b60006118cd82846156b0565b60006138728261351e565b600061387f858585614133565b9050806010600082825461389391906156e3565b909155509095945050505050565b60006120c54262093a80613512565b611db3898989898080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8a018190048102820181019092528881528c93508b92508a918a908a908190840183828082843760009201919091525061429092505050565b602081015161ffff81166139495761394485858585614337565b61109c565b60405162461bcd60e51b815260206004820152601c60248201527f4f4654436f72653a20756e6b6e6f776e207061636b65742074797065000000006044820152606401610db3565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600754610100900460ff1615613a2c5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610db3565b6007805461ff0019166101001790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861383e3390565b606081613a7181601f6156b0565b1015613abf5760405162461bcd60e51b815260206004820152600e60248201527f736c6963655f6f766572666c6f770000000000000000000000000000000000006044820152606401610db3565b613ac982846156b0565b84511015613b195760405162461bcd60e51b815260206004820152601160248201527f736c6963655f6f75744f66426f756e64730000000000000000000000000000006044820152606401610db3565b606082158015613b385760405191506000825260208201604052613b82565b6040519150601f8416801560200281840101858101878315602002848b0101015b81831015613b71578051835260209283019201613b59565b5050858452601f01601f1916604052505b50949350505050565b61ffff861660009081526002602052604081208054613ba99061563f565b80601f0160208091040260200160405190810160405280929190818152602001828054613bd59061563f565b8015613c225780601f10613bf757610100808354040283529160200191613c22565b820191906000526020600020905b815481529060010190602001808311613c0557829003601f168201915b50505050509050805160001415613ca15760405162461bcd60e51b815260206004820152603060248201527f4c7a4170703a2064657374696e6174696f6e20636861696e206973206e6f742060448201527f61207472757374656420736f75726365000000000000000000000000000000006064820152608401610db3565b613cac87875161436e565b60015460405162c5803160e81b81526001600160a01b039091169063c5803100908490613ce7908b9086908c908c908c908c90600401615a74565b6000604051808303818588803b158015613d0057600080fd5b505af1158015613d14573d6000803e3d6000fd5b505050505050505050505050565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa158015613d73573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d9791906157e8565b613da191906156b0565b6040516001600160a01b038516602482015260448101829052909150613dd490859063095ea7b360e01b90606401613006565b50505050565b6000613e2f826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661303d9092919063ffffffff16565b8051909150156116f95780806020019051810190613e4d9190615ace565b6116f95760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610db3565b606082471015613f375760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610db3565b843b613f855760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610db3565b600080866001600160a01b03168587604051613fa19190615aeb565b60006040518083038185875af1925050503d8060008114613fde576040519150601f19603f3d011682016040523d82523d6000602084013e613fe3565b606091505b5091509150613ff38282866143dc565b979650505050505050565b6000606060008060008661ffff1667ffffffffffffffff81111561402457614024614ebd565b6040519080825280601f01601f19166020018201604052801561404e576020820181803683370190505b50905060008087516020890160008d8df191503d925086831115614070578692505b828152826000602083013e909890975095505050505050565b8180519060200120600660008761ffff1661ffff168152602001908152602001600020856040516140ba9190615aeb565b90815260408051918290036020908101832067ffffffffffffffff88166000908152915220919091557fe183f33de2837795525b4792ca4cd60535bd77c53b7e7030060bfcf5734d6b0c906141189087908790879087908790615b07565b60405180910390a15050505050565b60006118cd82846156e3565b6040516370a0823160e01b81526001600160a01b03838116600483015260009182917f000000000000000000000000616e8bfa43f920657b3497dbf40d6b1a02d4608d16906370a0823190602401602060405180830381865afa15801561419e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906141c291906157e8565b90506141f86001600160a01b037f000000000000000000000000616e8bfa43f920657b3497dbf40d6b1a02d4608d168585613719565b6040516370a0823160e01b81526001600160a01b03858116600483015282917f000000000000000000000000616e8bfa43f920657b3497dbf40d6b1a02d4608d909116906370a0823190602401602060405180830381865afa158015614262573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061428691906157e8565b612ee591906156e3565b61429e866000836000614415565b60006142ac888888886144a6565b905060008087836040516020016142c593929190615801565b60405160208183030381529060405290506142e4888287878734613b8b565b886001600160a01b03168861ffff167f39a4c66499bcf4b56d79f0dde8ed7a9d4925a0df55825206b2b8531e202be0d0898560405161432492919061582e565b60405180910390a3505050505050505050565b6000808280602001905181019061434e9190615b66565b90935091506000905061436183826144e2565b9050610f7e878284614558565b61ffff82166000908152600460205260409020548061438c57506127105b808211156116f95760405162461bcd60e51b815260206004820181905260248201527f4c7a4170703a207061796c6f61642073697a6520697320746f6f206c617267656044820152606401610db3565b606083156143eb5750816118cd565b8251156143fb5782518084602001fd5b8160405162461bcd60e51b8152600401610db3919061525b565b60075460ff16156144315761442c848484846146df565b613dd4565b815115613dd45760405162461bcd60e51b815260206004820152602660248201527f4f4654436f72653a205f61646170746572506172616d73206d7573742062652060448201527f656d7074792e00000000000000000000000000000000000000000000000000006064820152608401610db3565b6000806144b5868686866147be565b90506144bf614983565b905080601060008282546144d391906156b0565b90915550909695505050505050565b60006144ef8260146156b0565b8351101561453f5760405162461bcd60e51b815260206004820152601560248201527f746f416464726573735f6f75744f66426f756e647300000000000000000000006044820152606401610db3565b5001602001516c01000000000000000000000000900490565b60006145626138a1565b6000818152600b602052604081205491925061457e828561385b565b6000848152600b60209081526040808320849055600854600a90925290912054919250906145ad908390614a8c565b11806145c05750600754610100900460ff165b156146825760408051602080820186905261ffff89168284018190526001600160a01b03891660608401819052608084018990524260a08086018290528651808703909101815260c086018088528151918601919091206000908152600c90955293869020805460ff191660011790559288905260e0840191909152610100830152610120820187905261014082015290517fa0381c37c26d93bfda7e2060ab159ac4cbb9cddae7f4b2ecb28dc131d13bbd76918190036101600190a16114c5565b61468d868686613867565b9350846001600160a01b03168661ffff167fbf551ec93859b170f9b2141bd9298bf3f64322c6f7beb2543a0cb669834118bf866040516146cf91815260200190565b60405180910390a3505050505050565b60006146ea83614aa0565b61ffff80871660009081526003602090815260408083209389168352929052908120549192509061471c9084906156b0565b90506000811161476e5760405162461bcd60e51b815260206004820152601a60248201527f4c7a4170703a206d696e4761734c696d6974206e6f74207365740000000000006044820152606401610db3565b808210156114c55760405162461bcd60e51b815260206004820152601b60248201527f4c7a4170703a20676173206c696d697420697320746f6f206c6f7700000000006044820152606401610db3565b60006001600160a01b03851633146148235760405162461bcd60e51b815260206004820152602260248201527f50726f78794f46543a206f776e6572206973206e6f742073656e642063616c6c60448201526132b960f11b6064820152608401610db3565b6040516370a0823160e01b81523060048201526000907f000000000000000000000000616e8bfa43f920657b3497dbf40d6b1a02d4608d6001600160a01b0316906370a0823190602401602060405180830381865afa15801561488a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906148ae91906157e8565b90506148e56001600160a01b037f000000000000000000000000616e8bfa43f920657b3497dbf40d6b1a02d4608d16873086614afc565b6040516370a0823160e01b815230600482015281907f000000000000000000000000616e8bfa43f920657b3497dbf40d6b1a02d4608d6001600160a01b0316906370a0823190602401602060405180830381865afa15801561494b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061496f91906157e8565b61497991906156e3565b9695505050505050565b6040516370a0823160e01b815230600482015260009081906001600160a01b037f000000000000000000000000616e8bfa43f920657b3497dbf40d6b1a02d4608d16906370a0823190602401602060405180830381865afa1580156149ec573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614a1091906157e8565b600f54604051636e553f6560e01b8152600481018390523060248201529192506001600160a01b031690636e553f65906044016020604051808303816000875af1158015614a62573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614a8691906157e8565b50919050565b600081831115610fb8576118cd8383614127565b6000602282511015614af45760405162461bcd60e51b815260206004820152601c60248201527f4c7a4170703a20696e76616c69642061646170746572506172616d73000000006044820152606401610db3565b506022015190565b6040516001600160a01b0380851660248301528316604482015260648101829052613dd49085906323b872dd60e01b90608401613006565b50805460008255600f016010900490600052602060002090810190612e589190614c51565b828054614b659061563f565b90600052602060002090601f016020900481019282614b875760008555614bcd565b82601f10614ba057805160ff1916838001178555614bcd565b82800160010185558215614bcd579182015b82811115614bcd578251825591602001919060010190614bb2565b50614bd9929150614c51565b5090565b828054614be99061563f565b90600052602060002090601f016020900481019282614c0b5760008555614bcd565b82601f10614c245782800160ff19823516178555614bcd565b82800160010185558215614bcd579182015b82811115614bcd578235825591602001919060010190614c36565b5b80821115614bd95760008155600101614c52565b61ffff81168114612e5857600080fd5b60008083601f840112614c8857600080fd5b50813567ffffffffffffffff811115614ca057600080fd5b602083019150836020828501011115614cb857600080fd5b9250929050565b803567ffffffffffffffff81168114614cd757600080fd5b919050565b60008060008060008060808789031215614cf557600080fd5b8635614d0081614c66565b9550602087013567ffffffffffffffff80821115614d1d57600080fd5b614d298a838b01614c76565b9097509550859150614d3d60408a01614cbf565b94506060890135915080821115614d5357600080fd5b50614d6089828a01614c76565b979a9699509497509295939492505050565b600060208284031215614d8457600080fd5b81356001600160e01b0319811681146118cd57600080fd5b600060208284031215614dae57600080fd5b5035919050565b600060208284031215614dc757600080fd5b81356118cd81614c66565b600080600060408486031215614de757600080fd5b83359250602084013567ffffffffffffffff811115614e0557600080fd5b614e1186828701614c76565b9497909650939450505050565b60005b83811015614e39578181015183820152602001614e21565b83811115613dd45750506000910152565b60008151808452614e62816020860160208601614e1e565b601f01601f19169290920160200192915050565b821515815260406020820152600061304c6040830184614e4a565b60008060408385031215614ea457600080fd5b8235614eaf81614c66565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715614efc57614efc614ebd565b604052919050565b600067ffffffffffffffff821115614f1e57614f1e614ebd565b5060051b60200190565b60008060408385031215614f3b57600080fd5b823567ffffffffffffffff811115614f5257600080fd5b8301601f81018513614f6357600080fd5b80356020614f78614f7383614f04565b614ed3565b82815260059290921b83018101918181019088841115614f9757600080fd5b938201935b83851015614fb557843582529382019390820190614f9c565b98969091013596505050505050565b6001600160a01b0381168114612e5857600080fd5b60008060408385031215614fec57600080fd5b8235614ff781614c66565b9150602083013561500781614fc4565b809150509250929050565b60006020828403121561502457600080fd5b81356118cd81614fc4565b60008060006060848603121561504457600080fd5b833561504f81614fc4565b9250602084013561505f81614fc4565b929592945050506040919091013590565b8015158114612e5857600080fd5b600080600080600080600060a0888a03121561509957600080fd5b87356150a481614c66565b9650602088013567ffffffffffffffff808211156150c157600080fd5b6150cd8b838c01614c76565b909850965060408a0135955060608a013591506150e982615070565b909350608089013590808211156150ff57600080fd5b5061510c8a828b01614c76565b989b979a50959850939692959293505050565b600067ffffffffffffffff82111561513957615139614ebd565b50601f01601f191660200190565b600082601f83011261515857600080fd5b8135615166614f738261511f565b81815284602083860101111561517b57600080fd5b816020850160208301376000918101602001919091529392505050565b6000806000606084860312156151ad57600080fd5b83356151b881614c66565b925060208401359150604084013567ffffffffffffffff8111156151db57600080fd5b6151e786828701615147565b9150509250925092565b60008060006040848603121561520657600080fd5b833561521181614c66565b9250602084013567ffffffffffffffff811115614e0557600080fd5b6000806040838503121561524057600080fd5b823561524b81614fc4565b9150602083013561500781615070565b6020815260006118cd6020830184614e4a565b6000806040838503121561528157600080fd5b8235614ff781614fc4565b600080600080600060a086880312156152a457600080fd5b8535945060208601356152b681614c66565b935060408601356152c681614fc4565b94979396509394606081013594506080013592915050565b600080600080600080600080600060e08a8c0312156152fc57600080fd5b893561530781614fc4565b985060208a013561531781614c66565b975060408a013567ffffffffffffffff8082111561533457600080fd5b6153408d838e01614c76565b909950975060608c0135965060808c0135915061535c82614fc4565b90945060a08b01359061536e82614fc4565b90935060c08b0135908082111561538457600080fd5b506153918c828d01614c76565b915080935050809150509295985092959850929598565b600060208083850312156153bb57600080fd5b823567ffffffffffffffff8111156153d257600080fd5b8301601f810185136153e357600080fd5b80356153f1614f7382614f04565b81815260059190911b8201830190838101908783111561541057600080fd5b928401925b82841015613ff357833561542881614c66565b82529284019290840190615415565b60008060006060848603121561544c57600080fd5b833561545781614c66565b9250602084013567ffffffffffffffff81111561547357600080fd5b61547f86828701615147565b92505061548e60408501614cbf565b90509250925092565b600080604083850312156154aa57600080fd5b82356154b581614c66565b9150602083013561500781614c66565b6000806000606084860312156154da57600080fd5b83356154e581614fc4565b925060208401356154f581614c66565b9150604084013561550581614fc4565b809150509250925092565b60008060008060006080868803121561552857600080fd5b853561553381614c66565b9450602086013561554381614c66565b935060408601359250606086013567ffffffffffffffff81111561556657600080fd5b61557288828901614c76565b969995985093965092949392505050565b6000806040838503121561559657600080fd5b82356154b581614fc4565b6000806000606084860312156155b657600080fd5b83356155c181614c66565b9250602084013561505f81614c66565b6000602082840312156155e357600080fd5b81356118cd81615070565b6000806000806080858703121561560457600080fd5b843561560f81614c66565b9350602085013561561f81614c66565b9250604085013561562f81614fc4565b9396929550929360600135925050565b600181811c9082168061565357607f821691505b60208210811415614a8657634e487b7160e01b600052602260045260246000fd5b8183823760009101908152919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600082198211156156c3576156c361569a565b500190565b60006000198214156156dc576156dc61569a565b5060010190565b6000828210156156f5576156f561569a565b500390565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b61ffff851681526060602082015260006157416060830185876156fa565b905082604083015295945050505050565b61ffff871681526001600160a01b038616602082015260a06040820152600061577e60a0830187614e4a565b851515606084015282810360808401526157998185876156fa565b9998505050505050505050565b600080604083850312156157b957600080fd5b505080516020909101519092909150565b61ffff84168152604060208201526000612ee56040830184866156fa565b6000602082840312156157fa57600080fd5b5051919050565b61ffff8416815260606020820152600061581e6060830185614e4a565b9050826040830152949350505050565b6040815260006158416040830185614e4a565b90508260208301529392505050565b60006001600160a01b03808a16835261ffff8916602084015260e0604084015261587d60e0840189614e4a565b876060850152818716608085015281861660a085015283810360c08501526158a58186614e4a565b9b9a5050505050505050505050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b600061ffff808816835280871660208401525084604083015260806060830152613ff36080830184866156fa565b61ffff861681526080602082015260006159266080830186886156fa565b67ffffffffffffffff94909416604083015250606001529392505050565b600082601f83011261595557600080fd5b8151615963614f738261511f565b81815284602083860101111561597857600080fd5b61304c826020830160208701614e1e565b60006020828403121561599b57600080fd5b815167ffffffffffffffff8111156159b257600080fd5b61304c84828501615944565b61ffff851681526080602082015260006159db6080830186614e4a565b67ffffffffffffffff851660408401528281036060840152613ff38185614e4a565b600060208284031215615a0f57600080fd5b81516118cd81614fc4565b6000816000190483118215151615615a3457615a3461569a565b500290565b600082615a5657634e487b7160e01b600052601260045260246000fd5b500490565b82815260406020820152600061304c6040830184614e4a565b61ffff8716815260c060208201526000615a9160c0830188614e4a565b8281036040840152615aa38188614e4a565b6001600160a01b0387811660608601528616608085015283810360a085015290506157998185614e4a565b600060208284031215615ae057600080fd5b81516118cd81615070565b60008251615afd818460208701614e1e565b9190910192915050565b61ffff8616815260a060208201526000615b2460a0830187614e4a565b67ffffffffffffffff861660408401528281036060840152615b468186614e4a565b90508281036080840152615b5a8185614e4a565b98975050505050505050565b600080600060608486031215615b7b57600080fd5b8351615b8681614c66565b602085015190935067ffffffffffffffff811115615ba357600080fd5b615baf86828701615944565b92505060408401519050925092509256fe4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a164736f6c634300080b000a

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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