MOVR Price: $20.12 (+6.37%)
Gas: 3.3 GWei

Contract

0x9a6d4Bb70409f7956D61d1F5c9C3090AE119C651

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
Set Cross Networ...93130702024-12-04 12:50:543 hrs ago1733316654IN
0x9a6d4Bb7...AE119C651
0 MOVR0.000362561.25
Set Cross Networ...93108002024-12-04 8:50:547 hrs ago1733302254IN
0x9a6d4Bb7...AE119C651
0 MOVR0.000362561.25
Set Cross Networ...93084542024-12-04 4:50:5411 hrs ago1733287854IN
0x9a6d4Bb7...AE119C651
0 MOVR0.001160194
Set Cross Networ...93060952024-12-04 0:50:5415 hrs ago1733273454IN
0x9a6d4Bb7...AE119C651
0 MOVR0.001160194
Set Cross Networ...93037542024-12-03 20:50:5419 hrs ago1733259054IN
0x9a6d4Bb7...AE119C651
0 MOVR0.001160194
Set Cross Networ...93015032024-12-03 16:50:5423 hrs ago1733244654IN
0x9a6d4Bb7...AE119C651
0 MOVR0.000400261.38
Set Cross Networ...92992342024-12-03 12:50:5427 hrs ago1733230254IN
0x9a6d4Bb7...AE119C651
0 MOVR0.000379961.31
Set Cross Networ...92969132024-12-03 8:50:5431 hrs ago1733215854IN
0x9a6d4Bb7...AE119C651
0 MOVR0.000362561.25
Set Cross Networ...92945742024-12-03 4:50:5435 hrs ago1733201454IN
0x9a6d4Bb7...AE119C651
0 MOVR0.001160194
Set Cross Networ...92922542024-12-03 0:50:5439 hrs ago1733187054IN
0x9a6d4Bb7...AE119C651
0 MOVR0.001160194
Set Cross Networ...92899882024-12-02 20:50:5443 hrs ago1733172654IN
0x9a6d4Bb7...AE119C651
0 MOVR0.000870143
Set Cross Networ...92876772024-12-02 16:50:5447 hrs ago1733158254IN
0x9a6d4Bb7...AE119C651
0 MOVR0.001160194
Set Cross Networ...92853442024-12-02 12:50:542 days ago1733143854IN
0x9a6d4Bb7...AE119C651
0 MOVR0.000362561.25
Set Cross Networ...92829952024-12-02 8:50:542 days ago1733129454IN
0x9a6d4Bb7...AE119C651
0 MOVR0.000362561.25
Set Cross Networ...92806442024-12-02 4:50:542 days ago1733115054IN
0x9a6d4Bb7...AE119C651
0 MOVR0.000362561.25
Set Cross Networ...92783062024-12-02 0:50:542 days ago1733100654IN
0x9a6d4Bb7...AE119C651
0 MOVR0.001160194
Set Cross Networ...92759402024-12-01 20:50:542 days ago1733086254IN
0x9a6d4Bb7...AE119C651
0 MOVR0.001160194
Set Cross Networ...92735782024-12-01 16:50:542 days ago1733071854IN
0x9a6d4Bb7...AE119C651
0 MOVR0.001160194
Set Cross Networ...92712152024-12-01 12:50:543 days ago1733057454IN
0x9a6d4Bb7...AE119C651
0 MOVR0.000400261.38
Set Cross Networ...92688932024-12-01 8:50:543 days ago1733043054IN
0x9a6d4Bb7...AE119C651
0 MOVR0.000545291.88
Set Cross Networ...92665352024-12-01 4:50:543 days ago1733028654IN
0x9a6d4Bb7...AE119C651
0 MOVR0.000362561.25
Set Cross Networ...92641702024-12-01 0:50:543 days ago1733014254IN
0x9a6d4Bb7...AE119C651
0 MOVR0.001160194
Set Cross Networ...92618052024-11-30 20:50:543 days ago1732999854IN
0x9a6d4Bb7...AE119C651
0 MOVR0.000362561.25
Set Cross Networ...92594552024-11-30 16:50:543 days ago1732985454IN
0x9a6d4Bb7...AE119C651
0 MOVR0.000362561.25
Set Cross Networ...92571212024-11-30 12:51:004 days ago1732971060IN
0x9a6d4Bb7...AE119C651
0 MOVR0.001160194
View all transactions

View more zero value Internal Transactions in Advanced View mode

Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
CrossChainManager

Compiler Version
v0.5.16+commit.9c3226ce

Optimization Enabled:
Yes with 1000 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity)

/**
 *Submitted for verification at moonriver.moonscan.io on 2024-05-24
*/

/*
    ___            _       ___  _                          
    | .\ ___  _ _ <_> ___ | __><_>._ _  ___ ._ _  ___  ___ 
    |  _// ._>| '_>| ||___|| _> | || ' |<_> || ' |/ | '/ ._>
    |_|  \___.|_|  |_|     |_|  |_||_|_|<___||_|_|\_|_.\___.
    
* PeriFinance: CrossChainManager.sol
*
* Latest source (may be newer): https://github.com/perifinance/peri-finance/blob/master/contracts/CrossChainManager.sol
* Docs: Will be added in the future. 
* https://docs.peri.finance/contracts/source/contracts/CrossChainManager
*
* Contract Dependencies: 
*	- IAddressResolver
*	- ICrossChainManager
*	- LimitedSetup
*	- MixinResolver
*	- Owned
* Libraries: 
*	- SafeDecimalMath
*	- SafeMath
*
* MIT License
* ===========
*
* Copyright (c) 2024 PeriFinance
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
*/



pragma solidity 0.5.16;

// https://docs.peri.finance/contracts/source/contracts/owned
contract Owned {
    address public owner;
    address public nominatedOwner;

    constructor(address _owner) public {
        require(_owner != address(0), "Owner address cannot be 0");
        owner = _owner;
        emit OwnerChanged(address(0), _owner);
    }

    function nominateNewOwner(address _owner) external onlyOwner {
        nominatedOwner = _owner;
        emit OwnerNominated(_owner);
    }

    function acceptOwnership() external {
        require(msg.sender == nominatedOwner, "You must be nominated before you can accept ownership");
        emit OwnerChanged(owner, nominatedOwner);
        owner = nominatedOwner;
        nominatedOwner = address(0);
    }

    modifier onlyOwner {
        _onlyOwner();
        _;
    }

    function _onlyOwner() private view {
        require(msg.sender == owner, "Only the contract owner may perform this action");
    }

    event OwnerNominated(address newOwner);
    event OwnerChanged(address oldOwner, address newOwner);
}


// https://docs.peri.finance/contracts/source/interfaces/iaddressresolver
interface IAddressResolver {
    function getAddress(bytes32 name) external view returns (address);

    function getPynth(bytes32 key) external view returns (address);

    function requireAndGetAddress(bytes32 name, string calldata reason) external view returns (address);
}


// https://docs.peri.finance/contracts/source/interfaces/ipynth
interface IPynth {
    // Views
    function currencyKey() external view returns (bytes32);

    function transferablePynths(address account) external view returns (uint);

    // Mutative functions
    function transferAndSettle(address to, uint value) external returns (bool);

    function transferFromAndSettle(
        address from,
        address to,
        uint value
    ) external returns (bool);

    // Restricted: used internally to PeriFinance
    function burn(address account, uint amount) external;

    function issue(address account, uint amount) external;
}


// https://docs.peri.finance/contracts/source/interfaces/iissuer
interface IIssuer {
    // Views
    function anyPynthOrPERIRateIsInvalid() external view returns (bool anyRateInvalid);

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

    function availablePynthCount() external view returns (uint);

    function availablePynths(uint index) external view returns (IPynth);

    function canBurnPynths(address account) external view returns (bool);

    function collateral(address account) external view returns (uint);

    function collateralisationRatio(address issuer) external view returns (uint);

    function collateralisationRatioAndAnyRatesInvalid(address _issuer)
        external
        view
        returns (uint cratio, bool anyRateIsInvalid);

    function debtBalanceOf(address issuer, bytes32 currencyKey) external view returns (uint debtBalance);

    function lastIssueEvent(address account) external view returns (uint);

    function maxIssuablePynths(address issuer)
        external
        view
        returns (
            uint,
            uint,
            uint
        );

    // function externalTokenQuota(
    //     address _account,
    //     uint _addtionalpUSD,
    //     uint _addtionalExToken,
    //     bool _isIssue
    // ) external view returns (uint);

    // function debtsCollateral(address _account, bool _rateCheck) external
    //     view
    //     returns (
    //         uint,
    //         uint,
    //         uint
    //     );
    function getRatios(address _account, bool _checkRate)
        external
        view
        returns (
            uint,
            uint,
            uint,
            uint,
            uint,
            uint
        );

    function getTargetRatio(address account) external view returns (uint);

    // function getTRatioCRatio(address _account)
    //     external
    //     view
    //     returns (
    //         uint,
    //         uint,
    //         uint,
    //         uint
    //     );

    function remainingIssuablePynths(address issuer)
        external
        view
        returns (
            uint maxIssuable,
            uint alreadyIssued,
            uint totalSystemDebt
        );

    function pynths(bytes32 currencyKey) external view returns (IPynth);

    function getPynths(bytes32[] calldata currencyKeys) external view returns (IPynth[] memory);

    function pynthsByAddress(address pynthAddress) external view returns (bytes32);

    function totalIssuedPynths(bytes32 currencyKey, bool excludeEtherCollateral) external view returns (uint, bool);

    function transferablePeriFinanceAndAnyRateIsInvalid(address account, uint balance)
        external
        view
        returns (uint transferable, bool anyRateIsInvalid);

    function amountsToFitClaimable(address _account) external view returns (uint burnAmount, uint exTokenAmountToUnstake);

    // Restricted: used internally to PeriFinance
    function issuePynths(
        address _issuer,
        bytes32 _currencyKey,
        uint _issueAmount
    ) external;

    function issueMaxPynths(address _issuer) external;

    function issuePynthsToMaxQuota(address _issuer, bytes32 _currencyKey) external;

    function burnPynths(
        address _from,
        bytes32 _currencyKey,
        uint _burnAmount
    ) external;

    function fitToClaimable(address _from) external;

    function exit(address _from) external;

    function liquidateDelinquentAccount(
        address account,
        uint pusdAmount,
        address liquidator
    ) external returns (uint totalRedeemed, uint amountToLiquidate);
}


// Inheritance


// Internal references


// https://docs.peri.finance/contracts/source/contracts/addressresolver
contract AddressResolver is Owned, IAddressResolver {
    mapping(bytes32 => address) public repository;

    constructor(address _owner) public Owned(_owner) {}

    /* ========== RESTRICTED FUNCTIONS ========== */

    function importAddresses(bytes32[] calldata names, address[] calldata destinations) external onlyOwner {
        require(names.length == destinations.length, "Input lengths must match");

        for (uint i = 0; i < names.length; i++) {
            bytes32 name = names[i];
            address destination = destinations[i];
            repository[name] = destination;
            emit AddressImported(name, destination);
        }
    }

    /* ========= PUBLIC FUNCTIONS ========== */

    function rebuildCaches(MixinResolver[] calldata destinations) external {
        for (uint i = 0; i < destinations.length; i++) {
            destinations[i].rebuildCache();
        }
    }

    /* ========== VIEWS ========== */

    function areAddressesImported(bytes32[] calldata names, address[] calldata destinations) external view returns (bool) {
        for (uint i = 0; i < names.length; i++) {
            if (repository[names[i]] != destinations[i]) {
                return false;
            }
        }
        return true;
    }

    function getAddress(bytes32 name) external view returns (address) {
        return repository[name];
    }

    function requireAndGetAddress(bytes32 name, string calldata reason) external view returns (address) {
        address _foundAddress = repository[name];
        require(_foundAddress != address(0), reason);
        return _foundAddress;
    }

    function getPynth(bytes32 key) external view returns (address) {
        IIssuer issuer = IIssuer(repository["Issuer"]);
        require(address(issuer) != address(0), "Cannot find Issuer address");
        return address(issuer.pynths(key));
    }

    /* ========== EVENTS ========== */

    event AddressImported(bytes32 name, address destination);
}


// solhint-disable payable-fallback

// https://docs.peri.finance/contracts/source/contracts/readproxy
contract ReadProxy is Owned {
    address public target;

    constructor(address _owner) public Owned(_owner) {}

    function setTarget(address _target) external onlyOwner {
        target = _target;
        emit TargetUpdated(target);
    }

    function() external {
        // The basics of a proxy read call
        // Note that msg.sender in the underlying will always be the address of this contract.
        assembly {
            calldatacopy(0, 0, calldatasize)

            // Use of staticcall - this will revert if the underlying function mutates state
            let result := staticcall(gas, sload(target_slot), 0, calldatasize, 0, 0)
            returndatacopy(0, 0, returndatasize)

            if iszero(result) {
                revert(0, returndatasize)
            }
            return(0, returndatasize)
        }
    }

    event TargetUpdated(address newTarget);
}


// Inheritance


// Internal references


// https://docs.peri.finance/contracts/source/contracts/mixinresolver
contract MixinResolver {
    AddressResolver public resolver;

    mapping(bytes32 => address) private addressCache;

    constructor(address _resolver) internal {
        resolver = AddressResolver(_resolver);
    }

    /* ========== INTERNAL FUNCTIONS ========== */

    function combineArrays(bytes32[] memory first, bytes32[] memory second)
        internal
        pure
        returns (bytes32[] memory combination)
    {
        combination = new bytes32[](first.length + second.length);

        for (uint i = 0; i < first.length; i++) {
            combination[i] = first[i];
        }

        for (uint j = 0; j < second.length; j++) {
            combination[first.length + j] = second[j];
        }
    }

    /* ========== PUBLIC FUNCTIONS ========== */

    // Note: this function is public not external in order for it to be overridden and invoked via super in subclasses
    function resolverAddressesRequired() public view returns (bytes32[] memory addresses) {}

    function rebuildCache() public {
        bytes32[] memory requiredAddresses = resolverAddressesRequired();
        // The resolver must call this function whenver it updates its state
        for (uint i = 0; i < requiredAddresses.length; i++) {
            bytes32 name = requiredAddresses[i];
            // Note: can only be invoked once the resolver has all the targets needed added
            address destination =
                resolver.requireAndGetAddress(name, string(abi.encodePacked("Resolver missing target: ", name)));
            addressCache[name] = destination;
            emit CacheUpdated(name, destination);
        }
    }

    /* ========== VIEWS ========== */

    function isResolverCached() external view returns (bool) {
        bytes32[] memory requiredAddresses = resolverAddressesRequired();
        for (uint i = 0; i < requiredAddresses.length; i++) {
            bytes32 name = requiredAddresses[i];
            // false if our cache is invalid or if the resolver doesn't have the required address
            if (resolver.getAddress(name) != addressCache[name] || addressCache[name] == address(0)) {
                return false;
            }
        }

        return true;
    }

    /* ========== INTERNAL FUNCTIONS ========== */

    function requireAndGetAddress(bytes32 name) internal view returns (address) {
        address _foundAddress = addressCache[name];
        require(_foundAddress != address(0), string(abi.encodePacked("Missing address: ", name)));
        return _foundAddress;
    }

    /* ========== EVENTS ========== */

    event CacheUpdated(bytes32 name, address destination);
}


