ETH Price: $3,018.68 (+2.98%)
Gas: 2 Gwei

Contract

0x882d80D3a191859d64477eb78Cca46599307ec1C
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
Set Time Lock Pe...76122062019-04-21 17:03:291905 days ago1555866209IN
Set: Transfer Proxy
0 ETH0.000110855
Batch Transfer76117552019-04-21 15:21:041905 days ago1555860064IN
Set: Transfer Proxy
0 ETH0.000110694
Transfer76117392019-04-21 15:17:381905 days ago1555859858IN
Set: Transfer Proxy
0 ETH0.000106324
Transfer Ownersh...76111342019-04-21 13:02:301905 days ago1555851750IN
Set: Transfer Proxy
0 ETH0.000093414
Renounce Ownersh...76111312019-04-21 13:01:561905 days ago1555851716IN
Set: Transfer Proxy
0 ETH0.000087234
Transfer Ownersh...75367022019-04-09 22:54:511917 days ago1554850491IN
Set: Transfer Proxy
0 ETH0.00006122
Set Time Lock Pe...75366492019-04-09 22:42:141917 days ago1554849734IN
Set: Transfer Proxy
0 ETH0.00008482
Add Authorized A...75366482019-04-09 22:41:581917 days ago1554849718IN
Set: Transfer Proxy
0 ETH0.000172262
0x6080604075365782019-04-09 22:29:331917 days ago1554848973IN
 Create: TransferProxy
0 ETH0.002697852

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
TransferProxy

Compiler Version
v0.5.7+commit.6da8b019

Optimization Enabled:
Yes with 200 runs

Other Settings:
byzantium EvmVersion

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2019-05-09
*/

// File: openzeppelin-solidity/contracts/math/SafeMath.sol

pragma solidity ^0.5.2;

/**
 * @title SafeMath
 * @dev Unsigned math operations with safety checks that revert on error
 */
