Contract 0x0fA09a648BCE46937ECa531917B15eF14632551a

Contract Overview

Balance:
0 MATIC
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x3f1da8503b453cdd69bfa52fabe52aad44b73cb9456c91ad7b3da5bb636b06ee0x60a06040239130472022-01-15 12:59:3213 days 6 hrs ago0x33bcde3da095c1d2681f3167e5696bf5b7d4f321 IN  Create: BridgeUpgradeable0 MATIC0.010704274 2
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
BridgeUpgradeable

Compiler Version
v0.8.2+commit.661d1103

Optimization Enabled:
Yes with 125 runs

Other Settings:
default evmVersion
File 1 of 25 : 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 "./VoterUpgradeable.sol";

import "./interfaces/IDepositExecute.sol";
import "./interfaces/ILiquidityPool.sol";
import "./interfaces/IERCHandler.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
{
    // View Functions
    function fetchMAX_RELAYERS() public view virtual returns (uint256) {
        return MAX_RELAYERS;
    }

    function fetchMAX_FEE_SETTERS() public view virtual returns (uint256) {
        return MAX_FEE_SETTERS;
    }

    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 fetch_quorum() public view virtual returns (uint64) {
        return _quorum;
    }

    function fetchTotalRelayers() public view virtual returns (uint256 count) {
        return totalRelayers;
    }

    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

    // Data Structure Starts

    uint256 private constant MAX_RELAYERS = 200;
    uint256 private constant MAX_FEE_SETTERS = 3;
    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 private totalRelayers;

    uint64 private _quorum;

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

    // Data Structure Ends

    event quorumChanged(uint64 quorum);
    event expiryChanged(uint256 expiry);
    event ProposalEvent(
        uint8 originChainID,
        uint64 depositNonce,
        VoterUpgradeable.ProposalStatus status,
        bytes32 dataHash
    );
    event ProposalVote(
        uint8 originChainID,
        uint64 depositNonce,
        VoterUpgradeable.ProposalStatus status,
        bytes32 dataHash
    );
    event Deposit(uint8 indexed destinationChainID, bytes32 indexed resourceID, uint64 indexed depositNonce);
    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 destinationChainID,
        uint64 depositNonce,
        address settlementToken,
        uint256 settlementAmount
    );
    /**
        @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, _msgSender());
        _setRoleAdmin(FEE_SETTER_ROLE, DEFAULT_ADMIN_ROLE);
        _setRoleAdmin(RELAYER_ROLE, DEFAULT_ADMIN_ROLE);
        _setRoleAdmin(PAUSER_ROLE, DEFAULT_ADMIN_ROLE);
        _setRoleAdmin(RESOURCE_SETTER, DEFAULT_ADMIN_ROLE);
        _setRoleAdmin(EMERGENCY_ROLE, DEFAULT_ADMIN_ROLE);

        _voter = VoterUpgradeable(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(_quorum);
    }

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

    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.
        @param contractAddress Address of contract to be called when a deposit is made and a deposited is executed.
     */
    function adminSetGenericResource(
        address handlerAddress,
        bytes32 resourceID,
        address contractAddress,
        bytes4 depositFunctionSig,
        uint256 depositFunctionDepositerOffset,
        bytes4 executeFunctionSig
    ) public virtual onlyRole(RESOURCE_SETTER) {
        _resourceIDToHandlerAddress[resourceID] = handlerAddress;
        IGenericHandler handler = IGenericHandler(handlerAddress);
        handler.setResource(
            resourceID,
            contractAddress,
            depositFunctionSig,
            depositFunctionDepositerOffset,
            executeFunctionSig
        );
    }

    /**
        @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.
     */
    function adminSetBurnable(address handlerAddress, address tokenAddress)
        public
        virtual
        onlyRole(DEFAULT_ADMIN_ROLE)
    {
        IERCHandler handler = IERCHandler(handlerAddress);
        handler.setBurnable(tokenAddress);
    }

    /**
        @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 Transfers eth in the contract to the specified addresses.
        The parameters addrs and amounts are mapped 1-1.
        This means that the address at index 0 for addrs will receive the amount (in WEI) from amounts at index 0.
        @param addrs Array of addresses to transfer {amounts} to.
        @param amounts Array of amonuts to transfer to {addrs}.
     */
    function transferFunds(address payable[] calldata addrs, uint256[] calldata amounts)
        public
        virtual
        nonReentrant
        onlyRole(DEFAULT_ADMIN_ROLE)
    {
        require(addrs.length == amounts.length, "addrs and amounts len mismatch");
        uint256 addrCount = addrs.length;
        for (uint256 i = 0; i < addrCount; i++) {
            addrs[i].transfer(amounts[i]);
        }
    }

    /**
       @notice Transfers ERC20 in the contract to the specified addresses. The parameters addrs
       and amounts are mapped 1-1.
       This means that the address at index 0 for addrs will receive the amount
       from amounts at index 0.
       @param addrs Array of addresses to transfer {amounts} to.
       @param tokens Array of addresses of {tokens} to transfer.
       @param amounts Array of amounts to transfer to {addrs}.
    */
    function transferFundsERC20(
        address[] calldata addrs,
        address[] calldata tokens,
        uint256[] calldata amounts
    ) public virtual nonReentrant onlyRole(DEFAULT_ADMIN_ROLE) {
        require(addrs.length == amounts.length, "addrs and amounts len mismatch");
        require(addrs.length == tokens.length, "addrs and amounts len mismatch");
        uint256 addrCount = addrs.length;
        for (uint256 i = 0; i < addrCount; i++) {
            IERC20Upgradeable(tokens[i]).transfer(addrs[i], amounts[i]);
        }
    }

    /**
       @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 distribution,
        uint256[] memory flags,
        address[] memory path,
        address feeTokenAddress
    ) public virtual nonReentrant whenNotPaused isWhitelisted {
        _deposit(destinationChainID, resourceID, data, distribution, flags, path, feeTokenAddress);
    }

    function depositETH(
        uint8 destinationChainID,
        bytes32 resourceID,
        bytes calldata data,
        uint256[] memory distribution,
        uint256[] memory flags,
        address[] memory path,
        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 }();
        IWETH(weth).transfer(msg.sender, msg.value);

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

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

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

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

    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));
        swapDetails.isDestNative = isDestNative == 0 ? false : true;
        swapDetails.index = 256; // 32 * 6 -> 8
        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 resourceID ResourceID used to find address of handler to be used for stake
       @param tokenAddress Asset which needs to be staked.
       @param amount Amount that needs to be staked.
       @notice Emits {Stake} event.
    */
    function stake(
        bytes32 resourceID,
        address tokenAddress,
        uint256 amount
    ) public virtual nonReentrant whenNotPaused {
        address handler = _resourceIDToHandlerAddress[resourceID];
        ILiquidityPool depositHandler = ILiquidityPool(handler);
        IERCHandler ercHandler = IERCHandler(handler);
        address _tokenAddress = ercHandler.resourceIDToTokenContractAddress(resourceID);
        require(_tokenAddress == tokenAddress, "stakeETH: invalid token address");
        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 resourceID ResourceID used to find address of handler to be used for stake
       @param tokenAddress Asset which needs to be staked.
       @param amount Amount that needs to be staked.
       @notice Emits {Stake} event.
    */
    function stakeETH(
        bytes32 resourceID,
        address tokenAddress,
        uint256 amount
    ) public payable virtual nonReentrant whenNotPaused {
        address handler = _resourceIDToHandlerAddress[resourceID];
        ILiquidityPool depositHandler = ILiquidityPool(handler);
        IERCHandler ercHandler = IERCHandler(handler);
        address _tokenAddress = ercHandler.resourceIDToTokenContractAddress(resourceID);
        address WETH = ercHandler._WETH();
        require(_tokenAddress == tokenAddress, "stakeETH: invalid token address");
        require(tokenAddress == WETH, "stakeETH: incorrect weth address");
        require(msg.value == amount, "stakeETH: insufficient eth provided");

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

    /**
       @notice Allows unstaking from liquidity pools.
       @notice Only callable when Bridge is not paused.
       @param resourceID ResourceID used to find address of handler to be used for unstake
       @param tokenAddress Asset which needs to be unstaked.
       @param amount Amount that needs to be unstaked.
       @notice Emits {Unstake} event.
    */
    function unstake(
        bytes32 resourceID,
        address tokenAddress,
        uint256 amount
    ) public virtual nonReentrant whenNotPaused {
        address handler = _resourceIDToHandlerAddress[resourceID];
        ILiquidityPool depositHandler = ILiquidityPool(handler);
        IERCHandler ercHandler = IERCHandler(handler);
        address _tokenAddress = ercHandler.resourceIDToTokenContractAddress(resourceID);
        require(_tokenAddress == tokenAddress, "stakeETH: invalid token address");
        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 resourceID ResourceID used to find address of handler to be used for unstake
       @param tokenAddress Asset which needs to be unstaked.
       @param amount Amount that needs to be unstaked.
       @notice Emits {Unstake} event.
    */
    function unstakeETH(
        bytes32 resourceID,
        address tokenAddress,
        uint256 amount
    ) public virtual nonReentrant whenNotPaused {
        address handler = _resourceIDToHandlerAddress[resourceID];
        ILiquidityPool depositHandler = ILiquidityPool(handler);
        IERCHandler ercHandler = IERCHandler(handler);
        address _tokenAddress = ercHandler.resourceIDToTokenContractAddress(resourceID);
        require(_tokenAddress == tokenAddress, "stakeETH: invalid token address");
        address WETH = ercHandler._WETH();
        require(tokenAddress == WETH, "stakeETH: incorrect weth address");
        depositHandler.unstakeETH(msg.sender, tokenAddress, amount);
        emit Unstake(msg.sender, amount, tokenAddress);
    }

    // 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 dataHash
    ) public view virtual returns (VoterUpgradeable.issueStruct memory status) {
        bytes32 proposalHash = keccak256(abi.encodePacked(originChainID, depositNonce, dataHash));
        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));
        if (_proposals[proposalHash] == 0) {
            uint256 id = _voter.createProposal(block.number + _expiry, _quorum);
            _proposals[proposalHash] = id;
            _proposalDetails[id] = proposalStruct(chainID, depositNonce, resourceID, dataHash);
            emit ProposalEvent(chainID, depositNonce, VoterUpgradeable.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]) != VoterUpgradeable.ProposalStatus.Cancelled) {
            _voter.vote(_proposals[proposalHash], 1, msg.sender);

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

    /**
        @notice Cancels a deposit proposal that has not been executed yet.
        @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 originally provided when deposit was made.
        @notice Proposal must be past expiry threshold.
        @notice Emits {ProposalEvent} event with status {Cancelled}.
     */
    function cancelProposal(
        uint8 chainID,
        uint64 depositNonce,
        bytes32 dataHash
    ) public onlyAdminOrRelayer {
        bytes32 proposalHash = keccak256(abi.encodePacked(chainID, depositNonce, dataHash));
        VoterUpgradeable.ProposalStatus currentStatus = _voter.getStatus(_proposals[proposalHash]);
        require(
            currentStatus == VoterUpgradeable.ProposalStatus.Active ||
                currentStatus == VoterUpgradeable.ProposalStatus.Passed,
            "Proposal cannot be cancelled"
        );

        _voter.setStatus(_proposals[proposalHash]);

        emit ProposalEvent(chainID, depositNonce, VoterUpgradeable.ProposalStatus.Cancelled, dataHash);
    }

    /**
        @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 distribution,
        uint256[] memory flags,
        address[] memory path
    ) public virtual onlyRole(RELAYER_ROLE) whenNotPaused {
        address settlementToken;
        IDepositExecute.SwapInfo memory swapDetails = unpackDepositData(data);
        swapDetails.distribution = distribution;
        swapDetails.flags = flags;
        swapDetails.path = path;

        bytes32 dataHash = keccak256(abi.encodePacked(_resourceIDToHandlerAddress[resourceID], data));
        bytes32 proposalHash = keccak256(abi.encodePacked(chainID, depositNonce, dataHash));
        VoterUpgradeable.ProposalStatus currentStatus = _voter.getStatus(_proposals[proposalHash]);
        require(currentStatus == VoterUpgradeable.ProposalStatus.Passed, "Proposal must have Passed status");

        _voter.executeProposal(_proposals[proposalHash]);

        IDepositExecute depositHandler = IDepositExecute(_resourceIDToHandlerAddress[resourceID]);

        (settlementToken, swapDetails.returnAmount) = depositHandler.executeProposal(swapDetails, resourceID);
        emit Settlement(chainID, depositNonce, settlementToken, swapDetails.returnAmount);

        emit ProposalEvent(chainID, depositNonce, VoterUpgradeable.ProposalStatus.Executed, dataHash);
    }

    // Voting Function ends
}

File 2 of 25 : Initializable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @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.
 */
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() {
        require(_initializing || !_initialized, "Initializable: contract is already initialized");

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

        _;

        if (isTopLevelCall) {
            _initializing = false;
        }
    }
}

