ERC-20
DeFi
Overview
Max Total Supply
236,401.634724 QSD
Holders
44 (0.00%)
Market
Onchain Market Cap
$0.00
Circulating Supply Market Cap
-
Other Info
Token Contract (WITH 6 Decimals)
Balance
0 QSDValue
$0.00Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Source Code Verified (Exact Match)
Contract Name:
Qsd
Compiler Version
v0.8.23+commit.f704f362
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.23; /** * @title Quant Reserve Token Contract * @author A Q T I S / @AQTIS-Team * @notice This contract handles tokenomics for Qsd */ import {AbstractLST} from "./AbstractLST.sol"; import {ITokenPriceCalculator} from "../interfaces/ITokenPriceCalculator.sol"; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import {QsdRewards} from "./rewards/QsdRewards.sol"; // ======= QSD Contract ======= // contract Qsd is AbstractLST, QsdRewards { using SafeERC20 for IERC20; // ======= Constants ======= // uint constant public QSD_PRICE = 1; // ======= Dependencies ======= // address public immutable usdAddress; constructor(address _usd) // (name, symbol, totalMaxSupply, 15 %apy, 2.5%aqtisApy) AbstractLST("Quant State Dollar", "QSD", 1_000_000_000 * 1e6) QsdRewards(150, 25) { usdAddress = _usd; } function decimals() public view virtual override returns (uint8) { return 6; } function buyTokensWithEth() external override payable onlyBuyActive onlyWhitelist { uint tokensToMint = calculateTokensToMintWithEth(msg.value); // validate buy require(!_exceedsCap(tokensToMint), "Qsd: Buy exceeds cap"); require(msg.value >= minAmountBuy, "Qsd: Insufficient buy amount"); // execute buy _mint(msg.sender, tokensToMint); _forwardEth(msg.value); _afterBuy(msg.sender, tokensToMint); } function buyTokens(uint amount) external override onlyBuyActive onlyWhitelist { uint tokensToMint = calculateTokensToMintWithUSD(amount); // validate buy require(!_exceedsCap(tokensToMint), "Qsd: Buy exceeds cap"); require(amount >= minAmountBuy, "Qsd: Insufficient buy amount"); // transfer USD from user to contract IERC20(usdAddress).safeTransferFrom(msg.sender, address(this), amount); // execute buy _mint(msg.sender, tokensToMint); _forwardERC20(usdAddress, amount); _afterBuy(msg.sender, tokensToMint); } // ======= Permissioned Functions ======= // function mint(uint amount) external override onlyRewards { _mint(msg.sender, amount); } function mintWithCap(uint amount) external override onlyRewards { require(!_exceedsCap(amount), "Qsd: Mint exceeds cap"); _mint(msg.sender, amount); } function setRewardsAddress(address _rewardsAddress) external override onlyOwner { _setRewardsAddress(_rewardsAddress); } function setContractRewardsWhitelist(address _contract, bool _whitelisted) external onlyOwner { _setWhitelistedContract(_contract, _whitelisted); } function setTokenPriceCalculator(address _tokenPriceCalculator) external override onlyOwner { _setTokenPriceCalculator(_tokenPriceCalculator); } // ======= Public View Functions ======= // function calculateTokensToMintWithUSD(uint amount) public view returns (uint) { uint usdPrice = tokenPriceCalculator.getLatestUsdPrice(); return (amount * usdPrice) / (QSD_PRICE * 1e8); } function calculateTokensToMintWithEth(uint ethAmount) public view returns (uint) { uint ethPrice = tokenPriceCalculator.getLatestEthPrice(); return (ethAmount * ethPrice) / (QSD_PRICE * 1e8 * 1e12); } // ======= Override Functions ======= // function _update(address from, address to, uint256 value) internal virtual override { super._update(from, to, value); _updateRecord(from, value, Update.FROM); _updateRecord(to, value, Update.TO); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol) pragma solidity ^0.8.20; import {Context} from "../utils/Context.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. * * The initial owner is set to the address provided by the deployer. This can * later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; /** * @dev The caller account is not authorized to perform an operation. */ error OwnableUnauthorizedAccount(address account); /** * @dev The owner is not a valid owner account. (eg. `address(0)`) */ error OwnableInvalidOwner(address owner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the address provided by the deployer as the initial owner. */ constructor(address initialOwner) { if (initialOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(initialOwner); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { if (owner() != _msgSender()) { revert OwnableUnauthorizedAccount(_msgSender()); } } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { if (newOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol) pragma solidity ^0.8.20; /** * @dev Standard ERC20 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens. */ interface IERC20Errors { /** * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. * @param balance Current balance for the interacting account. * @param needed Minimum amount required to perform a transfer. */ error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC20InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC20InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers. * @param spender Address that may be allowed to operate on tokens without being their owner. * @param allowance Amount of tokens a `spender` is allowed to operate with. * @param needed Minimum amount required to perform a transfer. */ error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC20InvalidApprover(address approver); /** * @dev Indicates a failure with the `spender` to be approved. Used in approvals. * @param spender Address that may be allowed to operate on tokens without being their owner. */ error ERC20InvalidSpender(address spender); } /** * @dev Standard ERC721 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens. */ interface IERC721Errors { /** * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20. * Used in balance queries. * @param owner Address of the current owner of a token. */ error ERC721InvalidOwner(address owner); /** * @dev Indicates a `tokenId` whose `owner` is the zero address. * @param tokenId Identifier number of a token. */ error ERC721NonexistentToken(uint256 tokenId); /** * @dev Indicates an error related to the ownership over a particular token. Used in transfers. * @param sender Address whose tokens are being transferred. * @param tokenId Identifier number of a token. * @param owner Address of the current owner of a token. */ error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC721InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC721InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `operator`’s approval. Used in transfers. * @param operator Address that may be allowed to operate on tokens without being their owner. * @param tokenId Identifier number of a token. */ error ERC721InsufficientApproval(address operator, uint256 tokenId); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC721InvalidApprover(address approver); /** * @dev Indicates a failure with the `operator` to be approved. Used in approvals. * @param operator Address that may be allowed to operate on tokens without being their owner. */ error ERC721InvalidOperator(address operator); } /** * @dev Standard ERC1155 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens. */ interface IERC1155Errors { /** * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. * @param balance Current balance for the interacting account. * @param needed Minimum amount required to perform a transfer. * @param tokenId Identifier number of a token. */ error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC1155InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC1155InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `operator`’s approval. Used in transfers. * @param operator Address that may be allowed to operate on tokens without being their owner. * @param owner Address of the current owner of a token. */ error ERC1155MissingApprovalForAll(address operator, address owner); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC1155InvalidApprover(address approver); /** * @dev Indicates a failure with the `operator` to be approved. Used in approvals. * @param operator Address that may be allowed to operate on tokens without being their owner. */ error ERC1155InvalidOperator(address operator); /** * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation. * Used in batch transfers. * @param idsLength Length of the array of token identifiers * @param valuesLength Length of the array of token amounts */ error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/ERC20.sol) pragma solidity ^0.8.20; import {IERC20} from "./IERC20.sol"; import {IERC20Metadata} from "./extensions/IERC20Metadata.sol"; import {Context} from "../../utils/Context.sol"; import {IERC20Errors} from "../../interfaces/draft-IERC6093.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}. * * TIP: For a detailed writeup see our guide * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * The default value of {decimals} is 18. To change this, you should override * this function so it returns a different value. * * We have followed general OpenZeppelin Contracts guidelines: functions revert * instead returning `false` on failure. This behavior is nonetheless * conventional and does not conflict with the expectations of ERC20 * applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. */ abstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors { mapping(address account => uint256) private _balances; mapping(address account => mapping(address spender => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * All two of these values are immutable: they can only be set once during * construction. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual 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 default value returned by this function, unless * it's overridden. * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `to` cannot be the zero address. * - the caller must have a balance of at least `value`. */ function transfer(address to, uint256 value) public virtual returns (bool) { address owner = _msgSender(); _transfer(owner, to, value); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * NOTE: If `value` is the maximum `uint256`, the allowance is not updated on * `transferFrom`. This is semantically equivalent to an infinite approval. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 value) public virtual returns (bool) { address owner = _msgSender(); _approve(owner, spender, value); 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}. * * NOTE: Does not update the allowance if the current allowance * is the maximum `uint256`. * * Requirements: * * - `from` and `to` cannot be the zero address. * - `from` must have a balance of at least `value`. * - the caller must have allowance for ``from``'s tokens of at least * `value`. */ function transferFrom(address from, address to, uint256 value) public virtual returns (bool) { address spender = _msgSender(); _spendAllowance(from, spender, value); _transfer(from, to, value); return true; } /** * @dev Moves a `value` amount of tokens from `from` to `to`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * NOTE: This function is not virtual, {_update} should be overridden instead. */ function _transfer(address from, address to, uint256 value) internal { if (from == address(0)) { revert ERC20InvalidSender(address(0)); } if (to == address(0)) { revert ERC20InvalidReceiver(address(0)); } _update(from, to, value); } /** * @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from` * (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding * this function. * * Emits a {Transfer} event. */ function _update(address from, address to, uint256 value) internal virtual { if (from == address(0)) { // Overflow check required: The rest of the code assumes that totalSupply never overflows _totalSupply += value; } else { uint256 fromBalance = _balances[from]; if (fromBalance < value) { revert ERC20InsufficientBalance(from, fromBalance, value); } unchecked { // Overflow not possible: value <= fromBalance <= totalSupply. _balances[from] = fromBalance - value; } } if (to == address(0)) { unchecked { // Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply. _totalSupply -= value; } } else { unchecked { // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256. _balances[to] += value; } } emit Transfer(from, to, value); } /** * @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0). * Relies on the `_update` mechanism * * Emits a {Transfer} event with `from` set to the zero address. * * NOTE: This function is not virtual, {_update} should be overridden instead. */ function _mint(address account, uint256 value) internal { if (account == address(0)) { revert ERC20InvalidReceiver(address(0)); } _update(address(0), account, value); } /** * @dev Destroys a `value` amount of tokens from `account`, lowering the total supply. * Relies on the `_update` mechanism. * * Emits a {Transfer} event with `to` set to the zero address. * * NOTE: This function is not virtual, {_update} should be overridden instead */ function _burn(address account, uint256 value) internal { if (account == address(0)) { revert ERC20InvalidSender(address(0)); } _update(account, address(0), value); } /** * @dev Sets `value` 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. * * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument. */ function _approve(address owner, address spender, uint256 value) internal { _approve(owner, spender, value, true); } /** * @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event. * * By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by * `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any * `Approval` event during `transferFrom` operations. * * Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to * true using the following override: * ``` * function _approve(address owner, address spender, uint256 value, bool) internal virtual override { * super._approve(owner, spender, value, true); * } * ``` * * Requirements are the same as {_approve}. */ function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual { if (owner == address(0)) { revert ERC20InvalidApprover(address(0)); } if (spender == address(0)) { revert ERC20InvalidSpender(address(0)); } _allowances[owner][spender] = value; if (emitEvent) { emit Approval(owner, spender, value); } } /** * @dev Updates `owner` s allowance for `spender` based on spent `value`. * * Does not update the allowance value in case of infinite allowance. * Revert if not enough allowance is available. * * Does not emit an {Approval} event. */ function _spendAllowance(address owner, address spender, uint256 value) internal virtual { uint256 currentAllowance = allowance(owner, spender); if (currentAllowance != type(uint256).max) { if (currentAllowance < value) { revert ERC20InsufficientAllowance(spender, currentAllowance, value); } unchecked { _approve(owner, spender, currentAllowance - value, false); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the value of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the value of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves a `value` amount of tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 value) 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 a `value` amount of tokens 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 value) external returns (bool); /** * @dev Moves a `value` amount of tokens from `from` to `to` using the * allowance mechanism. `value` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 value) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity ^0.8.20; import {IERC20} from "../IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. * * ==== Security Considerations * * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be * considered as an intention to spend the allowance in any specific way. The second is that because permits have * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be * generally recommended is: * * ```solidity * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public { * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {} * doThing(..., value); * } * * function doThing(..., uint256 value) public { * token.safeTransferFrom(msg.sender, address(this), value); * ... * } * ``` * * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also * {SafeERC20-safeTransferFrom}). * * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so * contracts should have entry points that don't rely on permit. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. * * CAUTION: See Security Considerations above. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.20; import {IERC20} from "../IERC20.sol"; import {IERC20Permit} from "../extensions/IERC20Permit.sol"; import {Address} from "../../../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; /** * @dev An operation with an ERC20 token failed. */ error SafeERC20FailedOperation(address token); /** * @dev Indicates a failed `decreaseAllowance` request. */ error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease); /** * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value))); } /** * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful. */ function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value))); } /** * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 oldAllowance = token.allowance(address(this), spender); forceApprove(token, spender, oldAllowance + value); } /** * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no * value, non-reverting calls are assumed to be successful. */ function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal { unchecked { uint256 currentAllowance = token.allowance(address(this), spender); if (currentAllowance < requestedDecrease) { revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease); } forceApprove(token, spender, currentAllowance - requestedDecrease); } } /** * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval * to be set to zero before setting it to a non-zero value, such as USDT. */ function forceApprove(IERC20 token, address spender, uint256 value) internal { bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value)); if (!_callOptionalReturnBool(token, approvalCall)) { _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0))); _callOptionalReturn(token, approvalCall); } } /** * @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); if (returndata.length != 0 && !abi.decode(returndata, (bool))) { revert SafeERC20FailedOperation(address(token)); } } /** * @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). * * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead. */ function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) { // 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 cannot use {Address-functionCall} here since this should return false // and not revert is the subcall reverts. (bool success, bytes memory returndata) = address(token).call(data); return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol) pragma solidity ^0.8.20; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev The ETH balance of the account is not enough to perform the operation. */ error AddressInsufficientBalance(address account); /** * @dev There's no code at `target` (it is not a contract). */ error AddressEmptyCode(address target); /** * @dev A call to an address target failed. The target may have reverted. */ error FailedInnerCall(); /** * @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://consensys.net/diligence/blog/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.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { if (address(this).balance < amount) { revert AddressInsufficientBalance(address(this)); } (bool success, ) = recipient.call{value: amount}(""); if (!success) { revert FailedInnerCall(); } } /** * @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 or custom error, it is bubbled * up by this function (like regular Solidity function calls). However, if * the call reverted with no returned reason, this function reverts with a * {FailedInnerCall} error. * * 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. */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0); } /** * @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`. */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { if (address(this).balance < value) { revert AddressInsufficientBalance(address(this)); } (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an * unsuccessful call. */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata ) internal view returns (bytes memory) { if (!success) { _revert(returndata); } else { // only check if target is a contract if the call was successful and the return data is empty // otherwise we already know that it was a contract if (returndata.length == 0 && target.code.length == 0) { revert AddressEmptyCode(target); } return returndata; } } /** * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the * revert reason or with a default {FailedInnerCall} error. */ function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) { if (!success) { _revert(returndata); } else { return returndata; } } /** * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}. */ function _revert(bytes memory returndata) private pure { // 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 /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert FailedInnerCall(); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/ReentrancyGuard.sol) pragma solidity ^0.8.20; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant NOT_ENTERED = 1; uint256 private constant ENTERED = 2; uint256 private _status; /** * @dev Unauthorized reentrant call. */ error ReentrancyGuardReentrantCall(); constructor() { _status = NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be NOT_ENTERED if (_status == ENTERED) { revert ReentrancyGuardReentrantCall(); } // Any calls to nonReentrant after this point will fail _status = ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = NOT_ENTERED; } /** * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a * `nonReentrant` function in the call stack. */ function _reentrancyGuardEntered() internal view returns (bool) { return _status == ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/structs/EnumerableSet.sol) // This file was procedurally generated from scripts/generate/templates/EnumerableSet.js. pragma solidity ^0.8.20; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ```solidity * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. * * [WARNING] * ==== * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure * unusable. * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. * * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an * array of EnumerableSet. * ==== */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position is the index of the value in the `values` array plus 1. // Position 0 is used to mean a value is not in the set. mapping(bytes32 value => uint256) _positions; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._positions[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We cache the value's position to prevent multiple reads from the same storage slot uint256 position = set._positions[value]; if (position != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 valueIndex = position - 1; uint256 lastIndex = set._values.length - 1; if (valueIndex != lastIndex) { bytes32 lastValue = set._values[lastIndex]; // Move the lastValue to the index where the value to delete is set._values[valueIndex] = lastValue; // Update the tracked position of the lastValue (that was just moved) set._positions[lastValue] = position; } // Delete the slot where the moved value was stored set._values.pop(); // Delete the tracked position for the deleted slot delete set._positions[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._positions[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { return set._values[index]; } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function _values(Set storage set) private view returns (bytes32[] memory) { return set._values; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { bytes32[] memory store = _values(set._inner); bytes32[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(AddressSet storage set) internal view returns (address[] memory) { bytes32[] memory store = _values(set._inner); address[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values in the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(UintSet storage set) internal view returns (uint256[] memory) { bytes32[] memory store = _values(set._inner); uint256[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.23; interface IRewards { struct RewardsDistribution { uint256 usdcRewards; uint256 ethRewards; uint256 aqtisRewards; uint256 cappedLSTRewards; } function getRewardsFor(address user) external view returns (RewardsDistribution memory); function resetUser(address user) external; function twaCircSupplySinceLastClaim(address user) external view returns (uint); function circulatingSupply() external view returns (uint); function cumulativeCirculatingSupply() external view returns (uint); function userTWAB(address user) external view returns (uint); function lastClaimTime(address user) external view returns (uint); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.23; /** * @title Token Price Calculator Interface * @notice Interface for token price calculator */ interface ITokenPriceCalculator { function update() external; function getAqtisPriceInWETH() external view returns (uint256); function getAqtisPriceInUSD() external view returns (uint256); function getLatestUsdPrice() external view returns (uint256); function getLatestEthPrice() external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.23; import {Address} from "@openzeppelin/contracts/utils/Address.sol"; import {ReentrancyGuard} from "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {PseudoCappedERC20} from "../token/PseudoCappedERC20.sol"; /** * @title Abstract LSD Contract * @author A Q T I S / @AQTIS-Team * @notice This contract provides the LSD tokenomics */ abstract contract AbstractLST is PseudoCappedERC20, Ownable, ReentrancyGuard { using Address for address; using SafeERC20 for IERC20; // ======= Roles ======= // address public distributionAddress; // ======= State Variables ======= // bool public buyActive; bool public whitelistActive; uint256 public minAmountBuy; mapping(address => bool) public whitelist; // ======= Event Logs ======= // event BuyTokens(address indexed user, uint256 amount, uint256 newTotalSupply); event SoftMaxSupplyChanged(uint256 newSoftMaxSupply); event MinAmountBuyChanged(uint256 newMinAmountBuy); event BuyActivated(address indexed activator); event BuyDeactivated(address indexed deactivator); event WhitelistActivated(address indexed activator); event WhitelistDeactivated(address indexed deactivator); event WhitelistUpdated(address indexed addr, bool whitelisted); event DistributionAddressUpdated(address indexed newDistributionAddress); constructor( string memory _name, string memory _symbol, uint256 _totalMaxSupply ) PseudoCappedERC20(_name, _symbol, _totalMaxSupply) Ownable(msg.sender) {} // ======= Setters ======= // function setMinAmountBuy(uint256 _newMinAmountBuy) external onlyOwner { require(_newMinAmountBuy > 0, "Min amount buy must be greater than 0"); minAmountBuy = _newMinAmountBuy; emit MinAmountBuyChanged(_newMinAmountBuy); } function setBuyActive(bool _buyActive) external onlyOwner { buyActive = _buyActive; if (_buyActive) { emit BuyActivated(msg.sender); } else { emit BuyDeactivated(msg.sender); } } function setWhitelistActive(bool _whitelistActive) external onlyOwner { whitelistActive = _whitelistActive; if (_whitelistActive) { emit WhitelistActivated(msg.sender); } else { emit WhitelistDeactivated(msg.sender); } } function updateWhitelist(address _addr, bool _whitelisted) external onlyOwner { whitelist[_addr] = _whitelisted; emit WhitelistUpdated(_addr, _whitelisted); } function setDistributionAddress(address _distributionAddress) external onlyOwner { distributionAddress = _distributionAddress; emit DistributionAddressUpdated(_distributionAddress); } function setCap(uint256 _newCap) external onlyOwner { _setCap(_newCap); emit SoftMaxSupplyChanged(_newCap); } // ======= Modifiers ======= // modifier onlyBuyActive() { require(buyActive, "Abstract LST: buy not active"); _; } modifier onlyWhitelist() { if (whitelistActive) { require(whitelist[msg.sender], "Abstract LST: caller is not whitelisted"); } _; } // ======= Abstract Functions ======= // function buyTokensWithEth() external virtual payable; function buyTokens(uint amount) external virtual; // only for rewards address function mint(uint amount) external virtual; function mintWithCap(uint amount) external virtual; function setRewardsAddress(address _rewardsAddress) external virtual; function setTokenPriceCalculator(address _tokenPriceCalculator) external virtual; // ======= Internal Functions ======= // function _forwardEth(uint256 _amount) internal { require(distributionAddress != address(0), "Abstract LST: distributor address not set"); require(_amount > 0, "Abstract LST: amount must be greater than 0"); Address.sendValue(payable(distributionAddress), _amount); } function _forwardERC20(address _token, uint256 _amount) internal { require(_token != address(0), "Abstract LST: token address cannot be the zero address"); require(_amount > 0, "Abstract LST: amount must be greater than 0"); IERC20(_token).safeTransfer(distributionAddress, _amount); } function _afterBuy(address _user, uint256 _amount) internal { emit BuyTokens(_user, _amount, totalSupply()); } // ======= External Functions ======= // /// @notice Allows the owner to withdraw stuck ETH from the contract function withdrawETH() external onlyOwner { require(owner() != address(0), "AbstractLST: owner cannot be the zero address"); Address.sendValue(payable(owner()), address(this).balance); } /// @notice Allows the owner to withdraw any ERC20 token from the contract /// @param token The address of the ERC20 token to withdraw function withdrawERC20(address token) external onlyOwner { require(owner() != address(0), "AbstractLST: owner cannot be the zero address"); IERC20(token).safeTransfer(owner(), IERC20(token).balanceOf(address(this))); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.23; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import {IRewards} from "../../interfaces/IRewards.sol"; import {ITokenPriceCalculator} from "../../interfaces/ITokenPriceCalculator.sol"; abstract contract AbstractRewards is IRewards { using EnumerableSet for EnumerableSet.AddressSet; enum Update {FROM, TO} struct UserRecord { uint256 userBalance; uint256 lastUpdateTime; uint256 cumulativeBalance; uint256 cumCirculatingSupplyLastClaim; uint256 lastClaimTime; } // ======= Dependencies ======= // address public rewardsAddress; ITokenPriceCalculator public tokenPriceCalculator; // ======= State Variables ======= // uint public immutable apy; uint public immutable aqtisApy; uint public constant DENOMINATOR = 1000; struct Supply { uint totalSupply; uint lastUpdateTime; uint currentCirculatingSupply; uint cumulativeCirculatingSupply; } Supply internal _supply; mapping(address => bool) public whitelistedContracts; constructor(uint _apy, uint _aqtisApy) { apy = _apy; aqtisApy = _aqtisApy; } modifier onlyRewards { require(msg.sender == rewardsAddress, "Rewards: Only rewards contract can call this function"); _; } // ======= State Variables ======= // mapping(address => UserRecord) internal _userRecords; // ======= Setters Variables ======= // function _setRewardsAddress(address _rewardsAddress) internal { rewardsAddress = _rewardsAddress; } function _setTokenPriceCalculator(address _tokenPriceCalculator) internal { tokenPriceCalculator = ITokenPriceCalculator(_tokenPriceCalculator); } // ======= Abstract Functions ======= // function getRewardsFor(address user) external view virtual returns (RewardsDistribution memory); function _beforeUpdate(address user, uint256 value, Update updateType) internal virtual; function _beforeReset(address user) internal virtual; // ======= External Functions ======= // function resetUser(address user) external onlyRewards { _resetUser(user); } // ======= Internal Functions ======= // function _updateSupply(address user, uint256 value, Update updateType) internal { uint updateDiff = block.timestamp - _supply.lastUpdateTime; _supply.cumulativeCirculatingSupply += _supply.currentCirculatingSupply * updateDiff; // handle mint and burn if (user == address(0)) { if (updateType == Update.FROM) { _supply.totalSupply += value; } else if (updateType == Update.TO) { _supply.totalSupply -= value; } } bool userIsContract = isContract(user); if (userIsContract && _userRecords[user].userBalance != 0) { // adjust circulating supply by remaining contract balance if (updateType == Update.FROM) _supply.currentCirculatingSupply -= (_userRecords[user].userBalance - value); else if (updateType == Update.TO) { _supply.currentCirculatingSupply -= (_userRecords[user].userBalance + value); } delete _userRecords[user]; } else if (updateType == Update.FROM && (user == address(0) || userIsContract)) { _supply.currentCirculatingSupply += value; } else if (updateType == Update.TO && (user == address(0) || userIsContract)) { _supply.currentCirculatingSupply -= value; } _supply.lastUpdateTime = block.timestamp; } function _updateRecord(address user, uint256 value, Update updateType) internal { _beforeUpdate(user, value, updateType); _updateSupply(user, value, updateType); if (user == address(0) || isContract(user)) { return; } UserRecord storage record = _userRecords[user]; uint256 timeElapsed = 0; // First entry check if (record.lastUpdateTime == 0) { record.cumulativeBalance = 0; record.cumCirculatingSupplyLastClaim = _supply.cumulativeCirculatingSupply; record.lastClaimTime = block.timestamp; } else { timeElapsed = block.timestamp - record.lastUpdateTime; record.cumulativeBalance += record.userBalance * timeElapsed; } // Update balance and last update time if (updateType == Update.FROM) { record.userBalance -= value; } else { record.userBalance += value; } record.lastUpdateTime = block.timestamp; } function _getTWAB(address user) internal view returns (uint256) { UserRecord memory record = _userRecords[user]; uint256 claimTime = block.timestamp - record.lastClaimTime; if (claimTime == 0) { return 0; } uint256 timeDifference = block.timestamp - record.lastUpdateTime; return (record.cumulativeBalance + (record.userBalance * timeDifference)) / claimTime; } function _resetUser(address user) internal { _beforeReset(user); UserRecord storage record = _userRecords[user]; record.lastClaimTime = block.timestamp; record.lastUpdateTime = block.timestamp; record.cumulativeBalance = 0; record.cumCirculatingSupplyLastClaim = cumulativeCirculatingSupply(); } function _setWhitelistedContract(address _contract, bool _isWhitelisted) internal { whitelistedContracts[_contract] = _isWhitelisted; } // ======= Public View Functions ======= // function twaCircSupplySinceLastClaim(address user) public view returns (uint) { UserRecord memory record = _userRecords[user]; uint claimTime = block.timestamp - record.lastClaimTime; require(claimTime > 0, "Rewards: Claim time is 0"); return (cumulativeCirculatingSupply() - record.cumCirculatingSupplyLastClaim) / claimTime; } function circulatingSupply() public view returns (uint) { return _supply.currentCirculatingSupply; } function cumulativeCirculatingSupply() public view returns (uint){ uint updateDiff = block.timestamp - _supply.lastUpdateTime; return _supply.cumulativeCirculatingSupply + _supply.currentCirculatingSupply * updateDiff; } function userTWAB(address user) external view returns (uint) { return _getTWAB(user); } function lastClaimTime(address user) external view returns (uint) { return _userRecords[user].lastClaimTime; } // ======= Utils ======= // function isContract(address addr) internal view returns (bool) { if (whitelistedContracts[addr]) { return false; } uint size; assembly { size := extcodesize(addr) } return size > 0; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.23; import {AbstractRewards} from "./AbstractRewards.sol"; import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; contract QsdRewards is AbstractRewards { constructor (uint _apy, uint _aqtisApy) AbstractRewards(_apy, _aqtisApy) { } function getRewardsFor(address user) external view override returns (RewardsDistribution memory) { uint256 twab = _getTWAB(user); uint timeSinceLastClaim = block.timestamp - _userRecords[user].lastClaimTime; uint usdcRewards = ((apy - aqtisApy) * twab * timeSinceLastClaim) / (DENOMINATOR * 365 days); uint aqtisRewards = _getAqtisRewards(twab, timeSinceLastClaim); return RewardsDistribution(usdcRewards, 0, aqtisRewards, 0); } function _beforeUpdate(address user, uint256 value, Update updateType) internal override { // Do nothing } function _beforeReset(address user) internal override { // Do nothing } function _getAqtisRewards(uint twab, uint duration) internal view returns (uint) { uint aqtisPrice = tokenPriceCalculator.getAqtisPriceInUSD(); return (aqtisApy * twab * duration * 1e18 * 1e12) / (DENOMINATOR * aqtisPrice * 365 days); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.23; import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; /** * @title PseudoCappedERC20 Contract * @author A Q T I S / @AQTIS-Team * @notice This contract provides the base functionality for a soft-capped ERC20 token */ contract PseudoCappedERC20 is ERC20 { uint256 internal _cap; constructor( string memory __name, string memory __symbol, uint256 __cap ) ERC20(__name, __symbol) { _cap = __cap; } function _setCap(uint256 __newCap) internal { _cap = __newCap; } function _exceedsCap(uint256 amount) internal view returns (bool) { return totalSupply() + amount > _cap; } function cap() external view returns (uint256) { return _cap; } }
{ "evmVersion": "paris", "libraries": {}, "metadata": { "bytecodeHash": "ipfs", "useLiteralContent": true }, "optimizer": { "enabled": true, "runs": 1000 }, "remappings": [], "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_usd","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"allowance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"ERC20InsufficientAllowance","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"ERC20InsufficientBalance","type":"error"},{"inputs":[{"internalType":"address","name":"approver","type":"address"}],"name":"ERC20InvalidApprover","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC20InvalidReceiver","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"ERC20InvalidSender","type":"error"},{"inputs":[{"internalType":"address","name":"spender","type":"address"}],"name":"ERC20InvalidSpender","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"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":true,"internalType":"address","name":"activator","type":"address"}],"name":"BuyActivated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"deactivator","type":"address"}],"name":"BuyDeactivated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newTotalSupply","type":"uint256"}],"name":"BuyTokens","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newDistributionAddress","type":"address"}],"name":"DistributionAddressUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newMinAmountBuy","type":"uint256"}],"name":"MinAmountBuyChanged","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":"uint256","name":"newSoftMaxSupply","type":"uint256"}],"name":"SoftMaxSupplyChanged","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":true,"internalType":"address","name":"activator","type":"address"}],"name":"WhitelistActivated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"deactivator","type":"address"}],"name":"WhitelistDeactivated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"addr","type":"address"},{"indexed":false,"internalType":"bool","name":"whitelisted","type":"bool"}],"name":"WhitelistUpdated","type":"event"},{"inputs":[],"name":"DENOMINATOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"QSD_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"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":"value","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"apy","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"aqtisApy","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"buyActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"buyTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"buyTokensWithEth","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"ethAmount","type":"uint256"}],"name":"calculateTokensToMintWithEth","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"calculateTokensToMintWithUSD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"circulatingSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cumulativeCirculatingSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"distributionAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getRewardsFor","outputs":[{"components":[{"internalType":"uint256","name":"usdcRewards","type":"uint256"},{"internalType":"uint256","name":"ethRewards","type":"uint256"},{"internalType":"uint256","name":"aqtisRewards","type":"uint256"},{"internalType":"uint256","name":"cappedLSTRewards","type":"uint256"}],"internalType":"struct IRewards.RewardsDistribution","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"lastClaimTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minAmountBuy","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mintWithCap","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":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"resetUser","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardsAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"_buyActive","type":"bool"}],"name":"setBuyActive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newCap","type":"uint256"}],"name":"setCap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_contract","type":"address"},{"internalType":"bool","name":"_whitelisted","type":"bool"}],"name":"setContractRewardsWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_distributionAddress","type":"address"}],"name":"setDistributionAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newMinAmountBuy","type":"uint256"}],"name":"setMinAmountBuy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_rewardsAddress","type":"address"}],"name":"setRewardsAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenPriceCalculator","type":"address"}],"name":"setTokenPriceCalculator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_whitelistActive","type":"bool"}],"name":"setWhitelistActive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenPriceCalculator","outputs":[{"internalType":"contract ITokenPriceCalculator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transferFrom","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":[{"internalType":"address","name":"user","type":"address"}],"name":"twaCircSupplySinceLastClaim","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_addr","type":"address"},{"internalType":"bool","name":"_whitelisted","type":"bool"}],"name":"updateWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"usdAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"userTWAB","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelist","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"whitelistActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelistedContracts","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"withdrawERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawETH","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60e06040523480156200001157600080fd5b5060405162002f8c38038062002f8c833981016040819052620000349162000169565b6096601981816040518060400160405280601281526020017128bab0b73a1029ba30ba32902237b63630b960711b815250604051806040016040528060038152602001621454d160ea1b81525066038d7ea4c680003383838382828160039081620000a0919062000242565b506004620000af828262000242565b50505060055550506001600160a01b038116620000e657604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b620000f18162000117565b50506001600755505060809190915260a05250506001600160a01b031660c0526200030e565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000602082840312156200017c57600080fd5b81516001600160a01b03811681146200019457600080fd5b9392505050565b634e487b7160e01b600052604160045260246000fd5b600181811c90821680620001c657607f821691505b602082108103620001e757634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200023d576000816000526020600020601f850160051c81016020861015620002185750805b601f850160051c820191505b81811015620002395782815560010162000224565b5050505b505050565b81516001600160401b038111156200025e576200025e6200019b565b62000276816200026f8454620001b1565b84620001ed565b602080601f831160018114620002ae5760008415620002955750858301515b600019600386901b1c1916600185901b17855562000239565b600085815260208120601f198616915b82811015620002df57888601518255948401946001909101908401620002be565b5085821015620002fe5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60805160a05160c051612c2b620003616000396000818161075201528181610fbc0152610ff30152600081816108c001528181610b940152611b880152600081816105850152610bb50152612c2b6000f3fe6080604052600436106103295760003560e01c80639358928b116101a5578063c0973eed116100ec578063e086e5ec11610095578063f2fde38b1161006f578063f2fde38b14610985578063f4f3b200146109a5578063f89b7644146109c5578063fed1280b146109e557600080fd5b8063e086e5ec14610930578063e347358014610945578063eb45261a1461096557600080fd5b8063d34fd412116100c6578063d34fd412146108ae578063d87744cf146108e2578063dd62ed3e146108ea57600080fd5b8063c0973eed1461084e578063c3b754dc1461086e578063ccdfff531461088e57600080fd5b8063a0712d681161014e578063a9c8d48811610128578063a9c8d488146107d5578063b77cf9c6146107f5578063b89fc89e1461082e57600080fd5b8063a0712d6814610774578063a11a1add14610794578063a9059cbb146107b557600080fd5b80639b19251a1161017f5780639b19251a146106fa5780639bdd940c1461072a5780639e1a86131461074057600080fd5b80639358928b146106b057806393dd451e146106c557806395d89b41146106e557600080fd5b80633610724e116102745780636aae22031161021d57806383e193a6116101f757806383e193a6146106475780638906758d1461065c5780638da5cb5b1461067c578063918f86741461069a57600080fd5b80636aae2203146105dc57806370a08231146105fc578063715018a61461063257600080fd5b80633bcfc4b81161024e5780633bcfc4b81461057357806347786d37146105a75780634fbee124146105c757600080fd5b80633610724e146104eb57806337fb7e211461050b578063391feebb1461054357600080fd5b806323b872dd116102d6578063343959b4116102b0578063343959b414610496578063353d224b146104b6578063355274ea146104d657600080fd5b806323b872dd1461043a57806328a659101461045a578063313ce5671461047a57600080fd5b80630d392cd9116103075780630d392cd9146103a657806318160ddd146103c85780632260b83e146103e757600080fd5b806302ce58131461032e57806306fdde0314610364578063095ea7b314610386575b600080fd5b34801561033a57600080fd5b5060085461034f90600160a81b900460ff1681565b60405190151581526020015b60405180910390f35b34801561037057600080fd5b50610379610a05565b60405161035b9190612960565b34801561039257600080fd5b5061034f6103a13660046129af565b610a97565b3480156103b257600080fd5b506103c66103c13660046129e7565b610ab1565b005b3480156103d457600080fd5b506002545b60405190815260200161035b565b3480156103f357600080fd5b50610407610402366004612a1e565b610b19565b60405161035b91908151815260208083015190820152604080830151908201526060918201519181019190915260800190565b34801561044657600080fd5b5061034f610455366004612a39565b610c30565b34801561046657600080fd5b506103d9610475366004612a75565b610c56565b34801561048657600080fd5b506040516006815260200161035b565b3480156104a257600080fd5b506103c66104b1366004612a1e565b610d04565b3480156104c257600080fd5b506103d96104d1366004612a75565b610d95565b3480156104e257600080fd5b506005546103d9565b3480156104f757600080fd5b506103c6610506366004612a75565b610e20565b34801561051757600080fd5b5060085461052b906001600160a01b031681565b6040516001600160a01b03909116815260200161035b565b34801561054f57600080fd5b5061034f61055e366004612a1e565b60116020526000908152604090205460ff1681565b34801561057f57600080fd5b506103d97f000000000000000000000000000000000000000000000000000000000000000081565b3480156105b357600080fd5b506103c66105c2366004612a75565b611026565b3480156105d357600080fd5b506103d961106e565b3480156105e857600080fd5b506103c66105f7366004612a1e565b6110a4565b34801561060857600080fd5b506103d9610617366004612a1e565b6001600160a01b031660009081526020819052604090205490565b34801561063e57600080fd5b506103c66110d7565b34801561065357600080fd5b506103d9600181565b34801561066857600080fd5b506103c6610677366004612a1e565b6110eb565b34801561068857600080fd5b506006546001600160a01b031661052b565b3480156106a657600080fd5b506103d96103e881565b3480156106bc57600080fd5b50600f546103d9565b3480156106d157600080fd5b506103c66106e0366004612a75565b61111e565b3480156106f157600080fd5b506103796111fe565b34801561070657600080fd5b5061034f610715366004612a1e565b600a6020526000908152604090205460ff1681565b34801561073657600080fd5b506103d960095481565b34801561074c57600080fd5b5061052b7f000000000000000000000000000000000000000000000000000000000000000081565b34801561078057600080fd5b506103c661078f366004612a75565b61120d565b3480156107a057600080fd5b5060085461034f90600160a01b900460ff1681565b3480156107c157600080fd5b5061034f6107d03660046129af565b61128d565b3480156107e157600080fd5b506103c66107f0366004612a75565b61129b565b34801561080157600080fd5b506103d9610810366004612a1e565b6001600160a01b031660009081526012602052604090206004015490565b34801561083a57600080fd5b506103c6610849366004612a1e565b61134e565b34801561085a57600080fd5b50600b5461052b906001600160a01b031681565b34801561087a57600080fd5b506103c6610889366004612a8e565b6113ad565b34801561089a57600080fd5b506103c66108a9366004612a8e565b61144e565b3480156108ba57600080fd5b506103d97f000000000000000000000000000000000000000000000000000000000000000081565b6103c66114ef565b3480156108f657600080fd5b506103d9610905366004612aab565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b34801561093c57600080fd5b506103c661169b565b34801561095157600080fd5b506103d9610960366004612a1e565b61173e565b34801561097157600080fd5b506103c66109803660046129e7565b611749565b34801561099157600080fd5b506103c66109a0366004612a1e565b611779565b3480156109b157600080fd5b506103c66109c0366004612a1e565b6117cd565b3480156109d157600080fd5b50600c5461052b906001600160a01b031681565b3480156109f157600080fd5b506103d9610a00366004612a1e565b6118fc565b606060038054610a1490612ade565b80601f0160208091040260200160405190810160405280929190818152602001828054610a4090612ade565b8015610a8d5780601f10610a6257610100808354040283529160200191610a8d565b820191906000526020600020905b815481529060010190602001808311610a7057829003601f168201915b5050505050905090565b600033610aa58185856119d8565b60019150505b92915050565b610ab96119ea565b6001600160a01b0382166000818152600a6020908152604091829020805460ff191685151590811790915591519182527ff93f9a76c1bf3444d22400a00cb9fe990e6abe9dbb333fda48859cfee864543d91015b60405180910390a25050565b610b446040518060800160405280600081526020016000815260200160008152602001600081525090565b6000610b4f83611a30565b6001600160a01b03841660009081526012602052604081206004015491925090610b799042612b2e565b90506000610b8d6103e86301e13380612b41565b8284610bd97f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000612b2e565b610be39190612b41565b610bed9190612b41565b610bf79190612b58565b90506000610c058484611aeb565b6040805160808101825293845260006020850181905290840191909152606083015250949350505050565b600033610c3e858285611bd7565b610c49858585611c6e565b60019150505b9392505050565b600080600c60009054906101000a90046001600160a01b03166001600160a01b03166330c0b9ec6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610cac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cd09190612b7a565b9050610ce160016305f5e100612b41565b610cf09064e8d4a51000612b41565b610cfa8285612b41565b610c4f9190612b58565b600b546001600160a01b03163314610d895760405162461bcd60e51b815260206004820152603560248201527f526577617264733a204f6e6c79207265776172647320636f6e7472616374206360448201527f616e2063616c6c20746869732066756e6374696f6e000000000000000000000060648201526084015b60405180910390fd5b610d9281611ce6565b50565b600080600c60009054906101000a90046001600160a01b03166001600160a01b031663caafa6c16040518163ffffffff1660e01b8152600401602060405180830381865afa158015610deb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0f9190612b7a565b9050610cf060016305f5e100612b41565b600854600160a01b900460ff16610e795760405162461bcd60e51b815260206004820152601c60248201527f4162737472616374204c53543a20627579206e6f7420616374697665000000006044820152606401610d80565b600854600160a81b900460ff1615610efa57336000908152600a602052604090205460ff16610efa5760405162461bcd60e51b815260206004820152602760248201527f4162737472616374204c53543a2063616c6c6572206973206e6f742077686974604482015266195b1a5cdd195960ca1b6064820152608401610d80565b6000610f0582610d95565b9050610f1081611d24565b15610f5d5760405162461bcd60e51b815260206004820152601460248201527f5173643a204275792065786365656473206361700000000000000000000000006044820152606401610d80565b600954821015610faf5760405162461bcd60e51b815260206004820152601c60248201527f5173643a20496e73756666696369656e742062757920616d6f756e74000000006044820152606401610d80565b610fe46001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016333085611d44565b610fee3382611dc0565b6110187f000000000000000000000000000000000000000000000000000000000000000083611df6565b6110223382611ef0565b5050565b61102e6119ea565b61103781600555565b6040518181527fb42dbc56569dad594f79a8fa479f0b9b87b68602d1b8fc221d10b62bf703dbed906020015b60405180910390a150565b600e5460009081906110809042612b2e565b600f54909150611091908290612b41565b60105461109e9190612b93565b91505090565b6110ac6119ea565b600c805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03831617905550565b6110df6119ea565b6110e96000611f3a565b565b6110f36119ea565b600b805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03831617905550565b600b546001600160a01b0316331461119e5760405162461bcd60e51b815260206004820152603560248201527f526577617264733a204f6e6c79207265776172647320636f6e7472616374206360448201527f616e2063616c6c20746869732066756e6374696f6e00000000000000000000006064820152608401610d80565b6111a781611d24565b156111f45760405162461bcd60e51b815260206004820152601560248201527f5173643a204d696e7420657863656564732063617000000000000000000000006044820152606401610d80565b610d923382611dc0565b606060048054610a1490612ade565b600b546001600160a01b031633146111f45760405162461bcd60e51b815260206004820152603560248201527f526577617264733a204f6e6c79207265776172647320636f6e7472616374206360448201527f616e2063616c6c20746869732066756e6374696f6e00000000000000000000006064820152608401610d80565b600033610aa5818585611c6e565b6112a36119ea565b600081116113195760405162461bcd60e51b815260206004820152602560248201527f4d696e20616d6f756e7420627579206d7573742062652067726561746572207460448201527f68616e20300000000000000000000000000000000000000000000000000000006064820152608401610d80565b60098190556040518181527f4d02ac2bfe90115b91d59c32ad6d07ea86d935aedb62055d844decbc0a6cb47190602001611063565b6113566119ea565b6008805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040517f8125853d25d6f68e074fb323e9f6e68b582733c9f03a78a2fda62e81d5d594f490600090a250565b6113b56119ea565b6008805482158015600160a81b027fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff909216919091179091556114205760405133907fe17ac05ff4095c2a1b270ddc6f70ea762311620bf4be3b1c2b0a9f4d5b16a53390600090a250565b60405133907f5a5fb1bb60b955fafbedf12a782cf1135ba3f37b851d547e79c04e55d1d9a2bb90600090a250565b6114566119ea565b6008805482158015600160a01b027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff909216919091179091556114c15760405133907f414deba86f382e3da8ecf26ff472fe712d2e8489ed191afbb662b3d720cb4b4590600090a250565b60405133907fb474c7aee2343d3d4a0a18ecf7798a53688ce4d25cab70fbad7ea88866e881a590600090a250565b600854600160a01b900460ff166115485760405162461bcd60e51b815260206004820152601c60248201527f4162737472616374204c53543a20627579206e6f7420616374697665000000006044820152606401610d80565b600854600160a81b900460ff16156115c957336000908152600a602052604090205460ff166115c95760405162461bcd60e51b815260206004820152602760248201527f4162737472616374204c53543a2063616c6c6572206973206e6f742077686974604482015266195b1a5cdd195960ca1b6064820152608401610d80565b60006115d434610c56565b90506115df81611d24565b1561162c5760405162461bcd60e51b815260206004820152601460248201527f5173643a204275792065786365656473206361700000000000000000000000006044820152606401610d80565b60095434101561167e5760405162461bcd60e51b815260206004820152601c60248201527f5173643a20496e73756666696369656e742062757920616d6f756e74000000006044820152606401610d80565b6116883382611dc0565b61169134611f99565b610d923382611ef0565b6116a36119ea565b60006116b76006546001600160a01b031690565b6001600160a01b0316036117235760405162461bcd60e51b815260206004820152602d60248201527f41627374726163744c53543a206f776e65722063616e6e6f742062652074686560448201526c207a65726f206164647265737360981b6064820152608401610d80565b6110e96117386006546001600160a01b031690565b4761208d565b6000610aab82611a30565b6117516119ea565b6001600160a01b0382166000908152601160205260409020805460ff19168215151790555050565b6117816119ea565b6001600160a01b0381166117c4576040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260006004820152602401610d80565b610d9281611f3a565b6117d56119ea565b60006117e96006546001600160a01b031690565b6001600160a01b0316036118555760405162461bcd60e51b815260206004820152602d60248201527f41627374726163744c53543a206f776e65722063616e6e6f742062652074686560448201526c207a65726f206164647265737360981b6064820152608401610d80565b610d9261186a6006546001600160a01b031690565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b038416906370a0823190602401602060405180830381865afa1580156118c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118eb9190612b7a565b6001600160a01b0384169190612124565b6001600160a01b0381166000908152601260209081526040808320815160a08101835281548152600182015493810193909352600281015491830191909152600381015460608301526004015460808201819052829061195c9042612b2e565b9050600081116119ae5760405162461bcd60e51b815260206004820152601860248201527f526577617264733a20436c61696d2074696d65206973203000000000000000006044820152606401610d80565b8082606001516119bc61106e565b6119c69190612b2e565b6119d09190612b58565b949350505050565b6119e58383836001612155565b505050565b6006546001600160a01b031633146110e9576040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152602401610d80565b6001600160a01b0381166000908152601260209081526040808320815160a081018352815481526001820154938101939093526002810154918301919091526003810154606083015260040154608082018190528290611a909042612b2e565b905080600003611aa4575060009392505050565b6000826020015142611ab69190612b2e565b905081818460000151611ac99190612b41565b8460400151611ad89190612b93565b611ae29190612b58565b95945050505050565b600080600c60009054906101000a90046001600160a01b03166001600160a01b031663831f3eb86040518163ffffffff1660e01b8152600401602060405180830381865afa158015611b41573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b659190612b7a565b9050611b73816103e8612b41565b611b81906301e13380612b41565b83611bac867f0000000000000000000000000000000000000000000000000000000000000000612b41565b611bb69190612b41565b611bc890670de0b6b3a7640000612b41565b6119c69064e8d4a51000612b41565b6001600160a01b038381166000908152600160209081526040808320938616835292905220546000198114611c685781811015611c59576040517ffb8f41b20000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024810182905260448101839052606401610d80565b611c6884848484036000612155565b50505050565b6001600160a01b038316611cb1576040517f96c6fd1e00000000000000000000000000000000000000000000000000000000815260006004820152602401610d80565b6001600160a01b038216611cdb5760405163ec442f0560e01b815260006004820152602401610d80565b6119e583838361225c565b6001600160a01b0381166000908152601260205260408120426004820181905560018201556002810191909155611d1b61106e565b60039091015550565b600060055482611d3360025490565b611d3d9190612b93565b1192915050565b6040516001600160a01b038481166024830152838116604483015260648201839052611c689186918216906323b872dd906084015b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061227f565b6001600160a01b038216611dea5760405163ec442f0560e01b815260006004820152602401610d80565b6110226000838361225c565b6001600160a01b038216611e725760405162461bcd60e51b815260206004820152603660248201527f4162737472616374204c53543a20746f6b656e20616464726573732063616e6e60448201527f6f7420626520746865207a65726f2061646472657373000000000000000000006064820152608401610d80565b60008111611ed65760405162461bcd60e51b815260206004820152602b60248201527f4162737472616374204c53543a20616d6f756e74206d7573742062652067726560448201526a061746572207468616e20360ac1b6064820152608401610d80565b600854611022906001600160a01b03848116911683612124565b816001600160a01b03167f0a37b72bb67eee30e09084cf386f8a17817c57f620c3ab95fb25d6a20356ec7782611f2560025490565b60408051928352602083019190915201610b0d565b600680546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6008546001600160a01b03166120175760405162461bcd60e51b815260206004820152602960248201527f4162737472616374204c53543a206469737472696275746f722061646472657360448201527f73206e6f742073657400000000000000000000000000000000000000000000006064820152608401610d80565b6000811161207b5760405162461bcd60e51b815260206004820152602b60248201527f4162737472616374204c53543a20616d6f756e74206d7573742062652067726560448201526a061746572207468616e20360ac1b6064820152608401610d80565b600854610d92906001600160a01b0316825b804710156120b05760405163cd78605960e01b8152306004820152602401610d80565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146120fd576040519150601f19603f3d011682016040523d82523d6000602084013e612102565b606091505b50509050806119e557604051630a12f52160e11b815260040160405180910390fd5b6040516001600160a01b038381166024830152604482018390526119e591859182169063a9059cbb90606401611d79565b6001600160a01b038416612198576040517fe602df0500000000000000000000000000000000000000000000000000000000815260006004820152602401610d80565b6001600160a01b0383166121db576040517f94280d6200000000000000000000000000000000000000000000000000000000815260006004820152602401610d80565b6001600160a01b0380851660009081526001602090815260408083209387168352929052208290558015611c6857826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258460405161224e91815260200190565b60405180910390a350505050565b6122678383836122fb565b6122738382600061243e565b6119e58282600161243e565b60006122946001600160a01b03841683612544565b905080516000141580156122b95750808060200190518101906122b79190612ba6565b155b156119e5576040517f5274afe70000000000000000000000000000000000000000000000000000000081526001600160a01b0384166004820152602401610d80565b6001600160a01b03831661232657806002600082825461231b9190612b93565b909155506123b19050565b6001600160a01b03831660009081526020819052604090205481811015612392576040517fe450d38c0000000000000000000000000000000000000000000000000000000081526001600160a01b03851660048201526024810182905260448101839052606401610d80565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b0382166123cd576002805482900390556123ec565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161243191815260200190565b60405180910390a3505050565b612449838383612552565b6001600160a01b03831615806124635750612463836127d1565b1561246d57505050565b6001600160a01b0383166000908152601260205260408120600181015490919081036124ad576000600283015560105460038301554260048301556124e5565b60018201546124bc9042612b2e565b82549091506124cc908290612b41565b8260020160008282546124df9190612b93565b90915550505b60008360018111156124f9576124f9612bc3565b0361251d57838260000160008282546125129190612b2e565b909155506125379050565b838260000160008282546125319190612b93565b90915550505b5042600190910155505050565b6060610c4f83836000612801565b600e546000906125629042612b2e565b600f54909150612573908290612b41565b60108054600090612585908490612b93565b90915550506001600160a01b0384166126055760008260018111156125ac576125ac612bc3565b036125d15782600d60000160008282546125c69190612b93565b909155506126059050565b60018260018111156125e5576125e5612bc3565b036126055782600d60000160008282546125ff9190612b2e565b90915550505b6000612610856127d1565b905080801561263657506001600160a01b03851660009081526012602052604090205415155b1561272357600083600181111561264f5761264f612bc3565b03612695576001600160a01b038516600090815260126020526040902054612678908590612b2e565b600f805460009061268a908490612b2e565b909155506126ea9050565b60018360018111156126a9576126a9612bc3565b036126ea576001600160a01b0385166000908152601260205260409020546126d2908590612b93565b600f80546000906126e4908490612b2e565b90915550505b6001600160a01b0385166000908152601260205260408120818155600181018290556002810182905560038101829055600401556127c6565b600083600181111561273757612737612bc3565b14801561275257506001600160a01b03851615806127525750805b156127775783600d600201600082825461276c9190612b93565b909155506127c69050565b600183600181111561278b5761278b612bc3565b1480156127a657506001600160a01b03851615806127a65750805b156127c65783600d60020160008282546127c09190612b2e565b90915550505b505042600e55505050565b6001600160a01b03811660009081526011602052604081205460ff16156127fa57506000919050565b503b151590565b6060814710156128265760405163cd78605960e01b8152306004820152602401610d80565b600080856001600160a01b031684866040516128429190612bd9565b60006040518083038185875af1925050503d806000811461287f576040519150601f19603f3d011682016040523d82523d6000602084013e612884565b606091505b509150915061289486838361289e565b9695505050505050565b6060826128b3576128ae82612913565b610c4f565b81511580156128ca57506001600160a01b0384163b155b1561290c576040517f9996b3150000000000000000000000000000000000000000000000000000000081526001600160a01b0385166004820152602401610d80565b5080610c4f565b8051156129235780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b60005b8381101561295757818101518382015260200161293f565b50506000910152565b602081526000825180602084015261297f81604085016020870161293c565b601f01601f19169190910160400192915050565b80356001600160a01b03811681146129aa57600080fd5b919050565b600080604083850312156129c257600080fd5b6129cb83612993565b946020939093013593505050565b8015158114610d9257600080fd5b600080604083850312156129fa57600080fd5b612a0383612993565b91506020830135612a13816129d9565b809150509250929050565b600060208284031215612a3057600080fd5b610c4f82612993565b600080600060608486031215612a4e57600080fd5b612a5784612993565b9250612a6560208501612993565b9150604084013590509250925092565b600060208284031215612a8757600080fd5b5035919050565b600060208284031215612aa057600080fd5b8135610c4f816129d9565b60008060408385031215612abe57600080fd5b612ac783612993565b9150612ad560208401612993565b90509250929050565b600181811c90821680612af257607f821691505b602082108103612b1257634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b81810381811115610aab57610aab612b18565b8082028115828204841417610aab57610aab612b18565b600082612b7557634e487b7160e01b600052601260045260246000fd5b500490565b600060208284031215612b8c57600080fd5b5051919050565b80820180821115610aab57610aab612b18565b600060208284031215612bb857600080fd5b8151610c4f816129d9565b634e487b7160e01b600052602160045260246000fd5b60008251612beb81846020870161293c565b919091019291505056fea2646970667358221220f1f2249472a01dff9cbcadb9d9421f76712c3c1309b0e113f70271ead6d03bf964736f6c63430008170033000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
Deployed Bytecode
0x6080604052600436106103295760003560e01c80639358928b116101a5578063c0973eed116100ec578063e086e5ec11610095578063f2fde38b1161006f578063f2fde38b14610985578063f4f3b200146109a5578063f89b7644146109c5578063fed1280b146109e557600080fd5b8063e086e5ec14610930578063e347358014610945578063eb45261a1461096557600080fd5b8063d34fd412116100c6578063d34fd412146108ae578063d87744cf146108e2578063dd62ed3e146108ea57600080fd5b8063c0973eed1461084e578063c3b754dc1461086e578063ccdfff531461088e57600080fd5b8063a0712d681161014e578063a9c8d48811610128578063a9c8d488146107d5578063b77cf9c6146107f5578063b89fc89e1461082e57600080fd5b8063a0712d6814610774578063a11a1add14610794578063a9059cbb146107b557600080fd5b80639b19251a1161017f5780639b19251a146106fa5780639bdd940c1461072a5780639e1a86131461074057600080fd5b80639358928b146106b057806393dd451e146106c557806395d89b41146106e557600080fd5b80633610724e116102745780636aae22031161021d57806383e193a6116101f757806383e193a6146106475780638906758d1461065c5780638da5cb5b1461067c578063918f86741461069a57600080fd5b80636aae2203146105dc57806370a08231146105fc578063715018a61461063257600080fd5b80633bcfc4b81161024e5780633bcfc4b81461057357806347786d37146105a75780634fbee124146105c757600080fd5b80633610724e146104eb57806337fb7e211461050b578063391feebb1461054357600080fd5b806323b872dd116102d6578063343959b4116102b0578063343959b414610496578063353d224b146104b6578063355274ea146104d657600080fd5b806323b872dd1461043a57806328a659101461045a578063313ce5671461047a57600080fd5b80630d392cd9116103075780630d392cd9146103a657806318160ddd146103c85780632260b83e146103e757600080fd5b806302ce58131461032e57806306fdde0314610364578063095ea7b314610386575b600080fd5b34801561033a57600080fd5b5060085461034f90600160a81b900460ff1681565b60405190151581526020015b60405180910390f35b34801561037057600080fd5b50610379610a05565b60405161035b9190612960565b34801561039257600080fd5b5061034f6103a13660046129af565b610a97565b3480156103b257600080fd5b506103c66103c13660046129e7565b610ab1565b005b3480156103d457600080fd5b506002545b60405190815260200161035b565b3480156103f357600080fd5b50610407610402366004612a1e565b610b19565b60405161035b91908151815260208083015190820152604080830151908201526060918201519181019190915260800190565b34801561044657600080fd5b5061034f610455366004612a39565b610c30565b34801561046657600080fd5b506103d9610475366004612a75565b610c56565b34801561048657600080fd5b506040516006815260200161035b565b3480156104a257600080fd5b506103c66104b1366004612a1e565b610d04565b3480156104c257600080fd5b506103d96104d1366004612a75565b610d95565b3480156104e257600080fd5b506005546103d9565b3480156104f757600080fd5b506103c6610506366004612a75565b610e20565b34801561051757600080fd5b5060085461052b906001600160a01b031681565b6040516001600160a01b03909116815260200161035b565b34801561054f57600080fd5b5061034f61055e366004612a1e565b60116020526000908152604090205460ff1681565b34801561057f57600080fd5b506103d97f000000000000000000000000000000000000000000000000000000000000009681565b3480156105b357600080fd5b506103c66105c2366004612a75565b611026565b3480156105d357600080fd5b506103d961106e565b3480156105e857600080fd5b506103c66105f7366004612a1e565b6110a4565b34801561060857600080fd5b506103d9610617366004612a1e565b6001600160a01b031660009081526020819052604090205490565b34801561063e57600080fd5b506103c66110d7565b34801561065357600080fd5b506103d9600181565b34801561066857600080fd5b506103c6610677366004612a1e565b6110eb565b34801561068857600080fd5b506006546001600160a01b031661052b565b3480156106a657600080fd5b506103d96103e881565b3480156106bc57600080fd5b50600f546103d9565b3480156106d157600080fd5b506103c66106e0366004612a75565b61111e565b3480156106f157600080fd5b506103796111fe565b34801561070657600080fd5b5061034f610715366004612a1e565b600a6020526000908152604090205460ff1681565b34801561073657600080fd5b506103d960095481565b34801561074c57600080fd5b5061052b7f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4881565b34801561078057600080fd5b506103c661078f366004612a75565b61120d565b3480156107a057600080fd5b5060085461034f90600160a01b900460ff1681565b3480156107c157600080fd5b5061034f6107d03660046129af565b61128d565b3480156107e157600080fd5b506103c66107f0366004612a75565b61129b565b34801561080157600080fd5b506103d9610810366004612a1e565b6001600160a01b031660009081526012602052604090206004015490565b34801561083a57600080fd5b506103c6610849366004612a1e565b61134e565b34801561085a57600080fd5b50600b5461052b906001600160a01b031681565b34801561087a57600080fd5b506103c6610889366004612a8e565b6113ad565b34801561089a57600080fd5b506103c66108a9366004612a8e565b61144e565b3480156108ba57600080fd5b506103d97f000000000000000000000000000000000000000000000000000000000000001981565b6103c66114ef565b3480156108f657600080fd5b506103d9610905366004612aab565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b34801561093c57600080fd5b506103c661169b565b34801561095157600080fd5b506103d9610960366004612a1e565b61173e565b34801561097157600080fd5b506103c66109803660046129e7565b611749565b34801561099157600080fd5b506103c66109a0366004612a1e565b611779565b3480156109b157600080fd5b506103c66109c0366004612a1e565b6117cd565b3480156109d157600080fd5b50600c5461052b906001600160a01b031681565b3480156109f157600080fd5b506103d9610a00366004612a1e565b6118fc565b606060038054610a1490612ade565b80601f0160208091040260200160405190810160405280929190818152602001828054610a4090612ade565b8015610a8d5780601f10610a6257610100808354040283529160200191610a8d565b820191906000526020600020905b815481529060010190602001808311610a7057829003601f168201915b5050505050905090565b600033610aa58185856119d8565b60019150505b92915050565b610ab96119ea565b6001600160a01b0382166000818152600a6020908152604091829020805460ff191685151590811790915591519182527ff93f9a76c1bf3444d22400a00cb9fe990e6abe9dbb333fda48859cfee864543d91015b60405180910390a25050565b610b446040518060800160405280600081526020016000815260200160008152602001600081525090565b6000610b4f83611a30565b6001600160a01b03841660009081526012602052604081206004015491925090610b799042612b2e565b90506000610b8d6103e86301e13380612b41565b8284610bd97f00000000000000000000000000000000000000000000000000000000000000197f0000000000000000000000000000000000000000000000000000000000000096612b2e565b610be39190612b41565b610bed9190612b41565b610bf79190612b58565b90506000610c058484611aeb565b6040805160808101825293845260006020850181905290840191909152606083015250949350505050565b600033610c3e858285611bd7565b610c49858585611c6e565b60019150505b9392505050565b600080600c60009054906101000a90046001600160a01b03166001600160a01b03166330c0b9ec6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610cac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cd09190612b7a565b9050610ce160016305f5e100612b41565b610cf09064e8d4a51000612b41565b610cfa8285612b41565b610c4f9190612b58565b600b546001600160a01b03163314610d895760405162461bcd60e51b815260206004820152603560248201527f526577617264733a204f6e6c79207265776172647320636f6e7472616374206360448201527f616e2063616c6c20746869732066756e6374696f6e000000000000000000000060648201526084015b60405180910390fd5b610d9281611ce6565b50565b600080600c60009054906101000a90046001600160a01b03166001600160a01b031663caafa6c16040518163ffffffff1660e01b8152600401602060405180830381865afa158015610deb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0f9190612b7a565b9050610cf060016305f5e100612b41565b600854600160a01b900460ff16610e795760405162461bcd60e51b815260206004820152601c60248201527f4162737472616374204c53543a20627579206e6f7420616374697665000000006044820152606401610d80565b600854600160a81b900460ff1615610efa57336000908152600a602052604090205460ff16610efa5760405162461bcd60e51b815260206004820152602760248201527f4162737472616374204c53543a2063616c6c6572206973206e6f742077686974604482015266195b1a5cdd195960ca1b6064820152608401610d80565b6000610f0582610d95565b9050610f1081611d24565b15610f5d5760405162461bcd60e51b815260206004820152601460248201527f5173643a204275792065786365656473206361700000000000000000000000006044820152606401610d80565b600954821015610faf5760405162461bcd60e51b815260206004820152601c60248201527f5173643a20496e73756666696369656e742062757920616d6f756e74000000006044820152606401610d80565b610fe46001600160a01b037f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4816333085611d44565b610fee3382611dc0565b6110187f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4883611df6565b6110223382611ef0565b5050565b61102e6119ea565b61103781600555565b6040518181527fb42dbc56569dad594f79a8fa479f0b9b87b68602d1b8fc221d10b62bf703dbed906020015b60405180910390a150565b600e5460009081906110809042612b2e565b600f54909150611091908290612b41565b60105461109e9190612b93565b91505090565b6110ac6119ea565b600c805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03831617905550565b6110df6119ea565b6110e96000611f3a565b565b6110f36119ea565b600b805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03831617905550565b600b546001600160a01b0316331461119e5760405162461bcd60e51b815260206004820152603560248201527f526577617264733a204f6e6c79207265776172647320636f6e7472616374206360448201527f616e2063616c6c20746869732066756e6374696f6e00000000000000000000006064820152608401610d80565b6111a781611d24565b156111f45760405162461bcd60e51b815260206004820152601560248201527f5173643a204d696e7420657863656564732063617000000000000000000000006044820152606401610d80565b610d923382611dc0565b606060048054610a1490612ade565b600b546001600160a01b031633146111f45760405162461bcd60e51b815260206004820152603560248201527f526577617264733a204f6e6c79207265776172647320636f6e7472616374206360448201527f616e2063616c6c20746869732066756e6374696f6e00000000000000000000006064820152608401610d80565b600033610aa5818585611c6e565b6112a36119ea565b600081116113195760405162461bcd60e51b815260206004820152602560248201527f4d696e20616d6f756e7420627579206d7573742062652067726561746572207460448201527f68616e20300000000000000000000000000000000000000000000000000000006064820152608401610d80565b60098190556040518181527f4d02ac2bfe90115b91d59c32ad6d07ea86d935aedb62055d844decbc0a6cb47190602001611063565b6113566119ea565b6008805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040517f8125853d25d6f68e074fb323e9f6e68b582733c9f03a78a2fda62e81d5d594f490600090a250565b6113b56119ea565b6008805482158015600160a81b027fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff909216919091179091556114205760405133907fe17ac05ff4095c2a1b270ddc6f70ea762311620bf4be3b1c2b0a9f4d5b16a53390600090a250565b60405133907f5a5fb1bb60b955fafbedf12a782cf1135ba3f37b851d547e79c04e55d1d9a2bb90600090a250565b6114566119ea565b6008805482158015600160a01b027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff909216919091179091556114c15760405133907f414deba86f382e3da8ecf26ff472fe712d2e8489ed191afbb662b3d720cb4b4590600090a250565b60405133907fb474c7aee2343d3d4a0a18ecf7798a53688ce4d25cab70fbad7ea88866e881a590600090a250565b600854600160a01b900460ff166115485760405162461bcd60e51b815260206004820152601c60248201527f4162737472616374204c53543a20627579206e6f7420616374697665000000006044820152606401610d80565b600854600160a81b900460ff16156115c957336000908152600a602052604090205460ff166115c95760405162461bcd60e51b815260206004820152602760248201527f4162737472616374204c53543a2063616c6c6572206973206e6f742077686974604482015266195b1a5cdd195960ca1b6064820152608401610d80565b60006115d434610c56565b90506115df81611d24565b1561162c5760405162461bcd60e51b815260206004820152601460248201527f5173643a204275792065786365656473206361700000000000000000000000006044820152606401610d80565b60095434101561167e5760405162461bcd60e51b815260206004820152601c60248201527f5173643a20496e73756666696369656e742062757920616d6f756e74000000006044820152606401610d80565b6116883382611dc0565b61169134611f99565b610d923382611ef0565b6116a36119ea565b60006116b76006546001600160a01b031690565b6001600160a01b0316036117235760405162461bcd60e51b815260206004820152602d60248201527f41627374726163744c53543a206f776e65722063616e6e6f742062652074686560448201526c207a65726f206164647265737360981b6064820152608401610d80565b6110e96117386006546001600160a01b031690565b4761208d565b6000610aab82611a30565b6117516119ea565b6001600160a01b0382166000908152601160205260409020805460ff19168215151790555050565b6117816119ea565b6001600160a01b0381166117c4576040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260006004820152602401610d80565b610d9281611f3a565b6117d56119ea565b60006117e96006546001600160a01b031690565b6001600160a01b0316036118555760405162461bcd60e51b815260206004820152602d60248201527f41627374726163744c53543a206f776e65722063616e6e6f742062652074686560448201526c207a65726f206164647265737360981b6064820152608401610d80565b610d9261186a6006546001600160a01b031690565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b038416906370a0823190602401602060405180830381865afa1580156118c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118eb9190612b7a565b6001600160a01b0384169190612124565b6001600160a01b0381166000908152601260209081526040808320815160a08101835281548152600182015493810193909352600281015491830191909152600381015460608301526004015460808201819052829061195c9042612b2e565b9050600081116119ae5760405162461bcd60e51b815260206004820152601860248201527f526577617264733a20436c61696d2074696d65206973203000000000000000006044820152606401610d80565b8082606001516119bc61106e565b6119c69190612b2e565b6119d09190612b58565b949350505050565b6119e58383836001612155565b505050565b6006546001600160a01b031633146110e9576040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152602401610d80565b6001600160a01b0381166000908152601260209081526040808320815160a081018352815481526001820154938101939093526002810154918301919091526003810154606083015260040154608082018190528290611a909042612b2e565b905080600003611aa4575060009392505050565b6000826020015142611ab69190612b2e565b905081818460000151611ac99190612b41565b8460400151611ad89190612b93565b611ae29190612b58565b95945050505050565b600080600c60009054906101000a90046001600160a01b03166001600160a01b031663831f3eb86040518163ffffffff1660e01b8152600401602060405180830381865afa158015611b41573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b659190612b7a565b9050611b73816103e8612b41565b611b81906301e13380612b41565b83611bac867f0000000000000000000000000000000000000000000000000000000000000019612b41565b611bb69190612b41565b611bc890670de0b6b3a7640000612b41565b6119c69064e8d4a51000612b41565b6001600160a01b038381166000908152600160209081526040808320938616835292905220546000198114611c685781811015611c59576040517ffb8f41b20000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024810182905260448101839052606401610d80565b611c6884848484036000612155565b50505050565b6001600160a01b038316611cb1576040517f96c6fd1e00000000000000000000000000000000000000000000000000000000815260006004820152602401610d80565b6001600160a01b038216611cdb5760405163ec442f0560e01b815260006004820152602401610d80565b6119e583838361225c565b6001600160a01b0381166000908152601260205260408120426004820181905560018201556002810191909155611d1b61106e565b60039091015550565b600060055482611d3360025490565b611d3d9190612b93565b1192915050565b6040516001600160a01b038481166024830152838116604483015260648201839052611c689186918216906323b872dd906084015b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061227f565b6001600160a01b038216611dea5760405163ec442f0560e01b815260006004820152602401610d80565b6110226000838361225c565b6001600160a01b038216611e725760405162461bcd60e51b815260206004820152603660248201527f4162737472616374204c53543a20746f6b656e20616464726573732063616e6e60448201527f6f7420626520746865207a65726f2061646472657373000000000000000000006064820152608401610d80565b60008111611ed65760405162461bcd60e51b815260206004820152602b60248201527f4162737472616374204c53543a20616d6f756e74206d7573742062652067726560448201526a061746572207468616e20360ac1b6064820152608401610d80565b600854611022906001600160a01b03848116911683612124565b816001600160a01b03167f0a37b72bb67eee30e09084cf386f8a17817c57f620c3ab95fb25d6a20356ec7782611f2560025490565b60408051928352602083019190915201610b0d565b600680546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6008546001600160a01b03166120175760405162461bcd60e51b815260206004820152602960248201527f4162737472616374204c53543a206469737472696275746f722061646472657360448201527f73206e6f742073657400000000000000000000000000000000000000000000006064820152608401610d80565b6000811161207b5760405162461bcd60e51b815260206004820152602b60248201527f4162737472616374204c53543a20616d6f756e74206d7573742062652067726560448201526a061746572207468616e20360ac1b6064820152608401610d80565b600854610d92906001600160a01b0316825b804710156120b05760405163cd78605960e01b8152306004820152602401610d80565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146120fd576040519150601f19603f3d011682016040523d82523d6000602084013e612102565b606091505b50509050806119e557604051630a12f52160e11b815260040160405180910390fd5b6040516001600160a01b038381166024830152604482018390526119e591859182169063a9059cbb90606401611d79565b6001600160a01b038416612198576040517fe602df0500000000000000000000000000000000000000000000000000000000815260006004820152602401610d80565b6001600160a01b0383166121db576040517f94280d6200000000000000000000000000000000000000000000000000000000815260006004820152602401610d80565b6001600160a01b0380851660009081526001602090815260408083209387168352929052208290558015611c6857826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258460405161224e91815260200190565b60405180910390a350505050565b6122678383836122fb565b6122738382600061243e565b6119e58282600161243e565b60006122946001600160a01b03841683612544565b905080516000141580156122b95750808060200190518101906122b79190612ba6565b155b156119e5576040517f5274afe70000000000000000000000000000000000000000000000000000000081526001600160a01b0384166004820152602401610d80565b6001600160a01b03831661232657806002600082825461231b9190612b93565b909155506123b19050565b6001600160a01b03831660009081526020819052604090205481811015612392576040517fe450d38c0000000000000000000000000000000000000000000000000000000081526001600160a01b03851660048201526024810182905260448101839052606401610d80565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b0382166123cd576002805482900390556123ec565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161243191815260200190565b60405180910390a3505050565b612449838383612552565b6001600160a01b03831615806124635750612463836127d1565b1561246d57505050565b6001600160a01b0383166000908152601260205260408120600181015490919081036124ad576000600283015560105460038301554260048301556124e5565b60018201546124bc9042612b2e565b82549091506124cc908290612b41565b8260020160008282546124df9190612b93565b90915550505b60008360018111156124f9576124f9612bc3565b0361251d57838260000160008282546125129190612b2e565b909155506125379050565b838260000160008282546125319190612b93565b90915550505b5042600190910155505050565b6060610c4f83836000612801565b600e546000906125629042612b2e565b600f54909150612573908290612b41565b60108054600090612585908490612b93565b90915550506001600160a01b0384166126055760008260018111156125ac576125ac612bc3565b036125d15782600d60000160008282546125c69190612b93565b909155506126059050565b60018260018111156125e5576125e5612bc3565b036126055782600d60000160008282546125ff9190612b2e565b90915550505b6000612610856127d1565b905080801561263657506001600160a01b03851660009081526012602052604090205415155b1561272357600083600181111561264f5761264f612bc3565b03612695576001600160a01b038516600090815260126020526040902054612678908590612b2e565b600f805460009061268a908490612b2e565b909155506126ea9050565b60018360018111156126a9576126a9612bc3565b036126ea576001600160a01b0385166000908152601260205260409020546126d2908590612b93565b600f80546000906126e4908490612b2e565b90915550505b6001600160a01b0385166000908152601260205260408120818155600181018290556002810182905560038101829055600401556127c6565b600083600181111561273757612737612bc3565b14801561275257506001600160a01b03851615806127525750805b156127775783600d600201600082825461276c9190612b93565b909155506127c69050565b600183600181111561278b5761278b612bc3565b1480156127a657506001600160a01b03851615806127a65750805b156127c65783600d60020160008282546127c09190612b2e565b90915550505b505042600e55505050565b6001600160a01b03811660009081526011602052604081205460ff16156127fa57506000919050565b503b151590565b6060814710156128265760405163cd78605960e01b8152306004820152602401610d80565b600080856001600160a01b031684866040516128429190612bd9565b60006040518083038185875af1925050503d806000811461287f576040519150601f19603f3d011682016040523d82523d6000602084013e612884565b606091505b509150915061289486838361289e565b9695505050505050565b6060826128b3576128ae82612913565b610c4f565b81511580156128ca57506001600160a01b0384163b155b1561290c576040517f9996b3150000000000000000000000000000000000000000000000000000000081526001600160a01b0385166004820152602401610d80565b5080610c4f565b8051156129235780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b60005b8381101561295757818101518382015260200161293f565b50506000910152565b602081526000825180602084015261297f81604085016020870161293c565b601f01601f19169190910160400192915050565b80356001600160a01b03811681146129aa57600080fd5b919050565b600080604083850312156129c257600080fd5b6129cb83612993565b946020939093013593505050565b8015158114610d9257600080fd5b600080604083850312156129fa57600080fd5b612a0383612993565b91506020830135612a13816129d9565b809150509250929050565b600060208284031215612a3057600080fd5b610c4f82612993565b600080600060608486031215612a4e57600080fd5b612a5784612993565b9250612a6560208501612993565b9150604084013590509250925092565b600060208284031215612a8757600080fd5b5035919050565b600060208284031215612aa057600080fd5b8135610c4f816129d9565b60008060408385031215612abe57600080fd5b612ac783612993565b9150612ad560208401612993565b90509250929050565b600181811c90821680612af257607f821691505b602082108103612b1257634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b81810381811115610aab57610aab612b18565b8082028115828204841417610aab57610aab612b18565b600082612b7557634e487b7160e01b600052601260045260246000fd5b500490565b600060208284031215612b8c57600080fd5b5051919050565b80820180821115610aab57610aab612b18565b600060208284031215612bb857600080fd5b8151610c4f816129d9565b634e487b7160e01b600052602160045260246000fd5b60008251612beb81846020870161293c565b919091019291505056fea2646970667358221220f1f2249472a01dff9cbcadb9d9421f76712c3c1309b0e113f70271ead6d03bf964736f6c63430008170033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
-----Decoded View---------------
Arg [0] : _usd (address): 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.