library SafeMath {
    /**
     * @dev Multiplies two unsigned integers, reverts on 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);

        return c;
    }

    /**
     * @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        // Solidity only automatically asserts when dividing by 0
        require(b > 0);
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold

        return c;
    }

    /**
     * @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b <= a);
        uint256 c = a - b;

        return c;
    }

    /**
     * @dev Adds two unsigned integers, reverts on overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a);

        return c;
    }

    /**
     * @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
     * reverts when dividing by zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b != 0);
        return a % b;
    }
}

// File: openzeppelin-solidity/contracts/ownership/Ownable.sol

pragma solidity ^0.5.2;

/**
 * @title Ownable
 * @dev The Ownable contract has an owner address, and provides basic authorization control
 * functions, this simplifies the implementation of "user permissions".
 */
contract Ownable {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev The Ownable constructor sets the original `owner` of the contract to the sender
     * account.
     */
    constructor () internal {
        _owner = msg.sender;
        emit OwnershipTransferred(address(0), _owner);
    }

    /**
     * @return the address of the owner.
     */
    function owner() public view returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(isOwner());
        _;
    }

    /**
     * @return true if `msg.sender` is the owner of the contract.
     */
    function isOwner() public view returns (bool) {
        return msg.sender == _owner;
    }

    /**
     * @dev Allows the current owner to relinquish control of the contract.
     * It will not be possible to call the functions with the `onlyOwner`
     * modifier anymore.
     * @notice Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public onlyOwner {
        emit OwnershipTransferred(_owner, address(0));
        _owner = address(0);
    }

    /**
     * @dev Allows the current owner to transfer control of the contract to a newOwner.
     * @param newOwner The address to transfer ownership to.
     */
    function transferOwnership(address newOwner) public onlyOwner {
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers control of the contract to a newOwner.
     * @param newOwner The address to transfer ownership to.
     */
    function _transferOwnership(address newOwner) internal {
        require(newOwner != address(0));
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}

// File: contracts/lib/AddressArrayUtils.sol

// Pulled in from Cryptofin Solidity package in order to control Solidity compiler version
// https://github.com/cryptofinlabs/cryptofin-solidity/blob/master/contracts/array-utils/AddressArrayUtils.sol

pragma solidity 0.5.7;


library AddressArrayUtils {

    /**
     * Finds the index of the first occurrence of the given element.
     * @param A The input array to search
     * @param a The value to find
     * @return Returns (index and isIn) for the first occurrence starting from index 0
     */
    function indexOf(address[] memory A, address a) internal pure returns (uint256, bool) {
        uint256 length = A.length;
        for (uint256 i = 0; i < length; i++) {
            if (A[i] == a) {
                return (i, true);
            }
        }
        return (0, false);
    }

    /**
    * Returns true if the value is present in the list. Uses indexOf internally.
    * @param A The input array to search
    * @param a The value to find
    * @return Returns isIn for the first occurrence starting from index 0
    */
    function contains(address[] memory A, address a) internal pure returns (bool) {
        bool isIn;
        (, isIn) = indexOf(A, a);
        return isIn;
    }

    /// @return Returns index and isIn for the first occurrence starting from
    /// end
    function indexOfFromEnd(address[] memory A, address a) internal pure returns (uint256, bool) {
        uint256 length = A.length;
        for (uint256 i = length; i > 0; i--) {
            if (A[i - 1] == a) {
                return (i, true);
            }
        }
        return (0, false);
    }

    /**
     * Returns the combination of the two arrays
     * @param A The first array
     * @param B The second array
     * @return Returns A extended by B
     */
    function extend(address[] memory A, address[] memory B) internal pure returns (address[] memory) {
        uint256 aLength = A.length;
        uint256 bLength = B.length;
        address[] memory newAddresses = new address[](aLength + bLength);
        for (uint256 i = 0; i < aLength; i++) {
            newAddresses[i] = A[i];
        }
        for (uint256 j = 0; j < bLength; j++) {
            newAddresses[aLength + j] = B[j];
        }
        return newAddresses;
    }

    /**
     * Returns the array with a appended to A.
     * @param A The first array
     * @param a The value to append
     * @return Returns A appended by a
     */
    function append(address[] memory A, address a) internal pure returns (address[] memory) {
        address[] memory newAddresses = new address[](A.length + 1);
        for (uint256 i = 0; i < A.length; i++) {
            newAddresses[i] = A[i];
        }
        newAddresses[A.length] = a;
        return newAddresses;
    }

    /**
     * Returns the combination of two storage arrays.
     * @param A The first array
     * @param B The second array
     * @return Returns A appended by a
     */
    function sExtend(address[] storage A, address[] storage B) internal {
        uint256 length = B.length;
        for (uint256 i = 0; i < length; i++) {
            A.push(B[i]);
        }
    }

    /**
     * Returns the intersection of two arrays. Arrays are treated as collections, so duplicates are kept.
     * @param A The first array
     * @param B The second array
     * @return The intersection of the two arrays
     */
    function intersect(address[] memory A, address[] memory B) internal pure returns (address[] memory) {
        uint256 length = A.length;
        bool[] memory includeMap = new bool[](length);
        uint256 newLength = 0;
        for (uint256 i = 0; i < length; i++) {
            if (contains(B, A[i])) {
                includeMap[i] = true;
                newLength++;
            }
        }
        address[] memory newAddresses = new address[](newLength);
        uint256 j = 0;
        for (uint256 k = 0; k < length; k++) {
            if (includeMap[k]) {
                newAddresses[j] = A[k];
                j++;
            }
        }
        return newAddresses;
    }

    /**
     * Returns the union of the two arrays. Order is not guaranteed.
     * @param A The first array
     * @param B The second array
     * @return The union of the two arrays
     */
    function union(address[] memory A, address[] memory B) internal pure returns (address[] memory) {
        address[] memory leftDifference = difference(A, B);
        address[] memory rightDifference = difference(B, A);
        address[] memory intersection = intersect(A, B);
        return extend(leftDifference, extend(intersection, rightDifference));
    }

    /**
     * Alternate implementation
     * Assumes there are no duplicates
     */
    function unionB(address[] memory A, address[] memory B) internal pure returns (address[] memory) {
        bool[] memory includeMap = new bool[](A.length + B.length);
        uint256 count = 0;
        for (uint256 i = 0; i < A.length; i++) {
            includeMap[i] = true;
            count++;
        }
        for (uint256 j = 0; j < B.length; j++) {
            if (!contains(A, B[j])) {
                includeMap[A.length + j] = true;
                count++;
            }
        }
        address[] memory newAddresses = new address[](count);
        uint256 k = 0;
        for (uint256 m = 0; m < A.length; m++) {
            if (includeMap[m]) {
                newAddresses[k] = A[m];
                k++;
            }
        }
        for (uint256 n = 0; n < B.length; n++) {
            if (includeMap[A.length + n]) {
                newAddresses[k] = B[n];
                k++;
            }
        }
        return newAddresses;
    }

    /**
     * Computes the difference of two arrays. Assumes there are no duplicates.
     * @param A The first array
     * @param B The second array
     * @return The difference of the two arrays
     */
    function difference(address[] memory A, address[] memory B) internal pure returns (address[] memory) {
        uint256 length = A.length;
        bool[] memory includeMap = new bool[](length);
        uint256 count = 0;
        // First count the new length because can't push for in-memory arrays
        for (uint256 i = 0; i < length; i++) {
            address e = A[i];
            if (!contains(B, e)) {
                includeMap[i] = true;
                count++;
            }
        }
        address[] memory newAddresses = new address[](count);
        uint256 j = 0;
        for (uint256 k = 0; k < length; k++) {
            if (includeMap[k]) {
                newAddresses[j] = A[k];
                j++;
            }
        }
        return newAddresses;
    }

    /**
    * @dev Reverses storage array in place
    */
    function sReverse(address[] storage A) internal {
        address t;
        uint256 length = A.length;
        for (uint256 i = 0; i < length / 2; i++) {
            t = A[i];
            A[i] = A[A.length - i - 1];
            A[A.length - i - 1] = t;
        }
    }

    /**
    * Removes specified index from array
    * Resulting ordering is not guaranteed
    * @return Returns the new array and the removed entry
    */
    function pop(address[] memory A, uint256 index)
        internal
        pure
        returns (address[] memory, address)
    {
        uint256 length = A.length;
        address[] memory newAddresses = new address[](length - 1);
        for (uint256 i = 0; i < index; i++) {
            newAddresses[i] = A[i];
        }
        for (uint256 j = index + 1; j < length; j++) {
            newAddresses[j - 1] = A[j];
        }
        return (newAddresses, A[index]);
    }

    /**
     * @return Returns the new array
     */
    function remove(address[] memory A, address a)
        internal
        pure
        returns (address[] memory)
    {
        (uint256 index, bool isIn) = indexOf(A, a);
        if (!isIn) {
            revert();
        } else {
            (address[] memory _A,) = pop(A, index);
            return _A;
        }
    }

    function sPop(address[] storage A, uint256 index) internal returns (address) {
        uint256 length = A.length;
        if (index >= length) {
            revert("Error: index out of bounds");
        }
        address entry = A[index];
        for (uint256 i = index; i < length - 1; i++) {
            A[i] = A[i + 1];
        }
        A.length--;
        return entry;
    }

    /**
    * Deletes address at index and fills the spot with the last address.
    * Order is not preserved.
    * @return Returns the removed entry
    */
    function sPopCheap(address[] storage A, uint256 index) internal returns (address) {
        uint256 length = A.length;
        if (index >= length) {
            revert("Error: index out of bounds");
        }
        address entry = A[index];
        if (index != length - 1) {
            A[index] = A[length - 1];
            delete A[length - 1];
        }
        A.length--;
        return entry;
    }

    /**
     * Deletes address at index. Works by swapping it with the last address, then deleting.
     * Order is not preserved
     * @param A Storage array to remove from
     */
    function sRemoveCheap(address[] storage A, address a) internal {
        (uint256 index, bool isIn) = indexOf(A, a);
        if (!isIn) {
            revert("Error: entry not found");
        } else {
            sPopCheap(A, index);
            return;
        }
    }

    /**
     * Returns whether or not there's a duplicate. Runs in O(n^2).
     * @param A Array to search
     * @return Returns true if duplicate, false otherwise
     */
    function hasDuplicate(address[] memory A) internal pure returns (bool) {
        if (A.length == 0) {
            return false;
        }
        for (uint256 i = 0; i < A.length - 1; i++) {
            for (uint256 j = i + 1; j < A.length; j++) {
                if (A[i] == A[j]) {
                    return true;
                }
            }
        }
        return false;
    }

    /**
     * Returns whether the two arrays are equal.
     * @param A The first array
     * @param B The second array
     * @return True is the arrays are equal, false if not.
     */
    function isEqual(address[] memory A, address[] memory B) internal pure returns (bool) {
        if (A.length != B.length) {
            return false;
        }
        for (uint256 i = 0; i < A.length; i++) {
            if (A[i] != B[i]) {
                return false;
            }
        }
        return true;
    }

    /**
     * Returns the elements indexed at indexArray.
     * @param A The array to index
     * @param indexArray The array to use to index
     * @return Returns array containing elements indexed at indexArray
     */
    function argGet(address[] memory A, uint256[] memory indexArray)
        internal
        pure
        returns (address[] memory)
    {
        address[] memory array = new address[](indexArray.length);
        for (uint256 i = 0; i < indexArray.length; i++) {
            array[i] = A[indexArray[i]];
        }
        return array;
    }

}

// File: contracts/lib/TimeLockUpgrade.sol

/*
    Copyright 2018 Set Labs Inc.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
*/

pragma solidity 0.5.7;




/**
 * @title TimeLockUpgrade
 * @author Set Protocol
 *
 * The TimeLockUpgrade contract contains a modifier for handling minimum time period updates
 */
contract TimeLockUpgrade is
    Ownable
{
    using SafeMath for uint256;

    /* ============ State Variables ============ */

    // Timelock Upgrade Period in seconds
    uint256 public timeLockPeriod;

    // Mapping of upgradable units and initialized timelock
    mapping(bytes32 => uint256) public timeLockedUpgrades;

    /* ============ Events ============ */

    event UpgradeRegistered(
        bytes32 _upgradeHash,
        uint256 _timestamp
    );

    /* ============ Modifiers ============ */

    modifier timeLockUpgrade() {
        // If the time lock period is 0, then allow non-timebound upgrades.
        // This is useful for initialization of the protocol and for testing.
        if (timeLockPeriod == 0) {
            _;

            return;
        }

        // The upgrade hash is defined by the hash of the transaction call data,
        // which uniquely identifies the function as well as the passed in arguments.
        bytes32 upgradeHash = keccak256(
            abi.encodePacked(
                msg.data
            )
        );

        uint256 registrationTime = timeLockedUpgrades[upgradeHash];

        // If the upgrade hasn't been registered, register with the current time.
        if (registrationTime == 0) {
            timeLockedUpgrades[upgradeHash] = block.timestamp;

            emit UpgradeRegistered(
                upgradeHash,
                block.timestamp
            );

            return;
        }

        require(
            block.timestamp >= registrationTime.add(timeLockPeriod),
            "TimeLockUpgrade: Time lock period must have elapsed."
        );

        // Reset the timestamp to 0
        timeLockedUpgrades[upgradeHash] = 0;

        // Run the rest of the upgrades
        _;
    }

    /* ============ Function ============ */

    /**
     * Change timeLockPeriod period. Generally called after initially settings have been set up.
     *
     * @param  _timeLockPeriod   Time in seconds that upgrades need to be evaluated before execution
     */
    function setTimeLockPeriod(
        uint256 _timeLockPeriod
    )
        external
        onlyOwner
    {
        // Only allow setting of the timeLockPeriod if the period is greater than the existing
        require(
            _timeLockPeriod > timeLockPeriod,
            "TimeLockUpgrade: New period must be greater than existing"
        );

        timeLockPeriod = _timeLockPeriod;
    }
}

// File: contracts/lib/Authorizable.sol

/*
    Copyright 2018 Set Labs Inc.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
*/

pragma solidity 0.5.7;






/**
 * @title Authorizable
 * @author Set Protocol
 *
 * The Authorizable contract is an inherited contract that sets permissions on certain function calls
 * through the onlyAuthorized modifier. Permissions can be managed only by the Owner of the contract.
 */
contract Authorizable is
    Ownable,
    TimeLockUpgrade
{
    using SafeMath for uint256;
    using AddressArrayUtils for address[];

    /* ============ State Variables ============ */

    // Mapping of addresses to bool indicator of authorization
    mapping (address => bool) public authorized;

    // Array of authorized addresses
    address[] public authorities;

    /* ============ Modifiers ============ */

    // Only authorized addresses can invoke functions with this modifier.
    modifier onlyAuthorized {
        require(
            authorized[msg.sender],
            "Authorizable.onlyAuthorized: Sender not included in authorities"
        );
        _;
    }

    /* ============ Events ============ */

    // Event emitted when new address is authorized.
    event AddressAuthorized (
        address indexed authAddress,
        address authorizedBy
    );

    // Event emitted when address is deauthorized.
    event AuthorizedAddressRemoved (
        address indexed addressRemoved,
        address authorizedBy
    );

    /* ============ Setters ============ */

    /**
     * Add authorized address to contract. Can only be set by owner.
     *
     * @param  _authTarget   The address of the new authorized contract
     */

    function addAuthorizedAddress(address _authTarget)
        external
        onlyOwner
        timeLockUpgrade
    {
        // Require that address is not already authorized
        require(
            !authorized[_authTarget],
            "Authorizable.addAuthorizedAddress: Address already registered"
        );

        // Set address authority to true
        authorized[_authTarget] = true;

        // Add address to authorities array
        authorities.push(_authTarget);

        // Emit authorized address event
        emit AddressAuthorized(
            _authTarget,
            msg.sender
        );
    }

    /**
     * Remove authorized address from contract. Can only be set by owner.
     *
     * @param  _authTarget   The address to be de-permissioned
     */

    function removeAuthorizedAddress(address _authTarget)
        external
        onlyOwner
    {
        // Require address is authorized
        require(
            authorized[_authTarget],
            "Authorizable.removeAuthorizedAddress: Address not authorized"
        );

        // Delete address from authorized mapping
        authorized[_authTarget] = false;

        authorities = authorities.remove(_authTarget);

        // Emit AuthorizedAddressRemoved event.
        emit AuthorizedAddressRemoved(
            _authTarget,
            msg.sender
        );
    }

    /* ============ Getters ============ */

    /**
     * Get array of authorized addresses.
     *
     * @return address[]   Array of authorized addresses
     */
    function getAuthorizedAddresses()
        external
        view
        returns (address[] memory)
    {
        // Return array of authorized addresses
        return authorities;
    }
}

// File: contracts/lib/CommonMath.sol

/*
    Copyright 2018 Set Labs Inc.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
*/

pragma solidity 0.5.7;



library CommonMath {
    using SafeMath for uint256;

    /**
     * Calculates and returns the maximum value for a uint256
     *
     * @return  The maximum value for uint256
     */
    function maxUInt256()
        internal
        pure
        returns (uint256)
    {
        return 2 ** 256 - 1;
    }

    /**
    * @dev Performs the power on a specified value, reverts on overflow.
    */
    function safePower(
        uint256 a,
        uint256 pow
    )
        internal
        pure
        returns (uint256)
    {
        require(a > 0);

        uint256 result = 1;
        for (uint256 i = 0; i < pow; i++){
            uint256 previousResult = result;

            // Using safemath multiplication prevents overflows
            result = previousResult.mul(a);
        }

        return result;
    }

    /**
     * Checks for rounding errors and returns value of potential partial amounts of a principal
     *
     * @param  _principal       Number fractional amount is derived from
     * @param  _numerator       Numerator of fraction
     * @param  _denominator     Denominator of fraction
     * @return uint256          Fractional amount of principal calculated
     */
    function getPartialAmount(
        uint256 _principal,
        uint256 _numerator,
        uint256 _denominator
    )
        internal
        pure
        returns (uint256)
    {
        // Get remainder of partial amount (if 0 not a partial amount)
        uint256 remainder = mulmod(_principal, _numerator, _denominator);

        // Return if not a partial amount
        if (remainder == 0) {
            return _principal.mul(_numerator).div(_denominator);
        }

        // Calculate error percentage
        uint256 errPercentageTimes1000000 = remainder.mul(1000000).div(_numerator.mul(_principal));

        // Require error percentage is less than 0.1%.
        require(
            errPercentageTimes1000000 < 1000,
            "CommonMath.getPartialAmount: Rounding error exceeds bounds"
        );

        return _principal.mul(_numerator).div(_denominator);
    }

}

// File: contracts/lib/IERC20.sol

/*
    Copyright 2018 Set Labs Inc.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
*/

pragma solidity 0.5.7;


/**
 * @title IERC20
 * @author Set Protocol
 *
 * Interface for using ERC20 Tokens. This interface is needed to interact with tokens that are not
 * fully ERC20 compliant and return something other than true on successful transfers.
 */
interface IERC20 {
    function balanceOf(
        address _owner
    )
        external
        view
        returns (uint256);

    function allowance(
        address _owner,
        address _spender
    )
        external
        view
        returns (uint256);

    function transfer(
        address _to,
        uint256 _quantity
    )
        external;

    function transferFrom(
        address _from,
        address _to,
        uint256 _quantity
    )
        external;

    function approve(
        address _spender,
        uint256 _quantity
    )
        external
        returns (bool);
}

// File: contracts/lib/ERC20Wrapper.sol

/*
    Copyright 2018 Set Labs Inc.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
*/

pragma solidity 0.5.7;




/**
 * @title ERC20Wrapper
 * @author Set Protocol
 *
 * This library contains functions for interacting wtih ERC20 tokens, even those not fully compliant.
 * For all functions we will only accept tokens that return a null or true value, any other values will
 * cause the operation to revert.
 */
library ERC20Wrapper {

    // ============ Internal Functions ============

    /**
     * Check balance owner's balance of ERC20 token
     *
     * @param  _token          The address of the ERC20 token
     * @param  _owner          The owner who's balance is being checked
     * @return  uint256        The _owner's amount of tokens
     */
    function balanceOf(
        address _token,
        address _owner
    )
        external
        view
        returns (uint256)
    {
        return IERC20(_token).balanceOf(_owner);
    }

    /**
     * Checks spender's allowance to use token's on owner's behalf.
     *
     * @param  _token          The address of the ERC20 token
     * @param  _owner          The token owner address
     * @param  _spender        The address the allowance is being checked on
     * @return  uint256        The spender's allowance on behalf of owner
     */
    function allowance(
        address _token,
        address _owner,
        address _spender
    )
        internal
        view
        returns (uint256)
    {
        return IERC20(_token).allowance(_owner, _spender);
    }

    /**
     * Transfers tokens from an address. Handle's tokens that return true or null.
     * If other value returned, reverts.
     *
     * @param  _token          The address of the ERC20 token
     * @param  _to             The address to transfer to
     * @param  _quantity       The amount of tokens to transfer
     */
    function transfer(
        address _token,
        address _to,
        uint256 _quantity
    )
        external
    {
        IERC20(_token).transfer(_to, _quantity);

        // Check that transfer returns true or null
        require(
            checkSuccess(),
            "ERC20Wrapper.transfer: Bad return value"
        );
    }

    /**
     * Transfers tokens from an address (that has set allowance on the proxy).
     * Handle's tokens that return true or null. If other value returned, reverts.
     *
     * @param  _token          The address of the ERC20 token
     * @param  _from           The address to transfer from
     * @param  _to             The address to transfer to
     * @param  _quantity       The number of tokens to transfer
     */
    function transferFrom(
        address _token,
        address _from,
        address _to,
        uint256 _quantity
    )
        external
    {
        IERC20(_token).transferFrom(_from, _to, _quantity);

        // Check that transferFrom returns true or null
        require(
            checkSuccess(),
            "ERC20Wrapper.transferFrom: Bad return value"
        );
    }

    /**
     * Grants spender ability to spend on owner's behalf.
     * Handle's tokens that return true or null. If other value returned, reverts.
     *
     * @param  _token          The address of the ERC20 token
     * @param  _spender        The address to approve for transfer
     * @param  _quantity       The amount of tokens to approve spender for
     */
    function approve(
        address _token,
        address _spender,
        uint256 _quantity
    )
        internal
    {
        IERC20(_token).approve(_spender, _quantity);

        // Check that approve returns true or null
        require(
            checkSuccess(),
            "ERC20Wrapper.approve: Bad return value"
        );
    }

    /**
     * Ensure's the owner has granted enough allowance for system to
     * transfer tokens.
     *
     * @param  _token          The address of the ERC20 token
     * @param  _owner          The address of the token owner
     * @param  _spender        The address to grant/check allowance for
     * @param  _quantity       The amount to see if allowed for
     */
    function ensureAllowance(
        address _token,
        address _owner,
        address _spender,
        uint256 _quantity
    )
        internal
    {
        uint256 currentAllowance = allowance(_token, _owner, _spender);
        if (currentAllowance < _quantity) {
            approve(
                _token,
                _spender,
                CommonMath.maxUInt256()
            );
        }
    }

    // ============ Private Functions ============

    /**
     * Checks the return value of the previous function up to 32 bytes. Returns true if the previous
     * function returned 0 bytes or 1.
     */
    function checkSuccess(
    )
        private
        pure
        returns (bool)
    {
        // default to failure
        uint256 returnValue = 0;

        assembly {
            // check number of bytes returned from last function call
            switch returndatasize

            // no bytes returned: assume success
            case 0x0 {
                returnValue := 1
            }

            // 32 bytes returned
            case 0x20 {
                // copy 32 bytes into scratch space
                returndatacopy(0x0, 0x0, 0x20)

                // load those bytes into returnValue
                returnValue := mload(0x0)
            }

            // not sure what was returned: dont mark as success
            default { }
        }

        // check if returned value is one or nothing
        return returnValue == 1;
    }
}

// File: contracts/core/TransferProxy.sol

/*
    Copyright 2018 Set Labs Inc.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
*/

pragma solidity 0.5.7;





/**
 * @title TransferProxy
 * @author Set Protocol
 *
 * The transferProxy contract is responsible for moving tokens through the system to
 * assist with issuance and usage from modules.
 */

contract TransferProxy is
    Authorizable
{
    using SafeMath for uint256;

    /* ============ External Functions ============ */

    /**
     * Transfers tokens from an address (that has set allowance on the proxy).
     * Can only be called by Core.
     *
     * @param  _token          The address of the ERC20 token
     * @param  _quantity       The number of tokens to transfer
     * @param  _from           The address to transfer from
     * @param  _to             The address to transfer to
     */
    function transfer(
        address _token,
        uint256 _quantity,
        address _from,
        address _to
    )
        public
        onlyAuthorized
    {
        // Call specified ERC20 contract to transfer tokens (via proxy).
        if (_quantity > 0) {
            // Retrieve current balance of token for the receiver
            uint256 existingBalance = ERC20Wrapper.balanceOf(
                _token,
                _to
            );

            ERC20Wrapper.transferFrom(
                _token,
                _from,
                _to,
                _quantity
            );

            // Get new balance of transferred token for receiver
            uint256 newBalance = ERC20Wrapper.balanceOf(
                _token,
                _to
            );

            // Verify transfer quantity is reflected in balance
            require(
                newBalance == existingBalance.add(_quantity),
                "TransferProxy.transfer: Invalid post transfer balance"
            );
        }
    }

    /**
     * Transfers tokens from an address (that has set allowance on the proxy).
     * Can only be called by Core.
     *
     * @param  _tokens         The addresses of the ERC20 token
     * @param  _quantities     The numbers of tokens to transfer
     * @param  _from           The address to transfer from
     * @param  _to             The address to transfer to
     */
    function batchTransfer(
        address[] calldata _tokens,
        uint256[] calldata _quantities,
        address _from,
        address _to
    )
        external
        onlyAuthorized
    {
        // Storing token count to local variable to save on invocation
        uint256 tokenCount = _tokens.length;

        // Confirm and empty _tokens array is not passed
        require(
            tokenCount > 0,
            "TransferProxy.batchTransfer: Tokens must not be empty"
        );

        // Confirm there is one quantity for every token address
        require(
            tokenCount == _quantities.length,
            "TransferProxy.batchTransfer: Tokens and quantities lengths mismatch"
        );

        for (uint256 i = 0; i < tokenCount; i++) {
            if (_quantities[i] > 0) {
                transfer(
                    _tokens[i],
                    _quantities[i],
                    _from,
                    _to
                );
            }
        }
    }

}

Contract Security Audit

Contract ABI

[{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"timeLockedUpgrades","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_authTarget","type":"address"}],"name":"addAuthorizedAddress","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"authorities","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_authTarget","type":"address"}],"name":"removeAuthorizedAddress","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_tokens","type":"address[]"},{"name":"_quantities","type":"uint256[]"},{"name":"_from","type":"address"},{"name":"_to","type":"address"}],"name":"batchTransfer","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"renounceOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"timeLockPeriod","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isOwner","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_timeLockPeriod","type":"uint256"}],"name":"setTimeLockPeriod","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_token","type":"address"},{"name":"_quantity","type":"uint256"},{"name":"_from","type":"address"},{"name":"_to","type":"address"}],"name":"transfer","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"authorized","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getAuthorizedAddresses","outputs":[{"name":"","type":"address[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"anonymous":false,"inputs":[{"indexed":true,"name":"authAddress","type":"address"},{"indexed":false,"name":"authorizedBy","type":"address"}],"name":"AddressAuthorized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"addressRemoved","type":"address"},{"indexed":false,"name":"authorizedBy","type":"address"}],"name":"AuthorizedAddressRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_upgradeHash","type":"bytes32"},{"indexed":false,"name":"_timestamp","type":"uint256"}],"name":"UpgradeRegistered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"}]

