ETH Price: $3,632.90 (+4.18%)
Gas: 77 Gwei

Contract

0x1906F7408e2C2643Ea99Aa3DCD37234Adf675f74
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
0x60806040129293032021-07-30 21:17:04948 days ago1627679824IN
 Create: GIMExtension
0 ETH0.0730178239

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
GIMExtension

Compiler Version
v0.6.10+commit.00c0fcaf

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 8 : GIMExtension.sol
/*
    Copyright 2021 IndexCooperative

    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.6.10;
pragma experimental "ABIEncoderV2";

import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { SafeMath } from "@openzeppelin/contracts/math/SafeMath.sol";

import { AddressArrayUtils } from "../lib/AddressArrayUtils.sol";
import { BaseAdapter } from "../lib/BaseAdapter.sol";
import { IBaseManager } from "../interfaces/IBaseManager.sol";
import { IGeneralIndexModule } from "../interfaces/IGeneralIndexModule.sol";
import { ISetToken } from "../interfaces/ISetToken.sol";

/**
 * @title GIMExtension
 * @author Set Protocol
 *
 * Smart contract manager extension that acts as a pass-through contract for interacting with GeneralIndexModule.
 * All functions are only callable by operator. startRebalance() on GIM maps to startRebalanceWithUnits on
 * GIMExtension. 
 */
contract GIMExtension is BaseAdapter {

    using AddressArrayUtils for address[];
    using SafeMath for uint256;

    /* ============ State Variables ============ */
    
    ISetToken public setToken;
    IGeneralIndexModule public generalIndexModule;  // GIM

    /* ============ Constructor ============ */

    constructor(IBaseManager _manager, IGeneralIndexModule _generalIndexModule) public BaseAdapter(_manager) {
        generalIndexModule = _generalIndexModule;
        setToken = manager.setToken();
    }

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

    /**
     * ONLY OPERATOR: Submits a startRebalance call to GeneralIndexModule. Uses internal function so that this contract can be inherited and
     * custom startRebalance logic can be added on top. Components array is sorted in new and old components arrays in order to conform to
     * startRebalance interface. See GIM for function specific restrictions.
     * @param _components               Array of components involved in rebalance inclusive of components being removed from set (targetUnit = 0)
     * @param _targetUnits              Array of target units at end of rebalance, maps to same index of _components array
     * @param _positionMultiplier       Position multiplier when target units were calculated, needed in order to adjust target units if fees accrued
     */
    function startRebalanceWithUnits(
        address[] calldata _components,
        uint256[] calldata _targetUnits,
        uint256 _positionMultiplier
    )
        external
        onlyOperator
    {
        (
            address[] memory newComponents,
            uint256[] memory newComponentsTargetUnits,
            uint256[] memory oldComponentsTargetUnits
        ) = _sortNewAndOldComponents(_components, _targetUnits);
        _startRebalance(newComponents, newComponentsTargetUnits, oldComponentsTargetUnits, _positionMultiplier);
    }

    /**
     * ONLY OPERATOR: Submits a setTradeMaximums call to GeneralIndexModule. See GIM for function specific restrictions.
     *
     * @param _components           Array of components
     * @param _tradeMaximums        Array of trade maximums mapping to correct component
     */
    function setTradeMaximums(
        address[] memory _components,
        uint256[] memory _tradeMaximums
    )
        external
        onlyOperator
    {
        bytes memory callData = abi.encodeWithSelector(
            IGeneralIndexModule.setTradeMaximums.selector,
            setToken,
            _components,
            _tradeMaximums
        );

        invokeManager(address(generalIndexModule), callData);   
    }

    /**
     * ONLY OPERATOR: Submits a setExchanges call to GeneralIndexModule. See GIM for function specific restrictions.
     *
     * @param _components           Array of components
     * @param _exchangeNames        Array of exchange names mapping to correct component
     */
    function setExchanges(
        address[] memory _components,
        string[] memory _exchangeNames
    )
        external
        onlyOperator
    {
        bytes memory callData = abi.encodeWithSelector(
            IGeneralIndexModule.setExchanges.selector,
            setToken,
            _components,
            _exchangeNames
        );

        invokeManager(address(generalIndexModule), callData);  
    }

    /**
     * ONLY OPERATOR: Submits a setCoolOffPeriods call to GeneralIndexModule. See GIM for function specific restrictions.
     *
     * @param _components           Array of components
     * @param _coolOffPeriods       Array of cool off periods to correct component
     */
    function setCoolOffPeriods(
        address[] memory _components,
        uint256[] memory _coolOffPeriods
    )
        external
        onlyOperator
    {
        bytes memory callData = abi.encodeWithSelector(
            IGeneralIndexModule.setCoolOffPeriods.selector,
            setToken,
            _components,
            _coolOffPeriods
        );

        invokeManager(address(generalIndexModule), callData);  
    }

    /**
     * ONLY OPERATOR: Submits a setExchangeData call to GeneralIndexModule. See GIM for function specific restrictions.
     *
     * @param _components           Array of components
     * @param _exchangeData         Array of exchange specific arbitrary bytes data
     */
    function setExchangeData(
        address[] memory _components,
        bytes[] memory _exchangeData
    )
        external
        onlyOperator
    {
        bytes memory callData = abi.encodeWithSelector(
            IGeneralIndexModule.setExchangeData.selector,
            setToken,
            _components,
            _exchangeData
        );

        invokeManager(address(generalIndexModule), callData); 
    }

    /**
     * ONLY OPERATOR: Submits a setRaiseTargetPercentage call to GeneralIndexModule. See GIM for function specific restrictions.
     *
     * @param _raiseTargetPercentage        Amount to raise all component's unit targets by (in precise units)
     */
    function setRaiseTargetPercentage(uint256 _raiseTargetPercentage) external onlyOperator {
        bytes memory callData = abi.encodeWithSelector(
            IGeneralIndexModule.setRaiseTargetPercentage.selector,
            setToken,
            _raiseTargetPercentage
        );

        invokeManager(address(generalIndexModule), callData); 
    }

    /**
     * ONLY OPERATOR: Submits a setTraderStatus call to GeneralIndexModule. See GIM for function specific restrictions.
     *
     * @param _traders           Array trader addresses to toggle status
     * @param _statuses          Booleans indicating if matching trader can trade
     */
    function setTraderStatus(
        address[] memory _traders,
        bool[] memory _statuses
    )
        external
        onlyOperator
    {
        bytes memory callData = abi.encodeWithSelector(
            IGeneralIndexModule.setTraderStatus.selector,
            setToken,
            _traders,
            _statuses
        );

        invokeManager(address(generalIndexModule), callData); 
    }

    /**
     * ONLY OPERATOR: Submits a setAnyoneTrade call to GeneralIndexModule. See GIM for function specific restrictions.
     *
     * @param _status          Boolean indicating if anyone can call trade
     */
    function setAnyoneTrade(bool _status) external onlyOperator {
        bytes memory callData = abi.encodeWithSelector(
            IGeneralIndexModule.setAnyoneTrade.selector,
            setToken,
            _status
        );

        invokeManager(address(generalIndexModule), callData); 
    }

    /**
     * ONLY OPERATOR: Submits a initialize call to GeneralIndexModule. See GIM for function specific restrictions.
     */
    function initialize() external onlyOperator {
        bytes memory callData = abi.encodeWithSelector(
            IGeneralIndexModule.initialize.selector,
            setToken
        );

        invokeManager(address(generalIndexModule), callData);    
    }

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

    /**
     * Internal function that creates calldata and submits startRebalance call to GeneralIndexModule.
     *
     * @param _newComponents                    Array of new components to add to allocation
     * @param _newComponentsTargetUnits         Array of target units at end of rebalance for new components, maps to same index of _newComponents array
     * @param _oldComponentsTargetUnits         Array of target units at end of rebalance for old component, maps to same index of
     *                                               _setToken.getComponents() array, if component being removed set to 0.
     * @param _positionMultiplier               Position multiplier when target units were calculated, needed in order to adjust target units
     *                                               if fees accrued
     */
    function _startRebalance(
        address[] memory _newComponents,
        uint256[] memory _newComponentsTargetUnits,
        uint256[] memory _oldComponentsTargetUnits,
        uint256 _positionMultiplier
    )
        internal
    {
        bytes memory callData = abi.encodeWithSelector(
            IGeneralIndexModule.startRebalance.selector,
            setToken,
            _newComponents,
            _newComponentsTargetUnits,
            _oldComponentsTargetUnits,
            _positionMultiplier
        );

        invokeManager(address(generalIndexModule), callData);
    }

    /**
     * Internal function that sorts components into old and new components and builds the requisite target unit arrays. Old components target units
     * MUST maintain the order of the components array on the SetToken. The _components array MUST contain an entry for all current components even if
     * component is being removed (targetUnit = 0). This is validated implicitly by calculating the amount of new components that would be added as
     * implied by the array lengths, if more than the expected amount of new components are added then it implies an old component is missing.
     *
     * @param _components          Array of components involved in rebalance inclusive of components being removed from set (targetUnit = 0)
     * @param _targetUnits         Array of target units at end of rebalance, maps to same index of _components array
     */
    function _sortNewAndOldComponents(
        address[] memory _components,
        uint256[] memory _targetUnits
    )
        internal
        view
        returns (address[] memory, uint256[] memory, uint256[] memory)
    {
        address[] memory currentComponents = setToken.getComponents();

        uint256 currentSetComponentsLength = currentComponents.length;
        uint256 rebalanceComponentsLength = _components.length;

        require(rebalanceComponentsLength >= currentSetComponentsLength, "Components array must be equal or longer than current components");

        // We assume that there is an entry for each old component regardless of if it's 0, so any additional components in the array
        // must be added as a new component. Hence we can declare the length of the new components array as the difference between
        // rebalanceComponentsLength and currentSetComponentsLength
        uint256[] memory oldComponentsTargetUnits = new uint256[](currentSetComponentsLength);
        address[] memory newComponents = new address[](rebalanceComponentsLength.sub(currentSetComponentsLength));
        uint256[] memory newTargetUnits = new uint256[](rebalanceComponentsLength.sub(currentSetComponentsLength));

        uint256 newCounter;     // Count amount of components added to newComponents array to add new components to next index
        for (uint256 i = 0; i < rebalanceComponentsLength; i++) {
            address component = _components[i];
            (uint256 index, bool isIn) = currentComponents.indexOf(component);

            if (isIn) {
                oldComponentsTargetUnits[index] = _targetUnits[i];  // Use index in order to map to correct component in currentComponents array
            } else {
                require(newCounter < newComponents.length, "Unexpected new component added");
                newComponents[newCounter] = component;
                newTargetUnits[newCounter] = _targetUnits[i];
                newCounter = newCounter.add(1);
            }
        }

        return (newComponents, newTargetUnits, oldComponentsTargetUnits);
    }
}

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

