Contract 0xE038E59DEEC8657d105B6a3Fb5040b3a6189Dd51

Contract Overview

Balance:
0 Ether
Txn Hash Method
Block
From
To
Value
0xae9a16b4ef59c6abe1a40c6dfba55f9533c6d29c2824451ea8cc9e4a1d72e6160xeb78e5ee247131422021-05-07 13:38:3211 days 6 hrs ago0xf4e2bc18464670a684bb8ce2f5663c543db402c3 IN  0xe038e59deec8657d105b6a3fb5040b3a6189dd510 Ether0.0004541523
0x3190460deb528f282d13bce3fcb3356e670f71c46e59a72b3fe327127f0fb0750xeb78e5ee247121252021-05-07 12:29:0011 days 7 hrs ago0xf4e2bc18464670a684bb8ce2f5663c543db402c3 IN  0xe038e59deec8657d105b6a3fb5040b3a6189dd510 Ether0.0004541163
0x0ed56f37636c0a044f14e2e5ba071b133752a34a38f8c685d819850e2cb011550xeb78e5ee247102622021-05-07 10:22:2411 days 9 hrs ago0xf4e2bc18464670a684bb8ce2f5663c543db402c3 IN  0xe038e59deec8657d105b6a3fb5040b3a6189dd510 Ether0.0001513841
0xd554ff0833a2a547801f9be989eabbc44acfc45832039afa8f9975e41da004f70xeb78e5ee245087202021-04-27 21:45:5620 days 22 hrs ago0x69bdb276a17dd90f9d3a545944ccb20e593ae8e3 IN  0xe038e59deec8657d105b6a3fb5040b3a6189dd510 Ether0.0001515041
0x79ae816e50ab7e036046480bc842a7470fe31be892734904bb97911eb412418bAccrue Fee244437382021-04-24 20:14:3223 days 23 hrs ago0x69bdb276a17dd90f9d3a545944ccb20e593ae8e3 IN  0xe038e59deec8657d105b6a3fb5040b3a6189dd510 Ether0.0007437368
0xc11bb5b2ae489668c0cf88bc4c600a66fd3a13f3829225a168490d6bfe8e0e270xeb78e5ee239717622021-03-18 5:44:5261 days 14 hrs ago0x78d32460d0a53ac2678e869eb6b4f6ba9d2ef360 IN  0xe038e59deec8657d105b6a3fb5040b3a6189dd510 Ether0.000454443
0xbb5d5f0cfb11e0de8cfb9448d52af025a1b3cfc52a3d5db95c460cfd917c14bd0xeb78e5ee239392582021-03-16 3:07:0063 days 16 hrs ago0x25cb39a8b252b0a4b47768b57e452d714efe448a IN  0xe038e59deec8657d105b6a3fb5040b3a6189dd510 Ether0.0015150410
0xd91e479725fb08baa205baa126f850e870e631aa0da6145942430f7eda51d0dc0xeb78e5ee239360992021-03-15 22:24:1263 days 21 hrs ago0xa5723f22c4d69bf360b995913cbf7e97978209fe IN  0xe038e59deec8657d105b6a3fb5040b3a6189dd510 Ether0.001664810
0xd33e42016b8f62eb4861e80175625020ec92d051f6d8c93bf1141a21d33ba80e0xeb78e5ee239358352021-03-15 22:00:4463 days 21 hrs ago0x27aa74f5dbfce2be9ad564acd552b0d8d480a9f2 IN  0xe038e59deec8657d105b6a3fb5040b3a6189dd510 Ether0.00378725
0xdd80f071bab103dcfbd8d405039426cc31d1bfb56bd0de56706e4c61cf6ac93c0xeb78e5ee239335212021-03-15 18:33:1664 days 1 hr ago0x78d32460d0a53ac2678e869eb6b4f6ba9d2ef360 IN  0xe038e59deec8657d105b6a3fb5040b3a6189dd510 Ether0.001514810
0x2ce0093aa976a8a94f012c0a23c362b7f4ff550a3b1b8892dddfb9a7fef94c710xeb78e5ee239325552021-03-15 17:06:5264 days 2 hrs ago0x78d32460d0a53ac2678e869eb6b4f6ba9d2ef360 IN  0xe038e59deec8657d105b6a3fb5040b3a6189dd510 Ether0.001514810
0xcb382b223800f066c880c1a18374bf8816c9270ca0f182afd6f440f0c1082e820xeb78e5ee239315122021-03-15 15:33:1664 days 4 hrs ago0x78d32460d0a53ac2678e869eb6b4f6ba9d2ef360 IN  0xe038e59deec8657d105b6a3fb5040b3a6189dd510 Ether0.001514810
0x6b42a82618f1f97567ecc1004f3123c4e1330385771af5e57c66ab67195556aa0xeb78e5ee239243342021-03-15 4:41:4864 days 15 hrs ago0x78d32460d0a53ac2678e869eb6b4f6ba9d2ef360 IN  0xe038e59deec8657d105b6a3fb5040b3a6189dd510 Ether0.001514810
0xe3fc21768f0a52186dc402f49e37dd76d9f40ab1c076230277cfd49dbc405a0e0xeb78e5ee239242772021-03-15 4:36:4464 days 15 hrs ago0x78d32460d0a53ac2678e869eb6b4f6ba9d2ef360 IN  0xe038e59deec8657d105b6a3fb5040b3a6189dd510 Ether0.001514810
0xe34e677798d16776979d47995212ec87129894b542c94d6cf6f57a4173a192580xeb78e5ee239223122021-03-15 1:39:4064 days 18 hrs ago0x78d32460d0a53ac2678e869eb6b4f6ba9d2ef360 IN  0xe038e59deec8657d105b6a3fb5040b3a6189dd510 Ether0.001514810
0x16d50867613b0c105e2fff406a8becf1631f32324bf12aa66e2a2d0a55f518dc0xeb78e5ee239197022021-03-14 21:37:3264 days 22 hrs ago0x78d32460d0a53ac2678e869eb6b4f6ba9d2ef360 IN  0xe038e59deec8657d105b6a3fb5040b3a6189dd510 Ether0.001514810
0x626e1834f244a27c31a786c864ae0182357f5a5ca60e1d5ecd7f8466a957d8a30xeb78e5ee239196732021-03-14 21:34:5664 days 22 hrs ago0x78d32460d0a53ac2678e869eb6b4f6ba9d2ef360 IN  0xe038e59deec8657d105b6a3fb5040b3a6189dd510 Ether0.001514810
0xafb8de05e50402f32a14fd668a6a49fa1769acbf9bd6883b50a524967a4789710xeb78e5ee239168402021-03-14 17:16:0065 days 2 hrs ago0x78d32460d0a53ac2678e869eb6b4f6ba9d2ef360 IN  0xe038e59deec8657d105b6a3fb5040b3a6189dd510 Ether0.0015138410
0x24516465f6c02c8128158d76709c7e7c87af51102ca8524c8eadcb8858c11ff10xeb78e5ee239085632021-03-14 3:40:2865 days 16 hrs ago0x78d32460d0a53ac2678e869eb6b4f6ba9d2ef360 IN  0xe038e59deec8657d105b6a3fb5040b3a6189dd510 Ether0.0015138410
0x7b4065d13873c975c39fe69096aaba955ea7492a82704d9dd6fcc821bf8b93600xeb78e5ee239022902021-03-13 18:16:4866 days 1 hr ago0x78d32460d0a53ac2678e869eb6b4f6ba9d2ef360 IN  0xe038e59deec8657d105b6a3fb5040b3a6189dd510 Ether0.0015138410
0x917cdeebee855481633fdf147760adaffa72a969ad77cb8405607a765abe494d0xeb78e5ee237813332021-03-06 3:54:5273 days 15 hrs ago0x69bdb276a17dd90f9d3a545944ccb20e593ae8e3 IN  0xe038e59deec8657d105b6a3fb5040b3a6189dd510 Ether0.01090742472
0x4a4751c387de6bbdd05d06e66e4bed91d092314b2e47696122aae08a3da7d816Accrue Fee237795902021-03-06 1:18:3673 days 18 hrs ago0x25d9d2d38fa590ccfeb3c59d12daa30297380666 IN  0xe038e59deec8657d105b6a3fb5040b3a6189dd510 Ether0.0009295510
0xce545576315327e5cb4e8c879aeddcaedcb5184fac5bf9b6656251ef6b2ed4860xeb78e5ee237311812021-03-03 0:33:3276 days 19 hrs ago0x69bdb276a17dd90f9d3a545944ccb20e593ae8e3 IN  0xe038e59deec8657d105b6a3fb5040b3a6189dd510 Ether0.0004545123
0x40368cb3af697640677e6c5cda03358fe1177df87c439c0229ae14b36822aa390xeb78e5ee236215802021-02-24 0:38:2083 days 19 hrs ago0x69bdb276a17dd90f9d3a545944ccb20e593ae8e3 IN  0xe038e59deec8657d105b6a3fb5040b3a6189dd510 Ether0.0030298420
0x5f8d0921f249c68b94b374b29849a072d5e9fef893c1dc0af934393361e99e680xeb78e5ee235185612021-02-17 15:27:4490 days 4 hrs ago0x0014d8a0c42e5ec5d69b2b9190186c494e2a6905 IN  0xe038e59deec8657d105b6a3fb5040b3a6189dd510 Ether0.0006818224.5
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0xae9a16b4ef59c6abe1a40c6dfba55f9533c6d29c2824451ea8cc9e4a1d72e616247131422021-05-07 13:38:3211 days 6 hrs ago 0xe038e59deec8657d105b6a3fb5040b3a6189dd51 0xed1fe1994c6c50c19811ea0534e923c91b8c16320 Ether
0xae9a16b4ef59c6abe1a40c6dfba55f9533c6d29c2824451ea8cc9e4a1d72e616247131422021-05-07 13:38:3211 days 6 hrs ago 0xe038e59deec8657d105b6a3fb5040b3a6189dd51 0xed1fe1994c6c50c19811ea0534e923c91b8c16320 Ether
0xae9a16b4ef59c6abe1a40c6dfba55f9533c6d29c2824451ea8cc9e4a1d72e616247131422021-05-07 13:38:3211 days 6 hrs ago 0xe038e59deec8657d105b6a3fb5040b3a6189dd51 0x9048278ca7e874f9338e4898c436ab07aa4547010 Ether
0xae9a16b4ef59c6abe1a40c6dfba55f9533c6d29c2824451ea8cc9e4a1d72e616247131422021-05-07 13:38:3211 days 6 hrs ago 0xe038e59deec8657d105b6a3fb5040b3a6189dd51 0xed1fe1994c6c50c19811ea0534e923c91b8c16320 Ether
0x3190460deb528f282d13bce3fcb3356e670f71c46e59a72b3fe327127f0fb075247121252021-05-07 12:29:0011 days 7 hrs ago 0xe038e59deec8657d105b6a3fb5040b3a6189dd51 0x85758e4b2dd825ee42c97800fb46db6c7c1e500f0 Ether
0x3190460deb528f282d13bce3fcb3356e670f71c46e59a72b3fe327127f0fb075247121252021-05-07 12:29:0011 days 7 hrs ago 0xe038e59deec8657d105b6a3fb5040b3a6189dd51 0x85758e4b2dd825ee42c97800fb46db6c7c1e500f0 Ether
0x3190460deb528f282d13bce3fcb3356e670f71c46e59a72b3fe327127f0fb075247121252021-05-07 12:29:0011 days 7 hrs ago 0xe038e59deec8657d105b6a3fb5040b3a6189dd51 0x9048278ca7e874f9338e4898c436ab07aa4547010 Ether
0x3190460deb528f282d13bce3fcb3356e670f71c46e59a72b3fe327127f0fb075247121252021-05-07 12:29:0011 days 7 hrs ago 0xe038e59deec8657d105b6a3fb5040b3a6189dd51 0x85758e4b2dd825ee42c97800fb46db6c7c1e500f0 Ether
0x0ed56f37636c0a044f14e2e5ba071b133752a34a38f8c685d819850e2cb01155247102622021-05-07 10:22:2411 days 9 hrs ago 0xe038e59deec8657d105b6a3fb5040b3a6189dd51 0x016057880f7c321640886c25386c79c3ee176cdd0 Ether
0x0ed56f37636c0a044f14e2e5ba071b133752a34a38f8c685d819850e2cb01155247102622021-05-07 10:22:2411 days 9 hrs ago 0xe038e59deec8657d105b6a3fb5040b3a6189dd51 0x016057880f7c321640886c25386c79c3ee176cdd0 Ether
0x0ed56f37636c0a044f14e2e5ba071b133752a34a38f8c685d819850e2cb01155247102622021-05-07 10:22:2411 days 9 hrs ago 0xe038e59deec8657d105b6a3fb5040b3a6189dd51 0x9048278ca7e874f9338e4898c436ab07aa4547010 Ether
0x0ed56f37636c0a044f14e2e5ba071b133752a34a38f8c685d819850e2cb01155247102622021-05-07 10:22:2411 days 9 hrs ago 0xe038e59deec8657d105b6a3fb5040b3a6189dd51 0x016057880f7c321640886c25386c79c3ee176cdd0 Ether
0xcab98d59eab9d7a6e6aa4012daf41fcac95aef7eb30f5d394825935cadf873e4245087662021-04-27 21:49:0020 days 22 hrs ago 0x676c7b527c706801e64ad2108aa1f0ddc83807d0 0xe038e59deec8657d105b6a3fb5040b3a6189dd510 Ether
0xd554ff0833a2a547801f9be989eabbc44acfc45832039afa8f9975e41da004f7245087202021-04-27 21:45:5620 days 22 hrs ago 0xe038e59deec8657d105b6a3fb5040b3a6189dd51 0x7edc8917dfb6f2c696a41579356dfc6ecd360aa10 Ether
0xd554ff0833a2a547801f9be989eabbc44acfc45832039afa8f9975e41da004f7245087202021-04-27 21:45:5620 days 22 hrs ago 0xe038e59deec8657d105b6a3fb5040b3a6189dd51 0x7edc8917dfb6f2c696a41579356dfc6ecd360aa10 Ether
0xd554ff0833a2a547801f9be989eabbc44acfc45832039afa8f9975e41da004f7245087202021-04-27 21:45:5620 days 22 hrs ago 0xe038e59deec8657d105b6a3fb5040b3a6189dd51 0x9048278ca7e874f9338e4898c436ab07aa4547010 Ether
0xd554ff0833a2a547801f9be989eabbc44acfc45832039afa8f9975e41da004f7245087202021-04-27 21:45:5620 days 22 hrs ago 0xe038e59deec8657d105b6a3fb5040b3a6189dd51 0x7edc8917dfb6f2c696a41579356dfc6ecd360aa10 Ether
0x79ae816e50ab7e036046480bc842a7470fe31be892734904bb97911eb412418b244437382021-04-24 20:14:3223 days 23 hrs ago 0xe038e59deec8657d105b6a3fb5040b3a6189dd51 0xea41f11c916813eda966a4e1a0b09c98c4bbc5550 Ether
0x79ae816e50ab7e036046480bc842a7470fe31be892734904bb97911eb412418b244437382021-04-24 20:14:3223 days 23 hrs ago 0xe038e59deec8657d105b6a3fb5040b3a6189dd51 0xea41f11c916813eda966a4e1a0b09c98c4bbc5550 Ether
0x79ae816e50ab7e036046480bc842a7470fe31be892734904bb97911eb412418b244437382021-04-24 20:14:3223 days 23 hrs ago 0xe038e59deec8657d105b6a3fb5040b3a6189dd51 0xea41f11c916813eda966a4e1a0b09c98c4bbc5550 Ether
0x79ae816e50ab7e036046480bc842a7470fe31be892734904bb97911eb412418b244437382021-04-24 20:14:3223 days 23 hrs ago 0xe038e59deec8657d105b6a3fb5040b3a6189dd51 0x9048278ca7e874f9338e4898c436ab07aa4547010 Ether
0x79ae816e50ab7e036046480bc842a7470fe31be892734904bb97911eb412418b244437382021-04-24 20:14:3223 days 23 hrs ago 0xe038e59deec8657d105b6a3fb5040b3a6189dd51 0x9048278ca7e874f9338e4898c436ab07aa4547010 Ether
0x79ae816e50ab7e036046480bc842a7470fe31be892734904bb97911eb412418b244437382021-04-24 20:14:3223 days 23 hrs ago 0xe038e59deec8657d105b6a3fb5040b3a6189dd51 0xea41f11c916813eda966a4e1a0b09c98c4bbc5550 Ether
0x79ae816e50ab7e036046480bc842a7470fe31be892734904bb97911eb412418b244437382021-04-24 20:14:3223 days 23 hrs ago 0xe038e59deec8657d105b6a3fb5040b3a6189dd51 0xea41f11c916813eda966a4e1a0b09c98c4bbc5550 Ether
0x79ae816e50ab7e036046480bc842a7470fe31be892734904bb97911eb412418b244437382021-04-24 20:14:3223 days 23 hrs ago 0xe038e59deec8657d105b6a3fb5040b3a6189dd51 0x9048278ca7e874f9338e4898c436ab07aa4547010 Ether
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
StreamingFeeModule

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-09-08
*/

