Source Code
Latest 25 from a total of 1,150 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Withdraw | 24435875 | 3 days ago | IN | 0 ETH | 0.00005007 | ||||
| Deposit | 24435164 | 3 days ago | IN | 0 ETH | 0.00003537 | ||||
| Withdraw | 24354082 | 14 days ago | IN | 0 ETH | 0.00002155 | ||||
| Taker Withdraw | 24354067 | 14 days ago | IN | 0 ETH | 0.00001623 | ||||
| Withdraw | 24270976 | 26 days ago | IN | 0 ETH | 0.00001575 | ||||
| Withdraw | 24268698 | 26 days ago | IN | 0 ETH | 0.00001297 | ||||
| Withdraw | 24267765 | 26 days ago | IN | 0 ETH | 0.00000828 | ||||
| Withdraw | 24267417 | 26 days ago | IN | 0 ETH | 0.0000068 | ||||
| Withdraw | 24267415 | 26 days ago | IN | 0 ETH | 0.00000706 | ||||
| Withdraw | 24267412 | 26 days ago | IN | 0 ETH | 0.00000669 | ||||
| Withdraw | 24267409 | 26 days ago | IN | 0 ETH | 0.00000963 | ||||
| Withdraw | 24267390 | 26 days ago | IN | 0 ETH | 0.00000591 | ||||
| Withdraw | 24267385 | 26 days ago | IN | 0 ETH | 0.00000677 | ||||
| Withdraw | 24267382 | 26 days ago | IN | 0 ETH | 0.00000674 | ||||
| Withdraw | 24267379 | 26 days ago | IN | 0 ETH | 0.0000076 | ||||
| Withdraw | 24267376 | 26 days ago | IN | 0 ETH | 0.00000707 | ||||
| Withdraw | 24267374 | 26 days ago | IN | 0 ETH | 0.00000831 | ||||
| Withdraw | 24267344 | 26 days ago | IN | 0 ETH | 0.00000762 | ||||
| Withdraw | 24267340 | 26 days ago | IN | 0 ETH | 0.00000756 | ||||
| Withdraw | 24267336 | 26 days ago | IN | 0 ETH | 0.00001876 | ||||
| Withdraw | 24267332 | 26 days ago | IN | 0 ETH | 0.00001088 | ||||
| Withdraw | 24267329 | 26 days ago | IN | 0 ETH | 0.00000969 | ||||
| Withdraw | 24267326 | 26 days ago | IN | 0 ETH | 0.00000956 | ||||
| Withdraw | 24267323 | 26 days ago | IN | 0 ETH | 0.00000663 | ||||
| Withdraw | 24267320 | 26 days ago | IN | 0 ETH | 0.00000682 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
MasterChef
Compiler Version
v0.8.31+commit.fd3a2265
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
function decimals() external view returns (uint8);
/**
* @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);
function mint(address _to, uint256 _amount) external;
function reward(address user, 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
);
}
/**
* @dev 封装了 Solidity 的算术运算并添加了溢出检查。
*
* Solidity 中的算术运算会溢出溢出。
* 这很容易导致错误,因为程序员通常因为溢出会引发错误,这是高级编程语言中的普遍情况。
* “SafeMath”通过在操作溢出时恢复事务来恢复这种直觉。
*
* 使用这个库而不是未经检查的操作可以消除一整类错误,因此建议始终使用它。
*/
library SafeMath {
/**
* @dev 返回两个无符号整数的相加,在溢出时恢复。
*
* 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 返回两个无符号整数相除的余数。 (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;
}
}
/**
* @dev 地址类型相关函数集合
*/
library Address {
/**
* @dev 如果 `account` 是合约,则返回 true。
*
* [IMPORTANT]
* ====
* 假设此函数返回 false 的地址是外部账户 (EOA) 而不是合约是不安全的。
*
* 其中,对于以下类型的地址,`isContract` 将返回 false:
*
* - 外部账户
* - 施工合约
* - 将创建合约的地址
* - 合约存在但被销毁的地址
* ====
*/
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 替代 Solidity 的 `transfer`:将 `amount` wei 发送给 `recipient`,
* 转发所有可用的 gas 并在出现错误时恢复。
*
* 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);
}
}
}
}
/**
* @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 已弃用。
* 此函数存在与 {IERC20-approve} 中发现的问题类似的问题,不鼓励使用。
*
* 如果可能,请改用 {safeIncreaseAllowance} 和 {safeDecreaseAllowance}。
*/
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"
);
}
}
}
/*
* @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 payable(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;
}
}
/**
* @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() {
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;
}
}
/**
* @dev Uniswap V2 Router Interface
*/
interface IUniswapV2Router02 {
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function getAmountsOut(
uint amountIn,
address[] calldata path
) external view returns (uint[] memory amounts);
function getAmountsIn(
uint amountOut,
address[] calldata path
) external view returns (uint[] memory amounts);
function WETH() external pure returns (address);
}
// 请注意,它是可拥有的,并且拥有者拥有巨大的权力。
// 一旦 SUSHI 被充分分配并且社区可以表现出自我管理,所有权将转移到治理智能合约。
//
contract MasterChef is Ownable {
using SafeMath for uint256;
using SafeERC20 for IERC20;
// 每个用户的信息。
struct UserInfo {
uint256 amount; // 用户提供了多少 LP 代币。
uint256 rewardDebt; // 用户已经获取的奖励
uint256 totalReward; // 累计获得的奖励
}
//
// 我们在这里做一些花哨的数学运算。
// 基本上,在任何时间点,有权授予用户但待分配的 SUSHI 数量为:
//
// pending reward = (user.amount * pool.accSushiPerShare) - user.rewardDebt
//
// 每当用户将 LP 代币存入或提取到池中时。这是发生的事情:
// 1. 池的 `accSushiPerShare`(和 `lastRewardBlock`)得到更新。
// 2. 用户收到发送到他/她的地址的待处理奖励。
// 3. 用户的“金额”得到更新。
// 4. 用户的“rewardDebt”得到更新。
// 每个池的信息。
struct PoolInfo {
IERC20 lpToken; // LP 代币合约地址。
uint256 decimals; // LP 代币的精度
uint256 totalPower;
uint256 allocPoint; // 分配给此池的分配点数。 SUSHI 分配每个块。
uint256 lastRewardTime; // SUSHI 分配发生的最后一个块号。
uint256 accSushiPerShare; // 质押一个LPToken的全局收益
uint256 hourlyDepositLimit; // 每小时存款金额上限
uint256 currentHour; // 当前统计的小时
uint256 depositedThisHour; // 当前小时累计的存款额
}
// The SUSHI TOKEN!
IERC20 public token;
IERC20 public buyToken = IERC20(0xdAC17F958D2ee523a2206206994597C13D831ec7); // 中间代币,用于LP→奖励代币的兑换路径
// Uniswap V2 Router for buying tokens
IUniswapV2Router02 public uniswapRouter =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uint256 public powerPerPrice = 1e18; // 1 Power的价格
uint256 public lastPriceUpdateTime; // 上次更新价格的时间
uint256 public depreciationPerDayBps = 30; // 0.3% = 30/10000
uint256 public constant PRICE_DENOMINATOR = 10000;
uint256 public inviteRewardRate = 200; // 邀请奖励比例 200/10000 = 2%
uint256 public fundRate = 800; // 基金比例 800/10000 = 8%
address public fundAddress; // 基金地址
mapping(address => address) public inviter; //邀请人
mapping(address => uint256) public inviteCount; //邀请人好友数
mapping(address => uint256) public totalInviteReward; //累计奖励
// 每个池的信息。
PoolInfo[] public poolInfo;
// 每个持有 LP 代币的用户的信息。
mapping(uint256 => mapping(address => UserInfo)) public userInfo;
mapping(address => uint256) public Pid;
// 总分配点数。 必须是所有池中所有分配点的总和。
uint256 public totalAllocPoint = 0;
// SUSHI 挖矿开始时的时间戳。
uint256 public startTime;
event Deposit(
address indexed user,
uint256 indexed pid,
uint256 amount,
uint256 powerAmount
);
event Withdraw(
address indexed user,
uint256 indexed pid,
uint256 amount,
uint256 powerAmount
);
event EmergencyWithdraw(
address indexed user,
uint256 indexed pid,
uint256 amount,
uint256 powerAmount
);
event BindInviter(address indexed user, address indexed inviter);
event InviteReward(
uint256 indexed pid,
address indexed user,
address indexed inviter,
uint256 amount
);
event TakeUserReward(
uint256 indexed pid,
address indexed user,
uint256 amount
);
event RewardDistributed(
uint256 indexed pid,
uint256 rewardAmount,
uint256 timestamp
);
event HourlyDepositLimitUpdated(
uint256 indexed pid,
uint256 hourlyLimit
);
constructor(address _token, uint256 _startTime, address _fundAddress) {
token = IERC20(_token);
startTime = _startTime;
fundAddress = _fundAddress;
lastPriceUpdateTime = startTime;
}
function setFundAddress(address _fundAddress) external onlyOwner {
require(_fundAddress != address(0), "Invalid fund address");
fundAddress = _fundAddress;
}
function poolLength() external view returns (uint256) {
return poolInfo.length;
}
// 将新的 lp 添加到池中。 只能由所有者调用。
// XXX 不要多次添加相同的 LP 令牌。 如果你这样做,奖励会被搞砸。
// _allocPoint 分配点
// _withUpdate 是否马上更新所有池的奖励变量。 小心汽油消费!
function add(uint256 _allocPoint, IERC20 _lpToken) public onlyOwner {
require(Pid[address(_lpToken)] == 0); //防呆,避免重复添加池
uint256 lastRewardTime = block.timestamp > startTime
? block.timestamp
: startTime;
totalAllocPoint = totalAllocPoint.add(_allocPoint);
poolInfo.push(
PoolInfo({
lpToken: _lpToken,
decimals: 10 ** _lpToken.decimals(),
allocPoint: _allocPoint,
lastRewardTime: lastRewardTime,
accSushiPerShare: 0,
totalPower: 0,
hourlyDepositLimit: 10 ** _lpToken.decimals() * 10000,
currentHour: 0,
depositedThisHour: 0
})
);
_lpToken.safeApprove(address(uniswapRouter), type(uint256).max);
Pid[address(_lpToken)] = poolInfo.length;
}
// 更新给定池的 token 分配点。 只能由所有者调用。
function set(uint256 _pid, uint256 _allocPoint) public onlyOwner {
totalAllocPoint = totalAllocPoint.sub(poolInfo[_pid].allocPoint).add(
_allocPoint
);
poolInfo[_pid].allocPoint = _allocPoint;
poolInfo[_pid].lpToken.safeApprove(address(uniswapRouter), 0);
poolInfo[_pid].lpToken.safeApprove(
address(uniswapRouter),
type(uint256).max
);
}
function setHourlyDepositLimit(uint256 _pid, uint256 _hourlyLimit) external onlyOwner {
poolInfo[_pid].hourlyDepositLimit = _hourlyLimit;
emit HourlyDepositLimitUpdated(_pid, _hourlyLimit);
}
// 查看功能以查看前端待处理的 SUSHI。
function pendingSushi(
uint256 _pid,
address _user
) external view returns (uint256) {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][_user];
uint256 accSushiPerShare = pool.accSushiPerShare;
return user.amount.mul(accSushiPerShare).div(1e12).sub(user.rewardDebt);
}
function bindInviter(address _inviter) external {
require(inviter[msg.sender] == address(0), "Already bound");
require(_inviter != address(0), "Invalid inviter");
require(
inviter[_inviter] != msg.sender,
"Inviter cannot be same as user"
);
require(
_inviter == address(this) || inviter[_inviter] != address(0),
"Invalid inviter"
); //邀请人不能为空
require(_inviter != msg.sender, "Inviter cannot be self");
inviter[msg.sender] = _inviter;
inviteCount[_inviter] += 1;
emit BindInviter(msg.sender, _inviter);
}
function updatePrice(uint256 _pid) public {
if (block.timestamp < lastPriceUpdateTime + 300) return;
uint256 elapsed = block.timestamp - lastPriceUpdateTime;
// 每秒线性摊:powerPerPrice += powerPerPrice * (bps/天) * 秒数 / 86400
uint256 delta = (powerPerPrice * depreciationPerDayBps * elapsed) /
(PRICE_DENOMINATOR * 86400);
if (delta > 0) {
powerPerPrice += delta;
lastPriceUpdateTime = block.timestamp;
}
//每5分钟奖励一次
PoolInfo storage pool = poolInfo[_pid];
if (block.timestamp - pool.lastRewardTime >= 300) {
reward(_pid);
}
}
function _syncHourlyDeposit(PoolInfo storage pool) internal {
uint256 currentHour = block.timestamp / 1 hours;
if (pool.currentHour != currentHour) {
pool.currentHour = currentHour;
pool.depositedThisHour = 0;
}
}
function _reduceHourlyDeposit(PoolInfo storage pool, uint256 amount) internal {
if (amount == 0) {
return;
}
_syncHourlyDeposit(pool);
if (pool.depositedThisHour > amount) {
pool.depositedThisHour = pool.depositedThisHour.sub(amount);
} else {
pool.depositedThisHour = 0;
}
}
// 将 LP 代币存入 MasterChef 以分配 SUSHI。
function deposit(uint256 _pid, uint256 _amount) public {
require(_amount > 0, "Invalid amount");
require(inviter[msg.sender] != address(0), "must bind inviter");
updatePrice(_pid);
PoolInfo storage pool = poolInfo[_pid];
_syncHourlyDeposit(pool);
uint256 poolTotalAmount = (pool.totalPower * pool.decimals) /
powerPerPrice;
uint256 newHourlyTotal = pool.depositedThisHour.add(_amount);
uint256 poolOnePercent = poolTotalAmount / 100;
require(
newHourlyTotal <= pool.hourlyDepositLimit ||
newHourlyTotal <= poolOnePercent,
"deposit exceeds hourly limit"
);
pool.depositedThisHour = newHourlyTotal;
UserInfo storage user = userInfo[_pid][msg.sender];
if (user.amount > 0) {
uint256 pending = user
.amount
.mul(pool.accSushiPerShare)
.div(1e12)
.sub(user.rewardDebt);
_processUserRewardAndFee(_pid, pending, msg.sender);
}
pool.lpToken.safeTransferFrom(
address(msg.sender),
address(this),
_amount
);
// 更新矿池总算力
uint256 powerAmount = (_amount * powerPerPrice) / pool.decimals;
pool.totalPower = pool.totalPower.add(powerAmount);
user.amount = user.amount.add(powerAmount);
user.rewardDebt = user.amount.mul(pool.accSushiPerShare).div(1e12);
emit Deposit(msg.sender, _pid, _amount, powerAmount);
}
// 从 MasterChef 中提现 LP 代币。
function withdraw(uint256 _pid, uint256 _powerAmount) public {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][msg.sender];
require(_powerAmount > 0, "Invalid power amount");
require(user.amount >= _powerAmount, "withdraw: not good");
updatePrice(_pid);
uint256 pending = user.amount.mul(pool.accSushiPerShare).div(1e12).sub(
user.rewardDebt
);
_processUserRewardAndFee(_pid, pending, msg.sender);
// 更新矿池总算力
uint256 _amount = (_powerAmount * pool.decimals) / powerPerPrice;
_reduceHourlyDeposit(pool, _amount);
pool.totalPower = pool.totalPower.sub(_powerAmount);
user.amount = user.amount.sub(_powerAmount);
user.rewardDebt = user.amount.mul(pool.accSushiPerShare).div(1e12);
pool.lpToken.safeTransfer(address(msg.sender), _amount);
emit Withdraw(msg.sender, _pid, _amount, _powerAmount);
}
// 提现而不关心奖励。 仅限紧急情况。
function emergencyWithdraw(uint256 _pid) public {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][msg.sender];
require(user.amount > 0, "Invalid user amount");
uint256 _amount = (user.amount * pool.decimals) / powerPerPrice;
_reduceHourlyDeposit(pool, _amount);
pool.lpToken.safeTransfer(address(msg.sender), _amount);
emit EmergencyWithdraw(msg.sender, _pid, _amount, user.amount);
// 更新矿池总算力
pool.totalPower = pool.totalPower.sub(user.amount);
user.amount = 0;
user.rewardDebt = 0;
}
// 直接领取收益
function takerWithdraw(uint256 _pid) public {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][msg.sender];
if (user.amount > 0) {
uint256 pending = user
.amount
.mul(pool.accSushiPerShare)
.div(1e12)
.sub(user.rewardDebt);
_processUserRewardAndFee(_pid, pending, msg.sender);
}
user.rewardDebt = user.amount.mul(pool.accSushiPerShare).div(1e12);
}
// 处理用户收益和手续费的内部函数
function _processUserRewardAndFee(
uint256 _pid,
uint256 pending,
address userAddress
) internal {
if (pending > 0) {
// 发放基金奖励
uint256 fundAmount = (pending * fundRate) / 10000;
uint256 finalInviteReward = 0;
// 处理多代邀请奖励
if (inviteRewardRate > 0) {
address inviterAddress = inviter[userAddress];
uint256 userPower = userInfo[_pid][userAddress].amount;
uint256 inviterPower = userInfo[_pid][inviterAddress].amount;
uint256 baseInviteReward = (pending * inviteRewardRate) / 10000;
if (inviterPower > 0) {
if (inviterPower < userPower) {
// 触发烧伤
finalInviteReward =
(baseInviteReward * inviterPower) /
userPower;
uint256 burnAmount = baseInviteReward -
finalInviteReward;
if (burnAmount > 0) {
// 烧伤的奖励发给基金
fundAmount = fundAmount.add(burnAmount);
}
} else {
finalInviteReward = baseInviteReward;
}
if (finalInviteReward > 0) {
totalInviteReward[inviterAddress] = totalInviteReward[
inviterAddress
].add(finalInviteReward);
safeSushiTransfer(inviterAddress, finalInviteReward);
emit InviteReward(
_pid,
userAddress,
inviterAddress,
finalInviteReward
);
}
} else {
//邀请人没有算力
fundAmount = fundAmount.add(baseInviteReward);
}
}
safeSushiTransfer(fundAddress, fundAmount);
pending = pending - fundAmount - finalInviteReward;
safeSushiTransfer(userAddress, pending);
emit TakeUserReward(_pid, userAddress, pending);
// 发放用户自己的奖励
userInfo[_pid][userAddress].totalReward = userInfo[_pid][
userAddress
].totalReward.add(pending);
}
}
// 安全的sushi转账功能,以防万一如果舍入错误导致池没有足够的寿司。
function safeSushiTransfer(address _to, uint256 _amount) internal {
uint256 sushiBal = token.balanceOf(address(this));
if (_amount > sushiBal) {
token.transfer(_to, sushiBal);
} else {
token.transfer(_to, _amount);
}
}
function reward(uint256 _pid) public {
PoolInfo storage pool = poolInfo[_pid];
uint256 balance = pool.lpToken.balanceOf(address(this));
uint256 totalRefundBalance = (pool.totalPower * pool.decimals) /
powerPerPrice;
// 計算多餘的LP代幣數量
uint256 excessLp = 0;
if (balance > totalRefundBalance) {
excessLp = balance - totalRefundBalance;
}
uint256 totalRewardTokensBought = 0;
// 如果有多餘的LP代幣,且配置了交換路徑,則用來購買獎勵代幣
if (excessLp > 0 && address(uniswapRouter) != address(0)) {
address[] memory swapPathToUse;
if (address(pool.lpToken) == address(buyToken)) {
swapPathToUse = new address[](2);
swapPathToUse[0] = address(pool.lpToken);
swapPathToUse[1] = address(token);
} else {
swapPathToUse = new address[](3);
swapPathToUse[0] = address(pool.lpToken);
swapPathToUse[1] = address(buyToken);
swapPathToUse[2] = address(token);
}
uint256[] memory rewardAmounts = uniswapRouter
.swapExactTokensForTokens(
excessLp,
0, // 接受任何數量的輸出
swapPathToUse,
address(this),
block.timestamp + 300
);
totalRewardTokensBought = rewardAmounts[rewardAmounts.length - 1];
}
// 如果購買到了獎勵代幣,更新accSushiPerShare
if (totalRewardTokensBought > 0 && pool.totalPower > 0) {
pool.accSushiPerShare = pool.accSushiPerShare.add(
totalRewardTokensBought.mul(1e12).div(pool.totalPower)
);
pool.lastRewardTime = block.timestamp;
// 觸發獎勵分發事件
emit RewardDistributed(
_pid,
totalRewardTokensBought,
block.timestamp
);
}
}
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"remappings": []
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_startTime","type":"uint256"},{"internalType":"address","name":"_fundAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"inviter","type":"address"}],"name":"BindInviter","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"powerAmount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"powerAmount","type":"uint256"}],"name":"EmergencyWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"hourlyLimit","type":"uint256"}],"name":"HourlyDepositLimitUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"inviter","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"InviteReward","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rewardAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"RewardDistributed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TakeUserReward","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"powerAmount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"PRICE_DENOMINATOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"Pid","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_allocPoint","type":"uint256"},{"internalType":"contract IERC20","name":"_lpToken","type":"address"}],"name":"add","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_inviter","type":"address"}],"name":"bindInviter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"buyToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"depreciationPerDayBps","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"fundAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fundRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"inviteCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"inviteRewardRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"inviter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastPriceUpdateTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"pendingSushi","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolInfo","outputs":[{"internalType":"contract IERC20","name":"lpToken","type":"address"},{"internalType":"uint256","name":"decimals","type":"uint256"},{"internalType":"uint256","name":"totalPower","type":"uint256"},{"internalType":"uint256","name":"allocPoint","type":"uint256"},{"internalType":"uint256","name":"lastRewardTime","type":"uint256"},{"internalType":"uint256","name":"accSushiPerShare","type":"uint256"},{"internalType":"uint256","name":"hourlyDepositLimit","type":"uint256"},{"internalType":"uint256","name":"currentHour","type":"uint256"},{"internalType":"uint256","name":"depositedThisHour","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"powerPerPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"reward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_allocPoint","type":"uint256"}],"name":"set","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_fundAddress","type":"address"}],"name":"setFundAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_hourlyLimit","type":"uint256"}],"name":"setHourlyDepositLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"takerWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAllocPoint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"totalInviteReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"uniswapRouter","outputs":[{"internalType":"contract IUniswapV2Router02","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"updatePrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"userInfo","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"rewardDebt","type":"uint256"},{"internalType":"uint256","name":"totalReward","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_powerAmount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
6080604052600280546001600160a01b031990811673dac17f958d2ee523a2206206994597c13d831ec71790915560038054909116737a250d5630b4cf539739df2c5dacb4c659f2488d179055670de0b6b3a7640000600455601e60065560c86007556103206008555f601055348015610077575f5ffd5b5060405161281d38038061281d8339810160408190526100969161012b565b5f80546001600160a01b031916339081178255604051909182917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350600180546001600160a01b039485166001600160a01b03199182161790915560118390556009805492909416911617909155600555610164565b80516001600160a01b0381168114610126575f5ffd5b919050565b5f5f5f6060848603121561013d575f5ffd5b61014684610110565b92506020840151915061015b60408501610110565b90509250925092565b6126ac806101715f395ff3fe608060405234801561000f575f5ffd5b50600436106101fd575f3560e01c8063831e2a9611610114578063d332a781116100a9578063e8fb43c211610079578063e8fb43c2146104a5578063ee8f0b7a146104ae578063f2fde38b146104d6578063fc0c546a146104e9578063fe5ee0ba146104fc575f5ffd5b8063d332a78114610463578063e2723bc014610476578063e2bbb1581461047f578063e82bef2914610492575f5ffd5b806393f1a40b116100e457806393f1a40b146103d6578063a14a9f8f1461042a578063a48217191461043d578063a9fb763c14610450575f5ffd5b8063831e2a961461038157806385dc3004146103a05780638d6cc56d146103b35780638da5cb5b146103c6575f5ffd5b80635312ea8e116101955780636c1516e1116101655780636c1516e114610333578063715018a61461033c578063735de9f714610344578063771a26111461036f57806378e9792514610378575f5ffd5b80635312ea8e146102d957806354e05d50146102ec57806357b24e6b1461030b57806361a2a8c81461032a575f5ffd5b80631ab06ee5116101d05780631ab06ee5146102955780632b8bbbe8146102aa578063441a3e70146102bd57806349b9a7af146102d0575f5ffd5b8063081e3eda146102015780631526fe271461021857806317caf6f114610279578063195426ec14610282575b5f5ffd5b600d545b6040519081526020015b60405180910390f35b61022b610226366004612248565b61050f565b604080516001600160a01b03909a168a5260208a0198909852968801959095526060870193909352608086019190915260a085015260c084015260e08301526101008201526101200161020f565b61020560105481565b610205610290366004612276565b610572565b6102a86102a33660046122a4565b6105f9565b005b6102a86102b8366004612276565b610711565b6102a86102cb3660046122a4565b610971565b61020560055481565b6102a86102e7366004612248565b610b3f565b6102056102fa3660046122c4565b600f6020525f908152604090205481565b6102056103193660046122c4565b600b6020525f908152604090205481565b61020560085481565b61020561271081565b6102a8610c67565b600354610357906001600160a01b031681565b6040516001600160a01b03909116815260200161020f565b61020560075481565b61020560115481565b61020561038f3660046122c4565b600c6020525f908152604090205481565b6102a86103ae3660046122c4565b610cd8565b6102a86103c1366004612248565b610d70565b5f546001600160a01b0316610357565b61040f6103e4366004612276565b600e60209081525f928352604080842090915290825290208054600182015460029092015490919083565b6040805193845260208401929092529082015260600161020f565b6102a86104383660046122c4565b610e3b565b600254610357906001600160a01b031681565b6102a861045e366004612248565b611083565b6102a8610471366004612248565b611422565b61020560065481565b6102a861048d3660046122a4565b6114c4565b600954610357906001600160a01b031681565b61020560045481565b6103576104bc3660046122c4565b600a6020525f90815260409020546001600160a01b031681565b6102a86104e43660046122c4565b61175d565b600154610357906001600160a01b031681565b6102a861050a3660046122a4565b611844565b600d818154811061051e575f80fd5b5f9182526020909120600990910201805460018201546002830154600384015460048501546005860154600687015460078801546008909801546001600160a01b0390971698509496939592949193909289565b5f5f600d8481548110610587576105876122df565b5f9182526020808320878452600e825260408085206001600160a01b0389168652909252922060056009909202909201908101546001830154835492945090916105ed91906105e79064e8d4a51000906105e190866118d2565b90611957565b90611998565b93505050505b92915050565b5f546001600160a01b0316331461062b5760405162461bcd60e51b8152600401610622906122f3565b60405180910390fd5b61066c81610666600d8581548110610645576106456122df565b905f5260205f2090600902016003015460105461199890919063ffffffff16565b906119d9565b60108190555080600d8381548110610686576106866122df565b905f5260205f209060090201600301819055506106e560035f9054906101000a90046001600160a01b03165f600d85815481106106c5576106c56122df565b5f9182526020909120600990910201546001600160a01b03169190611a37565b600354600d805461070d926001600160a01b0316915f1991869081106106c5576106c56122df565b5050565b5f546001600160a01b0316331461073a5760405162461bcd60e51b8152600401610622906122f3565b6001600160a01b0381165f908152600f60205260409020541561075b575f5ffd5b5f601154421161076d5760115461076f565b425b60105490915061077f90846119d9565b601081905550600d604051806101200160405280846001600160a01b03168152602001846001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107de573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108029190612328565b61080d90600a61243f565b81526020015f81526020018581526020018381526020015f8152602001846001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610866573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061088a9190612328565b61089590600a61243f565b6108a19061271061244d565b81525f6020808301829052604092830182905284546001808201875595835291819020845160099093020180546001600160a01b0319166001600160a01b03938416178155908401519481019490945590820151600284015560608201516003808501919091556080830151600485015560a0830151600585015560c0830151600685015560e0830151600785015561010090920151600890930192909255546109519184811691165f19611a37565b50600d546001600160a01b039091165f908152600f602052604090205550565b5f600d8381548110610985576109856122df565b5f9182526020808320868452600e82526040808520338652909252922060099091029091019150826109f05760405162461bcd60e51b8152602060048201526014602482015273125b9d985b1a59081c1bddd95c88185b5bdd5b9d60621b6044820152606401610622565b8054831115610a365760405162461bcd60e51b81526020600482015260126024820152711dda5d1a191c985dce881b9bdd0819dbdbd960721b6044820152606401610622565b610a3f84610d70565b5f610a6b82600101546105e764e8d4a510006105e18760050154875f01546118d290919063ffffffff16565b9050610a78858233611b82565b5f600454846001015486610a8c919061244d565b610a969190612464565b9050610aa28482611de2565b6002840154610ab19086611998565b60028501558254610ac29086611998565b8084556005850154610adf9164e8d4a51000916105e191906118d2565b60018401558354610afa906001600160a01b03163383611e24565b6040805182815260208101879052879133917f02f25270a4d87bea75db541cdfe559334a275b4a233520ed6c0a2429667cca94910160405180910390a3505050505050565b5f600d8281548110610b5357610b536122df565b5f9182526020808320858452600e825260408085203386529092529220805460099092029092019250610bbe5760405162461bcd60e51b8152602060048201526013602482015272125b9d985b1a59081d5cd95c88185b5bdd5b9d606a1b6044820152606401610622565b600454600183015482545f9291610bd49161244d565b610bde9190612464565b9050610bea8382611de2565b8254610c00906001600160a01b03163383611e24565b8154604080518381526020810192909252859133917f2369db1bafee945aee5630782f4a170682e3f8188d8dc247a4c73eb8c9e692d2910160405180910390a381546002840154610c5091611998565b6002909301929092555f8082556001909101555050565b5f546001600160a01b03163314610c905760405162461bcd60e51b8152600401610622906122f3565b5f80546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a35f80546001600160a01b0319169055565b5f546001600160a01b03163314610d015760405162461bcd60e51b8152600401610622906122f3565b6001600160a01b038116610d4e5760405162461bcd60e51b8152602060048201526014602482015273496e76616c69642066756e64206164647265737360601b6044820152606401610622565b600980546001600160a01b0319166001600160a01b0392909216919091179055565b600554610d7f9061012c612483565b421015610d895750565b5f60055442610d989190612496565b90505f610daa6127106201518061244d565b82600654600454610dbb919061244d565b610dc5919061244d565b610dcf9190612464565b90508015610df2578060045f828254610de89190612483565b9091555050426005555b5f600d8481548110610e0657610e066122df565b905f5260205f209060090201905061012c816004015442610e279190612496565b10610e3557610e3584611083565b50505050565b335f908152600a60205260409020546001600160a01b031615610e905760405162461bcd60e51b815260206004820152600d60248201526c105b1c9958591e48189bdd5b99609a1b6044820152606401610622565b6001600160a01b038116610ed85760405162461bcd60e51b815260206004820152600f60248201526e24b73b30b634b21034b73b34ba32b960891b6044820152606401610622565b6001600160a01b038181165f908152600a602052604090205433911603610f415760405162461bcd60e51b815260206004820152601e60248201527f496e76697465722063616e6e6f742062652073616d65206173207573657200006044820152606401610622565b6001600160a01b038116301480610f7057506001600160a01b038181165f908152600a60205260409020541615155b610fae5760405162461bcd60e51b815260206004820152600f60248201526e24b73b30b634b21034b73b34ba32b960891b6044820152606401610622565b336001600160a01b03821603610fff5760405162461bcd60e51b815260206004820152601660248201527524b73b34ba32b91031b0b73737ba1031329039b2b63360511b6044820152606401610622565b335f908152600a6020908152604080832080546001600160a01b0319166001600160a01b0386169081179091558352600b9091528120805460019290611046908490612483565b90915550506040516001600160a01b0382169033907faedcbe757d0af5671d08686487d4ddf9c86e82687daf8fd291edfe54b7e9707c905f90a350565b5f600d8281548110611097576110976122df565b5f918252602082206009919091020180546040516370a0823160e01b81523060048201529193506001600160a01b0316906370a0823190602401602060405180830381865afa1580156110ec573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061111091906124a9565b90505f6004548360010154846002015461112a919061244d565b6111349190612464565b90505f8183111561114c576111498284612496565b90505b5f811580159061116657506003546001600160a01b031615155b1561138d5760025485546060916001600160a01b039081169116036112185760408051600280825260608201835290916020830190803683375050875482519293506001600160a01b0316918391505f906111c3576111c36122df565b6001600160a01b03928316602091820292909201015260018054835192169183919081106111f3576111f36122df565b60200260200101906001600160a01b031690816001600160a01b0316815250506112da565b6040805160038082526080820190925290602082016060803683375050875482519293506001600160a01b0316918391505f90611257576112576122df565b6001600160a01b039283166020918202929092010152600254825191169082906001908110611288576112886122df565b6001600160a01b0392831660209182029290920101526001548251911690829060029081106112b9576112b96122df565b60200260200101906001600160a01b031690816001600160a01b0316815250505b6003545f906001600160a01b03166338ed1739858385306112fd4261012c612483565b6040518663ffffffff1660e01b815260040161131d9594939291906124d4565b5f604051808303815f875af1158015611338573d5f5f3e3d5ffd5b505050506040513d5f823e601f3d908101601f1916820160405261135f9190810190612544565b905080600182516113709190612496565b81518110611380576113806122df565b6020026020010151925050505b5f8111801561139f57505f8560020154115b1561141a5760028501546113cb906113c0906105e18464e8d4a510006118d2565b6005870154906119d9565b6005860155426004860181905560405187917fda04004d58812f3e164f58e498158acca1b0054d975fce0e3bafdf56f2e254ba9161141191858252602082015260400190565b60405180910390a25b505050505050565b5f600d8281548110611436576114366122df565b5f9182526020808320858452600e8252604080852033865290925292208054600990920290920192501561149f575f61149082600101546105e764e8d4a510006105e18760050154875f01546118d290919063ffffffff16565b905061149d848233611b82565b505b600582015481546114ba9164e8d4a51000916105e1916118d2565b6001909101555050565b5f81116115045760405162461bcd60e51b815260206004820152600e60248201526d125b9d985b1a5908185b5bdd5b9d60921b6044820152606401610622565b335f908152600a60205260409020546001600160a01b031661155c5760405162461bcd60e51b815260206004820152601160248201527036bab9ba103134b7321034b73b34ba32b960791b6044820152606401610622565b61156582610d70565b5f600d8381548110611579576115796122df565b905f5260205f209060090201905061159081611e54565b5f600454826001015483600201546115a8919061244d565b6115b29190612464565b90505f6115cc8484600801546119d990919063ffffffff16565b90505f6115da606484612464565b90508360060154821115806115ef5750808211155b61163b5760405162461bcd60e51b815260206004820152601c60248201527f6465706f736974206578636565647320686f75726c79206c696d6974000000006044820152606401610622565b600884018290555f868152600e60209081526040808320338452909152902080541561169c575f61168d82600101546105e764e8d4a510006105e18a60050154875f01546118d290919063ffffffff16565b905061169a888233611b82565b505b84546116b3906001600160a01b0316333089611e7c565b5f8560010154600454886116c7919061244d565b6116d19190612464565b60028701549091506116e390826119d9565b600287015581546116f490826119d9565b80835560058701546117119164e8d4a51000916105e191906118d2565b60018301556040805188815260208101839052899133917f36af321ec8d3c75236829c5317affd40ddb308863a1236d2d277a4025cccee1e910160405180910390a35050505050505050565b5f546001600160a01b031633146117865760405162461bcd60e51b8152600401610622906122f3565b6001600160a01b0381166117eb5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610622565b5f80546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35f80546001600160a01b0319166001600160a01b0392909216919091179055565b5f546001600160a01b0316331461186d5760405162461bcd60e51b8152600401610622906122f3565b80600d8381548110611881576118816122df565b905f5260205f20906009020160060181905550817fa45acc80ef1f75d4e97523c10c6f683ea6067dcdf00e976721af30a0ce80e872826040516118c691815260200190565b60405180910390a25050565b5f825f036118e157505f6105f3565b5f6118ec838561244d565b9050826118f98583612464565b146119505760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610622565b9392505050565b5f61195083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611eb4565b5f61195083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611ee9565b5f806119e58385612483565b9050838110156119505760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610622565b801580611aaf5750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa158015611a89573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611aad91906124a9565b155b611b1a5760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608401610622565b6040516001600160a01b038316602482015260448101829052611b7d90849063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611f18565b505050565b8115611b7d575f61271060085484611b9a919061244d565b611ba49190612464565b6007549091505f9015611d0c576001600160a01b038381165f818152600a60209081526040808320548a8452600e83528184209484529390915280822054929093168082529281205460075490919061271090611c01908a61244d565b611c0b9190612464565b90508115611cfa5782821015611c585782611c26838361244d565b611c309190612464565b94505f611c3d8683612496565b90508015611c5257611c4f87826119d9565b96505b50611c5c565b8094505b8415611cf5576001600160a01b0384165f908152600c6020526040902054611c8490866119d9565b6001600160a01b0385165f908152600c6020526040902055611ca68486611fe9565b836001600160a01b0316876001600160a01b03168a7faef4d1ddb1ed3b989787e04cc1905e877ef63284f443d35f1b4657120223020b88604051611cec91815260200190565b60405180910390a45b611d07565b611d0486826119d9565b95505b505050505b600954611d22906001600160a01b031683611fe9565b80611d2d8386612496565b611d379190612496565b9350611d438385611fe9565b826001600160a01b0316857f4cb8c7088eeedef5bcb2b3947774f996db2850d16a6b77281dd0ab5d46f54b8286604051611d7f91815260200190565b60405180910390a35f858152600e602090815260408083206001600160a01b0387168452909152902060020154611db690856119d9565b5f868152600e602090815260408083206001600160a01b03881684529091529020600201555050505050565b805f03611ded575050565b611df682611e54565b8082600801541115611e1a576008820154611e119082611998565b60088301555050565b5f60088301555050565b6040516001600160a01b038316602482015260448101829052611b7d90849063a9059cbb60e01b90606401611b46565b5f611e61610e1042612464565b90508082600701541461070d5760078201555f600890910155565b6040516001600160a01b0380851660248301528316604482015260648101829052610e359085906323b872dd60e01b90608401611b46565b5f8183611ed45760405162461bcd60e51b8152600401610622919061260c565b505f611ee08486612464565b95945050505050565b5f8184841115611f0c5760405162461bcd60e51b8152600401610622919061260c565b505f611ee08486612496565b5f611f6c826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661210b9092919063ffffffff16565b805190915015611b7d5780806020019051810190611f8a9190612641565b611b7d5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610622565b6001546040516370a0823160e01b81523060048201525f916001600160a01b0316906370a0823190602401602060405180830381865afa15801561202f573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061205391906124a9565b9050808211156120d25760015460405163a9059cbb60e01b81526001600160a01b038581166004830152602482018490529091169063a9059cbb906044015b6020604051808303815f875af11580156120ae573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e359190612641565b60015460405163a9059cbb60e01b81526001600160a01b038581166004830152602482018590529091169063a9059cbb90604401612092565b606061211984845f85612121565b949350505050565b606061212c85612210565b6121785760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610622565b5f5f866001600160a01b031685876040516121939190612660565b5f6040518083038185875af1925050503d805f81146121cd576040519150601f19603f3d011682016040523d82523d5f602084013e6121d2565b606091505b509150915081156121e65791506121199050565b8051156121f65780518082602001fd5b8360405162461bcd60e51b8152600401610622919061260c565b5f813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470818114801590612119575050151592915050565b5f60208284031215612258575f5ffd5b5035919050565b6001600160a01b0381168114612273575f5ffd5b50565b5f5f60408385031215612287575f5ffd5b8235915060208301356122998161225f565b809150509250929050565b5f5f604083850312156122b5575f5ffd5b50508035926020909101359150565b5f602082840312156122d4575f5ffd5b81356119508161225f565b634e487b7160e01b5f52603260045260245ffd5b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b5f60208284031215612338575f5ffd5b815160ff81168114611950575f5ffd5b634e487b7160e01b5f52601160045260245ffd5b6001815b60018411156123975780850481111561237b5761237b612348565b600184161561238957908102905b60019390931c928002612360565b935093915050565b5f826123ad575060016105f3565b816123b957505f6105f3565b81600181146123cf57600281146123d9576123f5565b60019150506105f3565b60ff8411156123ea576123ea612348565b50506001821b6105f3565b5060208310610133831016604e8410600b8410161715612418575081810a6105f3565b6124245f19848461235c565b805f190482111561243757612437612348565b029392505050565b5f61195060ff84168361239f565b80820281158282048414176105f3576105f3612348565b5f8261247e57634e487b7160e01b5f52601260045260245ffd5b500490565b808201808211156105f3576105f3612348565b818103818111156105f3576105f3612348565b5f602082840312156124b9575f5ffd5b5051919050565b634e487b7160e01b5f52604160045260245ffd5b5f60a0820187835286602084015260a0604084015280865180835260c0850191506020880192505f5b818110156125245783516001600160a01b03168352602093840193909201916001016124fd565b50506001600160a01b039590951660608401525050608001529392505050565b5f60208284031215612554575f5ffd5b815167ffffffffffffffff81111561256a575f5ffd5b8201601f8101841361257a575f5ffd5b805167ffffffffffffffff811115612594576125946124c0565b8060051b604051601f19603f830116810181811067ffffffffffffffff821117156125c1576125c16124c0565b6040529182526020818401810192908101878411156125de575f5ffd5b6020850194505b83851015612601578451808252602095860195909350016125e5565b509695505050505050565b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f83011684010191505092915050565b5f60208284031215612651575f5ffd5b81518015158114611950575f5ffd5b5f82518060208501845e5f92019182525091905056fea2646970667358221220b2958e59ded111c8e72be521093f4db0b520a2f725527cc1b8576e4da45d3c9764736f6c634300081f0033000000000000000000000000797c3a64c2e7b57b0df5fbcf12bc6302413ced97000000000000000000000000000000000000000000000000000000006952a58000000000000000000000000019092089e355ca5fb08aa909d80e332d7d69f509
Deployed Bytecode
0x608060405234801561000f575f5ffd5b50600436106101fd575f3560e01c8063831e2a9611610114578063d332a781116100a9578063e8fb43c211610079578063e8fb43c2146104a5578063ee8f0b7a146104ae578063f2fde38b146104d6578063fc0c546a146104e9578063fe5ee0ba146104fc575f5ffd5b8063d332a78114610463578063e2723bc014610476578063e2bbb1581461047f578063e82bef2914610492575f5ffd5b806393f1a40b116100e457806393f1a40b146103d6578063a14a9f8f1461042a578063a48217191461043d578063a9fb763c14610450575f5ffd5b8063831e2a961461038157806385dc3004146103a05780638d6cc56d146103b35780638da5cb5b146103c6575f5ffd5b80635312ea8e116101955780636c1516e1116101655780636c1516e114610333578063715018a61461033c578063735de9f714610344578063771a26111461036f57806378e9792514610378575f5ffd5b80635312ea8e146102d957806354e05d50146102ec57806357b24e6b1461030b57806361a2a8c81461032a575f5ffd5b80631ab06ee5116101d05780631ab06ee5146102955780632b8bbbe8146102aa578063441a3e70146102bd57806349b9a7af146102d0575f5ffd5b8063081e3eda146102015780631526fe271461021857806317caf6f114610279578063195426ec14610282575b5f5ffd5b600d545b6040519081526020015b60405180910390f35b61022b610226366004612248565b61050f565b604080516001600160a01b03909a168a5260208a0198909852968801959095526060870193909352608086019190915260a085015260c084015260e08301526101008201526101200161020f565b61020560105481565b610205610290366004612276565b610572565b6102a86102a33660046122a4565b6105f9565b005b6102a86102b8366004612276565b610711565b6102a86102cb3660046122a4565b610971565b61020560055481565b6102a86102e7366004612248565b610b3f565b6102056102fa3660046122c4565b600f6020525f908152604090205481565b6102056103193660046122c4565b600b6020525f908152604090205481565b61020560085481565b61020561271081565b6102a8610c67565b600354610357906001600160a01b031681565b6040516001600160a01b03909116815260200161020f565b61020560075481565b61020560115481565b61020561038f3660046122c4565b600c6020525f908152604090205481565b6102a86103ae3660046122c4565b610cd8565b6102a86103c1366004612248565b610d70565b5f546001600160a01b0316610357565b61040f6103e4366004612276565b600e60209081525f928352604080842090915290825290208054600182015460029092015490919083565b6040805193845260208401929092529082015260600161020f565b6102a86104383660046122c4565b610e3b565b600254610357906001600160a01b031681565b6102a861045e366004612248565b611083565b6102a8610471366004612248565b611422565b61020560065481565b6102a861048d3660046122a4565b6114c4565b600954610357906001600160a01b031681565b61020560045481565b6103576104bc3660046122c4565b600a6020525f90815260409020546001600160a01b031681565b6102a86104e43660046122c4565b61175d565b600154610357906001600160a01b031681565b6102a861050a3660046122a4565b611844565b600d818154811061051e575f80fd5b5f9182526020909120600990910201805460018201546002830154600384015460048501546005860154600687015460078801546008909801546001600160a01b0390971698509496939592949193909289565b5f5f600d8481548110610587576105876122df565b5f9182526020808320878452600e825260408085206001600160a01b0389168652909252922060056009909202909201908101546001830154835492945090916105ed91906105e79064e8d4a51000906105e190866118d2565b90611957565b90611998565b93505050505b92915050565b5f546001600160a01b0316331461062b5760405162461bcd60e51b8152600401610622906122f3565b60405180910390fd5b61066c81610666600d8581548110610645576106456122df565b905f5260205f2090600902016003015460105461199890919063ffffffff16565b906119d9565b60108190555080600d8381548110610686576106866122df565b905f5260205f209060090201600301819055506106e560035f9054906101000a90046001600160a01b03165f600d85815481106106c5576106c56122df565b5f9182526020909120600990910201546001600160a01b03169190611a37565b600354600d805461070d926001600160a01b0316915f1991869081106106c5576106c56122df565b5050565b5f546001600160a01b0316331461073a5760405162461bcd60e51b8152600401610622906122f3565b6001600160a01b0381165f908152600f60205260409020541561075b575f5ffd5b5f601154421161076d5760115461076f565b425b60105490915061077f90846119d9565b601081905550600d604051806101200160405280846001600160a01b03168152602001846001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107de573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108029190612328565b61080d90600a61243f565b81526020015f81526020018581526020018381526020015f8152602001846001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610866573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061088a9190612328565b61089590600a61243f565b6108a19061271061244d565b81525f6020808301829052604092830182905284546001808201875595835291819020845160099093020180546001600160a01b0319166001600160a01b03938416178155908401519481019490945590820151600284015560608201516003808501919091556080830151600485015560a0830151600585015560c0830151600685015560e0830151600785015561010090920151600890930192909255546109519184811691165f19611a37565b50600d546001600160a01b039091165f908152600f602052604090205550565b5f600d8381548110610985576109856122df565b5f9182526020808320868452600e82526040808520338652909252922060099091029091019150826109f05760405162461bcd60e51b8152602060048201526014602482015273125b9d985b1a59081c1bddd95c88185b5bdd5b9d60621b6044820152606401610622565b8054831115610a365760405162461bcd60e51b81526020600482015260126024820152711dda5d1a191c985dce881b9bdd0819dbdbd960721b6044820152606401610622565b610a3f84610d70565b5f610a6b82600101546105e764e8d4a510006105e18760050154875f01546118d290919063ffffffff16565b9050610a78858233611b82565b5f600454846001015486610a8c919061244d565b610a969190612464565b9050610aa28482611de2565b6002840154610ab19086611998565b60028501558254610ac29086611998565b8084556005850154610adf9164e8d4a51000916105e191906118d2565b60018401558354610afa906001600160a01b03163383611e24565b6040805182815260208101879052879133917f02f25270a4d87bea75db541cdfe559334a275b4a233520ed6c0a2429667cca94910160405180910390a3505050505050565b5f600d8281548110610b5357610b536122df565b5f9182526020808320858452600e825260408085203386529092529220805460099092029092019250610bbe5760405162461bcd60e51b8152602060048201526013602482015272125b9d985b1a59081d5cd95c88185b5bdd5b9d606a1b6044820152606401610622565b600454600183015482545f9291610bd49161244d565b610bde9190612464565b9050610bea8382611de2565b8254610c00906001600160a01b03163383611e24565b8154604080518381526020810192909252859133917f2369db1bafee945aee5630782f4a170682e3f8188d8dc247a4c73eb8c9e692d2910160405180910390a381546002840154610c5091611998565b6002909301929092555f8082556001909101555050565b5f546001600160a01b03163314610c905760405162461bcd60e51b8152600401610622906122f3565b5f80546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a35f80546001600160a01b0319169055565b5f546001600160a01b03163314610d015760405162461bcd60e51b8152600401610622906122f3565b6001600160a01b038116610d4e5760405162461bcd60e51b8152602060048201526014602482015273496e76616c69642066756e64206164647265737360601b6044820152606401610622565b600980546001600160a01b0319166001600160a01b0392909216919091179055565b600554610d7f9061012c612483565b421015610d895750565b5f60055442610d989190612496565b90505f610daa6127106201518061244d565b82600654600454610dbb919061244d565b610dc5919061244d565b610dcf9190612464565b90508015610df2578060045f828254610de89190612483565b9091555050426005555b5f600d8481548110610e0657610e066122df565b905f5260205f209060090201905061012c816004015442610e279190612496565b10610e3557610e3584611083565b50505050565b335f908152600a60205260409020546001600160a01b031615610e905760405162461bcd60e51b815260206004820152600d60248201526c105b1c9958591e48189bdd5b99609a1b6044820152606401610622565b6001600160a01b038116610ed85760405162461bcd60e51b815260206004820152600f60248201526e24b73b30b634b21034b73b34ba32b960891b6044820152606401610622565b6001600160a01b038181165f908152600a602052604090205433911603610f415760405162461bcd60e51b815260206004820152601e60248201527f496e76697465722063616e6e6f742062652073616d65206173207573657200006044820152606401610622565b6001600160a01b038116301480610f7057506001600160a01b038181165f908152600a60205260409020541615155b610fae5760405162461bcd60e51b815260206004820152600f60248201526e24b73b30b634b21034b73b34ba32b960891b6044820152606401610622565b336001600160a01b03821603610fff5760405162461bcd60e51b815260206004820152601660248201527524b73b34ba32b91031b0b73737ba1031329039b2b63360511b6044820152606401610622565b335f908152600a6020908152604080832080546001600160a01b0319166001600160a01b0386169081179091558352600b9091528120805460019290611046908490612483565b90915550506040516001600160a01b0382169033907faedcbe757d0af5671d08686487d4ddf9c86e82687daf8fd291edfe54b7e9707c905f90a350565b5f600d8281548110611097576110976122df565b5f918252602082206009919091020180546040516370a0823160e01b81523060048201529193506001600160a01b0316906370a0823190602401602060405180830381865afa1580156110ec573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061111091906124a9565b90505f6004548360010154846002015461112a919061244d565b6111349190612464565b90505f8183111561114c576111498284612496565b90505b5f811580159061116657506003546001600160a01b031615155b1561138d5760025485546060916001600160a01b039081169116036112185760408051600280825260608201835290916020830190803683375050875482519293506001600160a01b0316918391505f906111c3576111c36122df565b6001600160a01b03928316602091820292909201015260018054835192169183919081106111f3576111f36122df565b60200260200101906001600160a01b031690816001600160a01b0316815250506112da565b6040805160038082526080820190925290602082016060803683375050875482519293506001600160a01b0316918391505f90611257576112576122df565b6001600160a01b039283166020918202929092010152600254825191169082906001908110611288576112886122df565b6001600160a01b0392831660209182029290920101526001548251911690829060029081106112b9576112b96122df565b60200260200101906001600160a01b031690816001600160a01b0316815250505b6003545f906001600160a01b03166338ed1739858385306112fd4261012c612483565b6040518663ffffffff1660e01b815260040161131d9594939291906124d4565b5f604051808303815f875af1158015611338573d5f5f3e3d5ffd5b505050506040513d5f823e601f3d908101601f1916820160405261135f9190810190612544565b905080600182516113709190612496565b81518110611380576113806122df565b6020026020010151925050505b5f8111801561139f57505f8560020154115b1561141a5760028501546113cb906113c0906105e18464e8d4a510006118d2565b6005870154906119d9565b6005860155426004860181905560405187917fda04004d58812f3e164f58e498158acca1b0054d975fce0e3bafdf56f2e254ba9161141191858252602082015260400190565b60405180910390a25b505050505050565b5f600d8281548110611436576114366122df565b5f9182526020808320858452600e8252604080852033865290925292208054600990920290920192501561149f575f61149082600101546105e764e8d4a510006105e18760050154875f01546118d290919063ffffffff16565b905061149d848233611b82565b505b600582015481546114ba9164e8d4a51000916105e1916118d2565b6001909101555050565b5f81116115045760405162461bcd60e51b815260206004820152600e60248201526d125b9d985b1a5908185b5bdd5b9d60921b6044820152606401610622565b335f908152600a60205260409020546001600160a01b031661155c5760405162461bcd60e51b815260206004820152601160248201527036bab9ba103134b7321034b73b34ba32b960791b6044820152606401610622565b61156582610d70565b5f600d8381548110611579576115796122df565b905f5260205f209060090201905061159081611e54565b5f600454826001015483600201546115a8919061244d565b6115b29190612464565b90505f6115cc8484600801546119d990919063ffffffff16565b90505f6115da606484612464565b90508360060154821115806115ef5750808211155b61163b5760405162461bcd60e51b815260206004820152601c60248201527f6465706f736974206578636565647320686f75726c79206c696d6974000000006044820152606401610622565b600884018290555f868152600e60209081526040808320338452909152902080541561169c575f61168d82600101546105e764e8d4a510006105e18a60050154875f01546118d290919063ffffffff16565b905061169a888233611b82565b505b84546116b3906001600160a01b0316333089611e7c565b5f8560010154600454886116c7919061244d565b6116d19190612464565b60028701549091506116e390826119d9565b600287015581546116f490826119d9565b80835560058701546117119164e8d4a51000916105e191906118d2565b60018301556040805188815260208101839052899133917f36af321ec8d3c75236829c5317affd40ddb308863a1236d2d277a4025cccee1e910160405180910390a35050505050505050565b5f546001600160a01b031633146117865760405162461bcd60e51b8152600401610622906122f3565b6001600160a01b0381166117eb5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610622565b5f80546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35f80546001600160a01b0319166001600160a01b0392909216919091179055565b5f546001600160a01b0316331461186d5760405162461bcd60e51b8152600401610622906122f3565b80600d8381548110611881576118816122df565b905f5260205f20906009020160060181905550817fa45acc80ef1f75d4e97523c10c6f683ea6067dcdf00e976721af30a0ce80e872826040516118c691815260200190565b60405180910390a25050565b5f825f036118e157505f6105f3565b5f6118ec838561244d565b9050826118f98583612464565b146119505760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610622565b9392505050565b5f61195083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611eb4565b5f61195083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611ee9565b5f806119e58385612483565b9050838110156119505760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610622565b801580611aaf5750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa158015611a89573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611aad91906124a9565b155b611b1a5760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608401610622565b6040516001600160a01b038316602482015260448101829052611b7d90849063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611f18565b505050565b8115611b7d575f61271060085484611b9a919061244d565b611ba49190612464565b6007549091505f9015611d0c576001600160a01b038381165f818152600a60209081526040808320548a8452600e83528184209484529390915280822054929093168082529281205460075490919061271090611c01908a61244d565b611c0b9190612464565b90508115611cfa5782821015611c585782611c26838361244d565b611c309190612464565b94505f611c3d8683612496565b90508015611c5257611c4f87826119d9565b96505b50611c5c565b8094505b8415611cf5576001600160a01b0384165f908152600c6020526040902054611c8490866119d9565b6001600160a01b0385165f908152600c6020526040902055611ca68486611fe9565b836001600160a01b0316876001600160a01b03168a7faef4d1ddb1ed3b989787e04cc1905e877ef63284f443d35f1b4657120223020b88604051611cec91815260200190565b60405180910390a45b611d07565b611d0486826119d9565b95505b505050505b600954611d22906001600160a01b031683611fe9565b80611d2d8386612496565b611d379190612496565b9350611d438385611fe9565b826001600160a01b0316857f4cb8c7088eeedef5bcb2b3947774f996db2850d16a6b77281dd0ab5d46f54b8286604051611d7f91815260200190565b60405180910390a35f858152600e602090815260408083206001600160a01b0387168452909152902060020154611db690856119d9565b5f868152600e602090815260408083206001600160a01b03881684529091529020600201555050505050565b805f03611ded575050565b611df682611e54565b8082600801541115611e1a576008820154611e119082611998565b60088301555050565b5f60088301555050565b6040516001600160a01b038316602482015260448101829052611b7d90849063a9059cbb60e01b90606401611b46565b5f611e61610e1042612464565b90508082600701541461070d5760078201555f600890910155565b6040516001600160a01b0380851660248301528316604482015260648101829052610e359085906323b872dd60e01b90608401611b46565b5f8183611ed45760405162461bcd60e51b8152600401610622919061260c565b505f611ee08486612464565b95945050505050565b5f8184841115611f0c5760405162461bcd60e51b8152600401610622919061260c565b505f611ee08486612496565b5f611f6c826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661210b9092919063ffffffff16565b805190915015611b7d5780806020019051810190611f8a9190612641565b611b7d5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610622565b6001546040516370a0823160e01b81523060048201525f916001600160a01b0316906370a0823190602401602060405180830381865afa15801561202f573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061205391906124a9565b9050808211156120d25760015460405163a9059cbb60e01b81526001600160a01b038581166004830152602482018490529091169063a9059cbb906044015b6020604051808303815f875af11580156120ae573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e359190612641565b60015460405163a9059cbb60e01b81526001600160a01b038581166004830152602482018590529091169063a9059cbb90604401612092565b606061211984845f85612121565b949350505050565b606061212c85612210565b6121785760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610622565b5f5f866001600160a01b031685876040516121939190612660565b5f6040518083038185875af1925050503d805f81146121cd576040519150601f19603f3d011682016040523d82523d5f602084013e6121d2565b606091505b509150915081156121e65791506121199050565b8051156121f65780518082602001fd5b8360405162461bcd60e51b8152600401610622919061260c565b5f813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470818114801590612119575050151592915050565b5f60208284031215612258575f5ffd5b5035919050565b6001600160a01b0381168114612273575f5ffd5b50565b5f5f60408385031215612287575f5ffd5b8235915060208301356122998161225f565b809150509250929050565b5f5f604083850312156122b5575f5ffd5b50508035926020909101359150565b5f602082840312156122d4575f5ffd5b81356119508161225f565b634e487b7160e01b5f52603260045260245ffd5b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b5f60208284031215612338575f5ffd5b815160ff81168114611950575f5ffd5b634e487b7160e01b5f52601160045260245ffd5b6001815b60018411156123975780850481111561237b5761237b612348565b600184161561238957908102905b60019390931c928002612360565b935093915050565b5f826123ad575060016105f3565b816123b957505f6105f3565b81600181146123cf57600281146123d9576123f5565b60019150506105f3565b60ff8411156123ea576123ea612348565b50506001821b6105f3565b5060208310610133831016604e8410600b8410161715612418575081810a6105f3565b6124245f19848461235c565b805f190482111561243757612437612348565b029392505050565b5f61195060ff84168361239f565b80820281158282048414176105f3576105f3612348565b5f8261247e57634e487b7160e01b5f52601260045260245ffd5b500490565b808201808211156105f3576105f3612348565b818103818111156105f3576105f3612348565b5f602082840312156124b9575f5ffd5b5051919050565b634e487b7160e01b5f52604160045260245ffd5b5f60a0820187835286602084015260a0604084015280865180835260c0850191506020880192505f5b818110156125245783516001600160a01b03168352602093840193909201916001016124fd565b50506001600160a01b039590951660608401525050608001529392505050565b5f60208284031215612554575f5ffd5b815167ffffffffffffffff81111561256a575f5ffd5b8201601f8101841361257a575f5ffd5b805167ffffffffffffffff811115612594576125946124c0565b8060051b604051601f19603f830116810181811067ffffffffffffffff821117156125c1576125c16124c0565b6040529182526020818401810192908101878411156125de575f5ffd5b6020850194505b83851015612601578451808252602095860195909350016125e5565b509695505050505050565b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f83011684010191505092915050565b5f60208284031215612651575f5ffd5b81518015158114611950575f5ffd5b5f82518060208501845e5f92019182525091905056fea2646970667358221220b2958e59ded111c8e72be521093f4db0b520a2f725527cc1b8576e4da45d3c9764736f6c634300081f0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000797c3a64c2e7b57b0df5fbcf12bc6302413ced97000000000000000000000000000000000000000000000000000000006952a58000000000000000000000000019092089e355ca5fb08aa909d80e332d7d69f509
-----Decoded View---------------
Arg [0] : _token (address): 0x797C3a64c2E7b57b0DF5FBCF12bc6302413CEd97
Arg [1] : _startTime (uint256): 1767024000
Arg [2] : _fundAddress (address): 0x19092089e355ca5Fb08aa909d80e332D7d69F509
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000797c3a64c2e7b57b0df5fbcf12bc6302413ced97
Arg [1] : 000000000000000000000000000000000000000000000000000000006952a580
Arg [2] : 00000000000000000000000019092089e355ca5fb08aa909d80e332d7d69f509
Loading...
Loading
Loading...
Loading
Net Worth in USD
$227.66
Net Worth in ETH
0.109064
Token Allocations
USDT
100.00%
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|---|---|---|---|---|
| ETH | 100.00% | $0.999796 | 227.7093 | $227.66 |
Loading...
Loading
Loading...
Loading
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.