6080604081905260008054600160a060020a0319163317808255600160a060020a0316917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a36112ac806100576000396000f3fe608060405234801561001057600080fd5b5060043610610107576000357c0100000000000000000000000000000000000000000000000000000000900480638da5cb5b116100a9578063a6c4e46711610083578063a6c4e467146102e6578063b918161114610322578063d39de6e914610348578063f2fde38b146103a057610107565b80638da5cb5b146102a55780638f32d59b146102ad5780639303b16f146102c957610107565b806370712939116100e5578063707129391461019c578063709a385e146101c2578063715018a61461029557806378446bc11461029d57610107565b80631766486d1461010c57806342f1181e1461013b578063494503d414610163575b600080fd5b6101296004803603602081101561012257600080fd5b50356103c6565b60408051918252519081900360200190f35b6101616004803603602081101561015157600080fd5b5035600160a060020a03166103d8565b005b6101806004803603602081101561017957600080fd5b5035610702565b60408051600160a060020a039092168252519081900360200190f35b610161600480360360208110156101b257600080fd5b5035600160a060020a0316610729565b610161600480360360808110156101d857600080fd5b8101906020810181356401000000008111156101f357600080fd5b82018360208201111561020557600080fd5b8035906020019184602083028401116401000000008311171561022757600080fd5b91939092909160208101903564010000000081111561024557600080fd5b82018360208201111561025757600080fd5b8035906020019184602083028401116401000000008311171561027957600080fd5b9193509150600160a060020a0381358116916020013516610878565b6101616109bb565b610129610a23565b610180610a29565b6102b5610a39565b604080519115158252519081900360200190f35b610161600480360360208110156102df57600080fd5b5035610a4a565b610161600480360360808110156102fc57600080fd5b50600160a060020a03813581169160208101359160408201358116916060013516610aa3565b6102b56004803603602081101561033857600080fd5b5035600160a060020a0316610d51565b610350610d66565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561038c578181015183820152602001610374565b505050509050019250505060405180910390f35b610161600480360360208110156103b657600080fd5b5035600160a060020a0316610dc8565b60026020526000908152604090205481565b6103e0610a39565b6103e957600080fd5b6001546104f757600160a060020a03811660009081526003602052604090205460ff161561044b5760405160e560020a62461bcd02815260040180806020018281038252603d81526020018061115c603d913960400191505060405180910390fd5b600160a060020a0381166000818152600360209081526040808320805460ff191660019081179091556004805491820181559093527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b909201805473ffffffffffffffffffffffffffffffffffffffff191684179055815133815291517f8918da6429714f0e9c40ae7f270773e27fc8caf7a256e19807f859563b7514de9281900390910190a26106ff565b60008036604051602001808383808284376040805191909301818103601f190182528352805160209182012060008181526002909252929020549195509093505050811515905061059657600082815260026020908152604091829020429081905582518581529182015281517f0e0905d1a972d476e353bdcc3e06b19a71709054c8ba01eccb7e0691eca6d374929181900390910190a150506106ff565b6001546105aa90829063ffffffff610de216565b4210156105eb5760405160e560020a62461bcd0281526004018080602001828103825260348152602001806112146034913960400191505060405180910390fd5b6000828152600260209081526040808320839055600160a060020a0386168352600390915290205460ff16156106555760405160e560020a62461bcd02815260040180806020018281038252603d81526020018061115c603d913960400191505060405180910390fd5b600160a060020a0383166000818152600360209081526040808320805460ff191660019081179091556004805491820181559093527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b909201805473ffffffffffffffffffffffffffffffffffffffff191684179055815133815291517f8918da6429714f0e9c40ae7f270773e27fc8caf7a256e19807f859563b7514de9281900390910190a250505b50565b6004818154811061070f57fe5b600091825260209091200154600160a060020a0316905081565b610731610a39565b61073a57600080fd5b600160a060020a03811660009081526003602052604090205460ff166107945760405160e560020a62461bcd02815260040180806020018281038252603c8152602001806111d8603c913960400191505060405180910390fd5b600160a060020a038116600090815260036020908152604091829020805460ff19169055600480548351818402810184019094528084526108219385939092919083018282801561080e57602002820191906000526020600020905b8154600160a060020a031681526001909101906020018083116107f0575b5050505050610dfd90919063ffffffff16565b80516108359160049160209091019061100b565b50604080513381529051600160a060020a038316917f1f32c1b084e2de0713b8fb16bd46bb9df710a3dbeae2f3ca93af46e016dcc6b0919081900360200190a250565b3360009081526003602052604090205460ff166108c95760405160e560020a62461bcd02815260040180806020018281038252603f815260200180611199603f913960400191505060405180910390fd5b84806109095760405160e560020a62461bcd0281526004018080602001828103825260358152602001806111276035913960400191505060405180910390fd5b80841461094a5760405160e560020a62461bcd0281526004018080602001828103825260438152602001806110e46043913960600191505060405180910390fd5b60005b818110156109b157600086868381811061096357fe5b9050602002013511156109a9576109a988888381811061097f57fe5b90506020020135600160a060020a031687878481811061099b57fe5b905060200201358686610aa3565b60010161094d565b5050505050505050565b6109c3610a39565b6109cc57600080fd5b60008054604051600160a060020a03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a36000805473ffffffffffffffffffffffffffffffffffffffff19169055565b60015481565b600054600160a060020a03165b90565b600054600160a060020a0316331490565b610a52610a39565b610a5b57600080fd5b6001548111610a9e5760405160e560020a62461bcd0281526004018080602001828103825260398152602001806112486039913960400191505060405180910390fd5b600155565b3360009081526003602052604090205460ff16610af45760405160e560020a62461bcd02815260040180806020018281038252603f815260200180611199603f913960400191505060405180910390fd5b8215610d4b57604080517ff7888aec000000000000000000000000000000000000000000000000000000008152600160a060020a03808716600483015283166024820152905160009173eadada7c6943c223c0d4bea475a6dacc7368f8d69163f7888aec91604480820192602092909190829003018186803b158015610b7957600080fd5b505af4158015610b8d573d6000803e3d6000fd5b505050506040513d6020811015610ba357600080fd5b5051604080517f15dacbea000000000000000000000000000000000000000000000000000000008152600160a060020a03808916600483015280871660248301528516604482015260648101879052905191925073eadada7c6943c223c0d4bea475a6dacc7368f8d6916315dacbea91608480820192600092909190829003018186803b158015610c3357600080fd5b505af4158015610c47573d6000803e3d6000fd5b5050604080517ff7888aec000000000000000000000000000000000000000000000000000000008152600160a060020a03808a1660048301528616602482015290516000935073eadada7c6943c223c0d4bea475a6dacc7368f8d6925063f7888aec91604480820192602092909190829003018186803b158015610cca57600080fd5b505af4158015610cde573d6000803e3d6000fd5b505050506040513d6020811015610cf457600080fd5b50519050610d08828663ffffffff610de216565b8114610d485760405160e560020a62461bcd0281526004018080602001828103825260358152602001806110af6035913960400191505060405180910390fd5b50505b50505050565b60036020526000908152604090205460ff1681565b60606004805480602002602001604051908101604052809291908181526020018280548015610dbe57602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610da0575b5050505050905090565b610dd0610a39565b610dd957600080fd5b6106ff81610e32565b600082820183811015610df457600080fd5b90505b92915050565b6060600080610e0c8585610ead565b9150915080610e1a57600080fd5b6060610e268684610f11565b509350610df792505050565b600160a060020a038116610e4557600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b81516000908190815b81811015610f005784600160a060020a0316868281518110610ed457fe5b6020026020010151600160a060020a03161415610ef857925060019150610f0a9050565b600101610eb6565b5060009250829150505b9250929050565b606060008084519050606060018203604051908082528060200260200182016040528015610f49578160200160208202803883390190505b50905060005b85811015610f9757868181518110610f6357fe5b6020026020010151828281518110610f7757fe5b600160a060020a0390921660209283029190910190910152600101610f4f565b50600185015b82811015610fe857868181518110610fb157fe5b6020026020010151826001830381518110610fc857fe5b600160a060020a0390921660209283029190910190910152600101610f9d565b5080868681518110610ff657fe5b60200260200101519350935050509250929050565b82805482825590600052602060002090810192821561106d579160200282015b8281111561106d578251825473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0390911617825560209092019160019091019061102b565b5061107992915061107d565b5090565b610a3691905b8082111561107957805473ffffffffffffffffffffffffffffffffffffffff1916815560010161108356fe5472616e7366657250726f78792e7472616e736665723a20496e76616c696420706f7374207472616e736665722062616c616e63655472616e7366657250726f78792e62617463685472616e736665723a20546f6b656e7320616e64207175616e746974696573206c656e67746873206d69736d617463685472616e7366657250726f78792e62617463685472616e736665723a20546f6b656e73206d757374206e6f7420626520656d707479417574686f72697a61626c652e616464417574686f72697a6564416464726573733a204164647265737320616c72656164792072656769737465726564417574686f72697a61626c652e6f6e6c79417574686f72697a65643a2053656e646572206e6f7420696e636c7564656420696e20617574686f726974696573417574686f72697a61626c652e72656d6f7665417574686f72697a6564416464726573733a2041646472657373206e6f7420617574686f72697a656454696d654c6f636b557067726164653a2054696d65206c6f636b20706572696f64206d757374206861766520656c61707365642e54696d654c6f636b557067726164653a204e657720706572696f64206d7573742062652067726561746572207468616e206578697374696e67a165627a7a723058206389644523db4f6d00b2f004ff35abed0729de15379f07903b12b7e7bccf485a0029

