Contract 0x936Ffda1C892a7c65777b14C1D71fD2C79222099

Contract Overview

Balance:
0 Ether
Txn Hash Method
Block
From
To
Value
0xad54f6563d40083fd83ccd3e7664b7bf2754ba5b5eafb8b2180d6fb34c1817a9Delegate242348802021-04-12 22:43:2435 days 21 hrs ago0x69bdb276a17dd90f9d3a545944ccb20e593ae8e3 IN  0x936ffda1c892a7c65777b14c1d71fd2c792220990 Ether0.000620510
0xfd6932423b19c474a9950f4256a990d85c5b6a583628a7ca16641e407e0ba77aDelegate242348732021-04-12 22:42:2835 days 21 hrs ago0x69bdb276a17dd90f9d3a545944ccb20e593ae8e3 IN  0x936ffda1c892a7c65777b14c1d71fd2c792220990 Ether0.0008900410
0x8ecb4e28e3b004c0f7ddd4edbe573ccab4026bfcf8d7c44f9b0ed132628b9353Delegate242348282021-04-12 22:35:5635 days 21 hrs ago0x69bdb276a17dd90f9d3a545944ccb20e593ae8e3 IN  0x936ffda1c892a7c65777b14c1d71fd2c792220990 Ether0.0009018210
0x39734d8a704ef39b1f5b9dca2db8bdd0988a6cd01517433440c4dc1d54a0996aPropose221557652020-11-17 21:55:40181 days 22 hrs ago0x69bdb276a17dd90f9d3a545944ccb20e593ae8e3 IN  0x936ffda1c892a7c65777b14c1d71fd2c792220990 Ether0.01081339622
0x2166b51225f63d2b1101a677398cc4b807e2e5872ba19a45d851a7a350b0c867Register220865932020-11-13 20:57:36185 days 23 hrs ago0x69bdb276a17dd90f9d3a545944ccb20e593ae8e3 IN  0x936ffda1c892a7c65777b14c1d71fd2c792220990 Ether0.002413120
0x8954b618ced5979b313df8eb6929e04e59d556ae2ae0ede97ab0aff9129fbdb5Vote220865132020-11-13 20:52:00185 days 23 hrs ago0x69bdb276a17dd90f9d3a545944ccb20e593ae8e3 IN  0x936ffda1c892a7c65777b14c1d71fd2c792220990 Ether0.0027100820
0x2bd28c3c3087fe8c5456ac86fcec686d5c93206167a75d75c1d3c3d25f7b691eInitialize220865072020-11-13 20:51:36185 days 23 hrs ago0x69bdb276a17dd90f9d3a545944ccb20e593ae8e3 IN  0x936ffda1c892a7c65777b14c1d71fd2c792220990 Ether0.0013827220
0x8e6f9ed7125cff2d27a052bad16809978aab1a36bac6c42392925bacf5038481Revoke220864962020-11-13 20:50:48185 days 23 hrs ago0x69bdb276a17dd90f9d3a545944ccb20e593ae8e3 IN  0x936ffda1c892a7c65777b14c1d71fd2c792220990 Ether0.0018082820
0x936de432e62998111e5942c25312e95c1d18e325b8ddb68b2cd39b5232fc9643Vote220864912020-11-13 20:50:28185 days 23 hrs ago0x69bdb276a17dd90f9d3a545944ccb20e593ae8e3 IN  0x936ffda1c892a7c65777b14c1d71fd2c792220990 Ether0.000799720
0xd08e1be888d9275475f208cf3c50b7bbe8d86049c36059277468559d16ed7235Vote220864782020-11-13 20:49:36185 days 23 hrs ago0x69bdb276a17dd90f9d3a545944ccb20e593ae8e3 IN  0x936ffda1c892a7c65777b14c1d71fd2c792220990 Ether0.0014869420
0x2152cbd6290c913806ad33fbf51bddeb9bf4080dff1c96eb149bdac203f83922Vote220864672020-11-13 20:48:48185 days 23 hrs ago0x69bdb276a17dd90f9d3a545944ccb20e593ae8e3 IN  0x936ffda1c892a7c65777b14c1d71fd2c792220990 Ether0.0024600420
0x0ce1bc904d1b44c558d33f1d26e6ac7c11760cf2242428a32e9e504abf7c9416Vote220864632020-11-13 20:48:28185 days 23 hrs ago0x69bdb276a17dd90f9d3a545944ccb20e593ae8e3 IN  0x936ffda1c892a7c65777b14c1d71fd2c792220990 Ether0.001407720
0x26b3470c9106994b5b78fc3cba50b5c6e6384986a99e1a6999e2e330d73c335aPropose220864122020-11-13 20:44:52185 days 23 hrs ago0x69bdb276a17dd90f9d3a545944ccb20e593ae8e3 IN  0x936ffda1c892a7c65777b14c1d71fd2c792220990 Ether0.0098303620
0x330b98e2bf85d247e282a93a932f5082e1ead83c6a1453b58ce1ec95802cbe5cRegister220864072020-11-13 20:44:32185 days 23 hrs ago0x69bdb276a17dd90f9d3a545944ccb20e593ae8e3 IN  0x936ffda1c892a7c65777b14c1d71fd2c792220990 Ether0.002413120
0xf143a1193233aafebcfe6fa9e86a4b7a67bfd9edb227d1824576a19bf38f533aInitialize220863922020-11-13 20:43:28185 days 23 hrs ago0x69bdb276a17dd90f9d3a545944ccb20e593ae8e3 IN  0x936ffda1c892a7c65777b14c1d71fd2c792220990 Ether0.0013827220
0xbdb4a5cc9d956a8332b3c5c9026dd555e10d867e6783f7ee66b1e74d684a7e740x60806040220862572020-11-13 20:33:56185 days 23 hrs ago0x69bdb276a17dd90f9d3a545944ccb20e593ae8e3 IN  Contract Creation0 Ether0.0254958620
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0xad54f6563d40083fd83ccd3e7664b7bf2754ba5b5eafb8b2180d6fb34c1817a9242348802021-04-12 22:43:2435 days 21 hrs ago 0x936ffda1c892a7c65777b14c1d71fd2c79222099 0xea41f11c916813eda966a4e1a0b09c98c4bbc5550 Ether
0xad54f6563d40083fd83ccd3e7664b7bf2754ba5b5eafb8b2180d6fb34c1817a9242348802021-04-12 22:43:2435 days 21 hrs ago 0x936ffda1c892a7c65777b14c1d71fd2c79222099 0xd51c6b0ab3e9c8415404995ac5aa81f82c13dd040 Ether
0xad54f6563d40083fd83ccd3e7664b7bf2754ba5b5eafb8b2180d6fb34c1817a9242348802021-04-12 22:43:2435 days 21 hrs ago 0x936ffda1c892a7c65777b14c1d71fd2c79222099 0x28a87dcca3322f90b3a4ce80cee499869efdbf110 Ether
0xad54f6563d40083fd83ccd3e7664b7bf2754ba5b5eafb8b2180d6fb34c1817a9242348802021-04-12 22:43:2435 days 21 hrs ago 0x936ffda1c892a7c65777b14c1d71fd2c79222099 0x9048278ca7e874f9338e4898c436ab07aa4547010 Ether
0xad54f6563d40083fd83ccd3e7664b7bf2754ba5b5eafb8b2180d6fb34c1817a9242348802021-04-12 22:43:2435 days 21 hrs ago 0x936ffda1c892a7c65777b14c1d71fd2c79222099 0xea41f11c916813eda966a4e1a0b09c98c4bbc5550 Ether
0xad54f6563d40083fd83ccd3e7664b7bf2754ba5b5eafb8b2180d6fb34c1817a9242348802021-04-12 22:43:2435 days 21 hrs ago 0x936ffda1c892a7c65777b14c1d71fd2c79222099 0x9048278ca7e874f9338e4898c436ab07aa4547010 Ether
0xad54f6563d40083fd83ccd3e7664b7bf2754ba5b5eafb8b2180d6fb34c1817a9242348802021-04-12 22:43:2435 days 21 hrs ago 0x936ffda1c892a7c65777b14c1d71fd2c79222099 0xea41f11c916813eda966a4e1a0b09c98c4bbc5550 Ether
0xfd6932423b19c474a9950f4256a990d85c5b6a583628a7ca16641e407e0ba77a242348732021-04-12 22:42:2835 days 21 hrs ago 0x936ffda1c892a7c65777b14c1d71fd2c79222099 0xea41f11c916813eda966a4e1a0b09c98c4bbc5550 Ether
0xfd6932423b19c474a9950f4256a990d85c5b6a583628a7ca16641e407e0ba77a242348732021-04-12 22:42:2835 days 21 hrs ago 0x936ffda1c892a7c65777b14c1d71fd2c79222099 0xdd61b109780cb93eea404bf79964e4c588dbd1370 Ether
0xfd6932423b19c474a9950f4256a990d85c5b6a583628a7ca16641e407e0ba77a242348732021-04-12 22:42:2835 days 21 hrs ago 0x936ffda1c892a7c65777b14c1d71fd2c79222099 0x28a87dcca3322f90b3a4ce80cee499869efdbf110 Ether
0xfd6932423b19c474a9950f4256a990d85c5b6a583628a7ca16641e407e0ba77a242348732021-04-12 22:42:2835 days 21 hrs ago 0x936ffda1c892a7c65777b14c1d71fd2c79222099 0x9048278ca7e874f9338e4898c436ab07aa4547010 Ether
0xfd6932423b19c474a9950f4256a990d85c5b6a583628a7ca16641e407e0ba77a242348732021-04-12 22:42:2835 days 21 hrs ago 0x936ffda1c892a7c65777b14c1d71fd2c79222099 0xea41f11c916813eda966a4e1a0b09c98c4bbc5550 Ether
0xfd6932423b19c474a9950f4256a990d85c5b6a583628a7ca16641e407e0ba77a242348732021-04-12 22:42:2835 days 21 hrs ago 0x936ffda1c892a7c65777b14c1d71fd2c79222099 0x9048278ca7e874f9338e4898c436ab07aa4547010 Ether
0xfd6932423b19c474a9950f4256a990d85c5b6a583628a7ca16641e407e0ba77a242348732021-04-12 22:42:2835 days 21 hrs ago 0x936ffda1c892a7c65777b14c1d71fd2c79222099 0xea41f11c916813eda966a4e1a0b09c98c4bbc5550 Ether
0x8ecb4e28e3b004c0f7ddd4edbe573ccab4026bfcf8d7c44f9b0ed132628b9353242348282021-04-12 22:35:5635 days 21 hrs ago 0x936ffda1c892a7c65777b14c1d71fd2c79222099 0xea41f11c916813eda966a4e1a0b09c98c4bbc5550 Ether
0x8ecb4e28e3b004c0f7ddd4edbe573ccab4026bfcf8d7c44f9b0ed132628b9353242348282021-04-12 22:35:5635 days 21 hrs ago 0x936ffda1c892a7c65777b14c1d71fd2c79222099 0xf8c3d834198197bd3770ed791e2d35caf0acc8ce0 Ether
0x8ecb4e28e3b004c0f7ddd4edbe573ccab4026bfcf8d7c44f9b0ed132628b9353242348282021-04-12 22:35:5635 days 21 hrs ago 0x936ffda1c892a7c65777b14c1d71fd2c79222099 0x28a87dcca3322f90b3a4ce80cee499869efdbf110 Ether
0x8ecb4e28e3b004c0f7ddd4edbe573ccab4026bfcf8d7c44f9b0ed132628b9353242348282021-04-12 22:35:5635 days 21 hrs ago 0x936ffda1c892a7c65777b14c1d71fd2c79222099 0x9048278ca7e874f9338e4898c436ab07aa4547010 Ether
0x8ecb4e28e3b004c0f7ddd4edbe573ccab4026bfcf8d7c44f9b0ed132628b9353242348282021-04-12 22:35:5635 days 21 hrs ago 0x936ffda1c892a7c65777b14c1d71fd2c79222099 0xea41f11c916813eda966a4e1a0b09c98c4bbc5550 Ether
0x8ecb4e28e3b004c0f7ddd4edbe573ccab4026bfcf8d7c44f9b0ed132628b9353242348282021-04-12 22:35:5635 days 21 hrs ago 0x936ffda1c892a7c65777b14c1d71fd2c79222099 0x9048278ca7e874f9338e4898c436ab07aa4547010 Ether
0x8ecb4e28e3b004c0f7ddd4edbe573ccab4026bfcf8d7c44f9b0ed132628b9353242348282021-04-12 22:35:5635 days 21 hrs ago 0x936ffda1c892a7c65777b14c1d71fd2c79222099 0xea41f11c916813eda966a4e1a0b09c98c4bbc5550 Ether
0x39734d8a704ef39b1f5b9dca2db8bdd0988a6cd01517433440c4dc1d54a0996a221557652020-11-17 21:55:40181 days 22 hrs ago 0x936ffda1c892a7c65777b14c1d71fd2c79222099 0x1f3bd4c989b7ddfaf8b79e30814608fbf3f22ced0 Ether
0x39734d8a704ef39b1f5b9dca2db8bdd0988a6cd01517433440c4dc1d54a0996a221557652020-11-17 21:55:40181 days 22 hrs ago 0x936ffda1c892a7c65777b14c1d71fd2c79222099 0x0114e7a8acd073327270619abf00d50f9658fe400 Ether
0x39734d8a704ef39b1f5b9dca2db8bdd0988a6cd01517433440c4dc1d54a0996a221557652020-11-17 21:55:40181 days 22 hrs ago 0x936ffda1c892a7c65777b14c1d71fd2c79222099 0x28a87dcca3322f90b3a4ce80cee499869efdbf110 Ether
0x39734d8a704ef39b1f5b9dca2db8bdd0988a6cd01517433440c4dc1d54a0996a221557652020-11-17 21:55:40181 days 22 hrs ago 0x936ffda1c892a7c65777b14c1d71fd2c79222099 0x9048278ca7e874f9338e4898c436ab07aa4547010 Ether
[ Download CSV Export 
Loading

Contract Source Code Verified (Similar Match)
Note: This contract matches the deployed ByteCode of the Source Code for Contract 0xea35725f25c25bCD23c6BA36480399e7f1A4eAf3

Contract Name:
GovernanceModule

Compiler Version
v0.6.10+commit.00c0fcaf

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, Apache-2.0 license

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2020-11-13
*/

// Dependency file: @openzeppelin/contracts/utils/Address.sol



// pragma solidity ^0.6.2;

/**
 * @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) {
        // According to EIP-1052, 0x0 is the value returned for not-yet created accounts
        // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
        // for accounts without code, i.e. `keccak256('')`
        bytes32 codehash;
        bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
        // solhint-disable-next-line no-inline-assembly
        assembly { codehash := extcodehash(account) }
        return (codehash != accountHash && codehash != 0x0);
    }

    /**
     * @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");
        return _functionCallWithValue(target, data, value, errorMessage);
    }

    function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
        require(isContract(target), "Address: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
        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);
            }
        }
    }
}

// Dependency file: contracts/interfaces/ISetValuer.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.


*/
// pragma solidity 0.6.10;

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

interface ISetValuer {
    function calculateSetTokenValuation(ISetToken _setToken, address _quoteAsset) external view returns (uint256);
}
// Dependency file: contracts/interfaces/IPriceOracle.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.


*/
// pragma solidity 0.6.10;

/**
 * @title IPriceOracle
 * @author Set Protocol
 *
 * Interface for interacting with PriceOracle
 */
interface IPriceOracle {

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

    function getPrice(address _assetOne, address _assetTwo) external view returns (uint256);
    function masterQuoteAsset() external view returns (address);
}
// Dependency file: contracts/interfaces/IIntegrationRegistry.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.


*/
// pragma solidity 0.6.10;

interface IIntegrationRegistry {
    function addIntegration(address _module, string memory _id, address _wrapper) external;
    function getIntegrationAdapter(address _module, string memory _id) external view returns(address);
    function getIntegrationAdapterWithHash(address _module, bytes32 _id) external view returns(address);
    function isValidIntegration(address _module, string memory _id) external view returns(bool);
}
// Dependency file: @openzeppelin/contracts/math/SignedSafeMath.sol



// pragma solidity ^0.6.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;
    }
}

