Contract 0x70098588622d4C9e511B75a9f96BC346EA85363E 1

Txn Hash Method
Block
From
To
Value [Txn Fee]
0xdbb195e45d5ef31b9c10f6806e53595a99f19cfcb01cb334760703cabf8cd1f20x60a06040164228892022-06-23 18:33:416 days 14 hrs ago0xb00b19938346b745ccb3fc4fad946de0caa724a2 IN  Create: BridgeUpgradeable0 AVAX0.12355492525
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.

Contract Source Code Verified (Exact Match)

Contract Name:
BridgeUpgradeable

Compiler Version
v0.8.2+commit.661d1103

Optimization Enabled:
Yes with 50 runs

Other Settings:
default evmVersion
File 1 of 23 : BridgeUpgradeable.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.2;

import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";

import "./interfaces/IVoterUpgradeable.sol";
import "./interfaces/IERC20Upgradeable.sol";

import "./interfaces/IDepositExecute.sol";
import "./interfaces/ILiquidityPool.sol";
import "./interfaces/IERCHandler.sol";
import "./interfaces/IERCHandlerDecimals.sol";
import "./interfaces/IGenericHandler.sol";
import "./interfaces/IWETH.sol";

/**
    @title Facilitates deposits, creation and voting of deposit proposals, and deposit executions.
    @author Router Protocol
 */