File 3 of 25 : PausableUpgradeable.sol
// SPDX-License-Identifier: MIT

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 initializer {
        __Context_init_unchained();
        __Pausable_init_unchained();
    }

    function __Pausable_init_unchained() internal initializer {
        _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 25 : AccessControlUpgradeable.sol
// SPDX-License-Identifier: MIT

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 initializer {
        __Context_init_unchained();
        __ERC165_init_unchained();
        __AccessControl_init_unchained();
    }

    function __AccessControl_init_unchained() internal initializer {
    }
    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 granted `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}.
     * ====
     */
    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);
    }

    function _grantRole(bytes32 role, address account) private {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    function _revokeRole(bytes32 role, address account) private {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
    uint256[49] private __gap;
}

File 5 of 25 : UUPSUpgradeable.sol
// SPDX-License-Identifier: MIT

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 initializer {
        __ERC1967Upgrade_init_unchained();
        __UUPSUpgradeable_init_unchained();
    }

    function __UUPSUpgradeable_init_unchained() internal initializer {
    }
    /// @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 25 : ReentrancyGuardUpgradeable.sol
// SPDX-License-Identifier: MIT

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 initializer {
        __ReentrancyGuard_init_unchained();
    }

    function __ReentrancyGuard_init_unchained() internal initializer {
        _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 make 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 25 : VoterUpgradeable.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.2;

import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol";

import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";

/**
    @author Router Protocol
    @title VoterUpgradeable Contract
*/
contract VoterUpgradeable is Initializable, AccessControlUpgradeable, ERC20Upgradeable, UUPSUpgradeable {
    using CountersUpgradeable for CountersUpgradeable.Counter;

    CountersUpgradeable.Counter private _IssueCtr;

    address public bridge;

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

    mapping(uint256 => issueStruct) private issueMap;

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

    // IssueID -> address -> hasVoted - bool
    mapping(uint256 => mapping(address => hasVotedStruct)) private hasVoted;

    struct hasVotedStruct {
        bool voted;
        uint8 option;
    }

    // IssueID -> vote option -> weight
    mapping(uint256 => mapping(uint8 => uint256)) private voteWeight;

    modifier isBridge() {
        require(msg.sender == bridge);
        _;
    }

    modifier isvalidIssue(uint256 _issue) {
        require(
            issueMap[_issue].status == ProposalStatus.Active,
            "ERC-1202: Not a valid proposal to vote on or voting on proposal is complete"
        );
        _;
    }

    modifier isNotvalidIssue(uint256 _issue) {
        require(issueMap[_issue].status == ProposalStatus.Inactive, "ERC-1202: A valid proposal");
        _;
    }

    modifier isNotEnded(uint256 _issue) {
        require(
            (block.number < issueMap[_issue].endBlock) && (issueMap[_issue].status == ProposalStatus.Active),
            "ERC-1202: Voting has ended"
        );
        _;
    }

    modifier isVotingEnded(uint256 _issue) {
        require(block.number >= issueMap[_issue].endBlock, "ERC-1202: Voting has not ended");
        _;
    }

    modifier isNotVoted(uint256 _issue, address relayer) {
        require(!hasVoted[_issue][relayer].voted, "ERC-1202: User has Voted");
        _;
    }

    modifier isValidOption(uint8 _opts) {
        require((_opts == 1) || (_opts == 2), "ERC-1202: Is not valid option");
        _;
    }

    modifier isValidbalance(address relayer) {
        require(balanceOf(relayer) == 1 ether, "ERC-1202: Is not valid balance");
        _;
    }

    modifier isValidquorum(uint64 quorum) {
        require((quorum > 0) && (quorum <= 10000), "ERC-1202: Is not valid quorum");
        _;
    }

    modifier isPassed(uint256 id) {
        require(issueMap[id].status == ProposalStatus.Passed, "ERC-1202: Proposal is not passed");
        _;
    }

    /**
        @notice OnCreateIssue Event
        @notice Creates a event when a new proposal is created to be voted upon.
        @param issueId ID of the proposal.
    */
    event OnCreateIssue(uint256 issueId);

    /**
        @notice OnVote Event
        @notice Creates a event when a proposal is voted upon.
        @param issueId ID of the proposal.
        @param _from Address of the voter.
        @param _value Voting power of the voter.
    */
    event OnVote(uint256 issueId, address indexed _from, uint256 _value);

    /**
        @notice OnStatusChange Event
        @notice Creates a event when a status of the Proposal is changed.
        @param issueId ID of the proposal.
        @param Status Status of the proposal.
    */
    event OnStatusChange(uint256 issueId, ProposalStatus Status);

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

    /**
        @notice Initializer Function
        @notice Can be called only once and acts like constructor for UUPS based upgradeable contracts.
    */
    function __VoterUpgradeable_init() internal initializer {
        __AccessControl_init();
        __ERC20_init_unchained("Relayer Vote Token ", "RRT");
        __VoterUpgradeable_init_unchained();

        _setupRole(DEFAULT_ADMIN_ROLE, _msgSender());
    }

    /**
        @notice Shadow function to Initializer Function
        @notice Can be called only once and acts like constructor for UUPS based upgradeable contracts.
    */
    function __VoterUpgradeable_init_unchained() internal initializer {}

    function initialize() external initializer {
        __VoterUpgradeable_init();
    }

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

    function setBridge(address _b) public virtual onlyRole(DEFAULT_ADMIN_ROLE) {
        require(_b != address(0), "RouterProtocol_VOTER::Bridge Address can not be zero address.");
        require(_b != address(this), "RouterProtocol_VOTER::Bridge Address can not be Voter address.");
        require(!hasRole(DEFAULT_ADMIN_ROLE, _b));
        bridge = _b;
    }

    /**
        @notice mint function
        @dev Grants VOting Token
        @param account address to which role is being revoked
    */
    function mint(address account) public virtual isBridge {
        _mint(account, 1 ether);
    }

    /**
        @notice burn function
        @dev Revokes Voting Token
        @param account address to which role is being revoked
    */
    function burn(address account) public virtual isBridge {
        _burn(account, 1 ether);
    }

    /**
     * @dev See {ERC20-_beforeTokenTransfer}.
     *
     * Requirements:
     *
     * - the token tranfer amongst users must not happen.
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual override {
        super._beforeTokenTransfer(from, to, amount);
        //        revert("ERC20 Non Transferable: This token is not transferable");
    }

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

    /**
    @notice createProposal function
    @notice Creates a new proposal.
    @notice Preconditon1 - Function is external and can be accessed by BRIDGE_ROLE only.
    @notice Preconditon2 - Proposal quorum must be valid integer
    @param endBlock End block number for proposal to end.
    @param quorum quorum percentage for the proposal.
*/
    function createProposal(uint256 endBlock, uint64 quorum)
        public
        virtual
        isBridge
        isValidquorum(quorum)
        returns (uint256 id)
    {
        _IssueCtr.increment();
        uint256 ctr = _IssueCtr.current();
        issueMap[ctr] = issueStruct(ProposalStatus.Active, block.number, endBlock, quorum, 0, 0);
        emit OnCreateIssue(ctr);
        emit OnStatusChange(ctr, issueMap[ctr].status);
        return ctr;
    }

    /**
        @notice vote function
        @notice Vote on a new proposal.
        @notice Preconditon1 - Function is external and can be accessed by BRIDGE_ROLE only.
        @notice Preconditon2 - Checks weather issue / proposal ID is valid
        @notice Preconditon3 - Current voter must not have voted on proposal
        @notice Preconditon4 - Options entered for voting must be valid (ie. - Option must be either 1 - yes or 2 - no )
        @notice Preconditon5 - Voting for the current proposal / issue must not have ended
        @notice Preconditon6 - Members must have valid balances to vote.
        @param issueId Issue ID or proposal ID for casting vote
        @param option Option selected by the user
        @return success Boolean value to denote successfull completion of function
    */
    function vote(
        uint256 issueId,
        uint8 option,
        address relayer
    )
        public
        virtual
        isBridge
        isvalidIssue(issueId)
        isNotVoted(issueId, relayer)
        isValidOption(option)
        isNotEnded(issueId)
        isValidbalance(relayer)
        returns (bool success)
    {
        uint256 balance = balanceOf(relayer);
        hasVoted[issueId][relayer] = hasVotedStruct(true, option);
        voteWeight[issueId][option] = voteWeight[issueId][option] + balance;
        issueMap[issueId].maxVotes = issueMap[issueId].maxVotes + balance;
        uint256 yes = voteWeight[issueId][1];
        uint256 yesPercent = (yes * (10000)) / (totalSupply()); // YesPercent = yes*10000/totalSupply
        if (yesPercent > issueMap[issueId].quorum) _setStatus(issueId, 1, ProposalStatus.Passed);

        emit OnVote(issueId, relayer, balance);
        return true;
    }

    /**
        @notice setStatus function
        @notice Updates the status of the proposal
        @notice Preconditon1 - Function is external and can be accessed by BRIDGE_ROLE only.
        @notice Preconditon2 - Proposal must have ended its voting duration
        @param issueId Issue ID or proposal ID for changing the status
        @return success Boolean value to denote successfull completion of function
    */
    function setStatus(uint256 issueId) public virtual isVotingEnded(issueId) isBridge returns (bool success) {
        uint256 yes = voteWeight[issueId][1];
        uint256 yesPercent = (yes * (10000)) / (totalSupply()); // YesPercent = yes*10000/maxvotes
        if (yesPercent > issueMap[issueId].quorum) {
            return _setStatus(issueId, 1, ProposalStatus.Passed);
        }
        return _setStatus(issueId, 2, ProposalStatus.Cancelled);
    }

    function _setStatus(
        uint256 issueId,
        uint8 option,
        ProposalStatus status
    ) internal returns (bool success) {
        issueMap[issueId].resultOption = option;
        issueMap[issueId].status = status;

        emit OnStatusChange(issueId, issueMap[issueId].status);
        return true;
    }

    /**
        @notice executeProposal function
        @notice Marks the status of the proposal as executed.
        @notice Preconditon1 - Function is external and can be accessed by BRIDGE_ROLE only.
        @notice Preconditon2 - Proposal must be with statue of passed
        @param issueId Issue ID or proposal ID for changing the status
        @return success Boolean value to denote successfull completion of function
    */
    function executeProposal(uint256 issueId) public virtual isPassed(issueId) isBridge returns (bool success) {
        issueMap[issueId].status = ProposalStatus.Executed;
        emit OnStatusChange(issueId, issueMap[issueId].status);
        return true;
    }

    /**
        @notice ballotOf function
        @notice Fetches the casted vote of the user.
        @notice Preconditon1 - Function is public and open to all.
        @param issueId Issue ID or proposal ID
        @param addr Address of the person casting vote
        @return option Option casted by the voter
    */
    function ballotOf(uint256 issueId, address addr) public view virtual returns (uint8 option) {
        return hasVoted[issueId][addr].option;
    }

    function Voted(uint256 issueId, address addr) public view virtual returns (bool) {
        return hasVoted[issueId][addr].voted;
    }

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

    /**
        @notice weightOf function
        @notice Fetches the vote weight of the user.
        @notice Preconditon1 - Function is public and open to all.
        @param addr Address of the person casting vote
        @return weight Vote weight of the voter
    */
    function weightOf(address addr) public view virtual returns (uint256 weight) {
        return balanceOf(addr);
    }

    /**
        @notice getStatus function
        @notice Fetches the status of the proposal.
        @notice Preconditon1 - Function is public and open to all.
        @param issueId Issue ID or proposal ID
        @return status Proposal status of the user
    */
    function getStatus(uint256 issueId) public view virtual returns (ProposalStatus status) {
        return issueMap[issueId].status;
    }

    /**
        @notice weightedVoteCountsOf function
        @notice Fetches the Wieight of the option for a proposal.
        @notice Preconditon1 - Function is public and open to all.
        @param issueId Issue ID or proposal ID
        @param option Option selected by the voters
        @return count Total Count of the option
    */
    function weightedVoteCountsOf(uint256 issueId, uint8 option) public view virtual returns (uint256 count) {
        return voteWeight[issueId][option];
    }

    /**
        @notice fetchIssueMap function
        @notice Fetches the Issue Status.
        @notice Preconditon1 - Function is public and open to all.
        @return issue Details of the issue
    */
    function fetchIssueMap(uint256 _issue) public view virtual returns (issueStruct memory issue) {
        return issueMap[_issue];
    }

    /**
        @notice fetchIsExpired function
        @notice Fetches the Issue is active or inactive.
        @notice Preconditon1 - Function is public and open to all.
        @return status Status of issue
    */
    function fetchIsExpired(uint256 _issue) public view virtual returns (bool status) {
        return block.number >= issueMap[_issue].endBlock;
    }

    /**
        @notice fetchCtr function
        @notice Fetches the Current counters.
        @notice Preconditon1 - Function is public and open to all.
        @return counter Counter for number of proposals
    */
    function fetchCtr() public view virtual returns (uint256 counter) {
        return _IssueCtr.current();
    }
}

File 8 of 25 : 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;
        uint256[] distribution;
        uint256[] flags;
        address[] path;
        address depositer;
        bool isDestNative;
    }

    /**
        @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 9 of 25 : 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 10 of 25 : 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 getTotalFeeSetters() external view returns (uint256);

    // function grantFeeRole(address account) external;

    // function revokeFeeRole(address account) external;
    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;

    /**
        @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.
     */
    function setBurnable(address contractAddress) 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 11 of 25 : 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 {
    /**
        @notice Correlates {resourceID} with {contractAddress}, {depositFunctionSig}, and {executeFunctionSig}.
        @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.
        @param depositFunctionSig Function signature of method to be called in {contractAddress} when a deposit is made.
        @param depositFunctionDepositerOffset Depositer address position offset in the metadata, in bytes.
        @param executeFunctionSig Function signature of method to be called in {contractAddress} when a deposit is executed.
     */
    function setResource(
        bytes32 resourceID,
        address contractAddress,
        bytes4 depositFunctionSig,
        uint256 depositFunctionDepositerOffset,
        bytes4 executeFunctionSig
    ) external;
}

File 12 of 25 : 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 13 of 25 : ContextUpgradeable.sol
// SPDX-License-Identifier: MIT

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 initializer {
        __Context_init_unchained();
    }

    function __Context_init_unchained() internal initializer {
    }
    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 14 of 25 : IAccessControlUpgradeable.sol
// SPDX-License-Identifier: MIT

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

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 16 of 25 : ERC165Upgradeable.sol
// SPDX-License-Identifier: MIT

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 initializer {
        __ERC165_init_unchained();
    }

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

File 17 of 25 : IERC165Upgradeable.sol
// SPDX-License-Identifier: MIT

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 18 of 25 : ERC1967UpgradeUpgradeable.sol
// SPDX-License-Identifier: MIT

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 initializer {
        __ERC1967Upgrade_init_unchained();
    }

    function __ERC1967Upgrade_init_unchained() internal initializer {
    }
    // 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 19 of 25 : IBeaconUpgradeable.sol
// SPDX-License-Identifier: MIT

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 20 of 25 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT

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 21 of 25 : StorageSlotUpgradeable.sol
// SPDX-License-Identifier: MIT

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

File 22 of 25 : ERC20Upgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

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

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

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

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

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

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

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

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

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

    /**
     * @dev See {IERC20-approve}.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        _approve(_msgSender(), spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * Requirements:
     *
     * - `sender` and `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     * - the caller must have allowance for ``sender``'s tokens of at least
     * `amount`.
     */
    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) public virtual override returns (bool) {
        _transfer(sender, recipient, amount);

        uint256 currentAllowance = _allowances[sender][_msgSender()];
        require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
        unchecked {
            _approve(sender, _msgSender(), currentAllowance - amount);
        }

        return true;
    }

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

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

        return true;
    }

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

        _beforeTokenTransfer(sender, recipient, amount);

        uint256 senderBalance = _balances[sender];
        require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[sender] = senderBalance - amount;
        }
        _balances[recipient] += amount;

        emit Transfer(sender, recipient, amount);

        _afterTokenTransfer(sender, recipient, amount);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