// Dependency file: @openzeppelin/contracts/token/ERC20/SafeERC20.sol



// pragma solidity ^0.6.0;

// import "./IERC20.sol";
// import "../../math/SafeMath.sol";
// import "../../utils/Address.sol";

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

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

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

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(IERC20 token, address spender, uint256 value) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        // solhint-disable-next-line max-line-length
        require((value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

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

    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) { // Return data is optional
            // solhint-disable-next-line max-line-length
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

// Dependency file: contracts/protocol/lib/ResourceIdentifier.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.


*/

// pragma solidity 0.6.10;

// import { IController } from "../../interfaces/IController.sol";
// import { IIntegrationRegistry } from "../../interfaces/IIntegrationRegistry.sol";
// import { IPriceOracle } from "../../interfaces/IPriceOracle.sol";
// import { ISetValuer } from "../../interfaces/ISetValuer.sol";

/**
 * @title ResourceIdentifier
 * @author Set Protocol
 *
 * A collection of utility functions to fetch information related to Resource contracts in the system
 */
library ResourceIdentifier {

    // IntegrationRegistry will always be resource ID 0 in the system
    uint256 constant internal INTEGRATION_REGISTRY_RESOURCE_ID = 0;
    // PriceOracle will always be resource ID 1 in the system
    uint256 constant internal PRICE_ORACLE_RESOURCE_ID = 1;
    // SetValuer resource will always be resource ID 2 in the system
    uint256 constant internal SET_VALUER_RESOURCE_ID = 2;

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

    /**
     * Gets the instance of integration registry stored on Controller. Note: IntegrationRegistry is stored as index 0 on
     * the Controller
     */
    function getIntegrationRegistry(IController _controller) internal view returns (IIntegrationRegistry) {
        return IIntegrationRegistry(_controller.resourceId(INTEGRATION_REGISTRY_RESOURCE_ID));
    }

    /**
     * Gets instance of price oracle on Controller. Note: PriceOracle is stored as index 1 on the Controller
     */
    function getPriceOracle(IController _controller) internal view returns (IPriceOracle) {
        return IPriceOracle(_controller.resourceId(PRICE_ORACLE_RESOURCE_ID));
    }

    /**
     * Gets the instance of Set valuer on Controller. Note: SetValuer is stored as index 2 on the Controller
     */
    function getSetValuer(IController _controller) internal view returns (ISetValuer) {
        return ISetValuer(_controller.resourceId(SET_VALUER_RESOURCE_ID));
    }
}
// Dependency file: contracts/lib/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.


*/

// pragma solidity 0.6.10;
// pragma experimental ABIEncoderV2;

// 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
 */
library PreciseUnitMath {
    using SafeMath for uint256;
    using SignedSafeMath 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 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;
    }
}
// Dependency file: contracts/interfaces/IModule.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.


*/
// pragma solidity 0.6.10;


/**
 * @title IModule
 * @author Set Protocol
 *
 * Interface for interacting with Modules.
 */
interface IModule {
    /**
     * Called by a SetToken to notify that this module was removed from the Set token. Any logic can be included
     * in case checks need to be made or state needs to be cleared.
     */
    function removeModule() external;
}
// Dependency file: contracts/lib/ExplicitERC20.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.


*/

// pragma solidity 0.6.10;

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

/**
 * @title ExplicitERC20
 * @author Set Protocol
 *
 * Utility functions for ERC20 transfers that require the explicit amount to be transferred.
 */
library ExplicitERC20 {
    using SafeMath for uint256;

    /**
     * When given allowance, transfers a token from the "_from" to the "_to" of quantity "_quantity".
     * Ensures that the recipient has received the correct quantity (ie no fees taken on transfer)
     *
     * @param _token           ERC20 token to approve
     * @param _from            The account to transfer tokens from
     * @param _to              The account to transfer tokens to
     * @param _quantity        The quantity to transfer
     */
    function transferFrom(
        IERC20 _token,
        address _from,
        address _to,
        uint256 _quantity
    )
        internal
    {
        // Call specified ERC20 contract to transfer tokens (via proxy).
        if (_quantity > 0) {
            uint256 existingBalance = _token.balanceOf(_to);

            SafeERC20.safeTransferFrom(
                _token,
                _from,
                _to,
                _quantity
            );

            uint256 newBalance = _token.balanceOf(_to);

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

// Dependency file: @openzeppelin/contracts/math/SafeMath.sol



// pragma solidity ^0.6.0;

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

        return c;
    }

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

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

        return c;
    }

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

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

        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return div(a, b, "SafeMath: division by zero");
    }

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

        return c;
    }

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

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

