ETH Price: $3,352.63 (+1.72%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
NAVIssuanceExtension

Compiler Version
v0.6.10+commit.00c0fcaf

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 15 : NAVIssuanceExtension.sol
/*
    Copyright 2022 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 {Address} from "@openzeppelin/contracts/utils/Address.sol";
import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol";

import {ISetToken} from "@setprotocol/set-protocol-v2/contracts/interfaces/ISetToken.sol";
import {INAVIssuanceModule} from "../../interfaces/INAVIssuanceModule.sol";
import {INAVIssuanceHook} from "../../interfaces/INAVIssuanceHook.sol";

import {PreciseUnitMath} from "@setprotocol/set-protocol-v2/contracts/lib/PreciseUnitMath.sol";

import {BaseGlobalExtension} from "../lib/BaseGlobalExtension.sol";
import {IDelegatedManager} from "../interfaces/IDelegatedManager.sol";
import {IManagerCore} from "../interfaces/IManagerCore.sol";

/**
 * @title IssuanceExtension
 * @author Set Protocol
 *
 * Smart contract global extension which provides DelegatedManager owner and methodologist the ability to accrue and split
 * issuance and redemption fees. Owner may configure the fee split percentages.
 *
 * Notes
 * - the fee split is set on the Delegated Manager contract
 * - when fees distributed via this contract will be inclusive of all fee types that have already been accrued
 */
contract NAVIssuanceExtension is BaseGlobalExtension {
    using Address for address;
    using PreciseUnitMath for uint256;
    using SafeMath for uint256;

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

    event IssuanceExtensionInitialized(
        address indexed _setToken,
        address indexed _delegatedManager
    );

    event FeesDistributed(
        address _setToken,
        address indexed _ownerFeeRecipient,
        address indexed _methodologist,
        uint256 _ownerTake,
        uint256 _methodologistTake
    );

    /* ============ State Variables ============ */
    struct NAVIssuanceSettings {
        INAVIssuanceHook managerIssuanceHook; // Issuance hook configurations
        INAVIssuanceHook managerRedemptionHook; // Redemption hook configurations
        address[] reserveAssets; // Allowed reserve assets - Must have a price enabled with the price oracle
        address feeRecipient; // Manager fee recipient
        uint256[2] managerFees; // Manager fees. 0 index is issue and 1 index is redeem fee (0.01% = 1e14, 1% = 1e16)
        uint256 maxManagerFee; // Maximum fee manager is allowed to set for issue and redeem
        uint256 premiumPercentage; // Premium percentage (0.01% = 1e14, 1% = 1e16). This premium is a buffer around oracle
        // prices paid by user to the SetToken, which prevents arbitrage and oracle front running
        uint256 maxPremiumPercentage; // Maximum premium percentage manager is allowed to set (configured by manager)
        uint256 minSetTokenSupply; // Minimum SetToken supply required for issuance and redemption
        // to prevent dramatic inflationary changes to the SetToken's position multiplier
    }
    // Instance of navIssuanceModule
    INAVIssuanceModule public immutable navIssuanceModule;

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

    constructor(
        IManagerCore _managerCore,
        INAVIssuanceModule _navIssuanceModule
    ) public BaseGlobalExtension(_managerCore) {
        navIssuanceModule = _navIssuanceModule;
    }

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

    /**
     * ANYONE CALLABLE: Distributes fees accrued to the DelegatedManager. Calculates fees for
     * owner and methodologist, and sends to owner fee recipient and methodologist respectively.
     */
    function distributeFees(ISetToken _setToken) public {
        IDelegatedManager delegatedManager = _manager(_setToken);

        uint256 totalFees = _setToken.balanceOf(address(delegatedManager));

        address methodologist = delegatedManager.methodologist();
        address ownerFeeRecipient = delegatedManager.ownerFeeRecipient();

        uint256 ownerTake = totalFees.preciseMul(
            delegatedManager.ownerFeeSplit()
        );
        uint256 methodologistTake = totalFees.sub(ownerTake);

        if (ownerTake > 0) {
            delegatedManager.transferTokens(
                address(_setToken),
                ownerFeeRecipient,
                ownerTake
            );
        }

        if (methodologistTake > 0) {
            delegatedManager.transferTokens(
                address(_setToken),
                methodologist,
                methodologistTake
            );
        }

        emit FeesDistributed(
            address(_setToken),
            ownerFeeRecipient,
            methodologist,
            ownerTake,
            methodologistTake
        );
    }

    function initializeModule(
        IDelegatedManager _delegatedManager,
        NAVIssuanceSettings memory _navIssuanceSettings
    ) external onlyOwnerAndValidManager(_delegatedManager) {
        require(
            _delegatedManager.isInitializedExtension(address(this)),
            "Extension must be initialized"
        );

        _initializeModule(
            _delegatedManager.setToken(),
            _delegatedManager,
            _navIssuanceSettings
        );
    }

    /**
     * ONLY OWNER: Initializes IssuanceExtension to the DelegatedManager.
     *
     * @param _delegatedManager     Instance of the DelegatedManager to initialize
     */
    function initializeExtension(IDelegatedManager _delegatedManager)
        external
        onlyOwnerAndValidManager(_delegatedManager)
    {
        require(
            _delegatedManager.isPendingExtension(address(this)),
            "Extension must be pending"
        );

        ISetToken setToken = _delegatedManager.setToken();

        _initializeExtension(setToken, _delegatedManager);

        emit IssuanceExtensionInitialized(
            address(setToken),
            address(_delegatedManager)
        );
    }

    function initializeModuleAndExtension(
        IDelegatedManager _delegatedManager,
        NAVIssuanceSettings memory _navIssuanceSettings
    ) external onlyOwnerAndValidManager(_delegatedManager) {
        require(
            _delegatedManager.isPendingExtension(address(this)),
            "Extension must be pending"
        );

        ISetToken setToken = _delegatedManager.setToken();

        _initializeExtension(setToken, _delegatedManager);
        _initializeModule(setToken, _delegatedManager, _navIssuanceSettings);

        emit IssuanceExtensionInitialized(
            address(setToken),
            address(_delegatedManager)
        );
    }

    /**
     * ONLY MANAGER: Remove an existing SetToken and DelegatedManager tracked by the IssuanceExtension
     */
    function removeExtension() external override {
        IDelegatedManager delegatedManager = IDelegatedManager(msg.sender);
        ISetToken setToken = delegatedManager.setToken();

        _removeExtension(setToken, delegatedManager);
    }

    function addReserveAsset(ISetToken _setToken, uint256 _reserveAsset)
        external
        onlyOwner(_setToken)
    {
        bytes memory callData = abi.encodeWithSelector(
            INAVIssuanceModule.addReserveAsset.selector,
            _setToken,
            _reserveAsset
        );
        _invokeManager(
            _manager(_setToken),
            address(navIssuanceModule),
            callData
        );
    }

    function removeReserveAsset(ISetToken _setToken, uint256 _reserveAsset)
        external
        onlyOwner(_setToken)
    {
        bytes memory callData = abi.encodeWithSelector(
            INAVIssuanceModule.removeReserveAsset.selector,
            _setToken,
            _reserveAsset
        );
        _invokeManager(
            _manager(_setToken),
            address(navIssuanceModule),
            callData
        );
    }

    function editPremium(ISetToken _setToken, uint256 _premiumPercentage)
        external
        onlyOwner(_setToken)
    {
        bytes memory callData = abi.encodeWithSelector(
            INAVIssuanceModule.editPremium.selector,
            _setToken,
            _premiumPercentage
        );
        _invokeManager(
            _manager(_setToken),
            address(navIssuanceModule),
            callData
        );
    }

    function editManagerFee(
        ISetToken _setToken,
        uint256 _managerFeePercentage,
        uint256 _managerFeeIndex
    ) external onlyOwner(_setToken) {
        bytes memory callData = abi.encodeWithSelector(
            INAVIssuanceModule.editManagerFee.selector,
            _setToken,
            _managerFeePercentage,
            _managerFeeIndex
        );
        _invokeManager(
            _manager(_setToken),
            address(navIssuanceModule),
            callData
        );
    }

    /**
     * ONLY OWNER: Updates fee recipient on navIssuanceModule
     *
     * @param _setToken         Instance of the SetToken to update fee recipient for
     * @param _newFeeRecipient  Address of new fee recipient. This should be the address of the DelegatedManager
     */
    function editFeeRecipient(ISetToken _setToken, address _newFeeRecipient)
        external
        onlyOwner(_setToken)
    {
        bytes memory callData = abi.encodeWithSelector(
            INAVIssuanceModule.editFeeRecipient.selector,
            _setToken,
            _newFeeRecipient
        );
        _invokeManager(
            _manager(_setToken),
            address(navIssuanceModule),
            callData
        );
    }

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

    function _initializeModule(
        ISetToken _setToken,
        IDelegatedManager _delegatedManager,
        NAVIssuanceSettings memory _navIssuanceSettings
    ) internal {
        bytes memory callData = abi.encodeWithSelector(
            INAVIssuanceModule.initialize.selector,
            _setToken,
            _navIssuanceSettings
        );
        _invokeManager(_delegatedManager, address(navIssuanceModule), callData);
    }
}

File 2 of 15 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2 <0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

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

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (bool success, ) = recipient.call{ value: amount }("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain`call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
      return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{ value: value }(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.staticcall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 3 of 15 : 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, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        uint256 c = a + b;
        if (c < a) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b > a) return (false, 0);
        return (true, a - b);
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, 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 (true, 0);
        uint256 c = a * b;
        if (c / a != b) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b == 0) return (false, 0);
        return (true, a / b);
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b == 0) return (false, 0);
        return (true, a % b);
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");
        return c;
    }

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

    /**
     * @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) {
        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, reverting 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) {
        require(b > 0, "SafeMath: division by zero");
        return a / b;
    }

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

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * 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);
        return a - b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryDiv}.
     *
     * 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);
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * 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 15 : ISetToken.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";

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

File 5 of 15 : INAVIssuanceModule.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 {ISetToken} from "./ISetToken.sol";
import {INAVIssuanceHook} from "./INAVIssuanceHook.sol";

interface INAVIssuanceModule {
    struct NAVIssuanceSettings {
        INAVIssuanceHook managerIssuanceHook; // Issuance hook configurations
        INAVIssuanceHook managerRedemptionHook; // Redemption hook configurations
        address[] reserveAssets; // Allowed reserve assets - Must have a price enabled with the price oracle
        address feeRecipient; // Manager fee recipient
        uint256[2] managerFees; // Manager fees. 0 index is issue and 1 index is redeem fee (0.01% = 1e14, 1% = 1e16)
        uint256 maxManagerFee; // Maximum fee manager is allowed to set for issue and redeem
        uint256 premiumPercentage; // Premium percentage (0.01% = 1e14, 1% = 1e16). This premium is a buffer around oracle
        // prices paid by user to the SetToken, which prevents arbitrage and oracle front running
        uint256 maxPremiumPercentage; // Maximum premium percentage manager is allowed to set (configured by manager)
        uint256 minSetTokenSupply; // Minimum SetToken supply required for issuance and redemption
        // to prevent dramatic inflationary changes to the SetToken's position multiplier
    }

    function initialize(
        ISetToken _setToken,
        NAVIssuanceSettings memory _navIssuanceSettings
    ) external;

    function issue(
        ISetToken _setToken,
        address _reserveAsset,
        uint256 _reserveAssetQuantity,
        uint256 _minSetTokenReceiveQuantity,
        address _to
    ) external;

    function redeem(
        ISetToken _setToken,
        address _reserveAsset,
        uint256 _setTokenQuantity,
        uint256 _minReserveReceiveQuantity,
        address _to
    ) external;

    function addReserveAsset(ISetToken _setToken, address _reserveAsset)
        external;

    function removeReserveAsset(ISetToken _setToken, address _reserveAsset)
        external;

    function editPremium(ISetToken _setToken, uint256 _premiumPercentage)
        external;

    function editManagerFee(
        ISetToken _setToken,
        uint256 _managerFeePercentage,
        uint256 _managerFeeIndex
    ) external;

    function editFeeRecipient(ISetToken _setToken, address _managerFeeRecipient)
        external;
}

File 6 of 15 : INAVIssuanceHook.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;

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

interface INAVIssuanceHook {
    function invokePreIssueHook(
        ISetToken _setToken,
        address _reserveAsset,
        uint256 _reserveAssetQuantity,
        address _sender,
        address _to
    )
        external;

    function invokePreRedeemHook(
        ISetToken _setToken,
        uint256 _redeemQuantity,
        address _sender,
        address _to
    )
        external;
}

File 7 of 15 : PreciseUnitMath.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 { SafeCast } from "@openzeppelin/contracts/utils/SafeCast.sol";
import { SafeMath } from "@openzeppelin/contracts/math/SafeMath.sol";
import { SignedSafeMath } from "@openzeppelin/contracts/math/SignedSafeMath.sol";


/**
 * @title PreciseUnitMath
 * @author Set Protocol
 *
 * Arithmetic for fixed-point numbers with 18 decimals of precision. Some functions taken from
 * dYdX's BaseMath library.
 *
 * CHANGELOG:
 * - 9/21/20: Added safePower function
 * - 4/21/21: Added approximatelyEquals function
 * - 12/13/21: Added preciseDivCeil (int overloads) function
 * - 12/13/21: Added abs function
 */