contract BridgeUpgradeable is
    Initializable,
    PausableUpgradeable,
    AccessControlUpgradeable,
    UUPSUpgradeable,
    ReentrancyGuardUpgradeable
{
    function fetch_chainID() public view virtual returns (uint8) {
        return _chainID;
    }

    function fetch_expiry() public view virtual returns (uint256) {
        return _expiry;
    }

    function fetch_whitelistEnabled() public view virtual returns (bool) {
        return _whitelistEnabled;
    }

    function fetch_depositCounts(uint8 _id) public view virtual returns (uint64) {
        return _depositCounts[_id];
    }

    function fetch_resourceIDToHandlerAddress(bytes32 _id) public view virtual returns (address) {
        return _resourceIDToHandlerAddress[_id];
    }

    function fetch_proposals(bytes32 _id) public view virtual returns (uint256) {
        return _proposals[_id];
    }

    function fetch_whitelist(address _beneficiary) public view virtual returns (bool) {
        return _whitelist[_beneficiary];
    }

    function GetProposalHash(
        uint8 chainID,
        uint64 depositNonce,
        bytes32 dataHash
    ) public pure virtual returns (bytes32) {
        bytes32 proposalHash = keccak256(abi.encodePacked(chainID, depositNonce, dataHash));
        return proposalHash;
    }

    function HasVotedOnProposal(
        uint8 chainID,
        uint64 depositNonce,
        bytes32 dataHash
    ) public view virtual returns (bool) {
        bytes32 proposalHash = keccak256(abi.encodePacked(chainID, depositNonce, dataHash));
        uint256 id = _proposals[proposalHash];
        return _voter.Voted(id, msg.sender);
    }

    // View Functions

    uint8 private _chainID;
    uint256 private _expiry;
    bool private _whitelistEnabled;
    bytes32 public constant FEE_SETTER_ROLE = keccak256("FEE_SETTER_ROLE");
    bytes32 public constant RELAYER_ROLE = keccak256("RELAYER_ROLE");
    bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE");
    bytes32 public constant RESOURCE_SETTER = keccak256("RESOURCE_SETTER");
    bytes32 public constant EMERGENCY_ROLE = keccak256("EMERGENCY_ROLE");
    uint256 public totalRelayers;

    uint64 public _quorum;

    IVoterUpgradeable public _voter;

    // enum ProposalStatus { Inactive, Active, Passed, Executed, Cancelled }

    mapping(uint8 => uint64) private _depositCounts;

    mapping(bytes32 => address) private _resourceIDToHandlerAddress;

    mapping(bytes32 => uint256) private _proposals;

    mapping(address => bool) private _whitelist;

    mapping(uint256 => proposalStruct) private _proposalDetails;

    struct proposalStruct {
        uint8 chainID;
        uint64 depositNonce;
        bytes32 dataHash;
        bytes32 resourceID;
    }

    mapping(address => bool) private _genericWhitelist;

    // Data Structure Ends

    event quorumChanged(uint64 quorum);
    event expiryChanged(uint256 expiry);
    event ProposalEvent(
        uint8 originChainID,
        uint64 depositNonce,
        IVoterUpgradeable.ProposalStatus status,
        bytes32 dataHash
    );
    event ProposalVote(
        uint8 originChainID,
        uint64 depositNonce,
        IVoterUpgradeable.ProposalStatus status,
        bytes32 dataHash
    );
    event Deposit(
        uint8 indexed destinationChainID,
        bytes32 indexed resourceID,
        uint64 indexed depositNonce,
        uint256 widgetID
    );
    event Stake(address indexed staker, uint256 amount, address pool);
    event Unstake(address indexed unstaker, uint256 amount, address pool);
    event FeeSetterAdded(address feeSetter);
    event FeeSetterRemoved(address feeSetter);
    event AddedWhitelist(address whitelistAddress);
    event RemovedWhitelist(address whitelistAddress);
    event WhitelistingSetting(bool status);
    event AdminWithdraw(address handler, address tokenAddress, address recipient, uint256 amountOrTokenID);
    event Settlement(
        uint8 indexed originChainID,
        uint64 indexed depositNonce,
        address settlementToken,
        uint256 settlementAmount,
        IVoterUpgradeable.ProposalStatus status
    );
    event GenericDeposit(
        uint8 indexed destinationChainID,
        bytes32 resourceID,
        uint64 depositNonce,
        address indexed user,
        bytes data
    );
    /**
        @notice RelayerAdded Event
        @notice Creates a event when Relayer Role is granted.
        @param relayer Address of relayer.
    */
    event RelayerAdded(address relayer);

    /**
        @notice RelayerRemoved Event
        @notice Creates a event when Relayer Role is revoked.
        @param relayer Address of relayer.
    */
    event RelayerRemoved(address relayer);

    // Modifier Section Starts

    modifier onlyAdminOrRelayer() {
        require(
            hasRole(DEFAULT_ADMIN_ROLE, msg.sender) || hasRole(RELAYER_ROLE, msg.sender),
            "sender is not relayer or admin"
        );
        _;
    }

    modifier isWhitelisted() {
        if (_whitelistEnabled) {
            require(_whitelist[msg.sender], "address is not whitelisted");
        }
        _;
    }

    modifier isWhitelistEnabled() {
        require(_whitelistEnabled, "BridgeUpgradeable: White listing is not enabled");
        _;
    }

    modifier isResourceID(bytes32 _id) {
        require(_resourceIDToHandlerAddress[_id] != address(0), "BridgeUpgradeable: No handler for resourceID");
        _;
    }

    modifier isProposalExists(
        uint8 chainID,
        uint64 depositNonce,
        bytes32 dataHash
    ) {
        bytes32 proposalHash = keccak256(abi.encodePacked(chainID, depositNonce, dataHash));
        require(_proposals[proposalHash] != 0, "BridgeUpgradeable: Proposal Already Exists");
        _;
    }

    // Modifier Section ends

    receive() external payable {}

    // Upgrade Section Starts
    /**
        @notice Initializes Bridge, creates and grants {msg.sender} the admin role,
        creates and grants {initialRelayers} the relayer role.
        @param chainID ID of chain the Bridge contract exists on.
        @param quorum Number of votes needed for a deposit proposal to be considered passed.
     */
    function initialize(
        uint8 chainID,
        uint256 quorum,
        uint256 expiry,
        address voter
    ) external initializer {
        __AccessControl_init();
        __Pausable_init();

        // Constructor Fx
        _setupRole(DEFAULT_ADMIN_ROLE, msg.sender);

        _voter = IVoterUpgradeable(voter);

        _chainID = chainID;
        _quorum = uint64(quorum);
        _expiry = expiry;

        // Constructor Fx
    }

    function _authorizeUpgrade(address newImplementation) internal virtual override onlyRole(DEFAULT_ADMIN_ROLE) {}

    // Upgrade Section Ends

    // Access Control Section Starts

    /**
        @notice grantRole function
        @dev Overrides the grant role in accessControl contract.
        @dev If RELAYER_ROLE is granted then it would mint 1 voting token as voting weights.
        @dev The Token minted would be notional and non transferable type.
        @param role Hash of the role being granted
        @param account address to which role is being granted
    */
    function grantRole(bytes32 role, address account)
        public
        virtual
        override
        nonReentrant
        onlyRole(getRoleAdmin(role))
    {
        super.grantRole(role, account);
        if (role == RELAYER_ROLE && _voter.balanceOf(account) == 0 ether) {
            _voter.mint(account);
            totalRelayers = totalRelayers + 1;
            emit RelayerAdded(account);
        }
    }

    /**
        @notice revokeRole function
        @dev Overrides the grant role in accessControl contract.
        @dev If RELAYER_ROLE is revoked then it would burn 1 voting token as voting weights.
        @dev The Token burned would be notional and non transferable type.
        @param role Hash of the role being revoked
        @param account address to which role is being revoked
    */
    function revokeRole(bytes32 role, address account)
        public
        virtual
        override
        nonReentrant
        onlyRole(getRoleAdmin(role))
    {
        super.revokeRole(role, account);
        if (role == RELAYER_ROLE && _voter.balanceOf(account) == 1 ether) {
            _voter.burn(account);
            totalRelayers = totalRelayers - 1;
            emit RelayerRemoved(account);
        }
    }

    // Access Control Section Ends

    // Whitelist Section Starts
    /**
        @dev Adds single address to _whitelist.
        @param _beneficiary Address to be added to the _whitelist
    */
    function addToWhitelist(address _beneficiary) public virtual onlyRole(DEFAULT_ADMIN_ROLE) isWhitelistEnabled {
        _whitelist[_beneficiary] = true;
        emit AddedWhitelist(_beneficiary);
    }

    /**
        @dev Removes single address from _whitelist.
        @param _beneficiary Address to be removed to the _whitelist
    */
    function removeFromWhitelist(address _beneficiary) public virtual onlyRole(DEFAULT_ADMIN_ROLE) isWhitelistEnabled {
        _whitelist[_beneficiary] = false;
        emit RemovedWhitelist(_beneficiary);
    }

    /**
        @dev setWhitelisting whitelisting process.
    */
    function setWhitelisting(bool value) public virtual onlyRole(DEFAULT_ADMIN_ROLE) {
        _whitelistEnabled = value;
        emit WhitelistingSetting(value);
    }

    // Whitelist Section Ends

    // Pause Section Starts

    /**
        @notice Pauses deposits, proposal creation and voting, and deposit executions.
        @notice Only callable by an address that currently has the admin role.
    */
    function pause() public virtual onlyRole(PAUSER_ROLE) whenNotPaused {
        _pause();
    }

    /**
        @notice Unpauses deposits, proposal creation and voting, and deposit executions.
        @notice Only callable by an address that currently has the admin role.
     */
    function unpause() public virtual onlyRole(PAUSER_ROLE) whenPaused {
        _unpause();
    }

    // Pause Section Ends

    // Ancilary Admin Functions Starts



    /**
        @notice Modifies the number of votes required for a proposal to be considered passed.
        @notice Only callable by an address that currently has the admin role.
        @param newQuorum Value {newQuorum} will be changed to.
        @notice Emits {quorumChanged} event.
     */
    function adminChangeQuorum(uint256 newQuorum) public virtual onlyRole(DEFAULT_ADMIN_ROLE) {
        _quorum = uint64(newQuorum);
        emit quorumChanged(_quorum);
    }

    /**
        @notice Modifies the block expiry for a proposal.
        @notice Only callable by an address that currently has the admin role.
        @param newExpiry will be new value of _expiry.
        @notice Emits {expiryChanged} event.
     */
    function adminChangeExpiry(uint256 newExpiry) public virtual onlyRole(DEFAULT_ADMIN_ROLE) {
        _expiry = newExpiry;
        emit expiryChanged(_expiry);
    }

    /**
        @notice Sets a new resource for handler contracts that use the IERCHandler interface,
        and maps the {handlerAddress} to {resourceID} in {_resourceIDToHandlerAddress}.
        @notice Only callable by an address that currently has the admin role.
        @param handlerAddress Address of handler resource will be set for.
        @param resourceID ResourceID to be used when making deposits.
        @param tokenAddress Address of contract to be called when a deposit is made and a deposited is executed.
     */
    function adminSetResource(
        address handlerAddress,
        bytes32 resourceID,
        address tokenAddress
    ) public virtual onlyRole(RESOURCE_SETTER) {
        _resourceIDToHandlerAddress[resourceID] = handlerAddress;
        IERCHandler handler = IERCHandler(handlerAddress);
        handler.setResource(resourceID, tokenAddress);
    }

    /**
        @notice Sets a new resource for handler contracts that use the IERCHandler interface,
        and maps the {handlerAddress} to {resourceID} in {_resourceIDToHandlerAddress}.
        @notice Only callable by an address that currently has the admin role.
        @param handlerAddress Address of handler resource will be set for.
        @param tokenAddress token contract for setting config.
        @param destinationChainID destinationChainID to be used when setting config.
        @param decimals decimals for token on target chain.
     */
    function adminSetTokenDecimals(
        address handlerAddress,
        address tokenAddress,
        uint8 destinationChainID,
        uint8 decimals
    ) public virtual onlyRole(RESOURCE_SETTER) {
        IERCHandlerDecimals handler = IERCHandlerDecimals(handlerAddress);
        handler.setTokenDecimals(tokenAddress, destinationChainID, decimals);
    }

    function adminSetOneSplitAddress(address handlerAddress, address contractAddress)
        public
        virtual
        onlyRole(DEFAULT_ADMIN_ROLE)
    {
        IERCHandler handler = IERCHandler(handlerAddress);
        handler.setOneSplitAddress(contractAddress);
    }

    /**
    @notice Creates new liquidity pool
    @notice Only callable by an address that currently has the admin role.
    @param handlerAddress Address of handler resource will be set for.
    @param tokenAddress Address of token for which pool needs to be created.
 */
    function adminSetLiquidityPool(
        string memory name,
        string memory symbol,
        uint8 decimals,
        address handlerAddress,
        address tokenAddress,
        address lpAddress
    ) public virtual onlyRole(DEFAULT_ADMIN_ROLE) {
        IERCHandler handler = IERCHandler(handlerAddress);
        handler.setLiquidityPool(name, symbol, decimals, tokenAddress, lpAddress);
    }

    function adminSetLiquidityPoolOwner(
        address handlerAddress,
        address newOwner,
        address tokenAddress,
        address lpAddress
    ) public virtual onlyRole(DEFAULT_ADMIN_ROLE) {
        IERCHandler handler = IERCHandler(handlerAddress);
        handler.setLiquidityPoolOwner(newOwner, tokenAddress, lpAddress);
    }

    /**
        @notice Sets a new resource for handler contracts that use the IGenericHandler interface,
        and maps the {handlerAddress} to {resourceID} in {_resourceIDToHandlerAddress}.
        @notice Only callable by an address that currently has the admin role.
        @param handlerAddress Address of handler resource will be set for.
        @param resourceID ResourceID to be used when making deposits.
     */
    function adminSetGenericResource(address handlerAddress, bytes32 resourceID)
        public
        virtual
        onlyRole(RESOURCE_SETTER)
    {
        _resourceIDToHandlerAddress[resourceID] = handlerAddress;
        _genericWhitelist[handlerAddress] = true;
    }

    /**
        @notice Sets a resource as burnable for handler contracts that use the IERCHandler interface.
        @notice Only callable by an address that currently has the admin role.
        @param handlerAddress Address of handler resource will be set for.
        @param tokenAddress Address of contract to be called when a deposit is made and a deposited is executed.
        @param status Boolean flag to change burnable status.
     */
    function adminSetBurnable(
        address handlerAddress,
        address tokenAddress,
        bool status
    ) public virtual onlyRole(DEFAULT_ADMIN_ROLE) {
        IERCHandler handler = IERCHandler(handlerAddress);
        handler.setBurnable(tokenAddress, status);
    }

    /**
        @notice Used to manually withdraw funds from ERC safes.
        @param handlerAddress Address of handler to withdraw from.
        @param tokenAddress Address of token to withdraw.
        @param recipient Address to withdraw tokens to.
        @param amount the amount of ERC20 tokens to withdraw.
     */
    function adminWithdraw(
        address handlerAddress,
        address tokenAddress,
        address recipient,
        uint256 amount
    ) public virtual nonReentrant onlyRole(EMERGENCY_ROLE) {
        IERCHandler handler = IERCHandler(handlerAddress);
        handler.withdraw(tokenAddress, recipient, amount);
        emit AdminWithdraw(handlerAddress, tokenAddress, recipient, amount);
    }

    /**
        @notice Used to manually withdraw funds from ERC safes.
        @param handlerAddress Address of handler to withdraw from.
        @param tokenAddress Address of token to withdraw.
        @param recipient Address to withdraw tokens to.
        @param amount the amount of ERC20 tokens to withdraw.
     */
    function adminWithdrawFees(
        address handlerAddress,
        address tokenAddress,
        address recipient,
        uint256 amount
    ) public virtual nonReentrant onlyRole(EMERGENCY_ROLE) {
        IERCHandler handler = IERCHandler(handlerAddress);
        handler.withdrawFees(tokenAddress, recipient, amount);
        emit AdminWithdraw(handlerAddress, tokenAddress, recipient, amount);
    }

    /**
       @notice Used to set feeStatus
       @notice Only callable by admin.
    */
    function adminSetFeeStatus(bytes32 resourceID, bool status) public virtual onlyRole(DEFAULT_ADMIN_ROLE) {
        address handlerAddress = _resourceIDToHandlerAddress[resourceID];
        IERCHandler handler = IERCHandler(handlerAddress);
        handler.toggleFeeStatus(status);
    }

    // Fee Function Starts

    /**
       @notice Used to set fee
       @notice Only callable by feeSetter.
    */
    function setBridgeFee(
        bytes32 resourceID,
        uint8 destinationChainID,
        address feeTokenAddress,
        uint256 transferFee,
        uint256 exchangeFee,
        bool accepted
    ) public virtual onlyRole(FEE_SETTER_ROLE) {
        address handlerAddress = _resourceIDToHandlerAddress[resourceID];
        IERCHandler handler = IERCHandler(handlerAddress);
        require(handler.getFeeStatus(), "fee is not enabled");
        handler.setBridgeFee(destinationChainID, feeTokenAddress, transferFee, exchangeFee, accepted);
    }

    function getBridgeFee(
        bytes32 resourceID,
        uint8 destChainID,
        address feeTokenAddress
    ) public view returns (uint256, uint256) {
        address handlerAddress = _resourceIDToHandlerAddress[resourceID];
        IERCHandler handler = IERCHandler(handlerAddress);
        return handler.getBridgeFee(destChainID, feeTokenAddress);
    }

    // Fee Function Ends

    // Deposit Function Starts

    function deposit(
        uint8 destinationChainID,
        bytes32 resourceID,
        bytes calldata data,
        uint256[] memory flags,
        address[] memory path,
        bytes[] calldata dataTx,
        address feeTokenAddress
    ) public virtual nonReentrant whenNotPaused isWhitelisted {
        _deposit(destinationChainID, resourceID, data, flags, path, dataTx, feeTokenAddress);
    }

    function depositETH(
        uint8 destinationChainID,
        bytes32 resourceID,
        bytes calldata data,
        uint256[] memory flags,
        address[] memory path,
        bytes[] calldata dataTx,
        address feeTokenAddress
    ) public payable virtual nonReentrant whenNotPaused isWhitelisted {
        IERCHandler ercHandler = IERCHandler(_resourceIDToHandlerAddress[resourceID]);
        require(address(ercHandler) != address(0), "resourceID not mapped to handler");
        require(msg.value > 0, "depositETH: No native assets transferred");

        address weth = ercHandler._WETH();

        IWETH(weth).deposit{ value: msg.value }();
        require(IWETH(weth).transfer(msg.sender, msg.value));

        _deposit(destinationChainID, resourceID, data, flags, path, dataTx, feeTokenAddress);
    }

    /**
       @notice Used notify bridge for generic deposit
       @notice Can only be called by Generic handler
    */
    function genericDeposit(uint8 _destChainID, bytes32 _resourceID) external whenNotPaused returns (uint64) {
        require(_genericWhitelist[_resourceIDToHandlerAddress[_resourceID]] == true);
        require(_resourceIDToHandlerAddress[_resourceID] == msg.sender);
        uint64 depositNonce = ++_depositCounts[_destChainID];
        emit Deposit(_destChainID, _resourceID, depositNonce, 0);
        return depositNonce;
    }

    function _deposit(
        uint8 destinationChainID,
        bytes32 resourceID,
        bytes calldata data,
        uint256[] memory flags,
        address[] memory path,
        bytes[] calldata dataTx,
        address feeTokenAddress
    ) private {
        IDepositExecute.SwapInfo memory swapDetails = unpackDepositData(data);

        swapDetails.depositer = msg.sender;
        swapDetails.flags = flags;
        swapDetails.path = path;
        swapDetails.feeTokenAddress = feeTokenAddress;
        swapDetails.dataTx = dataTx;

        swapDetails.handler = _resourceIDToHandlerAddress[resourceID];
        require(swapDetails.handler != address(0), "resourceID not mapped to handler");

        swapDetails.depositNonce = ++_depositCounts[destinationChainID];

        IDepositExecute depositHandler = IDepositExecute(swapDetails.handler);
        depositHandler.deposit(resourceID, destinationChainID, swapDetails.depositNonce, swapDetails);

        emit Deposit(destinationChainID, resourceID, swapDetails.depositNonce, swapDetails.widgetID);
    }

    function unpackDepositData(bytes calldata data)
        internal
        pure
        returns (IDepositExecute.SwapInfo memory depositData)
    {
        IDepositExecute.SwapInfo memory swapDetails;
        uint256 isDestNative;

        (
            swapDetails.srcTokenAmount,
            swapDetails.srcStableTokenAmount,
            swapDetails.destStableTokenAmount,
            swapDetails.destTokenAmount,
            isDestNative,
            swapDetails.lenRecipientAddress,
            swapDetails.lenSrcTokenAddress,
            swapDetails.lenDestTokenAddress
        ) = abi.decode(data, (uint256, uint256, uint256, uint256, uint256, uint256, uint256, uint256));

        //Note: to avoid stack too deep error, we are decoding it again.
        (, , , , , , , , swapDetails.widgetID) = abi.decode(
            data,
            (uint256, uint256, uint256, uint256, uint256, uint256, uint256, uint256, uint256)
        );

        swapDetails.isDestNative = isDestNative == 0 ? false : true;
        swapDetails.index = 288; // 32 * 6 -> 9

        bytes memory recipient = bytes(data[swapDetails.index:swapDetails.index + swapDetails.lenRecipientAddress]);
        swapDetails.index = swapDetails.index + swapDetails.lenRecipientAddress;
        bytes memory srcToken = bytes(data[swapDetails.index:swapDetails.index + swapDetails.lenSrcTokenAddress]);
        swapDetails.index = swapDetails.index + swapDetails.lenSrcTokenAddress;
        bytes memory destStableToken = bytes(
            data[swapDetails.index:swapDetails.index + swapDetails.lenDestTokenAddress]
        );
        swapDetails.index = swapDetails.index + swapDetails.lenDestTokenAddress;
        bytes memory destToken = bytes(data[swapDetails.index:swapDetails.index + swapDetails.lenDestTokenAddress]);

        bytes20 srcTokenAddress;
        bytes20 destStableTokenAddress;
        bytes20 destTokenAddress;
        bytes20 recipientAddress;
        assembly {
            srcTokenAddress := mload(add(srcToken, 0x20))
            destStableTokenAddress := mload(add(destStableToken, 0x20))
            destTokenAddress := mload(add(destToken, 0x20))
            recipientAddress := mload(add(recipient, 0x20))
        }
        swapDetails.srcTokenAddress = srcTokenAddress;
        swapDetails.destStableTokenAddress = address(destStableTokenAddress);
        swapDetails.destTokenAddress = destTokenAddress;
        swapDetails.recipient = address(recipientAddress);

        return swapDetails;
    }

    // Deposit Function Ends

    /**
       @notice Allows staking into liquidity pools.
       @notice Only callable when Bridge is not paused.
       @param handler handler address
       @param tokenAddress Asset which needs to be staked.
       @param amount Amount that needs to be staked.
       @notice Emits {Stake} event.
    */
    function stake(
        address handler,
        address tokenAddress,
        uint256 amount
    ) public virtual whenNotPaused {
        ILiquidityPool depositHandler = ILiquidityPool(handler);
        depositHandler.stake(msg.sender, tokenAddress, amount);
        emit Stake(msg.sender, amount, tokenAddress);
    }

    /**
       @notice Allows staking ETH into liquidity pools.
       @notice Only callable when Bridge is not paused.
       @param handler handler address
       @notice Emits {Stake} event.
    */
    function stakeETH(address handler) public payable virtual nonReentrant whenNotPaused {
        ILiquidityPool depositHandler = ILiquidityPool(handler);
        IERCHandler ercHandler = IERCHandler(handler);
        address WETH = ercHandler._WETH();
        uint256 amount = msg.value;
        require(amount > 0, "stakeETH: insufficient eth provided");

        IWETH(WETH).deposit{ value: amount }();
        assert(IWETH(WETH).transfer(handler, amount));
        depositHandler.stakeETH(msg.sender, WETH, amount);
        emit Stake(msg.sender, amount, WETH);
    }

    /**
       @notice Allows unstaking from liquidity pools.
       @notice Only callable when Bridge is not paused.
       @param handler handler address
       @param tokenAddress Asset which needs to be unstaked.
       @param amount Amount that needs to be unstaked.
       @notice Emits {Unstake} event.
    */
    function unstake(
        address handler,
        address tokenAddress,
        uint256 amount
    ) public virtual whenNotPaused {
        ILiquidityPool depositHandler = ILiquidityPool(handler);
        depositHandler.unstake(msg.sender, tokenAddress, amount);
        emit Unstake(msg.sender, amount, tokenAddress);
    }

    /**
       @notice Allows unstaking ETH from liquidity pools.
       @notice Only callable when Bridge is not paused.
       @param handler handler address
       @param amount Amount that needs to be unstaked.
       @notice Emits {Unstake} event.
    */
    function unstakeETH(address handler, uint256 amount) public virtual nonReentrant whenNotPaused {
        ILiquidityPool depositHandler = ILiquidityPool(handler);
        IERCHandler ercHandler = IERCHandler(handler);
        address WETH = ercHandler._WETH();
        depositHandler.unstakeETH(msg.sender, WETH, amount);
        emit Unstake(msg.sender, amount, WETH);
    }

    // Stating/UnStaking Function Ends

    // Voting Function starts

    /**
        @notice Returns a proposal.
        @param originChainID Chain ID deposit originated from.
        @param depositNonce ID of proposal generated by proposal's origin Bridge contract.
        @param dataHash Hash of data to be provided when deposit proposal is executed.
     */
    function getProposal(
        uint8 originChainID,
        uint64 depositNonce,
        bytes32 resourceID,
        bytes32 dataHash
    ) public view virtual returns (IVoterUpgradeable.issueStruct memory status) {
        bytes32 proposalHash = keccak256(abi.encodePacked(originChainID, depositNonce, dataHash, resourceID));
        return _voter.fetchIssueMap(_proposals[proposalHash]);
    }

    /**
        @notice When called, {msg.sender} will be marked as voting in favor of proposal.
        @notice Only callable by relayers when Bridge is not paused.
        @param chainID ID of chain deposit originated from.
        @param depositNonce ID of deposited generated by origin Bridge contract.
        @param dataHash Hash of data provided when deposit was made.
        @notice Proposal must not have already been passed or executed.
        @notice {msg.sender} must not have already voted on proposal.
        @notice Emits {ProposalEvent} event with status indicating the proposal status.
        @notice Emits {ProposalVote} event.
     */
    function voteProposal(
        uint8 chainID,
        uint64 depositNonce,
        bytes32 resourceID,
        bytes32 dataHash
    ) public virtual isResourceID(resourceID) onlyRole(RELAYER_ROLE) whenNotPaused {
        bytes32 proposalHash = keccak256(abi.encodePacked(chainID, depositNonce, dataHash, resourceID));
        if (_proposals[proposalHash] == 0) {
            uint256 id = _voter.createProposal(block.number + _expiry, _quorum);
            _proposals[proposalHash] = id;
            emit ProposalEvent(chainID, depositNonce, IVoterUpgradeable.ProposalStatus.Active, dataHash);
        } else if (_voter.fetchIsExpired(_proposals[proposalHash])) {
            _voter.setStatus(_proposals[proposalHash]);
            emit ProposalEvent(chainID, depositNonce, _voter.getStatus(_proposals[proposalHash]), dataHash);
            return;
        }
        if (_voter.getStatus(_proposals[proposalHash]) != IVoterUpgradeable.ProposalStatus.Cancelled) {
            _voter.vote(_proposals[proposalHash], 1, msg.sender);

            emit ProposalVote(chainID, depositNonce, _voter.getStatus(_proposals[proposalHash]), dataHash);
            if (_voter.getStatus(_proposals[proposalHash]) == IVoterUpgradeable.ProposalStatus.Passed) {
                emit ProposalEvent(chainID, depositNonce, _voter.getStatus(_proposals[proposalHash]), dataHash);
            }
        }
    }

    /**
        @notice Cancels a deposit proposal.
        @notice Only callable by admin when Bridge is not paused.
        @param chainID ID of chain deposit originated from.
        @param depositNonce ID of deposited generated by origin Bridge contract.
        @param dataHash Hash of data originally provided when deposit was made.
     */
    function cancelProposal(
        uint8 chainID,
        uint64 depositNonce,
        bytes32 resourceID,
        bytes32 dataHash
    ) public onlyRole(DEFAULT_ADMIN_ROLE) whenNotPaused {
        bytes32 proposalHash = keccak256(abi.encodePacked(chainID, depositNonce, dataHash, resourceID));
        IVoterUpgradeable.ProposalStatus currentStatus = _voter.getStatus(_proposals[proposalHash]);
        require(currentStatus == IVoterUpgradeable.ProposalStatus.Cancelled, "Proposal must be cancelled");
        delete _proposals[proposalHash];
    }

    /**
        @notice Executes a deposit proposal that is considered passed using a specified handler contract.
        @notice Only callable by relayers when Bridge is not paused.
        @param chainID ID of chain deposit originated from.
        @param resourceID ResourceID to be used when making deposits.
        @param depositNonce ID of deposited generated by origin Bridge contract.
        @param data Data originally provided when deposit was made.
        @notice Proposal must have Passed status.
        @notice Hash of {data} must equal proposal's {dataHash}.
        @notice Emits {ProposalEvent} event with status {Executed}.
     */
    function executeProposal(
        uint8 chainID,
        uint64 depositNonce,
        bytes calldata data,
        bytes32 resourceID,
        uint256[] memory flags,
        address[] memory path,
        bytes[] memory dataTx
    ) public virtual onlyRole(RELAYER_ROLE) whenNotPaused {
        bytes32 dataHash = keccak256(abi.encodePacked(_resourceIDToHandlerAddress[resourceID], data));
        bytes32 proposalHash = keccak256(abi.encodePacked(chainID, depositNonce, dataHash, resourceID));
        if (_genericWhitelist[_resourceIDToHandlerAddress[resourceID]]) {
            IGenericHandler genericHandler = IGenericHandler(_resourceIDToHandlerAddress[resourceID]);
            genericHandler.executeProposal(data);
            emit ProposalEvent(chainID, depositNonce, IVoterUpgradeable.ProposalStatus.Executed, dataHash);
        } else {
            address settlementToken;
            IDepositExecute.SwapInfo memory swapDetails = unpackDepositData(data);
            swapDetails.dataTx = dataTx;
            swapDetails.flags = flags;
            swapDetails.path = path;
            swapDetails.index = chainID;
            swapDetails.depositNonce = depositNonce;
            IDepositExecute depositHandler = IDepositExecute(_resourceIDToHandlerAddress[resourceID]);
            (settlementToken, swapDetails.returnAmount) = depositHandler.executeProposal(swapDetails, resourceID);
            emit Settlement(
                chainID,
                depositNonce,
                settlementToken,
                swapDetails.returnAmount,
                IVoterUpgradeable.ProposalStatus.Executed
            );

            emit ProposalEvent(chainID, depositNonce, IVoterUpgradeable.ProposalStatus.Executed, dataHash);
        }
        IVoterUpgradeable.ProposalStatus currentStatus = _voter.getStatus(_proposals[proposalHash]);
        require(currentStatus == IVoterUpgradeable.ProposalStatus.Passed, "Proposal must have Passed status");
        _voter.executeProposal(_proposals[proposalHash]);
    }

    // Voting Function ends
}