// Dependency file: @openzeppelin/contracts/token/ERC20/IERC20.sol



// pragma solidity ^0.6.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);
}

// Dependency file: contracts/protocol/lib/ModuleBase.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.


*/

// pragma solidity 0.6.10;

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

// import { ExplicitERC20 } from "../../lib/ExplicitERC20.sol";
// import { IController } from "../../interfaces/IController.sol";
// import { IModule } from "../../interfaces/IModule.sol";
// import { ISetToken } from "../../interfaces/ISetToken.sol";
// import { Invoke } from "./Invoke.sol";
// import { PreciseUnitMath } from "../../lib/PreciseUnitMath.sol";
// import { ResourceIdentifier } from "./ResourceIdentifier.sol";

/**
 * @title ModuleBase
 * @author Set Protocol
 *
 * Abstract class that houses common Module-related state and functions.
 */
abstract contract ModuleBase is IModule {
    using PreciseUnitMath for uint256;
    using Invoke for ISetToken;
    using ResourceIdentifier for IController;

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

    // Address of the controller
    IController public controller;

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

    modifier onlyManagerAndValidSet(ISetToken _setToken) { 
        require(isSetManager(_setToken, msg.sender), "Must be the SetToken manager");
        require(isSetValidAndInitialized(_setToken), "Must be a valid and initialized SetToken");
        _;
    }

    modifier onlySetManager(ISetToken _setToken, address _caller) {
        require(isSetManager(_setToken, _caller), "Must be the SetToken manager");
        _;
    }

    modifier onlyValidAndInitializedSet(ISetToken _setToken) {
        require(isSetValidAndInitialized(_setToken), "Must be a valid and initialized SetToken");
        _;
    }

    /**
     * Throws if the sender is not a SetToken's module or module not enabled
     */
    modifier onlyModule(ISetToken _setToken) {
        require(
            _setToken.moduleStates(msg.sender) == ISetToken.ModuleState.INITIALIZED,
            "Only the module can call"
        );

        require(
            controller.isModule(msg.sender),
            "Module must be enabled on controller"
        );
        _;
    }

    /**
     * Utilized during module initializations to check that the module is in pending state
     * and that the SetToken is valid
     */
    modifier onlyValidAndPendingSet(ISetToken _setToken) {
        require(controller.isSet(address(_setToken)), "Must be controller-enabled SetToken");
        require(isSetPendingInitialization(_setToken), "Must be pending initialization");        
        _;
    }

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

    /**
     * Set state variables and map asset pairs to their oracles
     *
     * @param _controller             Address of controller contract
     */
    constructor(IController _controller) public {
        controller = _controller;
    }

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

    /**
     * Transfers tokens from an address (that has set allowance on the module).
     *
     * @param  _token          The address of the ERC20 token
     * @param  _from           The address to transfer from
     * @param  _to             The address to transfer to
     * @param  _quantity       The number of tokens to transfer
     */
    function transferFrom(IERC20 _token, address _from, address _to, uint256 _quantity) internal {
        ExplicitERC20.transferFrom(_token, _from, _to, _quantity);
    }

    /**
     * Gets the integration for the module with the passed in name. Validates that the address is not empty
     */
    function getAndValidateAdapter(string memory _integrationName) internal view returns(address) { 
        bytes32 integrationHash = getNameHash(_integrationName);
        return getAndValidateAdapterWithHash(integrationHash);
    }

    /**
     * Gets the integration for the module with the passed in hash. Validates that the address is not empty
     */
    function getAndValidateAdapterWithHash(bytes32 _integrationHash) internal view returns(address) { 
        address adapter = controller.getIntegrationRegistry().getIntegrationAdapterWithHash(
            address(this),
            _integrationHash
        );

        require(adapter != address(0), "Must be valid adapter"); 
        return adapter;
    }

    /**
     * Gets the total fee for this module of the passed in index (fee % * quantity)
     */
    function getModuleFee(uint256 _feeIndex, uint256 _quantity) internal view returns(uint256) {
        uint256 feePercentage = controller.getModuleFee(address(this), _feeIndex);
        return _quantity.preciseMul(feePercentage);
    }

    /**
     * Pays the _feeQuantity from the _setToken denominated in _token to the protocol fee recipient
     */
    function payProtocolFeeFromSetToken(ISetToken _setToken, address _token, uint256 _feeQuantity) internal {
        if (_feeQuantity > 0) {
            _setToken.strictInvokeTransfer(_token, controller.feeRecipient(), _feeQuantity); 
        }
    }

    /**
     * Returns true if the module is in process of initialization on the SetToken
     */
    function isSetPendingInitialization(ISetToken _setToken) internal view returns(bool) {
        return _setToken.isPendingModule(address(this));
    }

    /**
     * Returns true if the address is the SetToken's manager
     */
    function isSetManager(ISetToken _setToken, address _toCheck) internal view returns(bool) {
        return _setToken.manager() == _toCheck;
    }

    /**
     * Returns true if SetToken must be enabled on the controller 
     * and module is registered on the SetToken
     */
    function isSetValidAndInitialized(ISetToken _setToken) internal view returns(bool) {
        return controller.isSet(address(_setToken)) &&
            _setToken.isInitializedModule(address(this));
    }

    /**
     * Hashes the string and returns a bytes32 value
     */
    function getNameHash(string memory _name) internal pure returns(bytes32) {
        return keccak256(bytes(_name));
    }
}
// Dependency file: contracts/interfaces/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.


*/
// 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);
}
// Dependency file: contracts/protocol/lib/Invoke.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.


*/

// pragma solidity 0.6.10;

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

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


/**
 * @title Invoke
 * @author Set Protocol
 *
 * A collection of common utility functions for interacting with the SetToken's invoke function
 */