// https://docs.peri.finance/contracts/source/contracts/limitedsetup
contract LimitedSetup {
    uint public setupExpiryTime;

    /**
     * @dev LimitedSetup Constructor.
     * @param setupDuration The time the setup period will last for.
     */
    constructor(uint setupDuration) internal {
        setupExpiryTime = now + setupDuration;
    }

    modifier onlyDuringSetup {
        require(now < setupExpiryTime, "Can only perform this action during setup");
        _;
    }
}


interface ICrossChainManager {
    // View Functions
    function crossChainState() external view returns (address);

    function debtManager() external view returns (address);

    // supply schedule wrapper functions
    // function mintableSupply() external view returns (uint);
    // // supply schedule wrapper functions
    // function isMintable() external view returns (bool);
    // // supply schedule wrapper functions
    // function minterReward() external view returns (uint);

    // function getCrossChainIds() external view returns (bytes32[] memory);

    // function getNetworkId(bytes32 _chainID) external view returns (uint);

    function currentNetworkIssuedDebtOf(bytes32 currencyKey) external view returns (uint, bool);

    function currentNetworkActiveDebtOf(bytes32 currencyKey) external view returns (uint, bool);

    function currentNetworkIssuedDebt() external view returns (uint);

    function currentNetworkActiveDebt() external view returns (uint);

    // function getCrossNetworkIssuedDebt(bytes32 _chainID) external view returns (uint);

    // function getCrossNetworkActiveDebt(bytes32 _chainID) external view returns (uint);

    function crossNetworkIssuedDebtAll() external view returns (uint);

    function crossNetworkActiveDebtAll() external view returns (uint);

    function currentNetworkDebtPercentage() external view returns (uint);

    function movedAmount(uint _inboundOutbound, uint targetNetworkId) external view returns (uint);

    function outboundSumToCurrentNetwork() external view returns (uint);

    function syncTimestamp() external view returns (uint);

    function syncStale() external view returns (bool);

    // Mutative functions
    function setCrossChainState(address) external;

    function setDebtManager(address) external;

    // supply schedule wrapper functions
    // function recordMintEvent(uint supplyMinted) external returns (bool);

    // function setCrosschain(bytes32 _chainID) external;

    // function addCrosschain(bytes32 _chainID) external;

    // function addNetworkId(bytes32 _chainID, uint _networkId) external;

    // function addNetworkIds(uint[] calldata _networkIds) external;

    function addCurrentNetworkIssuedDebt(uint _amount) external;

    function subtractCurrentNetworkIssuedDebt(uint _amount) external;

    function setCrossNetworkIssuedDebtAll(uint[] calldata _chainIDs, uint[] calldata _amounts) external;

    function setCrossNetworkActiveDebtAll(uint[] calldata _chainIDs, uint[] calldata _amounts) external;

    function setOutboundSumToCurrentNetwork(uint _amount) external;

    // deprecated functions --> to be removed. they do nothing inside the contract
    // for backwards compatibility with Exchanger
    function addTotalNetworkDebt(uint amount) external;

    // for backwards compatibility with Exchanger
    function subtractTotalNetworkDebt(uint amount) external;

    // for backwards compatibility with Issuer
    function setCrossNetworkUserDebt(address account, uint userStateDebtLedgerIndex) external;

    // for backwards compatibility with Issuer
    function clearCrossNetworkUserDebt(address account) external;
}


interface ICrossChainState {
    struct CrossNetworkUserData {
        // total network debtLedgerIndex
        uint totalNetworkDebtLedgerIndex;
        // user state debtledgerIndex
        uint userStateDebtLedgerIndex;
    }

    // Views
    function getChainID() external view returns (uint);

    // function getCrossChainCount() external view returns (uint);

    function getCurrentNetworkIssuedDebt() external view returns (uint);

    function getTotalNetworkIssuedDebt() external view returns (uint);

    function getCrossNetworkIssuedDebtAll() external view returns (uint);

    function getCrossNetworkActiveDebtAll() external view returns (uint);

    function getOutboundSumToCurrentNetwork() external view returns (uint);

    // Mutative functions
    // function addNetworkId(uint _networkId) external;

    function setCrossNetworkIssuedDebtAll(uint[] calldata _chainIDs, uint[] calldata _amounts) external;

    function setCrossNetworkActiveDebtAll(uint[] calldata _chainIDs, uint[] calldata _amounts) external;

    function setCrossNetworkDebtsAll(
        uint[] calldata _chainIDs,
        uint[] calldata _debts,
        uint[] calldata _activeDebts,
        uint _inbound
    ) external;

    // function addCrossNetworkNDebts(
    //     uint _chainID,
    //     uint _issuedDebt,
    //     uint _activeDebt
    // ) external;

    function addIssuedDebt(uint _chainID, uint _amount) external;

    function subtractIssuedDebt(uint _chainID, uint _amount) external;

    function setOutboundSumToCurrentNetwork(uint _amount) external;

    function setInitialCurrentIssuedDebt(uint _amount) external;

    // deprecated functions --> to be removed. they do nothing inside the contract
    // function totalNetworkDebtLedgerLength() external view returns (uint);

    // function lastTotalNetworkDebtLedgerEntry() external view returns (uint);

    // function getTotalNetworkDebtEntryAtIndex(uint) external view returns (uint);

    // function getCrossNetworkUserData(address) external view returns (uint, uint);

    // function getCrossChainIds() external view returns (bytes32[] memory);

    // function getNetworkId(bytes32 _chainID) external view returns (uint);

    // function getCrossNetworkIssuedDebt(bytes32 _chainID) external view returns (uint);

    // function getCrossNetworkActiveDebt(bytes32 _chainID) external view returns (uint);

    // function setCrossNetworkUserData(address, uint) external;

    // function clearCrossNetworkUserData(address) external;

    // function appendTotalNetworkDebtLedger(uint) external;

    // function addTotalNetworkDebtLedger(uint amount) external;

    // function subtractTotalNetworkDebtLedger(uint amount) external;

    // function setCrosschain(bytes32 _chainID) external;

    // function addCrosschain(bytes32 chainID) external;
}


interface IDebtCache {
    // Views

    function cachedDebt() external view returns (uint);

    function cachedPynthDebt(bytes32 currencyKey) external view returns (uint);

    function cacheTimestamp() external view returns (uint);

    function cacheInvalid() external view returns (bool);

    function cacheStale() external view returns (bool);

    function currentPynthDebts(bytes32[] calldata currencyKeys)
        external
        view
        returns (uint[] memory debtValues, bool anyRateIsInvalid);

    function cachedPynthDebts(bytes32[] calldata currencyKeys) external view returns (uint[] memory debtValues);

    function currentDebt() external view returns (uint debt, bool anyRateIsInvalid);

    function cacheInfo()
        external
        view
        returns (
            uint debt,
            uint timestamp,
            bool isInvalid,
            bool isStale
        );

    // Mutative functions

    function updateCachedPynthDebts(bytes32[] calldata currencyKeys) external;

    function updateCachedPynthDebtWithRate(bytes32 currencyKey, uint currencyRate) external;

    function updateCachedPynthDebtsWithRates(bytes32[] calldata currencyKeys, uint[] calldata currencyRates) external;

    function updateDebtCacheValidity(bool currentlyInvalid) external;

    function purgeCachedPynthDebt(bytes32 currencyKey) external;

    function takeDebtSnapshot() external;
}


pragma experimental ABIEncoderV2;

interface IBridgeState {
    // ----VIEWS

    struct Signature {
        bytes32 r;
        bytes32 s;
        uint8 v;
    }

    function networkOpened(uint chainId) external view returns (bool);

    function accountOutboundings(
        address account,
        uint periodId,
        uint index
    ) external view returns (uint);

    function accountInboundings(address account, uint index) external view returns (uint);

    function inboundings(uint index)
        external
        view
        returns (
            address,
            uint,
            uint,
            uint,
            bool,
            Signature memory
        );

    function outboundings(uint index)
        external
        view
        returns (
            address,
            uint,
            uint,
            uint,
            Signature memory
        );

    function outboundPeriods(uint index)
        external
        view
        returns (
            uint,
            uint,
            uint[] memory,
            bool
        );

    function srcOutboundingIdRegistered(uint chainId, uint srcOutboundingId) external view returns (bool isRegistered);

    function numberOfOutboundPerPeriod() external view returns (uint);

    function periodDuration() external view returns (uint);

    function outboundingsLength() external view returns (uint);

    function getTotalOutboundAmount() external view returns (uint);

    function inboundingsLength() external view returns (uint);

    function getTotalInboundAmount() external view returns (uint);

    function outboundIdsInPeriod(uint outboundPeriodId) external view returns (uint[] memory);

    function isOnRole(bytes32 roleKey, address account) external view returns (bool);

    function accountOutboundingsInPeriod(address _account, uint _period) external view returns (uint[] memory);

    function applicableInboundIds(address account) external view returns (uint[] memory);

    function outboundRequestIdsInPeriod(address account, uint periodId) external view returns (uint[] memory);

    function periodIdsToProcess() external view returns (uint[] memory);

    function getMovedAmount(uint _inboundOutbound, uint targetNetworkId) external view returns (uint);

    // ----MUTATIVES

    function appendOutboundingRequest(
        address account,
        uint amount,
        uint destChainIds,
        Signature calldata sign
    ) external;

    function appendMultipleInboundingRequests(
        address[] calldata accounts,
        uint[] calldata amounts,
        uint[] calldata srcChainIds,
        uint[] calldata srcOutboundingIds,
        Signature[] calldata sign
    ) external;

    function appendInboundingRequest(
        address account,
        uint amount,
        uint srcChainId,
        uint srcOutboundingId,
        bytes32 r,
        bytes32 s,
        uint8 v
    ) external;

    function claimInbound(uint index, uint _amount) external;
}


// https://docs.peri.finance/contracts/source/interfaces/iexchangerates
interface IExchangeRates {
    // Structs
    struct RateAndUpdatedTime {
        uint216 rate;
        uint40 time;
    }

    struct InversePricing {
        uint entryPoint;
        uint upperLimit;
        uint lowerLimit;
        bool frozenAtUpperLimit;
        bool frozenAtLowerLimit;
    }

    // Views
    function aggregators(bytes32 currencyKey) external view returns (address);

    function aggregatorWarningFlags() external view returns (address);

    function anyRateIsInvalid(bytes32[] calldata currencyKeys) external view returns (bool);

    function canFreezeRate(bytes32 currencyKey) external view returns (bool);

    function currentRoundForRate(bytes32 currencyKey) external view returns (uint);

    function currenciesUsingAggregator(address aggregator) external view returns (bytes32[] memory);

    function effectiveValue(
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey
    ) external view returns (uint value);

    function effectiveValueAndRates(
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey
    )
        external
        view
        returns (
            uint value,
            uint sourceRate,
            uint destinationRate
        );

    function effectiveValueAtRound(
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey,
        uint roundIdForSrc,
        uint roundIdForDest
    ) external view returns (uint value);

    function getCurrentRoundId(bytes32 currencyKey) external view returns (uint);

    function getLastRoundIdBeforeElapsedSecs(
        bytes32 currencyKey,
        uint startingRoundId,
        uint startingTimestamp,
        uint timediff
    ) external view returns (uint);

    function inversePricing(bytes32 currencyKey)
        external
        view
        returns (
            uint entryPoint,
            uint upperLimit,
            uint lowerLimit,
            bool frozenAtUpperLimit,
            bool frozenAtLowerLimit
        );

    function lastRateUpdateTimes(bytes32 currencyKey) external view returns (uint256);

    function oracle() external view returns (address);

    function rateAndTimestampAtRound(bytes32 currencyKey, uint roundId) external view returns (uint rate, uint time);

    function rateAndUpdatedTime(bytes32 currencyKey) external view returns (uint rate, uint time);

    function rateAndInvalid(bytes32 currencyKey) external view returns (uint rate, bool isInvalid);

    function rateForCurrency(bytes32 currencyKey) external view returns (uint);

    function rateIsFlagged(bytes32 currencyKey) external view returns (bool);

    function rateIsFrozen(bytes32 currencyKey) external view returns (bool);

    function rateIsInvalid(bytes32 currencyKey) external view returns (bool);

    function rateIsStale(bytes32 currencyKey) external view returns (bool);

    function rateStalePeriod() external view returns (uint);

    function ratesAndUpdatedTimeForCurrencyLastNRounds(bytes32 currencyKey, uint numRounds)
        external
        view
        returns (uint[] memory rates, uint[] memory times);

    function ratesAndInvalidForCurrencies(bytes32[] calldata currencyKeys)
        external
        view
        returns (uint[] memory rates, bool anyRateInvalid);

    function ratesForCurrencies(bytes32[] calldata currencyKeys) external view returns (uint[] memory);

    // Mutative functions
    function freezeRate(bytes32 currencyKey) external;
}


// https://docs.peri.finance/contracts/source/interfaces/isupplyschedule
interface ISupplySchedule {
    // Views
    function mintableSupply() external view returns (uint);

    function isMintable() external view returns (bool);

    function minterReward() external view returns (uint);

    // Mutative functions
    function recordMintEvent(uint supplyMinted) external returns (bool);
}