File 2 of 23 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (proxy/utils/Initializable.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the
 * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() initializer {}
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     */
    bool private _initialized;

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

    /**
     * @dev Modifier to protect an initializer function from being invoked twice.
     */
    modifier initializer() {
        // If the contract is initializing we ignore whether _initialized is set in order to support multiple
        // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the
        // contract may have been reentered.
        require(_initializing ? _isConstructor() : !_initialized, "Initializable: contract is already initialized");

        bool isTopLevelCall = !_initializing;
        if (isTopLevelCall) {
            _initializing = true;
            _initialized = true;
        }

        _;

        if (isTopLevelCall) {
            _initializing = false;
        }
    }

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

    function _isConstructor() private view returns (bool) {
        return !AddressUpgradeable.isContract(address(this));
    }
}

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

pragma solidity ^0.8.0;

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

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

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

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    function __Pausable_init() internal onlyInitializing {
        __Context_init_unchained();
        __Pausable_init_unchained();
    }

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

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

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

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

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

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

File 4 of 23 : AccessControlUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/AccessControl.sol)

pragma solidity ^0.8.0;

import "./IAccessControlUpgradeable.sol";
import "../utils/ContextUpgradeable.sol";
import "../utils/StringsUpgradeable.sol";
import "../utils/introspection/ERC165Upgradeable.sol";
import "../proxy/utils/Initializable.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it.
 */
abstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControlUpgradeable, ERC165Upgradeable {
    function __AccessControl_init() internal onlyInitializing {
        __Context_init_unchained();
        __ERC165_init_unchained();
        __AccessControl_init_unchained();
    }

    function __AccessControl_init_unchained() internal onlyInitializing {
    }
    struct RoleData {
        mapping(address => bool) members;
        bytes32 adminRole;
    }

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with a standardized message including the required role.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     *
     * _Available since v4.1._
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role, _msgSender());
        _;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IAccessControlUpgradeable).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view override returns (bool) {
        return _roles[role].members[account];
    }

    /**
     * @dev Revert with a standard message if `account` is missing `role`.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     */
    function _checkRole(bytes32 role, address account) internal view {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        StringsUpgradeable.toHexString(uint160(account), 20),
                        " is missing role ",
                        StringsUpgradeable.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view override returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been revoked `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) public virtual override {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     *
     * NOTE: This function is deprecated in favor of {_grantRole}.
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        bytes32 previousAdminRole = getRoleAdmin(role);
        _roles[role].adminRole = adminRole;
        emit RoleAdminChanged(role, previousAdminRole, adminRole);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * Internal function without access restriction.
     */
    function _grantRole(bytes32 role, address account) internal virtual {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * Internal function without access restriction.
     */
    function _revokeRole(bytes32 role, address account) internal virtual {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
    uint256[49] private __gap;
}

File 5 of 23 : UUPSUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (proxy/utils/UUPSUpgradeable.sol)

pragma solidity ^0.8.0;

import "../ERC1967/ERC1967UpgradeUpgradeable.sol";
import "./Initializable.sol";

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

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

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

    /**
     * @dev Upgrade the implementation of the proxy to `newImplementation`.
     *
     * Calls {_authorizeUpgrade}.
     *
     * Emits an {Upgraded} event.
     */
    function upgradeTo(address newImplementation) external virtual onlyProxy {
        _authorizeUpgrade(newImplementation);
        _upgradeToAndCallSecure(newImplementation, new bytes(0), false);
    }

    /**
     * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call
     * encoded in `data`.
     *
     * Calls {_authorizeUpgrade}.
     *
     * Emits an {Upgraded} event.
     */
    function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy {
        _authorizeUpgrade(newImplementation);
        _upgradeToAndCallSecure(newImplementation, data, true);
    }

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

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

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

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

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

    uint256 private _status;

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

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

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

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

        _;

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

File 7 of 23 : IVoterUpgradeable.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.2;

/**
    @title Interface to be used with handlers that support ERC20s and ERC721s.
    @author Router Protocol.
 */
interface IVoterUpgradeable {

    enum ProposalStatus { Inactive, Active, Passed, Executed, Cancelled }

    struct issueStruct {
        ProposalStatus status;
        uint256 startBlock;
        uint256 endBlock;
        uint64 quorum;
        uint256 maxVotes;
        uint8 resultOption;
    }

    function Voted(uint256, address) external view returns (bool);

    function mint(address) external;

    function burn(address account) external;
    
    function balanceOf(address) external view returns (uint256);

    function fetchIssueMap(uint256 _issue) external view returns (issueStruct memory issue);

    function fetchIsExpired(uint256 _issue) external view returns (bool status);

    function createProposal(uint256 endBlock, uint64 quorum)
        external
        returns (uint256 id);

    function setStatus(uint256 issueId) external  returns (bool success);
    function getStatus(uint256 issueId) external view returns (ProposalStatus status);
     function vote(
        uint256 issueId,
        uint8 option,
        address relayer
    )
        external
        returns (bool success);
    
    function executeProposal(uint256 issueId) external returns (bool success);
}

File 8 of 23 : IERC20Upgradeable.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.2;

/**
    @title Interface to be used with handlers that support ERC20s and ERC721s.
    @author Router Protocol.
 */
interface IERC20Upgradeable {

    function transfer( address, uint256) external;
    function decimals() external view returns (uint8);
}

File 9 of 23 : IDepositExecute.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.2;

/**
    @title Interface for handler contracts that support deposits and deposit executions.
    @author Router Protocol.
 */
interface IDepositExecute {
    struct SwapInfo {
        address feeTokenAddress;
        uint64 depositNonce;
        uint256 index;
        uint256 returnAmount;
        address recipient;
        address stableTokenAddress;
        address handler;
        uint256 srcTokenAmount;
        uint256 srcStableTokenAmount;
        uint256 destStableTokenAmount;
        uint256 destTokenAmount;
        uint256 lenRecipientAddress;
        uint256 lenSrcTokenAddress;
        uint256 lenDestTokenAddress;
        bytes20 srcTokenAddress;
        address srcStableTokenAddress;
        bytes20 destTokenAddress;
        address destStableTokenAddress;
        bytes[] dataTx;
        uint256[] flags;
        address[] path;
        address depositer;
        bool isDestNative;
        uint256 widgetID;
    }

    /**
        @notice It is intended that deposit are made using the Bridge contract.
        @param destinationChainID Chain ID deposit is expected to be bridged to.
        @param depositNonce This value is generated as an ID by the Bridge contract.
        @param swapDetails Swap details

     */
    function deposit(
        bytes32 resourceID,
        uint8 destinationChainID,
        uint64 depositNonce,
        SwapInfo calldata swapDetails
    ) external;

    /**
        @notice It is intended that proposals are executed by the Bridge contract.
     */
    function executeProposal(SwapInfo calldata swapDetails, bytes32 resourceID) external returns (address, uint256);
}

File 10 of 23 : ILiquidityPool.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.2;

/**
    @title Interface for handler contracts that support deposits and deposit executions.
    @author Router Protocol.
 */
interface ILiquidityPool {
    /**
        @notice Staking should be done by using bridge contract.
        @param depositor stakes liquidity in the pool .
        @param tokenAddress staking token for which liquidity needs to be added.
        @param amount Amount that needs to be staked.
     */
    function stake(
        address depositor,
        address tokenAddress,
        uint256 amount
    ) external;

    /**
        @notice Staking should be done by using bridge contract.
        @param depositor stakes liquidity in the pool .
        @param tokenAddress staking token for which liquidity needs to be added.
        @param amount Amount that needs to be staked.
     */
    function stakeETH(
        address depositor,
        address tokenAddress,
        uint256 amount
    ) external;

    /**
        @notice Staking should be done by using bridge contract.
        @param unstaker removes liquidity from the pool.
        @param tokenAddress staking token of which liquidity needs to be removed.
        @param amount Amount that needs to be unstaked.
     */
    function unstake(
        address unstaker,
        address tokenAddress,
        uint256 amount
    ) external;

    /**
        @notice Staking should be done by using bridge contract.
        @param unstaker removes liquidity from the pool.
        @param tokenAddress staking token of which liquidity needs to be removed.
        @param amount Amount that needs to be unstaked.
     */
    function unstakeETH(
        address unstaker,
        address tokenAddress,
        uint256 amount
    ) external;
}

File 11 of 23 : IERCHandler.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.2;

/**
    @title Interface to be used with handlers that support ERC20s and ERC721s.
    @author Router Protocol.
 */
interface IERCHandler {
    function withdrawFees(
        address tokenAddress,
        address recipient,
        uint256 amount
    ) external;

    function getBridgeFee(uint8 destinationChainID, address feeTokenAddress) external view returns (uint256, uint256);

    function setBridgeFee(
        uint8 destinationChainID,
        address feeTokenAddress,
        uint256 transferFee,
        uint256 exchangeFee,
        bool accepted
    ) external;

    function toggleFeeStatus(bool status) external;

    function getFeeStatus() external view returns (bool);

    function _ETH() external view returns (address);

    function _WETH() external view returns (address);

    function resourceIDToTokenContractAddress(bytes32 resourceID) external view returns (address);

    /**
        @notice Correlates {resourceID} with {contractAddress}.
        @param resourceID ResourceID to be used when making deposits.
        @param contractAddress Address of contract to be called when a deposit is made and a deposited is executed.
     */
    function setResource(bytes32 resourceID, address contractAddress) external;

    // function setTokenDecimals(address tokenAddress, uint8 destinationChainID, uint8 decimals) external;

    /**
        @notice Sets oneSplitAddress for the handler
        @param contractAddress Address of oneSplit contract
     */
    function setOneSplitAddress(address contractAddress) external;

    /**
        @notice Correlates {resourceID} with {contractAddress}.
        @param contractAddress Address of contract for qhich liquidity pool needs to be created.
     */
    function setLiquidityPool(
        string memory name,
        string memory symbol,
        uint8 decimals,
        address contractAddress,
        address lpAddress
    ) external;

    function setLiquidityPoolOwner(
        address newOwner,
        address tokenAddress,
        address lpAddress
    ) external;

    /**
        @notice Marks {contractAddress} as mintable/burnable.
        @param contractAddress Address of contract to be used when making or executing deposits.
        @param status Boolean flag for burnanble status.
     */
    function setBurnable(address contractAddress, bool status) external;

    /**
        @notice Used to manually release funds from ERC safes.
        @param tokenAddress Address of token contract to release.
        @param recipient Address to release tokens to.
        @param amountOrTokenID Either the amount of ERC20 tokens or the ERC721 token ID to release.
     */
    function withdraw(
        address tokenAddress,
        address recipient,
        uint256 amountOrTokenID
    ) external;
}

File 12 of 23 : IERCHandlerDecimals.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.2;

/**
    @title Interface to be used with handlers that support ERC20s and ERC721s.
    @author Router Protocol.
 */
interface IERCHandlerDecimals {
    
    function setTokenDecimals(address tokenAddress, uint8 destinationChainID, uint8 decimals) external;

}

File 13 of 23 : IGenericHandler.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.2;

/**
    @title Interface for handler that handles generic deposits and deposit executions.
    @author Router Protocol.
 */
interface IGenericHandler {

    function genericDeposit(
        bytes32 _resourceID,
        uint8 _destChainID,
        uint64 _nonce,
        address _srcAddress,
        bytes4 _selector,
        bytes calldata _data,
        bytes32 _hash
    ) external;

    function executeProposal( bytes calldata data) external;
}

File 14 of 23 : IWETH.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.2;

interface IWETH {
    function deposit() external payable;

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

    function withdraw(uint256) external;

    function transferFrom(
        address src,
        address dst,
        uint256 wad
    ) external returns (bool);

    function approve(address guy, uint256 wad) external returns (bool);
}

File 15 of 23 : AddressUpgradeable.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 AddressUpgradeable {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    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 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 16 of 23 : ContextUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

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

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

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

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
    uint256[50] private __gap;
}

File 17 of 23 : IAccessControlUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)

pragma solidity ^0.8.0;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControlUpgradeable {
    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {AccessControl-_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) external;
}

File 18 of 23 : StringsUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library StringsUpgradeable {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

pragma solidity ^0.8.0;

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

File 21 of 23 : ERC1967UpgradeUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Upgrade.sol)

pragma solidity ^0.8.2;

import "../beacon/IBeaconUpgradeable.sol";
import "../../utils/AddressUpgradeable.sol";
import "../../utils/StorageSlotUpgradeable.sol";
import "../utils/Initializable.sol";

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

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

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

    /**
     * @dev Emitted when the implementation is upgraded.
     */
    event Upgraded(address indexed implementation);

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

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

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

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

    /**
     * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeToAndCallSecure(
        address newImplementation,
        bytes memory data,
        bool forceCall
    ) internal {
        address oldImplementation = _getImplementation();

        // Initial upgrade and setup call
        _setImplementation(newImplementation);
        if (data.length > 0 || forceCall) {
            _functionDelegateCall(newImplementation, data);
        }

        // Perform rollback test if not already in progress
        StorageSlotUpgradeable.BooleanSlot storage rollbackTesting = StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT);
        if (!rollbackTesting.value) {
            // Trigger rollback using upgradeTo from the new implementation
            rollbackTesting.value = true;
            _functionDelegateCall(
                newImplementation,
                abi.encodeWithSignature("upgradeTo(address)", oldImplementation)
            );
            rollbackTesting.value = false;
            // Check rollback was effective
            require(oldImplementation == _getImplementation(), "ERC1967Upgrade: upgrade breaks further upgrades");
            // Finally reset to the new implementation and log the upgrade
            _upgradeTo(newImplementation);
        }
    }

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

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

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

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

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

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

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

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

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

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

    /**
     * @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) private returns (bytes memory) {
        require(AddressUpgradeable.isContract(target), "Address: delegate call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return AddressUpgradeable.verifyCallResult(success, returndata, "Address: low-level delegate call failed");
    }
    uint256[50] private __gap;
}

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

pragma solidity ^0.8.0;

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

File 23 of 23 : StorageSlotUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)

pragma solidity ^0.8.0;

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

    struct BooleanSlot {
        bool value;
    }

    struct Bytes32Slot {
        bytes32 value;
    }

    struct Uint256Slot {
        uint256 value;
    }

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

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

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

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

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

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"whitelistAddress","type":"address"}],"name":"AddedWhitelist","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"handler","type":"address"},{"indexed":false,"internalType":"address","name":"tokenAddress","type":"address"},{"indexed":false,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountOrTokenID","type":"uint256"}],"name":"AdminWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint8","name":"destinationChainID","type":"uint8"},{"indexed":true,"internalType":"bytes32","name":"resourceID","type":"bytes32"},{"indexed":true,"internalType":"uint64","name":"depositNonce","type":"uint64"},{"indexed":false,"internalType":"uint256","name":"widgetID","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"feeSetter","type":"address"}],"name":"FeeSetterAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"feeSetter","type":"address"}],"name":"FeeSetterRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint8","name":"destinationChainID","type":"uint8"},{"indexed":false,"internalType":"bytes32","name":"resourceID","type":"bytes32"},{"indexed":false,"internalType":"uint64","name":"depositNonce","type":"uint64"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"bytes","name":"data","type":"bytes"}],"name":"GenericDeposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"originChainID","type":"uint8"},{"indexed":false,"internalType":"uint64","name":"depositNonce","type":"uint64"},{"indexed":false,"internalType":"enum IVoterUpgradeable.ProposalStatus","name":"status","type":"uint8"},{"indexed":false,"internalType":"bytes32","name":"dataHash","type":"bytes32"}],"name":"ProposalEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"originChainID","type":"uint8"},{"indexed":false,"internalType":"uint64","name":"depositNonce","type":"uint64"},{"indexed":false,"internalType":"enum IVoterUpgradeable.ProposalStatus","name":"status","type":"uint8"},{"indexed":false,"internalType":"bytes32","name":"dataHash","type":"bytes32"}],"name":"ProposalVote","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"relayer","type":"address"}],"name":"RelayerAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"relayer","type":"address"}],"name":"RelayerRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"whitelistAddress","type":"address"}],"name":"RemovedWhitelist","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint8","name":"originChainID","type":"uint8"},{"indexed":true,"internalType":"uint64","name":"depositNonce","type":"uint64"},{"indexed":false,"internalType":"address","name":"settlementToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"settlementAmount","type":"uint256"},{"indexed":false,"internalType":"enum IVoterUpgradeable.ProposalStatus","name":"status","type":"uint8"}],"name":"Settlement","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"staker","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"address","name":"pool","type":"address"}],"name":"Stake","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"unstaker","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"address","name":"pool","type":"address"}],"name":"Unstake","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"status","type":"bool"}],"name":"WhitelistingSetting","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"expiry","type":"uint256"}],"name":"expiryChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"quorum","type":"uint64"}],"name":"quorumChanged","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EMERGENCY_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FEE_SETTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"chainID","type":"uint8"},{"internalType":"uint64","name":"depositNonce","type":"uint64"},{"internalType":"bytes32","name":"dataHash","type":"bytes32"}],"name":"GetProposalHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint8","name":"chainID","type":"uint8"},{"internalType":"uint64","name":"depositNonce","type":"uint64"},{"internalType":"bytes32","name":"dataHash","type":"bytes32"}],"name":"HasVotedOnProposal","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAUSER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"RELAYER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"RESOURCE_SETTER","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_quorum","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_voter","outputs":[{"internalType":"contract IVoterUpgradeable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_beneficiary","type":"address"}],"name":"addToWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newExpiry","type":"uint256"}],"name":"adminChangeExpiry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newQuorum","type":"uint256"}],"name":"adminChangeQuorum","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"handlerAddress","type":"address"},{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"bool","name":"status","type":"bool"}],"name":"adminSetBurnable","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"resourceID","type":"bytes32"},{"internalType":"bool","name":"status","type":"bool"}],"name":"adminSetFeeStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"handlerAddress","type":"address"},{"internalType":"bytes32","name":"resourceID","type":"bytes32"}],"name":"adminSetGenericResource","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"uint8","name":"decimals","type":"uint8"},{"internalType":"address","name":"handlerAddress","type":"address"},{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"address","name":"lpAddress","type":"address"}],"name":"adminSetLiquidityPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"handlerAddress","type":"address"},{"internalType":"address","name":"newOwner","type":"address"},{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"address","name":"lpAddress","type":"address"}],"name":"adminSetLiquidityPoolOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"handlerAddress","type":"address"},{"internalType":"address","name":"contractAddress","type":"address"}],"name":"adminSetOneSplitAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"handlerAddress","type":"address"},{"internalType":"bytes32","name":"resourceID","type":"bytes32"},{"internalType":"address","name":"tokenAddress","type":"address"}],"name":"adminSetResource","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"handlerAddress","type":"address"},{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint8","name":"destinationChainID","type":"uint8"},{"internalType":"uint8","name":"decimals","type":"uint8"}],"name":"adminSetTokenDecimals","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"handlerAddress","type":"address"},{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"adminWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"handlerAddress","type":"address"},{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"adminWithdrawFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"chainID","type":"uint8"},{"internalType":"uint64","name":"depositNonce","type":"uint64"},{"internalType":"bytes32","name":"resourceID","type":"bytes32"},{"internalType":"bytes32","name":"dataHash","type":"bytes32"}],"name":"cancelProposal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"destinationChainID","type":"uint8"},{"internalType":"bytes32","name":"resourceID","type":"bytes32"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"uint256[]","name":"flags","type":"uint256[]"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"bytes[]","name":"dataTx","type":"bytes[]"},{"internalType":"address","name":"feeTokenAddress","type":"address"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"destinationChainID","type":"uint8"},{"internalType":"bytes32","name":"resourceID","type":"bytes32"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"uint256[]","name":"flags","type":"uint256[]"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"bytes[]","name":"dataTx","type":"bytes[]"},{"internalType":"address","name":"feeTokenAddress","type":"address"}],"name":"depositETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint8","name":"chainID","type":"uint8"},{"internalType":"uint64","name":"depositNonce","type":"uint64"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"bytes32","name":"resourceID","type":"bytes32"},{"internalType":"uint256[]","name":"flags","type":"uint256[]"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"bytes[]","name":"dataTx","type":"bytes[]"}],"name":"executeProposal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"fetch_chainID","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"_id","type":"uint8"}],"name":"fetch_depositCounts","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fetch_expiry","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_id","type":"bytes32"}],"name":"fetch_proposals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_id","type":"bytes32"}],"name":"fetch_resourceIDToHandlerAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_beneficiary","type":"address"}],"name":"fetch_whitelist","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fetch_whitelistEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"_destChainID","type":"uint8"},{"internalType":"bytes32","name":"_resourceID","type":"bytes32"}],"name":"genericDeposit","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"resourceID","type":"bytes32"},{"internalType":"uint8","name":"destChainID","type":"uint8"},{"internalType":"address","name":"feeTokenAddress","type":"address"}],"name":"getBridgeFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"originChainID","type":"uint8"},{"internalType":"uint64","name":"depositNonce","type":"uint64"},{"internalType":"bytes32","name":"resourceID","type":"bytes32"},{"internalType":"bytes32","name":"dataHash","type":"bytes32"}],"name":"getProposal","outputs":[{"components":[{"internalType":"enum IVoterUpgradeable.ProposalStatus","name":"status","type":"uint8"},{"internalType":"uint256","name":"startBlock","type":"uint256"},{"internalType":"uint256","name":"endBlock","type":"uint256"},{"internalType":"uint64","name":"quorum","type":"uint64"},{"internalType":"uint256","name":"maxVotes","type":"uint256"},{"internalType":"uint8","name":"resultOption","type":"uint8"}],"internalType":"struct IVoterUpgradeable.issueStruct","name":"status","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"chainID","type":"uint8"},{"internalType":"uint256","name":"quorum","type":"uint256"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"address","name":"voter","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","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":"address","name":"_beneficiary","type":"address"}],"name":"removeFromWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"resourceID","type":"bytes32"},{"internalType":"uint8","name":"destinationChainID","type":"uint8"},{"internalType":"address","name":"feeTokenAddress","type":"address"},{"internalType":"uint256","name":"transferFee","type":"uint256"},{"internalType":"uint256","name":"exchangeFee","type":"uint256"},{"internalType":"bool","name":"accepted","type":"bool"}],"name":"setBridgeFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"value","type":"bool"}],"name":"setWhitelisting","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"handler","type":"address"},{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"handler","type":"address"}],"name":"stakeETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalRelayers","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"handler","type":"address"},{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"handler","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"unstakeETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint8","name":"chainID","type":"uint8"},{"internalType":"uint64","name":"depositNonce","type":"uint64"},{"internalType":"bytes32","name":"resourceID","type":"bytes32"},{"internalType":"bytes32","name":"dataHash","type":"bytes32"}],"name":"voteProposal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60a06040523060601b60805234801561001757600080fd5b5060805160601c6158716200004c600039600081816118c50152818161190501528181611cd00152611d1001526158716000f3fe6080604052600436106102c55760003560e01c80637bd3af5011610171578063a5285090116100d2578063a52850901461087e578063b2c0f640146108ab578063bb5ba77e146108ce578063bf6eac2f146108e7578063c155762914610907578063c794c69814610927578063cb10f21514610947578063d547741f14610967578063db618e2a14610987578063e43252d7146109a9578063e63ab1e9146109c9578063e9347683146109eb578063ebc2693914610a1f578063f19ba3f814610a54578063fe79b9a914610a74576102cc565b80637bd3af50146106da5780637d026d96146106fa5780638456cb591461071a578063858021291461072f578063862159ab1461074f5780638ab1d681146107665780638ac4c1841461078657806391d14854146107a6578063926d7d7f146107c6578063946fe3e8146107e85780639be8eb53146107fb578063a07e338d1461081b578063a217fddf14610849578063a42570df1461085e576102cc565b80633f4ba83a116102265780633f4ba83a146104da57806343cee719146104ef57806349b9ac5e1461050f5780634d98a61b146105485780634f1ef2861461055e57806350d1882e1461057157806355883e47146105a85780635af5f7ba146105c85780635bc51147146105e85780635c975abb146106225780635cd1d2c31461063a57806360829f8a1461065a5780636e99227e1461067a578063700803b51461069a578063780cf004146106ba576102cc565b806301ffc9a7146102d15780630e5f06e5146103065780631dd7e81f146103405780631ff013f11461036257806320df435914610382578063248a9ca3146103b25780632becbe31146103d25780632e09305c146103f25780632f2ff15d1461040557806336568abe146104255780633659cfe6146104455780633c047803146104655780633db9b42a146104855780633dd301d9146104ba576102cc565b366102cc57005b600080fd5b3480156102dd57600080fd5b506102f16102ec3660046148ee565b610a94565b60405190151581526020015b60405180910390f35b34801561031257600080fd5b506102f16103213660046144ea565b6001600160a01b03166000908152610167602052604090205460ff1690565b34801561034c57600080fd5b5061036061035b3660046146df565b610acd565b005b34801561036e57600080fd5b5061036061037d366004614cae565b610b2d565b34801561038e57600080fd5b506103a46000805160206157be83398151915281565b6040519081526020016102fd565b3480156103be57600080fd5b506103a46103cd3660046147f2565b6112db565b3480156103de57600080fd5b506103606103ed3660046145b5565b6112f0565b610360610400366004614b64565b6113f8565b34801561041157600080fd5b5061036061042036600461480a565b61168e565b34801561043157600080fd5b5061036061044036600461480a565b61183c565b34801561045157600080fd5b506103606104603660046144ea565b6118ba565b34801561047157600080fd5b506103606104803660046146df565b611983565b34801561049157600080fd5b50610163546104ad90600160401b90046001600160a01b031681565b6040516102fd91906151b5565b3480156104c657600080fd5b506102f16104d5366004614c7f565b611b02565b3480156104e657600080fd5b50610360611bd7565b3480156104fb57600080fd5b5061036061050a366004614b64565b611c1a565b34801561051b57600080fd5b5061016354610530906001600160401b031681565b6040516001600160401b0390911681526020016102fd565b34801561055457600080fd5b50610160546103a4565b61036061056c366004614740565b611cc5565b34801561057d57600080fd5b506104ad61058c3660046147f2565b600090815261016560205260409020546001600160a01b031690565b3480156105b457600080fd5b506103606105c3366004614930565b611d7b565b3480156105d457600080fd5b506103606105e33660046147ba565b611df9565b3480156105f457600080fd5b50610530610603366004614b2b565b60ff16600090815261016460205260409020546001600160401b031690565b34801561062e57600080fd5b5060335460ff166102f1565b34801561064657600080fd5b5061036061065536600461468f565b611e4f565b34801561066657600080fd5b5061036061067536600461464f565b611ee0565b34801561068657600080fd5b50610360610695366004614888565b611fb0565b3480156106a657600080fd5b506105306106b5366004614b47565b61212d565b3480156106c657600080fd5b506103606106d53660046145b5565b612252565b3480156106e657600080fd5b506103606106f5366004614cae565b6122c7565b34801561070657600080fd5b506103606107153660046147f2565b61243d565b34801561072657600080fd5b5061036061247f565b34801561073b57600080fd5b5061036061074a366004614605565b6124c3565b34801561075b57600080fd5b506103a46101625481565b34801561077257600080fd5b506103606107813660046144ea565b61253d565b34801561079257600080fd5b506103606107a1366004614522565b6125bd565b3480156107b257600080fd5b506102f16107c136600461480a565b61262f565b3480156107d257600080fd5b506103a46000805160206157fe83398151915281565b6103606107f63660046144ea565b61265a565b34801561080757600080fd5b506103606108163660046147f2565b61290b565b34801561082757600080fd5b506103a46108363660046147f2565b6000908152610166602052604090205490565b34801561085557600080fd5b506103a4600081565b34801561086a57600080fd5b50610360610879366004614cf3565b61296b565b34801561088a57600080fd5b5061089e610899366004614cae565b612df0565b6040516102fd919061555a565b3480156108b757600080fd5b5061015f5460405160ff90911681526020016102fd565b3480156108da57600080fd5b506101615460ff166102f1565b3480156108f357600080fd5b5061036061090236600461464f565b612eee565b34801561091357600080fd5b5061036061092236600461455a565b612fb0565b34801561093357600080fd5b506103a4610942366004614c7f565b612ffd565b34801561095357600080fd5b5061036061096236600461470a565b613036565b34801561097357600080fd5b5061036061098236600461480a565b6130a1565b34801561099357600080fd5b506103a460008051602061579e83398151915281565b3480156109b557600080fd5b506103606109c43660046144ea565b613244565b3480156109d557600080fd5b506103a460008051602061581e83398151915281565b3480156109f757600080fd5b506103a47fe6ad9a47fbda1dc18de1eb5eeb7d935e5e81b4748f3cfc61e233e64f8818206081565b348015610a2b57600080fd5b50610a3f610a3a366004614852565b6132c7565b604080519283526020830191909152016102fd565b348015610a6057600080fd5b50610360610a6f36600461482e565b61336b565b348015610a8057600080fd5b50610360610a8f366004614c41565b6133bb565b60006001600160e01b03198216637965db0b60e01b1480610ac557506301ffc9a760e01b6001600160e01b03198316145b90505b919050565b60008051602061579e833981519152610ae781335b6134ed565b5060009081526101656020908152604080832080546001600160a01b039095166001600160a01b031990951685179055928252610169905220805460ff19166001179055565b6000828152610165602052604090205482906001600160a01b0316610bae5760405162461bcd60e51b815260206004820152602c60248201527f4272696467655570677261646561626c653a204e6f2068616e646c657220666f60448201526b1c881c995cdbdd5c98d9525160a21b60648201526084015b60405180910390fd5b6000805160206157fe833981519152610bc78133610ae2565b60335460ff1615610bea5760405162461bcd60e51b8152600401610ba590615458565b600086868587604051602001610c03949392919061517e565b60408051601f1981840301815291815281516020928301206000818152610166909352912054909150610d27576101635461016054600091600160401b90046001600160a01b03169063ba831b9c90610c5c9043615661565b6101635460405160e084901b6001600160e01b031916815260048101929092526001600160401b03166024820152604401602060405180830381600087803b158015610ca757600080fd5b505af1158015610cbb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cdf9190614a3e565b6000838152610166602052604090819020829055519091506000805160206157de83398151915290610d19908a908a906001908a906155b1565b60405180910390a150610f20565b6101635460008281526101666020526040908190205490516345737d1d60e11b81526004810191909152600160401b9091046001600160a01b031690638ae6fa3a9060240160206040518083038186803b158015610d8457600080fd5b505afa158015610d98573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dbc91906147d6565b15610f20576101635460008281526101666020526040908190205490516369ba1a7560e01b81526004810191909152600160401b9091046001600160a01b0316906369ba1a7590602401602060405180830381600087803b158015610e2057600080fd5b505af1158015610e34573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e5891906147d6565b50610163546000828152610166602052604090819020549051632e31150760e11b815260048101919091526000805160206157de8339815191529189918991600160401b90046001600160a01b031690635c622a0e9060240160206040518083038186803b158015610ec957600080fd5b505afa158015610edd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f019190614916565b87604051610f1294939291906155b1565b60405180910390a1506112d3565b6004610163546000838152610166602052604090819020549051632e31150760e11b81526004810191909152600160401b9091046001600160a01b031690635c622a0e9060240160206040518083038186803b158015610f7f57600080fd5b505afa158015610f93573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fb79190614916565b6004811115610fd657634e487b7160e01b600052602160045260246000fd5b146112d157610163546000828152610166602052604090819020549051630ce7fb8360e11b8152600481019190915260016024820152336044820152600160401b9091046001600160a01b0316906319cff70690606401602060405180830381600087803b15801561104757600080fd5b505af115801561105b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107f91906147d6565b50610163546000828152610166602052604090819020549051632e31150760e11b815260048101919091527f25f8daaa4635a7729927ba3f5b3d59cc3320aca7c32c9db4e7ca7b95743436409189918991600160401b90046001600160a01b031690635c622a0e9060240160206040518083038186803b15801561110257600080fd5b505afa158015611116573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061113a9190614916565b8760405161114b94939291906155b1565b60405180910390a16002610163546000838152610166602052604090819020549051632e31150760e11b81526004810191909152600160401b9091046001600160a01b031690635c622a0e9060240160206040518083038186803b1580156111b257600080fd5b505afa1580156111c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111ea9190614916565b600481111561120957634e487b7160e01b600052602160045260246000fd5b14156112d157610163546000828152610166602052604090819020549051632e31150760e11b815260048101919091526000805160206157de8339815191529189918991600160401b90046001600160a01b031690635c622a0e9060240160206040518083038186803b15801561127f57600080fd5b505afa158015611293573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112b79190614916565b876040516112c894939291906155b1565b60405180910390a15b505b505050505050565b60009081526097602052604090206001015490565b600261012d5414156113145760405162461bcd60e51b8152600401610ba590615501565b600261012d556000805160206157be8339815191526113338133610ae2565b6040516372aee27360e11b815285906001600160a01b0382169063e55dc4e690611365908890889088906004016151c9565b600060405180830381600087803b15801561137f57600080fd5b505af1158015611393573d6000803e3d6000fd5b5050604080516001600160a01b038a8116825289811660208301528816818301526060810187905290517f7d3706b5a5b55581dd829778c6dc22a79c5e0909849ef3174c169b718978d8aa9350908190036080019150a15050600161012d5550505050565b600261012d54141561141c5760405162461bcd60e51b8152600401610ba590615501565b600261012d5560335460ff16156114455760405162461bcd60e51b8152600401610ba590615458565b6101615460ff161561148157336000908152610167602052604090205460ff166114815760405162461bcd60e51b8152600401610ba590615482565b600088815261016560205260409020546001600160a01b0316806114b75760405162461bcd60e51b8152600401610ba5906153d4565b600034116115185760405162461bcd60e51b815260206004820152602860248201527f6465706f7369744554483a204e6f206e617469766520617373657473207472616044820152671b9cd9995c9c995960c21b6064820152608401610ba5565b6000816001600160a01b031663e0af36166040518163ffffffff1660e01b815260040160206040518083038186803b15801561155357600080fd5b505afa158015611567573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061158b9190614506565b9050806001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b1580156115c857600080fd5b505af11580156115dc573d6000803e3d6000fd5b505060405163a9059cbb60e01b81526001600160a01b038516935063a9059cbb925061160f9150339034906004016151ed565b602060405180830381600087803b15801561162957600080fd5b505af115801561163d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061166191906147d6565b61166a57600080fd5b61167b8b8b8b8b8b8b8b8b8b613551565b5050600161012d55505050505050505050565b600261012d5414156116b25760405162461bcd60e51b8152600401610ba590615501565b600261012d556116c1826112db565b6116cb8133610ae2565b6116d58383613707565b6000805160206157fe833981519152831480156117765750610163546040516370a0823160e01b8152600160401b9091046001600160a01b0316906370a08231906117249085906004016151b5565b60206040518083038186803b15801561173c57600080fd5b505afa158015611750573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117749190614a3e565b155b1561183157610163546040516335313c2160e11b8152600160401b9091046001600160a01b031690636a627842906117b29085906004016151b5565b600060405180830381600087803b1580156117cc57600080fd5b505af11580156117e0573d6000803e3d6000fd5b505050506101625460016117f49190615661565b610162556040517f03580ee9f53a62b7cb409a2cb56f9be87747dd15017afc5cef6eef321e4fb2c5906118289084906151b5565b60405180910390a15b5050600161012d5550565b6001600160a01b03811633146118ac5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610ba5565b6118b68282613729565b5050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614156119035760405162461bcd60e51b8152600401610ba59061533c565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316611935613790565b6001600160a01b03161461195b5760405162461bcd60e51b8152600401610ba590615388565b611964816137be565b60408051600080825260208201909252611980918391906137ca565b50565b600261012d5414156119a75760405162461bcd60e51b8152600401610ba590615501565b600261012d5560335460ff16156119d05760405162461bcd60e51b8152600401610ba590615458565b600082905060008390506000816001600160a01b031663e0af36166040518163ffffffff1660e01b815260040160206040518083038186803b158015611a1557600080fd5b505afa158015611a29573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a4d9190614506565b604051631a7f5a4160e31b81529091506001600160a01b0384169063d3fad20890611a80903390859089906004016151c9565b600060405180830381600087803b158015611a9a57600080fd5b505af1158015611aae573d6000803e3d6000fd5b50505050336001600160a01b03167f379bc14156b62673a2efd113a5b989c8240c2018bf1fa01ee2d3d5915f769d4b8583604051611aed92919061522a565b60405180910390a25050600161012d55505050565b600080848484604051602001611b1a9392919061514c565b60408051808303601f1901815282825280516020918201206000818152610166909252919020546101635463030b0f8d60e01b845291935091600160401b9091046001600160a01b03169063030b0f8d90611b7b908490339060040161522a565b60206040518083038186803b158015611b9357600080fd5b505afa158015611ba7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bcb91906147d6565b925050505b9392505050565b60008051602061581e833981519152611bf08133610ae2565b60335460ff16611c125760405162461bcd60e51b8152600401610ba59061530e565b61198061390a565b600261012d541415611c3e5760405162461bcd60e51b8152600401610ba590615501565b600261012d5560335460ff1615611c675760405162461bcd60e51b8152600401610ba590615458565b6101615460ff1615611ca357336000908152610167602052604090205460ff16611ca35760405162461bcd60e51b8152600401610ba590615482565b611cb4898989898989898989613551565b5050600161012d5550505050505050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415611d0e5760405162461bcd60e51b8152600401610ba59061533c565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316611d40613790565b6001600160a01b031614611d665760405162461bcd60e51b8152600401610ba590615388565b611d6f826137be565b6118b6828260016137ca565b6000611d878133610ae2565b6040516325a0141360e21b815284906001600160a01b03821690639680504c90611dbd908b908b908b908a908a906004016152be565b600060405180830381600087803b158015611dd757600080fd5b505af1158015611deb573d6000803e3d6000fd5b505050505050505050505050565b6000611e058133610ae2565b610161805460ff19168315159081179091556040519081527f78e648f9aa0bf2a4400dc354b571bbbf0d423305d9b78e94a9014ab03ff8bb7b906020015b60405180910390a15050565b60008051602061579e833981519152611e688133610ae2565b60405163359d860160e01b81526001600160a01b03858116600483015260ff80861660248401528416604483015286919082169063359d8601906064015b600060405180830381600087803b158015611ec057600080fd5b505af1158015611ed4573d6000803e3d6000fd5b50505050505050505050565b60335460ff1615611f035760405162461bcd60e51b8152600401610ba590615458565b6040516330414fc560e11b815283906001600160a01b038216906360829f8a90611f35903390879087906004016151c9565b600060405180830381600087803b158015611f4f57600080fd5b505af1158015611f63573d6000803e3d6000fd5b50505050336001600160a01b03167f379bc14156b62673a2efd113a5b989c8240c2018bf1fa01ee2d3d5915f769d4b8385604051611fa292919061522a565b60405180910390a250505050565b7fe6ad9a47fbda1dc18de1eb5eeb7d935e5e81b4748f3cfc61e233e64f88182060611fdb8133610ae2565b6000878152610165602090815260409182902054825163d755c34960e01b815292516001600160a01b03909116928392839263d755c349926004808201939291829003018186803b15801561202f57600080fd5b505afa158015612043573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061206791906147d6565b6120a85760405162461bcd60e51b8152602060048201526012602482015271199959481a5cc81b9bdd08195b98589b195960721b6044820152606401610ba5565b604051631487001b60e01b815260ff891660048201526001600160a01b03888116602483015260448201889052606482018790528515156084830152821690631487001b9060a401600060405180830381600087803b15801561210a57600080fd5b505af115801561211e573d6000803e3d6000fd5b50505050505050505050505050565b600061213b60335460ff1690565b156121585760405162461bcd60e51b8152600401610ba590615458565b600082815261016560209081526040808320546001600160a01b0316835261016990915290205460ff16151560011461219057600080fd5b600082815261016560205260409020546001600160a01b031633146121b457600080fd5b60ff8316600090815261016460205260408120805482906121dd906001600160401b0316615703565b91906101000a8154816001600160401b0302191690836001600160401b0316021790559050806001600160401b0316838560ff167fc9745c10b9322d1d4b7bf22f00dc660872b611832eedcfffdbcdc09ebafcb313600060405161224391815260200190565b60405180910390a49392505050565b600261012d5414156122765760405162461bcd60e51b8152600401610ba590615501565b600261012d556000805160206157be8339815191526122958133610ae2565b604051636ce5768960e11b815285906001600160a01b0382169063d9caed1290611365908890889088906004016151c9565b60006122d38133610ae2565b60335460ff16156122f65760405162461bcd60e51b8152600401610ba590615458565b60008585848660405160200161230f949392919061517e565b60408051808303601f19018152828252805160209182012061016354600082815261016690935292822054632e31150760e11b85526004850152935091600160401b9091046001600160a01b031690635c622a0e9060240160206040518083038186803b15801561237f57600080fd5b505afa158015612393573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123b79190614916565b905060048160048111156123db57634e487b7160e01b600052602160045260246000fd5b146124255760405162461bcd60e51b815260206004820152601a602482015279141c9bdc1bdcd85b081b5d5cdd0818994818d85b98d95b1b195960321b6044820152606401610ba5565b50600090815261016660205260408120555050505050565b60006124498133610ae2565b6101608290556040518281527fa2b67627a88e010182419ae858fcf3ca4374ad08cbbd6fe10bebcf8b26d3b5fe90602001611e43565b60008051602061581e8339815191526124988133610ae2565b60335460ff16156124bb5760405162461bcd60e51b8152600401610ba590615458565b611980613970565b60006124cf8133610ae2565b604051631764b06b60e21b81526001600160a01b0384811660048301528315156024830152859190821690635d92c1ac906044015b600060405180830381600087803b15801561251e57600080fd5b505af1158015612532573d6000803e3d6000fd5b505050505050505050565b60006125498133610ae2565b6101615460ff1661256c5760405162461bcd60e51b8152600401610ba590615409565b6001600160a01b0382166000908152610167602052604090819020805460ff19169055517f441e43beaf2db8af6e1f9f7a6b9f0dcc36fcf83a2904264c9ab624068242efff90611e439084906151b5565b60006125c98133610ae2565b60405163e7c308fd60e01b815283906001600160a01b0382169063e7c308fd906125f79086906004016151b5565b600060405180830381600087803b15801561261157600080fd5b505af1158015612625573d6000803e3d6000fd5b5050505050505050565b60009182526097602090815260408084206001600160a01b0393909316845291905290205460ff1690565b600261012d54141561267e5760405162461bcd60e51b8152600401610ba590615501565b600261012d5560335460ff16156126a75760405162461bcd60e51b8152600401610ba590615458565b600081905060008290506000816001600160a01b031663e0af36166040518163ffffffff1660e01b815260040160206040518083038186803b1580156126ec57600080fd5b505afa158015612700573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127249190614506565b905034806127805760405162461bcd60e51b815260206004820152602360248201527f7374616b654554483a20696e73756666696369656e74206574682070726f766960448201526219195960ea1b6064820152608401610ba5565b816001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b1580156127bb57600080fd5b505af11580156127cf573d6000803e3d6000fd5b505060405163a9059cbb60e01b81526001600160a01b038616935063a9059cbb92506128029150889085906004016151ed565b602060405180830381600087803b15801561281c57600080fd5b505af1158015612830573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061285491906147d6565b61286e57634e487b7160e01b600052600160045260246000fd5b60405163f4e480e160e01b81526001600160a01b0385169063f4e480e19061289e903390869086906004016151c9565b600060405180830381600087803b1580156128b857600080fd5b505af11580156128cc573d6000803e3d6000fd5b50505050336001600160a01b03167fcc2e01638b08266366840f4a2ac8755c01e6932f730d5b707835cf4e23a152458284604051611aed92919061522a565b60006129178133610ae2565b610163805467ffffffffffffffff19166001600160401b038481169190911791829055604051911681527f99c317e8206747b01304c113e5c93aee8a0d136eca391733b384fc0f878f6e0690602001611e43565b6000805160206157fe8339815191526129848133610ae2565b60335460ff16156129a75760405162461bcd60e51b8152600401610ba590615458565b6000858152610165602090815260408083205490516129d6926001600160a01b03909216918b918b9101615099565b60405160208183030381529060405280519060200120905060008a8a8389604051602001612a07949392919061517e565b60408051601f19818403018152918152815160209283012060008a81526101658452828120546001600160a01b0316815261016990935291205490915060ff1615612af25760008781526101656020526040908190205490516330faa25960e01b81526001600160a01b039091169081906330faa25990612a8e908d908d9060040161527c565b600060405180830381600087803b158015612aa857600080fd5b505af1158015612abc573d6000803e3d6000fd5b505050506000805160206157de8339815191528c8c600386604051612ae494939291906155b1565b60405180910390a150612c53565b600080612aff8b8b6139c8565b61024081018790526102608101899052610280810188905260ff8e166040808301919091526001600160401b038e1660208084019190915260008c8152610165909152819020549051635f624fbd60e01b81529192506001600160a01b0316908190635f624fbd90612b779085908e90600401615538565b6040805180830381600087803b158015612b9057600080fd5b505af1158015612ba4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bc8919061478d565b836060018181525081945050508c6001600160401b03168e60ff167ff3eebc917bbcdbb3122520c3cdb2a3e3955672aeb3612717f0c7b2872ed296e78585606001516003604051612c1b93929190615206565b60405180910390a36000805160206157de8339815191528e8e600388604051612c4794939291906155b1565b60405180910390a15050505b6101635460008281526101666020526040808220549051632e31150760e11b815260048101919091529091600160401b90046001600160a01b031690635c622a0e9060240160206040518083038186803b158015612cb057600080fd5b505afa158015612cc4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ce89190614916565b90506002816004811115612d0c57634e487b7160e01b600052602160045260246000fd5b14612d595760405162461bcd60e51b815260206004820181905260248201527f50726f706f73616c206d757374206861766520506173736564207374617475736044820152606401610ba5565b610163546000838152610166602052604090819020549051630d61b51960e01b81526004810191909152600160401b9091046001600160a01b031690630d61b51990602401602060405180830381600087803b158015612db857600080fd5b505af1158015612dcc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061211e91906147d6565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a0810191909152600085858486604051602001612e3b949392919061517e565b60408051808303601f19018152828252805160209182012061016354600082815261016690935292909120546307336bcb60e21b845260048401529250600160401b90046001600160a01b031690631ccdaf2c9060240160c06040518083038186803b158015612eaa57600080fd5b505afa158015612ebe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ee291906149cd565b9150505b949350505050565b60335460ff1615612f115760405162461bcd60e51b8152600401610ba590615458565b60405163bf6eac2f60e01b815283906001600160a01b0382169063bf6eac2f90612f43903390879087906004016151c9565b600060405180830381600087803b158015612f5d57600080fd5b505af1158015612f71573d6000803e3d6000fd5b50505050336001600160a01b03167fcc2e01638b08266366840f4a2ac8755c01e6932f730d5b707835cf4e23a152458385604051611fa292919061522a565b6000612fbc8133610ae2565b604051633ffda2fd60e11b81526001600160a01b03858116600483015284811660248301528381166044830152869190821690637ffb45fa90606401611ea6565b6000808484846040516020016130159392919061514c565b60408051808303601f19018152919052805160209091012095945050505050565b60008051602061579e83398151915261304f8133610ae2565b600083815261016560205260409081902080546001600160a01b0319166001600160a01b0387169081179091559051635c7d1b9b60e11b815285919063b8fa373690612504908790879060040161522a565b600261012d5414156130c55760405162461bcd60e51b8152600401610ba590615501565b600261012d556130d4826112db565b6130de8133610ae2565b6130e88383613c60565b6000805160206157fe833981519152831480156131925750610163546040516370a0823160e01b8152600160401b9091046001600160a01b0316906370a08231906131379085906004016151b5565b60206040518083038186803b15801561314f57600080fd5b505afa158015613163573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131879190614a3e565b670de0b6b3a7640000145b15611831576101635460405163226bf2d160e21b8152600160401b9091046001600160a01b0316906389afcb44906131ce9085906004016151b5565b600060405180830381600087803b1580156131e857600080fd5b505af11580156131fc573d6000803e3d6000fd5b505050506001610162546132109190615698565b610162556040517f10e1f7ce9fd7d1b90a66d13a2ab3cb8dd7f29f3f8d520b143b063ccfbab6906b906118289084906151b5565b60006132508133610ae2565b6101615460ff166132735760405162461bcd60e51b8152600401610ba590615409565b6001600160a01b0382166000908152610167602052604090819020805460ff19166001179055517f2373c347d35d91064d64b63157cb8aee2bd652a41983ca2e8a3e7348bfeff92f90611e439084906151b5565b60008381526101656020526040808220549051639e601b3160e01b815260ff851660048201526001600160a01b0384811660248301528392169081908190639e601b3190604401604080518083038186803b15801561332557600080fd5b505afa158015613339573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061335d9190614a56565b935093505050935093915050565b60006133778133610ae2565b6000838152610165602052604090819020549051636be1dc2b60e01b815283151560048201526001600160a01b039091169081908190636be1dc2b90602401612504565b600054610100900460ff166133d65760005460ff16156133da565b303b155b61343d5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610ba5565b600054610100900460ff16158015613468576000805460ff1961ff0019909116610100171660011790555b613470613c7d565b613478613cbe565b613483600033613cf5565b610163805461015f805460ff191660ff8916179055600160401b600160e01b031916600160401b6001600160a01b038516021767ffffffffffffffff19166001600160401b03861617905561016083905580156134e6576000805461ff00191690555b5050505050565b6134f7828261262f565b6118b65761350f816001600160a01b03166014613cff565b61351a836020613cff565b60405160200161352b9291906150dd565b60408051601f198184030181529082905262461bcd60e51b8252610ba5916004016152ab565b600061355d88886139c8565b336102a0820152610260810187905261028081018690526001600160a01b0383168152905061358c83856156af565b610240820152600089815261016560205260409020546001600160a01b031660c082018190526135ce5760405162461bcd60e51b8152600401610ba5906153d4565b60ff8a1660009081526101646020526040812080549091906135f8906001600160401b0316615703565b91906101000a8154816001600160401b0302191690836001600160401b03160217905581602001906001600160401b031690816001600160401b03168152505060008160c001519050806001600160a01b0316634a2661608b8d8560200151866040518563ffffffff1660e01b81526004016136779493929190615241565b600060405180830381600087803b15801561369157600080fd5b505af11580156136a5573d6000803e3d6000fd5b5050505081602001516001600160401b03168a8c60ff167fc9745c10b9322d1d4b7bf22f00dc660872b611832eedcfffdbcdc09ebafcb313856102e001516040516136f291815260200190565b60405180910390a45050505050505050505050565b613710826112db565b61371a8133610ae2565b6137248383613ee0565b505050565b613733828261262f565b156118b65760008281526097602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b60006118b68133610ae2565b60006137d4613790565b90506137df84613f66565b6000835111806137ec5750815b156137fd576137fb848461400b565b505b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143805460ff166134e657805460ff191660011781556040516138789086906138499085906024016151b5565b60408051601f198184030181529190526020810180516001600160e01b0316631b2ce7f360e11b17905261400b565b50805460ff19168155613889613790565b6001600160a01b0316826001600160a01b0316146139015760405162461bcd60e51b815260206004820152602f60248201527f45524331393637557067726164653a207570677261646520627265616b73206660448201526e75727468657220757067726164657360881b6064820152608401610ba5565b6134e6856140f6565b60335460ff1661392c5760405162461bcd60e51b8152600401610ba59061530e565b6033805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b60405161396691906151b5565b60405180910390a1565b60335460ff16156139935760405162461bcd60e51b8152600401610ba590615458565b6033805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586139593390565b6139d06141c9565b6139d86141c9565b60006139e684860186614a79565b6101a08a015261018089015261016088015261014087019190915261012086019190915261010085019190915260e08401919091529050613a2984860186614acd565b6102e08b0152505086159550613a46945050505050576001613a49565b60005b15156102c08301526101206040830181905261016083015160009187918790613a729083615661565b92613a7f93929190615639565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050506101608401516040850151919250613aca91615661565b6040840181905261018084015160009188918890613ae89083615661565b92613af593929190615639565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050506101808501516040860151919250613b4091615661565b604085018190526101a085015160009189918990613b5e9083615661565b92613b6b93929190615639565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050506101a08601516040870151919250613bb691615661565b604086018190526101a08601516000918a918a90613bd49083615661565b92613be193929190615639565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250505050602093840151928401519084015194909301516001600160601b03199283166101c0880152606093841c61022088015291909316610200860152901c60808401525090949350505050565b613c69826112db565b613c738133610ae2565b6137248383613729565b600054610100900460ff16613ca45760405162461bcd60e51b8152600401610ba5906154b6565b613cac614136565b613cb4614136565b613cbc614136565b565b600054610100900460ff16613ce55760405162461bcd60e51b8152600401610ba5906154b6565b613ced614136565b613cbc61415d565b6118b68282613ee0565b60606000613d0e836002615679565b613d19906002615661565b6001600160401b03811115613d3e57634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015613d68576020820181803683370190505b509050600360fc1b81600081518110613d9157634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110613dce57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506000613df2846002615679565b613dfd906001615661565b90505b6001811115613e91576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110613e3f57634e487b7160e01b600052603260045260246000fd5b1a60f81b828281518110613e6357634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c93613e8a816156ec565b9050613e00565b508315611bd05760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610ba5565b613eea828261262f565b6118b65760008281526097602090815260408083206001600160a01b03851684529091529020805460ff19166001179055613f223390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b803b613fca5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610ba5565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b6060823b61406a5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610ba5565b600080846001600160a01b03168460405161408591906150c1565b600060405180830381855af49150503d80600081146140c0576040519150601f19603f3d011682016040523d82523d6000602084013e6140c5565b606091505b50915091506140ed828260405180606001604052806027815260200161583e60279139614190565b95945050505050565b6140ff81613f66565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b600054610100900460ff16613cbc5760405162461bcd60e51b8152600401610ba5906154b6565b600054610100900460ff166141845760405162461bcd60e51b8152600401610ba5906154b6565b6033805460ff19169055565b6060831561419f575081611bd0565b8251156141af5782518084602001fd5b8160405162461bcd60e51b8152600401610ba591906152ab565b604080516103008101825260008082526020820181905291810182905260608082018390526080820183905260a0820183905260c0820183905260e08201839052610100820183905261012082018390526101408201839052610160820183905261018082018390526101a082018390526101c082018390526101e0820183905261020082018390526102208201839052610240820181905261026082018190526102808201526102a081018290526102c081018290526102e081019190915290565b600061429f61429a84615616565b6155e6565b83815290506020808201908360005b868110156142d5576142c3888335880161445b565b845292820192908201906001016142ae565b505050509392505050565b8035610ac881615756565b600082601f8301126142fb578081fd5b8135602061430b61429a83615616565b8281528181019085830183850287018401881015614327578586fd5b855b8581101561434e57813561433c81615756565b84529284019290840190600101614329565b5090979650505050505050565b60008083601f84011261436c578182fd5b5081356001600160401b03811115614382578182fd5b602083019150836020808302850101111561439c57600080fd5b9250929050565b600082601f8301126143b3578081fd5b611bd08383356020850161428c565b600082601f8301126143d2578081fd5b813560206143e261429a83615616565b82815281810190858301838502870184018810156143fe578586fd5b855b8581101561434e57813584529284019290840190600101614400565b60008083601f84011261442d578182fd5b5081356001600160401b03811115614443578182fd5b60208301915083602082850101111561439c57600080fd5b600082601f83011261446b578081fd5b81356001600160401b0381111561448457614484615740565b614497601f8201601f19166020016155e6565b8181528460208386010111156144ab578283fd5b816020850160208301379081016020019190915292915050565b805160058110610ac857600080fd5b8035610ac881615779565b8035610ac88161578e565b6000602082840312156144fb578081fd5b8135611bd081615756565b600060208284031215614517578081fd5b8151611bd081615756565b60008060408385031215614534578081fd5b823561453f81615756565b9150602083013561454f81615756565b809150509250929050565b6000806000806080858703121561456f578182fd5b843561457a81615756565b9350602085013561458a81615756565b9250604085013561459a81615756565b915060608501356145aa81615756565b939692955090935050565b600080600080608085870312156145ca578182fd5b84356145d581615756565b935060208501356145e581615756565b925060408501356145f581615756565b9396929550929360600135925050565b600080600060608486031215614619578081fd5b833561462481615756565b9250602084013561463481615756565b915060408401356146448161576b565b809150509250925092565b600080600060608486031215614663578081fd5b833561466e81615756565b9250602084013561467e81615756565b929592945050506040919091013590565b600080600080608085870312156146a4578182fd5b84356146af81615756565b935060208501356146bf81615756565b925060408501356146cf8161578e565b915060608501356145aa8161578e565b600080604083850312156146f1578182fd5b82356146fc81615756565b946020939093013593505050565b60008060006060848603121561471e578081fd5b833561472981615756565b925060208401359150604084013561464481615756565b60008060408385031215614752578182fd5b823561475d81615756565b915060208301356001600160401b03811115614777578182fd5b6147838582860161445b565b9150509250929050565b6000806040838503121561479f578182fd5b82516147aa81615756565b6020939093015192949293505050565b6000602082840312156147cb578081fd5b8135611bd08161576b565b6000602082840312156147e7578081fd5b8151611bd08161576b565b600060208284031215614803578081fd5b5035919050565b6000806040838503121561481c578182fd5b82359150602083013561454f81615756565b60008060408385031215614840578182fd5b82359150602083013561454f8161576b565b600080600060608486031215614866578081fd5b8335925060208401356148788161578e565b9150604084013561464481615756565b60008060008060008060c087890312156148a0578384fd5b8635955060208701356148b28161578e565b945060408701356148c281615756565b9350606087013592506080870135915060a08701356148e08161576b565b809150509295509295509295565b6000602082840312156148ff578081fd5b81356001600160e01b031981168114611bd0578182fd5b600060208284031215614927578081fd5b611bd0826144c5565b60008060008060008060c08789031215614948578384fd5b86356001600160401b038082111561495e578586fd5b61496a8a838b0161445b565b9750602089013591508082111561497f578586fd5b5061498c89828a0161445b565b955050604087013561499d8161578e565b935060608701356149ad81615756565b925060808701356149bd81615756565b915060a08701356148e081615756565b600060c082840312156149de578081fd5b6149e860c06155e6565b6149f1836144c5565b815260208301516020820152604083015160408201526060830151614a1581615779565b60608201526080838101519082015260a0830151614a328161578e565b60a08201529392505050565b600060208284031215614a4f578081fd5b5051919050565b60008060408385031215614a68578182fd5b505080516020909101519092909150565b600080600080600080600080610100898b031215614a95578586fd5b505086359860208801359850604088013597606081013597506080810135965060a0810135955060c0810135945060e0013592509050565b60008060008060008060008060006101208a8c031215614aeb578283fd5b505087359960208901359950604089013598606081013598506080810135975060a0810135965060c0810135955060e08101359450610100013592509050565b600060208284031215614b3c578081fd5b8135611bd08161578e565b60008060408385031215614b59578182fd5b82356146fc8161578e565b600080600080600080600080600060e08a8c031215614b81578283fd5b614b8a8a6144df565b985060208a0135975060408a01356001600160401b0380821115614bac578485fd5b614bb88d838e0161441c565b909950975060608c0135915080821115614bd0578485fd5b614bdc8d838e016143c2565b965060808c0135915080821115614bf1578485fd5b614bfd8d838e016142eb565b955060a08c0135915080821115614c12578485fd5b50614c1f8c828d0161435b565b9094509250614c32905060c08b016142e0565b90509295985092959850929598565b60008060008060808587031215614c56578182fd5b8435614c618161578e565b9350602085013592506040850135915060608501356145aa81615756565b600080600060608486031215614c93578081fd5b8335614c9e8161578e565b9250602084013561467e81615779565b60008060008060808587031215614cc3578182fd5b8435614cce8161578e565b93506020850135614cde81615779565b93969395505050506040820135916060013590565b60008060008060008060008060e0898b031215614d0e578182fd5b614d17896144df565b9750614d2560208a016144d4565b965060408901356001600160401b0380821115614d40578384fd5b614d4c8c838d0161441c565b909850965060608b0135955060808b0135915080821115614d6b578384fd5b614d778c838d016143c2565b945060a08b0135915080821115614d8c578384fd5b614d988c838d016142eb565b935060c08b0135915080821115614dad578283fd5b50614dba8b828c016143a3565b9150509295985092959890939650565b6001600160a01b03169052565b6000815180845260208085019450808401835b83811015614e0f5781516001600160a01b031687529582019590820190600101614dea565b509495945050505050565b6000815180845260208085018081965082840281019150828601855b85811015614e60578284038952614e4e848351614eaa565b98850198935090840190600101614e36565b5091979650505050505050565b6000815180845260208085019450808401835b83811015614e0f57815187529582019590820190600101614e80565b6001600160601b0319169052565b60008151808452614ec28160208601602086016156bc565b601f01601f19169290920160200192915050565b60058110614ef457634e487b7160e01b600052602160045260246000fd5b9052565b6000610300614f08848451614dca565b6020830151614f2260208601826001600160401b03169052565b5060408301516040850152606083015160608501526080830151614f496080860182614dca565b5060a0830151614f5c60a0860182614dca565b5060c0830151614f6f60c0860182614dca565b5060e08381015190850152610100808401519085015261012080840151908501526101408084015190850152610160808401519085015261018080840151908501526101a080840151908501526101c080840151614fcf82870182614e9c565b50506101e080840151614fe482870182614dca565b505061020080840151614ff982870182614e9c565b50506102208084015161500e82870182614dca565b505061024080840151828287015261502883870182614e1a565b9250505061026080840151858303828701526150448382614e6d565b9250505061028080840151858303828701526150608382614dd7565b925050506102a08084015161507782870182614dca565b50506102c0838101511515908501526102e09283015192909301919091525090565b606084901b6001600160601b0319168152600082846014840137910160140190815292915050565b600082516150d38184602087016156bc565b9190910192915050565b600076020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b8252835161510f8160178501602088016156bc565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516151408160288401602088016156bc565b01602801949350505050565b60f89390931b6001600160f81b031916835260c09190911b6001600160c01b0319166001830152600982015260290190565b60f89490941b6001600160f81b031916845260c09290921b6001600160c01b03191660018401526009830152602982015260490190565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b03841681526020810183905260608101612ee66040830184614ed6565b9182526001600160a01b0316602082015260400190565b600085825260ff851660208301526001600160401b0384166040830152608060608301526152726080830184614ef8565b9695505050505050565b60006020825282602083015282846040840137818301604090810191909152601f909201601f19160101919050565b600060208252611bd06020830184614eaa565b600060a082526152d160a0830188614eaa565b82810360208401526152e38188614eaa565b60ff96909616604084015250506001600160a01b039283166060820152911660809091015292915050565b60208082526014908201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604082015260600190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b6020808252818101527f7265736f757263654944206e6f74206d617070656420746f2068616e646c6572604082015260600190565b6020808252602f908201527f4272696467655570677261646561626c653a205768697465206c697374696e6760408201526e081a5cc81b9bdd08195b98589b1959608a1b606082015260800190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6020808252601a90820152791859191c995cdcc81a5cc81b9bdd081dda1a5d195b1a5cdd195960321b604082015260600190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60006040825261554b6040830185614ef8565b90508260208301529392505050565b600060c08201905061556d828451614ed6565b60208301516020830152604083015160408301526001600160401b0360608401511660608301526080830151608083015260ff60a08401511660a083015292915050565b60ff851681526001600160401b0384166020820152608081016155d76040830185614ed6565b82606083015295945050505050565b604051601f8201601f191681016001600160401b038111828210171561560e5761560e615740565b604052919050565b60006001600160401b0382111561562f5761562f615740565b5060209081020190565b60008085851115615648578182fd5b83861115615654578182fd5b5050820193919092039150565b600082198211156156745761567461572a565b500190565b60008160001904831182151516156156935761569361572a565b500290565b6000828210156156aa576156aa61572a565b500390565b6000611bd036848461428c565b60005b838110156156d75781810151838201526020016156bf565b838111156156e6576000848401525b50505050565b6000816156fb576156fb61572a565b506000190190565b60006001600160401b03808316818114156157205761572061572a565b6001019392505050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461198057600080fd5b801515811461198057600080fd5b6001600160401b038116811461198057600080fd5b60ff8116811461198057600080fdfe8b9e7a9f25b0aca3f51c01b8fee30790fb16f4d4deded8385ae6643d054bb078bf233dd2aafeb4d50879c4aa5c81e96d92f6e6945c906a58f9f2d1c1631b4b26968626a768e76ba1363efe44e322a6c4900c5f084e0b45f35e294dfddaa9e0d5e2b7fb3b832174769106daebcfd6d1970523240dda11281102db9363b83b0dc465d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a164736f6c6343000802000a

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.