pragma solidity >=0.6.0 <0.8.0;

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

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

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

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

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

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

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

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

File 3 of 8 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @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) {
        return sub(a, b, "SafeMath: subtraction overflow");
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        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-contracts/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) {
        return div(a, b, "SafeMath: division by zero");
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts with custom message 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, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        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) {
        return mod(a, b, "SafeMath: modulo by zero");
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts with custom message 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, string memory errorMessage) internal pure returns (uint256) {
        require(b != 0, errorMessage);
        return a % b;
    }
}

File 4 of 8 : AddressArrayUtils.sol
/*
    Copyright 2020 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.

    SPDX-License-Identifier: Apache License, Version 2.0
*/

pragma solidity 0.6.10;

/**
 * @title AddressArrayUtils
 * @author Set Protocol
 *
 * Utility functions to handle Address Arrays
 *
 * CHANGELOG:
 * - 4/27/21: Added validatePairsWithArray methods
 */
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 (uint256(-1), 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) = indexOf(A, a);
        return isIn;
    }

    /**
    * Returns true if there are 2 elements that are the same in an array
    * @param A The input array to search
    * @return Returns boolean for the first occurrence of a duplicate
    */
    function hasDuplicate(address[] memory A) internal pure returns(bool) {
        require(A.length > 0, "A is empty");

        for (uint256 i = 0; i < A.length - 1; i++) {
            address current = A[i];
            for (uint256 j = i + 1; j < A.length; j++) {
                if (current == A[j]) {
                    return true;
                }
            }
        }
        return false;
    }

    /**
     * @param A The input array to search
     * @param a The address to remove
     * @return Returns the array with the object removed.
     */
    function remove(address[] memory A, address a)
        internal
        pure
        returns (address[] memory)
    {
        (uint256 index, bool isIn) = indexOf(A, a);
        if (!isIn) {
            revert("Address not in array.");
        } else {
            (address[] memory _A,) = pop(A, index);
            return _A;
        }
    }

    /**
     * @param A The input array to search
     * @param a The address to remove
     */
    function removeStorage(address[] storage A, address a)
        internal
    {
        (uint256 index, bool isIn) = indexOf(A, a);
        if (!isIn) {
            revert("Address not in array.");
        } else {
            uint256 lastIndex = A.length - 1; // If the array would be empty, the previous line would throw, so no underflow here
            if (index != lastIndex) { A[index] = A[lastIndex]; }
            A.pop();
        }
    }

    /**
    * Removes specified index from array
    * @param A The input array to search
    * @param index The index to remove
    * @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;
        require(index < A.length, "Index must be < 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]);
    }

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

    /**
     * Validate that address and uint array lengths match. Validate address array is not empty
     * and contains no duplicate elements.
     *
     * @param A         Array of addresses
     * @param B         Array of uint
     */
    function validatePairsWithArray(address[] memory A, uint[] memory B) internal pure {
        require(A.length == B.length, "Array length mismatch");
        _validateLengthAndUniqueness(A);
    }

    /**
     * Validate that address and bool array lengths match. Validate address array is not empty
     * and contains no duplicate elements.
     *
     * @param A         Array of addresses
     * @param B         Array of bool
     */
    function validatePairsWithArray(address[] memory A, bool[] memory B) internal pure {
        require(A.length == B.length, "Array length mismatch");
        _validateLengthAndUniqueness(A);
    }

    /**
     * Validate that address and string array lengths match. Validate address array is not empty
     * and contains no duplicate elements.
     *
     * @param A         Array of addresses
     * @param B         Array of strings
     */
    function validatePairsWithArray(address[] memory A, string[] memory B) internal pure {
        require(A.length == B.length, "Array length mismatch");
        _validateLengthAndUniqueness(A);
    }

    /**
     * Validate that address array lengths match, and calling address array are not empty
     * and contain no duplicate elements.
     *
     * @param A         Array of addresses
     * @param B         Array of addresses
     */
    function validatePairsWithArray(address[] memory A, address[] memory B) internal pure {
        require(A.length == B.length, "Array length mismatch");
        _validateLengthAndUniqueness(A);
    }

    /**
     * Validate that address and bytes array lengths match. Validate address array is not empty
     * and contains no duplicate elements.
     *
     * @param A         Array of addresses
     * @param B         Array of bytes
     */
    function validatePairsWithArray(address[] memory A, bytes[] memory B) internal pure {
        require(A.length == B.length, "Array length mismatch");
        _validateLengthAndUniqueness(A);
    }

    /**
     * Validate address array is not empty and contains no duplicate elements.
     *
     * @param A          Array of addresses
     */
    function _validateLengthAndUniqueness(address[] memory A) internal pure {
        require(A.length > 0, "Array length must be > 0");
        require(!hasDuplicate(A), "Cannot duplicate addresses");
    }
}

