More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 2,773 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Withdraw Stake | 20666672 | 2 hrs ago | IN | 0 ETH | 0.00009287 | ||||
Withdraw Stake | 20662099 | 17 hrs ago | IN | 0 ETH | 0.00021037 | ||||
Withdraw Stake | 20658311 | 30 hrs ago | IN | 0 ETH | 0.00008168 | ||||
Withdraw Stake | 20652296 | 2 days ago | IN | 0 ETH | 0.00005198 | ||||
Withdraw Stake | 20648172 | 2 days ago | IN | 0 ETH | 0.0000881 | ||||
Withdraw Stake | 20647641 | 2 days ago | IN | 0 ETH | 0.000057 | ||||
Withdraw Stake | 20643228 | 3 days ago | IN | 0 ETH | 0.00007369 | ||||
Withdraw Stake | 20643228 | 3 days ago | IN | 0 ETH | 0.0001187 | ||||
Withdraw Stake | 20643177 | 3 days ago | IN | 0 ETH | 0.00013581 | ||||
Withdraw Stake | 20642049 | 3 days ago | IN | 0 ETH | 0.00024069 | ||||
Withdraw Stake | 20633642 | 4 days ago | IN | 0 ETH | 0.00009551 | ||||
Withdraw Stake | 20633577 | 4 days ago | IN | 0 ETH | 0.00007883 | ||||
Withdraw Stake | 20631886 | 4 days ago | IN | 0 ETH | 0.00005937 | ||||
Withdraw Stake | 20624867 | 5 days ago | IN | 0 ETH | 0.00006338 | ||||
Withdraw Stake | 20623886 | 6 days ago | IN | 0 ETH | 0.00006348 | ||||
Withdraw Stake | 20619240 | 6 days ago | IN | 0 ETH | 0.00008939 | ||||
Withdraw Stake | 20615148 | 7 days ago | IN | 0 ETH | 0.0001024 | ||||
Withdraw Stake | 20611004 | 7 days ago | IN | 0 ETH | 0.00007141 | ||||
Withdraw Stake | 20607331 | 8 days ago | IN | 0 ETH | 0.00007051 | ||||
Withdraw Stake | 20602099 | 9 days ago | IN | 0 ETH | 0.0000768 | ||||
Withdraw Stake | 20600614 | 9 days ago | IN | 0 ETH | 0.00007182 | ||||
Withdraw Stake | 20599681 | 9 days ago | IN | 0 ETH | 0.0003316 | ||||
Withdraw Stake | 20598841 | 9 days ago | IN | 0 ETH | 0.00006507 | ||||
Withdraw Stake | 20598813 | 9 days ago | IN | 0 ETH | 0.00005285 | ||||
Withdraw Stake | 20598727 | 9 days ago | IN | 0 ETH | 0.0000666 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x01f581fC...9e91216f0 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
SDAOBondedTokenStake
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)
pragma solidity ^0.6.0; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "./IExternalStake.sol"; contract SDAOBondedTokenStake is IExternalStake, Ownable, ReentrancyGuard{ using SafeMath for uint256; ERC20 public token; // Address of token contract and same used for rewards ERC20 public bonusToken; // Address of bonus token contract struct StakeInfo { bool exist; uint256 amount; uint256 rewardComputeIndex; uint256 bonusAmount; } // Staking period timestamp (Debatable on timestamp vs blocknumber - went with timestamp) struct StakePeriod { uint256 startPeriod; uint256 submissionEndPeriod; uint256 endPeriod; uint256 maxStake; uint256 windowRewardAmount; uint256 windowMaxAmount; } address public tokenOperator; // Address to manage the Stake uint256 public maxAirDropStakeBlocks; // Block numbers to complete the airDrop Auto Stakes mapping (address => uint256) public balances; // Useer Token balance in the contract uint256 public currentStakeMapIndex; // Current Stake Index to avoid math calc in all methods mapping (uint256 => StakePeriod) public stakeMap; // List of Stake Holders address[] stakeHolders; // All Stake Holders mapping(address => StakeInfo) stakeHolderInfo; // To store the total stake in a window uint256 public windowTotalStake; // Events event NewOperator(address tokenOperator); event WithdrawToken(address indexed tokenOperator, uint256 amount); event OpenForStake(uint256 indexed stakeIndex, address indexed tokenOperator, uint256 startPeriod, uint256 endPeriod, uint256 rewardAmount); event SubmitStake(uint256 indexed stakeIndex, address indexed staker, uint256 stakeAmount); event WithdrawStake(uint256 indexed stakeIndex, address indexed staker, uint256 stakeAmount, uint256 bonusAmount); event ClaimStake(uint256 indexed stakeIndex, address indexed staker, uint256 totalAmount, uint256 bonusAmount); event AddReward(address indexed staker, uint256 indexed stakeIndex, address tokenOperator, uint256 stakeAmount, uint256 rewardAmount, uint256 windowTotalStake); // Modifiers modifier onlyOperator() { require( msg.sender == tokenOperator, "Only operator can call this function." ); _; } // Token Operator should be able to do auto renewal modifier allowSubmission() { require( now >= stakeMap[currentStakeMapIndex].startPeriod && now <= stakeMap[currentStakeMapIndex].submissionEndPeriod, "Staking at this point not allowed" ); _; } modifier validStakeLimit(address staker, uint256 stakeAmount) { uint256 stakerTotalStake; stakerTotalStake = stakeAmount.add(stakeHolderInfo[staker].amount); // Check for Max Stake per Wallet and stake window max limit require( stakeAmount > 0 && stakerTotalStake <= stakeMap[currentStakeMapIndex].maxStake && windowTotalStake.add(stakeAmount) <= stakeMap[currentStakeMapIndex].windowMaxAmount, "Exceeding max limits" ); _; } // Check for claim - Stake Window should be either in submission phase or after end period modifier allowClaimStake() { require( (now >= stakeMap[currentStakeMapIndex].startPeriod && now <= stakeMap[currentStakeMapIndex].submissionEndPeriod && stakeHolderInfo[msg.sender].amount > 0) || (now > stakeMap[currentStakeMapIndex].endPeriod && stakeHolderInfo[msg.sender].amount > 0), "Invalid claim request"); _; } constructor(address _token, uint256 _maxAirDropStakeBlocks) public { token = ERC20(_token); tokenOperator = msg.sender; currentStakeMapIndex = 0; windowTotalStake = 0; maxAirDropStakeBlocks = _maxAirDropStakeBlocks.add(block.number); } function updateOperator(address newOperator) external onlyOwner { require(newOperator != address(0), "Invalid operator address"); tokenOperator = newOperator; emit NewOperator(newOperator); } function withdrawToken(uint256 value) external onlyOperator { // Check if contract is having required balance require(token.balanceOf(address(this)) >= value, "Not enough balance in the contract"); require(token.transfer(msg.sender, value), "Unable to transfer token to the operator account"); emit WithdrawToken(tokenOperator, value); } // To set the bonus token for future needs function setBonusToken(address _bonusToken) external onlyOwner { require(_bonusToken != address(0), "Invalid bonus token"); bonusToken = ERC20(_bonusToken); } function openForStake(uint256 _startPeriod, uint256 _submissionEndPeriod, uint256 _endPeriod, uint256 _windowRewardAmount, uint256 _maxStake, uint256 _windowMaxAmount) external onlyOperator { // Check Input Parameters require(_startPeriod >= now && _startPeriod < _submissionEndPeriod && _submissionEndPeriod < _endPeriod, "Invalid stake period"); require(_windowRewardAmount > 0 && _maxStake > 0 && _windowMaxAmount > 0, "Invalid inputs" ); // Check Stake in Progress require(currentStakeMapIndex == 0 || (now > stakeMap[currentStakeMapIndex].submissionEndPeriod && _startPeriod >= stakeMap[currentStakeMapIndex].endPeriod), "Cannot have more than one stake request at a time"); // Move the staking period to next one currentStakeMapIndex = currentStakeMapIndex + 1; StakePeriod memory stakePeriod; // Set Staking attributes stakePeriod.startPeriod = _startPeriod; stakePeriod.submissionEndPeriod = _submissionEndPeriod; stakePeriod.endPeriod = _endPeriod; stakePeriod.windowRewardAmount = _windowRewardAmount; stakePeriod.maxStake = _maxStake; stakePeriod.windowMaxAmount = _windowMaxAmount; stakeMap[currentStakeMapIndex] = stakePeriod; // Add the current window reward to the window total stake windowTotalStake = windowTotalStake.add(_windowRewardAmount); emit OpenForStake(currentStakeMapIndex, msg.sender, _startPeriod, _endPeriod, _windowRewardAmount); } // To add the Stake Holder function _createStake(address staker, uint256 stakeAmount) internal returns(bool) { StakeInfo storage stakeInfo = stakeHolderInfo[staker]; // Check if the user already staked in the past if(stakeInfo.exist) { stakeInfo.amount = stakeInfo.amount.add(stakeAmount); } else { StakeInfo memory req; // Create a new stake request req.exist = true; req.amount = stakeAmount; req.rewardComputeIndex = 0; // Add to the Stake Holders List stakeHolderInfo[staker] = req; // Add to the Stake Holders List stakeHolders.push(staker); } return true; } // To submit a new stake for the current window - This function left as is for backward compatability with existing DApps function submitStake(uint256 stakeAmount) external allowSubmission validStakeLimit(msg.sender, stakeAmount) { // Transfer the Tokens to Contract require(token.transferFrom(msg.sender, address(this), stakeAmount), "Unable to transfer token to the contract"); _createStake(msg.sender, stakeAmount); // Update the User balance balances[msg.sender] = balances[msg.sender].add(stakeAmount); // Update current stake period total stake - For Auto Approvals windowTotalStake = windowTotalStake.add(stakeAmount); emit SubmitStake(currentStakeMapIndex, msg.sender, stakeAmount); } // To Submit a new stakeFor in the current window - Can be called from the other contracts like airdrop function submitStakeFor(address staker, uint256 stakeAmount) external virtual override allowSubmission validStakeLimit(staker, stakeAmount) nonReentrant returns(bool) { // Check for the stakerFor Address require(staker != address(0), "Invalid staker"); // Transfer the Tokens to Contract require(token.transferFrom(msg.sender, address(this), stakeAmount), "Unable to transfer token to the contract"); _createStake(staker, stakeAmount); // Update the User balance balances[staker] = balances[staker].add(stakeAmount); // Update current stake period total stake - For Auto Approvals windowTotalStake = windowTotalStake.add(stakeAmount); emit SubmitStake(currentStakeMapIndex, staker, stakeAmount); return true; } // To withdraw stake during submission phase function withdrawStake(uint256 stakeAmount) external allowClaimStake nonReentrant{ //require( // (now >= stakeMap[stakeMapIndex].startPeriod && now <= stakeMap[stakeMapIndex].submissionEndPeriod), // "Stake withdraw at this point is not allowed" //); StakeInfo storage stakeInfo = stakeHolderInfo[msg.sender]; // Validate the input Stake Amount require(stakeAmount > 0 && stakeInfo.amount >= stakeAmount, "Cannot withdraw beyond stake amount"); uint256 bonusAmount; // Update the staker balance in the staking window stakeInfo.amount = stakeInfo.amount.sub(stakeAmount); bonusAmount = stakeInfo.bonusAmount; stakeInfo.bonusAmount = 0; // Update the User balance balances[msg.sender] = balances[msg.sender].sub(stakeAmount); // Update current stake period total stake - For Auto Approvals windowTotalStake = windowTotalStake.sub(stakeAmount); // Return to User Wallet require(token.transfer(msg.sender, stakeAmount), "Unable to transfer token to the account"); // Call the bonus transfer function - Should transfer only if set if(address(bonusToken) != address(0) && bonusAmount > 0) { require(bonusToken.transfer(msg.sender, bonusAmount), "Unable to transfer bonus token to the account"); } emit WithdrawStake(currentStakeMapIndex, msg.sender, stakeAmount, bonusAmount); } // To claim from the stake window function claimStake() external allowClaimStake nonReentrant{ StakeInfo storage stakeInfo = stakeHolderInfo[msg.sender]; uint256 stakeAmount; uint256 bonusAmount; // No more stake windows or in submission phase stakeAmount = stakeInfo.amount; bonusAmount = stakeInfo.bonusAmount; stakeInfo.amount = 0; stakeInfo.bonusAmount = 0; // Update current stake period total stake windowTotalStake = windowTotalStake.sub(stakeAmount); // Check for balance in the contract require(token.balanceOf(address(this)) >= stakeAmount, "Not enough balance in the contract"); // Update the User Balance balances[msg.sender] = balances[msg.sender].sub(stakeAmount); // Call the transfer function require(token.transfer(msg.sender, stakeAmount), "Unable to transfer token back to the account"); // Call the bonus transfer function - Should transfer only if set if(address(bonusToken) != address(0) && bonusAmount > 0) { require(bonusToken.transfer(msg.sender, bonusAmount), "Unable to transfer bonus token to the account"); } emit ClaimStake(currentStakeMapIndex, msg.sender, stakeAmount, bonusAmount); } function _calculateRewardAmount(uint256 stakeMapIndex, uint256 stakeAmount) internal view returns(uint256) { uint256 calcRewardAmount; if(windowTotalStake > stakeMap[stakeMapIndex].windowRewardAmount) { calcRewardAmount = stakeAmount.mul(stakeMap[stakeMapIndex].windowRewardAmount).div(windowTotalStake.sub(stakeMap[stakeMapIndex].windowRewardAmount)); } return calcRewardAmount; } // Update reward for staker in the respective stake window function computeAndAddReward(uint256 stakeMapIndex, address staker, uint256 stakeBonusAmount) public onlyOperator returns(bool) { // Check for the Incubation Period require( now > stakeMap[stakeMapIndex].submissionEndPeriod && now < stakeMap[stakeMapIndex].endPeriod, "Reward cannot be added now" ); StakeInfo storage stakeInfo = stakeHolderInfo[staker]; // Check if reward already computed require(stakeInfo.amount > 0 && stakeInfo.rewardComputeIndex != stakeMapIndex, "Invalid reward request"); // Calculate the totalAmount uint256 totalAmount; uint256 rewardAmount; // Calculate the reward amount for the current window totalAmount = stakeInfo.amount; rewardAmount = _calculateRewardAmount(stakeMapIndex, totalAmount); totalAmount = totalAmount.add(rewardAmount); // Add the reward amount stakeInfo.amount = totalAmount; // Add the bonus Amount stakeInfo.bonusAmount = stakeInfo.bonusAmount.add(stakeBonusAmount); // Update the reward compute index to avoid mulitple addition stakeInfo.rewardComputeIndex = stakeMapIndex; // Update the User Balance balances[staker] = balances[staker].add(rewardAmount); emit AddReward(staker, stakeMapIndex, tokenOperator, totalAmount, rewardAmount, windowTotalStake); return true; } function updateRewards(uint256 stakeMapIndex, address[] calldata staker, uint256 stakeBonusAmount) external onlyOperator { for(uint256 indx = 0; indx < staker.length; indx++) { require(computeAndAddReward(stakeMapIndex, staker[indx], stakeBonusAmount)); } } // AirDrop to Stake - Load existing stakes from Air Drop function airDropStakes(uint256 stakeMapIndex, address[] calldata staker, uint256[] calldata stakeAmount) external onlyOperator { // Add check for Block Number to restrict air drop auto stake phase after certain block number require(block.number < maxAirDropStakeBlocks, "Exceeds airdrop auto stake phase"); // Check Input Parameters require(staker.length == stakeAmount.length, "Invalid Input Arrays"); // Stakers should be for current window require(currentStakeMapIndex == stakeMapIndex, "Invalid Stake Window Index"); for(uint256 indx = 0; indx < staker.length; indx++) { StakeInfo memory req; // Create a stake request with amount req.exist = true; req.amount = stakeAmount[indx]; req.rewardComputeIndex = 0; // Add to the Stake Holders List stakeHolderInfo[staker[indx]] = req; // Add to the Stake Holders List stakeHolders.push(staker[indx]); // Update the User balance balances[staker[indx]] = stakeAmount[indx]; // Update current stake period total stake - Along with Reward windowTotalStake = windowTotalStake.add(stakeAmount[indx]); } } // Getter Functions function getStakeHolders() external view returns(address[] memory) { return stakeHolders; } function getStakeInfo(address staker) external view returns (bool found, uint256 amount, uint256 rewardComputeIndex, uint256 bonusAmount) { StakeInfo memory stakeInfo = stakeHolderInfo[staker]; found = false; if(stakeInfo.exist) { found = true; } amount = stakeInfo.amount; rewardComputeIndex = stakeInfo.rewardComputeIndex; bonusAmount = stakeInfo.bonusAmount; } }
pragma solidity ^0.6.0; interface IExternalStake { function submitStakeFor(address staker, uint256 stakeAmount) external returns(bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.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]. */ 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 () internal { _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 make 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 pragma solidity ^0.6.2; /** * @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 in 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"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.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; import "../../GSN/Context.sol"; import "./IERC20.sol"; import "../../math/SafeMath.sol"; import "../../utils/Address.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin guidelines: functions revert instead * of returning `false` on failure. This behavior is nonetheless conventional * and does not conflict with the expectations of ERC20 applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; /** * @dev Sets the values for {name} and {symbol}, initializes {decimals} with * a default value of 18. * * To select a different value for {decimals}, use {_setupDecimals}. * * All three of these values are immutable: they can only be set once during * construction. */ constructor (string memory name, string memory symbol) public { _name = name; _symbol = symbol; _decimals = 18; } /** * @dev Returns the name of the token. */ function name() public view returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is * called. * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view returns (uint8) { return _decimals; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}; * * Requirements: * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements * * - `to` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Sets {decimals} to a value other than the default one of 18. * * WARNING: This function should only be called from the constructor. Most * applications that interact with token contracts will not expect * {decimals} to ever change, and may work incorrectly if it does. */ function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.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, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; import "../GSN/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.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; } }
{ "remappings": [], "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "istanbul", "libraries": {}, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_maxAirDropStakeBlocks","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"staker","type":"address"},{"indexed":true,"internalType":"uint256","name":"stakeIndex","type":"uint256"},{"indexed":false,"internalType":"address","name":"tokenOperator","type":"address"},{"indexed":false,"internalType":"uint256","name":"stakeAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rewardAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"windowTotalStake","type":"uint256"}],"name":"AddReward","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"stakeIndex","type":"uint256"},{"indexed":true,"internalType":"address","name":"staker","type":"address"},{"indexed":false,"internalType":"uint256","name":"totalAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"bonusAmount","type":"uint256"}],"name":"ClaimStake","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"tokenOperator","type":"address"}],"name":"NewOperator","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"stakeIndex","type":"uint256"},{"indexed":true,"internalType":"address","name":"tokenOperator","type":"address"},{"indexed":false,"internalType":"uint256","name":"startPeriod","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endPeriod","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rewardAmount","type":"uint256"}],"name":"OpenForStake","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"stakeIndex","type":"uint256"},{"indexed":true,"internalType":"address","name":"staker","type":"address"},{"indexed":false,"internalType":"uint256","name":"stakeAmount","type":"uint256"}],"name":"SubmitStake","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"stakeIndex","type":"uint256"},{"indexed":true,"internalType":"address","name":"staker","type":"address"},{"indexed":false,"internalType":"uint256","name":"stakeAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"bonusAmount","type":"uint256"}],"name":"WithdrawStake","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"tokenOperator","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"WithdrawToken","type":"event"},{"inputs":[{"internalType":"uint256","name":"stakeMapIndex","type":"uint256"},{"internalType":"address[]","name":"staker","type":"address[]"},{"internalType":"uint256[]","name":"stakeAmount","type":"uint256[]"}],"name":"airDropStakes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balances","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bonusToken","outputs":[{"internalType":"contract ERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimStake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"stakeMapIndex","type":"uint256"},{"internalType":"address","name":"staker","type":"address"},{"internalType":"uint256","name":"stakeBonusAmount","type":"uint256"}],"name":"computeAndAddReward","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"currentStakeMapIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getStakeHolders","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"staker","type":"address"}],"name":"getStakeInfo","outputs":[{"internalType":"bool","name":"found","type":"bool"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"rewardComputeIndex","type":"uint256"},{"internalType":"uint256","name":"bonusAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxAirDropStakeBlocks","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_startPeriod","type":"uint256"},{"internalType":"uint256","name":"_submissionEndPeriod","type":"uint256"},{"internalType":"uint256","name":"_endPeriod","type":"uint256"},{"internalType":"uint256","name":"_windowRewardAmount","type":"uint256"},{"internalType":"uint256","name":"_maxStake","type":"uint256"},{"internalType":"uint256","name":"_windowMaxAmount","type":"uint256"}],"name":"openForStake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_bonusToken","type":"address"}],"name":"setBonusToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"stakeMap","outputs":[{"internalType":"uint256","name":"startPeriod","type":"uint256"},{"internalType":"uint256","name":"submissionEndPeriod","type":"uint256"},{"internalType":"uint256","name":"endPeriod","type":"uint256"},{"internalType":"uint256","name":"maxStake","type":"uint256"},{"internalType":"uint256","name":"windowRewardAmount","type":"uint256"},{"internalType":"uint256","name":"windowMaxAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"stakeAmount","type":"uint256"}],"name":"submitStake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"staker","type":"address"},{"internalType":"uint256","name":"stakeAmount","type":"uint256"}],"name":"submitStakeFor","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract ERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenOperator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOperator","type":"address"}],"name":"updateOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"stakeMapIndex","type":"uint256"},{"internalType":"address[]","name":"staker","type":"address[]"},{"internalType":"uint256","name":"stakeBonusAmount","type":"uint256"}],"name":"updateRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"windowTotalStake","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"stakeAmount","type":"uint256"}],"name":"withdrawStake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"value","type":"uint256"}],"name":"withdrawToken","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101585760003560e01c80638bd85c44116100c3578063c8aea2471161007c578063c8aea2471461049a578063e737b86e14610511578063eb32117314610519578063f2fde38b14610521578063f7fecc2714610547578063fc0c546a1461059f57610158565b80638bd85c44146103d35780638da5cb5b146103db578063ac7475ed146103e3578063b2eaeaaa14610409578063bec3aa751461042f578063c34531531461044c57610158565b806348bba3091161011557806348bba3091461025b5780634d028c271461032457806350baa622146103565780635a8a173414610373578063715018a61461037b57806388a0c9291461038357610158565b80631c0676671461015d57806325d5971f1461019a57806327e235e3146101b75780632ad77f8f146101ef57806334044b78146101f757806341d4a1ab14610237575b600080fd5b610198600480360360c081101561017357600080fd5b5080359060208101359060408101359060608101359060808101359060a001356105a7565b005b610198600480360360208110156101b057600080fd5b50356107fe565b6101dd600480360360208110156101cd57600080fd5b50356001600160a01b0316610bc5565b60408051918252519081900360200190f35b6101dd610bd7565b6102236004803603604081101561020d57600080fd5b506001600160a01b038135169060200135610bdd565b604080519115158252519081900360200190f35b61023f610f25565b604080516001600160a01b039092168252519081900360200190f35b6101986004803603606081101561027157600080fd5b8135919081019060408101602082013564010000000081111561029357600080fd5b8201836020820111156102a557600080fd5b803590602001918460208302840111640100000000831117156102c757600080fd5b9193909290916020810190356401000000008111156102e557600080fd5b8201836020820111156102f757600080fd5b8035906020019184602083028401116401000000008311171561031957600080fd5b509092509050610f34565b6102236004803603606081101561033a57600080fd5b508035906001600160a01b0360208201351690604001356111ef565b6101986004803603602081101561036c57600080fd5b5035611419565b6101dd611615565b61019861161b565b6103a06004803603602081101561039957600080fd5b50356116bd565b604080519687526020870195909552858501939093526060850191909152608084015260a0830152519081900360c00190f35b6101dd6116f2565b61023f6116f8565b610198600480360360208110156103f957600080fd5b50356001600160a01b0316611707565b6101986004803603602081101561041f57600080fd5b50356001600160a01b031661180e565b6101986004803603602081101561044557600080fd5b50356118d9565b6104726004803603602081101561046257600080fd5b50356001600160a01b0316611b4a565b6040805194151585526020850193909352838301919091526060830152519081900360800190f35b610198600480360360608110156104b057600080fd5b813591908101906040810160208201356401000000008111156104d257600080fd5b8201836020820111156104e457600080fd5b8035906020019184602083028401116401000000008311171561050657600080fd5b919350915035611bd0565b61023f611c62565b610198611c71565b6101986004803603602081101561053757600080fd5b50356001600160a01b0316612091565b61054f612189565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561058b578181015183820152602001610573565b505050509050019250505060405180910390f35b61023f6121eb565b6004546001600160a01b031633146105f05760405162461bcd60e51b81526004018080602001828103825260258152602001806127866025913960400191505060405180910390fd5b4286101580156105ff57508486105b801561060a57508385105b610652576040805162461bcd60e51b8152602060048201526014602482015273125b9d985b1a59081cdd185ad9481c195c9a5bd960621b604482015290519081900360640190fd5b6000831180156106625750600082115b801561066e5750600081115b6106b0576040805162461bcd60e51b815260206004820152600e60248201526d496e76616c696420696e7075747360901b604482015290519081900360640190fd5b60075415806106f15750600754600090815260086020526040902060010154421180156106f157506007546000908152600860205260409020600201548610155b61072c5760405162461bcd60e51b815260040180806020018281038252603181526020018061265a6031913960400191505060405180910390fd5b60078054600101905561073d61257f565b86815260208082018781526040808401888152608085018881526060860188815260a08701888152600754600090815260089097529390952086518155935160018501559051600284015592516003830155915160048201559051600590910155600b546107ab90856121fa565b600b55600754604080518981526020810188905280820187905290513392917fcdf5b97db577de28441798f046e8910e8e4cfa4634aa957d9c29d8d35e10db00919081900360600190a350505050505050565b600754600090815260086020526040902054421080159061083357506007546000908152600860205260409020600101544211155b80156108505750336000908152600a602052604090206001015415155b8061088a57506007546000908152600860205260409020600201544211801561088a5750336000908152600a602052604090206001015415155b6108d3576040805162461bcd60e51b8152602060048201526015602482015274125b9d985b1a590818db185a5b481c995c5d595cdd605a1b604482015290519081900360640190fd5b6002600154141561092b576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002600155336000908152600a602052604090208115801590610952575081816001015410155b61098d5760405162461bcd60e51b815260040180806020018281038252602381526020018061268b6023913960400191505060405180910390fd5b600181015460009061099f908461225d565b60018301555060038101805460009182905533825260066020526040909120546109c9908461225d565b33600090815260066020526040902055600b546109e6908461225d565b600b556002546040805163a9059cbb60e01b81523360048201526024810186905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b158015610a3d57600080fd5b505af1158015610a51573d6000803e3d6000fd5b505050506040513d6020811015610a6757600080fd5b5051610aa45760405162461bcd60e51b81526004018080602001828103825260278152602001806126ae6027913960400191505060405180910390fd5b6003546001600160a01b031615801590610abe5750600081115b15610b7e576003546040805163a9059cbb60e01b81523360048201526024810184905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b158015610b1757600080fd5b505af1158015610b2b573d6000803e3d6000fd5b505050506040513d6020811015610b4157600080fd5b5051610b7e5760405162461bcd60e51b815260040180806020018281038252602d815260200180612759602d913960400191505060405180910390fd5b600754604080518581526020810184905281513393927f673bfbb3dfcd8a2199b5dd0f5266f5ed6716f9502c7dcc5aa89b1d46554b96df928290030190a350506001805550565b60066020526000908152604090205481565b60055481565b6007546000908152600860205260408120544210801590610c1257506007546000908152600860205260409020600101544211155b610c4d5760405162461bcd60e51b81526004018080602001828103825260218152602001806127166021913960400191505060405180910390fd5b6001600160a01b0383166000908152600a602052604081206001015484918491610c789083906121fa565b9050600082118015610c9e57506007546000908152600860205260409020600301548111155b8015610cca5750600754600090815260086020526040902060050154600b54610cc790846121fa565b11155b610d12576040805162461bcd60e51b8152602060048201526014602482015273457863656564696e67206d6178206c696d69747360601b604482015290519081900360640190fd5b60026001541415610d6a576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026001556001600160a01b038616610dbb576040805162461bcd60e51b815260206004820152600e60248201526d24b73b30b634b21039ba30b5b2b960911b604482015290519081900360640190fd5b600254604080516323b872dd60e01b81523360048201523060248201526044810188905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b158015610e1557600080fd5b505af1158015610e29573d6000803e3d6000fd5b505050506040513d6020811015610e3f57600080fd5b5051610e7c5760405162461bcd60e51b81526004018080602001828103825260288152602001806125e06028913960400191505060405180910390fd5b610e86868661229f565b506001600160a01b038616600090815260066020526040902054610eaa90866121fa565b6001600160a01b038716600090815260066020526040902055600b54610ed090866121fa565b600b556007546040805187815290516001600160a01b03891692917f157efccb244e0e1ae7a36a1c28a1f45b62e1250e06e57d9cb44cc1cdc2d95d92919081900360200190a350506001808055949350505050565b6003546001600160a01b031681565b6004546001600160a01b03163314610f7d5760405162461bcd60e51b81526004018080602001828103825260258152602001806127866025913960400191505060405180910390fd5b6005544310610fd3576040805162461bcd60e51b815260206004820181905260248201527f457863656564732061697264726f70206175746f207374616b65207068617365604482015290519081900360640190fd5b82811461101e576040805162461bcd60e51b8152602060048201526014602482015273496e76616c696420496e7075742041727261797360601b604482015290519081900360640190fd5b8460075414611074576040805162461bcd60e51b815260206004820152601a60248201527f496e76616c6964205374616b652057696e646f7720496e646578000000000000604482015290519081900360640190fd5b60005b838110156111e7576110876125b5565b6001815283838381811061109757fe5b90506020020135816020018181525050600081604001818152505080600a60008888868181106110c357fe5b602090810292909201356001600160a01b03168352508181019290925260409081016000208351815460ff19169015151781559183015160018301558201516002820155606090910151600390910155600986868481811061112157fe5b835460018101855560009485526020948590200180546001600160a01b0319166001600160a01b03959092029390930135939093169290921790555083838381811061116957fe5b905060200201356006600088888681811061118057fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b03168152602001908152602001600020819055506111db8484848181106111c357fe5b90506020020135600b546121fa90919063ffffffff16565b600b5550600101611077565b505050505050565b6004546000906001600160a01b0316331461123b5760405162461bcd60e51b81526004018080602001828103825260258152602001806127866025913960400191505060405180910390fd5b6000848152600860205260409020600101544211801561126b575060008481526008602052604090206002015442105b6112bc576040805162461bcd60e51b815260206004820152601a60248201527f5265776172642063616e6e6f74206265206164646564206e6f77000000000000604482015290519081900360640190fd5b6001600160a01b0383166000908152600a602052604090206001810154158015906112eb575084816002015414155b611335576040805162461bcd60e51b8152602060048201526016602482015275125b9d985b1a59081c995dd85c99081c995c5d595cdd60521b604482015290519081900360640190fd5b60018101546000611346878361237e565b905061135282826121fa565b60018401819055600384015490925061136b90866121fa565b6003840155600283018790556001600160a01b03861660009081526006602052604090205461139a90826121fa565b6001600160a01b0380881660008181526006602090815260409182902094909455600454600b5482519190941681529384018690528381018590526060840192909252905189927f45e1ba9e71ec24a10adf9d3f8cf6c41c4452fcb51b8aa6850861243fb23f76f3919081900360800190a35060019695505050505050565b6004546001600160a01b031633146114625760405162461bcd60e51b81526004018080602001828103825260258152602001806127866025913960400191505060405180910390fd5b600254604080516370a0823160e01b8152306004820152905183926001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156114ac57600080fd5b505afa1580156114c0573d6000803e3d6000fd5b505050506040513d60208110156114d657600080fd5b505110156115155760405162461bcd60e51b81526004018080602001828103825260228152602001806127376022913960400191505060405180910390fd5b6002546040805163a9059cbb60e01b81523360048201526024810184905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b15801561156957600080fd5b505af115801561157d573d6000803e3d6000fd5b505050506040513d602081101561159357600080fd5b50516115d05760405162461bcd60e51b81526004018080602001828103825260308152602001806127ab6030913960400191505060405180910390fd5b6004546040805183815290516001600160a01b03909216917f992ee874049a42cae0757a765cd7f641b6028cc35c3478bde8330bf417c3a7a99181900360200190a250565b60075481565b6116236123e9565b6000546001600160a01b03908116911614611673576040805162461bcd60e51b815260206004820181905260248201526000805160206126f6833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600860205260009081526040902080546001820154600283015460038401546004850154600590950154939492939192909186565b600b5481565b6000546001600160a01b031690565b61170f6123e9565b6000546001600160a01b0390811691161461175f576040805162461bcd60e51b815260206004820181905260248201526000805160206126f6833981519152604482015290519081900360640190fd5b6001600160a01b0381166117ba576040805162461bcd60e51b815260206004820152601860248201527f496e76616c6964206f70657261746f7220616464726573730000000000000000604482015290519081900360640190fd5b600480546001600160a01b0383166001600160a01b0319909116811790915560408051918252517fda12ee837e6978172aaf54b16145ffe08414fd8710092ef033c71b8eb6ec189a9181900360200190a150565b6118166123e9565b6000546001600160a01b03908116911614611866576040805162461bcd60e51b815260206004820181905260248201526000805160206126f6833981519152604482015290519081900360640190fd5b6001600160a01b0381166118b7576040805162461bcd60e51b815260206004820152601360248201527224b73b30b634b2103137b73ab9903a37b5b2b760691b604482015290519081900360640190fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b600754600090815260086020526040902054421080159061190e57506007546000908152600860205260409020600101544211155b6119495760405162461bcd60e51b81526004018080602001828103825260218152602001806127166021913960400191505060405180910390fd5b336000818152600a602052604081206001015483919061196a9083906121fa565b905060008211801561199057506007546000908152600860205260409020600301548111155b80156119bc5750600754600090815260086020526040902060050154600b546119b990846121fa565b11155b611a04576040805162461bcd60e51b8152602060048201526014602482015273457863656564696e67206d6178206c696d69747360601b604482015290519081900360640190fd5b600254604080516323b872dd60e01b81523360048201523060248201526044810187905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b158015611a5e57600080fd5b505af1158015611a72573d6000803e3d6000fd5b505050506040513d6020811015611a8857600080fd5b5051611ac55760405162461bcd60e51b81526004018080602001828103825260288152602001806125e06028913960400191505060405180910390fd5b611acf338561229f565b5033600090815260066020526040902054611aea90856121fa565b33600090815260066020526040902055600b54611b0790856121fa565b600b556007546040805186815290513392917f157efccb244e0e1ae7a36a1c28a1f45b62e1250e06e57d9cb44cc1cdc2d95d92919081900360200190a350505050565b600080600080611b586125b5565b506001600160a01b0385166000908152600a602090815260408083208151608081018352815460ff161580158252600183015494820194909452600282015492810192909252600301546060820152919550611bb357600194505b806020015193508060400151925080606001519150509193509193565b6004546001600160a01b03163314611c195760405162461bcd60e51b81526004018080602001828103825260258152602001806127866025913960400191505060405180910390fd5b60005b82811015611c5b57611c4a85858584818110611c3457fe5b905060200201356001600160a01b0316846111ef565b611c5357600080fd5b600101611c1c565b5050505050565b6004546001600160a01b031681565b6007546000908152600860205260409020544210801590611ca657506007546000908152600860205260409020600101544211155b8015611cc35750336000908152600a602052604090206001015415155b80611cfd575060075460009081526008602052604090206002015442118015611cfd5750336000908152600a602052604090206001015415155b611d46576040805162461bcd60e51b8152602060048201526015602482015274125b9d985b1a590818db185a5b481c995c5d595cdd605a1b604482015290519081900360640190fd5b60026001541415611d9e576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026001908155336000908152600a6020526040812091820180546003840180549284905592909255600b54611dd4908361225d565b600b55600254604080516370a0823160e01b8152306004820152905184926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015611e2157600080fd5b505afa158015611e35573d6000803e3d6000fd5b505050506040513d6020811015611e4b57600080fd5b50511015611e8a5760405162461bcd60e51b81526004018080602001828103825260228152602001806127376022913960400191505060405180910390fd5b33600090815260066020526040902054611ea4908361225d565b33600081815260066020908152604080832094909455600254845163a9059cbb60e01b815260048101949094526024840187905293516001600160a01b039094169363a9059cbb93604480820194918390030190829087803b158015611f0957600080fd5b505af1158015611f1d573d6000803e3d6000fd5b505050506040513d6020811015611f3357600080fd5b5051611f705760405162461bcd60e51b815260040180806020018281038252602c815260200180612608602c913960400191505060405180910390fd5b6003546001600160a01b031615801590611f8a5750600081115b1561204a576003546040805163a9059cbb60e01b81523360048201526024810184905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b158015611fe357600080fd5b505af1158015611ff7573d6000803e3d6000fd5b505050506040513d602081101561200d57600080fd5b505161204a5760405162461bcd60e51b815260040180806020018281038252602d815260200180612759602d913960400191505060405180910390fd5b600754604080518481526020810184905281513393927f264d516978993d9a3ad8f7f4be7c3ec864bd6e25e4ccb0da2bfc2bba01698c53928290030190a350506001805550565b6120996123e9565b6000546001600160a01b039081169116146120e9576040805162461bcd60e51b815260206004820181905260248201526000805160206126f6833981519152604482015290519081900360640190fd5b6001600160a01b03811661212e5760405162461bcd60e51b81526004018080602001828103825260268152602001806126346026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b606060098054806020026020016040519081016040528092919081815260200182805480156121e157602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116121c3575b5050505050905090565b6002546001600160a01b031681565b600082820183811015612254576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b90505b92915050565b600061225483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506123ed565b6001600160a01b0382166000908152600a60205260408120805460ff16156122da5760018101546122d090846121fa565b6001820155612374565b6122e26125b5565b60018082526020808301868152600060408086018281526001600160a01b038b16808452600a9095529082208651815460ff19169015151781559251838601555160028301556060909401516003909101556009805492830181559092527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af0180546001600160a01b03191690911790555b5060019392505050565b600082815260086020526040812060040154600b548291101561225457600084815260086020526040902060040154600b546123e1916123be919061225d565b6000868152600860205260409020600401546123db908690612484565b906124dd565b949350505050565b3390565b6000818484111561247c5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612441578181015183820152602001612429565b50505050905090810190601f16801561246e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b60008261249357506000612257565b828202828482816124a057fe5b04146122545760405162461bcd60e51b81526004018080602001828103825260218152602001806126d56021913960400191505060405180910390fd5b600061225483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250600081836125695760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315612441578181015183820152602001612429565b50600083858161257557fe5b0495945050505050565b6040518060c001604052806000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6040518060800160405280600015158152602001600081526020016000815260200160008152509056fe556e61626c6520746f207472616e7366657220746f6b656e20746f2074686520636f6e7472616374556e61626c6520746f207472616e7366657220746f6b656e206261636b20746f20746865206163636f756e744f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737343616e6e6f742068617665206d6f7265207468616e206f6e65207374616b65207265717565737420617420612074696d6543616e6e6f74207769746864726177206265796f6e64207374616b6520616d6f756e74556e61626c6520746f207472616e7366657220746f6b656e20746f20746865206163636f756e74536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725374616b696e67206174207468697320706f696e74206e6f7420616c6c6f7765644e6f7420656e6f7567682062616c616e636520696e2074686520636f6e7472616374556e61626c6520746f207472616e7366657220626f6e757320746f6b656e20746f20746865206163636f756e744f6e6c79206f70657261746f722063616e2063616c6c20746869732066756e6374696f6e2e556e61626c6520746f207472616e7366657220746f6b656e20746f20746865206f70657261746f72206163636f756e74a2646970667358221220318dbbd417678f4ecc7a0087509034cadc8d665f8f740aa0c4255cb73e7bcddb64736f6c634300060c0033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 26 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
ETH | 100.00% | $0.025788 | 36,578,129.914 | $943,292.91 |
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.