// https://docs.peri.finance/contracts/source/interfaces/isystemsettings
interface ISystemSettings {
    // Views
    function priceDeviationThresholdFactor() external view returns (uint);

    function waitingPeriodSecs() external view returns (uint);

    function issuanceRatio() external view returns (uint);

    function feePeriodDuration() external view returns (uint);

    function targetThreshold() external view returns (uint);

    function liquidationDelay() external view returns (uint);

    function liquidationRatio() external view returns (uint);

    function liquidationPenalty() external view returns (uint);

    function rateStalePeriod() external view returns (uint);

    function exchangeFeeRate(bytes32 currencyKey) external view returns (uint);

    function minimumStakeTime() external view returns (uint);

    function externalTokenQuota() external view returns (uint);

    function bridgeTransferGasCost() external view returns (uint);

    function bridgeClaimGasCost() external view returns (uint);

    function syncStaleThreshold() external view returns (uint);

    function debtSnapshotStaleTime() external view returns (uint);
}


/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when 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.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");

        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b <= a, "SafeMath: subtraction overflow");
        uint256 c = a - b;

        return c;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");

        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        // Solidity only automatically asserts when dividing by 0
        require(b > 0, "SafeMath: division by zero");
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold

        return c;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b != 0, "SafeMath: modulo by zero");
        return a % b;
    }
}


// Libraries


// https://docs.peri.finance/contracts/source/libraries/safedecimalmath
library SafeDecimalMath {
    using SafeMath for uint;

    /* Number of decimal places in the representations. */
    uint8 public constant decimals = 18;
    uint8 public constant highPrecisionDecimals = 27;

    /* The number representing 1.0. */
    uint public constant UNIT = 10**uint(decimals);

    /* The number representing 1.0 for higher fidelity numbers. */
    uint public constant PRECISE_UNIT = 10**uint(highPrecisionDecimals);
    uint private constant UNIT_TO_HIGH_PRECISION_CONVERSION_FACTOR = 10**uint(highPrecisionDecimals - decimals);

    /**
     * @return Provides an interface to UNIT.
     */
    function unit() external pure returns (uint) {
        return UNIT;
    }

    /**
     * @return Provides an interface to PRECISE_UNIT.
     */
    function preciseUnit() external pure returns (uint) {
        return PRECISE_UNIT;
    }

    /**
     * @return The result of multiplying x and y, interpreting the operands as fixed-point
     * decimals.
     *
     * @dev A unit factor is divided out after the product of x and y is evaluated,
     * so that product must be less than 2**256. As this is an integer division,
     * the internal division always rounds down. This helps save on gas. Rounding
     * is more expensive on gas.
     */
    function multiplyDecimal(uint x, uint y) internal pure returns (uint) {
        /* Divide by UNIT to remove the extra factor introduced by the product. */
        return x.mul(y) / UNIT;
    }

    /**
     * @return The result of safely multiplying x and y, interpreting the operands
     * as fixed-point decimals of the specified precision unit.
     *
     * @dev The operands should be in the form of a the specified unit factor which will be
     * divided out after the product of x and y is evaluated, so that product must be
     * less than 2**256.
     *
     * Unlike multiplyDecimal, this function rounds the result to the nearest increment.
     * Rounding is useful when you need to retain fidelity for small decimal numbers
     * (eg. small fractions or percentages).
     */
    function _multiplyDecimalRound(
        uint x,
        uint y,
        uint precisionUnit
    ) private pure returns (uint) {
        /* Divide by UNIT to remove the extra factor introduced by the product. */
        uint quotientTimesTen = x.mul(y) / (precisionUnit / 10);

        if (quotientTimesTen % 10 >= 5) {
            quotientTimesTen += 10;
        }

        return quotientTimesTen / 10;
    }

    /**
     * @return The result of safely multiplying x and y, interpreting the operands
     * as fixed-point decimals of a precise unit.
     *
     * @dev The operands should be in the precise unit factor which will be
     * divided out after the product of x and y is evaluated, so that product must be
     * less than 2**256.
     *
     * Unlike multiplyDecimal, this function rounds the result to the nearest increment.
     * Rounding is useful when you need to retain fidelity for small decimal numbers
     * (eg. small fractions or percentages).
     */
    function multiplyDecimalRoundPrecise(uint x, uint y) internal pure returns (uint) {
        return _multiplyDecimalRound(x, y, PRECISE_UNIT);
    }

    /**
     * @return The result of safely multiplying x and y, interpreting the operands
     * as fixed-point decimals of a standard unit.
     *
     * @dev The operands should be in the standard unit factor which will be
     * divided out after the product of x and y is evaluated, so that product must be
     * less than 2**256.
     *
     * Unlike multiplyDecimal, this function rounds the result to the nearest increment.
     * Rounding is useful when you need to retain fidelity for small decimal numbers
     * (eg. small fractions or percentages).
     */
    function multiplyDecimalRound(uint x, uint y) internal pure returns (uint) {
        return _multiplyDecimalRound(x, y, UNIT);
    }

    /**
     * @return The result of safely dividing x and y. The return value is a high
     * precision decimal.
     *
     * @dev y is divided after the product of x and the standard precision unit
     * is evaluated, so the product of x and UNIT must be less than 2**256. As
     * this is an integer division, the result is always rounded down.
     * This helps save on gas. Rounding is more expensive on gas.
     */
    function divideDecimal(uint x, uint y) internal pure returns (uint) {
        /* Reintroduce the UNIT factor that will be divided out by y. */
        return x.mul(UNIT).div(y);
    }

    /**
     * @return The result of safely dividing x and y. The return value is as a rounded
     * decimal in the precision unit specified in the parameter.
     *
     * @dev y is divided after the product of x and the specified precision unit
     * is evaluated, so the product of x and the specified precision unit must
     * be less than 2**256. The result is rounded to the nearest increment.
     */
    function _divideDecimalRound(
        uint x,
        uint y,
        uint precisionUnit
    ) private pure returns (uint) {
        uint resultTimesTen = x.mul(precisionUnit * 10).div(y);

        if (resultTimesTen % 10 >= 5) {
            resultTimesTen += 10;
        }

        return resultTimesTen / 10;
    }

    /**
     * @return The result of safely dividing x and y. The return value is as a rounded
     * standard precision decimal.
     *
     * @dev y is divided after the product of x and the standard precision unit
     * is evaluated, so the product of x and the standard precision unit must
     * be less than 2**256. The result is rounded to the nearest increment.
     */
    function divideDecimalRound(uint x, uint y) internal pure returns (uint) {
        return _divideDecimalRound(x, y, UNIT);
    }

    /**
     * @return The result of safely dividing x and y. The return value is as a rounded
     * high precision decimal.
     *
     * @dev y is divided after the product of x and the high precision unit
     * is evaluated, so the product of x and the high precision unit must
     * be less than 2**256. The result is rounded to the nearest increment.
     */
    function divideDecimalRoundPrecise(uint x, uint y) internal pure returns (uint) {
        return _divideDecimalRound(x, y, PRECISE_UNIT);
    }

    /**
     * @dev Convert a standard decimal representation to a high precision one.
     */
    function decimalToPreciseDecimal(uint i) internal pure returns (uint) {
        return i.mul(UNIT_TO_HIGH_PRECISION_CONVERSION_FACTOR);
    }

    /**
     * @dev Convert a high precision decimal to a standard decimal representation.
     */
    function preciseDecimalToDecimal(uint i) internal pure returns (uint) {
        uint quotientTimesTen = i / (UNIT_TO_HIGH_PRECISION_CONVERSION_FACTOR / 10);

        if (quotientTimesTen % 10 >= 5) {
            quotientTimesTen += 10;
        }

        return quotientTimesTen / 10;
    }

    /**
     * @dev Round down the value with given number
     */
    function roundDownDecimal(uint x, uint d) internal pure returns (uint) {
        return x.div(10**d).mul(10**d);
    }

    /**
     * @dev Round up the value with given number
     */
    function roundUpDecimal(uint x, uint d) internal pure returns (uint) {
        uint _decimal = 10**d;

        if (x % _decimal > 0) {
            x = x.add(10**d);
        }

        return x.div(_decimal).mul(_decimal);
    }
}


// Inheritance


// Libraries