library PreciseUnitMath {
    using SafeMath for uint256;
    using SignedSafeMath for int256;
    using SafeCast for int256;

    // The number One in precise units.
    uint256 constant internal PRECISE_UNIT = 10 ** 18;
    int256 constant internal PRECISE_UNIT_INT = 10 ** 18;

    // Max unsigned integer value
    uint256 constant internal MAX_UINT_256 = type(uint256).max;
    // Max and min signed integer value
    int256 constant internal MAX_INT_256 = type(int256).max;
    int256 constant internal MIN_INT_256 = type(int256).min;

    /**
     * @dev Getter function since constants can't be read directly from libraries.
     */
    function preciseUnit() internal pure returns (uint256) {
        return PRECISE_UNIT;
    }

    /**
     * @dev Getter function since constants can't be read directly from libraries.
     */
    function preciseUnitInt() internal pure returns (int256) {
        return PRECISE_UNIT_INT;
    }

    /**
     * @dev Getter function since constants can't be read directly from libraries.
     */
    function maxUint256() internal pure returns (uint256) {
        return MAX_UINT_256;
    }

    /**
     * @dev Getter function since constants can't be read directly from libraries.
     */
    function maxInt256() internal pure returns (int256) {
        return MAX_INT_256;
    }

    /**
     * @dev Getter function since constants can't be read directly from libraries.
     */
    function minInt256() internal pure returns (int256) {
        return MIN_INT_256;
    }

    /**
     * @dev Multiplies value a by value b (result is rounded down). It's assumed that the value b is the significand
     * of a number with 18 decimals precision.
     */
    function preciseMul(uint256 a, uint256 b) internal pure returns (uint256) {
        return a.mul(b).div(PRECISE_UNIT);
    }

    /**
     * @dev Multiplies value a by value b (result is rounded towards zero). It's assumed that the value b is the
     * significand of a number with 18 decimals precision.
     */
    function preciseMul(int256 a, int256 b) internal pure returns (int256) {
        return a.mul(b).div(PRECISE_UNIT_INT);
    }

    /**
     * @dev Multiplies value a by value b (result is rounded up). It's assumed that the value b is the significand
     * of a number with 18 decimals precision.
     */
    function preciseMulCeil(uint256 a, uint256 b) internal pure returns (uint256) {
        if (a == 0 || b == 0) {
            return 0;
        }
        return a.mul(b).sub(1).div(PRECISE_UNIT).add(1);
    }

    /**
     * @dev Divides value a by value b (result is rounded down).
     */
    function preciseDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        return a.mul(PRECISE_UNIT).div(b);
    }


    /**
     * @dev Divides value a by value b (result is rounded towards 0).
     */
    function preciseDiv(int256 a, int256 b) internal pure returns (int256) {
        return a.mul(PRECISE_UNIT_INT).div(b);
    }

    /**
     * @dev Divides value a by value b (result is rounded up or away from 0).
     */
    function preciseDivCeil(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b != 0, "Cant divide by 0");

        return a > 0 ? a.mul(PRECISE_UNIT).sub(1).div(b).add(1) : 0;
    }

    /**
     * @dev Divides value a by value b (result is rounded up or away from 0). When `a` is 0, 0 is
     * returned. When `b` is 0, method reverts with divide-by-zero error.
     */
    function preciseDivCeil(int256 a, int256 b) internal pure returns (int256) {
        require(b != 0, "Cant divide by 0");
        
        a = a.mul(PRECISE_UNIT_INT);
        int256 c = a.div(b);

        if (a % b != 0) {
            // a ^ b == 0 case is covered by the previous if statement, hence it won't resolve to --c
            (a ^ b > 0) ? ++c : --c;
        }

        return c;
    }

    /**
     * @dev Divides value a by value b (result is rounded down - positive numbers toward 0 and negative away from 0).
     */
    function divDown(int256 a, int256 b) internal pure returns (int256) {
        require(b != 0, "Cant divide by 0");
        require(a != MIN_INT_256 || b != -1, "Invalid input");

        int256 result = a.div(b);
        if (a ^ b < 0 && a % b != 0) {
            result -= 1;
        }

        return result;
    }

    /**
     * @dev Multiplies value a by value b where rounding is towards the lesser number.
     * (positive values are rounded towards zero and negative values are rounded away from 0).
     */
    function conservativePreciseMul(int256 a, int256 b) internal pure returns (int256) {
        return divDown(a.mul(b), PRECISE_UNIT_INT);
    }

    /**
     * @dev Divides value a by value b where rounding is towards the lesser number.
     * (positive values are rounded towards zero and negative values are rounded away from 0).
     */
    function conservativePreciseDiv(int256 a, int256 b) internal pure returns (int256) {
        return divDown(a.mul(PRECISE_UNIT_INT), b);
    }

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

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

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

        return result;
    }

    /**
     * @dev Returns true if a =~ b within range, false otherwise.
     */
    function approximatelyEquals(uint256 a, uint256 b, uint256 range) internal pure returns (bool) {
        return a <= b.add(range) && a >= b.sub(range);
    }

    /**
     * Returns the absolute value of int256 `a` as a uint256
     */
    function abs(int256 a) internal pure returns (uint) {
        return a >= 0 ? a.toUint256() : a.mul(-1).toUint256();
    }

    /**
     * Returns the negation of a
     */
    function neg(int256 a) internal pure returns (int256) {
        require(a > MIN_INT_256, "Inversion overflow");
        return -a;
    }
}