Deployed Bytecode

0x608060405234801561001057600080fd5b5060043610610107576000357c0100000000000000000000000000000000000000000000000000000000900480638da5cb5b116100a9578063a6c4e46711610083578063a6c4e467146102e6578063b918161114610322578063d39de6e914610348578063f2fde38b146103a057610107565b80638da5cb5b146102a55780638f32d59b146102ad5780639303b16f146102c957610107565b806370712939116100e5578063707129391461019c578063709a385e146101c2578063715018a61461029557806378446bc11461029d57610107565b80631766486d1461010c57806342f1181e1461013b578063494503d414610163575b600080fd5b6101296004803603602081101561012257600080fd5b50356103c6565b60408051918252519081900360200190f35b6101616004803603602081101561015157600080fd5b5035600160a060020a03166103d8565b005b6101806004803603602081101561017957600080fd5b5035610702565b60408051600160a060020a039092168252519081900360200190f35b610161600480360360208110156101b257600080fd5b5035600160a060020a0316610729565b610161600480360360808110156101d857600080fd5b8101906020810181356401000000008111156101f357600080fd5b82018360208201111561020557600080fd5b8035906020019184602083028401116401000000008311171561022757600080fd5b91939092909160208101903564010000000081111561024557600080fd5b82018360208201111561025757600080fd5b8035906020019184602083028401116401000000008311171561027957600080fd5b9193509150600160a060020a0381358116916020013516610878565b6101616109bb565b610129610a23565b610180610a29565b6102b5610a39565b604080519115158252519081900360200190f35b610161600480360360208110156102df57600080fd5b5035610a4a565b610161600480360360808110156102fc57600080fd5b50600160a060020a03813581169160208101359160408201358116916060013516610aa3565b6102b56004803603602081101561033857600080fd5b5035600160a060020a0316610d51565b610350610d66565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561038c578181015183820152602001610374565b505050509050019250505060405180910390f35b610161600480360360208110156103b657600080fd5b5035600160a060020a0316610dc8565b60026020526000908152604090205481565b6103e0610a39565b6103e957600080fd5b6001546104f757600160a060020a03811660009081526003602052604090205460ff161561044b5760405160e560020a62461bcd02815260040180806020018281038252603d81526020018061115c603d913960400191505060405180910390fd5b600160a060020a0381166000818152600360209081526040808320805460ff191660019081179091556004805491820181559093527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b909201805473ffffffffffffffffffffffffffffffffffffffff191684179055815133815291517f8918da6429714f0e9c40ae7f270773e27fc8caf7a256e19807f859563b7514de9281900390910190a26106ff565b60008036604051602001808383808284376040805191909301818103601f190182528352805160209182012060008181526002909252929020549195509093505050811515905061059657600082815260026020908152604091829020429081905582518581529182015281517f0e0905d1a972d476e353bdcc3e06b19a71709054c8ba01eccb7e0691eca6d374929181900390910190a150506106ff565b6001546105aa90829063ffffffff610de216565b4210156105eb5760405160e560020a62461bcd0281526004018080602001828103825260348152602001806112146034913960400191505060405180910390fd5b6000828152600260209081526040808320839055600160a060020a0386168352600390915290205460ff16156106555760405160e560020a62461bcd02815260040180806020018281038252603d81526020018061115c603d913960400191505060405180910390fd5b600160a060020a0383166000818152600360209081526040808320805460ff191660019081179091556004805491820181559093527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b909201805473ffffffffffffffffffffffffffffffffffffffff191684179055815133815291517f8918da6429714f0e9c40ae7f270773e27fc8caf7a256e19807f859563b7514de9281900390910190a250505b50565b6004818154811061070f57fe5b600091825260209091200154600160a060020a0316905081565b610731610a39565b61073a57600080fd5b600160a060020a03811660009081526003602052604090205460ff166107945760405160e560020a62461bcd02815260040180806020018281038252603c8152602001806111d8603c913960400191505060405180910390fd5b600160a060020a038116600090815260036020908152604091829020805460ff19169055600480548351818402810184019094528084526108219385939092919083018282801561080e57602002820191906000526020600020905b8154600160a060020a031681526001909101906020018083116107f0575b5050505050610dfd90919063ffffffff16565b80516108359160049160209091019061100b565b50604080513381529051600160a060020a038316917f1f32c1b084e2de0713b8fb16bd46bb9df710a3dbeae2f3ca93af46e016dcc6b0919081900360200190a250565b3360009081526003602052604090205460ff166108c95760405160e560020a62461bcd02815260040180806020018281038252603f815260200180611199603f913960400191505060405180910390fd5b84806109095760405160e560020a62461bcd0281526004018080602001828103825260358152602001806111276035913960400191505060405180910390fd5b80841461094a5760405160e560020a62461bcd0281526004018080602001828103825260438152602001806110e46043913960600191505060405180910390fd5b60005b818110156109b157600086868381811061096357fe5b9050602002013511156109a9576109a988888381811061097f57fe5b90506020020135600160a060020a031687878481811061099b57fe5b905060200201358686610aa3565b60010161094d565b5050505050505050565b6109c3610a39565b6109cc57600080fd5b60008054604051600160a060020a03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a36000805473ffffffffffffffffffffffffffffffffffffffff19169055565b60015481565b600054600160a060020a03165b90565b600054600160a060020a0316331490565b610a52610a39565b610a5b57600080fd5b6001548111610a9e5760405160e560020a62461bcd0281526004018080602001828103825260398152602001806112486039913960400191505060405180910390fd5b600155565b3360009081526003602052604090205460ff16610af45760405160e560020a62461bcd02815260040180806020018281038252603f815260200180611199603f913960400191505060405180910390fd5b8215610d4b57604080517ff7888aec000000000000000000000000000000000000000000000000000000008152600160a060020a03808716600483015283166024820152905160009173eadada7c6943c223c0d4bea475a6dacc7368f8d69163f7888aec91604480820192602092909190829003018186803b158015610b7957600080fd5b505af4158015610b8d573d6000803e3d6000fd5b505050506040513d6020811015610ba357600080fd5b5051604080517f15dacbea000000000000000000000000000000000000000000000000000000008152600160a060020a03808916600483015280871660248301528516604482015260648101879052905191925073eadada7c6943c223c0d4bea475a6dacc7368f8d6916315dacbea91608480820192600092909190829003018186803b158015610c3357600080fd5b505af4158015610c47573d6000803e3d6000fd5b5050604080517ff7888aec000000000000000000000000000000000000000000000000000000008152600160a060020a03808a1660048301528616602482015290516000935073eadada7c6943c223c0d4bea475a6dacc7368f8d6925063f7888aec91604480820192602092909190829003018186803b158015610cca57600080fd5b505af4158015610cde573d6000803e3d6000fd5b505050506040513d6020811015610cf457600080fd5b50519050610d08828663ffffffff610de216565b8114610d485760405160e560020a62461bcd0281526004018080602001828103825260358152602001806110af6035913960400191505060405180910390fd5b50505b50505050565b60036020526000908152604090205460ff1681565b60606004805480602002602001604051908101604052809291908181526020018280548015610dbe57602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610da0575b5050505050905090565b610dd0610a39565b610dd957600080fd5b6106ff81610e32565b600082820183811015610df457600080fd5b90505b92915050565b6060600080610e0c8585610ead565b9150915080610e1a57600080fd5b6060610e268684610f11565b509350610df792505050565b600160a060020a038116610e4557600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b81516000908190815b81811015610f005784600160a060020a0316868281518110610ed457fe5b6020026020010151600160a060020a03161415610ef857925060019150610f0a9050565b600101610eb6565b5060009250829150505b9250929050565b606060008084519050606060018203604051908082528060200260200182016040528015610f49578160200160208202803883390190505b50905060005b85811015610f9757868181518110610f6357fe5b6020026020010151828281518110610f7757fe5b600160a060020a0390921660209283029190910190910152600101610f4f565b50600185015b82811015610fe857868181518110610fb157fe5b6020026020010151826001830381518110610fc857fe5b600160a060020a0390921660209283029190910190910152600101610f9d565b5080868681518110610ff657fe5b60200260200101519350935050509250929050565b82805482825590600052602060002090810192821561106d579160200282015b8281111561106d578251825473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0390911617825560209092019160019091019061102b565b5061107992915061107d565b5090565b610a3691905b8082111561107957805473ffffffffffffffffffffffffffffffffffffffff1916815560010161108356fe5472616e7366657250726f78792e7472616e736665723a20496e76616c696420706f7374207472616e736665722062616c616e63655472616e7366657250726f78792e62617463685472616e736665723a20546f6b656e7320616e64207175616e746974696573206c656e67746873206d69736d617463685472616e7366657250726f78792e62617463685472616e736665723a20546f6b656e73206d757374206e6f7420626520656d707479417574686f72697a61626c652e616464417574686f72697a6564416464726573733a204164647265737320616c72656164792072656769737465726564417574686f72697a61626c652e6f6e6c79417574686f72697a65643a2053656e646572206e6f7420696e636c7564656420696e20617574686f726974696573417574686f72697a61626c652e72656d6f7665417574686f72697a6564416464726573733a2041646472657373206e6f7420617574686f72697a656454696d654c6f636b557067726164653a2054696d65206c6f636b20706572696f64206d757374206861766520656c61707365642e54696d654c6f636b557067726164653a204e657720706572696f64206d7573742062652067726561746572207468616e206578697374696e67a165627a7a723058206389644523db4f6d00b2f004ff35abed0729de15379f07903b12b7e7bccf485a0029