contract CrossChainManager is Owned, MixinResolver, LimitedSetup, ICrossChainManager {
    using SafeMath for uint;
    using SafeDecimalMath for uint;

    bytes32 internal constant pUSD = "pUSD";

    address internal _crossChainState;
    address internal _debtManager;

    uint internal _syncTimestamp;
    bool internal _isStale;

    bytes32 private constant CONTRACT_DEBTCACHE = "DebtCache";
    bytes32 private constant CONTRACT_BRIDGESTATEPUSD = "BridgeStatepUSD";
    bytes32 private constant CONTRACT_EXCHANGERATES = "ExchangeRates";
    bytes32 private constant CONTRACT_SUPPLYSCHEDULE = "SupplySchedule";
    bytes32 private constant CONTRACT_SYSTEMSETTINGS = "SystemSettings";

    constructor(
        address _owner,
        address _resolver,
        address _crossChainStateAddress,
        address _debtManagerAddress
    ) public Owned(_owner) MixinResolver(_resolver) LimitedSetup(2 weeks) {
        _crossChainState = _crossChainStateAddress;
        _debtManager = _debtManagerAddress;
        _syncTimestamp = block.timestamp;
        _isStale = false;
    }

    //*********************** View functions ***************************
    /**
     * @notice return addresses of required resolver instance
     * @return address of required resolver addresses
     */
    function resolverAddressesRequired() public view returns (bytes32[] memory addresses) {
        addresses = new bytes32[](5);
        addresses[0] = CONTRACT_DEBTCACHE;
        addresses[1] = CONTRACT_BRIDGESTATEPUSD;
        addresses[2] = CONTRACT_EXCHANGERATES;
        addresses[3] = CONTRACT_SUPPLYSCHEDULE;
        addresses[4] = CONTRACT_SYSTEMSETTINGS;
    }

    /**
     * @notice return debtCache instance
     * @return debtCache instance
     */
    function debtCache() internal view returns (IDebtCache) {
        return IDebtCache(requireAndGetAddress(CONTRACT_DEBTCACHE));
    }

    /**
     * @notice return cross chain state instance
     * @return cross chain state instance
     */
    function state() internal view returns (ICrossChainState) {
        return ICrossChainState(_crossChainState);
    }

    /**
     * @notice return bridge state instance
     * @return bridge state instance
     */
    function bridgeStatepUSD() internal view returns (IBridgeState) {
        return IBridgeState(requireAndGetAddress(CONTRACT_BRIDGESTATEPUSD));
    }

    /**
     * @notice return exchange rates instance
     * @return exchange rates instance
     */
    function exchangeRates() internal view returns (IExchangeRates) {
        return IExchangeRates(requireAndGetAddress(CONTRACT_EXCHANGERATES));
    }

    /**
     * @notice return system settings instance
     * @return system settings instance
     */
    function systemSettings() internal view returns (ISystemSettings) {
        return ISystemSettings(requireAndGetAddress(CONTRACT_SYSTEMSETTINGS));
    }

    /**
     * @notice return supply schedule instance
     * @dev called by inFlationalMint
     * @return supply schedule instance
     */
    function supplySchedule() internal view returns (ISupplySchedule) {
        return ISupplySchedule(requireAndGetAddress(CONTRACT_SUPPLYSCHEDULE));
    }

    /**
     * @notice return current network's mintable supply
     * @dev called by inFlationalMint
     * @return mintable supply
     */
    function mintableSupply() external view returns (uint supplyToMint) {
        uint _currRate = _currentNetworkDebtPercentage();
        require(SafeDecimalMath.preciseUnit() >= _currRate, "Network rate invalid");
        require(!_syncStale(_syncTimestamp) || SafeDecimalMath.preciseUnit() == _currRate, "Cross chain debt is stale");

        supplyToMint = supplySchedule().mintableSupply();
        require(supplyToMint > 0, "No mintable supply");

        supplyToMint = supplyToMint
            .decimalToPreciseDecimal()
            .multiplyDecimalRoundPrecise(_currRate)
            .preciseDecimalToDecimal();

        return supplyToMint;
    }

    function isMintable() external view returns (bool) {
        return supplySchedule().isMintable();
    }

    function minterReward() external view returns (uint) {
        return supplySchedule().minterReward();
    }

    /**
     * @notice return current chain id
     * @return current chain id
     */
    function getChainID() external view returns (uint) {
        return state().getChainID();
    }

    /**
     * @notice return cross chain state instance address
     * @return cross chain state instance address
     */
    function crossChainState() external view returns (address) {
        return _crossChainState;
    }

    /**
     * @notice return debt manager instance address
     * @return debt manager instance address
     */
    function debtManager() external view returns (address) {
        return _debtManager;
    }

    /**
     * @notice return cross chain synchronization timestamp
     * @return cross chain synchronization timestamp
     */
    function syncTimestamp() external view returns (uint) {
        return _syncTimestamp;
    }

    /**
     * @notice return cross chain synchronization stale flag
     * @return cross chain synchronization stale flag
     */
    function isStale() external view returns (bool) {
        return _isStale;
    }

    /**
     * @notice return current cross chain count
     * @return current cross chain count
     */
    // function crossChainCount() external view returns (uint) {
    //     return state().getCrossChainCount();
    // }

    /**
     * @notice return current sum of total network system debt
     * @dev current network's active debt by currency key
     * @param currencyKey currency key
     * @return totalSystemValue debt,
     * @return anyRateIsInvalid any rate is invalid
     */
    function currentNetworkIssuedDebtOf(bytes32 currencyKey)
        external
        view
        returns (uint totalSystemValue, bool anyRateIsInvalid)
    {
        totalSystemValue = _currentNetworkIssuedDebt();

        if (currencyKey == pUSD) {
            return (totalSystemValue, false);
        }

        (uint currencyRate, bool currencyRateInvalid) = exchangeRates().rateAndInvalid(currencyKey);

        return (totalSystemValue.divideDecimalRound(currencyRate), currencyRateInvalid);
    }

    /**
     * @notice Get current network's active debt by currency key
     * @dev needs to consider issued debt change by staking and burning between the cross chain synchronization
     * @return totalSystemValue debt,
     * @return anyRateIsInvalid any rate is invalid
     */
    function currentNetworkActiveDebtOf(bytes32 currencyKey)
        external
        view
        returns (uint totalSystemValue, bool anyRateIsInvalid)
    {
        (totalSystemValue, anyRateIsInvalid) = _currentNetworkActiveDebt();

        if (currencyKey == pUSD) {
            return (totalSystemValue, anyRateIsInvalid);
        }

        (uint currencyRate, bool currencyRateInvalid) = exchangeRates().rateAndInvalid(currencyKey);

        totalSystemValue = totalSystemValue
            .decimalToPreciseDecimal()
            .divideDecimalRoundPrecise(currencyRate.decimalToPreciseDecimal())
            .preciseDecimalToDecimal();

        anyRateIsInvalid = anyRateIsInvalid || currencyRateInvalid;

        // return (totalSystemValue.divideDecimalRound(currencyRate), anyRateIsInvalid || currencyRateInvalid);
    }

    /**
     * @notice Get current network's issued debt
     * @dev deprecated
     * @return outbound amount
     */
    function currentNetworkIssuedDebt() external view returns (uint) {
        uint issuedDebt = _currentNetworkIssuedDebt();
        return issuedDebt;
    }

    /**
     * @notice Get current network's active debt
     * @dev needs to consider issued debt change by staking and burning between the cross chain synchronization
     * @return outbound amount
     */
    function currentNetworkActiveDebt() external view returns (uint) {
        (uint activeDebt, ) = _currentNetworkActiveDebt();
        return activeDebt;
    }

    /**
     * @notice Get connected chain's total issued debt
     * @return issued debt
     */
    function crossNetworkIssuedDebtAll() external view returns (uint) {
        return state().getCrossNetworkIssuedDebtAll();
    }

    /**
     * @notice Get connected chain's total active debt
     * @dev may need more robust way of secure the crosschain debts
     * @return active debt
     */
    function crossNetworkActiveDebtAll() external view returns (uint) {
        return state().getCrossNetworkActiveDebtAll();
    }

    /**
     * @notice Get CURRENT debt percentage of network by total networks
     * @dev external function
     * @return current debt ratio of network by total network debt
     */
    function currentNetworkDebtPercentage() external view returns (uint) {
        return _currentNetworkDebtPercentage();
    }

    /**
     * @notice Get current network's in&outbound net amount
     * @dev used for cross chain debt synchronization
     * @return outbound amount
     */
    function movedAmount(uint _inboundOutbound, uint targetNetworkId) external view returns (uint) {
        return bridgeStatepUSD().getMovedAmount(_inboundOutbound, targetNetworkId);
    }

    /**
     * @notice Get current network's inbound amount compiled by other networks
     * @dev used for cross chain debt synchronization
     * @return inbound amount
     */
    function outboundSumToCurrentNetwork() external view returns (uint) {
        return state().getOutboundSumToCurrentNetwork();
    }

    /**
     * @notice Get current cross chain synchronization stale flag
     * @dev used for cross chain debt synchronization
     * @return inbound amount
     */
    function syncStale() external view returns (bool) {
        return _syncStale(_syncTimestamp) && SafeDecimalMath.preciseUnit() != _currentNetworkDebtPercentage();
    }

    // ********************* Internal View functions ***************************

    /**
     * @notice Get CURRENT debt percentage of network by total networks
     * @dev internal function
     * @return current debt ratio of network by total network debt
     */
    function _currentNetworkDebtPercentage() internal view returns (uint networkPercentage) {
        uint totalIssuedDebt = state().getTotalNetworkIssuedDebt();

        networkPercentage = totalIssuedDebt == 0
            ? SafeDecimalMath.preciseUnit()
            : _currentNetworkIssuedDebt().decimalToPreciseDecimal().divideDecimalRoundPrecise(
                totalIssuedDebt.decimalToPreciseDecimal()
            );
    }

    /**
     * @notice Get CURRENT network's issued debt
     * @dev internal function
     * @return currentNetworkIssuedDebt current network's issued debt
     */
    function _currentNetworkIssuedDebt() internal view returns (uint networkIssuedDebt) {
        networkIssuedDebt = state().getCurrentNetworkIssuedDebt();
    }

    /**
     * @notice Get CURRENT network's in&out included debt percentage of network by total networks
     * @dev possibly deprecated
     * @return currentNetworActivekDebt current network's active debt
     */
    function _currentNetworkActiveDebt() internal view returns (uint currentNetworActivekDebt, bool anyRateIsInvalid) {
        bool cachStale;
        (currentNetworActivekDebt, , anyRateIsInvalid, cachStale) = debtCache().cacheInfo();
        anyRateIsInvalid = anyRateIsInvalid || cachStale;

        // get current network's active debt by applying In&Out amount
        (uint inboundAmount, uint outboundAmount) = _getInOutAmount();
        currentNetworActivekDebt = currentNetworActivekDebt.add(outboundAmount).sub(inboundAmount);

        // get current network's active debt after multiplying the debt percentage to the total active debt
        currentNetworActivekDebt = currentNetworActivekDebt
            .add(state().getCrossNetworkActiveDebtAll())
            .decimalToPreciseDecimal()
            .multiplyDecimalRoundPrecise(_currentNetworkDebtPercentage())
            .preciseDecimalToDecimal();
    }

    /**
     * @notice Get CURRENT network's in&out
     * @dev internal function
     * @return inboundAmount inbound amount
     * @return outboundAmount  outbound amount
     */
    function _getInOutAmount() internal view returns (uint inboundAmount, uint outboundAmount) {
        outboundAmount = bridgeStatepUSD().getTotalOutboundAmount();
        inboundAmount = bridgeStatepUSD().getTotalInboundAmount();

        // if the amount is less than the amount comiled by the other networks, which means bridge is not synchronized yet
        uint outboundFromOtherNetwork = state().getOutboundSumToCurrentNetwork();
        // so, we need to use the-others's sum of outbound targeted to current network
        inboundAmount = inboundAmount < outboundFromOtherNetwork ? outboundFromOtherNetwork : inboundAmount;
    }

    /**
     * @notice Get synced timestamp
     * @dev Note a 0 timestamp means that the sync is uninitialised.
     * @param timestamp cross chain synchronization timestamp
     */
    function _syncStale(uint timestamp) internal view returns (bool) {
        return systemSettings().debtSnapshotStaleTime() < block.timestamp - timestamp || timestamp == 0 || _isStale;
    }

    //************************* Mutative functions ***************************
    /**
     * @notice set state instance address for cross chain state management
     * @param crossChainStateAddress address of cross chain state instance
     */
    function setCrossChainState(address crossChainStateAddress) external onlyOwner {
        _crossChainState = crossChainStateAddress;
    }

    /**
     * @notice set debt manager address for cross chain debt operation
     * @param debtManagerAddress address of cross chain instance
     */
    function setDebtManager(address debtManagerAddress) external onlyOwner {
        _debtManager = debtManagerAddress;
    }

    /**
     * @notice add multiple connected chain name ids and network ids for cross chain state management
     * @param _networkIds network ids
     */
    // function addNetworkIds(uint[] calldata _networkIds) external onlyOwner {
    //     for (uint i; i < _networkIds.length; i++) {
    //         state().addNetworkId(_networkIds[i]);
    //     }
    // }

    /**
     * @notice add current network's issued debt
     * @dev keep track of current network's issued debt
     * @param _amount debt amount
     */
    function addCurrentNetworkIssuedDebt(uint _amount) external {
        state().addIssuedDebt(state().getChainID(), _amount);

        _setStaleByDebtChangeRate(_amount);

        emit IssuedDebtAdded(_amount, state().getCurrentNetworkIssuedDebt(), block.timestamp, _isStale);
    }

    /**
     * @notice subtract current network's issued debt
     * @dev keep track of current network's issued debt
     * @param _amount debt amount
     */
    function subtractCurrentNetworkIssuedDebt(uint _amount) external {
        state().subtractIssuedDebt(state().getChainID(), _amount);

        _setStaleByDebtChangeRate(_amount);

        emit IssuedDebtSubtracted(_amount, state().getCurrentNetworkIssuedDebt(), block.timestamp, _isStale);
    }

    /**
     * @notice set all connected cross-chain's issued debt
     * @dev issued debt is the debt that is issued by the connected chain
     * @param _chainIDs chain ids
     * @param _amounts debt array
     */
    function setCrossNetworkIssuedDebtAll(uint[] calldata _chainIDs, uint[] calldata _amounts) external onlyDebtManager {
        state().setCrossNetworkIssuedDebtAll(_chainIDs, _amounts);
        _syncTimestamp = block.timestamp;
        _isStale = false;

        for (uint i; i < _chainIDs.length; i++) {
            emit CrossChainIssuedDebtSynced(_chainIDs[i], _amounts[i], block.timestamp);
        }
    }

    /**
     * @notice set all connected cross-chain's active debt
     * @dev active debt is the debt that is all issued pynths assets' floating amount calculated by the exchange rate
     * @param _chainIDs chain ids
     * @param _amounts debt array
     */
    function setCrossNetworkActiveDebtAll(uint[] calldata _chainIDs, uint[] calldata _amounts) external onlyDebtManager {
        state().setCrossNetworkActiveDebtAll(_chainIDs, _amounts);
        _syncTimestamp = block.timestamp;
        _isStale = false;

        for (uint i; i < _chainIDs.length; i++) {
            emit CrossChainActiveDebtSynced(_chainIDs[i], _amounts[i], block.timestamp);
        }
    }

    /**
     * @notice set all connected cross-chain's issued debt and inbound amount
     * @dev called by scheduler
     * @param _chainIDs chain ids
     * @param _activeDebts debt array
     * @param _issuedDebts debt array
     * @param _inbound current network's inbound amount compiled by other networks
     */
    function setCrossNetworkDebtsAll(
        uint[] calldata _chainIDs,
        uint[] calldata _issuedDebts,
        uint[] calldata _activeDebts,
        uint _inbound
    ) external onlyDebtManager {
        state().setCrossNetworkDebtsAll(_chainIDs, _issuedDebts, _activeDebts, _inbound);
        _syncTimestamp = block.timestamp;
        _isStale = false;

        for (uint i; i < _chainIDs.length; i++) {
            emit CrossChainSynced(_chainIDs[i], _issuedDebts[i], _activeDebts[i], block.timestamp);
        }
    }

    /**
     * @notice set current network's issued debt
     * @dev calling the function is strictly limited to the setup period
    //**** When upgrading the contract, the function SHOULD BE NOT BE CALLED AGAIN.
     *      Instead, you need move to previose network's issued debt to the new contract 
     */
    function setInitialCurrentIssuedDebt(address _prevState) external onlyOwner onlyDuringSetup {
        state().setInitialCurrentIssuedDebt(ICrossChainState(_prevState).getCurrentNetworkIssuedDebt());
    }

    /**
     * @notice set inbound to current network from other networks
     * @param _amount debt amount
     */
    function setOutboundSumToCurrentNetwork(uint _amount) external onlyDebtManager {
        state().setOutboundSumToCurrentNetwork(_amount);
    }

    // ************************* Internal Mutative functions ***************************

    /**
     * @notice set cross chain synchronization stale flag
     * @dev internal function
     * @param _amount changed debt amount
     */
    function _setStaleByDebtChangeRate(uint _amount) internal {
        if (
            state().getCurrentNetworkIssuedDebt() > 0 &&
            _amount.divideDecimalRound(state().getCurrentNetworkIssuedDebt()) >= systemSettings().syncStaleThreshold()
        ) {
            _isStale = true;
        }
    }

    //*********************** */ Modifiers *******************************
    /**
     * @notice check if the caller is debt manager
     * @dev modifier
     */
    modifier onlyDebtManager() {
        require(msg.sender == _debtManager, "Only the debt manager may perform this action");
        _;
    }

    // /**
    //  * @notice check if the caller is debtCache or exchanger
    //  */
    // modifier onlyDebtCache() {
    //     _onlyDebtCache(); // Use an internal function to save code size.
    //     _;
    // }

    // /**
    //  * @notice check if the caller is debtCache or exchanger
    //  */
    // function _onlyDebtCache() internal view {
    //     bool isDebtCache = msg.sender == address(debtCache());
    //     require(isDebtCache, "CrossChainManager: Only the debtCache contract can perform this action");
    // }

    //****************** deprecated *******************/
    //****************** deprecated *******************/
    // View functions

    // /**
    //  * @notice Get cross-chain ids
    //  * @return current debt ratio of network by total network debt
    //  */
    // function getCrossChainIds() external view returns (bytes32[] memory) {
    //     return state().getCrossChainIds();
    // }

    // /**
    //  * @notice Get connected chain's issued debt
    //  * @dev possibly deprecated
    //  * @param _chainID chain id
    //  * @return issued debt
    //  */
    // function getCrossNetworkIssuedDebt(bytes32 _chainID) external view returns (uint) {
    //     return state().getCrossNetworkIssuedDebt(_chainID);
    // }

    // /**
    //  * @notice Get connected chain's active debt
    //  * @param _chainID chain id
    //  * @return active debt
    //  */
    // function getCrossNetworkActiveDebt(bytes32 _chainID) external view returns (uint) {
    //     return state().getCrossNetworkActiveDebt(_chainID);
    // }

    // /**
    //  * @notice return current sum of total network system debt
    //  * @dev deprecated
    //  * @return totalNetworkDebt uint
    //  */
    // function currentTotalNetworkDebt() external view returns (uint) {
    //     return state().lastTotalNetworkDebtLedgerEntry();
    // }

    // /**
    //  * @notice return user's cross chain debt entry index
    //  * @dev possibly deprecated
    //  */
    // function userIssuanceDataForTotalNetwork(address account)
    //     external
    //     view
    //     returns (uint crossChainDebtEntryIndex, uint userStateDebtLedgerIndex)
    // {
    //     (crossChainDebtEntryIndex, userStateDebtLedgerIndex) = state().getCrossNetworkUserData(account);
    // }

    // Mutative functions

    // /**
    //  * @notice add connected chain's issued debt
    //  * @dev deprecated
    //  * @param _chainID chain id
    //  * @param _amount debt amount
    //  */
    // function addIssuedDebt(bytes32 _chainID, uint _amount) external {
    //     state().addIssuedDebt(_chainID, _amount);
    //     return;
    // }

    // /**
    //  * @notice subtract connected chain's issued debt
    //  * @dev deprecated
    //  * @param _chainID chain id
    //  * @param _amount debt amount
    //  */
    // function subtractIssuedDebt(bytes32 _chainID, uint _amount) external {
    //     state().subtractIssuedDebt(_chainID, _amount);
    //     return;
    // }

    // /**
    //  * @notice save current sum of total network system debt to the state
    //  * @dev deprecated
    //  * @param totalNetworkDebt uint
    //  */
    // function appendTotalNetworkDebt(uint totalNetworkDebt) external onlyDebtManager {
    //     state().appendTotalNetworkDebtLedger(totalNetworkDebt);
    // }

    /**
     * @notice add amount to current sum of total network system debt
     * @dev deprecated
     * @param amount  debt amount
     */
    function addTotalNetworkDebt(uint amount) external {}

    /**
     * @notice subtract amount from current sum of total network system debt
     * @dev deprecated
     * @param amount debt amount
     */
    function subtractTotalNetworkDebt(uint amount) external {}

    /**
     * @notice set user's cross chain debt entry index
     * @dev deprecated
     * @param account user's address
     */
    function setCrossNetworkUserDebt(address account, uint userStateDebtLedgerIndex) external {}

    /**
     * @notice clear user's cross chain debt entry index
     * @dev deprecated
     * @param account user's address
     */
    function clearCrossNetworkUserDebt(address account) external {}

    //*********************** Events ***************************
    /**
     * @notice Emitted when current network issued debt has added
     * @param amount uint
     * @param latestNetworkDebt uint
     * @param timestamp uint
     * @param syncInvalid bool
     */
    event IssuedDebtAdded(uint amount, uint latestNetworkDebt, uint timestamp, bool syncInvalid);

    /**
     * @notice Emitted when current network issued debt has subtracted
     * @param amount uint
     * @param latestNetworkDebt uint
     * @param timestamp uint
     * @param syncInvalid bool
     */
    event IssuedDebtSubtracted(uint amount, uint latestNetworkDebt, uint timestamp, bool syncInvalid);

    /**
     * @notice Emitted when current network debt has synchronized
     * @param chainID uint
     * @param issuedDebt uint
     * @param activeDebt uint
     * @param timestamp uint
     */
    event CrossChainSynced(uint chainID, uint issuedDebt, uint activeDebt, uint timestamp);

    /**
     * @notice Emitted when current network issued debt has subtracted
     * @param chainID uint
     * @param issuedDebt uint
     * @param timestamp uint
     */
    event CrossChainIssuedDebtSynced(uint chainID, uint issuedDebt, uint timestamp);

    /**
     * @notice Emitted when current network active debt has subtracted
     * @param chainID uint
     * @param activeDebt uint
     * @param timestamp uint
     */
    event CrossChainActiveDebtSynced(uint chainID, uint activeDebt, uint timestamp);
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_resolver","type":"address"},{"internalType":"address","name":"_crossChainStateAddress","type":"address"},{"internalType":"address","name":"_debtManagerAddress","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"name","type":"bytes32"},{"indexed":false,"internalType":"address","name":"destination","type":"address"}],"name":"CacheUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"chainID","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"activeDebt","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"CrossChainActiveDebtSynced","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"chainID","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"issuedDebt","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"CrossChainIssuedDebtSynced","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"chainID","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"issuedDebt","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"activeDebt","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"CrossChainSynced","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"latestNetworkDebt","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"bool","name":"syncInvalid","type":"bool"}],"name":"IssuedDebtAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"latestNetworkDebt","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"bool","name":"syncInvalid","type":"bool"}],"name":"IssuedDebtSubtracted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldOwner","type":"address"},{"indexed":false,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerNominated","type":"event"},{"constant":false,"inputs":[],"name":"acceptOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"addCurrentNetworkIssuedDebt","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"addTotalNetworkDebt","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"clearCrossNetworkUserDebt","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"crossChainState","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"crossNetworkActiveDebtAll","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"crossNetworkIssuedDebtAll","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"currentNetworkActiveDebt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"}],"name":"currentNetworkActiveDebtOf","outputs":[{"internalType":"uint256","name":"totalSystemValue","type":"uint256"},{"internalType":"bool","name":"anyRateIsInvalid","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"currentNetworkDebtPercentage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"currentNetworkIssuedDebt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"}],"name":"currentNetworkIssuedDebtOf","outputs":[{"internalType":"uint256","name":"totalSystemValue","type":"uint256"},{"internalType":"bool","name":"anyRateIsInvalid","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"debtManager","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getChainID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isMintable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isResolverCached","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isStale","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"mintableSupply","outputs":[{"internalType":"uint256","name":"supplyToMint","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"minterReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"_inboundOutbound","type":"uint256"},{"internalType":"uint256","name":"targetNetworkId","type":"uint256"}],"name":"movedAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"nominateNewOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"nominatedOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"outboundSumToCurrentNetwork","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"rebuildCache","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"resolver","outputs":[{"internalType":"contract AddressResolver","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"resolverAddressesRequired","outputs":[{"internalType":"bytes32[]","name":"addresses","type":"bytes32[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"crossChainStateAddress","type":"address"}],"name":"setCrossChainState","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256[]","name":"_chainIDs","type":"uint256[]"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"}],"name":"setCrossNetworkActiveDebtAll","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256[]","name":"_chainIDs","type":"uint256[]"},{"internalType":"uint256[]","name":"_issuedDebts","type":"uint256[]"},{"internalType":"uint256[]","name":"_activeDebts","type":"uint256[]"},{"internalType":"uint256","name":"_inbound","type":"uint256"}],"name":"setCrossNetworkDebtsAll","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256[]","name":"_chainIDs","type":"uint256[]"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"}],"name":"setCrossNetworkIssuedDebtAll","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"userStateDebtLedgerIndex","type":"uint256"}],"name":"setCrossNetworkUserDebt","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"debtManagerAddress","type":"address"}],"name":"setDebtManager","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_prevState","type":"address"}],"name":"setInitialCurrentIssuedDebt","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"setOutboundSumToCurrentNetwork","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"setupExpiryTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"subtractCurrentNetworkIssuedDebt","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"subtractTotalNetworkDebt","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"syncStale","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"syncTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"}]

