MOVR Price: $21.71 (+0.21%)
Gas: 1 GWei

Contract

0x93f220D3e997D21D423687cBCa5874a7EAbEbE8B

Overview

MOVR Balance

Moonriver Chain LogoMoonriver Chain LogoMoonriver Chain Logo0 MOVR

MOVR Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
0x6080604014628282022-02-09 14:37:18778 days ago1644417438IN
 Create: Ledger
0 MOVR0.005512793

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Ledger

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 12 : Ledger.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
pragma abicoder v2;

import "IERC20.sol";
import "SafeCast.sol";

import "IOracleMaster.sol";
import "ILido.sol";
import "IAuthManager.sol";
import "IRelayEncoder.sol";
import "IXcmTransactor.sol";
import "IController.sol";
import "Types.sol";

import "LedgerUtils.sol";
import "ReportUtils.sol";



contract Ledger {
    using LedgerUtils for Types.OracleData;
    using SafeCast for uint256;

    event DownwardComplete(uint128 amount);
    event UpwardComplete(uint128 amount);
    event Rewards(uint128 amount, uint128 balance);
    event Slash(uint128 amount, uint128 balance);

    // Lido main contract address
    ILido public LIDO;

    // vKSM precompile
    IERC20 internal VKSM;

    // controller for sending xcm messages to relay chain
    IController internal CONTROLLER;

    // ledger stash account
    bytes32 public stashAccount;

    // ledger controller account
    bytes32 public controllerAccount;

    // Stash balance that includes locked (bounded in stake) and free to transfer balance
    uint128 public totalBalance;

    // Locked, or bonded in stake module, balance
    uint128 public lockedBalance;

    // last reported active ledger balance
    uint128 public activeBalance;

    // last reported ledger status
    Types.LedgerStatus public status;

    // Cached stash balance. Need to calculate rewards between successfull up/down transfers
    uint128 public cachedTotalBalance;

    // Pending transfers
    uint128 public transferUpwardBalance;
    uint128 public transferDownwardBalance;

    // Pending bonding
    uint128 public pendingBonds;

    // Minimal allowed balance to being a nominator
    uint128 public MIN_NOMINATOR_BALANCE;

    // Minimal allowable active balance
    uint128 public MINIMUM_BALANCE;

    // Ledger manager role
    bytes32 internal constant ROLE_LEDGER_MANAGER = keccak256("ROLE_LEDGER_MANAGER");

    // Maximum allowable unlocking chunks amount
    uint256 public MAX_UNLOCKING_CHUNKS;

    // Allows function calls only from LIDO
    modifier onlyLido() {
        require(msg.sender == address(LIDO), "LEDGER: NOT_LIDO");
        _;
    }

    // Allows function calls only from Oracle
    modifier onlyOracle() {
        address oracle = IOracleMaster(ILido(LIDO).ORACLE_MASTER()).getOracle(address(this));
        require(msg.sender == oracle, "LEDGER: NOT_ORACLE");
        _;
    }

    // Allows function calls only from member with specific role
    modifier auth(bytes32 role) {
        require(IAuthManager(ILido(LIDO).AUTH_MANAGER()).has(role, msg.sender), "LEDGER: UNAUTHOROZED");
        _;
    }

    /**
    * @notice Initialize ledger contract.
    * @param _stashAccount - stash account id
    * @param _controllerAccount - controller account id
    * @param _vKSM - vKSM contract address
    * @param _controller - xcmTransactor(relaychain calls relayer) contract address
    * @param _minNominatorBalance - minimal allowed nominator balance
    * @param _lido - LIDO address
    * @param _minimumBalance - minimal allowed active balance for ledger
    * @param _maxUnlockingChunks - maximum amount of unlocking chunks
    */
    function initialize(
        bytes32 _stashAccount,
        bytes32 _controllerAccount,
        address _vKSM,
        address _controller,
        uint128 _minNominatorBalance,
        address _lido,
        uint128 _minimumBalance,
        uint256 _maxUnlockingChunks
    ) external {
        require(_vKSM != address(0), "LEDGER: INCORRECT_VKSM");
        require(address(VKSM) == address(0), "LEDGER: ALREADY_INITIALIZED");

        // The owner of the funds
        stashAccount = _stashAccount;
        // The account which handles bounded part of stash funds (unbond, rebond, withdraw, nominate)
        controllerAccount = _controllerAccount;

        status = Types.LedgerStatus.None;

        LIDO = ILido(_lido);

        VKSM = IERC20(_vKSM);

        CONTROLLER = IController(_controller);

        MIN_NOMINATOR_BALANCE = _minNominatorBalance;

        MINIMUM_BALANCE = _minimumBalance;
        
        MAX_UNLOCKING_CHUNKS = _maxUnlockingChunks;
    }

    /**
    * @notice Set new minimal allowed nominator balance and minimal active balance, allowed to call only by lido contract
    * @dev That method designed to be called by lido contract when relay spec is changed
    * @param _minNominatorBalance - minimal allowed nominator balance
    * @param _minimumBalance - minimal allowed ledger active balance
    * @param _maxUnlockingChunks - maximum amount of unlocking chunks
    */
    function setRelaySpecs(uint128 _minNominatorBalance, uint128 _minimumBalance, uint256 _maxUnlockingChunks) external onlyLido {
        MIN_NOMINATOR_BALANCE = _minNominatorBalance;
        MINIMUM_BALANCE = _minimumBalance;
        MAX_UNLOCKING_CHUNKS = _maxUnlockingChunks;
    }

    /**
    * @notice Refresh allowances for ledger
    */
    function refreshAllowances() external auth(ROLE_LEDGER_MANAGER) {
        VKSM.approve(address(LIDO), type(uint256).max);
        VKSM.approve(address(CONTROLLER), type(uint256).max);
    }

    /**
    * @notice Return target stake amount for this ledger
    * @return target stake amount
    */
    function ledgerStake() public view returns (uint256) {
        return LIDO.ledgerStake(address(this));
    }

    /**
    * @notice Return true if ledger doesn't have any funds
    */
    function isEmpty() external view returns (bool) {
        return totalBalance == 0 && transferUpwardBalance == 0 && transferDownwardBalance == 0;
    }

    /**
    * @notice Nominate on behalf of this ledger, allowed to call only by lido contract
    * @dev Method spawns xcm call to relaychain.
    * @param _validators - array of choosen validator to be nominated
    */
    function nominate(bytes32[] calldata _validators) external onlyLido {
        require(activeBalance >= MIN_NOMINATOR_BALANCE, "LEDGER: NOT_ENOUGH_STAKE");
        CONTROLLER.nominate(_validators);
    }

    /**
    * @notice Provide portion of relaychain data about current ledger, allowed to call only by oracle contract
    * @dev Basically, ledger can obtain data from any source, but for now it allowed to recieve only from oracle.
           Method perform calculation of current state based on report data and saved state and expose
           required instructions(relaychain pallet calls) via xcm to adjust bonded amount to required target stake.
    * @param _eraId - reporting era id
    * @param _report - data that represent state of ledger on relaychain for `_eraId`
    */
    function pushData(uint64 _eraId, Types.OracleData memory _report) external onlyOracle {
        require(stashAccount == _report.stashAccount, "LEDGER: STASH_ACCOUNT_MISMATCH");

        status = _report.stakeStatus;
        activeBalance = _report.activeBalance;

        (uint128 unlockingBalance, uint128 withdrawableBalance) = _report.getTotalUnlocking(_eraId);
        uint128 nonWithdrawableBalance = unlockingBalance - withdrawableBalance;

        if (!_processRelayTransfers(_report)) {
            return;
        }
        uint128 _cachedTotalBalance = cachedTotalBalance;
        
        if (cachedTotalBalance > 0) {
            uint128 relativeDifference = _report.stashBalance > cachedTotalBalance ? 
                _report.stashBalance - cachedTotalBalance :
                cachedTotalBalance - _report.stashBalance;
            // NOTE: 1 / 10000 - one base point
            relativeDifference = relativeDifference * 10000 / cachedTotalBalance;
            require(relativeDifference < LIDO.MAX_ALLOWABLE_DIFFERENCE(), "LEDGER: DIFFERENCE_EXCEEDS_BALANCE");
        }

        if (_cachedTotalBalance < _report.stashBalance) { // if cached balance > real => we have reward
            uint128 reward = _report.stashBalance - _cachedTotalBalance;
            LIDO.distributeRewards(reward, _report.stashBalance);

            emit Rewards(reward, _report.stashBalance);
        }
        else if (_cachedTotalBalance > _report.stashBalance) {
            uint128 slash = _cachedTotalBalance - _report.stashBalance;
            LIDO.distributeLosses(slash, _report.stashBalance);

            emit Slash(slash, _report.stashBalance);
        }

        uint128 _ledgerStake = ledgerStake().toUint128();

        // relay deficit or bonding
        if (_report.stashBalance <= _ledgerStake) {
            //    Staking strategy:
            //     - upward transfer deficit tokens
            //     - rebond all unlocking tokens
            //     - bond_extra all free balance

            uint128 deficit = _ledgerStake - _report.stashBalance;

            // just upward transfer if we have deficit
            if (deficit > 0) {
                LIDO.transferToLedger(deficit);
                CONTROLLER.transferToRelaychain(deficit);
                transferUpwardBalance += deficit;
            }

            // rebond all always
            if (unlockingBalance > 0) {
                // NOTE: we always should pass maximum length and pallet return unused weight
                CONTROLLER.rebond(unlockingBalance, MAX_UNLOCKING_CHUNKS);
            }

            uint128 relayFreeBalance = _report.getFreeBalance();
            if ((relayFreeBalance == transferUpwardBalance) && (transferUpwardBalance > 0)) {
                // In case if bond amount = transferUpwardBalance we can't distinguish 2 messages were success or 2 masseges were failed
                relayFreeBalance -= 1;
            }

            pendingBonds = 0;
            
            if (relayFreeBalance > 0 &&
                (_report.stakeStatus == Types.LedgerStatus.Nominator || _report.stakeStatus == Types.LedgerStatus.Idle)) {
                CONTROLLER.bondExtra(relayFreeBalance);
                pendingBonds = relayFreeBalance;
            } else if (_report.stakeStatus == Types.LedgerStatus.None && relayFreeBalance >= MIN_NOMINATOR_BALANCE) {
                CONTROLLER.bond(controllerAccount, relayFreeBalance);
                pendingBonds = relayFreeBalance;
            }
        }
        else if (_report.stashBalance > _ledgerStake) { // parachain deficit
            //    Unstaking strategy:
            //     - try to downward transfer already free balance
            //     - if we still have deficit try to withdraw already unlocked tokens
            //     - if we still have deficit initiate unbond for remain deficit

            // if ledger is in the deadpool we need to put it to chill
            if (_ledgerStake < MIN_NOMINATOR_BALANCE && status != Types.LedgerStatus.Idle) {
                CONTROLLER.chill();
            }

            uint128 deficit = _report.stashBalance - _ledgerStake;
            uint128 relayFreeBalance = _report.getFreeBalance();

            // need to downward transfer if we have some free
            if (relayFreeBalance > 0) {
                uint128 forTransfer = relayFreeBalance > deficit ? deficit : relayFreeBalance;
                CONTROLLER.transferToParachain(forTransfer);
                transferDownwardBalance += forTransfer;
                deficit -= forTransfer;
                relayFreeBalance -= forTransfer;
            }

            // withdraw if we have some unlocked
            if (deficit > 0 && withdrawableBalance > 0) {
                uint32 slashSpans = 0;
                if ((_report.unlocking.length == 0) && (_report.activeBalance <= MINIMUM_BALANCE)) {
                    slashSpans = _report.slashingSpans;
                }
                CONTROLLER.withdrawUnbonded(slashSpans);
                deficit -= withdrawableBalance > deficit ? deficit : withdrawableBalance;
            }

            // need to unbond if we still have deficit
            if (nonWithdrawableBalance < deficit) {
                // NOTE: if ledger.active - forUnbond < min_balance => all active balance would be unbonded
                // https://github.com/paritytech/substrate/blob/master/frame/staking/src/pallet/mod.rs#L858
                uint128 forUnbond = deficit - nonWithdrawableBalance;
                CONTROLLER.unbond(forUnbond);
            }

            // bond all remain free balance
            if (relayFreeBalance > 0) {
                CONTROLLER.bondExtra(relayFreeBalance);
            }
        }

        cachedTotalBalance = _report.stashBalance;
    }

    /**
    * @notice Await for all transfers from/to relay chain
    * @param _report - data that represent state of ledger on relaychain
    */
    function _processRelayTransfers(Types.OracleData memory _report) internal returns(bool) {
        // wait for the downward transfer to complete
        uint128 _transferDownwardBalance = transferDownwardBalance;
        if (_transferDownwardBalance > 0) {
            uint128 totalDownwardTransferred = uint128(VKSM.balanceOf(address(this)));

            if (totalDownwardTransferred >= _transferDownwardBalance ) {
                // send all funds to lido
                LIDO.transferFromLedger(totalDownwardTransferred);

                // Clear transfer flag
                cachedTotalBalance -= _transferDownwardBalance;
                transferDownwardBalance = 0;

                emit DownwardComplete(_transferDownwardBalance);
                _transferDownwardBalance = 0;
            }
        }

        // wait for the upward transfer to complete
        uint128 _transferUpwardBalance = transferUpwardBalance;
        if (_transferUpwardBalance > 0) {
            // NOTE: pending Bonds allows to control balance which was bonded in previous era, but not in lockedBalance yet
            // (see single_ledger_test:test_equal_deposit_bond)
            uint128 ledgerFreeBalance = (totalBalance - lockedBalance);
            int128 freeBalanceDiff = int128(_report.getFreeBalance()) - int128(ledgerFreeBalance);
            int128 expectedBalanceDiff = int128(transferUpwardBalance) - int128(pendingBonds);

            if (freeBalanceDiff >= expectedBalanceDiff) {
                cachedTotalBalance += _transferUpwardBalance;

                transferUpwardBalance = 0;
                // pendingBonds = 0;
                emit UpwardComplete(_transferUpwardBalance);
                _transferUpwardBalance = 0;
            }
        }

        if (_transferDownwardBalance == 0 && _transferUpwardBalance == 0) {
            // update ledger data from oracle report
            totalBalance = _report.stashBalance;
            lockedBalance = _report.totalBalance;
            return true;
        }

        return false;
    }
}

