ETH Price: $3,390.45 (+1.28%)

Contract

0xCd9D4988C0AE61887B075bA77f08cbFAd2b65068
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Deposit144052752022-03-17 17:10:311012 days ago1647537031IN
Synthetix: L2 Deposit
0 ETH0.0221231986.15689832
Deposit144051952022-03-17 16:52:561012 days ago1647535976IN
Synthetix: L2 Deposit
0 ETH0.0235426390.70906298
Deposit144047262022-03-17 15:01:481012 days ago1647529308IN
Synthetix: L2 Deposit
0 ETH0.02948966114.86107834
Deposit144038832022-03-17 11:57:531012 days ago1647518273IN
Synthetix: L2 Deposit
0 ETH0.0076571729.8243919
Deposit144036162022-03-17 11:00:201012 days ago1647514820IN
Synthetix: L2 Deposit
0 ETH0.0054478921.21635988
Deposit144028882022-03-17 8:14:091012 days ago1647504849IN
Synthetix: L2 Deposit
0 ETH0.0046666718.17482592
Deposit144028112022-03-17 7:58:251012 days ago1647503905IN
Synthetix: L2 Deposit
0 ETH0.0049128919.13465247
Deposit144016872022-03-17 3:45:211012 days ago1647488721IN
Synthetix: L2 Deposit
0 ETH0.0080552631.37200873
Migrate Escrow144016332022-03-17 3:33:021013 days ago1647487982IN
Synthetix: L2 Deposit
0 ETH0.0174594635.85524501
Deposit144013142022-03-17 2:22:241013 days ago1647483744IN
Synthetix: L2 Deposit
0 ETH0.0063248324.63499642
Deposit144012012022-03-17 2:00:101013 days ago1647482410IN
Synthetix: L2 Deposit
0 ETH0.0083814832.64404038
Deposit144011232022-03-17 1:44:101013 days ago1647481450IN
Synthetix: L2 Deposit
0 ETH0.0090421835.21895278
Deposit144006582022-03-17 0:01:531013 days ago1647475313IN
Synthetix: L2 Deposit
0 ETH0.0153982759.9672486
Deposit144001432022-03-16 21:58:521013 days ago1647467932IN
Synthetix: L2 Deposit
0 ETH0.0127325749.58824967
Deposit144001362022-03-16 21:57:141013 days ago1647467834IN
Synthetix: L2 Deposit
0 ETH0.011736745.70758132
Deposit144000692022-03-16 21:42:221013 days ago1647466942IN
Synthetix: L2 Deposit
0 ETH0.0089846435.40998468
Deposit144000682022-03-16 21:41:441013 days ago1647466904IN
Synthetix: L2 Deposit
0 ETH0.0101934339.69930519
Deposit143988222022-03-16 16:55:471013 days ago1647449747IN
Synthetix: L2 Deposit
0 ETH0.0098901338.51808646
Deposit143980462022-03-16 14:07:581013 days ago1647439678IN
Synthetix: L2 Deposit
0 ETH0.0069228826.96186185
Deposit143980332022-03-16 14:06:071013 days ago1647439567IN
Synthetix: L2 Deposit
0 ETH0.0097067937.80405094
Deposit143978992022-03-16 13:37:321013 days ago1647437852IN
Synthetix: L2 Deposit
0 ETH0.0068964526.85891406
Deposit143977362022-03-16 13:01:191013 days ago1647435679IN
Synthetix: L2 Deposit
0 ETH0.00986438.41633049
Deposit143964692022-03-16 8:16:251013 days ago1647418585IN
Synthetix: L2 Deposit
0 ETH0.0062363824.28934875
Deposit143963772022-03-16 7:53:151013 days ago1647417195IN
Synthetix: L2 Deposit
0 ETH0.0048188318.7682949
Deposit143963522022-03-16 7:48:081013 days ago1647416888IN
Synthetix: L2 Deposit
0 ETH0.0041873516.3080582
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
SynthetixBridgeToOptimism

Compiler Version
v0.5.16+commit.9c3226ce

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2021-05-10
*/

