Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00Latest 1 from a total of 1 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Initialize Imple... | 23599017 | 139 days ago | IN | 0 ETH | 0.0000525 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
ZeroDAOTokenV2
Compiler Version
v0.8.3+commit.8d00100c
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.3;
// Slight modifiations from base Open Zeppelin Contracts
// Consult /oz/README.md for more information
import "./oz/ERC20Upgradeable.sol";
import "./oz/ERC20SnapshotUpgradeable.sol";
import "./oz/ERC20PausableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
contract ZeroDAOTokenV2 is
OwnableUpgradeable,
ERC20Upgradeable,
ERC20PausableUpgradeable,
ERC20SnapshotUpgradeable
{
using SafeERC20 for IERC20;
event AuthorizedSnapshotter(address account);
event DeauthorizedSnapshotter(address account);
event ERC20TokenWithdrawn(
IERC20 indexed token,
address indexed to,
uint256 indexed amount
);
// Mapping which stores all addresses allowed to snapshot
mapping(address => bool) authorizedToSnapshot;
function initialize(
string memory name,
string memory symbol
) public initializer {
__Ownable_init();
__ERC20_init(name, symbol);
__ERC20Snapshot_init();
__ERC20Pausable_init();
}
// Call this on the implementation contract (not the proxy)
function initializeImplementation() public initializer {
__Ownable_init();
_pause();
}
/**
* Pauses the token contract preventing any token mint/transfer/burn operations.
* Can only be called if the contract is unpaused.
*/
function pause() external onlyOwner {
_pause();
}
/**
* Unpauses the token contract preventing any token mint/transfer/burn operations
* Can only be called if the contract is paused.
*/
function unpause() external onlyOwner {
_unpause();
}
/**
* Creates a token balance snapshot. Ideally this would be called by the
* controlling DAO whenever a proposal is made.
*/
function snapshot() external returns (uint256) {
require(
authorizedToSnapshot[_msgSender()] || _msgSender() == owner(),
"zDAOToken: Not authorized to snapshot"
);
return _snapshot();
}
/**
* Authorizes an account to take snapshots
* @param account The account to authorize
*/
function authorizeSnapshotter(address account) external onlyOwner {
require(
!authorizedToSnapshot[account],
"zDAOToken: Account already authorized"
);
authorizedToSnapshot[account] = true;
emit AuthorizedSnapshotter(account);
}
/**
* Deauthorizes an account to take snapshots
* @param account The account to de-authorize
*/
function deauthorizeSnapshotter(address account) external onlyOwner {
require(authorizedToSnapshot[account], "zDAOToken: Account not authorized");
authorizedToSnapshot[account] = false;
emit DeauthorizedSnapshotter(account);
}
/**
* Withdraws ERC20 tokens that are stuck in this contract.
* @param token The ERC20 token contract address to withdraw
* @param to The address to send the tokens to
* @param amount The amount of tokens to withdraw (0 means withdraw all available)
*/
function withdrawERC20(
IERC20 token,
address to,
uint256 amount
) external onlyOwner {
require(
address(token) != address(0),
"zDAOToken: Token address cannot be zero"
);
require(to != address(0), "zDAOToken: Recipient address cannot be zero");
uint256 withdrawAmount;
if (amount == 0) {
// If amount is 0, withdraw all available tokens
withdrawAmount = token.balanceOf(address(this));
} else {
withdrawAmount = amount;
}
token.safeTransfer(to, withdrawAmount);
emit ERC20TokenWithdrawn(token, to, withdrawAmount);
}
/**
* Utility function to transfer tokens to many addresses at once.
* @param recipients The addresses to send tokens to
* @param amount The amount of tokens to send
* @return Boolean if the transfer was a success
*/
function transferBulk(
address[] calldata recipients,
uint256 amount
) external returns (bool) {
address sender = _msgSender();
uint256 total = amount * recipients.length;
require(
_balances[sender] >= total,
"ERC20: transfer amount exceeds balance"
);
require(!paused(), "ERC20Pausable: token transfer while paused");
_balances[sender] -= total;
_updateAccountSnapshot(sender);
for (uint256 i = 0; i < recipients.length; ++i) {
address recipient = recipients[i];
require(recipient != address(0), "ERC20: transfer to the zero address");
// Note: _beforeTokenTransfer isn't called here
// This function emulates what it would do (paused and snapshot)
_balances[recipient] += amount;
_updateAccountSnapshot(recipient);
emit Transfer(sender, recipient, amount);
}
return true;
}
/**
* Utility function to transfer tokens to many addresses at once.
* @param sender The address to send the tokens from
* @param recipients The addresses to send tokens to
* @param amount The amount of tokens to send
* @return Boolean if the transfer was a success
*/
function transferFromBulk(
address sender,
address[] calldata recipients,
uint256 amount
) external returns (bool) {
require(!paused(), "ERC20Pausable: token transfer while paused");
uint256 total = amount * recipients.length;
require(
_balances[sender] >= total,
"ERC20: transfer amount exceeds balance"
);
// Ensure enough allowance
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(
currentAllowance >= total,
"ERC20: transfer total exceeds allowance"
);
_approve(sender, _msgSender(), currentAllowance - total);
_balances[sender] -= total;
_updateAccountSnapshot(sender);
for (uint256 i = 0; i < recipients.length; ++i) {
address recipient = recipients[i];
require(recipient != address(0), "ERC20: transfer to the zero address");
// Note: _beforeTokenTransfer isn't called here
// This function emulates what it would do (paused and snapshot)
_balances[recipient] += amount;
_updateAccountSnapshot(recipient);
emit Transfer(sender, recipient, amount);
}
return true;
}
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
)
internal
virtual
override(
ERC20PausableUpgradeable,
ERC20SnapshotUpgradeable,
ERC20Upgradeable
)
{
super._beforeTokenTransfer(from, to, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) internal override {
if (to == address(this)) {
_burn(from, amount);
} else {
super._transfer(from, to, amount);
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
/**
* @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 guidelines: functions revert instead
* of 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 ERC20Upgradeable is
Initializable,
ContextUpgradeable,
IERC20Upgradeable
{
// Diff from Open Zeppelin Standard
mapping(address => uint256) internal _balances;
mapping(address => mapping(address => uint256)) internal _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* The defaut value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All three of these values are immutable: they can only be set once during
* construction.
*/
function __ERC20_init(string memory name_, string memory symbol_)
internal
initializer
{
__Context_init_unchained();
__ERC20_init_unchained(name_, symbol_);
}
function __ERC20_init_unchained(string memory name_, string memory symbol_)
internal
initializer
{
_name = name_;
_symbol = symbol_;
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual 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
* overloaded;
*
* 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 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"
);
_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"
);
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
return true;
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is 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");
_balances[sender] = senderBalance - amount;
_balances[recipient] += amount;
emit Transfer(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:
*
* - `to` 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);
}
/**
* @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");
_balances[account] = accountBalance - amount;
_totalSupply -= amount;
emit Transfer(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 to 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 {}
uint256[45] private __gap;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./ERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/ArraysUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
/**
* @dev This contract extends an ERC20 token with a snapshot mechanism. When a snapshot is created, the balances and
* total supply at the time are recorded for later access.
*
* This can be used to safely create mechanisms based on token balances such as trustless dividends or weighted voting.
* In naive implementations it's possible to perform a "double spend" attack by reusing the same balance from different
* accounts. By using snapshots to calculate dividends or voting power, those attacks no longer apply. It can also be
* used to create an efficient ERC20 forking mechanism.
*
* Snapshots are created by the internal {_snapshot} function, which will emit the {Snapshot} event and return a
* snapshot id. To get the total supply at the time of a snapshot, call the function {totalSupplyAt} with the snapshot
* id. To get the balance of an account at the time of a snapshot, call the {balanceOfAt} function with the snapshot id
* and the account address.
*
* ==== Gas Costs
*
* Snapshots are efficient. Snapshot creation is _O(1)_. Retrieval of balances or total supply from a snapshot is _O(log
* n)_ in the number of snapshots that have been created, although _n_ for a specific account will generally be much
* smaller since identical balances in subsequent snapshots are stored as a single entry.
*
* There is a constant overhead for normal ERC20 transfers due to the additional snapshot bookkeeping. This overhead is
* only significant for the first transfer that immediately follows a snapshot for a particular account. Subsequent
* transfers will have normal cost until the next snapshot, and so on.
*/
abstract contract ERC20SnapshotUpgradeable is Initializable, ERC20Upgradeable {
function __ERC20Snapshot_init() internal initializer {
__Context_init_unchained();
__ERC20Snapshot_init_unchained();
}
function __ERC20Snapshot_init_unchained() internal initializer {}
// Inspired by Jordi Baylina's MiniMeToken to record historical balances:
// https://github.com/Giveth/minimd/blob/ea04d950eea153a04c51fa510b068b9dded390cb/contracts/MiniMeToken.sol
using ArraysUpgradeable for uint256[];
using CountersUpgradeable for CountersUpgradeable.Counter;
// Snapshotted values have arrays of ids and the value corresponding to that id. These could be an array of a
// Snapshot struct, but that would impede usage of functions that work on an array.
struct Snapshots {
uint256[] ids;
uint256[] values;
}
mapping(address => Snapshots) private _accountBalanceSnapshots;
Snapshots private _totalSupplySnapshots;
// Snapshot ids increase monotonically, with the first value being 1. An id of 0 is invalid.
CountersUpgradeable.Counter private _currentSnapshotId;
/**
* @dev Emitted by {_snapshot} when a snapshot identified by `id` is created.
*/
event Snapshot(uint256 id);
/**
* @dev Creates a new snapshot and returns its snapshot id.
*
* Emits a {Snapshot} event that contains the same id.
*
* {_snapshot} is `internal` and you have to decide how to expose it externally. Its usage may be restricted to a
* set of accounts, for example using {AccessControl}, or it may be open to the public.
*
* [WARNING]
* ====
* While an open way of calling {_snapshot} is required for certain trust minimization mechanisms such as forking,
* you must consider that it can potentially be used by attackers in two ways.
*
* First, it can be used to increase the cost of retrieval of values from snapshots, although it will grow
* logarithmically thus rendering this attack ineffective in the long term. Second, it can be used to target
* specific accounts and increase the cost of ERC20 transfers for them, in the ways specified in the Gas Costs
* section above.
*
* We haven't measured the actual numbers; if this is something you're interested in please reach out to us.
* ====
*/
function _snapshot() internal virtual returns (uint256) {
_currentSnapshotId.increment();
uint256 currentId = _currentSnapshotId.current();
emit Snapshot(currentId);
return currentId;
}
/**
* @dev Retrieves the balance of `account` at the time `snapshotId` was created.
*/
function balanceOfAt(address account, uint256 snapshotId)
public
view
virtual
returns (uint256)
{
(bool snapshotted, uint256 value) =
_valueAt(snapshotId, _accountBalanceSnapshots[account]);
return snapshotted ? value : balanceOf(account);
}
/**
* @dev Retrieves the total supply at the time `snapshotId` was created.
*/
function totalSupplyAt(uint256 snapshotId)
public
view
virtual
returns (uint256)
{
(bool snapshotted, uint256 value) =
_valueAt(snapshotId, _totalSupplySnapshots);
return snapshotted ? value : totalSupply();
}
// Update balance and/or total supply snapshots before the values are modified. This is implemented
// in the _beforeTokenTransfer hook, which is executed for _mint, _burn, and _transfer operations.
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual override {
super._beforeTokenTransfer(from, to, amount);
if (from == address(0)) {
// mint
_updateAccountSnapshot(to);
_updateTotalSupplySnapshot();
} else if (to == address(0)) {
// burn
_updateAccountSnapshot(from);
_updateTotalSupplySnapshot();
} else {
// transfer
_updateAccountSnapshot(from);
_updateAccountSnapshot(to);
}
}
function _valueAt(uint256 snapshotId, Snapshots storage snapshots)
private
view
returns (bool, uint256)
{
require(snapshotId > 0, "ERC20Snapshot: id is 0");
// solhint-disable-next-line max-line-length
require(
snapshotId <= _currentSnapshotId.current(),
"ERC20Snapshot: nonexistent id"
);
// When a valid snapshot is queried, there are three possibilities:
// a) The queried value was not modified after the snapshot was taken. Therefore, a snapshot entry was never
// created for this id, and all stored snapshot ids are smaller than the requested one. The value that corresponds
// to this id is the current one.
// b) The queried value was modified after the snapshot was taken. Therefore, there will be an entry with the
// requested id, and its value is the one to return.
// c) More snapshots were created after the requested one, and the queried value was later modified. There will be
// no entry for the requested id: the value that corresponds to it is that of the smallest snapshot id that is
// larger than the requested one.
//
// In summary, we need to find an element in an array, returning the index of the smallest value that is larger if
// it is not found, unless said value doesn't exist (e.g. when all values are smaller). Arrays.findUpperBound does
// exactly this.
uint256 index = snapshots.ids.findUpperBound(snapshotId);
if (index == snapshots.ids.length) {
return (false, 0);
} else {
return (true, snapshots.values[index]);
}
}
function _updateAccountSnapshot(address account) internal {
_updateSnapshot(_accountBalanceSnapshots[account], balanceOf(account));
}
function _updateTotalSupplySnapshot() internal {
_updateSnapshot(_totalSupplySnapshots, totalSupply());
}
function _updateSnapshot(Snapshots storage snapshots, uint256 currentValue)
private
{
uint256 currentId = _currentSnapshotId.current();
if (_lastSnapshotId(snapshots.ids) < currentId) {
snapshots.ids.push(currentId);
snapshots.values.push(currentValue);
}
}
function _lastSnapshotId(uint256[] storage ids)
private
view
returns (uint256)
{
if (ids.length == 0) {
return 0;
} else {
return ids[ids.length - 1];
}
}
uint256[46] private __gap;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./ERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
/**
* @dev ERC20 token with pausable token transfers, minting and burning.
*
* Useful for scenarios such as preventing trades until the end of an evaluation
* period, or having an emergency switch for freezing all token transfers in the
* event of a large bug.
*/
abstract contract ERC20PausableUpgradeable is
Initializable,
ERC20Upgradeable,
PausableUpgradeable
{
function __ERC20Pausable_init() internal initializer {
__Context_init_unchained();
__Pausable_init_unchained();
__ERC20Pausable_init_unchained();
}
function __ERC20Pausable_init_unchained() internal initializer {}
/**
* @dev See {ERC20-_beforeTokenTransfer}.
*
* Requirements:
*
* - the contract must not be paused.
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual override {
super._beforeTokenTransfer(from, to, amount);
require(!paused(), "ERC20Pausable: token transfer while paused");
}
uint256[50] private __gap;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
function __Ownable_init() internal initializer {
__Context_init_unchained();
__Ownable_init_unchained();
}
function __Ownable_init_unchained() internal initializer {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
uint256[49] private __gap;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../IERC20.sol";
import "../../../utils/Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(IERC20 token, address spender, uint256 value) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
// solhint-disable-next-line max-line-length
require((value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) { // Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20Upgradeable {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";
/*
* @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 ContextUpgradeable is Initializable {
function __Context_init() internal initializer {
__Context_init_unchained();
}
function __Context_init_unchained() internal initializer {
}
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
uint256[50] private __gap;
}// SPDX-License-Identifier: MIT
// solhint-disable-next-line compiler-version
pragma solidity ^0.8.0;
import "../../utils/AddressUpgradeable.sol";
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {UpgradeableProxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*/
abstract contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
*/
bool private _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private _initializing;
/**
* @dev Modifier to protect an initializer function from being invoked twice.
*/
modifier initializer() {
require(_initializing || !_initialized, "Initializable: contract is already initialized");
bool isTopLevelCall = !_initializing;
if (isTopLevelCall) {
_initializing = true;
_initialized = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Collection of functions related to the address type
*/
library AddressUpgradeable {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain`call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: value }(data);
return _verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.staticcall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./math/MathUpgradeable.sol";
/**
* @dev Collection of functions related to array types.
*/
library ArraysUpgradeable {
/**
* @dev Searches a sorted `array` and returns the first index that contains
* a value greater or equal to `element`. If no such index exists (i.e. all
* values in the array are strictly less than `element`), the array length is
* returned. Time complexity O(log n).
*
* `array` is expected to be sorted in ascending order, and to contain no
* repeated elements.
*/
function findUpperBound(uint256[] storage array, uint256 element) internal view returns (uint256) {
if (array.length == 0) {
return 0;
}
uint256 low = 0;
uint256 high = array.length;
while (low < high) {
uint256 mid = MathUpgradeable.average(low, high);
// Note that mid will always be strictly less than high (i.e. it will be a valid array index)
// because Math.average rounds down (it does integer division with truncation).
if (array[mid] > element) {
high = mid;
} else {
low = mid + 1;
}
}
// At this point `low` is the exclusive upper bound. We will return the inclusive upper bound.
if (low > 0 && array[low - 1] == element) {
return low - 1;
} else {
return low;
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @title Counters
* @author Matt Condon (@shrugs)
* @dev Provides counters that can only be incremented or decremented by one. This can be used e.g. to track the number
* of elements in a mapping, issuing ERC721 ids, or counting request ids.
*
* Include with `using Counters for Counters.Counter;`
*/
library CountersUpgradeable {
struct Counter {
// This variable should never be directly accessed by users of the library: interactions must be restricted to
// the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
// this feature: see https://github.com/ethereum/solidity/issues/4637
uint256 _value; // default: 0
}
function current(Counter storage counter) internal view returns (uint256) {
return counter._value;
}
function increment(Counter storage counter) internal {
unchecked {
counter._value += 1;
}
}
function decrement(Counter storage counter) internal {
uint256 value = counter._value;
require(value > 0, "Counter: decrement overflow");
unchecked {
counter._value = value - 1;
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library MathUpgradeable {
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a >= b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow, so we distribute
return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.sol";
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
abstract contract PausableUpgradeable is Initializable, ContextUpgradeable {
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
bool private _paused;
/**
* @dev Initializes the contract in unpaused state.
*/
function __Pausable_init() internal initializer {
__Context_init_unchained();
__Pausable_init_unchained();
}
function __Pausable_init_unchained() internal initializer {
_paused = false;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view virtual returns (bool) {
return _paused;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
require(!paused(), "Pausable: paused");
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
require(paused(), "Pausable: not paused");
_;
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
uint256[49] private __gap;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain`call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: value }(data);
return _verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.staticcall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.delegatecall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"AuthorizedSnapshotter","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"DeauthorizedSnapshotter","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ERC20TokenWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"}],"name":"Snapshot","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"authorizeSnapshotter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"snapshotId","type":"uint256"}],"name":"balanceOfAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"deauthorizeSnapshotter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"initializeImplementation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"snapshot","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"snapshotId","type":"uint256"}],"name":"totalSupplyAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"recipients","type":"address[]"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferBulk","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address[]","name":"recipients","type":"address[]"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFromBulk","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawERC20","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
608060405234801561001057600080fd5b5061279c806100206000396000f3fe608060405234801561001057600080fd5b50600436106101a95760003560e01c8063715018a6116100f9578063a9059cbb11610097578063dd62ed3e11610071578063dd62ed3e14610339578063e9825ffa14610372578063f2fde38b14610385578063fbc1284f14610398576101a9565b8063a9059cbb14610300578063c18e273414610313578063d5adcbe014610326576101a9565b806395d89b41116100d357806395d89b41146102ca5780639711715a146102d2578063981b24d0146102da578063a457c2d7146102ed576101a9565b8063715018a61461029f5780638456cb59146102a75780638da5cb5b146102af576101a9565b80633f4ba83a116101665780634cd88b76116101405780634cd88b761461025b5780634ee2cd7e1461026e5780635c975abb1461028157806370a082311461028c576101a9565b80633f4ba83a1461023657806344004cc1146102405780634c10879d14610253576101a9565b806306fdde03146101ae578063095ea7b3146101cc57806318160ddd146101ef57806323b872dd14610201578063313ce567146102145780633950935114610223575b600080fd5b6101b66103ab565b6040516101c3919061246a565b60405180910390f35b6101df6101da366004612314565b61043d565b60405190151581526020016101c3565b6067545b6040519081526020016101c3565b6101df61020f36600461227a565b610454565b604051601281526020016101c3565b6101df610231366004612314565b61050c565b61023e610543565b005b61023e61024e3660046123a9565b610577565b61023e610754565b61023e6102693660046123bd565b6107d0565b6101f361027c366004612314565b610860565b60975460ff166101df565b6101f361029a366004612226565b6108a9565b61023e6108c8565b61023e61093c565b6033546040516001600160a01b0390911681526020016101c3565b6101b661096e565b6101f361097d565b6101f36102e836600461241e565b610a0d565b6101df6102fb366004612314565b610a38565b6101df61030e366004612314565b610ad3565b6101df61032136600461233f565b610ae0565b6101df6103343660046122ba565b610c7d565b6101f3610347366004612242565b6001600160a01b03918216600090815260666020908152604080832093909416825291909152205490565b61023e610380366004612226565b610eb4565b61023e610393366004612226565b610faa565b61023e6103a6366004612226565b611095565b6060606880546103ba90612685565b80601f01602080910402602001604051908101604052809291908181526020018280546103e690612685565b80156104335780601f1061040857610100808354040283529160200191610433565b820191906000526020600020905b81548152906001019060200180831161041657829003601f168201915b5050505050905090565b600061044a33848461118c565b5060015b92915050565b60006104618484846112b1565b6001600160a01b0384166000908152606660209081526040808320338452909152902054828110156104eb5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b6104ff85336104fa868561263e565b61118c565b60019150505b9392505050565b3360008181526066602090815260408083206001600160a01b0387168452909152812054909161044a9185906104fa9086906125f3565b6033546001600160a01b0316331461056d5760405162461bcd60e51b81526004016104e290612574565b6105756112dc565b565b6033546001600160a01b031633146105a15760405162461bcd60e51b81526004016104e290612574565b6001600160a01b0383166106075760405162461bcd60e51b815260206004820152602760248201527f7a44414f546f6b656e3a20546f6b656e20616464726573732063616e6e6f74206044820152666265207a65726f60c81b60648201526084016104e2565b6001600160a01b0382166106715760405162461bcd60e51b815260206004820152602b60248201527f7a44414f546f6b656e3a20526563697069656e7420616464726573732063616e60448201526a6e6f74206265207a65726f60a81b60648201526084016104e2565b6000816106f6576040516370a0823160e01b81523060048201526001600160a01b038516906370a082319060240160206040518083038186803b1580156106b757600080fd5b505afa1580156106cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ef9190612436565b90506106f9565b50805b61070d6001600160a01b038516848361136f565b80836001600160a01b0316856001600160a01b03167facf3ec80f13d1c43e4c70cdf27a5966509d7582fff9fe9c2d4d2bc3268b19a2d60405160405180910390a450505050565b600054610100900460ff168061076d575060005460ff16155b6107895760405162461bcd60e51b81526004016104e290612526565b600054610100900460ff161580156107ab576000805461ffff19166101011790555b6107b36113c1565b6107bb611428565b80156107cd576000805461ff00191690555b50565b600054610100900460ff16806107e9575060005460ff16155b6108055760405162461bcd60e51b81526004016104e290612526565b600054610100900460ff16158015610827576000805461ffff19166101011790555b61082f6113c1565b61083983836114a3565b61084161150c565b610849611573565b801561085b576000805461ff00191690555b505050565b6001600160a01b038216600090815260fb60205260408120819081906108879085906115da565b915091508161089e57610899856108a9565b6108a0565b805b95945050505050565b6001600160a01b0381166000908152606560205260409020545b919050565b6033546001600160a01b031633146108f25760405162461bcd60e51b81526004016104e290612574565b6033546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3603380546001600160a01b0319169055565b6033546001600160a01b031633146109665760405162461bcd60e51b81526004016104e290612574565b610575611428565b6060606980546103ba90612685565b33600090815261012d602052604081205460ff16806109a657506033546001600160a01b031633145b610a005760405162461bcd60e51b815260206004820152602560248201527f7a44414f546f6b656e3a204e6f7420617574686f72697a656420746f20736e616044820152641c1cda1bdd60da1b60648201526084016104e2565b610a086116da565b905090565b6000806000610a1d8460fc6115da565b9150915081610a2e57606754610a30565b805b949350505050565b3360009081526066602090815260408083206001600160a01b038616845290915281205482811015610aba5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016104e2565b610ac933856104fa868561263e565b5060019392505050565b600061044a3384846112b1565b60003381610aee858561261f565b6001600160a01b038316600090815260656020526040902054909150811115610b295760405162461bcd60e51b81526004016104e2906124e0565b60975460ff1615610b4c5760405162461bcd60e51b81526004016104e2906125a9565b6001600160a01b03821660009081526065602052604081208054839290610b7490849061263e565b90915550610b83905082611735565b60005b85811015610c70576000878783818110610bb057634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610bc59190612226565b90506001600160a01b038116610bed5760405162461bcd60e51b81526004016104e29061249d565b6001600160a01b03811660009081526065602052604081208054889290610c159084906125f3565b90915550610c24905081611735565b806001600160a01b0316846001600160a01b031660008051602061274783398151915288604051610c5791815260200190565b60405180910390a350610c69816126c0565b9050610b86565b5060019695505050505050565b6000610c8b60975460ff1690565b15610ca85760405162461bcd60e51b81526004016104e2906125a9565b6000610cb4848461261f565b6001600160a01b038716600090815260656020526040902054909150811115610cef5760405162461bcd60e51b81526004016104e2906124e0565b6001600160a01b038616600090815260666020908152604080832033845290915290205481811015610d735760405162461bcd60e51b815260206004820152602760248201527f45524332303a207472616e7366657220746f74616c206578636565647320616c6044820152666c6f77616e636560c81b60648201526084016104e2565b610d8287336104fa858561263e565b6001600160a01b03871660009081526065602052604081208054849290610daa90849061263e565b90915550610db9905087611735565b60005b85811015610ea6576000878783818110610de657634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610dfb9190612226565b90506001600160a01b038116610e235760405162461bcd60e51b81526004016104e29061249d565b6001600160a01b03811660009081526065602052604081208054889290610e4b9084906125f3565b90915550610e5a905081611735565b806001600160a01b0316896001600160a01b031660008051602061274783398151915288604051610e8d91815260200190565b60405180910390a350610e9f816126c0565b9050610dbc565b506001979650505050505050565b6033546001600160a01b03163314610ede5760405162461bcd60e51b81526004016104e290612574565b6001600160a01b038116600090815261012d602052604090205460ff16610f515760405162461bcd60e51b815260206004820152602160248201527f7a44414f546f6b656e3a204163636f756e74206e6f7420617574686f72697a656044820152601960fa1b60648201526084016104e2565b6001600160a01b038116600081815261012d6020908152604091829020805460ff1916905590519182527f51f8ef0f426007e7662fabfb0a7d46d2e383ffe4f627aebfac09c2815468773991015b60405180910390a150565b6033546001600160a01b03163314610fd45760405162461bcd60e51b81526004016104e290612574565b6001600160a01b0381166110395760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104e2565b6033546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3603380546001600160a01b0319166001600160a01b0392909216919091179055565b6033546001600160a01b031633146110bf5760405162461bcd60e51b81526004016104e290612574565b6001600160a01b038116600090815261012d602052604090205460ff16156111375760405162461bcd60e51b815260206004820152602560248201527f7a44414f546f6b656e3a204163636f756e7420616c726561647920617574686f6044820152641c9a5e995960da1b60648201526084016104e2565b6001600160a01b038116600081815261012d6020908152604091829020805460ff1916600117905590519182527f2e457b8fcc8c01e995f48f89abb9cf6a72dce32622702d6ffa54c372be369ff99101610f9f565b6001600160a01b0383166111ee5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104e2565b6001600160a01b03821661124f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104e2565b6001600160a01b0383811660008181526066602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b0382163014156112d1576112cc838261175f565b61085b565b61085b8383836118a8565b60975460ff166113255760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016104e2565b6097805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b17905261085b9084906119fe565b600054610100900460ff16806113da575060005460ff16155b6113f65760405162461bcd60e51b81526004016104e290612526565b600054610100900460ff16158015611418576000805461ffff19166101011790555b611420611ad0565b6107bb611b3a565b60975460ff161561146e5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016104e2565b6097805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586113523390565b600054610100900460ff16806114bc575060005460ff16155b6114d85760405162461bcd60e51b81526004016104e290612526565b600054610100900460ff161580156114fa576000805461ffff19166101011790555b611502611ad0565b6108498383611be8565b600054610100900460ff1680611525575060005460ff16155b6115415760405162461bcd60e51b81526004016104e290612526565b600054610100900460ff16158015611563576000805461ffff19166101011790555b61156b611ad0565b6107bb611ad0565b600054610100900460ff168061158c575060005460ff16155b6115a85760405162461bcd60e51b81526004016104e290612526565b600054610100900460ff161580156115ca576000805461ffff19166101011790555b6115d2611ad0565b61156b611c7d565b600080600084116116265760405162461bcd60e51b815260206004820152601660248201527504552433230536e617073686f743a20696420697320360541b60448201526064016104e2565b60fe548411156116785760405162461bcd60e51b815260206004820152601d60248201527f4552433230536e617073686f743a206e6f6e6578697374656e7420696400000060448201526064016104e2565b60006116848486611cf2565b845490915081141561169d5760008092509250506116d3565b60018460010182815481106116c257634e487b7160e01b600052603260045260246000fd5b906000526020600020015492509250505b9250929050565b60006116ea60fe80546001019055565b60006116f560fe5490565b90507f8030e83b04d87bef53480e26263266d6ca66863aa8506aca6f2559d18aa1cb678160405161172891815260200190565b60405180910390a1905090565b6001600160a01b038116600090815260fb602052604090206107cd9061175a836108a9565b611dd1565b6001600160a01b0382166117bf5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016104e2565b6117cb82600083611e1c565b6001600160a01b0382166000908152606560205260409020548181101561183f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b60648201526084016104e2565b611849828261263e565b6001600160a01b0384166000908152606560205260408120919091556067805484929061187790849061263e565b90915550506040518281526000906001600160a01b03851690600080516020612747833981519152906020016112a4565b6001600160a01b03831661190c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104e2565b6001600160a01b0382166119325760405162461bcd60e51b81526004016104e29061249d565b61193d838383611e1c565b6001600160a01b038316600090815260656020526040902054818110156119765760405162461bcd60e51b81526004016104e2906124e0565b611980828261263e565b6001600160a01b0380861660009081526065602052604080822093909355908516815290812080548492906119b69084906125f3565b92505081905550826001600160a01b0316846001600160a01b0316600080516020612747833981519152846040516119f091815260200190565b60405180910390a350505050565b6000611a53826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611e279092919063ffffffff16565b80519091501561085b5780806020019051810190611a719190612389565b61085b5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016104e2565b600054610100900460ff1680611ae9575060005460ff16155b611b055760405162461bcd60e51b81526004016104e290612526565b600054610100900460ff161580156107bb576000805461ffff191661010117905580156107cd576000805461ff001916905550565b600054610100900460ff1680611b53575060005460ff16155b611b6f5760405162461bcd60e51b81526004016104e290612526565b600054610100900460ff16158015611b91576000805461ffff19166101011790555b603380546001600160a01b0319163390811790915560405181906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35080156107cd576000805461ff001916905550565b600054610100900460ff1680611c01575060005460ff16155b611c1d5760405162461bcd60e51b81526004016104e290612526565b600054610100900460ff16158015611c3f576000805461ffff19166101011790555b8251611c529060689060208601906120c3565b508151611c669060699060208501906120c3565b50801561085b576000805461ff0019169055505050565b600054610100900460ff1680611c96575060005460ff16155b611cb25760405162461bcd60e51b81526004016104e290612526565b600054610100900460ff16158015611cd4576000805461ffff19166101011790555b6097805460ff1916905580156107cd576000805461ff001916905550565b8154600090611d035750600061044e565b82546000905b80821015611d6d576000611d1d8383611e36565b905084868281548110611d4057634e487b7160e01b600052603260045260246000fd5b90600052602060002001541115611d5957809150611d67565b611d648160016125f3565b92505b50611d09565b600082118015611db057508385611d8560018561263e565b81548110611da357634e487b7160e01b600052603260045260246000fd5b9060005260206000200154145b15611dc957611dc060018361263e565b9250505061044e565b50905061044e565b6000611ddc60fe5490565b905080611de884611e8d565b101561085b578254600180820185556000858152602080822090930193909355938401805494850181558252902090910155565b61085b838383611ede565b6060610a308484600085611f31565b60006002611e4481846126db565b611e4f6002866126db565b611e5991906125f3565b611e63919061260b565b611e6e60028461260b565b611e7960028661260b565b611e8391906125f3565b61050591906125f3565b8054600090611e9e575060006108c3565b81548290611eae9060019061263e565b81548110611ecc57634e487b7160e01b600052603260045260246000fd5b906000526020600020015490506108c3565b611ee9838383612059565b6001600160a01b038316611f0857611f0082611735565b6112cc61207c565b6001600160a01b038216611f1f57611f0083611735565b611f2883611735565b61085b82611735565b606082471015611f925760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016104e2565b843b611fe05760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016104e2565b600080866001600160a01b03168587604051611ffc919061244e565b60006040518083038185875af1925050503d8060008114612039576040519150601f19603f3d011682016040523d82523d6000602084013e61203e565b606091505b509150915061204e82828661208a565b979650505050505050565b60975460ff161561085b5760405162461bcd60e51b81526004016104e2906125a9565b61057560fc61175a60675490565b60608315612099575081610505565b8251156120a95782518084602001fd5b8160405162461bcd60e51b81526004016104e2919061246a565b8280546120cf90612685565b90600052602060002090601f0160209004810192826120f15760008555612137565b82601f1061210a57805160ff1916838001178555612137565b82800160010185558215612137579182015b8281111561213757825182559160200191906001019061211c565b50612143929150612147565b5090565b5b808211156121435760008155600101612148565b60008083601f84011261216d578081fd5b50813567ffffffffffffffff811115612184578182fd5b6020830191508360208260051b85010111156116d357600080fd5b600082601f8301126121af578081fd5b813567ffffffffffffffff808211156121ca576121ca61271b565b604051601f8301601f19908116603f011681019082821181831017156121f2576121f261271b565b8160405283815286602085880101111561220a578485fd5b8360208701602083013792830160200193909352509392505050565b600060208284031215612237578081fd5b813561050581612731565b60008060408385031215612254578081fd5b823561225f81612731565b9150602083013561226f81612731565b809150509250929050565b60008060006060848603121561228e578081fd5b833561229981612731565b925060208401356122a981612731565b929592945050506040919091013590565b600080600080606085870312156122cf578081fd5b84356122da81612731565b9350602085013567ffffffffffffffff8111156122f5578182fd5b6123018782880161215c565b9598909750949560400135949350505050565b60008060408385031215612326578182fd5b823561233181612731565b946020939093013593505050565b600080600060408486031215612353578283fd5b833567ffffffffffffffff811115612369578384fd5b6123758682870161215c565b909790965060209590950135949350505050565b60006020828403121561239a578081fd5b81518015158114610505578182fd5b60008060006060848603121561228e578283fd5b600080604083850312156123cf578182fd5b823567ffffffffffffffff808211156123e6578384fd5b6123f28683870161219f565b93506020850135915080821115612407578283fd5b506124148582860161219f565b9150509250929050565b60006020828403121561242f578081fd5b5035919050565b600060208284031215612447578081fd5b5051919050565b60008251612460818460208701612655565b9190910192915050565b6000602082528251806020840152612489816040850160208701612655565b601f01601f19169190910160400192915050565b60208082526023908201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526026908201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604082015265616c616e636560d01b606082015260800190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252602a908201527f45524332305061757361626c653a20746f6b656e207472616e736665722077686040820152691a5b19481c185d5cd95960b21b606082015260800190565b60008219821115612606576126066126ef565b500190565b60008261261a5761261a612705565b500490565b6000816000190483118215151615612639576126396126ef565b500290565b600082821015612650576126506126ef565b500390565b60005b83811015612670578181015183820152602001612658565b8381111561267f576000848401525b50505050565b600181811c9082168061269957607f821691505b602082108114156126ba57634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156126d4576126d46126ef565b5060010190565b6000826126ea576126ea612705565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107cd57600080fdfeddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa26469706673582212204831c4a72f99722e2569d6e815fabcc8ac18fbbfdb6a8f36707e1e015541037364736f6c63430008030033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101a95760003560e01c8063715018a6116100f9578063a9059cbb11610097578063dd62ed3e11610071578063dd62ed3e14610339578063e9825ffa14610372578063f2fde38b14610385578063fbc1284f14610398576101a9565b8063a9059cbb14610300578063c18e273414610313578063d5adcbe014610326576101a9565b806395d89b41116100d357806395d89b41146102ca5780639711715a146102d2578063981b24d0146102da578063a457c2d7146102ed576101a9565b8063715018a61461029f5780638456cb59146102a75780638da5cb5b146102af576101a9565b80633f4ba83a116101665780634cd88b76116101405780634cd88b761461025b5780634ee2cd7e1461026e5780635c975abb1461028157806370a082311461028c576101a9565b80633f4ba83a1461023657806344004cc1146102405780634c10879d14610253576101a9565b806306fdde03146101ae578063095ea7b3146101cc57806318160ddd146101ef57806323b872dd14610201578063313ce567146102145780633950935114610223575b600080fd5b6101b66103ab565b6040516101c3919061246a565b60405180910390f35b6101df6101da366004612314565b61043d565b60405190151581526020016101c3565b6067545b6040519081526020016101c3565b6101df61020f36600461227a565b610454565b604051601281526020016101c3565b6101df610231366004612314565b61050c565b61023e610543565b005b61023e61024e3660046123a9565b610577565b61023e610754565b61023e6102693660046123bd565b6107d0565b6101f361027c366004612314565b610860565b60975460ff166101df565b6101f361029a366004612226565b6108a9565b61023e6108c8565b61023e61093c565b6033546040516001600160a01b0390911681526020016101c3565b6101b661096e565b6101f361097d565b6101f36102e836600461241e565b610a0d565b6101df6102fb366004612314565b610a38565b6101df61030e366004612314565b610ad3565b6101df61032136600461233f565b610ae0565b6101df6103343660046122ba565b610c7d565b6101f3610347366004612242565b6001600160a01b03918216600090815260666020908152604080832093909416825291909152205490565b61023e610380366004612226565b610eb4565b61023e610393366004612226565b610faa565b61023e6103a6366004612226565b611095565b6060606880546103ba90612685565b80601f01602080910402602001604051908101604052809291908181526020018280546103e690612685565b80156104335780601f1061040857610100808354040283529160200191610433565b820191906000526020600020905b81548152906001019060200180831161041657829003601f168201915b5050505050905090565b600061044a33848461118c565b5060015b92915050565b60006104618484846112b1565b6001600160a01b0384166000908152606660209081526040808320338452909152902054828110156104eb5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b6104ff85336104fa868561263e565b61118c565b60019150505b9392505050565b3360008181526066602090815260408083206001600160a01b0387168452909152812054909161044a9185906104fa9086906125f3565b6033546001600160a01b0316331461056d5760405162461bcd60e51b81526004016104e290612574565b6105756112dc565b565b6033546001600160a01b031633146105a15760405162461bcd60e51b81526004016104e290612574565b6001600160a01b0383166106075760405162461bcd60e51b815260206004820152602760248201527f7a44414f546f6b656e3a20546f6b656e20616464726573732063616e6e6f74206044820152666265207a65726f60c81b60648201526084016104e2565b6001600160a01b0382166106715760405162461bcd60e51b815260206004820152602b60248201527f7a44414f546f6b656e3a20526563697069656e7420616464726573732063616e60448201526a6e6f74206265207a65726f60a81b60648201526084016104e2565b6000816106f6576040516370a0823160e01b81523060048201526001600160a01b038516906370a082319060240160206040518083038186803b1580156106b757600080fd5b505afa1580156106cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ef9190612436565b90506106f9565b50805b61070d6001600160a01b038516848361136f565b80836001600160a01b0316856001600160a01b03167facf3ec80f13d1c43e4c70cdf27a5966509d7582fff9fe9c2d4d2bc3268b19a2d60405160405180910390a450505050565b600054610100900460ff168061076d575060005460ff16155b6107895760405162461bcd60e51b81526004016104e290612526565b600054610100900460ff161580156107ab576000805461ffff19166101011790555b6107b36113c1565b6107bb611428565b80156107cd576000805461ff00191690555b50565b600054610100900460ff16806107e9575060005460ff16155b6108055760405162461bcd60e51b81526004016104e290612526565b600054610100900460ff16158015610827576000805461ffff19166101011790555b61082f6113c1565b61083983836114a3565b61084161150c565b610849611573565b801561085b576000805461ff00191690555b505050565b6001600160a01b038216600090815260fb60205260408120819081906108879085906115da565b915091508161089e57610899856108a9565b6108a0565b805b95945050505050565b6001600160a01b0381166000908152606560205260409020545b919050565b6033546001600160a01b031633146108f25760405162461bcd60e51b81526004016104e290612574565b6033546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3603380546001600160a01b0319169055565b6033546001600160a01b031633146109665760405162461bcd60e51b81526004016104e290612574565b610575611428565b6060606980546103ba90612685565b33600090815261012d602052604081205460ff16806109a657506033546001600160a01b031633145b610a005760405162461bcd60e51b815260206004820152602560248201527f7a44414f546f6b656e3a204e6f7420617574686f72697a656420746f20736e616044820152641c1cda1bdd60da1b60648201526084016104e2565b610a086116da565b905090565b6000806000610a1d8460fc6115da565b9150915081610a2e57606754610a30565b805b949350505050565b3360009081526066602090815260408083206001600160a01b038616845290915281205482811015610aba5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016104e2565b610ac933856104fa868561263e565b5060019392505050565b600061044a3384846112b1565b60003381610aee858561261f565b6001600160a01b038316600090815260656020526040902054909150811115610b295760405162461bcd60e51b81526004016104e2906124e0565b60975460ff1615610b4c5760405162461bcd60e51b81526004016104e2906125a9565b6001600160a01b03821660009081526065602052604081208054839290610b7490849061263e565b90915550610b83905082611735565b60005b85811015610c70576000878783818110610bb057634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610bc59190612226565b90506001600160a01b038116610bed5760405162461bcd60e51b81526004016104e29061249d565b6001600160a01b03811660009081526065602052604081208054889290610c159084906125f3565b90915550610c24905081611735565b806001600160a01b0316846001600160a01b031660008051602061274783398151915288604051610c5791815260200190565b60405180910390a350610c69816126c0565b9050610b86565b5060019695505050505050565b6000610c8b60975460ff1690565b15610ca85760405162461bcd60e51b81526004016104e2906125a9565b6000610cb4848461261f565b6001600160a01b038716600090815260656020526040902054909150811115610cef5760405162461bcd60e51b81526004016104e2906124e0565b6001600160a01b038616600090815260666020908152604080832033845290915290205481811015610d735760405162461bcd60e51b815260206004820152602760248201527f45524332303a207472616e7366657220746f74616c206578636565647320616c6044820152666c6f77616e636560c81b60648201526084016104e2565b610d8287336104fa858561263e565b6001600160a01b03871660009081526065602052604081208054849290610daa90849061263e565b90915550610db9905087611735565b60005b85811015610ea6576000878783818110610de657634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610dfb9190612226565b90506001600160a01b038116610e235760405162461bcd60e51b81526004016104e29061249d565b6001600160a01b03811660009081526065602052604081208054889290610e4b9084906125f3565b90915550610e5a905081611735565b806001600160a01b0316896001600160a01b031660008051602061274783398151915288604051610e8d91815260200190565b60405180910390a350610e9f816126c0565b9050610dbc565b506001979650505050505050565b6033546001600160a01b03163314610ede5760405162461bcd60e51b81526004016104e290612574565b6001600160a01b038116600090815261012d602052604090205460ff16610f515760405162461bcd60e51b815260206004820152602160248201527f7a44414f546f6b656e3a204163636f756e74206e6f7420617574686f72697a656044820152601960fa1b60648201526084016104e2565b6001600160a01b038116600081815261012d6020908152604091829020805460ff1916905590519182527f51f8ef0f426007e7662fabfb0a7d46d2e383ffe4f627aebfac09c2815468773991015b60405180910390a150565b6033546001600160a01b03163314610fd45760405162461bcd60e51b81526004016104e290612574565b6001600160a01b0381166110395760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104e2565b6033546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3603380546001600160a01b0319166001600160a01b0392909216919091179055565b6033546001600160a01b031633146110bf5760405162461bcd60e51b81526004016104e290612574565b6001600160a01b038116600090815261012d602052604090205460ff16156111375760405162461bcd60e51b815260206004820152602560248201527f7a44414f546f6b656e3a204163636f756e7420616c726561647920617574686f6044820152641c9a5e995960da1b60648201526084016104e2565b6001600160a01b038116600081815261012d6020908152604091829020805460ff1916600117905590519182527f2e457b8fcc8c01e995f48f89abb9cf6a72dce32622702d6ffa54c372be369ff99101610f9f565b6001600160a01b0383166111ee5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104e2565b6001600160a01b03821661124f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104e2565b6001600160a01b0383811660008181526066602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b0382163014156112d1576112cc838261175f565b61085b565b61085b8383836118a8565b60975460ff166113255760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016104e2565b6097805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b17905261085b9084906119fe565b600054610100900460ff16806113da575060005460ff16155b6113f65760405162461bcd60e51b81526004016104e290612526565b600054610100900460ff16158015611418576000805461ffff19166101011790555b611420611ad0565b6107bb611b3a565b60975460ff161561146e5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016104e2565b6097805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586113523390565b600054610100900460ff16806114bc575060005460ff16155b6114d85760405162461bcd60e51b81526004016104e290612526565b600054610100900460ff161580156114fa576000805461ffff19166101011790555b611502611ad0565b6108498383611be8565b600054610100900460ff1680611525575060005460ff16155b6115415760405162461bcd60e51b81526004016104e290612526565b600054610100900460ff16158015611563576000805461ffff19166101011790555b61156b611ad0565b6107bb611ad0565b600054610100900460ff168061158c575060005460ff16155b6115a85760405162461bcd60e51b81526004016104e290612526565b600054610100900460ff161580156115ca576000805461ffff19166101011790555b6115d2611ad0565b61156b611c7d565b600080600084116116265760405162461bcd60e51b815260206004820152601660248201527504552433230536e617073686f743a20696420697320360541b60448201526064016104e2565b60fe548411156116785760405162461bcd60e51b815260206004820152601d60248201527f4552433230536e617073686f743a206e6f6e6578697374656e7420696400000060448201526064016104e2565b60006116848486611cf2565b845490915081141561169d5760008092509250506116d3565b60018460010182815481106116c257634e487b7160e01b600052603260045260246000fd5b906000526020600020015492509250505b9250929050565b60006116ea60fe80546001019055565b60006116f560fe5490565b90507f8030e83b04d87bef53480e26263266d6ca66863aa8506aca6f2559d18aa1cb678160405161172891815260200190565b60405180910390a1905090565b6001600160a01b038116600090815260fb602052604090206107cd9061175a836108a9565b611dd1565b6001600160a01b0382166117bf5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016104e2565b6117cb82600083611e1c565b6001600160a01b0382166000908152606560205260409020548181101561183f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b60648201526084016104e2565b611849828261263e565b6001600160a01b0384166000908152606560205260408120919091556067805484929061187790849061263e565b90915550506040518281526000906001600160a01b03851690600080516020612747833981519152906020016112a4565b6001600160a01b03831661190c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104e2565b6001600160a01b0382166119325760405162461bcd60e51b81526004016104e29061249d565b61193d838383611e1c565b6001600160a01b038316600090815260656020526040902054818110156119765760405162461bcd60e51b81526004016104e2906124e0565b611980828261263e565b6001600160a01b0380861660009081526065602052604080822093909355908516815290812080548492906119b69084906125f3565b92505081905550826001600160a01b0316846001600160a01b0316600080516020612747833981519152846040516119f091815260200190565b60405180910390a350505050565b6000611a53826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611e279092919063ffffffff16565b80519091501561085b5780806020019051810190611a719190612389565b61085b5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016104e2565b600054610100900460ff1680611ae9575060005460ff16155b611b055760405162461bcd60e51b81526004016104e290612526565b600054610100900460ff161580156107bb576000805461ffff191661010117905580156107cd576000805461ff001916905550565b600054610100900460ff1680611b53575060005460ff16155b611b6f5760405162461bcd60e51b81526004016104e290612526565b600054610100900460ff16158015611b91576000805461ffff19166101011790555b603380546001600160a01b0319163390811790915560405181906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35080156107cd576000805461ff001916905550565b600054610100900460ff1680611c01575060005460ff16155b611c1d5760405162461bcd60e51b81526004016104e290612526565b600054610100900460ff16158015611c3f576000805461ffff19166101011790555b8251611c529060689060208601906120c3565b508151611c669060699060208501906120c3565b50801561085b576000805461ff0019169055505050565b600054610100900460ff1680611c96575060005460ff16155b611cb25760405162461bcd60e51b81526004016104e290612526565b600054610100900460ff16158015611cd4576000805461ffff19166101011790555b6097805460ff1916905580156107cd576000805461ff001916905550565b8154600090611d035750600061044e565b82546000905b80821015611d6d576000611d1d8383611e36565b905084868281548110611d4057634e487b7160e01b600052603260045260246000fd5b90600052602060002001541115611d5957809150611d67565b611d648160016125f3565b92505b50611d09565b600082118015611db057508385611d8560018561263e565b81548110611da357634e487b7160e01b600052603260045260246000fd5b9060005260206000200154145b15611dc957611dc060018361263e565b9250505061044e565b50905061044e565b6000611ddc60fe5490565b905080611de884611e8d565b101561085b578254600180820185556000858152602080822090930193909355938401805494850181558252902090910155565b61085b838383611ede565b6060610a308484600085611f31565b60006002611e4481846126db565b611e4f6002866126db565b611e5991906125f3565b611e63919061260b565b611e6e60028461260b565b611e7960028661260b565b611e8391906125f3565b61050591906125f3565b8054600090611e9e575060006108c3565b81548290611eae9060019061263e565b81548110611ecc57634e487b7160e01b600052603260045260246000fd5b906000526020600020015490506108c3565b611ee9838383612059565b6001600160a01b038316611f0857611f0082611735565b6112cc61207c565b6001600160a01b038216611f1f57611f0083611735565b611f2883611735565b61085b82611735565b606082471015611f925760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016104e2565b843b611fe05760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016104e2565b600080866001600160a01b03168587604051611ffc919061244e565b60006040518083038185875af1925050503d8060008114612039576040519150601f19603f3d011682016040523d82523d6000602084013e61203e565b606091505b509150915061204e82828661208a565b979650505050505050565b60975460ff161561085b5760405162461bcd60e51b81526004016104e2906125a9565b61057560fc61175a60675490565b60608315612099575081610505565b8251156120a95782518084602001fd5b8160405162461bcd60e51b81526004016104e2919061246a565b8280546120cf90612685565b90600052602060002090601f0160209004810192826120f15760008555612137565b82601f1061210a57805160ff1916838001178555612137565b82800160010185558215612137579182015b8281111561213757825182559160200191906001019061211c565b50612143929150612147565b5090565b5b808211156121435760008155600101612148565b60008083601f84011261216d578081fd5b50813567ffffffffffffffff811115612184578182fd5b6020830191508360208260051b85010111156116d357600080fd5b600082601f8301126121af578081fd5b813567ffffffffffffffff808211156121ca576121ca61271b565b604051601f8301601f19908116603f011681019082821181831017156121f2576121f261271b565b8160405283815286602085880101111561220a578485fd5b8360208701602083013792830160200193909352509392505050565b600060208284031215612237578081fd5b813561050581612731565b60008060408385031215612254578081fd5b823561225f81612731565b9150602083013561226f81612731565b809150509250929050565b60008060006060848603121561228e578081fd5b833561229981612731565b925060208401356122a981612731565b929592945050506040919091013590565b600080600080606085870312156122cf578081fd5b84356122da81612731565b9350602085013567ffffffffffffffff8111156122f5578182fd5b6123018782880161215c565b9598909750949560400135949350505050565b60008060408385031215612326578182fd5b823561233181612731565b946020939093013593505050565b600080600060408486031215612353578283fd5b833567ffffffffffffffff811115612369578384fd5b6123758682870161215c565b909790965060209590950135949350505050565b60006020828403121561239a578081fd5b81518015158114610505578182fd5b60008060006060848603121561228e578283fd5b600080604083850312156123cf578182fd5b823567ffffffffffffffff808211156123e6578384fd5b6123f28683870161219f565b93506020850135915080821115612407578283fd5b506124148582860161219f565b9150509250929050565b60006020828403121561242f578081fd5b5035919050565b600060208284031215612447578081fd5b5051919050565b60008251612460818460208701612655565b9190910192915050565b6000602082528251806020840152612489816040850160208701612655565b601f01601f19169190910160400192915050565b60208082526023908201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526026908201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604082015265616c616e636560d01b606082015260800190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252602a908201527f45524332305061757361626c653a20746f6b656e207472616e736665722077686040820152691a5b19481c185d5cd95960b21b606082015260800190565b60008219821115612606576126066126ef565b500190565b60008261261a5761261a612705565b500490565b6000816000190483118215151615612639576126396126ef565b500290565b600082821015612650576126506126ef565b500390565b60005b83811015612670578181015183820152602001612658565b8381111561267f576000848401525b50505050565b600181811c9082168061269957607f821691505b602082108114156126ba57634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156126d4576126d46126ef565b5060010190565b6000826126ea576126ea612705565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107cd57600080fdfeddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa26469706673582212204831c4a72f99722e2569d6e815fabcc8ac18fbbfdb6a8f36707e1e015541037364736f6c63430008030033
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 33 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.