Transactions
Token Transfers
Tokens
Internal Transactions
Coin Balance History
Logs
Code
Read Contract
Write Contract
Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
This contract has been partially verified via Sourcify.
View contract in Sourcify repository
- Contract name:
- PrivateSale
- Optimization enabled
- true
- Compiler version
- v0.6.12+commit.27d51765
- Optimization runs
- 200
- EVM Version
- istanbul
- Verified at
- 2026-04-22T01:58:56.328222Z
Constructor Arguments
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012750000000000000000000000000000000000000000000000000000000000000004b0000000000000000000000000000000000000000000000000000000000000011a0000000000000000000000002ec75589856562646afe393455986cad26c4cc5f
Arg [0] (uint256) : 0
Arg [1] (uint256) : 1209600
Arg [2] (uint256) : 1200
Arg [3] (uint256) : 282
Arg [4] (address) : 0x2ec75589856562646afe393455986cad26c4cc5f
PrivateSale.sol
// File: @openzeppelin/contracts/GSN/Context.sol
pragma solidity ^0.6.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal virtual view returns (address payable) {
return msg.sender;
}
function _msgData() internal virtual view 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.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(
newOwner != address(0),
"Ownable: new owner is the zero address"
);
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
// File: @openzeppelin/contracts-ethereum-package/contracts/token/ERC20/IERC20.sol
pragma solidity ^0.6.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount)
external
returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender)
external
view
returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
// File: @openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol
pragma solidity ^0.6.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
// File: @openzeppelin/contracts-ethereum-package/contracts/utils/Address.sol
pragma solidity ^0.6.2;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash
= 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly {
codehash := extcodehash(account)
}
return (codehash != accountHash && codehash != 0x0);
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(
address(this).balance >= amount,
"Address: insufficient balance"
);
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{value: amount}("");
require(
success,
"Address: unable to send value, recipient may have reverted"
);
}
}
// File: @openzeppelin/contracts-ethereum-package/contracts/token/ERC20/SafeERC20.sol
pragma solidity ^0.6.0;
/**
* @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 ERC20;` 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)
);
}
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.
// A Solidity high level call has three parts:
// 1. The target address is checked to verify it contains contract code
// 2. The call itself is made, and success asserted
// 3. The return value is decoded, which in turn checks the size of the returned data.
// solhint-disable-next-line max-line-length
require(address(token).isContract(), "SafeERC20: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = address(token).call(data);
require(success, "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/PrivateSale.sol
pragma solidity 0.6.12;
contract PrivateSale is Ownable {
using SafeMath for uint256;
using SafeERC20 for IERC20;
struct TokenLock {
uint256 timestamp;
uint256 amount;
bool isUnlocked;
}
struct User {
uint256 alloc;
uint256 bought;
uint256 locked;
TokenLock[] releases;
uint256 boughtWithNerdz;
}
mapping(address => User) public whitelist;
IERC20 public trop;
IERC20 public nerd;
uint256 public totalSold;
uint256 public totalLocked;
uint256 public totalUnlocked;
uint256 public saleStart;
uint256 public saleStop;
address payable public tokenOwner;
uint256 public ethPegged; //in usd: i.e. 1150, 1200
uint256 public nerdzPegged; //in usd: i.e. 1150, 1200
uint256 public constant MAX_SALE_DURATION = 14 days;
event AddedToWhitelist(address[] account);
event RemovedFromWhitelist(address[] account);
constructor(
uint256 _start,
uint256 _duration,
uint256 _ethPegged,
uint256 _nerdzPegged,
address _trop
) public {
saleStart = _start == 0 ? block.timestamp : _start;
require(saleStart >= block.timestamp);
require(_duration <= MAX_SALE_DURATION);
saleStop = saleStart.add(_duration);
ethPegged = _ethPegged;
nerdzPegged = _nerdzPegged;
nerd = IERC20(0x32C868F6318D6334B2250F323D914Bc2239E4EeE);
trop = IERC20(_trop);
tokenOwner = msg.sender;
}
function setTokenOwner(address payable _tokenOwner) external onlyOwner {
tokenOwner = _tokenOwner;
}
function setPegged(uint256 _ethPegged, uint256 _nerdzPegged)
external
onlyOwner
{
ethPegged = _ethPegged;
nerdzPegged = _nerdzPegged;
}
function setSaleTime(uint256 _start, uint256 _duration) external onlyOwner {
if (saleStart == 0) saleStart = _start;
require(_duration < MAX_SALE_DURATION);
saleStop = saleStart.add(_duration);
}
modifier onlyWhitelisted() {
require(isWhitelisted(msg.sender));
_;
}
function setTrop(address _trop) external onlyOwner {
trop = IERC20(_trop);
}
function add(address[] memory _addresses, uint256[] memory _allocations)
external
onlyOwner
{
require(_addresses.length == _allocations.length);
for (uint256 i = 0; i < _addresses.length; i++) {
setAllocation(_addresses[i], _allocations[i]);
}
emit AddedToWhitelist(_addresses);
}
function setAllocation(address _addr, uint256 alloc) public onlyOwner {
whitelist[_addr].alloc = alloc;
}
function remove(address[] calldata _addresses) external onlyOwner {
for (uint256 i = 0; i > _addresses.length; i++) {
whitelist[_addresses[i]].alloc = 0;
}
emit RemovedFromWhitelist(_addresses);
}
function isWhitelisted(address _address) public view returns (bool) {
return whitelist[_address].alloc > 0;
}
function withdrawToken(address _token) external onlyOwner {
if (_token == address(trop)) {
//withdraw remaining, unsold trop
require(block.timestamp > saleStop);
uint256 bal = trop.balanceOf(address(this));
trop.transfer(tokenOwner, bal.sub(totalLocked));
} else if (_token == address(0)) {
tokenOwner.transfer(address(this).balance);
} else {
IERC20 t = IERC20(_token);
uint256 bal = t.balanceOf(address(this));
t.safeTransfer(tokenOwner, bal);
}
}
fallback() external payable {
buyTokenWithETH();
}
receive() external payable {
buyTokenWithETH();
}
function lockTrop(address _user) internal {
uint256 lockedAmount = whitelist[_user].locked;
delete whitelist[_user].releases; //clear old data
whitelist[_user].releases.push(
TokenLock({
timestamp: saleStart.add(30 days),
amount: lockedAmount.mul(30).div(100),
isUnlocked: false
})
);
whitelist[_user].releases.push(
TokenLock({
timestamp: saleStart.add(60 days),
amount: lockedAmount.mul(20).div(100),
isUnlocked: false
})
);
whitelist[_user].releases.push(
TokenLock({
timestamp: saleStart.add(90 days),
amount: lockedAmount.mul(20).div(100),
isUnlocked: false
})
);
whitelist[_user].releases.push(
TokenLock({
timestamp: saleStart.add(120 days),
amount: lockedAmount.mul(20).div(100),
isUnlocked: false
})
);
whitelist[_user].releases.push(
TokenLock({
timestamp: saleStart.add(150 days),
amount: lockedAmount.mul(10).div(100),
isUnlocked: false
})
);
}
function buyTokenWithETH() public payable onlyWhitelisted {
require(
block.timestamp >= saleStart && block.timestamp <= saleStop,
"invalid time"
);
uint256 tokenAmount = msg.value.mul(ethPegged).div(11);
uint256 ethReturn = 0;
if (
whitelist[msg.sender].bought.add(tokenAmount) >
whitelist[msg.sender].alloc
) {
tokenAmount = whitelist[msg.sender].alloc.sub(
whitelist[msg.sender].bought
);
uint256 actualETHSpentInWei = tokenAmount.mul(11).div(ethPegged);
ethReturn = msg.value.sub(actualETHSpentInWei);
}
if (tokenAmount > 0) {
//send 50%, locked 50%
uint256 toSend = tokenAmount.div(2);
uint256 locked = tokenAmount.sub(toSend);
trop.safeTransfer(msg.sender, toSend);
whitelist[msg.sender].bought = whitelist[msg.sender].bought.add(
tokenAmount
);
whitelist[msg.sender].locked = whitelist[msg.sender].locked.add(
locked
);
totalSold = totalSold.add(tokenAmount);
totalLocked = totalLocked.add(locked);
lockTrop(msg.sender);
}
if (ethReturn > 0) {
msg.sender.transfer(ethReturn); //revert if fallback of msg.sender has heavy opertions
}
}
function buyTokenWithNERDz(uint256 _nerdzAmount) external onlyWhitelisted {
require(
block.timestamp >= saleStart && block.timestamp <= saleStop,
"invalid time"
);
require(
whitelist[msg.sender].boughtWithNerdz <
whitelist[msg.sender].alloc.mul(30).div(100),
"cannot buy with nerdz any more"
);
uint256 nerdzBefore = nerd.balanceOf(address(this));
nerd.safeTransferFrom(msg.sender, address(this), _nerdzAmount);
uint256 nerdzReceive = nerd.balanceOf(address(this)).sub(nerdzBefore);
//5% discount
uint256 tokenAmount = nerdzReceive
.mul(nerdzPegged)
.div(11)
.mul(100)
.div(95);
uint256 nerdzReturn = 0;
if (
whitelist[msg.sender].bought.add(tokenAmount) >
whitelist[msg.sender].alloc
) {
tokenAmount = whitelist[msg.sender].alloc.sub(
whitelist[msg.sender].bought
);
uint256 actualNerdzSpentInWei = tokenAmount
.mul(11)
.div(nerdzPegged)
.mul(95)
.div(100);
nerdzReturn = nerdzReceive.sub(actualNerdzSpentInWei);
}
if (
whitelist[msg.sender].boughtWithNerdz.add(tokenAmount) >=
whitelist[msg.sender].alloc.mul(30).div(100)
) {
tokenAmount = whitelist[msg.sender].alloc.mul(30).div(100).sub(
whitelist[msg.sender].boughtWithNerdz
);
uint256 actualNerdzSpentInWei = tokenAmount
.mul(11)
.div(nerdzPegged)
.mul(95)
.div(100);
nerdzReturn = nerdzReceive.sub(actualNerdzSpentInWei);
}
if (tokenAmount > 0) {
//send 50%, locked 50%
uint256 toSend = tokenAmount.div(2);
uint256 locked = tokenAmount.sub(toSend);
trop.safeTransfer(msg.sender, toSend);
whitelist[msg.sender].bought = whitelist[msg.sender].bought.add(
tokenAmount
);
whitelist[msg.sender].locked = whitelist[msg.sender].locked.add(
locked
);
whitelist[msg.sender].boughtWithNerdz = whitelist[msg.sender]
.boughtWithNerdz
.add(tokenAmount);
totalSold = totalSold.add(tokenAmount);
totalLocked = totalLocked.add(locked);
lockTrop(msg.sender);
}
if (nerdzReturn > 0) {
nerd.safeTransfer(msg.sender, nerdzReturn); //revert if fallback of msg.sender has heavy opertions
}
}
function withdrawLockedToken() external {
require(whitelist[msg.sender].locked > 0);
User storage user = whitelist[msg.sender];
uint256 totalRelease = 0;
for (uint256 i = 0; i < user.releases.length; i++) {
if (
!user.releases[i].isUnlocked &&
user.releases[i].timestamp < block.timestamp
) {
totalRelease = totalRelease.add(user.releases[i].amount);
user.releases[i].isUnlocked = true;
}
}
if (totalRelease > 0) {
trop.safeTransfer(msg.sender, totalRelease);
totalUnlocked = totalUnlocked.add(totalRelease);
}
}
}
Compiler Settings
{"remappings":[],"optimizer":{"runs":200,"enabled":true},"metadata":{"bytecodeHash":"ipfs"},"libraries":{},"evmVersion":"istanbul","compilationTarget":{"PrivateSale.sol":"PrivateSale"}}
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"uint256","name":"_start","internalType":"uint256"},{"type":"uint256","name":"_duration","internalType":"uint256"},{"type":"uint256","name":"_ethPegged","internalType":"uint256"},{"type":"uint256","name":"_nerdzPegged","internalType":"uint256"},{"type":"address","name":"_trop","internalType":"address"}]},{"type":"event","name":"AddedToWhitelist","inputs":[{"type":"address[]","name":"account","internalType":"address[]","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"RemovedFromWhitelist","inputs":[{"type":"address[]","name":"account","internalType":"address[]","indexed":false}],"anonymous":false},{"type":"fallback","stateMutability":"payable"},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"MAX_SALE_DURATION","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"add","inputs":[{"type":"address[]","name":"_addresses","internalType":"address[]"},{"type":"uint256[]","name":"_allocations","internalType":"uint256[]"}]},{"type":"function","stateMutability":"payable","outputs":[],"name":"buyTokenWithETH","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"buyTokenWithNERDz","inputs":[{"type":"uint256","name":"_nerdzAmount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"ethPegged","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isWhitelisted","inputs":[{"type":"address","name":"_address","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IERC20"}],"name":"nerd","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"nerdzPegged","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"remove","inputs":[{"type":"address[]","name":"_addresses","internalType":"address[]"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"saleStart","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"saleStop","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setAllocation","inputs":[{"type":"address","name":"_addr","internalType":"address"},{"type":"uint256","name":"alloc","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setPegged","inputs":[{"type":"uint256","name":"_ethPegged","internalType":"uint256"},{"type":"uint256","name":"_nerdzPegged","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setSaleTime","inputs":[{"type":"uint256","name":"_start","internalType":"uint256"},{"type":"uint256","name":"_duration","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setTokenOwner","inputs":[{"type":"address","name":"_tokenOwner","internalType":"address payable"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setTrop","inputs":[{"type":"address","name":"_trop","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address payable"}],"name":"tokenOwner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalLocked","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalSold","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalUnlocked","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IERC20"}],"name":"trop","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"alloc","internalType":"uint256"},{"type":"uint256","name":"bought","internalType":"uint256"},{"type":"uint256","name":"locked","internalType":"uint256"},{"type":"uint256","name":"boughtWithNerdz","internalType":"uint256"}],"name":"whitelist","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdrawLockedToken","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdrawToken","inputs":[{"type":"address","name":"_token","internalType":"address"}]},{"type":"receive","stateMutability":"payable"}]
Contract Creation Code
0x60806040523480156200001157600080fd5b50604051620022b3380380620022b3833981810160405260a08110156200003757600080fd5b508051602082015160408301516060840151608090940151929391929091906000620000626200015e565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3508415620000ba5784620000bc565b425b6007819055421115620000ce57600080fd5b62127500841115620000df57600080fd5b620000fb846007546200016260201b620017d21790919060201c565b600855600a92909255600b55600380546001600160a01b03199081167332c868f6318d6334b2250f323d914bc2239e4eee17909155600280546001600160a01b039390931692821692909217909155600980549091163317905550620001c49050565b3390565b600082820183811015620001bd576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b6120df80620001d46000396000f3fe6080604052600436106101a05760003560e01c80639076c166116100ec578063aba0606e1161008a578063ca87e67e11610064578063ca87e67e1461065e578063f2474cbe1461068e578063f2fde38b146106a3578063fc6e33ee146106d6576101af565b8063aba0606e14610604578063bb28e85e14610619578063c9aa401914610649576101af565b80639b19251a116100c65780639b19251a1461056c578063a3e67610146105c5578063a779d080146105da578063ab0bcc41146105ef576101af565b80639076c166146104f45780639106d7ba1461052d5780639432515114610542576101af565b80635e4ba17c11610159578063762b6da611610133578063762b6da6146104665780638078059c1461049757806389476069146104ac5780638da5cb5b146104df576101af565b80635e4ba17c146103d45780636effdc30146101af578063715018a614610451576101af565b806318e02bd9146101b75780632315550e146101ea5780633af32abf1461031e5780633f5e6d9314610365578063471b7f091461038c57806356891412146103bf576101af565b366101af576101ad6106eb565b005b6101ad6106eb565b3480156101c357600080fd5b506101ad600480360360208110156101da57600080fd5b50356001600160a01b03166108e5565b3480156101f657600080fd5b506101ad6004803603604081101561020d57600080fd5b81019060208101813564010000000081111561022857600080fd5b82018360208201111561023a57600080fd5b8035906020019184602083028401116401000000008311171561025c57600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092959493602081019350359150506401000000008111156102ac57600080fd5b8201836020820111156102be57600080fd5b803590602001918460208302840111640100000000831117156102e057600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955061095f945050505050565b34801561032a57600080fd5b506103516004803603602081101561034157600080fd5b50356001600160a01b0316610a83565b604080519115158252519081900360200190f35b34801561037157600080fd5b5061037a610aa0565b60408051918252519081900360200190f35b34801561039857600080fd5b506101ad600480360360208110156103af57600080fd5b50356001600160a01b0316610aa6565b3480156103cb57600080fd5b5061037a610b20565b3480156103e057600080fd5b506101ad600480360360208110156103f757600080fd5b81019060208101813564010000000081111561041257600080fd5b82018360208201111561042457600080fd5b8035906020019184602083028401116401000000008311171561044657600080fd5b509092509050610b26565b34801561045d57600080fd5b506101ad610c2e565b34801561047257600080fd5b5061047b610cd0565b604080516001600160a01b039092168252519081900360200190f35b3480156104a357600080fd5b5061037a610cdf565b3480156104b857600080fd5b506101ad600480360360208110156104cf57600080fd5b50356001600160a01b0316610ce5565b3480156104eb57600080fd5b5061047b610f62565b34801561050057600080fd5b506101ad6004803603604081101561051757600080fd5b506001600160a01b038135169060200135610f71565b34801561053957600080fd5b5061037a610fe5565b34801561054e57600080fd5b506101ad6004803603602081101561056557600080fd5b5035610feb565b34801561057857600080fd5b5061059f6004803603602081101561058f57600080fd5b50356001600160a01b031661145c565b604080519485526020850193909352838301919091526060830152519081900360800190f35b3480156105d157600080fd5b5061047b611484565b3480156105e657600080fd5b5061037a611493565b3480156105fb57600080fd5b5061037a611499565b34801561061057600080fd5b5061047b61149f565b34801561062557600080fd5b506101ad6004803603604081101561063c57600080fd5b50803590602001356114ae565b34801561065557600080fd5b5061037a611511565b34801561066a57600080fd5b506101ad6004803603604081101561068157600080fd5b5080359060200135611517565b34801561069a57600080fd5b506101ad61159f565b3480156106af57600080fd5b506101ad600480360360208110156106c657600080fd5b50356001600160a01b03166116d3565b3480156106e257600080fd5b5061037a6117cb565b6106f433610a83565b6106fd57600080fd5b600754421015801561071157506008544211155b610751576040805162461bcd60e51b815260206004820152600c60248201526b696e76616c69642074696d6560a01b604482015290519081900360640190fd5b6000610773600b61076d600a543461183590919063ffffffff16565b9061188e565b33600090815260016020819052604082208054910154929350909161079890846117d2565b11156107ed573360009081526001602081905260409091209081015490546107bf916118d0565b915060006107dd600a5461076d600b8661183590919063ffffffff16565b90506107e934826118d0565b9150505b81156108ac57600061080083600261188e565b9050600061080e84836118d0565b600254909150610828906001600160a01b03163384611912565b336000908152600160208190526040909120015461084690856117d2565b336000908152600160208190526040909120908101919091556002015461086d90826117d2565b3360009081526001602052604090206002015560045461088d90856117d2565b60045560055461089d90826117d2565b6005556108a933611964565b50505b80156108e157604051339082156108fc029083906000818181858888f193505050501580156108df573d6000803e3d6000fd5b505b5050565b6108ed611c7d565b6000546001600160a01b0390811691161461093d576040805162461bcd60e51b81526020600482018190526024820152600080516020612060833981519152604482015290519081900360640190fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b610967611c7d565b6000546001600160a01b039081169116146109b7576040805162461bcd60e51b81526020600482018190526024820152600080516020612060833981519152604482015290519081900360640190fd5b80518251146109c557600080fd5b60005b8251811015610a0957610a018382815181106109e057fe5b60200260200101518383815181106109f457fe5b6020026020010151610f71565b6001016109c8565b507fe3c5086a518f78e8aa61952bb9c28a9a0f0022707e537ea961faa918e0d89f6f826040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610a6c578181015183820152602001610a54565b505050509050019250505060405180910390a15050565b6001600160a01b0316600090815260016020526040902054151590565b600b5481565b610aae611c7d565b6000546001600160a01b03908116911614610afe576040805162461bcd60e51b81526020600482018190526024820152600080516020612060833981519152604482015290519081900360640190fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b60055481565b610b2e611c7d565b6000546001600160a01b03908116911614610b7e576040805162461bcd60e51b81526020600482018190526024820152600080516020612060833981519152604482015290519081900360640190fd5b60005b81811115610bc657600060016000858585818110610b9b57fe5b602090810292909201356001600160a01b031683525081019190915260400160002055600101610b81565b507f17dbdef66bfe28946fe1bf49cc6946533e58c6e0ecbf907152e406b630eb4f27828260405180806020018281038252848482818152602001925060200280828437600083820152604051601f909101601f19169092018290039550909350505050a15050565b610c36611c7d565b6000546001600160a01b03908116911614610c86576040805162461bcd60e51b81526020600482018190526024820152600080516020612060833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6003546001600160a01b031681565b60085481565b610ced611c7d565b6000546001600160a01b03908116911614610d3d576040805162461bcd60e51b81526020600482018190526024820152600080516020612060833981519152604482015290519081900360640190fd5b6002546001600160a01b0382811691161415610e7e576008544211610d6157600080fd5b600254604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610dac57600080fd5b505afa158015610dc0573d6000803e3d6000fd5b505050506040513d6020811015610dd657600080fd5b50516002546009546005549293506001600160a01b039182169263a9059cbb9290911690610e059085906118d0565b6040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610e4b57600080fd5b505af1158015610e5f573d6000803e3d6000fd5b505050506040513d6020811015610e7557600080fd5b50610f5f915050565b6001600160a01b038116610ecb576009546040516001600160a01b03909116904780156108fc02916000818181858888f19350505050158015610ec5573d6000803e3d6000fd5b50610f5f565b604080516370a0823160e01b8152306004820152905182916000916001600160a01b038416916370a08231916024808301926020929190829003018186803b158015610f1657600080fd5b505afa158015610f2a573d6000803e3d6000fd5b505050506040513d6020811015610f4057600080fd5b50516009549091506108df906001600160a01b03848116911683611912565b50565b6000546001600160a01b031690565b610f79611c7d565b6000546001600160a01b03908116911614610fc9576040805162461bcd60e51b81526020600482018190526024820152600080516020612060833981519152604482015290519081900360640190fd5b6001600160a01b03909116600090815260016020526040902055565b60045481565b610ff433610a83565b610ffd57600080fd5b600754421015801561101157506008544211155b611051576040805162461bcd60e51b815260206004820152600c60248201526b696e76616c69642074696d6560a01b604482015290519081900360640190fd5b336000908152600160205260409020546110739060649061076d90601e611835565b33600090815260016020526040902060040154106110d8576040805162461bcd60e51b815260206004820152601e60248201527f63616e6e6f74206275792077697468206e6572647a20616e79206d6f72650000604482015290519081900360640190fd5b600354604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561112357600080fd5b505afa158015611137573d6000803e3d6000fd5b505050506040513d602081101561114d57600080fd5b505160035490915061116a906001600160a01b0316333085611c81565b600354604080516370a0823160e01b815230600482015290516000926111f09285926001600160a01b03909216916370a0823191602480820192602092909190829003018186803b1580156111be57600080fd5b505afa1580156111d2573d6000803e3d6000fd5b505050506040513d60208110156111e857600080fd5b5051906118d0565b9050600061121e605f61076d6064611218600b61076d600b548961183590919063ffffffff16565b90611835565b33600090815260016020819052604082208054910154929350909161124390846117d2565b11156112a25733600090815260016020819052604090912090810154905461126a916118d0565b91506000611292606461076d605f611218600b5461076d600b8a61183590919063ffffffff16565b905061129e84826118d0565b9150505b336000908152600160205260409020546112c49060649061076d90601e611835565b336000908152600160205260409020600401546112e190846117d2565b10611351573360009081526001602052604090206004810154905461131991906113139060649061076d90601e611835565b906118d0565b91506000611341606461076d605f611218600b5461076d600b8a61183590919063ffffffff16565b905061134d84826118d0565b9150505b811561143857600061136483600261188e565b9050600061137284836118d0565b60025490915061138c906001600160a01b03163384611912565b33600090815260016020819052604090912001546113aa90856117d2565b33600090815260016020819052604090912090810191909155600201546113d190826117d2565b3360009081526001602052604090206002810191909155600401546113f690856117d2565b3360009081526001602052604090206004908101919091555461141990856117d2565b60045560055461142990826117d2565b60055561143533611964565b50505b801561145557600354611455906001600160a01b03163383611912565b5050505050565b6001602081905260009182526040909120805491810154600282015460049092015490919084565b6009546001600160a01b031681565b60065481565b60075481565b6002546001600160a01b031681565b6114b6611c7d565b6000546001600160a01b03908116911614611506576040805162461bcd60e51b81526020600482018190526024820152600080516020612060833981519152604482015290519081900360640190fd5b600a91909155600b55565b600a5481565b61151f611c7d565b6000546001600160a01b0390811691161461156f576040805162461bcd60e51b81526020600482018190526024820152600080516020612060833981519152604482015290519081900360640190fd5b60075461157c5760078290555b62127500811061158b57600080fd5b60075461159890826117d2565b6008555050565b336000908152600160205260409020600201546115bb57600080fd5b33600090815260016020526040812090805b60038301548110156116a1578260030181815481106115e857fe5b600091825260209091206002600390920201015460ff1615801561162b57504283600301828154811061161757fe5b906000526020600020906003020160000154105b156116995761166383600301828154811061164257fe5b906000526020600020906003020160010154836117d290919063ffffffff16565b9150600183600301828154811061167657fe5b60009182526020909120600390910201600201805460ff19169115159190911790555b6001016115cd565b5080156108e1576002546116bf906001600160a01b03163383611912565b6006546116cc90826117d2565b6006555050565b6116db611c7d565b6000546001600160a01b0390811691161461172b576040805162461bcd60e51b81526020600482018190526024820152600080516020612060833981519152604482015290519081900360640190fd5b6001600160a01b0381166117705760405162461bcd60e51b81526004018080602001828103825260268152602001806120196026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6212750081565b60008282018381101561182c576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b90505b92915050565b6000826118445750600061182f565b8282028284828161185157fe5b041461182c5760405162461bcd60e51b815260040180806020018281038252602181526020018061203f6021913960400191505060405180910390fd5b600061182c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611ce1565b600061182c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611d83565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526108df908490611ddd565b6001600160a01b038116600090815260016020526040812060028101549161198f9160030190611fd1565b60016000836001600160a01b03166001600160a01b0316815260200190815260200160002060030160405180606001604052806119da62278d006007546117d290919063ffffffff16565b81526020016119ef606461076d86601e611835565b8152600060209182018190528354600180820186559482528282208451600392830290910190815584840151818701556040948501516002909101805460ff19169115159190911790556001600160a01b0387168252939091528190208151606081019092526007549201918190611a6a90624f1a006117d2565b8152602001611a7f606461076d866014611835565b8152600060209182018190528354600180820186559482528282208451600392830290910190815584840151818701556040948501516002909101805460ff19169115159190911790556001600160a01b0387168252939091528190208151606081019092526007549201918190611afa906276a7006117d2565b8152602001611b0f606461076d866014611835565b8152600060209182018190528354600180820186559482528282208451600392830290910190815584840151818701556040948501516002909101805460ff19169115159190911790556001600160a01b0387168252939091528190208151606081019092526007549201918190611b8a90629e34006117d2565b8152602001611b9f606461076d866014611835565b8152600060209182018190528354600180820186559482528282208451600392830290910190815584840151818701556040948501516002909101805460ff19169115159190911790556001600160a01b0387168252939091528190208151606081019092526007549201918190611c1a9062c5c1006117d2565b8152602001611c2f606461076d86600a611835565b8152600060209182018190528354600180820186559482529082902083516003909202019081559082015192810192909255604001516002909101805460ff19169115159190911790555050565b3390565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052611cdb908590611ddd565b50505050565b60008183611d6d5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611d32578181015183820152602001611d1a565b50505050905090810190601f168015611d5f5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581611d7957fe5b0495945050505050565b60008184841115611dd55760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611d32578181015183820152602001611d1a565b505050900390565b611def826001600160a01b0316611f95565b611e40576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b60208310611e7e5780518252601f199092019160209182019101611e5f565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611ee0576040519150601f19603f3d011682016040523d82523d6000602084013e611ee5565b606091505b509150915081611f3c576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b805115611cdb57808060200190516020811015611f5857600080fd5b5051611cdb5760405162461bcd60e51b815260040180806020018281038252602a815260200180612080602a913960400191505060405180910390fd5b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470818114801590611fc957508115155b949350505050565b5080546000825560030290600052602060002090810190610f5f91905b80821115612014576000808255600182015560028101805460ff19169055600301611fee565b509056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a26469706673582212208e4429f818f32fcb0cd2c9aa184cc92958b20345e016dd451101f9601f934a6664736f6c634300060c00330000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012750000000000000000000000000000000000000000000000000000000000000004b0000000000000000000000000000000000000000000000000000000000000011a0000000000000000000000002ec75589856562646afe393455986cad26c4cc5f
Deployed ByteCode
0x6080604052600436106101a05760003560e01c80639076c166116100ec578063aba0606e1161008a578063ca87e67e11610064578063ca87e67e1461065e578063f2474cbe1461068e578063f2fde38b146106a3578063fc6e33ee146106d6576101af565b8063aba0606e14610604578063bb28e85e14610619578063c9aa401914610649576101af565b80639b19251a116100c65780639b19251a1461056c578063a3e67610146105c5578063a779d080146105da578063ab0bcc41146105ef576101af565b80639076c166146104f45780639106d7ba1461052d5780639432515114610542576101af565b80635e4ba17c11610159578063762b6da611610133578063762b6da6146104665780638078059c1461049757806389476069146104ac5780638da5cb5b146104df576101af565b80635e4ba17c146103d45780636effdc30146101af578063715018a614610451576101af565b806318e02bd9146101b75780632315550e146101ea5780633af32abf1461031e5780633f5e6d9314610365578063471b7f091461038c57806356891412146103bf576101af565b366101af576101ad6106eb565b005b6101ad6106eb565b3480156101c357600080fd5b506101ad600480360360208110156101da57600080fd5b50356001600160a01b03166108e5565b3480156101f657600080fd5b506101ad6004803603604081101561020d57600080fd5b81019060208101813564010000000081111561022857600080fd5b82018360208201111561023a57600080fd5b8035906020019184602083028401116401000000008311171561025c57600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092959493602081019350359150506401000000008111156102ac57600080fd5b8201836020820111156102be57600080fd5b803590602001918460208302840111640100000000831117156102e057600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955061095f945050505050565b34801561032a57600080fd5b506103516004803603602081101561034157600080fd5b50356001600160a01b0316610a83565b604080519115158252519081900360200190f35b34801561037157600080fd5b5061037a610aa0565b60408051918252519081900360200190f35b34801561039857600080fd5b506101ad600480360360208110156103af57600080fd5b50356001600160a01b0316610aa6565b3480156103cb57600080fd5b5061037a610b20565b3480156103e057600080fd5b506101ad600480360360208110156103f757600080fd5b81019060208101813564010000000081111561041257600080fd5b82018360208201111561042457600080fd5b8035906020019184602083028401116401000000008311171561044657600080fd5b509092509050610b26565b34801561045d57600080fd5b506101ad610c2e565b34801561047257600080fd5b5061047b610cd0565b604080516001600160a01b039092168252519081900360200190f35b3480156104a357600080fd5b5061037a610cdf565b3480156104b857600080fd5b506101ad600480360360208110156104cf57600080fd5b50356001600160a01b0316610ce5565b3480156104eb57600080fd5b5061047b610f62565b34801561050057600080fd5b506101ad6004803603604081101561051757600080fd5b506001600160a01b038135169060200135610f71565b34801561053957600080fd5b5061037a610fe5565b34801561054e57600080fd5b506101ad6004803603602081101561056557600080fd5b5035610feb565b34801561057857600080fd5b5061059f6004803603602081101561058f57600080fd5b50356001600160a01b031661145c565b604080519485526020850193909352838301919091526060830152519081900360800190f35b3480156105d157600080fd5b5061047b611484565b3480156105e657600080fd5b5061037a611493565b3480156105fb57600080fd5b5061037a611499565b34801561061057600080fd5b5061047b61149f565b34801561062557600080fd5b506101ad6004803603604081101561063c57600080fd5b50803590602001356114ae565b34801561065557600080fd5b5061037a611511565b34801561066a57600080fd5b506101ad6004803603604081101561068157600080fd5b5080359060200135611517565b34801561069a57600080fd5b506101ad61159f565b3480156106af57600080fd5b506101ad600480360360208110156106c657600080fd5b50356001600160a01b03166116d3565b3480156106e257600080fd5b5061037a6117cb565b6106f433610a83565b6106fd57600080fd5b600754421015801561071157506008544211155b610751576040805162461bcd60e51b815260206004820152600c60248201526b696e76616c69642074696d6560a01b604482015290519081900360640190fd5b6000610773600b61076d600a543461183590919063ffffffff16565b9061188e565b33600090815260016020819052604082208054910154929350909161079890846117d2565b11156107ed573360009081526001602081905260409091209081015490546107bf916118d0565b915060006107dd600a5461076d600b8661183590919063ffffffff16565b90506107e934826118d0565b9150505b81156108ac57600061080083600261188e565b9050600061080e84836118d0565b600254909150610828906001600160a01b03163384611912565b336000908152600160208190526040909120015461084690856117d2565b336000908152600160208190526040909120908101919091556002015461086d90826117d2565b3360009081526001602052604090206002015560045461088d90856117d2565b60045560055461089d90826117d2565b6005556108a933611964565b50505b80156108e157604051339082156108fc029083906000818181858888f193505050501580156108df573d6000803e3d6000fd5b505b5050565b6108ed611c7d565b6000546001600160a01b0390811691161461093d576040805162461bcd60e51b81526020600482018190526024820152600080516020612060833981519152604482015290519081900360640190fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b610967611c7d565b6000546001600160a01b039081169116146109b7576040805162461bcd60e51b81526020600482018190526024820152600080516020612060833981519152604482015290519081900360640190fd5b80518251146109c557600080fd5b60005b8251811015610a0957610a018382815181106109e057fe5b60200260200101518383815181106109f457fe5b6020026020010151610f71565b6001016109c8565b507fe3c5086a518f78e8aa61952bb9c28a9a0f0022707e537ea961faa918e0d89f6f826040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610a6c578181015183820152602001610a54565b505050509050019250505060405180910390a15050565b6001600160a01b0316600090815260016020526040902054151590565b600b5481565b610aae611c7d565b6000546001600160a01b03908116911614610afe576040805162461bcd60e51b81526020600482018190526024820152600080516020612060833981519152604482015290519081900360640190fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b60055481565b610b2e611c7d565b6000546001600160a01b03908116911614610b7e576040805162461bcd60e51b81526020600482018190526024820152600080516020612060833981519152604482015290519081900360640190fd5b60005b81811115610bc657600060016000858585818110610b9b57fe5b602090810292909201356001600160a01b031683525081019190915260400160002055600101610b81565b507f17dbdef66bfe28946fe1bf49cc6946533e58c6e0ecbf907152e406b630eb4f27828260405180806020018281038252848482818152602001925060200280828437600083820152604051601f909101601f19169092018290039550909350505050a15050565b610c36611c7d565b6000546001600160a01b03908116911614610c86576040805162461bcd60e51b81526020600482018190526024820152600080516020612060833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6003546001600160a01b031681565b60085481565b610ced611c7d565b6000546001600160a01b03908116911614610d3d576040805162461bcd60e51b81526020600482018190526024820152600080516020612060833981519152604482015290519081900360640190fd5b6002546001600160a01b0382811691161415610e7e576008544211610d6157600080fd5b600254604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610dac57600080fd5b505afa158015610dc0573d6000803e3d6000fd5b505050506040513d6020811015610dd657600080fd5b50516002546009546005549293506001600160a01b039182169263a9059cbb9290911690610e059085906118d0565b6040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610e4b57600080fd5b505af1158015610e5f573d6000803e3d6000fd5b505050506040513d6020811015610e7557600080fd5b50610f5f915050565b6001600160a01b038116610ecb576009546040516001600160a01b03909116904780156108fc02916000818181858888f19350505050158015610ec5573d6000803e3d6000fd5b50610f5f565b604080516370a0823160e01b8152306004820152905182916000916001600160a01b038416916370a08231916024808301926020929190829003018186803b158015610f1657600080fd5b505afa158015610f2a573d6000803e3d6000fd5b505050506040513d6020811015610f4057600080fd5b50516009549091506108df906001600160a01b03848116911683611912565b50565b6000546001600160a01b031690565b610f79611c7d565b6000546001600160a01b03908116911614610fc9576040805162461bcd60e51b81526020600482018190526024820152600080516020612060833981519152604482015290519081900360640190fd5b6001600160a01b03909116600090815260016020526040902055565b60045481565b610ff433610a83565b610ffd57600080fd5b600754421015801561101157506008544211155b611051576040805162461bcd60e51b815260206004820152600c60248201526b696e76616c69642074696d6560a01b604482015290519081900360640190fd5b336000908152600160205260409020546110739060649061076d90601e611835565b33600090815260016020526040902060040154106110d8576040805162461bcd60e51b815260206004820152601e60248201527f63616e6e6f74206275792077697468206e6572647a20616e79206d6f72650000604482015290519081900360640190fd5b600354604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561112357600080fd5b505afa158015611137573d6000803e3d6000fd5b505050506040513d602081101561114d57600080fd5b505160035490915061116a906001600160a01b0316333085611c81565b600354604080516370a0823160e01b815230600482015290516000926111f09285926001600160a01b03909216916370a0823191602480820192602092909190829003018186803b1580156111be57600080fd5b505afa1580156111d2573d6000803e3d6000fd5b505050506040513d60208110156111e857600080fd5b5051906118d0565b9050600061121e605f61076d6064611218600b61076d600b548961183590919063ffffffff16565b90611835565b33600090815260016020819052604082208054910154929350909161124390846117d2565b11156112a25733600090815260016020819052604090912090810154905461126a916118d0565b91506000611292606461076d605f611218600b5461076d600b8a61183590919063ffffffff16565b905061129e84826118d0565b9150505b336000908152600160205260409020546112c49060649061076d90601e611835565b336000908152600160205260409020600401546112e190846117d2565b10611351573360009081526001602052604090206004810154905461131991906113139060649061076d90601e611835565b906118d0565b91506000611341606461076d605f611218600b5461076d600b8a61183590919063ffffffff16565b905061134d84826118d0565b9150505b811561143857600061136483600261188e565b9050600061137284836118d0565b60025490915061138c906001600160a01b03163384611912565b33600090815260016020819052604090912001546113aa90856117d2565b33600090815260016020819052604090912090810191909155600201546113d190826117d2565b3360009081526001602052604090206002810191909155600401546113f690856117d2565b3360009081526001602052604090206004908101919091555461141990856117d2565b60045560055461142990826117d2565b60055561143533611964565b50505b801561145557600354611455906001600160a01b03163383611912565b5050505050565b6001602081905260009182526040909120805491810154600282015460049092015490919084565b6009546001600160a01b031681565b60065481565b60075481565b6002546001600160a01b031681565b6114b6611c7d565b6000546001600160a01b03908116911614611506576040805162461bcd60e51b81526020600482018190526024820152600080516020612060833981519152604482015290519081900360640190fd5b600a91909155600b55565b600a5481565b61151f611c7d565b6000546001600160a01b0390811691161461156f576040805162461bcd60e51b81526020600482018190526024820152600080516020612060833981519152604482015290519081900360640190fd5b60075461157c5760078290555b62127500811061158b57600080fd5b60075461159890826117d2565b6008555050565b336000908152600160205260409020600201546115bb57600080fd5b33600090815260016020526040812090805b60038301548110156116a1578260030181815481106115e857fe5b600091825260209091206002600390920201015460ff1615801561162b57504283600301828154811061161757fe5b906000526020600020906003020160000154105b156116995761166383600301828154811061164257fe5b906000526020600020906003020160010154836117d290919063ffffffff16565b9150600183600301828154811061167657fe5b60009182526020909120600390910201600201805460ff19169115159190911790555b6001016115cd565b5080156108e1576002546116bf906001600160a01b03163383611912565b6006546116cc90826117d2565b6006555050565b6116db611c7d565b6000546001600160a01b0390811691161461172b576040805162461bcd60e51b81526020600482018190526024820152600080516020612060833981519152604482015290519081900360640190fd5b6001600160a01b0381166117705760405162461bcd60e51b81526004018080602001828103825260268152602001806120196026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6212750081565b60008282018381101561182c576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b90505b92915050565b6000826118445750600061182f565b8282028284828161185157fe5b041461182c5760405162461bcd60e51b815260040180806020018281038252602181526020018061203f6021913960400191505060405180910390fd5b600061182c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611ce1565b600061182c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611d83565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526108df908490611ddd565b6001600160a01b038116600090815260016020526040812060028101549161198f9160030190611fd1565b60016000836001600160a01b03166001600160a01b0316815260200190815260200160002060030160405180606001604052806119da62278d006007546117d290919063ffffffff16565b81526020016119ef606461076d86601e611835565b8152600060209182018190528354600180820186559482528282208451600392830290910190815584840151818701556040948501516002909101805460ff19169115159190911790556001600160a01b0387168252939091528190208151606081019092526007549201918190611a6a90624f1a006117d2565b8152602001611a7f606461076d866014611835565b8152600060209182018190528354600180820186559482528282208451600392830290910190815584840151818701556040948501516002909101805460ff19169115159190911790556001600160a01b0387168252939091528190208151606081019092526007549201918190611afa906276a7006117d2565b8152602001611b0f606461076d866014611835565b8152600060209182018190528354600180820186559482528282208451600392830290910190815584840151818701556040948501516002909101805460ff19169115159190911790556001600160a01b0387168252939091528190208151606081019092526007549201918190611b8a90629e34006117d2565b8152602001611b9f606461076d866014611835565b8152600060209182018190528354600180820186559482528282208451600392830290910190815584840151818701556040948501516002909101805460ff19169115159190911790556001600160a01b0387168252939091528190208151606081019092526007549201918190611c1a9062c5c1006117d2565b8152602001611c2f606461076d86600a611835565b8152600060209182018190528354600180820186559482529082902083516003909202019081559082015192810192909255604001516002909101805460ff19169115159190911790555050565b3390565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052611cdb908590611ddd565b50505050565b60008183611d6d5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611d32578181015183820152602001611d1a565b50505050905090810190601f168015611d5f5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581611d7957fe5b0495945050505050565b60008184841115611dd55760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611d32578181015183820152602001611d1a565b505050900390565b611def826001600160a01b0316611f95565b611e40576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b60208310611e7e5780518252601f199092019160209182019101611e5f565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611ee0576040519150601f19603f3d011682016040523d82523d6000602084013e611ee5565b606091505b509150915081611f3c576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b805115611cdb57808060200190516020811015611f5857600080fd5b5051611cdb5760405162461bcd60e51b815260040180806020018281038252602a815260200180612080602a913960400191505060405180910390fd5b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470818114801590611fc957508115155b949350505050565b5080546000825560030290600052602060002090810190610f5f91905b80821115612014576000808255600182015560028101805460ff19169055600301611fee565b509056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a26469706673582212208e4429f818f32fcb0cd2c9aa184cc92958b20345e016dd451101f9601f934a6664736f6c634300060c0033