File 5 of 8 : BaseAdapter.sol
/*
    Copyright 2021 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.6.10;

import { AddressArrayUtils } from "../lib/AddressArrayUtils.sol";
import { IBaseManager } from "../interfaces/IBaseManager.sol";

/**
 * @title BaseAdapter
 * @author Set Protocol
 *
 * Abstract class that houses common adapter-related state and functions.
 */
abstract contract BaseAdapter {
    using AddressArrayUtils for address[];

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

    event CallerStatusUpdated(address indexed _caller, bool _status);
    event AnyoneCallableUpdated(bool indexed _status);

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

    /**
     * Throws if the sender is not the SetToken operator
     */
    modifier onlyOperator() {
        require(msg.sender == manager.operator(), "Must be operator");
        _;
    }

    /**
     * Throws if the sender is not the SetToken methodologist
     */
    modifier onlyMethodologist() {
        require(msg.sender == manager.methodologist(), "Must be methodologist");
        _;
    }

    /**
     * Throws if caller is a contract, can be used to stop flash loan and sandwich attacks
     */
    modifier onlyEOA() {
        require(msg.sender == tx.origin, "Caller must be EOA Address");
        _;
    }

    /**
     * Throws if not allowed caller
     */
    modifier onlyAllowedCaller(address _caller) {
        require(isAllowedCaller(_caller), "Address not permitted to call");
        _;
    }

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

    // Instance of manager contract
    IBaseManager public manager;

    // Boolean indicating if anyone can call function
    bool public anyoneCallable;

    // Mapping of addresses allowed to call function
    mapping(address => bool) public callAllowList;

    /* ============ Constructor ============ */

    constructor(IBaseManager _manager) public { manager = _manager; }

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

    /**
     * OPERATOR ONLY: Toggle ability for passed addresses to call only allowed caller functions
     *
     * @param _callers           Array of caller addresses to toggle status
     * @param _statuses          Array of statuses for each caller
     */
    function updateCallerStatus(address[] calldata _callers, bool[] calldata _statuses) external onlyOperator {
        require(_callers.length == _statuses.length, "Array length mismatch");
        require(_callers.length > 0, "Array length must be > 0");
        require(!_callers.hasDuplicate(), "Cannot duplicate callers");

        for (uint256 i = 0; i < _callers.length; i++) {
            address caller = _callers[i];
            bool status = _statuses[i];
            callAllowList[caller] = status;
            emit CallerStatusUpdated(caller, status);
        }
    }

    /**
     * OPERATOR ONLY: Toggle whether anyone can call function, bypassing the callAllowlist 
     *
     * @param _status           Boolean indicating whether to allow anyone call
     */
    function updateAnyoneCallable(bool _status) external onlyOperator {
        anyoneCallable = _status;
        emit AnyoneCallableUpdated(_status);
    }

    /* ============ Internal Functions ============ */
    
    /**
     * Invoke manager to transfer tokens from manager to other contract.
     *
     * @param _token           Token being transferred from manager contract
     * @param _amount          Amount of token being transferred
     */
    function invokeManagerTransfer(address _token, address _destination, uint256 _amount) internal {
        bytes memory callData = abi.encodeWithSignature("transfer(address,uint256)", _destination, _amount);
        invokeManager(_token, callData);
    }

    /**
     * Invoke call from manager
     *
     * @param _module           Module to interact with
     * @param _encoded          Encoded byte data
     */
    function invokeManager(address _module, bytes memory _encoded) internal {
        manager.interactManager(_module, _encoded);
    }

    /**
     * Determine if passed address is allowed to call function. If anyoneCallable set to true anyone can call otherwise needs to be approved.
     *
     * return bool              Boolean indicating if allowed caller
     */
    function isAllowedCaller(address _caller) internal view virtual returns (bool) {
        return anyoneCallable || callAllowList[_caller];
    }
}

File 6 of 8 : IBaseManager.sol
/*
    Copyright 2021 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.6.10;
pragma experimental "ABIEncoderV2";

import { ISetToken } from "./ISetToken.sol";

interface IBaseManager {
    function setToken() external returns(ISetToken);
    
    function methodologist() external returns(address);

    function operator() external returns(address);

    function interactManager(address _module, bytes calldata _encoded) external;
}

File 7 of 8 : IGeneralIndexModule.sol
/*
    Copyright 2020 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.
    SPDX-License-Identifier: Apache License, Version 2.0
*/
pragma solidity 0.6.10;
pragma experimental "ABIEncoderV2";

import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";

import { ISetToken } from "./ISetToken.sol";

interface IGeneralIndexModule {
    function startRebalance(
        ISetToken _setToken,
        address[] calldata _newComponents,
        uint256[] calldata _newComponentsTargetUnits,
        uint256[] calldata _oldComponentsTargetUnits,
        uint256 _positionMultiplier
    )
        external;
    
    function trade(
        ISetToken _setToken,
        IERC20 _component,
        uint256 _ethQuantityLimit
    )
        external;

    function tradeRemainingWETH(
        ISetToken _setToken,
        IERC20 _component,
        uint256 _minComponentReceived
    )
        external;
    
    function raiseAssetTargets(ISetToken _setToken) external;

    function setTradeMaximums(
        ISetToken _setToken,
        address[] memory _components,
        uint256[] memory _tradeMaximums
    )
        external;
    
    function setExchanges(
        ISetToken _setToken,
        address[] memory _components,
        string[] memory _exchangeNames
    )
        external;

    function setCoolOffPeriods(
        ISetToken _setToken,
        address[] memory _components,
        uint256[] memory _coolOffPeriods
    )
        external;

    function setExchangeData(
        ISetToken _setToken,
        address[] memory _components,
        bytes[] memory _exchangeData
    )
        external;

    function setRaiseTargetPercentage(ISetToken _setToken, uint256 _raiseTargetPercentage) external;

    function setTraderStatus(
        ISetToken _setToken,
        address[] memory _traders,
        bool[] memory _statuses
    )
        external;

    function setAnyoneTrade(ISetToken _setToken, bool _status) external;
    function initialize(ISetToken _setToken) external;
}

File 8 of 8 : ISetToken.sol
pragma solidity 0.6.10;
pragma experimental "ABIEncoderV2";

import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";

/**
 * @title ISetToken
 * @author Set Protocol
 *
 * Interface for operating with SetTokens.
 */
interface ISetToken is IERC20 {