File 2 of 12 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

File 3 of 12 : SafeCast.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow
 * checks.
 *
 * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can
 * easily result in undesired exploitation or bugs, since developers usually
 * assume that overflows raise errors. `SafeCast` restores this intuition by
 * reverting the transaction when such an operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 *
 * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing
 * all math on `uint256` and `int256` and then downcasting.
 */
library SafeCast {
    /**
     * @dev Returns the downcasted uint128 from uint256, reverting on
     * overflow (when the input is greater than largest uint128).
     *
     * Counterpart to Solidity's `uint128` operator.
     *
     * Requirements:
     *
     * - input must fit into 128 bits
     */
    function toUint128(uint256 value) internal pure returns (uint128) {
        require(value < 2**128, "SafeCast: value doesn\'t fit in 128 bits");
        return uint128(value);
    }

    /**
     * @dev Returns the downcasted uint64 from uint256, reverting on
     * overflow (when the input is greater than largest uint64).
     *
     * Counterpart to Solidity's `uint64` operator.
     *
     * Requirements:
     *
     * - input must fit into 64 bits
     */
    function toUint64(uint256 value) internal pure returns (uint64) {
        require(value < 2**64, "SafeCast: value doesn\'t fit in 64 bits");
        return uint64(value);
    }

    /**
     * @dev Returns the downcasted uint32 from uint256, reverting on
     * overflow (when the input is greater than largest uint32).
     *
     * Counterpart to Solidity's `uint32` operator.
     *
     * Requirements:
     *
     * - input must fit into 32 bits
     */
    function toUint32(uint256 value) internal pure returns (uint32) {
        require(value < 2**32, "SafeCast: value doesn\'t fit in 32 bits");
        return uint32(value);
    }

    /**
     * @dev Returns the downcasted uint16 from uint256, reverting on
     * overflow (when the input is greater than largest uint16).
     *
     * Counterpart to Solidity's `uint16` operator.
     *
     * Requirements:
     *
     * - input must fit into 16 bits
     */
    function toUint16(uint256 value) internal pure returns (uint16) {
        require(value < 2**16, "SafeCast: value doesn\'t fit in 16 bits");
        return uint16(value);
    }

    /**
     * @dev Returns the downcasted uint8 from uint256, reverting on
     * overflow (when the input is greater than largest uint8).
     *
     * Counterpart to Solidity's `uint8` operator.
     *
     * Requirements:
     *
     * - input must fit into 8 bits.
     */
    function toUint8(uint256 value) internal pure returns (uint8) {
        require(value < 2**8, "SafeCast: value doesn\'t fit in 8 bits");
        return uint8(value);
    }

    /**
     * @dev Converts a signed int256 into an unsigned uint256.
     *
     * Requirements:
     *
     * - input must be greater than or equal to 0.
     */
    function toUint256(int256 value) internal pure returns (uint256) {
        require(value >= 0, "SafeCast: value must be positive");
        return uint256(value);
    }

    /**
     * @dev Returns the downcasted int128 from int256, reverting on
     * overflow (when the input is less than smallest int128 or
     * greater than largest int128).
     *
     * Counterpart to Solidity's `int128` operator.
     *
     * Requirements:
     *
     * - input must fit into 128 bits
     *
     * _Available since v3.1._
     */
    function toInt128(int256 value) internal pure returns (int128) {
        require(value >= -2**127 && value < 2**127, "SafeCast: value doesn\'t fit in 128 bits");
        return int128(value);
    }

    /**
     * @dev Returns the downcasted int64 from int256, reverting on
     * overflow (when the input is less than smallest int64 or
     * greater than largest int64).
     *
     * Counterpart to Solidity's `int64` operator.
     *
     * Requirements:
     *
     * - input must fit into 64 bits
     *
     * _Available since v3.1._
     */
    function toInt64(int256 value) internal pure returns (int64) {
        require(value >= -2**63 && value < 2**63, "SafeCast: value doesn\'t fit in 64 bits");
        return int64(value);
    }

    /**
     * @dev Returns the downcasted int32 from int256, reverting on
     * overflow (when the input is less than smallest int32 or
     * greater than largest int32).
     *
     * Counterpart to Solidity's `int32` operator.
     *
     * Requirements:
     *
     * - input must fit into 32 bits
     *
     * _Available since v3.1._
     */
    function toInt32(int256 value) internal pure returns (int32) {
        require(value >= -2**31 && value < 2**31, "SafeCast: value doesn\'t fit in 32 bits");
        return int32(value);
    }

    /**
     * @dev Returns the downcasted int16 from int256, reverting on
     * overflow (when the input is less than smallest int16 or
     * greater than largest int16).
     *
     * Counterpart to Solidity's `int16` operator.
     *
     * Requirements:
     *
     * - input must fit into 16 bits
     *
     * _Available since v3.1._
     */
    function toInt16(int256 value) internal pure returns (int16) {
        require(value >= -2**15 && value < 2**15, "SafeCast: value doesn\'t fit in 16 bits");
        return int16(value);
    }

    /**
     * @dev Returns the downcasted int8 from int256, reverting on
     * overflow (when the input is less than smallest int8 or
     * greater than largest int8).
     *
     * Counterpart to Solidity's `int8` operator.
     *
     * Requirements:
     *
     * - input must fit into 8 bits.
     *
     * _Available since v3.1._
     */
    function toInt8(int256 value) internal pure returns (int8) {
        require(value >= -2**7 && value < 2**7, "SafeCast: value doesn\'t fit in 8 bits");
        return int8(value);
    }

    /**
     * @dev Converts an unsigned uint256 into a signed int256.
     *
     * Requirements:
     *
     * - input must be less than or equal to maxInt256.
     */
    function toInt256(uint256 value) internal pure returns (int256) {
        require(value < 2**255, "SafeCast: value doesn't fit in an int256");
        return int256(value);
    }
}