File 23 of 25 : CountersUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @title Counters
 * @author Matt Condon (@shrugs)
 * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number
 * of elements in a mapping, issuing ERC721 ids, or counting request ids.
 *
 * Include with `using Counters for Counters.Counter;`
 */
library CountersUpgradeable {
    struct Counter {
        // This variable should never be directly accessed by users of the library: interactions must be restricted to
        // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
        // this feature: see https://github.com/ethereum/solidity/issues/4637
        uint256 _value; // default: 0
    }

    function current(Counter storage counter) internal view returns (uint256) {
        return counter._value;
    }

    function increment(Counter storage counter) internal {
        unchecked {
            counter._value += 1;
        }
    }

    function decrement(Counter storage counter) internal {
        uint256 value = counter._value;
        require(value > 0, "Counter: decrement overflow");
        unchecked {
            counter._value = value - 1;
        }
    }

    function reset(Counter storage counter) internal {
        counter._value = 0;
    }
}

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

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20Upgradeable {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

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

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

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

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

File 25 of 25 : IERC20MetadataUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC20Upgradeable.sol";

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

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

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

Settings
{
  "evmVersion": "berlin",
  "metadata": {
    "bytecodeHash": "none",
    "useLiteralContent": true
  },
  "optimizer": {
    "enabled": true,
    "runs": 125
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "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"}],"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":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 VoterUpgradeable.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 VoterUpgradeable.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":"destinationChainID","type":"uint8"},{"indexed":false,"internalType":"uint64","name":"depositNonce","type":"uint64"},{"indexed":false,"internalType":"address","name":"settlementToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"settlementAmount","type":"uint256"}],"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":"_voter","outputs":[{"internalType":"contract VoterUpgradeable","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"}],"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"},{"internalType":"address","name":"contractAddress","type":"address"},{"internalType":"bytes4","name":"depositFunctionSig","type":"bytes4"},{"internalType":"uint256","name":"depositFunctionDepositerOffset","type":"uint256"},{"internalType":"bytes4","name":"executeFunctionSig","type":"bytes4"}],"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":"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":"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":"distribution","type":"uint256[]"},{"internalType":"uint256[]","name":"flags","type":"uint256[]"},{"internalType":"address[]","name":"path","type":"address[]"},{"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":"distribution","type":"uint256[]"},{"internalType":"uint256[]","name":"flags","type":"uint256[]"},{"internalType":"address[]","name":"path","type":"address[]"},{"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":"distribution","type":"uint256[]"},{"internalType":"uint256[]","name":"flags","type":"uint256[]"},{"internalType":"address[]","name":"path","type":"address[]"}],"name":"executeProposal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"fetchMAX_FEE_SETTERS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fetchMAX_RELAYERS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fetchTotalRelayers","outputs":[{"internalType":"uint256","name":"count","type":"uint256"}],"stateMutability":"view","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":[],"name":"fetch_quorum","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"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":"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":"dataHash","type":"bytes32"}],"name":"getProposal","outputs":[{"components":[{"internalType":"enum VoterUpgradeable.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 VoterUpgradeable.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":"bytes32","name":"resourceID","type":"bytes32"},{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"resourceID","type":"bytes32"},{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"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":[{"internalType":"address payable[]","name":"addrs","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"transferFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"addrs","type":"address[]"},{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"transferFundsERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"resourceID","type":"bytes32"},{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"resourceID","type":"bytes32"},{"internalType":"address","name":"tokenAddress","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"}]

60a06040523060601b60805234801561001757600080fd5b5060805160601c615fdd6200004c600039600081816119480152818161198801528181611ce80152611d280152615fdd6000f3fe60806040526004361061031b5760003560e01c80638ab1d6811161019c578063bb5ba77e116100e2578063dfd441de11610090578063dfd441de14610a0a578063e43252d714610a1d578063e63ab1e914610a3d578063e934768314610a5f578063ebc2693914610a81578063f071460414610ab6578063f19ba3f814610ac9578063fe79b9a914610ae957610322565b8063bb5ba77e1461092f578063c155762914610948578063c794c69814610968578063cb10f21514610988578063cd125cc2146109a8578063d547741f146109c8578063db618e2a146109e857610322565b8063926d7d7f1161014a578063926d7d7f1461081a5780639be8eb531461083c578063a07e338d1461085c578063a217fddf1461088a578063a98b9ff41461089f578063a9cf69fa146108bf578063aa81cea7146108ec578063b2c0f6401461090c57610322565b80638ab1d681146107445780638ab7bc1d146107645780638ac4c184146107845780638c0c2631146107a45780638c610c8d146107c45780638ff71309146107e457806391d14854146107fa57610322565b8063428d2b4b116102615780635a1ad87c1161020f5780635a1ad87c1461063d5780635af5f7ba1461065d5780635bc511471461067d5780635c975abb146106b75780636e99227e146106cf578063780cf004146106ef5780637d026d961461070f5780638456cb591461072f57610322565b8063428d2b4b146105695780634603ae381461057d5780634633f4e41461059d5780634d98a61b146105bd5780634f1ef286146105d357806350d1882e146105e657806355883e471461061d57610322565b80632f2ff15d116102c95780632f2ff15d146104585780633074104b146104785780633077618a1461048c57806336568abe146104bf5780633659cfe6146104df5780633db9b42a146104ff5780633dd301d9146105345780633f4ba83a1461055457610322565b806301ffc9a7146103275780630e5f06e51461035c57806317f03ce5146103965780631ff013f1146103b857806320df4359146103d8578063248a9ca3146104085780632becbe311461043857610322565b3661032257005b600080fd5b34801561033357600080fd5b506103476103423660046150e4565b610b09565b60405190151581526020015b60405180910390f35b34801561036857600080fd5b50610347610377366004614c2a565b6001600160a01b03166000908152610167602052604090205460ff1690565b3480156103a257600080fd5b506103b66103b13660046153e6565b610b42565b005b3480156103c457600080fd5b506103b66103d3366004615415565b610de1565b3480156103e457600080fd5b506103fa600080516020615f2a83398151915281565b604051908152602001610353565b34801561041457600080fd5b506103fa610423366004614fb1565b60009081526097602052604090206001015490565b34801561044457600080fd5b506103b6610453366004614cf5565b611600565b34801561046457600080fd5b506103b6610473366004614fc9565b611708565b34801561048457600080fd5b5060c86103fa565b34801561049857600080fd5b50610163546001600160401b03165b6040516001600160401b039091168152602001610353565b3480156104cb57600080fd5b506103b66104da366004614fc9565b6118bf565b3480156104eb57600080fd5b506103b66104fa366004614c2a565b61193d565b34801561050b57600080fd5b506101635461052790600160401b90046001600160a01b031681565b604051610353919061589d565b34801561054057600080fd5b5061034761054f3660046153e6565b611a06565b34801561056057600080fd5b506103b6611adb565b34801561057557600080fd5b5060036103fa565b34801561058957600080fd5b506103b6610598366004614f11565b611b1e565b3480156105a957600080fd5b506103b66105b83660046152d1565b611c34565b3480156105c957600080fd5b50610160546103fa565b6103b66105e1366004614def565b611cdd565b3480156105f257600080fd5b50610527610601366004614fb1565b600090815261016560205260409020546001600160a01b031690565b34801561062957600080fd5b506103b6610638366004615118565b611d93565b34801561064957600080fd5b506103b6610658366004614d86565b611e11565b34801561066957600080fd5b506103b6610678366004614f79565b611ea3565b34801561068957600080fd5b506104a76106983660046152b5565b60ff16600090815261016460205260409020546001600160401b031690565b3480156106c357600080fd5b5060335460ff16610347565b3480156106db57600080fd5b506103b66106ea36600461507e565b611ef9565b3480156106fb57600080fd5b506103b661070a366004614cf5565b612064565b34801561071b57600080fd5b506103b661072a366004614fb1565b6120d9565b34801561073b57600080fd5b506103b6612129565b34801561075057600080fd5b506103b661075f366004614c2a565b61216d565b34801561077057600080fd5b506103b661077f366004614fed565b6121ed565b34801561079057600080fd5b506103b661079f366004614c62565b612458565b3480156107b057600080fd5b506103b66107bf366004614c62565b6124ca565b3480156107d057600080fd5b506103b66107df366004614fed565b612504565b3480156107f057600080fd5b50610162546103fa565b34801561080657600080fd5b50610347610815366004614fc9565b6126c8565b34801561082657600080fd5b506103fa600080516020615f6a83398151915281565b34801561084857600080fd5b506103b6610857366004614fb1565b6126f3565b34801561086857600080fd5b506103fa610877366004614fb1565b6000908152610166602052604090205490565b34801561089657600080fd5b506103fa600081565b3480156108ab57600080fd5b506103b66108ba366004614fed565b612753565b3480156108cb57600080fd5b506108df6108da3660046153e6565b612900565b6040516103539190615c98565b3480156108f857600080fd5b506103b6610907366004614e7c565b6129f9565b34801561091857600080fd5b5061015f5460405160ff9091168152602001610353565b34801561093b57600080fd5b506101615460ff16610347565b34801561095457600080fd5b506103b6610963366004614c9a565b612bab565b34801561097457600080fd5b506103fa6109833660046153e6565b612c2d565b34801561099457600080fd5b506103b66109a3366004614d45565b612c66565b3480156109b457600080fd5b506103b66109c336600461545a565b612d0a565b3480156109d457600080fd5b506103b66109e3366004614fc9565b6130c2565b3480156109f457600080fd5b506103fa600080516020615f0a83398151915281565b6103b6610a183660046152d1565b61326e565b348015610a2957600080fd5b506103b6610a38366004614c2a565b6134fa565b348015610a4957600080fd5b506103fa600080516020615f8a83398151915281565b348015610a6b57600080fd5b506103fa600080516020615eea83398151915281565b348015610a8d57600080fd5b50610aa1610a9c366004615048565b61357d565b60408051928352602083019190915201610353565b6103b6610ac4366004614fed565b613621565b348015610ad557600080fd5b506103b6610ae4366004615024565b6139bd565b348015610af557600080fd5b506103b6610b043660046153a8565b613a0d565b60006001600160e01b03198216637965db0b60e01b1480610b3a57506301ffc9a760e01b6001600160e01b03198316145b90505b919050565b610b4d6000336126c8565b80610b6b5750610b6b600080516020615f6a833981519152336126c8565b610bbc5760405162461bcd60e51b815260206004820152601e60248201527f73656e646572206973206e6f742072656c61796572206f722061646d696e000060448201526064015b60405180910390fd5b6000838383604051602001610bd39392919061586b565b60408051808303601f19018152828252805160209182012061016354600082815261016690935292822054632e31150760e11b85526004850152935091600160401b9091046001600160a01b031690635c622a0e9060240160206040518083038186803b158015610c4357600080fd5b505afa158015610c57573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c7b91906150fe565b90506001816004811115610c9f57634e487b7160e01b600052602160045260246000fd5b1480610cca57506002816004811115610cc857634e487b7160e01b600052602160045260246000fd5b145b610d165760405162461bcd60e51b815260206004820152601c60248201527f50726f706f73616c2063616e6e6f742062652063616e63656c6c6564000000006044820152606401610bb3565b6101635460008381526101666020526040908190205490516369ba1a7560e01b81526004810191909152600160401b9091046001600160a01b0316906369ba1a7590602401602060405180830381600087803b158015610d7557600080fd5b505af1158015610d89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dad9190614f95565b50600080516020615f4a8339815191528585600486604051610dd29493929190615cef565b60405180910390a15050505050565b6000828152610165602052604090205482906001600160a01b0316610e5d5760405162461bcd60e51b815260206004820152602c60248201527f4272696467655570677261646561626c653a204e6f2068616e646c657220666f60448201526b1c881c995cdbdd5c98d9525160a21b6064820152608401610bb3565b600080516020615f6a833981519152610e7781335b613b6f565b60335460ff1615610e9a5760405162461bcd60e51b8152600401610bb390615b5b565b6000868685604051602001610eb19392919061586b565b60408051601f198184030181529181528151602092830120600081815261016690935291205490915061104c576101635461016054600091600160401b90046001600160a01b03169063ba831b9c90610f0a9043615d9f565b6101635460405160e084901b6001600160e01b031916815260048101929092526001600160401b03166024820152604401602060405180830381600087803b158015610f5557600080fd5b505af1158015610f69573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f8d9190615226565b600083815261016660209081526040808320849055805160808101825260ff808e1682526001600160401b03808e168386019081528385018e8152606085018e8152898952610168909752968590209351845491519092166101000268ffffffffffffffff00199290931660ff199091161716178155925160018085019190915591516002909301929092559051919250600080516020615f4a8339815191529161103e918b918b91908a90615cef565b60405180910390a150611245565b6101635460008281526101666020526040908190205490516345737d1d60e11b81526004810191909152600160401b9091046001600160a01b031690638ae6fa3a9060240160206040518083038186803b1580156110a957600080fd5b505afa1580156110bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110e19190614f95565b15611245576101635460008281526101666020526040908190205490516369ba1a7560e01b81526004810191909152600160401b9091046001600160a01b0316906369ba1a7590602401602060405180830381600087803b15801561114557600080fd5b505af1158015611159573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061117d9190614f95565b50610163546000828152610166602052604090819020549051632e31150760e11b81526004810191909152600080516020615f4a8339815191529189918991600160401b90046001600160a01b031690635c622a0e9060240160206040518083038186803b1580156111ee57600080fd5b505afa158015611202573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061122691906150fe565b876040516112379493929190615cef565b60405180910390a1506115f8565b6004610163546000838152610166602052604090819020549051632e31150760e11b81526004810191909152600160401b9091046001600160a01b031690635c622a0e9060240160206040518083038186803b1580156112a457600080fd5b505afa1580156112b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112dc91906150fe565b60048111156112fb57634e487b7160e01b600052602160045260246000fd5b146115f657610163546000828152610166602052604090819020549051630ce7fb8360e11b8152600481019190915260016024820152336044820152600160401b9091046001600160a01b0316906319cff70690606401602060405180830381600087803b15801561136c57600080fd5b505af1158015611380573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113a49190614f95565b50610163546000828152610166602052604090819020549051632e31150760e11b815260048101919091527f25f8daaa4635a7729927ba3f5b3d59cc3320aca7c32c9db4e7ca7b95743436409189918991600160401b90046001600160a01b031690635c622a0e9060240160206040518083038186803b15801561142757600080fd5b505afa15801561143b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061145f91906150fe565b876040516114709493929190615cef565b60405180910390a16002610163546000838152610166602052604090819020549051632e31150760e11b81526004810191909152600160401b9091046001600160a01b031690635c622a0e9060240160206040518083038186803b1580156114d757600080fd5b505afa1580156114eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061150f91906150fe565b600481111561152e57634e487b7160e01b600052602160045260246000fd5b14156115f657610163546000828152610166602052604090819020549051632e31150760e11b81526004810191909152600080516020615f4a8339815191529189918991600160401b90046001600160a01b031690635c622a0e9060240160206040518083038186803b1580156115a457600080fd5b505afa1580156115b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115dc91906150fe565b876040516115ed9493929190615cef565b60405180910390a15b505b505050505050565b600261012d5414156116245760405162461bcd60e51b8152600401610bb390615c3f565b600261012d55600080516020615f2a8339815191526116438133610e72565b6040516372aee27360e11b815285906001600160a01b0382169063e55dc4e690611675908890889088906004016158b1565b600060405180830381600087803b15801561168f57600080fd5b505af11580156116a3573d6000803e3d6000fd5b5050604080516001600160a01b038a8116825289811660208301528816818301526060810187905290517f7d3706b5a5b55581dd829778c6dc22a79c5e0909849ef3174c169b718978d8aa9350908190036080019150a15050600161012d5550505050565b600261012d54141561172c5760405162461bcd60e51b8152600401610bb390615c3f565b600261012d5560008281526097602052604090206001015461174e8133610e72565b6117588383613bd3565b600080516020615f6a833981519152831480156117f95750610163546040516370a0823160e01b8152600160401b9091046001600160a01b0316906370a08231906117a790859060040161589d565b60206040518083038186803b1580156117bf57600080fd5b505afa1580156117d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117f79190615226565b155b156118b457610163546040516335313c2160e11b8152600160401b9091046001600160a01b031690636a6278429061183590859060040161589d565b600060405180830381600087803b15801561184f57600080fd5b505af1158015611863573d6000803e3d6000fd5b505050506101625460016118779190615d9f565b610162556040517f03580ee9f53a62b7cb409a2cb56f9be87747dd15017afc5cef6eef321e4fb2c5906118ab90849061589d565b60405180910390a15b5050600161012d5550565b6001600160a01b038116331461192f5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610bb3565b6119398282613bfe565b5050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614156119865760405162461bcd60e51b8152600401610bb390615a08565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166119b8613c65565b6001600160a01b0316146119de5760405162461bcd60e51b8152600401610bb390615a8b565b6119e781613c93565b60408051600080825260208201909252611a0391839190613c9f565b50565b600080848484604051602001611a1e9392919061586b565b60408051808303601f1901815282825280516020918201206000818152610166909252919020546101635463030b0f8d60e01b845291935091600160401b9091046001600160a01b03169063030b0f8d90611a7f90849033906004016158ee565b60206040518083038186803b158015611a9757600080fd5b505afa158015611aab573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611acf9190614f95565b925050505b9392505050565b600080516020615f8a833981519152611af48133610e72565b60335460ff16611b165760405162461bcd60e51b8152600401610bb3906159da565b611a03613ddf565b600261012d541415611b425760405162461bcd60e51b8152600401610bb390615c3f565b600261012d556000611b548133610e72565b838214611b735760405162461bcd60e51b8152600401610bb3906159a3565b8360005b81811015611c2557868682818110611b9f57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190611bb49190614c2a565b6001600160a01b03166108fc868684818110611be057634e487b7160e01b600052603260045260246000fd5b905060200201359081150290604051600060405180830381858888f19350505050158015611c12573d6000803e3d6000fd5b5080611c1d81615e34565b915050611b77565b5050600161012d555050505050565b600261012d541415611c585760405162461bcd60e51b8152600401610bb390615c3f565b600261012d5560335460ff1615611c815760405162461bcd60e51b8152600401610bb390615b5b565b6101615460ff1615611cbd57336000908152610167602052604090205460ff16611cbd5760405162461bcd60e51b8152600401610bb390615bd3565b611ccd8888888888888888613e45565b5050600161012d55505050505050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415611d265760405162461bcd60e51b8152600401610bb390615a08565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316611d58613c65565b6001600160a01b031614611d7e5760405162461bcd60e51b8152600401610bb390615a8b565b611d8782613c93565b61193982826001613c9f565b6000611d9f8133610e72565b6040516325a0141360e21b815284906001600160a01b03821690639680504c90611dd5908b908b908b908a908a90600401615953565b600060405180830381600087803b158015611def57600080fd5b505af1158015611e03573d6000803e3d6000fd5b505050505050505050505050565b600080516020615f0a833981519152611e2a8133610e72565b600086815261016560205260409081902080546001600160a01b0319166001600160a01b038a8116918217909255915163de319d9960e01b81526004810189905290871660248201526001600160e01b03198087166044830152606482018690528416608482015288919063de319d999060a401611dd5565b6000611eaf8133610e72565b610161805460ff19168315159081179091556040519081527f78e648f9aa0bf2a4400dc354b571bbbf0d423305d9b78e94a9014ab03ff8bb7b906020015b60405180910390a15050565b600080516020615eea833981519152611f128133610e72565b6000878152610165602090815260409182902054825163d755c34960e01b815292516001600160a01b03909116928392839263d755c349926004808201939291829003018186803b158015611f6657600080fd5b505afa158015611f7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f9e9190614f95565b611fdf5760405162461bcd60e51b8152602060048201526012602482015271199959481a5cc81b9bdd08195b98589b195960721b6044820152606401610bb3565b604051631487001b60e01b815260ff891660048201526001600160a01b03888116602483015260448201889052606482018790528515156084830152821690631487001b9060a401600060405180830381600087803b15801561204157600080fd5b505af1158015612055573d6000803e3d6000fd5b50505050505050505050505050565b600261012d5414156120885760405162461bcd60e51b8152600401610bb390615c3f565b600261012d55600080516020615f2a8339815191526120a78133610e72565b604051636ce5768960e11b815285906001600160a01b0382169063d9caed1290611675908890889088906004016158b1565b60006120e58133610e72565b610160829055610163546040516001600160401b0390911681527fa2b67627a88e010182419ae858fcf3ca4374ad08cbbd6fe10bebcf8b26d3b5fe90602001611eed565b600080516020615f8a8339815191526121428133610e72565b60335460ff16156121655760405162461bcd60e51b8152600401610bb390615b5b565b611a03613fb8565b60006121798133610e72565b6101615460ff1661219c5760405162461bcd60e51b8152600401610bb390615b0c565b6001600160a01b0382166000908152610167602052604090819020805460ff19169055517f441e43beaf2db8af6e1f9f7a6b9f0dcc36fcf83a2904264c9ab624068242efff90611eed90849061589d565b600261012d5414156122115760405162461bcd60e51b8152600401610bb390615c3f565b600261012d5560335460ff161561223a5760405162461bcd60e51b8152600401610bb390615b5b565b60008381526101656020526040808220549051630d74357760e21b8152600481018690526001600160a01b0390911691829182919082906335d0d5dc9060240160206040518083038186803b15801561229257600080fd5b505afa1580156122a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122ca9190614c46565b9050856001600160a01b0316816001600160a01b0316146122fd5760405162461bcd60e51b8152600401610bb390615a54565b6000826001600160a01b031663e0af36166040518163ffffffff1660e01b815260040160206040518083038186803b15801561233857600080fd5b505afa15801561234c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123709190614c46565b9050806001600160a01b0316876001600160a01b0316146123a35760405162461bcd60e51b8152600401610bb390615c0a565b604051631a7f5a4160e31b81526001600160a01b0385169063d3fad208906123d39033908b908b906004016158b1565b600060405180830381600087803b1580156123ed57600080fd5b505af1158015612401573d6000803e3d6000fd5b50505050336001600160a01b03167f379bc14156b62673a2efd113a5b989c8240c2018bf1fa01ee2d3d5915f769d4b87896040516124409291906158ee565b60405180910390a25050600161012d55505050505050565b60006124648133610e72565b60405163e7c308fd60e01b815283906001600160a01b0382169063e7c308fd9061249290869060040161589d565b600060405180830381600087803b1580156124ac57600080fd5b505af11580156124c0573d6000803e3d6000fd5b5050505050505050565b60006124d68133610e72565b6040516307b7ed9960e01b815283906001600160a01b038216906307b7ed999061249290869060040161589d565b600261012d5414156125285760405162461bcd60e51b8152600401610bb390615c3f565b600261012d5560335460ff16156125515760405162461bcd60e51b8152600401610bb390615b5b565b60008381526101656020526040808220549051630d74357760e21b8152600481018690526001600160a01b0390911691829182919082906335d0d5dc9060240160206040518083038186803b1580156125a957600080fd5b505afa1580156125bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125e19190614c46565b9050856001600160a01b0316816001600160a01b0316146126145760405162461bcd60e51b8152600401610bb390615a54565b60405163bf6eac2f60e01b81526001600160a01b0384169063bf6eac2f906126449033908a908a906004016158b1565b600060405180830381600087803b15801561265e57600080fd5b505af1158015612672573d6000803e3d6000fd5b50505050336001600160a01b03167fcc2e01638b08266366840f4a2ac8755c01e6932f730d5b707835cf4e23a1524586886040516126b19291906158ee565b60405180910390a25050600161012d555050505050565b60009182526097602090815260408084206001600160a01b0393909316845291905290205460ff1690565b60006126ff8133610e72565b610163805467ffffffffffffffff19166001600160401b038481169190911791829055604051911681527f99c317e8206747b01304c113e5c93aee8a0d136eca391733b384fc0f878f6e0690602001611eed565b600261012d5414156127775760405162461bcd60e51b8152600401610bb390615c3f565b600261012d5560335460ff16156127a05760405162461bcd60e51b8152600401610bb390615b5b565b60008381526101656020526040808220549051630d74357760e21b8152600481018690526001600160a01b0390911691829182919082906335d0d5dc9060240160206040518083038186803b1580156127f857600080fd5b505afa15801561280c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128309190614c46565b9050856001600160a01b0316816001600160a01b0316146128635760405162461bcd60e51b8152600401610bb390615a54565b6040516330414fc560e11b81526001600160a01b038416906360829f8a906128939033908a908a906004016158b1565b600060405180830381600087803b1580156128ad57600080fd5b505af11580156128c1573d6000803e3d6000fd5b50505050336001600160a01b03167f379bc14156b62673a2efd113a5b989c8240c2018bf1fa01ee2d3d5915f769d4b86886040516126b19291906158ee565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a081019190915260008484846040516020016129499392919061586b565b60408051808303601f19018152828252805160209182012061016354600082815261016690935292909120546307336bcb60e21b845260048401529250600160401b90046001600160a01b031690631ccdaf2c9060240160c06040518083038186803b1580156129b857600080fd5b505afa1580156129cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129f091906151b5565b95945050505050565b600261012d541415612a1d5760405162461bcd60e51b8152600401610bb390615c3f565b600261012d556000612a2f8133610e72565b858214612a4e5760405162461bcd60e51b8152600401610bb3906159a3565b858414612a6d5760405162461bcd60e51b8152600401610bb3906159a3565b8560005b81811015612b9a57868682818110612a9957634e487b7160e01b600052603260045260246000fd5b9050602002016020810190612aae9190614c2a565b6001600160a01b031663a9059cbb8a8a84818110612adc57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190612af19190614c2a565b878785818110612b1157634e487b7160e01b600052603260045260246000fd5b905060200201356040518363ffffffff1660e01b8152600401612b359291906158d5565b602060405180830381600087803b158015612b4f57600080fd5b505af1158015612b63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b879190614f95565b5080612b9281615e34565b915050612a71565b5050600161012d5550505050505050565b6000612bb78133610e72565b604051633ffda2fd60e11b81526001600160a01b03858116600483015284811660248301528381166044830152869190821690637ffb45fa90606401600060405180830381600087803b158015612c0d57600080fd5b505af1158015612c21573d6000803e3d6000fd5b50505050505050505050565b600080848484604051602001612c459392919061586b565b60408051808303601f19018152919052805160209091012095945050505050565b600080516020615f0a833981519152612c7f8133610e72565b600083815261016560205260409081902080546001600160a01b0319166001600160a01b0387169081179091559051635c7d1b9b60e11b815285919063b8fa373690612cd190879087906004016158ee565b600060405180830381600087803b158015612ceb57600080fd5b505af1158015612cff573d6000803e3d6000fd5b505050505050505050565b600080516020615f6a833981519152612d238133610e72565b60335460ff1615612d465760405162461bcd60e51b8152600401610bb390615b5b565b600080612d538989614010565b6102408101879052610260810186905261028081018590526000888152610165602090815260408083205490519394509192612d9d926001600160a01b0316918d918d91016157b4565b60405160208183030381529060405280519060200120905060008c8c83604051602001612dcc9392919061586b565b60408051808303601f19018152828252805160209182012061016354600082815261016690935292822054632e31150760e11b85526004850152935091600160401b9091046001600160a01b031690635c622a0e9060240160206040518083038186803b158015612e3c57600080fd5b505afa158015612e50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e7491906150fe565b90506002816004811115612e9857634e487b7160e01b600052602160045260246000fd5b14612ee55760405162461bcd60e51b815260206004820181905260248201527f50726f706f73616c206d757374206861766520506173736564207374617475736044820152606401610bb3565b610163546000838152610166602052604090819020549051630d61b51960e01b81526004810191909152600160401b9091046001600160a01b031690630d61b51990602401602060405180830381600087803b158015612f4457600080fd5b505af1158015612f58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f7c9190614f95565b5060008a815261016560205260409081902054905163078d92eb60e41b81526001600160a01b039091169081906378d92eb090612fbf9088908f90600401615c76565b6040805180830381600087803b158015612fd857600080fd5b505af1158015612fec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130109190614e4f565b866060018181525081975050508e60ff167f10af23e3c2fe2f66e88c27d077cce2a70013983537b14d1a13855406b7371c9a8f88886060015160405161307d939291906001600160401b039390931683526001600160a01b03919091166020830152604082015260600190565b60405180910390a2600080516020615f4a8339815191528f8f6003876040516130a99493929190615cef565b60405180910390a1505050505050505050505050505050565b600261012d5414156130e65760405162461bcd60e51b8152600401610bb390615c3f565b600261012d556000828152609760205260409020600101546131088133610e72565b613112838361428c565b600080516020615f6a833981519152831480156131bc5750610163546040516370a0823160e01b8152600160401b9091046001600160a01b0316906370a082319061316190859060040161589d565b60206040518083038186803b15801561317957600080fd5b505afa15801561318d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131b19190615226565b670de0b6b3a7640000145b156118b4576101635460405163226bf2d160e21b8152600160401b9091046001600160a01b0316906389afcb44906131f890859060040161589d565b600060405180830381600087803b15801561321257600080fd5b505af1158015613226573d6000803e3d6000fd5b5050505060016101625461323a9190615dd6565b610162556040517f10e1f7ce9fd7d1b90a66d13a2ab3cb8dd7f29f3f8d520b143b063ccfbab6906b906118ab90849061589d565b600261012d5414156132925760405162461bcd60e51b8152600401610bb390615c3f565b600261012d5560335460ff16156132bb5760405162461bcd60e51b8152600401610bb390615b5b565b6101615460ff16156132f757336000908152610167602052604090205460ff166132f75760405162461bcd60e51b8152600401610bb390615bd3565b600087815261016560205260409020546001600160a01b03168061332d5760405162461bcd60e51b8152600401610bb390615ad7565b6000341161338e5760405162461bcd60e51b815260206004820152602860248201527f6465706f7369744554483a204e6f206e617469766520617373657473207472616044820152671b9cd9995c9c995960c21b6064820152608401610bb3565b6000816001600160a01b031663e0af36166040518163ffffffff1660e01b815260040160206040518083038186803b1580156133c957600080fd5b505afa1580156133dd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906134019190614c46565b9050806001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b15801561343e57600080fd5b505af1158015613452573d6000803e3d6000fd5b505060405163a9059cbb60e01b81526001600160a01b038516935063a9059cbb92506134859150339034906004016158d5565b602060405180830381600087803b15801561349f57600080fd5b505af11580156134b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906134d79190614f95565b506134e88a8a8a8a8a8a8a8a613e45565b5050600161012d555050505050505050565b60006135068133610e72565b6101615460ff166135295760405162461bcd60e51b8152600401610bb390615b0c565b6001600160a01b0382166000908152610167602052604090819020805460ff19166001179055517f2373c347d35d91064d64b63157cb8aee2bd652a41983ca2e8a3e7348bfeff92f90611eed90849061589d565b60008381526101656020526040808220549051639e601b3160e01b815260ff851660048201526001600160a01b0384811660248301528392169081908190639e601b3190604401604080518083038186803b1580156135db57600080fd5b505afa1580156135ef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613613919061523e565b935093505050935093915050565b600261012d5414156136455760405162461bcd60e51b8152600401610bb390615c3f565b600261012d5560335460ff161561366e5760405162461bcd60e51b8152600401610bb390615b5b565b60008381526101656020526040808220549051630d74357760e21b8152600481018690526001600160a01b0390911691829182919082906335d0d5dc9060240160206040518083038186803b1580156136c657600080fd5b505afa1580156136da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136fe9190614c46565b90506000826001600160a01b031663e0af36166040518163ffffffff1660e01b815260040160206040518083038186803b15801561373b57600080fd5b505afa15801561374f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137739190614c46565b9050866001600160a01b0316826001600160a01b0316146137a65760405162461bcd60e51b8152600401610bb390615a54565b806001600160a01b0316876001600160a01b0316146137d75760405162461bcd60e51b8152600401610bb390615c0a565b8534146138325760405162461bcd60e51b815260206004820152602360248201527f7374616b654554483a20696e73756666696369656e74206574682070726f766960448201526219195960ea1b6064820152608401610bb3565b806001600160a01b031663d0e30db0876040518263ffffffff1660e01b81526004016000604051808303818588803b15801561386d57600080fd5b505af1158015613881573d6000803e3d6000fd5b505060405163a9059cbb60e01b81526001600160a01b038516935063a9059cbb92506138b4915088908a906004016158d5565b602060405180830381600087803b1580156138ce57600080fd5b505af11580156138e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139069190614f95565b61392057634e487b7160e01b600052600160045260246000fd5b60405163f4e480e160e01b81526001600160a01b0385169063f4e480e1906139509033908b908b906004016158b1565b600060405180830381600087803b15801561396a57600080fd5b505af115801561397e573d6000803e3d6000fd5b50505050336001600160a01b03167fcc2e01638b08266366840f4a2ac8755c01e6932f730d5b707835cf4e23a1524587896040516124409291906158ee565b60006139c98133610e72565b6000838152610165602052604090819020549051636be1dc2b60e01b815283151560048201526001600160a01b039091169081908190636be1dc2b90602401612cd1565b600054610100900460ff1680613a26575060005460ff16155b613a425760405162461bcd60e51b8152600401610bb390615b85565b600054610100900460ff16158015613a6d576000805460ff1961ff0019909116610100171660011790555b613a756142b2565b613a7d61433e565b613a886000336143ae565b613aa1600080516020615eea83398151915260006143b8565b613aba600080516020615f6a83398151915260006143b8565b613ad3600080516020615f8a83398151915260006143b8565b613aec600080516020615f0a83398151915260006143b8565b613b05600080516020615f2a83398151915260006143b8565b610163805461015f805460ff191660ff8916179055600160401b600160e01b031916600160401b6001600160a01b038516021767ffffffffffffffff19166001600160401b0386161790556101608390558015613b68576000805461ff00191690555b5050505050565b613b7982826126c8565b61193957613b91816001600160a01b03166014614403565b613b9c836020614403565b604051602001613bad9291906157fc565b60408051601f198184030181529082905262461bcd60e51b8252610bb391600401615940565b600082815260976020526040902060010154613bef8133610e72565b613bf983836145e4565b505050565b613c0882826126c8565b156119395760008281526097602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b60006119398133610e72565b6000613ca9613c65565b9050613cb48461466a565b600083511180613cc15750815b15613cd257613cd0848461470f565b505b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143805460ff16613b6857805460ff19166001178155604051613d4d908690613d1e90859060240161589d565b60408051601f198184030181529190526020810180516001600160e01b0316631b2ce7f360e11b17905261470f565b50805460ff19168155613d5e613c65565b6001600160a01b0316826001600160a01b031614613dd65760405162461bcd60e51b815260206004820152602f60248201527f45524331393637557067726164653a207570677261646520627265616b73206660448201526e75727468657220757067726164657360881b6064820152608401610bb3565b613b68856147f1565b60335460ff16613e015760405162461bcd60e51b8152600401610bb3906159da565b6033805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b604051613e3b919061589d565b60405180910390a1565b6000613e518787614010565b336102a08201526102408101869052610260810185905261028081018490526001600160a01b03838116825260008a815261016560205260409020541660c08201819052909150613eb45760405162461bcd60e51b8152600401610bb390615ad7565b60ff89166000908152610164602052604081208054909190613ede906001600160401b0316615e4f565b82546001600160401b039182166101009390930a83810292021916179091556020820181905260c0820151604051636ac6376b60e01b815290916001600160a01b03831691636ac6376b91613f3b918d918f918890600401615905565b600060405180830381600087803b158015613f5557600080fd5b505af1158015613f69573d6000803e3d6000fd5b5050505081602001516001600160401b0316898b60ff167fdbb69440df8433824a026ef190652f29929eb64b4d1d5d2a69be8afe3e6eaed860405160405180910390a450505050505050505050565b60335460ff1615613fdb5760405162461bcd60e51b8152600401610bb390615b5b565b6033805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258613e2e3390565b61401861495b565b61402061495b565b600061402e84860186615261565b6101a08a015261018089015261016088015261014087019190915261012086019190915261010085019190915260e084019190915290508015614072576001614075565b60005b15156102c0830152610100604083018190526101608301516000918791879061409e9083615d9f565b926140ab93929190615d77565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050505061016084015160408501519192506140f691615d9f565b60408401819052610180840151600091889188906141149083615d9f565b9261412193929190615d77565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250505050610180850151604086015191925061416c91615d9f565b604085018190526101a08501516000918991899061418a9083615d9f565b9261419793929190615d77565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050506101a086015160408701519192506141e291615d9f565b604086018190526101a08601516000918a918a906142009083615d9f565b9261420d93929190615d77565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250505050602093840151928401519084015194909301516001600160601b03199283166101c0880152606093841c61022088015291909316610200860152901c60808401525090949350505050565b6000828152609760205260409020600101546142a88133610e72565b613bf98383613bfe565b600054610100900460ff16806142cb575060005460ff16155b6142e75760405162461bcd60e51b8152600401610bb390615b85565b600054610100900460ff16158015614312576000805460ff1961ff0019909116610100171660011790555b61431a614831565b614322614831565b61432a614831565b8015611a03576000805461ff001916905550565b600054610100900460ff1680614357575060005460ff16155b6143735760405162461bcd60e51b8152600401610bb390615b85565b600054610100900460ff1615801561439e576000805460ff1961ff0019909116610100171660011790555b6143a6614831565b61432a6148a4565b61193982826145e4565b600082815260976020526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b60606000614412836002615db7565b61441d906002615d9f565b6001600160401b0381111561444257634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f19166020018201604052801561446c576020820181803683370190505b509050600360fc1b8160008151811061449557634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106144d257634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060006144f6846002615db7565b614501906001615d9f565b90505b6001811115614595576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061454357634e487b7160e01b600052603260045260246000fd5b1a60f81b82828151811061456757634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c9361458e81615e1d565b9050614504565b508315611ad45760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610bb3565b6145ee82826126c8565b6119395760008281526097602090815260408083206001600160a01b03851684529091529020805460ff191660011790556146263390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b803b6146ce5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610bb3565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b6060823b61476e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610bb3565b600080846001600160a01b03168460405161478991906157e0565b600060405180830381855af49150503d80600081146147c4576040519150601f19603f3d011682016040523d82523d6000602084013e6147c9565b606091505b50915091506129f08282604051806060016040528060278152602001615faa60279139614922565b6147fa8161466a565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b600054610100900460ff168061484a575060005460ff16155b6148665760405162461bcd60e51b8152600401610bb390615b85565b600054610100900460ff1615801561432a576000805460ff1961ff0019909116610100171660011790558015611a03576000805461ff001916905550565b600054610100900460ff16806148bd575060005460ff16155b6148d95760405162461bcd60e51b8152600401610bb390615b85565b600054610100900460ff16158015614904576000805460ff1961ff0019909116610100171660011790555b6033805460ff191690558015611a03576000805461ff001916905550565b60608315614931575081611ad4565b8251156149415782518084602001fd5b8160405162461bcd60e51b8152600401610bb39190615940565b604080516102e08101825260008082526020820181905291810182905260608082018390526080820183905260a0820183905260c0820183905260e08201839052610100820183905261012082018390526101408201839052610160820183905261018082018390526101a082018390526101c082018390526101e0820183905261020082018390526102208201839052610240820181905261026082018190526102808201526102a081018290526102c081019190915290565b60006001600160401b03831115614a2f57614a2f615e8c565b614a42601f8401601f1916602001615d24565b9050828152838383011115614a5657600080fd5b828260208301376000602084830101529392505050565b8035610b3d81615ea2565b60008083601f840112614a89578182fd5b5081356001600160401b03811115614a9f578182fd5b6020830191508360208083028501011115614ab957600080fd5b9250929050565b600082601f830112614ad0578081fd5b81356020614ae5614ae083615d54565b615d24565b8281528181019085830183850287018401881015614b01578586fd5b855b85811015614b28578135614b1681615ea2565b84529284019290840190600101614b03565b5090979650505050505050565b600082601f830112614b45578081fd5b81356020614b55614ae083615d54565b8281528181019085830183850287018401881015614b71578586fd5b855b85811015614b2857813584529284019290840190600101614b73565b80356001600160e01b031981168114610b3d57600080fd5b60008083601f840112614bb8578182fd5b5081356001600160401b03811115614bce578182fd5b602083019150836020828501011115614ab957600080fd5b805160058110610b3d57600080fd5b600082601f830112614c05578081fd5b611ad483833560208501614a16565b8035610b3d81615ec5565b8035610b3d81615eda565b600060208284031215614c3b578081fd5b8135611ad481615ea2565b600060208284031215614c57578081fd5b8151611ad481615ea2565b60008060408385031215614c74578081fd5b8235614c7f81615ea2565b91506020830135614c8f81615ea2565b809150509250929050565b60008060008060808587031215614caf578182fd5b8435614cba81615ea2565b93506020850135614cca81615ea2565b92506040850135614cda81615ea2565b91506060850135614cea81615ea2565b939692955090935050565b60008060008060808587031215614d0a578182fd5b8435614d1581615ea2565b93506020850135614d2581615ea2565b92506040850135614d3581615ea2565b9396929550929360600135925050565b600080600060608486031215614d59578081fd5b8335614d6481615ea2565b9250602084013591506040840135614d7b81615ea2565b809150509250925092565b60008060008060008060c08789031215614d9e578384fd5b8635614da981615ea2565b9550602087013594506040870135614dc081615ea2565b9350614dce60608801614b8f565b925060808701359150614de360a08801614b8f565b90509295509295509295565b60008060408385031215614e01578182fd5b8235614e0c81615ea2565b915060208301356001600160401b03811115614e26578182fd5b8301601f81018513614e36578182fd5b614e4585823560208401614a16565b9150509250929050565b60008060408385031215614e61578182fd5b8251614e6c81615ea2565b6020939093015192949293505050565b60008060008060008060608789031215614e94578384fd5b86356001600160401b0380821115614eaa578586fd5b614eb68a838b01614a78565b90985096506020890135915080821115614ece578586fd5b614eda8a838b01614a78565b90965094506040890135915080821115614ef2578384fd5b50614eff89828a01614a78565b979a9699509497509295939492505050565b60008060008060408587031215614f26578182fd5b84356001600160401b0380821115614f3c578384fd5b614f4888838901614a78565b90965094506020870135915080821115614f60578384fd5b50614f6d87828801614a78565b95989497509550505050565b600060208284031215614f8a578081fd5b8135611ad481615eb7565b600060208284031215614fa6578081fd5b8151611ad481615eb7565b600060208284031215614fc2578081fd5b5035919050565b60008060408385031215614fdb578182fd5b823591506020830135614c8f81615ea2565b600080600060608486031215615001578081fd5b83359250602084013561501381615ea2565b929592945050506040919091013590565b60008060408385031215615036578182fd5b823591506020830135614c8f81615eb7565b60008060006060848603121561505c578081fd5b83359250602084013561506e81615eda565b91506040840135614d7b81615ea2565b60008060008060008060c08789031215615096578384fd5b8635955060208701356150a881615eda565b945060408701356150b881615ea2565b9350606087013592506080870135915060a08701356150d681615eb7565b809150509295509295509295565b6000602082840312156150f5578081fd5b611ad482614b8f565b60006020828403121561510f578081fd5b611ad482614be6565b60008060008060008060c08789031215615130578384fd5b86356001600160401b0380821115615146578586fd5b6151528a838b01614bf5565b97506020890135915080821115615167578586fd5b5061517489828a01614bf5565b955050604087013561518581615eda565b9350606087013561519581615ea2565b925060808701356151a581615ea2565b915060a08701356150d681615ea2565b600060c082840312156151c6578081fd5b6151d060c0615d24565b6151d983614be6565b8152602083015160208201526040830151604082015260608301516151fd81615ec5565b60608201526080838101519082015260a083015161521a81615eda565b60a08201529392505050565b600060208284031215615237578081fd5b5051919050565b60008060408385031215615250578182fd5b505080516020909101519092909150565b600080600080600080600080610100898b03121561527d578586fd5b505086359860208801359850604088013597606081013597506080810135965060a0810135955060c0810135945060e0013592509050565b6000602082840312156152c6578081fd5b8135611ad481615eda565b60008060008060008060008060e0898b0312156152ec578182fd5b6152f589614c1f565b97506020890135965060408901356001600160401b0380821115615317578384fd5b6153238c838d01614ba7565b909850965060608b013591508082111561533b578384fd5b6153478c838d01614b35565b955060808b013591508082111561535c578384fd5b6153688c838d01614b35565b945060a08b013591508082111561537d578384fd5b5061538a8b828c01614ac0565b92505061539960c08a01614a6d565b90509295985092959890939650565b600080600080608085870312156153bd578182fd5b84356153c881615eda565b935060208501359250604085013591506060850135614cea81615ea2565b6000806000606084860312156153fa578081fd5b833561540581615eda565b9250602084013561501381615ec5565b6000806000806080858703121561542a578182fd5b843561543581615eda565b9350602085013561544581615ec5565b93969395505050506040820135916060013590565b60008060008060008060008060e0898b031215615475578182fd5b61547e89614c1f565b975061548c60208a01614c14565b965060408901356001600160401b03808211156154a7578384fd5b6154b38c838d01614ba7565b909850965060608b0135955060808b01359150808211156154d2578384fd5b6154de8c838d01614b35565b945060a08b01359150808211156154f3578384fd5b6154ff8c838d01614b35565b935060c08b0135915080821115615514578283fd5b506155218b828c01614ac0565b9150509295985092959890939650565b6000815180845260208085019450808401835b838110156155695781516001600160a01b031687529582019590820190600101615544565b509495945050505050565b6000815180845260208085019450808401835b8381101561556957815187529582019590820190600101615587565b600581106155c157634e487b7160e01b600052602160045260246000fd5b9052565b600081518084526155dd816020860160208601615ded565b601f01601f19169290920160200192915050565b80516001600160a01b0316825260006102e0602083015161561d60208601826001600160401b03169052565b506040830151604085015260608301516060850152608083015161564c60808601826001600160a01b03169052565b5060a083015161566760a08601826001600160a01b03169052565b5060c083015161568260c08601826001600160a01b03169052565b5060e08381015190850152610100808401519085015261012080840151908501526101408084015190850152610160808401519085015261018080840151908501526101a080840151908501526101c0808401516001600160601b031981168287015250506101e0838101516001600160a01b038116868301525050610200838101516001600160601b03198116868301525050610220838101516001600160a01b03811686830152505061024080840151828287015261574583870182615574565b9250505061026080840151858303828701526157618382615574565b92505050610280808401518583038287015261577d8382615531565b925050506102a08084015161579c828701826001600160a01b03169052565b50506102c09283015115159390920192909252919050565b60006bffffffffffffffffffffffff198560601b16825282846014840137910160140190815292915050565b600082516157f2818460208701615ded565b9190910192915050565b600076020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b8252835161582e816017850160208801615ded565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161585f816028840160208801615ded565b01602801949350505050565b60f89390931b6001600160f81b031916835260c09190911b6001600160c01b0319166001830152600982015260290190565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b9182526001600160a01b0316602082015260400190565b600085825260ff851660208301526001600160401b03841660408301526080606083015261593660808301846155f1565b9695505050505050565b600060208252611ad460208301846155c5565b600060a0825261596660a08301886155c5565b828103602084015261597881886155c5565b60ff96909616604084015250506001600160a01b039283166060820152911660809091015292915050565b6020808252601e908201527f616464727320616e6420616d6f756e7473206c656e206d69736d617463680000604082015260600190565b60208082526014908201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604082015260600190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252601f908201527f7374616b654554483a20696e76616c696420746f6b656e206164647265737300604082015260600190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b6020808252818101527f7265736f757263654944206e6f74206d617070656420746f2068616e646c6572604082015260600190565b6020808252602f908201527f4272696467655570677261646561626c653a205768697465206c697374696e6760408201526e081a5cc81b9bdd08195b98589b1959608a1b606082015260800190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252601a908201527f61646472657373206973206e6f742077686974656c6973746564000000000000604082015260600190565b6020808252818101527f7374616b654554483a20696e636f727265637420776574682061646472657373604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b600060408252615c8960408301856155f1565b90508260208301529392505050565b600060c082019050615cab8284516155a3565b60208301516020830152604083015160408301526001600160401b0360608401511660608301526080830151608083015260ff60a08401511660a083015292915050565b60ff851681526001600160401b038416602082015260808101615d1560408301856155a3565b82606083015295945050505050565b604051601f8201601f191681016001600160401b0381118282101715615d4c57615d4c615e8c565b604052919050565b60006001600160401b03821115615d6d57615d6d615e8c565b5060209081020190565b60008085851115615d86578182fd5b83861115615d92578182fd5b5050820193919092039150565b60008219821115615db257615db2615e76565b500190565b6000816000190483118215151615615dd157615dd1615e76565b500290565b600082821015615de857615de8615e76565b500390565b60005b83811015615e08578181015183820152602001615df0565b83811115615e17576000848401525b50505050565b600081615e2c57615e2c615e76565b506000190190565b6000600019821415615e4857615e48615e76565b5060010190565b60006001600160401b0380831681811415615e6c57615e6c615e76565b6001019392505050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114611a0357600080fd5b8015158114611a0357600080fd5b6001600160401b0381168114611a0357600080fd5b60ff81168114611a0357600080fdfee6ad9a47fbda1dc18de1eb5eeb7d935e5e81b4748f3cfc61e233e64f881820608b9e7a9f25b0aca3f51c01b8fee30790fb16f4d4deded8385ae6643d054bb078bf233dd2aafeb4d50879c4aa5c81e96d92f6e6945c906a58f9f2d1c1631b4b26968626a768e76ba1363efe44e322a6c4900c5f084e0b45f35e294dfddaa9e0d5e2b7fb3b832174769106daebcfd6d1970523240dda11281102db9363b83b0dc465d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a164736f6c6343000802000a

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading