Sepolia Testnet

Contract

0x7CA45F1C7DE9395249822d89de10b044eFCe85b9

Overview

ETH Balance

0 ETH

Multichain Info

N/A
Transaction Hash
Method
Block
From
To
Value
Set Fee Pool54873732024-03-14 23:58:4896 days ago1710460728IN
0x7CA45F1C...4eFCe85b9
0 ETH0.000056141.19267606
Set Synthetix54873722024-03-14 23:58:2496 days ago1710460704IN
0x7CA45F1C...4eFCe85b9
0 ETH0.000057211.21377769
0x6080604054871972024-03-14 23:21:1296 days ago1710458472IN
 Create: RewardEscrow
0 ETH0.00014610.13732477

Advanced mode:
Parent Transaction Hash Block From To Value
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
RewardEscrow

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 2024-03-15
*/

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

* Synthetix: RewardEscrow.sol
*
* Latest source (may be newer): https://github.com/Synthetixio/synthetix/blob/master/contracts/RewardEscrow.sol
* Docs: https://docs.synthetix.io/contracts/RewardEscrow
*
* Contract Dependencies: 
*	- IRewardEscrow
*	- Owned
* Libraries: 
*	- SafeDecimalMath
*	- SafeMath
*
* MIT License
* ===========
*
* Copyright (c) 2024 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/irewardescrow
interface IRewardEscrow {
    // 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 getVestingScheduleEntry(address account, uint index) external view returns (uint[2] memory);

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

    // Mutative functions
    function appendVestingEntry(address account, uint quantity) external;

    function vest() external;
}


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

        return c;
    }

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

        return c;
    }

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

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

        return c;
    }

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

        return c;
    }

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


// Libraries


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

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

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

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

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

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

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

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

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

        return quotientTimesTen / 10;
    }

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

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

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

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

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

        return resultTimesTen / 10;
    }

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

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

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

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

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

        return quotientTimesTen / 10;
    }

    // Computes `a - b`, setting the value to 0 if b > a.
    function floorsub(uint a, uint b) internal pure returns (uint) {
        return b >= a ? 0 : a - b;
    }

    /* ---------- Utilities ---------- */
    /*
     * Absolute value of the input, returned as a signed number.
     */
    function signedAbs(int x) internal pure returns (int) {
        return x < 0 ? -x : x;
    }

    /*
     * Absolute value of the input, returned as an unsigned number.
     */
    function abs(int x) internal pure returns (uint) {
        return uint(signedAbs(x));
    }
}


// https://docs.synthetix.io/contracts/source/interfaces/ierc20
interface IERC20 {
    // ERC20 Optional Views
    function name() external view returns (string memory);

    function symbol() external view returns (string memory);

    function decimals() external view returns (uint8);

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

    function balanceOf(address owner) external view returns (uint);

    function allowance(address owner, address spender) external view returns (uint);

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

    function approve(address spender, uint value) external returns (bool);

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

    // Events
    event Transfer(address indexed from, address indexed to, uint value);

    event Approval(address indexed owner, address indexed spender, uint value);
}


// https://docs.synthetix.io/contracts/source/interfaces/ifeepool
interface IFeePool {
    // Views

    // solhint-disable-next-line func-name-mixedcase
    function FEE_ADDRESS() external view returns (address);

    function feesAvailable(address account) external view returns (uint, uint);

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

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

    function feePeriodDuration() external view returns (uint);

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

    function targetThreshold() external view returns (uint);

    function totalFeesAvailable() external view returns (uint);

    function totalFeesBurned() external view returns (uint);

    function totalRewardsAvailable() external view returns (uint);

    // Mutative Functions
    function claimFees() external returns (bool);

    function claimOnBehalf(address claimingForAddress) external returns (bool);

    function closeCurrentFeePeriod() external;

    function closeSecondary(uint snxBackedDebt, uint debtShareSupply) external;

    function recordFeePaid(uint sUSDAmount) external;