60806040523480156200001157600080fd5b50604051620030b3380380620030b3833981016040819052620000349162000130565b6212750083856001600160a01b0381166200006c5760405162461bcd60e51b8152600401620000639062000217565b60405180910390fd5b600080546001600160a01b0319166001600160a01b0383161781556040517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c91620000b9918490620001f1565b60405180910390a150600280546001600160a01b03199081166001600160a01b039384161790915542928301600455600580548216958316959095179094556006805490941692169190911790915560075550506008805460ff1916905562000272565b80516200012a8162000258565b92915050565b600080600080608085870312156200014757600080fd5b60006200015587876200011d565b945050602062000168878288016200011d565b93505060406200017b878288016200011d565b92505060606200018e878288016200011d565b91505092959194509250565b620001a58162000244565b82525050565b620001a58162000232565b6000620001c560198362000229565b7f4f776e657220616464726573732063616e6e6f74206265203000000000000000815260200192915050565b604081016200020182856200019a565b620002106020830184620001ab565b9392505050565b602080825281016200012a81620001b6565b90815260200190565b60006001600160a01b0382166200012a565b60006200012a8260006200012a8262000232565b620002638162000232565b81146200026f57600080fd5b50565b612e3180620002826000396000f3fe608060405234801561001057600080fd5b50600436106102c85760003560e01c80636b42e5b31161017b5780639bdd7ac7116100d8578063d9a63c011161008c578063e4c16da311610071578063e4c16da3146104dc578063f14c44ed146104e4578063f2de2dee146104f7576102c8565b8063d9a63c01146104c1578063dff48488146104c9576102c8565b8063b265e218116100bd578063b265e2181461049e578063cc5c095c146104a6578063d5495e06146104ae576102c8565b80639bdd7ac71461048e578063a02a406914610496576102c8565b8063884a48bc1161012f578063899ffef411610114578063899ffef41461045e5780638bfc007c146104735780638da5cb5b14610486576102c8565b8063884a48bc14610438578063889716011461044b576102c8565b806378a52a9c1161016057806378a52a9c1461041557806379ba50971461041d57806384e2c11614610425576102c8565b80636b42e5b314610405578063741853601461040d576102c8565b806340f68cdd116102295780635082fa3f116101dd57806353fb3b0d116101c257806353fb3b0d146103e2578063564b81ef146103f557806360b3a033146103fd576102c8565b80635082fa3f146103c557806353a47bb7146103da576102c8565b806346b45af71161020e57806346b45af7146103a257806346ba2d90146103aa5780634e03d640146103b2576102c8565b806340f68cdd1461038c57806343d37e0c1461039a576102c8565b806315712139116102805780631a26f447116102655780631a26f4471461036f5780632a222dfe146103495780632af64bd314610384576102c8565b806315712139146103495780631627540c1461035c576102c8565b80630a5407fd116102b15780630a5407fd146103005780630ca1f9111461031557806313cf458414610336576102c8565b806302760d94146102cd57806304f3bcec146102eb575b600080fd5b6102d561050a565b6040516102e29190612b67565b60405180910390f35b6102f361051a565b6040516102e29190612ba3565b61031361030e366004612367565b610529565b005b6103286103233660046124ab565b61064e565b6040516102e2929190612c72565b6103136103443660046122e9565b610739565b6103136103573660046124ab565b610763565b61031361036a3660046122e9565b610766565b6103776107c4565b6040516102e29190612b59565b6103776107cd565b6103136103573660046122e9565b6103776108fd565b61037761099c565b6102d5610a16565b6103136103c03660046124ab565b610a1c565b6103cd610bb6565b6040516102e29190612a97565b6103cd610bc5565b6103136103f0366004612367565b610bd4565b6102d5610ce9565b6103cd610d63565b6102d5610d72565b610313610db4565b6102d5610f0a565b610313610f4c565b6102d5610433366004612517565b610fe8565b6103286104463660046124ab565b611078565b6103136104593660046122e9565b611140565b61046661123a565b6040516102e29190612ac0565b6103136104813660046122e9565b61135e565b6103cd611388565b6102d5611397565b6102d56113d9565b6102d56113df565b6102d56113f0565b6103136104bc3660046124ab565b6115fb565b6102d561170c565b6103136104d73660046124ab565b61171e565b6102d561177b565b6103136104f23660046123d7565b6117bd565b61031361050536600461232d565b610f06565b60006105146118f6565b90505b90565b6002546001600160a01b031681565b6006546001600160a01b0316331461055c5760405162461bcd60e51b815260040161055390612c22565b60405180910390fd5b610564610bb6565b6001600160a01b0316630a5407fd858585856040518563ffffffff1660e01b81526004016105959493929190612ad1565b600060405180830381600087803b1580156105af57600080fd5b505af11580156105c3573d6000803e3d6000fd5b50504260075550506008805460ff1916905560005b83811015610647577fd367269632fc7ec6ce27b8601e408a38f2b78c693719a69e608ee343f3b3d2c185858381811061060d57fe5b9050602002013584848481811061062057fe5b905060200201354260405161063793929190612ca8565b60405180910390a16001016105d8565b5050505050565b600080610659611a16565b9092509050631c1554d160e21b83141561067257610734565b60008061067d611b7c565b6001600160a01b0316630c71cd23866040518263ffffffff1660e01b81526004016106a89190612b67565b604080518083038186803b1580156106bf57600080fd5b505afa1580156106d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506106f791908101906124e7565b9150915061072461071f61070a84611b97565b61071387611b97565b9063ffffffff611bad16565b611bc6565b9350828061072f5750805b925050505b915091565b610741611be8565b600580546001600160a01b0319166001600160a01b0392909216919091179055565b50565b61076e611be8565b600180546001600160a01b0319166001600160a01b0383161790556040517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce22906107b9908390612a97565b60405180910390a150565b60085460ff1690565b600060606107d961123a565b905060005b81518110156108f45760008282815181106107f557fe5b602090810291909101810151600081815260039092526040918290205460025492517f21f8a7210000000000000000000000000000000000000000000000000000000081529193506001600160a01b039081169216906321f8a7219061085f908590600401612b67565b60206040518083038186803b15801561087757600080fd5b505afa15801561088b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506108af919081019061230f565b6001600160a01b03161415806108da57506000818152600360205260409020546001600160a01b0316155b156108eb5760009350505050610517565b506001016107de565b50600191505090565b600061090a600754611c14565b801561051457506109196118f6565b737ea7c696fc24bca617c3ce18845ed84c6d9edd3463d5e5e6e66040518163ffffffff1660e01b815260040160206040518083038186803b15801561095d57600080fd5b505af4158015610971573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061099591908101906124c9565b1415905090565b60006109a6611cad565b6001600160a01b03166346b45af76040518163ffffffff1660e01b815260040160206040518083038186803b1580156109de57600080fd5b505afa1580156109f2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610514919081019061248d565b60045481565b610a24610bb6565b6001600160a01b031663a872485c610a3a610bb6565b6001600160a01b031663564b81ef6040518163ffffffff1660e01b815260040160206040518083038186803b158015610a7257600080fd5b505afa158015610a86573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610aaa91908101906124c9565b836040518363ffffffff1660e01b8152600401610ac8929190612c8d565b600060405180830381600087803b158015610ae257600080fd5b505af1158015610af6573d6000803e3d6000fd5b50505050610b0381611cd8565b7f8bdd4f2c8e6f93acb14463a0ff56847cd66b543c8dc399d67d0a21eea71e190d81610b2d610bb6565b6001600160a01b031663b076f08b6040518163ffffffff1660e01b815260040160206040518083038186803b158015610b6557600080fd5b505afa158015610b79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610b9d91908101906124c9565b6008546040516107b9939291429160ff90911690612cd0565b6005546001600160a01b031690565b6001546001600160a01b031681565b6006546001600160a01b03163314610bfe5760405162461bcd60e51b815260040161055390612c22565b610c06610bb6565b6001600160a01b03166353fb3b0d858585856040518563ffffffff1660e01b8152600401610c379493929190612ad1565b600060405180830381600087803b158015610c5157600080fd5b505af1158015610c65573d6000803e3d6000fd5b50504260075550506008805460ff1916905560005b83811015610647577f573b615659a012b9fc6dc8612f02e92d026bab5fa453125ac5d97f6a07db9e0b858583818110610caf57fe5b90506020020135848484818110610cc257fe5b9050602002013542604051610cd993929190612ca8565b60405180910390a1600101610c7a565b6000610cf3610bb6565b6001600160a01b031663564b81ef6040518163ffffffff1660e01b815260040160206040518083038186803b158015610d2b57600080fd5b505afa158015610d3f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061051491908101906124c9565b6006546001600160a01b031690565b6000610d7c610bb6565b6001600160a01b031663ac96603e6040518163ffffffff1660e01b815260040160206040518083038186803b158015610d2b57600080fd5b6060610dbe61123a565b905060005b8151811015610f06576000828281518110610dda57fe5b602002602001015190506000600260009054906101000a90046001600160a01b03166001600160a01b031663dacb2d018384604051602001610e1c9190612a8c565b6040516020818303038152906040526040518363ffffffff1660e01b8152600401610e48929190612b83565b60206040518083038186803b158015610e6057600080fd5b505afa158015610e74573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610e98919081019061230f565b6000838152600360205260409081902080546001600160a01b0319166001600160a01b038416179055519091507f88a93678a3692f6789d9546fc621bf7234b101ddb7d4fe479455112831b8aa6890610ef49084908490612b75565b60405180910390a15050600101610dc3565b5050565b6000610f14610bb6565b6001600160a01b031663fac0d5416040518163ffffffff1660e01b815260040160206040518083038186803b158015610d2b57600080fd5b6001546001600160a01b03163314610f765760405162461bcd60e51b815260040161055390612bc2565b6000546001546040517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c92610fb9926001600160a01b0391821692911690612aa5565b60405180910390a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b6000610ff2611e72565b6001600160a01b03166394a8b41984846040518363ffffffff1660e01b815260040161101f929190612c8d565b60206040518083038186803b15801561103757600080fd5b505afa15801561104b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061106f91908101906124c9565b90505b92915050565b600080611083611e9d565b9150631c1554d160e21b83141561109c57506000610734565b6000806110a7611b7c565b6001600160a01b0316630c71cd23866040518263ffffffff1660e01b81526004016110d29190612b67565b604080518083038186803b1580156110e957600080fd5b505afa1580156110fd573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061112191908101906124e7565b9092509050611136848363ffffffff611edf16565b9350915050915091565b611148611be8565b60045442106111695760405162461bcd60e51b815260040161055390612c62565b611171610bb6565b6001600160a01b0316636bc60d04826001600160a01b031663b076f08b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156111b857600080fd5b505afa1580156111cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506111f091908101906124c9565b6040518263ffffffff1660e01b815260040161120c9190612b67565b600060405180830381600087803b15801561122657600080fd5b505af1158015610647573d6000803e3d6000fd5b60408051600580825260c082019092526060916020820160a0803883390190505090506844656274436163686560b81b8160008151811061127757fe5b6020026020010181815250507f4272696467655374617465705553440000000000000000000000000000000000816001815181106112b157fe5b6020026020010181815250506c45786368616e6765526174657360981b816002815181106112db57fe5b6020026020010181815250507f537570706c795363686564756c650000000000000000000000000000000000008160038151811061131557fe5b6020026020010181815250507f53797374656d53657474696e67730000000000000000000000000000000000008160048151811061134f57fe5b60200260200101818152505090565b611366611be8565b600680546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031681565b60006113a1611cad565b6001600160a01b0316639bdd7ac76040518163ffffffff1660e01b815260040160206040518083038186803b158015610d2b57600080fd5b60075490565b6000806113ea611e9d565b91505090565b6000806113fb6118f6565b905080737ea7c696fc24bca617c3ce18845ed84c6d9edd3463d5e5e6e66040518163ffffffff1660e01b815260040160206040518083038186803b15801561144257600080fd5b505af4158015611456573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061147a91908101906124c9565b10156114985760405162461bcd60e51b815260040161055390612bf2565b6114a3600754611c14565b1580611529575080737ea7c696fc24bca617c3ce18845ed84c6d9edd3463d5e5e6e66040518163ffffffff1660e01b815260040160206040518083038186803b1580156114ef57600080fd5b505af4158015611503573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061152791908101906124c9565b145b6115455760405162461bcd60e51b815260040161055390612c42565b61154d611cad565b6001600160a01b031663cc5c095c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561158557600080fd5b505afa158015611599573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506115bd91908101906124c9565b9150600082116115df5760405162461bcd60e51b815260040161055390612be2565b6113ea61071f826115ef85611b97565b9063ffffffff611ef416565b611603610bb6565b6001600160a01b031663385bb1a3611619610bb6565b6001600160a01b031663564b81ef6040518163ffffffff1660e01b815260040160206040518083038186803b15801561165157600080fd5b505afa158015611665573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061168991908101906124c9565b836040518363ffffffff1660e01b81526004016116a7929190612c8d565b600060405180830381600087803b1580156116c157600080fd5b505af11580156116d5573d6000803e3d6000fd5b505050506116e281611cd8565b7ff63087d1db604445d3ddb331ee89a4dd39a1d58f912cbe690c63bb5fae0e6c9381610b2d610bb6565b600080611717611a16565b5091505090565b6006546001600160a01b031633146117485760405162461bcd60e51b815260040161055390612c22565b611750610bb6565b6001600160a01b031663dff48488826040518263ffffffff1660e01b815260040161120c9190612b67565b6000611785610bb6565b6001600160a01b0316633eb767156040518163ffffffff1660e01b815260040160206040518083038186803b158015610d2b57600080fd5b6006546001600160a01b031633146117e75760405162461bcd60e51b815260040161055390612c22565b6117ef610bb6565b6001600160a01b031663f14c44ed888888888888886040518863ffffffff1660e01b81526004016118269796959493929190612b02565b600060405180830381600087803b15801561184057600080fd5b505af1158015611854573d6000803e3d6000fd5b50504260075550506008805460ff1916905560005b868110156118ec577f274cfe27e7b48429b318b8e3a5f1a15cf65877a6bc0ac509cbceb73cbab5478b88888381811061189e57fe5b905060200201358787848181106118b157fe5b905060200201358686858181106118c457fe5b90506020020135426040516118dc9493929190612d0e565b60405180910390a1600101611869565b5050505050505050565b600080611901610bb6565b6001600160a01b0316637f5535136040518163ffffffff1660e01b815260040160206040518083038186803b15801561193957600080fd5b505afa15801561194d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061197191908101906124c9565b9050801561199a5761199561198582611b97565b610713611990611e9d565b611b97565b6113ea565b737ea7c696fc24bca617c3ce18845ed84c6d9edd3463d5e5e6e66040518163ffffffff1660e01b815260040160206040518083038186803b1580156119de57600080fd5b505af41580156119f2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506113ea91908101906124c9565b6000806000611a23611f0d565b6001600160a01b0316633a900a2e6040518163ffffffff1660e01b815260040160806040518083038186803b158015611a5b57600080fd5b505afa158015611a6f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611a939190810190612536565b929550935090915082905080611aa65750805b9150600080611ab3611f24565b9092509050611ad882611acc878463ffffffff6120ad16565b9063ffffffff6120d216565b9450611b7361071f611ae86118f6565b6115ef611990611af6610bb6565b6001600160a01b031663fac0d5416040518163ffffffff1660e01b815260040160206040518083038186803b158015611b2e57600080fd5b505afa158015611b42573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611b6691908101906124c9565b8a9063ffffffff6120ad16565b94505050509091565b60006105146c45786368616e6765526174657360981b6120fa565b600061107282633b9aca0063ffffffff61215e16565b600061106f83836b033b2e3c9fd0803ce8000000612198565b60006305f5e10082046005600a820610611bde57600a015b600a900492915050565b6000546001600160a01b03163314611c125760405162461bcd60e51b815260040161055390612c32565b565b6000814203611c216121de565b6001600160a01b031663af5355d86040518163ffffffff1660e01b815260040160206040518083038186803b158015611c5957600080fd5b505afa158015611c6d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611c9191908101906124c9565b1080611c9b575081155b8061107257505060085460ff16919050565b60006105147f537570706c795363686564756c650000000000000000000000000000000000006120fa565b6000611ce2610bb6565b6001600160a01b031663b076f08b6040518163ffffffff1660e01b815260040160206040518083038186803b158015611d1a57600080fd5b505afa158015611d2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611d5291908101906124c9565b118015611e5d5750611d626121de565b6001600160a01b031663680a17186040518163ffffffff1660e01b815260040160206040518083038186803b158015611d9a57600080fd5b505afa158015611dae573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611dd291908101906124c9565b611e5a611ddd610bb6565b6001600160a01b031663b076f08b6040518163ffffffff1660e01b815260040160206040518083038186803b158015611e1557600080fd5b505afa158015611e29573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611e4d91908101906124c9565b839063ffffffff611edf16565b10155b15610763576008805460ff1916600117905550565b60006105147f42726964676553746174657055534400000000000000000000000000000000006120fa565b6000611ea7610bb6565b6001600160a01b031663b076f08b6040518163ffffffff1660e01b815260040160206040518083038186803b158015610d2b57600080fd5b600061106f8383670de0b6b3a7640000612198565b600061106f83836b033b2e3c9fd0803ce8000000612209565b60006105146844656274436163686560b81b6120fa565b600080611f2f611e72565b6001600160a01b031663663c2dae6040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6757600080fd5b505afa158015611f7b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611f9f91908101906124c9565b9050611fa9611e72565b6001600160a01b031663fc9ff1216040518163ffffffff1660e01b815260040160206040518083038186803b158015611fe157600080fd5b505afa158015611ff5573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061201991908101906124c9565b91506000612025610bb6565b6001600160a01b031663ac96603e6040518163ffffffff1660e01b815260040160206040518083038186803b15801561205d57600080fd5b505afa158015612071573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061209591908101906124c9565b90508083106120a457826120a6565b805b9250509091565b60008282018381101561106f5760405162461bcd60e51b815260040161055390612bd2565b6000828211156120f45760405162461bcd60e51b815260040161055390612c02565b50900390565b60008181526003602090815260408083205490516001600160a01b03909116918215159161212a91869101612a6c565b604051602081830303815290604052906121575760405162461bcd60e51b81526004016105539190612bb1565b5092915050565b60008261216d57506000611072565b8282028284828161217a57fe5b041461106f5760405162461bcd60e51b815260040161055390612c52565b6000806121be846121b287600a870263ffffffff61215e16565b9063ffffffff61223416565b90506005600a825b06106121d057600a015b600a900490505b9392505050565b60006105147f53797374656d53657474696e67730000000000000000000000000000000000006120fa565b600080600a8304612220868663ffffffff61215e16565b8161222757fe5b0490506005600a826121c6565b60008082116122555760405162461bcd60e51b815260040161055390612c12565b600082848161226057fe5b04949350505050565b803561107281612dc8565b805161107281612dc8565b60008083601f84011261229157600080fd5b50813567ffffffffffffffff8111156122a957600080fd5b6020830191508360208202830111156122c157600080fd5b9250929050565b805161107281612ddc565b803561107281612de5565b805161107281612de5565b6000602082840312156122fb57600080fd5b60006123078484612269565b949350505050565b60006020828403121561232157600080fd5b60006123078484612274565b6000806040838503121561234057600080fd5b600061234c8585612269565b925050602061235d858286016122d3565b9150509250929050565b6000806000806040858703121561237d57600080fd5b843567ffffffffffffffff81111561239457600080fd5b6123a08782880161227f565b9450945050602085013567ffffffffffffffff8111156123bf57600080fd5b6123cb8782880161227f565b95989497509550505050565b60008060008060008060006080888a0312156123f257600080fd5b873567ffffffffffffffff81111561240957600080fd5b6124158a828b0161227f565b9750975050602088013567ffffffffffffffff81111561243457600080fd5b6124408a828b0161227f565b9550955050604088013567ffffffffffffffff81111561245f57600080fd5b61246b8a828b0161227f565b9350935050606061247e8a828b016122d3565b91505092959891949750929550565b60006020828403121561249f57600080fd5b600061230784846122c8565b6000602082840312156124bd57600080fd5b600061230784846122d3565b6000602082840312156124db57600080fd5b600061230784846122de565b600080604083850312156124fa57600080fd5b600061250685856122de565b925050602061235d858286016122c8565b6000806040838503121561252a57600080fd5b600061234c85856122d3565b6000806000806080858703121561254c57600080fd5b600061255887876122de565b9450506020612569878288016122de565b935050604061257a878288016122c8565b925050606061258b878288016122c8565b91505092959194509250565b60006125a3838361266e565b505060200190565b6125b481612d5b565b82525050565b60006125c582612d49565b6125cf8185612d4d565b93506125da83612d43565b8060005b838110156126085781516125f28882612597565b97506125fd83612d43565b9250506001016125de565b509495945050505050565b600061261f8385612d4d565b93507f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83111561264e57600080fd5b60208302925061265f838584612d82565b50500190565b6125b481612d66565b6125b481610517565b6125b461268382610517565b610517565b6125b481612d77565b600061269c82612d49565b6126a68185612d4d565b93506126b6818560208601612d8e565b6126bf81612dbe565b9093019392505050565b60006126d6603583612d4d565b7f596f75206d757374206265206e6f6d696e61746564206265666f726520796f7581527f2063616e20616363657074206f776e6572736869700000000000000000000000602082015260400192915050565b6000612735601b83612d4d565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000815260200192915050565b600061276e601283612d4d565b7f4e6f206d696e7461626c6520737570706c790000000000000000000000000000815260200192915050565b60006127a7601483612d4d565b7f4e6574776f726b207261746520696e76616c6964000000000000000000000000815260200192915050565b60006127e0601e83612d4d565b7f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815260200192915050565b6000612819601a83612d4d565b7f536166654d6174683a206469766973696f6e206279207a65726f000000000000815260200192915050565b6000612852601183612d56565b7f4d697373696e6720616464726573733a20000000000000000000000000000000815260110192915050565b600061288b602d83612d4d565b7f4f6e6c79207468652064656274206d616e61676572206d617920706572666f7281527f6d207468697320616374696f6e00000000000000000000000000000000000000602082015260400192915050565b60006128ea602f83612d4d565b7f4f6e6c792074686520636f6e7472616374206f776e6572206d6179207065726681527f6f726d207468697320616374696f6e0000000000000000000000000000000000602082015260400192915050565b6000612949601983612d4d565b7f43726f737320636861696e2064656274206973207374616c6500000000000000815260200192915050565b6000612982602183612d4d565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f81527f7700000000000000000000000000000000000000000000000000000000000000602082015260400192915050565b60006129e1602983612d4d565b7f43616e206f6e6c7920706572666f726d207468697320616374696f6e2064757281527f696e672073657475700000000000000000000000000000000000000000000000602082015260400192915050565b6000612a40601983612d56565b7f5265736f6c766572206d697373696e67207461726765743a2000000000000000815260190192915050565b6000612a7782612845565b9150612a838284612677565b50602001919050565b6000612a7782612a33565b6020810161107282846125ab565b60408101612ab382856125ab565b6121d760208301846125ab565b6020808252810161106f81846125ba565b60408082528101612ae3818688612613565b90508181036020830152612af8818486612613565b9695505050505050565b60808082528101612b1481898b612613565b90508181036020830152612b29818789612613565b90508181036040830152612b3e818587612613565b9050612b4d606083018461266e565b98975050505050505050565b602081016110728284612665565b60208101611072828461266e565b60408101612ab3828561266e565b60408101612b91828561266e565b81810360208301526123078184612691565b602081016110728284612688565b6020808252810161106f8184612691565b60208082528101611072816126c9565b6020808252810161107281612728565b6020808252810161107281612761565b602080825281016110728161279a565b60208082528101611072816127d3565b602080825281016110728161280c565b602080825281016110728161287e565b60208082528101611072816128dd565b602080825281016110728161293c565b6020808252810161107281612975565b60208082528101611072816129d4565b60408101612c80828561266e565b6121d76020830184612665565b60408101612c9b828561266e565b6121d7602083018461266e565b60608101612cb6828661266e565b612cc3602083018561266e565b612307604083018461266e565b60808101612cde828761266e565b612ceb602083018661266e565b612cf8604083018561266e565b612d056060830184612665565b95945050505050565b60808101612d1c828761266e565b612d29602083018661266e565b612d36604083018561266e565b612d05606083018461266e565b60200190565b5190565b90815260200190565b919050565b600061107282612d6b565b151590565b6001600160a01b031690565b600061107282612d5b565b82818337506000910152565b60005b83811015612da9578181015183820152602001612d91565b83811115612db8576000848401525b50505050565b601f01601f191690565b612dd181612d5b565b811461076357600080fd5b612dd181612d66565b612dd18161051756fea365627a7a723158203b7bbd2af1e6b45f7b3dad3ef93908da636cc2fca849ecfa5da1300039b9d84d6c6578706572696d656e74616cf564736f6c634300051000400000000000000000000000001c19d81a6f11958d58130ddbc505933426c8036900000000000000000000000072ec0eab4c52bd9299ce4599e694ace08076fba3000000000000000000000000a0d2eb4be11853ba5865e3ff96008ec96d82b08a00000000000000000000000008a76fb0b5511b0a10dc4141c4dad6e2471803ba

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106102c85760003560e01c80636b42e5b31161017b5780639bdd7ac7116100d8578063d9a63c011161008c578063e4c16da311610071578063e4c16da3146104dc578063f14c44ed146104e4578063f2de2dee146104f7576102c8565b8063d9a63c01146104c1578063dff48488146104c9576102c8565b8063b265e218116100bd578063b265e2181461049e578063cc5c095c146104a6578063d5495e06146104ae576102c8565b80639bdd7ac71461048e578063a02a406914610496576102c8565b8063884a48bc1161012f578063899ffef411610114578063899ffef41461045e5780638bfc007c146104735780638da5cb5b14610486576102c8565b8063884a48bc14610438578063889716011461044b576102c8565b806378a52a9c1161016057806378a52a9c1461041557806379ba50971461041d57806384e2c11614610425576102c8565b80636b42e5b314610405578063741853601461040d576102c8565b806340f68cdd116102295780635082fa3f116101dd57806353fb3b0d116101c257806353fb3b0d146103e2578063564b81ef146103f557806360b3a033146103fd576102c8565b80635082fa3f146103c557806353a47bb7146103da576102c8565b806346b45af71161020e57806346b45af7146103a257806346ba2d90146103aa5780634e03d640146103b2576102c8565b806340f68cdd1461038c57806343d37e0c1461039a576102c8565b806315712139116102805780631a26f447116102655780631a26f4471461036f5780632a222dfe146103495780632af64bd314610384576102c8565b806315712139146103495780631627540c1461035c576102c8565b80630a5407fd116102b15780630a5407fd146103005780630ca1f9111461031557806313cf458414610336576102c8565b806302760d94146102cd57806304f3bcec146102eb575b600080fd5b6102d561050a565b6040516102e29190612b67565b60405180910390f35b6102f361051a565b6040516102e29190612ba3565b61031361030e366004612367565b610529565b005b6103286103233660046124ab565b61064e565b6040516102e2929190612c72565b6103136103443660046122e9565b610739565b6103136103573660046124ab565b610763565b61031361036a3660046122e9565b610766565b6103776107c4565b6040516102e29190612b59565b6103776107cd565b6103136103573660046122e9565b6103776108fd565b61037761099c565b6102d5610a16565b6103136103c03660046124ab565b610a1c565b6103cd610bb6565b6040516102e29190612a97565b6103cd610bc5565b6103136103f0366004612367565b610bd4565b6102d5610ce9565b6103cd610d63565b6102d5610d72565b610313610db4565b6102d5610f0a565b610313610f4c565b6102d5610433366004612517565b610fe8565b6103286104463660046124ab565b611078565b6103136104593660046122e9565b611140565b61046661123a565b6040516102e29190612ac0565b6103136104813660046122e9565b61135e565b6103cd611388565b6102d5611397565b6102d56113d9565b6102d56113df565b6102d56113f0565b6103136104bc3660046124ab565b6115fb565b6102d561170c565b6103136104d73660046124ab565b61171e565b6102d561177b565b6103136104f23660046123d7565b6117bd565b61031361050536600461232d565b610f06565b60006105146118f6565b90505b90565b6002546001600160a01b031681565b6006546001600160a01b0316331461055c5760405162461bcd60e51b815260040161055390612c22565b60405180910390fd5b610564610bb6565b6001600160a01b0316630a5407fd858585856040518563ffffffff1660e01b81526004016105959493929190612ad1565b600060405180830381600087803b1580156105af57600080fd5b505af11580156105c3573d6000803e3d6000fd5b50504260075550506008805460ff1916905560005b83811015610647577fd367269632fc7ec6ce27b8601e408a38f2b78c693719a69e608ee343f3b3d2c185858381811061060d57fe5b9050602002013584848481811061062057fe5b905060200201354260405161063793929190612ca8565b60405180910390a16001016105d8565b5050505050565b600080610659611a16565b9092509050631c1554d160e21b83141561067257610734565b60008061067d611b7c565b6001600160a01b0316630c71cd23866040518263ffffffff1660e01b81526004016106a89190612b67565b604080518083038186803b1580156106bf57600080fd5b505afa1580156106d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506106f791908101906124e7565b9150915061072461071f61070a84611b97565b61071387611b97565b9063ffffffff611bad16565b611bc6565b9350828061072f5750805b925050505b915091565b610741611be8565b600580546001600160a01b0319166001600160a01b0392909216919091179055565b50565b61076e611be8565b600180546001600160a01b0319166001600160a01b0383161790556040517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce22906107b9908390612a97565b60405180910390a150565b60085460ff1690565b600060606107d961123a565b905060005b81518110156108f45760008282815181106107f557fe5b602090810291909101810151600081815260039092526040918290205460025492517f21f8a7210000000000000000000000000000000000000000000000000000000081529193506001600160a01b039081169216906321f8a7219061085f908590600401612b67565b60206040518083038186803b15801561087757600080fd5b505afa15801561088b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506108af919081019061230f565b6001600160a01b03161415806108da57506000818152600360205260409020546001600160a01b0316155b156108eb5760009350505050610517565b506001016107de565b50600191505090565b600061090a600754611c14565b801561051457506109196118f6565b737ea7c696fc24bca617c3ce18845ed84c6d9edd3463d5e5e6e66040518163ffffffff1660e01b815260040160206040518083038186803b15801561095d57600080fd5b505af4158015610971573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061099591908101906124c9565b1415905090565b60006109a6611cad565b6001600160a01b03166346b45af76040518163ffffffff1660e01b815260040160206040518083038186803b1580156109de57600080fd5b505afa1580156109f2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610514919081019061248d565b60045481565b610a24610bb6565b6001600160a01b031663a872485c610a3a610bb6565b6001600160a01b031663564b81ef6040518163ffffffff1660e01b815260040160206040518083038186803b158015610a7257600080fd5b505afa158015610a86573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610aaa91908101906124c9565b836040518363ffffffff1660e01b8152600401610ac8929190612c8d565b600060405180830381600087803b158015610ae257600080fd5b505af1158015610af6573d6000803e3d6000fd5b50505050610b0381611cd8565b7f8bdd4f2c8e6f93acb14463a0ff56847cd66b543c8dc399d67d0a21eea71e190d81610b2d610bb6565b6001600160a01b031663b076f08b6040518163ffffffff1660e01b815260040160206040518083038186803b158015610b6557600080fd5b505afa158015610b79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610b9d91908101906124c9565b6008546040516107b9939291429160ff90911690612cd0565b6005546001600160a01b031690565b6001546001600160a01b031681565b6006546001600160a01b03163314610bfe5760405162461bcd60e51b815260040161055390612c22565b610c06610bb6565b6001600160a01b03166353fb3b0d858585856040518563ffffffff1660e01b8152600401610c379493929190612ad1565b600060405180830381600087803b158015610c5157600080fd5b505af1158015610c65573d6000803e3d6000fd5b50504260075550506008805460ff1916905560005b83811015610647577f573b615659a012b9fc6dc8612f02e92d026bab5fa453125ac5d97f6a07db9e0b858583818110610caf57fe5b90506020020135848484818110610cc257fe5b9050602002013542604051610cd993929190612ca8565b60405180910390a1600101610c7a565b6000610cf3610bb6565b6001600160a01b031663564b81ef6040518163ffffffff1660e01b815260040160206040518083038186803b158015610d2b57600080fd5b505afa158015610d3f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061051491908101906124c9565b6006546001600160a01b031690565b6000610d7c610bb6565b6001600160a01b031663ac96603e6040518163ffffffff1660e01b815260040160206040518083038186803b158015610d2b57600080fd5b6060610dbe61123a565b905060005b8151811015610f06576000828281518110610dda57fe5b602002602001015190506000600260009054906101000a90046001600160a01b03166001600160a01b031663dacb2d018384604051602001610e1c9190612a8c565b6040516020818303038152906040526040518363ffffffff1660e01b8152600401610e48929190612b83565b60206040518083038186803b158015610e6057600080fd5b505afa158015610e74573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610e98919081019061230f565b6000838152600360205260409081902080546001600160a01b0319166001600160a01b038416179055519091507f88a93678a3692f6789d9546fc621bf7234b101ddb7d4fe479455112831b8aa6890610ef49084908490612b75565b60405180910390a15050600101610dc3565b5050565b6000610f14610bb6565b6001600160a01b031663fac0d5416040518163ffffffff1660e01b815260040160206040518083038186803b158015610d2b57600080fd5b6001546001600160a01b03163314610f765760405162461bcd60e51b815260040161055390612bc2565b6000546001546040517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c92610fb9926001600160a01b0391821692911690612aa5565b60405180910390a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b6000610ff2611e72565b6001600160a01b03166394a8b41984846040518363ffffffff1660e01b815260040161101f929190612c8d565b60206040518083038186803b15801561103757600080fd5b505afa15801561104b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061106f91908101906124c9565b90505b92915050565b600080611083611e9d565b9150631c1554d160e21b83141561109c57506000610734565b6000806110a7611b7c565b6001600160a01b0316630c71cd23866040518263ffffffff1660e01b81526004016110d29190612b67565b604080518083038186803b1580156110e957600080fd5b505afa1580156110fd573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061112191908101906124e7565b9092509050611136848363ffffffff611edf16565b9350915050915091565b611148611be8565b60045442106111695760405162461bcd60e51b815260040161055390612c62565b611171610bb6565b6001600160a01b0316636bc60d04826001600160a01b031663b076f08b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156111b857600080fd5b505afa1580156111cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506111f091908101906124c9565b6040518263ffffffff1660e01b815260040161120c9190612b67565b600060405180830381600087803b15801561122657600080fd5b505af1158015610647573d6000803e3d6000fd5b60408051600580825260c082019092526060916020820160a0803883390190505090506844656274436163686560b81b8160008151811061127757fe5b6020026020010181815250507f4272696467655374617465705553440000000000000000000000000000000000816001815181106112b157fe5b6020026020010181815250506c45786368616e6765526174657360981b816002815181106112db57fe5b6020026020010181815250507f537570706c795363686564756c650000000000000000000000000000000000008160038151811061131557fe5b6020026020010181815250507f53797374656d53657474696e67730000000000000000000000000000000000008160048151811061134f57fe5b60200260200101818152505090565b611366611be8565b600680546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031681565b60006113a1611cad565b6001600160a01b0316639bdd7ac76040518163ffffffff1660e01b815260040160206040518083038186803b158015610d2b57600080fd5b60075490565b6000806113ea611e9d565b91505090565b6000806113fb6118f6565b905080737ea7c696fc24bca617c3ce18845ed84c6d9edd3463d5e5e6e66040518163ffffffff1660e01b815260040160206040518083038186803b15801561144257600080fd5b505af4158015611456573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061147a91908101906124c9565b10156114985760405162461bcd60e51b815260040161055390612bf2565b6114a3600754611c14565b1580611529575080737ea7c696fc24bca617c3ce18845ed84c6d9edd3463d5e5e6e66040518163ffffffff1660e01b815260040160206040518083038186803b1580156114ef57600080fd5b505af4158015611503573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061152791908101906124c9565b145b6115455760405162461bcd60e51b815260040161055390612c42565b61154d611cad565b6001600160a01b031663cc5c095c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561158557600080fd5b505afa158015611599573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506115bd91908101906124c9565b9150600082116115df5760405162461bcd60e51b815260040161055390612be2565b6113ea61071f826115ef85611b97565b9063ffffffff611ef416565b611603610bb6565b6001600160a01b031663385bb1a3611619610bb6565b6001600160a01b031663564b81ef6040518163ffffffff1660e01b815260040160206040518083038186803b15801561165157600080fd5b505afa158015611665573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061168991908101906124c9565b836040518363ffffffff1660e01b81526004016116a7929190612c8d565b600060405180830381600087803b1580156116c157600080fd5b505af11580156116d5573d6000803e3d6000fd5b505050506116e281611cd8565b7ff63087d1db604445d3ddb331ee89a4dd39a1d58f912cbe690c63bb5fae0e6c9381610b2d610bb6565b600080611717611a16565b5091505090565b6006546001600160a01b031633146117485760405162461bcd60e51b815260040161055390612c22565b611750610bb6565b6001600160a01b031663dff48488826040518263ffffffff1660e01b815260040161120c9190612b67565b6000611785610bb6565b6001600160a01b0316633eb767156040518163ffffffff1660e01b815260040160206040518083038186803b158015610d2b57600080fd5b6006546001600160a01b031633146117e75760405162461bcd60e51b815260040161055390612c22565b6117ef610bb6565b6001600160a01b031663f14c44ed888888888888886040518863ffffffff1660e01b81526004016118269796959493929190612b02565b600060405180830381600087803b15801561184057600080fd5b505af1158015611854573d6000803e3d6000fd5b50504260075550506008805460ff1916905560005b868110156118ec577f274cfe27e7b48429b318b8e3a5f1a15cf65877a6bc0ac509cbceb73cbab5478b88888381811061189e57fe5b905060200201358787848181106118b157fe5b905060200201358686858181106118c457fe5b90506020020135426040516118dc9493929190612d0e565b60405180910390a1600101611869565b5050505050505050565b600080611901610bb6565b6001600160a01b0316637f5535136040518163ffffffff1660e01b815260040160206040518083038186803b15801561193957600080fd5b505afa15801561194d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061197191908101906124c9565b9050801561199a5761199561198582611b97565b610713611990611e9d565b611b97565b6113ea565b737ea7c696fc24bca617c3ce18845ed84c6d9edd3463d5e5e6e66040518163ffffffff1660e01b815260040160206040518083038186803b1580156119de57600080fd5b505af41580156119f2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506113ea91908101906124c9565b6000806000611a23611f0d565b6001600160a01b0316633a900a2e6040518163ffffffff1660e01b815260040160806040518083038186803b158015611a5b57600080fd5b505afa158015611a6f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611a939190810190612536565b929550935090915082905080611aa65750805b9150600080611ab3611f24565b9092509050611ad882611acc878463ffffffff6120ad16565b9063ffffffff6120d216565b9450611b7361071f611ae86118f6565b6115ef611990611af6610bb6565b6001600160a01b031663fac0d5416040518163ffffffff1660e01b815260040160206040518083038186803b158015611b2e57600080fd5b505afa158015611b42573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611b6691908101906124c9565b8a9063ffffffff6120ad16565b94505050509091565b60006105146c45786368616e6765526174657360981b6120fa565b600061107282633b9aca0063ffffffff61215e16565b600061106f83836b033b2e3c9fd0803ce8000000612198565b60006305f5e10082046005600a820610611bde57600a015b600a900492915050565b6000546001600160a01b03163314611c125760405162461bcd60e51b815260040161055390612c32565b565b6000814203611c216121de565b6001600160a01b031663af5355d86040518163ffffffff1660e01b815260040160206040518083038186803b158015611c5957600080fd5b505afa158015611c6d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611c9191908101906124c9565b1080611c9b575081155b8061107257505060085460ff16919050565b60006105147f537570706c795363686564756c650000000000000000000000000000000000006120fa565b6000611ce2610bb6565b6001600160a01b031663b076f08b6040518163ffffffff1660e01b815260040160206040518083038186803b158015611d1a57600080fd5b505afa158015611d2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611d5291908101906124c9565b118015611e5d5750611d626121de565b6001600160a01b031663680a17186040518163ffffffff1660e01b815260040160206040518083038186803b158015611d9a57600080fd5b505afa158015611dae573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611dd291908101906124c9565b611e5a611ddd610bb6565b6001600160a01b031663b076f08b6040518163ffffffff1660e01b815260040160206040518083038186803b158015611e1557600080fd5b505afa158015611e29573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611e4d91908101906124c9565b839063ffffffff611edf16565b10155b15610763576008805460ff1916600117905550565b60006105147f42726964676553746174657055534400000000000000000000000000000000006120fa565b6000611ea7610bb6565b6001600160a01b031663b076f08b6040518163ffffffff1660e01b815260040160206040518083038186803b158015610d2b57600080fd5b600061106f8383670de0b6b3a7640000612198565b600061106f83836b033b2e3c9fd0803ce8000000612209565b60006105146844656274436163686560b81b6120fa565b600080611f2f611e72565b6001600160a01b031663663c2dae6040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6757600080fd5b505afa158015611f7b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611f9f91908101906124c9565b9050611fa9611e72565b6001600160a01b031663fc9ff1216040518163ffffffff1660e01b815260040160206040518083038186803b158015611fe157600080fd5b505afa158015611ff5573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061201991908101906124c9565b91506000612025610bb6565b6001600160a01b031663ac96603e6040518163ffffffff1660e01b815260040160206040518083038186803b15801561205d57600080fd5b505afa158015612071573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061209591908101906124c9565b90508083106120a457826120a6565b805b9250509091565b60008282018381101561106f5760405162461bcd60e51b815260040161055390612bd2565b6000828211156120f45760405162461bcd60e51b815260040161055390612c02565b50900390565b60008181526003602090815260408083205490516001600160a01b03909116918215159161212a91869101612a6c565b604051602081830303815290604052906121575760405162461bcd60e51b81526004016105539190612bb1565b5092915050565b60008261216d57506000611072565b8282028284828161217a57fe5b041461106f5760405162461bcd60e51b815260040161055390612c52565b6000806121be846121b287600a870263ffffffff61215e16565b9063ffffffff61223416565b90506005600a825b06106121d057600a015b600a900490505b9392505050565b60006105147f53797374656d53657474696e67730000000000000000000000000000000000006120fa565b600080600a8304612220868663ffffffff61215e16565b8161222757fe5b0490506005600a826121c6565b60008082116122555760405162461bcd60e51b815260040161055390612c12565b600082848161226057fe5b04949350505050565b803561107281612dc8565b805161107281612dc8565b60008083601f84011261229157600080fd5b50813567ffffffffffffffff8111156122a957600080fd5b6020830191508360208202830111156122c157600080fd5b9250929050565b805161107281612ddc565b803561107281612de5565b805161107281612de5565b6000602082840312156122fb57600080fd5b60006123078484612269565b949350505050565b60006020828403121561232157600080fd5b60006123078484612274565b6000806040838503121561234057600080fd5b600061234c8585612269565b925050602061235d858286016122d3565b9150509250929050565b6000806000806040858703121561237d57600080fd5b843567ffffffffffffffff81111561239457600080fd5b6123a08782880161227f565b9450945050602085013567ffffffffffffffff8111156123bf57600080fd5b6123cb8782880161227f565b95989497509550505050565b60008060008060008060006080888a0312156123f257600080fd5b873567ffffffffffffffff81111561240957600080fd5b6124158a828b0161227f565b9750975050602088013567ffffffffffffffff81111561243457600080fd5b6124408a828b0161227f565b9550955050604088013567ffffffffffffffff81111561245f57600080fd5b61246b8a828b0161227f565b9350935050606061247e8a828b016122d3565b91505092959891949750929550565b60006020828403121561249f57600080fd5b600061230784846122c8565b6000602082840312156124bd57600080fd5b600061230784846122d3565b6000602082840312156124db57600080fd5b600061230784846122de565b600080604083850312156124fa57600080fd5b600061250685856122de565b925050602061235d858286016122c8565b6000806040838503121561252a57600080fd5b600061234c85856122d3565b6000806000806080858703121561254c57600080fd5b600061255887876122de565b9450506020612569878288016122de565b935050604061257a878288016122c8565b925050606061258b878288016122c8565b91505092959194509250565b60006125a3838361266e565b505060200190565b6125b481612d5b565b82525050565b60006125c582612d49565b6125cf8185612d4d565b93506125da83612d43565b8060005b838110156126085781516125f28882612597565b97506125fd83612d43565b9250506001016125de565b509495945050505050565b600061261f8385612d4d565b93507f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83111561264e57600080fd5b60208302925061265f838584612d82565b50500190565b6125b481612d66565b6125b481610517565b6125b461268382610517565b610517565b6125b481612d77565b600061269c82612d49565b6126a68185612d4d565b93506126b6818560208601612d8e565b6126bf81612dbe565b9093019392505050565b60006126d6603583612d4d565b7f596f75206d757374206265206e6f6d696e61746564206265666f726520796f7581527f2063616e20616363657074206f776e6572736869700000000000000000000000602082015260400192915050565b6000612735601b83612d4d565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000815260200192915050565b600061276e601283612d4d565b7f4e6f206d696e7461626c6520737570706c790000000000000000000000000000815260200192915050565b60006127a7601483612d4d565b7f4e6574776f726b207261746520696e76616c6964000000000000000000000000815260200192915050565b60006127e0601e83612d4d565b7f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815260200192915050565b6000612819601a83612d4d565b7f536166654d6174683a206469766973696f6e206279207a65726f000000000000815260200192915050565b6000612852601183612d56565b7f4d697373696e6720616464726573733a20000000000000000000000000000000815260110192915050565b600061288b602d83612d4d565b7f4f6e6c79207468652064656274206d616e61676572206d617920706572666f7281527f6d207468697320616374696f6e00000000000000000000000000000000000000602082015260400192915050565b60006128ea602f83612d4d565b7f4f6e6c792074686520636f6e7472616374206f776e6572206d6179207065726681527f6f726d207468697320616374696f6e0000000000000000000000000000000000602082015260400192915050565b6000612949601983612d4d565b7f43726f737320636861696e2064656274206973207374616c6500000000000000815260200192915050565b6000612982602183612d4d565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f81527f7700000000000000000000000000000000000000000000000000000000000000602082015260400192915050565b60006129e1602983612d4d565b7f43616e206f6e6c7920706572666f726d207468697320616374696f6e2064757281527f696e672073657475700000000000000000000000000000000000000000000000602082015260400192915050565b6000612a40601983612d56565b7f5265736f6c766572206d697373696e67207461726765743a2000000000000000815260190192915050565b6000612a7782612845565b9150612a838284612677565b50602001919050565b6000612a7782612a33565b6020810161107282846125ab565b60408101612ab382856125ab565b6121d760208301846125ab565b6020808252810161106f81846125ba565b60408082528101612ae3818688612613565b90508181036020830152612af8818486612613565b9695505050505050565b60808082528101612b1481898b612613565b90508181036020830152612b29818789612613565b90508181036040830152612b3e818587612613565b9050612b4d606083018461266e565b98975050505050505050565b602081016110728284612665565b60208101611072828461266e565b60408101612ab3828561266e565b60408101612b91828561266e565b81810360208301526123078184612691565b602081016110728284612688565b6020808252810161106f8184612691565b60208082528101611072816126c9565b6020808252810161107281612728565b6020808252810161107281612761565b602080825281016110728161279a565b60208082528101611072816127d3565b602080825281016110728161280c565b602080825281016110728161287e565b60208082528101611072816128dd565b602080825281016110728161293c565b6020808252810161107281612975565b60208082528101611072816129d4565b60408101612c80828561266e565b6121d76020830184612665565b60408101612c9b828561266e565b6121d7602083018461266e565b60608101612cb6828661266e565b612cc3602083018561266e565b612307604083018461266e565b60808101612cde828761266e565b612ceb602083018661266e565b612cf8604083018561266e565b612d056060830184612665565b95945050505050565b60808101612d1c828761266e565b612d29602083018661266e565b612d36604083018561266e565b612d05606083018461266e565b60200190565b5190565b90815260200190565b919050565b600061107282612d6b565b151590565b6001600160a01b031690565b600061107282612d5b565b82818337506000910152565b60005b83811015612da9578181015183820152602001612d91565b83811115612db8576000848401525b50505050565b601f01601f191690565b612dd181612d5b565b811461076357600080fd5b612dd181612d66565b612dd18161051756fea365627a7a723158203b7bbd2af1e6b45f7b3dad3ef93908da636cc2fca849ecfa5da1300039b9d84d6c6578706572696d656e74616cf564736f6c63430005100040

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

