Feature Tip: Add private address tag to any address under My Name Tag !
More Info
Private Name Tags
ContractCreator
Latest 11 from a total of 11 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Harvest And Comp... | 14439806 | 1025 days ago | IN | 0 ETH | 0.00315454 | ||||
Update Pool | 14439804 | 1025 days ago | IN | 0 ETH | 0.00307396 | ||||
Deposit | 14439796 | 1025 days ago | IN | 0 ETH | 0.00510878 | ||||
Withdraw All | 14439773 | 1025 days ago | IN | 0 ETH | 0.00163832 | ||||
Withdraw | 14439649 | 1025 days ago | IN | 0 ETH | 0.0024476 | ||||
Withdraw | 14439633 | 1025 days ago | IN | 0 ETH | 0.00343849 | ||||
Harvest And Comp... | 14439498 | 1025 days ago | IN | 0 ETH | 0.00209962 | ||||
Update Pool | 14439482 | 1025 days ago | IN | 0 ETH | 0.0020132 | ||||
Update Pool | 14439466 | 1025 days ago | IN | 0 ETH | 0.00231859 | ||||
Deposit | 14439454 | 1025 days ago | IN | 0 ETH | 0.00334916 | ||||
Deposit | 14213247 | 1060 days ago | IN | 0 ETH | 0.00795818 |
Advanced mode: Intended for advanced users or developers and will display all Internal Transactions including zero value transfers. Name tag integration is not available in advanced view.
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block |
From
|
To
|
||||
---|---|---|---|---|---|---|---|
21603184 | 1 hr ago | 0 ETH | |||||
21603184 | 1 hr ago | 0 ETH | |||||
21603184 | 1 hr ago | 0 ETH | |||||
21603184 | 1 hr ago | 0 ETH | |||||
21603184 | 1 hr ago | 0 ETH | |||||
21603184 | 1 hr ago | 0 ETH | |||||
21603184 | 1 hr ago | 0 ETH | |||||
21603154 | 1 hr ago | 0 ETH | |||||
21600875 | 8 hrs ago | 0 ETH | |||||
21600875 | 8 hrs ago | 0 ETH | |||||
21600875 | 8 hrs ago | 0 ETH | |||||
21600875 | 8 hrs ago | 0 ETH | |||||
21599724 | 12 hrs ago | 0 ETH | |||||
21599724 | 12 hrs ago | 0 ETH | |||||
21599724 | 12 hrs ago | 0 ETH | |||||
21599724 | 12 hrs ago | 0 ETH | |||||
21599717 | 12 hrs ago | 0 ETH | |||||
21599717 | 12 hrs ago | 0 ETH | |||||
21599717 | 12 hrs ago | 0 ETH | |||||
21599717 | 12 hrs ago | 0 ETH | |||||
21599476 | 13 hrs ago | 0 ETH | |||||
21599476 | 13 hrs ago | 0 ETH | |||||
21599476 | 13 hrs ago | 0 ETH | |||||
21599476 | 13 hrs ago | 0 ETH | |||||
21597739 | 19 hrs ago | 0 ETH |
Loading...
Loading
Contract Name:
TokenDistributor
Compiler Version
v0.8.11+commit.d7f03943
Optimization Enabled:
Yes with 100 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {ReentrancyGuard} from '@openzeppelin/contracts/security/ReentrancyGuard.sol'; import {IERC20, SafeERC20} from '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol'; import {IMintableERC20} from './IMintableERC20.sol'; /** * @title TokenDistributor * @notice It handles the distribution of X2Y2 token. * It auto-adjusts block rewards over a set number of periods. */ contract TokenDistributor is ReentrancyGuard { using SafeERC20 for IERC20; using SafeERC20 for IMintableERC20; struct StakingPeriod { uint256 rewardPerBlockForStaking; uint256 rewardPerBlockForOthers; uint256 periodLengthInBlock; } struct UserInfo { uint256 amount; // Amount of staked tokens provided by user uint256 rewardDebt; // Reward debt } // Precision factor for calculating rewards uint256 public constant PRECISION_FACTOR = 10**12; IMintableERC20 public immutable x2y2Token; address public immutable tokenSplitter; // Number of reward periods uint256 public immutable NUMBER_PERIODS; // Block number when rewards start uint256 public immutable START_BLOCK; // Accumulated tokens per share uint256 public accTokenPerShare; // Current phase for rewards uint256 public currentPhase; // Block number when rewards end uint256 public endBlock; // Block number of the last update uint256 public lastRewardBlock; // Tokens distributed per block for other purposes (team + treasury + trading rewards) uint256 public rewardPerBlockForOthers; // Tokens distributed per block for staking uint256 public rewardPerBlockForStaking; // Total amount staked uint256 public totalAmountStaked; mapping(uint256 => StakingPeriod) public stakingPeriod; mapping(address => UserInfo) public userInfo; event Compound(address indexed user, uint256 harvestedAmount); event Deposit(address indexed user, uint256 amount, uint256 harvestedAmount); event NewRewardsPerBlock( uint256 indexed currentPhase, uint256 startBlock, uint256 rewardPerBlockForStaking, uint256 rewardPerBlockForOthers ); event Withdraw(address indexed user, uint256 amount, uint256 harvestedAmount); /** * @notice Constructor * @param _x2y2Token token address * @param _tokenSplitter token splitter contract address (for team and trading rewards) * @param _startBlock start block for reward program * @param _rewardsPerBlockForStaking array of rewards per block for staking * @param _rewardsPerBlockForOthers array of rewards per block for other purposes (team + treasury + trading rewards) * @param _periodLengthesInBlocks array of period lengthes * @param _numberPeriods number of periods with different rewards/lengthes (e.g., if 3 changes --> 4 periods) */ constructor( address _x2y2Token, address _tokenSplitter, uint256 _startBlock, uint256[] memory _rewardsPerBlockForStaking, uint256[] memory _rewardsPerBlockForOthers, uint256[] memory _periodLengthesInBlocks, uint256 _numberPeriods ) { require( (_periodLengthesInBlocks.length == _numberPeriods) && (_rewardsPerBlockForStaking.length == _numberPeriods) && (_rewardsPerBlockForStaking.length == _numberPeriods), 'Distributor: Lengthes must match numberPeriods' ); // 1. Operational checks for supply uint256 nonCirculatingSupply = IMintableERC20(_x2y2Token).SUPPLY_CAP() - IMintableERC20(_x2y2Token).totalSupply(); uint256 amountTokensToBeMinted; for (uint256 i = 0; i < _numberPeriods; i++) { amountTokensToBeMinted += (_rewardsPerBlockForStaking[i] * _periodLengthesInBlocks[i]) + (_rewardsPerBlockForOthers[i] * _periodLengthesInBlocks[i]); stakingPeriod[i] = StakingPeriod({ rewardPerBlockForStaking: _rewardsPerBlockForStaking[i], rewardPerBlockForOthers: _rewardsPerBlockForOthers[i], periodLengthInBlock: _periodLengthesInBlocks[i] }); } require( amountTokensToBeMinted == nonCirculatingSupply, 'Distributor: Wrong reward parameters' ); // 2. Store values x2y2Token = IMintableERC20(_x2y2Token); tokenSplitter = _tokenSplitter; rewardPerBlockForStaking = _rewardsPerBlockForStaking[0]; rewardPerBlockForOthers = _rewardsPerBlockForOthers[0]; START_BLOCK = _startBlock; endBlock = _startBlock + _periodLengthesInBlocks[0]; NUMBER_PERIODS = _numberPeriods; // Set the lastRewardBlock as the startBlock lastRewardBlock = _startBlock; } /** * @notice Deposit staked tokens and compounds pending rewards * @param amount amount to deposit (in X2Y2) */ function deposit(uint256 amount) external nonReentrant { require(amount > 0, 'Deposit: Amount must be > 0'); require(block.number >= START_BLOCK, 'Deposit: Not started yet'); // Update pool information _updatePool(); // Transfer X2Y2 tokens to this contract x2y2Token.safeTransferFrom(msg.sender, address(this), amount); uint256 pendingRewards; // If not new deposit, calculate pending rewards (for auto-compounding) if (userInfo[msg.sender].amount > 0) { pendingRewards = ((userInfo[msg.sender].amount * accTokenPerShare) / PRECISION_FACTOR) - userInfo[msg.sender].rewardDebt; } // Adjust user information userInfo[msg.sender].amount += (amount + pendingRewards); userInfo[msg.sender].rewardDebt = (userInfo[msg.sender].amount * accTokenPerShare) / PRECISION_FACTOR; // Increase totalAmountStaked totalAmountStaked += (amount + pendingRewards); emit Deposit(msg.sender, amount, pendingRewards); } /** * @notice Compound based on pending rewards */ function harvestAndCompound() external nonReentrant { // Update pool information _updatePool(); // Calculate pending rewards uint256 pendingRewards = ((userInfo[msg.sender].amount * accTokenPerShare) / PRECISION_FACTOR) - userInfo[msg.sender].rewardDebt; // Return if no pending rewards if (pendingRewards == 0) { // It doesn't throw revertion (to help with the fee-sharing auto-compounding contract) return; } // Adjust user amount for pending rewards userInfo[msg.sender].amount += pendingRewards; // Adjust totalAmountStaked totalAmountStaked += pendingRewards; // Recalculate reward debt based on new user amount userInfo[msg.sender].rewardDebt = (userInfo[msg.sender].amount * accTokenPerShare) / PRECISION_FACTOR; emit Compound(msg.sender, pendingRewards); } /** * @notice Update pool rewards */ function updatePool() external nonReentrant { _updatePool(); } /** * @notice Withdraw staked tokens and compound pending rewards * @param amount amount to withdraw */ function withdraw(uint256 amount) external nonReentrant { require( (userInfo[msg.sender].amount >= amount) && (amount > 0), 'Withdraw: Amount must be > 0 or lower than user balance' ); // Update pool _updatePool(); // Calculate pending rewards uint256 pendingRewards = ((userInfo[msg.sender].amount * accTokenPerShare) / PRECISION_FACTOR) - userInfo[msg.sender].rewardDebt; // Adjust user information userInfo[msg.sender].amount = userInfo[msg.sender].amount + pendingRewards - amount; userInfo[msg.sender].rewardDebt = (userInfo[msg.sender].amount * accTokenPerShare) / PRECISION_FACTOR; // Adjust total amount staked totalAmountStaked = totalAmountStaked + pendingRewards - amount; // Transfer X2Y2 tokens to the sender x2y2Token.safeTransfer(msg.sender, amount); emit Withdraw(msg.sender, amount, pendingRewards); } /** * @notice Withdraw all staked tokens and collect tokens */ function withdrawAll() external nonReentrant { require(userInfo[msg.sender].amount > 0, 'Withdraw: Amount must be > 0'); // Update pool _updatePool(); // Calculate pending rewards and amount to transfer (to the sender) uint256 pendingRewards = ((userInfo[msg.sender].amount * accTokenPerShare) / PRECISION_FACTOR) - userInfo[msg.sender].rewardDebt; uint256 amountToTransfer = userInfo[msg.sender].amount + pendingRewards; // Adjust total amount staked totalAmountStaked = totalAmountStaked - userInfo[msg.sender].amount; // Adjust user information userInfo[msg.sender].amount = 0; userInfo[msg.sender].rewardDebt = 0; // Transfer X2Y2 tokens to the sender x2y2Token.safeTransfer(msg.sender, amountToTransfer); emit Withdraw(msg.sender, amountToTransfer, pendingRewards); } /** * @notice Calculate pending rewards for a user * @param user address of the user * @return Pending rewards */ function calculatePendingRewards(address user) external view returns (uint256) { if ((block.number > lastRewardBlock) && (totalAmountStaked != 0)) { uint256 multiplier = _getMultiplier(lastRewardBlock, block.number); uint256 tokenRewardForStaking = multiplier * rewardPerBlockForStaking; uint256 adjustedEndBlock = endBlock; uint256 adjustedCurrentPhase = currentPhase; // Check whether to adjust multipliers and reward per block while ( (block.number > adjustedEndBlock) && (adjustedCurrentPhase < (NUMBER_PERIODS - 1)) ) { // Update current phase adjustedCurrentPhase++; // Update rewards per block uint256 adjustedRewardPerBlockForStaking = stakingPeriod[adjustedCurrentPhase] .rewardPerBlockForStaking; // Calculate adjusted block number uint256 previousEndBlock = adjustedEndBlock; // Update end block adjustedEndBlock = previousEndBlock + stakingPeriod[adjustedCurrentPhase].periodLengthInBlock; // Calculate new multiplier uint256 newMultiplier = (block.number <= adjustedEndBlock) ? (block.number - previousEndBlock) : stakingPeriod[adjustedCurrentPhase].periodLengthInBlock; // Adjust token rewards for staking tokenRewardForStaking += (newMultiplier * adjustedRewardPerBlockForStaking); } uint256 adjustedTokenPerShare = accTokenPerShare + (tokenRewardForStaking * PRECISION_FACTOR) / totalAmountStaked; return (userInfo[user].amount * adjustedTokenPerShare) / PRECISION_FACTOR - userInfo[user].rewardDebt; } else { return (userInfo[user].amount * accTokenPerShare) / PRECISION_FACTOR - userInfo[user].rewardDebt; } } /** * @notice Update reward variables of the pool */ function _updatePool() internal { if (block.number <= lastRewardBlock) { return; } if (totalAmountStaked == 0) { lastRewardBlock = block.number; return; } // Calculate multiplier uint256 multiplier = _getMultiplier(lastRewardBlock, block.number); // Calculate rewards for staking and others uint256 tokenRewardForStaking = multiplier * rewardPerBlockForStaking; uint256 tokenRewardForOthers = multiplier * rewardPerBlockForOthers; // Check whether to adjust multipliers and reward per block while ((block.number > endBlock) && (currentPhase < (NUMBER_PERIODS - 1))) { // Update rewards per block _updateRewardsPerBlock(endBlock); uint256 previousEndBlock = endBlock; // Adjust the end block endBlock += stakingPeriod[currentPhase].periodLengthInBlock; // Adjust multiplier to cover the missing periods with other lower inflation schedule uint256 newMultiplier = _getMultiplier(previousEndBlock, block.number); // Adjust token rewards tokenRewardForStaking += (newMultiplier * rewardPerBlockForStaking); tokenRewardForOthers += (newMultiplier * rewardPerBlockForOthers); } // Mint tokens only if token rewards for staking are not null if (tokenRewardForStaking > 0) { // It allows protection against potential issues to prevent funds from being locked bool mintStatus = x2y2Token.mint(address(this), tokenRewardForStaking); if (mintStatus) { accTokenPerShare = accTokenPerShare + ((tokenRewardForStaking * PRECISION_FACTOR) / totalAmountStaked); } x2y2Token.mint(tokenSplitter, tokenRewardForOthers); } // Update last reward block only if it wasn't updated after or at the end block if (lastRewardBlock <= endBlock) { lastRewardBlock = block.number; } } /** * @notice Update rewards per block * @dev Rewards are halved by 2 (for staking + others) */ function _updateRewardsPerBlock(uint256 _newStartBlock) internal { // Update current phase currentPhase++; // Update rewards per block rewardPerBlockForStaking = stakingPeriod[currentPhase].rewardPerBlockForStaking; rewardPerBlockForOthers = stakingPeriod[currentPhase].rewardPerBlockForOthers; emit NewRewardsPerBlock( currentPhase, _newStartBlock, rewardPerBlockForStaking, rewardPerBlockForOthers ); } /** * @notice Return reward multiplier over the given "from" to "to" block. * @param from block to start calculating reward * @param to block to finish calculating reward * @return the multiplier for the period */ function _getMultiplier(uint256 from, uint256 to) internal view returns (uint256) { if (to <= endBlock) { return to - from; } else if (from >= endBlock) { return 0; } else { return endBlock - from; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; import "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove( IERC20 token, address spender, uint256 value ) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance( IERC20 token, address spender, uint256 value ) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {IERC20} from '@openzeppelin/contracts/token/ERC20/IERC20.sol'; interface IMintableERC20 is IERC20 { function SUPPLY_CAP() external view returns (uint256); function mint(address account, uint256 amount) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Address.sol) pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
{ "optimizer": { "enabled": true, "runs": 100 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_x2y2Token","type":"address"},{"internalType":"address","name":"_tokenSplitter","type":"address"},{"internalType":"uint256","name":"_startBlock","type":"uint256"},{"internalType":"uint256[]","name":"_rewardsPerBlockForStaking","type":"uint256[]"},{"internalType":"uint256[]","name":"_rewardsPerBlockForOthers","type":"uint256[]"},{"internalType":"uint256[]","name":"_periodLengthesInBlocks","type":"uint256[]"},{"internalType":"uint256","name":"_numberPeriods","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"harvestedAmount","type":"uint256"}],"name":"Compound","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"harvestedAmount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"currentPhase","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"startBlock","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rewardPerBlockForStaking","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rewardPerBlockForOthers","type":"uint256"}],"name":"NewRewardsPerBlock","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"harvestedAmount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"NUMBER_PERIODS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PRECISION_FACTOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"START_BLOCK","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"accTokenPerShare","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"calculatePendingRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentPhase","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"endBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"harvestAndCompound","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lastRewardBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardPerBlockForOthers","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardPerBlockForStaking","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"stakingPeriod","outputs":[{"internalType":"uint256","name":"rewardPerBlockForStaking","type":"uint256"},{"internalType":"uint256","name":"rewardPerBlockForOthers","type":"uint256"},{"internalType":"uint256","name":"periodLengthInBlock","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenSplitter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAmountStaked","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"updatePool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"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":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"x2y2Token","outputs":[{"internalType":"contract IMintableERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
6101006040523480156200001257600080fd5b5060405162001b3438038062001b348339810160408190526200003591620004d7565b60016000558151811480156200004b5750808451145b8015620000585750808451145b620000c15760405162461bcd60e51b815260206004820152602e60248201527f4469737472696275746f723a204c656e6774686573206d757374206d6174636860448201526d206e756d626572506572696f647360901b60648201526084015b60405180910390fd5b6000876001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000102573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001289190620005a2565b886001600160a01b0316630cfccc836040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000167573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200018d9190620005a2565b620001999190620005d2565b90506000805b83811015620002fd57848181518110620001bd57620001bd620005ec565b6020026020010151868281518110620001da57620001da620005ec565b6020026020010151620001ee919062000602565b858281518110620002035762000203620005ec565b6020026020010151888381518110620002205762000220620005ec565b602002602001015162000234919062000602565b62000240919062000624565b6200024c908362000624565b915060405180606001604052808883815181106200026e576200026e620005ec565b60200260200101518152602001878381518110620002905762000290620005ec565b60200260200101518152602001868381518110620002b257620002b2620005ec565b60209081029190910181015190915260008381526008825260409081902083518155918301516001830155919091015160029091015580620002f4816200063f565b9150506200019f565b508181146200035b5760405162461bcd60e51b8152602060048201526024808201527f4469737472696275746f723a2057726f6e672072657761726420706172616d656044820152637465727360e01b6064820152608401620000b8565b6001600160a01b03808a16608052881660a05285518690600090620003845762000384620005ec565b602002602001015160068190555084600081518110620003a857620003a8620005ec565b60200260200101516005819055508660e0818152505083600081518110620003d457620003d4620005ec565b602002602001015187620003e9919062000624565b600355505060c052505050600455506200065d9050565b80516001600160a01b03811681146200041857600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200044557600080fd5b815160206001600160401b03808311156200046457620004646200041d565b8260051b604051601f19603f830116810181811084821117156200048c576200048c6200041d565b604052938452858101830193838101925087851115620004ab57600080fd5b83870191505b84821015620004cc57815183529183019190830190620004b1565b979650505050505050565b600080600080600080600060e0888a031215620004f357600080fd5b620004fe8862000400565b96506200050e6020890162000400565b604089015160608a015191975095506001600160401b03808211156200053357600080fd5b620005418b838c0162000433565b955060808a01519150808211156200055857600080fd5b620005668b838c0162000433565b945060a08a01519150808211156200057d57600080fd5b506200058c8a828b0162000433565b92505060c0880151905092959891949750929550565b600060208284031215620005b557600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b600082821015620005e757620005e7620005bc565b500390565b634e487b7160e01b600052603260045260246000fd5b60008160001904831182151516156200061f576200061f620005bc565b500290565b600082198211156200063a576200063a620005bc565b500190565b6000600019821415620006565762000656620005bc565b5060010190565b60805160a05160c05160e05161145e620006d6600039600081816101c70152610a370152600081816101ee015281816103710152610cc601526000818161022f0152610e880152600081816102f1015281816107c50152818161095901528181610ab501528181610d950152610e5b015261145e6000f3fe608060405234801561001057600080fd5b506004361061012c5760003560e01c80638f662915116100ad578063ccd34cd511610071578063ccd34cd5146102cf578063e3161ddd146102db578063e683d96f146102e3578063ebde5ee6146102ec578063fe961f611461031357600080fd5b80638f66291514610221578063a46074c31461022a578063a9f8d18114610269578063b6b55f2514610272578063c1027c981461028557600080fd5b80632e1a7d4d116100f45780632e1a7d4d146101af57806339b3e826146101c257806352bf348c146101e95780635a9477e914610210578063853828b61461021957600080fd5b8063055ad42e14610131578063083c63231461014d578063097aad10146101565780631959a002146101695780632a4e051b146101a5575b600080fd5b61013a60025481565b6040519081526020015b60405180910390f35b61013a60035481565b61013a610164366004611258565b61031c565b610190610177366004611258565b6009602052600090815260409020805460019091015482565b60408051928352602083019190915201610144565b6101ad6104ea565b005b6101ad6101bd366004611281565b610634565b61013a7f000000000000000000000000000000000000000000000000000000000000000081565b61013a7f000000000000000000000000000000000000000000000000000000000000000081565b61013a60065481565b6101ad610831565b61013a60015481565b6102517f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610144565b61013a60045481565b6101ad610280366004611281565b6109c0565b6102b4610293366004611281565b60086020526000908152604090208054600182015460029092015490919083565b60408051938452602084019290925290820152606001610144565b61013a64e8d4a5100081565b6101ad610bfb565b61013a60055481565b6102517f000000000000000000000000000000000000000000000000000000000000000081565b61013a60075481565b600060045443118015610330575060075415155b1561049b57600061034360045443610c2b565b905060006006548261035591906112b0565b600354600254919250905b8143118015610398575061039560017f00000000000000000000000000000000000000000000000000000000000000006112cf565b81105b1561041b57806103a7816112e6565b60008181526008602052604090208054600290910154919350915083906103ce9082611301565b93506000844311156103f1576000848152600860205260409020600201546103fb565b6103fb82436112cf565b905061040783826112b0565b6104119087611301565b9550505050610360565b60075460009061043064e8d4a51000866112b0565b61043a9190611319565b6001546104479190611301565b6001600160a01b0388166000908152600960205260409020600181015490549192509064e8d4a510009061047c9084906112b0565b6104869190611319565b61049091906112cf565b979650505050505050565b6001600160a01b038216600090815260096020526040902060018082015490549154909164e8d4a51000916104d091906112b0565b6104da9190611319565b6104e491906112cf565b92915050565b600260005414156105165760405162461bcd60e51b815260040161050d9061133b565b60405180910390fd5b6002600055610523610c66565b33600090815260096020526040812060018082015490549154909164e8d4a510009161054f91906112b0565b6105599190611319565b61056391906112cf565b905080610570575061062d565b336000908152600960205260408120805483929061058f908490611301565b9250508190555080600760008282546105a89190611301565b90915550506001543360009081526009602052604090205464e8d4a51000916105d0916112b0565b6105da9190611319565b33600081815260096020526040908190206001019290925590517f169f1815ebdea059aac3bb00ec9a9594c7a5ffcb64a17e8392b5d84909a14556906106239084815260200190565b60405180910390a2505b6001600055565b600260005414156106575760405162461bcd60e51b815260040161050d9061133b565b6002600090815533815260096020526040902054811180159061067a5750600081115b6106e65760405162461bcd60e51b815260206004820152603760248201527f57697468647261773a20416d6f756e74206d757374206265203e2030206f72206044820152766c6f776572207468616e20757365722062616c616e636560481b606482015260840161050d565b6106ee610c66565b33600090815260096020526040812060018082015490549154909164e8d4a510009161071a91906112b0565b6107249190611319565b61072e91906112cf565b33600090815260096020526040902054909150829061074e908390611301565b61075891906112cf565b33600090815260096020526040902081905560015464e8d4a510009161077e91906112b0565b6107889190611319565b3360009081526009602052604090206001015560075482906107ab908390611301565b6107b591906112cf565b6007556107ec6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163384610f0d565b604080518381526020810183905233917ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b56891015b60405180910390a250506001600055565b600260005414156108545760405162461bcd60e51b815260040161050d9061133b565b60026000908155338152600960205260409020546108b45760405162461bcd60e51b815260206004820152601c60248201527f57697468647261773a20416d6f756e74206d757374206265203e203000000000604482015260640161050d565b6108bc610c66565b33600090815260096020526040812060018082015490549154909164e8d4a51000916108e891906112b0565b6108f29190611319565b6108fc91906112cf565b336000908152600960205260408120549192509061091b908390611301565b3360009081526009602052604090205460075491925061093a916112cf565b60075533600081815260096020526040812081815560010155610988907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169083610f0d565b604080518281526020810184905233917ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b5689101610820565b600260005414156109e35760405162461bcd60e51b815260040161050d9061133b565b600260005580610a355760405162461bcd60e51b815260206004820152601b60248201527f4465706f7369743a20416d6f756e74206d757374206265203e20300000000000604482015260640161050d565b7f0000000000000000000000000000000000000000000000000000000000000000431015610aa05760405162461bcd60e51b815260206004820152601860248201527711195c1bdcda5d0e88139bdd081cdd185c9d1959081e595d60421b604482015260640161050d565b610aa8610c66565b610add6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016333084610f63565b3360009081526009602052604081205415610b355733600090815260096020526040902060018082015490549154909164e8d4a5100091610b1e91906112b0565b610b289190611319565b610b3291906112cf565b90505b610b3f8183611301565b3360009081526009602052604081208054909190610b5e908490611301565b90915550506001543360009081526009602052604090205464e8d4a5100091610b86916112b0565b610b909190611319565b33600090815260096020526040902060010155610bad8183611301565b60076000828254610bbe9190611301565b9091555050604080518381526020810183905233917f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a159101610820565b60026000541415610c1e5760405162461bcd60e51b815260040161050d9061133b565b600260005561062d610c66565b60006003548211610c4757610c4083836112cf565b90506104e4565b6003548310610c58575060006104e4565b82600354610c4091906112cf565b6004544311610c7157565b600754610c7e5743600455565b6000610c8c60045443610c2b565b9050600060065482610c9e91906112b0565b9050600060055483610cb091906112b0565b90505b60035443118015610cef5750610cea60017f00000000000000000000000000000000000000000000000000000000000000006112cf565b600254105b15610d7557610cff600354610fa1565b6003805460028054600090815260086020526040812090910154919290610d268385611301565b9091555060009050610d388243610c2b565b905060065481610d4891906112b0565b610d529085611301565b935060055481610d6291906112b0565b610d6c9084611301565b92505050610cb3565b8115610ef8576040516340c10f1960e01b81526000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906340c10f1990610dcc9030908790600401611372565b6020604051808303816000875af1158015610deb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0f919061138b565b90508015610e4457600754610e2964e8d4a51000856112b0565b610e339190611319565b600154610e409190611301565b6001555b6040516340c10f1960e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906340c10f1990610eb2907f0000000000000000000000000000000000000000000000000000000000000000908690600401611372565b6020604051808303816000875af1158015610ed1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ef5919061138b565b50505b60035460045411610f0857436004555b505050565b610f088363a9059cbb60e01b8484604051602401610f2c929190611372565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261101c565b6040516001600160a01b0380851660248301528316604482015260648101829052610f9b9085906323b872dd60e01b90608401610f2c565b50505050565b60028054906000610fb1836112e6565b90915550506002546000818152600860209081526040918290208054600681905560019091015460058190558351868152928301919091528183015290517f40181eb77bccfdef1a73b669bb4290d98e2fbec678c7cf4578ae256210420e179181900360600190a250565b6000611071826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166110ee9092919063ffffffff16565b805190915015610f08578080602001905181019061108f919061138b565b610f085760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161050d565b60606110fd8484600085611107565b90505b9392505050565b6060824710156111685760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161050d565b843b6111b65760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161050d565b600080866001600160a01b031685876040516111d291906113d9565b60006040518083038185875af1925050503d806000811461120f576040519150601f19603f3d011682016040523d82523d6000602084013e611214565b606091505b50915091506104908282866060831561122e575081611100565b82511561123e5782518084602001fd5b8160405162461bcd60e51b815260040161050d91906113f5565b60006020828403121561126a57600080fd5b81356001600160a01b038116811461110057600080fd5b60006020828403121561129357600080fd5b5035919050565b634e487b7160e01b600052601160045260246000fd5b60008160001904831182151516156112ca576112ca61129a565b500290565b6000828210156112e1576112e161129a565b500390565b60006000198214156112fa576112fa61129a565b5060010190565b600082198211156113145761131461129a565b500190565b60008261133657634e487b7160e01b600052601260045260246000fd5b500490565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6001600160a01b03929092168252602082015260400190565b60006020828403121561139d57600080fd5b8151801515811461110057600080fd5b60005b838110156113c85781810151838201526020016113b0565b83811115610f9b5750506000910152565b600082516113eb8184602087016113ad565b9190910192915050565b60208152600082518060208401526114148160408501602087016113ad565b601f01601f1916919091016040019291505056fea26469706673582212202895772d156eff10722253e4f31093d7395e6622c31bdd37fb6f0e76d07c37f764736f6c634300080b00330000000000000000000000001e4ede388cbc9f4b5c79681b7f94d36a11abebc9000000000000000000000000e7643ff46c6f88ed812b3e7198c2fa2522d630cc0000000000000000000000000000000000000000000000000000000000d8e06800000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000002200000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000001ee392474d02220000000000000000000000000000000000000000000000000004fc4f4d14837d0000000000000000000000000000000000000000000000000000d0180f599b00e800000000000000000000000000000000000000000000000000455d5a7333aaf8000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000064639b67ba46ee00000000000000000000000000000000000000000000000000103401ba82ab560000000000000000000000000000000000000000000000000002a44e31e337c2f800000000000000000000000000000000000000000000000000e16f65f667eba8000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000002f9b8000000000000000000000000000000000000000000000000000000000008ed28000000000000000000000000000000000000000000000000000000000017cdc0000000000000000000000000000000000000000000000000000000000023b4a0
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061012c5760003560e01c80638f662915116100ad578063ccd34cd511610071578063ccd34cd5146102cf578063e3161ddd146102db578063e683d96f146102e3578063ebde5ee6146102ec578063fe961f611461031357600080fd5b80638f66291514610221578063a46074c31461022a578063a9f8d18114610269578063b6b55f2514610272578063c1027c981461028557600080fd5b80632e1a7d4d116100f45780632e1a7d4d146101af57806339b3e826146101c257806352bf348c146101e95780635a9477e914610210578063853828b61461021957600080fd5b8063055ad42e14610131578063083c63231461014d578063097aad10146101565780631959a002146101695780632a4e051b146101a5575b600080fd5b61013a60025481565b6040519081526020015b60405180910390f35b61013a60035481565b61013a610164366004611258565b61031c565b610190610177366004611258565b6009602052600090815260409020805460019091015482565b60408051928352602083019190915201610144565b6101ad6104ea565b005b6101ad6101bd366004611281565b610634565b61013a7f0000000000000000000000000000000000000000000000000000000000d8e06881565b61013a7f000000000000000000000000000000000000000000000000000000000000000481565b61013a60065481565b6101ad610831565b61013a60015481565b6102517f000000000000000000000000e7643ff46c6f88ed812b3e7198c2fa2522d630cc81565b6040516001600160a01b039091168152602001610144565b61013a60045481565b6101ad610280366004611281565b6109c0565b6102b4610293366004611281565b60086020526000908152604090208054600182015460029092015490919083565b60408051938452602084019290925290820152606001610144565b61013a64e8d4a5100081565b6101ad610bfb565b61013a60055481565b6102517f0000000000000000000000001e4ede388cbc9f4b5c79681b7f94d36a11abebc981565b61013a60075481565b600060045443118015610330575060075415155b1561049b57600061034360045443610c2b565b905060006006548261035591906112b0565b600354600254919250905b8143118015610398575061039560017f00000000000000000000000000000000000000000000000000000000000000046112cf565b81105b1561041b57806103a7816112e6565b60008181526008602052604090208054600290910154919350915083906103ce9082611301565b93506000844311156103f1576000848152600860205260409020600201546103fb565b6103fb82436112cf565b905061040783826112b0565b6104119087611301565b9550505050610360565b60075460009061043064e8d4a51000866112b0565b61043a9190611319565b6001546104479190611301565b6001600160a01b0388166000908152600960205260409020600181015490549192509064e8d4a510009061047c9084906112b0565b6104869190611319565b61049091906112cf565b979650505050505050565b6001600160a01b038216600090815260096020526040902060018082015490549154909164e8d4a51000916104d091906112b0565b6104da9190611319565b6104e491906112cf565b92915050565b600260005414156105165760405162461bcd60e51b815260040161050d9061133b565b60405180910390fd5b6002600055610523610c66565b33600090815260096020526040812060018082015490549154909164e8d4a510009161054f91906112b0565b6105599190611319565b61056391906112cf565b905080610570575061062d565b336000908152600960205260408120805483929061058f908490611301565b9250508190555080600760008282546105a89190611301565b90915550506001543360009081526009602052604090205464e8d4a51000916105d0916112b0565b6105da9190611319565b33600081815260096020526040908190206001019290925590517f169f1815ebdea059aac3bb00ec9a9594c7a5ffcb64a17e8392b5d84909a14556906106239084815260200190565b60405180910390a2505b6001600055565b600260005414156106575760405162461bcd60e51b815260040161050d9061133b565b6002600090815533815260096020526040902054811180159061067a5750600081115b6106e65760405162461bcd60e51b815260206004820152603760248201527f57697468647261773a20416d6f756e74206d757374206265203e2030206f72206044820152766c6f776572207468616e20757365722062616c616e636560481b606482015260840161050d565b6106ee610c66565b33600090815260096020526040812060018082015490549154909164e8d4a510009161071a91906112b0565b6107249190611319565b61072e91906112cf565b33600090815260096020526040902054909150829061074e908390611301565b61075891906112cf565b33600090815260096020526040902081905560015464e8d4a510009161077e91906112b0565b6107889190611319565b3360009081526009602052604090206001015560075482906107ab908390611301565b6107b591906112cf565b6007556107ec6001600160a01b037f0000000000000000000000001e4ede388cbc9f4b5c79681b7f94d36a11abebc9163384610f0d565b604080518381526020810183905233917ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b56891015b60405180910390a250506001600055565b600260005414156108545760405162461bcd60e51b815260040161050d9061133b565b60026000908155338152600960205260409020546108b45760405162461bcd60e51b815260206004820152601c60248201527f57697468647261773a20416d6f756e74206d757374206265203e203000000000604482015260640161050d565b6108bc610c66565b33600090815260096020526040812060018082015490549154909164e8d4a51000916108e891906112b0565b6108f29190611319565b6108fc91906112cf565b336000908152600960205260408120549192509061091b908390611301565b3360009081526009602052604090205460075491925061093a916112cf565b60075533600081815260096020526040812081815560010155610988907f0000000000000000000000001e4ede388cbc9f4b5c79681b7f94d36a11abebc96001600160a01b03169083610f0d565b604080518281526020810184905233917ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b5689101610820565b600260005414156109e35760405162461bcd60e51b815260040161050d9061133b565b600260005580610a355760405162461bcd60e51b815260206004820152601b60248201527f4465706f7369743a20416d6f756e74206d757374206265203e20300000000000604482015260640161050d565b7f0000000000000000000000000000000000000000000000000000000000d8e068431015610aa05760405162461bcd60e51b815260206004820152601860248201527711195c1bdcda5d0e88139bdd081cdd185c9d1959081e595d60421b604482015260640161050d565b610aa8610c66565b610add6001600160a01b037f0000000000000000000000001e4ede388cbc9f4b5c79681b7f94d36a11abebc916333084610f63565b3360009081526009602052604081205415610b355733600090815260096020526040902060018082015490549154909164e8d4a5100091610b1e91906112b0565b610b289190611319565b610b3291906112cf565b90505b610b3f8183611301565b3360009081526009602052604081208054909190610b5e908490611301565b90915550506001543360009081526009602052604090205464e8d4a5100091610b86916112b0565b610b909190611319565b33600090815260096020526040902060010155610bad8183611301565b60076000828254610bbe9190611301565b9091555050604080518381526020810183905233917f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a159101610820565b60026000541415610c1e5760405162461bcd60e51b815260040161050d9061133b565b600260005561062d610c66565b60006003548211610c4757610c4083836112cf565b90506104e4565b6003548310610c58575060006104e4565b82600354610c4091906112cf565b6004544311610c7157565b600754610c7e5743600455565b6000610c8c60045443610c2b565b9050600060065482610c9e91906112b0565b9050600060055483610cb091906112b0565b90505b60035443118015610cef5750610cea60017f00000000000000000000000000000000000000000000000000000000000000046112cf565b600254105b15610d7557610cff600354610fa1565b6003805460028054600090815260086020526040812090910154919290610d268385611301565b9091555060009050610d388243610c2b565b905060065481610d4891906112b0565b610d529085611301565b935060055481610d6291906112b0565b610d6c9084611301565b92505050610cb3565b8115610ef8576040516340c10f1960e01b81526000906001600160a01b037f0000000000000000000000001e4ede388cbc9f4b5c79681b7f94d36a11abebc916906340c10f1990610dcc9030908790600401611372565b6020604051808303816000875af1158015610deb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0f919061138b565b90508015610e4457600754610e2964e8d4a51000856112b0565b610e339190611319565b600154610e409190611301565b6001555b6040516340c10f1960e01b81526001600160a01b037f0000000000000000000000001e4ede388cbc9f4b5c79681b7f94d36a11abebc916906340c10f1990610eb2907f000000000000000000000000e7643ff46c6f88ed812b3e7198c2fa2522d630cc908690600401611372565b6020604051808303816000875af1158015610ed1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ef5919061138b565b50505b60035460045411610f0857436004555b505050565b610f088363a9059cbb60e01b8484604051602401610f2c929190611372565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261101c565b6040516001600160a01b0380851660248301528316604482015260648101829052610f9b9085906323b872dd60e01b90608401610f2c565b50505050565b60028054906000610fb1836112e6565b90915550506002546000818152600860209081526040918290208054600681905560019091015460058190558351868152928301919091528183015290517f40181eb77bccfdef1a73b669bb4290d98e2fbec678c7cf4578ae256210420e179181900360600190a250565b6000611071826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166110ee9092919063ffffffff16565b805190915015610f08578080602001905181019061108f919061138b565b610f085760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161050d565b60606110fd8484600085611107565b90505b9392505050565b6060824710156111685760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161050d565b843b6111b65760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161050d565b600080866001600160a01b031685876040516111d291906113d9565b60006040518083038185875af1925050503d806000811461120f576040519150601f19603f3d011682016040523d82523d6000602084013e611214565b606091505b50915091506104908282866060831561122e575081611100565b82511561123e5782518084602001fd5b8160405162461bcd60e51b815260040161050d91906113f5565b60006020828403121561126a57600080fd5b81356001600160a01b038116811461110057600080fd5b60006020828403121561129357600080fd5b5035919050565b634e487b7160e01b600052601160045260246000fd5b60008160001904831182151516156112ca576112ca61129a565b500290565b6000828210156112e1576112e161129a565b500390565b60006000198214156112fa576112fa61129a565b5060010190565b600082198211156113145761131461129a565b500190565b60008261133657634e487b7160e01b600052601260045260246000fd5b500490565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6001600160a01b03929092168252602082015260400190565b60006020828403121561139d57600080fd5b8151801515811461110057600080fd5b60005b838110156113c85781810151838201526020016113b0565b83811115610f9b5750506000910152565b600082516113eb8184602087016113ad565b9190910192915050565b60208152600082518060208401526114148160408501602087016113ad565b601f01601f1916919091016040019291505056fea26469706673582212202895772d156eff10722253e4f31093d7395e6622c31bdd37fb6f0e76d07c37f764736f6c634300080b0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000001e4ede388cbc9f4b5c79681b7f94d36a11abebc9000000000000000000000000e7643ff46c6f88ed812b3e7198c2fa2522d630cc0000000000000000000000000000000000000000000000000000000000d8e06800000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000002200000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000001ee392474d02220000000000000000000000000000000000000000000000000004fc4f4d14837d0000000000000000000000000000000000000000000000000000d0180f599b00e800000000000000000000000000000000000000000000000000455d5a7333aaf8000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000064639b67ba46ee00000000000000000000000000000000000000000000000000103401ba82ab560000000000000000000000000000000000000000000000000002a44e31e337c2f800000000000000000000000000000000000000000000000000e16f65f667eba8000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000002f9b8000000000000000000000000000000000000000000000000000000000008ed28000000000000000000000000000000000000000000000000000000000017cdc0000000000000000000000000000000000000000000000000000000000023b4a0
-----Decoded View---------------
Arg [0] : _x2y2Token (address): 0x1E4EDE388cbc9F4b5c79681B7f94d36a11ABEBC9
Arg [1] : _tokenSplitter (address): 0xe7643Ff46C6f88ED812b3E7198c2fA2522d630CC
Arg [2] : _startBlock (uint256): 14213224
Arg [3] : _rewardsPerBlockForStaking (uint256[]): 569800569800569782272,91967811266056880128,14994751836857100288,4998250612285700096
Arg [4] : _rewardsPerBlockForOthers (uint256[]): 1851851851851851759616,298895386614684844032,48732943469785577472,16244314489928525824
Arg [5] : _periodLengthesInBlocks (uint256[]): 195000,585000,1560000,2340000
Arg [6] : _numberPeriods (uint256): 4
-----Encoded View---------------
22 Constructor Arguments found :
Arg [0] : 0000000000000000000000001e4ede388cbc9f4b5c79681b7f94d36a11abebc9
Arg [1] : 000000000000000000000000e7643ff46c6f88ed812b3e7198c2fa2522d630cc
Arg [2] : 0000000000000000000000000000000000000000000000000000000000d8e068
Arg [3] : 00000000000000000000000000000000000000000000000000000000000000e0
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000180
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000220
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [8] : 00000000000000000000000000000000000000000000001ee392474d02220000
Arg [9] : 000000000000000000000000000000000000000000000004fc4f4d14837d0000
Arg [10] : 000000000000000000000000000000000000000000000000d0180f599b00e800
Arg [11] : 000000000000000000000000000000000000000000000000455d5a7333aaf800
Arg [12] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [13] : 000000000000000000000000000000000000000000000064639b67ba46ee0000
Arg [14] : 0000000000000000000000000000000000000000000000103401ba82ab560000
Arg [15] : 000000000000000000000000000000000000000000000002a44e31e337c2f800
Arg [16] : 000000000000000000000000000000000000000000000000e16f65f667eba800
Arg [17] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [18] : 000000000000000000000000000000000000000000000000000000000002f9b8
Arg [19] : 000000000000000000000000000000000000000000000000000000000008ed28
Arg [20] : 000000000000000000000000000000000000000000000000000000000017cdc0
Arg [21] : 000000000000000000000000000000000000000000000000000000000023b4a0
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
ETH | 100.00% | $0.004283 | 453,164,920.0482 | $1,940,801.12 |
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.