library Invoke {
    using SafeMath for uint256;

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

    /**
     * Instructs the SetToken to set approvals of the ERC20 token to a spender.
     *
     * @param _setToken        SetToken instance to invoke
     * @param _token           ERC20 token to approve
     * @param _spender         The account allowed to spend the SetToken's balance
     * @param _quantity        The quantity of allowance to allow
     */
    function invokeApprove(
        ISetToken _setToken,
        address _token,
        address _spender,
        uint256 _quantity
    )
        internal
    {
        bytes memory callData = abi.encodeWithSignature("approve(address,uint256)", _spender, _quantity);
        _setToken.invoke(_token, 0, callData);
    }

    /**
     * Instructs the SetToken to transfer the ERC20 token to a recipient.
     *
     * @param _setToken        SetToken instance to invoke
     * @param _token           ERC20 token to transfer
     * @param _to              The recipient account
     * @param _quantity        The quantity to transfer
     */
    function invokeTransfer(
        ISetToken _setToken,
        address _token,
        address _to,
        uint256 _quantity
    )
        internal
    {
        if (_quantity > 0) {
            bytes memory callData = abi.encodeWithSignature("transfer(address,uint256)", _to, _quantity);
            _setToken.invoke(_token, 0, callData);
        }
    }

    /**
     * Instructs the SetToken to transfer the ERC20 token to a recipient.
     * The new SetToken balance must equal the existing balance less the quantity transferred
     *
     * @param _setToken        SetToken instance to invoke
     * @param _token           ERC20 token to transfer
     * @param _to              The recipient account
     * @param _quantity        The quantity to transfer
     */
    function strictInvokeTransfer(
        ISetToken _setToken,
        address _token,
        address _to,
        uint256 _quantity
    )
        internal
    {
        if (_quantity > 0) {
            // Retrieve current balance of token for the SetToken
            uint256 existingBalance = IERC20(_token).balanceOf(address(_setToken));

            Invoke.invokeTransfer(_setToken, _token, _to, _quantity);

            // Get new balance of transferred token for SetToken
            uint256 newBalance = IERC20(_token).balanceOf(address(_setToken));

            // Verify only the transfer quantity is subtracted
            require(
                newBalance == existingBalance.sub(_quantity),
                "Invalid post transfer balance"
            );
        }
    }

    /**
     * Instructs the SetToken to unwrap the passed quantity of WETH
     *
     * @param _setToken        SetToken instance to invoke
     * @param _weth            WETH address
     * @param _quantity        The quantity to unwrap
     */
    function invokeUnwrapWETH(ISetToken _setToken, address _weth, uint256 _quantity) internal {
        bytes memory callData = abi.encodeWithSignature("withdraw(uint256)", _quantity);
        _setToken.invoke(_weth, 0, callData);
    }

    /**
     * Instructs the SetToken to wrap the passed quantity of ETH
     *
     * @param _setToken        SetToken instance to invoke
     * @param _weth            WETH address
     * @param _quantity        The quantity to unwrap
     */
    function invokeWrapWETH(ISetToken _setToken, address _weth, uint256 _quantity) internal {
        bytes memory callData = abi.encodeWithSignature("deposit()");
        _setToken.invoke(_weth, _quantity, callData);
    }
}
// Dependency file: contracts/interfaces/IGovernanceAdapter.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.


*/
// pragma solidity 0.6.10;


/**
 * @title IGovernanceAdapter
 * @author Set Protocol
 */
interface IGovernanceAdapter {

    function getVoteCalldata(
        uint256 _proposalId,
        bool _support,
        bytes memory _data
    )
        external
        view
        returns (address _target, uint256 _value, bytes memory _calldata);

    function getDelegateCalldata(address _delegatee) external view returns (address _target, uint256 _value, bytes memory _calldata);

    function getRegisterCalldata(address _setToken) external view returns (address _target, uint256 _value, bytes memory _calldata);

    function getRevokeCalldata() external view returns (address _target, uint256 _value, bytes memory _calldata);

    function getProposeCalldata(bytes memory _proposalData) external view returns (address _target, uint256 _value, bytes memory _calldata);
}
// Dependency file: contracts/interfaces/IController.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.


*/
// pragma solidity 0.6.10;

interface IController {
    function addSet(address _setToken) external;
    function feeRecipient() external view returns(address);
    function getModuleFee(address _module, uint256 _feeType) external view returns(uint256);
    function isModule(address _module) external view returns(bool);
    function isSet(address _setToken) external view returns(bool);
    function isSystemContract(address _contractAddress) external view returns (bool);
    function resourceId(uint256 _id) external view returns(address);
}
// Dependency file: @openzeppelin/contracts/utils/ReentrancyGuard.sol



// pragma solidity ^0.6.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor () internal {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and make it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;

        _;

        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
}

/*
    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.


*/

pragma solidity 0.6.10;
pragma experimental "ABIEncoderV2";

// import { ReentrancyGuard } from "@openzeppelin/contracts/utils/ReentrancyGuard.sol";

// import { IController } from "../../interfaces/IController.sol";
// import { IGovernanceAdapter } from "../../interfaces/IGovernanceAdapter.sol";
// import { Invoke } from "../lib/Invoke.sol";
// import { ISetToken } from "../../interfaces/ISetToken.sol";
// import { ModuleBase } from "../lib/ModuleBase.sol";


/**
 * @title GovernanceModule
 * @author Set Protocol
 *
 * A smart contract module that enables participating in governance of component tokens held in the SetToken.
 * Examples of intended protocols include Compound, Uniswap, and Maker governance. 
 */
contract GovernanceModule is ModuleBase, ReentrancyGuard {
    using Invoke for ISetToken;

    /* ============ Events ============ */
    event ProposalVoted(
        ISetToken indexed _setToken,
        IGovernanceAdapter indexed _governanceAdapter,
        uint256 indexed _proposalId,
        bool _support
    );

    event VoteDelegated(
        ISetToken indexed _setToken,
        IGovernanceAdapter indexed _governanceAdapter,
        address _delegatee
    );

    event ProposalCreated(
        ISetToken indexed _setToken,
        IGovernanceAdapter indexed _governanceAdapter,
        bytes _proposalData
    );

    event RegistrationSubmitted(
        ISetToken indexed _setToken,
        IGovernanceAdapter indexed _governanceAdapter
    );

    event RegistrationRevoked(
        ISetToken indexed _setToken,
        IGovernanceAdapter indexed _governanceAdapter
    );

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

    constructor(IController _controller) public ModuleBase(_controller) {}

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

    /**
     * SET MANAGER ONLY. Delegate voting power to an Ethereum address. Note: for some governance adapters, delegating to self is
     * equivalent to registering and delegating to zero address is revoking right to vote.
     *
     * @param _setToken                 Address of SetToken
     * @param _governanceName           Human readable name of integration (e.g. COMPOUND) stored in the IntegrationRegistry
     * @param _delegatee                Address of delegatee
     */
    function delegate(
        ISetToken _setToken,
        string memory _governanceName,
        address _delegatee
    )
        external
        nonReentrant
        onlyManagerAndValidSet(_setToken)
    {
        IGovernanceAdapter governanceAdapter = IGovernanceAdapter(getAndValidateAdapter(_governanceName));

        (
            address targetExchange,
            uint256 callValue,
            bytes memory methodData
        ) = governanceAdapter.getDelegateCalldata(_delegatee);

        _setToken.invoke(targetExchange, callValue, methodData);

        emit VoteDelegated(_setToken, governanceAdapter, _delegatee);
    }

    /**
     * SET MANAGER ONLY. Create a new proposal for a specified governance protocol.
     *
     * @param _setToken                 Address of SetToken
     * @param _governanceName           Human readable name of integration (e.g. COMPOUND) stored in the IntegrationRegistry
     * @param _proposalData             Byte data of proposal to pass into governance adapter
     */
    function propose(
        ISetToken _setToken,
        string memory _governanceName,
        bytes memory _proposalData
    )
        external
        nonReentrant
        onlyManagerAndValidSet(_setToken)
    {
        IGovernanceAdapter governanceAdapter = IGovernanceAdapter(getAndValidateAdapter(_governanceName));

        (
            address targetExchange,
            uint256 callValue,
            bytes memory methodData
        ) = governanceAdapter.getProposeCalldata(_proposalData);

        _setToken.invoke(targetExchange, callValue, methodData);

        emit ProposalCreated(_setToken, governanceAdapter, _proposalData);
    }

    /**
     * SET MANAGER ONLY. Register for voting for the SetToken
     *
     * @param _setToken                 Address of SetToken
     * @param _governanceName           Human readable name of integration (e.g. COMPOUND) stored in the IntegrationRegistry
     */
    function register(
        ISetToken _setToken,
        string memory _governanceName
    )
        external
        nonReentrant
        onlyManagerAndValidSet(_setToken)
    {
        IGovernanceAdapter governanceAdapter = IGovernanceAdapter(getAndValidateAdapter(_governanceName));

        (
            address targetExchange,
            uint256 callValue,
            bytes memory methodData
        ) = governanceAdapter.getRegisterCalldata(address(_setToken));

        _setToken.invoke(targetExchange, callValue, methodData);

        emit RegistrationSubmitted(_setToken, governanceAdapter);
    }

    /**
     * SET MANAGER ONLY. Revoke voting for the SetToken
     *
     * @param _setToken                 Address of SetToken
     * @param _governanceName           Human readable name of integration (e.g. COMPOUND) stored in the IntegrationRegistry
     */
    function revoke(
        ISetToken _setToken,
        string memory _governanceName
    )
        external
        nonReentrant
        onlyManagerAndValidSet(_setToken)
    {
        IGovernanceAdapter governanceAdapter = IGovernanceAdapter(getAndValidateAdapter(_governanceName));

        (
            address targetExchange,
            uint256 callValue,
            bytes memory methodData
        ) = governanceAdapter.getRevokeCalldata();

        _setToken.invoke(targetExchange, callValue, methodData);

        emit RegistrationRevoked(_setToken, governanceAdapter);
    }

    /**
     * SET MANAGER ONLY. Cast vote for a specific governance token held in the SetToken. Manager specifies whether to vote for or against
     * a given proposal
     *
     * @param _setToken                 Address of SetToken
     * @param _governanceName           Human readable name of integration (e.g. COMPOUND) stored in the IntegrationRegistry
     * @param _proposalId               ID of the proposal to vote on
     * @param _support                  Boolean indicating whether to support proposal
     * @param _data                     Arbitrary bytes to be used to construct vote call data
     */
    function vote(
        ISetToken _setToken,
        string memory _governanceName,
        uint256 _proposalId,
        bool _support,
        bytes memory _data
    )
        external
        nonReentrant
        onlyManagerAndValidSet(_setToken)
    {
        IGovernanceAdapter governanceAdapter = IGovernanceAdapter(getAndValidateAdapter(_governanceName));

        (
            address targetExchange,
            uint256 callValue,
            bytes memory methodData
        ) = governanceAdapter.getVoteCalldata(
            _proposalId,
            _support,
            _data
        );

        _setToken.invoke(targetExchange, callValue, methodData);

        emit ProposalVoted(_setToken, governanceAdapter, _proposalId, _support);
    }

    /**
     * Initializes this module to the SetToken. Only callable by the SetToken's manager.
     *
     * @param _setToken             Instance of the SetToken to issue
     */
    function initialize(ISetToken _setToken) external onlySetManager(_setToken, msg.sender) onlyValidAndPendingSet(_setToken) {
        _setToken.initializeModule();
    }

    /**
     * Removes this module from the SetToken, via call by the SetToken.
     */
    function removeModule() external override {}
}