    function setRewardsToDistribute(uint amount) external;
}


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


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 totalIssuedSynthsExcludeOtherCollateral(bytes32 currencyKey) external view returns (uint);

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

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

    // 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 rewardAddress,
        bytes32 trackingCode
    ) external returns (uint amountReceived);

    function exchangeWithTrackingForInitiator(
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey,
        address rewardAddress,
        bytes32 trackingCode
    ) external returns (uint amountReceived);

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

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

    function exchangeAtomically(
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey,
        bytes32 trackingCode,
        uint minAmount
    ) external returns (uint amountReceived);

    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) external returns (bool);

    function liquidateDelinquentAccountEscrowIndex(address account, uint escrowStartIndex) external returns (bool);

    function liquidateSelf() external returns (bool);

    // Restricted Functions

    function mintSecondary(address account, uint amount) external;

    function mintSecondaryRewards(uint amount) external;

    function burnSecondary(address account, uint amount) external;

    function migrateAccountBalances(address account) external returns (uint totalEscrowRevoked, uint totalLiquidBalance);
}


// Inheritance


// Libraries


// Internal references


// https://docs.synthetix.io/contracts/source/contracts/rewardescrow
contract RewardEscrow is Owned, IRewardEscrow {
    using SafeMath for uint;

    /* The corresponding Synthetix contract. */
    ISynthetix public synthetix;

    IFeePool public feePool;

    /* Lists of (timestamp, quantity) pairs per account, sorted in ascending time order.
     * These are the times at which each given quantity of SNX vests. */
    mapping(address => uint[2][]) public vestingSchedules;

    /* An account's total escrowed synthetix balance to save recomputing this for fee extraction purposes. */
    mapping(address => uint) public totalEscrowedAccountBalance;

    /* An account's total vested reward synthetix. */
    mapping(address => uint) public totalVestedAccountBalance;

    /* The total remaining escrowed balance, for verifying the actual synthetix balance of this contract against. */
    uint public totalEscrowedBalance;

    uint internal constant TIME_INDEX = 0;
    uint internal constant QUANTITY_INDEX = 1;

    /* Limit vesting entries to disallow unbounded iteration over vesting schedules.
     * There are 5 years of the supply schedule */
    uint public constant MAX_VESTING_ENTRIES = 52 * 5;

    /* ========== CONSTRUCTOR ========== */

    constructor(
        address _owner,
        ISynthetix _synthetix,
        IFeePool _feePool
    ) public Owned(_owner) {
        synthetix = _synthetix;
        feePool = _feePool;
    }

    /* ========== SETTERS ========== */

    /**
     * @notice set the synthetix contract address as we need to transfer SNX when the user vests
     */
    function setSynthetix(ISynthetix _synthetix) external onlyOwner {
        synthetix = _synthetix;
        emit SynthetixUpdated(address(_synthetix));
    }

    /**
     * @notice set the FeePool contract as it is the only authority to be able to call
     * appendVestingEntry with the onlyFeePool modifer
     */
    function setFeePool(IFeePool _feePool) external onlyOwner {
        feePool = _feePool;
        emit FeePoolUpdated(address(_feePool));
    }

    /* ========== VIEW FUNCTIONS ========== */

    /**
     * @notice A simple alias to totalEscrowedAccountBalance: provides ERC20 balance integration.
     */
    function balanceOf(address account) public view returns (uint) {
        return totalEscrowedAccountBalance[account];
    }

    function _numVestingEntries(address account) internal view returns (uint) {
        return vestingSchedules[account].length;
    }

    /**
     * @notice The number of vesting dates in an account's schedule.
     */
    function numVestingEntries(address account) external view returns (uint) {
        return vestingSchedules[account].length;
    }

    /**
     * @notice Get a particular schedule entry for an account.
     * @return A pair of uints: (timestamp, synthetix quantity).
     */
    function getVestingScheduleEntry(address account, uint index) public view returns (uint[2] memory) {
        return vestingSchedules[account][index];
    }

    /**
     * @notice Get the time at which a given schedule entry will vest.
     */
    function getVestingTime(address account, uint index) public view returns (uint) {
        return getVestingScheduleEntry(account, index)[TIME_INDEX];
    }

    /**
     * @notice Get the quantity of SNX associated with a given schedule entry.
     */
    function getVestingQuantity(address account, uint index) public view returns (uint) {
        return getVestingScheduleEntry(account, index)[QUANTITY_INDEX];
    }

    /**
     * @notice Obtain the index of the next schedule entry that will vest for a given user.
     */
    function getNextVestingIndex(address account) public view returns (uint) {
        uint len = _numVestingEntries(account);
        for (uint i = 0; i < len; i++) {
            if (getVestingTime(account, i) != 0) {
                return i;
            }
        }
        return len;
    }

    /**
     * @notice Obtain the next schedule entry that will vest for a given user.
     * @return A pair of uints: (timestamp, synthetix quantity). */
    function getNextVestingEntry(address account) public view returns (uint[2] memory) {
        uint index = getNextVestingIndex(account);
        if (index == _numVestingEntries(account)) {
            return [uint(0), 0];
        }
        return getVestingScheduleEntry(account, index);
    }

    /**
     * @notice Obtain the time at which the next schedule entry will vest for a given user.
     */
    function getNextVestingTime(address account) external view returns (uint) {
        return getNextVestingEntry(account)[TIME_INDEX];
    }

    /**
     * @notice Obtain the quantity which the next schedule entry will vest for a given user.
     */
    function getNextVestingQuantity(address account) external view returns (uint) {
        return getNextVestingEntry(account)[QUANTITY_INDEX];
    }

    /**
     * @notice return the full vesting schedule entries vest for a given user.
     * @dev For DApps to display the vesting schedule for the
     * inflationary supply over 5 years. Solidity cant return variable length arrays
     * so this is returning pairs of data. Vesting Time at [0] and quantity at [1] and so on
     */
    function checkAccountSchedule(address account) public view returns (uint[520] memory) {
        uint[520] memory _result;
        uint schedules = _numVestingEntries(account);
        for (uint i = 0; i < schedules; i++) {
            uint[2] memory pair = getVestingScheduleEntry(account, i);
            _result[i * 2] = pair[0];
            _result[i * 2 + 1] = pair[1];
        }
        return _result;
    }

    /* ========== MUTATIVE FUNCTIONS ========== */

    function _appendVestingEntry(address account, uint quantity) internal {
        /* No empty or already-passed vesting entries allowed. */
        require(quantity != 0, "Quantity cannot be zero");

        /* There must be enough balance in the contract to provide for the vesting entry. */
        totalEscrowedBalance = totalEscrowedBalance.add(quantity);
        require(
            totalEscrowedBalance <= IERC20(address(synthetix)).balanceOf(address(this)),
            "Must be enough balance in the contract to provide for the vesting entry"
        );

        /* Disallow arbitrarily long vesting schedules in light of the gas limit. */
        uint scheduleLength = vestingSchedules[account].length;
        require(scheduleLength <= MAX_VESTING_ENTRIES, "Vesting schedule is too long");

        /* Escrow the tokens for 1 year. */
        uint time = now + 52 weeks;

        if (scheduleLength == 0) {
            totalEscrowedAccountBalance[account] = quantity;
        } else {
            /* Disallow adding new vested SNX earlier than the last one.
             * Since entries are only appended, this means that no vesting date can be repeated. */
            require(
                getVestingTime(account, scheduleLength - 1) < time,
                "Cannot add new vested entries earlier than the last one"
            );
            totalEscrowedAccountBalance[account] = totalEscrowedAccountBalance[account].add(quantity);
        }

        vestingSchedules[account].push([time, quantity]);

        emit VestingEntryCreated(account, now, quantity);
    }

    /**
     * @notice Add a new vesting entry at a given time and quantity to an account's schedule.
     * @dev A call to this should accompany a previous successful call to synthetix.transfer(rewardEscrow, amount),
     * to ensure that when the funds are withdrawn, there is enough balance.
     * Note; although this function could technically be used to produce unbounded
     * arrays, it's only withinn the 4 year period of the weekly inflation schedule.
     * @param account The account to append a new vesting entry to.
     * @param quantity The quantity of SNX that will be escrowed.
     */
    function appendVestingEntry(address account, uint quantity) external onlyFeePool {
        _appendVestingEntry(account, quantity);
    }

    /**
     * @notice Allow a user to withdraw any SNX in their schedule that have vested.
     */
    function vest() external {
        uint numEntries = _numVestingEntries(msg.sender);
        uint total;
        for (uint i = 0; i < numEntries; i++) {
            uint time = getVestingTime(msg.sender, i);
            /* The list is sorted; when we reach the first future time, bail out. */
            if (time > now) {
                break;
            }
            uint qty = getVestingQuantity(msg.sender, i);
            if (qty > 0) {
                vestingSchedules[msg.sender][i] = [0, 0];
                total = total.add(qty);
            }
        }

        if (total != 0) {
            totalEscrowedBalance = totalEscrowedBalance.sub(total);
            totalEscrowedAccountBalance[msg.sender] = totalEscrowedAccountBalance[msg.sender].sub(total);
            totalVestedAccountBalance[msg.sender] = totalVestedAccountBalance[msg.sender].add(total);
            IERC20(address(synthetix)).transfer(msg.sender, total);
            emit Vested(msg.sender, now, total);
        }
    }

    /* ========== MODIFIERS ========== */

    modifier onlyFeePool() {
        bool isFeePool = msg.sender == address(feePool);

        require(isFeePool, "Only the FeePool contracts can perform this action");
        _;
    }

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

    event SynthetixUpdated(address newSynthetix);

    event FeePoolUpdated(address newFeePool);

    event Vested(address indexed beneficiary, uint time, uint value);

    event VestingEntryCreated(address indexed beneficiary, uint time, uint value);
}