/*
   ____            __   __        __   _
  / __/__ __ ___  / /_ / /  ___  / /_ (_)__ __
 _\ \ / // // _ \/ __// _ \/ -_)/ __// / \ \ /
/___/ \_, //_//_/\__//_//_/\__/ \__//_/ /_\_\
     /___/

* Synthetix: SynthetixBridgeToOptimism.sol
*
* Latest source (may be newer): https://github.com/Synthetixio/synthetix/blob/master/contracts/SynthetixBridgeToOptimism.sol
* Docs: https://docs.synthetix.io/contracts/SynthetixBridgeToOptimism
*
* Contract Dependencies: 
*	- BaseSynthetixBridge
*	- IAddressResolver
*	- IBaseSynthetixBridge
*	- ISynthetixBridgeToOptimism
*	- MixinResolver
*	- MixinSystemSettings
*	- Owned
*	- iOVM_L1TokenGateway
* Libraries: 
*	- Address
*	- SafeERC20
*	- SafeMath
*	- VestingEntries
*
* MIT License
* ===========
*
* Copyright (c) 2021 Synthetix
*
* 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.synthetix.io/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.synthetix.io/contracts/source/interfaces/iaddressresolver
interface IAddressResolver {
    function getAddress(bytes32 name) external view returns (address);

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

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


// https://docs.synthetix.io/contracts/source/interfaces/isynth
interface ISynth {
    // Views
    function currencyKey() external view returns (bytes32);

    function transferableSynths(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 Synthetix
    function burn(address account, uint amount) external;

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


// https://docs.synthetix.io/contracts/source/interfaces/iissuer
interface IIssuer {
    // Views
    function anySynthOrSNXRateIsInvalid() external view returns (bool anyRateInvalid);

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

    function availableSynthCount() external view returns (uint);

    function availableSynths(uint index) external view returns (ISynth);

    function canBurnSynths(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 issuanceRatio() external view returns (uint);

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

    function maxIssuableSynths(address issuer) external view returns (uint maxIssuable);

    function minimumStakeTime() external view returns (uint);

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

    function synths(bytes32 currencyKey) external view returns (ISynth);

    function getSynths(bytes32[] calldata currencyKeys) external view returns (ISynth[] memory);

    function synthsByAddress(address synthAddress) external view returns (bytes32);

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

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

    // Restricted: used internally to Synthetix
    function issueSynths(address from, uint amount) external;

    function issueSynthsOnBehalf(
        address issueFor,
        address from,
        uint amount
    ) external;

    function issueMaxSynths(address from) external;

    function issueMaxSynthsOnBehalf(address issueFor, address from) external;

    function burnSynths(address from, uint amount) external;

    function burnSynthsOnBehalf(
        address burnForAddress,
        address from,
        uint amount
    ) external;

    function burnSynthsToTarget(address from) external;

    function burnSynthsToTargetOnBehalf(address burnForAddress, address from) external;

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


// Inheritance


// Internal references


// https://docs.synthetix.io/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 getSynth(bytes32 key) external view returns (address) {
        IIssuer issuer = IIssuer(repository["Issuer"]);
        require(address(issuer) != address(0), "Cannot find Issuer address");
        return address(issuer.synths(key));
    }

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

    event AddressImported(bytes32 name, address destination);
}


// solhint-disable payable-fallback

// https://docs.synthetix.io/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.synthetix.io/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.synthetix.io/contracts/source/interfaces/iflexiblestorage
interface IFlexibleStorage {
    // Views
    function getUIntValue(bytes32 contractName, bytes32 record) external view returns (uint);

    function getUIntValues(bytes32 contractName, bytes32[] calldata records) external view returns (uint[] memory);

    function getIntValue(bytes32 contractName, bytes32 record) external view returns (int);

    function getIntValues(bytes32 contractName, bytes32[] calldata records) external view returns (int[] memory);

    function getAddressValue(bytes32 contractName, bytes32 record) external view returns (address);

    function getAddressValues(bytes32 contractName, bytes32[] calldata records) external view returns (address[] memory);

    function getBoolValue(bytes32 contractName, bytes32 record) external view returns (bool);

    function getBoolValues(bytes32 contractName, bytes32[] calldata records) external view returns (bool[] memory);

    function getBytes32Value(bytes32 contractName, bytes32 record) external view returns (bytes32);

    function getBytes32Values(bytes32 contractName, bytes32[] calldata records) external view returns (bytes32[] memory);

    // Mutative functions
    function deleteUIntValue(bytes32 contractName, bytes32 record) external;

    function deleteIntValue(bytes32 contractName, bytes32 record) external;

    function deleteAddressValue(bytes32 contractName, bytes32 record) external;

    function deleteBoolValue(bytes32 contractName, bytes32 record) external;

    function deleteBytes32Value(bytes32 contractName, bytes32 record) external;

    function setUIntValue(
        bytes32 contractName,
        bytes32 record,
        uint value
    ) external;

    function setUIntValues(
        bytes32 contractName,
        bytes32[] calldata records,
        uint[] calldata values
    ) external;

    function setIntValue(
        bytes32 contractName,
        bytes32 record,
        int value
    ) external;

    function setIntValues(
        bytes32 contractName,
        bytes32[] calldata records,
        int[] calldata values
    ) external;

    function setAddressValue(
        bytes32 contractName,
        bytes32 record,
        address value
    ) external;

    function setAddressValues(
        bytes32 contractName,
        bytes32[] calldata records,
        address[] calldata values
    ) external;

    function setBoolValue(
        bytes32 contractName,
        bytes32 record,
        bool value
    ) external;

    function setBoolValues(
        bytes32 contractName,
        bytes32[] calldata records,
        bool[] calldata values
    ) external;

    function setBytes32Value(
        bytes32 contractName,
        bytes32 record,
        bytes32 value
    ) external;

    function setBytes32Values(
        bytes32 contractName,
        bytes32[] calldata records,
        bytes32[] calldata values
    ) external;
}


// Internal references


// https://docs.synthetix.io/contracts/source/contracts/mixinsystemsettings
contract MixinSystemSettings is MixinResolver {
    bytes32 internal constant SETTING_CONTRACT_NAME = "SystemSettings";

    bytes32 internal constant SETTING_WAITING_PERIOD_SECS = "waitingPeriodSecs";
    bytes32 internal constant SETTING_PRICE_DEVIATION_THRESHOLD_FACTOR = "priceDeviationThresholdFactor";
    bytes32 internal constant SETTING_ISSUANCE_RATIO = "issuanceRatio";
    bytes32 internal constant SETTING_FEE_PERIOD_DURATION = "feePeriodDuration";
    bytes32 internal constant SETTING_TARGET_THRESHOLD = "targetThreshold";
    bytes32 internal constant SETTING_LIQUIDATION_DELAY = "liquidationDelay";
    bytes32 internal constant SETTING_LIQUIDATION_RATIO = "liquidationRatio";
    bytes32 internal constant SETTING_LIQUIDATION_PENALTY = "liquidationPenalty";
    bytes32 internal constant SETTING_RATE_STALE_PERIOD = "rateStalePeriod";
    bytes32 internal constant SETTING_EXCHANGE_FEE_RATE = "exchangeFeeRate";
    bytes32 internal constant SETTING_MINIMUM_STAKE_TIME = "minimumStakeTime";
    bytes32 internal constant SETTING_AGGREGATOR_WARNING_FLAGS = "aggregatorWarningFlags";
    bytes32 internal constant SETTING_TRADING_REWARDS_ENABLED = "tradingRewardsEnabled";
    bytes32 internal constant SETTING_DEBT_SNAPSHOT_STALE_TIME = "debtSnapshotStaleTime";
    bytes32 internal constant SETTING_CROSS_DOMAIN_DEPOSIT_GAS_LIMIT = "crossDomainDepositGasLimit";
    bytes32 internal constant SETTING_CROSS_DOMAIN_ESCROW_GAS_LIMIT = "crossDomainEscrowGasLimit";
    bytes32 internal constant SETTING_CROSS_DOMAIN_REWARD_GAS_LIMIT = "crossDomainRewardGasLimit";
    bytes32 internal constant SETTING_CROSS_DOMAIN_WITHDRAWAL_GAS_LIMIT = "crossDomainWithdrawalGasLimit";

    bytes32 internal constant CONTRACT_FLEXIBLESTORAGE = "FlexibleStorage";

    enum CrossDomainMessageGasLimits {Deposit, Escrow, Reward, Withdrawal}

    constructor(address _resolver) internal MixinResolver(_resolver) {}

    function resolverAddressesRequired() public view returns (bytes32[] memory addresses) {
        addresses = new bytes32[](1);
        addresses[0] = CONTRACT_FLEXIBLESTORAGE;
    }

    function flexibleStorage() internal view returns (IFlexibleStorage) {
        return IFlexibleStorage(requireAndGetAddress(CONTRACT_FLEXIBLESTORAGE));
    }

    function _getGasLimitSetting(CrossDomainMessageGasLimits gasLimitType) internal pure returns (bytes32) {
        if (gasLimitType == CrossDomainMessageGasLimits.Deposit) {
            return SETTING_CROSS_DOMAIN_DEPOSIT_GAS_LIMIT;
        } else if (gasLimitType == CrossDomainMessageGasLimits.Escrow) {
            return SETTING_CROSS_DOMAIN_ESCROW_GAS_LIMIT;
        } else if (gasLimitType == CrossDomainMessageGasLimits.Reward) {
            return SETTING_CROSS_DOMAIN_REWARD_GAS_LIMIT;
        } else if (gasLimitType == CrossDomainMessageGasLimits.Withdrawal) {
            return SETTING_CROSS_DOMAIN_WITHDRAWAL_GAS_LIMIT;
        } else {
            revert("Unknown gas limit type");
        }
    }

    function getCrossDomainMessageGasLimit(CrossDomainMessageGasLimits gasLimitType) internal view returns (uint) {
        return flexibleStorage().getUIntValue(SETTING_CONTRACT_NAME, _getGasLimitSetting(gasLimitType));
    }

    function getTradingRewardsEnabled() internal view returns (bool) {
        return flexibleStorage().getBoolValue(SETTING_CONTRACT_NAME, SETTING_TRADING_REWARDS_ENABLED);
    }

    function getWaitingPeriodSecs() internal view returns (uint) {
        return flexibleStorage().getUIntValue(SETTING_CONTRACT_NAME, SETTING_WAITING_PERIOD_SECS);
    }

    function getPriceDeviationThresholdFactor() internal view returns (uint) {
        return flexibleStorage().getUIntValue(SETTING_CONTRACT_NAME, SETTING_PRICE_DEVIATION_THRESHOLD_FACTOR);
    }

    function getIssuanceRatio() internal view returns (uint) {
        // lookup on flexible storage directly for gas savings (rather than via SystemSettings)
        return flexibleStorage().getUIntValue(SETTING_CONTRACT_NAME, SETTING_ISSUANCE_RATIO);
    }

    function getFeePeriodDuration() internal view returns (uint) {
        // lookup on flexible storage directly for gas savings (rather than via SystemSettings)
        return flexibleStorage().getUIntValue(SETTING_CONTRACT_NAME, SETTING_FEE_PERIOD_DURATION);
    }

    function getTargetThreshold() internal view returns (uint) {
        // lookup on flexible storage directly for gas savings (rather than via SystemSettings)
        return flexibleStorage().getUIntValue(SETTING_CONTRACT_NAME, SETTING_TARGET_THRESHOLD);
    }

    function getLiquidationDelay() internal view returns (uint) {
        return flexibleStorage().getUIntValue(SETTING_CONTRACT_NAME, SETTING_LIQUIDATION_DELAY);
    }

    function getLiquidationRatio() internal view returns (uint) {
        return flexibleStorage().getUIntValue(SETTING_CONTRACT_NAME, SETTING_LIQUIDATION_RATIO);
    }

    function getLiquidationPenalty() internal view returns (uint) {
        return flexibleStorage().getUIntValue(SETTING_CONTRACT_NAME, SETTING_LIQUIDATION_PENALTY);
    }

    function getRateStalePeriod() internal view returns (uint) {
        return flexibleStorage().getUIntValue(SETTING_CONTRACT_NAME, SETTING_RATE_STALE_PERIOD);
    }

    function getExchangeFeeRate(bytes32 currencyKey) internal view returns (uint) {
        return
            flexibleStorage().getUIntValue(
                SETTING_CONTRACT_NAME,
                keccak256(abi.encodePacked(SETTING_EXCHANGE_FEE_RATE, currencyKey))
            );
    }

    function getMinimumStakeTime() internal view returns (uint) {
        return flexibleStorage().getUIntValue(SETTING_CONTRACT_NAME, SETTING_MINIMUM_STAKE_TIME);
    }

    function getAggregatorWarningFlags() internal view returns (address) {
        return flexibleStorage().getAddressValue(SETTING_CONTRACT_NAME, SETTING_AGGREGATOR_WARNING_FLAGS);
    }

    function getDebtSnapshotStaleTime() internal view returns (uint) {
        return flexibleStorage().getUIntValue(SETTING_CONTRACT_NAME, SETTING_DEBT_SNAPSHOT_STALE_TIME);
    }
}


pragma experimental ABIEncoderV2;

interface IBaseSynthetixBridge {
    function suspendInitiation() external;

    function resumeInitiation() external;
}


interface IVirtualSynth {
    // Views
    function balanceOfUnderlying(address account) external view returns (uint);

    function rate() external view returns (uint);

    function readyToSettle() external view returns (bool);

    function secsLeftInWaitingPeriod() external view returns (uint);

    function settled() external view returns (bool);

    function synth() external view returns (ISynth);

    // Mutative functions
    function settle(address account) external;
}


// https://docs.synthetix.io/contracts/source/interfaces/isynthetix
interface ISynthetix {
    // Views
    function anySynthOrSNXRateIsInvalid() external view returns (bool anyRateInvalid);

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

    function availableSynthCount() external view returns (uint);

    function availableSynths(uint index) external view returns (ISynth);

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

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

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

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

    function maxIssuableSynths(address issuer) external view returns (uint maxIssuable);

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

    function synths(bytes32 currencyKey) external view returns (ISynth);

    function synthsByAddress(address synthAddress) external view returns (bytes32);

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

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

    function transferableSynthetix(address account) external view returns (uint transferable);

    // Mutative Functions
    function burnSynths(uint amount) external;

    function burnSynthsOnBehalf(address burnForAddress, uint amount) external;

    function burnSynthsToTarget() external;

    function burnSynthsToTargetOnBehalf(address burnForAddress) external;

    function exchange(
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey
    ) external returns (uint amountReceived);

    function exchangeOnBehalf(
        address exchangeForAddress,
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey
    ) external returns (uint amountReceived);

    function exchangeWithTracking(
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey,
        address originator,
        bytes32 trackingCode
    ) external returns (uint amountReceived);

    function exchangeOnBehalfWithTracking(
        address exchangeForAddress,
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey,
        address originator,
        bytes32 trackingCode
    ) external returns (uint amountReceived);

    function exchangeWithVirtual(
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey,
        bytes32 trackingCode
    ) external returns (uint amountReceived, IVirtualSynth vSynth);

    function issueMaxSynths() external;

    function issueMaxSynthsOnBehalf(address issueForAddress) external;

    function issueSynths(uint amount) external;

    function issueSynthsOnBehalf(address issueForAddress, uint amount) external;

    function mint() external returns (bool);

    function settle(bytes32 currencyKey)
        external
        returns (
            uint reclaimed,
            uint refunded,
            uint numEntries
        );

    // Liquidations
    function liquidateDelinquentAccount(address account, uint susdAmount) external returns (bool);

    // Restricted Functions

    function mintSecondary(address account, uint amount) external;

    function mintSecondaryRewards(uint amount) external;

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


library VestingEntries {
    struct VestingEntry {
        uint64 endTime;
        uint256 escrowAmount;
    }
    struct VestingEntryWithID {
        uint64 endTime;
        uint256 escrowAmount;
        uint256 entryID;
    }
}

interface IRewardEscrowV2 {
    // Views
    function balanceOf(address account) external view returns (uint);

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

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

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

    function getVestingQuantity(address account, uint256[] calldata entryIDs) external view returns (uint);

    function getVestingSchedules(
        address account,
        uint256 index,
        uint256 pageSize
    ) external view returns (VestingEntries.VestingEntryWithID[] memory);

    function getAccountVestingEntryIDs(
        address account,
        uint256 index,
        uint256 pageSize
    ) external view returns (uint256[] memory);

    function getVestingEntryClaimable(address account, uint256 entryID) external view returns (uint);

    function getVestingEntry(address account, uint256 entryID) external view returns (uint64, uint256);

    // Mutative functions
    function vest(uint256[] calldata entryIDs) external;

    function createEscrowEntry(
        address beneficiary,
        uint256 deposit,
        uint256 duration
    ) external;

    function appendVestingEntry(
        address account,
        uint256 quantity,
        uint256 duration
    ) external;

    function migrateVestingSchedule(address _addressToMigrate) external;

    function migrateAccountEscrowBalances(
        address[] calldata accounts,
        uint256[] calldata escrowBalances,
        uint256[] calldata vestedBalances
    ) external;

    // Account Merging
    function startMergingWindow() external;

    function mergeAccount(address accountToMerge, uint256[] calldata entryIDs) external;

    function nominateAccountToMerge(address account) external;

    function accountMergingIsOpen() external view returns (bool);

    // L2 Migration
    function importVestingEntries(
        address account,
        uint256 escrowedAmount,
        VestingEntries.VestingEntry[] calldata vestingEntries
    ) external;

    // Return amount of SNX transfered to SynthetixBridgeToOptimism deposit contract
    function burnForMigration(address account, uint256[] calldata entryIDs)
        external
        returns (uint256 escrowedAccountBalance, VestingEntries.VestingEntry[] memory vestingEntries);
}


// SPDX-License-Identifier: MIT


/**
 * @title iAbs_BaseCrossDomainMessenger
 */