    /* ============ Enums ============ */

    enum ModuleState {
        NONE,
        PENDING,
        INITIALIZED
    }

    /* ============ Structs ============ */
    /**
     * The base definition of a SetToken Position
     *
     * @param component           Address of token in the Position
     * @param module              If not in default state, the address of associated module
     * @param unit                Each unit is the # of components per 10^18 of a SetToken
     * @param positionState       Position ENUM. Default is 0; External is 1
     * @param data                Arbitrary data
     */
    struct Position {
        address component;
        address module;
        int256 unit;
        uint8 positionState;
        bytes data;
    }

    /**
     * A struct that stores a component's cash position details and external positions
     * This data structure allows O(1) access to a component's cash position units and 
     * virtual units.
     *
     * @param virtualUnit               Virtual value of a component's DEFAULT position. Stored as virtual for efficiency
     *                                  updating all units at once via the position multiplier. Virtual units are achieved
     *                                  by dividing a "real" value by the "positionMultiplier"
     * @param componentIndex            
     * @param externalPositionModules   List of external modules attached to each external position. Each module
     *                                  maps to an external position
     * @param externalPositions         Mapping of module => ExternalPosition struct for a given component
     */
    struct ComponentPosition {
      int256 virtualUnit;
      address[] externalPositionModules;
      mapping(address => ExternalPosition) externalPositions;
    }

    /**
     * A struct that stores a component's external position details including virtual unit and any
     * auxiliary data.
     *
     * @param virtualUnit       Virtual value of a component's EXTERNAL position.
     * @param data              Arbitrary data
     */
    struct ExternalPosition {
      int256 virtualUnit;
      bytes data;
    }


    /* ============ Functions ============ */
    
    function addComponent(address _component) external;
    function removeComponent(address _component) external;
    function editDefaultPositionUnit(address _component, int256 _realUnit) external;
    function addExternalPositionModule(address _component, address _positionModule) external;
    function removeExternalPositionModule(address _component, address _positionModule) external;
    function editExternalPositionUnit(address _component, address _positionModule, int256 _realUnit) external;
    function editExternalPositionData(address _component, address _positionModule, bytes calldata _data) external;

    function invoke(address _target, uint256 _value, bytes calldata _data) external returns(bytes memory);

    function editPositionMultiplier(int256 _newMultiplier) external;

    function mint(address _account, uint256 _quantity) external;
    function burn(address _account, uint256 _quantity) external;

    function lock() external;
    function unlock() external;

    function addModule(address _module) external;
    function removeModule(address _module) external;
    function initializeModule() external;

    function setManager(address _manager) external;

    function manager() external view returns (address);
    function moduleStates(address _module) external view returns (ModuleState);
    function getModules() external view returns (address[] memory);
    
    function getDefaultPositionRealUnit(address _component) external view returns(int256);
    function getExternalPositionRealUnit(address _component, address _positionModule) external view returns(int256);
    function getComponents() external view returns(address[] memory);
    function getExternalPositionModules(address _component) external view returns(address[] memory);
    function getExternalPositionData(address _component, address _positionModule) external view returns(bytes memory);
    function isExternalPositionModule(address _component, address _module) external view returns(bool);
    function isComponent(address _component) external view returns(bool);
    
    function positionMultiplier() external view returns (int256);
    function getPositions() external view returns (Position[] memory);
    function getTotalComponentRealUnits(address _component) external view returns(int256);