File 8 of 15 : BaseGlobalExtension.sol
/*
    Copyright 2022 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;

import { AddressArrayUtils } from "@setprotocol/set-protocol-v2/contracts/lib/AddressArrayUtils.sol";
import { ISetToken } from "@setprotocol/set-protocol-v2/contracts/interfaces/ISetToken.sol";

import { IDelegatedManager } from "../interfaces/IDelegatedManager.sol";
import { IManagerCore } from "../interfaces/IManagerCore.sol";

/**
 * @title BaseGlobalExtension
 * @author Set Protocol
 *
 * Abstract class that houses common global extension-related functions. Global extensions must
 * also have their own initializeExtension function (not included here because interfaces will vary).
 */
abstract contract BaseGlobalExtension {
    using AddressArrayUtils for address[];

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

    event ExtensionRemoved(
        address indexed _setToken,
        address indexed _delegatedManager
    );

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

    // Address of the ManagerCore
    IManagerCore public immutable managerCore;

    // Mapping from Set Token to DelegatedManager
    mapping(ISetToken => IDelegatedManager) public setManagers;

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

    /**
     * Throws if the sender is not the SetToken manager contract owner
     */
    modifier onlyOwner(ISetToken _setToken) {
        require(msg.sender == _manager(_setToken).owner(), "Must be owner");
        _;
    }

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

    /**
     * Throws if the sender is not a SetToken operator
     */
    modifier onlyOperator(ISetToken _setToken) {
        require(_manager(_setToken).operatorAllowlist(msg.sender), "Must be approved operator");
        _;
    }

    /**
     * Throws if the sender is not the SetToken manager contract owner or if the manager is not enabled on the ManagerCore
     */
    modifier onlyOwnerAndValidManager(IDelegatedManager _delegatedManager) {
        require(msg.sender == _delegatedManager.owner(), "Must be owner");
        require(managerCore.isManager(address(_delegatedManager)), "Must be ManagerCore-enabled manager");
        _;
    }

    /**
     * Throws if asset is not allowed to be held by the Set
     */
    modifier onlyAllowedAsset(ISetToken _setToken, address _asset) {
        require(_manager(_setToken).isAllowedAsset(_asset), "Must be allowed asset");
        _;
    }

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

    /**
     * Set state variables
     *
     * @param _managerCore             Address of managerCore contract
     */
    constructor(IManagerCore _managerCore) public {
        managerCore = _managerCore;
    }

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

    /**
     * ONLY MANAGER: Deletes SetToken/Manager state from extension. Must only be callable by manager!
     */
    function removeExtension() external virtual;

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

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

    /**
     * Internal function to grab manager of passed SetToken from extensions data structure.
     *
     * @param _setToken         SetToken who's manager is needed
     */
    function _manager(ISetToken _setToken) internal view returns (IDelegatedManager) {
        return setManagers[_setToken];
    }

    /**
     * Internal function to initialize extension to the DelegatedManager.
     *
     * @param _setToken             Instance of the SetToken corresponding to the DelegatedManager
     * @param _delegatedManager     Instance of the DelegatedManager to initialize
     */
    function _initializeExtension(ISetToken _setToken, IDelegatedManager _delegatedManager) internal {
        setManagers[_setToken] = _delegatedManager;

        _delegatedManager.initializeExtension();
    }

    /**
     * ONLY MANAGER: Internal function to delete SetToken/Manager state from extension
     */
    function _removeExtension(ISetToken _setToken, IDelegatedManager _delegatedManager) internal {
        require(msg.sender == address(_manager(_setToken)), "Must be Manager");

        delete setManagers[_setToken];

        emit ExtensionRemoved(address(_setToken), address(_delegatedManager));
    }
}

File 9 of 15 : IDelegatedManager.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.

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

pragma solidity 0.6.10;
pragma experimental "ABIEncoderV2";

import { ISetToken } from "@setprotocol/set-protocol-v2/contracts/interfaces/ISetToken.sol";

interface IDelegatedManager {
    function interactManager(address _module, bytes calldata _encoded) external;

    function initializeExtension() external;

    function transferTokens(address _token, address _destination, uint256 _amount) external;

    function updateOwnerFeeSplit(uint256 _newFeeSplit) external;

    function updateOwnerFeeRecipient(address _newFeeRecipient) external;

    function setMethodologist(address _newMethodologist) external;

    function transferOwnership(address _owner) external;

