Feature Tip: Add private address tag to any address under My Name Tag !
More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 3,121 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Collect Rewards | 18660875 | 439 days ago | IN | 0 ETH | 0.00105517 | ||||
Withdraw | 18303692 | 489 days ago | IN | 0 ETH | 0.00084394 | ||||
Emergency Withdr... | 18302061 | 489 days ago | IN | 0 ETH | 0.00053767 | ||||
Deposit | 15294515 | 916 days ago | IN | 0 ETH | 0.00699509 | ||||
Withdraw | 15231002 | 926 days ago | IN | 0 ETH | 0.00111689 | ||||
Collect Rewards | 15231001 | 926 days ago | IN | 0 ETH | 0.00115563 | ||||
Deposit | 15066232 | 951 days ago | IN | 0 ETH | 0.00115669 | ||||
Deposit | 15066232 | 951 days ago | IN | 0 ETH | 0.00271095 | ||||
Deposit | 15066232 | 951 days ago | IN | 0 ETH | 0.0087031 | ||||
Withdraw | 14803916 | 996 days ago | IN | 0 ETH | 0.00169516 | ||||
Withdraw | 14638691 | 1022 days ago | IN | 0 ETH | 0.00436306 | ||||
Collect Rewards | 14638688 | 1022 days ago | IN | 0 ETH | 0.00431642 | ||||
Withdraw | 14627921 | 1024 days ago | IN | 0 ETH | 0.00374445 | ||||
Withdraw | 14586380 | 1030 days ago | IN | 0 ETH | 0.00339893 | ||||
Withdraw | 14504013 | 1043 days ago | IN | 0 ETH | 0.00260079 | ||||
Collect Rewards | 14504013 | 1043 days ago | IN | 0 ETH | 0.00387742 | ||||
Withdraw | 14471542 | 1048 days ago | IN | 0 ETH | 0.00320851 | ||||
Withdraw | 14441035 | 1053 days ago | IN | 0 ETH | 0.00093742 | ||||
Withdraw | 14441034 | 1053 days ago | IN | 0 ETH | 0.00277619 | ||||
Withdraw | 14434652 | 1054 days ago | IN | 0 ETH | 0.00182422 | ||||
Withdraw | 14410274 | 1058 days ago | IN | 0 ETH | 0.00269595 | ||||
Collect Rewards | 14410242 | 1058 days ago | IN | 0 ETH | 0.00327218 | ||||
Withdraw | 14382882 | 1062 days ago | IN | 0 ETH | 0.00088721 | ||||
Collect Rewards | 14382882 | 1062 days ago | IN | 0 ETH | 0.00098837 | ||||
Collect Rewards | 14382879 | 1062 days ago | IN | 0 ETH | 0.00127359 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
StarsMasterChef
Compiler Version
v0.6.12+commit.27d51765
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; contract StarsMasterChef is AccessControl { using SafeMath for uint256; using SafeERC20 for IERC20; bytes32 public constant ROLE_ADMIN = keccak256("ROLE_ADMIN"); // Info of each user. struct UserInfo { uint256 amount; // How many Stars the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // // We do some fancy math here. Basically, any point in time, the amount of Stars // entitled to a user but is pending to be distributed is: // // pending reward = (user.amount * pool.accStarsPerShare) - user.rewardDebt // // Whenever a user deposits or withdraws Stars to the pool. Here's what happens: // 1. The pool's `accStarsPerShare` (and `lastRewardBlock`) gets updated. // 2. User receives the pending reward sent to his/her address. // 3. User's `amount` gets updated. // 4. User's `rewardDebt` gets updated. } struct PoolInfo { IERC20 lpToken; // Address of LP token contract. uint256 allocPoint; // How many allocation points assigned to this pool. Stars to distribute per block. uint256 lastRewardBlock; // Last block number that Stars distribution occurs. uint256 accStarsPerShare; // Accumulated Stars per share, times 1e12. See below. uint256 poolSupply; } // The Stars token IERC20 public stars; // Info of each pool. PoolInfo[] public poolInfo; // Info of each user that stakes tokens. mapping(uint256 => mapping(address => UserInfo)) public userInfo; // The block number when Stars staking starts. uint256 public startBlock; bool public initialized; // Total allocation poitns. Must be the sum of all allocation points in all pools. uint256 public totalAllocPoint = 0; // Total Stars awarded per block on each of the 3 epochs uint256[3] public rewardAmounts; // The number of blocks since the starting block until each epoch ends uint256[3] public epochs; // The total number of stars distributed as rewards in each epoch uint256[3] public totalStarsPerEpoch; event RewardsCollected(address indexed user, uint256 indexed pid); event Deposit(address indexed user, uint256 indexed pid, uint256 amount); event Withdraw(address indexed user, uint256 indexed pid, uint256 amount); event EmergencyWithdraw( address indexed user, uint256 indexed pid, uint256 amount ); modifier onlyAdmin { require(hasRole(ROLE_ADMIN, msg.sender), "Sender is not admin"); _; } modifier isInitialized { require(initialized, "Not initialized"); _; } /** * @dev Stores the Stars contract, and allows users with the admin role to * grant/revoke the admin role from other users. Sets reward amounts and * epochs. * * Params: * starsAddress: the address of the Stars contract * _admin: the address of the first admin */ constructor( address starsAddress, address _admin, uint256[3] memory _rewardAmounts, uint256[3] memory _epochs ) public { _setupRole(ROLE_ADMIN, _admin); _setRoleAdmin(ROLE_ADMIN, ROLE_ADMIN); require( _epochs[0] < _epochs[1] && _epochs[1] < _epochs[2], "invalid epochs" ); stars = IERC20(starsAddress); rewardAmounts = _rewardAmounts; epochs = _epochs; totalStarsPerEpoch[0] = _rewardAmounts[0].mul(_epochs[0]); totalStarsPerEpoch[1] = _rewardAmounts[1].mul( _epochs[1].sub(_epochs[0]) ); totalStarsPerEpoch[2] = _rewardAmounts[2].mul( _epochs[2].sub(_epochs[1]) ); } /** * @dev Transfers 40 million ether and sets the startblock. Admin only * * Params: * _startBlock: the block number for staking to begin */ function init(uint256 _startBlock) public onlyAdmin { require(!initialized, "Already initialized"); stars.safeTransferFrom( msg.sender, address(this), totalStarsPerEpoch[0].add(totalStarsPerEpoch[1]).add( totalStarsPerEpoch[2] ) ); startBlock = _startBlock; initialized = true; } /** * @dev Returns the number of pools there are for front-end. */ function poolLength() external view returns (uint256) { return poolInfo.length; } /** * @dev Adds a new pool. Admin only * * Params: * _allocPoint: the allocation points to be assigned to this pool * _lpToken: the token that this pool accepts * _withUpdate: whether or not to update all pools */ function add( uint256 _allocPoint, IERC20 _lpToken, bool _withUpdate ) public onlyAdmin isInitialized { if (_withUpdate) { massUpdatePools(); } uint256 lastRewardBlock = block.number > startBlock ? block.number : startBlock; totalAllocPoint = totalAllocPoint.add(_allocPoint); poolInfo.push( PoolInfo({ lpToken: _lpToken, allocPoint: _allocPoint, lastRewardBlock: lastRewardBlock, accStarsPerShare: 0, poolSupply: 0 }) ); } /** * @dev Sets new pool. Admin only * * Params: * _pid: pool id * _allocPoint: the allocation points to be assigned to this pool * _withUpdate: whether or not to update all pools */ function set( uint256 _pid, uint256 _allocPoint, bool _withUpdate ) public onlyAdmin isInitialized { if (_withUpdate) { massUpdatePools(); } totalAllocPoint = totalAllocPoint.sub(poolInfo[_pid].allocPoint).add( _allocPoint ); poolInfo[_pid].allocPoint = _allocPoint; } /** * @dev View function to see pending Stars on frontend. * * Params: * _user: address of the stars to view the pending rewards for. */ function pendingStars(uint256 _pid, address _user) external view isInitialized returns (uint256) { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][_user]; if (pool.poolSupply == 0) { return 0; } uint256 currRateEndStarsPerShare = accStarsPerShareAtCurrRate( uint256(block.number).sub(startBlock), pool.poolSupply ); uint256 currRateStartStarsPerShare = accStarsPerShareAtCurrRate( pool.lastRewardBlock.sub(startBlock), pool.poolSupply ); uint256 starsReward = (currRateEndStarsPerShare.sub(currRateStartStarsPerShare)) .mul(pool.allocPoint) .div(totalAllocPoint); uint256 pendingAccStarsPerShare = pool.accStarsPerShare.add(starsReward); return user.amount.mul(pendingAccStarsPerShare).div(1e12).sub( user.rewardDebt ); } /** * @dev An internal function to calculate the total accumulated Stars per * share, assuming the stars per share remained the same since staking * began. * * Params: * blocks: The number of blocks to calculate for */ function accStarsPerShareAtCurrRate(uint256 blocks, uint256 poolSupply) public view returns (uint256) { if (blocks > epochs[2]) { return totalStarsPerEpoch[0] .add(totalStarsPerEpoch[1]) .add(totalStarsPerEpoch[2]) .mul(1e12) .div(poolSupply); } else if (blocks > epochs[1]) { uint256 currTierRewards = (blocks.sub(epochs[1]).mul(rewardAmounts[2])); return totalStarsPerEpoch[0] .add(totalStarsPerEpoch[1]) .add(currTierRewards) .mul(1e12) .div(poolSupply); } else if (blocks > epochs[0]) { uint256 currTierRewards = (blocks.sub(epochs[0]).mul(rewardAmounts[1])); return totalStarsPerEpoch[0].add(currTierRewards).mul(1e12).div( poolSupply ); } else { return blocks.mul(rewardAmounts[0]).mul(1e12).div(poolSupply); } } /** * @dev A function for the front-end to see information about the current rewards. */ function starsPerBlock() public view isInitialized returns (uint256 amount) { uint256 blocks = uint256(block.number).sub(startBlock); if (blocks >= epochs[2]) { return 0; } else if (blocks >= epochs[1]) { return rewardAmounts[2]; } else if (blocks >= epochs[0]) { return rewardAmounts[1]; } else { return rewardAmounts[0]; } } /** * @dev Calculates the additional stars per share that have been accumulated * since lastRewardBlock, and updates accStarsPerShare and lastRewardBlock * accordingly. */ function updatePool(uint256 _pid) public isInitialized { PoolInfo storage pool = poolInfo[_pid]; if (block.number <= pool.lastRewardBlock) { return; } if (pool.poolSupply != 0) { uint256 currRateEndStarsPerShare = accStarsPerShareAtCurrRate( uint256(block.number).sub(startBlock), pool.poolSupply ); uint256 currRateStartStarsPerShare = accStarsPerShareAtCurrRate( pool.lastRewardBlock.sub(startBlock), pool.poolSupply ); uint256 starsReward = (currRateEndStarsPerShare.sub(currRateStartStarsPerShare)) .mul(pool.allocPoint) .div(totalAllocPoint); pool.accStarsPerShare = pool.accStarsPerShare.add(starsReward); } pool.lastRewardBlock = block.number; } // Update reward vairables for all pools. Be careful of gas spending! function massUpdatePools() public isInitialized { uint256 length = poolInfo.length; for (uint256 pid = 0; pid < length; ++pid) { updatePool(pid); } } /** * @dev Collect rewards owed. * * Params: * _pid: the pool id */ function collectRewards(uint256 _pid) public isInitialized { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; updatePool(_pid); if (user.amount > 0) { uint256 pending = user.amount.mul(pool.accStarsPerShare).div(1e12).sub( user.rewardDebt ); safeStarsTransfer(msg.sender, pending); user.rewardDebt = user.amount.mul(pool.accStarsPerShare).div(1e12); } emit RewardsCollected(msg.sender, _pid); } /** * @dev Deposit stars for staking. The sender's pending rewards are * sent to the sender, and the sender's information is updated accordingly. * * Params: * _pid: the pool id * _amount: amount of Stars to deposit */ function deposit(uint256 _pid, uint256 _amount) public isInitialized { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; updatePool(_pid); pool.lpToken.safeTransferFrom( address(msg.sender), address(this), _amount ); uint256 pending = user.amount.mul(pool.accStarsPerShare).div(1e12).sub( user.rewardDebt ); safeStarsTransfer(msg.sender, pending); user.amount = user.amount.add(_amount); user.rewardDebt = user.amount.mul(pool.accStarsPerShare).div(1e12); pool.poolSupply = pool.poolSupply.add(_amount); emit Deposit(msg.sender, _pid, _amount); } /** * @dev Withdraw Stars from the amount that the user is staking and collect * pending rewards. * * Params: * _pid: the pool id * _amount: amount of Stars to withdraw * * Requirements: * _amount is less than or equal to the amount of Stars the the user has * deposited to the contract */ function withdraw(uint256 _pid, uint256 _amount) public isInitialized { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; require(user.amount >= _amount, "withdraw: not good"); updatePool(_pid); pool.lpToken.safeTransfer(address(msg.sender), _amount); uint256 pending = user.amount.mul(pool.accStarsPerShare).div(1e12).sub( user.rewardDebt ); safeStarsTransfer(msg.sender, pending); user.amount = user.amount.sub(_amount); user.rewardDebt = user.amount.mul(pool.accStarsPerShare).div(1e12); pool.poolSupply = pool.poolSupply.sub(_amount); emit Withdraw(msg.sender, _pid, _amount); } /** * @dev Withdraw without caring about rewards. EMERGENCY ONLY. */ function emergencyWithdraw(uint256 _pid) external isInitialized { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; pool.lpToken.safeTransfer(address(msg.sender), user.amount); emit EmergencyWithdraw(msg.sender, _pid, user.amount); pool.poolSupply = pool.poolSupply.sub(user.amount); user.amount = 0; user.rewardDebt = 0; } /** * @dev Safe Stars transfer function, just in case if rounding error causes * pool to not have enough Stars. Transaction gas fee on additional checks * will be more expensive than the possible rounding profit itself. * * Params: * _to: address to send Stars to * _amount: amount of Stars to send */ function safeStarsTransfer(address _to, uint256 _amount) internal { uint256 starsBal = stars.balanceOf(address(this)); if (_amount > starsBal) { stars.transfer(_to, starsBal); } else { stars.transfer(_to, _amount); } } }
// 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.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; import "../utils/EnumerableSet.sol"; import "../utils/Address.sol"; import "../utils/Context.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. * * 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 { using EnumerableSet for EnumerableSet.AddressSet; using Address for address; struct RoleData { EnumerableSet.AddressSet members; bytes32 adminRole; } mapping (bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @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 {_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) public view returns (bool) { return _roles[role].members.contains(account); } /** * @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 returns (uint256) { return _roles[role].members.length(); } /** * @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 returns (address) { return _roles[role].members.at(index); } /** * @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 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 { require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to grant"); _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 { require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to revoke"); _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 granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) public virtual { 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}. * ==== */ 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 { emit RoleAdminChanged(role, _roles[role].adminRole, adminRole); _roles[role].adminRole = adminRole; } function _grantRole(bytes32 role, address account) private { if (_roles[role].members.add(account)) { emit RoleGranted(role, account, _msgSender()); } } function _revokeRole(bytes32 role, address account) private { if (_roles[role].members.remove(account)) { emit RoleRevoked(role, account, _msgSender()); } } }
// 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.0 <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; // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement. 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] = toDeleteIndex + 1; // All indexes are 1-based // 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) { require(set._values.length > index, "EnumerableSet: index out of bounds"); return set._values[index]; } // 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); } // 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)))); } // 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)); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <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 GSN 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 payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"starsAddress","type":"address"},{"internalType":"address","name":"_admin","type":"address"},{"internalType":"uint256[3]","name":"_rewardAmounts","type":"uint256[3]"},{"internalType":"uint256[3]","name":"_epochs","type":"uint256[3]"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"EmergencyWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"}],"name":"RewardsCollected","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":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ROLE_ADMIN","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"blocks","type":"uint256"},{"internalType":"uint256","name":"poolSupply","type":"uint256"}],"name":"accStarsPerShareAtCurrRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_allocPoint","type":"uint256"},{"internalType":"contract IERC20","name":"_lpToken","type":"address"},{"internalType":"bool","name":"_withUpdate","type":"bool"}],"name":"add","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"collectRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"epochs","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":[{"internalType":"uint256","name":"_startBlock","type":"uint256"}],"name":"init","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"initialized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"massUpdatePools","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"pendingStars","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolInfo","outputs":[{"internalType":"contract IERC20","name":"lpToken","type":"address"},{"internalType":"uint256","name":"allocPoint","type":"uint256"},{"internalType":"uint256","name":"lastRewardBlock","type":"uint256"},{"internalType":"uint256","name":"accStarsPerShare","type":"uint256"},{"internalType":"uint256","name":"poolSupply","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","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":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"rewardAmounts","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_allocPoint","type":"uint256"},{"internalType":"bool","name":"_withUpdate","type":"bool"}],"name":"set","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stars","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"starsPerBlock","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"startBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAllocPoint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"totalStarsPerEpoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"updatePool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"userInfo","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"rewardDebt","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405260006006553480156200001657600080fd5b50604051620025173803806200251783398181016040526101008110156200003d57600080fd5b50805160208201519091604081019060a0016200006a600080516020620024d683398151915284620001aa565b62000085600080516020620024d683398151915280620001ba565b60208101518151108015620000a1575060408101516020820151105b620000e4576040805162461bcd60e51b815260206004820152600e60248201526d696e76616c69642065706f63687360901b604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b0386161790556200010e6007836003620003cc565b506200011e600a826003620003cc565b50805162000143908360005b60200201516200020c60201b620015e11790919060201c565b600d55805162000178906200016f908360015b60200201516200027360201b6200163a1790919060201c565b8360016200012a565b600e5560208101516200019c90620001939083600262000156565b8360026200012a565b600f55506200042692505050565b620001b68282620002d1565b5050565b600082815260208190526040808220600201549051839285917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a460009182526020829052604090912060020155565b6000826200021d575060006200026d565b828202828482816200022b57fe5b04146200026a5760405162461bcd60e51b8152600401808060200182810382526021815260200180620024f66021913960400191505060405180910390fd5b90505b92915050565b600082821115620002cb576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b600082815260208181526040909120620002f6918390620016976200034a821b17901c565b15620001b6576200030662000361565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60006200026a836001600160a01b03841662000365565b3390565b6000620003738383620003b4565b620003ab575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556200026d565b5060006200026d565b60009081526001919091016020526040902054151590565b8260038101928215620003fd579160200282015b82811115620003fd578251825591602001919060010190620003e0565b506200040b9291506200040f565b5090565b5b808211156200040b576000815560010162000410565b6120a080620004366000396000f3fe608060405234801561001057600080fd5b50600436106101e55760003560e01c806364fdcd431161010f578063b7b0422d116100a2578063d391014b11610071578063d391014b14610565578063d547741f1461056d578063d7c7edd414610599578063e2bbb158146105b6576101e5565b8063b7b0422d146104f1578063c6b61e4c1461050e578063ca0930471461052b578063ca15c87314610548576101e5565b806393f1a40b116100de57806393f1a40b1461045b578063982669eb146104a0578063a217fddf146104cc578063b18486d7146104d4576101e5565b806364fdcd43146103e15780639010d07c1461040457806391d14854146104275780639207ddb114610453576101e5565b80632f2ff15d1161018757806351eb05a61161015657806351eb05a6146103745780635312ea8e14610391578063630b5ba1146103ae57806364482f79146103b6576101e5565b80632f2ff15d146102f157806336568abe1461031d578063441a3e701461034957806348cd4cb11461036c576101e5565b8063158ef93e116101c3578063158ef93e1461027a57806317caf6f1146102965780631eaaa0451461029e578063248a9ca3146102d4576101e5565b8063081e3eda146101ea5780630dd5b3c5146102045780631526fe2714610228575b600080fd5b6101f26105d9565b60408051918252519081900360200190f35b61020c6105e0565b604080516001600160a01b039092168252519081900360200190f35b6102456004803603602081101561023e57600080fd5b50356105ef565b604080516001600160a01b03909616865260208601949094528484019290925260608401526080830152519081900360a00190f35b610282610637565b604080519115158252519081900360200190f35b6101f2610640565b6102d2600480360360608110156102b457600080fd5b508035906001600160a01b0360208201351690604001351515610646565b005b6101f2600480360360208110156102ea57600080fd5b503561083e565b6102d26004803603604081101561030757600080fd5b50803590602001356001600160a01b0316610853565b6102d26004803603604081101561033357600080fd5b50803590602001356001600160a01b03166108bf565b6102d26004803603604081101561035f57600080fd5b5080359060200135610920565b6101f2610ad0565b6102d26004803603602081101561038a57600080fd5b5035610ad6565b6102d2600480360360208110156103a757600080fd5b5035610bf8565b6102d2610cf4565b6102d2600480360360608110156103cc57600080fd5b50803590602081013590604001351515610d5c565b6101f2600480360360408110156103f757600080fd5b5080359060200135610e7d565b61020c6004803603604081101561041a57600080fd5b5080359060200135610f6c565b6102826004803603604081101561043d57600080fd5b50803590602001356001600160a01b0316610f8b565b6101f2610fa3565b6104876004803603604081101561047157600080fd5b50803590602001356001600160a01b031661104f565b6040805192835260208301919091528051918290030190f35b6101f2600480360360408110156104b657600080fd5b50803590602001356001600160a01b0316611073565b6101f26111d0565b6102d2600480360360208110156104ea57600080fd5b50356111d5565b6102d26004803603602081101561050757600080fd5b50356112f3565b6101f26004803603602081101561052457600080fd5b50356113d7565b6101f26004803603602081101561054157600080fd5b50356113eb565b6101f26004803603602081101561055e57600080fd5b50356113f8565b6101f261140f565b6102d26004803603604081101561058357600080fd5b50803590602001356001600160a01b0316611421565b6101f2600480360360208110156105af57600080fd5b503561147a565b6102d2600480360360408110156105cc57600080fd5b5080359060200135611487565b6002545b90565b6001546001600160a01b031681565b600281815481106105fc57fe5b6000918252602090912060059091020180546001820154600283015460038401546004909401546001600160a01b0390931694509092909185565b60055460ff1681565b60065481565b61065e600080516020611fd183398151915233610f8b565b6106a5576040805162461bcd60e51b815260206004820152601360248201527229b2b73232b91034b9903737ba1030b236b4b760691b604482015290519081900360640190fd5b60055460ff166106ee576040805162461bcd60e51b815260206004820152600f60248201526e139bdd081a5b9a5d1a585b1a5e9959608a1b604482015290519081900360640190fd5b80156106fc576106fc610cf4565b6000600454431161070f57600454610711565b435b60065490915061072190856116ac565b6006556040805160a0810182526001600160a01b039485168152602081019586529081019182526000606082018181526080830182815260028054600181018255935292517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace600590930292830180546001600160a01b031916919097161790955594517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5acf86015590517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad085015591517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad184015550517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad290910155565b60009081526020819052604090206002015490565b60008281526020819052604090206002015461087690610871611706565b610f8b565b6108b15760405162461bcd60e51b815260040180806020018281038252602f815260200180611f4c602f913960400191505060405180910390fd5b6108bb828261170a565b5050565b6108c7611706565b6001600160a01b0316816001600160a01b0316146109165760405162461bcd60e51b815260040180806020018281038252602f81526020018061203c602f913960400191505060405180910390fd5b6108bb8282611773565b60055460ff16610969576040805162461bcd60e51b815260206004820152600f60248201526e139bdd081a5b9a5d1a585b1a5e9959608a1b604482015290519081900360640190fd5b60006002838154811061097857fe5b6000918252602080832086845260038252604080852033865290925292208054600590920290920192508311156109eb576040805162461bcd60e51b81526020600482015260126024820152711dda5d1a191c985dce881b9bdd0819dbdbd960721b604482015290519081900360640190fd5b6109f484610ad6565b8154610a0a906001600160a01b031633856117dc565b6000610a448260010154610a3e64e8d4a51000610a38876003015487600001546115e190919063ffffffff16565b90611833565b9061163a565b9050610a50338261189a565b8154610a5c908561163a565b8083556003840154610a799164e8d4a5100091610a3891906115e1565b60018301556004830154610a8d908561163a565b6004840155604080518581529051869133917ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b5689181900360200190a35050505050565b60045481565b60055460ff16610b1f576040805162461bcd60e51b815260206004820152600f60248201526e139bdd081a5b9a5d1a585b1a5e9959608a1b604482015290519081900360640190fd5b600060028281548110610b2e57fe5b9060005260206000209060050201905080600201544311610b4f5750610bf5565b600481015415610bed576000610b7d610b736004544361163a90919063ffffffff16565b8360040154610e7d565b90506000610ba7610b9d600454856002015461163a90919063ffffffff16565b8460040154610e7d565b90506000610bd2600654610a388660010154610bcc868861163a90919063ffffffff16565b906115e1565b6003850154909150610be490826116ac565b60038501555050505b436002909101555b50565b60055460ff16610c41576040805162461bcd60e51b815260206004820152600f60248201526e139bdd081a5b9a5d1a585b1a5e9959608a1b604482015290519081900360640190fd5b600060028281548110610c5057fe5b60009182526020808320858452600382526040808520338087529352909320805460059093029093018054909450610c95926001600160a01b039190911691906117dc565b80546040805191825251849133917fbb757047c2b5f3974fe26b7c10f732e7bce710b0952a71082702781e62ae05959181900360200190a380546004830154610cdd9161163a565b600490920191909155600080825560019091015550565b60055460ff16610d3d576040805162461bcd60e51b815260206004820152600f60248201526e139bdd081a5b9a5d1a585b1a5e9959608a1b604482015290519081900360640190fd5b60025460005b818110156108bb57610d5481610ad6565b600101610d43565b610d74600080516020611fd183398151915233610f8b565b610dbb576040805162461bcd60e51b815260206004820152601360248201527229b2b73232b91034b9903737ba1030b236b4b760691b604482015290519081900360640190fd5b60055460ff16610e04576040805162461bcd60e51b815260206004820152600f60248201526e139bdd081a5b9a5d1a585b1a5e9959608a1b604482015290519081900360640190fd5b8015610e1257610e12610cf4565b610e4f82610e4960028681548110610e2657fe5b90600052602060002090600502016001015460065461163a90919063ffffffff16565b906116ac565b6006819055508160028481548110610e6357fe5b906000526020600020906005020160010181905550505050565b600c54600090831115610ebf57610eb882610a3864e8d4a51000610bcc600d60025b0154610e49600d60015b0154600d60005b0154906116ac565b9050610f66565b600b54831115610f0c576000610ee5600760020154610bcc600a60015b0154879061163a565b9050610f0483610a3864e8d4a51000610bcc85610e49600d6001610ea9565b915050610f66565b600a54831115610f49576000610f2d600760010154610bcc600a6000610edc565b9050610f0483610a3864e8d4a51000610bcc85600d6000610eb0565b610eb882610a3864e8d4a51000610bcc60076000015488906115e1565b92915050565b6000828152602081905260408120610f849083611a2a565b9392505050565b6000828152602081905260408120610f849083611a36565b60055460009060ff16610fef576040805162461bcd60e51b815260206004820152600f60248201526e139bdd081a5b9a5d1a585b1a5e9959608a1b604482015290519081900360640190fd5b60006110066004544361163a90919063ffffffff16565b600c54909150811061101c5760009150506105dd565b600b54811061103457600760025b01549150506105dd565b600a548110611046576007600161102a565b6007600061102a565b60036020908152600092835260408084209091529082529020805460019091015482565b60055460009060ff166110bf576040805162461bcd60e51b815260206004820152600f60248201526e139bdd081a5b9a5d1a585b1a5e9959608a1b604482015290519081900360640190fd5b6000600284815481106110ce57fe5b600091825260208083208784526003825260408085206001600160a01b03891686529092529220600460059092029092019081015490925061111557600092505050610f66565b600061112f610b9d6004544361163a90919063ffffffff16565b9050600061115961114f600454866002015461163a90919063ffffffff16565b8560040154610e7d565b9050600061117e600654610a388760010154610bcc868861163a90919063ffffffff16565b905060006111998287600301546116ac90919063ffffffff16565b90506111c38560010154610a3e64e8d4a51000610a38858a600001546115e190919063ffffffff16565b9998505050505050505050565b600081565b60055460ff1661121e576040805162461bcd60e51b815260206004820152600f60248201526e139bdd081a5b9a5d1a585b1a5e9959608a1b604482015290519081900360640190fd5b60006002828154811061122d57fe5b6000918252602080832085845260038252604080852033865290925292206005909102909101915061125e83610ad6565b8054156112c15760006112938260010154610a3e64e8d4a51000610a38876003015487600001546115e190919063ffffffff16565b905061129f338261189a565b600383015482546112ba9164e8d4a5100091610a38916115e1565b6001830155505b604051839033907ff404cd4814ff561c9e00078e4984b7c5580a7d479c47554807962de186f34e9a90600090a3505050565b61130b600080516020611fd183398151915233610f8b565b611352576040805162461bcd60e51b815260206004820152601360248201527229b2b73232b91034b9903737ba1030b236b4b760691b604482015290519081900360640190fd5b60055460ff16156113a0576040805162461bcd60e51b8152602060048201526013602482015272105b1c9958591e481a5b9a5d1a585b1a5e9959606a1b604482015290519081900360640190fd5b6113c533306113b1600d6002610e9f565b6001546001600160a01b0316929190611a4b565b6004556005805460ff19166001179055565b600a81600381106113e457fe5b0154905081565b600781600381106113e457fe5b6000818152602081905260408120610f6690611aab565b600080516020611fd183398151915281565b60008281526020819052604090206002015461143f90610871611706565b6109165760405162461bcd60e51b8152600401808060200182810382526030815260200180611fa16030913960400191505060405180910390fd5b600d81600381106113e457fe5b60055460ff166114d0576040805162461bcd60e51b815260206004820152600f60248201526e139bdd081a5b9a5d1a585b1a5e9959608a1b604482015290519081900360640190fd5b6000600283815481106114df57fe5b6000918252602080832086845260038252604080852033865290925292206005909102909101915061151084610ad6565b8154611527906001600160a01b0316333086611a4b565b60006115558260010154610a3e64e8d4a51000610a38876003015487600001546115e190919063ffffffff16565b9050611561338261189a565b815461156d90856116ac565b808355600384015461158a9164e8d4a5100091610a3891906115e1565b6001830155600483015461159e90856116ac565b6004840155604080518581529051869133917f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a159181900360200190a35050505050565b6000826115f057506000610f66565b828202828482816115fd57fe5b0414610f845760405162461bcd60e51b8152600401808060200182810382526021815260200180611ff16021913960400191505060405180910390fd5b600082821115611691576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6000610f84836001600160a01b038416611ab6565b600082820183811015610f84576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b3390565b60008281526020819052604090206117229082611697565b156108bb5761172f611706565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600082815260208190526040902061178b9082611b00565b156108bb57611798611706565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b17905261182e908490611b15565b505050565b6000808211611889576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b81838161189257fe5b049392505050565b600154604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156118e557600080fd5b505afa1580156118f9573d6000803e3d6000fd5b505050506040513d602081101561190f57600080fd5b50519050808211156119a3576001546040805163a9059cbb60e01b81526001600160a01b038681166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b15801561197157600080fd5b505af1158015611985573d6000803e3d6000fd5b505050506040513d602081101561199b57600080fd5b5061182e9050565b6001546040805163a9059cbb60e01b81526001600160a01b038681166004830152602482018690529151919092169163a9059cbb9160448083019260209291908290030181600087803b1580156119f957600080fd5b505af1158015611a0d573d6000803e3d6000fd5b505050506040513d6020811015611a2357600080fd5b5050505050565b6000610f848383611bc6565b6000610f84836001600160a01b038416611c2a565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052611aa5908590611b15565b50505050565b6000610f6682611c42565b6000611ac28383611c2a565b611af857508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610f66565b506000610f66565b6000610f84836001600160a01b038416611c46565b6060611b6a826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611d0c9092919063ffffffff16565b80519091501561182e57808060200190516020811015611b8957600080fd5b505161182e5760405162461bcd60e51b815260040180806020018281038252602a815260200180612012602a913960400191505060405180910390fd5b81546000908210611c085760405162461bcd60e51b8152600401808060200182810382526022815260200180611f2a6022913960400191505060405180910390fd5b826000018281548110611c1757fe5b9060005260206000200154905092915050565b60009081526001919091016020526040902054151590565b5490565b60008181526001830160205260408120548015611d025783546000198083019190810190600090879083908110611c7957fe5b9060005260206000200154905080876000018481548110611c9657fe5b600091825260208083209091019290925582815260018981019092526040902090840190558654879080611cc657fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050610f66565b6000915050610f66565b6060611d1b8484600085611d23565b949350505050565b606082471015611d645760405162461bcd60e51b8152600401808060200182810382526026815260200180611f7b6026913960400191505060405180910390fd5b611d6d85611e7f565b611dbe576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b60208310611dfd5780518252601f199092019160209182019101611dde565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114611e5f576040519150601f19603f3d011682016040523d82523d6000602084013e611e64565b606091505b5091509150611e74828286611e85565b979650505050505050565b3b151590565b60608315611e94575081610f84565b825115611ea45782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611eee578181015183820152602001611ed6565b50505050905090810190601f168015611f1b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fdfe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e6473416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f206772616e74416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f207265766f6b652172861495e7b85edac73e3cd5fbb42dd675baadf627720e687bcfdaca025096536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636520726f6c657320666f722073656c66a2646970667358221220d6b193f1bce007e276b8ef5a2a9e07dad08f17fb0d77426525c571c9e2a4a85764736f6c634300060c00332172861495e7b85edac73e3cd5fbb42dd675baadf627720e687bcfdaca025096536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77000000000000000000000000c55c2175e90a46602fd42e931f62b3acc1a013ca0000000000000000000000001c3b019f6d5a38d3eeea65cc8ab8eca8d61dcc7000000000000000000000000000000000000000000000000ad78ebc5ac6200000000000000000000000000000000000000000000000000003cb71f51fc5580000000000000000000000000000000000000000000000000001158e460913d0000000000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000000000000000000000493e000000000000000000000000000000000000000000000000000000000000927c0
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101e55760003560e01c806364fdcd431161010f578063b7b0422d116100a2578063d391014b11610071578063d391014b14610565578063d547741f1461056d578063d7c7edd414610599578063e2bbb158146105b6576101e5565b8063b7b0422d146104f1578063c6b61e4c1461050e578063ca0930471461052b578063ca15c87314610548576101e5565b806393f1a40b116100de57806393f1a40b1461045b578063982669eb146104a0578063a217fddf146104cc578063b18486d7146104d4576101e5565b806364fdcd43146103e15780639010d07c1461040457806391d14854146104275780639207ddb114610453576101e5565b80632f2ff15d1161018757806351eb05a61161015657806351eb05a6146103745780635312ea8e14610391578063630b5ba1146103ae57806364482f79146103b6576101e5565b80632f2ff15d146102f157806336568abe1461031d578063441a3e701461034957806348cd4cb11461036c576101e5565b8063158ef93e116101c3578063158ef93e1461027a57806317caf6f1146102965780631eaaa0451461029e578063248a9ca3146102d4576101e5565b8063081e3eda146101ea5780630dd5b3c5146102045780631526fe2714610228575b600080fd5b6101f26105d9565b60408051918252519081900360200190f35b61020c6105e0565b604080516001600160a01b039092168252519081900360200190f35b6102456004803603602081101561023e57600080fd5b50356105ef565b604080516001600160a01b03909616865260208601949094528484019290925260608401526080830152519081900360a00190f35b610282610637565b604080519115158252519081900360200190f35b6101f2610640565b6102d2600480360360608110156102b457600080fd5b508035906001600160a01b0360208201351690604001351515610646565b005b6101f2600480360360208110156102ea57600080fd5b503561083e565b6102d26004803603604081101561030757600080fd5b50803590602001356001600160a01b0316610853565b6102d26004803603604081101561033357600080fd5b50803590602001356001600160a01b03166108bf565b6102d26004803603604081101561035f57600080fd5b5080359060200135610920565b6101f2610ad0565b6102d26004803603602081101561038a57600080fd5b5035610ad6565b6102d2600480360360208110156103a757600080fd5b5035610bf8565b6102d2610cf4565b6102d2600480360360608110156103cc57600080fd5b50803590602081013590604001351515610d5c565b6101f2600480360360408110156103f757600080fd5b5080359060200135610e7d565b61020c6004803603604081101561041a57600080fd5b5080359060200135610f6c565b6102826004803603604081101561043d57600080fd5b50803590602001356001600160a01b0316610f8b565b6101f2610fa3565b6104876004803603604081101561047157600080fd5b50803590602001356001600160a01b031661104f565b6040805192835260208301919091528051918290030190f35b6101f2600480360360408110156104b657600080fd5b50803590602001356001600160a01b0316611073565b6101f26111d0565b6102d2600480360360208110156104ea57600080fd5b50356111d5565b6102d26004803603602081101561050757600080fd5b50356112f3565b6101f26004803603602081101561052457600080fd5b50356113d7565b6101f26004803603602081101561054157600080fd5b50356113eb565b6101f26004803603602081101561055e57600080fd5b50356113f8565b6101f261140f565b6102d26004803603604081101561058357600080fd5b50803590602001356001600160a01b0316611421565b6101f2600480360360208110156105af57600080fd5b503561147a565b6102d2600480360360408110156105cc57600080fd5b5080359060200135611487565b6002545b90565b6001546001600160a01b031681565b600281815481106105fc57fe5b6000918252602090912060059091020180546001820154600283015460038401546004909401546001600160a01b0390931694509092909185565b60055460ff1681565b60065481565b61065e600080516020611fd183398151915233610f8b565b6106a5576040805162461bcd60e51b815260206004820152601360248201527229b2b73232b91034b9903737ba1030b236b4b760691b604482015290519081900360640190fd5b60055460ff166106ee576040805162461bcd60e51b815260206004820152600f60248201526e139bdd081a5b9a5d1a585b1a5e9959608a1b604482015290519081900360640190fd5b80156106fc576106fc610cf4565b6000600454431161070f57600454610711565b435b60065490915061072190856116ac565b6006556040805160a0810182526001600160a01b039485168152602081019586529081019182526000606082018181526080830182815260028054600181018255935292517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace600590930292830180546001600160a01b031916919097161790955594517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5acf86015590517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad085015591517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad184015550517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad290910155565b60009081526020819052604090206002015490565b60008281526020819052604090206002015461087690610871611706565b610f8b565b6108b15760405162461bcd60e51b815260040180806020018281038252602f815260200180611f4c602f913960400191505060405180910390fd5b6108bb828261170a565b5050565b6108c7611706565b6001600160a01b0316816001600160a01b0316146109165760405162461bcd60e51b815260040180806020018281038252602f81526020018061203c602f913960400191505060405180910390fd5b6108bb8282611773565b60055460ff16610969576040805162461bcd60e51b815260206004820152600f60248201526e139bdd081a5b9a5d1a585b1a5e9959608a1b604482015290519081900360640190fd5b60006002838154811061097857fe5b6000918252602080832086845260038252604080852033865290925292208054600590920290920192508311156109eb576040805162461bcd60e51b81526020600482015260126024820152711dda5d1a191c985dce881b9bdd0819dbdbd960721b604482015290519081900360640190fd5b6109f484610ad6565b8154610a0a906001600160a01b031633856117dc565b6000610a448260010154610a3e64e8d4a51000610a38876003015487600001546115e190919063ffffffff16565b90611833565b9061163a565b9050610a50338261189a565b8154610a5c908561163a565b8083556003840154610a799164e8d4a5100091610a3891906115e1565b60018301556004830154610a8d908561163a565b6004840155604080518581529051869133917ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b5689181900360200190a35050505050565b60045481565b60055460ff16610b1f576040805162461bcd60e51b815260206004820152600f60248201526e139bdd081a5b9a5d1a585b1a5e9959608a1b604482015290519081900360640190fd5b600060028281548110610b2e57fe5b9060005260206000209060050201905080600201544311610b4f5750610bf5565b600481015415610bed576000610b7d610b736004544361163a90919063ffffffff16565b8360040154610e7d565b90506000610ba7610b9d600454856002015461163a90919063ffffffff16565b8460040154610e7d565b90506000610bd2600654610a388660010154610bcc868861163a90919063ffffffff16565b906115e1565b6003850154909150610be490826116ac565b60038501555050505b436002909101555b50565b60055460ff16610c41576040805162461bcd60e51b815260206004820152600f60248201526e139bdd081a5b9a5d1a585b1a5e9959608a1b604482015290519081900360640190fd5b600060028281548110610c5057fe5b60009182526020808320858452600382526040808520338087529352909320805460059093029093018054909450610c95926001600160a01b039190911691906117dc565b80546040805191825251849133917fbb757047c2b5f3974fe26b7c10f732e7bce710b0952a71082702781e62ae05959181900360200190a380546004830154610cdd9161163a565b600490920191909155600080825560019091015550565b60055460ff16610d3d576040805162461bcd60e51b815260206004820152600f60248201526e139bdd081a5b9a5d1a585b1a5e9959608a1b604482015290519081900360640190fd5b60025460005b818110156108bb57610d5481610ad6565b600101610d43565b610d74600080516020611fd183398151915233610f8b565b610dbb576040805162461bcd60e51b815260206004820152601360248201527229b2b73232b91034b9903737ba1030b236b4b760691b604482015290519081900360640190fd5b60055460ff16610e04576040805162461bcd60e51b815260206004820152600f60248201526e139bdd081a5b9a5d1a585b1a5e9959608a1b604482015290519081900360640190fd5b8015610e1257610e12610cf4565b610e4f82610e4960028681548110610e2657fe5b90600052602060002090600502016001015460065461163a90919063ffffffff16565b906116ac565b6006819055508160028481548110610e6357fe5b906000526020600020906005020160010181905550505050565b600c54600090831115610ebf57610eb882610a3864e8d4a51000610bcc600d60025b0154610e49600d60015b0154600d60005b0154906116ac565b9050610f66565b600b54831115610f0c576000610ee5600760020154610bcc600a60015b0154879061163a565b9050610f0483610a3864e8d4a51000610bcc85610e49600d6001610ea9565b915050610f66565b600a54831115610f49576000610f2d600760010154610bcc600a6000610edc565b9050610f0483610a3864e8d4a51000610bcc85600d6000610eb0565b610eb882610a3864e8d4a51000610bcc60076000015488906115e1565b92915050565b6000828152602081905260408120610f849083611a2a565b9392505050565b6000828152602081905260408120610f849083611a36565b60055460009060ff16610fef576040805162461bcd60e51b815260206004820152600f60248201526e139bdd081a5b9a5d1a585b1a5e9959608a1b604482015290519081900360640190fd5b60006110066004544361163a90919063ffffffff16565b600c54909150811061101c5760009150506105dd565b600b54811061103457600760025b01549150506105dd565b600a548110611046576007600161102a565b6007600061102a565b60036020908152600092835260408084209091529082529020805460019091015482565b60055460009060ff166110bf576040805162461bcd60e51b815260206004820152600f60248201526e139bdd081a5b9a5d1a585b1a5e9959608a1b604482015290519081900360640190fd5b6000600284815481106110ce57fe5b600091825260208083208784526003825260408085206001600160a01b03891686529092529220600460059092029092019081015490925061111557600092505050610f66565b600061112f610b9d6004544361163a90919063ffffffff16565b9050600061115961114f600454866002015461163a90919063ffffffff16565b8560040154610e7d565b9050600061117e600654610a388760010154610bcc868861163a90919063ffffffff16565b905060006111998287600301546116ac90919063ffffffff16565b90506111c38560010154610a3e64e8d4a51000610a38858a600001546115e190919063ffffffff16565b9998505050505050505050565b600081565b60055460ff1661121e576040805162461bcd60e51b815260206004820152600f60248201526e139bdd081a5b9a5d1a585b1a5e9959608a1b604482015290519081900360640190fd5b60006002828154811061122d57fe5b6000918252602080832085845260038252604080852033865290925292206005909102909101915061125e83610ad6565b8054156112c15760006112938260010154610a3e64e8d4a51000610a38876003015487600001546115e190919063ffffffff16565b905061129f338261189a565b600383015482546112ba9164e8d4a5100091610a38916115e1565b6001830155505b604051839033907ff404cd4814ff561c9e00078e4984b7c5580a7d479c47554807962de186f34e9a90600090a3505050565b61130b600080516020611fd183398151915233610f8b565b611352576040805162461bcd60e51b815260206004820152601360248201527229b2b73232b91034b9903737ba1030b236b4b760691b604482015290519081900360640190fd5b60055460ff16156113a0576040805162461bcd60e51b8152602060048201526013602482015272105b1c9958591e481a5b9a5d1a585b1a5e9959606a1b604482015290519081900360640190fd5b6113c533306113b1600d6002610e9f565b6001546001600160a01b0316929190611a4b565b6004556005805460ff19166001179055565b600a81600381106113e457fe5b0154905081565b600781600381106113e457fe5b6000818152602081905260408120610f6690611aab565b600080516020611fd183398151915281565b60008281526020819052604090206002015461143f90610871611706565b6109165760405162461bcd60e51b8152600401808060200182810382526030815260200180611fa16030913960400191505060405180910390fd5b600d81600381106113e457fe5b60055460ff166114d0576040805162461bcd60e51b815260206004820152600f60248201526e139bdd081a5b9a5d1a585b1a5e9959608a1b604482015290519081900360640190fd5b6000600283815481106114df57fe5b6000918252602080832086845260038252604080852033865290925292206005909102909101915061151084610ad6565b8154611527906001600160a01b0316333086611a4b565b60006115558260010154610a3e64e8d4a51000610a38876003015487600001546115e190919063ffffffff16565b9050611561338261189a565b815461156d90856116ac565b808355600384015461158a9164e8d4a5100091610a3891906115e1565b6001830155600483015461159e90856116ac565b6004840155604080518581529051869133917f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a159181900360200190a35050505050565b6000826115f057506000610f66565b828202828482816115fd57fe5b0414610f845760405162461bcd60e51b8152600401808060200182810382526021815260200180611ff16021913960400191505060405180910390fd5b600082821115611691576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6000610f84836001600160a01b038416611ab6565b600082820183811015610f84576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b3390565b60008281526020819052604090206117229082611697565b156108bb5761172f611706565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600082815260208190526040902061178b9082611b00565b156108bb57611798611706565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b17905261182e908490611b15565b505050565b6000808211611889576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b81838161189257fe5b049392505050565b600154604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156118e557600080fd5b505afa1580156118f9573d6000803e3d6000fd5b505050506040513d602081101561190f57600080fd5b50519050808211156119a3576001546040805163a9059cbb60e01b81526001600160a01b038681166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b15801561197157600080fd5b505af1158015611985573d6000803e3d6000fd5b505050506040513d602081101561199b57600080fd5b5061182e9050565b6001546040805163a9059cbb60e01b81526001600160a01b038681166004830152602482018690529151919092169163a9059cbb9160448083019260209291908290030181600087803b1580156119f957600080fd5b505af1158015611a0d573d6000803e3d6000fd5b505050506040513d6020811015611a2357600080fd5b5050505050565b6000610f848383611bc6565b6000610f84836001600160a01b038416611c2a565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052611aa5908590611b15565b50505050565b6000610f6682611c42565b6000611ac28383611c2a565b611af857508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610f66565b506000610f66565b6000610f84836001600160a01b038416611c46565b6060611b6a826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611d0c9092919063ffffffff16565b80519091501561182e57808060200190516020811015611b8957600080fd5b505161182e5760405162461bcd60e51b815260040180806020018281038252602a815260200180612012602a913960400191505060405180910390fd5b81546000908210611c085760405162461bcd60e51b8152600401808060200182810382526022815260200180611f2a6022913960400191505060405180910390fd5b826000018281548110611c1757fe5b9060005260206000200154905092915050565b60009081526001919091016020526040902054151590565b5490565b60008181526001830160205260408120548015611d025783546000198083019190810190600090879083908110611c7957fe5b9060005260206000200154905080876000018481548110611c9657fe5b600091825260208083209091019290925582815260018981019092526040902090840190558654879080611cc657fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050610f66565b6000915050610f66565b6060611d1b8484600085611d23565b949350505050565b606082471015611d645760405162461bcd60e51b8152600401808060200182810382526026815260200180611f7b6026913960400191505060405180910390fd5b611d6d85611e7f565b611dbe576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b60208310611dfd5780518252601f199092019160209182019101611dde565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114611e5f576040519150601f19603f3d011682016040523d82523d6000602084013e611e64565b606091505b5091509150611e74828286611e85565b979650505050505050565b3b151590565b60608315611e94575081610f84565b825115611ea45782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611eee578181015183820152602001611ed6565b50505050905090810190601f168015611f1b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fdfe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e6473416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f206772616e74416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f207265766f6b652172861495e7b85edac73e3cd5fbb42dd675baadf627720e687bcfdaca025096536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636520726f6c657320666f722073656c66a2646970667358221220d6b193f1bce007e276b8ef5a2a9e07dad08f17fb0d77426525c571c9e2a4a85764736f6c634300060c0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000c55c2175e90a46602fd42e931f62b3acc1a013ca0000000000000000000000001c3b019f6d5a38d3eeea65cc8ab8eca8d61dcc7000000000000000000000000000000000000000000000000ad78ebc5ac6200000000000000000000000000000000000000000000000000003cb71f51fc5580000000000000000000000000000000000000000000000000001158e460913d0000000000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000000000000000000000493e000000000000000000000000000000000000000000000000000000000000927c0
-----Decoded View---------------
Arg [0] : starsAddress (address): 0xc55c2175E90A46602fD42e931f62B3Acc1A013Ca
Arg [1] : _admin (address): 0x1c3B019F6d5a38d3EEea65cc8AB8EcA8D61dCC70
Arg [2] : _rewardAmounts (uint256[3]): 200000000000000000000,70000000000000000000,20000000000000000000
Arg [3] : _epochs (uint256[3]): 100000,300000,600000
-----Encoded View---------------
8 Constructor Arguments found :
Arg [0] : 000000000000000000000000c55c2175e90a46602fd42e931f62b3acc1a013ca
Arg [1] : 0000000000000000000000001c3b019f6d5a38d3eeea65cc8ab8eca8d61dcc70
Arg [2] : 00000000000000000000000000000000000000000000000ad78ebc5ac6200000
Arg [3] : 000000000000000000000000000000000000000000000003cb71f51fc5580000
Arg [4] : 000000000000000000000000000000000000000000000001158e460913d00000
Arg [5] : 00000000000000000000000000000000000000000000000000000000000186a0
Arg [6] : 00000000000000000000000000000000000000000000000000000000000493e0
Arg [7] : 00000000000000000000000000000000000000000000000000000000000927c0
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
ETH | 100.00% | $0.000601 | 1,574,576.3427 | $946.82 |
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.