Contract ABI

[{"inputs":[{"internalType":"contract IController","name":"_controller","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"indexed":true,"internalType":"contract IGovernanceAdapter","name":"_governanceAdapter","type":"address"},{"indexed":false,"internalType":"bytes","name":"_proposalData","type":"bytes"}],"name":"ProposalCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"indexed":true,"internalType":"contract IGovernanceAdapter","name":"_governanceAdapter","type":"address"},{"indexed":true,"internalType":"uint256","name":"_proposalId","type":"uint256"},{"indexed":false,"internalType":"bool","name":"_support","type":"bool"}],"name":"ProposalVoted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"indexed":true,"internalType":"contract IGovernanceAdapter","name":"_governanceAdapter","type":"address"}],"name":"RegistrationRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"indexed":true,"internalType":"contract IGovernanceAdapter","name":"_governanceAdapter","type":"address"}],"name":"RegistrationSubmitted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"indexed":true,"internalType":"contract IGovernanceAdapter","name":"_governanceAdapter","type":"address"},{"indexed":false,"internalType":"address","name":"_delegatee","type":"address"}],"name":"VoteDelegated","type":"event"},{"inputs":[],"name":"controller","outputs":[{"internalType":"contract IController","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"string","name":"_governanceName","type":"string"},{"internalType":"address","name":"_delegatee","type":"address"}],"name":"delegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"string","name":"_governanceName","type":"string"},{"internalType":"bytes","name":"_proposalData","type":"bytes"}],"name":"propose","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"string","name":"_governanceName","type":"string"}],"name":"register","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"removeModule","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"string","name":"_governanceName","type":"string"}],"name":"revoke","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"string","name":"_governanceName","type":"string"},{"internalType":"uint256","name":"_proposalId","type":"uint256"},{"internalType":"bool","name":"_support","type":"bool"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"vote","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b506040516115e73803806115e783398101604081905261002f91610058565b600080546001600160a01b0319166001600160a01b039290921691909117905560018055610086565b600060208284031215610069578081fd5b81516001600160a01b038116811461007f578182fd5b9392505050565b611552806100956000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c8063c4d66de81161005b578063c4d66de8146100d0578063cfec8387146100e3578063dff85651146100f6578063f77c47911461010957610088565b806332434a2e1461008d57806340493ccf146100a2578063847ef08d146100b5578063afd0224b146100bd575b600080fd5b6100a061009b3660046110a0565b610127565b005b6100a06100b03660046110ee565b610310565b6100a06104fc565b6100a06100cb3660046110a0565b6104fe565b6100a06100de366004611084565b6106d3565b6100a06100f13660046111b9565b610815565b6100a0610104366004611150565b610a08565b610111610bde565b60405161011e9190611277565b60405180910390f35b600260015414156101535760405162461bcd60e51b815260040161014a9061141a565b60405180910390fd5b6002600155816101638133610bed565b61017f5760405162461bcd60e51b815260040161014a906113e3565b61018881610c7b565b6101a45760405162461bcd60e51b815260040161014a906112f2565b60006101af83610d85565b90506000806060836001600160a01b031663d3da53a4886040518263ffffffff1660e01b81526004016101e29190611277565b60006040518083038186803b1580156101fa57600080fd5b505afa15801561020e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526102369190810190610fd5565b925092509250866001600160a01b0316638f6f03328484846040518463ffffffff1660e01b815260040161026c939291906112a4565b600060405180830381600087803b15801561028657600080fd5b505af115801561029a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526102c29190810190611049565b50836001600160a01b0316876001600160a01b03167f28c85356595a6d26a36a8ea64f43fe31fa3ef9c786b5566f80d3d560af3b3a5560405160405180910390a35050600180555050505050565b600260015414156103335760405162461bcd60e51b815260040161014a9061141a565b6002600155826103438133610bed565b61035f5760405162461bcd60e51b815260040161014a906113e3565b61036881610c7b565b6103845760405162461bcd60e51b815260040161014a906112f2565b600061038f84610d85565b90506000806060836001600160a01b031663d0ae50ae876040518263ffffffff1660e01b81526004016103c29190611277565b60006040518083038186803b1580156103da57600080fd5b505afa1580156103ee573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526104169190810190610fd5565b925092509250876001600160a01b0316638f6f03328484846040518463ffffffff1660e01b815260040161044c939291906112a4565b600060405180830381600087803b15801561046657600080fd5b505af115801561047a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526104a29190810190611049565b50836001600160a01b0316886001600160a01b03167f8220b2caa6f0c2c2582472ceea7af3ea32209fc927b466237da9e2c8c4e6553b886040516104e69190611277565b60405180910390a3505060018055505050505050565b565b600260015414156105215760405162461bcd60e51b815260040161014a9061141a565b6002600155816105318133610bed565b61054d5760405162461bcd60e51b815260040161014a906113e3565b61055681610c7b565b6105725760405162461bcd60e51b815260040161014a906112f2565b600061057d83610d85565b90506000806060836001600160a01b031663d5abba996040518163ffffffff1660e01b815260040160006040518083038186803b1580156105bd57600080fd5b505afa1580156105d1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526105f99190810190610fd5565b925092509250866001600160a01b0316638f6f03328484846040518463ffffffff1660e01b815260040161062f939291906112a4565b600060405180830381600087803b15801561064957600080fd5b505af115801561065d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526106859190810190611049565b50836001600160a01b0316876001600160a01b03167f287dbe06a6a5acbe985b65078dde5d39ac24d2fd58391bb292b8ef1d08e572f660405160405180910390a35050600180555050505050565b80336106df8282610bed565b6106fb5760405162461bcd60e51b815260040161014a906113e3565b600054604051631d3af8fb60e21b815284916001600160a01b0316906374ebe3ec9061072b908490600401611277565b60206040518083038186803b15801561074357600080fd5b505afa158015610757573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061077b919061102d565b6107975760405162461bcd60e51b815260040161014a906113a0565b6107a081610da3565b6107bc5760405162461bcd60e51b815260040161014a9061133a565b836001600160a01b0316630ffe0f1e6040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156107f757600080fd5b505af115801561080b573d6000803e3d6000fd5b5050505050505050565b600260015414156108385760405162461bcd60e51b815260040161014a9061141a565b6002600155846108488133610bed565b6108645760405162461bcd60e51b815260040161014a906113e3565b61086d81610c7b565b6108895760405162461bcd60e51b815260040161014a906112f2565b600061089486610d85565b90506000806060836001600160a01b031663a4fed2ce8989896040518463ffffffff1660e01b81526004016108cb9392919061145a565b60006040518083038186803b1580156108e357600080fd5b505afa1580156108f7573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261091f9190810190610fd5565b925092509250896001600160a01b0316638f6f03328484846040518463ffffffff1660e01b8152600401610955939291906112a4565b600060405180830381600087803b15801561096f57600080fd5b505af1158015610983573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526109ab9190810190611049565b5087846001600160a01b03168b6001600160a01b03167fdbfb5295f66731a3476998db46423492cb33fe683f68d98ab13b1a8f922873138a6040516109f091906112d4565b60405180910390a45050600180555050505050505050565b60026001541415610a2b5760405162461bcd60e51b815260040161014a9061141a565b600260015582610a3b8133610bed565b610a575760405162461bcd60e51b815260040161014a906113e3565b610a6081610c7b565b610a7c5760405162461bcd60e51b815260040161014a906112f2565b6000610a8784610d85565b90506000806060836001600160a01b0316635cb8b5e3876040518263ffffffff1660e01b8152600401610aba91906112df565b60006040518083038186803b158015610ad257600080fd5b505afa158015610ae6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610b0e9190810190610fd5565b925092509250876001600160a01b0316638f6f03328484846040518463ffffffff1660e01b8152600401610b44939291906112a4565b600060405180830381600087803b158015610b5e57600080fd5b505af1158015610b72573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610b9a9190810190611049565b50836001600160a01b0316886001600160a01b03167f97960511614a09205f5794e634a82aa9063a669eed5833c847cb423962e9e305886040516104e691906112df565b6000546001600160a01b031681565b6000816001600160a01b0316836001600160a01b031663481c6a756040518163ffffffff1660e01b815260040160206040518083038186803b158015610c3257600080fd5b505afa158015610c46573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c6a9190610fb9565b6001600160a01b0316149392505050565b60008054604051631d3af8fb60e21b81526001600160a01b03909116906374ebe3ec90610cac908590600401611277565b60206040518083038186803b158015610cc457600080fd5b505afa158015610cd8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cfc919061102d565b8015610d7f57506040516335fc6c9f60e21b81526001600160a01b0383169063d7f1b27c90610d2f903090600401611277565b60206040518083038186803b158015610d4757600080fd5b505afa158015610d5b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d7f919061102d565b92915050565b600080610d9183610dd2565b9050610d9c81610ddd565b9392505050565b6040516353bae5f760e01b81526000906001600160a01b038316906353bae5f790610d2f903090600401611277565b805160209091012090565b600080548190610df5906001600160a01b0316610e9a565b6001600160a01b031663e6d642c530856040518363ffffffff1660e01b8152600401610e2292919061128b565b60206040518083038186803b158015610e3a57600080fd5b505afa158015610e4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e729190610fb9565b90506001600160a01b038116610d7f5760405162461bcd60e51b815260040161014a90611371565b6040516373b2e76b60e11b81526000906001600160a01b0383169063e765ced690610ec9908490600401611451565b60206040518083038186803b158015610ee157600080fd5b505afa158015610ef5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d7f9190610fb9565b600082601f830112610f29578081fd5b8135610f3c610f37826114a2565b61147b565b9150808252836020828501011115610f5357600080fd5b8060208401602084013760009082016020015292915050565b600082601f830112610f7c578081fd5b8151610f8a610f37826114a2565b9150808252836020828501011115610fa157600080fd5b610fb28160208401602086016114c6565b5092915050565b600060208284031215610fca578081fd5b8151610d9c816114f6565b600080600060608486031215610fe9578182fd5b8351610ff4816114f6565b60208501516040860151919450925067ffffffffffffffff811115611017578182fd5b61102386828701610f6c565b9150509250925092565b60006020828403121561103e578081fd5b8151610d9c8161150e565b60006020828403121561105a578081fd5b815167ffffffffffffffff811115611070578182fd5b61107c84828501610f6c565b949350505050565b600060208284031215611095578081fd5b8135610d9c816114f6565b600080604083850312156110b2578182fd5b82356110bd816114f6565b9150602083013567ffffffffffffffff8111156110d8578182fd5b6110e485828601610f19565b9150509250929050565b600080600060608486031215611102578283fd5b833561110d816114f6565b9250602084013567ffffffffffffffff811115611128578283fd5b61113486828701610f19565b9250506040840135611145816114f6565b809150509250925092565b600080600060608486031215611164578283fd5b833561116f816114f6565b9250602084013567ffffffffffffffff8082111561118b578384fd5b61119787838801610f19565b935060408601359150808211156111ac578283fd5b5061102386828701610f19565b600080600080600060a086880312156111d0578081fd5b85356111db816114f6565b9450602086013567ffffffffffffffff808211156111f7578283fd5b61120389838a01610f19565b9550604088013594506060880135915061121c8261150e565b90925060808701359080821115611231578283fd5b5061123e88828901610f19565b9150509295509295909350565b600081518084526112638160208601602086016114c6565b601f01601f19169290920160200192915050565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b600060018060a01b0385168252836020830152606060408301526112cb606083018461124b565b95945050505050565b901515815260200190565b600060208252610d9c602083018461124b565b60208082526028908201527f4d75737420626520612076616c696420616e6420696e697469616c697a65642060408201526729b2ba2a37b5b2b760c11b606082015260800190565b6020808252601e908201527f4d7573742062652070656e64696e6720696e697469616c697a6174696f6e0000604082015260600190565b60208082526015908201527426bab9ba103132903b30b634b21030b230b83a32b960591b604082015260600190565b60208082526023908201527f4d75737420626520636f6e74726f6c6c65722d656e61626c656420536574546f60408201526235b2b760e91b606082015260800190565b6020808252601c908201527f4d7573742062652074686520536574546f6b656e206d616e6167657200000000604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b90815260200190565b60008482528315156020830152606060408301526112cb606083018461124b565b60405181810167ffffffffffffffff8111828210171561149a57600080fd5b604052919050565b600067ffffffffffffffff8211156114b8578081fd5b50601f01601f191660200190565b60005b838110156114e15781810151838201526020016114c9565b838111156114f0576000848401525b50505050565b6001600160a01b038116811461150b57600080fd5b50565b801515811461150b57600080fdfea2646970667358221220bae650404747503565dcef680704e29e95557b5e7069bbf4798c199ba766c8c264736f6c634300060a00330000000000000000000000009048278ca7e874f9338e4898c436ab07aa454701