0000000000000000000000001c19d81a6f11958d58130ddbc505933426c8036900000000000000000000000072ec0eab4c52bd9299ce4599e694ace08076fba3000000000000000000000000a0d2eb4be11853ba5865e3ff96008ec96d82b08a00000000000000000000000008a76fb0b5511b0a10dc4141c4dad6e2471803ba

-----Decoded View---------------
Arg [0] : _owner (address): 0x1c19D81a6F11958D58130DdbC505933426C80369
Arg [1] : _resolver (address): 0x72EC0EaB4C52Bd9299CE4599E694ACE08076fba3
Arg [2] : _crossChainStateAddress (address): 0xa0D2eb4BE11853BA5865E3ff96008EC96D82b08a
Arg [3] : _debtManagerAddress (address): 0x08a76Fb0B5511b0a10DC4141C4DAD6E2471803ba

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 0000000000000000000000001c19d81a6f11958d58130ddbc505933426c80369
Arg [1] : 00000000000000000000000072ec0eab4c52bd9299ce4599e694ace08076fba3
Arg [2] : 000000000000000000000000a0d2eb4be11853ba5865e3ff96008ec96d82b08a
Arg [3] : 00000000000000000000000008a76fb0b5511b0a10dc4141c4dad6e2471803ba


Library Used


Block Transaction Gas Used Reward
view all blocks collator

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

Validator Index Block Amount
View All Withdrawals

Transaction 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.