interface iAbs_BaseCrossDomainMessenger {

    /**********
     * Events *
     **********/

    event SentMessage(bytes message);
    event RelayedMessage(bytes32 msgHash);
    event FailedRelayedMessage(bytes32 msgHash);


    /*************
     * Variables *
     *************/

    function xDomainMessageSender() external view returns (address);


    /********************
     * Public Functions *
     ********************/

    /**
     * Sends a cross domain message to the target messenger.
     * @param _target Target contract address.
     * @param _message Message to send to the target.
     * @param _gasLimit Gas limit for the provided message.
     */
    function sendMessage(
        address _target,
        bytes calldata _message,
        uint32 _gasLimit
    ) external;
}


// Inheritance


// Internal references


contract BaseSynthetixBridge is Owned, MixinSystemSettings, IBaseSynthetixBridge {
    /* ========== ADDRESS RESOLVER CONFIGURATION ========== */
    bytes32 private constant CONTRACT_EXT_MESSENGER = "ext:Messenger";
    bytes32 internal constant CONTRACT_SYNTHETIX = "Synthetix";
    bytes32 private constant CONTRACT_REWARDESCROW = "RewardEscrowV2";

    bool public initiationActive;

    // ========== CONSTRUCTOR ==========

    constructor(address _owner, address _resolver) public Owned(_owner) MixinSystemSettings(_resolver) {
        initiationActive = true;
    }

    // ========== INTERNALS ============

    function messenger() internal view returns (iAbs_BaseCrossDomainMessenger) {
        return iAbs_BaseCrossDomainMessenger(requireAndGetAddress(CONTRACT_EXT_MESSENGER));
    }

    function synthetix() internal view returns (ISynthetix) {
        return ISynthetix(requireAndGetAddress(CONTRACT_SYNTHETIX));
    }

    function rewardEscrowV2() internal view returns (IRewardEscrowV2) {
        return IRewardEscrowV2(requireAndGetAddress(CONTRACT_REWARDESCROW));
    }

    function initiatingActive() internal view {
        require(initiationActive, "Initiation deactivated");
    }

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

    function resolverAddressesRequired() public view returns (bytes32[] memory addresses) {
        bytes32[] memory existingAddresses = MixinSystemSettings.resolverAddressesRequired();
        bytes32[] memory newAddresses = new bytes32[](3);
        newAddresses[0] = CONTRACT_EXT_MESSENGER;
        newAddresses[1] = CONTRACT_SYNTHETIX;
        newAddresses[2] = CONTRACT_REWARDESCROW;
        addresses = combineArrays(existingAddresses, newAddresses);
    }

    // ========== MODIFIERS ============

    modifier requireInitiationActive() {
        initiatingActive();
        _;
    }

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

    function suspendInitiation() external onlyOwner {
        require(initiationActive, "Initiation suspended");
        initiationActive = false;
        emit InitiationSuspended();
    }

    function resumeInitiation() external onlyOwner {
        require(!initiationActive, "Initiation not suspended");
        initiationActive = true;
        emit InitiationResumed();
    }

    // ========== EVENTS ==========

    event InitiationSuspended();

    event InitiationResumed();
}


interface ISynthetixBridgeToOptimism {
    function migrateEscrow(uint256[][] calldata entryIDs) external;

    function depositReward(uint amount) external;

    function depositAndMigrateEscrow(uint256 depositAmount, uint256[][] calldata entryIDs) external;
}


// SPDX-License-Identifier: MIT


/**
 * @title iOVM_L1TokenGateway
 */
interface iOVM_L1TokenGateway {

    /**********
     * Events *
     **********/

    event DepositInitiated(
        address indexed _from,
        address _to,
        uint256 _amount
    );

    event WithdrawalFinalized(
        address indexed _to,
        uint256 _amount
    );


    /********************
     * Public Functions *
     ********************/

    function deposit(
        uint _amount
    )
        external;

    function depositTo(
        address _to,
        uint _amount
    )
        external;


    /*************************
     * Cross-chain Functions *
     *************************/

    function finalizeWithdrawal(
        address _to,
        uint _amount
    )
        external;
}


/**
 * @dev Interface of the ERC20 standard as defined in the EIP. Does not include
 * the optional functions; to access them see `ERC20Detailed`.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

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

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

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

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


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


/**
 * @dev Collection of functions related to the address type,
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * This test is non-exhaustive, and there may be false-negatives: during the
     * execution of a contract's constructor, its address will be reported as
     * not containing a contract.
     *
     * > It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies in extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        // solhint-disable-next-line no-inline-assembly
        assembly { size := extcodesize(account) }
        return size > 0;
    }
}


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

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

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

    function safeApprove(IERC20 token, address spender, uint256 value) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        // solhint-disable-next-line max-line-length
        require((value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

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

    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender).sub(value);
        callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves.

        // A Solidity high level call has three parts:
        //  1. The target address is checked to verify it contains contract code
        //  2. The call itself is made, and success asserted
        //  3. The return value is decoded, which in turn checks the size of the returned data.
        // solhint-disable-next-line max-line-length
        require(address(token).isContract(), "SafeERC20: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = address(token).call(data);
        require(success, "SafeERC20: low-level call failed");

        if (returndata.length > 0) { // Return data is optional
            // solhint-disable-next-line max-line-length
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}


interface ISynthetixBridgeToBase {
    // invoked by the xDomain messenger on L2
    function finalizeEscrowMigration(
        address account,
        uint256 escrowedAmount,
        VestingEntries.VestingEntry[] calldata vestingEntries
    ) external;

    // invoked by the xDomain messenger on L2
    function finalizeRewardDeposit(address from, uint amount) external;
}


// SPDX-License-Identifier: MIT


/**
 * @title iOVM_L2DepositedToken
 */
interface iOVM_L2DepositedToken {

    /**********
     * Events *
     **********/

    event WithdrawalInitiated(
        address indexed _from,
        address _to,
        uint256 _amount
    );

    event DepositFinalized(
        address indexed _to,
        uint256 _amount
    );


    /********************
     * Public Functions *
     ********************/

    function withdraw(
        uint _amount
    )
        external;

    function withdrawTo(
        address _to,
        uint _amount
    )
        external;


    /*************************
     * Cross-chain Functions *
     *************************/

    function finalizeDeposit(
        address _to,
        uint _amount
    )
        external;
}


// Inheritance


// Internal references


