Feature Tip: Add private address tag to any address under My Name Tag !
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 1 internal transaction
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
15847392 | 705 days ago | Contract Creation | 0 ETH |
Loading...
Loading
Contract Name:
SmartChefFactory
Compiler Version
v0.6.12+commit.27d51765
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2022-10-28 */ /** *Submitted for verification at Etherscan.io on 2022-06-13 */ // File: @openzeppelin/contracts/utils/Context.sol // SPDX-License-Identifier: MIT pragma solidity 0.6.12; /* * @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; } } // File: @openzeppelin/contracts/access/Ownable.sol pragma solidity 0.6.12; /** * @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. */ abstract 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 virtual 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; } } pragma solidity 0.6.12; interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the token decimals. */ function decimals() external view returns (uint8); /** * @dev Returns the token symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the token name. */ function name() external view returns (string memory); /** * @dev Returns the erc token owner. */ function getOwner() external view returns (address); /** * @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); } // File: @openzeppelin/contracts/math/SafeMath.sol pragma solidity 0.6.12; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b > a) return (false, 0); return (true, a - b); } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a / b); } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a % b); } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) return 0; uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: division by zero"); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: modulo by zero"); return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); return a - b; } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryDiv}. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); return a % b; } } // File: @openzeppelin/contracts/utils/ReentrancyGuard.sol pragma solidity 0.6.12; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() 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; } } // File: @openzeppelin/contracts/utils/Address.sol pragma solidity 0.6.12; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{value: value}(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) private pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } // File: bsc-library/contracts/SafeBEP20.sol pragma solidity 0.6.12; /** * @title SafeBEP20 * @dev Wrappers around BEP20 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 SafeBEP20 for IBEP20;` 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"); } } } // File: contracts/SmartChefInitializable.sol pragma solidity 0.6.12; contract SmartChefInitializable is Ownable, ReentrancyGuard { using SafeMath for uint256; using SafeERC20 for IERC20; uint256 public lockTime; // 432,000 blocks = 15 days; uint256 public endLockTime; // The address of the smart chef factory address public SMART_CHEF_FACTORY; // Whether a limit is set for users bool public hasUserLimit; // Whether it is initialized bool public isInitialized; // Accrued token per share uint256 public accTokenPerShare; // The block number when SOKU mining ends. uint256 public bonusEndBlock; // The block number when SOKU mining starts. uint256 public startBlock; // The block number of the last pool update uint256 public lastRewardBlock; // The pool limit (0 if none) uint256 public poolLimitPerUser; // SOKU tokens created per block. uint256 public rewardPerBlock; // The precision factor uint256 public PRECISION_FACTOR; // The reward token IERC20 public rewardToken; // The staked token IERC20 public stakedToken; // Info of each user that stakes tokens (stakedToken) mapping(address => UserInfo) public userInfo; mapping(address => uint256) public addressEndLockTime; bool public hasSavedPendingRewardUpdatedByAdmin = true; bool public hasAllRewardDistributedByAdmin = true; uint public numberOfClaimSavedPendingReward; uint public numberOfClaimCurrentAndTotalPendingReward; mapping(address => uint256) public temporaryPendingReward; struct UserInfo { uint256 amount; // How many staked tokens the user has provided uint256 rewardDebt; // Reward debt } event AdminTokenRecovery(address tokenRecovered, uint256 amount); event Deposit(address indexed user, uint256 amount); event ClaimReward(address indexed user, uint256 amount); event EmergencyWithdraw(address indexed user, uint256 amount); event NewStartAndEndBlocks(uint256 startBlock, uint256 endBlock); event NewRewardPerBlock(uint256 rewardPerBlock); event NewPoolLimit(uint256 poolLimitPerUser); event Withdraw(address indexed user, uint256 amount); constructor() public { SMART_CHEF_FACTORY = msg.sender; } /* * @notice Initialize the contract * @param _stakedToken: staked token address * @param _rewardToken: reward token address * @param _rewardPerBlock: reward per block (in rewardToken) * @param _startBlock: start block * @param _bonusEndBlock: end block * @param _poolLimitPerUser: pool limit per user in stakedToken (if any, else 0) * @param _admin: admin address with ownership */ function initialize( IERC20 _stakedToken, IERC20 _rewardToken, uint256 _rewardPerBlock, uint256 _startBlock, uint256 _bonusEndBlock, uint256 _lockTime, uint256 _poolLimitPerUser, address _admin ) external { require(!isInitialized, "Already initialized"); require(msg.sender == SMART_CHEF_FACTORY, "Not factory"); // Make this contract initialized isInitialized = true; stakedToken = _stakedToken; rewardToken = _rewardToken; rewardPerBlock = _rewardPerBlock; startBlock = _startBlock; bonusEndBlock = _bonusEndBlock; lockTime = _lockTime; endLockTime = block.number.add(lockTime); if (_poolLimitPerUser > 0) { hasUserLimit = true; poolLimitPerUser = _poolLimitPerUser; } uint256 decimalsRewardToken = uint256(rewardToken.decimals()); require(decimalsRewardToken < 30, "Must be inferior to 30"); PRECISION_FACTOR = uint256(10**(uint256(30).sub(decimalsRewardToken))); // Set the lastRewardBlock as the startBlock lastRewardBlock = startBlock; // Transfer ownership to the admin address who becomes owner of the contract transferOwnership(_admin); } /* * @notice Deposit staked tokens and collect reward tokens (if any) * @param _amount: amount to withdraw (in rewardToken) */ function deposit(uint256 _amount) external nonReentrant { UserInfo storage user = userInfo[msg.sender]; uint256 balanceDiff = 0; if (hasUserLimit) { require(_amount.add(user.amount) <= poolLimitPerUser, "User amount above limit"); } _updatePool(); if (_amount > 0) { uint256 balanceBefore = stakedToken.balanceOf(address(this)); stakedToken.transferFrom(msg.sender, address(this), _amount); uint256 balanceAfter = stakedToken.balanceOf(address(this)); balanceDiff = balanceAfter - balanceBefore; user.amount = user.amount.add(balanceDiff); } user.rewardDebt = user.rewardDebt.add(balanceDiff.mul(accTokenPerShare).div(PRECISION_FACTOR)); emit Deposit(msg.sender, balanceDiff); _resetAddressEndLockTime(); } function claimReward() external { _claimReward(msg.sender); } /* * @notice Withdraw staked tokens and collect reward tokens * @param _amount: amount to withdraw (in rewardToken) */ function withdraw(uint256 _amount) external nonReentrant { uint256 localAddressEndLockTime; if(addressEndLockTime[msg.sender] == 0) { localAddressEndLockTime = endLockTime; } else { localAddressEndLockTime = addressEndLockTime[msg.sender]; } require(block.number >= localAddressEndLockTime || block.number >= bonusEndBlock, "Lock still in affect, or pool has not ended yet."); UserInfo storage user = userInfo[msg.sender]; require(user.amount >= _amount, "Amount to withdraw too high"); _updatePool(); uint256 pending = user.amount.mul(accTokenPerShare).div(PRECISION_FACTOR).sub(user.rewardDebt); if (_amount > 0) { user.amount = user.amount.sub(_amount); stakedToken.safeTransfer(address(msg.sender), _amount); } if (pending > 0) { rewardToken.safeTransfer(address(msg.sender), pending); } user.rewardDebt = user.amount.mul(accTokenPerShare).div(PRECISION_FACTOR); emit Withdraw(msg.sender, _amount); } /* * @notice Withdraw staked tokens without caring about reward reward * @dev Needs to be for emergency. */ function emergencyWithdraw() external nonReentrant { UserInfo storage user = userInfo[msg.sender]; uint256 amountToTransfer = user.amount; user.amount = 0; user.rewardDebt = 0; if (amountToTransfer > 0) { stakedToken.safeTransfer(address(msg.sender), amountToTransfer); } emit EmergencyWithdraw(msg.sender, user.amount); } /* * @notice Stop reward * @dev Only callable by owner. Needs to be for emergency. */ function emergencyRewardWithdraw(uint256 _amount) external onlyOwner { rewardToken.safeTransfer(address(msg.sender), _amount); } /** * @notice It allows the admin to recover wrong tokens sent to the contract * @param _tokenAddress: the address of the token to withdraw * @param _tokenAmount: the number of tokens to withdraw * @dev This function is only callable by admin. */ function recoverWrongTokens(address _tokenAddress, uint256 _tokenAmount) external onlyOwner { // require(_tokenAddress != address(stakedToken), "Cannot be staked token"); require(_tokenAddress != address(rewardToken), "Cannot be reward token"); IERC20(_tokenAddress).safeTransfer(address(msg.sender), _tokenAmount); emit AdminTokenRecovery(_tokenAddress, _tokenAmount); } /* * @notice Stop reward * @dev Only callable by owner */ function stopReward() external onlyOwner { bonusEndBlock = block.number; } /* * @notice Update pool limit per user * @dev Only callable by owner. * @param _hasUserLimit: whether the limit remains forced * @param _poolLimitPerUser: new pool limit per user */ function updatePoolLimitPerUser(bool _hasUserLimit, uint256 _poolLimitPerUser) external onlyOwner { require(hasUserLimit, "Must be set"); if (_hasUserLimit) { require(_poolLimitPerUser > poolLimitPerUser, "New limit must be higher"); poolLimitPerUser = _poolLimitPerUser; } else { hasUserLimit = _hasUserLimit; poolLimitPerUser = 0; } emit NewPoolLimit(poolLimitPerUser); } /* * @notice Update reward per block * @dev Only callable by owner. * @param _rewardPerBlock: the reward per block */ // ** When updating rewardPerBlock, claim every users tokens ** // function updateRewardPerBlock(uint256 _rewardPerBlock) external onlyOwner { _updatePool(); rewardPerBlock = _rewardPerBlock; emit NewRewardPerBlock(_rewardPerBlock); } /** * @notice It allows the admin to update start and end blocks * @dev This function is only callable by owner. * @param _startBlock: the new start block * @param _bonusEndBlock: the new end block */ function updateStartAndEndBlocks(uint256 _startBlock, uint256 _bonusEndBlock) external onlyOwner { require(block.number < startBlock, "Pool has started"); require(_startBlock < _bonusEndBlock, "New startBlock must be lower than new endBlock"); require(block.number < _startBlock, "New startBlock must be higher than current block"); startBlock = _startBlock; bonusEndBlock = _bonusEndBlock; // Set the lastRewardBlock as the startBlock lastRewardBlock = startBlock; emit NewStartAndEndBlocks(_startBlock, _bonusEndBlock); } /* * @notice View function to see pending reward on frontend. * @param _user: user address * @return Pending reward for a given user */ function pendingReward(address _user) public view returns (uint256) { UserInfo storage user = userInfo[_user]; uint256 stakedTokenSupply = stakedToken.balanceOf(address(this)); if (block.number > lastRewardBlock && stakedTokenSupply != 0) { uint256 multiplier = _getMultiplier(lastRewardBlock, block.number); uint256 SOKUReward = multiplier.mul(rewardPerBlock); uint256 adjustedTokenPerShare = accTokenPerShare.add(SOKUReward.mul(PRECISION_FACTOR).div(stakedTokenSupply)); return user.amount.mul(adjustedTokenPerShare).div(PRECISION_FACTOR).sub(user.rewardDebt); } else { return user.amount.mul(accTokenPerShare).div(PRECISION_FACTOR).sub(user.rewardDebt); } } function getRemainingLockTime(address _user) external view returns (uint256) { if (addressEndLockTime[_user] < block.number) { return 0; } return addressEndLockTime[_user] - block.number; } function _resetAddressEndLockTime() internal { addressEndLockTime[msg.sender] = block.number.add(lockTime); } /* * @notice Update reward variables of the given pool to be up-to-date. */ function _updatePool() internal { if (block.number <= lastRewardBlock) { return; } uint256 stakedTokenSupply = stakedToken.balanceOf(address(this)); if (stakedTokenSupply == 0) { lastRewardBlock = block.number; return; } uint256 multiplier = _getMultiplier(lastRewardBlock, block.number); uint256 SOKUReward = multiplier.mul(rewardPerBlock); accTokenPerShare = accTokenPerShare.add(SOKUReward.mul(PRECISION_FACTOR).div(stakedTokenSupply)); lastRewardBlock = block.number; } /* * @notice Return reward multiplier over the given _from to _to block. * @param _from: block to start * @param _to: block to finish */ function _getMultiplier(uint256 _from, uint256 _to) internal view returns (uint256) { if (_to <= bonusEndBlock) { return _to.sub(_from); } else if (_from >= bonusEndBlock) { return 0; } else { return bonusEndBlock.sub(_from); } } function _claimReward(address _user) internal { UserInfo storage user = userInfo[_user]; _updatePool(); if (user.amount > 0) { uint256 pending = user.amount.mul(accTokenPerShare).div(PRECISION_FACTOR).sub(user.rewardDebt); if (pending > 0) { uint256 localAddressEndLockTime; if (addressEndLockTime[_user] == 0) { localAddressEndLockTime = endLockTime; } else { localAddressEndLockTime = addressEndLockTime[_user]; } // If the lock time (i.e. 15 days) has passed or pool has ended require(block.number >= localAddressEndLockTime || block.number >= bonusEndBlock, "Lock time has not expired, or the pool has not ended yet."); rewardToken.safeTransfer(address(_user), pending); } user.rewardDebt = user.amount.mul(accTokenPerShare).div(PRECISION_FACTOR); emit ClaimReward(_user, pending); } } } // File: contracts/SmartChefFactory.sol pragma solidity 0.6.12; contract SmartChefFactory is Ownable { event NewSmartChefContract(address indexed smartChef); constructor() public { // } /* * @notice Deploy the pool * @param _stakedToken: staked token address * @param _rewardToken: reward token address * @param _rewardPerBlock: reward per block (in rewardToken) * @param _startBlock: start block * @param _endBlock: end block * @param _poolLimitPerUser: pool limit per user in stakedToken (if any, else 0) * @param _admin: admin address with ownership * @return address of new smart chef contract */ function deployPool( IERC20 _stakedToken, IERC20 _rewardToken, uint256 _rewardPerBlock, uint256 _startBlock, uint256 _bonusEndBlock, uint256 _lockTime, uint256 _poolLimitPerUser, address _admin ) external onlyOwner { require(_stakedToken.totalSupply() >= 0); require(_rewardToken.totalSupply() >= 0); require(_stakedToken != _rewardToken, "Tokens must be be different"); bytes memory bytecode = type(SmartChefInitializable).creationCode; bytes32 salt = keccak256(abi.encodePacked(_stakedToken, _rewardToken, _startBlock)); address smartChefAddress; assembly { smartChefAddress := create2(0, add(bytecode, 32), mload(bytecode), salt) } SmartChefInitializable(smartChefAddress).initialize( _stakedToken, _rewardToken, _rewardPerBlock, _startBlock, _bonusEndBlock, _lockTime, _poolLimitPerUser, _admin ); emit NewSmartChefContract(smartChefAddress); } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"smartChef","type":"address"}],"name":"NewSmartChefContract","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"},{"inputs":[{"internalType":"contract IERC20","name":"_stakedToken","type":"address"},{"internalType":"contract IERC20","name":"_rewardToken","type":"address"},{"internalType":"uint256","name":"_rewardPerBlock","type":"uint256"},{"internalType":"uint256","name":"_startBlock","type":"uint256"},{"internalType":"uint256","name":"_bonusEndBlock","type":"uint256"},{"internalType":"uint256","name":"_lockTime","type":"uint256"},{"internalType":"uint256","name":"_poolLimitPerUser","type":"uint256"},{"internalType":"address","name":"_admin","type":"address"}],"name":"deployPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b50600061001b61006a565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35061006e565b3390565b6127458061007d6000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c8063715018a6146100515780638da5cb5b1461005b578063bbc22f501461007f578063f2fde38b146100d4575b600080fd5b6100596100fa565b005b6100636101b8565b604080516001600160a01b039092168252519081900360200190f35b610059600480360361010081101561009657600080fd5b506001600160a01b038135811691602081013582169160408201359160608101359160808201359160a08101359160c08201359160e00135166101c7565b610059600480360360208110156100ea57600080fd5b50356001600160a01b03166104e8565b6101026105fc565b6001600160a01b03166101136101b8565b6001600160a01b03161461016e576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b6101cf6105fc565b6001600160a01b03166101e06101b8565b6001600160a01b03161461023b576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6000886001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561027657600080fd5b505afa15801561028a573d6000803e3d6000fd5b505050506040513d60208110156102a057600080fd5b505110156102ad57600080fd5b6000876001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156102e857600080fd5b505afa1580156102fc573d6000803e3d6000fd5b505050506040513d602081101561031257600080fd5b5051101561031f57600080fd5b866001600160a01b0316886001600160a01b03161415610386576040805162461bcd60e51b815260206004820152601b60248201527f546f6b656e73206d75737420626520626520646966666572656e740000000000604482015290519081900360640190fd5b60606040518060200161039890610600565b6020820181038252601f19601f820116604052509050600089898860405160200180846001600160a01b031660601b8152601401836001600160a01b031660601b815260140182815260200193505050506040516020818303038152906040528051906020012090506000818351602085016000f560408051632aa2c38160e01b81526001600160a01b038e811660048301528d81166024830152604482018d9052606482018c9052608482018b905260a482018a905260c4820189905287811660e4830152915192935090831691632aa2c381916101048082019260009290919082900301818387803b15801561048f57600080fd5b505af11580156104a3573d6000803e3d6000fd5b50506040516001600160a01b03841692507fe0d103a92c6ff6c4aceb49d436f4028e0deb4884fdbcb9f32b03045eabb44a6c9150600090a25050505050505050505050565b6104f06105fc565b6001600160a01b03166105016101b8565b6001600160a01b03161461055c576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b0381166105a15760405162461bcd60e51b81526004018080602001828103825260268152602001806126ea6026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b3390565b6120dc8061060e8339019056fe60806040526010805461ff001960ff199091166001171661010017905534801561002857600080fd5b506000610033610098565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35060018055600480546001600160a01b0319163317905561009c565b3390565b612031806100ab6000396000f3fe608060405234801561001057600080fd5b50600436106102275760003560e01c80638ae39cac11610130578063bd617191116100b8578063e8eb2c6f1161007c578063e8eb2c6f146104e0578063f2fde38b14610506578063f40f0f521461052c578063f7c618c114610552578063f95e6fb91461055a57610227565b8063bd617191146104b8578063cc7a262e146104c0578063ccd34cd5146104c8578063cdafbad1146104d0578063db2e21bc146104d857610227565b80639513997f116100ff5780639513997f14610443578063a0b4090514610466578063a9f8d1811461048b578063b6b55f2514610493578063b88a802f146104b057610227565b80638ae39cac146104075780638da5cb5b1461040f5780638f6629151461043357806392e8990e1461043b57610227565b80633279beab116101b357806348cd4cb11161018257806348cd4cb1146103df57806366fe9f8a146103e7578063702b2f34146103ef578063715018a6146103f757806380dc0672146103ff57610227565b80633279beab14610368578063392e53cd146103855780633f138d4b1461038d57806347304494146103b957610227565b80631ec64f62116101fa5780631ec64f62146102ac5780632636aedf146102c857806328449fa7146102d05780632aa2c381146102f65780632e1a7d4d1461034b57610227565b806301f8a9761461022c5780630d6680871461024b5780631959a002146102655780631aed6553146102a4575b600080fd5b6102496004803603602081101561024257600080fd5b5035610562565b005b610253610607565b60408051918252519081900360200190f35b61028b6004803603602081101561027b57600080fd5b50356001600160a01b031661060d565b6040805192835260208301919091528051918290030190f35b610253610626565b6102b461062c565b604080519115158252519081900360200190f35b61025361063a565b610253600480360360208110156102e657600080fd5b50356001600160a01b0316610640565b610249600480360361010081101561030d57600080fd5b506001600160a01b038135811691602081013582169160408201359160608101359160808201359160a08101359160c08201359160e0013516610652565b6102496004803603602081101561036157600080fd5b5035610866565b6102496004803603602081101561037e57600080fd5b5035610a86565b6102b4610b02565b610249600480360360408110156103a357600080fd5b506001600160a01b038135169060200135610b12565b610253600480360360208110156103cf57600080fd5b50356001600160a01b0316610c2c565b610253610c77565b610253610c7d565b610253610c83565b610249610c89565b610249610d35565b610253610d9d565b610417610da3565b604080516001600160a01b039092168252519081900360200190f35b610253610db2565b6102b4610db8565b6102496004803603604081101561045957600080fd5b5080359060200135610dc8565b6102496004803603604081101561047c57600080fd5b50803515159060200135610f3d565b6102536110a7565b610249600480360360208110156104a957600080fd5b50356110ad565b6102496113a4565b6104176113af565b6104176113be565b6102536113cd565b6102b46113d3565b6102496113dc565b610253600480360360208110156104f657600080fd5b50356001600160a01b03166114b3565b6102496004803603602081101561051c57600080fd5b50356001600160a01b03166114c5565b6102536004803603602081101561054257600080fd5b50356001600160a01b03166115c7565b61041761171d565b61025361172c565b61056a611732565b6001600160a01b031661057b610da3565b6001600160a01b0316146105c4576040805162461bcd60e51b81526020600482018190526024820152600080516020611f79833981519152604482015290519081900360640190fd5b6105cc611736565b600a8190556040805182815290517f0c4d677eef92893ac7ec52faf8140fc6c851ab4736302b4f3a89dfb20696a0df9181900360200190a150565b60025481565b600e602052600090815260409020805460019091015482565b60065481565b601054610100900460ff1681565b60035481565b600f6020526000908152604090205481565b600454600160a81b900460ff16156106a7576040805162461bcd60e51b8152602060048201526013602482015272105b1c9958591e481a5b9a5d1a585b1a5e9959606a1b604482015290519081900360640190fd5b6004546001600160a01b031633146106f4576040805162461bcd60e51b815260206004820152600b60248201526a4e6f7420666163746f727960a81b604482015290519081900360640190fd5b6004805460ff60a81b1916600160a81b179055600d80546001600160a01b03808b166001600160a01b031992831617909255600c8054928a1692909116919091179055600a869055600785905560068490556002839055610755438461181d565b6003558115610777576004805460ff60a01b1916600160a01b17905560098290555b600c546040805163313ce56760e01b815290516000926001600160a01b03169163313ce567916004808301926020929190829003018186803b1580156107bc57600080fd5b505afa1580156107d0573d6000803e3d6000fd5b505050506040513d60208110156107e657600080fd5b505160ff169050601e811061083b576040805162461bcd60e51b815260206004820152601660248201527504d75737420626520696e666572696f7220746f2033360541b604482015290519081900360640190fd5b610846601e82611880565b600a0a600b5560075460085561085b826114c5565b505050505050505050565b600260015414156108be576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002600155336000908152600f60205260408120546108e057506003546108f2565b50336000908152600f60205260409020545b804310158061090357506006544310155b61093e5760405162461bcd60e51b8152600401808060200182810382526030815260200180611ea46030913960400191505060405180910390fd5b336000908152600e6020526040902080548311156109a3576040805162461bcd60e51b815260206004820152601b60248201527f416d6f756e7420746f20776974686472617720746f6f20686967680000000000604482015290519081900360640190fd5b6109ab611736565b60006109e082600101546109da600b546109d460055487600001546118dd90919063ffffffff16565b90611936565b90611880565b90508315610a0d5781546109f49085611880565b8255600d54610a0d906001600160a01b0316338661199d565b8015610a2a57600c54610a2a906001600160a01b0316338361199d565b600b546005548354610a4192916109d491906118dd565b600183015560408051858152905133917f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364919081900360200190a25050600180555050565b610a8e611732565b6001600160a01b0316610a9f610da3565b6001600160a01b031614610ae8576040805162461bcd60e51b81526020600482018190526024820152600080516020611f79833981519152604482015290519081900360640190fd5b600c54610aff906001600160a01b0316338361199d565b50565b600454600160a81b900460ff1681565b610b1a611732565b6001600160a01b0316610b2b610da3565b6001600160a01b031614610b74576040805162461bcd60e51b81526020600482018190526024820152600080516020611f79833981519152604482015290519081900360640190fd5b600c546001600160a01b0383811691161415610bd0576040805162461bcd60e51b815260206004820152601660248201527521b0b73737ba103132903932bbb0b932103a37b5b2b760511b604482015290519081900360640190fd5b610be46001600160a01b038316338361199d565b604080516001600160a01b03841681526020810183905281517f74545154aac348a3eac92596bd1971957ca94795f4e954ec5f613b55fab78129929181900390910190a15050565b6001600160a01b0381166000908152600f6020526040812054431115610c5457506000610c72565b506001600160a01b0381166000908152600f60205260409020544390035b919050565b60075481565b60095481565b60125481565b610c91611732565b6001600160a01b0316610ca2610da3565b6001600160a01b031614610ceb576040805162461bcd60e51b81526020600482018190526024820152600080516020611f79833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b610d3d611732565b6001600160a01b0316610d4e610da3565b6001600160a01b031614610d97576040805162461bcd60e51b81526020600482018190526024820152600080516020611f79833981519152604482015290519081900360640190fd5b43600655565b600a5481565b6000546001600160a01b031690565b60055481565b600454600160a01b900460ff1681565b610dd0611732565b6001600160a01b0316610de1610da3565b6001600160a01b031614610e2a576040805162461bcd60e51b81526020600482018190526024820152600080516020611f79833981519152604482015290519081900360640190fd5b6007544310610e73576040805162461bcd60e51b815260206004820152601060248201526f141bdbdb081a185cc81cdd185c9d195960821b604482015290519081900360640190fd5b808210610eb15760405162461bcd60e51b815260040180806020018281038252602e815260200180611ed4602e913960400191505060405180910390fd5b814310610eef5760405162461bcd60e51b8152600401808060200182810382526030815260200180611f286030913960400191505060405180910390fd5b600782905560068190556008829055604080518381526020810183905281517f7cd0ab87d19036f3dfadadb232c78aa4879dda3f0c994a9d637532410ee2ce06929181900390910190a15050565b610f45611732565b6001600160a01b0316610f56610da3565b6001600160a01b031614610f9f576040805162461bcd60e51b81526020600482018190526024820152600080516020611f79833981519152604482015290519081900360640190fd5b600454600160a01b900460ff16610feb576040805162461bcd60e51b815260206004820152600b60248201526a135d5cdd081899481cd95d60aa1b604482015290519081900360640190fd5b8115611051576009548111611047576040805162461bcd60e51b815260206004820152601860248201527f4e6577206c696d6974206d757374206265206869676865720000000000000000604482015290519081900360640190fd5b600981905561106e565b6004805460ff60a01b1916600160a01b8415150217905560006009555b60095460408051918252517f241f67ee5f41b7a5cabf911367329be7215900f602ebfc47f89dce2a6bcd847c9181900360200190a15050565b60085481565b60026001541415611105576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002600155336000908152600e60205260408120600454909190600160a01b900460ff161561119157600954825461113e90859061181d565b1115611191576040805162461bcd60e51b815260206004820152601760248201527f5573657220616d6f756e742061626f7665206c696d6974000000000000000000604482015290519081900360640190fd5b611199611736565b821561132f57600d54604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156111ea57600080fd5b505afa1580156111fe573d6000803e3d6000fd5b505050506040513d602081101561121457600080fd5b5051600d54604080516323b872dd60e01b81523360048201523060248201526044810188905290519293506001600160a01b03909116916323b872dd916064808201926020929091908290030181600087803b15801561127357600080fd5b505af1158015611287573d6000803e3d6000fd5b505050506040513d602081101561129d57600080fd5b5050600d54604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156112ea57600080fd5b505afa1580156112fe573d6000803e3d6000fd5b505050506040513d602081101561131457600080fd5b50518454838203945090915061132a908461181d565b845550505b61135861134d600b546109d4600554856118dd90919063ffffffff16565b60018401549061181d565b600183015560408051828152905133917fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c919081900360200190a261139b6119f4565b50506001805550565b6113ad33611a14565b565b6004546001600160a01b031681565b600d546001600160a01b031681565b600b5481565b60105460ff1681565b60026001541415611434576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026001908155336000908152600e6020526040812080548282559281019190915590801561147457600d54611474906001600160a01b0316338361199d565b8154604080519182525133917f5fafa99d0643513820be26656b45130b01e1c03062e1266bf36f88cbd3bd9695919081900360200190a2505060018055565b60136020526000908152604090205481565b6114cd611732565b6001600160a01b03166114de610da3565b6001600160a01b031614611527576040805162461bcd60e51b81526020600482018190526024820152600080516020611f79833981519152604482015290519081900360640190fd5b6001600160a01b03811661156c5760405162461bcd60e51b8152600401808060200182810382526026815260200180611e7e6026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038082166000908152600e60209081526040808320600d5482516370a0823160e01b8152306004820152925194959194869491909216926370a082319260248083019392829003018186803b15801561162657600080fd5b505afa15801561163a573d6000803e3d6000fd5b505050506040513d602081101561165057600080fd5b50516008549091504311801561166557508015155b156116ed57600061167860085443611b73565b90506000611691600a54836118dd90919063ffffffff16565b905060006116ba6116b1856109d4600b54866118dd90919063ffffffff16565b6005549061181d565b90506116e185600101546109da600b546109d4858a600001546118dd90919063ffffffff16565b95505050505050610c72565b61171482600101546109da600b546109d460055487600001546118dd90919063ffffffff16565b92505050610c72565b600c546001600160a01b031681565b60115481565b3390565b6008544311611744576113ad565b600d54604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561178f57600080fd5b505afa1580156117a3573d6000803e3d6000fd5b505050506040513d60208110156117b957600080fd5b50519050806117cc5750436008556113ad565b60006117da60085443611b73565b905060006117f3600a54836118dd90919063ffffffff16565b90506118116116b1846109d4600b54856118dd90919063ffffffff16565b60055550504360085550565b600082820183811015611877576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b90505b92915050565b6000828211156118d7576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6000826118ec5750600061187a565b828202828482816118f957fe5b04146118775760405162461bcd60e51b8152600401808060200182810382526021815260200180611f586021913960400191505060405180910390fd5b600080821161198c576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b81838161199557fe5b049392505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526119ef908490611bad565b505050565b600254611a0290439061181d565b336000908152600f6020526040902055565b6001600160a01b0381166000908152600e60205260409020611a34611736565b805415611b6f576000611a6482600101546109da600b546109d460055487600001546118dd90919063ffffffff16565b90508015611b12576001600160a01b0383166000908152600f6020526040812054611a925750600354611aad565b506001600160a01b0383166000908152600f60205260409020545b8043101580611abe57506006544310155b611af95760405162461bcd60e51b8152600401808060200182810382526039815260200180611f996039913960400191505060405180910390fd5b600c54611b10906001600160a01b0316858461199d565b505b600b546005548354611b2992916109d491906118dd565b60018301556040805182815290516001600160a01b038516917fba8de60c3403ec381d1d484652ea1980e3c3e56359195c92525bff4ce47ad98e919081900360200190a2505b5050565b60006006548211611b8f57611b888284611880565b905061187a565b6006548310611ba05750600061187a565b600654611b889084611880565b6060611c02826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611c5e9092919063ffffffff16565b8051909150156119ef57808060200190516020811015611c2157600080fd5b50516119ef5760405162461bcd60e51b815260040180806020018281038252602a815260200180611fd2602a913960400191505060405180910390fd5b6060611c6d8484600085611c77565b90505b9392505050565b606082471015611cb85760405162461bcd60e51b8152600401808060200182810382526026815260200180611f026026913960400191505060405180910390fd5b611cc185611dd3565b611d12576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b60208310611d515780518252601f199092019160209182019101611d32565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114611db3576040519150601f19603f3d011682016040523d82523d6000602084013e611db8565b606091505b5091509150611dc8828286611dd9565b979650505050505050565b3b151590565b60608315611de8575081611c70565b825115611df85782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611e42578181015183820152602001611e2a565b50505050905090810190601f168015611e6f5780820380516001836020036101000a031916815260200191505b509250505060405180910390fdfe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734c6f636b207374696c6c20696e206166666563742c206f7220706f6f6c20686173206e6f7420656e646564207965742e4e6577207374617274426c6f636b206d757374206265206c6f776572207468616e206e657720656e64426c6f636b416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c4e6577207374617274426c6f636b206d75737420626520686967686572207468616e2063757272656e7420626c6f636b536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65724c6f636b2074696d6520686173206e6f7420657870697265642c206f722074686520706f6f6c20686173206e6f7420656e646564207965742e5361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a26469706673582212205170c77f5ba904b217929fe091f4ad08dfa67cb616633e5d1e0ef8274032134864736f6c634300060c00334f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a2646970667358221220d2ead7905a1417a276806dd715d4ee8d9307896147e04604bcfecbf52cd2a9db64736f6c634300060c0033
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061004c5760003560e01c8063715018a6146100515780638da5cb5b1461005b578063bbc22f501461007f578063f2fde38b146100d4575b600080fd5b6100596100fa565b005b6100636101b8565b604080516001600160a01b039092168252519081900360200190f35b610059600480360361010081101561009657600080fd5b506001600160a01b038135811691602081013582169160408201359160608101359160808201359160a08101359160c08201359160e00135166101c7565b610059600480360360208110156100ea57600080fd5b50356001600160a01b03166104e8565b6101026105fc565b6001600160a01b03166101136101b8565b6001600160a01b03161461016e576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b6101cf6105fc565b6001600160a01b03166101e06101b8565b6001600160a01b03161461023b576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6000886001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561027657600080fd5b505afa15801561028a573d6000803e3d6000fd5b505050506040513d60208110156102a057600080fd5b505110156102ad57600080fd5b6000876001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156102e857600080fd5b505afa1580156102fc573d6000803e3d6000fd5b505050506040513d602081101561031257600080fd5b5051101561031f57600080fd5b866001600160a01b0316886001600160a01b03161415610386576040805162461bcd60e51b815260206004820152601b60248201527f546f6b656e73206d75737420626520626520646966666572656e740000000000604482015290519081900360640190fd5b60606040518060200161039890610600565b6020820181038252601f19601f820116604052509050600089898860405160200180846001600160a01b031660601b8152601401836001600160a01b031660601b815260140182815260200193505050506040516020818303038152906040528051906020012090506000818351602085016000f560408051632aa2c38160e01b81526001600160a01b038e811660048301528d81166024830152604482018d9052606482018c9052608482018b905260a482018a905260c4820189905287811660e4830152915192935090831691632aa2c381916101048082019260009290919082900301818387803b15801561048f57600080fd5b505af11580156104a3573d6000803e3d6000fd5b50506040516001600160a01b03841692507fe0d103a92c6ff6c4aceb49d436f4028e0deb4884fdbcb9f32b03045eabb44a6c9150600090a25050505050505050505050565b6104f06105fc565b6001600160a01b03166105016101b8565b6001600160a01b03161461055c576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b0381166105a15760405162461bcd60e51b81526004018080602001828103825260268152602001806126ea6026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b3390565b6120dc8061060e8339019056fe60806040526010805461ff001960ff199091166001171661010017905534801561002857600080fd5b506000610033610098565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35060018055600480546001600160a01b0319163317905561009c565b3390565b612031806100ab6000396000f3fe608060405234801561001057600080fd5b50600436106102275760003560e01c80638ae39cac11610130578063bd617191116100b8578063e8eb2c6f1161007c578063e8eb2c6f146104e0578063f2fde38b14610506578063f40f0f521461052c578063f7c618c114610552578063f95e6fb91461055a57610227565b8063bd617191146104b8578063cc7a262e146104c0578063ccd34cd5146104c8578063cdafbad1146104d0578063db2e21bc146104d857610227565b80639513997f116100ff5780639513997f14610443578063a0b4090514610466578063a9f8d1811461048b578063b6b55f2514610493578063b88a802f146104b057610227565b80638ae39cac146104075780638da5cb5b1461040f5780638f6629151461043357806392e8990e1461043b57610227565b80633279beab116101b357806348cd4cb11161018257806348cd4cb1146103df57806366fe9f8a146103e7578063702b2f34146103ef578063715018a6146103f757806380dc0672146103ff57610227565b80633279beab14610368578063392e53cd146103855780633f138d4b1461038d57806347304494146103b957610227565b80631ec64f62116101fa5780631ec64f62146102ac5780632636aedf146102c857806328449fa7146102d05780632aa2c381146102f65780632e1a7d4d1461034b57610227565b806301f8a9761461022c5780630d6680871461024b5780631959a002146102655780631aed6553146102a4575b600080fd5b6102496004803603602081101561024257600080fd5b5035610562565b005b610253610607565b60408051918252519081900360200190f35b61028b6004803603602081101561027b57600080fd5b50356001600160a01b031661060d565b6040805192835260208301919091528051918290030190f35b610253610626565b6102b461062c565b604080519115158252519081900360200190f35b61025361063a565b610253600480360360208110156102e657600080fd5b50356001600160a01b0316610640565b610249600480360361010081101561030d57600080fd5b506001600160a01b038135811691602081013582169160408201359160608101359160808201359160a08101359160c08201359160e0013516610652565b6102496004803603602081101561036157600080fd5b5035610866565b6102496004803603602081101561037e57600080fd5b5035610a86565b6102b4610b02565b610249600480360360408110156103a357600080fd5b506001600160a01b038135169060200135610b12565b610253600480360360208110156103cf57600080fd5b50356001600160a01b0316610c2c565b610253610c77565b610253610c7d565b610253610c83565b610249610c89565b610249610d35565b610253610d9d565b610417610da3565b604080516001600160a01b039092168252519081900360200190f35b610253610db2565b6102b4610db8565b6102496004803603604081101561045957600080fd5b5080359060200135610dc8565b6102496004803603604081101561047c57600080fd5b50803515159060200135610f3d565b6102536110a7565b610249600480360360208110156104a957600080fd5b50356110ad565b6102496113a4565b6104176113af565b6104176113be565b6102536113cd565b6102b46113d3565b6102496113dc565b610253600480360360208110156104f657600080fd5b50356001600160a01b03166114b3565b6102496004803603602081101561051c57600080fd5b50356001600160a01b03166114c5565b6102536004803603602081101561054257600080fd5b50356001600160a01b03166115c7565b61041761171d565b61025361172c565b61056a611732565b6001600160a01b031661057b610da3565b6001600160a01b0316146105c4576040805162461bcd60e51b81526020600482018190526024820152600080516020611f79833981519152604482015290519081900360640190fd5b6105cc611736565b600a8190556040805182815290517f0c4d677eef92893ac7ec52faf8140fc6c851ab4736302b4f3a89dfb20696a0df9181900360200190a150565b60025481565b600e602052600090815260409020805460019091015482565b60065481565b601054610100900460ff1681565b60035481565b600f6020526000908152604090205481565b600454600160a81b900460ff16156106a7576040805162461bcd60e51b8152602060048201526013602482015272105b1c9958591e481a5b9a5d1a585b1a5e9959606a1b604482015290519081900360640190fd5b6004546001600160a01b031633146106f4576040805162461bcd60e51b815260206004820152600b60248201526a4e6f7420666163746f727960a81b604482015290519081900360640190fd5b6004805460ff60a81b1916600160a81b179055600d80546001600160a01b03808b166001600160a01b031992831617909255600c8054928a1692909116919091179055600a869055600785905560068490556002839055610755438461181d565b6003558115610777576004805460ff60a01b1916600160a01b17905560098290555b600c546040805163313ce56760e01b815290516000926001600160a01b03169163313ce567916004808301926020929190829003018186803b1580156107bc57600080fd5b505afa1580156107d0573d6000803e3d6000fd5b505050506040513d60208110156107e657600080fd5b505160ff169050601e811061083b576040805162461bcd60e51b815260206004820152601660248201527504d75737420626520696e666572696f7220746f2033360541b604482015290519081900360640190fd5b610846601e82611880565b600a0a600b5560075460085561085b826114c5565b505050505050505050565b600260015414156108be576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002600155336000908152600f60205260408120546108e057506003546108f2565b50336000908152600f60205260409020545b804310158061090357506006544310155b61093e5760405162461bcd60e51b8152600401808060200182810382526030815260200180611ea46030913960400191505060405180910390fd5b336000908152600e6020526040902080548311156109a3576040805162461bcd60e51b815260206004820152601b60248201527f416d6f756e7420746f20776974686472617720746f6f20686967680000000000604482015290519081900360640190fd5b6109ab611736565b60006109e082600101546109da600b546109d460055487600001546118dd90919063ffffffff16565b90611936565b90611880565b90508315610a0d5781546109f49085611880565b8255600d54610a0d906001600160a01b0316338661199d565b8015610a2a57600c54610a2a906001600160a01b0316338361199d565b600b546005548354610a4192916109d491906118dd565b600183015560408051858152905133917f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364919081900360200190a25050600180555050565b610a8e611732565b6001600160a01b0316610a9f610da3565b6001600160a01b031614610ae8576040805162461bcd60e51b81526020600482018190526024820152600080516020611f79833981519152604482015290519081900360640190fd5b600c54610aff906001600160a01b0316338361199d565b50565b600454600160a81b900460ff1681565b610b1a611732565b6001600160a01b0316610b2b610da3565b6001600160a01b031614610b74576040805162461bcd60e51b81526020600482018190526024820152600080516020611f79833981519152604482015290519081900360640190fd5b600c546001600160a01b0383811691161415610bd0576040805162461bcd60e51b815260206004820152601660248201527521b0b73737ba103132903932bbb0b932103a37b5b2b760511b604482015290519081900360640190fd5b610be46001600160a01b038316338361199d565b604080516001600160a01b03841681526020810183905281517f74545154aac348a3eac92596bd1971957ca94795f4e954ec5f613b55fab78129929181900390910190a15050565b6001600160a01b0381166000908152600f6020526040812054431115610c5457506000610c72565b506001600160a01b0381166000908152600f60205260409020544390035b919050565b60075481565b60095481565b60125481565b610c91611732565b6001600160a01b0316610ca2610da3565b6001600160a01b031614610ceb576040805162461bcd60e51b81526020600482018190526024820152600080516020611f79833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b610d3d611732565b6001600160a01b0316610d4e610da3565b6001600160a01b031614610d97576040805162461bcd60e51b81526020600482018190526024820152600080516020611f79833981519152604482015290519081900360640190fd5b43600655565b600a5481565b6000546001600160a01b031690565b60055481565b600454600160a01b900460ff1681565b610dd0611732565b6001600160a01b0316610de1610da3565b6001600160a01b031614610e2a576040805162461bcd60e51b81526020600482018190526024820152600080516020611f79833981519152604482015290519081900360640190fd5b6007544310610e73576040805162461bcd60e51b815260206004820152601060248201526f141bdbdb081a185cc81cdd185c9d195960821b604482015290519081900360640190fd5b808210610eb15760405162461bcd60e51b815260040180806020018281038252602e815260200180611ed4602e913960400191505060405180910390fd5b814310610eef5760405162461bcd60e51b8152600401808060200182810382526030815260200180611f286030913960400191505060405180910390fd5b600782905560068190556008829055604080518381526020810183905281517f7cd0ab87d19036f3dfadadb232c78aa4879dda3f0c994a9d637532410ee2ce06929181900390910190a15050565b610f45611732565b6001600160a01b0316610f56610da3565b6001600160a01b031614610f9f576040805162461bcd60e51b81526020600482018190526024820152600080516020611f79833981519152604482015290519081900360640190fd5b600454600160a01b900460ff16610feb576040805162461bcd60e51b815260206004820152600b60248201526a135d5cdd081899481cd95d60aa1b604482015290519081900360640190fd5b8115611051576009548111611047576040805162461bcd60e51b815260206004820152601860248201527f4e6577206c696d6974206d757374206265206869676865720000000000000000604482015290519081900360640190fd5b600981905561106e565b6004805460ff60a01b1916600160a01b8415150217905560006009555b60095460408051918252517f241f67ee5f41b7a5cabf911367329be7215900f602ebfc47f89dce2a6bcd847c9181900360200190a15050565b60085481565b60026001541415611105576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002600155336000908152600e60205260408120600454909190600160a01b900460ff161561119157600954825461113e90859061181d565b1115611191576040805162461bcd60e51b815260206004820152601760248201527f5573657220616d6f756e742061626f7665206c696d6974000000000000000000604482015290519081900360640190fd5b611199611736565b821561132f57600d54604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156111ea57600080fd5b505afa1580156111fe573d6000803e3d6000fd5b505050506040513d602081101561121457600080fd5b5051600d54604080516323b872dd60e01b81523360048201523060248201526044810188905290519293506001600160a01b03909116916323b872dd916064808201926020929091908290030181600087803b15801561127357600080fd5b505af1158015611287573d6000803e3d6000fd5b505050506040513d602081101561129d57600080fd5b5050600d54604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156112ea57600080fd5b505afa1580156112fe573d6000803e3d6000fd5b505050506040513d602081101561131457600080fd5b50518454838203945090915061132a908461181d565b845550505b61135861134d600b546109d4600554856118dd90919063ffffffff16565b60018401549061181d565b600183015560408051828152905133917fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c919081900360200190a261139b6119f4565b50506001805550565b6113ad33611a14565b565b6004546001600160a01b031681565b600d546001600160a01b031681565b600b5481565b60105460ff1681565b60026001541415611434576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026001908155336000908152600e6020526040812080548282559281019190915590801561147457600d54611474906001600160a01b0316338361199d565b8154604080519182525133917f5fafa99d0643513820be26656b45130b01e1c03062e1266bf36f88cbd3bd9695919081900360200190a2505060018055565b60136020526000908152604090205481565b6114cd611732565b6001600160a01b03166114de610da3565b6001600160a01b031614611527576040805162461bcd60e51b81526020600482018190526024820152600080516020611f79833981519152604482015290519081900360640190fd5b6001600160a01b03811661156c5760405162461bcd60e51b8152600401808060200182810382526026815260200180611e7e6026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038082166000908152600e60209081526040808320600d5482516370a0823160e01b8152306004820152925194959194869491909216926370a082319260248083019392829003018186803b15801561162657600080fd5b505afa15801561163a573d6000803e3d6000fd5b505050506040513d602081101561165057600080fd5b50516008549091504311801561166557508015155b156116ed57600061167860085443611b73565b90506000611691600a54836118dd90919063ffffffff16565b905060006116ba6116b1856109d4600b54866118dd90919063ffffffff16565b6005549061181d565b90506116e185600101546109da600b546109d4858a600001546118dd90919063ffffffff16565b95505050505050610c72565b61171482600101546109da600b546109d460055487600001546118dd90919063ffffffff16565b92505050610c72565b600c546001600160a01b031681565b60115481565b3390565b6008544311611744576113ad565b600d54604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561178f57600080fd5b505afa1580156117a3573d6000803e3d6000fd5b505050506040513d60208110156117b957600080fd5b50519050806117cc5750436008556113ad565b60006117da60085443611b73565b905060006117f3600a54836118dd90919063ffffffff16565b90506118116116b1846109d4600b54856118dd90919063ffffffff16565b60055550504360085550565b600082820183811015611877576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b90505b92915050565b6000828211156118d7576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6000826118ec5750600061187a565b828202828482816118f957fe5b04146118775760405162461bcd60e51b8152600401808060200182810382526021815260200180611f586021913960400191505060405180910390fd5b600080821161198c576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b81838161199557fe5b049392505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526119ef908490611bad565b505050565b600254611a0290439061181d565b336000908152600f6020526040902055565b6001600160a01b0381166000908152600e60205260409020611a34611736565b805415611b6f576000611a6482600101546109da600b546109d460055487600001546118dd90919063ffffffff16565b90508015611b12576001600160a01b0383166000908152600f6020526040812054611a925750600354611aad565b506001600160a01b0383166000908152600f60205260409020545b8043101580611abe57506006544310155b611af95760405162461bcd60e51b8152600401808060200182810382526039815260200180611f996039913960400191505060405180910390fd5b600c54611b10906001600160a01b0316858461199d565b505b600b546005548354611b2992916109d491906118dd565b60018301556040805182815290516001600160a01b038516917fba8de60c3403ec381d1d484652ea1980e3c3e56359195c92525bff4ce47ad98e919081900360200190a2505b5050565b60006006548211611b8f57611b888284611880565b905061187a565b6006548310611ba05750600061187a565b600654611b889084611880565b6060611c02826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611c5e9092919063ffffffff16565b8051909150156119ef57808060200190516020811015611c2157600080fd5b50516119ef5760405162461bcd60e51b815260040180806020018281038252602a815260200180611fd2602a913960400191505060405180910390fd5b6060611c6d8484600085611c77565b90505b9392505050565b606082471015611cb85760405162461bcd60e51b8152600401808060200182810382526026815260200180611f026026913960400191505060405180910390fd5b611cc185611dd3565b611d12576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b60208310611d515780518252601f199092019160209182019101611d32565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114611db3576040519150601f19603f3d011682016040523d82523d6000602084013e611db8565b606091505b5091509150611dc8828286611dd9565b979650505050505050565b3b151590565b60608315611de8575081611c70565b825115611df85782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611e42578181015183820152602001611e2a565b50505050905090810190601f168015611e6f5780820380516001836020036101000a031916815260200191505b509250505060405180910390fdfe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734c6f636b207374696c6c20696e206166666563742c206f7220706f6f6c20686173206e6f7420656e646564207965742e4e6577207374617274426c6f636b206d757374206265206c6f776572207468616e206e657720656e64426c6f636b416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c4e6577207374617274426c6f636b206d75737420626520686967686572207468616e2063757272656e7420626c6f636b536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65724c6f636b2074696d6520686173206e6f7420657870697265642c206f722074686520706f6f6c20686173206e6f7420656e646564207965742e5361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a26469706673582212205170c77f5ba904b217929fe091f4ad08dfa67cb616633e5d1e0ef8274032134864736f6c634300060c00334f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a2646970667358221220d2ead7905a1417a276806dd715d4ee8d9307896147e04604bcfecbf52cd2a9db64736f6c634300060c0033
Deployed Bytecode Sourcemap
43005:1792:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2833:148;;;:::i;:::-;;2182:87;;;:::i;:::-;;;;-1:-1:-1;;;;;2182:87:0;;;;;;;;;;;;;;43640:1154;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;43640:1154:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;3136:244::-;;;;;;;;;;;;;;;;-1:-1:-1;3136:244:0;-1:-1:-1;;;;;3136:244:0;;:::i;2833:148::-;2413:12;:10;:12::i;:::-;-1:-1:-1;;;;;2402:23:0;:7;:5;:7::i;:::-;-1:-1:-1;;;;;2402:23:0;;2394:68;;;;;-1:-1:-1;;;2394:68:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2940:1:::1;2924:6:::0;;2903:40:::1;::::0;-1:-1:-1;;;;;2924:6:0;;::::1;::::0;2903:40:::1;::::0;2940:1;;2903:40:::1;2971:1;2954:19:::0;;-1:-1:-1;;;;;;2954:19:0::1;::::0;;2833:148::o;2182:87::-;2228:7;2255:6;-1:-1:-1;;;;;2255:6:0;2182:87;:::o;43640:1154::-;2413:12;:10;:12::i;:::-;-1:-1:-1;;;;;2402:23:0;:7;:5;:7::i;:::-;-1:-1:-1;;;;;2402:23:0;;2394:68;;;;;-1:-1:-1;;;2394:68:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;43981:1:::1;43951:12;-1:-1:-1::0;;;;;43951:24:0::1;;:26;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;::::0;::::1;;-1:-1:-1::0;43951:26:0;:31:::1;;43943:40;;;::::0;::::1;;44032:1;44002:12;-1:-1:-1::0;;;;;44002:24:0::1;;:26;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;::::0;::::1;;-1:-1:-1::0;44002:26:0;:31:::1;;43994:40;;;::::0;::::1;;44069:12;-1:-1:-1::0;;;;;44053:28:0::1;:12;-1:-1:-1::0;;;;;44053:28:0::1;;;44045:68;;;::::0;;-1:-1:-1;;;44045:68:0;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;::::1;::::0;;;;;;;;;;;;;::::1;;44126:21;44150:41;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;44126:65;;44202:12;44244;44258;44272:11;44227:57;;;;;;-1:-1:-1::0;;;;;44227:57:0::1;;;;;;;;-1:-1:-1::0;;;;;44227:57:0::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;44217:68;;;;;;44202:83;;44296:24;44424:4;44413:8;44407:15;44402:2;44392:8;44388:17;44385:1;44377:52;44452:278;::::0;;-1:-1:-1;;;44452:278:0;;-1:-1:-1;;;;;44452:278:0;;::::1;;::::0;::::1;::::0;;;::::1;::::0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::1;::::0;;;;;;44357:72;;-1:-1:-1;44452:51:0;;::::1;::::0;::::1;::::0;:278;;;;;-1:-1:-1;;44452:278:0;;;;;;;;-1:-1:-1;44452:51:0;:278;::::1;;::::0;::::1;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;-1:-1:-1::0;;44748:38:0::1;::::0;-1:-1:-1;;;;;44748:38:0;::::1;::::0;-1:-1:-1;44748:38:0::1;::::0;-1:-1:-1;44748:38:0;;::::1;2473:1;;;43640:1154:::0;;;;;;;;:::o;3136:244::-;2413:12;:10;:12::i;:::-;-1:-1:-1;;;;;2402:23:0;:7;:5;:7::i;:::-;-1:-1:-1;;;;;2402:23:0;;2394:68;;;;;-1:-1:-1;;;2394:68:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;3225:22:0;::::1;3217:73;;;;-1:-1:-1::0;;;3217:73:0::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3327:6;::::0;;3306:38:::1;::::0;-1:-1:-1;;;;;3306:38:0;;::::1;::::0;3327:6;::::1;::::0;3306:38:::1;::::0;::::1;3355:6;:17:::0;;-1:-1:-1;;;;;;3355:17:0::1;-1:-1:-1::0;;;;;3355:17:0;;;::::1;::::0;;;::::1;::::0;;3136:244::o;730:106::-;818:10;730:106;:::o;-1:-1:-1:-;;;;;;;;:::o
Swarm Source
ipfs://d2ead7905a1417a276806dd715d4ee8d9307896147e04604bcfecbf52cd2a9db
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 27 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
[ 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.