// 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: @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/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: 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.
 */
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 = result.sub(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);
    }
}
// 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";

/**
 * @title ModuleBase
 * @author Set Protocol
 *
 * Abstract class that houses common Module-related state and functions.
 */
abstract contract ModuleBase is IModule {

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

    // Address of the controller
    IController public controller;

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

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

    /**
     * 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));
    }
}
// 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/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/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 getModuleFee(address _module, uint256 _feeType) external view returns(uint256);
    function resourceId(uint256 _id) external view returns(address);
    function feeRecipient() external view returns(address);
    function isModule(address _module) external view returns(bool);
    function isSet(address _setToken) external view returns(bool);
    function isSystemContract(address _contractAddress) 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/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/utils/SafeCast.sol



// pragma solidity ^0.6.0;


/**
 * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow
 * checks.
 *
 * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can
 * easily result in undesired exploitation or bugs, since developers usually
 * assume that overflows raise errors. `SafeCast` restores this intuition by
 * reverting the transaction when such an operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 *
 * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing
 * all math on `uint256` and `int256` and then downcasting.
 */
library SafeCast {

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

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

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

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

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

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

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

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

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

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

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

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

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

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


/**
 * @title StreamingFeeModule
 * @author Set Protocol
 *
 * Smart contract that accrues streaming fees for Set managers. Streaming fees are denominated as percent
 * per year and realized as Set inflation rewarded to the manager.
 */
contract StreamingFeeModule is ModuleBase, ReentrancyGuard {
    using SafeMath for uint256;
    using PreciseUnitMath for uint256;
    using SafeCast for uint256;

    using SignedSafeMath for int256;
    using PreciseUnitMath for int256;
    using SafeCast for int256;


    /* ============ Structs ============ */

    struct FeeState {
        address feeRecipient;                   // Address to accrue fees to
        uint256 maxStreamingFeePercentage;      // Max streaming fee maanager commits to using (1% = 1e16, 100% = 1e18)
        uint256 streamingFeePercentage;         // Percent of Set accruing to manager annually (1% = 1e16, 100% = 1e18)
        uint256 lastStreamingFeeTimestamp;      // Timestamp last streaming fee was accrued
    }

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

    event FeeActualized(address indexed _setToken, uint256 _managerFee, uint256 _protocolFee);
    event StreamingFeeUpdated(address indexed _setToken, uint256 _newStreamingFee);
    event FeeRecipientUpdated(address indexed _setToken, address _newFeeRecipient);

    /* ============ Constants ============ */

    uint256 private constant ONE_YEAR_IN_SECONDS = 365.25 days;
    uint256 private constant PROTOCOL_STREAMING_FEE_INDEX = 0;

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

    mapping(ISetToken => FeeState) public feeStates;

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

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

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

    /*
     * Calculates total inflation percentage then mints new Sets to the fee recipient. Position units are
     * then adjusted down (in magnitude) in order to ensure full collateralization. Callable by anyone.
     *
     * @param _setToken       Address of SetToken
     */
    function accrueFee(ISetToken _setToken) public nonReentrant onlyValidAndInitializedSet(_setToken) {
        uint256 managerFee;
        uint256 protocolFee;

        if (_streamingFeePercentage(_setToken) > 0) {
            uint256 inflationFeePercentage = _calculateStreamingFee(_setToken);

            // Calculate incentiveFee inflation
            uint256 feeQuantity = _calculateStreamingFeeInflation(_setToken, inflationFeePercentage);

            // Mint new Sets to manager and protocol
            (
                managerFee,
                protocolFee
            ) = _mintManagerAndProtocolFee(_setToken, feeQuantity);

            _editPositionMultiplier(_setToken, inflationFeePercentage);
        }

        feeStates[_setToken].lastStreamingFeeTimestamp = block.timestamp;

        emit FeeActualized(address(_setToken), managerFee, protocolFee);
    }

    /**
     * SET MANAGER ONLY. Initialize module with SetToken and set the fee state for the SetToken. Passed
     * _settings will have lastStreamingFeeTimestamp over-written.
     *
     * @param _setToken                 Address of SetToken
     * @param _settings                 FeeState struct defining fee parameters
     */
    function initialize(
        ISetToken _setToken,
        FeeState memory _settings
    )
        external
        onlySetManager(_setToken, msg.sender)
        onlyValidAndPendingSet(_setToken)
    {
        require(_settings.feeRecipient != address(0), "Fee Recipient must be non-zero address.");
        require(_settings.maxStreamingFeePercentage < PreciseUnitMath.preciseUnit(), "Max fee must be < 100%.");
        require(_settings.streamingFeePercentage <= _settings.maxStreamingFeePercentage, "Fee must be <= max.");

        _settings.lastStreamingFeeTimestamp = block.timestamp;

        feeStates[_setToken] = _settings;
        _setToken.initializeModule();
    }

    /**
     * Removes this module from the SetToken, via call by the SetToken. Manager's feeState is deleted. Fees
     * are not accrued in case reason for removing module is related to fee accrual.
     */
    function removeModule() external override {
        delete feeStates[ISetToken(msg.sender)];
    }

    /*
     * Set new streaming fee. Fees accrue at current rate then new rate is set.
     * Fees are accrued to prevent the manager from unfairly accruing a larger percentage.
     *
     * @param _setToken       Address of SetToken
     * @param _newFee         New streaming fee 18 decimal precision
     */
    function updateStreamingFee(
        ISetToken _setToken,
        uint256 _newFee
    )
        external
        onlySetManager(_setToken, msg.sender)
        onlyValidAndInitializedSet(_setToken)
    {
        require(_newFee < _maxStreamingFeePercentage(_setToken), "Fee must be less than max");
        accrueFee(_setToken);

        feeStates[_setToken].streamingFeePercentage = _newFee;

        emit StreamingFeeUpdated(address(_setToken), _newFee);
    }

    /*
     * Set new fee recipient.
     *
     * @param _setToken             Address of SetToken
     * @param _newFeeRecipient      New fee recipient
     */
    function updateFeeRecipient(ISetToken _setToken, address _newFeeRecipient)
        external
        onlySetManager(_setToken, msg.sender)
        onlyValidAndInitializedSet(_setToken)
    {
        require(_newFeeRecipient != address(0), "Fee Recipient must be non-zero address.");

        feeStates[_setToken].feeRecipient = _newFeeRecipient;

        emit FeeRecipientUpdated(address(_setToken), _newFeeRecipient);
    }

    /*
     * Calculates total inflation percentage in order to accrue fees to manager.
     *
     * @param _setToken       Address of SetToken
     * @return  uint256       Percent inflation of supply
     */
    function getFee(ISetToken _setToken) external view returns (uint256) {
        return _calculateStreamingFee(_setToken);
    }

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

    /**
     * Calculates streaming fee by multiplying streamingFeePercentage by the elapsed amount of time since the last fee
     * was collected divided by one year in seconds, since the fee is a yearly fee.
     *
     * @param  _setToken          Address of Set to have feeState updated
     * @return uint256            Streaming fee denominated in percentage of totalSupply
     */
    function _calculateStreamingFee(ISetToken _setToken) internal view returns(uint256) {
        uint256 timeSinceLastFee = block.timestamp.sub(_lastStreamingFeeTimestamp(_setToken));

        // Streaming fee is streaming fee times years since last fee
        return timeSinceLastFee.mul(_streamingFeePercentage(_setToken)).div(ONE_YEAR_IN_SECONDS);
    }

    /**
     * Returns the new incentive fee denominated in the number of SetTokens to mint. The calculation for the fee involves
     * implying mint quantity so that the feeRecipient owns the fee percentage of the entire supply of the Set.
     *
     * The formula to solve for fee is:
     * (feeQuantity / feeQuantity) + totalSupply = fee / scaleFactor
     *
     * The simplified formula utilized below is:
     * feeQuantity = fee * totalSupply / (scaleFactor - fee)
     *
     * @param   _setToken               SetToken instance
     * @param   _feePercentage          Fee levied to feeRecipient
     * @return  uint256                 New RebalancingSet issue quantity
     */
    function _calculateStreamingFeeInflation(
        ISetToken _setToken,
        uint256 _feePercentage
    )
        internal
        view
        returns (uint256)
    {
        uint256 totalSupply = _setToken.totalSupply();

        // fee * totalSupply
        uint256 a = _feePercentage.mul(totalSupply);

        // ScaleFactor (10e18) - fee
        uint256 b = PreciseUnitMath.preciseUnit().sub(_feePercentage);

        return a.div(b);
    }

    /**
     * Mints sets to both the manager and the protocol. Protocol takes a percentage fee of the total amount of Sets
     * minted to manager.
     *
     * @param   _setToken               SetToken instance
     * @param   _feeQuantity            Amount of Sets to be minted as fees
     * @return  uint256                 Amount of Sets accrued to manager as fee
     * @return  uint256                 Amount of Sets accrued to protocol as fee
     */
    function _mintManagerAndProtocolFee(ISetToken _setToken, uint256 _feeQuantity) internal returns (uint256, uint256) {
        address protocolFeeRecipient = controller.feeRecipient();
        uint256 protocolFee = controller.getModuleFee(address(this), PROTOCOL_STREAMING_FEE_INDEX);

        uint256 protocolFeeAmount = _feeQuantity.preciseMul(protocolFee);
        uint256 managerFeeAmount = _feeQuantity.sub(protocolFeeAmount);

        _setToken.mint(_feeRecipient(_setToken), managerFeeAmount);

        if (protocolFeeAmount > 0) {
            _setToken.mint(protocolFeeRecipient, protocolFeeAmount);
        }

        return (managerFeeAmount, protocolFeeAmount);
    }

    /**
     * Calculates new position multiplier according to following formula:
     *
     * newMultiplier = oldMultiplier * (1-inflationFee)
     *
     * This reduces position sizes to offset increase in supply due to fee collection.
     *
     * @param   _setToken               SetToken instance
     * @param   _inflationFee           Fee inflation rate
     */
    function _editPositionMultiplier(ISetToken _setToken, uint256 _inflationFee) internal {
        int256 currentMultipler = _setToken.positionMultiplier();
        int256 newMultiplier = currentMultipler.preciseMul(PreciseUnitMath.preciseUnit().sub(_inflationFee).toInt256());

        _setToken.editPositionMultiplier(newMultiplier);
    }

    function _feeRecipient(ISetToken _set) internal view returns (address) {
        return feeStates[_set].feeRecipient;
    }

    function _lastStreamingFeeTimestamp(ISetToken _set) internal view returns (uint256) {
        return feeStates[_set].lastStreamingFeeTimestamp;
    }

    function _maxStreamingFeePercentage(ISetToken _set) internal view returns (uint256) {
        return feeStates[_set].maxStreamingFeePercentage;
    }

    function _streamingFeePercentage(ISetToken _set) internal view returns (uint256) {
        return feeStates[_set].streamingFeePercentage;
    }
}

Contract ABI

[{"inputs":[{"internalType":"contract IController","name":"_controller","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_setToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"_managerFee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_protocolFee","type":"uint256"}],"name":"FeeActualized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_setToken","type":"address"},{"indexed":false,"internalType":"address","name":"_newFeeRecipient","type":"address"}],"name":"FeeRecipientUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_setToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"_newStreamingFee","type":"uint256"}],"name":"StreamingFeeUpdated","type":"event"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"}],"name":"accrueFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"controller","outputs":[{"internalType":"contract IController","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"","type":"address"}],"name":"feeStates","outputs":[{"internalType":"address","name":"feeRecipient","type":"address"},{"internalType":"uint256","name":"maxStreamingFeePercentage","type":"uint256"},{"internalType":"uint256","name":"streamingFeePercentage","type":"uint256"},{"internalType":"uint256","name":"lastStreamingFeeTimestamp","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"}],"name":"getFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"components":[{"internalType":"address","name":"feeRecipient","type":"address"},{"internalType":"uint256","name":"maxStreamingFeePercentage","type":"uint256"},{"internalType":"uint256","name":"streamingFeePercentage","type":"uint256"},{"internalType":"uint256","name":"lastStreamingFeeTimestamp","type":"uint256"}],"internalType":"struct StreamingFeeModule.FeeState","name":"_settings","type":"tuple"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"removeModule","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"address","name":"_newFeeRecipient","type":"address"}],"name":"updateFeeRecipient","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_newFee","type":"uint256"}],"name":"updateStreamingFee","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b506040516115b93803806115b983398101604081905261002f91610058565b600080546001600160a01b0319166001600160a01b039290921691909117905560018055610086565b600060208284031215610069578081fd5b81516001600160a01b038116811461007f578182fd5b9392505050565b611524806100956000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c80638e7bdd481161005b5780638e7bdd48146100d0578063b88c9148146100fc578063eb78e5ee1461011c578063f77c47911461012f57610088565b80632f3eec491461008d57806345cb3fde146100a25780635d98c373146100b5578063847ef08d146100c8575b600080fd5b6100a061009b366004610f9b565b610144565b005b6100a06100b036600461107e565b610249565b6100a06100c3366004610fb7565b610324565b6100a06103f8565b6100e36100de366004610f9b565b61042a565b6040516100f394939291906110ee565b60405180910390f35b61010f61010a366004610f9b565b61045d565b6040516100f39190611114565b6100a061012a366004610fef565b61046e565b61013761067b565b6040516100f391906110c1565b600260015414156101705760405162461bcd60e51b815260040161016790611491565b60405180910390fd5b60026001558061017f8161068a565b61019b5760405162461bcd60e51b8152600401610167906111a7565b60008060006101a98561078e565b11156101e65760006101ba856107ad565b905060006101c886836107ff565b90506101d486826108bf565b90945092506101e38683610ad9565b50505b6001600160a01b0384166000818152600260205260409081902042600390910155517faca81f8dfdb5e554ef873ba451d1ca28d6701b3d9c3ab5e56c699ae0b37bade19061023790859085906114c8565b60405180910390a25050600180555050565b81336102558282610bdb565b6102715760405162461bcd60e51b815260040161016790611425565b8361027b8161068a565b6102975760405162461bcd60e51b8152600401610167906111a7565b6102a085610c69565b84106102be5760405162461bcd60e51b815260040161016790611226565b6102c785610144565b6001600160a01b03851660008181526002602081905260409182902001869055517fa648920efd9baafceb9a4c0163ddc4d7c9df1d0f9a58f8e376bd0ec68e0f749890610315908790611114565b60405180910390a25050505050565b81336103308282610bdb565b61034c5760405162461bcd60e51b815260040161016790611425565b836103568161068a565b6103725760405162461bcd60e51b8152600401610167906111a7565b6001600160a01b0384166103985760405162461bcd60e51b815260040161016790611326565b6001600160a01b038581166000818152600260205260409081902080546001600160a01b0319169388169390931790925590517faaebcf1bfa00580e41d966056b48521fa9f202645c86d4ddf28113e617c1b1d3906103159087906110c1565b336000908152600260208190526040822080546001600160a01b03191681556001810183905590810182905560030155565b600260208190526000918252604090912080546001820154928201546003909201546001600160a01b0390911692919084565b6000610468826107ad565b92915050565b813361047a8282610bdb565b6104965760405162461bcd60e51b815260040161016790611425565b600054604051631d3af8fb60e21b815285916001600160a01b0316906374ebe3ec906104c69084906004016110c1565b60206040518083038186803b1580156104de57600080fd5b505afa1580156104f2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105169190610f7b565b6105325760405162461bcd60e51b8152600401610167906113e2565b61053b81610c87565b6105575760405162461bcd60e51b8152600401610167906111ef565b83516001600160a01b031661057e5760405162461bcd60e51b815260040161016790611326565b610586610cb6565b8460200151106105a85760405162461bcd60e51b815260040161016790611170565b8360200151846040015111156105d05760405162461bcd60e51b81526004016101679061136d565b42606085019081526001600160a01b0386811660008181526002602081815260408084208b5181546001600160a01b0319169716969096178655908a01516001860155808a015191850191909155935160039093019290925582516307ff078f60e11b815292519092630ffe0f1e92600480830193919282900301818387803b15801561065c57600080fd5b505af1158015610670573d6000803e3d6000fd5b505050505050505050565b6000546001600160a01b031681565b60008054604051631d3af8fb60e21b81526001600160a01b03909116906374ebe3ec906106bb9085906004016110c1565b60206040518083038186803b1580156106d357600080fd5b505afa1580156106e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061070b9190610f7b565b801561046857506040516335fc6c9f60e21b81526001600160a01b0383169063d7f1b27c9061073e9030906004016110c1565b60206040518083038186803b15801561075657600080fd5b505afa15801561076a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104689190610f7b565b6001600160a01b03166000908152600260208190526040909120015490565b6000806107c96107bc84610cc2565b429063ffffffff610ce016565b90506107f86301e187e06107ec6107df8661078e565b849063ffffffff610d2216565b9063ffffffff610d5c16565b9392505050565b600080836001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561083b57600080fd5b505afa15801561084f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061087391906110a9565b90506000610887848363ffffffff610d2216565b905060006108a385610897610cb6565b9063ffffffff610ce016565b90506108b5828263ffffffff610d5c16565b9695505050505050565b60008060008060009054906101000a90046001600160a01b03166001600160a01b031663469048406040518163ffffffff1660e01b815260040160206040518083038186803b15801561091157600080fd5b505afa158015610925573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109499190610f5f565b6000805460405163792aa04f60e01b815292935090916001600160a01b039091169063792aa04f9061098190309085906004016110d5565b60206040518083038186803b15801561099957600080fd5b505afa1580156109ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d191906110a9565b905060006109e5868363ffffffff610d9e16565b905060006109f9878363ffffffff610ce016565b9050876001600160a01b03166340c10f19610a138a610dbc565b836040518363ffffffff1660e01b8152600401610a319291906110d5565b600060405180830381600087803b158015610a4b57600080fd5b505af1158015610a5f573d6000803e3d6000fd5b505050506000821115610acd576040516340c10f1960e01b81526001600160a01b038916906340c10f1990610a9a90879086906004016110d5565b600060405180830381600087803b158015610ab457600080fd5b505af1158015610ac8573d6000803e3d6000fd5b505050505b97909650945050505050565b6000826001600160a01b0316635230c3966040518163ffffffff1660e01b815260040160206040518083038186803b158015610b1457600080fd5b505afa158015610b28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b4c91906110a9565b90506000610b74610b67610b6285610897610cb6565b610dda565b839063ffffffff610e0316565b60405163c2de0e9d60e01b81529091506001600160a01b0385169063c2de0e9d90610ba3908490600401611114565b600060405180830381600087803b158015610bbd57600080fd5b505af1158015610bd1573d6000803e3d6000fd5b5050505050505050565b6000816001600160a01b0316836001600160a01b031663481c6a756040518163ffffffff1660e01b815260040160206040518083038186803b158015610c2057600080fd5b505afa158015610c34573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c589190610f5f565b6001600160a01b0316149392505050565b6001600160a01b031660009081526002602052604090206001015490565b6040516353bae5f760e01b81526000906001600160a01b038316906353bae5f79061073e9030906004016110c1565b670de0b6b3a764000090565b6001600160a01b031660009081526002602052604090206003015490565b60006107f883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e2d565b600082610d3157506000610468565b82820282848281610d3e57fe5b04146107f85760405162461bcd60e51b81526004016101679061129e565b60006107f883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610e59565b60006107f8670de0b6b3a76400006107ec858563ffffffff610d2216565b6001600160a01b039081166000908152600260205260409020541690565b6000600160ff1b8210610dff5760405162461bcd60e51b81526004016101679061139a565b5090565b60006107f8670de0b6b3a7640000610e21858563ffffffff610e9016565b9063ffffffff610efb16565b60008184841115610e515760405162461bcd60e51b8152600401610167919061111d565b505050900390565b60008183610e7a5760405162461bcd60e51b8152600401610167919061111d565b506000838581610e8657fe5b0495945050505050565b600082610e9f57506000610468565b82600019148015610eb35750600160ff1b82145b15610ed05760405162461bcd60e51b8152600401610167906112df565b82820282848281610edd57fe5b05146107f85760405162461bcd60e51b8152600401610167906112df565b600081610f1a5760405162461bcd60e51b81526004016101679061145c565b81600019148015610f2e5750600160ff1b83145b15610f4b5760405162461bcd60e51b81526004016101679061125d565b6000828481610f5657fe5b05949350505050565b600060208284031215610f70578081fd5b81516107f8816114d6565b600060208284031215610f8c578081fd5b815180151581146107f8578182fd5b600060208284031215610fac578081fd5b81356107f8816114d6565b60008060408385031215610fc9578081fd5b8235610fd4816114d6565b91506020830135610fe4816114d6565b809150509250929050565b60008082840360a0811215611002578283fd5b833561100d816114d6565b92506080601f1982011215611020578182fd5b506040516080810181811067ffffffffffffffff82111715611040578283fd5b6040526020840135611051816114d6565b80825250604084013560208201526060840135604082015260808401356060820152809150509250929050565b60008060408385031215611090578182fd5b823561109b816114d6565b946020939093013593505050565b6000602082840312156110ba578081fd5b5051919050565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b0394909416845260208401929092526040830152606082015260800190565b90815260200190565b6000602080835283518082850152825b818110156111495785810183015185820160400152820161112d565b8181111561115a5783604083870101525b50601f01601f1916929092016040019392505050565b60208082526017908201527f4d617820666565206d757374206265203c20313030252e000000000000000000604082015260600190565b60208082526028908201527f4d75737420626520612076616c696420616e6420696e697469616c697a65642060408201526729b2ba2a37b5b2b760c11b606082015260800190565b6020808252601e908201527f4d7573742062652070656e64696e6720696e697469616c697a6174696f6e0000604082015260600190565b60208082526019908201527f466565206d757374206265206c657373207468616e206d617800000000000000604082015260600190565b60208082526021908201527f5369676e6564536166654d6174683a206469766973696f6e206f766572666c6f6040820152607760f81b606082015260800190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6040820152607760f81b606082015260800190565b60208082526027908201527f5369676e6564536166654d6174683a206d756c7469706c69636174696f6e206f604082015266766572666c6f7760c81b606082015260800190565b60208082526027908201527f46656520526563697069656e74206d757374206265206e6f6e2d7a65726f206160408201526632323932b9b99760c91b606082015260800190565b6020808252601390820152722332b29036bab9ba103132901e1e9036b0bc1760691b604082015260600190565b60208082526028908201527f53616665436173743a2076616c756520646f65736e27742066697420696e2061604082015267371034b73a191a9b60c11b606082015260800190565b60208082526023908201527f4d75737420626520636f6e74726f6c6c65722d656e61626c656420536574546f60408201526235b2b760e91b606082015260800190565b6020808252601c908201527f4d7573742062652074686520536574546f6b656e206d616e6167657200000000604082015260600190565b6020808252818101527f5369676e6564536166654d6174683a206469766973696f6e206279207a65726f604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b918252602082015260400190565b6001600160a01b03811681146114eb57600080fd5b5056fea2646970667358221220ba7667045a62821576f45f97bfd8b1cc568441fd88b75e911a09cd56a86503c464736f6c634300060a00330000000000000000000000009048278ca7e874f9338e4898c436ab07aa454701

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

0000000000000000000000009048278ca7e874f9338e4898c436ab07aa454701

-----Decoded View---------------
Arg [0] : _controller (address): 0x9048278ca7e874f9338e4898c436ab07aa454701

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000009048278ca7e874f9338e4898c436ab07aa454701


Deployed ByteCode Sourcemap

52653:10383:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;54512:894;;;;;;;;;:::i;:::-;;57094:475;;;;;;;;;:::i;57745:433::-;;;;;;;;;:::i;56667:100::-;;;:::i;53981:47::-;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;58403:128;;;;;;;;;:::i;:::-;;;;;;;;55755:691;;;;;;;;;:::i;20531:29::-;;;:::i;:::-;;;;;;;;54512:894;50186:1;50792:7;;:19;;50784:63;;;;-1:-1:-1;;;50784:63:0;;;;;;;;;;;;;;;;;50186:1;50925:7;:18;54599:9;20868:35:::1;54599:9:::0;20868:24:::1;:35::i;:::-;20860:88;;;;-1:-1:-1::0;;;20860:88:0::1;;;;;;;;;54621:18:::2;54650:19:::0;54723:1:::2;54686:34;54710:9;54686:23;:34::i;:::-;:38;54682:564;;;54741:30;54774:33;54797:9;54774:22;:33::i;:::-;54741:66;;54873:19;54895:66;54927:9;54938:22;54895:31;:66::i;:::-;54873:88;;55109:50;55136:9;55147:11;55109:26;:50::i;:::-;55032:127:::0;;-1:-1:-1;55032:127:0;-1:-1:-1;55176:58:0::2;55200:9:::0;55211:22;55176:23:::2;:58::i;:::-;54682:564;;;-1:-1:-1::0;;;;;55258:20:0;::::2;;::::0;;;:9:::2;:20;::::0;;;;;;55307:15:::2;55258:46;::::0;;::::2;:64:::0;55340:58;::::2;::::0;::::2;::::0;55374:10;;55386:11;;55340:58:::2;;;;;;;;;;-1:-1:-1::0;;50142:1:0;51104:22;;-1:-1:-1;;54512:894:0:o;57094:475::-;57227:9;57238:10;20699:32;20712:9;20723:7;20699:12;:32::i;:::-;20691:73;;;;-1:-1:-1;;;20691:73:0;;;;;;;;;57286:9:::1;20868:35;20893:9;20868:24;:35::i;:::-;20860:88;;;;-1:-1:-1::0;;;20860:88:0::1;;;;;;;;;57331:37:::2;57358:9;57331:26;:37::i;:::-;57321:7;:47;57313:85;;;;-1:-1:-1::0;;;57313:85:0::2;;;;;;;;;57409:20;57419:9;57409;:20::i;:::-;-1:-1:-1::0;;;;;57442:20:0;::::2;;::::0;;;:9:::2;:20;::::0;;;;;;;;:43:::2;:53:::0;;;57513:48;::::2;::::0;::::2;::::0;57488:7;;57513:48:::2;;;;;;;;;;20775:1:::1;57094:475:::0;;;;:::o;57745:433::-;57862:9;57873:10;20699:32;20712:9;20723:7;20699:12;:32::i;:::-;20691:73;;;;-1:-1:-1;;;20691:73:0;;;;;;;;;57921:9:::1;20868:35;20893:9;20868:24;:35::i;:::-;20860:88;;;;-1:-1:-1::0;;;20860:88:0::1;;;;;;;;;-1:-1:-1::0;;;;;57956:30:0;::::2;57948:82;;;;-1:-1:-1::0;;;57948:82:0::2;;;;;;;;;-1:-1:-1::0;;;;;58043:20:0;;::::2;;::::0;;;:9:::2;:20;::::0;;;;;;:52;;-1:-1:-1;;;;;;58043:52:0::2;::::0;;::::2;::::0;;;::::2;::::0;;;58113:57;;::::2;::::0;::::2;::::0;58043:52;;58113:57:::2;;56667:100:::0;56747:10;56727:32;;;;:9;:32;;;;;;;56720:39;;-1:-1:-1;;;;;;56720:39:0;;;;;;;;;;;;;;;;;;56667:100::o;53981:47::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;53981:47:0;;;;;;;:::o;58403:128::-;58463:7;58490:33;58513:9;58490:22;:33::i;:::-;58483:40;58403:128;-1:-1:-1;;58403:128:0:o;55755:691::-;55890:9;55901:10;20699:32;20712:9;20723:7;20699:12;:32::i;:::-;20691:73;;;;-1:-1:-1;;;20691:73:0;;;;;;;;;21648:10:::1;::::0;:36:::1;::::0;-1:-1:-1;;;21648:36:0;;55945:9;;-1:-1:-1;;;;;21648:10:0::1;::::0;:16:::1;::::0;:36:::1;::::0;55945:9;;21648:36:::1;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;21640:84;;;;-1:-1:-1::0;;;21640:84:0::1;;;;;;;;;21743:37;21770:9;21743:26;:37::i;:::-;21735:80;;;;-1:-1:-1::0;;;21735:80:0::1;;;;;;;;;55980:22:::0;;-1:-1:-1;;;;;55980:36:0::2;55972:88;;;;-1:-1:-1::0;;;55972:88:0::2;;;;;;;;;56117:29;:27;:29::i;:::-;56079:9;:35;;;:67;56071:103;;;;-1:-1:-1::0;;;56071:103:0::2;;;;;;;;;56229:9;:35;;;56193:9;:32;;;:71;;56185:103;;;;-1:-1:-1::0;;;56185:103:0::2;;;;;;;;;56339:15;56301:35;::::0;::::2;:53:::0;;;-1:-1:-1;;;;;56367:20:0;;::::2;;::::0;;;:9:::2;:20;::::0;;;;;;;:32;;;;-1:-1:-1;;;;;;56367:32:0::2;::::0;::::2;::::0;;;::::2;::::0;;;;::::2;::::0;-1:-1:-1;56367:32:0;::::2;::::0;;;::::2;::::0;;;::::2;::::0;;;;;;::::2;::::0;;::::2;::::0;;;;56410:28;;-1:-1:-1;;;56410:28:0;;;;56367:20;;56410:26:::2;::::0;:28:::2;::::0;;::::2;::::0;56367:20;;56410:28;;;;;56367:20;;56410:28;::::2;;::::0;::::2;;;;::::0;::::2;;;;;;;;;;;;::::0;::::2;;;;;;;;;20775:1:::1;55755:691:::0;;;;:::o;20531:29::-;;;-1:-1:-1;;;;;20531:29:0;;:::o;23377:206::-;23454:4;23478:10;;:36;;-1:-1:-1;;;23478:36:0;;-1:-1:-1;;;;;23478:10:0;;;;:16;;:36;;23503:9;;23478:36;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:97;;;;-1:-1:-1;23531:44:0;;-1:-1:-1;;;23531:44:0;;-1:-1:-1;;;;;23531:29:0;;;;;:44;;23569:4;;23531:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;62888:145;-1:-1:-1;;;;;62987:15:0;62960:7;62987:15;;;:9;:15;;;;;;;;:38;;;62888:145::o;58993:359::-;59068:7;59088:24;59115:58;59135:37;59162:9;59135:26;:37::i;:::-;59115:15;;:58;:19;:58;:::i;:::-;59088:85;;59263:81;53842:11;59263:56;59284:34;59308:9;59284:23;:34::i;:::-;59263:16;;:56;:20;:56;:::i;:::-;:60;:81;:60;:81;:::i;:::-;59256:88;58993:359;-1:-1:-1;;;58993:359:0:o;60063:465::-;60224:7;60249:19;60271:9;-1:-1:-1;;;;;60271:21:0;;:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;60249:45;-1:-1:-1;60337:9:0;60349:31;:14;60249:45;60349:31;:18;:31;:::i;:::-;60337:43;;60431:9;60443:49;60477:14;60443:29;:27;:29::i;:::-;:33;:49;:33;:49;:::i;:::-;60431:61;-1:-1:-1;60512:8:0;:1;60431:61;60512:8;:5;:8;:::i;:::-;60505:15;60063:465;-1:-1:-1;;;;;;60063:465:0:o;61007:690::-;61104:7;61113;61133:28;61164:10;;;;;;;;;-1:-1:-1;;;;;61164:10:0;-1:-1:-1;;;;;61164:23:0;;:25;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;61200:19;61222:10;;:68;;-1:-1:-1;;;61222:68:0;;61133:56;;-1:-1:-1;61200:19:0;;-1:-1:-1;;;;;61222:10:0;;;;:23;;:68;;61254:4;;61200:19;;61222:68;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;61200:90;-1:-1:-1;61303:25:0;61331:36;:12;61200:90;61331:36;:23;:36;:::i;:::-;61303:64;-1:-1:-1;61378:24:0;61405:35;:12;61303:64;61405:35;:16;:35;:::i;:::-;61378:62;;61453:9;-1:-1:-1;;;;;61453:14:0;;61468:24;61482:9;61468:13;:24::i;:::-;61494:16;61453:58;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;61548:1;61528:17;:21;61524:109;;;61566:55;;-1:-1:-1;;;61566:55:0;;-1:-1:-1;;;;;61566:14:0;;;;;:55;;61581:20;;61603:17;;61566:55;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;61524:109;61653:16;61671:17;;-1:-1:-1;61007:690:0;-1:-1:-1;;;;;61007:690:0:o;62086:343::-;62183:23;62209:9;-1:-1:-1;;;;;62209:28:0;;:30;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;62183:56;;62250:20;62273:88;62301:59;:48;62335:13;62301:29;:27;:29::i;:48::-;:57;:59::i;:::-;62273:16;;:88;:27;:88;:::i;:::-;62374:47;;-1:-1:-1;;;62374:47:0;;62250:111;;-1:-1:-1;;;;;;62374:32:0;;;;;:47;;62250:111;;62374:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;62086:343;;;;:::o;23088:146::-;23171:4;23218:8;-1:-1:-1;;;;;23195:31:0;:9;-1:-1:-1;;;;;23195:17:0;;:19;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;23195:31:0;;;23088:146;-1:-1:-1;;;23088:146:0:o;62729:151::-;-1:-1:-1;;;;;62831:15:0;62804:7;62831:15;;;:9;:15;;;;;:41;;;;62729:151::o;22849:::-;22952:40;;-1:-1:-1;;;22952:40:0;;22928:4;;-1:-1:-1;;;;;22952:25:0;;;;;:40;;22986:4;;22952:40;;;;15315:93;14870:8;15315:93;:::o;62570:151::-;-1:-1:-1;;;;;62672:15:0;62645:7;62672:15;;;:9;:15;;;;;:41;;;;62570:151::o;37655:136::-;37713:7;37740:43;37744:1;37747;37740:43;;;;;;;;;;;;;;;;;:3;:43::i;38545:471::-;38603:7;38848:6;38844:47;;-1:-1:-1;38878:1:0;38871:8;;38844:47;38915:5;;;38919:1;38915;:5;:1;38939:5;;;;;:10;38931:56;;;;-1:-1:-1;;;38931:56:0;;;;;;;;39492:132;39550:7;39577:39;39581:1;39584;39577:39;;;;;;;;;;;;;;;;;:3;:39::i;16409:126::-;16474:7;16501:26;14870:8;16501;:1;16507;16501:8;:5;:8;:::i;62437:125::-;-1:-1:-1;;;;;62526:15:0;;;62499:7;62526:15;;;:9;:15;;;;;:28;;;62437:125::o;48249:181::-;48305:6;-1:-1:-1;;;48332:5:0;:14;48324:67;;;;-1:-1:-1;;;48324:67:0;;;;;;;;;-1:-1:-1;48416:5:0;48249:181::o;16735:127::-;16798:6;16824:30;14929:8;16824;:1;16830;16824:8;:5;:8;:::i;:::-;:12;:30;:12;:30;:::i;38094:192::-;38180:7;38216:12;38208:6;;;;38200:29;;;;-1:-1:-1;;;38200:29:0;;;;;;;;;;-1:-1:-1;;;38252:5:0;;;38094:192::o;40120:278::-;40206:7;40241:12;40234:5;40226:28;;;;-1:-1:-1;;;40226:28:0;;;;;;;;;;;40265:9;40281:1;40277;:5;;;;;;;40120:278;-1:-1:-1;;;;;40120:278:0:o;34003:568::-;34059:6;34303;34299:47;;-1:-1:-1;34333:1:0;34326:8;;34299:47;34368:1;-1:-1:-1;;34368:7:0;:27;;;;;-1:-1:-1;;;34379:1:0;:16;34368:27;34366:30;34358:82;;;;-1:-1:-1;;;34358:82:0;;;;;;;;;34464:5;;;34468:1;34464;:5;:1;34488:5;;;;;:10;34480:62;;;;-1:-1:-1;;;34480:62:0;;;;;;;;35045:271;35101:6;35128;35120:51;;;;-1:-1:-1;;;35120:51:0;;;;;;;;;35192:1;-1:-1:-1;;35192:7:0;:27;;;;;-1:-1:-1;;;35203:1:0;:16;35192:27;35190:30;35182:76;;;;-1:-1:-1;;;35182:76:0;;;;;;;;;35271:8;35286:1;35282;:5;;;;;;;35045:271;-1:-1:-1;;;;35045:271:0:o;1880:263:-1:-;;1995:2;1983:9;1974:7;1970:23;1966:32;1963:2;;;-1:-1;;2001:12;1963:2;226:6;220:13;238:33;265:5;238:33;;2150:257;;2262:2;2250:9;2241:7;2237:23;2233:32;2230:2;;;-1:-1;;2268:12;2230:2;364:6;358:13;20911:5;19594:13;19587:21;20889:5;20886:32;20876:2;;-1:-1;;20922:12;2414:277;;2536:2;2524:9;2515:7;2511:23;2507:32;2504:2;;;-1:-1;;2542:12;2504:2;516:6;503:20;528:51;573:5;528:51;;2698:402;;;2837:2;2825:9;2816:7;2812:23;2808:32;2805:2;;;-1:-1;;2843:12;2805:2;516:6;503:20;528:51;573:5;528:51;;;2895:81;-1:-1;3013:2;3052:22;;72:20;97:33;72:20;97:33;;;3021:63;;;;2799:301;;;;;;3107:455;;;3260:9;3251:7;3247:23;3272:3;3247:23;3243:33;3240:2;;;-1:-1;;3279:12;3240:2;516:6;503:20;528:51;573:5;528:51;;;3331:81;-1:-1;886:4;-1:-1;;865:19;;861:30;858:2;;;-1:-1;;894:12;858:2;;18928;18922:9;886:4;18958:6;18954:17;19065:6;19053:10;19050:22;19029:18;19017:10;19014:34;19011:62;19008:2;;;-1:-1;;19076:12;19008:2;18928;19095:22;3449:2;3514:22;;72:20;97:33;72:20;97:33;;;1032:49;1014:16;1007:75;;18928:2;3518:9;1218:22;1669:20;3449:2;1183:5;1179:16;1172:75;1380:22;3518:9;1380:22;1669:20;18928:2;1345:5;1341:16;1334:75;886:4;3518:9;1545:22;1669:20;1380:22;1510:5;1506:16;1499:75;3457:89;;;;3234:328;;;;;;3569:402;;;3708:2;3696:9;3687:7;3683:23;3679:32;3676:2;;;-1:-1;;3714:12;3676:2;516:6;503:20;528:51;573:5;528:51;;;3766:81;3884:2;3923:22;;;;1669:20;;-1:-1;;;3670:301;3978:261;;4092:2;4080:9;4071:7;4067:23;4063:32;4060:2;;;-1:-1;;4098:12;4060:2;-1:-1;668:13;;4054:185;-1:-1;4054:185;10432:222;-1:-1;;;;;19876:54;;;;4587:37;;10559:2;10544:18;;10530:124;10661:333;-1:-1;;;;;19876:54;;;;4587:37;;10980:2;10965:18;;4878:36;10816:2;10801:18;;10787:207;11001:556;-1:-1;;;;;19876:54;;;;4587:37;;11377:2;11362:18;;4878:36;;;;11460:2;11445:18;;4878:36;11543:2;11528:18;;4878:36;11212:3;11197:19;;11183:374;11833:218;4878:36;;;11958:2;11943:18;;11929:122;12058:310;;12205:2;;12226:17;12219:47;5071:5;19217:12;19374:6;12205:2;12194:9;12190:18;19362:19;-1:-1;20397:101;20411:6;20408:1;20405:13;20397:101;;;20478:11;;;;;20472:18;20459:11;;;19402:14;20459:11;20452:39;20426:10;;20397:101;;;20513:6;20510:1;20507:13;20504:2;;;-1:-1;19402:14;20569:6;12194:9;20560:16;;20553:27;20504:2;-1:-1;865:19;20669:14;-1:-1;;20665:28;5229:39;;;;19402:14;5229:39;;12176:192;-1:-1;;;12176:192;12375:416;12575:2;12589:47;;;5505:2;12560:18;;;19362:19;5541:25;19402:14;;;5521:46;5586:12;;;12546:245;12798:416;12998:2;13012:47;;;5837:2;12983:18;;;19362:19;5873:34;19402:14;;;5853:55;-1:-1;;;5928:12;;;5921:32;5972:12;;;12969:245;13221:416;13421:2;13435:47;;;6223:2;13406:18;;;19362:19;6259:32;19402:14;;;6239:53;6311:12;;;13392:245;13644:416;13844:2;13858:47;;;6562:2;13829:18;;;19362:19;6598:27;19402:14;;;6578:48;6645:12;;;13815:245;14067:416;14267:2;14281:47;;;6896:2;14252:18;;;19362:19;6932:34;19402:14;;;6912:55;-1:-1;;;6987:12;;;6980:25;7024:12;;;14238:245;14490:416;14690:2;14704:47;;;7275:2;14675:18;;;19362:19;7311:34;19402:14;;;7291:55;-1:-1;;;7366:12;;;7359:25;7403:12;;;14661:245;14913:416;15113:2;15127:47;;;7654:2;15098:18;;;19362:19;7690:34;19402:14;;;7670:55;-1:-1;;;7745:12;;;7738:31;7788:12;;;15084:245;15336:416;15536:2;15550:47;;;8039:2;15521:18;;;19362:19;8075:34;19402:14;;;8055:55;-1:-1;;;8130:12;;;8123:31;8173:12;;;15507:245;15759:416;15959:2;15973:47;;;8424:2;15944:18;;;19362:19;-1:-1;;;19402:14;;;8440:42;8501:12;;;15930:245;16182:416;16382:2;16396:47;;;8752:2;16367:18;;;19362:19;8788:34;19402:14;;;8768:55;-1:-1;;;8843:12;;;8836:32;8887:12;;;16353:245;16605:416;16805:2;16819:47;;;9138:2;16790:18;;;19362:19;9174:34;19402:14;;;9154:55;-1:-1;;;9229:12;;;9222:27;9268:12;;;16776:245;17028:416;17228:2;17242:47;;;9519:2;17213:18;;;19362:19;9555:30;19402:14;;;9535:51;9605:12;;;17199:245;17451:416;17651:2;17665:47;;;17636:18;;;19362:19;9892:34;19402:14;;;9872:55;9946:12;;;17622:245;17874:416;18074:2;18088:47;;;10197:2;18059:18;;;19362:19;10233:33;19402:14;;;10213:54;10286:12;;;18045:245;18526:333;4878:36;;;18845:2;18830:18;;4878:36;18681:2;18666:18;;18652:207;20706:117;-1:-1;;;;;19876:54;;20765:35;;20755:2;;20814:1;;20804:12;20755:2;20749:74;

Swarm Source

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