Contract ABI

[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract ISynthetix","name":"_synthetix","type":"address"},{"internalType":"contract IFeePool","name":"_feePool","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newFeePool","type":"address"}],"name":"FeePoolUpdated","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":false,"internalType":"address","name":"newSynthetix","type":"address"}],"name":"SynthetixUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beneficiary","type":"address"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Vested","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beneficiary","type":"address"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"VestingEntryCreated","type":"event"},{"constant":true,"inputs":[],"name":"MAX_VESTING_ENTRIES","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"acceptOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"appendVestingEntry","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"checkAccountSchedule","outputs":[{"internalType":"uint256[520]","name":"","type":"uint256[520]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"feePool","outputs":[{"internalType":"contract IFeePool","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getNextVestingEntry","outputs":[{"internalType":"uint256[2]","name":"","type":"uint256[2]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getNextVestingIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getNextVestingQuantity","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getNextVestingTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getVestingQuantity","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getVestingScheduleEntry","outputs":[{"internalType":"uint256[2]","name":"","type":"uint256[2]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getVestingTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"nominateNewOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"nominatedOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"numVestingEntries","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"contract IFeePool","name":"_feePool","type":"address"}],"name":"setFeePool","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"contract ISynthetix","name":"_synthetix","type":"address"}],"name":"setSynthetix","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"synthetix","outputs":[{"internalType":"contract ISynthetix","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"totalEscrowedAccountBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalEscrowedBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"totalVestedAccountBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"vest","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"vestingSchedules","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b506040516112e23803806112e28339818101604052606081101561003357600080fd5b5080516020820151604090920151909190826001600160a01b0381166100a0576040805162461bcd60e51b815260206004820152601960248201527f4f776e657220616464726573732063616e6e6f74206265203000000000000000604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b038316908117825560408051928352602083019190915280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a150600280546001600160a01b039384166001600160a01b03199182161790915560038054929093169116179055506111ad806101356000396000f3fe608060405234801561001057600080fd5b50600436106101735760003560e01c806370a08231116100de5780639b217f9011610097578063d0cc82e311610071578063d0cc82e31461045d578063da7bd3e914610465578063ee1d036c14610491578063fec9f9da146104bd57610173565b80639b217f90146103fd578063ae2e933b14610429578063b5ddb9c71461043157610173565b806370a082311461039157806371e780f3146103b7578063759b5225146103bf57806379ba5097146103c75780638da5cb5b146103cf57806397f46527146103d757610173565b8063326a3cfb11610130578063326a3cfb146102ab578063449d0eb1146102d1578063458efde31461030d57806345e5441f1461031557806353a47bb7146103475780636b3905c41461036b57610173565b80631627540c1461017857806319db2228146101a057806319e740c0146101c6578063204b676a146101fe578063227d517a146102245780632f5bb6611461024a575b600080fd5b61019e6004803603602081101561018e57600080fd5b50356001600160a01b03166104e3565b005b61019e600480360360208110156101b657600080fd5b50356001600160a01b031661053f565b6101ec600480360360208110156101dc57600080fd5b50356001600160a01b031661059b565b60408051918252519081900360200190f35b6101ec6004803603602081101561021457600080fd5b50356001600160a01b03166105dd565b6101ec6004803603602081101561023a57600080fd5b50356001600160a01b03166105f8565b6102706004803603602081101561026057600080fd5b50356001600160a01b031661060a565b6040518082600260200280838360005b83811015610298578181015183820152602001610280565b5050505090500191505060405180910390f35b6101ec600480360360208110156102c157600080fd5b50356001600160a01b031661065b565b6102f7600480360360208110156102e757600080fd5b50356001600160a01b031661066d565b6040518151815280826141008083836020610280565b61019e6106f3565b6101ec6004803603606081101561032b57600080fd5b506001600160a01b0381351690602081013590604001356108dc565b61034f610918565b604080516001600160a01b039092168252519081900360200190f35b6101ec6004803603602081101561038157600080fd5b50356001600160a01b0316610927565b6101ec600480360360208110156103a757600080fd5b50356001600160a01b0316610940565b6101ec61095b565b61034f610961565b61019e610970565b61034f610a2c565b6101ec600480360360208110156103ed57600080fd5b50356001600160a01b0316610a3b565b6101ec6004803603604081101561041357600080fd5b506001600160a01b038135169060200135610a4d565b61034f610a68565b61019e6004803603604081101561044757600080fd5b506001600160a01b038135169060200135610a77565b6101ec610ad0565b6102706004803603604081101561047b57600080fd5b506001600160a01b038135169060200135610ad6565b6101ec600480360360408110156104a757600080fd5b506001600160a01b038135169060200135610b45565b61019e600480360360208110156104d357600080fd5b50356001600160a01b0316610b58565b6104eb610bb4565b600180546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce229181900360200190a150565b610547610bb4565b600380546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f6d1d088acfe4f30d6014f6f693c61c16258f9784a6ed8439b2c59213eecb62959181900360200190a150565b6000806105a7836105dd565b905060005b818110156105d4576105be8482610a4d565b156105cc5791506105d89050565b6001016105ac565b5090505b919050565b6001600160a01b031660009081526004602052604090205490565b60066020526000908152604090205481565b610612610f98565b600061061d8361059b565b9050610628836105dd565b81141561064a57505060408051808201909152600080825260208201526105d8565b6106548382610ad6565b9392505050565b60056020526000908152604090205481565b610675610fb6565b61067d610fb6565b6000610688846105dd565b905060005b818110156106ea5761069d610f98565b6106a78683610ad6565b8051909150846002840261020881106106bc57fe5b60200201528060016020020151848360020260010161020881106106dc57fe5b60200201525060010161068d565b50909392505050565b60006106fe336105dd565b90506000805b828110156107a35760006107183383610a4d565b90504281111561072857506107a3565b60006107343384610b45565b905080156107995760408051808201825260008082526020808301829052338252600490529190912080548590811061076957fe5b9060005260206000209060020201906002610785929190610fd6565b50610796848263ffffffff610bff16565b93505b5050600101610704565b5080156108d8576007546107bd908263ffffffff610c5916565b600755336000908152600560205260409020546107e0908263ffffffff610c5916565b3360009081526005602090815260408083209390935560069052205461080c908263ffffffff610bff16565b33600081815260066020908152604080832094909455600254845163a9059cbb60e01b815260048101949094526024840186905293516001600160a01b039094169363a9059cbb93604480820194918390030190829087803b15801561087157600080fd5b505af1158015610885573d6000803e3d6000fd5b505050506040513d602081101561089b57600080fd5b50506040805142815260208101839052815133927ffbeff59d2bfda0d79ea8a29f8c57c66d48c7a13eabbdb90908d9115ec41c9dc6928290030190a25b5050565b600460205282600052604060002082815481106108f557fe5b9060005260206000209060020201816002811061090e57fe5b0154925083915050565b6001546001600160a01b031681565b60006109328261060a565b60005b602002015192915050565b6001600160a01b031660009081526005602052604090205490565b60075481565b6002546001600160a01b031681565b6001546001600160a01b031633146109b95760405162461bcd60e51b81526004018080602001828103825260358152602001806110656035913960400191505060405180910390fd5b600054600154604080516001600160a01b03938416815292909116602083015280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b6000546001600160a01b031681565b6000610a468261060a565b6001610935565b6000610a598383610ad6565b60005b60200201519392505050565b6003546001600160a01b031681565b6003546001600160a01b0316331480610ac15760405162461bcd60e51b81526004018080602001828103825260328152602001806111476032913960400191505060405180910390fd5b610acb8383610cb6565b505050565b61010481565b610ade610f98565b6001600160a01b0383166000908152600460205260409020805483908110610b0257fe5b600091825260209091206040805180820191829052926002908102909201919082845b815481526020019060010190808311610b25575050505050905092915050565b6000610b518383610ad6565b6001610a5c565b610b60610bb4565b600280546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f46e9c68bd7831071bdd478f1ae4c4a52463961a9d620383a0a121dbfc0e0f06d9181900360200190a150565b6000546001600160a01b03163314610bfd5760405162461bcd60e51b815260040180806020018281038252602f815260200180611118602f913960400191505060405180910390fd5b565b600082820183811015610654576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600082821115610cb0576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b80610d08576040805162461bcd60e51b815260206004820152601760248201527f5175616e746974792063616e6e6f74206265207a65726f000000000000000000604482015290519081900360640190fd5b600754610d1b908263ffffffff610bff16565b600755600254604080516370a0823160e01b815230600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b158015610d6957600080fd5b505afa158015610d7d573d6000803e3d6000fd5b505050506040513d6020811015610d9357600080fd5b50516007541115610dd55760405162461bcd60e51b81526004018080602001828103825260478152602001806110d16047913960600191505060405180910390fd5b6001600160a01b038216600090815260046020526040902054610104811115610e45576040805162461bcd60e51b815260206004820152601c60248201527f56657374696e67207363686564756c6520697320746f6f206c6f6e6700000000604482015290519081900360640190fd5b6301dfe200420181610e71576001600160a01b0384166000908152600560205260409020839055610efe565b80610e7f8560018503610a4d565b10610ebb5760405162461bcd60e51b815260040180806020018281038252603781526020018061109a6037913960400191505060405180910390fd5b6001600160a01b038416600090815260056020526040902054610ee4908463ffffffff610bff16565b6001600160a01b0385166000908152600560205260409020555b6001600160a01b0384166000908152600460209081526040808320815180830190925284825281830187905280546001810180835591855292909320610f4d9260029081029091019190611019565b5050604080514281526020810185905281516001600160a01b038716927fedd34dc5a5ea12bd847909801d0660781b50e26c7f4cec3c7b308f1ea410635c928290030190a250505050565b60405180604001604052806002906020820280388339509192915050565b604051806141000160405280610208906020820280388339509192915050565b8260028101928215611009579160200282015b82811115611009578251829060ff16905591602001919060010190610fe9565b50611015929150611047565b5090565b8260028101928215611009579160200282015b8281111561100957825182559160200191906001019061102c565b61106191905b80821115611015576000815560010161104d565b9056fe596f75206d757374206265206e6f6d696e61746564206265666f726520796f752063616e20616363657074206f776e65727368697043616e6e6f7420616464206e65772076657374656420656e7472696573206561726c696572207468616e20746865206c617374206f6e654d75737420626520656e6f7567682062616c616e636520696e2074686520636f6e747261637420746f2070726f7669646520666f72207468652076657374696e6720656e7472794f6e6c792074686520636f6e7472616374206f776e6572206d617920706572666f726d207468697320616374696f6e4f6e6c792074686520466565506f6f6c20636f6e7472616374732063616e20706572666f726d207468697320616374696f6ea265627a7a72315820fa51bbafea8a0e92834ee2381033a3ec9c2e13de4973127626edb6267fa7319764736f6c6343000510003200000000000000000000000048914229dedd5a9922f44441ffccfc2cb7856ee900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101735760003560e01c806370a08231116100de5780639b217f9011610097578063d0cc82e311610071578063d0cc82e31461045d578063da7bd3e914610465578063ee1d036c14610491578063fec9f9da146104bd57610173565b80639b217f90146103fd578063ae2e933b14610429578063b5ddb9c71461043157610173565b806370a082311461039157806371e780f3146103b7578063759b5225146103bf57806379ba5097146103c75780638da5cb5b146103cf57806397f46527146103d757610173565b8063326a3cfb11610130578063326a3cfb146102ab578063449d0eb1146102d1578063458efde31461030d57806345e5441f1461031557806353a47bb7146103475780636b3905c41461036b57610173565b80631627540c1461017857806319db2228146101a057806319e740c0146101c6578063204b676a146101fe578063227d517a146102245780632f5bb6611461024a575b600080fd5b61019e6004803603602081101561018e57600080fd5b50356001600160a01b03166104e3565b005b61019e600480360360208110156101b657600080fd5b50356001600160a01b031661053f565b6101ec600480360360208110156101dc57600080fd5b50356001600160a01b031661059b565b60408051918252519081900360200190f35b6101ec6004803603602081101561021457600080fd5b50356001600160a01b03166105dd565b6101ec6004803603602081101561023a57600080fd5b50356001600160a01b03166105f8565b6102706004803603602081101561026057600080fd5b50356001600160a01b031661060a565b6040518082600260200280838360005b83811015610298578181015183820152602001610280565b5050505090500191505060405180910390f35b6101ec600480360360208110156102c157600080fd5b50356001600160a01b031661065b565b6102f7600480360360208110156102e757600080fd5b50356001600160a01b031661066d565b6040518151815280826141008083836020610280565b61019e6106f3565b6101ec6004803603606081101561032b57600080fd5b506001600160a01b0381351690602081013590604001356108dc565b61034f610918565b604080516001600160a01b039092168252519081900360200190f35b6101ec6004803603602081101561038157600080fd5b50356001600160a01b0316610927565b6101ec600480360360208110156103a757600080fd5b50356001600160a01b0316610940565b6101ec61095b565b61034f610961565b61019e610970565b61034f610a2c565b6101ec600480360360208110156103ed57600080fd5b50356001600160a01b0316610a3b565b6101ec6004803603604081101561041357600080fd5b506001600160a01b038135169060200135610a4d565b61034f610a68565b61019e6004803603604081101561044757600080fd5b506001600160a01b038135169060200135610a77565b6101ec610ad0565b6102706004803603604081101561047b57600080fd5b506001600160a01b038135169060200135610ad6565b6101ec600480360360408110156104a757600080fd5b506001600160a01b038135169060200135610b45565b61019e600480360360208110156104d357600080fd5b50356001600160a01b0316610b58565b6104eb610bb4565b600180546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce229181900360200190a150565b610547610bb4565b600380546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f6d1d088acfe4f30d6014f6f693c61c16258f9784a6ed8439b2c59213eecb62959181900360200190a150565b6000806105a7836105dd565b905060005b818110156105d4576105be8482610a4d565b156105cc5791506105d89050565b6001016105ac565b5090505b919050565b6001600160a01b031660009081526004602052604090205490565b60066020526000908152604090205481565b610612610f98565b600061061d8361059b565b9050610628836105dd565b81141561064a57505060408051808201909152600080825260208201526105d8565b6106548382610ad6565b9392505050565b60056020526000908152604090205481565b610675610fb6565b61067d610fb6565b6000610688846105dd565b905060005b818110156106ea5761069d610f98565b6106a78683610ad6565b8051909150846002840261020881106106bc57fe5b60200201528060016020020151848360020260010161020881106106dc57fe5b60200201525060010161068d565b50909392505050565b60006106fe336105dd565b90506000805b828110156107a35760006107183383610a4d565b90504281111561072857506107a3565b60006107343384610b45565b905080156107995760408051808201825260008082526020808301829052338252600490529190912080548590811061076957fe5b9060005260206000209060020201906002610785929190610fd6565b50610796848263ffffffff610bff16565b93505b5050600101610704565b5080156108d8576007546107bd908263ffffffff610c5916565b600755336000908152600560205260409020546107e0908263ffffffff610c5916565b3360009081526005602090815260408083209390935560069052205461080c908263ffffffff610bff16565b33600081815260066020908152604080832094909455600254845163a9059cbb60e01b815260048101949094526024840186905293516001600160a01b039094169363a9059cbb93604480820194918390030190829087803b15801561087157600080fd5b505af1158015610885573d6000803e3d6000fd5b505050506040513d602081101561089b57600080fd5b50506040805142815260208101839052815133927ffbeff59d2bfda0d79ea8a29f8c57c66d48c7a13eabbdb90908d9115ec41c9dc6928290030190a25b5050565b600460205282600052604060002082815481106108f557fe5b9060005260206000209060020201816002811061090e57fe5b0154925083915050565b6001546001600160a01b031681565b60006109328261060a565b60005b602002015192915050565b6001600160a01b031660009081526005602052604090205490565b60075481565b6002546001600160a01b031681565b6001546001600160a01b031633146109b95760405162461bcd60e51b81526004018080602001828103825260358152602001806110656035913960400191505060405180910390fd5b600054600154604080516001600160a01b03938416815292909116602083015280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b6000546001600160a01b031681565b6000610a468261060a565b6001610935565b6000610a598383610ad6565b60005b60200201519392505050565b6003546001600160a01b031681565b6003546001600160a01b0316331480610ac15760405162461bcd60e51b81526004018080602001828103825260328152602001806111476032913960400191505060405180910390fd5b610acb8383610cb6565b505050565b61010481565b610ade610f98565b6001600160a01b0383166000908152600460205260409020805483908110610b0257fe5b600091825260209091206040805180820191829052926002908102909201919082845b815481526020019060010190808311610b25575050505050905092915050565b6000610b518383610ad6565b6001610a5c565b610b60610bb4565b600280546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f46e9c68bd7831071bdd478f1ae4c4a52463961a9d620383a0a121dbfc0e0f06d9181900360200190a150565b6000546001600160a01b03163314610bfd5760405162461bcd60e51b815260040180806020018281038252602f815260200180611118602f913960400191505060405180910390fd5b565b600082820183811015610654576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600082821115610cb0576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b80610d08576040805162461bcd60e51b815260206004820152601760248201527f5175616e746974792063616e6e6f74206265207a65726f000000000000000000604482015290519081900360640190fd5b600754610d1b908263ffffffff610bff16565b600755600254604080516370a0823160e01b815230600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b158015610d6957600080fd5b505afa158015610d7d573d6000803e3d6000fd5b505050506040513d6020811015610d9357600080fd5b50516007541115610dd55760405162461bcd60e51b81526004018080602001828103825260478152602001806110d16047913960600191505060405180910390fd5b6001600160a01b038216600090815260046020526040902054610104811115610e45576040805162461bcd60e51b815260206004820152601c60248201527f56657374696e67207363686564756c6520697320746f6f206c6f6e6700000000604482015290519081900360640190fd5b6301dfe200420181610e71576001600160a01b0384166000908152600560205260409020839055610efe565b80610e7f8560018503610a4d565b10610ebb5760405162461bcd60e51b815260040180806020018281038252603781526020018061109a6037913960400191505060405180910390fd5b6001600160a01b038416600090815260056020526040902054610ee4908463ffffffff610bff16565b6001600160a01b0385166000908152600560205260409020555b6001600160a01b0384166000908152600460209081526040808320815180830190925284825281830187905280546001810180835591855292909320610f4d9260029081029091019190611019565b5050604080514281526020810185905281516001600160a01b038716927fedd34dc5a5ea12bd847909801d0660781b50e26c7f4cec3c7b308f1ea410635c928290030190a250505050565b60405180604001604052806002906020820280388339509192915050565b604051806141000160405280610208906020820280388339509192915050565b8260028101928215611009579160200282015b82811115611009578251829060ff16905591602001919060010190610fe9565b50611015929150611047565b5090565b8260028101928215611009579160200282015b8281111561100957825182559160200191906001019061102c565b61106191905b80821115611015576000815560010161104d565b9056fe596f75206d757374206265206e6f6d696e61746564206265666f726520796f752063616e20616363657074206f776e65727368697043616e6e6f7420616464206e65772076657374656420656e7472696573206561726c696572207468616e20746865206c617374206f6e654d75737420626520656e6f7567682062616c616e636520696e2074686520636f6e747261637420746f2070726f7669646520666f72207468652076657374696e6720656e7472794f6e6c792074686520636f6e7472616374206f776e6572206d617920706572666f726d207468697320616374696f6e4f6e6c792074686520466565506f6f6c20636f6e7472616374732063616e20706572666f726d207468697320616374696f6ea265627a7a72315820fa51bbafea8a0e92834ee2381033a3ec9c2e13de4973127626edb6267fa7319764736f6c63430005100032

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

00000000000000000000000048914229dedd5a9922f44441ffccfc2cb7856ee900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : _owner (address): 0x48914229deDd5A9922f44441ffCCfC2Cb7856Ee9
Arg [1] : _synthetix (address): 0x0000000000000000000000000000000000000000
Arg [2] : _feePool (address): 0x0000000000000000000000000000000000000000

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 00000000000000000000000048914229dedd5a9922f44441ffccfc2cb7856ee9
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000000


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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