Libraries Used


Deployed Bytecode Sourcemap

34919:3042:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;34919:3042:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;16913:53;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;16913:53:0;;:::i;:::-;;;;;;;;;;;;;;;;21435:642;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;21435:642:0;-1:-1:-1;;;;;21435:642:0;;:::i;:::-;;20478:28;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;20478:28:0;;:::i;:::-;;;;-1:-1:-1;;;;;20478:28:0;;;;;;;;;;;;;;22252:596;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;22252:596:0;-1:-1:-1;;;;;22252:596:0;;:::i;36924:1032::-;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;36924:1032:0;;;;;;;;21:11:-1;5:28;;2:2;;;46:1;43;36:12;2:2;36924:1032:0;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;36924:1032:0;;;;;;101:9:-1;95:2;81:12;77:21;67:8;63:36;60:51;39:11;25:12;22:29;11:108;8:2;;;132:1;129;122:12;8:2;36924:1032:0;;;;;;;;;;;21:11:-1;5:28;;2:2;;;46:1;43;36:12;2:2;36924:1032:0;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;36924:1032:0;;;;;;101:9:-1;95:2;81:12;77:21;67:8;63:36;60:51;39:11;25:12;22:29;11:108;8:2;;;132:1;129;122:12;8:2;36924:1032:0;;-1:-1:-1;36924:1032:0;-1:-1:-1;;;;;;36924:1032:0;;;;;;;;;;:::i;3531:140::-;;;:::i;16814:29::-;;;:::i;2741:79::-;;;:::i;3076:92::-;;;:::i;:::-;;;;;;;;;;;;;;;;;;18745:409;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;18745:409:0;;:::i;35454:1069::-;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;-1:-1;;;;;;35454:1069:0;;;;;;;;;;;;;;;;;;;;;;:::i;20388:43::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;20388:43:0;-1:-1:-1;;;;;20388:43:0;;:::i;23030:193::-;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:100:-1;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;23030:193:0;;;;;;;;;;;;;;;;;3848:109;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3848:109:0;-1:-1:-1;;;;;3848:109:0;;:::i;16913:53::-;;;;;;;;;;;;;:::o;21435:642::-;2953:9;:7;:9::i;:::-;2945:18;;;;;;17367:14;;17363:76;;-1:-1:-1;;;;;21646:23:0;;;;;;:10;:23;;;;;;;;21645:24;21623:135;;;;-1:-1:-1;;;;;21623:135:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;21813:23:0;;;;;;:10;:23;;;;;;;;:30;;-1:-1:-1;;21813:30:0;21839:4;21813:30;;;;;;21901:11;27:10:-1;;23:18;;;45:23;;21901:29:0;;;;;;;;;-1:-1:-1;;21901:29:0;;;;;21990:79;;22048:10;21990:79;;;;;;;;;;;;;;17421:7;;17363:76;17620:19;17701:8;;17666:58;;;;;;;30:3:-1;22:6;14;1:33;17666:58:0;;;45:16:-1;;;;26:21;;;-1:-1;;22:32;6:49;;17666:58:0;;17642:93;;49:4:-1;17642:93:0;;;;17748:24;17775:31;;;:18;:31;;;;;;;17642:93;;-1:-1:-1;17775:31:0;;-1:-1:-1;;;17906:21:0;;17902:244;;-1:-1:-1;17902:244:0;;17944:31;;;;:18;:31;;;;;;;;;17978:15;17944:49;;;;18015:96;;;;;;;;;;;;;;;;;;;;;;18128:7;;;;17902:244;18220:14;;18199:36;;:16;;:36;:20;:36;:::i;:::-;18180:15;:55;;18158:157;;;;-1:-1:-1;;;;;18158:157:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;18399:1;18365:31;;;:18;:31;;;;;;;;:35;;;-1:-1:-1;;;;;21646:23:0;;;;:10;:23;;;;;;;;21645:24;21623:135;;;;-1:-1:-1;;;;;21623:135:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;21813:23:0;;;;;;:10;:23;;;;;;;;:30;;-1:-1:-1;;21813:30:0;21839:4;21813:30;;;;;;21901:11;27:10:-1;;23:18;;;45:23;;21901:29:0;;;;;;;;;-1:-1:-1;;21901:29:0;;;;;21990:79;;22048:10;21990:79;;;;;;;;;;;;;;2974:1;;;21435:642;:::o;20478:28::-;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;20478:28:0;;-1:-1:-1;20478:28:0;:::o;22252:596::-;2953:9;:7;:9::i;:::-;2945:18;;;;;;-1:-1:-1;;;;;22423:23:0;;;;;;:10;:23;;;;;;;;22401:133;;;;-1:-1:-1;;;;;22401:133:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;22598:23:0;;22624:5;22598:23;;;:10;:23;;;;;;;;;:31;;-1:-1:-1;;22598:31:0;;;22656:11;:18;;;;;;;;;;;;;;;;;:31;;22609:11;;22656:18;;:11;:18;;;:11;:18;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;22656:18:0;;;;;;;;;;;;;;;;;;;;;;;:31;;;;:::i;:::-;22642:45;;;;:11;;:45;;;;;;:::i;:::-;-1:-1:-1;22754:86:0;;;22819:10;22754:86;;;;-1:-1:-1;;;;;22754:86:0;;;;;;;;;;;;;22252:596;:::o;36924:1032::-;20707:10;20696:22;;;;:10;:22;;;;;;;;20674:135;;;;-1:-1:-1;;;;;20674:135:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;37229:7;37336:14;37314:117;;;;-1:-1:-1;;;;;37314:117:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;37532:32;;;37510:149;;;;-1:-1:-1;;;;;37510:149:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;37677:9;37672:277;37696:10;37692:1;:14;37672:277;;;37749:1;37732:11;;37744:1;37732:14;;;;;;;;;;;;;:18;37728:210;;;37771:151;37802:7;;37810:1;37802:10;;;;;;;;;;;;;-1:-1:-1;;;;;37802:10:0;37835:11;;37847:1;37835:14;;;;;;;;;;;;;37872:5;37900:3;37771:8;:151::i;:::-;37708:3;;37672:277;;;;20820:1;36924:1032;;;;;;:::o;3531:140::-;2953:9;:7;:9::i;:::-;2945:18;;;;;;3630:1;3614:6;;3593:40;;-1:-1:-1;;;;;3614:6:0;;;;3593:40;;3630:1;;3593:40;3661:1;3644:19;;-1:-1:-1;;3644:19:0;;;3531:140::o;16814:29::-;;;;:::o;2741:79::-;2779:7;2806:6;-1:-1:-1;;;;;2806:6:0;2741:79;;:::o;3076:92::-;3116:4;3154:6;-1:-1:-1;;;;;3154:6:0;3140:10;:20;;3076:92::o;18745:409::-;2953:9;:7;:9::i;:::-;2945:18;;;;;;19002:14;;18984:15;:32;18962:139;;;;-1:-1:-1;;;;;18962:139:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;19114:14;:32;18745:409::o;35454:1069::-;20707:10;20696:22;;;;:10;:22;;;;;;;;20674:135;;;;-1:-1:-1;;;;;20674:135:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;35712:13;;35708:808;;35835:84;;;;;;-1:-1:-1;;;;;35835:84:0;;;;;;;;;;;;;;;35809:23;;35835:12;;:22;;:84;;;;;;;;;;;;;;;:12;:84;;;5:2:-1;;;;30:1;27;20:12;5:2;35835:84:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;35835:84:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;35835:84:0;35936:139;;;;;;-1:-1:-1;;;;;35936:139:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;35835:84;;-1:-1:-1;35936:12:0;;:25;;:139;;;;;-1:-1:-1;;35936:139:0;;;;;;;;:12;:139;;;5:2:-1;;;;30:1;27;20:12;5:2;35936:139:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;-1:-1;;36179:84:0;;;;;;-1:-1:-1;;;;;36179:84:0;;;;;;;;;;;;;;;36158:18;;-1:-1:-1;36179:12:0;;-1:-1:-1;36179:22:0;;:84;;;;;;;;;;;;;;;:12;:84;;;5:2:-1;;;;30:1;27;20:12;5:2;36179:84:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;36179:84:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;36179:84:0;;-1:-1:-1;36385:30:0;:15;36405:9;36385:30;:19;:30;:::i;:::-;36371:10;:44;36345:159;;;;-1:-1:-1;;;;;36345:159:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;35708:808;;;35454:1069;;;;:::o;20388:43::-;;;;;;;;;;;;;;;:::o;23030:193::-;23114:16;23204:11;23197:18;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;23197:18:0;;;;;;;;;;;;;;;;;;;;;;;23030:193;:::o;3848:109::-;2953:9;:7;:9::i;:::-;2945:18;;;;;;3921:28;3940:8;3921:18;:28::i;1550:150::-;1608:7;1640:5;;;1664:6;;;;1656:15;;;;;;1691:1;-1:-1:-1;1550:150:0;;;;;:::o;12272:332::-;12369:16;12404:13;12419:9;12432:13;12440:1;12443;12432:7;:13::i;:::-;12403:42;;;;12461:4;12456:141;;12482:8;;;12456:141;12524:19;12548:13;12552:1;12555:5;12548:3;:13::i;:::-;-1:-1:-1;12523:38:0;-1:-1:-1;12576:9:0;;-1:-1:-1;;;12576:9:0;4107:187;-1:-1:-1;;;;;4181:22:0;;4173:31;;;;;;4241:6;;;4220:38;;-1:-1:-1;;;;;4220:38:0;;;;4241:6;;;4220:38;;;4269:6;:17;;-1:-1:-1;;4269:17:0;-1:-1:-1;;;;;4269:17:0;;;;;;;;;;4107:187::o;4872:297::-;4986:8;;4943:7;;;;;5005:129;5029:6;5025:1;:10;5005:129;;;5069:1;-1:-1:-1;;;;;5061:9:0;:1;5063;5061:4;;;;;;;;;;;;;;-1:-1:-1;;;;;5061:9:0;;5057:66;;;5099:1;-1:-1:-1;5102:4:0;;-1:-1:-1;5091:16:0;;-1:-1:-1;5091:16:0;5057:66;5037:3;;5005:129;;;-1:-1:-1;5152:1:0;;-1:-1:-1;5152:1:0;;-1:-1:-1;;4872:297:0;;;;;;:::o;11721:487::-;11819:16;11837:7;11862:14;11879:1;:8;11862:25;;11898:29;11953:1;11944:6;:10;11930:25;;;;;;;;;;;;;;;;;;;;;;29:2:-1;21:6;17:15;117:4;105:10;97:6;88:34;136:17;;-1:-1;11930:25:0;-1:-1:-1;11898:57:0;-1:-1:-1;11971:9:0;11966:85;11990:5;11986:1;:9;11966:85;;;12035:1;12037;12035:4;;;;;;;;;;;;;;12017:12;12030:1;12017:15;;;;;;;;-1:-1:-1;;;;;12017:22:0;;;:15;;;;;;;;;;;:22;11997:3;;11966:85;;;-1:-1:-1;12086:1:0;12078:9;;12061:98;12093:6;12089:1;:10;12061:98;;;12143:1;12145;12143:4;;;;;;;;;;;;;;12121:12;12138:1;12134;:5;12121:19;;;;;;;;-1:-1:-1;;;;;12121:26:0;;;:19;;;;;;;;;;;:26;12101:3;;12061:98;;;;12177:12;12191:1;12193:5;12191:8;;;;;;;;;;;;;;12169:31;;;;;;11721:487;;;;;:::o;34919:3042::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;34919:3042:0;-1:-1:-1;;;;;34919:3042:0;;;;;;;;;;;-1:-1:-1;34919:3042:0;;;;;;;-1:-1:-1;34919:3042:0;;;-1:-1:-1;34919:3042:0;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;-1:-1:-1;;34919:3042:0;;;;;;

Swarm Source

bzzr://6389644523db4f6d00b2f004ff35abed0729de15379f07903b12b7e7bccf485a

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.