contract SynthetixBridgeToOptimism is BaseSynthetixBridge, ISynthetixBridgeToOptimism, iOVM_L1TokenGateway {
    using SafeERC20 for IERC20;

    /* ========== ADDRESS RESOLVER CONFIGURATION ========== */
    bytes32 private constant CONTRACT_ISSUER = "Issuer";
    bytes32 private constant CONTRACT_REWARDSDISTRIBUTION = "RewardsDistribution";
    bytes32 private constant CONTRACT_OVM_SYNTHETIXBRIDGETOBASE = "ovm:SynthetixBridgeToBase";
    bytes32 private constant CONTRACT_SYNTHETIXBRIDGEESCROW = "SynthetixBridgeEscrow";

    uint8 private constant MAX_ENTRIES_MIGRATED_PER_MESSAGE = 26;

    // ========== CONSTRUCTOR ==========

    constructor(address _owner, address _resolver) public BaseSynthetixBridge(_owner, _resolver) {}

    // ========== INTERNALS ============

    function synthetixERC20() internal view returns (IERC20) {
        return IERC20(requireAndGetAddress(CONTRACT_SYNTHETIX));
    }

    function issuer() internal view returns (IIssuer) {
        return IIssuer(requireAndGetAddress(CONTRACT_ISSUER));
    }

    function rewardsDistribution() internal view returns (address) {
        return requireAndGetAddress(CONTRACT_REWARDSDISTRIBUTION);
    }

    function synthetixBridgeToBase() internal view returns (address) {
        return requireAndGetAddress(CONTRACT_OVM_SYNTHETIXBRIDGETOBASE);
    }

    function synthetixBridgeEscrow() internal view returns (address) {
        return requireAndGetAddress(CONTRACT_SYNTHETIXBRIDGEESCROW);
    }

    function hasZeroDebt() internal view {
        require(issuer().debtBalanceOf(msg.sender, "sUSD") == 0, "Cannot deposit or migrate with debt");
    }

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

    function resolverAddressesRequired() public view returns (bytes32[] memory addresses) {
        bytes32[] memory existingAddresses = BaseSynthetixBridge.resolverAddressesRequired();
        bytes32[] memory newAddresses = new bytes32[](4);
        newAddresses[0] = CONTRACT_ISSUER;
        newAddresses[1] = CONTRACT_REWARDSDISTRIBUTION;
        newAddresses[2] = CONTRACT_OVM_SYNTHETIXBRIDGETOBASE;
        newAddresses[3] = CONTRACT_SYNTHETIXBRIDGEESCROW;
        addresses = combineArrays(existingAddresses, newAddresses);
    }

    // ========== MODIFIERS ============

    modifier requireZeroDebt() {
        hasZeroDebt();
        _;
    }

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

    function deposit(uint256 amount) external requireInitiationActive requireZeroDebt {
        _initiateDeposit(msg.sender, amount);
    }

    function depositTo(address to, uint amount) external requireInitiationActive requireZeroDebt {
        _initiateDeposit(to, amount);
    }

    function migrateEscrow(uint256[][] memory entryIDs) public requireInitiationActive requireZeroDebt {
        _migrateEscrow(entryIDs);
    }

    // invoked by a generous user on L1
    function depositReward(uint amount) external requireInitiationActive {
        // move the SNX into the deposit escrow
        synthetixERC20().transferFrom(msg.sender, synthetixBridgeEscrow(), amount);

        _depositReward(msg.sender, amount);
    }

    // forward any accidental tokens sent here to the escrow
    function forwardTokensToEscrow(address token) external {
        IERC20 erc20 = IERC20(token);
        erc20.safeTransfer(synthetixBridgeEscrow(), erc20.balanceOf(address(this)));
    }

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

    // invoked by Messenger on L1 after L2 waiting period elapses
    function finalizeWithdrawal(address to, uint256 amount) external {
        // ensure function only callable from L2 Bridge via messenger (aka relayer)
        require(msg.sender == address(messenger()), "Only the relayer can call this");
        require(messenger().xDomainMessageSender() == synthetixBridgeToBase(), "Only the L2 bridge can invoke");

        // transfer amount back to user
        synthetixERC20().transferFrom(synthetixBridgeEscrow(), to, amount);

        // no escrow actions - escrow remains on L2
        emit iOVM_L1TokenGateway.WithdrawalFinalized(to, amount);
    }

    // invoked by RewardsDistribution on L1 (takes SNX)
    function notifyRewardAmount(uint256 amount) external {
        require(msg.sender == address(rewardsDistribution()), "Caller is not RewardsDistribution contract");

        // NOTE: transfer SNX to synthetixBridgeEscrow because RewardsDistribution transfers them initially to this contract.
        synthetixERC20().transfer(synthetixBridgeEscrow(), amount);

        // to be here means I've been given an amount of SNX to distribute onto L2
        _depositReward(msg.sender, amount);
    }

    function depositAndMigrateEscrow(uint256 depositAmount, uint256[][] memory entryIDs)
        public
        requireInitiationActive
        requireZeroDebt
    {
        if (entryIDs.length > 0) {
            _migrateEscrow(entryIDs);
        }

        if (depositAmount > 0) {
            _initiateDeposit(msg.sender, depositAmount);
        }
    }

    // ========== PRIVATE/INTERNAL FUNCTIONS =========

    function _depositReward(address _from, uint256 _amount) internal {
        // create message payload for L2
        ISynthetixBridgeToBase bridgeToBase;
        bytes memory messageData = abi.encodeWithSelector(bridgeToBase.finalizeRewardDeposit.selector, _from, _amount);

        // relay the message to this contract on L2 via L1 Messenger
        messenger().sendMessage(
            synthetixBridgeToBase(),
            messageData,
            uint32(getCrossDomainMessageGasLimit(CrossDomainMessageGasLimits.Reward))
        );

        emit RewardDepositInitiated(_from, _amount);
    }

    function _initiateDeposit(address _to, uint256 _depositAmount) private {
        // Transfer SNX to L2
        // First, move the SNX into the deposit escrow
        synthetixERC20().transferFrom(msg.sender, synthetixBridgeEscrow(), _depositAmount);
        // create message payload for L2
        iOVM_L2DepositedToken bridgeToBase;
        bytes memory messageData = abi.encodeWithSelector(bridgeToBase.finalizeDeposit.selector, _to, _depositAmount);

        // relay the message to this contract on L2 via L1 Messenger
        messenger().sendMessage(
            synthetixBridgeToBase(),
            messageData,
            uint32(getCrossDomainMessageGasLimit(CrossDomainMessageGasLimits.Deposit))
        );

        emit iOVM_L1TokenGateway.DepositInitiated(msg.sender, _to, _depositAmount);
    }

    function _migrateEscrow(uint256[][] memory _entryIDs) private {
        // loop through the entryID array
        for (uint256 i = 0; i < _entryIDs.length; i++) {
            // Cannot send more than MAX_ENTRIES_MIGRATED_PER_MESSAGE entries due to ovm gas restrictions
            require(_entryIDs[i].length <= MAX_ENTRIES_MIGRATED_PER_MESSAGE, "Exceeds max entries per migration");
            // Burn their reward escrow first
            // Note: escrowSummary would lose the fidelity of the weekly escrows, so this may not be sufficient
            uint256 escrowedAccountBalance;
            VestingEntries.VestingEntry[] memory vestingEntries;
            (escrowedAccountBalance, vestingEntries) = rewardEscrowV2().burnForMigration(msg.sender, _entryIDs[i]);

            // if there is an escrow amount to be migrated
            if (escrowedAccountBalance > 0) {
                // NOTE: transfer SNX to synthetixBridgeEscrow because burnForMigration() transfers them to this contract.
                synthetixERC20().transfer(synthetixBridgeEscrow(), escrowedAccountBalance);
                // create message payload for L2
                ISynthetixBridgeToBase bridgeToBase;
                bytes memory messageData =
                    abi.encodeWithSelector(
                        bridgeToBase.finalizeEscrowMigration.selector,
                        msg.sender,
                        escrowedAccountBalance,
                        vestingEntries
                    );
                // relay the message to this contract on L2 via L1 Messenger
                messenger().sendMessage(
                    synthetixBridgeToBase(),
                    messageData,
                    uint32(getCrossDomainMessageGasLimit(CrossDomainMessageGasLimits.Escrow))
                );

                emit ExportedVestingEntries(msg.sender, escrowedAccountBalance, vestingEntries);
            }
        }
    }

    // ========== EVENTS ==========

    event ExportedVestingEntries(
        address indexed account,
        uint256 escrowedAccountBalance,
        VestingEntries.VestingEntry[] vestingEntries
    );

    event RewardDepositInitiated(address indexed account, uint256 amount);
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_resolver","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":true,"internalType":"address","name":"_from","type":"address"},{"indexed":false,"internalType":"address","name":"_to","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"DepositInitiated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"escrowedAccountBalance","type":"uint256"},{"components":[{"internalType":"uint64","name":"endTime","type":"uint64"},{"internalType":"uint256","name":"escrowAmount","type":"uint256"}],"indexed":false,"internalType":"struct VestingEntries.VestingEntry[]","name":"vestingEntries","type":"tuple[]"}],"name":"ExportedVestingEntries","type":"event"},{"anonymous":false,"inputs":[],"name":"InitiationResumed","type":"event"},{"anonymous":false,"inputs":[],"name":"InitiationSuspended","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"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RewardDepositInitiated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_to","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"WithdrawalFinalized","type":"event"},{"constant":false,"inputs":[],"name":"acceptOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"deposit","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"depositAmount","type":"uint256"},{"internalType":"uint256[][]","name":"entryIDs","type":"uint256[][]"}],"name":"depositAndMigrateEscrow","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"depositReward","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"depositTo","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"finalizeWithdrawal","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"forwardTokensToEscrow","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"initiationActive","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":false,"inputs":[{"internalType":"uint256[][]","name":"entryIDs","type":"uint256[][]"}],"name":"migrateEscrow","outputs":[],"payable":false,"stateMutability":"nonpayable","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":false,"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"notifyRewardAmount","outputs":[],"payable":false,"stateMutability":"nonpayable","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":[],"name":"resumeInitiation","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"suspendInitiation","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"}]