    function setToken() external view returns(ISetToken);
    function owner() external view returns(address);
    function methodologist() external view returns(address);
    function operatorAllowlist(address _operator) external view returns(bool);
    function assetAllowlist(address _asset) external view returns(bool);
    function useAssetAllowlist() external view returns(bool);
    function isAllowedAsset(address _asset) external view returns(bool);
    function isPendingExtension(address _extension) external view returns(bool);
    function isInitializedExtension(address _extension) external view returns(bool);
    function getExtensions() external view returns(address[] memory);
    function getOperators() external view returns(address[] memory);
    function getAllowedAssets() external view returns(address[] memory);
    function ownerFeeRecipient() external view returns(address);
    function ownerFeeSplit() external view returns(uint256);
}

File 10 of 15 : IManagerCore.sol
/*
    Copyright 2022 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;

interface IManagerCore {
    function addManager(address _manager) external;
    function isExtension(address _extension) external view returns(bool);
    function isFactory(address _factory) external view returns(bool);
    function isManager(address _manager) external view returns(bool);
    function owner() external view returns(address);
}

File 11 of 15 : 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 12 of 15 : ISetToken.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";

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

File 13 of 15 : SafeCast.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;


/**
 * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow
 * checks.
 *
 * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can
 * easily result in undesired exploitation or bugs, since developers usually
 * assume that overflows raise errors. `SafeCast` restores this intuition by
 * reverting the transaction when such 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.
 *
 * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing
 * all math on `uint256` and `int256` and then downcasting.
 */
library SafeCast {

    /**
     * @dev Returns the downcasted uint128 from uint256, reverting on
     * overflow (when the input is greater than largest uint128).
     *
     * Counterpart to Solidity's `uint128` operator.
     *
     * Requirements:
     *
     * - input must fit into 128 bits
     */
    function toUint128(uint256 value) internal pure returns (uint128) {
        require(value < 2**128, "SafeCast: value doesn\'t fit in 128 bits");
        return uint128(value);
    }

    /**
     * @dev Returns the downcasted uint64 from uint256, reverting on
     * overflow (when the input is greater than largest uint64).
     *
     * Counterpart to Solidity's `uint64` operator.
     *
     * Requirements:
     *
     * - input must fit into 64 bits
     */
    function toUint64(uint256 value) internal pure returns (uint64) {
        require(value < 2**64, "SafeCast: value doesn\'t fit in 64 bits");
        return uint64(value);
    }

    /**
     * @dev Returns the downcasted uint32 from uint256, reverting on
     * overflow (when the input is greater than largest uint32).
     *
     * Counterpart to Solidity's `uint32` operator.
     *
     * Requirements:
     *
     * - input must fit into 32 bits
     */
    function toUint32(uint256 value) internal pure returns (uint32) {
        require(value < 2**32, "SafeCast: value doesn\'t fit in 32 bits");
        return uint32(value);
    }

    /**
     * @dev Returns the downcasted uint16 from uint256, reverting on
     * overflow (when the input is greater than largest uint16).
     *
     * Counterpart to Solidity's `uint16` operator.
     *
     * Requirements:
     *
     * - input must fit into 16 bits
     */
    function toUint16(uint256 value) internal pure returns (uint16) {
        require(value < 2**16, "SafeCast: value doesn\'t fit in 16 bits");
        return uint16(value);
    }

    /**
     * @dev Returns the downcasted uint8 from uint256, reverting on
     * overflow (when the input is greater than largest uint8).
     *
     * Counterpart to Solidity's `uint8` operator.
     *
     * Requirements:
     *
     * - input must fit into 8 bits.
     */
    function toUint8(uint256 value) internal pure returns (uint8) {
        require(value < 2**8, "SafeCast: value doesn\'t fit in 8 bits");
        return uint8(value);
    }

    /**
     * @dev Converts a signed int256 into an unsigned uint256.
     *
     * Requirements:
     *
     * - input must be greater than or equal to 0.
     */
    function toUint256(int256 value) internal pure returns (uint256) {
        require(value >= 0, "SafeCast: value must be positive");
        return uint256(value);
    }

    /**
     * @dev Returns the downcasted int128 from int256, reverting on
     * overflow (when the input is less than smallest int128 or
     * greater than largest int128).
     *
     * Counterpart to Solidity's `int128` operator.
     *
     * Requirements:
     *
     * - input must fit into 128 bits
     *
     * _Available since v3.1._
     */
    function toInt128(int256 value) internal pure returns (int128) {
        require(value >= -2**127 && value < 2**127, "SafeCast: value doesn\'t fit in 128 bits");
        return int128(value);
    }

    /**
     * @dev Returns the downcasted int64 from int256, reverting on
     * overflow (when the input is less than smallest int64 or
     * greater than largest int64).
     *
     * Counterpart to Solidity's `int64` operator.
     *
     * Requirements:
     *
     * - input must fit into 64 bits
     *
     * _Available since v3.1._
     */
    function toInt64(int256 value) internal pure returns (int64) {
        require(value >= -2**63 && value < 2**63, "SafeCast: value doesn\'t fit in 64 bits");
        return int64(value);
    }

    /**
     * @dev Returns the downcasted int32 from int256, reverting on
     * overflow (when the input is less than smallest int32 or
     * greater than largest int32).
     *
     * Counterpart to Solidity's `int32` operator.
     *
     * Requirements:
     *
     * - input must fit into 32 bits
     *
     * _Available since v3.1._
     */
    function toInt32(int256 value) internal pure returns (int32) {
        require(value >= -2**31 && value < 2**31, "SafeCast: value doesn\'t fit in 32 bits");
        return int32(value);
    }

    /**
     * @dev Returns the downcasted int16 from int256, reverting on
     * overflow (when the input is less than smallest int16 or
     * greater than largest int16).
     *
     * Counterpart to Solidity's `int16` operator.
     *
     * Requirements:
     *
     * - input must fit into 16 bits
     *
     * _Available since v3.1._
     */
    function toInt16(int256 value) internal pure returns (int16) {
        require(value >= -2**15 && value < 2**15, "SafeCast: value doesn\'t fit in 16 bits");
        return int16(value);
    }

    /**
     * @dev Returns the downcasted int8 from int256, reverting on
     * overflow (when the input is less than smallest int8 or
     * greater than largest int8).
     *
     * Counterpart to Solidity's `int8` operator.
     *
     * Requirements:
     *
     * - input must fit into 8 bits.
     *
     * _Available since v3.1._
     */
    function toInt8(int256 value) internal pure returns (int8) {
        require(value >= -2**7 && value < 2**7, "SafeCast: value doesn\'t fit in 8 bits");
        return int8(value);
    }

    /**
     * @dev Converts an unsigned uint256 into a signed int256.
     *
     * Requirements:
     *
     * - input must be less than or equal to maxInt256.
     */
    function toInt256(uint256 value) internal pure returns (int256) {
        require(value < 2**255, "SafeCast: value doesn't fit in an int256");
        return int256(value);
    }
}

File 14 of 15 : SignedSafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @title SignedSafeMath
 * @dev Signed math operations with safety checks that revert on error.
 */