File 4 of 12 : IOracleMaster.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IOracleMaster {
    function addLedger(address ledger) external;

    function removeLedger(address ledger) external;

    function getOracle(address ledger) view external returns (address);

    function eraId() view external returns (uint64);

    function setLido(address lido) external;
}

File 5 of 12 : ILido.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "Types.sol";

interface ILido {
    function MAX_ALLOWABLE_DIFFERENCE() external view returns(uint128);

    function developers() external view returns(address);

    function deposit(uint256 amount) external returns (uint256);
    
    function distributeRewards(uint256 totalRewards, uint256 ledgerBalance) external;

    function distributeLosses(uint256 totalLosses, uint256 ledgerBalance) external;

    function getStashAccounts() external view returns (bytes32[] memory);

    function getLedgerAddresses() external view returns (address[] memory);

    function ledgerStake(address ledger) external view returns (uint256);

    function ledgerShares(address ledger) external view returns (uint256);

    function avaliableForStake() external view returns (uint256);

    function transferFromLedger(uint256 amount) external;

    function transferToLedger(uint256 amount) external;

    function flushStakes() external;

    function findLedger(bytes32 stash) external view returns (address);

    function AUTH_MANAGER() external returns(address);

    function ORACLE_MASTER() external view returns (address);

    function getPooledKSMByShares(uint256 sharesAmount) external view returns (uint256);

    function getSharesByPooledKSM(uint256 amount) external view returns (uint256);

    function transfer(address recipient, uint256 amount) external returns (bool);

    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
}

File 6 of 12 : Types.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface Types {
    struct Fee{
        uint16 total;
        uint16 operators;
        uint16 developers;
        uint16 treasury;
    }

    struct Stash {
        bytes32 stashAccount;
        uint64  eraId;
    }

    enum LedgerStatus {
        // bonded but not participate in staking
        Idle,
        // participate as nominator
        Nominator,
        // participate as validator
        Validator,
        // not bonded not participate in staking
        None
    }

    struct UnlockingChunk {
        uint128 balance;
        uint64 era;
    }

    struct OracleData {
        bytes32 stashAccount;
        bytes32 controllerAccount;
        LedgerStatus stakeStatus;
        // active part of stash balance
        uint128 activeBalance;
        // locked for stake stash balance.
        uint128 totalBalance;
        // totalBalance = activeBalance + sum(unlocked.balance)
        UnlockingChunk[] unlocking;
        uint32[] claimedRewards;
        // stash account balance. It includes locked (totalBalance) balance assigned
        // to a controller.
        uint128 stashBalance;
        // slashing spans for ledger
        uint32 slashingSpans;
    }

    struct RelaySpec {
        uint16 maxValidatorsPerLedger;
        uint128 minNominatorBalance;
        uint128 ledgerMinimumActiveBalance;
        uint256 maxUnlockingChunks;
    }
}

File 7 of 12 : IAuthManager.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IAuthManager {
    function has(bytes32 role, address member) external view returns (bool);

    function add(bytes32 role, address member) external;

    function remove(bytes32 role, address member) external;
}

File 8 of 12 : IRelayEncoder.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/// @author The Moonbeam Team
/// @title The interface through which solidity contracts will interact with Relay Encoder
/// We follow this same interface including four-byte function selectors, in the precompile that
/// wraps the pallet
interface IRelayEncoder {
    // dev Encode 'bond' relay call
    // Selector: 31627376
    // @param controller_address: Address of the controller
    // @param amount: The amount to bond
    // @param reward_destination: the account that should receive the reward
    // @returns The bytes associated with the encoded call
    function encode_bond(uint256 controller_address, uint256 amount, bytes memory reward_destination) external pure returns (bytes memory result);

    // dev Encode 'bond_extra' relay call
    // Selector: 49def326
    // @param amount: The extra amount to bond
    // @returns The bytes associated with the encoded call
    function encode_bond_extra(uint256 amount) external pure returns (bytes memory result);

    // dev Encode 'unbond' relay call
    // Selector: bc4b2187
    // @param amount: The amount to unbond
    // @returns The bytes associated with the encoded call
    function encode_unbond(uint256 amount) external pure returns (bytes memory result);

    // dev Encode 'withdraw_unbonded' relay call
    // Selector: 2d220331
    // @param slashes: Weight hint, number of slashing spans
    // @returns The bytes associated with the encoded call
    function encode_withdraw_unbonded(uint32 slashes) external pure returns (bytes memory result);

    // dev Encode 'validate' relay call
    // Selector: 3a0d803a
    // @param comission: Comission of the validator as parts_per_billion
    // @param blocked: Whether or not the validator is accepting more nominations
    // @returns The bytes associated with the encoded call
    // selector: 3a0d803a
    function encode_validate(uint256 comission, bool blocked) external pure returns (bytes memory result);

    // dev Encode 'nominate' relay call
    // Selector: a7cb124b
    // @param nominees: An array of AccountIds corresponding to the accounts we will nominate
    // @param blocked: Whether or not the validator is accepting more nominations
    // @returns The bytes associated with the encoded call
    function encode_nominate(uint256 [] memory nominees) external pure returns (bytes memory result);

    // dev Encode 'chill' relay call
    // Selector: bc4b2187
    // @returns The bytes associated with the encoded call
    function encode_chill() external pure returns (bytes memory result);

    // dev Encode 'set_payee' relay call
    // Selector: 9801b147
    // @param reward_destination: the account that should receive the reward
    // @returns The bytes associated with the encoded call
    function encode_set_payee(bytes memory reward_destination) external pure returns (bytes memory result);