    function isInitializedModule(address _module) external view returns(bool);
    function isPendingModule(address _module) external view returns(bool);
    function isLocked() external view returns (bool);
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  },
  "metadata": {
    "useLiteralContent": true
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract IBaseManager","name":"_manager","type":"address"},{"internalType":"contract IGeneralIndexModule","name":"_generalIndexModule","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bool","name":"_status","type":"bool"}],"name":"AnyoneCallableUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_caller","type":"address"},{"indexed":false,"internalType":"bool","name":"_status","type":"bool"}],"name":"CallerStatusUpdated","type":"event"},{"inputs":[],"name":"anyoneCallable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"callAllowList","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"generalIndexModule","outputs":[{"internalType":"contract IGeneralIndexModule","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"contract IBaseManager","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"_status","type":"bool"}],"name":"setAnyoneTrade","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_components","type":"address[]"},{"internalType":"uint256[]","name":"_coolOffPeriods","type":"uint256[]"}],"name":"setCoolOffPeriods","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_components","type":"address[]"},{"internalType":"bytes[]","name":"_exchangeData","type":"bytes[]"}],"name":"setExchangeData","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_components","type":"address[]"},{"internalType":"string[]","name":"_exchangeNames","type":"string[]"}],"name":"setExchanges","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_raiseTargetPercentage","type":"uint256"}],"name":"setRaiseTargetPercentage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"setToken","outputs":[{"internalType":"contract ISetToken","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_components","type":"address[]"},{"internalType":"uint256[]","name":"_tradeMaximums","type":"uint256[]"}],"name":"setTradeMaximums","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_traders","type":"address[]"},{"internalType":"bool[]","name":"_statuses","type":"bool[]"}],"name":"setTraderStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_components","type":"address[]"},{"internalType":"uint256[]","name":"_targetUnits","type":"uint256[]"},{"internalType":"uint256","name":"_positionMultiplier","type":"uint256"}],"name":"startRebalanceWithUnits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_status","type":"bool"}],"name":"updateAnyoneCallable","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_callers","type":"address[]"},{"internalType":"bool[]","name":"_statuses","type":"bool[]"}],"name":"updateCallerStatus","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040523480156200001157600080fd5b506040516200210d3803806200210d833981016040819052620000349162000105565b600080546001600160a01b038085166001600160a01b0319928316178084556003805486841694169390931790925560408051633b673d6360e21b81529051929091169263ed9cf58c926004808401936020939083900390910190829087803b158015620000a157600080fd5b505af1158015620000b6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000dc919062000143565b600280546001600160a01b0319166001600160a01b039290921691909117905550620001829050565b6000806040838503121562000118578182fd5b8251620001258162000169565b6020840151909250620001388162000169565b809150509250929050565b60006020828403121562000155578081fd5b8151620001628162000169565b9392505050565b6001600160a01b03811681146200017f57600080fd5b50565b611f7b80620001926000396000f3fe608060405234801561001057600080fd5b50600436106101005760003560e01c8063a075723611610097578063e81409d311610066578063e81409d3146101e2578063ed9cf58c146101f5578063f2d7dddb146101fd578063fc98f8521461021057610100565b8063a0757236146101a1578063aea6cc80146101b4578063d8be633d146101c7578063de02745b146101cf57610100565b80635a41aeb2116100d35780635a41aeb2146101605780635a860bab146101735780638129fc1c146101865780639ce4f3891461018e57610100565b80632d158e7d14610105578063481c6a75146101235780634afdd22f146101385780634ee05c4a1461014d575b600080fd5b61010d610223565b60405161011a9190611adb565b60405180910390f35b61012b610233565b60405161011a9190611ae6565b61014b610146366004611912565b610242565b005b61014b61015b366004611873565b61037e565b61014b61016e366004611912565b610461565b61014b6101813660046119ba565b610544565b61014b610642565b61014b61019c3660046115f9565b61076f565b61014b6101af3660046119ba565b6108b4565b61010d6101c2366004611559565b6109e4565b61012b6109f9565b61014b6101dd3660046117c4565b610a08565b61014b6101f0366004611591565b610aeb565b61012b610cfb565b61014b61020b3660046119da565b610d0a565b61014b61021e366004611704565b610deb565b600054600160a01b900460ff1681565b6000546001600160a01b031681565b6000809054906101000a90046001600160a01b03166001600160a01b031663570ca7356040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561029157600080fd5b505af11580156102a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102c99190611575565b6001600160a01b0316336001600160a01b0316146103025760405162461bcd60e51b81526004016102f990611d34565b60405180910390fd5b60025460405160609163188d6e2160e21b9161032e916001600160a01b03169086908690602401611c51565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152600354909150610379906001600160a01b031682610ece565b505050565b6000809054906101000a90046001600160a01b03166001600160a01b031663570ca7356040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156103cd57600080fd5b505af11580156103e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104059190611575565b6001600160a01b0316336001600160a01b0316146104355760405162461bcd60e51b81526004016102f990611d34565b600254604051606091636dbd8b9160e01b9161032e916001600160a01b03169086908690602401611be1565b6000809054906101000a90046001600160a01b03166001600160a01b031663570ca7356040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156104b057600080fd5b505af11580156104c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104e89190611575565b6001600160a01b0316336001600160a01b0316146105185760405162461bcd60e51b81526004016102f990611d34565b60025460405160609163b821771960e01b9161032e916001600160a01b03169086908690602401611c51565b6000809054906101000a90046001600160a01b03166001600160a01b031663570ca7356040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561059357600080fd5b505af11580156105a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105cb9190611575565b6001600160a01b0316336001600160a01b0316146105fb5760405162461bcd60e51b81526004016102f990611d34565b6000805460ff60a01b1916600160a01b83151590810291909117825560405190917f92f8cd47e301bde05ff0abd73cc198632f3ac64fa443a1afc3e47745b3ea1acb91a250565b6000809054906101000a90046001600160a01b03166001600160a01b031663570ca7356040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561069157600080fd5b505af11580156106a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106c99190611575565b6001600160a01b0316336001600160a01b0316146106f95760405162461bcd60e51b81526004016102f990611d34565b60025460405160609163189acdbd60e31b91610721916001600160a01b031690602401611ae6565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915260035490915061076c906001600160a01b031682610ece565b50565b6000809054906101000a90046001600160a01b03166001600160a01b031663570ca7356040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156107be57600080fd5b505af11580156107d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107f69190611575565b6001600160a01b0316336001600160a01b0316146108265760405162461bcd60e51b81526004016102f990611d34565b606080606061089888888080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808c0282810182019093528b82529093508b92508a918291850190849080828437600092019190915250610f3692505050565b9250925092506108aa838383876111fb565b5050505050505050565b6000809054906101000a90046001600160a01b03166001600160a01b031663570ca7356040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561090357600080fd5b505af1158015610917573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061093b9190611575565b6001600160a01b0316336001600160a01b03161461096b5760405162461bcd60e51b81526004016102f990611d34565b600254604051606091638fa92b0560e01b91610995916001600160a01b0316908590602401611ced565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526003549091506109e0906001600160a01b031682610ece565b5050565b60016020526000908152604090205460ff1681565b6003546001600160a01b031681565b6000809054906101000a90046001600160a01b03166001600160a01b031663570ca7356040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610a5757600080fd5b505af1158015610a6b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a8f9190611575565b6001600160a01b0316336001600160a01b031614610abf5760405162461bcd60e51b81526004016102f990611d34565b600254604051606091630bdbaaf560e11b9161032e916001600160a01b03169086908690602401611b61565b6000809054906101000a90046001600160a01b03166001600160a01b031663570ca7356040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610b3a57600080fd5b505af1158015610b4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b729190611575565b6001600160a01b0316336001600160a01b031614610ba25760405162461bcd60e51b81526004016102f990611d34565b828114610bc15760405162461bcd60e51b81526004016102f990611d5e565b82610bde5760405162461bcd60e51b81526004016102f990611e32565b610c1a84848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061127692505050565b15610c375760405162461bcd60e51b81526004016102f990611dfb565b60005b83811015610cf4576000858583818110610c5057fe5b9050602002016020810190610c659190611559565b90506000848484818110610c7557fe5b9050602002016020810190610c8a91906119ba565b6001600160a01b03831660008181526001602052604090819020805460ff191684151517905551919250907fbbf89f81f443eef9b97bfd2b7e260c0f575050d4094a0027dcf5d3623d9ef3ad90610ce2908490611adb565b60405180910390a25050600101610c3a565b5050505050565b6002546001600160a01b031681565b6000809054906101000a90046001600160a01b03166001600160a01b031663570ca7356040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610d5957600080fd5b505af1158015610d6d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d919190611575565b6001600160a01b0316336001600160a01b031614610dc15760405162461bcd60e51b81526004016102f990611d34565b6002546040516060916339ba98dd60e11b91610995916001600160a01b0316908590602401611d08565b6000809054906101000a90046001600160a01b03166001600160a01b031663570ca7356040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610e3a57600080fd5b505af1158015610e4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e729190611575565b6001600160a01b0316336001600160a01b031614610ea25760405162461bcd60e51b81526004016102f990611d34565b60025460405160609163b91d30e960e01b9161032e916001600160a01b03169086908690602401611afa565b600054604051634cf4f63b60e01b81526001600160a01b0390911690634cf4f63b90610f009085908590600401611aaf565b600060405180830381600087803b158015610f1a57600080fd5b505af1158015610f2e573d6000803e3d6000fd5b505050505050565b606080606080600260009054906101000a90046001600160a01b03166001600160a01b03166399d50d5d6040518163ffffffff1660e01b815260040160006040518083038186803b158015610f8a57600080fd5b505afa158015610f9e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610fc69190810190611669565b805187519192509081811015610fee5760405162461bcd60e51b81526004016102f990611e69565b6060826001600160401b038111801561100657600080fd5b50604051908082528060200260200182016040528015611030578160200160208202803683370190505b5090506060611045838563ffffffff61132716565b6001600160401b038111801561105a57600080fd5b50604051908082528060200260200182016040528015611084578160200160208202803683370190505b5090506060611099848663ffffffff61132716565b6001600160401b03811180156110ae57600080fd5b506040519080825280602002602001820160405280156110d8578160200160208202803683370190505b5090506000805b858110156111e75760008d82815181106110f557fe5b60200260200101519050600080611115838c61137290919063ffffffff16565b915091508015611150578e848151811061112b57fe5b602002602001015188838151811061113f57fe5b6020026020010181815250506111dc565b865185106111705760405162461bcd60e51b81526004016102f990611dc4565b8287868151811061117d57fe5b60200260200101906001600160a01b031690816001600160a01b0316815250508e84815181106111a957fe5b60200260200101518686815181106111bd57fe5b60209081029190910101526111d985600163ffffffff6113d816565b94505b5050506001016110df565b509198509650909450505050509250925092565b600254604051606091632f5c5ac360e01b9161122b916001600160a01b0316908890889088908890602401611c91565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152600354909150610cf4906001600160a01b031682610ece565b6000808251116112985760405162461bcd60e51b81526004016102f990611ec7565b60005b600183510381101561131c5760008382815181106112b557fe5b6020026020010151905060008260010190505b8451811015611312578481815181106112dd57fe5b60200260200101516001600160a01b0316826001600160a01b0316141561130a5760019350505050611322565b6001016112c8565b505060010161129b565b50600090505b919050565b600061136983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113fd565b90505b92915050565b81516000908190815b818110156113c557846001600160a01b031686828151811061139957fe5b60200260200101516001600160a01b031614156113bd579250600191506113d19050565b60010161137b565b50600019600092509250505b9250929050565b6000828201838110156113695760405162461bcd60e51b81526004016102f990611d8d565b600081848411156114215760405162461bcd60e51b81526004016102f99190611d21565b505050900390565b60008083601f84011261143a578182fd5b5081356001600160401b03811115611450578182fd5b60208301915083602080830285010111156113d157600080fd5b600082601f83011261147a578081fd5b813561148d61148882611f11565b611eeb565b8181529150602080830190848101818402860182018710156114ae57600080fd5b60005b848110156114d65781356114c481611f30565b845292820192908201906001016114b1565b505050505092915050565b8035801515811461136c57600080fd5b600082601f830112611501578081fd5b81356001600160401b03811115611516578182fd5b611529601f8201601f1916602001611eeb565b915080825283602082850101111561154057600080fd5b8060208401602084013760009082016020015292915050565b60006020828403121561156a578081fd5b813561136981611f30565b600060208284031215611586578081fd5b815161136981611f30565b600080600080604085870312156115a6578283fd5b84356001600160401b03808211156115bc578485fd5b6115c888838901611429565b909650945060208701359150808211156115e0578384fd5b506115ed87828801611429565b95989497509550505050565b600080600080600060608688031215611610578081fd5b85356001600160401b0380821115611626578283fd5b61163289838a01611429565b9097509550602088013591508082111561164a578283fd5b5061165788828901611429565b96999598509660400135949350505050565b6000602080838503121561167b578182fd5b82516001600160401b03811115611690578283fd5b80840185601f8201126116a1578384fd5b805191506116b161148883611f11565b82815283810190828501858502840186018910156116cd578687fd5b8693505b848410156116f85780516116e481611f30565b8352600193909301929185019185016116d1565b50979650505050505050565b60008060408385031215611716578182fd5b82356001600160401b038082111561172c578384fd5b6117388683870161146a565b935060209150818501358181111561174e578384fd5b85019050601f81018613611760578283fd5b803561176e61148882611f11565b81815283810190838501858402850186018a101561178a578687fd5b8694505b838510156117b4576117a08a826114e1565b83526001949094019391850191850161178e565b5080955050505050509250929050565b600080604083850312156117d6578182fd5b82356001600160401b03808211156117ec578384fd5b6117f88683870161146a565b935060209150818501358181111561180e578384fd5b85019050601f81018613611820578283fd5b803561182e61148882611f11565b81815283810190838501865b84811015611863576118518b8884358901016114f1565b8452928601929086019060010161183a565b5096999098509650505050505050565b60008060408385031215611885578182fd5b82356001600160401b038082111561189b578384fd5b6118a78683870161146a565b93506020915081850135818111156118bd578384fd5b85019050601f810186136118cf578283fd5b80356118dd61148882611f11565b81815283810190838501865b84811015611863576119008b8884358901016114f1565b845292860192908601906001016118e9565b60008060408385031215611924578182fd5b82356001600160401b038082111561193a578384fd5b6119468683870161146a565b935060209150818501358181111561195c578384fd5b85019050601f8101861361196e578283fd5b803561197c61148882611f11565b81815283810190838501858402850186018a1015611998578687fd5b8694505b838510156117b457803583526001949094019391850191850161199c565b6000602082840312156119cb578081fd5b81358015158114611369578182fd5b6000602082840312156119eb578081fd5b5035919050565b6000815180845260208085019450808401835b83811015611a2a5781516001600160a01b031687529582019590820190600101611a05565b509495945050505050565b6000815180845260208085019450808401835b83811015611a2a57815187529582019590820190600101611a48565b60008151808452815b81811015611a8957602081850181015186830182015201611a6d565b81811115611a9a5782602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b0383168152604060208201819052600090611ad390830184611a64565b949350505050565b901515815260200190565b6001600160a01b0391909116815260200190565b6001600160a01b038416815260606020808301829052600091611b1f908401866119f2565b8381036040850152845180825282860191830190845b81811015611b53578351151583529284019291840191600101611b35565b509098975050505050505050565b6001600160a01b038416815260606020808301829052600091611b86908401866119f2565b838103604085015284518082528282019083810283018401848801865b83811015611bd157601f19868403018552611bbf838351611a64565b94870194925090860190600101611ba3565b50909a9950505050505050505050565b6001600160a01b038416815260606020808301829052600091611c06908401866119f2565b838103604085015284518082528282019083810283018401848801865b83811015611bd157601f19868403018552611c3f838351611a64565b94870194925090860190600101611c23565b6001600160a01b0384168152606060208201819052600090611c75908301856119f2565b8281036040840152611c878185611a35565b9695505050505050565b6001600160a01b038616815260a060208201819052600090611cb5908301876119f2565b8281036040840152611cc78187611a35565b8381036060850152611cd98187611a35565b925050508260808301529695505050505050565b6001600160a01b039290921682521515602082015260400190565b6001600160a01b03929092168252602082015260400190565b6000602082526113696020830184611a64565b60208082526010908201526f26bab9ba1031329037b832b930ba37b960811b604082015260600190565b602080825260159082015274082e4e4c2f240d8cadccee8d040dad2e6dac2e8c6d605b1b604082015260600190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b6020808252601e908201527f556e6578706563746564206e657720636f6d706f6e656e742061646465640000604082015260600190565b60208082526018908201527f43616e6e6f74206475706c69636174652063616c6c6572730000000000000000604082015260600190565b60208082526018908201527f4172726179206c656e677468206d757374206265203e20300000000000000000604082015260600190565b602080825260409082018190527f436f6d706f6e656e7473206172726179206d75737420626520657175616c206f908201527f72206c6f6e676572207468616e2063757272656e7420636f6d706f6e656e7473606082015260800190565b6020808252600a90820152694120697320656d70747960b01b604082015260600190565b6040518181016001600160401b0381118282101715611f0957600080fd5b604052919050565b60006001600160401b03821115611f26578081fd5b5060209081020190565b6001600160a01b038116811461076c57600080fdfea2646970667358221220a8c79524b12552b2808b9f2f46e0373bdc4ec2b3ceb71413db776372a41df67e64736f6c634300060a00330000000000000000000000000528a40435d0940f3759f6bbad3ebfd050211a2e00000000000000000000000084ce03ae547330f61584ad6103743732b1ae97c5

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063a075723611610097578063e81409d311610066578063e81409d3146101e2578063ed9cf58c146101f5578063f2d7dddb146101fd578063fc98f8521461021057610100565b8063a0757236146101a1578063aea6cc80146101b4578063d8be633d146101c7578063de02745b146101cf57610100565b80635a41aeb2116100d35780635a41aeb2146101605780635a860bab146101735780638129fc1c146101865780639ce4f3891461018e57610100565b80632d158e7d14610105578063481c6a75146101235780634afdd22f146101385780634ee05c4a1461014d575b600080fd5b61010d610223565b60405161011a9190611adb565b60405180910390f35b61012b610233565b60405161011a9190611ae6565b61014b610146366004611912565b610242565b005b61014b61015b366004611873565b61037e565b61014b61016e366004611912565b610461565b61014b6101813660046119ba565b610544565b61014b610642565b61014b61019c3660046115f9565b61076f565b61014b6101af3660046119ba565b6108b4565b61010d6101c2366004611559565b6109e4565b61012b6109f9565b61014b6101dd3660046117c4565b610a08565b61014b6101f0366004611591565b610aeb565b61012b610cfb565b61014b61020b3660046119da565b610d0a565b61014b61021e366004611704565b610deb565b600054600160a01b900460ff1681565b6000546001600160a01b031681565b6000809054906101000a90046001600160a01b03166001600160a01b031663570ca7356040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561029157600080fd5b505af11580156102a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102c99190611575565b6001600160a01b0316336001600160a01b0316146103025760405162461bcd60e51b81526004016102f990611d34565b60405180910390fd5b60025460405160609163188d6e2160e21b9161032e916001600160a01b03169086908690602401611c51565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152600354909150610379906001600160a01b031682610ece565b505050565b6000809054906101000a90046001600160a01b03166001600160a01b031663570ca7356040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156103cd57600080fd5b505af11580156103e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104059190611575565b6001600160a01b0316336001600160a01b0316146104355760405162461bcd60e51b81526004016102f990611d34565b600254604051606091636dbd8b9160e01b9161032e916001600160a01b03169086908690602401611be1565b6000809054906101000a90046001600160a01b03166001600160a01b031663570ca7356040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156104b057600080fd5b505af11580156104c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104e89190611575565b6001600160a01b0316336001600160a01b0316146105185760405162461bcd60e51b81526004016102f990611d34565b60025460405160609163b821771960e01b9161032e916001600160a01b03169086908690602401611c51565b6000809054906101000a90046001600160a01b03166001600160a01b031663570ca7356040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561059357600080fd5b505af11580156105a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105cb9190611575565b6001600160a01b0316336001600160a01b0316146105fb5760405162461bcd60e51b81526004016102f990611d34565b6000805460ff60a01b1916600160a01b83151590810291909117825560405190917f92f8cd47e301bde05ff0abd73cc198632f3ac64fa443a1afc3e47745b3ea1acb91a250565b6000809054906101000a90046001600160a01b03166001600160a01b031663570ca7356040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561069157600080fd5b505af11580156106a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106c99190611575565b6001600160a01b0316336001600160a01b0316146106f95760405162461bcd60e51b81526004016102f990611d34565b60025460405160609163189acdbd60e31b91610721916001600160a01b031690602401611ae6565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915260035490915061076c906001600160a01b031682610ece565b50565b6000809054906101000a90046001600160a01b03166001600160a01b031663570ca7356040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156107be57600080fd5b505af11580156107d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107f69190611575565b6001600160a01b0316336001600160a01b0316146108265760405162461bcd60e51b81526004016102f990611d34565b606080606061089888888080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808c0282810182019093528b82529093508b92508a918291850190849080828437600092019190915250610f3692505050565b9250925092506108aa838383876111fb565b5050505050505050565b6000809054906101000a90046001600160a01b03166001600160a01b031663570ca7356040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561090357600080fd5b505af1158015610917573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061093b9190611575565b6001600160a01b0316336001600160a01b03161461096b5760405162461bcd60e51b81526004016102f990611d34565b600254604051606091638fa92b0560e01b91610995916001600160a01b0316908590602401611ced565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526003549091506109e0906001600160a01b031682610ece565b5050565b60016020526000908152604090205460ff1681565b6003546001600160a01b031681565b6000809054906101000a90046001600160a01b03166001600160a01b031663570ca7356040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610a5757600080fd5b505af1158015610a6b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a8f9190611575565b6001600160a01b0316336001600160a01b031614610abf5760405162461bcd60e51b81526004016102f990611d34565b600254604051606091630bdbaaf560e11b9161032e916001600160a01b03169086908690602401611b61565b6000809054906101000a90046001600160a01b03166001600160a01b031663570ca7356040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610b3a57600080fd5b505af1158015610b4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b729190611575565b6001600160a01b0316336001600160a01b031614610ba25760405162461bcd60e51b81526004016102f990611d34565b828114610bc15760405162461bcd60e51b81526004016102f990611d5e565b82610bde5760405162461bcd60e51b81526004016102f990611e32565b610c1a84848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061127692505050565b15610c375760405162461bcd60e51b81526004016102f990611dfb565b60005b83811015610cf4576000858583818110610c5057fe5b9050602002016020810190610c659190611559565b90506000848484818110610c7557fe5b9050602002016020810190610c8a91906119ba565b6001600160a01b03831660008181526001602052604090819020805460ff191684151517905551919250907fbbf89f81f443eef9b97bfd2b7e260c0f575050d4094a0027dcf5d3623d9ef3ad90610ce2908490611adb565b60405180910390a25050600101610c3a565b5050505050565b6002546001600160a01b031681565b6000809054906101000a90046001600160a01b03166001600160a01b031663570ca7356040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610d5957600080fd5b505af1158015610d6d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d919190611575565b6001600160a01b0316336001600160a01b031614610dc15760405162461bcd60e51b81526004016102f990611d34565b6002546040516060916339ba98dd60e11b91610995916001600160a01b0316908590602401611d08565b6000809054906101000a90046001600160a01b03166001600160a01b031663570ca7356040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610e3a57600080fd5b505af1158015610e4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e729190611575565b6001600160a01b0316336001600160a01b031614610ea25760405162461bcd60e51b81526004016102f990611d34565b60025460405160609163b91d30e960e01b9161032e916001600160a01b03169086908690602401611afa565b600054604051634cf4f63b60e01b81526001600160a01b0390911690634cf4f63b90610f009085908590600401611aaf565b600060405180830381600087803b158015610f1a57600080fd5b505af1158015610f2e573d6000803e3d6000fd5b505050505050565b606080606080600260009054906101000a90046001600160a01b03166001600160a01b03166399d50d5d6040518163ffffffff1660e01b815260040160006040518083038186803b158015610f8a57600080fd5b505afa158015610f9e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610fc69190810190611669565b805187519192509081811015610fee5760405162461bcd60e51b81526004016102f990611e69565b6060826001600160401b038111801561100657600080fd5b50604051908082528060200260200182016040528015611030578160200160208202803683370190505b5090506060611045838563ffffffff61132716565b6001600160401b038111801561105a57600080fd5b50604051908082528060200260200182016040528015611084578160200160208202803683370190505b5090506060611099848663ffffffff61132716565b6001600160401b03811180156110ae57600080fd5b506040519080825280602002602001820160405280156110d8578160200160208202803683370190505b5090506000805b858110156111e75760008d82815181106110f557fe5b60200260200101519050600080611115838c61137290919063ffffffff16565b915091508015611150578e848151811061112b57fe5b602002602001015188838151811061113f57fe5b6020026020010181815250506111dc565b865185106111705760405162461bcd60e51b81526004016102f990611dc4565b8287868151811061117d57fe5b60200260200101906001600160a01b031690816001600160a01b0316815250508e84815181106111a957fe5b60200260200101518686815181106111bd57fe5b60209081029190910101526111d985600163ffffffff6113d816565b94505b5050506001016110df565b509198509650909450505050509250925092565b600254604051606091632f5c5ac360e01b9161122b916001600160a01b0316908890889088908890602401611c91565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152600354909150610cf4906001600160a01b031682610ece565b6000808251116112985760405162461bcd60e51b81526004016102f990611ec7565b60005b600183510381101561131c5760008382815181106112b557fe5b6020026020010151905060008260010190505b8451811015611312578481815181106112dd57fe5b60200260200101516001600160a01b0316826001600160a01b0316141561130a5760019350505050611322565b6001016112c8565b505060010161129b565b50600090505b919050565b600061136983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113fd565b90505b92915050565b81516000908190815b818110156113c557846001600160a01b031686828151811061139957fe5b60200260200101516001600160a01b031614156113bd579250600191506113d19050565b60010161137b565b50600019600092509250505b9250929050565b6000828201838110156113695760405162461bcd60e51b81526004016102f990611d8d565b600081848411156114215760405162461bcd60e51b81526004016102f99190611d21565b505050900390565b60008083601f84011261143a578182fd5b5081356001600160401b03811115611450578182fd5b60208301915083602080830285010111156113d157600080fd5b600082601f83011261147a578081fd5b813561148d61148882611f11565b611eeb565b8181529150602080830190848101818402860182018710156114ae57600080fd5b60005b848110156114d65781356114c481611f30565b845292820192908201906001016114b1565b505050505092915050565b8035801515811461136c57600080fd5b600082601f830112611501578081fd5b81356001600160401b03811115611516578182fd5b611529601f8201601f1916602001611eeb565b915080825283602082850101111561154057600080fd5b8060208401602084013760009082016020015292915050565b60006020828403121561156a578081fd5b813561136981611f30565b600060208284031215611586578081fd5b815161136981611f30565b600080600080604085870312156115a6578283fd5b84356001600160401b03808211156115bc578485fd5b6115c888838901611429565b909650945060208701359150808211156115e0578384fd5b506115ed87828801611429565b95989497509550505050565b600080600080600060608688031215611610578081fd5b85356001600160401b0380821115611626578283fd5b61163289838a01611429565b9097509550602088013591508082111561164a578283fd5b5061165788828901611429565b96999598509660400135949350505050565b6000602080838503121561167b578182fd5b82516001600160401b03811115611690578283fd5b80840185601f8201126116a1578384fd5b805191506116b161148883611f11565b82815283810190828501858502840186018910156116cd578687fd5b8693505b848410156116f85780516116e481611f30565b8352600193909301929185019185016116d1565b50979650505050505050565b60008060408385031215611716578182fd5b82356001600160401b038082111561172c578384fd5b6117388683870161146a565b935060209150818501358181111561174e578384fd5b85019050601f81018613611760578283fd5b803561176e61148882611f11565b81815283810190838501858402850186018a101561178a578687fd5b8694505b838510156117b4576117a08a826114e1565b83526001949094019391850191850161178e565b5080955050505050509250929050565b600080604083850312156117d6578182fd5b82356001600160401b03808211156117ec578384fd5b6117f88683870161146a565b935060209150818501358181111561180e578384fd5b85019050601f81018613611820578283fd5b803561182e61148882611f11565b81815283810190838501865b84811015611863576118518b8884358901016114f1565b8452928601929086019060010161183a565b5096999098509650505050505050565b60008060408385031215611885578182fd5b82356001600160401b038082111561189b578384fd5b6118a78683870161146a565b93506020915081850135818111156118bd578384fd5b85019050601f810186136118cf578283fd5b80356118dd61148882611f11565b81815283810190838501865b84811015611863576119008b8884358901016114f1565b845292860192908601906001016118e9565b60008060408385031215611924578182fd5b82356001600160401b038082111561193a578384fd5b6119468683870161146a565b935060209150818501358181111561195c578384fd5b85019050601f8101861361196e578283fd5b803561197c61148882611f11565b81815283810190838501858402850186018a1015611998578687fd5b8694505b838510156117b457803583526001949094019391850191850161199c565b6000602082840312156119cb578081fd5b81358015158114611369578182fd5b6000602082840312156119eb578081fd5b5035919050565b6000815180845260208085019450808401835b83811015611a2a5781516001600160a01b031687529582019590820190600101611a05565b509495945050505050565b6000815180845260208085019450808401835b83811015611a2a57815187529582019590820190600101611a48565b60008151808452815b81811015611a8957602081850181015186830182015201611a6d565b81811115611a9a5782602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b0383168152604060208201819052600090611ad390830184611a64565b949350505050565b901515815260200190565b6001600160a01b0391909116815260200190565b6001600160a01b038416815260606020808301829052600091611b1f908401866119f2565b8381036040850152845180825282860191830190845b81811015611b53578351151583529284019291840191600101611b35565b509098975050505050505050565b6001600160a01b038416815260606020808301829052600091611b86908401866119f2565b838103604085015284518082528282019083810283018401848801865b83811015611bd157601f19868403018552611bbf838351611a64565b94870194925090860190600101611ba3565b50909a9950505050505050505050565b6001600160a01b038416815260606020808301829052600091611c06908401866119f2565b838103604085015284518082528282019083810283018401848801865b83811015611bd157601f19868403018552611c3f838351611a64565b94870194925090860190600101611c23565b6001600160a01b0384168152606060208201819052600090611c75908301856119f2565b8281036040840152611c878185611a35565b9695505050505050565b6001600160a01b038616815260a060208201819052600090611cb5908301876119f2565b8281036040840152611cc78187611a35565b8381036060850152611cd98187611a35565b925050508260808301529695505050505050565b6001600160a01b039290921682521515602082015260400190565b6001600160a01b03929092168252602082015260400190565b6000602082526113696020830184611a64565b60208082526010908201526f26bab9ba1031329037b832b930ba37b960811b604082015260600190565b602080825260159082015274082e4e4c2f240d8cadccee8d040dad2e6dac2e8c6d605b1b604082015260600190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b6020808252601e908201527f556e6578706563746564206e657720636f6d706f6e656e742061646465640000604082015260600190565b60208082526018908201527f43616e6e6f74206475706c69636174652063616c6c6572730000000000000000604082015260600190565b60208082526018908201527f4172726179206c656e677468206d757374206265203e20300000000000000000604082015260600190565b602080825260409082018190527f436f6d706f6e656e7473206172726179206d75737420626520657175616c206f908201527f72206c6f6e676572207468616e2063757272656e7420636f6d706f6e656e7473606082015260800190565b6020808252600a90820152694120697320656d70747960b01b604082015260600190565b6040518181016001600160401b0381118282101715611f0957600080fd5b604052919050565b60006001600160401b03821115611f26578081fd5b5060209081020190565b6001600160a01b038116811461076c57600080fdfea2646970667358221220a8c79524b12552b2808b9f2f46e0373bdc4ec2b3ceb71413db776372a41df67e64736f6c634300060a0033

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

0000000000000000000000000528a40435d0940f3759f6bbad3ebfd050211a2e00000000000000000000000084ce03ae547330f61584ad6103743732b1ae97c5

-----Decoded View---------------
Arg [0] : _manager (address): 0x0528A40435D0940f3759F6bBad3eBfD050211a2e
Arg [1] : _generalIndexModule (address): 0x84cE03AE547330f61584aD6103743732B1AE97C5

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000000528a40435d0940f3759f6bbad3ebfd050211a2e
Arg [1] : 00000000000000000000000084ce03ae547330f61584ad6103743732b1ae97c5


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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