library SignedSafeMath {
    int256 constant private _INT256_MIN = -2**255;

    /**
     * @dev Returns the multiplication of two signed integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(int256 a, int256 b) internal pure returns (int256) {
        // 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;
        }

        require(!(a == -1 && b == _INT256_MIN), "SignedSafeMath: multiplication overflow");

        int256 c = a * b;
        require(c / a == b, "SignedSafeMath: multiplication overflow");

        return c;
    }

    /**
     * @dev Returns the integer division of two signed 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(int256 a, int256 b) internal pure returns (int256) {
        require(b != 0, "SignedSafeMath: division by zero");
        require(!(b == -1 && a == _INT256_MIN), "SignedSafeMath: division overflow");

        int256 c = a / b;

        return c;
    }

    /**
     * @dev Returns the subtraction of two signed integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(int256 a, int256 b) internal pure returns (int256) {
        int256 c = a - b;
        require((b >= 0 && c <= a) || (b < 0 && c > a), "SignedSafeMath: subtraction overflow");

        return c;
    }

    /**
     * @dev Returns the addition of two signed integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(int256 a, int256 b) internal pure returns (int256) {
        int256 c = a + b;
        require((b >= 0 && c >= a) || (b < 0 && c < a), "SignedSafeMath: addition overflow");

        return c;
    }
}

File 15 of 15 : 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/21/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");
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract IManagerCore","name":"_managerCore","type":"address"},{"internalType":"contract INAVIssuanceModule","name":"_navIssuanceModule","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_setToken","type":"address"},{"indexed":true,"internalType":"address","name":"_delegatedManager","type":"address"}],"name":"ExtensionRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_setToken","type":"address"},{"indexed":true,"internalType":"address","name":"_ownerFeeRecipient","type":"address"},{"indexed":true,"internalType":"address","name":"_methodologist","type":"address"},{"indexed":false,"internalType":"uint256","name":"_ownerTake","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_methodologistTake","type":"uint256"}],"name":"FeesDistributed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_setToken","type":"address"},{"indexed":true,"internalType":"address","name":"_delegatedManager","type":"address"}],"name":"IssuanceExtensionInitialized","type":"event"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_reserveAsset","type":"uint256"}],"name":"addReserveAsset","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"}],"name":"distributeFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"address","name":"_newFeeRecipient","type":"address"}],"name":"editFeeRecipient","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_managerFeePercentage","type":"uint256"},{"internalType":"uint256","name":"_managerFeeIndex","type":"uint256"}],"name":"editManagerFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_premiumPercentage","type":"uint256"}],"name":"editPremium","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IDelegatedManager","name":"_delegatedManager","type":"address"}],"name":"initializeExtension","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IDelegatedManager","name":"_delegatedManager","type":"address"},{"components":[{"internalType":"contract INAVIssuanceHook","name":"managerIssuanceHook","type":"address"},{"internalType":"contract INAVIssuanceHook","name":"managerRedemptionHook","type":"address"},{"internalType":"address[]","name":"reserveAssets","type":"address[]"},{"internalType":"address","name":"feeRecipient","type":"address"},{"internalType":"uint256[2]","name":"managerFees","type":"uint256[2]"},{"internalType":"uint256","name":"maxManagerFee","type":"uint256"},{"internalType":"uint256","name":"premiumPercentage","type":"uint256"},{"internalType":"uint256","name":"maxPremiumPercentage","type":"uint256"},{"internalType":"uint256","name":"minSetTokenSupply","type":"uint256"}],"internalType":"struct NAVIssuanceExtension.NAVIssuanceSettings","name":"_navIssuanceSettings","type":"tuple"}],"name":"initializeModule","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IDelegatedManager","name":"_delegatedManager","type":"address"},{"components":[{"internalType":"contract INAVIssuanceHook","name":"managerIssuanceHook","type":"address"},{"internalType":"contract INAVIssuanceHook","name":"managerRedemptionHook","type":"address"},{"internalType":"address[]","name":"reserveAssets","type":"address[]"},{"internalType":"address","name":"feeRecipient","type":"address"},{"internalType":"uint256[2]","name":"managerFees","type":"uint256[2]"},{"internalType":"uint256","name":"maxManagerFee","type":"uint256"},{"internalType":"uint256","name":"premiumPercentage","type":"uint256"},{"internalType":"uint256","name":"maxPremiumPercentage","type":"uint256"},{"internalType":"uint256","name":"minSetTokenSupply","type":"uint256"}],"internalType":"struct NAVIssuanceExtension.NAVIssuanceSettings","name":"_navIssuanceSettings","type":"tuple"}],"name":"initializeModuleAndExtension","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"managerCore","outputs":[{"internalType":"contract IManagerCore","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"navIssuanceModule","outputs":[{"internalType":"contract INAVIssuanceModule","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"removeExtension","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_reserveAsset","type":"uint256"}],"name":"removeReserveAsset","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"","type":"address"}],"name":"setManagers","outputs":[{"internalType":"contract IDelegatedManager","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

60c06040523480156200001157600080fd5b5060405162001d5638038062001d56833981016040819052620000349162000053565b6001600160601b0319606092831b8116608052911b1660a052620000aa565b6000806040838503121562000066578182fd5b8251620000738162000091565b6020840151909250620000868162000091565b809150509250929050565b6001600160a01b0381168114620000a757600080fd5b50565b60805160601c60a05160601c611c69620000ed600039806102d4528061099f528061134d52508061047f52806107945280610f4252806112515250611c696000f3fe608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063322f1e271161008c578063c65c01c311610066578063c65c01c314610181578063de2236bd14610194578063df3fa714146101a7578063e4bc91b7146101ba576100cf565b8063322f1e27146101535780639413f25c1461015b578063b2dedb491461016e576100cf565b8063080b16f8146100d45780630e3af8ad146100e95780631a682e76146100fc57806320022b7e1461010f5780632b1fce911461011757806330c24ca014610140575b600080fd5b6100e76100e236600461177f565b6101c2565b005b6100e76100f73660046117b7565b6102ff565b6100e761010a366004611688565b6103c6565b6100e7610638565b61012a61012536600461166c565b6106c0565b60405161013791906118a1565b60405180910390f35b6100e761014e366004611688565b6106db565b61012a61099d565b6100e761016936600461166c565b6109c1565b6100e761017c3660046117b7565b610cfb565b6100e761018f3660046117b7565b610dc2565b6100e76101a236600461166c565b610e89565b6100e76101b53660046117e2565b61113f565b61012a61124f565b816101cc81611273565b6001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561020457600080fd5b505afa158015610218573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061023c9190611630565b6001600160a01b0316336001600160a01b0316146102755760405162461bcd60e51b815260040161026c90611af5565b60405180910390fd5b606063080b16f860e01b848460405160240161029292919061195d565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915290506102f96102d285611273565b7f000000000000000000000000000000000000000000000000000000000000000083611291565b50505050565b8161030981611273565b6001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561034157600080fd5b505afa158015610355573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103799190611630565b6001600160a01b0316336001600160a01b0316146103a95760405162461bcd60e51b815260040161026c90611af5565b6060630e3af8ad60e01b8484604051602401610292929190611a2b565b81806001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561040057600080fd5b505afa158015610414573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104389190611630565b6001600160a01b0316336001600160a01b0316146104685760405162461bcd60e51b815260040161026c90611af5565b60405163f3ae241560e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063f3ae2415906104b49084906004016118a1565b60206040518083038186803b1580156104cc57600080fd5b505afa1580156104e0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610504919061164c565b6105205760405162461bcd60e51b815260040161026c90611a44565b60405163d113368560e01b81526001600160a01b0384169063d11336859061054c9030906004016118a1565b60206040518083038186803b15801561056457600080fd5b505afa158015610578573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061059c919061164c565b6105b85760405162461bcd60e51b815260040161026c90611bbd565b610633836001600160a01b031663ed9cf58c6040518163ffffffff1660e01b815260040160206040518083038186803b1580156105f457600080fd5b505afa158015610608573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061062c9190611630565b84846112f6565b505050565b60003390506000816001600160a01b031663ed9cf58c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561067857600080fd5b505afa15801561068c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106b09190611630565b90506106bc8183611372565b5050565b6000602081905290815260409020546001600160a01b031681565b81806001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561071557600080fd5b505afa158015610729573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061074d9190611630565b6001600160a01b0316336001600160a01b03161461077d5760405162461bcd60e51b815260040161026c90611af5565b60405163f3ae241560e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063f3ae2415906107c99084906004016118a1565b60206040518083038186803b1580156107e157600080fd5b505afa1580156107f5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610819919061164c565b6108355760405162461bcd60e51b815260040161026c90611a44565b604051631f8e9d5160e31b81526001600160a01b0384169063fc74ea88906108619030906004016118a1565b60206040518083038186803b15801561087957600080fd5b505afa15801561088d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108b1919061164c565b6108cd5760405162461bcd60e51b815260040161026c90611b86565b6000836001600160a01b031663ed9cf58c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561090857600080fd5b505afa15801561091c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109409190611630565b905061094c8185611400565b6109578185856112f6565b836001600160a01b0316816001600160a01b03167f60d761969a2b25178abb98577ac823a5b690899d4f115da5d016126c9e8a7c1060405160405180910390a350505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b60006109cc82611273565b90506000826001600160a01b03166370a08231836040518263ffffffff1660e01b81526004016109fc91906118a1565b60206040518083038186803b158015610a1457600080fd5b505afa158015610a28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a4c9190611816565b90506000826001600160a01b0316639f8e67bf6040518163ffffffff1660e01b815260040160206040518083038186803b158015610a8957600080fd5b505afa158015610a9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac19190611630565b90506000836001600160a01b031663012a73886040518163ffffffff1660e01b815260040160206040518083038186803b158015610afe57600080fd5b505afa158015610b12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b369190611630565b90506000610bbb856001600160a01b0316634be738816040518163ffffffff1660e01b815260040160206040518083038186803b158015610b7657600080fd5b505afa158015610b8a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bae9190611816565b859063ffffffff61147c16565b90506000610bcf858363ffffffff6114af16565b90508115610c3a5760405163a64b6e5f60e01b81526001600160a01b0387169063a64b6e5f90610c07908a90879087906004016118b5565b600060405180830381600087803b158015610c2157600080fd5b505af1158015610c35573d6000803e3d6000fd5b505050505b8015610ca35760405163a64b6e5f60e01b81526001600160a01b0387169063a64b6e5f90610c70908a90889086906004016118b5565b600060405180830381600087803b158015610c8a57600080fd5b505af1158015610c9e573d6000803e3d6000fd5b505050505b836001600160a01b0316836001600160a01b03167f2956d503f579c8862273501aee27bc32b9ebced833e7769d7b9ce8ff6bc54936898585604051610cea9392919061193c565b60405180910390a350505050505050565b81610d0581611273565b6001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3d57600080fd5b505afa158015610d51573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d759190611630565b6001600160a01b0316336001600160a01b031614610da55760405162461bcd60e51b815260040161026c90611af5565b606063281d011560e01b8484604051602401610292929190611a2b565b81610dcc81611273565b6001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b158015610e0457600080fd5b505afa158015610e18573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e3c9190611630565b6001600160a01b0316336001600160a01b031614610e6c5760405162461bcd60e51b815260040161026c90611af5565b60606391819fb360e01b8484604051602401610292929190611a2b565b80806001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b158015610ec357600080fd5b505afa158015610ed7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610efb9190611630565b6001600160a01b0316336001600160a01b031614610f2b5760405162461bcd60e51b815260040161026c90611af5565b60405163f3ae241560e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063f3ae241590610f779084906004016118a1565b60206040518083038186803b158015610f8f57600080fd5b505afa158015610fa3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fc7919061164c565b610fe35760405162461bcd60e51b815260040161026c90611a44565b604051631f8e9d5160e31b81526001600160a01b0383169063fc74ea889061100f9030906004016118a1565b60206040518083038186803b15801561102757600080fd5b505afa15801561103b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061105f919061164c565b61107b5760405162461bcd60e51b815260040161026c90611b86565b6000826001600160a01b031663ed9cf58c6040518163ffffffff1660e01b815260040160206040518083038186803b1580156110b657600080fd5b505afa1580156110ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110ee9190611630565b90506110fa8184611400565b826001600160a01b0316816001600160a01b03167f60d761969a2b25178abb98577ac823a5b690899d4f115da5d016126c9e8a7c1060405160405180910390a3505050565b8261114981611273565b6001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561118157600080fd5b505afa158015611195573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111b99190611630565b6001600160a01b0316336001600160a01b0316146111e95760405162461bcd60e51b815260040161026c90611af5565b606063df3fa71460e01b8585856040516024016112089392919061193c565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915290506112486102d286611273565b5050505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b6001600160a01b039081166000908152602081905260409020541690565b604051634cf4f63b60e01b81526001600160a01b03841690634cf4f63b906112bf90859085906004016118d9565b600060405180830381600087803b1580156112d957600080fd5b505af11580156112ed573d6000803e3d6000fd5b50505050505050565b606063b98b603060e01b8483604051602401611313929190611977565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915290506102f9837f000000000000000000000000000000000000000000000000000000000000000083611291565b61137b82611273565b6001600160a01b0316336001600160a01b0316146113ab5760405162461bcd60e51b815260040161026c90611b1c565b6001600160a01b0380831660008181526020819052604080822080546001600160a01b031916905551928416927f6a87827eefdfa1b8651b66ff7c8c5b7e72436f627cd2ecd358b9eeada2e910349190a35050565b6001600160a01b0382811660009081526020819052604080822080546001600160a01b0319169385169384179055805163dc20f8bf60e01b8152905163dc20f8bf9260048084019391929182900301818387803b15801561146057600080fd5b505af1158015611474573d6000803e3d6000fd5b505050505050565b60006114a6670de0b6b3a764000061149a858563ffffffff6114d716565b9063ffffffff61151116565b90505b92915050565b6000828211156114d15760405162461bcd60e51b815260040161026c90611a87565b50900390565b6000826114e6575060006114a9565b828202828482816114f357fe5b04146114a65760405162461bcd60e51b815260040161026c90611b45565b60008082116115325760405162461bcd60e51b815260040161026c90611abe565b81838161153b57fe5b049392505050565b80356114a981611c1b565b600082601f83011261155e578081fd5b813567ffffffffffffffff811115611574578182fd5b6020808202611584828201611bf4565b838152935081840185830182870184018810156115a057600080fd5b600092505b848310156115cc5780356115b881611c1b565b8252600192909201919083019083016115a5565b505050505092915050565b600082601f8301126115e7578081fd5b6115f16040611bf4565b905080828460408501111561160557600080fd5b60005b6002811015611627578135835260209283019290910190600101611608565b50505092915050565b600060208284031215611641578081fd5b81516114a681611c1b565b60006020828403121561165d578081fd5b815180151581146114a6578182fd5b60006020828403121561167d578081fd5b81356114a681611c1b565b6000806040838503121561169a578081fd5b82356116a581611c1b565b9150602083013567ffffffffffffffff808211156116c1578283fd5b81850161014081880312156116d4578384fd5b61012092506116e283611bf4565b6116ec8883611543565b81526116fb8860208401611543565b6020820152604082013583811115611711578586fd5b61171d8982850161154e565b6040830152506117308860608401611543565b606082015261174288608084016115d7565b608082015260c082013560a082015260e082013560c082015261010092508282013560e08201528382013583820152809450505050509250929050565b60008060408385031215611791578182fd5b823561179c81611c1b565b915060208301356117ac81611c1b565b809150509250929050565b600080604083850312156117c9578182fd5b82356117d481611c1b565b946020939093013593505050565b6000806000606084860312156117f6578081fd5b833561180181611c1b565b95602085013595506040909401359392505050565b600060208284031215611827578081fd5b5051919050565b6001600160a01b03169052565b6000815180845260208085019450808401835b838110156118735781516001600160a01b03168752958201959082019060010161184e565b509495945050505050565b8060005b60028110156102f9578151845260209384019390910190600101611882565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b600060018060a01b038416825260206040818401528351806040850152825b81811015611914578581018301518582016060015282016118f8565b818111156119255783606083870101525b50601f01601f191692909201606001949350505050565b6001600160a01b039390931683526020830191909152604082015260600190565b6001600160a01b0392831681529116602082015260400190565b600060018060a01b03841682526040602083015261199960408301845161182e565b60208301516119ab606084018261182e565b5060408301516101408060808501526119c861018085018361183b565b606086015192506119dc60a086018461182e565b608086015192506119f060c086018461187e565b60a08601519250610100838187015260c087015161012087015260e08701518387015280870151610160870152508093505050509392505050565b6001600160a01b03929092168252602082015260400190565b60208082526023908201527f4d757374206265204d616e61676572436f72652d656e61626c6564206d616e6160408201526233b2b960e91b606082015260800190565b6020808252601e908201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604082015260600190565b6020808252601a908201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604082015260600190565b6020808252600d908201526c26bab9ba1031329037bbb732b960991b604082015260600190565b6020808252600f908201526e26bab9ba1031329026b0b730b3b2b960891b604082015260600190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6040820152607760f81b606082015260800190565b60208082526019908201527f457874656e73696f6e206d7573742062652070656e64696e6700000000000000604082015260600190565b6020808252601d908201527f457874656e73696f6e206d75737420626520696e697469616c697a6564000000604082015260600190565b60405181810167ffffffffffffffff81118282101715611c1357600080fd5b604052919050565b6001600160a01b0381168114611c3057600080fd5b5056fea2646970667358221220aa482641bc11d29abf31b7641690293719dcc1691db11f211a316d6bbdf2307b64736f6c634300060a0033000000000000000000000000bea48ca3aac57d570a9054cc374d2f01c2bc48ed00000000000000000000000090d7b52487997dca7e4b4f991ba66404321d7e3e

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063322f1e271161008c578063c65c01c311610066578063c65c01c314610181578063de2236bd14610194578063df3fa714146101a7578063e4bc91b7146101ba576100cf565b8063322f1e27146101535780639413f25c1461015b578063b2dedb491461016e576100cf565b8063080b16f8146100d45780630e3af8ad146100e95780631a682e76146100fc57806320022b7e1461010f5780632b1fce911461011757806330c24ca014610140575b600080fd5b6100e76100e236600461177f565b6101c2565b005b6100e76100f73660046117b7565b6102ff565b6100e761010a366004611688565b6103c6565b6100e7610638565b61012a61012536600461166c565b6106c0565b60405161013791906118a1565b60405180910390f35b6100e761014e366004611688565b6106db565b61012a61099d565b6100e761016936600461166c565b6109c1565b6100e761017c3660046117b7565b610cfb565b6100e761018f3660046117b7565b610dc2565b6100e76101a236600461166c565b610e89565b6100e76101b53660046117e2565b61113f565b61012a61124f565b816101cc81611273565b6001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561020457600080fd5b505afa158015610218573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061023c9190611630565b6001600160a01b0316336001600160a01b0316146102755760405162461bcd60e51b815260040161026c90611af5565b60405180910390fd5b606063080b16f860e01b848460405160240161029292919061195d565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915290506102f96102d285611273565b7f00000000000000000000000090d7b52487997dca7e4b4f991ba66404321d7e3e83611291565b50505050565b8161030981611273565b6001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561034157600080fd5b505afa158015610355573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103799190611630565b6001600160a01b0316336001600160a01b0316146103a95760405162461bcd60e51b815260040161026c90611af5565b6060630e3af8ad60e01b8484604051602401610292929190611a2b565b81806001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561040057600080fd5b505afa158015610414573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104389190611630565b6001600160a01b0316336001600160a01b0316146104685760405162461bcd60e51b815260040161026c90611af5565b60405163f3ae241560e01b81526001600160a01b037f000000000000000000000000bea48ca3aac57d570a9054cc374d2f01c2bc48ed169063f3ae2415906104b49084906004016118a1565b60206040518083038186803b1580156104cc57600080fd5b505afa1580156104e0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610504919061164c565b6105205760405162461bcd60e51b815260040161026c90611a44565b60405163d113368560e01b81526001600160a01b0384169063d11336859061054c9030906004016118a1565b60206040518083038186803b15801561056457600080fd5b505afa158015610578573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061059c919061164c565b6105b85760405162461bcd60e51b815260040161026c90611bbd565b610633836001600160a01b031663ed9cf58c6040518163ffffffff1660e01b815260040160206040518083038186803b1580156105f457600080fd5b505afa158015610608573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061062c9190611630565b84846112f6565b505050565b60003390506000816001600160a01b031663ed9cf58c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561067857600080fd5b505afa15801561068c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106b09190611630565b90506106bc8183611372565b5050565b6000602081905290815260409020546001600160a01b031681565b81806001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561071557600080fd5b505afa158015610729573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061074d9190611630565b6001600160a01b0316336001600160a01b03161461077d5760405162461bcd60e51b815260040161026c90611af5565b60405163f3ae241560e01b81526001600160a01b037f000000000000000000000000bea48ca3aac57d570a9054cc374d2f01c2bc48ed169063f3ae2415906107c99084906004016118a1565b60206040518083038186803b1580156107e157600080fd5b505afa1580156107f5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610819919061164c565b6108355760405162461bcd60e51b815260040161026c90611a44565b604051631f8e9d5160e31b81526001600160a01b0384169063fc74ea88906108619030906004016118a1565b60206040518083038186803b15801561087957600080fd5b505afa15801561088d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108b1919061164c565b6108cd5760405162461bcd60e51b815260040161026c90611b86565b6000836001600160a01b031663ed9cf58c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561090857600080fd5b505afa15801561091c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109409190611630565b905061094c8185611400565b6109578185856112f6565b836001600160a01b0316816001600160a01b03167f60d761969a2b25178abb98577ac823a5b690899d4f115da5d016126c9e8a7c1060405160405180910390a350505050565b7f00000000000000000000000090d7b52487997dca7e4b4f991ba66404321d7e3e81565b60006109cc82611273565b90506000826001600160a01b03166370a08231836040518263ffffffff1660e01b81526004016109fc91906118a1565b60206040518083038186803b158015610a1457600080fd5b505afa158015610a28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a4c9190611816565b90506000826001600160a01b0316639f8e67bf6040518163ffffffff1660e01b815260040160206040518083038186803b158015610a8957600080fd5b505afa158015610a9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac19190611630565b90506000836001600160a01b031663012a73886040518163ffffffff1660e01b815260040160206040518083038186803b158015610afe57600080fd5b505afa158015610b12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b369190611630565b90506000610bbb856001600160a01b0316634be738816040518163ffffffff1660e01b815260040160206040518083038186803b158015610b7657600080fd5b505afa158015610b8a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bae9190611816565b859063ffffffff61147c16565b90506000610bcf858363ffffffff6114af16565b90508115610c3a5760405163a64b6e5f60e01b81526001600160a01b0387169063a64b6e5f90610c07908a90879087906004016118b5565b600060405180830381600087803b158015610c2157600080fd5b505af1158015610c35573d6000803e3d6000fd5b505050505b8015610ca35760405163a64b6e5f60e01b81526001600160a01b0387169063a64b6e5f90610c70908a90889086906004016118b5565b600060405180830381600087803b158015610c8a57600080fd5b505af1158015610c9e573d6000803e3d6000fd5b505050505b836001600160a01b0316836001600160a01b03167f2956d503f579c8862273501aee27bc32b9ebced833e7769d7b9ce8ff6bc54936898585604051610cea9392919061193c565b60405180910390a350505050505050565b81610d0581611273565b6001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3d57600080fd5b505afa158015610d51573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d759190611630565b6001600160a01b0316336001600160a01b031614610da55760405162461bcd60e51b815260040161026c90611af5565b606063281d011560e01b8484604051602401610292929190611a2b565b81610dcc81611273565b6001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b158015610e0457600080fd5b505afa158015610e18573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e3c9190611630565b6001600160a01b0316336001600160a01b031614610e6c5760405162461bcd60e51b815260040161026c90611af5565b60606391819fb360e01b8484604051602401610292929190611a2b565b80806001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b158015610ec357600080fd5b505afa158015610ed7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610efb9190611630565b6001600160a01b0316336001600160a01b031614610f2b5760405162461bcd60e51b815260040161026c90611af5565b60405163f3ae241560e01b81526001600160a01b037f000000000000000000000000bea48ca3aac57d570a9054cc374d2f01c2bc48ed169063f3ae241590610f779084906004016118a1565b60206040518083038186803b158015610f8f57600080fd5b505afa158015610fa3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fc7919061164c565b610fe35760405162461bcd60e51b815260040161026c90611a44565b604051631f8e9d5160e31b81526001600160a01b0383169063fc74ea889061100f9030906004016118a1565b60206040518083038186803b15801561102757600080fd5b505afa15801561103b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061105f919061164c565b61107b5760405162461bcd60e51b815260040161026c90611b86565b6000826001600160a01b031663ed9cf58c6040518163ffffffff1660e01b815260040160206040518083038186803b1580156110b657600080fd5b505afa1580156110ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110ee9190611630565b90506110fa8184611400565b826001600160a01b0316816001600160a01b03167f60d761969a2b25178abb98577ac823a5b690899d4f115da5d016126c9e8a7c1060405160405180910390a3505050565b8261114981611273565b6001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561118157600080fd5b505afa158015611195573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111b99190611630565b6001600160a01b0316336001600160a01b0316146111e95760405162461bcd60e51b815260040161026c90611af5565b606063df3fa71460e01b8585856040516024016112089392919061193c565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915290506112486102d286611273565b5050505050565b7f000000000000000000000000bea48ca3aac57d570a9054cc374d2f01c2bc48ed81565b6001600160a01b039081166000908152602081905260409020541690565b604051634cf4f63b60e01b81526001600160a01b03841690634cf4f63b906112bf90859085906004016118d9565b600060405180830381600087803b1580156112d957600080fd5b505af11580156112ed573d6000803e3d6000fd5b50505050505050565b606063b98b603060e01b8483604051602401611313929190611977565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915290506102f9837f00000000000000000000000090d7b52487997dca7e4b4f991ba66404321d7e3e83611291565b61137b82611273565b6001600160a01b0316336001600160a01b0316146113ab5760405162461bcd60e51b815260040161026c90611b1c565b6001600160a01b0380831660008181526020819052604080822080546001600160a01b031916905551928416927f6a87827eefdfa1b8651b66ff7c8c5b7e72436f627cd2ecd358b9eeada2e910349190a35050565b6001600160a01b0382811660009081526020819052604080822080546001600160a01b0319169385169384179055805163dc20f8bf60e01b8152905163dc20f8bf9260048084019391929182900301818387803b15801561146057600080fd5b505af1158015611474573d6000803e3d6000fd5b505050505050565b60006114a6670de0b6b3a764000061149a858563ffffffff6114d716565b9063ffffffff61151116565b90505b92915050565b6000828211156114d15760405162461bcd60e51b815260040161026c90611a87565b50900390565b6000826114e6575060006114a9565b828202828482816114f357fe5b04146114a65760405162461bcd60e51b815260040161026c90611b45565b60008082116115325760405162461bcd60e51b815260040161026c90611abe565b81838161153b57fe5b049392505050565b80356114a981611c1b565b600082601f83011261155e578081fd5b813567ffffffffffffffff811115611574578182fd5b6020808202611584828201611bf4565b838152935081840185830182870184018810156115a057600080fd5b600092505b848310156115cc5780356115b881611c1b565b8252600192909201919083019083016115a5565b505050505092915050565b600082601f8301126115e7578081fd5b6115f16040611bf4565b905080828460408501111561160557600080fd5b60005b6002811015611627578135835260209283019290910190600101611608565b50505092915050565b600060208284031215611641578081fd5b81516114a681611c1b565b60006020828403121561165d578081fd5b815180151581146114a6578182fd5b60006020828403121561167d578081fd5b81356114a681611c1b565b6000806040838503121561169a578081fd5b82356116a581611c1b565b9150602083013567ffffffffffffffff808211156116c1578283fd5b81850161014081880312156116d4578384fd5b61012092506116e283611bf4565b6116ec8883611543565b81526116fb8860208401611543565b6020820152604082013583811115611711578586fd5b61171d8982850161154e565b6040830152506117308860608401611543565b606082015261174288608084016115d7565b608082015260c082013560a082015260e082013560c082015261010092508282013560e08201528382013583820152809450505050509250929050565b60008060408385031215611791578182fd5b823561179c81611c1b565b915060208301356117ac81611c1b565b809150509250929050565b600080604083850312156117c9578182fd5b82356117d481611c1b565b946020939093013593505050565b6000806000606084860312156117f6578081fd5b833561180181611c1b565b95602085013595506040909401359392505050565b600060208284031215611827578081fd5b5051919050565b6001600160a01b03169052565b6000815180845260208085019450808401835b838110156118735781516001600160a01b03168752958201959082019060010161184e565b509495945050505050565b8060005b60028110156102f9578151845260209384019390910190600101611882565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b600060018060a01b038416825260206040818401528351806040850152825b81811015611914578581018301518582016060015282016118f8565b818111156119255783606083870101525b50601f01601f191692909201606001949350505050565b6001600160a01b039390931683526020830191909152604082015260600190565b6001600160a01b0392831681529116602082015260400190565b600060018060a01b03841682526040602083015261199960408301845161182e565b60208301516119ab606084018261182e565b5060408301516101408060808501526119c861018085018361183b565b606086015192506119dc60a086018461182e565b608086015192506119f060c086018461187e565b60a08601519250610100838187015260c087015161012087015260e08701518387015280870151610160870152508093505050509392505050565b6001600160a01b03929092168252602082015260400190565b60208082526023908201527f4d757374206265204d616e61676572436f72652d656e61626c6564206d616e6160408201526233b2b960e91b606082015260800190565b6020808252601e908201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604082015260600190565b6020808252601a908201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604082015260600190565b6020808252600d908201526c26bab9ba1031329037bbb732b960991b604082015260600190565b6020808252600f908201526e26bab9ba1031329026b0b730b3b2b960891b604082015260600190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6040820152607760f81b606082015260800190565b60208082526019908201527f457874656e73696f6e206d7573742062652070656e64696e6700000000000000604082015260600190565b6020808252601d908201527f457874656e73696f6e206d75737420626520696e697469616c697a6564000000604082015260600190565b60405181810167ffffffffffffffff81118282101715611c1357600080fd5b604052919050565b6001600160a01b0381168114611c3057600080fd5b5056fea2646970667358221220aa482641bc11d29abf31b7641690293719dcc1691db11f211a316d6bbdf2307b64736f6c634300060a0033

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

000000000000000000000000bea48ca3aac57d570a9054cc374d2f01c2bc48ed00000000000000000000000090d7b52487997dca7e4b4f991ba66404321d7e3e

-----Decoded View---------------
Arg [0] : _managerCore (address): 0xBea48CA3AaC57D570a9054CC374D2F01c2Bc48Ed
Arg [1] : _navIssuanceModule (address): 0x90d7b52487997Dca7e4B4F991BA66404321D7e3e

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000bea48ca3aac57d570a9054cc374d2f01c2bc48ed
Arg [1] : 00000000000000000000000090d7b52487997dca7e4b4f991ba66404321d7e3e


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

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.