    // dev Encode 'set_controller' relay call
    // Selector: 7a8f48c2
    // @param controller: The controller address
    // @returns The bytes associated with the encoded call
    function encode_set_controller(uint256 controller) external pure returns (bytes memory result);

    // dev Encode 'rebond' relay call
    // Selector: add6b3bf
    // @param amount: The amount to rebond
    // @returns The bytes associated with the encoded call
    function encode_rebond(uint256 amount) external pure returns (bytes memory result);
}

File 9 of 12 : IXcmTransactor.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/**
 * @title Xcm Transactor Interface
 *
 * The interface through which solidity contracts will interact with xcm transactor pallet
 *
 */
interface IXcmTransactor {
    // A multilocation is defined by its number of parents and the encoded junctions (interior)
    struct Multilocation {
        uint8 parents;
        bytes [] interior;
    }

    /** Get index of an account in xcm transactor
     *
     * @param index The index of which we want to retrieve the account
     */
    function index_to_account(uint16 index) external view returns(address);

    /** Get transact info of a multilocation
     * Selector 71b0edfa
     * @param multilocation The location for which we want to retrieve transact info
     */
    function transact_info(Multilocation memory multilocation)
        external view  returns(uint64, uint256, uint64, uint64, uint256);

    /** Transact through XCM using fee based on its multilocation
     *
     * @dev The token transfer burns/transfers the corresponding amount before sending
     * @param transactor The transactor to be used
     * @param index The index to be used
     * @param fee_asset The asset in which we want to pay fees.
     * It has to be a reserve of the destination chain
     * @param weight The weight we want to buy in the destination chain
     * @param inner_call The inner call to be executed in the destination chain
     */
    function transact_through_derivative_multilocation(
        uint8 transactor,
        uint16 index,
        Multilocation memory fee_asset,
        uint64 weight,
        bytes memory inner_call
    ) external;

    /** Transact through XCM using fee based on its currency_id
     *
     * @dev The token transfer burns/transfers the corresponding amount before sending
     * @param transactor The transactor to be used
     * @param index The index to be used
     * @param currency_id Address of the currencyId of the asset to be used for fees
     * It has to be a reserve of the destination chain
     * @param weight The weight we want to buy in the destination chain
     * @param inner_call The inner call to be executed in the destination chain
     */
    function transact_through_derivative(
        uint8 transactor,
        uint16 index,
        address currency_id,
        uint64 weight,
        bytes memory inner_call
    ) external;
}

File 10 of 12 : IController.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;


interface IController {
    function newSubAccount(uint16 index, bytes32 accountId, address paraAddress) external;

    function deleteSubAccount(address paraAddress) external;

    function nominate(bytes32[] calldata _validators) external;

    function bond(bytes32 controller, uint256 amount) external;

    function bondExtra(uint256 amount) external;

    function unbond(uint256 amount) external;

    function withdrawUnbonded(uint32 slashingSpans) external;

    function rebond(uint256 amount, uint256 unbondingChunks) external;

    function chill() external;

    function transferToParachain(uint256 amount) external;

    function transferToRelaychain(uint256 amount) external;
}

File 11 of 12 : LedgerUtils.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "Types.sol";


library LedgerUtils {
    /// @notice Return unlocking and withdrawable balances
    function getTotalUnlocking(Types.OracleData memory report, uint64 _eraId) internal pure returns (uint128, uint128) {
        uint128 _total = 0;
        uint128 _withdrawble = 0;
        for (uint i = 0; i < report.unlocking.length; i++) {
            _total += report.unlocking[i].balance;
            if (report.unlocking[i].era <= _eraId) {
                _withdrawble += report.unlocking[i].balance;
            }
        }
        return (_total, _withdrawble);
    }
    /// @notice Return stash balance that can be freely transfer or allocated for stake
    function getFreeBalance(Types.OracleData memory report) internal pure returns (uint128) {
        return report.stashBalance - report.totalBalance;
    }

    /// @notice Return true if report is consistent
    function isConsistent(Types.OracleData memory report) internal pure returns (bool) {
        (uint128 _total,) = getTotalUnlocking(report, 0);
        return report.unlocking.length < type(uint8).max
            && report.totalBalance == (report.activeBalance + _total)
            && report.stashBalance >= report.totalBalance;
    }
}

File 12 of 12 : ReportUtils.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;


library ReportUtils {
    // last bytes used to count votes
    uint256 constant internal COUNT_OUTMASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00;

    /// @notice Check if the given reports are different, not considering the counter of the first
    function isDifferent(uint256 value, uint256 that) internal pure returns (bool) {
        return (value & COUNT_OUTMASK) != that;
    }

    /// @notice Return the total number of votes recorded for the variant
    function getCount(uint256 value) internal pure returns (uint8) {
        return uint8(value);
    }
}

