Contract 0x2C641e14AfEcb16b4Aa6601A40EE60c3cc792f7D

 
 
Txn Hash
Method
Block
From
To
Value
0x0d5ee1368a7c5ff9ab0764074916add22e319f1c62810eeebebcb657c053c7eaDistribute140334272022-01-19 2:58:22319 days 10 hrs ago0x1a123d835b006d27d4978c8eb40b14f08e0b8607 IN  0x2c641e14afecb16b4aa6601a40ee60c3cc792f7d0 Ether0.01575137 111.71581779
0x52640efc0a38e0039fd58ed060b898b44ad71c70271f4654880b42910f2247e5Distribute139360232022-01-04 1:26:36334 days 11 hrs ago0xd20eb2390e675b000adb8511f62b28404115a1a4 IN  0x2c641e14afecb16b4aa6601a40ee60c3cc792f7d0 Ether0.00846311 96.17611819
0x7e18a7da72e1a8a6565ea909d99c4072d7a4e37ca7d8b23fe6be84760eefad17Distribute133798492021-10-08 18:38:53421 days 18 hrs ago0x1a123d835b006d27d4978c8eb40b14f08e0b8607 IN  0x2c641e14afecb16b4aa6601a40ee60c3cc792f7d0 Ether0.00502416 132.8090653
0x118841f081bc0bf9763de5b61dd382f6d73137312d1db8aec278496c70df899eDistribute131613932021-09-04 20:25:04455 days 16 hrs ago0xbedf3cf16ba1fce6c3b751903cf77e51d51e05b8 IN  0x2c641e14afecb16b4aa6601a40ee60c3cc792f7d0 Ether0.02410445 100.86008781
0xd3d328570ab7163e2cb16e00518a7193256da5ff3b1a6a1317cecd8304679abaDistribute131407782021-09-01 16:13:54458 days 20 hrs ago0x1a123d835b006d27d4978c8eb40b14f08e0b8607 IN  0x2c641e14afecb16b4aa6601a40ee60c3cc792f7d0 Ether0.01425873 133.5150042
0x1ebe247ca102781aad0240cf69ec53b11b99bbfaec7eddd1c16df0a49e6992a0Distribute130033182021-08-11 10:27:53480 days 2 hrs ago0xc3d6880fd95e06c816cb030fac45b3ffe3651cb0 IN  0x2c641e14afecb16b4aa6601a40ee60c3cc792f7d0 Ether0.0048872745.82060878
0x26f0fee4e9e7eb9250d5d12a2c1eeea99bafff994037084f3b26046bc6b4d4baDistribute129316742021-07-31 6:11:33491 days 6 hrs agoyearn: Deployer 1 IN  0x2c641e14afecb16b4aa6601a40ee60c3cc792f7d0 Ether0.0018062818
0x6671cdc23df87d340de69eb487b698f765fc822410deafbbee9019ae12494c5fDistribute129276462021-07-30 15:00:10491 days 22 hrs ago0x1a123d835b006d27d4978c8eb40b14f08e0b8607 IN  0x2c641e14afecb16b4aa6601a40ee60c3cc792f7d0 Ether0.0036706138
0xdb9b37d0f5d73e47d0e1c5af10af2e93189b255bc4e249dcfa9a7ccf215389a7Distribute129183462021-07-29 3:20:40493 days 9 hrs ago0x1a123d835b006d27d4978c8eb40b14f08e0b8607 IN  0x2c641e14afecb16b4aa6601a40ee60c3cc792f7d0 Ether0.001931920
0x52a9f01d7ba3d591ce9630b9df0eb8418259656ba9cf7c6dc7c0f0115a87fa64Distribute129171932021-07-28 23:04:42493 days 14 hrs ago0xc3d6880fd95e06c816cb030fac45b3ffe3651cb0 IN  0x2c641e14afecb16b4aa6601a40ee60c3cc792f7d0 Ether0.0023822624
0xacfba60b18407e406679953d01b5209e48262803a0b955222eb42dfe6d1bbe1fDistribute127441122021-07-01 21:20:09520 days 15 hrs ago0x1a123d835b006d27d4978c8eb40b14f08e0b8607 IN  0x2c641e14afecb16b4aa6601a40ee60c3cc792f7d0 Ether0.0024148725
0x2e6fe535cf5c5c15946792a8db0325d45f0da79672aec018b16275a6001e50ccDistribute127441122021-07-01 21:20:09520 days 15 hrs ago0x1a123d835b006d27d4978c8eb40b14f08e0b8607 IN  0x2c641e14afecb16b4aa6601a40ee60c3cc792f7d0 Ether0.0024148725
0x52b0902163aa7976f1c425be724d0acabeeddb153751d67c32d63094275714e8Distribute126417182021-06-15 22:13:46536 days 14 hrs ago0xc3d6880fd95e06c816cb030fac45b3ffe3651cb0 IN  0x2c641e14afecb16b4aa6601a40ee60c3cc792f7d0 Ether0.0017362918
0x1d418ede02b5d39d2d6d45325ccf9b044cd0590fb4fb6bbf25def5d7cf094d9bDistribute126346732021-06-14 20:13:39537 days 16 hrs ago0xbedf3cf16ba1fce6c3b751903cf77e51d51e05b8 IN  0x2c641e14afecb16b4aa6601a40ee60c3cc792f7d0 Ether0.002519920
0x09a7bbfff0489aa386f5cfde3fd67ad03fa51fd614742c0a5e9b29101bda4e92Set Contributors125957772021-06-08 19:27:51543 days 17 hrs agoyearn: Deployer 1 IN  0x2c641e14afecb16b4aa6601a40ee60c3cc792f7d0 Ether0.0018321113
0x645bf332faea14184038c685304e657bc58b84c2f355569f990cca668410f962Set Contributors125842372021-06-07 0:32:49545 days 12 hrs ago0x1a123d835b006d27d4978c8eb40b14f08e0b8607 IN  0x2c641e14afecb16b4aa6601a40ee60c3cc792f7d0 Ether0.0016058717
0xa97b367445dee6387146ccd868e03d4116a15f07edd6c381bd6189689236d538Distribute125500522021-06-01 17:57:23550 days 19 hrs ago0x1a123d835b006d27d4978c8eb40b14f08e0b8607 IN  0x2c641e14afecb16b4aa6601a40ee60c3cc792f7d0 Ether0.0029944431.00000134
0x436f27c39a5a8560cbecfcc9bbb4c7cb77f7a5dbf89b491fd304766b5d5d201aDistribute125500492021-06-01 17:57:08550 days 19 hrs ago0x1a123d835b006d27d4978c8eb40b14f08e0b8607 IN  0x2c641e14afecb16b4aa6601a40ee60c3cc792f7d0 Ether0.0029944431
0x23b2f386831d775bc3125c831e642d07217a23d68b77f1f4ddc4d341ef98736bDistribute125460052021-06-01 2:48:18551 days 10 hrs ago0x6afb7c9a6e8f34a3e0ec6b734942a5589a84f44c IN  0x2c641e14afecb16b4aa6601a40ee60c3cc792f7d0 Ether0.0019653327
0x0137a97c57b73f6aea22f4f61bffd1aac58c11d4e4210b1c0450fd79bbd37bc9Set Contributors125203052021-05-28 3:06:18555 days 10 hrs ago0xbedf3cf16ba1fce6c3b751903cf77e51d51e05b8 IN  0x2c641e14afecb16b4aa6601a40ee60c3cc792f7d0 Ether0.0067268335.9
0x5244325b05df1e3d7e8ac1d4f0f2023e6f671016c2242098620d574dd450d893Distribute125168002021-05-27 14:06:43555 days 23 hrs ago0x6afb7c9a6e8f34a3e0ec6b734942a5589a84f44c IN  0x2c641e14afecb16b4aa6601a40ee60c3cc792f7d0 Ether0.001670730
0xe52478993e9eedf86925f696ff0dd626bcdf93ce7e62801dd9c3d553c8b792f1Distribute124998652021-05-24 22:50:00558 days 14 hrs ago0xc3d6880fd95e06c816cb030fac45b3ffe3651cb0 IN  0x2c641e14afecb16b4aa6601a40ee60c3cc792f7d0 Ether0.0047645248
0x04336dc3e82c1466236ac415df8f6aa18fde8152efc53181c037b393e6916964Distribute124936362021-05-23 23:46:13559 days 13 hrs ago0x6afb7c9a6e8f34a3e0ec6b734942a5589a84f44c IN  0x2c641e14afecb16b4aa6601a40ee60c3cc792f7d0 Ether0.0022666540.70137469
0x04b7aafd3ce511625d86ee54013fc24c732f6fc364d74438aa6ef959e19d0fb3Distribute124335792021-05-14 16:27:13568 days 20 hrs ago0xc3d6880fd95e06c816cb030fac45b3ffe3651cb0 IN  0x2c641e14afecb16b4aa6601a40ee60c3cc792f7d0 Ether0.01397366149
0x56886e712f92de7587802d264a9c92ca4457130267ed03eeacf99fb54767032bDistribute123672532021-05-04 10:40:46579 days 2 hrs ago0x6afb7c9a6e8f34a3e0ec6b734942a5589a84f44c IN  0x2c641e14afecb16b4aa6601a40ee60c3cc792f7d0 Ether0.0029843941
[ Download CSV Export 
View more zero value Internal Transactions in Advanced View mode
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
SharerV3

Compiler Version
v0.6.12+commit.27d51765

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, None license

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2021-02-16
*/

// SPDX-License-Identifier: NONE

pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;



// Part: IStrategy

interface IStrategy{
    function vault() external view returns (address);

}

// Part: OpenZeppelin/[email protected]/Address

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

// Part: OpenZeppelin/[email protected]/IERC20

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

// Part: OpenZeppelin/[email protected]/SafeMath

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

// Part: OpenZeppelin/[email protected]/SafeERC20

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

// File: SharerV3.sol

//for version 0.3.1 or above of base strategy

contract SharerV3 {
    using SafeERC20 for IERC20;
    using Address for address;
    using SafeMath for uint256;
    
    event ContributorsSet(address indexed strategy, address[] contributors, uint256[] numOfShares);
    event Distribute(address indexed strategy, uint256 totalDistributed);

    struct Contributor {
        address contributor;
        uint256 numOfShares;
    }
    mapping(address => Contributor[]) public shares;
    address public strategistMs;
    address public pendingStrategistMs;


    constructor() public {
        strategistMs = msg.sender;
    }

    function changeStratMs(address _ms) external {
        require(msg.sender == strategistMs);
        pendingStrategistMs = _ms;
    }

    function acceptStratMs() external {
        require(msg.sender == pendingStrategistMs);
        strategistMs = pendingStrategistMs;
    }

    function viewContributors(address strategy) public view returns (Contributor[] memory){
       return shares[strategy];
    }

    // Contributors for a strategy are set all at once, not on individual basis.
    // Initialization of contributors list for any strategy can be done by anyone. Afterwards, only Strategist MS can call this
    // If sum of total shares set < 1,000, any remainder of shares will go to strategist multisig
    function setContributors(address strategy, address[] calldata _contributors, uint256[] calldata _numOfShares) public {
        require(_contributors.length == _numOfShares.length, "length not the same");

        require(shares[strategy].length == 0 || msg.sender == strategistMs, "Only Strat MS can overwrite");

        delete shares[strategy];
        uint256 totalShares = 0;

        for(uint256 i = 0; i < _contributors.length; i++ ){
            totalShares = totalShares.add(_numOfShares[i]);
            shares[strategy].push(Contributor(_contributors[i], _numOfShares[i]));
        }
        require(totalShares <= 1000, "share total more than 100%");
        emit ContributorsSet(strategy, _contributors, _numOfShares);
    }


    function distribute(address _strategy) public{
        IStrategy strategy = IStrategy(_strategy);
        IERC20 reward =  IERC20(strategy.vault());
        
        uint256 totalRewards = reward.balanceOf(_strategy);
        if(totalRewards <= 1000){
           return;
        }
        uint256 remainingRewards = totalRewards;

        Contributor[] memory contributorsT = shares[_strategy];
        for(uint256 i = 0; i < contributorsT.length; i++ ){
                address cont = contributorsT[i].contributor;
                uint256 share = totalRewards.mul(contributorsT[i].numOfShares).div(1000);
                reward.safeTransferFrom(_strategy, cont, share);
                remainingRewards -= share;
        }
        reward.safeTransferFrom(_strategy, strategistMs, remainingRewards);
        emit Distribute(_strategy, totalRewards);
    }

    function checkBalance(address _strategy) public view returns(uint256){
        IStrategy strategy = IStrategy(_strategy);
        IERC20 reward =  IERC20(strategy.vault());
        return reward.balanceOf(_strategy);
    }
}

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"strategy","type":"address"},{"indexed":false,"internalType":"address[]","name":"contributors","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"numOfShares","type":"uint256[]"}],"name":"ContributorsSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"strategy","type":"address"},{"indexed":false,"internalType":"uint256","name":"totalDistributed","type":"uint256"}],"name":"Distribute","type":"event"},{"inputs":[],"name":"acceptStratMs","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_ms","type":"address"}],"name":"changeStratMs","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_strategy","type":"address"}],"name":"checkBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_strategy","type":"address"}],"name":"distribute","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pendingStrategistMs","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"strategy","type":"address"},{"internalType":"address[]","name":"_contributors","type":"address[]"},{"internalType":"uint256[]","name":"_numOfShares","type":"uint256[]"}],"name":"setContributors","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"shares","outputs":[{"internalType":"address","name":"contributor","type":"address"},{"internalType":"uint256","name":"numOfShares","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"strategistMs","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"strategy","type":"address"}],"name":"viewContributors","outputs":[{"components":[{"internalType":"address","name":"contributor","type":"address"},{"internalType":"uint256","name":"numOfShares","type":"uint256"}],"internalType":"struct SharerV3.Contributor[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b50600180546001600160a01b0319163317905561102d806100326000396000f3fe608060405234801561001057600080fd5b50600436106100935760003560e01c8063259ddefc11610066578063259ddefc146100f3578063345e9cd6146101145780635f5152261461011c57806363453ae11461013c578063ab32256b1461014f57610093565b806305478ef8146100985780630ed820ef146100ad5780630f5a0ce5146100cb57806310a25be7146100d3575b600080fd5b6100ab6100a6366004610b87565b610162565b005b6100b561019b565b6040516100c29190610cbe565b60405180910390f35b6100ab6101aa565b6100e66100e1366004610b87565b6101e5565b6040516100c29190610d8e565b610106610101366004610c3f565b61026e565b6040516100c2929190610cf6565b6100b56102b1565b61012f61012a366004610b87565b6102c0565b6040516100c29190610fad565b6100ab61014a366004610b87565b6103c0565b6100ab61015d366004610bbf565b610636565b6001546001600160a01b0316331461017957600080fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6001546001600160a01b031681565b6002546001600160a01b031633146101c157600080fd5b600254600180546001600160a01b0319166001600160a01b03909216919091179055565b6001600160a01b038116600090815260208181526040808320805482518185028101850190935280835260609492939192909184015b82821015610263576000848152602090819020604080518082019091526002850290910180546001600160a01b0316825260019081015482840152908352909201910161021b565b505050509050919050565b6000602052816000526040600020818154811061028757fe5b6000918252602090912060029091020180546001909101546001600160a01b039091169250905082565b6002546001600160a01b031681565b6000808290506000816001600160a01b031663fbfa77cf6040518163ffffffff1660e01b815260040160206040518083038186803b15801561030157600080fd5b505afa158015610315573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103399190610ba3565b6040516370a0823160e01b81529091506001600160a01b038216906370a0823190610368908790600401610cbe565b60206040518083038186803b15801561038057600080fd5b505afa158015610394573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103b89190610c8a565b949350505050565b60008190506000816001600160a01b031663fbfa77cf6040518163ffffffff1660e01b815260040160206040518083038186803b15801561040057600080fd5b505afa158015610414573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104389190610ba3565b90506000816001600160a01b03166370a08231856040518263ffffffff1660e01b81526004016104689190610cbe565b60206040518083038186803b15801561048057600080fd5b505afa158015610494573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104b89190610c8a565b90506103e881116104cb57505050610633565b6001600160a01b0384166000908152602081815260408083208054825181850281018501909352808352859460609484015b82821015610545576000848152602090819020604080518082019091526002850290910180546001600160a01b031682526001908101548284015290835290920191016104fd565b50505050905060005b81518110156105cf57600082828151811061056557fe5b602002602001015160000151905060006105ab6103e86105a586868151811061058a57fe5b6020026020010151602001518961081e90919063ffffffff16565b90610861565b90506105c26001600160a01b0388168a84846108a3565b909303925060010161054e565b506001546105ec906001600160a01b0386811691899116856108a3565b856001600160a01b03167fc1d32ad5cca423e7dda2123dbf8c482f8e77d00b631c06e903a47f2cec1334df846040516106259190610fad565b60405180910390a250505050505b50565b82811461065e5760405162461bcd60e51b815260040161065590610e50565b60405180910390fd5b6001600160a01b038516600090815260208190526040902054158061068d57506001546001600160a01b031633145b6106a95760405162461bcd60e51b815260040161065590610ef5565b6001600160a01b03851660009081526020819052604081206106ca91610af8565b6000805b848110156107bc576106fb8484838181106106e557fe5b905060200201358361090190919063ffffffff16565b9150600080886001600160a01b03166001600160a01b03168152602001908152602001600020604051806040016040528088888581811061073857fe5b905060200201602081019061074d9190610b87565b6001600160a01b0316815260200186868581811061076757fe5b60209081029290920135909252835460018082018655600095865294829020845160029092020180546001600160a01b0319166001600160a01b039092169190911781559201519183019190915550016106ce565b506103e88111156107df5760405162461bcd60e51b815260040161065590610ebe565b856001600160a01b03167fd9b8935557e5467344eaaa57a20dfaef2be644d7938534df5c983b88b72f4579868686866040516106259493929190610d0f565b60008261082d5750600061085b565b8282028284828161083a57fe5b04146108585760405162461bcd60e51b815260040161065590610e7d565b90505b92915050565b600061085883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610926565b6108fb846323b872dd60e01b8585856040516024016108c493929190610cd2565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261095d565b50505050565b6000828201838110156108585760405162461bcd60e51b815260040161065590610e19565b600081836109475760405162461bcd60e51b81526004016106559190610de6565b50600083858161095357fe5b0495945050505050565b60606109b2826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166109f19092919063ffffffff16565b8051909150156109ec57808060200190518101906109d09190610c6a565b6109ec5760405162461bcd60e51b815260040161065590610f63565b505050565b60606103b884846000856060610a0685610abf565b610a225760405162461bcd60e51b815260040161065590610f2c565b60006060866001600160a01b03168587604051610a3f9190610ca2565b60006040518083038185875af1925050503d8060008114610a7c576040519150601f19603f3d011682016040523d82523d6000602084013e610a81565b606091505b50915091508115610a955791506103b89050565b805115610aa55780518082602001fd5b8360405162461bcd60e51b81526004016106559190610de6565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4708181148015906103b8575050151592915050565b508054600082556002029060005260206000209081019061063391905b80821115610b3a5780546001600160a01b031916815560006001820155600201610b15565b5090565b60008083601f840112610b4f578182fd5b50813567ffffffffffffffff811115610b66578182fd5b6020830191508360208083028501011115610b8057600080fd5b9250929050565b600060208284031215610b98578081fd5b813561085881610fe2565b600060208284031215610bb4578081fd5b815161085881610fe2565b600080600080600060608688031215610bd6578081fd5b8535610be181610fe2565b9450602086013567ffffffffffffffff80821115610bfd578283fd5b610c0989838a01610b3e565b90965094506040880135915080821115610c21578283fd5b50610c2e88828901610b3e565b969995985093965092949392505050565b60008060408385031215610c51578182fd5b8235610c5c81610fe2565b946020939093013593505050565b600060208284031215610c7b578081fd5b81518015158114610858578182fd5b600060208284031215610c9b578081fd5b5051919050565b60008251610cb4818460208701610fb6565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b6040808252810184905260008560608301825b87811015610d525760208335610d3781610fe2565b6001600160a01b031683529283019290910190600101610d22565b5083810360208501528481526001600160fb1b03851115610d71578283fd5b602085029150818660208301370160200190815295945050505050565b602080825282518282018190526000919060409081850190868401855b82811015610dd957815180516001600160a01b03168552860151868501529284019290850190600101610dab565b5091979650505050505050565b6000602082528251806020840152610e05816040850160208701610fb6565b601f01601f19169190910160400192915050565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b6020808252601390820152726c656e677468206e6f74207468652073616d6560681b604082015260600190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6040820152607760f81b606082015260800190565b6020808252601a908201527f736861726520746f74616c206d6f7265207468616e2031303025000000000000604082015260600190565b6020808252601b908201527f4f6e6c79205374726174204d532063616e206f76657277726974650000000000604082015260600190565b6020808252601d908201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604082015260600190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6040820152691bdd081cdd58d8d9595960b21b606082015260800190565b90815260200190565b60005b83811015610fd1578181015183820152602001610fb9565b838111156108fb5750506000910152565b6001600160a01b038116811461063357600080fdfea2646970667358221220473020a6b1526ed867d42132868ef50de6ed8c8d24b04f5434c3cd179397e2bd64736f6c634300060c0033

Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.

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