Deployed ByteCode Sourcemap

60828:7047:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;64440:627;;;;;;;;;:::i;:::-;;62437:652;;;;;;;;;:::i;67828:44::-;;;:::i;65345:603::-;;;;;;;;;:::i;67560:169::-;;;;;;;;;:::i;66588:777::-;;;;;;;;;:::i;63490:666::-;;;;;;;;;:::i;38220:29::-;;;:::i;:::-;;;;;;;;;;;;;;;;64440:627;58516:1;59122:7;;:19;;59114:63;;;;-1:-1:-1;;;59114:63:0;;;;;;;;;;;;;;;;;58516:1;59255:7;:18;64607:9;38380:35:::1;64607:9:::0;38404:10:::1;38380:12;:35::i;:::-;38372:76;;;;-1:-1:-1::0;;;38372:76:0::1;;;;;;;;;38467:35;38492:9;38467:24;:35::i;:::-;38459:88;;;;-1:-1:-1::0;;;38459:88:0::1;;;;;;;;;64634:36:::2;64692:38;64714:15;64692:21;:38::i;:::-;64634:97;;64759:22;64796:17:::0;64828:23:::2;64865:17;-1:-1:-1::0;;;;;64865:37:0::2;;64911:9;64865:57;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;;;;;;::::0;;::::2;-1:-1:-1::0;;64865:57:0::2;::::0;::::2;;::::0;::::2;::::0;;;::::2;::::0;::::2;;;64744:178;;;;;;64935:9;-1:-1:-1::0;;;;;64935:16:0::2;;64952:14;64968:9;64979:10;64935:55;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;;;;;;::::0;;::::2;-1:-1:-1::0;;64935:55:0::2;::::0;::::2;;::::0;::::2;::::0;;;::::2;::::0;::::2;;;;65041:17;-1:-1:-1::0;;;;;65008:51:0::2;65030:9;-1:-1:-1::0;;;;;65008:51:0::2;;;;;;;;;;;-1:-1:-1::0;;58472:1:0;59434:22;;-1:-1:-1;;;;;64440:627:0:o;62437:652::-;58516:1;59122:7;;:19;;59114:63;;;;-1:-1:-1;;;59114:63:0;;;;;;;;;58516:1;59255:7;:18;62633:9;38380:35:::1;62633:9:::0;38404:10:::1;38380:12;:35::i;:::-;38372:76;;;;-1:-1:-1::0;;;38372:76:0::1;;;;;;;;;38467:35;38492:9;38467:24;:35::i;:::-;38459:88;;;;-1:-1:-1::0;;;38459:88:0::1;;;;;;;;;62660:36:::2;62718:38;62740:15;62718:21;:38::i;:::-;62660:97;;62785:22;62822:17:::0;62854:23:::2;62891:17;-1:-1:-1::0;;;;;62891:37:0::2;;62929:10;62891:49;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;;;;;;::::0;;::::2;-1:-1:-1::0;;62891:49:0::2;::::0;::::2;;::::0;::::2;::::0;;;::::2;::::0;::::2;;;62770:170;;;;;;62953:9;-1:-1:-1::0;;;;;62953:16:0::2;;62970:14;62986:9;62997:10;62953:55;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;;;;;;::::0;;::::2;-1:-1:-1::0;;62953:55:0::2;::::0;::::2;;::::0;::::2;::::0;;;::::2;::::0;::::2;;;;63051:17;-1:-1:-1::0;;;;;63026:55:0::2;63040:9;-1:-1:-1::0;;;;;63026:55:0::2;;63070:10;63026:55;;;;;;;;;;;;;;;-1:-1:-1::0;;58472:1:0;59434:22;;-1:-1:-1;;;;;;62437:652:0:o;67828:44::-;:::o;65345:603::-;58516:1;59122:7;;:19;;59114:63;;;;-1:-1:-1;;;59114:63:0;;;;;;;;;58516:1;59255:7;:18;65510:9;38380:35:::1;65510:9:::0;38404:10:::1;38380:12;:35::i;:::-;38372:76;;;;-1:-1:-1::0;;;38372:76:0::1;;;;;;;;;38467:35;38492:9;38467:24;:35::i;:::-;38459:88;;;;-1:-1:-1::0;;;38459:88:0::1;;;;;;;;;65537:36:::2;65595:38;65617:15;65595:21;:38::i;:::-;65537:97;;65662:22;65699:17:::0;65731:23:::2;65768:17;-1:-1:-1::0;;;;;65768:35:0::2;;:37;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;;;;;;::::0;;::::2;-1:-1:-1::0;;65768:37:0::2;::::0;::::2;;::::0;::::2;::::0;;;::::2;::::0;::::2;;;65647:158;;;;;;65818:9;-1:-1:-1::0;;;;;65818:16:0::2;;65835:14;65851:9;65862:10;65818:55;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;;;;;;::::0;;::::2;-1:-1:-1::0;;65818:55:0::2;::::0;::::2;;::::0;::::2;::::0;;;::::2;::::0;::::2;;;;65922:17;-1:-1:-1::0;;;;;65891:49:0::2;65911:9;-1:-1:-1::0;;;;;65891:49:0::2;;;;;;;;;;;-1:-1:-1::0;;58472:1:0;59434:22;;-1:-1:-1;;;;;65345:603:0:o;67560:169::-;67625:9;67636:10;38656:32;38669:9;38680:7;38656:12;:32::i;:::-;38648:73;;;;-1:-1:-1;;;38648:73:0;;;;;;;;;39605:10:::1;::::0;:36:::1;::::0;-1:-1:-1;;;39605:36:0;;67671:9;;-1:-1:-1;;;;;39605:10:0::1;::::0;:16:::1;::::0;:36:::1;::::0;67671:9;;39605:36:::1;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;39597:84;;;;-1:-1:-1::0;;;39597:84:0::1;;;;;;;;;39700:37;39727:9;39700:26;:37::i;:::-;39692:80;;;;-1:-1:-1::0;;;39692:80:0::1;;;;;;;;;67693:9:::2;-1:-1:-1::0;;;;;67693:26:0::2;;:28;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;::::0;::::2;;;;;;;;;38732:1:::1;67560:169:::0;;;:::o;66588:777::-;58516:1;59122:7;;:19;;59114:63;;;;-1:-1:-1;;;59114:63:0;;;;;;;;;58516:1;59255:7;:18;66834:9;38380:35:::1;66834:9:::0;38404:10:::1;38380:12;:35::i;:::-;38372:76;;;;-1:-1:-1::0;;;38372:76:0::1;;;;;;;;;38467:35;38492:9;38467:24;:35::i;:::-;38459:88;;;;-1:-1:-1::0;;;38459:88:0::1;;;;;;;;;66861:36:::2;66919:38;66941:15;66919:21;:38::i;:::-;66861:97;;66986:22;67023:17:::0;67055:23:::2;67092:17;-1:-1:-1::0;;;;;67092:33:0::2;;67140:11;67166:8;67189:5;67092:113;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;;;;;;::::0;;::::2;-1:-1:-1::0;;67092:113:0::2;::::0;::::2;;::::0;::::2;::::0;;;::::2;::::0;::::2;;;66971:234;;;;;;67218:9;-1:-1:-1::0;;;;;67218:16:0::2;;67235:14;67251:9;67262:10;67218:55;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;;;;;;::::0;;::::2;-1:-1:-1::0;;67218:55:0::2;::::0;::::2;;::::0;::::2;::::0;;;::::2;::::0;::::2;;;;67335:11;67316:17;-1:-1:-1::0;;;;;67291:66:0::2;67305:9;-1:-1:-1::0;;;;;67291:66:0::2;;67348:8;67291:66;;;;;;;;;;;;;;;-1:-1:-1::0;;58472:1:0;59434:22;;-1:-1:-1;;;;;;;;66588:777:0:o;63490:666::-;58516:1;59122:7;;:19;;59114:63;;;;-1:-1:-1;;;59114:63:0;;;;;;;;;58516:1;59255:7;:18;63693:9;38380:35:::1;63693:9:::0;38404:10:::1;38380:12;:35::i;:::-;38372:76;;;;-1:-1:-1::0;;;38372:76:0::1;;;;;;;;;38467:35;38492:9;38467:24;:35::i;:::-;38459:88;;;;-1:-1:-1::0;;;38459:88:0::1;;;;;;;;;63720:36:::2;63778:38;63800:15;63778:21;:38::i;:::-;63720:97;;63845:22;63882:17:::0;63914:23:::2;63951:17;-1:-1:-1::0;;;;;63951:36:0::2;;63988:13;63951:51;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;;;;;;::::0;;::::2;-1:-1:-1::0;;63951:51:0::2;::::0;::::2;;::::0;::::2;::::0;;;::::2;::::0;::::2;;;63830:172;;;;;;64015:9;-1:-1:-1::0;;;;;64015:16:0::2;;64032:14;64048:9;64059:10;64015:55;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;;;;;;::::0;;::::2;-1:-1:-1::0;;64015:55:0::2;::::0;::::2;;::::0;::::2;::::0;;;::::2;::::0;::::2;;;;64115:17;-1:-1:-1::0;;;;;64088:60:0::2;64104:9;-1:-1:-1::0;;;;;64088:60:0::2;;64134:13;64088:60;;;;;;;38220:29:::0;;;-1:-1:-1;;;;;38220:29:0;;:::o;42636:146::-;42719:4;42766:8;-1:-1:-1;;;;;42743:31:0;:9;-1:-1:-1;;;;;42743:17:0;;:19;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;42743:31:0;;;42636:146;-1:-1:-1;;;42636:146:0:o;42925:206::-;43002:4;43026:10;;:36;;-1:-1:-1;;;43026:36:0;;-1:-1:-1;;;;;43026:10:0;;;;:16;;:36;;43051:9;;43026:36;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:97;;;;-1:-1:-1;43079:44:0;;-1:-1:-1;;;43079:44:0;;-1:-1:-1;;;;;43079:29:0;;;;;:44;;43117:4;;43079:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;43019:104;42925:206;-1:-1:-1;;42925:206:0:o;40832:233::-;40917:7;40938:23;40964:29;40976:16;40964:11;:29::i;:::-;40938:55;;41011:46;41041:15;41011:29;:46::i;:::-;41004:53;40832:233;-1:-1:-1;;;40832:233:0:o;42397:151::-;42500:40;;-1:-1:-1;;;42500:40:0;;42476:4;;-1:-1:-1;;;;;42500:25:0;;;;;:40;;42534:4;;42500:40;;;;43211:122;43302:23;;;;;;;;43211:122::o;41200:363::-;41287:7;41326:10;;41287:7;;41326:35;;-1:-1:-1;;;;;41326:10:0;:33;:35::i;:::-;-1:-1:-1;;;;;41326:65:0;;41414:4;41434:16;41326:135;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;41308:153;-1:-1:-1;;;;;;41482:21:0;;41474:55;;;;-1:-1:-1;;;41474:55:0;;;;;;;;17848:206;17989:56;;-1:-1:-1;;;17989:56:0;;17928:20;;-1:-1:-1;;;;;17989:22:0;;;;;:56;;17928:20;;17989:56;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;550:440:-1;;651:3;644:4;636:6;632:17;628:27;618:2;;-1:-1;;659:12;618:2;706:6;693:20;728:64;743:48;784:6;743:48;;;728:64;;;719:73;;812:6;805:5;798:21;916:3;848:4;907:6;840;898:16;;895:25;892:2;;;933:1;;923:12;892:2;17732:6;848:4;840:6;836:17;848:4;874:5;870:16;17709:30;17788:1;17770:16;;;848:4;17770:16;17763:27;874:5;611:379;-1:-1;;611:379;999:442;;1111:3;1104:4;1096:6;1092:17;1088:27;1078:2;;-1:-1;;1119:12;1078:2;1159:6;1153:13;1181:64;1196:48;1237:6;1196:48;;1181:64;1172:73;;1265:6;1258:5;1251:21;1369:3;1301:4;1360:6;1293;1351:16;;1348:25;1345:2;;;1386:1;;1376:12;1345:2;1396:39;1428:6;1301:4;1327:5;1323:16;1301:4;1293:6;1289:17;1396:39;;;;1071:370;;;;;2351:263;;2466:2;2454:9;2445:7;2441:23;2437:32;2434:2;;;-1:-1;;2472:12;2434:2;226:6;220:13;238:33;265:5;238:33;;2621:632;;;;2779:2;2767:9;2758:7;2754:23;2750:32;2747:2;;;-1:-1;;2785:12;2747:2;226:6;220:13;238:33;265:5;238:33;;;2948:2;2998:22;;2288:13;3088:2;3073:18;;3067:25;2837:74;;-1:-1;2288:13;-1:-1;3112:18;3101:30;;3098:2;;;-1:-1;;3134:12;3098:2;3164:73;3229:7;3220:6;3209:9;3205:22;3164:73;;;3154:83;;;2741:512;;;;;;3260:257;;3372:2;3360:9;3351:7;3347:23;3343:32;3340:2;;;-1:-1;;3378:12;3340:2;495:6;489:13;507:30;531:5;507:30;;3524:360;;3648:2;3636:9;3627:7;3623:23;3619:32;3616:2;;;-1:-1;;3654:12;3616:2;3705:17;3699:24;3743:18;3735:6;3732:30;3729:2;;;-1:-1;;3765:12;3729:2;3795:73;3860:7;3851:6;3840:9;3836:22;3795:73;;;3785:83;3610:274;-1:-1;;;;3610:274;3891:277;;4013:2;4001:9;3992:7;3988:23;3984:32;3981:2;;;-1:-1;;4019:12;3981:2;1547:6;1534:20;1559:51;1604:5;1559:51;;4175:508;;;4324:2;4312:9;4303:7;4299:23;4295:32;4292:2;;;-1:-1;;4330:12;4292:2;1547:6;1534:20;1559:51;1604:5;1559:51;;;4382:81;-1:-1;4528:2;4513:18;;4500:32;4552:18;4541:30;;4538:2;;;-1:-1;;4574:12;4538:2;4604:63;4659:7;4650:6;4639:9;4635:22;4604:63;;;4594:73;;;4286:397;;;;;;4690:633;;;;4856:2;4844:9;4835:7;4831:23;4827:32;4824:2;;;-1:-1;;4862:12;4824:2;1547:6;1534:20;1559:51;1604:5;1559:51;;;4914:81;-1:-1;5060:2;5045:18;;5032:32;5084:18;5073:30;;5070:2;;;-1:-1;;5106:12;5070:2;5136:63;5191:7;5182:6;5171:9;5167:22;5136:63;;;5126:73;;;5236:2;5279:9;5275:22;72:20;97:33;124:5;97:33;;;5244:63;;;;4818:505;;;;;;5330:737;;;;5505:2;5493:9;5484:7;5480:23;5476:32;5473:2;;;-1:-1;;5511:12;5473:2;1547:6;1534:20;1559:51;1604:5;1559:51;;;5563:81;-1:-1;5709:2;5694:18;;5681:32;5733:18;5722:30;;;5719:2;;;-1:-1;;5755:12;5719:2;5785:63;5840:7;5831:6;5820:9;5816:22;5785:63;;;5775:73;;5913:2;5902:9;5898:18;5885:32;5871:46;;5733:18;5929:6;5926:30;5923:2;;;-1:-1;;5959:12;5923:2;;5989:62;6043:7;6034:6;6023:9;6019:22;5989:62;;6074:983;;;;;;6280:3;6268:9;6259:7;6255:23;6251:33;6248:2;;;-1:-1;;6287:12;6248:2;1547:6;1534:20;1559:51;1604:5;1559:51;;;6339:81;-1:-1;6485:2;6470:18;;6457:32;6509:18;6498:30;;;6495:2;;;-1:-1;;6531:12;6495:2;6561:63;6616:7;6607:6;6596:9;6592:22;6561:63;;;6551:73;;6661:2;6704:9;6700:22;2140:20;6669:63;;6769:2;6809:9;6805:22;347:20;338:29;;372:30;396:5;372:30;;;6777:60;;-1:-1;6902:3;6887:19;;6874:33;;6916:30;;;6913:2;;;-1:-1;;6949:12;6913:2;;6979:62;7033:7;7024:6;7013:9;7009:22;6979:62;;;6969:72;;;6242:815;;;;;;;;;7415:343;;7557:5;16371:12;16527:6;16522:3;16515:19;7650:52;7695:6;16564:4;16559:3;16555:14;16564:4;7676:5;7672:16;7650:52;;;18165:7;18149:14;-1:-1;;18145:28;7714:39;;;;16564:4;7714:39;;7505:253;-1:-1;;7505:253;10171:222;-1:-1;;;;;17202:54;;;;7135:37;;10298:2;10283:18;;10269:124;10400:333;-1:-1;;;;;17202:54;;;;7135:37;;10719:2;10704:18;;7366:37;10555:2;10540:18;;10526:207;10740:528;;3112:18;;17213:42;;;16835:5;17202:54;7142:3;7135:37;7396:5;11105:2;11094:9;11090:18;7366:37;10941:2;11142;11131:9;11127:18;11120:48;11182:76;10941:2;10930:9;10926:18;11244:6;11182:76;;;11174:84;10912:356;-1:-1;;;;;10912:356;11275:210;16919:13;;16912:21;7249:34;;11396:2;11381:18;;11367:118;11492:306;;11637:2;11658:17;11651:47;11712:76;11637:2;11626:9;11622:18;11774:6;11712:76;;12074:416;12274:2;12288:47;;;8163:2;12259:18;;;16515:19;8199:34;16555:14;;;8179:55;-1:-1;;;8254:12;;;8247:32;8298:12;;;12245:245;12497:416;12697:2;12711:47;;;8549:2;12682:18;;;16515:19;8585:32;16555:14;;;8565:53;8637:12;;;12668:245;12920:416;13120:2;13134:47;;;8888:2;13105:18;;;16515:19;-1:-1;;;16555:14;;;8904:44;8967:12;;;13091:245;13343:416;13543:2;13557:47;;;9218:2;13528:18;;;16515:19;9254:34;16555:14;;;9234:55;-1:-1;;;9309:12;;;9302:27;9348:12;;;13514:245;13766:416;13966:2;13980:47;;;9599:2;13951:18;;;16515:19;9635:30;16555:14;;;9615:51;9685:12;;;13937:245;14189:416;14389:2;14403:47;;;9936:2;14374:18;;;16515:19;9972:33;16555:14;;;9952:54;10025:12;;;14360:245;14612:222;7366:37;;;14739:2;14724:18;;14710:124;14841:516;;7396:5;7373:3;7366:37;7276:5;16919:13;16912:21;15194:2;15183:9;15179:18;7249:34;15036:2;15231;15220:9;15216:18;15209:48;15271:76;15036:2;15025:9;15021:18;15333:6;15271:76;;15364:256;15426:2;15420:9;15452:17;;;15527:18;15512:34;;15548:22;;;15509:62;15506:2;;;15584:1;;15574:12;15506:2;15426;15593:22;15404:216;;-1:-1;15404:216;15627:321;;15770:18;15762:6;15759:30;15756:2;;;-1:-1;;15792:12;15756:2;-1:-1;18165:7;15846:17;-1:-1;;15842:33;15933:4;15923:15;;15693:255;17805:268;17870:1;17877:101;17891:6;17888:1;17885:13;17877:101;;;17958:11;;;17952:18;17939:11;;;17932:39;17913:2;17906:10;17877:101;;;17993:6;17990:1;17987:13;17984:2;;;17870:1;18049:6;18044:3;18040:16;18033:27;17984:2;;17854:219;;;;18186:117;-1:-1;;;;;17202:54;;18245:35;;18235:2;;18294:1;;18284:12;18235:2;18229:74;;18310:111;18391:5;16919:13;16912:21;18369:5;18366:32;18356:2;;18412:1;;18402:12

Swarm Source

ipfs://bae650404747503565dcef680704e29e95557b5e7069bbf4798c199ba766c8c2
Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
Loading