Settings
{
  "evmVersion": "istanbul",
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "libraries": {
    "Ledger.sol": {}
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint128","name":"amount","type":"uint128"}],"name":"DownwardComplete","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint128","name":"amount","type":"uint128"},{"indexed":false,"internalType":"uint128","name":"balance","type":"uint128"}],"name":"Rewards","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint128","name":"amount","type":"uint128"},{"indexed":false,"internalType":"uint128","name":"balance","type":"uint128"}],"name":"Slash","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint128","name":"amount","type":"uint128"}],"name":"UpwardComplete","type":"event"},{"inputs":[],"name":"LIDO","outputs":[{"internalType":"contract ILido","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_UNLOCKING_CHUNKS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINIMUM_BALANCE","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIN_NOMINATOR_BALANCE","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"activeBalance","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cachedTotalBalance","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"controllerAccount","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_stashAccount","type":"bytes32"},{"internalType":"bytes32","name":"_controllerAccount","type":"bytes32"},{"internalType":"address","name":"_vKSM","type":"address"},{"internalType":"address","name":"_controller","type":"address"},{"internalType":"uint128","name":"_minNominatorBalance","type":"uint128"},{"internalType":"address","name":"_lido","type":"address"},{"internalType":"uint128","name":"_minimumBalance","type":"uint128"},{"internalType":"uint256","name":"_maxUnlockingChunks","type":"uint256"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"isEmpty","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ledgerStake","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lockedBalance","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"_validators","type":"bytes32[]"}],"name":"nominate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pendingBonds","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"_eraId","type":"uint64"},{"components":[{"internalType":"bytes32","name":"stashAccount","type":"bytes32"},{"internalType":"bytes32","name":"controllerAccount","type":"bytes32"},{"internalType":"enum Types.LedgerStatus","name":"stakeStatus","type":"uint8"},{"internalType":"uint128","name":"activeBalance","type":"uint128"},{"internalType":"uint128","name":"totalBalance","type":"uint128"},{"components":[{"internalType":"uint128","name":"balance","type":"uint128"},{"internalType":"uint64","name":"era","type":"uint64"}],"internalType":"struct Types.UnlockingChunk[]","name":"unlocking","type":"tuple[]"},{"internalType":"uint32[]","name":"claimedRewards","type":"uint32[]"},{"internalType":"uint128","name":"stashBalance","type":"uint128"},{"internalType":"uint32","name":"slashingSpans","type":"uint32"}],"internalType":"struct Types.OracleData","name":"_report","type":"tuple"}],"name":"pushData","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"refreshAllowances","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint128","name":"_minNominatorBalance","type":"uint128"},{"internalType":"uint128","name":"_minimumBalance","type":"uint128"},{"internalType":"uint256","name":"_maxUnlockingChunks","type":"uint256"}],"name":"setRelaySpecs","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stashAccount","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"status","outputs":[{"internalType":"enum Types.LedgerStatus","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalBalance","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"transferDownwardBalance","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"transferUpwardBalance","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b506121da806100206000396000f3fe608060405234801561001057600080fd5b50600436106101375760003560e01c806368d52c77116100b8578063a5baabf01161007c578063a5baabf0146102ae578063ab28c935146102c1578063ad7a672f146102ca578063c80f3882146102dd578063d70477a6146102f0578063f5330e96146102f857600080fd5b806368d52c77146102295780637b80889b1461023c57806382d59f16146102565780638b21f170146102695780639ca8bddc1461029457600080fd5b80633113a1a6116100ff5780633113a1a6146101c2578063454ea647146101d5578063489ebdd5146101ef57806353498cdd146101f7578063681fe70c1461021157600080fd5b806308998c931461013c5780630ab306a01461016c57806311b5aede14610181578063200d2ed214610198578063231aebf2146101b9575b600080fd5b60065461014f906001600160801b031681565b6040516001600160801b0390911681526020015b60405180910390f35b61017f61017a366004611cf7565b61030b565b005b61018a60045481565b604051908152602001610163565b6006546101ac90600160801b900460ff1681565b6040516101639190611e1e565b61018a60035481565b60075461014f906001600160801b031681565b60075461014f90600160801b90046001600160801b031681565b61017f611095565b60095461014f90600160801b90046001600160801b031681565b610219611316565b6040519015158152602001610163565b60095461014f906001600160801b031681565b60055461014f90600160801b90046001600160801b031681565b61017f610264366004611e46565b61135c565b60005461027c906001600160a01b031681565b6040516001600160a01b039091168152602001610163565b60085461014f90600160801b90046001600160801b031681565b60085461014f906001600160801b031681565b61018a600a5481565b60055461014f906001600160801b031681565b61017f6102eb366004611e9c565b6113c7565b61018a6114eb565b61017f610306366004611f2a565b611567565b60008060009054906101000a90046001600160a01b03166001600160a01b0316633fd2c16a6040518163ffffffff1660e01b815260040160206040518083038186803b15801561035a57600080fd5b505afa15801561036e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103929190611f9f565b604051630869e91760e11b81523060048201526001600160a01b0391909116906310d3d22e9060240160206040518083038186803b1580156103d357600080fd5b505afa1580156103e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040b9190611f9f565b9050336001600160a01b0382161461045f5760405162461bcd60e51b81526020600482015260126024820152714c45444745523a204e4f545f4f5241434c4560701b60448201526064015b60405180910390fd5b8151600354146104b15760405162461bcd60e51b815260206004820152601e60248201527f4c45444745523a2053544153485f4143434f554e545f4d49534d4154434800006044820152606401610456565b60408201516006805460ff60801b1916600160801b8360038111156104d8576104d8611e08565b02179055506060820151600680546001600160801b0319166001600160801b0390921691909117905560008061050e848661167d565b9092509050600061051f8284611fd9565b905061052a8561174c565b61053657505050505050565b6007546001600160801b031680156106b85760075460e08701516000916001600160801b039081169116116105855760e087015160075461058091906001600160801b0316611fd9565b6105a0565b60075460e08801516105a0916001600160801b031690611fd9565b6007549091506001600160801b03166105bb82612710612001565b6105c59190612030565b905060008054906101000a90046001600160a01b03166001600160a01b0316636a92b5866040518163ffffffff1660e01b815260040160206040518083038186803b15801561061357600080fd5b505afa158015610627573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061064b9190612064565b6001600160801b0316816001600160801b0316106106b65760405162461bcd60e51b815260206004820152602260248201527f4c45444745523a20444946464552454e43455f455843454544535f42414c414e604482015261434560f01b6064820152608401610456565b505b8560e001516001600160801b0316816001600160801b031610156107ac576000818760e001516106e89190611fd9565b60005460e089015160405163df6c39fb60e01b81526001600160801b03808516600483015290911660248201529192506001600160a01b03169063df6c39fb90604401600060405180830381600087803b15801561074557600080fd5b505af1158015610759573d6000803e3d6000fd5b50505060e0880151604080516001600160801b03808616825290921660208301527f01f4c73b3c8ac2c1250442f70c34f73e178a6707f5771700a53041a31130a7d492500160405180910390a15061089c565b8560e001516001600160801b0316816001600160801b0316111561089c5760008660e00151826107dc9190611fd9565b60005460e089015160405163278325c160e21b81526001600160801b03808516600483015290911660248201529192506001600160a01b031690639e0c970490604401600060405180830381600087803b15801561083957600080fd5b505af115801561084d573d6000803e3d6000fd5b50505060e0880151604080516001600160801b03808616825290921660208301527fe5d0b30e3563f10570c76e157a83c7399a16a326e4b2a34546ebcab1b8da3faf92500160405180910390a1505b60006108ae6108a96114eb565b611a56565b9050806001600160801b03168760e001516001600160801b031611610c865760008760e00151826108df9190611fd9565b90506001600160801b03811615610a055760005460405163e100610760e01b81526001600160801b03831660048201526001600160a01b039091169063e100610790602401600060405180830381600087803b15801561093e57600080fd5b505af1158015610952573d6000803e3d6000fd5b505060025460405163c210aefd60e01b81526001600160801b03851660048201526001600160a01b03909116925063c210aefd9150602401600060405180830381600087803b1580156109a457600080fd5b505af11580156109b8573d6000803e3d6000fd5b5050505080600760108282829054906101000a90046001600160801b03166109e09190612081565b92506101000a8154816001600160801b0302191690836001600160801b031602179055505b6001600160801b03861615610a8657600254600a546040516332bd45dd60e11b81526001600160801b038916600482015260248101919091526001600160a01b039091169063657a8bba90604401600060405180830381600087803b158015610a6d57600080fd5b505af1158015610a81573d6000803e3d6000fd5b505050505b6000610a9189611abf565b6007549091506001600160801b03808316600160801b90920416148015610ac95750600754600160801b90046001600160801b031615155b15610adc57610ad9600182611fd9565b90505b600880546001600160801b03908116909155811615801590610b325750600189604001516003811115610b1157610b11611e08565b1480610b325750600089604001516003811115610b3057610b30611e08565b145b15610bbd57600254604051637565446f60e11b81526001600160801b03831660048201526001600160a01b039091169063eaca88de90602401600060405180830381600087803b158015610b8557600080fd5b505af1158015610b99573d6000803e3d6000fd5b5050600880546001600160801b03808616600160801b02911617905550610c7f9050565b600389604001516003811115610bd557610bd5611e08565b148015610bf157506009546001600160801b0390811690821610155b15610c7f57600254600480546040516351f9321560e01b8152918201526001600160801b03831660248201526001600160a01b03909116906351f9321590604401600060405180830381600087803b158015610c4c57600080fd5b505af1158015610c60573d6000803e3d6000fd5b5050600880546001600160801b03808616600160801b02911617905550505b5050611066565b806001600160801b03168760e001516001600160801b03161115611066576009546001600160801b03908116908216108015610ce057506000600654600160801b900460ff166003811115610cdd57610cdd611e08565b14155b15610d4e57600260009054906101000a90046001600160a01b03166001600160a01b0316632b8a3ae66040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610d3557600080fd5b505af1158015610d49573d6000803e3d6000fd5b505050505b6000818860e00151610d609190611fd9565b90506000610d6d89611abf565b90506001600160801b03811615610e67576000826001600160801b0316826001600160801b031611610d9f5781610da1565b825b6002546040516301753af160e61b81526001600160801b03831660048201529192506001600160a01b031690635d4ebc4090602401600060405180830381600087803b158015610df057600080fd5b505af1158015610e04573d6000803e3d6000fd5b505060088054849350909150600090610e279084906001600160801b0316612081565b92506101000a8154816001600160801b0302191690836001600160801b031602179055508083610e579190611fd9565b9250610e638183611fd9565b9150505b6000826001600160801b0316118015610e8957506000866001600160801b0316115b15610f5e5760008960a00151516000148015610ebf575060095460608b01516001600160801b03600160801b9092048216911611155b15610ecc57506101008901515b600254604051632a45338360e11b815263ffffffff831660048201526001600160a01b039091169063548a670690602401600060405180830381600087803b158015610f1757600080fd5b505af1158015610f2b573d6000803e3d6000fd5b50505050826001600160801b0316876001600160801b031611610f4e5786610f50565b825b610f5a9084611fd9565b9250505b816001600160801b0316856001600160801b03161015610fed576000610f848684611fd9565b6002546040516313ef4f1960e11b81526001600160801b03831660048201529192506001600160a01b0316906327de9e3290602401600060405180830381600087803b158015610fd357600080fd5b505af1158015610fe7573d6000803e3d6000fd5b50505050505b6001600160801b0381161561106357600254604051637565446f60e11b81526001600160801b03831660048201526001600160a01b039091169063eaca88de90602401600060405180830381600087803b15801561104a57600080fd5b505af115801561105e573d6000803e3d6000fd5b505050505b50505b5050505060e09290920151600780546001600160801b0319166001600160801b03909216919091179055505050565b7f585c6e254ec74f8e72b5cff099811ed8721d9039f710d9a1cb67eed6c74aa82760008054906101000a90046001600160a01b03166001600160a01b031663a1e206c76040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561110457600080fd5b505af1158015611118573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061113c9190611f9f565b604051633bfc46cb60e21b8152600481018390523360248201526001600160a01b03919091169063eff11b2c9060440160206040518083038186803b15801561118457600080fd5b505afa158015611198573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111bc91906120ac565b6111ff5760405162461bcd60e51b815260206004820152601460248201527313115111d1548e8815539055551213d493d6915160621b6044820152606401610456565b60015460005460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b390604401602060405180830381600087803b15801561125057600080fd5b505af1158015611264573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061128891906120ac565b5060015460025460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b390604401602060405180830381600087803b1580156112da57600080fd5b505af11580156112ee573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061131291906120ac565b5050565b6005546000906001600160801b03161580156113425750600754600160801b90046001600160801b0316155b801561135757506008546001600160801b0316155b905090565b6000546001600160a01b031633146113a95760405162461bcd60e51b815260206004820152601060248201526f4c45444745523a204e4f545f4c49444f60801b6044820152606401610456565b6001600160801b03918216600160801b029190921617600955600a55565b6001600160a01b0386166114165760405162461bcd60e51b81526020600482015260166024820152754c45444745523a20494e434f52524543545f564b534d60501b6044820152606401610456565b6001546001600160a01b03161561146f5760405162461bcd60e51b815260206004820152601b60248201527f4c45444745523a20414c52454144595f494e495449414c495a454400000000006044820152606401610456565b60039790975560049590955560068054600360801b60ff60801b19909116179055600080546001600160a01b03199081166001600160a01b039384161790915560018054821695831695909517909455600280549094169216919091179091556001600160801b039081169116600160801b0217600955600a55565b6000805460405163f144719560e01b81523060048201526001600160a01b039091169063f14471959060240160206040518083038186803b15801561152f57600080fd5b505afa158015611543573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061135791906120ce565b6000546001600160a01b031633146115b45760405162461bcd60e51b815260206004820152601060248201526f4c45444745523a204e4f545f4c49444f60801b6044820152606401610456565b6009546006546001600160801b03918216911610156116155760405162461bcd60e51b815260206004820152601860248201527f4c45444745523a204e4f545f454e4f5547485f5354414b4500000000000000006044820152606401610456565b600254604051637a99874b60e11b81526001600160a01b039091169063f5330e969061164790859085906004016120e7565b600060405180830381600087803b15801561166157600080fd5b505af1158015611675573d6000803e3d6000fd5b505050505050565b60008060008060005b8660a0015151811015611740578660a0015181815181106116a9576116a9612123565b602002602001015160000151836116c09190612081565b92508567ffffffffffffffff168760a0015182815181106116e3576116e3612123565b60200260200101516020015167ffffffffffffffff161161172e578660a00151818151811061171457611714612123565b6020026020010151600001518261172b9190612081565b91505b8061173881612139565b915050611686565b50909590945092505050565b6008546000906001600160801b031680156118ea576001546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a082319060240160206040518083038186803b1580156117a557600080fd5b505afa1580156117b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117dd91906120ce565b9050816001600160801b0316816001600160801b0316106118e8576000546040516338bc34db60e11b81526001600160801b03831660048201526001600160a01b039091169063717869b690602401600060405180830381600087803b15801561184657600080fd5b505af115801561185a573d6000803e3d6000fd5b50506007805485935090915060009061187d9084906001600160801b0316611fd9565b82546101009290920a6001600160801b03818102199093169183160217909155600880546001600160801b031916905560405190841681527f52a25fb647d899c87c6b0cab19bee2192a1dfd24a218ce175ac71e3b71963c32915060200160405180910390a1600091505b505b600754600160801b90046001600160801b031680156119ff57600554600090611925906001600160801b03600160801b820481169116611fd9565b905060008161193387611abf565b61193d9190612154565b60085460075491925060009161196b916001600160801b03600160801b918290048116929190910416612154565b905080600f0b82600f0b126119fb57600780548591906000906119989084906001600160801b0316612081565b82546101009290920a6001600160801b03818102199093169183160217909155600780548216905560405190861681527f5cc8f2d8958f89eface0ae3413232fdf21e4c334f8b030f014e056c77db694ee915060200160405180910390a1600093505b5050505b6001600160801b038216158015611a1d57506001600160801b038116155b15611a4c5750505060e08101516080909101516001600160801b03908116600160801b02911617600555600190565b5060009392505050565b6000600160801b8210611abb5760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20316044820152663238206269747360c81b6064820152608401610456565b5090565b600081608001518260e00151611ad59190611fd9565b92915050565b803567ffffffffffffffff81168114611af357600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715611b3157611b31611af8565b60405290565b604051610120810167ffffffffffffffff81118282101715611b3157611b31611af8565b604051601f8201601f1916810167ffffffffffffffff81118282101715611b8457611b84611af8565b604052919050565b803560048110611af357600080fd5b6001600160801b0381168114611bb057600080fd5b50565b8035611af381611b9b565b600067ffffffffffffffff821115611bd857611bd8611af8565b5060051b60200190565b600082601f830112611bf357600080fd5b81356020611c08611c0383611bbe565b611b5b565b82815260069290921b84018101918181019086841115611c2757600080fd5b8286015b84811015611c765760408189031215611c445760008081fd5b611c4c611b0e565b8135611c5781611b9b565b8152611c64828601611adb565b81860152835291830191604001611c2b565b509695505050505050565b803563ffffffff81168114611af357600080fd5b600082601f830112611ca657600080fd5b81356020611cb6611c0383611bbe565b82815260059290921b84018101918181019086841115611cd557600080fd5b8286015b84811015611c7657611cea81611c81565b8352918301918301611cd9565b60008060408385031215611d0a57600080fd5b611d1383611adb565b9150602083013567ffffffffffffffff80821115611d3057600080fd5b908401906101208287031215611d4557600080fd5b611d4d611b37565b8235815260208301356020820152611d6760408401611b8c565b6040820152611d7860608401611bb3565b6060820152611d8960808401611bb3565b608082015260a083013582811115611da057600080fd5b611dac88828601611be2565b60a08301525060c083013582811115611dc457600080fd5b611dd088828601611c95565b60c083015250611de260e08401611bb3565b60e08201526101009150611df7828401611c81565b828201528093505050509250929050565b634e487b7160e01b600052602160045260246000fd5b6020810160048310611e4057634e487b7160e01b600052602160045260246000fd5b91905290565b600080600060608486031215611e5b57600080fd5b8335611e6681611b9b565b92506020840135611e7681611b9b565b929592945050506040919091013590565b6001600160a01b0381168114611bb057600080fd5b600080600080600080600080610100898b031215611eb957600080fd5b88359750602089013596506040890135611ed281611e87565b95506060890135611ee281611e87565b94506080890135611ef281611b9b565b935060a0890135611f0281611e87565b925060c0890135611f1281611b9b565b8092505060e089013590509295985092959890939650565b60008060208385031215611f3d57600080fd5b823567ffffffffffffffff80821115611f5557600080fd5b818501915085601f830112611f6957600080fd5b813581811115611f7857600080fd5b8660208260051b8501011115611f8d57600080fd5b60209290920196919550909350505050565b600060208284031215611fb157600080fd5b8151611fbc81611e87565b9392505050565b634e487b7160e01b600052601160045260246000fd5b60006001600160801b0383811690831681811015611ff957611ff9611fc3565b039392505050565b60006001600160801b038083168185168183048111821515161561202757612027611fc3565b02949350505050565b60006001600160801b038084168061205857634e487b7160e01b600052601260045260246000fd5b92169190910492915050565b60006020828403121561207657600080fd5b8151611fbc81611b9b565b60006001600160801b038083168185168083038211156120a3576120a3611fc3565b01949350505050565b6000602082840312156120be57600080fd5b81518015158114611fbc57600080fd5b6000602082840312156120e057600080fd5b5051919050565b6020808252810182905260006001600160fb1b0383111561210757600080fd5b8260051b80856040850137600092016040019182525092915050565b634e487b7160e01b600052603260045260246000fd5b600060001982141561214d5761214d611fc3565b5060010190565b600081600f0b83600f0b600081128160016001607f1b03190183128115161561217f5761217f611fc3565b8160016001607f1b0301831381161561219a5761219a611fc3565b509003939250505056fea2646970667358221220ef7ea5e1471cebd55f830d4d676fa4ca3dd95ed39b67ea79f1c321ec7248383d64736f6c63430008090033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101375760003560e01c806368d52c77116100b8578063a5baabf01161007c578063a5baabf0146102ae578063ab28c935146102c1578063ad7a672f146102ca578063c80f3882146102dd578063d70477a6146102f0578063f5330e96146102f857600080fd5b806368d52c77146102295780637b80889b1461023c57806382d59f16146102565780638b21f170146102695780639ca8bddc1461029457600080fd5b80633113a1a6116100ff5780633113a1a6146101c2578063454ea647146101d5578063489ebdd5146101ef57806353498cdd146101f7578063681fe70c1461021157600080fd5b806308998c931461013c5780630ab306a01461016c57806311b5aede14610181578063200d2ed214610198578063231aebf2146101b9575b600080fd5b60065461014f906001600160801b031681565b6040516001600160801b0390911681526020015b60405180910390f35b61017f61017a366004611cf7565b61030b565b005b61018a60045481565b604051908152602001610163565b6006546101ac90600160801b900460ff1681565b6040516101639190611e1e565b61018a60035481565b60075461014f906001600160801b031681565b60075461014f90600160801b90046001600160801b031681565b61017f611095565b60095461014f90600160801b90046001600160801b031681565b610219611316565b6040519015158152602001610163565b60095461014f906001600160801b031681565b60055461014f90600160801b90046001600160801b031681565b61017f610264366004611e46565b61135c565b60005461027c906001600160a01b031681565b6040516001600160a01b039091168152602001610163565b60085461014f90600160801b90046001600160801b031681565b60085461014f906001600160801b031681565b61018a600a5481565b60055461014f906001600160801b031681565b61017f6102eb366004611e9c565b6113c7565b61018a6114eb565b61017f610306366004611f2a565b611567565b60008060009054906101000a90046001600160a01b03166001600160a01b0316633fd2c16a6040518163ffffffff1660e01b815260040160206040518083038186803b15801561035a57600080fd5b505afa15801561036e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103929190611f9f565b604051630869e91760e11b81523060048201526001600160a01b0391909116906310d3d22e9060240160206040518083038186803b1580156103d357600080fd5b505afa1580156103e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040b9190611f9f565b9050336001600160a01b0382161461045f5760405162461bcd60e51b81526020600482015260126024820152714c45444745523a204e4f545f4f5241434c4560701b60448201526064015b60405180910390fd5b8151600354146104b15760405162461bcd60e51b815260206004820152601e60248201527f4c45444745523a2053544153485f4143434f554e545f4d49534d4154434800006044820152606401610456565b60408201516006805460ff60801b1916600160801b8360038111156104d8576104d8611e08565b02179055506060820151600680546001600160801b0319166001600160801b0390921691909117905560008061050e848661167d565b9092509050600061051f8284611fd9565b905061052a8561174c565b61053657505050505050565b6007546001600160801b031680156106b85760075460e08701516000916001600160801b039081169116116105855760e087015160075461058091906001600160801b0316611fd9565b6105a0565b60075460e08801516105a0916001600160801b031690611fd9565b6007549091506001600160801b03166105bb82612710612001565b6105c59190612030565b905060008054906101000a90046001600160a01b03166001600160a01b0316636a92b5866040518163ffffffff1660e01b815260040160206040518083038186803b15801561061357600080fd5b505afa158015610627573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061064b9190612064565b6001600160801b0316816001600160801b0316106106b65760405162461bcd60e51b815260206004820152602260248201527f4c45444745523a20444946464552454e43455f455843454544535f42414c414e604482015261434560f01b6064820152608401610456565b505b8560e001516001600160801b0316816001600160801b031610156107ac576000818760e001516106e89190611fd9565b60005460e089015160405163df6c39fb60e01b81526001600160801b03808516600483015290911660248201529192506001600160a01b03169063df6c39fb90604401600060405180830381600087803b15801561074557600080fd5b505af1158015610759573d6000803e3d6000fd5b50505060e0880151604080516001600160801b03808616825290921660208301527f01f4c73b3c8ac2c1250442f70c34f73e178a6707f5771700a53041a31130a7d492500160405180910390a15061089c565b8560e001516001600160801b0316816001600160801b0316111561089c5760008660e00151826107dc9190611fd9565b60005460e089015160405163278325c160e21b81526001600160801b03808516600483015290911660248201529192506001600160a01b031690639e0c970490604401600060405180830381600087803b15801561083957600080fd5b505af115801561084d573d6000803e3d6000fd5b50505060e0880151604080516001600160801b03808616825290921660208301527fe5d0b30e3563f10570c76e157a83c7399a16a326e4b2a34546ebcab1b8da3faf92500160405180910390a1505b60006108ae6108a96114eb565b611a56565b9050806001600160801b03168760e001516001600160801b031611610c865760008760e00151826108df9190611fd9565b90506001600160801b03811615610a055760005460405163e100610760e01b81526001600160801b03831660048201526001600160a01b039091169063e100610790602401600060405180830381600087803b15801561093e57600080fd5b505af1158015610952573d6000803e3d6000fd5b505060025460405163c210aefd60e01b81526001600160801b03851660048201526001600160a01b03909116925063c210aefd9150602401600060405180830381600087803b1580156109a457600080fd5b505af11580156109b8573d6000803e3d6000fd5b5050505080600760108282829054906101000a90046001600160801b03166109e09190612081565b92506101000a8154816001600160801b0302191690836001600160801b031602179055505b6001600160801b03861615610a8657600254600a546040516332bd45dd60e11b81526001600160801b038916600482015260248101919091526001600160a01b039091169063657a8bba90604401600060405180830381600087803b158015610a6d57600080fd5b505af1158015610a81573d6000803e3d6000fd5b505050505b6000610a9189611abf565b6007549091506001600160801b03808316600160801b90920416148015610ac95750600754600160801b90046001600160801b031615155b15610adc57610ad9600182611fd9565b90505b600880546001600160801b03908116909155811615801590610b325750600189604001516003811115610b1157610b11611e08565b1480610b325750600089604001516003811115610b3057610b30611e08565b145b15610bbd57600254604051637565446f60e11b81526001600160801b03831660048201526001600160a01b039091169063eaca88de90602401600060405180830381600087803b158015610b8557600080fd5b505af1158015610b99573d6000803e3d6000fd5b5050600880546001600160801b03808616600160801b02911617905550610c7f9050565b600389604001516003811115610bd557610bd5611e08565b148015610bf157506009546001600160801b0390811690821610155b15610c7f57600254600480546040516351f9321560e01b8152918201526001600160801b03831660248201526001600160a01b03909116906351f9321590604401600060405180830381600087803b158015610c4c57600080fd5b505af1158015610c60573d6000803e3d6000fd5b5050600880546001600160801b03808616600160801b02911617905550505b5050611066565b806001600160801b03168760e001516001600160801b03161115611066576009546001600160801b03908116908216108015610ce057506000600654600160801b900460ff166003811115610cdd57610cdd611e08565b14155b15610d4e57600260009054906101000a90046001600160a01b03166001600160a01b0316632b8a3ae66040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610d3557600080fd5b505af1158015610d49573d6000803e3d6000fd5b505050505b6000818860e00151610d609190611fd9565b90506000610d6d89611abf565b90506001600160801b03811615610e67576000826001600160801b0316826001600160801b031611610d9f5781610da1565b825b6002546040516301753af160e61b81526001600160801b03831660048201529192506001600160a01b031690635d4ebc4090602401600060405180830381600087803b158015610df057600080fd5b505af1158015610e04573d6000803e3d6000fd5b505060088054849350909150600090610e279084906001600160801b0316612081565b92506101000a8154816001600160801b0302191690836001600160801b031602179055508083610e579190611fd9565b9250610e638183611fd9565b9150505b6000826001600160801b0316118015610e8957506000866001600160801b0316115b15610f5e5760008960a00151516000148015610ebf575060095460608b01516001600160801b03600160801b9092048216911611155b15610ecc57506101008901515b600254604051632a45338360e11b815263ffffffff831660048201526001600160a01b039091169063548a670690602401600060405180830381600087803b158015610f1757600080fd5b505af1158015610f2b573d6000803e3d6000fd5b50505050826001600160801b0316876001600160801b031611610f4e5786610f50565b825b610f5a9084611fd9565b9250505b816001600160801b0316856001600160801b03161015610fed576000610f848684611fd9565b6002546040516313ef4f1960e11b81526001600160801b03831660048201529192506001600160a01b0316906327de9e3290602401600060405180830381600087803b158015610fd357600080fd5b505af1158015610fe7573d6000803e3d6000fd5b50505050505b6001600160801b0381161561106357600254604051637565446f60e11b81526001600160801b03831660048201526001600160a01b039091169063eaca88de90602401600060405180830381600087803b15801561104a57600080fd5b505af115801561105e573d6000803e3d6000fd5b505050505b50505b5050505060e09290920151600780546001600160801b0319166001600160801b03909216919091179055505050565b7f585c6e254ec74f8e72b5cff099811ed8721d9039f710d9a1cb67eed6c74aa82760008054906101000a90046001600160a01b03166001600160a01b031663a1e206c76040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561110457600080fd5b505af1158015611118573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061113c9190611f9f565b604051633bfc46cb60e21b8152600481018390523360248201526001600160a01b03919091169063eff11b2c9060440160206040518083038186803b15801561118457600080fd5b505afa158015611198573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111bc91906120ac565b6111ff5760405162461bcd60e51b815260206004820152601460248201527313115111d1548e8815539055551213d493d6915160621b6044820152606401610456565b60015460005460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b390604401602060405180830381600087803b15801561125057600080fd5b505af1158015611264573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061128891906120ac565b5060015460025460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b390604401602060405180830381600087803b1580156112da57600080fd5b505af11580156112ee573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061131291906120ac565b5050565b6005546000906001600160801b03161580156113425750600754600160801b90046001600160801b0316155b801561135757506008546001600160801b0316155b905090565b6000546001600160a01b031633146113a95760405162461bcd60e51b815260206004820152601060248201526f4c45444745523a204e4f545f4c49444f60801b6044820152606401610456565b6001600160801b03918216600160801b029190921617600955600a55565b6001600160a01b0386166114165760405162461bcd60e51b81526020600482015260166024820152754c45444745523a20494e434f52524543545f564b534d60501b6044820152606401610456565b6001546001600160a01b03161561146f5760405162461bcd60e51b815260206004820152601b60248201527f4c45444745523a20414c52454144595f494e495449414c495a454400000000006044820152606401610456565b60039790975560049590955560068054600360801b60ff60801b19909116179055600080546001600160a01b03199081166001600160a01b039384161790915560018054821695831695909517909455600280549094169216919091179091556001600160801b039081169116600160801b0217600955600a55565b6000805460405163f144719560e01b81523060048201526001600160a01b039091169063f14471959060240160206040518083038186803b15801561152f57600080fd5b505afa158015611543573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061135791906120ce565b6000546001600160a01b031633146115b45760405162461bcd60e51b815260206004820152601060248201526f4c45444745523a204e4f545f4c49444f60801b6044820152606401610456565b6009546006546001600160801b03918216911610156116155760405162461bcd60e51b815260206004820152601860248201527f4c45444745523a204e4f545f454e4f5547485f5354414b4500000000000000006044820152606401610456565b600254604051637a99874b60e11b81526001600160a01b039091169063f5330e969061164790859085906004016120e7565b600060405180830381600087803b15801561166157600080fd5b505af1158015611675573d6000803e3d6000fd5b505050505050565b60008060008060005b8660a0015151811015611740578660a0015181815181106116a9576116a9612123565b602002602001015160000151836116c09190612081565b92508567ffffffffffffffff168760a0015182815181106116e3576116e3612123565b60200260200101516020015167ffffffffffffffff161161172e578660a00151818151811061171457611714612123565b6020026020010151600001518261172b9190612081565b91505b8061173881612139565b915050611686565b50909590945092505050565b6008546000906001600160801b031680156118ea576001546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a082319060240160206040518083038186803b1580156117a557600080fd5b505afa1580156117b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117dd91906120ce565b9050816001600160801b0316816001600160801b0316106118e8576000546040516338bc34db60e11b81526001600160801b03831660048201526001600160a01b039091169063717869b690602401600060405180830381600087803b15801561184657600080fd5b505af115801561185a573d6000803e3d6000fd5b50506007805485935090915060009061187d9084906001600160801b0316611fd9565b82546101009290920a6001600160801b03818102199093169183160217909155600880546001600160801b031916905560405190841681527f52a25fb647d899c87c6b0cab19bee2192a1dfd24a218ce175ac71e3b71963c32915060200160405180910390a1600091505b505b600754600160801b90046001600160801b031680156119ff57600554600090611925906001600160801b03600160801b820481169116611fd9565b905060008161193387611abf565b61193d9190612154565b60085460075491925060009161196b916001600160801b03600160801b918290048116929190910416612154565b905080600f0b82600f0b126119fb57600780548591906000906119989084906001600160801b0316612081565b82546101009290920a6001600160801b03818102199093169183160217909155600780548216905560405190861681527f5cc8f2d8958f89eface0ae3413232fdf21e4c334f8b030f014e056c77db694ee915060200160405180910390a1600093505b5050505b6001600160801b038216158015611a1d57506001600160801b038116155b15611a4c5750505060e08101516080909101516001600160801b03908116600160801b02911617600555600190565b5060009392505050565b6000600160801b8210611abb5760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20316044820152663238206269747360c81b6064820152608401610456565b5090565b600081608001518260e00151611ad59190611fd9565b92915050565b803567ffffffffffffffff81168114611af357600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715611b3157611b31611af8565b60405290565b604051610120810167ffffffffffffffff81118282101715611b3157611b31611af8565b604051601f8201601f1916810167ffffffffffffffff81118282101715611b8457611b84611af8565b604052919050565b803560048110611af357600080fd5b6001600160801b0381168114611bb057600080fd5b50565b8035611af381611b9b565b600067ffffffffffffffff821115611bd857611bd8611af8565b5060051b60200190565b600082601f830112611bf357600080fd5b81356020611c08611c0383611bbe565b611b5b565b82815260069290921b84018101918181019086841115611c2757600080fd5b8286015b84811015611c765760408189031215611c445760008081fd5b611c4c611b0e565b8135611c5781611b9b565b8152611c64828601611adb565b81860152835291830191604001611c2b565b509695505050505050565b803563ffffffff81168114611af357600080fd5b600082601f830112611ca657600080fd5b81356020611cb6611c0383611bbe565b82815260059290921b84018101918181019086841115611cd557600080fd5b8286015b84811015611c7657611cea81611c81565b8352918301918301611cd9565b60008060408385031215611d0a57600080fd5b611d1383611adb565b9150602083013567ffffffffffffffff80821115611d3057600080fd5b908401906101208287031215611d4557600080fd5b611d4d611b37565b8235815260208301356020820152611d6760408401611b8c565b6040820152611d7860608401611bb3565b6060820152611d8960808401611bb3565b608082015260a083013582811115611da057600080fd5b611dac88828601611be2565b60a08301525060c083013582811115611dc457600080fd5b611dd088828601611c95565b60c083015250611de260e08401611bb3565b60e08201526101009150611df7828401611c81565b828201528093505050509250929050565b634e487b7160e01b600052602160045260246000fd5b6020810160048310611e4057634e487b7160e01b600052602160045260246000fd5b91905290565b600080600060608486031215611e5b57600080fd5b8335611e6681611b9b565b92506020840135611e7681611b9b565b929592945050506040919091013590565b6001600160a01b0381168114611bb057600080fd5b600080600080600080600080610100898b031215611eb957600080fd5b88359750602089013596506040890135611ed281611e87565b95506060890135611ee281611e87565b94506080890135611ef281611b9b565b935060a0890135611f0281611e87565b925060c0890135611f1281611b9b565b8092505060e089013590509295985092959890939650565b60008060208385031215611f3d57600080fd5b823567ffffffffffffffff80821115611f5557600080fd5b818501915085601f830112611f6957600080fd5b813581811115611f7857600080fd5b8660208260051b8501011115611f8d57600080fd5b60209290920196919550909350505050565b600060208284031215611fb157600080fd5b8151611fbc81611e87565b9392505050565b634e487b7160e01b600052601160045260246000fd5b60006001600160801b0383811690831681811015611ff957611ff9611fc3565b039392505050565b60006001600160801b038083168185168183048111821515161561202757612027611fc3565b02949350505050565b60006001600160801b038084168061205857634e487b7160e01b600052601260045260246000fd5b92169190910492915050565b60006020828403121561207657600080fd5b8151611fbc81611b9b565b60006001600160801b038083168185168083038211156120a3576120a3611fc3565b01949350505050565b6000602082840312156120be57600080fd5b81518015158114611fbc57600080fd5b6000602082840312156120e057600080fd5b5051919050565b6020808252810182905260006001600160fb1b0383111561210757600080fd5b8260051b80856040850137600092016040019182525092915050565b634e487b7160e01b600052603260045260246000fd5b600060001982141561214d5761214d611fc3565b5060010190565b600081600f0b83600f0b600081128160016001607f1b03190183128115161561217f5761217f611fc3565b8160016001607f1b0301831381161561219a5761219a611fc3565b509003939250505056fea2646970667358221220ef7ea5e1471cebd55f830d4d676fa4ca3dd95ed39b67ea79f1c321ec7248383d64736f6c63430008090033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Txn Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]

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