60806040523480156200001157600080fd5b50604051620027a9380380620027a983398101604081905262000034916200010d565b81818080836001600160a01b0381166200006b5760405162461bcd60e51b81526004016200006290620001c9565b60405180910390fd5b600080546001600160a01b0319166001600160a01b0383161781556040517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c91620000b8918490620001a3565b60405180910390a150600280546001600160a01b0319166001600160a01b039290921691909117905550506004805460ff191660011790555062000224915050565b805162000107816200020a565b92915050565b600080604083850312156200012157600080fd5b60006200012f8585620000fa565b92505060206200014285828601620000fa565b9150509250929050565b6200015781620001f6565b82525050565b6200015781620001e4565b600062000177601983620001db565b7f4f776e657220616464726573732063616e6e6f74206265203000000000000000815260200192915050565b60408101620001b382856200014c565b620001c260208301846200015d565b9392505050565b60208082528101620001078162000168565b90815260200190565b60006001600160a01b03821662000107565b6000620001078260006200010782620001e4565b6200021581620001e4565b81146200022157600080fd5b50565b61257580620002346000396000f3fe608060405234801561001057600080fd5b50600436106101215760003560e01c8063698a26b2116100ad5780639a9e7f96116100715780639a9e7f9614610201578063a18e230714610214578063b6b55f2514610227578063f4f7b41a1461023a578063ffaad6a51461024d57610121565b8063698a26b2146101cc57806374185360146101d457806379ba5097146101dc578063899ffef4146101e45780638da5cb5b146101f957610121565b80632af64bd3116100f45780632af64bd3146101815780633872dda3146101895780633c6b16ab14610191578063462286d5146101a457806353a47bb7146101b757610121565b806304f3bcec14610126578063100be6d4146101445780631627540c146101595780631e2720ff1461016e575b600080fd5b61012e610260565b60405161013b919061230f565b60405180910390f35b61014c61026f565b60405161013b91906122b7565b61016c6101673660046119c9565b610278565b005b61016c61017c366004611a9a565b6102d6565b61014c61037c565b61016c610494565b61016c61019f366004611a9a565b6104fc565b61016c6101b23660046119c9565b610570565b6101bf610613565b60405161013b919061218d565b61016c610622565b61016c610685565b61016c6107d7565b6101ec610873565b60405161013b91906122a6565b6101bf610971565b61016c61020f366004611a47565b610980565b61016c610222366004611ad6565b610999565b61016c610235366004611a9a565b6109c9565b61016c610248366004611a0d565b6109e3565b61016c61025b366004611a0d565b610ba0565b6002546001600160a01b031681565b60045460ff1681565b610280610bba565b600180546001600160a01b0319166001600160a01b0383161790556040517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce22906102cb90839061218d565b60405180910390a150565b6102de610be6565b6102e6610c08565b6001600160a01b03166323b872dd336102fd610c24565b846040518463ffffffff1660e01b815260040161031c9392919061219b565b602060405180830381600087803b15801561033657600080fd5b505af115801561034a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061036e9190810190611a7c565b506103793382610c47565b50565b60006060610388610873565b905060005b815181101561048a5760008282815181106103a457fe5b602090810291909101810151600081815260039092526040918290205460025492516321f8a72160e01b81529193506001600160a01b039081169216906321f8a721906103f59085906004016122c5565b60206040518083038186803b15801561040d57600080fd5b505afa158015610421573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061044591908101906119ef565b6001600160a01b031614158061047057506000818152600360205260409020546001600160a01b0316155b156104815760009350505050610491565b5060010161038d565b5060019150505b90565b61049c610bba565b60045460ff166104c75760405162461bcd60e51b81526004016104be9061235e565b60405180910390fd5b6004805460ff191690556040517f43e00f2c8f8651a29db34d34fb689573423f8aaae8f9d32e3e871b4c35c6254690600090a1565b610504610d5d565b6001600160a01b0316336001600160a01b0316146105345760405162461bcd60e51b81526004016104be906123ce565b61053c610c08565b6001600160a01b031663a9059cbb610552610c24565b836040518363ffffffff1660e01b815260040161031c92919061228b565b8061060f61057c610c24565b6040516370a0823160e01b81526001600160a01b038416906370a08231906105a890309060040161218d565b60206040518083038186803b1580156105c057600080fd5b505afa1580156105d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506105f89190810190611ab8565b6001600160a01b038416919063ffffffff610d7e16565b5050565b6001546001600160a01b031681565b61062a610bba565b60045460ff161561064d5760405162461bcd60e51b81526004016104be9061232e565b6004805460ff191660011790556040517f7c88488c18e2ff121a34a4a2a44990557a5b76ab1ceb6bd95ebe7d419c7575f490600090a1565b606061068f610873565b905060005b815181101561060f5760008282815181106106ab57fe5b602002602001015190506000600260009054906101000a90046001600160a01b03166001600160a01b031663dacb2d0183846040516020016106ed9190612182565b6040516020818303038152906040526040518363ffffffff1660e01b81526004016107199291906122ef565b60206040518083038186803b15801561073157600080fd5b505afa158015610745573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061076991908101906119ef565b6000838152600360205260409081902080546001600160a01b0319166001600160a01b038416179055519091507f88a93678a3692f6789d9546fc621bf7234b101ddb7d4fe479455112831b8aa68906107c590849084906122d3565b60405180910390a15050600101610694565b6001546001600160a01b031633146108015760405162461bcd60e51b81526004016104be9061233e565b6000546001546040517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c92610844926001600160a01b0391821692911690612233565b60405180910390a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b60608061087e610ddc565b60408051600480825260a0820190925291925060609190602082016080803883390190505090506524b9b9bab2b960d11b816000815181106108bc57fe5b602002602001018181525050722932bbb0b93239a234b9ba3934b13aba34b7b760691b816001815181106108ec57fe5b602002602001018181525050786f766d3a53796e746865746978427269646765546f4261736560381b8160028151811061092257fe5b6020026020010181815250507453796e746865746978427269646765457363726f7760581b8160038151811061095457fe5b60200260200101818152505061096a8282610e7c565b9250505090565b6000546001600160a01b031681565b610988610be6565b610990610f38565b61037981610fd8565b6109a1610be6565b6109a9610f38565b8051156109b9576109b981610fd8565b811561060f5761060f3383611279565b6109d1610be6565b6109d9610f38565b6103793382611279565b6109eb611414565b6001600160a01b0316336001600160a01b031614610a1b5760405162461bcd60e51b81526004016104be906123be565b610a2361142f565b6001600160a01b0316610a34611414565b6001600160a01b0316636e296e456040518163ffffffff1660e01b815260040160206040518083038186803b158015610a6c57600080fd5b505afa158015610a80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610aa491908101906119ef565b6001600160a01b031614610aca5760405162461bcd60e51b81526004016104be9061234e565b610ad2610c08565b6001600160a01b03166323b872dd610ae8610c24565b84846040518463ffffffff1660e01b8152600401610b089392919061224e565b602060405180830381600087803b158015610b2257600080fd5b505af1158015610b36573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610b5a9190810190611a7c565b50816001600160a01b03167f9e5c4f9f4e46b8629d3dda85f43a69194f50254404a72dc62b9e932d9c94eda882604051610b9491906122c5565b60405180910390a25050565b610ba8610be6565b610bb0610f38565b61060f8282611279565b6000546001600160a01b03163314610be45760405162461bcd60e51b81526004016104be906123ae565b565b60045460ff16610be45760405162461bcd60e51b81526004016104be9061238e565b6000610c1f680a6f2dce8d0cae8d2f60bb1b611452565b905090565b6000610c1f7453796e746865746978427269646765457363726f7760581b611452565b60405160009060609063a616cdfb60e01b90610c69908690869060240161228b565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091529050610ca5611414565b6001600160a01b0316633dbb202b610cbb61142f565b83610cc660026114b8565b6040518463ffffffff1660e01b8152600401610ce49392919061225c565b600060405180830381600087803b158015610cfe57600080fd5b505af1158015610d12573d6000803e3d6000fd5b50505050836001600160a01b03167f0ac6af0c6fd21e58850b0385f451cdcc08071424f47fd04652be4e51069f43cc84604051610d4f91906122c5565b60405180910390a250505050565b6000610c1f722932bbb0b93239a234b9ba3934b13aba34b7b760691b611452565b604051610dd790849063a9059cbb60e01b90610da0908690869060240161228b565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261155e565b505050565b606080610de7611649565b60408051600380825260808201909252919250606091906020820183803883390190505090506c32bc3a1d26b2b9b9b2b733b2b960991b81600081518110610e2b57fe5b602002602001018181525050680a6f2dce8d0cae8d2f60bb1b81600181518110610e5157fe5b6020026020010181815250506d2932bbb0b93222b9b1b937bbab1960911b8160028151811061095457fe5b60608151835101604051908082528060200260200182016040528015610eac578160200160208202803883390190505b50905060005b8351811015610eee57838181518110610ec757fe5b6020026020010151828281518110610edb57fe5b6020908102919091010152600101610eb2565b5060005b8251811015610f3157828181518110610f0757fe5b6020026020010151828286510181518110610f1e57fe5b6020908102919091010152600101610ef2565b5092915050565b610f4061169a565b6001600160a01b031663d37c4d8b336040518263ffffffff1660e01b8152600401610f6b91906121e3565b60206040518083038186803b158015610f8357600080fd5b505afa158015610f97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610fbb9190810190611ab8565b15610be45760405162461bcd60e51b81526004016104be9061239e565b60005b815181101561060f57601a60ff16828281518110610ff557fe5b602002602001015151111561101c5760405162461bcd60e51b81526004016104be9061237e565b600060606110286116ae565b6001600160a01b03166380d46f583386868151811061104357fe5b60200260200101516040518363ffffffff1660e01b81526004016110689291906121c3565b600060405180830381600087803b15801561108257600080fd5b505af1158015611096573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526110be9190810190611b1e565b9092509050811561126f576110d1610c08565b6001600160a01b031663a9059cbb6110e7610c24565b846040518363ffffffff1660e01b815260040161110592919061228b565b602060405180830381600087803b15801561111f57600080fd5b505af1158015611133573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506111579190810190611a7c565b50604051600090606090637cbc127f60e11b9061117c903390879087906024016121fd565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915290506111b8611414565b6001600160a01b0316633dbb202b6111ce61142f565b836111d960016114b8565b6040518463ffffffff1660e01b81526004016111f79392919061225c565b600060405180830381600087803b15801561121157600080fd5b505af1158015611225573d6000803e3d6000fd5b50505050336001600160a01b03167f4dc5956ab6218a4dfa2cc5e5c50d98d039dde03aabfc504c54b601b6f5622696858560405161126492919061240e565b60405180910390a250505b5050600101610fdb565b611281610c08565b6001600160a01b03166323b872dd33611298610c24565b846040518463ffffffff1660e01b81526004016112b79392919061219b565b602060405180830381600087803b1580156112d157600080fd5b505af11580156112e5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506113099190810190611a7c565b50604051600090606090638d6e9a5b60e01b9061132c908690869060240161228b565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091529050611368611414565b6001600160a01b0316633dbb202b61137e61142f565b8361138960006114b8565b6040518463ffffffff1660e01b81526004016113a79392919061225c565b600060405180830381600087803b1580156113c157600080fd5b505af11580156113d5573d6000803e3d6000fd5b50505050336001600160a01b03167ff531653a5819e21265de50358610d55dbe6594c61605b209dfa4280d277938c18585604051610d4f92919061228b565b6000610c1f6c32bc3a1d26b2b9b9b2b733b2b960991b611452565b6000610c1f786f766d3a53796e746865746978427269646765546f4261736560381b5b60008181526003602090815260408083205490516001600160a01b03909116918215159161148291869101612162565b604051602081830303815290604052906114af5760405162461bcd60e51b81526004016104be919061231d565b5090505b919050565b60006114c26116ca565b6001600160a01b03166323257c2b6d53797374656d53657474696e677360901b6114eb856116e7565b6040518363ffffffff1660e01b81526004016115089291906122e1565b60206040518083038186803b15801561152057600080fd5b505afa158015611534573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506115589190810190611ab8565b92915050565b611570826001600160a01b03166117ec565b61158c5760405162461bcd60e51b81526004016104be906123fe565b60006060836001600160a01b0316836040516115a8919061214f565b6000604051808303816000865af19150503d80600081146115e5576040519150601f19603f3d011682016040523d82523d6000602084013e6115ea565b606091505b50915091508161160c5760405162461bcd60e51b81526004016104be9061236e565b80511561164357808060200190516116279190810190611a7c565b6116435760405162461bcd60e51b81526004016104be906123de565b50505050565b604080516001808252818301909252606091602080830190803883390190505090506e466c657869626c6553746f7261676560881b8160008151811061168b57fe5b60200260200101818152505090565b6000610c1f6524b9b9bab2b960d11b611452565b6000610c1f6d2932bbb0b93222b9b1b937bbab1960911b611452565b6000610c1f6e466c657869626c6553746f7261676560881b611452565b6000808260038111156116f657fe5b141561172357507f63726f7373446f6d61696e4465706f7369744761734c696d69740000000000006114b3565b600182600381111561173157fe5b141561175e57507f63726f7373446f6d61696e457363726f774761734c696d6974000000000000006114b3565b600282600381111561176c57fe5b141561179957507f63726f7373446f6d61696e5265776172644761734c696d6974000000000000006114b3565b60038260038111156117a757fe5b14156117d457507f63726f7373446f6d61696e5769746864726177616c4761734c696d69740000006114b3565b60405162461bcd60e51b81526004016104be906123ee565b3b151590565b803561155881612503565b805161155881612503565b600082601f83011261181957600080fd5b813561182c61182782612455565b61242e565b81815260209384019390925082018360005b8381101561186a578135860161185488826118e6565b845250602092830192919091019060010161183e565b5050505092915050565b600082601f83011261188557600080fd5b815161189361182782612455565b915081818352602084019350602081019050838560408402820111156118b857600080fd5b60005b8381101561186a57816118ce8882611961565b845250602090920191604091909101906001016118bb565b600082601f8301126118f757600080fd5b813561190561182782612455565b9150818183526020840193506020810190508385602084028201111561192a57600080fd5b60005b8381101561186a578161194088826119a8565b845250602092830192919091019060010161192d565b805161155881612517565b60006040828403121561197357600080fd5b61197d604061242e565b9050600061198b84846119be565b825250602061199c848483016119b3565b60208301525092915050565b803561155881612520565b805161155881612520565b805161155881612529565b6000602082840312156119db57600080fd5b60006119e784846117f2565b949350505050565b600060208284031215611a0157600080fd5b60006119e784846117fd565b60008060408385031215611a2057600080fd5b6000611a2c85856117f2565b9250506020611a3d858286016119a8565b9150509250929050565b600060208284031215611a5957600080fd5b813567ffffffffffffffff811115611a7057600080fd5b6119e784828501611808565b600060208284031215611a8e57600080fd5b60006119e78484611956565b600060208284031215611aac57600080fd5b60006119e784846119a8565b600060208284031215611aca57600080fd5b60006119e784846119b3565b60008060408385031215611ae957600080fd5b6000611af585856119a8565b925050602083013567ffffffffffffffff811115611b1257600080fd5b611a3d85828601611808565b60008060408385031215611b3157600080fd5b6000611b3d85856119b3565b925050602083015167ffffffffffffffff811115611b5a57600080fd5b611a3d85828601611874565b6000611b728383611ca4565b505060200190565b6000611b868383612119565b505060400190565b611b97816124bb565b82525050565b611b9781612489565b6000611bb18261247c565b611bbb8185612480565b9350611bc683612476565b8060005b83811015611bf4578151611bde8882611b66565b9750611be983612476565b925050600101611bca565b509495945050505050565b6000611c0a8261247c565b611c148185612480565b9350611c1f83612476565b8060005b83811015611bf4578151611c378882611b7a565b9750611c4283612476565b925050600101611c23565b6000611c588261247c565b611c628185612480565b9350611c6d83612476565b8060005b83811015611bf4578151611c858882611b66565b9750611c9083612476565b925050600101611c71565b611b9781612494565b611b9781610491565b611b97611cb982610491565b610491565b6000611cc98261247c565b611cd38185612480565b9350611ce38185602086016124cd565b611cec816124f9565b9093019392505050565b6000611d018261247c565b611d0b81856114b3565b9350611d1b8185602086016124cd565b9290920192915050565b611b97816124c2565b6000611d3b601883612480565b7f496e6974696174696f6e206e6f742073757370656e6465640000000000000000815260200192915050565b6000611d74603583612480565b7f596f75206d757374206265206e6f6d696e61746564206265666f726520796f7581527402063616e20616363657074206f776e65727368697605c1b602082015260400192915050565b6000611dcb601d83612480565b7f4f6e6c7920746865204c32206272696467652063616e20696e766f6b65000000815260200192915050565b6000611e04601483612480565b73125b9a5d1a585d1a5bdb881cdd5cdc195b99195960621b815260200192915050565b6000611e34602083612480565b7f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815260200192915050565b6000611e6d602183612480565b7f45786365656473206d617820656e747269657320706572206d6967726174696f8152603760f91b602082015260400192915050565b6000611eb06011836114b3565b70026b4b9b9b4b7339030b2323932b9b99d1607d1b815260110192915050565b6000611edd601683612480565b75125b9a5d1a585d1a5bdb8819195858dd1a5d985d195960521b815260200192915050565b6000611f0f602383612480565b7f43616e6e6f74206465706f736974206f72206d6967726174652077697468206481526219589d60ea1b602082015260400192915050565b6000611f54602f83612480565b7f4f6e6c792074686520636f6e7472616374206f776e6572206d6179207065726681526e37b936903a3434b99030b1ba34b7b760891b602082015260400192915050565b631cd554d160e21b9052565b6000611fb1601e83612480565b7f4f6e6c79207468652072656c617965722063616e2063616c6c20746869730000815260200192915050565b6000611fea6019836114b3565b7f5265736f6c766572206d697373696e67207461726765743a2000000000000000815260190192915050565b6000612023602a83612480565b7f43616c6c6572206973206e6f742052657761726473446973747269627574696f8152691b8818dbdb9d1c9858dd60b21b602082015260400192915050565b600061206f602a83612480565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e8152691bdd081cdd58d8d9595960b21b602082015260400192915050565b60006120bb601683612480565b75556e6b6e6f776e20676173206c696d6974207479706560501b815260200192915050565b60006120ed601f83612480565b7f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400815260200192915050565b8051604083019061212a8482612146565b5060208201516116436020850182611ca4565b611b97816124a5565b611b97816124ae565b600061215b8284611cf6565b9392505050565b600061216d82611ea3565b91506121798284611cad565b50602001919050565b600061216d82611fdd565b602081016115588284611b9d565b606081016121a98286611b8e565b6121b66020830185611b9d565b6119e76040830184611ca4565b604081016121d18285611b8e565b81810360208301526119e78184611c4d565b604081016121f18284611b8e565b61155860208301611f98565b6060810161220b8286611b9d565b6122186020830185611ca4565b818103604083015261222a8184611bff565b95945050505050565b604081016122418285611b9d565b61215b6020830184611b9d565b606081016121a98286611b9d565b6060810161226a8286611b9d565b818103602083015261227c8185611cbe565b90506119e7604083018461213d565b604081016122998285611b9d565b61215b6020830184611ca4565b6020808252810161215b8184611ba6565b602081016115588284611c9b565b602081016115588284611ca4565b604081016122418285611ca4565b604081016122998285611ca4565b604081016122fd8285611ca4565b81810360208301526119e78184611cbe565b602081016115588284611d25565b6020808252810161215b8184611cbe565b6020808252810161155881611d2e565b6020808252810161155881611d67565b6020808252810161155881611dbe565b6020808252810161155881611df7565b6020808252810161155881611e27565b6020808252810161155881611e60565b6020808252810161155881611ed0565b6020808252810161155881611f02565b6020808252810161155881611f47565b6020808252810161155881611fa4565b6020808252810161155881612016565b6020808252810161155881612062565b60208082528101611558816120ae565b60208082528101611558816120e0565b6040810161241c8285611ca4565b81810360208301526119e78184611bff565b60405181810167ffffffffffffffff8111828210171561244d57600080fd5b604052919050565b600067ffffffffffffffff82111561246c57600080fd5b5060209081020190565b60200190565b5190565b90815260200190565b600061155882612499565b151590565b6001600160a01b031690565b63ffffffff1690565b67ffffffffffffffff1690565b6000611558825b600061155882612489565b60005b838110156124e85781810151838201526020016124d0565b838111156116435750506000910152565b601f01601f191690565b61250c81612489565b811461037957600080fd5b61250c81612494565b61250c81610491565b61250c816124ae56fea365627a7a72315820d577a2a103b6b9994161b292600f087425ab39c45183117f13d05f9d4aff6cb96c6578706572696d656e74616cf564736f6c63430005100040000000000000000000000000de910777c787903f78c89e7a0bf7f4c435cbb1fe0000000000000000000000004e3b31eb0e5cb73641ee1e65e7dcefe520ba3ef2

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101215760003560e01c8063698a26b2116100ad5780639a9e7f96116100715780639a9e7f9614610201578063a18e230714610214578063b6b55f2514610227578063f4f7b41a1461023a578063ffaad6a51461024d57610121565b8063698a26b2146101cc57806374185360146101d457806379ba5097146101dc578063899ffef4146101e45780638da5cb5b146101f957610121565b80632af64bd3116100f45780632af64bd3146101815780633872dda3146101895780633c6b16ab14610191578063462286d5146101a457806353a47bb7146101b757610121565b806304f3bcec14610126578063100be6d4146101445780631627540c146101595780631e2720ff1461016e575b600080fd5b61012e610260565b60405161013b919061230f565b60405180910390f35b61014c61026f565b60405161013b91906122b7565b61016c6101673660046119c9565b610278565b005b61016c61017c366004611a9a565b6102d6565b61014c61037c565b61016c610494565b61016c61019f366004611a9a565b6104fc565b61016c6101b23660046119c9565b610570565b6101bf610613565b60405161013b919061218d565b61016c610622565b61016c610685565b61016c6107d7565b6101ec610873565b60405161013b91906122a6565b6101bf610971565b61016c61020f366004611a47565b610980565b61016c610222366004611ad6565b610999565b61016c610235366004611a9a565b6109c9565b61016c610248366004611a0d565b6109e3565b61016c61025b366004611a0d565b610ba0565b6002546001600160a01b031681565b60045460ff1681565b610280610bba565b600180546001600160a01b0319166001600160a01b0383161790556040517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce22906102cb90839061218d565b60405180910390a150565b6102de610be6565b6102e6610c08565b6001600160a01b03166323b872dd336102fd610c24565b846040518463ffffffff1660e01b815260040161031c9392919061219b565b602060405180830381600087803b15801561033657600080fd5b505af115801561034a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061036e9190810190611a7c565b506103793382610c47565b50565b60006060610388610873565b905060005b815181101561048a5760008282815181106103a457fe5b602090810291909101810151600081815260039092526040918290205460025492516321f8a72160e01b81529193506001600160a01b039081169216906321f8a721906103f59085906004016122c5565b60206040518083038186803b15801561040d57600080fd5b505afa158015610421573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061044591908101906119ef565b6001600160a01b031614158061047057506000818152600360205260409020546001600160a01b0316155b156104815760009350505050610491565b5060010161038d565b5060019150505b90565b61049c610bba565b60045460ff166104c75760405162461bcd60e51b81526004016104be9061235e565b60405180910390fd5b6004805460ff191690556040517f43e00f2c8f8651a29db34d34fb689573423f8aaae8f9d32e3e871b4c35c6254690600090a1565b610504610d5d565b6001600160a01b0316336001600160a01b0316146105345760405162461bcd60e51b81526004016104be906123ce565b61053c610c08565b6001600160a01b031663a9059cbb610552610c24565b836040518363ffffffff1660e01b815260040161031c92919061228b565b8061060f61057c610c24565b6040516370a0823160e01b81526001600160a01b038416906370a08231906105a890309060040161218d565b60206040518083038186803b1580156105c057600080fd5b505afa1580156105d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506105f89190810190611ab8565b6001600160a01b038416919063ffffffff610d7e16565b5050565b6001546001600160a01b031681565b61062a610bba565b60045460ff161561064d5760405162461bcd60e51b81526004016104be9061232e565b6004805460ff191660011790556040517f7c88488c18e2ff121a34a4a2a44990557a5b76ab1ceb6bd95ebe7d419c7575f490600090a1565b606061068f610873565b905060005b815181101561060f5760008282815181106106ab57fe5b602002602001015190506000600260009054906101000a90046001600160a01b03166001600160a01b031663dacb2d0183846040516020016106ed9190612182565b6040516020818303038152906040526040518363ffffffff1660e01b81526004016107199291906122ef565b60206040518083038186803b15801561073157600080fd5b505afa158015610745573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061076991908101906119ef565b6000838152600360205260409081902080546001600160a01b0319166001600160a01b038416179055519091507f88a93678a3692f6789d9546fc621bf7234b101ddb7d4fe479455112831b8aa68906107c590849084906122d3565b60405180910390a15050600101610694565b6001546001600160a01b031633146108015760405162461bcd60e51b81526004016104be9061233e565b6000546001546040517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c92610844926001600160a01b0391821692911690612233565b60405180910390a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b60608061087e610ddc565b60408051600480825260a0820190925291925060609190602082016080803883390190505090506524b9b9bab2b960d11b816000815181106108bc57fe5b602002602001018181525050722932bbb0b93239a234b9ba3934b13aba34b7b760691b816001815181106108ec57fe5b602002602001018181525050786f766d3a53796e746865746978427269646765546f4261736560381b8160028151811061092257fe5b6020026020010181815250507453796e746865746978427269646765457363726f7760581b8160038151811061095457fe5b60200260200101818152505061096a8282610e7c565b9250505090565b6000546001600160a01b031681565b610988610be6565b610990610f38565b61037981610fd8565b6109a1610be6565b6109a9610f38565b8051156109b9576109b981610fd8565b811561060f5761060f3383611279565b6109d1610be6565b6109d9610f38565b6103793382611279565b6109eb611414565b6001600160a01b0316336001600160a01b031614610a1b5760405162461bcd60e51b81526004016104be906123be565b610a2361142f565b6001600160a01b0316610a34611414565b6001600160a01b0316636e296e456040518163ffffffff1660e01b815260040160206040518083038186803b158015610a6c57600080fd5b505afa158015610a80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610aa491908101906119ef565b6001600160a01b031614610aca5760405162461bcd60e51b81526004016104be9061234e565b610ad2610c08565b6001600160a01b03166323b872dd610ae8610c24565b84846040518463ffffffff1660e01b8152600401610b089392919061224e565b602060405180830381600087803b158015610b2257600080fd5b505af1158015610b36573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610b5a9190810190611a7c565b50816001600160a01b03167f9e5c4f9f4e46b8629d3dda85f43a69194f50254404a72dc62b9e932d9c94eda882604051610b9491906122c5565b60405180910390a25050565b610ba8610be6565b610bb0610f38565b61060f8282611279565b6000546001600160a01b03163314610be45760405162461bcd60e51b81526004016104be906123ae565b565b60045460ff16610be45760405162461bcd60e51b81526004016104be9061238e565b6000610c1f680a6f2dce8d0cae8d2f60bb1b611452565b905090565b6000610c1f7453796e746865746978427269646765457363726f7760581b611452565b60405160009060609063a616cdfb60e01b90610c69908690869060240161228b565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091529050610ca5611414565b6001600160a01b0316633dbb202b610cbb61142f565b83610cc660026114b8565b6040518463ffffffff1660e01b8152600401610ce49392919061225c565b600060405180830381600087803b158015610cfe57600080fd5b505af1158015610d12573d6000803e3d6000fd5b50505050836001600160a01b03167f0ac6af0c6fd21e58850b0385f451cdcc08071424f47fd04652be4e51069f43cc84604051610d4f91906122c5565b60405180910390a250505050565b6000610c1f722932bbb0b93239a234b9ba3934b13aba34b7b760691b611452565b604051610dd790849063a9059cbb60e01b90610da0908690869060240161228b565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261155e565b505050565b606080610de7611649565b60408051600380825260808201909252919250606091906020820183803883390190505090506c32bc3a1d26b2b9b9b2b733b2b960991b81600081518110610e2b57fe5b602002602001018181525050680a6f2dce8d0cae8d2f60bb1b81600181518110610e5157fe5b6020026020010181815250506d2932bbb0b93222b9b1b937bbab1960911b8160028151811061095457fe5b60608151835101604051908082528060200260200182016040528015610eac578160200160208202803883390190505b50905060005b8351811015610eee57838181518110610ec757fe5b6020026020010151828281518110610edb57fe5b6020908102919091010152600101610eb2565b5060005b8251811015610f3157828181518110610f0757fe5b6020026020010151828286510181518110610f1e57fe5b6020908102919091010152600101610ef2565b5092915050565b610f4061169a565b6001600160a01b031663d37c4d8b336040518263ffffffff1660e01b8152600401610f6b91906121e3565b60206040518083038186803b158015610f8357600080fd5b505afa158015610f97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610fbb9190810190611ab8565b15610be45760405162461bcd60e51b81526004016104be9061239e565b60005b815181101561060f57601a60ff16828281518110610ff557fe5b602002602001015151111561101c5760405162461bcd60e51b81526004016104be9061237e565b600060606110286116ae565b6001600160a01b03166380d46f583386868151811061104357fe5b60200260200101516040518363ffffffff1660e01b81526004016110689291906121c3565b600060405180830381600087803b15801561108257600080fd5b505af1158015611096573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526110be9190810190611b1e565b9092509050811561126f576110d1610c08565b6001600160a01b031663a9059cbb6110e7610c24565b846040518363ffffffff1660e01b815260040161110592919061228b565b602060405180830381600087803b15801561111f57600080fd5b505af1158015611133573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506111579190810190611a7c565b50604051600090606090637cbc127f60e11b9061117c903390879087906024016121fd565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915290506111b8611414565b6001600160a01b0316633dbb202b6111ce61142f565b836111d960016114b8565b6040518463ffffffff1660e01b81526004016111f79392919061225c565b600060405180830381600087803b15801561121157600080fd5b505af1158015611225573d6000803e3d6000fd5b50505050336001600160a01b03167f4dc5956ab6218a4dfa2cc5e5c50d98d039dde03aabfc504c54b601b6f5622696858560405161126492919061240e565b60405180910390a250505b5050600101610fdb565b611281610c08565b6001600160a01b03166323b872dd33611298610c24565b846040518463ffffffff1660e01b81526004016112b79392919061219b565b602060405180830381600087803b1580156112d157600080fd5b505af11580156112e5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506113099190810190611a7c565b50604051600090606090638d6e9a5b60e01b9061132c908690869060240161228b565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091529050611368611414565b6001600160a01b0316633dbb202b61137e61142f565b8361138960006114b8565b6040518463ffffffff1660e01b81526004016113a79392919061225c565b600060405180830381600087803b1580156113c157600080fd5b505af11580156113d5573d6000803e3d6000fd5b50505050336001600160a01b03167ff531653a5819e21265de50358610d55dbe6594c61605b209dfa4280d277938c18585604051610d4f92919061228b565b6000610c1f6c32bc3a1d26b2b9b9b2b733b2b960991b611452565b6000610c1f786f766d3a53796e746865746978427269646765546f4261736560381b5b60008181526003602090815260408083205490516001600160a01b03909116918215159161148291869101612162565b604051602081830303815290604052906114af5760405162461bcd60e51b81526004016104be919061231d565b5090505b919050565b60006114c26116ca565b6001600160a01b03166323257c2b6d53797374656d53657474696e677360901b6114eb856116e7565b6040518363ffffffff1660e01b81526004016115089291906122e1565b60206040518083038186803b15801561152057600080fd5b505afa158015611534573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506115589190810190611ab8565b92915050565b611570826001600160a01b03166117ec565b61158c5760405162461bcd60e51b81526004016104be906123fe565b60006060836001600160a01b0316836040516115a8919061214f565b6000604051808303816000865af19150503d80600081146115e5576040519150601f19603f3d011682016040523d82523d6000602084013e6115ea565b606091505b50915091508161160c5760405162461bcd60e51b81526004016104be9061236e565b80511561164357808060200190516116279190810190611a7c565b6116435760405162461bcd60e51b81526004016104be906123de565b50505050565b604080516001808252818301909252606091602080830190803883390190505090506e466c657869626c6553746f7261676560881b8160008151811061168b57fe5b60200260200101818152505090565b6000610c1f6524b9b9bab2b960d11b611452565b6000610c1f6d2932bbb0b93222b9b1b937bbab1960911b611452565b6000610c1f6e466c657869626c6553746f7261676560881b611452565b6000808260038111156116f657fe5b141561172357507f63726f7373446f6d61696e4465706f7369744761734c696d69740000000000006114b3565b600182600381111561173157fe5b141561175e57507f63726f7373446f6d61696e457363726f774761734c696d6974000000000000006114b3565b600282600381111561176c57fe5b141561179957507f63726f7373446f6d61696e5265776172644761734c696d6974000000000000006114b3565b60038260038111156117a757fe5b14156117d457507f63726f7373446f6d61696e5769746864726177616c4761734c696d69740000006114b3565b60405162461bcd60e51b81526004016104be906123ee565b3b151590565b803561155881612503565b805161155881612503565b600082601f83011261181957600080fd5b813561182c61182782612455565b61242e565b81815260209384019390925082018360005b8381101561186a578135860161185488826118e6565b845250602092830192919091019060010161183e565b5050505092915050565b600082601f83011261188557600080fd5b815161189361182782612455565b915081818352602084019350602081019050838560408402820111156118b857600080fd5b60005b8381101561186a57816118ce8882611961565b845250602090920191604091909101906001016118bb565b600082601f8301126118f757600080fd5b813561190561182782612455565b9150818183526020840193506020810190508385602084028201111561192a57600080fd5b60005b8381101561186a578161194088826119a8565b845250602092830192919091019060010161192d565b805161155881612517565b60006040828403121561197357600080fd5b61197d604061242e565b9050600061198b84846119be565b825250602061199c848483016119b3565b60208301525092915050565b803561155881612520565b805161155881612520565b805161155881612529565b6000602082840312156119db57600080fd5b60006119e784846117f2565b949350505050565b600060208284031215611a0157600080fd5b60006119e784846117fd565b60008060408385031215611a2057600080fd5b6000611a2c85856117f2565b9250506020611a3d858286016119a8565b9150509250929050565b600060208284031215611a5957600080fd5b813567ffffffffffffffff811115611a7057600080fd5b6119e784828501611808565b600060208284031215611a8e57600080fd5b60006119e78484611956565b600060208284031215611aac57600080fd5b60006119e784846119a8565b600060208284031215611aca57600080fd5b60006119e784846119b3565b60008060408385031215611ae957600080fd5b6000611af585856119a8565b925050602083013567ffffffffffffffff811115611b1257600080fd5b611a3d85828601611808565b60008060408385031215611b3157600080fd5b6000611b3d85856119b3565b925050602083015167ffffffffffffffff811115611b5a57600080fd5b611a3d85828601611874565b6000611b728383611ca4565b505060200190565b6000611b868383612119565b505060400190565b611b97816124bb565b82525050565b611b9781612489565b6000611bb18261247c565b611bbb8185612480565b9350611bc683612476565b8060005b83811015611bf4578151611bde8882611b66565b9750611be983612476565b925050600101611bca565b509495945050505050565b6000611c0a8261247c565b611c148185612480565b9350611c1f83612476565b8060005b83811015611bf4578151611c378882611b7a565b9750611c4283612476565b925050600101611c23565b6000611c588261247c565b611c628185612480565b9350611c6d83612476565b8060005b83811015611bf4578151611c858882611b66565b9750611c9083612476565b925050600101611c71565b611b9781612494565b611b9781610491565b611b97611cb982610491565b610491565b6000611cc98261247c565b611cd38185612480565b9350611ce38185602086016124cd565b611cec816124f9565b9093019392505050565b6000611d018261247c565b611d0b81856114b3565b9350611d1b8185602086016124cd565b9290920192915050565b611b97816124c2565b6000611d3b601883612480565b7f496e6974696174696f6e206e6f742073757370656e6465640000000000000000815260200192915050565b6000611d74603583612480565b7f596f75206d757374206265206e6f6d696e61746564206265666f726520796f7581527402063616e20616363657074206f776e65727368697605c1b602082015260400192915050565b6000611dcb601d83612480565b7f4f6e6c7920746865204c32206272696467652063616e20696e766f6b65000000815260200192915050565b6000611e04601483612480565b73125b9a5d1a585d1a5bdb881cdd5cdc195b99195960621b815260200192915050565b6000611e34602083612480565b7f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815260200192915050565b6000611e6d602183612480565b7f45786365656473206d617820656e747269657320706572206d6967726174696f8152603760f91b602082015260400192915050565b6000611eb06011836114b3565b70026b4b9b9b4b7339030b2323932b9b99d1607d1b815260110192915050565b6000611edd601683612480565b75125b9a5d1a585d1a5bdb8819195858dd1a5d985d195960521b815260200192915050565b6000611f0f602383612480565b7f43616e6e6f74206465706f736974206f72206d6967726174652077697468206481526219589d60ea1b602082015260400192915050565b6000611f54602f83612480565b7f4f6e6c792074686520636f6e7472616374206f776e6572206d6179207065726681526e37b936903a3434b99030b1ba34b7b760891b602082015260400192915050565b631cd554d160e21b9052565b6000611fb1601e83612480565b7f4f6e6c79207468652072656c617965722063616e2063616c6c20746869730000815260200192915050565b6000611fea6019836114b3565b7f5265736f6c766572206d697373696e67207461726765743a2000000000000000815260190192915050565b6000612023602a83612480565b7f43616c6c6572206973206e6f742052657761726473446973747269627574696f8152691b8818dbdb9d1c9858dd60b21b602082015260400192915050565b600061206f602a83612480565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e8152691bdd081cdd58d8d9595960b21b602082015260400192915050565b60006120bb601683612480565b75556e6b6e6f776e20676173206c696d6974207479706560501b815260200192915050565b60006120ed601f83612480565b7f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400815260200192915050565b8051604083019061212a8482612146565b5060208201516116436020850182611ca4565b611b97816124a5565b611b97816124ae565b600061215b8284611cf6565b9392505050565b600061216d82611ea3565b91506121798284611cad565b50602001919050565b600061216d82611fdd565b602081016115588284611b9d565b606081016121a98286611b8e565b6121b66020830185611b9d565b6119e76040830184611ca4565b604081016121d18285611b8e565b81810360208301526119e78184611c4d565b604081016121f18284611b8e565b61155860208301611f98565b6060810161220b8286611b9d565b6122186020830185611ca4565b818103604083015261222a8184611bff565b95945050505050565b604081016122418285611b9d565b61215b6020830184611b9d565b606081016121a98286611b9d565b6060810161226a8286611b9d565b818103602083015261227c8185611cbe565b90506119e7604083018461213d565b604081016122998285611b9d565b61215b6020830184611ca4565b6020808252810161215b8184611ba6565b602081016115588284611c9b565b602081016115588284611ca4565b604081016122418285611ca4565b604081016122998285611ca4565b604081016122fd8285611ca4565b81810360208301526119e78184611cbe565b602081016115588284611d25565b6020808252810161215b8184611cbe565b6020808252810161155881611d2e565b6020808252810161155881611d67565b6020808252810161155881611dbe565b6020808252810161155881611df7565b6020808252810161155881611e27565b6020808252810161155881611e60565b6020808252810161155881611ed0565b6020808252810161155881611f02565b6020808252810161155881611f47565b6020808252810161155881611fa4565b6020808252810161155881612016565b6020808252810161155881612062565b60208082528101611558816120ae565b60208082528101611558816120e0565b6040810161241c8285611ca4565b81810360208301526119e78184611bff565b60405181810167ffffffffffffffff8111828210171561244d57600080fd5b604052919050565b600067ffffffffffffffff82111561246c57600080fd5b5060209081020190565b60200190565b5190565b90815260200190565b600061155882612499565b151590565b6001600160a01b031690565b63ffffffff1690565b67ffffffffffffffff1690565b6000611558825b600061155882612489565b60005b838110156124e85781810151838201526020016124d0565b838111156116435750506000910152565b601f01601f191690565b61250c81612489565b811461037957600080fd5b61250c81612494565b61250c81610491565b61250c816124ae56fea365627a7a72315820d577a2a103b6b9994161b292600f087425ab39c45183117f13d05f9d4aff6cb96c6578706572696d656e74616cf564736f6c63430005100040

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

000000000000000000000000de910777c787903f78c89e7a0bf7f4c435cbb1fe0000000000000000000000004e3b31eb0e5cb73641ee1e65e7dcefe520ba3ef2

-----Decoded View---------------
Arg [0] : _owner (address): 0xDe910777C787903F78C89e7a0bf7F4C435cBB1Fe
Arg [1] : _resolver (address): 0x4E3b31eB0E5CB73641EE1E65E7dCEFe520bA3ef2

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000de910777c787903f78c89e7a0bf7f4c435cbb1fe
Arg [1] : 0000000000000000000000004e3b31eb0e5cb73641ee1e65e7dcefe520ba3ef2


Libraries Used


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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.