Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 388 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Set Reward Per S... | 16382841 | 610 days ago | IN | 0 ETH | 0.00326064 | ||||
Distribute Rewar... | 16375668 | 611 days ago | IN | 0 ETH | 0.00129735 | ||||
Distribute Rewar... | 16368503 | 612 days ago | IN | 0 ETH | 0.00125426 | ||||
Distribute Rewar... | 16361331 | 613 days ago | IN | 0 ETH | 0.00122684 | ||||
Distribute Rewar... | 16354166 | 614 days ago | IN | 0 ETH | 0.00124136 | ||||
Distribute Rewar... | 16347004 | 615 days ago | IN | 0 ETH | 0.00155568 | ||||
Distribute Rewar... | 16339852 | 616 days ago | IN | 0 ETH | 0.00130253 | ||||
Distribute Rewar... | 16332684 | 617 days ago | IN | 0 ETH | 0.00139361 | ||||
Distribute Rewar... | 16325519 | 618 days ago | IN | 0 ETH | 0.00121015 | ||||
Distribute Rewar... | 16318350 | 619 days ago | IN | 0 ETH | 0.00119579 | ||||
Distribute Rewar... | 16311177 | 620 days ago | IN | 0 ETH | 0.00134439 | ||||
Distribute Rewar... | 16304007 | 621 days ago | IN | 0 ETH | 0.00125983 | ||||
Distribute Rewar... | 16296848 | 622 days ago | IN | 0 ETH | 0.0012309 | ||||
Distribute Rewar... | 16289676 | 623 days ago | IN | 0 ETH | 0.00133708 | ||||
Distribute Rewar... | 16282510 | 624 days ago | IN | 0 ETH | 0.00115882 | ||||
Distribute Rewar... | 16275344 | 625 days ago | IN | 0 ETH | 0.00102659 | ||||
Distribute Rewar... | 16268191 | 626 days ago | IN | 0 ETH | 0.00091166 | ||||
Distribute Rewar... | 16261025 | 627 days ago | IN | 0 ETH | 0.00098191 | ||||
Distribute Rewar... | 16253856 | 628 days ago | IN | 0 ETH | 0.00092131 | ||||
Distribute Rewar... | 16246680 | 629 days ago | IN | 0 ETH | 0.00113788 | ||||
Distribute Rewar... | 16239504 | 630 days ago | IN | 0 ETH | 0.00107852 | ||||
Distribute Rewar... | 16232340 | 631 days ago | IN | 0 ETH | 0.00107227 | ||||
Distribute Rewar... | 16225168 | 632 days ago | IN | 0 ETH | 0.00113648 | ||||
Distribute Rewar... | 16218003 | 633 days ago | IN | 0 ETH | 0.00112684 | ||||
Distribute Rewar... | 16210835 | 634 days ago | IN | 0 ETH | 0.00122199 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
LiquidityMiningManager
Compiler Version
v0.8.7+commit.e28d00a7
Optimization Enabled:
Yes with 800 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.7; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "./interfaces/IBasePool.sol"; import "./base/TokenSaver.sol"; contract LiquidityMiningManager is TokenSaver { using SafeERC20 for IERC20; bytes32 public constant GOV_ROLE = keccak256("GOV_ROLE"); bytes32 public constant REWARD_DISTRIBUTOR_ROLE = keccak256("REWARD_DISTRIBUTOR_ROLE"); uint256 public MAX_POOL_COUNT = 10; IERC20 immutable public reward; address immutable public rewardSource; uint256 public rewardPerSecond; //total reward amount per second uint256 public lastDistribution; //when rewards were last pushed uint256 public totalWeight; mapping(address => bool) public poolAdded; Pool[] public pools; struct Pool { IBasePool poolContract; uint256 weight; } modifier onlyGov { require(hasRole(GOV_ROLE, _msgSender()), "LiquidityMiningManager.onlyGov: permission denied"); _; } modifier onlyRewardDistributor { require(hasRole(REWARD_DISTRIBUTOR_ROLE, _msgSender()), "LiquidityMiningManager.onlyRewardDistributor: permission denied"); _; } event PoolAdded(address indexed pool, uint256 weight); event PoolRemoved(uint256 indexed poolId, address indexed pool); event WeightAdjusted(uint256 indexed poolId, address indexed pool, uint256 newWeight); event RewardsPerSecondSet(uint256 rewardsPerSecond); event RewardsDistributed(address _from, uint256 indexed _amount); constructor(address _reward, address _rewardSource) { require(_reward != address(0), "LiquidityMiningManager.constructor: reward token must be set"); require(_rewardSource != address(0), "LiquidityMiningManager.constructor: rewardSource token must be set"); reward = IERC20(_reward); rewardSource = _rewardSource; } function addPool(address _poolContract, uint256 _weight) external onlyGov { distributeRewards(); require(_poolContract != address(0), "LiquidityMiningManager.addPool: pool contract must be set"); require(!poolAdded[_poolContract], "LiquidityMiningManager.addPool: Pool already added"); require(pools.length < MAX_POOL_COUNT, "LiquidityMiningManager.addPool: Max amount of pools reached"); // add pool pools.push(Pool({ poolContract: IBasePool(_poolContract), weight: _weight })); poolAdded[_poolContract] = true; // increase totalWeight totalWeight += _weight; // Approve max token amount reward.safeApprove(_poolContract, type(uint256).max); emit PoolAdded(_poolContract, _weight); } function removePool(uint256 _poolId) external onlyGov { require(_poolId < pools.length, "LiquidityMiningManager.removePool: Pool does not exist"); distributeRewards(); address poolAddress = address(pools[_poolId].poolContract); // decrease totalWeight totalWeight -= pools[_poolId].weight; // remove pool pools[_poolId] = pools[pools.length - 1]; pools.pop(); poolAdded[poolAddress] = false; emit PoolRemoved(_poolId, poolAddress); } function adjustWeight(uint256 _poolId, uint256 _newWeight) external onlyGov { require(_poolId < pools.length, "LiquidityMiningManager.adjustWeight: Pool does not exist"); distributeRewards(); Pool storage pool = pools[_poolId]; totalWeight -= pool.weight; totalWeight += _newWeight; pool.weight = _newWeight; emit WeightAdjusted(_poolId, address(pool.poolContract), _newWeight); } function setRewardPerSecond(uint256 _rewardPerSecond) external onlyGov { distributeRewards(); rewardPerSecond = _rewardPerSecond; emit RewardsPerSecondSet(_rewardPerSecond); } function distributeRewards() public onlyRewardDistributor { uint256 timePassed = block.timestamp - lastDistribution; uint256 totalRewardAmount = rewardPerSecond * timePassed; lastDistribution = block.timestamp; // return if pool length == 0 if(pools.length == 0) { return; } // return if accrued rewards == 0 if(totalRewardAmount == 0) { return; } reward.safeTransferFrom(rewardSource, address(this), totalRewardAmount); for(uint256 i = 0; i < pools.length; i ++) { Pool memory pool = pools[i]; uint256 poolRewardAmount = totalRewardAmount * pool.weight / totalWeight; // Ignore tx failing to prevent a single pool from halting reward distribution address(pool.poolContract).call(abi.encodeWithSelector(pool.poolContract.distributeRewards.selector, poolRewardAmount)); } uint256 leftOverReward = reward.balanceOf(address(this)); // send back excess but ignore dust if(leftOverReward > 1) { reward.safeTransfer(rewardSource, leftOverReward); } emit RewardsDistributed(_msgSender(), totalRewardAmount); } function getPools() external view returns(Pool[] memory result) { return pools; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.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 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' 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) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance( IERC20 token, address spender, uint256 value ) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _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 require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.7; interface IBasePool { function distributeRewards(uint256 _amount) external; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.7; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/access/AccessControlEnumerable.sol"; contract TokenSaver is AccessControlEnumerable { using SafeERC20 for IERC20; bytes32 public constant TOKEN_SAVER_ROLE = keccak256("TOKEN_SAVER_ROLE"); event TokenSaved(address indexed by, address indexed receiver, address indexed token, uint256 amount); modifier onlyTokenSaver() { require(hasRole(TOKEN_SAVER_ROLE, _msgSender()), "TokenSaver.onlyTokenSaver: permission denied"); _; } constructor() { _setupRole(DEFAULT_ADMIN_ROLE, _msgSender()); } function saveToken(address _token, address _receiver, uint256 _amount) external onlyTokenSaver { IERC20(_token).safeTransfer(_receiver, _amount); emit TokenSaved(_msgSender(), _receiver, _token, _amount); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Address.sol) pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/AccessControlEnumerable.sol) pragma solidity ^0.8.0; import "./IAccessControlEnumerable.sol"; import "./AccessControl.sol"; import "../utils/structs/EnumerableSet.sol"; /** * @dev Extension of {AccessControl} that allows enumerating the members of each role. */ abstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl { using EnumerableSet for EnumerableSet.AddressSet; mapping(bytes32 => EnumerableSet.AddressSet) private _roleMembers; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) public view override returns (address) { return _roleMembers[role].at(index); } /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) public view override returns (uint256) { return _roleMembers[role].length(); } /** * @dev Overload {_grantRole} to track enumerable memberships */ function _grantRole(bytes32 role, address account) internal virtual override { super._grantRole(role, account); _roleMembers[role].add(account); } /** * @dev Overload {_revokeRole} to track enumerable memberships */ function _revokeRole(bytes32 role, address account) internal virtual override { super._revokeRole(role, account); _roleMembers[role].remove(account); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol) pragma solidity ^0.8.0; import "./IAccessControl.sol"; /** * @dev External interface of AccessControlEnumerable declared to support ERC165 detection. */ interface IAccessControlEnumerable is IAccessControl { /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) external view returns (address); /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/AccessControl.sol) pragma solidity ^0.8.0; import "./IAccessControl.sol"; import "../utils/Context.sol"; import "../utils/Strings.sol"; import "../utils/introspection/ERC165.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping(address => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role, _msgSender()); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", Strings.toHexString(uint160(account), 20), " is missing role ", Strings.toHexString(uint256(role), 32) ) ) ); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== * * NOTE: This function is deprecated in favor of {_grantRole}. */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Grants `role` to `account`. * * Internal function without access restriction. */ function _grantRole(bytes32 role, address account) internal virtual { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } /** * @dev Revokes `role` from `account`. * * Internal function without access restriction. */ function _revokeRole(bytes32 role, address account) internal virtual { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/structs/EnumerableSet.sol) pragma solidity ^0.8.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping(bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; if (lastIndex != toDeleteIndex) { bytes32 lastvalue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastvalue; // Update the index for the moved value set._indexes[lastvalue] = valueIndex; // Replace lastvalue's index to valueIndex } // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { return set._values[index]; } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function _values(Set storage set) private view returns (bytes32[] memory) { return set._values; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { return _values(set._inner); } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(AddressSet storage set) internal view returns (address[] memory) { bytes32[] memory store = _values(set._inner); address[] memory result; assembly { result := store } return result; } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(UintSet storage set) internal view returns (uint256[] memory) { bytes32[] memory store = _values(set._inner); uint256[] memory result; assembly { result := store } return result; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol) pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
{ "metadata": { "bytecodeHash": "none" }, "optimizer": { "enabled": true, "runs": 800 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_reward","type":"address"},{"internalType":"address","name":"_rewardSource","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pool","type":"address"},{"indexed":false,"internalType":"uint256","name":"weight","type":"uint256"}],"name":"PoolAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"poolId","type":"uint256"},{"indexed":true,"internalType":"address","name":"pool","type":"address"}],"name":"PoolRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_from","type":"address"},{"indexed":true,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"RewardsDistributed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"rewardsPerSecond","type":"uint256"}],"name":"RewardsPerSecondSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"by","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TokenSaved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"poolId","type":"uint256"},{"indexed":true,"internalType":"address","name":"pool","type":"address"},{"indexed":false,"internalType":"uint256","name":"newWeight","type":"uint256"}],"name":"WeightAdjusted","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"GOV_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_POOL_COUNT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"REWARD_DISTRIBUTOR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOKEN_SAVER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_poolContract","type":"address"},{"internalType":"uint256","name":"_weight","type":"uint256"}],"name":"addPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_poolId","type":"uint256"},{"internalType":"uint256","name":"_newWeight","type":"uint256"}],"name":"adjustWeight","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"distributeRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getPools","outputs":[{"components":[{"internalType":"contract IBasePool","name":"poolContract","type":"address"},{"internalType":"uint256","name":"weight","type":"uint256"}],"internalType":"struct LiquidityMiningManager.Pool[]","name":"result","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastDistribution","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"poolAdded","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"pools","outputs":[{"internalType":"contract IBasePool","name":"poolContract","type":"address"},{"internalType":"uint256","name":"weight","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_poolId","type":"uint256"}],"name":"removePool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"reward","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardPerSecond","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardSource","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"saveToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_rewardPerSecond","type":"uint256"}],"name":"setRewardPerSecond","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalWeight","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60c0604052600a6002553480156200001657600080fd5b50604051620024b6380380620024b68339810160408190526200003991620002d0565b620000466000336200014e565b6001600160a01b038216620000b75760405162461bcd60e51b815260206004820152603c60248201526000805160206200249683398151915260448201527f6f723a2072657761726420746f6b656e206d757374206265207365740000000060648201526084015b60405180910390fd5b6001600160a01b0381166200012f5760405162461bcd60e51b815260206004820152604260248201526000805160206200249683398151915260448201527f6f723a20726577617264536f7572636520746f6b656e206d7573742062652073606482015261195d60f21b608482015260a401620000ae565b6001600160601b0319606092831b8116608052911b1660a05262000308565b6200015a82826200015e565b5050565b620001758282620001a160201b620013b61760201c565b60008281526001602090815260409091206200019c9183906200145462000241821b17901c565b505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166200015a576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620001fd3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600062000258836001600160a01b03841662000261565b90505b92915050565b6000818152600183016020526040812054620002aa575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556200025b565b5060006200025b565b80516001600160a01b0381168114620002cb57600080fd5b919050565b60008060408385031215620002e457600080fd5b620002ef83620002b3565b9150620002ff60208401620002b3565b90509250929050565b60805160601c60a05160601c6121386200035e6000396000818161038c01528181610b290152610d540152600081816101eb015281816107dd01528181610b0701528181610c980152610d3201526121386000f3fe608060405234801561001057600080fd5b50600436106101b95760003560e01c80639010d07c116100f9578063a717639c11610097578063b9c849b611610071578063b9c849b61461042b578063ca15c8731461043e578063d3b91d8414610451578063d547741f1461047457600080fd5b8063a717639c146103c9578063ac4afa38146103d2578063b536818a1461040457600080fd5b80639afdb2c2116100d35780639afdb2c2146103745780639cfbc00214610387578063a217fddf146103ae578063a38dcbd0146103b657600080fd5b80639010d07c1461032157806391d148541461033457806396c82e571461036b57600080fd5b806336568abe11610166578063673a2a1f11610140578063673a2a1f146102d45780636f4a2cd0146102e957806376175b06146102f15780638f10369a1461031857600080fd5b806336568abe146102a55780635a8c2e26146102b857806366da5815146102c157600080fd5b80632f2ff15d116101975780632f2ff15d1461025657806332a9caba1461026b57806332e4bb0a1461027e57600080fd5b806301ffc9a7146101be578063228cb733146101e6578063248a9ca314610225575b600080fd5b6101d16101cc366004611e9a565b610487565b60405190151581526020015b60405180910390f35b61020d7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101dd565b610248610233366004611e33565b60009081526020819052604090206001015490565b6040519081526020016101dd565b610269610264366004611e4c565b6104b2565b005b610269610279366004611de7565b6104dd565b6102487fb814ff4a26ea3ec5cd1fa579daad86324826254265f3acfec78303a19845b44981565b6102696102b3366004611e4c565b61084d565b61024860025481565b6102696102cf366004611e33565b6108d9565b6102dc6109ac565b6040516101dd9190611f7a565b610269610a21565b6102487fd9d917c4034cff8a8c5fa1e40f9fbaf906b827c33ae3ab1fcabbb616cb8ef24d81565b61024860035481565b61020d61032f366004611e78565b610dbc565b6101d1610342366004611e4c565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b61024860055481565b610269610382366004611dab565b610ddb565b61020d7f000000000000000000000000000000000000000000000000000000000000000081565b610248600081565b6102696103c4366004611e33565b610eed565b61024860045481565b6103e56103e0366004611e33565b61118a565b604080516001600160a01b0390931683526020830191909152016101dd565b6102487f0603f2636f0ca34ae3ea5a23bb826e2bd2ffd59fb1c01edc1ba10fba2899d1ba81565b610269610439366004611e78565b6111c2565b61024861044c366004611e33565b611379565b6101d161045f366004611d90565b60066020526000908152604090205460ff1681565b610269610482366004611e4c565b611390565b60006001600160e01b03198216635a05180f60e01b14806104ac57506104ac82611469565b92915050565b6000828152602081905260409020600101546104ce813361149e565b6104d8838361151c565b505050565b6105077f0603f2636f0ca34ae3ea5a23bb826e2bd2ffd59fb1c01edc1ba10fba2899d1ba33610342565b6105725760405162461bcd60e51b815260206004820152603160248201527f4c69717569646974794d696e696e674d616e616765722e6f6e6c79476f763a206044820152701c195c9b5a5cdcda5bdb8819195b9a5959607a1b60648201526084015b60405180910390fd5b61057a610a21565b6001600160a01b0382166105f65760405162461bcd60e51b815260206004820152603960248201527f4c69717569646974794d696e696e674d616e616765722e616464506f6f6c3a2060448201527f706f6f6c20636f6e7472616374206d75737420626520736574000000000000006064820152608401610569565b6001600160a01b03821660009081526006602052604090205460ff16156106855760405162461bcd60e51b815260206004820152603260248201527f4c69717569646974794d696e696e674d616e616765722e616464506f6f6c3a2060448201527f506f6f6c20616c726561647920616464656400000000000000000000000000006064820152608401610569565b600254600754106106fe5760405162461bcd60e51b815260206004820152603b60248201527f4c69717569646974794d696e696e674d616e616765722e616464506f6f6c3a2060448201527f4d617820616d6f756e74206f6620706f6f6c73207265616368656400000000006064820152608401610569565b6040805180820182526001600160a01b0384811680835260208084018681526007805460018082018355600092835296517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6886002909202918201805473ffffffffffffffffffffffffffffffffffffffff1916919097161790955590517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6899094019390935590825260069052918220805460ff19169091179055600580548392906107ca908490612005565b9091555061080690506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168360001961153e565b816001600160a01b03167f0c98febfffcec480c66a977e13f14bafdb5199ea9603591a0715b0cabe0c3ae28260405161084191815260200190565b60405180910390a25050565b6001600160a01b03811633146108cb5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c6600000000000000000000000000000000006064820152608401610569565b6108d582826116b1565b5050565b6109037f0603f2636f0ca34ae3ea5a23bb826e2bd2ffd59fb1c01edc1ba10fba2899d1ba33610342565b6109695760405162461bcd60e51b815260206004820152603160248201527f4c69717569646974794d696e696e674d616e616765722e6f6e6c79476f763a206044820152701c195c9b5a5cdcda5bdb8819195b9a5959607a1b6064820152608401610569565b610971610a21565b60038190556040518181527fa779fa0f0a75020027d18183bb38fa4a9abeea71bb307e00ac7f5410527967ab9060200160405180910390a150565b60606007805480602002602001604051908101604052809291908181526020016000905b82821015610a18576000848152602090819020604080518082019091526002850290910180546001600160a01b031682526001908101548284015290835290920191016109d0565b50505050905090565b610a4b7fb814ff4a26ea3ec5cd1fa579daad86324826254265f3acfec78303a19845b44933610342565b610abd5760405162461bcd60e51b815260206004820152603f60248201527f4c69717569646974794d696e696e674d616e616765722e6f6e6c79526577617260448201527f644469737472696275746f723a207065726d697373696f6e2064656e696564006064820152608401610569565b600060045442610acd919061205e565b9050600081600354610adf919061203f565b42600455600754909150610af1575050565b80610afa575050565b610b4f6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000167f000000000000000000000000000000000000000000000000000000000000000030846116d3565b60005b600754811015610c7f57600060078281548110610b7157610b716120ff565b600091825260208083206040805180820190915260029093020180546001600160a01b0316835260010154908201819052600554919350610bb2908661203f565b610bbc919061201d565b825160408051602480820185905282518083039091018152604490910182526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16630b32e9c760e31b17905290519293506001600160a01b0390911691610c259190611edd565b6000604051808303816000865af19150503d8060008114610c62576040519150601f19603f3d011682016040523d82523d6000602084013e610c67565b606091505b50505050508080610c77906120b8565b915050610b52565b506040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a082319060240160206040518083038186803b158015610ce257600080fd5b505afa158015610cf6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d1a9190611ec4565b90506001811115610d7957610d796001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000167f000000000000000000000000000000000000000000000000000000000000000083611711565b817fdf29796aad820e4bb192f3a8d631b76519bcd2cbe77cc85af20e9df53cece086336040516001600160a01b03909116815260200160405180910390a2505050565b6000828152600160205260408120610dd49083611741565b9392505050565b610e057fd9d917c4034cff8a8c5fa1e40f9fbaf906b827c33ae3ab1fcabbb616cb8ef24d33610342565b610e775760405162461bcd60e51b815260206004820152602c60248201527f546f6b656e53617665722e6f6e6c79546f6b656e53617665723a207065726d6960448201527f7373696f6e2064656e69656400000000000000000000000000000000000000006064820152608401610569565b610e8b6001600160a01b0384168383611711565b826001600160a01b0316826001600160a01b0316610ea63390565b6001600160a01b03167f30d87cec6b4c56cede1018725d1e6d9304e2f7ee6d25b004b7e2183f793f26bc84604051610ee091815260200190565b60405180910390a4505050565b610f177f0603f2636f0ca34ae3ea5a23bb826e2bd2ffd59fb1c01edc1ba10fba2899d1ba33610342565b610f7d5760405162461bcd60e51b815260206004820152603160248201527f4c69717569646974794d696e696e674d616e616765722e6f6e6c79476f763a206044820152701c195c9b5a5cdcda5bdb8819195b9a5959607a1b6064820152608401610569565b6007548110610ff45760405162461bcd60e51b815260206004820152603660248201527f4c69717569646974794d696e696e674d616e616765722e72656d6f7665506f6f60448201527f6c3a20506f6f6c20646f6573206e6f74206578697374000000000000000000006064820152608401610569565b610ffc610a21565b600060078281548110611011576110116120ff565b6000918252602090912060029091020154600780546001600160a01b0390921692509083908110611044576110446120ff565b90600052602060002090600202016001015460056000828254611067919061205e565b90915550506007805461107c9060019061205e565b8154811061108c5761108c6120ff565b9060005260206000209060020201600783815481106110ad576110ad6120ff565b600091825260209091208254600290920201805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b039092169190911781556001918201549101556007805480611103576111036120e9565b60008281526020808220600260001990940193840201805473ffffffffffffffffffffffffffffffffffffffff19168155600101829055919092556001600160a01b03831680835260069091526040808320805460ff1916905551909184917f18e9d3644c306f9be50ade92ee325ee173812431fa971a0b8d46f9eb707396019190a35050565b6007818154811061119a57600080fd5b6000918252602090912060029091020180546001909101546001600160a01b03909116915082565b6111ec7f0603f2636f0ca34ae3ea5a23bb826e2bd2ffd59fb1c01edc1ba10fba2899d1ba33610342565b6112525760405162461bcd60e51b815260206004820152603160248201527f4c69717569646974794d696e696e674d616e616765722e6f6e6c79476f763a206044820152701c195c9b5a5cdcda5bdb8819195b9a5959607a1b6064820152608401610569565b60075482106112c95760405162461bcd60e51b815260206004820152603860248201527f4c69717569646974794d696e696e674d616e616765722e61646a75737457656960448201527f6768743a20506f6f6c20646f6573206e6f7420657869737400000000000000006064820152608401610569565b6112d1610a21565b6000600783815481106112e6576112e66120ff565b9060005260206000209060020201905080600101546005600082825461130c919061205e565b9250508190555081600560008282546113259190612005565b90915550506001810182905580546040518381526001600160a01b039091169084907f4bd857a398c0fb71cc804d86dac2b437d1e5ca0b8a3161ec9638515c5d1997c29060200160405180910390a3505050565b60008181526001602052604081206104ac9061174d565b6000828152602081905260409020600101546113ac813361149e565b6104d883836116b1565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166108d5576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556114103390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000610dd4836001600160a01b038416611757565b60006001600160e01b03198216637965db0b60e01b14806104ac57506301ffc9a760e01b6001600160e01b03198316146104ac565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166108d5576114da816001600160a01b031660146117a6565b6114e58360206117a6565b6040516020016114f6929190611ef9565b60408051601f198184030181529082905262461bcd60e51b825261056991600401611fd2565b61152682826113b6565b60008281526001602052604090206104d89082611454565b8015806115c75750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b15801561158d57600080fd5b505afa1580156115a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115c59190611ec4565b155b6116395760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527f20746f206e6f6e2d7a65726f20616c6c6f77616e6365000000000000000000006064820152608401610569565b6040516001600160a01b0383166024820152604481018290526104d890849063095ea7b360e01b906064015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166001600160e01b03199093169290921790915261194f565b6116bb8282611a34565b60008281526001602052604090206104d89082611ab3565b6040516001600160a01b038085166024830152831660448201526064810182905261170b9085906323b872dd60e01b90608401611665565b50505050565b6040516001600160a01b0383166024820152604481018290526104d890849063a9059cbb60e01b90606401611665565b6000610dd48383611ac8565b60006104ac825490565b600081815260018301602052604081205461179e575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556104ac565b5060006104ac565b606060006117b583600261203f565b6117c0906002612005565b67ffffffffffffffff8111156117d8576117d8612115565b6040519080825280601f01601f191660200182016040528015611802576020820181803683370190505b509050600360fc1b8160008151811061181d5761181d6120ff565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061184c5761184c6120ff565b60200101906001600160f81b031916908160001a905350600061187084600261203f565b61187b906001612005565b90505b6001811115611900577f303132333435363738396162636465660000000000000000000000000000000085600f16601081106118bc576118bc6120ff565b1a60f81b8282815181106118d2576118d26120ff565b60200101906001600160f81b031916908160001a90535060049490941c936118f9816120a1565b905061187e565b508315610dd45760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610569565b60006119a4826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611af29092919063ffffffff16565b8051909150156104d857808060200190518101906119c29190611e11565b6104d85760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610569565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16156108d5576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000610dd4836001600160a01b038416611b09565b6000826000018281548110611adf57611adf6120ff565b9060005260206000200154905092915050565b6060611b018484600085611bfc565b949350505050565b60008181526001830160205260408120548015611bf2576000611b2d60018361205e565b8554909150600090611b419060019061205e565b9050818114611ba6576000866000018281548110611b6157611b616120ff565b9060005260206000200154905080876000018481548110611b8457611b846120ff565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080611bb757611bb76120e9565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506104ac565b60009150506104ac565b606082471015611c745760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610569565b843b611cc25760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610569565b600080866001600160a01b03168587604051611cde9190611edd565b60006040518083038185875af1925050503d8060008114611d1b576040519150601f19603f3d011682016040523d82523d6000602084013e611d20565b606091505b5091509150611d30828286611d3b565b979650505050505050565b60608315611d4a575081610dd4565b825115611d5a5782518084602001fd5b8160405162461bcd60e51b81526004016105699190611fd2565b80356001600160a01b0381168114611d8b57600080fd5b919050565b600060208284031215611da257600080fd5b610dd482611d74565b600080600060608486031215611dc057600080fd5b611dc984611d74565b9250611dd760208501611d74565b9150604084013590509250925092565b60008060408385031215611dfa57600080fd5b611e0383611d74565b946020939093013593505050565b600060208284031215611e2357600080fd5b81518015158114610dd457600080fd5b600060208284031215611e4557600080fd5b5035919050565b60008060408385031215611e5f57600080fd5b82359150611e6f60208401611d74565b90509250929050565b60008060408385031215611e8b57600080fd5b50508035926020909101359150565b600060208284031215611eac57600080fd5b81356001600160e01b031981168114610dd457600080fd5b600060208284031215611ed657600080fd5b5051919050565b60008251611eef818460208701612075565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611f31816017850160208801612075565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611f6e816028840160208801612075565b01602801949350505050565b602080825282518282018190526000919060409081850190868401855b82811015611fc557815180516001600160a01b03168552860151868501529284019290850190600101611f97565b5091979650505050505050565b6020815260008251806020840152611ff1816040850160208701612075565b601f01601f19169190910160400192915050565b60008219821115612018576120186120d3565b500190565b60008261203a57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615612059576120596120d3565b500290565b600082821015612070576120706120d3565b500390565b60005b83811015612090578181015183820152602001612078565b8381111561170b5750506000910152565b6000816120b0576120b06120d3565b506000190190565b60006000198214156120cc576120cc6120d3565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fdfea164736f6c6343000807000a4c69717569646974794d696e696e674d616e616765722e636f6e7374727563740000000000000000000000002a2550e0a75acec6d811ae3930732f7f3ad6758800000000000000000000000096ff39b9cce8ae3a7e8d4e0e562ca53e70cf9a59
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101b95760003560e01c80639010d07c116100f9578063a717639c11610097578063b9c849b611610071578063b9c849b61461042b578063ca15c8731461043e578063d3b91d8414610451578063d547741f1461047457600080fd5b8063a717639c146103c9578063ac4afa38146103d2578063b536818a1461040457600080fd5b80639afdb2c2116100d35780639afdb2c2146103745780639cfbc00214610387578063a217fddf146103ae578063a38dcbd0146103b657600080fd5b80639010d07c1461032157806391d148541461033457806396c82e571461036b57600080fd5b806336568abe11610166578063673a2a1f11610140578063673a2a1f146102d45780636f4a2cd0146102e957806376175b06146102f15780638f10369a1461031857600080fd5b806336568abe146102a55780635a8c2e26146102b857806366da5815146102c157600080fd5b80632f2ff15d116101975780632f2ff15d1461025657806332a9caba1461026b57806332e4bb0a1461027e57600080fd5b806301ffc9a7146101be578063228cb733146101e6578063248a9ca314610225575b600080fd5b6101d16101cc366004611e9a565b610487565b60405190151581526020015b60405180910390f35b61020d7f0000000000000000000000002a2550e0a75acec6d811ae3930732f7f3ad6758881565b6040516001600160a01b0390911681526020016101dd565b610248610233366004611e33565b60009081526020819052604090206001015490565b6040519081526020016101dd565b610269610264366004611e4c565b6104b2565b005b610269610279366004611de7565b6104dd565b6102487fb814ff4a26ea3ec5cd1fa579daad86324826254265f3acfec78303a19845b44981565b6102696102b3366004611e4c565b61084d565b61024860025481565b6102696102cf366004611e33565b6108d9565b6102dc6109ac565b6040516101dd9190611f7a565b610269610a21565b6102487fd9d917c4034cff8a8c5fa1e40f9fbaf906b827c33ae3ab1fcabbb616cb8ef24d81565b61024860035481565b61020d61032f366004611e78565b610dbc565b6101d1610342366004611e4c565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b61024860055481565b610269610382366004611dab565b610ddb565b61020d7f00000000000000000000000096ff39b9cce8ae3a7e8d4e0e562ca53e70cf9a5981565b610248600081565b6102696103c4366004611e33565b610eed565b61024860045481565b6103e56103e0366004611e33565b61118a565b604080516001600160a01b0390931683526020830191909152016101dd565b6102487f0603f2636f0ca34ae3ea5a23bb826e2bd2ffd59fb1c01edc1ba10fba2899d1ba81565b610269610439366004611e78565b6111c2565b61024861044c366004611e33565b611379565b6101d161045f366004611d90565b60066020526000908152604090205460ff1681565b610269610482366004611e4c565b611390565b60006001600160e01b03198216635a05180f60e01b14806104ac57506104ac82611469565b92915050565b6000828152602081905260409020600101546104ce813361149e565b6104d8838361151c565b505050565b6105077f0603f2636f0ca34ae3ea5a23bb826e2bd2ffd59fb1c01edc1ba10fba2899d1ba33610342565b6105725760405162461bcd60e51b815260206004820152603160248201527f4c69717569646974794d696e696e674d616e616765722e6f6e6c79476f763a206044820152701c195c9b5a5cdcda5bdb8819195b9a5959607a1b60648201526084015b60405180910390fd5b61057a610a21565b6001600160a01b0382166105f65760405162461bcd60e51b815260206004820152603960248201527f4c69717569646974794d696e696e674d616e616765722e616464506f6f6c3a2060448201527f706f6f6c20636f6e7472616374206d75737420626520736574000000000000006064820152608401610569565b6001600160a01b03821660009081526006602052604090205460ff16156106855760405162461bcd60e51b815260206004820152603260248201527f4c69717569646974794d696e696e674d616e616765722e616464506f6f6c3a2060448201527f506f6f6c20616c726561647920616464656400000000000000000000000000006064820152608401610569565b600254600754106106fe5760405162461bcd60e51b815260206004820152603b60248201527f4c69717569646974794d696e696e674d616e616765722e616464506f6f6c3a2060448201527f4d617820616d6f756e74206f6620706f6f6c73207265616368656400000000006064820152608401610569565b6040805180820182526001600160a01b0384811680835260208084018681526007805460018082018355600092835296517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6886002909202918201805473ffffffffffffffffffffffffffffffffffffffff1916919097161790955590517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6899094019390935590825260069052918220805460ff19169091179055600580548392906107ca908490612005565b9091555061080690506001600160a01b037f0000000000000000000000002a2550e0a75acec6d811ae3930732f7f3ad67588168360001961153e565b816001600160a01b03167f0c98febfffcec480c66a977e13f14bafdb5199ea9603591a0715b0cabe0c3ae28260405161084191815260200190565b60405180910390a25050565b6001600160a01b03811633146108cb5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c6600000000000000000000000000000000006064820152608401610569565b6108d582826116b1565b5050565b6109037f0603f2636f0ca34ae3ea5a23bb826e2bd2ffd59fb1c01edc1ba10fba2899d1ba33610342565b6109695760405162461bcd60e51b815260206004820152603160248201527f4c69717569646974794d696e696e674d616e616765722e6f6e6c79476f763a206044820152701c195c9b5a5cdcda5bdb8819195b9a5959607a1b6064820152608401610569565b610971610a21565b60038190556040518181527fa779fa0f0a75020027d18183bb38fa4a9abeea71bb307e00ac7f5410527967ab9060200160405180910390a150565b60606007805480602002602001604051908101604052809291908181526020016000905b82821015610a18576000848152602090819020604080518082019091526002850290910180546001600160a01b031682526001908101548284015290835290920191016109d0565b50505050905090565b610a4b7fb814ff4a26ea3ec5cd1fa579daad86324826254265f3acfec78303a19845b44933610342565b610abd5760405162461bcd60e51b815260206004820152603f60248201527f4c69717569646974794d696e696e674d616e616765722e6f6e6c79526577617260448201527f644469737472696275746f723a207065726d697373696f6e2064656e696564006064820152608401610569565b600060045442610acd919061205e565b9050600081600354610adf919061203f565b42600455600754909150610af1575050565b80610afa575050565b610b4f6001600160a01b037f0000000000000000000000002a2550e0a75acec6d811ae3930732f7f3ad67588167f00000000000000000000000096ff39b9cce8ae3a7e8d4e0e562ca53e70cf9a5930846116d3565b60005b600754811015610c7f57600060078281548110610b7157610b716120ff565b600091825260208083206040805180820190915260029093020180546001600160a01b0316835260010154908201819052600554919350610bb2908661203f565b610bbc919061201d565b825160408051602480820185905282518083039091018152604490910182526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16630b32e9c760e31b17905290519293506001600160a01b0390911691610c259190611edd565b6000604051808303816000865af19150503d8060008114610c62576040519150601f19603f3d011682016040523d82523d6000602084013e610c67565b606091505b50505050508080610c77906120b8565b915050610b52565b506040516370a0823160e01b81523060048201526000907f0000000000000000000000002a2550e0a75acec6d811ae3930732f7f3ad675886001600160a01b0316906370a082319060240160206040518083038186803b158015610ce257600080fd5b505afa158015610cf6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d1a9190611ec4565b90506001811115610d7957610d796001600160a01b037f0000000000000000000000002a2550e0a75acec6d811ae3930732f7f3ad67588167f00000000000000000000000096ff39b9cce8ae3a7e8d4e0e562ca53e70cf9a5983611711565b817fdf29796aad820e4bb192f3a8d631b76519bcd2cbe77cc85af20e9df53cece086336040516001600160a01b03909116815260200160405180910390a2505050565b6000828152600160205260408120610dd49083611741565b9392505050565b610e057fd9d917c4034cff8a8c5fa1e40f9fbaf906b827c33ae3ab1fcabbb616cb8ef24d33610342565b610e775760405162461bcd60e51b815260206004820152602c60248201527f546f6b656e53617665722e6f6e6c79546f6b656e53617665723a207065726d6960448201527f7373696f6e2064656e69656400000000000000000000000000000000000000006064820152608401610569565b610e8b6001600160a01b0384168383611711565b826001600160a01b0316826001600160a01b0316610ea63390565b6001600160a01b03167f30d87cec6b4c56cede1018725d1e6d9304e2f7ee6d25b004b7e2183f793f26bc84604051610ee091815260200190565b60405180910390a4505050565b610f177f0603f2636f0ca34ae3ea5a23bb826e2bd2ffd59fb1c01edc1ba10fba2899d1ba33610342565b610f7d5760405162461bcd60e51b815260206004820152603160248201527f4c69717569646974794d696e696e674d616e616765722e6f6e6c79476f763a206044820152701c195c9b5a5cdcda5bdb8819195b9a5959607a1b6064820152608401610569565b6007548110610ff45760405162461bcd60e51b815260206004820152603660248201527f4c69717569646974794d696e696e674d616e616765722e72656d6f7665506f6f60448201527f6c3a20506f6f6c20646f6573206e6f74206578697374000000000000000000006064820152608401610569565b610ffc610a21565b600060078281548110611011576110116120ff565b6000918252602090912060029091020154600780546001600160a01b0390921692509083908110611044576110446120ff565b90600052602060002090600202016001015460056000828254611067919061205e565b90915550506007805461107c9060019061205e565b8154811061108c5761108c6120ff565b9060005260206000209060020201600783815481106110ad576110ad6120ff565b600091825260209091208254600290920201805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b039092169190911781556001918201549101556007805480611103576111036120e9565b60008281526020808220600260001990940193840201805473ffffffffffffffffffffffffffffffffffffffff19168155600101829055919092556001600160a01b03831680835260069091526040808320805460ff1916905551909184917f18e9d3644c306f9be50ade92ee325ee173812431fa971a0b8d46f9eb707396019190a35050565b6007818154811061119a57600080fd5b6000918252602090912060029091020180546001909101546001600160a01b03909116915082565b6111ec7f0603f2636f0ca34ae3ea5a23bb826e2bd2ffd59fb1c01edc1ba10fba2899d1ba33610342565b6112525760405162461bcd60e51b815260206004820152603160248201527f4c69717569646974794d696e696e674d616e616765722e6f6e6c79476f763a206044820152701c195c9b5a5cdcda5bdb8819195b9a5959607a1b6064820152608401610569565b60075482106112c95760405162461bcd60e51b815260206004820152603860248201527f4c69717569646974794d696e696e674d616e616765722e61646a75737457656960448201527f6768743a20506f6f6c20646f6573206e6f7420657869737400000000000000006064820152608401610569565b6112d1610a21565b6000600783815481106112e6576112e66120ff565b9060005260206000209060020201905080600101546005600082825461130c919061205e565b9250508190555081600560008282546113259190612005565b90915550506001810182905580546040518381526001600160a01b039091169084907f4bd857a398c0fb71cc804d86dac2b437d1e5ca0b8a3161ec9638515c5d1997c29060200160405180910390a3505050565b60008181526001602052604081206104ac9061174d565b6000828152602081905260409020600101546113ac813361149e565b6104d883836116b1565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166108d5576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556114103390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000610dd4836001600160a01b038416611757565b60006001600160e01b03198216637965db0b60e01b14806104ac57506301ffc9a760e01b6001600160e01b03198316146104ac565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166108d5576114da816001600160a01b031660146117a6565b6114e58360206117a6565b6040516020016114f6929190611ef9565b60408051601f198184030181529082905262461bcd60e51b825261056991600401611fd2565b61152682826113b6565b60008281526001602052604090206104d89082611454565b8015806115c75750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b15801561158d57600080fd5b505afa1580156115a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115c59190611ec4565b155b6116395760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527f20746f206e6f6e2d7a65726f20616c6c6f77616e6365000000000000000000006064820152608401610569565b6040516001600160a01b0383166024820152604481018290526104d890849063095ea7b360e01b906064015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166001600160e01b03199093169290921790915261194f565b6116bb8282611a34565b60008281526001602052604090206104d89082611ab3565b6040516001600160a01b038085166024830152831660448201526064810182905261170b9085906323b872dd60e01b90608401611665565b50505050565b6040516001600160a01b0383166024820152604481018290526104d890849063a9059cbb60e01b90606401611665565b6000610dd48383611ac8565b60006104ac825490565b600081815260018301602052604081205461179e575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556104ac565b5060006104ac565b606060006117b583600261203f565b6117c0906002612005565b67ffffffffffffffff8111156117d8576117d8612115565b6040519080825280601f01601f191660200182016040528015611802576020820181803683370190505b509050600360fc1b8160008151811061181d5761181d6120ff565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061184c5761184c6120ff565b60200101906001600160f81b031916908160001a905350600061187084600261203f565b61187b906001612005565b90505b6001811115611900577f303132333435363738396162636465660000000000000000000000000000000085600f16601081106118bc576118bc6120ff565b1a60f81b8282815181106118d2576118d26120ff565b60200101906001600160f81b031916908160001a90535060049490941c936118f9816120a1565b905061187e565b508315610dd45760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610569565b60006119a4826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611af29092919063ffffffff16565b8051909150156104d857808060200190518101906119c29190611e11565b6104d85760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610569565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16156108d5576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000610dd4836001600160a01b038416611b09565b6000826000018281548110611adf57611adf6120ff565b9060005260206000200154905092915050565b6060611b018484600085611bfc565b949350505050565b60008181526001830160205260408120548015611bf2576000611b2d60018361205e565b8554909150600090611b419060019061205e565b9050818114611ba6576000866000018281548110611b6157611b616120ff565b9060005260206000200154905080876000018481548110611b8457611b846120ff565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080611bb757611bb76120e9565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506104ac565b60009150506104ac565b606082471015611c745760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610569565b843b611cc25760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610569565b600080866001600160a01b03168587604051611cde9190611edd565b60006040518083038185875af1925050503d8060008114611d1b576040519150601f19603f3d011682016040523d82523d6000602084013e611d20565b606091505b5091509150611d30828286611d3b565b979650505050505050565b60608315611d4a575081610dd4565b825115611d5a5782518084602001fd5b8160405162461bcd60e51b81526004016105699190611fd2565b80356001600160a01b0381168114611d8b57600080fd5b919050565b600060208284031215611da257600080fd5b610dd482611d74565b600080600060608486031215611dc057600080fd5b611dc984611d74565b9250611dd760208501611d74565b9150604084013590509250925092565b60008060408385031215611dfa57600080fd5b611e0383611d74565b946020939093013593505050565b600060208284031215611e2357600080fd5b81518015158114610dd457600080fd5b600060208284031215611e4557600080fd5b5035919050565b60008060408385031215611e5f57600080fd5b82359150611e6f60208401611d74565b90509250929050565b60008060408385031215611e8b57600080fd5b50508035926020909101359150565b600060208284031215611eac57600080fd5b81356001600160e01b031981168114610dd457600080fd5b600060208284031215611ed657600080fd5b5051919050565b60008251611eef818460208701612075565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611f31816017850160208801612075565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611f6e816028840160208801612075565b01602801949350505050565b602080825282518282018190526000919060409081850190868401855b82811015611fc557815180516001600160a01b03168552860151868501529284019290850190600101611f97565b5091979650505050505050565b6020815260008251806020840152611ff1816040850160208701612075565b601f01601f19169190910160400192915050565b60008219821115612018576120186120d3565b500190565b60008261203a57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615612059576120596120d3565b500290565b600082821015612070576120706120d3565b500390565b60005b83811015612090578181015183820152602001612078565b8381111561170b5750506000910152565b6000816120b0576120b06120d3565b506000190190565b60006000198214156120cc576120cc6120d3565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fdfea164736f6c6343000807000a
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000002a2550e0a75acec6d811ae3930732f7f3ad6758800000000000000000000000096ff39b9cce8ae3a7e8d4e0e562ca53e70cf9a59
-----Decoded View---------------
Arg [0] : _reward (address): 0x2a2550e0A75aCec6D811AE3930732F7f3ad67588
Arg [1] : _rewardSource (address): 0x96ff39b9cCE8aE3a7e8d4E0E562cA53E70cF9A59
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000002a2550e0a75acec6d811ae3930732f7f3ad67588
Arg [1] : 00000000000000000000000096ff39b9cce8ae3a7e8d4e0e562ca53e70cf9a59
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 26 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.