Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- TestERC20
- Optimization enabled
- true
- Compiler version
- v0.8.3+commit.8d00100c
- Optimization runs
- 1
- EVM Version
- default
- Verified at
- 2022-02-24T11:58:43.573807Z
Contract source code
// Sources flattened with hardhat v2.7.0 https://hardhat.org
// File @openzeppelin/contracts/utils/[email protected]
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (utils/Context.sol)
pragma solidity ^0.8.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 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) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
// File @openzeppelin/contracts/access/[email protected]
// OpenZeppelin Contracts v4.4.0 (access/Ownable.sol)
pragma solidity ^0.8.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.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(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");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
// File @openzeppelin/contracts/token/ERC20/[email protected]
// OpenZeppelin Contracts v4.4.0 (token/ERC20/IERC20.sol)
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);
/**
* @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/token/ERC20/extensions/[email protected]
// OpenZeppelin Contracts v4.4.0 (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
// File @openzeppelin/contracts/token/ERC20/[email protected]
// OpenZeppelin Contracts v4.4.0 (token/ERC20/ERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin Contracts guidelines: functions revert
* instead returning `false` on failure. This behavior is nonetheless
* conventional and does not conflict with the expectations of ERC20
* applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
contract ERC20 is Context, IERC20, IERC20Metadata {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* The default value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5.05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless this function is
* overridden;
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual override returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
unchecked {
_approve(sender, _msgSender(), currentAllowance - amount);
}
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
}
return true;
}
/**
* @dev Moves `amount` of tokens from `sender` to `recipient`.
*
* This internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[sender] = senderBalance - amount;
}
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
_afterTokenTransfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
_afterTokenTransfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked {
_balances[account] = accountBalance - amount;
}
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
_afterTokenTransfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
/**
* @dev Hook that is called after any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* has been transferred to `to`.
* - when `from` is zero, `amount` tokens have been minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens have been burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
}
// File contracts/TestToken.sol
pragma solidity 0.8.3;
contract TestERC20 is Ownable, ERC20 {
uint256 public contestsStartDate;
uint256 public contestsDuration;
uint256 private claimableAmount = 100e18;
mapping(address => uint256) private lastClaim;
mapping(address => bool) private privilegedAccounts;
function mint(address account, uint256 amount) external onlyOwner {
_mint(account, amount);
}
function setContestStartDate(uint256 startDate) external onlyOwner {
contestsStartDate = startDate;
}
function setContestDuration(uint256 _contestsDuration) external onlyOwner {
contestsDuration = _contestsDuration;
}
function addPrivilegedAccounts(address account, bool active)
external
onlyOwner
{
privilegedAccounts[account] = active;
}
function claim(address account) external {
require(availableToClaim(account), "not available tokens for claim");
lastClaim[account] = block.timestamp;
_mint(account, claimableAmount);
}
function availableToClaim(address account) public view returns (bool) {
/*
if (block.timestamp < contestsStartDate || block.timestamp > contestsStartDate + contestsDuration) {
return false;
}
**/
if (lastClaim[account] == 0) {
return true;
}
if (
(lastClaim[account] - contestsStartDate) / 1 days <
(block.timestamp - contestsStartDate) / 1 days
) {
return true;
}
return false;
}
function burn(address account, uint256 amount) external onlyOwner {
_burn(account, amount);
}
function withdraw() external onlyOwner {
address payable payer = payable(msg.sender);
payer.transfer((address(this).balance));
}
constructor() ERC20("USDT test token", "USDT") {}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
if (
block.timestamp > contestsStartDate &&
block.timestamp < contestsStartDate + contestsDuration
) {
require(
privilegedAccounts[msg.sender] || privilegedAccounts[recipient],
"Not allowed transfer"
);
}
return super.transfer(recipient, amount);
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
if (
block.timestamp > contestsStartDate &&
block.timestamp < contestsStartDate + contestsDuration
) {
require(
privilegedAccounts[sender] || privilegedAccounts[recipient],
"Not allowed transfer"
);
}
return super.transferFrom(sender, recipient, amount);
}
}
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[]},{"type":"event","name":"Approval","inputs":[{"type":"address","name":"owner","internalType":"address","indexed":true},{"type":"address","name":"spender","internalType":"address","indexed":true},{"type":"uint256","name":"value","internalType":"uint256","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":"Transfer","inputs":[{"type":"address","name":"from","internalType":"address","indexed":true},{"type":"address","name":"to","internalType":"address","indexed":true},{"type":"uint256","name":"value","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addPrivilegedAccounts","inputs":[{"type":"address","name":"account","internalType":"address"},{"type":"bool","name":"active","internalType":"bool"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"allowance","inputs":[{"type":"address","name":"owner","internalType":"address"},{"type":"address","name":"spender","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"approve","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"availableToClaim","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balanceOf","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"burn","inputs":[{"type":"address","name":"account","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"claim","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"contestsDuration","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"contestsStartDate","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint8","name":"","internalType":"uint8"}],"name":"decimals","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"decreaseAllowance","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"subtractedValue","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"increaseAllowance","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"addedValue","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"mint","inputs":[{"type":"address","name":"account","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"name","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setContestDuration","inputs":[{"type":"uint256","name":"_contestsDuration","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setContestStartDate","inputs":[{"type":"uint256","name":"startDate","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"symbol","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalSupply","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"transfer","inputs":[{"type":"address","name":"recipient","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"transferFrom","inputs":[{"type":"address","name":"sender","internalType":"address"},{"type":"address","name":"recipient","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdraw","inputs":[]}]
Contract Creation Code
0x608060405268056bc75e2d631000006008553480156200001e57600080fd5b506040518060400160405280600f81526020016e2aa9a22a103a32b9ba103a37b5b2b760891b815250604051806040016040528060048152602001631554d11560e21b8152506200007e62000078620000b260201b60201c565b620000b6565b81516200009390600490602085019062000106565b508051620000a990600590602084019062000106565b505050620001e9565b3390565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b8280546200011490620001ac565b90600052602060002090601f01602090048101928262000138576000855562000183565b82601f106200015357805160ff191683800117855562000183565b8280016001018555821562000183579182015b828111156200018357825182559160200191906001019062000166565b506200019192915062000195565b5090565b5b8082111562000191576000815560010162000196565b600181811c90821680620001c157607f821691505b60208210811415620001e357634e487b7160e01b600052602260045260246000fd5b50919050565b61120880620001f96000396000f3fe608060405234801561001057600080fd5b50600436106101285760003560e01c806306fdde031461012d578063095ea7b31461014b5780630da451881461016e578063169b8cd51461018157806318160ddd146101985780631e83409a146101a057806323b872dd146101b5578063313ce567146101c857806339509351146101d75780633ccfd60b146101ea57806340c10f19146101f257806363eae6541461020557806370a082311461020e578063715018a614610237578063813b5da81461023f578063891d7e7f146102525780638a469461146102655780638da5cb5b1461027857806395d89b41146102985780639dc29fac146102a0578063a457c2d7146102b3578063a9059cbb146102c6578063dd62ed3e146102d9578063f2fde38b14610312575b600080fd5b610135610325565b604051610142919061105c565b60405180910390f35b61015e61015936600461101b565b6103b7565b6040519015158152602001610142565b61015e61017c366004610f5a565b6103cd565b61018a60065481565b604051908152602001610142565b60035461018a565b6101b36101ae366004610f5a565b610459565b005b61015e6101c3366004610fa6565b6104df565b60405160128152602001610142565b61015e6101e536600461101b565b610573565b6101b36105af565b6101b361020036600461101b565b610610565b61018a60075481565b61018a61021c366004610f5a565b6001600160a01b031660009081526001602052604090205490565b6101b3610649565b6101b361024d366004611044565b610684565b6101b3610260366004611044565b6106b8565b6101b3610273366004610fe1565b6106ec565b610280610746565b6040516001600160a01b039091168152602001610142565b610135610755565b6101b36102ae36600461101b565b610764565b61015e6102c136600461101b565b61079d565b61015e6102d436600461101b565b610836565b61018a6102e7366004610f74565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b6101b3610320366004610f5a565b6108bf565b60606004805461033490611161565b80601f016020809104026020016040519081016040528092919081815260200182805461036090611161565b80156103ad5780601f10610382576101008083540402835291602001916103ad565b820191906000526020600020905b81548152906001019060200180831161039057829003601f168201915b5050505050905090565b60006103c433848461095c565b50600192915050565b6001600160a01b0381166000908152600960205260408120546103f257506001610454565b6201518060065442610404919061114a565b61040e919061112a565b6006546001600160a01b03841660009081526009602052604090205462015180916104389161114a565b610442919061112a565b101561045057506001610454565b5060005b919050565b610462816103cd565b6104b35760405162461bcd60e51b815260206004820152601e60248201527f6e6f7420617661696c61626c6520746f6b656e7320666f7220636c61696d000060448201526064015b60405180910390fd5b6001600160a01b03811660009081526009602052604090204290556008546104dc908290610a81565b50565b60006006544211801561050057506007546006546104fd9190611112565b42105b15610560576001600160a01b0384166000908152600a602052604090205460ff168061054457506001600160a01b0383166000908152600a602052604090205460ff165b6105605760405162461bcd60e51b81526004016104aa906110af565b61056b848484610b4f565b949350505050565b3360008181526002602090815260408083206001600160a01b038716845290915281205490916103c49185906105aa908690611112565b61095c565b336105b8610746565b6001600160a01b0316146105de5760405162461bcd60e51b81526004016104aa906110dd565b604051339081904780156108fc02916000818181858888f1935050505015801561060c573d6000803e3d6000fd5b5050565b33610619610746565b6001600160a01b03161461063f5760405162461bcd60e51b81526004016104aa906110dd565b61060c8282610a81565b33610652610746565b6001600160a01b0316146106785760405162461bcd60e51b81526004016104aa906110dd565b6106826000610bf9565b565b3361068d610746565b6001600160a01b0316146106b35760405162461bcd60e51b81526004016104aa906110dd565b600755565b336106c1610746565b6001600160a01b0316146106e75760405162461bcd60e51b81526004016104aa906110dd565b600655565b336106f5610746565b6001600160a01b03161461071b5760405162461bcd60e51b81526004016104aa906110dd565b6001600160a01b03919091166000908152600a60205260409020805460ff1916911515919091179055565b6000546001600160a01b031690565b60606005805461033490611161565b3361076d610746565b6001600160a01b0316146107935760405162461bcd60e51b81526004016104aa906110dd565b61060c8282610c49565b3360009081526002602090815260408083206001600160a01b03861684529091528120548281101561081f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016104aa565b61082c338585840361095c565b5060019392505050565b60006006544211801561085757506007546006546108549190611112565b42105b156108ae57336000908152600a602052604090205460ff168061089257506001600160a01b0383166000908152600a602052604090205460ff165b6108ae5760405162461bcd60e51b81526004016104aa906110af565b6108b88383610d7d565b9392505050565b336108c8610746565b6001600160a01b0316146108ee5760405162461bcd60e51b81526004016104aa906110dd565b6001600160a01b0381166109535760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104aa565b6104dc81610bf9565b6001600160a01b0383166109be5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104aa565b6001600160a01b038216610a1f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104aa565b6001600160a01b0383811660008181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b038216610ad75760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016104aa565b8060036000828254610ae99190611112565b90915550506001600160a01b03821660009081526001602052604081208054839290610b16908490611112565b90915550506040518181526001600160a01b038316906000906000805160206111b38339815191529060200160405180910390a361060c565b6000610b5c848484610d86565b6001600160a01b038416600090815260026020908152604080832033845290915290205482811015610be15760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084016104aa565b610bee853385840361095c565b506001949350505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038216610ca95760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016104aa565b6001600160a01b03821660009081526001602052604090205481811015610d1d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b60648201526084016104aa565b6001600160a01b0383166000908152600160205260408120838303905560038054849290610d4c90849061114a565b90915550506040518281526000906001600160a01b038516906000805160206111b383398151915290602001610a74565b60006103c43384845b6001600160a01b038316610dea5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104aa565b6001600160a01b038216610e4c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104aa565b6001600160a01b03831660009081526001602052604090205481811015610ec45760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016104aa565b6001600160a01b03808516600090815260016020526040808220858503905591851681529081208054849290610efb908490611112565b92505081905550826001600160a01b0316846001600160a01b03166000805160206111b383398151915284604051610f3591815260200190565b60405180910390a350505050565b80356001600160a01b038116811461045457600080fd5b600060208284031215610f6b578081fd5b6108b882610f43565b60008060408385031215610f86578081fd5b610f8f83610f43565b9150610f9d60208401610f43565b90509250929050565b600080600060608486031215610fba578081fd5b610fc384610f43565b9250610fd160208501610f43565b9150604084013590509250925092565b60008060408385031215610ff3578182fd5b610ffc83610f43565b915060208301358015158114611010578182fd5b809150509250929050565b6000806040838503121561102d578182fd5b61103683610f43565b946020939093013593505050565b600060208284031215611055578081fd5b5035919050565b6000602080835283518082850152825b818110156110885785810183015185820160400152820161106c565b818111156110995783604083870101525b50601f01601f1916929092016040019392505050565b6020808252601490820152732737ba1030b63637bbb2b2103a3930b739b332b960611b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600082198211156111255761112561119c565b500190565b60008261114557634e487b7160e01b81526012600452602481fd5b500490565b60008282101561115c5761115c61119c565b500390565b600181811c9082168061117557607f821691505b6020821081141561119657634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fdfeddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220b5996df54f8bebb7bf754a3b09d967b05b30b014f5eeb6c16d6cbb612535dc6864736f6c63430008030033
Deployed ByteCode
0x608060405234801561001057600080fd5b50600436106101285760003560e01c806306fdde031461012d578063095ea7b31461014b5780630da451881461016e578063169b8cd51461018157806318160ddd146101985780631e83409a146101a057806323b872dd146101b5578063313ce567146101c857806339509351146101d75780633ccfd60b146101ea57806340c10f19146101f257806363eae6541461020557806370a082311461020e578063715018a614610237578063813b5da81461023f578063891d7e7f146102525780638a469461146102655780638da5cb5b1461027857806395d89b41146102985780639dc29fac146102a0578063a457c2d7146102b3578063a9059cbb146102c6578063dd62ed3e146102d9578063f2fde38b14610312575b600080fd5b610135610325565b604051610142919061105c565b60405180910390f35b61015e61015936600461101b565b6103b7565b6040519015158152602001610142565b61015e61017c366004610f5a565b6103cd565b61018a60065481565b604051908152602001610142565b60035461018a565b6101b36101ae366004610f5a565b610459565b005b61015e6101c3366004610fa6565b6104df565b60405160128152602001610142565b61015e6101e536600461101b565b610573565b6101b36105af565b6101b361020036600461101b565b610610565b61018a60075481565b61018a61021c366004610f5a565b6001600160a01b031660009081526001602052604090205490565b6101b3610649565b6101b361024d366004611044565b610684565b6101b3610260366004611044565b6106b8565b6101b3610273366004610fe1565b6106ec565b610280610746565b6040516001600160a01b039091168152602001610142565b610135610755565b6101b36102ae36600461101b565b610764565b61015e6102c136600461101b565b61079d565b61015e6102d436600461101b565b610836565b61018a6102e7366004610f74565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b6101b3610320366004610f5a565b6108bf565b60606004805461033490611161565b80601f016020809104026020016040519081016040528092919081815260200182805461036090611161565b80156103ad5780601f10610382576101008083540402835291602001916103ad565b820191906000526020600020905b81548152906001019060200180831161039057829003601f168201915b5050505050905090565b60006103c433848461095c565b50600192915050565b6001600160a01b0381166000908152600960205260408120546103f257506001610454565b6201518060065442610404919061114a565b61040e919061112a565b6006546001600160a01b03841660009081526009602052604090205462015180916104389161114a565b610442919061112a565b101561045057506001610454565b5060005b919050565b610462816103cd565b6104b35760405162461bcd60e51b815260206004820152601e60248201527f6e6f7420617661696c61626c6520746f6b656e7320666f7220636c61696d000060448201526064015b60405180910390fd5b6001600160a01b03811660009081526009602052604090204290556008546104dc908290610a81565b50565b60006006544211801561050057506007546006546104fd9190611112565b42105b15610560576001600160a01b0384166000908152600a602052604090205460ff168061054457506001600160a01b0383166000908152600a602052604090205460ff165b6105605760405162461bcd60e51b81526004016104aa906110af565b61056b848484610b4f565b949350505050565b3360008181526002602090815260408083206001600160a01b038716845290915281205490916103c49185906105aa908690611112565b61095c565b336105b8610746565b6001600160a01b0316146105de5760405162461bcd60e51b81526004016104aa906110dd565b604051339081904780156108fc02916000818181858888f1935050505015801561060c573d6000803e3d6000fd5b5050565b33610619610746565b6001600160a01b03161461063f5760405162461bcd60e51b81526004016104aa906110dd565b61060c8282610a81565b33610652610746565b6001600160a01b0316146106785760405162461bcd60e51b81526004016104aa906110dd565b6106826000610bf9565b565b3361068d610746565b6001600160a01b0316146106b35760405162461bcd60e51b81526004016104aa906110dd565b600755565b336106c1610746565b6001600160a01b0316146106e75760405162461bcd60e51b81526004016104aa906110dd565b600655565b336106f5610746565b6001600160a01b03161461071b5760405162461bcd60e51b81526004016104aa906110dd565b6001600160a01b03919091166000908152600a60205260409020805460ff1916911515919091179055565b6000546001600160a01b031690565b60606005805461033490611161565b3361076d610746565b6001600160a01b0316146107935760405162461bcd60e51b81526004016104aa906110dd565b61060c8282610c49565b3360009081526002602090815260408083206001600160a01b03861684529091528120548281101561081f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016104aa565b61082c338585840361095c565b5060019392505050565b60006006544211801561085757506007546006546108549190611112565b42105b156108ae57336000908152600a602052604090205460ff168061089257506001600160a01b0383166000908152600a602052604090205460ff165b6108ae5760405162461bcd60e51b81526004016104aa906110af565b6108b88383610d7d565b9392505050565b336108c8610746565b6001600160a01b0316146108ee5760405162461bcd60e51b81526004016104aa906110dd565b6001600160a01b0381166109535760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104aa565b6104dc81610bf9565b6001600160a01b0383166109be5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104aa565b6001600160a01b038216610a1f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104aa565b6001600160a01b0383811660008181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b038216610ad75760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016104aa565b8060036000828254610ae99190611112565b90915550506001600160a01b03821660009081526001602052604081208054839290610b16908490611112565b90915550506040518181526001600160a01b038316906000906000805160206111b38339815191529060200160405180910390a361060c565b6000610b5c848484610d86565b6001600160a01b038416600090815260026020908152604080832033845290915290205482811015610be15760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084016104aa565b610bee853385840361095c565b506001949350505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038216610ca95760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016104aa565b6001600160a01b03821660009081526001602052604090205481811015610d1d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b60648201526084016104aa565b6001600160a01b0383166000908152600160205260408120838303905560038054849290610d4c90849061114a565b90915550506040518281526000906001600160a01b038516906000805160206111b383398151915290602001610a74565b60006103c43384845b6001600160a01b038316610dea5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104aa565b6001600160a01b038216610e4c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104aa565b6001600160a01b03831660009081526001602052604090205481811015610ec45760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016104aa565b6001600160a01b03808516600090815260016020526040808220858503905591851681529081208054849290610efb908490611112565b92505081905550826001600160a01b0316846001600160a01b03166000805160206111b383398151915284604051610f3591815260200190565b60405180910390a350505050565b80356001600160a01b038116811461045457600080fd5b600060208284031215610f6b578081fd5b6108b882610f43565b60008060408385031215610f86578081fd5b610f8f83610f43565b9150610f9d60208401610f43565b90509250929050565b600080600060608486031215610fba578081fd5b610fc384610f43565b9250610fd160208501610f43565b9150604084013590509250925092565b60008060408385031215610ff3578182fd5b610ffc83610f43565b915060208301358015158114611010578182fd5b809150509250929050565b6000806040838503121561102d578182fd5b61103683610f43565b946020939093013593505050565b600060208284031215611055578081fd5b5035919050565b6000602080835283518082850152825b818110156110885785810183015185820160400152820161106c565b818111156110995783604083870101525b50601f01601f1916929092016040019392505050565b6020808252601490820152732737ba1030b63637bbb2b2103a3930b739b332b960611b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600082198211156111255761112561119c565b500190565b60008261114557634e487b7160e01b81526012600452602481fd5b500490565b60008282101561115c5761115c61119c565b500390565b600181811c9082168061117557607f821691505b6020821081141561119657634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fdfeddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220b5996df54f8bebb7bf754a3b09d967b05b30b014f5eeb6c16d6cbb612535dc6864736f6c63430008030033