More Info
Private Name Tags
ContractCreator
Latest 13 from a total of 13 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Withdraw | 15384824 | 879 days ago | IN | 0 ETH | 0.00161604 | ||||
Stake | 15384342 | 879 days ago | IN | 0 ETH | 0.00185829 | ||||
Stake | 15299971 | 892 days ago | IN | 0 ETH | 0.0014969 | ||||
Withdraw | 14818165 | 971 days ago | IN | 0 ETH | 0.00128556 | ||||
Stake | 14388732 | 1038 days ago | IN | 0 ETH | 0.00404952 | ||||
Withdraw | 14244459 | 1061 days ago | IN | 0 ETH | 0.00328228 | ||||
Stake | 14044815 | 1092 days ago | IN | 0 ETH | 0.02927734 | ||||
Withdraw | 13813052 | 1127 days ago | IN | 0 ETH | 0.00842255 | ||||
Stake | 13539148 | 1171 days ago | IN | 0 ETH | 0.02333095 | ||||
Stake | 13480952 | 1180 days ago | IN | 0 ETH | 0.01117985 | ||||
Stake | 13448351 | 1185 days ago | IN | 0 ETH | 0.00645605 | ||||
Stake | 13066031 | 1244 days ago | IN | 0 ETH | 0.00462268 | ||||
Increase Reward ... | 12953618 | 1262 days ago | IN | 0 ETH | 0.00511001 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
Staking
Compiler Version
v0.6.12+commit.27d51765
Optimization Enabled:
Yes with 200 runs
Other Settings:
constantinople EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.6.12; pragma experimental ABIEncoderV2; import "solowei/contracts/TwoStageOwnable.sol"; import "./StakingBase.sol"; contract Staking is StakingBase, TwoStageOwnable { uint256 private _freeSize; uint256 private _intervalsCount; uint256 private _size; uint256 private _intervalDuration; uint256 private _rewardPool; uint256 private _totalStaked; mapping(address => StakeData[]) private _stakedInformation; function getTimestamp() internal virtual view returns (uint256) { return block.timestamp; } function freeSize() public view returns (uint256) { return _freeSize; } function intervalsCount() public view returns (uint256) { return _intervalsCount; } function intervalDuration() public view returns (uint256) { return _intervalDuration; } function requiredRewards() public view returns (uint256) { return _calculateRewards(_totalStaked); } function rewardPool() public view returns (uint256) { return _rewardPool; } function size() public view returns (uint256) { return _size; } function totalStaked() public view returns (uint256) { return _totalStaked; } function availableToWithdraw(address account, uint256 id) public view returns (uint256 amountToWithdraw) { StakeData storage stake_ = _getStake(account, id); uint256 pastIntervalsCount = getTimestamp().sub(stake_.startsAt).div(_intervalDuration); amountToWithdraw = pastIntervalsCount < _intervalsCount ? stake_.rewards.mul(pastIntervalsCount).div(_intervalsCount) : stake_.rewards.add(stake_.amount); amountToWithdraw = amountToWithdraw.sub(stake_.withdrawn); } function getStake(address account, uint256 id) public view returns (StakeData memory) { return _getStake(account, id); } function getStakesCount(address account) public view returns (uint256) { return _stakedInformation[account].length; } function getStakes( address account, uint256 offset, uint256 limit ) public view returns (StakeData[] memory stakeData) { StakeData[] storage stakedInformation = _stakedInformation[account]; uint256 stakedInformationLength = stakedInformation.length; uint256 to = offset.add(limit); if (stakedInformationLength < to) to = stakedInformationLength; stakeData = new StakeData[](to - offset); for (uint256 i = offset; i < to; i++) { stakeData[i - offset] = stakedInformation[stakedInformationLength - i - 1]; } } constructor( address owner_, IERC20 stakingToken_, uint256 revenue_, uint256 intervalsCount_, uint256 intervalDuration_, uint256 size_ ) public TwoStageOwnable(owner_) { require(revenue_ > 0, "Revenue not positive"); require(intervalsCount_ > 0, "IntervalsCount not positive"); require(intervalDuration_ > 0, "IntervalDuration not positive"); require(size_ > 0, "Size not positive"); stakingToken = stakingToken_; revenue = revenue_; _intervalsCount = intervalsCount_; _intervalDuration = intervalDuration_ * 1 days; _size = size_; _freeSize = size_; } function decreaseRewardPool(uint256 amount) external onlyOwner onlyPositiveAmount(amount) returns (bool) { address caller = msg.sender; uint256 requiredRewards_ = requiredRewards(); require(_rewardPool > requiredRewards_, "No tokens to decrease"); require(amount <= _rewardPool.sub(requiredRewards_), "Not enough amount"); stakingToken.safeTransfer(caller, amount); _rewardPool = _rewardPool.sub(amount); emit RewardPoolDecreased(caller, amount); return true; } function increaseRewardPool(uint256 amount) external onlyOwner onlyPositiveAmount(amount) returns (bool) { address caller = msg.sender; stakingToken.safeTransferFrom(caller, address(this), amount); _rewardPool = _rewardPool.add(amount); emit RewardPoolIncreased(caller, amount); return true; } function setMinStakeAmount(uint256 value) external onlyOwner returns (bool) { minStakeAmount = value; emit MinStakeAmountUpdated(msg.sender, value); return true; } function stake(uint256 amount) external onlyPositiveAmount(amount) returns (bool) { require(amount >= minStakeAmount, "Amount lt minimum stake"); require(amount <= _freeSize, "Amount gt free size"); _freeSize = _freeSize.sub(amount); uint256 rewards = _calculateRewards(amount); require(rewards <= _rewardPool.sub(requiredRewards()), "Not enough rewards"); address caller = msg.sender; uint256 stakeId = _stakedInformation[caller].length; _totalStaked = _totalStaked.add(amount); _stakedInformation[caller].push(); StakeData storage stake_ = _stakedInformation[caller][stakeId]; stake_.amount = amount; stake_.rewards = rewards; stake_.startsAt = getTimestamp(); stakingToken.safeTransferFrom(caller, address(this), amount); emit Staked(caller, stakeId, amount); return true; } function withdraw(uint256 id, uint256 amount) external onlyPositiveAmount(amount) returns (bool) { address caller = msg.sender; require(amount <= availableToWithdraw(caller, id), "Not enough available tokens"); StakeData storage stake_ = _stakedInformation[caller][id]; (uint256 rewardsSubValue, uint256 totalStakedSubValue) = _calculateWithdrawAmountParts(stake_, amount); _rewardPool = _rewardPool.sub(rewardsSubValue); _totalStaked = _totalStaked.sub(totalStakedSubValue); stake_.withdrawn = stake_.withdrawn.add(amount); stakingToken.safeTransfer(caller, amount); emit Withdrawn(caller, id, amount); return true; } function _calculateRewards(uint256 amount) internal view returns (uint256) { return amount.mul(revenue).div(100); } function _getStake(address account, uint256 id) internal view returns (StakeData storage) { require(id < _stakedInformation[account].length, "Invalid stake id"); return _stakedInformation[account][id]; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b > a) return (false, 0); return (true, a - b); } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a / b); } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a % b); } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) return 0; uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: division by zero"); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: modulo by zero"); return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); return a - b; } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryDiv}. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a % b; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "./IERC20.sol"; import "../../math/SafeMath.sol"; import "../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' // solhint-disable-next-line max-line-length require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).add(value); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero"); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.2 <0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: value }(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.12; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; abstract contract StakingBase { using SafeMath for uint256; using SafeERC20 for IERC20; struct StakeData { uint256 amount; uint256 rewards; uint256 withdrawn; uint256 startsAt; } uint256 public minStakeAmount; uint256 public revenue; IERC20 public stakingToken; event MinStakeAmountUpdated(address indexed owner, uint256 value); event Staked(address indexed account, uint256 stakeId, uint256 amount); event RewardPoolDecreased(address indexed owner, uint256 amount); event RewardPoolIncreased(address indexed owner, uint256 amount); event Withdrawn(address indexed account, uint256 stakeId, uint256 amount); function _calculateWithdrawAmountParts( StakeData memory stake_, uint256 amount ) internal pure returns (uint256 rewardsSubValue, uint256 totalStakedSubValue) { if (stake_.withdrawn < stake_.rewards) { uint256 difference = stake_.rewards.sub(stake_.withdrawn); if (difference >= amount) { rewardsSubValue = amount; } else { rewardsSubValue = difference; totalStakedSubValue = amount.sub(difference); } } else { totalStakedSubValue = amount; } } modifier onlyPositiveAmount(uint256 amount) { require(amount > 0, "Amount not positive"); _; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.12; abstract contract TwoStageOwnable { address private _nominatedOwner; address private _owner; function nominatedOwner() public view returns (address) { return _nominatedOwner; } function owner() public view returns (address) { return _owner; } event OwnerChanged(address indexed newOwner); event OwnerNominated(address indexed nominatedOwner); constructor(address owner_) internal { require(owner_ != address(0), "Owner is zero"); _setOwner(owner_); } function acceptOwnership() external returns (bool success) { require(msg.sender == _nominatedOwner, "Not nominated to ownership"); _setOwner(_nominatedOwner); return true; } function nominateNewOwner(address owner_) external onlyOwner returns (bool success) { _nominateNewOwner(owner_); return true; } modifier onlyOwner { require(msg.sender == _owner, "Not owner"); _; } function _nominateNewOwner(address owner_) internal { if (_nominatedOwner == owner_) return; require(_owner != owner_, "Already owner"); _nominatedOwner = owner_; emit OwnerNominated(owner_); } function _setOwner(address newOwner) internal { if (_owner == newOwner) return; _owner = newOwner; _nominatedOwner = address(0); emit OwnerChanged(newOwner); } }
{ "remappings": [], "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "constantinople", "libraries": {}, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"owner_","type":"address"},{"internalType":"contract IERC20","name":"stakingToken_","type":"address"},{"internalType":"uint256","name":"revenue_","type":"uint256"},{"internalType":"uint256","name":"intervalsCount_","type":"uint256"},{"internalType":"uint256","name":"intervalDuration_","type":"uint256"},{"internalType":"uint256","name":"size_","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"MinStakeAmountUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"nominatedOwner","type":"address"}],"name":"OwnerNominated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RewardPoolDecreased","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RewardPoolIncreased","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"stakeId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Staked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"stakeId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[],"name":"acceptOwnership","outputs":[{"internalType":"bool","name":"success","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"availableToWithdraw","outputs":[{"internalType":"uint256","name":"amountToWithdraw","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"decreaseRewardPool","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"freeSize","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getStake","outputs":[{"components":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"rewards","type":"uint256"},{"internalType":"uint256","name":"withdrawn","type":"uint256"},{"internalType":"uint256","name":"startsAt","type":"uint256"}],"internalType":"struct StakingBase.StakeData","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"offset","type":"uint256"},{"internalType":"uint256","name":"limit","type":"uint256"}],"name":"getStakes","outputs":[{"components":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"rewards","type":"uint256"},{"internalType":"uint256","name":"withdrawn","type":"uint256"},{"internalType":"uint256","name":"startsAt","type":"uint256"}],"internalType":"struct StakingBase.StakeData[]","name":"stakeData","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getStakesCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"increaseRewardPool","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"intervalDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"intervalsCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minStakeAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner_","type":"address"}],"name":"nominateNewOwner","outputs":[{"internalType":"bool","name":"success","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"nominatedOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"requiredRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"revenue","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardPool","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"value","type":"uint256"}],"name":"setMinStakeAmount","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"size","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"stake","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stakingToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalStaked","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60806040523480156200001157600080fd5b5060405162001a1e38038062001a1e833981016040819052620000349162000234565b856001600160a01b03811662000081576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620000789062000296565b60405180910390fd5b6200008c81620001c2565b5060008411620000ca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620000789062000372565b6000831162000107576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200007890620002cd565b6000821162000144576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620000789062000304565b6000811162000181576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040162000078906200033b565b600280546001600160a01b0319166001600160a01b0396909616959095179094556001929092556006556201518002600855600781905560055550620003bf565b6004546001600160a01b0382811691161415620001df5762000231565b600480546001600160a01b0383166001600160a01b031991821681179092556003805490911690556040517fa2ea9883a321a3e97b8266c2b078bfeec6d50c711ed71f874a90d500ae2eaf3690600090a25b50565b60008060008060008060c087890312156200024d578182fd5b86516200025a81620003a9565b60208801519096506200026d81620003a9565b6040880151606089015160808a015160a0909a0151989b929a5090989097909650945092505050565b6020808252600d908201527f4f776e6572206973207a65726f00000000000000000000000000000000000000604082015260600190565b6020808252601b908201527f496e74657276616c73436f756e74206e6f7420706f7369746976650000000000604082015260600190565b6020808252601d908201527f496e74657276616c4475726174696f6e206e6f7420706f736974697665000000604082015260600190565b60208082526011908201527f53697a65206e6f7420706f736974697665000000000000000000000000000000604082015260600190565b60208082526014908201527f526576656e7565206e6f7420706f736974697665000000000000000000000000604082015260600190565b6001600160a01b03811681146200023157600080fd5b61164f80620003cf6000396000f3fe608060405234801561001057600080fd5b506004361061014d5760003560e01c806372f702f3116100c3578063949d225d1161007c578063949d225d14610264578063a694fc3a1461026c578063ae9d852e1461027f578063cfd4766314610287578063eb4af045146102a7578063f1887684146102ba5761014d565b806372f702f31461022957806373f0e6a01461023157806379ba509714610239578063817b1cd214610241578063848f39e5146102495780638da5cb5b1461025c5761014d565b80633e9491a2116101155780633e9491a2146101cb578063441a3e70146101d357806353a47bb7146101e6578063549b5bfc146101fb57806366666aa91461020e57806366f294cf146102165761014d565b80631627540c1461015257806316ed99261461017b578063193132b2146101905780632da496e3146101a35780633076dc42146101c3575b600080fd5b610165610160366004611032565b6102c2565b60405161017291906111e4565b60405180910390f35b610183610309565b60405161017291906115d6565b61016561019e3660046110ca565b61031b565b6101b66101b1366004611077565b6103e0565b6040516101729190611196565b6101836104f2565b6101836104f8565b6101656101e13660046110e2565b6104fe565b6101ee610662565b6040516101729190611145565b610183610209366004611032565b610671565b61018361068c565b61018361022436600461104d565b610692565b6101ee610724565b610183610733565b610165610739565b610183610781565b6101656102573660046110ca565b610787565b6101ee6108a4565b6101836108b3565b61016561027a3660046110ca565b6108b9565b610183610a4b565b61029a61029536600461104d565b610a51565b60405161017291906115c8565b6101656102b53660046110ca565b610a9b565b610183610b0f565b6004546000906001600160a01b031633146102f85760405162461bcd60e51b81526004016102ef906114f9565b60405180910390fd5b61030182610b15565b506001919050565b6000610316600a54610ba9565b905090565b6004546000906001600160a01b031633146103485760405162461bcd60e51b81526004016102ef906114f9565b81600081116103695760405162461bcd60e51b81526004016102ef90611363565b6002543390610383906001600160a01b0316823087610bc5565b6009546103909085610c23565b6009556040516001600160a01b038216907f4698090295330a492472d5c5ace09167b6321763e7e43a4a1dd1aa8f11465eab906103ce9087906115d6565b60405180910390a25060019392505050565b6001600160a01b0383166000908152600b6020526040812080546060926104078686610c23565b9050808210156104145750805b85810367ffffffffffffffff8111801561042d57600080fd5b5060405190808252806020026020018201604052801561046757816020015b610454610ff3565b81526020019060019003908161044c5790505b509350855b818110156104e757836001828503038154811061048557fe5b906000526020600020906004020160405180608001604052908160008201548152602001600182015481526020016002820154815260200160038201548152505085888303815181106104d457fe5b602090810291909101015260010161046c565b505050509392505050565b60085490565b60015481565b600081600081116105215760405162461bcd60e51b81526004016102ef90611363565b3361052c8186610692565b84111561054b5760405162461bcd60e51b81526004016102ef90611423565b6001600160a01b0381166000908152600b6020526040812080548790811061056f57fe5b906000526020600020906004020190506000806105bf8360405180608001604052908160008201548152602001600182015481526020016002820154815260200160038201548152505088610c4f565b60095491935091506105d19083610cb0565b600955600a546105e19082610cb0565b600a5560028301546105f39088610c23565b60028085019190915554610611906001600160a01b03168589610cd8565b836001600160a01b03167f92ccf450a286a957af52509bc1c9939d1a6a481783e142e41e2499f0bb66ebc6898960405161064c9291906115df565b60405180910390a2506001979650505050505050565b6003546001600160a01b031690565b6001600160a01b03166000908152600b602052604090205490565b60095490565b60008061069f8484610cfc565b905060006106c56008546106bf84600301546106b9610d6d565b90610cb0565b90610d71565b905060065481106106e557815460018301546106e091610c23565b610702565b6107026006546106bf838560010154610da390919063ffffffff16565b925061071b826002015484610cb090919063ffffffff16565b95945050505050565b6002546001600160a01b031681565b60065490565b6003546000906001600160a01b031633146107665760405162461bcd60e51b81526004016102ef906114c2565b60035461077b906001600160a01b0316610ddd565b50600190565b600a5490565b6004546000906001600160a01b031633146107b45760405162461bcd60e51b81526004016102ef906114f9565b81600081116107d55760405162461bcd60e51b81526004016102ef90611363565b3360006107e0610309565b905080600954116108035760405162461bcd60e51b81526004016102ef906113c7565b6009546108109082610cb0565b85111561082f5760405162461bcd60e51b81526004016102ef9061159d565b600254610846906001600160a01b03168387610cd8565b6009546108539086610cb0565b6009556040516001600160a01b038316907f023ebc6c8f9e481c0ce3b94e1c414080128a3c2d8aafe6057a77fd1797d119b2906108919088906115d6565b60405180910390a2506001949350505050565b6004546001600160a01b031690565b60075490565b600081600081116108dc5760405162461bcd60e51b81526004016102ef90611363565b6000548310156108fe5760405162461bcd60e51b81526004016102ef9061124e565b6005548311156109205760405162461bcd60e51b81526004016102ef906113f6565b60055461092d9084610cb0565b600555600061093b84610ba9565b9050610951610948610309565b60095490610cb0565b8111156109705760405162461bcd60e51b81526004016102ef90611222565b336000818152600b6020526040902054600a5461098d9087610c23565b600a556001600160a01b0382166000908152600b602052604081208054600101808255839081106109ba57fe5b600091825260209091206004909102018781556001810185905590506109de610d6d565b60038201556002546109fb906001600160a01b031684308a610bc5565b826001600160a01b03167f1449c6dd7851abc30abf37f57715f492010519147cc2652fbc38202c18a6ee908389604051610a369291906115df565b60405180910390a25060019695505050505050565b60055490565b610a59610ff3565b610a638383610cfc565b604080516080810182528254815260018301546020820152600283015491810191909152600390910154606082015290505b92915050565b6004546000906001600160a01b03163314610ac85760405162461bcd60e51b81526004016102ef906114f9565b600082905560405133907f6b8209c889d2e447ce78d1b931d24b74266309d74ab510ea34ed8212586ffa7190610aff9085906115d6565b60405180910390a2506001919050565b60005481565b6003546001600160a01b0382811691161415610b3057610ba6565b6004546001600160a01b0382811691161415610b5e5760405162461bcd60e51b81526004016102ef9061149b565b600380546001600160a01b0319166001600160a01b0383169081179091556040517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce2290600090a25b50565b6000610a9560646106bf60015485610da390919063ffffffff16565b610c1d846323b872dd60e01b858585604051602401610be693929190611159565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610e4c565b50505050565b600082820183811015610c485760405162461bcd60e51b81526004016102ef90611285565b9392505050565b600080836020015184604001511015610ca6576000610c7f85604001518660200151610cb090919063ffffffff16565b9050838110610c9057839250610ca0565b915081610c9d8482610cb0565b91505b50610ca9565b50815b9250929050565b600082821115610cd25760405162461bcd60e51b81526004016102ef906112e6565b50900390565b610cf78363a9059cbb60e01b8484604051602401610be692919061117d565b505050565b6001600160a01b0382166000908152600b60205260408120548210610d335760405162461bcd60e51b81526004016102ef906112bc565b6001600160a01b0383166000908152600b60205260409020805483908110610d5757fe5b9060005260206000209060040201905092915050565b4290565b6000808211610d925760405162461bcd60e51b81526004016102ef90611390565b818381610d9b57fe5b049392505050565b600082610db257506000610a95565b82820282848281610dbf57fe5b0414610c485760405162461bcd60e51b81526004016102ef9061145a565b6004546001600160a01b0382811691161415610df857610ba6565b600480546001600160a01b0383166001600160a01b031991821681179092556003805490911690556040517fa2ea9883a321a3e97b8266c2b078bfeec6d50c711ed71f874a90d500ae2eaf3690600090a250565b6060610ea1826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610edb9092919063ffffffff16565b805190915015610cf75780806020019051810190610ebf91906110aa565b610cf75760405162461bcd60e51b81526004016102ef90611553565b6060610eea8484600085610ef2565b949350505050565b60603031831115610f155760405162461bcd60e51b81526004016102ef9061131d565b610f1e85610fb4565b610f3a5760405162461bcd60e51b81526004016102ef9061151c565b60006060866001600160a01b03168587604051610f579190611129565b60006040518083038185875af1925050503d8060008114610f94576040519150601f19603f3d011682016040523d82523d6000602084013e610f99565b606091505b5091509150610fa9828286610fba565b979650505050505050565b3b151590565b60608315610fc9575081610c48565b825115610fd95782518084602001fd5b8160405162461bcd60e51b81526004016102ef91906111ef565b6040518060800160405280600081526020016000815260200160008152602001600081525090565b80356001600160a01b0381168114610a9557600080fd5b600060208284031215611043578081fd5b610c48838361101b565b6000806040838503121561105f578081fd5b611069848461101b565b946020939093013593505050565b60008060006060848603121561108b578081fd5b611095858561101b565b95602085013595506040909401359392505050565b6000602082840312156110bb578081fd5b81518015158114610c48578182fd5b6000602082840312156110db578081fd5b5035919050565b600080604083850312156110f4578182fd5b50508035926020909101359150565b805182526020810151602083015260408101516040830152606081015160608301525050565b6000825161113b8184602087016115ed565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b6020808252825182820181905260009190848201906040850190845b818110156111d8576111c5838551611103565b92840192608092909201916001016111b2565b50909695505050505050565b901515815260200190565b600060208252825180602084015261120e8160408501602087016115ed565b601f01601f19169190910160400192915050565b6020808252601290820152714e6f7420656e6f756768207265776172647360701b604082015260600190565b60208082526017908201527f416d6f756e74206c74206d696e696d756d207374616b65000000000000000000604082015260600190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b60208082526010908201526f125b9d985b1a59081cdd185ad9481a5960821b604082015260600190565b6020808252601e908201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604082015260600190565b60208082526026908201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6040820152651c8818d85b1b60d21b606082015260800190565b602080825260139082015272416d6f756e74206e6f7420706f73697469766560681b604082015260600190565b6020808252601a908201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604082015260600190565b6020808252601590820152744e6f20746f6b656e7320746f20646563726561736560581b604082015260600190565b602080825260139082015272416d6f756e7420677420667265652073697a6560681b604082015260600190565b6020808252601b908201527f4e6f7420656e6f75676820617661696c61626c6520746f6b656e730000000000604082015260600190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6040820152607760f81b606082015260800190565b6020808252600d908201526c20b63932b0b23c9037bbb732b960991b604082015260600190565b6020808252601a908201527f4e6f74206e6f6d696e6174656420746f206f776e657273686970000000000000604082015260600190565b6020808252600990820152682737ba1037bbb732b960b91b604082015260600190565b6020808252601d908201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604082015260600190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6040820152691bdd081cdd58d8d9595960b21b606082015260800190565b602080825260119082015270139bdd08195b9bdd59da08185b5bdd5b9d607a1b604082015260600190565b60808101610a958284611103565b90815260200190565b918252602082015260400190565b60005b838110156116085781810151838201526020016115f0565b83811115610c1d575050600091015256fea2646970667358221220c7fc899dde48a6c336d874794bd18eae02858d65cbc716810cf24bb4da9318e464736f6c634300060c00330000000000000000000000009f88f2ec52727eefab23dfa46609675bd04ae9bc000000000000000000000000f0c5831ec3da15f3696b4dad8b21c7ce2f007f28000000000000000000000000000000000000000000000000000000000000002d0000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000005b000000000000000000000000000000000000000000000000000540929c9533e0
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061014d5760003560e01c806372f702f3116100c3578063949d225d1161007c578063949d225d14610264578063a694fc3a1461026c578063ae9d852e1461027f578063cfd4766314610287578063eb4af045146102a7578063f1887684146102ba5761014d565b806372f702f31461022957806373f0e6a01461023157806379ba509714610239578063817b1cd214610241578063848f39e5146102495780638da5cb5b1461025c5761014d565b80633e9491a2116101155780633e9491a2146101cb578063441a3e70146101d357806353a47bb7146101e6578063549b5bfc146101fb57806366666aa91461020e57806366f294cf146102165761014d565b80631627540c1461015257806316ed99261461017b578063193132b2146101905780632da496e3146101a35780633076dc42146101c3575b600080fd5b610165610160366004611032565b6102c2565b60405161017291906111e4565b60405180910390f35b610183610309565b60405161017291906115d6565b61016561019e3660046110ca565b61031b565b6101b66101b1366004611077565b6103e0565b6040516101729190611196565b6101836104f2565b6101836104f8565b6101656101e13660046110e2565b6104fe565b6101ee610662565b6040516101729190611145565b610183610209366004611032565b610671565b61018361068c565b61018361022436600461104d565b610692565b6101ee610724565b610183610733565b610165610739565b610183610781565b6101656102573660046110ca565b610787565b6101ee6108a4565b6101836108b3565b61016561027a3660046110ca565b6108b9565b610183610a4b565b61029a61029536600461104d565b610a51565b60405161017291906115c8565b6101656102b53660046110ca565b610a9b565b610183610b0f565b6004546000906001600160a01b031633146102f85760405162461bcd60e51b81526004016102ef906114f9565b60405180910390fd5b61030182610b15565b506001919050565b6000610316600a54610ba9565b905090565b6004546000906001600160a01b031633146103485760405162461bcd60e51b81526004016102ef906114f9565b81600081116103695760405162461bcd60e51b81526004016102ef90611363565b6002543390610383906001600160a01b0316823087610bc5565b6009546103909085610c23565b6009556040516001600160a01b038216907f4698090295330a492472d5c5ace09167b6321763e7e43a4a1dd1aa8f11465eab906103ce9087906115d6565b60405180910390a25060019392505050565b6001600160a01b0383166000908152600b6020526040812080546060926104078686610c23565b9050808210156104145750805b85810367ffffffffffffffff8111801561042d57600080fd5b5060405190808252806020026020018201604052801561046757816020015b610454610ff3565b81526020019060019003908161044c5790505b509350855b818110156104e757836001828503038154811061048557fe5b906000526020600020906004020160405180608001604052908160008201548152602001600182015481526020016002820154815260200160038201548152505085888303815181106104d457fe5b602090810291909101015260010161046c565b505050509392505050565b60085490565b60015481565b600081600081116105215760405162461bcd60e51b81526004016102ef90611363565b3361052c8186610692565b84111561054b5760405162461bcd60e51b81526004016102ef90611423565b6001600160a01b0381166000908152600b6020526040812080548790811061056f57fe5b906000526020600020906004020190506000806105bf8360405180608001604052908160008201548152602001600182015481526020016002820154815260200160038201548152505088610c4f565b60095491935091506105d19083610cb0565b600955600a546105e19082610cb0565b600a5560028301546105f39088610c23565b60028085019190915554610611906001600160a01b03168589610cd8565b836001600160a01b03167f92ccf450a286a957af52509bc1c9939d1a6a481783e142e41e2499f0bb66ebc6898960405161064c9291906115df565b60405180910390a2506001979650505050505050565b6003546001600160a01b031690565b6001600160a01b03166000908152600b602052604090205490565b60095490565b60008061069f8484610cfc565b905060006106c56008546106bf84600301546106b9610d6d565b90610cb0565b90610d71565b905060065481106106e557815460018301546106e091610c23565b610702565b6107026006546106bf838560010154610da390919063ffffffff16565b925061071b826002015484610cb090919063ffffffff16565b95945050505050565b6002546001600160a01b031681565b60065490565b6003546000906001600160a01b031633146107665760405162461bcd60e51b81526004016102ef906114c2565b60035461077b906001600160a01b0316610ddd565b50600190565b600a5490565b6004546000906001600160a01b031633146107b45760405162461bcd60e51b81526004016102ef906114f9565b81600081116107d55760405162461bcd60e51b81526004016102ef90611363565b3360006107e0610309565b905080600954116108035760405162461bcd60e51b81526004016102ef906113c7565b6009546108109082610cb0565b85111561082f5760405162461bcd60e51b81526004016102ef9061159d565b600254610846906001600160a01b03168387610cd8565b6009546108539086610cb0565b6009556040516001600160a01b038316907f023ebc6c8f9e481c0ce3b94e1c414080128a3c2d8aafe6057a77fd1797d119b2906108919088906115d6565b60405180910390a2506001949350505050565b6004546001600160a01b031690565b60075490565b600081600081116108dc5760405162461bcd60e51b81526004016102ef90611363565b6000548310156108fe5760405162461bcd60e51b81526004016102ef9061124e565b6005548311156109205760405162461bcd60e51b81526004016102ef906113f6565b60055461092d9084610cb0565b600555600061093b84610ba9565b9050610951610948610309565b60095490610cb0565b8111156109705760405162461bcd60e51b81526004016102ef90611222565b336000818152600b6020526040902054600a5461098d9087610c23565b600a556001600160a01b0382166000908152600b602052604081208054600101808255839081106109ba57fe5b600091825260209091206004909102018781556001810185905590506109de610d6d565b60038201556002546109fb906001600160a01b031684308a610bc5565b826001600160a01b03167f1449c6dd7851abc30abf37f57715f492010519147cc2652fbc38202c18a6ee908389604051610a369291906115df565b60405180910390a25060019695505050505050565b60055490565b610a59610ff3565b610a638383610cfc565b604080516080810182528254815260018301546020820152600283015491810191909152600390910154606082015290505b92915050565b6004546000906001600160a01b03163314610ac85760405162461bcd60e51b81526004016102ef906114f9565b600082905560405133907f6b8209c889d2e447ce78d1b931d24b74266309d74ab510ea34ed8212586ffa7190610aff9085906115d6565b60405180910390a2506001919050565b60005481565b6003546001600160a01b0382811691161415610b3057610ba6565b6004546001600160a01b0382811691161415610b5e5760405162461bcd60e51b81526004016102ef9061149b565b600380546001600160a01b0319166001600160a01b0383169081179091556040517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce2290600090a25b50565b6000610a9560646106bf60015485610da390919063ffffffff16565b610c1d846323b872dd60e01b858585604051602401610be693929190611159565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610e4c565b50505050565b600082820183811015610c485760405162461bcd60e51b81526004016102ef90611285565b9392505050565b600080836020015184604001511015610ca6576000610c7f85604001518660200151610cb090919063ffffffff16565b9050838110610c9057839250610ca0565b915081610c9d8482610cb0565b91505b50610ca9565b50815b9250929050565b600082821115610cd25760405162461bcd60e51b81526004016102ef906112e6565b50900390565b610cf78363a9059cbb60e01b8484604051602401610be692919061117d565b505050565b6001600160a01b0382166000908152600b60205260408120548210610d335760405162461bcd60e51b81526004016102ef906112bc565b6001600160a01b0383166000908152600b60205260409020805483908110610d5757fe5b9060005260206000209060040201905092915050565b4290565b6000808211610d925760405162461bcd60e51b81526004016102ef90611390565b818381610d9b57fe5b049392505050565b600082610db257506000610a95565b82820282848281610dbf57fe5b0414610c485760405162461bcd60e51b81526004016102ef9061145a565b6004546001600160a01b0382811691161415610df857610ba6565b600480546001600160a01b0383166001600160a01b031991821681179092556003805490911690556040517fa2ea9883a321a3e97b8266c2b078bfeec6d50c711ed71f874a90d500ae2eaf3690600090a250565b6060610ea1826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610edb9092919063ffffffff16565b805190915015610cf75780806020019051810190610ebf91906110aa565b610cf75760405162461bcd60e51b81526004016102ef90611553565b6060610eea8484600085610ef2565b949350505050565b60603031831115610f155760405162461bcd60e51b81526004016102ef9061131d565b610f1e85610fb4565b610f3a5760405162461bcd60e51b81526004016102ef9061151c565b60006060866001600160a01b03168587604051610f579190611129565b60006040518083038185875af1925050503d8060008114610f94576040519150601f19603f3d011682016040523d82523d6000602084013e610f99565b606091505b5091509150610fa9828286610fba565b979650505050505050565b3b151590565b60608315610fc9575081610c48565b825115610fd95782518084602001fd5b8160405162461bcd60e51b81526004016102ef91906111ef565b6040518060800160405280600081526020016000815260200160008152602001600081525090565b80356001600160a01b0381168114610a9557600080fd5b600060208284031215611043578081fd5b610c48838361101b565b6000806040838503121561105f578081fd5b611069848461101b565b946020939093013593505050565b60008060006060848603121561108b578081fd5b611095858561101b565b95602085013595506040909401359392505050565b6000602082840312156110bb578081fd5b81518015158114610c48578182fd5b6000602082840312156110db578081fd5b5035919050565b600080604083850312156110f4578182fd5b50508035926020909101359150565b805182526020810151602083015260408101516040830152606081015160608301525050565b6000825161113b8184602087016115ed565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b6020808252825182820181905260009190848201906040850190845b818110156111d8576111c5838551611103565b92840192608092909201916001016111b2565b50909695505050505050565b901515815260200190565b600060208252825180602084015261120e8160408501602087016115ed565b601f01601f19169190910160400192915050565b6020808252601290820152714e6f7420656e6f756768207265776172647360701b604082015260600190565b60208082526017908201527f416d6f756e74206c74206d696e696d756d207374616b65000000000000000000604082015260600190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b60208082526010908201526f125b9d985b1a59081cdd185ad9481a5960821b604082015260600190565b6020808252601e908201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604082015260600190565b60208082526026908201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6040820152651c8818d85b1b60d21b606082015260800190565b602080825260139082015272416d6f756e74206e6f7420706f73697469766560681b604082015260600190565b6020808252601a908201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604082015260600190565b6020808252601590820152744e6f20746f6b656e7320746f20646563726561736560581b604082015260600190565b602080825260139082015272416d6f756e7420677420667265652073697a6560681b604082015260600190565b6020808252601b908201527f4e6f7420656e6f75676820617661696c61626c6520746f6b656e730000000000604082015260600190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6040820152607760f81b606082015260800190565b6020808252600d908201526c20b63932b0b23c9037bbb732b960991b604082015260600190565b6020808252601a908201527f4e6f74206e6f6d696e6174656420746f206f776e657273686970000000000000604082015260600190565b6020808252600990820152682737ba1037bbb732b960b91b604082015260600190565b6020808252601d908201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604082015260600190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6040820152691bdd081cdd58d8d9595960b21b606082015260800190565b602080825260119082015270139bdd08195b9bdd59da08185b5bdd5b9d607a1b604082015260600190565b60808101610a958284611103565b90815260200190565b918252602082015260400190565b60005b838110156116085781810151838201526020016115f0565b83811115610c1d575050600091015256fea2646970667358221220c7fc899dde48a6c336d874794bd18eae02858d65cbc716810cf24bb4da9318e464736f6c634300060c0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000009f88f2ec52727eefab23dfa46609675bd04ae9bc000000000000000000000000f0c5831ec3da15f3696b4dad8b21c7ce2f007f28000000000000000000000000000000000000000000000000000000000000002d0000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000005b000000000000000000000000000000000000000000000000000540929c9533e0
-----Decoded View---------------
Arg [0] : owner_ (address): 0x9f88F2Ec52727EEfAB23dfa46609675BD04AE9bc
Arg [1] : stakingToken_ (address): 0xF0c5831EC3Da15f3696B4DAd8B21c7Ce2f007f28
Arg [2] : revenue_ (uint256): 45
Arg [3] : intervalsCount_ (uint256): 8
Arg [4] : intervalDuration_ (uint256): 91
Arg [5] : size_ (uint256): 1478373319980000
-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 0000000000000000000000009f88f2ec52727eefab23dfa46609675bd04ae9bc
Arg [1] : 000000000000000000000000f0c5831ec3da15f3696b4dad8b21c7ce2f007f28
Arg [2] : 000000000000000000000000000000000000000000000000000000000000002d
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000008
Arg [4] : 000000000000000000000000000000000000000000000000000000000000005b
Arg [5] : 000000000000000000000000000000000000000000000000000540929c9533e0
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
ETH | 100.00% | $0.006 | 8,297,120.9399 | $49,782.27 |
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.