More Info
Private Name Tags
Latest 25 from a total of 1,218 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Withdraw | 14441995 | 993 days ago | IN | 0 ETH | 0.00206181 | ||||
Withdraw | 14434839 | 994 days ago | IN | 0 ETH | 0.00388749 | ||||
Withdraw | 14376128 | 1003 days ago | IN | 0 ETH | 0.00173209 | ||||
Withdraw | 14373624 | 1004 days ago | IN | 0 ETH | 0.00298968 | ||||
Withdraw | 14361899 | 1006 days ago | IN | 0 ETH | 0.00300518 | ||||
Deposit | 14324962 | 1011 days ago | IN | 0 ETH | 0.00513055 | ||||
Withdraw | 14307795 | 1014 days ago | IN | 0 ETH | 0.00407317 | ||||
Withdraw | 14304346 | 1014 days ago | IN | 0 ETH | 0.00889819 | ||||
Withdraw | 14282142 | 1018 days ago | IN | 0 ETH | 0.00676551 | ||||
Withdraw | 14233299 | 1025 days ago | IN | 0 ETH | 0.01531881 | ||||
Withdraw | 14176732 | 1034 days ago | IN | 0 ETH | 0.00480139 | ||||
Withdraw | 14145096 | 1039 days ago | IN | 0 ETH | 0.00906153 | ||||
Withdraw | 14053958 | 1053 days ago | IN | 0 ETH | 0.02810363 | ||||
Withdraw | 14053926 | 1053 days ago | IN | 0 ETH | 0.0268045 | ||||
Withdraw | 14019463 | 1059 days ago | IN | 0 ETH | 0.01097901 | ||||
Withdraw | 14008573 | 1060 days ago | IN | 0 ETH | 0.01794267 | ||||
Withdraw | 13980411 | 1065 days ago | IN | 0 ETH | 0.02673379 | ||||
Withdraw | 13961043 | 1068 days ago | IN | 0 ETH | 0.02137553 | ||||
Manual Epoch Ini... | 13959653 | 1068 days ago | IN | 0 ETH | 0.01143971 | ||||
Withdraw | 13948696 | 1069 days ago | IN | 0 ETH | 0.02842322 | ||||
Withdraw | 13886669 | 1079 days ago | IN | 0 ETH | 0.00431769 | ||||
Withdraw | 13871098 | 1081 days ago | IN | 0 ETH | 0.00583677 | ||||
Withdraw | 13860583 | 1083 days ago | IN | 0 ETH | 0.00751724 | ||||
Withdraw | 13854667 | 1084 days ago | IN | 0 ETH | 0.0062432 | ||||
Withdraw | 13835609 | 1087 days ago | IN | 0 ETH | 0.00446711 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
Staking2
Compiler Version
v0.6.12+commit.27d51765
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.6.11; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "../lib/BlackholePrevention.sol"; contract Staking2 is Ownable, ReentrancyGuard, BlackholePrevention { using SafeMath for uint256; uint128 constant private BASE_MULTIPLIER = uint128(1 * 10 ** 18); bool internal _paused; // timestamp for the epoch 1 // everything before that is considered epoch 0 which won't have a reward but allows for the initial stake uint256 public immutable epoch1Start; // duration of each epoch uint256 public immutable epochDuration; // holds the current balance of the user for each token mapping(address => mapping(address => uint256)) private balances; struct Pool { uint256 size; bool set; } // for each token, we store the total pool size mapping(address => mapping(uint256 => Pool)) private poolSize; // a checkpoint of the valid balance of a user for an epoch struct Checkpoint { uint128 epochId; uint128 multiplier; uint256 startBalance; uint256 newDeposits; } // balanceCheckpoints[user][token][] mapping(address => mapping(address => Checkpoint[])) private balanceCheckpoints; mapping(address => uint128) private lastWithdrawEpochId; event PausedStateSet(bool isPaused); event Deposit(address indexed user, address indexed tokenAddress, uint256 amount); event Withdraw(address indexed user, address indexed tokenAddress, uint256 amount); event ManualEpochInit(address indexed caller, uint128 indexed epochId, address[] tokens); event EmergencyWithdraw(address indexed user, address indexed tokenAddress, uint256 amount); constructor (uint256 _epoch1Start, uint256 _epochDuration) public { _paused = false; epoch1Start = _epoch1Start; epochDuration = _epochDuration; } function isPaused() external view returns (bool) { return _paused; } /* * Stores `amount` of `tokenAddress` tokens for the `user` into the vault */ function deposit(address tokenAddress, uint256 amount) public nonReentrant whenNotPaused { require(amount > 0, "STK:E-205"); IERC20 token = IERC20(tokenAddress); balances[msg.sender][tokenAddress] = balances[msg.sender][tokenAddress].add(amount); token.transferFrom(msg.sender, address(this), amount); // epoch logic uint128 currentEpoch = getCurrentEpoch(); uint128 currentMultiplier = currentEpochMultiplier(); uint256 balance = balances[msg.sender][tokenAddress]; if (!epochIsInitialized(tokenAddress, currentEpoch)) { address[] memory tokens = new address[](1); tokens[0] = tokenAddress; manualEpochInit(tokens, currentEpoch); } // update the next epoch pool size Pool storage pNextEpoch = poolSize[tokenAddress][currentEpoch + 1]; pNextEpoch.size = token.balanceOf(address(this)); pNextEpoch.set = true; Checkpoint[] storage checkpoints = balanceCheckpoints[msg.sender][tokenAddress]; uint256 balanceBefore = getEpochUserBalance(msg.sender, tokenAddress, currentEpoch); // if there's no checkpoint yet, it means the user didn't have any activity // we want to store checkpoints both for the current epoch and next epoch because // if a user does a withdraw, the current epoch can also be modified and // we don't want to insert another checkpoint in the middle of the array as that could be expensive if (checkpoints.length == 0) { checkpoints.push(Checkpoint(currentEpoch, currentMultiplier, 0, amount)); // next epoch => multiplier is 1, epoch deposits is 0 checkpoints.push(Checkpoint(currentEpoch + 1, BASE_MULTIPLIER, amount, 0)); } else { uint256 last = checkpoints.length - 1; // the last action happened in an older epoch (e.g. a deposit in epoch 3, current epoch is >=5) if (checkpoints[last].epochId < currentEpoch) { uint128 multiplier = computeNewMultiplier( getCheckpointBalance(checkpoints[last]), BASE_MULTIPLIER, amount, currentMultiplier ); checkpoints.push(Checkpoint(currentEpoch, multiplier, getCheckpointBalance(checkpoints[last]), amount)); checkpoints.push(Checkpoint(currentEpoch + 1, BASE_MULTIPLIER, balance, 0)); } // the last action happened in the previous epoch else if (checkpoints[last].epochId == currentEpoch) { checkpoints[last].multiplier = computeNewMultiplier( getCheckpointBalance(checkpoints[last]), checkpoints[last].multiplier, amount, currentMultiplier ); checkpoints[last].newDeposits = checkpoints[last].newDeposits.add(amount); checkpoints.push(Checkpoint(currentEpoch + 1, BASE_MULTIPLIER, balance, 0)); } // the last action happened in the current epoch else { if (last >= 1 && checkpoints[last - 1].epochId == currentEpoch) { checkpoints[last - 1].multiplier = computeNewMultiplier( getCheckpointBalance(checkpoints[last - 1]), checkpoints[last - 1].multiplier, amount, currentMultiplier ); checkpoints[last - 1].newDeposits = checkpoints[last - 1].newDeposits.add(amount); } checkpoints[last].startBalance = balance; } } uint256 balanceAfter = getEpochUserBalance(msg.sender, tokenAddress, currentEpoch); poolSize[tokenAddress][currentEpoch].size = poolSize[tokenAddress][currentEpoch].size.add(balanceAfter.sub(balanceBefore)); emit Deposit(msg.sender, tokenAddress, amount); } /* * Removes the deposit of the user and sends the amount of `tokenAddress` back to the `user` */ function withdraw(address tokenAddress, uint256 amount) public nonReentrant { require(balances[msg.sender][tokenAddress] >= amount, "STK:E-432"); balances[msg.sender][tokenAddress] = balances[msg.sender][tokenAddress].sub(amount); IERC20 token = IERC20(tokenAddress); token.transfer(msg.sender, amount); // epoch logic uint128 currentEpoch = getCurrentEpoch(); lastWithdrawEpochId[tokenAddress] = currentEpoch; if (!epochIsInitialized(tokenAddress, currentEpoch)) { address[] memory tokens = new address[](1); tokens[0] = tokenAddress; manualEpochInit(tokens, currentEpoch); } // update the pool size of the next epoch to its current balance Pool storage pNextEpoch = poolSize[tokenAddress][currentEpoch + 1]; pNextEpoch.size = token.balanceOf(address(this)); pNextEpoch.set = true; Checkpoint[] storage checkpoints = balanceCheckpoints[msg.sender][tokenAddress]; uint256 last = checkpoints.length - 1; // note: it's impossible to have a withdraw and no checkpoints because the checkpoints[last] will be out of bound and revert // there was a deposit in an older epoch (more than 1 behind [eg: previous 0, now 5]) but no other action since then if (checkpoints[last].epochId < currentEpoch) { checkpoints.push(Checkpoint(currentEpoch, BASE_MULTIPLIER, balances[msg.sender][tokenAddress], 0)); poolSize[tokenAddress][currentEpoch].size = poolSize[tokenAddress][currentEpoch].size.sub(amount); } // there was a deposit in the `epochId - 1` epoch => we have a checkpoint for the current epoch else if (checkpoints[last].epochId == currentEpoch) { checkpoints[last].startBalance = balances[msg.sender][tokenAddress]; checkpoints[last].newDeposits = 0; checkpoints[last].multiplier = BASE_MULTIPLIER; poolSize[tokenAddress][currentEpoch].size = poolSize[tokenAddress][currentEpoch].size.sub(amount); } // there was a deposit in the current epoch else { Checkpoint storage currentEpochCheckpoint = checkpoints[last - 1]; uint256 balanceBefore = getCheckpointEffectiveBalance(currentEpochCheckpoint); // in case of withdraw, we have 2 branches: // 1. the user withdraws less than he added in the current epoch // 2. the user withdraws more than he added in the current epoch (including 0) if (amount < currentEpochCheckpoint.newDeposits) { uint128 avgDepositMultiplier = uint128( balanceBefore.sub(currentEpochCheckpoint.startBalance).mul(BASE_MULTIPLIER).div(currentEpochCheckpoint.newDeposits) ); currentEpochCheckpoint.newDeposits = currentEpochCheckpoint.newDeposits.sub(amount); currentEpochCheckpoint.multiplier = computeNewMultiplier( currentEpochCheckpoint.startBalance, BASE_MULTIPLIER, currentEpochCheckpoint.newDeposits, avgDepositMultiplier ); } else { currentEpochCheckpoint.startBalance = currentEpochCheckpoint.startBalance.sub( amount.sub(currentEpochCheckpoint.newDeposits) ); currentEpochCheckpoint.newDeposits = 0; currentEpochCheckpoint.multiplier = BASE_MULTIPLIER; } uint256 balanceAfter = getCheckpointEffectiveBalance(currentEpochCheckpoint); poolSize[tokenAddress][currentEpoch].size = poolSize[tokenAddress][currentEpoch].size.sub(balanceBefore.sub(balanceAfter)); checkpoints[last].startBalance = balances[msg.sender][tokenAddress]; } emit Withdraw(msg.sender, tokenAddress, amount); } /* * manualEpochInit can be used by anyone to initialize an epoch based on the previous one * This is only applicable if there was no action (deposit/withdraw) in the current epoch. * Any deposit and withdraw will automatically initialize the current and next epoch. */ function manualEpochInit(address[] memory tokens, uint128 epochId) public whenNotPaused { require(epochId <= getCurrentEpoch(), "STK:E-306"); for (uint i = 0; i < tokens.length; i++) { Pool storage p = poolSize[tokens[i]][epochId]; if (epochId == 0) { p.size = uint256(0); p.set = true; } else { require(!epochIsInitialized(tokens[i], epochId), "STK:E-002"); require(epochIsInitialized(tokens[i], epochId - 1), "STK:E-305"); p.size = poolSize[tokens[i]][epochId - 1].size; p.set = true; } } emit ManualEpochInit(msg.sender, epochId, tokens); } function emergencyWithdraw(address tokenAddress) public { require((getCurrentEpoch() - lastWithdrawEpochId[tokenAddress]) >= 10, "STK:E-304"); uint256 totalUserBalance = balances[msg.sender][tokenAddress]; require(totalUserBalance > 0, "STK:E-205"); balances[msg.sender][tokenAddress] = 0; IERC20 token = IERC20(tokenAddress); token.transfer(msg.sender, totalUserBalance); emit EmergencyWithdraw(msg.sender, tokenAddress, totalUserBalance); } /* * Returns the valid balance of a user that was taken into consideration in the total pool size for the epoch * A deposit will only change the next epoch balance. * A withdraw will decrease the current epoch (and subsequent) balance. */ function getEpochUserBalance(address user, address token, uint128 epochId) public view returns (uint256) { Checkpoint[] storage checkpoints = balanceCheckpoints[user][token]; // if there are no checkpoints, it means the user never deposited any tokens, so the balance is 0 if (checkpoints.length == 0 || epochId < checkpoints[0].epochId) { return 0; } uint min = 0; uint max = checkpoints.length - 1; // shortcut for blocks newer than the latest checkpoint == current balance if (epochId >= checkpoints[max].epochId) { return getCheckpointEffectiveBalance(checkpoints[max]); } // binary search of the value in the array while (max > min) { uint mid = (max + min + 1) / 2; if (checkpoints[mid].epochId <= epochId) { min = mid; } else { max = mid - 1; } } return getCheckpointEffectiveBalance(checkpoints[min]); } /* * Returns the amount of `token` that the `user` has currently staked */ function balanceOf(address user, address token) public view returns (uint256) { return balances[user][token]; } /* * Returns the id of the current epoch derived from block.timestamp */ function getCurrentEpoch() public view returns (uint128) { if (block.timestamp < epoch1Start) { return 0; } return uint128((block.timestamp - epoch1Start) / epochDuration + 1); } /* * Returns the total amount of `tokenAddress` that was locked from beginning to end of epoch identified by `epochId` */ function getEpochPoolSize(address tokenAddress, uint128 epochId) public view returns (uint256) { // Premises: // 1. it's impossible to have gaps of uninitialized epochs // - any deposit or withdraw initialize the current epoch which requires the previous one to be initialized if (epochIsInitialized(tokenAddress, epochId)) { return poolSize[tokenAddress][epochId].size; } // epochId not initialized and epoch 0 not initialized => there was never any action on this pool if (!epochIsInitialized(tokenAddress, 0)) { return 0; } // epoch 0 is initialized => there was an action at some point but none that initialized the epochId // which means the current pool size is equal to the current balance of token held by the staking contract IERC20 token = IERC20(tokenAddress); return token.balanceOf(address(this)); } /* * Returns the percentage of time left in the current epoch */ function currentEpochMultiplier() public view returns (uint128) { uint128 currentEpoch = getCurrentEpoch(); uint256 currentEpochEnd = epoch1Start + currentEpoch * epochDuration; uint256 timeLeft = currentEpochEnd - block.timestamp; uint128 multiplier = uint128(timeLeft * BASE_MULTIPLIER / epochDuration); return multiplier; } function computeNewMultiplier(uint256 prevBalance, uint128 prevMultiplier, uint256 amount, uint128 currentMultiplier) public pure returns (uint128) { uint256 prevAmount = prevBalance.mul(prevMultiplier).div(BASE_MULTIPLIER); uint256 addAmount = amount.mul(currentMultiplier).div(BASE_MULTIPLIER); uint128 newMultiplier = uint128(prevAmount.add(addAmount).mul(BASE_MULTIPLIER).div(prevBalance.add(amount))); return newMultiplier; } /* * Checks if an epoch is initialized, meaning we have a pool size set for it */ function epochIsInitialized(address token, uint128 epochId) public view returns (bool) { return poolSize[token][epochId].set; } function getCheckpointBalance(Checkpoint memory c) internal pure returns (uint256) { return c.startBalance.add(c.newDeposits); } function getCheckpointEffectiveBalance(Checkpoint memory c) internal pure returns (uint256) { return getCheckpointBalance(c).mul(c.multiplier).div(BASE_MULTIPLIER); } /***********************************| | Only Admin/DAO | |__________________________________*/ function setPausedState(bool paused) external onlyOwner { _paused = paused; emit PausedStateSet(paused); } // Note: This contract should never hold ETH, if any is accidentally sent in then the DAO can return it function withdrawEther(address payable receiver, uint256 amount) external virtual onlyOwner { _withdrawEther(receiver, amount); } modifier whenNotPaused() { require(_paused != true, "STK:E-101"); _; } }
// 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 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; /** * @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; /** * @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 // BlackholePrevention.sol -- Part of the Charged Particles Protocol // Copyright (c) 2021 Firma Lux, Inc. <https://charged.fi> // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. pragma solidity >=0.6.0; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; /** * @notice Prevents ETH or Tokens from getting stuck in a contract by allowing * the Owner/DAO to pull them out on behalf of a user * This is only meant to contracts that are not expected to hold tokens, but do handle transferring them. */ contract BlackholePrevention { using Address for address payable; using SafeERC20 for IERC20; event WithdrawStuckEther(address indexed receiver, uint256 amount); event WithdrawStuckERC20(address indexed receiver, address indexed tokenAddress, uint256 amount); event WithdrawStuckERC721(address indexed receiver, address indexed tokenAddress, uint256 indexed tokenId); function _withdrawEther(address payable receiver, uint256 amount) internal virtual { require(receiver != address(0x0), "BHP:E-403"); if (address(this).balance >= amount) { receiver.sendValue(amount); emit WithdrawStuckEther(receiver, amount); } } function _withdrawERC20(address payable receiver, address tokenAddress, uint256 amount) internal virtual { require(receiver != address(0x0), "BHP:E-403"); if (IERC20(tokenAddress).balanceOf(address(this)) >= amount) { IERC20(tokenAddress).safeTransfer(receiver, amount); emit WithdrawStuckERC20(receiver, tokenAddress, amount); } } function _withdrawERC721(address payable receiver, address tokenAddress, uint256 tokenId) internal virtual { require(receiver != address(0x0), "BHP:E-403"); if (IERC721(tokenAddress).ownerOf(tokenId) == address(this)) { IERC721(tokenAddress).transferFrom(address(this), receiver, tokenId); emit WithdrawStuckERC721(receiver, tokenAddress, tokenId); } } }
// 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; } }
// 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) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } /** * @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; import "./IERC20.sol"; import "../../math/SafeMath.sol"; import "../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' // solhint-disable-next-line max-line-length require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).add(value); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero"); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.2; import "../../introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transfered from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 tokenId) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"uint256","name":"_epoch1Start","type":"uint256"},{"internalType":"uint256","name":"_epochDuration","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"tokenAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"tokenAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"EmergencyWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":true,"internalType":"uint128","name":"epochId","type":"uint128"},{"indexed":false,"internalType":"address[]","name":"tokens","type":"address[]"}],"name":"ManualEpochInit","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":false,"internalType":"bool","name":"isPaused","type":"bool"}],"name":"PausedStateSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"tokenAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":true,"internalType":"address","name":"tokenAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"WithdrawStuckERC20","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":true,"internalType":"address","name":"tokenAddress","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"WithdrawStuckERC721","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"WithdrawStuckEther","type":"event"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"address","name":"token","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"prevBalance","type":"uint256"},{"internalType":"uint128","name":"prevMultiplier","type":"uint128"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint128","name":"currentMultiplier","type":"uint128"}],"name":"computeNewMultiplier","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"currentEpochMultiplier","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"}],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"epoch1Start","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"epochDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint128","name":"epochId","type":"uint128"}],"name":"epochIsInitialized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentEpoch","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint128","name":"epochId","type":"uint128"}],"name":"getEpochPoolSize","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint128","name":"epochId","type":"uint128"}],"name":"getEpochUserBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint128","name":"epochId","type":"uint128"}],"name":"manualEpochInit","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":"bool","name":"paused","type":"bool"}],"name":"setPausedState","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"receiver","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawEther","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60c060405234801561001057600080fd5b506040516200295c3803806200295c8339818101604052604081101561003557600080fd5b50805160209091015160006100486100ae565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350600180556002805460ff1916905560809190915260a0526100b2565b3390565b60805160a05161286d620000ef60003980611096528061158f52806115f052508061155f52806115b0528061161d5280612337525061286d6000f3fe608060405234801561001057600080fd5b50600436106101215760003560e01c8063aa579154116100ad578063ea2c38ae11610071578063ea2c38ae14610339578063f2fde38b146103e7578063f3fef3a31461040d578063f4a4341d14610439578063f7888aec1461044157610121565b8063aa579154146102b9578063b187bd2614610302578063b97dd9e21461030a578063ce58a2a814610312578063db9f60ff1461031a57610121565b8063522f6815116100f4578063522f6815146101fb5780636ff1c9bc14610227578063715018a61461024d5780638c028dd0146102555780638da5cb5b1461029557610121565b80632ca32d7e1461012657806347e7ef241461016d5780634be41dba1461019b5780634ff0876a146101f3575b600080fd5b61015b6004803603604081101561013c57600080fd5b5080356001600160a01b031690602001356001600160801b031661046f565b60408051918252519081900360200190f35b6101996004803603604081101561018357600080fd5b506001600160a01b038135169060200135610549565b005b6101d7600480360360808110156101b157600080fd5b508035906001600160801b03602082013581169160408101359160609091013516611010565b604080516001600160801b039092168252519081900360200190f35b61015b611094565b6101996004803603604081101561021157600080fd5b506001600160a01b0381351690602001356110b8565b6101996004803603602081101561023d57600080fd5b50356001600160a01b031661111e565b6101996112d6565b61015b6004803603606081101561026b57600080fd5b5080356001600160a01b0390811691602081013590911690604001356001600160801b0316611378565b61029d611509565b604080516001600160a01b039092168252519081900360200190f35b6102ee600480360360408110156102cf57600080fd5b5080356001600160a01b031690602001356001600160801b0316611519565b604080519115158252519081900360200190f35b6102ee611552565b6101d761155b565b6101d76115e1565b6101996004803603602081101561033057600080fd5b50351515611661565b6101996004803603604081101561034f57600080fd5b81019060208101813564010000000081111561036a57600080fd5b82018360208201111561037c57600080fd5b8035906020019184602083028401116401000000008311171561039e57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550505090356001600160801b031691506117009050565b610199600480360360208110156103fd57600080fd5b50356001600160a01b03166119c8565b6101996004803603604081101561042357600080fd5b506001600160a01b038135169060200135611ac0565b61015b612335565b61015b6004803603604081101561045757600080fd5b506001600160a01b0381358116916020013516612359565b600061047b8383611519565b156104b357506001600160a01b03821660009081526004602090815260408083206001600160801b0385168452909152902054610543565b6104be836000611519565b6104ca57506000610543565b604080516370a0823160e01b8152306004820152905184916001600160a01b038316916370a0823191602480820192602092909190829003018186803b15801561051357600080fd5b505afa158015610527573d6000803e3d6000fd5b505050506040513d602081101561053d57600080fd5b50519150505b92915050565b600260015414156105a1576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026001818155905460ff16151514156105ee576040805162461bcd60e51b815260206004820152600960248201526853544b3a452d31303160b81b604482015290519081900360640190fd5b6000811161062f576040805162461bcd60e51b815260206004820152600960248201526853544b3a452d32303560b81b604482015290519081900360640190fd5b3360009081526003602090815260408083206001600160a01b0386168452909152902054829061065f9083612384565b3360008181526003602090815260408083206001600160a01b0389811685529083528184209590955580516323b872dd60e01b815260048101949094523060248501526044840187905251938516936323b872dd93606480820194918390030190829087803b1580156106d157600080fd5b505af11580156106e5573d6000803e3d6000fd5b505050506040513d60208110156106fb57600080fd5b506000905061070861155b565b905060006107146115e1565b3360009081526003602090815260408083206001600160a01b038a1684529091529020549091506107458684611519565b6107a55760408051600180825281830190925260609160208083019080368337019050509050868160008151811061077957fe5b60200260200101906001600160a01b031690816001600160a01b0316815250506107a38185611700565b505b6001600160a01b0380871660009081526004602081815260408084206001600160801b0360018a0116855282529283902083516370a0823160e01b81523093810193909352925192938816926370a08231926024808201939291829003018186803b15801561081357600080fd5b505afa158015610827573d6000803e3d6000fd5b505050506040513d602081101561083d57600080fd5b505181556001808201805460ff191690911790553360008181526005602090815260408083206001600160a01b038c168452909152812091610880908a88611378565b8254909150610a3557816040518060800160405280886001600160801b03168152602001876001600160801b03168152602001600081526020018a815250908060018154018082558091505060019003906000526020600020906003020160009091909190915060008201518160000160006101000a8154816001600160801b0302191690836001600160801b0316021790555060208201518160000160106101000a8154816001600160801b0302191690836001600160801b0316021790555060408201518160010155606082015181600201555050816040518060800160405280886001016001600160801b03168152602001670de0b6b3a76400006001600160801b031681526020018a81526020016000815250908060018154018082558091505060019003906000526020600020906003020160009091909190915060008201518160000160006101000a8154816001600160801b0302191690836001600160801b0316021790555060208201518160000160106101000a8154816001600160801b0302191690836001600160801b0316021790555060408201518160010155606082015181600201555050610f4b565b81546000198101906001600160801b03881690849083908110610a5457fe5b60009182526020909120600390910201546001600160801b03161015610ca9576000610aed610add858481548110610a8857fe5b600091825260209182902060408051608081018252600390930290910180546001600160801b038082168552600160801b909104169383019390935260018301549082015260029091015460608201526123de565b670de0b6b3a76400008c8a611010565b90508360405180608001604052808a6001600160801b03168152602001836001600160801b03168152602001610b28878681548110610a8857fe5b81526020018c815250908060018154018082558091505060019003906000526020600020906003020160009091909190915060008201518160000160006101000a8154816001600160801b0302191690836001600160801b0316021790555060208201518160000160106101000a8154816001600160801b0302191690836001600160801b03160217905550604082015181600101556060820151816002015550508360405180608001604052808a6001016001600160801b03168152602001670de0b6b3a76400006001600160801b031681526020018881526020016000815250908060018154018082558091505060019003906000526020600020906003020160009091909190915060008201518160000160006101000a8154816001600160801b0302191690836001600160801b0316021790555060208201518160000160106101000a8154816001600160801b0302191690836001600160801b031602179055506040820151816001015560608201518160020155505050610f49565b866001600160801b0316838281548110610cbf57fe5b60009182526020909120600390910201546001600160801b03161415610e4057610d25610cf1848381548110610a8857fe5b848381548110610cfd57fe5b6000918252602090912060039091020154600160801b90046001600160801b03168b89611010565b838281548110610d3157fe5b906000526020600020906003020160000160106101000a8154816001600160801b0302191690836001600160801b03160217905550610d9689848381548110610d7657fe5b90600052602060002090600302016002015461238490919063ffffffff16565b838281548110610da257fe5b6000918252602080832060026003938402909101810194909455604080516080810182526001600160801b036001808f0182168352670de0b6b3a76400008386019081529383018d8152606084018881528c548084018e558d8a5296909820935195909602909201805493518216600160801b029482166001600160801b031990941693909317169290921781559151908201559051910155610f49565b60018110158015610e815750866001600160801b0316836001830381548110610e6557fe5b60009182526020909120600390910201546001600160801b0316145b15610f2657610eaa610e9b846001840381548110610a8857fe5b846001840381548110610cfd57fe5b836001830381548110610eb957fe5b906000526020600020906003020160000160106101000a8154816001600160801b0302191690836001600160801b03160217905550610f0189846001840381548110610d7657fe5b836001830381548110610f1057fe5b9060005260206000209060030201600201819055505b84838281548110610f3357fe5b9060005260206000209060030201600101819055505b505b6000610f58338b89611378565b9050610f9a610f6782846123fb565b6001600160a01b038c1660009081526004602090815260408083206001600160801b038d16845290915290205490612384565b6001600160a01b038b1660008181526004602090815260408083206001600160801b038d1684528252918290209390935580518c81529051919233927f5548c837ab068cf56a2c2479df0882a4922fd203edb7517321831d95078c5f629281900390910190a35050600180555050505050505050565b600080611038670de0b6b3a7640000611032886001600160801b03891661243d565b90612496565b9050600061105b670de0b6b3a7640000611032876001600160801b03881661243d565b9050600061108861106c8988612384565b611032670de0b6b3a76400006110828787612384565b9061243d565b98975050505050505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b6110c06124d8565b6000546001600160a01b03908116911614611110576040805162461bcd60e51b81526020600482018190526024820152600080516020612818833981519152604482015290519081900360640190fd5b61111a82826124dc565b5050565b6001600160a01b038116600090815260066020526040902054600a906001600160801b031661114b61155b565b036001600160801b03161015611194576040805162461bcd60e51b815260206004820152600960248201526814d512ce914b4ccc0d60ba1b604482015290519081900360640190fd5b3360009081526003602090815260408083206001600160a01b0385168452909152902054806111f6576040805162461bcd60e51b815260206004820152600960248201526853544b3a452d32303560b81b604482015290519081900360640190fd5b3360008181526003602090815260408083206001600160a01b038716808552908352818420849055815163a9059cbb60e01b815260048101959095526024850186905290518694919363a9059cbb93604480850194919392918390030190829087803b15801561126557600080fd5b505af1158015611279573d6000803e3d6000fd5b505050506040513d602081101561128f57600080fd5b50506040805183815290516001600160a01b0385169133917ff24ef89f38eadc1bde50701ad6e4d6d11a2dc24f7cf834a486991f38833285049181900360200190a3505050565b6112de6124d8565b6000546001600160a01b0390811691161461132e576040805162461bcd60e51b81526020600482018190526024820152600080516020612818833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6001600160a01b0380841660009081526005602090815260408083209386168352929052908120805415806113d65750806000815481106113b557fe5b60009182526020909120600390910201546001600160801b03908116908416105b156113e5576000915050611502565b80546000906000198101908390829081106113fc57fe5b60009182526020909120600390910201546001600160801b039081169086161061148e5761148483828154811061142f57fe5b600091825260209182902060408051608081018252600390930290910180546001600160801b038082168552600160801b9091041693830193909352600183015490820152600290910154606082015261257f565b9350505050611502565b818111156114ed5760006002600183850101049050856001600160801b03168482815481106114b957fe5b60009182526020909120600390910201546001600160801b0316116114e0578092506114e7565b6001810391505b5061148e565b6114fc83838154811061142f57fe5b93505050505b9392505050565b6000546001600160a01b03165b90565b6001600160a01b03821660009081526004602090815260408083206001600160801b038516845290915290206001015460ff1692915050565b60025460ff1690565b60007f000000000000000000000000000000000000000000000000000000000000000042101561158d57506000611516565b7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000004203816115d857fe5b04600101905090565b6000806115ec61155b565b90507f00000000000000000000000000000000000000000000000000000000000000006001600160801b03821681027f0000000000000000000000000000000000000000000000000000000000000000019042820390600090670de0b6b3a764000083028161165757fe5b0494505050505090565b6116696124d8565b6000546001600160a01b039081169116146116b9576040805162461bcd60e51b81526020600482018190526024820152600080516020612818833981519152604482015290519081900360640190fd5b6002805482151560ff19909116811790915560408051918252517fa9bfed3d98385b3777389e321dbde773cf7d335fa604fefbae3dca93564f55869181900360200190a150565b60025460ff16151560011415611749576040805162461bcd60e51b815260206004820152600960248201526853544b3a452d31303160b81b604482015290519081900360640190fd5b61175161155b565b6001600160801b0316816001600160801b031611156117a3576040805162461bcd60e51b815260206004820152600960248201526829aa259d229699981b60b91b604482015290519081900360640190fd5b60005b825181101561193a576000600460008584815181106117c157fe5b6020908102919091018101516001600160a01b0316825281810192909252604090810160009081206001600160801b038716808352935220915061181857600081556001808201805460ff19169091179055611931565b61183584838151811061182757fe5b602002602001015184611519565b15611873576040805162461bcd60e51b815260206004820152600960248201526829aa259d229698181960b91b604482015290519081900360640190fd5b61189384838151811061188257fe5b602002602001015160018503611519565b6118d0576040805162461bcd60e51b815260206004820152600960248201526853544b3a452d33303560b81b604482015290519081900360640190fd5b600460008584815181106118e057fe5b6020908102919091018101516001600160a01b0316825281810192909252604090810160009081206001600160801b03600019880116825290925290205481556001818101805460ff191690911790555b506001016117a6565b50806001600160801b0316336001600160a01b03167fb85c32b8d9cecc81feba78646289584a693e9a8afea40ab2fd31efae4408429f846040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156119b1578181015183820152602001611999565b505050509050019250505060405180910390a35050565b6119d06124d8565b6000546001600160a01b03908116911614611a20576040805162461bcd60e51b81526020600482018190526024820152600080516020612818833981519152604482015290519081900360640190fd5b6001600160a01b038116611a655760405162461bcd60e51b81526004018080602001828103825260268152602001806127976026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b60026001541415611b18576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026001553360009081526003602090815260408083206001600160a01b0386168452909152902054811115611b81576040805162461bcd60e51b815260206004820152600960248201526829aa259d22969a199960b91b604482015290519081900360640190fd5b3360009081526003602090815260408083206001600160a01b0386168452909152902054611baf90826123fb565b3360008181526003602090815260408083206001600160a01b03881680855290835281842095909555805163a9059cbb60e01b81526004810194909452602484018690525186949363a9059cbb9360448083019493928390030190829087803b158015611c1b57600080fd5b505af1158015611c2f573d6000803e3d6000fd5b505050506040513d6020811015611c4557600080fd5b5060009050611c5261155b565b6001600160a01b038516600090815260066020526040902080546001600160801b0319166001600160801b0383161790559050611c8f8482611519565b611cef57604080516001808252818301909252606091602080830190803683370190505090508481600081518110611cc357fe5b60200260200101906001600160a01b031690816001600160a01b031681525050611ced8183611700565b505b6001600160a01b0380851660009081526004602081815260408084206001600160801b036001880116855282529283902083516370a0823160e01b81523093810193909352925192938616926370a08231926024808201939291829003018186803b158015611d5d57600080fd5b505afa158015611d71573d6000803e3d6000fd5b505050506040513d6020811015611d8757600080fd5b505181556001808201805460ff191690911790553360009081526005602090815260408083206001600160a01b0389168452909152902080546000198101906001600160801b03851690839083908110611ddd57fe5b60009182526020909120600390910201546001600160801b03161015611fa257816040518060800160405280866001600160801b03168152602001670de0b6b3a76400006001600160801b0316815260200160036000336001600160a01b03166001600160a01b0316815260200190815260200160002060008b6001600160a01b03166001600160a01b031681526020019081526020016000205481526020016000815250908060018154018082558091505060019003906000526020600020906003020160009091909190915060008201518160000160006101000a8154816001600160801b0302191690836001600160801b0316021790555060208201518160000160106101000a8154816001600160801b0302191690836001600160801b0316021790555060408201518160010155606082015181600201555050611f7086600460008a6001600160a01b03166001600160a01b031681526020019081526020016000206000876001600160801b03168152602001908152602001600020600001546123fb90919063ffffffff16565b6001600160a01b03881660009081526004602090815260408083206001600160801b03891684529091529020556122e8565b836001600160801b0316828281548110611fb857fe5b60009182526020909120600390910201546001600160801b031614156120ab573360009081526003602090815260408083206001600160a01b038b168452909152902054825483908390811061200a57fe5b906000526020600020906003020160010181905550600082828154811061202d57fe5b906000526020600020906003020160020181905550670de0b6b3a764000082828154811061205757fe5b60009182526020808320600390920290910180546001600160801b03948516600160801b029085161790556001600160a01b038a16825260048152604080832093881683529290522054611f7090876123fb565b60008260018303815481106120bc57fe5b6000918252602080832060408051608081018252600390940290910180546001600160801b038082168652600160801b90910416928401929092526001820154908301526002810154606083015292506121159061257f565b905081600201548810156121a95760006121598360020154611032670de0b6b3a76400006001600160801b03166110828760010154876123fb90919063ffffffff16565b600284015490915061216b908a6123fb565b60028401819055600184015461218b91670de0b6b3a76400009084611010565b83546001600160801b03918216600160801b029116178355506121f3565b6121ce6121c383600201548a6123fb90919063ffffffff16565b6001840154906123fb565b60018301556000600283015581546001600160801b03166503782dace9d960921b1782555b6040805160808101825283546001600160801b038082168352600160801b9091041660208201526001840154918101919091526002830154606082015260009061223c9061257f565b905061227e61224b83836123fb565b6001600160a01b038c1660009081526004602090815260408083206001600160801b038d168452909152902054906123fb565b6001600160a01b038b1660008181526004602090815260408083206001600160801b038d1684528252808320949094553382526003815283822092825291909152205485548690869081106122cf57fe5b9060005260206000209060030201600101819055505050505b6040805187815290516001600160a01b0389169133917f9b1bfa7fa9ee420a16e124f794c35ac9f90472acc99140eb2f6447c714cad8eb9181900360200190a35050600180555050505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b600082820183811015611502576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60006105438260600151836040015161238490919063ffffffff16565b600061150283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506125b0565b60008261244c57506000610543565b8282028284828161245957fe5b04146115025760405162461bcd60e51b81526004018080602001828103825260218152602001806127f76021913960400191505060405180910390fd5b600061150283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612647565b3390565b6001600160a01b038216612523576040805162461bcd60e51b81526020600482015260096024820152684248503a452d34303360b81b604482015290519081900360640190fd5b80471061111a5761253d6001600160a01b038316826126ac565b6040805182815290516001600160a01b038416917eddb683bb45cd5d0ad8a200c6fae7152b1c236ee90a4a37db692407f5cc38bd919081900360200190a25050565b6000610543670de0b6b3a76400006001600160801b031661103284602001516001600160801b0316611082866123de565b6000818484111561263f5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156126045781810151838201526020016125ec565b50505050905090810190601f1680156126315780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600081836126965760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156126045781810151838201526020016125ec565b5060008385816126a257fe5b0495945050505050565b80471015612701576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604482015290519081900360640190fd5b6040516000906001600160a01b0384169083908381818185875af1925050503d806000811461274c576040519150601f19603f3d011682016040523d82523d6000602084013e612751565b606091505b50509050806127915760405162461bcd60e51b815260040180806020018281038252603a8152602001806127bd603a913960400191505060405180910390fd5b50505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373416464726573733a20756e61626c6520746f2073656e642076616c75652c20726563697069656e74206d61792068617665207265766572746564536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a2646970667358221220179daa9cd9efbd845ba656896769f5a3b4adb3a7c60e9fe337e1efad2614ffe664736f6c634300060c003300000000000000000000000000000000000000000000000000000000612416640000000000000000000000000000000000000000000000000000000000093a80
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101215760003560e01c8063aa579154116100ad578063ea2c38ae11610071578063ea2c38ae14610339578063f2fde38b146103e7578063f3fef3a31461040d578063f4a4341d14610439578063f7888aec1461044157610121565b8063aa579154146102b9578063b187bd2614610302578063b97dd9e21461030a578063ce58a2a814610312578063db9f60ff1461031a57610121565b8063522f6815116100f4578063522f6815146101fb5780636ff1c9bc14610227578063715018a61461024d5780638c028dd0146102555780638da5cb5b1461029557610121565b80632ca32d7e1461012657806347e7ef241461016d5780634be41dba1461019b5780634ff0876a146101f3575b600080fd5b61015b6004803603604081101561013c57600080fd5b5080356001600160a01b031690602001356001600160801b031661046f565b60408051918252519081900360200190f35b6101996004803603604081101561018357600080fd5b506001600160a01b038135169060200135610549565b005b6101d7600480360360808110156101b157600080fd5b508035906001600160801b03602082013581169160408101359160609091013516611010565b604080516001600160801b039092168252519081900360200190f35b61015b611094565b6101996004803603604081101561021157600080fd5b506001600160a01b0381351690602001356110b8565b6101996004803603602081101561023d57600080fd5b50356001600160a01b031661111e565b6101996112d6565b61015b6004803603606081101561026b57600080fd5b5080356001600160a01b0390811691602081013590911690604001356001600160801b0316611378565b61029d611509565b604080516001600160a01b039092168252519081900360200190f35b6102ee600480360360408110156102cf57600080fd5b5080356001600160a01b031690602001356001600160801b0316611519565b604080519115158252519081900360200190f35b6102ee611552565b6101d761155b565b6101d76115e1565b6101996004803603602081101561033057600080fd5b50351515611661565b6101996004803603604081101561034f57600080fd5b81019060208101813564010000000081111561036a57600080fd5b82018360208201111561037c57600080fd5b8035906020019184602083028401116401000000008311171561039e57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550505090356001600160801b031691506117009050565b610199600480360360208110156103fd57600080fd5b50356001600160a01b03166119c8565b6101996004803603604081101561042357600080fd5b506001600160a01b038135169060200135611ac0565b61015b612335565b61015b6004803603604081101561045757600080fd5b506001600160a01b0381358116916020013516612359565b600061047b8383611519565b156104b357506001600160a01b03821660009081526004602090815260408083206001600160801b0385168452909152902054610543565b6104be836000611519565b6104ca57506000610543565b604080516370a0823160e01b8152306004820152905184916001600160a01b038316916370a0823191602480820192602092909190829003018186803b15801561051357600080fd5b505afa158015610527573d6000803e3d6000fd5b505050506040513d602081101561053d57600080fd5b50519150505b92915050565b600260015414156105a1576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026001818155905460ff16151514156105ee576040805162461bcd60e51b815260206004820152600960248201526853544b3a452d31303160b81b604482015290519081900360640190fd5b6000811161062f576040805162461bcd60e51b815260206004820152600960248201526853544b3a452d32303560b81b604482015290519081900360640190fd5b3360009081526003602090815260408083206001600160a01b0386168452909152902054829061065f9083612384565b3360008181526003602090815260408083206001600160a01b0389811685529083528184209590955580516323b872dd60e01b815260048101949094523060248501526044840187905251938516936323b872dd93606480820194918390030190829087803b1580156106d157600080fd5b505af11580156106e5573d6000803e3d6000fd5b505050506040513d60208110156106fb57600080fd5b506000905061070861155b565b905060006107146115e1565b3360009081526003602090815260408083206001600160a01b038a1684529091529020549091506107458684611519565b6107a55760408051600180825281830190925260609160208083019080368337019050509050868160008151811061077957fe5b60200260200101906001600160a01b031690816001600160a01b0316815250506107a38185611700565b505b6001600160a01b0380871660009081526004602081815260408084206001600160801b0360018a0116855282529283902083516370a0823160e01b81523093810193909352925192938816926370a08231926024808201939291829003018186803b15801561081357600080fd5b505afa158015610827573d6000803e3d6000fd5b505050506040513d602081101561083d57600080fd5b505181556001808201805460ff191690911790553360008181526005602090815260408083206001600160a01b038c168452909152812091610880908a88611378565b8254909150610a3557816040518060800160405280886001600160801b03168152602001876001600160801b03168152602001600081526020018a815250908060018154018082558091505060019003906000526020600020906003020160009091909190915060008201518160000160006101000a8154816001600160801b0302191690836001600160801b0316021790555060208201518160000160106101000a8154816001600160801b0302191690836001600160801b0316021790555060408201518160010155606082015181600201555050816040518060800160405280886001016001600160801b03168152602001670de0b6b3a76400006001600160801b031681526020018a81526020016000815250908060018154018082558091505060019003906000526020600020906003020160009091909190915060008201518160000160006101000a8154816001600160801b0302191690836001600160801b0316021790555060208201518160000160106101000a8154816001600160801b0302191690836001600160801b0316021790555060408201518160010155606082015181600201555050610f4b565b81546000198101906001600160801b03881690849083908110610a5457fe5b60009182526020909120600390910201546001600160801b03161015610ca9576000610aed610add858481548110610a8857fe5b600091825260209182902060408051608081018252600390930290910180546001600160801b038082168552600160801b909104169383019390935260018301549082015260029091015460608201526123de565b670de0b6b3a76400008c8a611010565b90508360405180608001604052808a6001600160801b03168152602001836001600160801b03168152602001610b28878681548110610a8857fe5b81526020018c815250908060018154018082558091505060019003906000526020600020906003020160009091909190915060008201518160000160006101000a8154816001600160801b0302191690836001600160801b0316021790555060208201518160000160106101000a8154816001600160801b0302191690836001600160801b03160217905550604082015181600101556060820151816002015550508360405180608001604052808a6001016001600160801b03168152602001670de0b6b3a76400006001600160801b031681526020018881526020016000815250908060018154018082558091505060019003906000526020600020906003020160009091909190915060008201518160000160006101000a8154816001600160801b0302191690836001600160801b0316021790555060208201518160000160106101000a8154816001600160801b0302191690836001600160801b031602179055506040820151816001015560608201518160020155505050610f49565b866001600160801b0316838281548110610cbf57fe5b60009182526020909120600390910201546001600160801b03161415610e4057610d25610cf1848381548110610a8857fe5b848381548110610cfd57fe5b6000918252602090912060039091020154600160801b90046001600160801b03168b89611010565b838281548110610d3157fe5b906000526020600020906003020160000160106101000a8154816001600160801b0302191690836001600160801b03160217905550610d9689848381548110610d7657fe5b90600052602060002090600302016002015461238490919063ffffffff16565b838281548110610da257fe5b6000918252602080832060026003938402909101810194909455604080516080810182526001600160801b036001808f0182168352670de0b6b3a76400008386019081529383018d8152606084018881528c548084018e558d8a5296909820935195909602909201805493518216600160801b029482166001600160801b031990941693909317169290921781559151908201559051910155610f49565b60018110158015610e815750866001600160801b0316836001830381548110610e6557fe5b60009182526020909120600390910201546001600160801b0316145b15610f2657610eaa610e9b846001840381548110610a8857fe5b846001840381548110610cfd57fe5b836001830381548110610eb957fe5b906000526020600020906003020160000160106101000a8154816001600160801b0302191690836001600160801b03160217905550610f0189846001840381548110610d7657fe5b836001830381548110610f1057fe5b9060005260206000209060030201600201819055505b84838281548110610f3357fe5b9060005260206000209060030201600101819055505b505b6000610f58338b89611378565b9050610f9a610f6782846123fb565b6001600160a01b038c1660009081526004602090815260408083206001600160801b038d16845290915290205490612384565b6001600160a01b038b1660008181526004602090815260408083206001600160801b038d1684528252918290209390935580518c81529051919233927f5548c837ab068cf56a2c2479df0882a4922fd203edb7517321831d95078c5f629281900390910190a35050600180555050505050505050565b600080611038670de0b6b3a7640000611032886001600160801b03891661243d565b90612496565b9050600061105b670de0b6b3a7640000611032876001600160801b03881661243d565b9050600061108861106c8988612384565b611032670de0b6b3a76400006110828787612384565b9061243d565b98975050505050505050565b7f0000000000000000000000000000000000000000000000000000000000093a8081565b6110c06124d8565b6000546001600160a01b03908116911614611110576040805162461bcd60e51b81526020600482018190526024820152600080516020612818833981519152604482015290519081900360640190fd5b61111a82826124dc565b5050565b6001600160a01b038116600090815260066020526040902054600a906001600160801b031661114b61155b565b036001600160801b03161015611194576040805162461bcd60e51b815260206004820152600960248201526814d512ce914b4ccc0d60ba1b604482015290519081900360640190fd5b3360009081526003602090815260408083206001600160a01b0385168452909152902054806111f6576040805162461bcd60e51b815260206004820152600960248201526853544b3a452d32303560b81b604482015290519081900360640190fd5b3360008181526003602090815260408083206001600160a01b038716808552908352818420849055815163a9059cbb60e01b815260048101959095526024850186905290518694919363a9059cbb93604480850194919392918390030190829087803b15801561126557600080fd5b505af1158015611279573d6000803e3d6000fd5b505050506040513d602081101561128f57600080fd5b50506040805183815290516001600160a01b0385169133917ff24ef89f38eadc1bde50701ad6e4d6d11a2dc24f7cf834a486991f38833285049181900360200190a3505050565b6112de6124d8565b6000546001600160a01b0390811691161461132e576040805162461bcd60e51b81526020600482018190526024820152600080516020612818833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6001600160a01b0380841660009081526005602090815260408083209386168352929052908120805415806113d65750806000815481106113b557fe5b60009182526020909120600390910201546001600160801b03908116908416105b156113e5576000915050611502565b80546000906000198101908390829081106113fc57fe5b60009182526020909120600390910201546001600160801b039081169086161061148e5761148483828154811061142f57fe5b600091825260209182902060408051608081018252600390930290910180546001600160801b038082168552600160801b9091041693830193909352600183015490820152600290910154606082015261257f565b9350505050611502565b818111156114ed5760006002600183850101049050856001600160801b03168482815481106114b957fe5b60009182526020909120600390910201546001600160801b0316116114e0578092506114e7565b6001810391505b5061148e565b6114fc83838154811061142f57fe5b93505050505b9392505050565b6000546001600160a01b03165b90565b6001600160a01b03821660009081526004602090815260408083206001600160801b038516845290915290206001015460ff1692915050565b60025460ff1690565b60007f000000000000000000000000000000000000000000000000000000006124166442101561158d57506000611516565b7f0000000000000000000000000000000000000000000000000000000000093a807f00000000000000000000000000000000000000000000000000000000612416644203816115d857fe5b04600101905090565b6000806115ec61155b565b90507f0000000000000000000000000000000000000000000000000000000000093a806001600160801b03821681027f0000000000000000000000000000000000000000000000000000000061241664019042820390600090670de0b6b3a764000083028161165757fe5b0494505050505090565b6116696124d8565b6000546001600160a01b039081169116146116b9576040805162461bcd60e51b81526020600482018190526024820152600080516020612818833981519152604482015290519081900360640190fd5b6002805482151560ff19909116811790915560408051918252517fa9bfed3d98385b3777389e321dbde773cf7d335fa604fefbae3dca93564f55869181900360200190a150565b60025460ff16151560011415611749576040805162461bcd60e51b815260206004820152600960248201526853544b3a452d31303160b81b604482015290519081900360640190fd5b61175161155b565b6001600160801b0316816001600160801b031611156117a3576040805162461bcd60e51b815260206004820152600960248201526829aa259d229699981b60b91b604482015290519081900360640190fd5b60005b825181101561193a576000600460008584815181106117c157fe5b6020908102919091018101516001600160a01b0316825281810192909252604090810160009081206001600160801b038716808352935220915061181857600081556001808201805460ff19169091179055611931565b61183584838151811061182757fe5b602002602001015184611519565b15611873576040805162461bcd60e51b815260206004820152600960248201526829aa259d229698181960b91b604482015290519081900360640190fd5b61189384838151811061188257fe5b602002602001015160018503611519565b6118d0576040805162461bcd60e51b815260206004820152600960248201526853544b3a452d33303560b81b604482015290519081900360640190fd5b600460008584815181106118e057fe5b6020908102919091018101516001600160a01b0316825281810192909252604090810160009081206001600160801b03600019880116825290925290205481556001818101805460ff191690911790555b506001016117a6565b50806001600160801b0316336001600160a01b03167fb85c32b8d9cecc81feba78646289584a693e9a8afea40ab2fd31efae4408429f846040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156119b1578181015183820152602001611999565b505050509050019250505060405180910390a35050565b6119d06124d8565b6000546001600160a01b03908116911614611a20576040805162461bcd60e51b81526020600482018190526024820152600080516020612818833981519152604482015290519081900360640190fd5b6001600160a01b038116611a655760405162461bcd60e51b81526004018080602001828103825260268152602001806127976026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b60026001541415611b18576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026001553360009081526003602090815260408083206001600160a01b0386168452909152902054811115611b81576040805162461bcd60e51b815260206004820152600960248201526829aa259d22969a199960b91b604482015290519081900360640190fd5b3360009081526003602090815260408083206001600160a01b0386168452909152902054611baf90826123fb565b3360008181526003602090815260408083206001600160a01b03881680855290835281842095909555805163a9059cbb60e01b81526004810194909452602484018690525186949363a9059cbb9360448083019493928390030190829087803b158015611c1b57600080fd5b505af1158015611c2f573d6000803e3d6000fd5b505050506040513d6020811015611c4557600080fd5b5060009050611c5261155b565b6001600160a01b038516600090815260066020526040902080546001600160801b0319166001600160801b0383161790559050611c8f8482611519565b611cef57604080516001808252818301909252606091602080830190803683370190505090508481600081518110611cc357fe5b60200260200101906001600160a01b031690816001600160a01b031681525050611ced8183611700565b505b6001600160a01b0380851660009081526004602081815260408084206001600160801b036001880116855282529283902083516370a0823160e01b81523093810193909352925192938616926370a08231926024808201939291829003018186803b158015611d5d57600080fd5b505afa158015611d71573d6000803e3d6000fd5b505050506040513d6020811015611d8757600080fd5b505181556001808201805460ff191690911790553360009081526005602090815260408083206001600160a01b0389168452909152902080546000198101906001600160801b03851690839083908110611ddd57fe5b60009182526020909120600390910201546001600160801b03161015611fa257816040518060800160405280866001600160801b03168152602001670de0b6b3a76400006001600160801b0316815260200160036000336001600160a01b03166001600160a01b0316815260200190815260200160002060008b6001600160a01b03166001600160a01b031681526020019081526020016000205481526020016000815250908060018154018082558091505060019003906000526020600020906003020160009091909190915060008201518160000160006101000a8154816001600160801b0302191690836001600160801b0316021790555060208201518160000160106101000a8154816001600160801b0302191690836001600160801b0316021790555060408201518160010155606082015181600201555050611f7086600460008a6001600160a01b03166001600160a01b031681526020019081526020016000206000876001600160801b03168152602001908152602001600020600001546123fb90919063ffffffff16565b6001600160a01b03881660009081526004602090815260408083206001600160801b03891684529091529020556122e8565b836001600160801b0316828281548110611fb857fe5b60009182526020909120600390910201546001600160801b031614156120ab573360009081526003602090815260408083206001600160a01b038b168452909152902054825483908390811061200a57fe5b906000526020600020906003020160010181905550600082828154811061202d57fe5b906000526020600020906003020160020181905550670de0b6b3a764000082828154811061205757fe5b60009182526020808320600390920290910180546001600160801b03948516600160801b029085161790556001600160a01b038a16825260048152604080832093881683529290522054611f7090876123fb565b60008260018303815481106120bc57fe5b6000918252602080832060408051608081018252600390940290910180546001600160801b038082168652600160801b90910416928401929092526001820154908301526002810154606083015292506121159061257f565b905081600201548810156121a95760006121598360020154611032670de0b6b3a76400006001600160801b03166110828760010154876123fb90919063ffffffff16565b600284015490915061216b908a6123fb565b60028401819055600184015461218b91670de0b6b3a76400009084611010565b83546001600160801b03918216600160801b029116178355506121f3565b6121ce6121c383600201548a6123fb90919063ffffffff16565b6001840154906123fb565b60018301556000600283015581546001600160801b03166503782dace9d960921b1782555b6040805160808101825283546001600160801b038082168352600160801b9091041660208201526001840154918101919091526002830154606082015260009061223c9061257f565b905061227e61224b83836123fb565b6001600160a01b038c1660009081526004602090815260408083206001600160801b038d168452909152902054906123fb565b6001600160a01b038b1660008181526004602090815260408083206001600160801b038d1684528252808320949094553382526003815283822092825291909152205485548690869081106122cf57fe5b9060005260206000209060030201600101819055505050505b6040805187815290516001600160a01b0389169133917f9b1bfa7fa9ee420a16e124f794c35ac9f90472acc99140eb2f6447c714cad8eb9181900360200190a35050600180555050505050565b7f000000000000000000000000000000000000000000000000000000006124166481565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b600082820183811015611502576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60006105438260600151836040015161238490919063ffffffff16565b600061150283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506125b0565b60008261244c57506000610543565b8282028284828161245957fe5b04146115025760405162461bcd60e51b81526004018080602001828103825260218152602001806127f76021913960400191505060405180910390fd5b600061150283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612647565b3390565b6001600160a01b038216612523576040805162461bcd60e51b81526020600482015260096024820152684248503a452d34303360b81b604482015290519081900360640190fd5b80471061111a5761253d6001600160a01b038316826126ac565b6040805182815290516001600160a01b038416917eddb683bb45cd5d0ad8a200c6fae7152b1c236ee90a4a37db692407f5cc38bd919081900360200190a25050565b6000610543670de0b6b3a76400006001600160801b031661103284602001516001600160801b0316611082866123de565b6000818484111561263f5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156126045781810151838201526020016125ec565b50505050905090810190601f1680156126315780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600081836126965760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156126045781810151838201526020016125ec565b5060008385816126a257fe5b0495945050505050565b80471015612701576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604482015290519081900360640190fd5b6040516000906001600160a01b0384169083908381818185875af1925050503d806000811461274c576040519150601f19603f3d011682016040523d82523d6000602084013e612751565b606091505b50509050806127915760405162461bcd60e51b815260040180806020018281038252603a8152602001806127bd603a913960400191505060405180910390fd5b50505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373416464726573733a20756e61626c6520746f2073656e642076616c75652c20726563697069656e74206d61792068617665207265766572746564536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a2646970667358221220179daa9cd9efbd845ba656896769f5a3b4adb3a7c60e9fe337e1efad2614ffe664736f6c634300060c0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000000000000000000000000000000000000612416640000000000000000000000000000000000000000000000000000000000093a80
-----Decoded View---------------
Arg [0] : _epoch1Start (uint256): 1629754980
Arg [1] : _epochDuration (uint256): 604800
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000061241664
Arg [1] : 0000000000000000000000000000000000000000000000000000000000093a80
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
ETH | 100.00% | $0.007115 | 102,440.6034 | $728.82 |
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.