Feature Tip: Add private address tag to any address under My Name Tag !
Overview
ETH Balance
0 ETH
Eth Value
$0.00Token Holdings
More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 140 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Finalize | 19902048 | 60 days ago | IN | 0 ETH | 0.00953689 | ||||
Set Locker | 19741244 | 83 days ago | IN | 0 ETH | 0.00017087 | ||||
Set Team | 19733755 | 84 days ago | IN | 0 ETH | 0.00091784 | ||||
Set Router | 19571696 | 106 days ago | IN | 0 ETH | 0.00074047 | ||||
Set Factory | 19479052 | 119 days ago | IN | 0 ETH | 0.00120029 | ||||
Set Router | 19443055 | 124 days ago | IN | 0 ETH | 0.00102861 | ||||
Set Router | 19350975 | 137 days ago | IN | 0 ETH | 0.00137517 | ||||
Set Locker | 19099836 | 173 days ago | IN | 0 ETH | 0.00036489 | ||||
Set Team | 19099822 | 173 days ago | IN | 0 ETH | 0.0003593 | ||||
Buy | 19058718 | 178 days ago | IN | 0 ETH | 0.00110634 | ||||
Buy | 19056761 | 179 days ago | IN | 0 ETH | 0.00087736 | ||||
Buy | 19056706 | 179 days ago | IN | 0 ETH | 0.00147918 | ||||
Buy | 19056704 | 179 days ago | IN | 0 ETH | 0.00098926 | ||||
Buy | 19056702 | 179 days ago | IN | 0 ETH | 0.00148264 | ||||
Buy | 19056699 | 179 days ago | IN | 0 ETH | 0.0009422 | ||||
Buy | 19056691 | 179 days ago | IN | 0 ETH | 0.00137004 | ||||
Buy | 19056687 | 179 days ago | IN | 0 ETH | 0.00098562 | ||||
Buy | 19056687 | 179 days ago | IN | 0 ETH | 0.00151977 | ||||
Buy | 19056679 | 179 days ago | IN | 0 ETH | 0.00090634 | ||||
Buy | 19056678 | 179 days ago | IN | 0 ETH | 0.00140034 | ||||
Buy | 19056671 | 179 days ago | IN | 0 ETH | 0.00089776 | ||||
Buy | 19056669 | 179 days ago | IN | 0 ETH | 0.0014206 | ||||
Buy | 19056669 | 179 days ago | IN | 0 ETH | 0.00092119 | ||||
Buy | 19056669 | 179 days ago | IN | 0 ETH | 0.00142041 | ||||
Buy | 19056668 | 179 days ago | IN | 0 ETH | 0.00092256 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
Launch
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
Yes with 10000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.20; import { IERC20Metadata } from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import { PercentageMath } from "./PercentageMath.sol"; import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; import { ReentrancyGuard } from "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import { IUniswapV2Factory } from "./mocks/uniswap-v2/IUniswapV2Factory.sol"; import { IUniswapV2Router02 } from "./mocks/uniswap-v2/IUniswapV2Router02.sol"; import { IToken } from "./Token.sol"; contract Launch is Ownable, ReentrancyGuard { using SafeERC20 for IERC20; using PercentageMath for uint256; // todo: add custom errors event Buy(address indexed account, uint256 amount); event Finalized(uint256 block); IERC20 immutable token; address public dai = 0x6B175474E89094C44Da98b954EedeAC495271d0F; IUniswapV2Factory public _uniswapV2Factory; IUniswapV2Router02 public _uniswapV2Router02; constructor( address _owner, address tokenAddress, address factory_, address router_ ) Ownable(_owner) { token = IERC20(tokenAddress); _uniswapV2Factory = IUniswapV2Factory(factory_); _uniswapV2Router02 = IUniswapV2Router02(router_); } struct PresaleData { uint256 startTimestamp; uint256 endTimestamp; uint256 maxEndTimestamp; uint256 totalAvailable; uint256 softCap; uint256 currentTier; uint256 pricePerTokenDex; // price in dai on uniswap uint256 liquidityPercentage; // as 1e4 address locker; address team; bool initialized; bool finalized; } PresaleData public presale; struct TierData { uint256 available; uint256 balance; uint256 tokenPricePerAsset; } mapping(uint256 => TierData) public tiers; uint256 public totalTiers; struct User { uint256 tier; uint256 balance; } mapping(address => mapping(uint256 => User)) public users; struct InitPresaleParams { uint256 totalPresaleSupply; uint256 startTimestamp; uint256 endTimestamp; uint256 maxEndTimestamp; uint256 softCap; uint256 liquidityPercentage; // as 1e4 uint256 pricePerTokenDex; address locker; address team; TierData[] tiers; } function initPresale( InitPresaleParams memory params ) external onlyOwner nonReentrant { require(params.liquidityPercentage <= 1e4, "Liquidity percentage exceeds max"); require(params.locker != address(0), "Locker cannot be address(0)"); require(params.startTimestamp > block.timestamp, "Start time must be greater than now"); require(params.endTimestamp > params.startTimestamp, "End time must be greater than start timestamp"); require(params.maxEndTimestamp > params.endTimestamp, "Max end time must be greater than end timestamp"); require(params.team != address(0), "Team cannot be address(0)"); uint256 assumedAssetRaised; // DAI uint256 totalTiers_ = params.tiers.length; totalTiers = totalTiers_; for (uint i = 0; i < totalTiers_; i++) { uint256 tierAvailable = params.tiers[i].available; uint256 tokenPricePerAsset = params.tiers[i].tokenPricePerAsset; uint256 assumedAssetRaisedInTier = tierAvailable / tokenPricePerAsset * 1e8; assumedAssetRaised += assumedAssetRaisedInTier; presale.totalAvailable += tierAvailable; // tiers data tiers[i].available = params.tiers[i].available; tiers[i].tokenPricePerAsset = tokenPricePerAsset; } // ================================= // // ==== require adequate supply ==== // // ================================= // uint256 totalTokensRequired = (assumedAssetRaised * params.pricePerTokenDex / 1e8) + (assumedAssetRaised * params.pricePerTokenDex / 1e8) .percentMul(params.liquidityPercentage); require(totalTokensRequired / params.totalPresaleSupply < 1, "Not enough tokens supplied"); token.safeTransferFrom(msg.sender, address(this), params.totalPresaleSupply); // ================================ // // ==== set presale parameters ==== // // ================================ // presale.liquidityPercentage = params.liquidityPercentage; presale.startTimestamp = params.startTimestamp; presale.endTimestamp = params.endTimestamp; presale.maxEndTimestamp = params.maxEndTimestamp; presale.softCap = params.softCap; presale.pricePerTokenDex = params.pricePerTokenDex; presale.locker = params.locker; presale.team = params.team; } function buy(uint256 amount) external nonReentrant { // ============================================ // // ================= requires ================= // // ============================================ // require(presale.startTimestamp != 0, "Presale not initialized"); // redundant require(block.timestamp >= presale.startTimestamp, "Presale hasn't started yet"); require(block.timestamp <= presale.endTimestamp, "Presale is over"); require(msg.sender != address(0), "msg.sender is zero"); require(amount != 0, "Amount is zero"); // ==== mutable don't transfer in more than needed ==== // uint256 transferInTotal = amount; // get latest tier uint256 tiersToIter = totalTiers - presale.currentTier; // ==== emit ==== // uint256 totalTokensBuy; for (uint256 i = 0; i < tiersToIter; i++) { // ==== total tokens available in curr tier ==== // uint256 available = tokensTierAvailable(i); // ============================================ // // ==== asset to tokens remaining for user ==== // // ============================================ // uint256 remainingTokensToBuy = transferInTotal * tiers[i].tokenPricePerAsset / 1e8; if (remainingTokensToBuy <= available) { // ==== update balance to transfer in ==== // transferInTotal -= transferInTotal; // ==== increase tier balance ==== // tiers[i].balance += remainingTokensToBuy; // ==== increase user tier balance ==== // users[msg.sender][i].balance += remainingTokensToBuy; totalTokensBuy += remainingTokensToBuy; break; } else { // ================================================= // // ==== if buying last available tokens in tier ==== // // ================================================= // // ================================================= // // ==== set curr 1st tier to avoid future iters ==== // // ================================================= // presale.currentTier = i; // ==================================== // // ==== buying more than available ==== // // ==================================== // transferInTotal -= available * 1e8 / tiers[i].tokenPricePerAsset; // ==== increase tier balance ==== // tiers[i].balance += available; // ==== increase user tier balance ==== // users[msg.sender][i].balance += available; totalTokensBuy += available; } } // ======================================= // // ==== transfer in calculated tokens ==== // // ======================================= // IERC20(dai).safeTransferFrom(msg.sender, address(this), amount - transferInTotal); emit Buy(msg.sender, totalTokensBuy); } function refund() external nonReentrant { require(block.timestamp > presale.endTimestamp, "Presale is not over"); require(totalBuys() < presale.softCap, "Softcap reached"); require(!presale.finalized, "Already finalized"); uint256 assetsToTransfer = 0; for (uint256 i = 0; i < totalTiers; i++) { uint256 userTierBalance_ = users[msg.sender][i].balance; // ==== non reentrant safe even while using it ==== // users[msg.sender][i].balance = 0; // ==== avoid calculating ==== // if (userTierBalance_ == 0) { break; } // ==== calculate asset amount ==== // assetsToTransfer += userTierBalance_ / tiers[i].tokenPricePerAsset * 1e8; } require(assetsToTransfer != 0, "Balance is zero"); IERC20(dai).safeTransfer(msg.sender, assetsToTransfer); } function claim() external nonReentrant { require(presale.startTimestamp != 0, "Presale not initialized"); // redundant require(block.timestamp > presale.endTimestamp, "Presale is not over"); require(totalBuys() >= presale.softCap, "Softcap not reached"); require(msg.sender != address(0), "msg.sender is zero"); uint256 totalBalance = 0; for (uint256 i = 0; i < totalTiers; i++) { uint256 userTierBalance_ = users[msg.sender][i].balance; users[msg.sender][i].balance = 0; // stop looping if (userTierBalance_ == 0) { break; } totalBalance += userTierBalance_; } require(totalBalance != 0, "Balance is zero"); token.safeTransfer(msg.sender, totalBalance); } /// @dev after endTimestamp only owner can call this /// after maxEndTimestamp anyone can call this function finalize(bool isOwner) external { address owner = owner(); require(!isOwner || msg.sender == owner, "NotOwner"); require(!presale.finalized, "Already finalized"); require(presale.startTimestamp != 0, "Presale not initialized"); // redundant require(block.timestamp > presale.endTimestamp, "Presale is not over"); // redundant require(isOwner || presale.maxEndTimestamp > presale.endTimestamp, "Presale is not over"); require(totalBuys() >= presale.softCap, "Softcap not reached"); _finalize(); } function _finalize() internal { // =============================== // // ==== set finalized to true ==== // // =============================== // presale.finalized = true; // =================== // // ==== total DAI ==== // // =================== // uint256 totalDai = IERC20(dai).balanceOf(address(this)); // =================== // // ==== total tokens ==== // // =================== // uint256 totalTokens = token.balanceOf(address(this)); // ============================= // // ==== total tokens bought ==== // // ============================= // uint256 totalTokensBought_ = totalTokensBought(); // ========================================= // // ==== total tokens to send to uniswap ==== // // ========================================= // uint256 totalTokensForLiquidity = totalTokensBought_.percentMul(presale.liquidityPercentage); // ========================================== // // ==== remaining after adding liquidity ==== // // ========================================== // uint256 remainingTokens = totalTokens - totalTokensForLiquidity; // ====================================== // // ==== total DAI to send to uniswap ==== // // ====================================== // uint256 totalDaiForLiquidity = totalDai.percentMul(presale.liquidityPercentage); // ========================================== // // ==== remaining after adding liquidity ==== // // ========================================== // uint256 remainingDai = totalDai - totalDaiForLiquidity; // =============================== // // ==== burn remaining tokens ==== // // =============================== // if (remainingTokens != 0) { IToken(address(token)).burn(remainingTokens); } // ============================ // // ==== transfer remaining ==== // // ============================ // if (remainingDai != 0) { IERC20(dai).transfer(presale.team, remainingDai); } // =========================== // // ==== create token pair ==== // // =========================== // _uniswapV2Factory.createPair(address(token), dai); // =========================== // // ==== add the liquidity ==== // // =========================== // IERC20(dai).approve(address(_uniswapV2Router02), totalDaiForLiquidity); token.approve(address(_uniswapV2Router02), totalTokensForLiquidity); ( , , uint liquidity) = _uniswapV2Router02.addLiquidity( address(token), dai, totalTokensForLiquidity, // amountADesired totalDaiForLiquidity, totalTokensForLiquidity, // amountAMin totalDaiForLiquidity, presale.locker, // send LP to locker block.timestamp + 300 ); require(liquidity > 0, "Liquidity is zero"); emit Finalized(block.number); } function userBalance(address account) public view returns (uint256) { uint256 totalBalance = 0; for (uint256 i = 0; i < totalTiers; i++) { totalBalance += users[account][i].balance; } return totalBalance; } function totalBuys() public view returns (uint256) { uint256 total = 0; for (uint256 i = 0; i < totalTiers; i++) { total += tiers[i].balance; } return total; } function userTierBalance(address account, uint256 tier) public view returns (uint256) { return users[account][tier].balance; } function totalTokensAvailable() public view returns (uint256) { uint256 totalTokensAvailable_ = 0; for (uint256 i = 0; i < totalTiers; i++) { totalTokensAvailable_ += tiers[i].available; } return totalTokensAvailable_; } function tokensAvailable() public view returns (uint256) { uint256 totalAvailable = 0; for (uint256 i = 0; i < totalTiers; i++) { totalAvailable += tokensTierAvailable(i); } return totalAvailable; } function totalTokensBought() public view returns (uint256) { uint256 totalTokensBought_ = 0; for (uint256 i = 0; i < totalTiers; i++) { totalTokensBought_ += tiers[i].balance; } return totalTokensBought_; } function tokensTierAvailable(uint256 tier) public view returns (uint256) { return (tiers[tier].available - tiers[tier].balance); } function remainingStart() public view returns (uint256) { // if already started return 0 if (block.timestamp >= presale.startTimestamp) { return 0; } else { return (presale.startTimestamp - block.timestamp); } } function remainingTime() public view returns (uint256) { // if already ended return 0 if (block.timestamp >= presale.endTimestamp) { return 0; } else { return (presale.endTimestamp - block.timestamp); } } function tierPricePerToken(uint256 tier) public view returns (uint256) { return tiers[tier].tokenPricePerAsset; } function isFinalized() public view returns (bool) { return presale.finalized; } function setLocker(address locker_) external onlyOwner { presale.locker = locker_; } function setTeam(address team_) external onlyOwner { presale.team = team_; } function setFactory(address factory_) external onlyOwner { _uniswapV2Factory = IUniswapV2Factory(factory_); } function setRouter(address router_) external onlyOwner { _uniswapV2Router02 = IUniswapV2Router02(router_); } function rescueERC20(address token_, address to) external onlyOwner { // ==== never allow TENSOR to be removed ==== // require(token_ != address(token), "Cannot rescue token"); if (token_ == dai) { // =================================================== // // ==== require presale is over to remove any DAI ==== // require(presale.finalized, "Presale not finalized"); } uint256 balance = IERC20(token_).balanceOf(address(this)); IERC20(token_).transfer(to, balance); } }
// 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/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/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/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.0) (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; } }
// 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; } }
pragma solidity ^0.8.20; interface IUniswapV2Factory { event PairCreated(address indexed token0, address indexed token1, address pair, uint); function feeTo() external view returns (address); function feeToSetter() external view returns (address); function getPair(address tokenA, address tokenB) external view returns (address pair); function allPairs(uint) external view returns (address pair); function allPairsLength() external view returns (uint); function createPair(address tokenA, address tokenB) external returns (address pair); function setFeeTo(address) external; function setFeeToSetter(address) external; }
pragma solidity ^0.8.20; interface IUniswapV2Router01 { function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidity( address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB, uint liquidity); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); function removeLiquidity( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB); function removeLiquidityETH( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountToken, uint amountETH); function removeLiquidityWithPermit( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountA, uint amountB); function removeLiquidityETHWithPermit( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountToken, uint amountETH); function swapExactTokensForTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapTokensForExactTokens( uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB); function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut); function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn); function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts); function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts); } interface IUniswapV2Router02 is IUniswapV2Router01 { function removeLiquidityETHSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountETH); function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountETH); function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function swapExactETHForTokensSupportingFeeOnTransferTokens( uint amountOutMin, address[] calldata path, address to, uint deadline ) external payable; function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.20; /** * @title PercentageMath library * @author Aave * @notice Provides functions to perform percentage calculations * @dev Percentages are defined by default with 2 decimals of precision (100.00). The precision is indicated by PERCENTAGE_FACTOR * @dev Operations are rounded. If a value is >=.5, will be rounded up, otherwise rounded down. */ library PercentageMath { // Maximum percentage factor (100.00%) uint256 internal constant PERCENTAGE_FACTOR = 1e4; // Half percentage factor (50.00%) uint256 internal constant HALF_PERCENTAGE_FACTOR = 0.5e4; /** * @notice Executes a percentage multiplication * @dev assembly optimized for improved gas savings, see https://twitter.com/transmissions11/status/1451131036377571328 * @param value The value of which the percentage needs to be calculated * @param percentage The percentage of the value to be calculated * @return result value percentmul percentage */ function percentMul(uint256 value, uint256 percentage) internal pure returns (uint256 result) { // to avoid overflow, value <= (type(uint256).max - HALF_PERCENTAGE_FACTOR) / percentage assembly { if iszero( or( iszero(percentage), iszero(gt(value, div(sub(not(0), HALF_PERCENTAGE_FACTOR), percentage))) ) ) { revert(0, 0) } result := div(add(mul(value, percentage), HALF_PERCENTAGE_FACTOR), PERCENTAGE_FACTOR) } } /** * @notice Executes a percentage division * @dev assembly optimized for improved gas savings, see https://twitter.com/transmissions11/status/1451131036377571328 * @param value The value of which the percentage needs to be calculated * @param percentage The percentage of the value to be calculated * @return result value percentdiv percentage */ function percentDiv(uint256 value, uint256 percentage) internal pure returns (uint256 result) { // to avoid overflow, value <= (type(uint256).max - halfPercentage) / PERCENTAGE_FACTOR assembly { if or( iszero(percentage), iszero(iszero(gt(value, div(sub(not(0), div(percentage, 2)), PERCENTAGE_FACTOR)))) ) { revert(0, 0) } result := div(add(mul(value, PERCENTAGE_FACTOR), div(percentage, 2)), percentage) } } }
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.20; import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; // import "hardhat/console.sol"; interface IToken { function burn(uint256 value) external; } contract Token is ERC20, IToken { uint256 private _totalSupply = 890000 * (10 ** 18); /// @notice Team tokens are partly for team and for future endeavors uint256 private teamDisbursementSupply = _totalSupply * 20 / 100; constructor( string memory name_, string memory symbol_ ) ERC20(name_, symbol_) { _mint(msg.sender, _totalSupply); // ultimately sent to launch contract _mint(msg.sender, teamDisbursementSupply); // ultimately sent to disbursement contract } function mint(address account, uint256 value) external { _mint(account, value); } function burn(uint256 value) external override { _burn(msg.sender, value); } }
{ "optimizer": { "enabled": true, "runs": 10000 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"address","name":"factory_","type":"address"},{"internalType":"address","name":"router_","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":[],"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":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Buy","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"block","type":"uint256"}],"name":"Finalized","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"},{"inputs":[],"name":"_uniswapV2Factory","outputs":[{"internalType":"contract IUniswapV2Factory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_uniswapV2Router02","outputs":[{"internalType":"contract IUniswapV2Router02","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"buy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"dai","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"isOwner","type":"bool"}],"name":"finalize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"totalPresaleSupply","type":"uint256"},{"internalType":"uint256","name":"startTimestamp","type":"uint256"},{"internalType":"uint256","name":"endTimestamp","type":"uint256"},{"internalType":"uint256","name":"maxEndTimestamp","type":"uint256"},{"internalType":"uint256","name":"softCap","type":"uint256"},{"internalType":"uint256","name":"liquidityPercentage","type":"uint256"},{"internalType":"uint256","name":"pricePerTokenDex","type":"uint256"},{"internalType":"address","name":"locker","type":"address"},{"internalType":"address","name":"team","type":"address"},{"components":[{"internalType":"uint256","name":"available","type":"uint256"},{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"tokenPricePerAsset","type":"uint256"}],"internalType":"struct Launch.TierData[]","name":"tiers","type":"tuple[]"}],"internalType":"struct Launch.InitPresaleParams","name":"params","type":"tuple"}],"name":"initPresale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"isFinalized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"presale","outputs":[{"internalType":"uint256","name":"startTimestamp","type":"uint256"},{"internalType":"uint256","name":"endTimestamp","type":"uint256"},{"internalType":"uint256","name":"maxEndTimestamp","type":"uint256"},{"internalType":"uint256","name":"totalAvailable","type":"uint256"},{"internalType":"uint256","name":"softCap","type":"uint256"},{"internalType":"uint256","name":"currentTier","type":"uint256"},{"internalType":"uint256","name":"pricePerTokenDex","type":"uint256"},{"internalType":"uint256","name":"liquidityPercentage","type":"uint256"},{"internalType":"address","name":"locker","type":"address"},{"internalType":"address","name":"team","type":"address"},{"internalType":"bool","name":"initialized","type":"bool"},{"internalType":"bool","name":"finalized","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"refund","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"remainingStart","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"remainingTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token_","type":"address"},{"internalType":"address","name":"to","type":"address"}],"name":"rescueERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"factory_","type":"address"}],"name":"setFactory","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"locker_","type":"address"}],"name":"setLocker","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"router_","type":"address"}],"name":"setRouter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"team_","type":"address"}],"name":"setTeam","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tier","type":"uint256"}],"name":"tierPricePerToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tiers","outputs":[{"internalType":"uint256","name":"available","type":"uint256"},{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"tokenPricePerAsset","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokensAvailable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tier","type":"uint256"}],"name":"tokensTierAvailable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalBuys","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalTiers","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalTokensAvailable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalTokensBought","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"userBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"tier","type":"uint256"}],"name":"userTierBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"users","outputs":[{"internalType":"uint256","name":"tier","type":"uint256"},{"internalType":"uint256","name":"balance","type":"uint256"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60a0604052600280546001600160a01b031916736b175474e89094c44da98b954eedeac495271d0f17905534801562000036575f80fd5b5060405162002aef38038062002aef83398101604081905262000059916200013b565b836001600160a01b0381166200008857604051631e4fbdf760e01b81525f600482015260240160405180910390fd5b6200009381620000d0565b50600180556001600160a01b03928316608052600380549284166001600160a01b0319938416179055600480549190931691161790555062000195565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b038116811462000136575f80fd5b919050565b5f805f80608085870312156200014f575f80fd5b6200015a856200011f565b93506200016a602086016200011f565b92506200017a604086016200011f565b91506200018a606086016200011f565b905092959194509250565b608051612910620001df5f395f8181610a1701528181610da40152818161102d01528181611c3601528181611d2101528181611e4e01528181611fa2015261202c01526129105ff3fe608060405234801561000f575f80fd5b50600436106101dc575f3560e01c80636c7f3f1711610109578063baa9e5311161009e578063e036a05e1161006e578063e036a05e14610457578063f2fde38b1461046a578063f4b9fa751461047d578063fdea8e0b14610490575f80fd5b8063baa9e531146103f1578063c0d78655146103f9578063cc9b78781461040c578063d96a094a14610444575f80fd5b806379eaaf61116100d957806379eaaf61146103a15780638d4e4083146103aa5780638da5cb5b146103d9578063acc4bd08146103e9575f80fd5b80636c7f3f17146103765780636c9789b01461037e5780636dd2cbe514610391578063715018a614610399575f80fd5b806322d7c6f31161017f578063590e1ae31161014f578063590e1ae3146103405780635bb47808146103485780635d799f871461035b57806360659a921461036e575f80fd5b806322d7c6f3146102b45780633f430f83146102c75780634e71d92d146102f257806354a02f9e146102fa575f80fd5b806304d8347d116101ba57806304d8347d14610264578063095cf5c61461026c578063171060ec1461027f5780631e4550b914610292575f80fd5b80630103c92b146101e05780630113c7e714610206578063039af9eb1461021b575b5f80fd5b6101f36101ee36600461242c565b61056d565b6040519081526020015b60405180910390f35b6102196102143660046125ba565b6105c6565b005b610249610229366004612690565b600f6020525f908152604090208054600182015460029092015490919083565b604080519384526020840192909252908201526060016101fd565b6101f3610acf565b61021961027a36600461242c565b610af2565b61021961028d36600461242c565b610b34565b6101f36102a0366004612690565b5f908152600f602052604090206002015490565b6101f36102c2366004612690565b610b76565b6004546102da906001600160a01b031681565b6040516001600160a01b0390911681526020016101fd565b610219610b9a565b61032b6103083660046126a7565b601160209081525f92835260408084209091529082529020805460019091015482565b604080519283526020830191909152016101fd565b610219610dd7565b61021961035636600461242c565b610fe1565b6102196103693660046126d1565b611023565b6101f3611241565b6101f361127c565b61021961038c366004612715565b6112b9565b6101f36114f3565b61021961152d565b6101f360105481565b600e547501000000000000000000000000000000000000000000900460ff1660405190151581526020016101fd565b5f546001600160a01b03166102da565b6101f361153e565b6101f361155c565b61021961040736600461242c565b611599565b6101f361041a3660046126a7565b6001600160a01b03919091165f908152601160209081526040808320938352929052206001015490565b610219610452366004612690565b6115db565b6003546102da906001600160a01b031681565b61021961047836600461242c565b61196a565b6002546102da906001600160a01b031681565b600554600654600754600854600954600a54600b54600c54600d54600e546105049998979695949392916001600160a01b03908116919081169060ff74010000000000000000000000000000000000000000820481169175010000000000000000000000000000000000000000009004168c565b604080519c8d5260208d019b909b52998b019890985260608a0196909652608089019490945260a088019290925260c087015260e08601526001600160a01b039081166101008601521661012084015215156101408301521515610160820152610180016101fd565b5f80805b6010548110156105bf576001600160a01b0384165f9081526011602090815260408083208484529091529020600101546105ab908361275d565b9150806105b781612770565b915050610571565b5092915050565b6105ce6119bd565b6105d6611a02565b6127108160a0015111156106315760405162461bcd60e51b815260206004820181905260248201527f4c69717569646974792070657263656e746167652065786365656473206d617860448201526064015b60405180910390fd5b60e08101516001600160a01b031661068b5760405162461bcd60e51b815260206004820152601b60248201527f4c6f636b65722063616e6e6f74206265206164647265737328302900000000006044820152606401610628565b428160200151116107045760405162461bcd60e51b815260206004820152602360248201527f53746172742074696d65206d7573742062652067726561746572207468616e2060448201527f6e6f7700000000000000000000000000000000000000000000000000000000006064820152608401610628565b80602001518160400151116107815760405162461bcd60e51b815260206004820152602d60248201527f456e642074696d65206d7573742062652067726561746572207468616e20737460448201527f6172742074696d657374616d70000000000000000000000000000000000000006064820152608401610628565b80604001518160600151116107fe5760405162461bcd60e51b815260206004820152602f60248201527f4d617820656e642074696d65206d75737420626520677265617465722074686160448201527f6e20656e642074696d657374616d7000000000000000000000000000000000006064820152608401610628565b6101008101516001600160a01b03166108595760405162461bcd60e51b815260206004820152601960248201527f5465616d2063616e6e6f742062652061646472657373283029000000000000006044820152606401610628565b6101208101515160108190555f90815b81811015610950575f8461012001518281518110610889576108896127a7565b60200260200101515f015190505f85610120015183815181106108ae576108ae6127a7565b60200260200101516040015190505f81836108c991906127d4565b6108d7906305f5e10061280c565b90506108e3818761275d565b95508260056003015f8282546108f9919061275d565b9091555050610120870151805185908110610916576109166127a7565b602090810291909101810151515f868152600f9092526040909120908155600201919091555081905061094881612770565b915050610869565b505f61097f8460a001516305f5e1008660c001518661096f919061280c565b61097991906127d4565b90611a45565b6305f5e1008560c0015185610994919061280c565b61099e91906127d4565b6109a8919061275d565b84519091506001906109ba90836127d4565b10610a075760405162461bcd60e51b815260206004820152601a60248201527f4e6f7420656e6f75676820746f6b656e7320737570706c6965640000000000006044820152606401610628565b8351610a41906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169033903090611a86565b50505060a0810151600c55602081015160055560408101516006556060810151600755608081015160095560c0810151600b5560e0810151600d80546001600160a01b039283167fffffffffffffffffffffffff000000000000000000000000000000000000000091821617909155610100830151600e8054919093169116179055610acc60018055565b50565b6005545f904210610adf57505f90565b600554610aed904290612823565b905090565b610afa6119bd565b600e80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b610b3c6119bd565b600d80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b5f818152600f6020526040812060018101549054610b949190612823565b92915050565b610ba2611a02565b6005545f03610bf35760405162461bcd60e51b815260206004820152601760248201527f50726573616c65206e6f7420696e697469616c697a65640000000000000000006044820152606401610628565b6006544211610c445760405162461bcd60e51b815260206004820152601360248201527f50726573616c65206973206e6f74206f766572000000000000000000000000006044820152606401610628565b600954610c4f61127c565b1015610c9d5760405162461bcd60e51b815260206004820152601360248201527f536f6674636170206e6f742072656163686564000000000000000000000000006044820152606401610628565b33610cea5760405162461bcd60e51b815260206004820152601360248201527f6d73672e73656e64657220206973207a65726f000000000000000000000000006044820152606401610628565b5f805b601054811015610d4757335f908152601160209081526040808320848452909152812060010180549082905590819003610d275750610d47565b610d31818461275d565b9250508080610d3f90612770565b915050610ced565b50805f03610d975760405162461bcd60e51b815260206004820152600f60248201527f42616c616e6365206973207a65726f00000000000000000000000000000000006044820152606401610628565b610dcb6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163383611b02565b50610dd560018055565b565b610ddf611a02565b6006544211610e305760405162461bcd60e51b815260206004820152601360248201527f50726573616c65206973206e6f74206f766572000000000000000000000000006044820152606401610628565b600954610e3b61127c565b10610e885760405162461bcd60e51b815260206004820152600f60248201527f536f6674636170207265616368656400000000000000000000000000000000006044820152606401610628565b600e547501000000000000000000000000000000000000000000900460ff1615610ef45760405162461bcd60e51b815260206004820152601160248201527f416c72656164792066696e616c697a65640000000000000000000000000000006044820152606401610628565b5f805b601054811015610f7a57335f908152601160209081526040808320848452909152812060010180549082905590819003610f315750610f7a565b5f828152600f6020526040902060020154610f4c90826127d4565b610f5a906305f5e10061280c565b610f64908461275d565b9250508080610f7290612770565b915050610ef7565b50805f03610fca5760405162461bcd60e51b815260206004820152600f60248201527f42616c616e6365206973207a65726f00000000000000000000000000000000006044820152606401610628565b600254610dcb906001600160a01b03163383611b02565b610fe96119bd565b600380547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b61102b6119bd565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316036110ac5760405162461bcd60e51b815260206004820152601360248201527f43616e6e6f742072657363756520746f6b656e000000000000000000000000006044820152606401610628565b6002546001600160a01b039081169083160361112d57600e547501000000000000000000000000000000000000000000900460ff1661112d5760405162461bcd60e51b815260206004820152601560248201527f50726573616c65206e6f742066696e616c697a656400000000000000000000006044820152606401610628565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201525f906001600160a01b038416906370a0823190602401602060405180830381865afa15801561118a573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906111ae9190612836565b6040517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b038481166004830152602482018390529192509084169063a9059cbb906044016020604051808303815f875af1158015611217573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061123b919061284d565b50505050565b5f80805b6010548110156112765761125881610b76565b611262908361275d565b91508061126e81612770565b915050611245565b50919050565b5f80805b601054811015611276575f818152600f60205260409020600101546112a5908361275d565b9150806112b181612770565b915050611280565b5f546001600160a01b03168115806112d95750336001600160a01b038216145b6113255760405162461bcd60e51b815260206004820152600860248201527f4e6f744f776e65720000000000000000000000000000000000000000000000006044820152606401610628565b600e547501000000000000000000000000000000000000000000900460ff16156113915760405162461bcd60e51b815260206004820152601160248201527f416c72656164792066696e616c697a65640000000000000000000000000000006044820152606401610628565b6005545f036113e25760405162461bcd60e51b815260206004820152601760248201527f50726573616c65206e6f7420696e697469616c697a65640000000000000000006044820152606401610628565b60065442116114335760405162461bcd60e51b815260206004820152601360248201527f50726573616c65206973206e6f74206f766572000000000000000000000000006044820152606401610628565b81806114425750600654600754115b61148e5760405162461bcd60e51b815260206004820152601360248201527f50726573616c65206973206e6f74206f766572000000000000000000000000006044820152606401610628565b60095461149961127c565b10156114e75760405162461bcd60e51b815260206004820152601360248201527f536f6674636170206e6f742072656163686564000000000000000000000000006044820152606401610628565b6114ef611b38565b5050565b5f80805b601054811015611276575f818152600f6020526040902054611519908361275d565b91508061152581612770565b9150506114f7565b6115356119bd565b610dd55f6121aa565b6006545f90421061154e57505f90565b600654610aed904290612823565b5f80805b601054811015611276575f818152600f6020526040902060010154611585908361275d565b91508061159181612770565b915050611560565b6115a16119bd565b600480547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6115e3611a02565b6005545f036116345760405162461bcd60e51b815260206004820152601760248201527f50726573616c65206e6f7420696e697469616c697a65640000000000000000006044820152606401610628565b6005544210156116865760405162461bcd60e51b815260206004820152601a60248201527f50726573616c65206861736e27742073746172746564207965740000000000006044820152606401610628565b6006544211156116d85760405162461bcd60e51b815260206004820152600f60248201527f50726573616c65206973206f76657200000000000000000000000000000000006044820152606401610628565b336117255760405162461bcd60e51b815260206004820152601260248201527f6d73672e73656e646572206973207a65726f00000000000000000000000000006044820152606401610628565b805f036117745760405162461bcd60e51b815260206004820152600e60248201527f416d6f756e74206973207a65726f0000000000000000000000000000000000006044820152606401610628565b600a5460105482915f916117889190612823565b90505f805b82811015611905575f61179f82610b76565b5f838152600f6020526040812060020154919250906305f5e100906117c4908861280c565b6117ce91906127d4565b9050818111611850576117e18680612823565b955080600f5f8581526020019081526020015f206001015f828254611806919061275d565b9091555050335f9081526011602090815260408083208684529091528120600101805483929061183790849061275d565b909155506118479050818561275d565b93505050611905565b600a8390555f838152600f6020526040902060020154611874836305f5e10061280c565b61187e91906127d4565b6118889087612823565b955081600f5f8581526020019081526020015f206001015f8282546118ad919061275d565b9091555050335f908152601160209081526040808320868452909152812060010180548492906118de90849061275d565b909155506118ee9050828561275d565b9350505080806118fd90612770565b91505061178d565b5061192933306119158688612823565b6002546001600160a01b0316929190611a86565b60405181815233907fe3d4187f6ca4248660cc0ac8b8056515bac4a8132be2eca31d6d0cc170722a7e9060200160405180910390a2505050610acc60018055565b6119726119bd565b6001600160a01b0381166119b4576040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081525f6004820152602401610628565b610acc816121aa565b5f546001600160a01b03163314610dd5576040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152602401610628565b600260015403611a3e576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600155565b5f81157fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec7783900484111517611a78575f80fd5b506127109102611388010490565b6040516001600160a01b03848116602483015283811660448301526064820183905261123b9186918216906323b872dd906084015b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612211565b6040516001600160a01b03838116602483015260448201839052611b3391859182169063a9059cbb90606401611abb565b505050565b600e80547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff1675010000000000000000000000000000000000000000001790556002546040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201525f916001600160a01b0316906370a0823190602401602060405180830381865afa158015611bd7573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611bfb9190612836565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529091505f906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa158015611c7b573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611c9f9190612836565b90505f611caa61155c565b600c549091505f90611cbd908390611a45565b90505f611cca8285612823565b600c549091505f90611cdd908790611a45565b90505f611cea8288612823565b90508215611d81576040517f42966c68000000000000000000000000000000000000000000000000000000008152600481018490527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906342966c68906024015f604051808303815f87803b158015611d6a575f80fd5b505af1158015611d7c573d5f803e3d5ffd5b505050505b8015611e1857600254600e546040517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b0391821660048201526024810184905291169063a9059cbb906044016020604051808303815f875af1158015611df2573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611e16919061284d565b505b6003546002546040517fc9c653960000000000000000000000000000000000000000000000000000000081526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166004830152918216602482015291169063c9c65396906044016020604051808303815f875af1158015611ea4573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611ec89190612868565b50600254600480546040517f095ea7b30000000000000000000000000000000000000000000000000000000081526001600160a01b0391821692810192909252602482018590529091169063095ea7b3906044016020604051808303815f875af1158015611f38573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611f5c919061284d565b50600480546040517f095ea7b30000000000000000000000000000000000000000000000000000000081526001600160a01b0391821692810192909252602482018690527f0000000000000000000000000000000000000000000000000000000000000000169063095ea7b3906044016020604051808303815f875af1158015611fe8573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061200c919061284d565b50600454600254600d545f926001600160a01b039081169263e8e33700927f000000000000000000000000000000000000000000000000000000000000000092918216918a91899183918391166120654261012c61275d565b60405160e08a901b7fffffffff000000000000000000000000000000000000000000000000000000001681526001600160a01b039889166004820152968816602488015260448701959095526064860193909352608485019190915260a484015290921660c482015260e4810191909152610104016060604051808303815f875af11580156120f6573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061211a9190612883565b925050505f811161216d5760405162461bcd60e51b815260206004820152601160248201527f4c6971756964697479206973207a65726f0000000000000000000000000000006044820152606401610628565b6040514381527f839cf22e1ba87ce2f5b9bbf46cf0175a09eed52febdfaac8852478e68203c7639060200160405180910390a15050505050505050565b5f80546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f6122256001600160a01b0384168361228b565b905080515f14158015612249575080806020019051810190612247919061284d565b155b15611b33576040517f5274afe70000000000000000000000000000000000000000000000000000000081526001600160a01b0384166004820152602401610628565b606061229883835f61229f565b9392505050565b6060814710156122dd576040517fcd786059000000000000000000000000000000000000000000000000000000008152306004820152602401610628565b5f80856001600160a01b031684866040516122f891906128ae565b5f6040518083038185875af1925050503d805f8114612332576040519150601f19603f3d011682016040523d82523d5f602084013e612337565b606091505b5091509150612347868383612351565b9695505050505050565b60608261236657612361826123c6565b612298565b815115801561237d57506001600160a01b0384163b155b156123bf576040517f9996b3150000000000000000000000000000000000000000000000000000000081526001600160a01b0385166004820152602401610628565b5080612298565b8051156123d65780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0381168114610acc575f80fd5b803561242781612408565b919050565b5f6020828403121561243c575f80fd5b813561229881612408565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6040516060810167ffffffffffffffff8111828210171561249757612497612447565b60405290565b604051610140810167ffffffffffffffff8111828210171561249757612497612447565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561250857612508612447565b604052919050565b5f82601f83011261251f575f80fd5b8135602067ffffffffffffffff82111561253b5761253b612447565b612549818360051b016124c1565b82815260609283028501820192828201919087851115612567575f80fd5b8387015b858110156125ad5781818a031215612582575f8081fd5b61258a612474565b81358152858201358682015260408083013590820152845292840192810161256b565b5090979650505050505050565b5f602082840312156125ca575f80fd5b813567ffffffffffffffff808211156125e1575f80fd5b9083019061014082860312156125f5575f80fd5b6125fd61249d565b823581526020830135602082015260408301356040820152606083013560608201526080830135608082015260a083013560a082015260c083013560c082015261264960e0840161241c565b60e082015261010061265c81850161241c565b908201526101208381013583811115612673575f80fd5b61267f88828701612510565b918301919091525095945050505050565b5f602082840312156126a0575f80fd5b5035919050565b5f80604083850312156126b8575f80fd5b82356126c381612408565b946020939093013593505050565b5f80604083850312156126e2575f80fd5b82356126ed81612408565b915060208301356126fd81612408565b809150509250929050565b8015158114610acc575f80fd5b5f60208284031215612725575f80fd5b813561229881612708565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b80820180821115610b9457610b94612730565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036127a0576127a0612730565b5060010190565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f82612807577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b500490565b8082028115828204841417610b9457610b94612730565b81810381811115610b9457610b94612730565b5f60208284031215612846575f80fd5b5051919050565b5f6020828403121561285d575f80fd5b815161229881612708565b5f60208284031215612878575f80fd5b815161229881612408565b5f805f60608486031215612895575f80fd5b8351925060208401519150604084015190509250925092565b5f82515f5b818110156128cd57602081860181015185830152016128b3565b505f92019182525091905056fea2646970667358221220fc7d65ddc0835f99aef7cbd601d444670ae645f0b59e9bcb6c77a0adc95ee22f64736f6c634300081400330000000000000000000000002dbeb1e61328256761e6b52d7b193b63cbe46d49000000000000000000000000f667bf1e7a2e50abc3e55d1f297c5c5e37b3a5980000000000000000000000005c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d
Deployed Bytecode
0x608060405234801561000f575f80fd5b50600436106101dc575f3560e01c80636c7f3f1711610109578063baa9e5311161009e578063e036a05e1161006e578063e036a05e14610457578063f2fde38b1461046a578063f4b9fa751461047d578063fdea8e0b14610490575f80fd5b8063baa9e531146103f1578063c0d78655146103f9578063cc9b78781461040c578063d96a094a14610444575f80fd5b806379eaaf61116100d957806379eaaf61146103a15780638d4e4083146103aa5780638da5cb5b146103d9578063acc4bd08146103e9575f80fd5b80636c7f3f17146103765780636c9789b01461037e5780636dd2cbe514610391578063715018a614610399575f80fd5b806322d7c6f31161017f578063590e1ae31161014f578063590e1ae3146103405780635bb47808146103485780635d799f871461035b57806360659a921461036e575f80fd5b806322d7c6f3146102b45780633f430f83146102c75780634e71d92d146102f257806354a02f9e146102fa575f80fd5b806304d8347d116101ba57806304d8347d14610264578063095cf5c61461026c578063171060ec1461027f5780631e4550b914610292575f80fd5b80630103c92b146101e05780630113c7e714610206578063039af9eb1461021b575b5f80fd5b6101f36101ee36600461242c565b61056d565b6040519081526020015b60405180910390f35b6102196102143660046125ba565b6105c6565b005b610249610229366004612690565b600f6020525f908152604090208054600182015460029092015490919083565b604080519384526020840192909252908201526060016101fd565b6101f3610acf565b61021961027a36600461242c565b610af2565b61021961028d36600461242c565b610b34565b6101f36102a0366004612690565b5f908152600f602052604090206002015490565b6101f36102c2366004612690565b610b76565b6004546102da906001600160a01b031681565b6040516001600160a01b0390911681526020016101fd565b610219610b9a565b61032b6103083660046126a7565b601160209081525f92835260408084209091529082529020805460019091015482565b604080519283526020830191909152016101fd565b610219610dd7565b61021961035636600461242c565b610fe1565b6102196103693660046126d1565b611023565b6101f3611241565b6101f361127c565b61021961038c366004612715565b6112b9565b6101f36114f3565b61021961152d565b6101f360105481565b600e547501000000000000000000000000000000000000000000900460ff1660405190151581526020016101fd565b5f546001600160a01b03166102da565b6101f361153e565b6101f361155c565b61021961040736600461242c565b611599565b6101f361041a3660046126a7565b6001600160a01b03919091165f908152601160209081526040808320938352929052206001015490565b610219610452366004612690565b6115db565b6003546102da906001600160a01b031681565b61021961047836600461242c565b61196a565b6002546102da906001600160a01b031681565b600554600654600754600854600954600a54600b54600c54600d54600e546105049998979695949392916001600160a01b03908116919081169060ff74010000000000000000000000000000000000000000820481169175010000000000000000000000000000000000000000009004168c565b604080519c8d5260208d019b909b52998b019890985260608a0196909652608089019490945260a088019290925260c087015260e08601526001600160a01b039081166101008601521661012084015215156101408301521515610160820152610180016101fd565b5f80805b6010548110156105bf576001600160a01b0384165f9081526011602090815260408083208484529091529020600101546105ab908361275d565b9150806105b781612770565b915050610571565b5092915050565b6105ce6119bd565b6105d6611a02565b6127108160a0015111156106315760405162461bcd60e51b815260206004820181905260248201527f4c69717569646974792070657263656e746167652065786365656473206d617860448201526064015b60405180910390fd5b60e08101516001600160a01b031661068b5760405162461bcd60e51b815260206004820152601b60248201527f4c6f636b65722063616e6e6f74206265206164647265737328302900000000006044820152606401610628565b428160200151116107045760405162461bcd60e51b815260206004820152602360248201527f53746172742074696d65206d7573742062652067726561746572207468616e2060448201527f6e6f7700000000000000000000000000000000000000000000000000000000006064820152608401610628565b80602001518160400151116107815760405162461bcd60e51b815260206004820152602d60248201527f456e642074696d65206d7573742062652067726561746572207468616e20737460448201527f6172742074696d657374616d70000000000000000000000000000000000000006064820152608401610628565b80604001518160600151116107fe5760405162461bcd60e51b815260206004820152602f60248201527f4d617820656e642074696d65206d75737420626520677265617465722074686160448201527f6e20656e642074696d657374616d7000000000000000000000000000000000006064820152608401610628565b6101008101516001600160a01b03166108595760405162461bcd60e51b815260206004820152601960248201527f5465616d2063616e6e6f742062652061646472657373283029000000000000006044820152606401610628565b6101208101515160108190555f90815b81811015610950575f8461012001518281518110610889576108896127a7565b60200260200101515f015190505f85610120015183815181106108ae576108ae6127a7565b60200260200101516040015190505f81836108c991906127d4565b6108d7906305f5e10061280c565b90506108e3818761275d565b95508260056003015f8282546108f9919061275d565b9091555050610120870151805185908110610916576109166127a7565b602090810291909101810151515f868152600f9092526040909120908155600201919091555081905061094881612770565b915050610869565b505f61097f8460a001516305f5e1008660c001518661096f919061280c565b61097991906127d4565b90611a45565b6305f5e1008560c0015185610994919061280c565b61099e91906127d4565b6109a8919061275d565b84519091506001906109ba90836127d4565b10610a075760405162461bcd60e51b815260206004820152601a60248201527f4e6f7420656e6f75676820746f6b656e7320737570706c6965640000000000006044820152606401610628565b8351610a41906001600160a01b037f000000000000000000000000f667bf1e7a2e50abc3e55d1f297c5c5e37b3a598169033903090611a86565b50505060a0810151600c55602081015160055560408101516006556060810151600755608081015160095560c0810151600b5560e0810151600d80546001600160a01b039283167fffffffffffffffffffffffff000000000000000000000000000000000000000091821617909155610100830151600e8054919093169116179055610acc60018055565b50565b6005545f904210610adf57505f90565b600554610aed904290612823565b905090565b610afa6119bd565b600e80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b610b3c6119bd565b600d80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b5f818152600f6020526040812060018101549054610b949190612823565b92915050565b610ba2611a02565b6005545f03610bf35760405162461bcd60e51b815260206004820152601760248201527f50726573616c65206e6f7420696e697469616c697a65640000000000000000006044820152606401610628565b6006544211610c445760405162461bcd60e51b815260206004820152601360248201527f50726573616c65206973206e6f74206f766572000000000000000000000000006044820152606401610628565b600954610c4f61127c565b1015610c9d5760405162461bcd60e51b815260206004820152601360248201527f536f6674636170206e6f742072656163686564000000000000000000000000006044820152606401610628565b33610cea5760405162461bcd60e51b815260206004820152601360248201527f6d73672e73656e64657220206973207a65726f000000000000000000000000006044820152606401610628565b5f805b601054811015610d4757335f908152601160209081526040808320848452909152812060010180549082905590819003610d275750610d47565b610d31818461275d565b9250508080610d3f90612770565b915050610ced565b50805f03610d975760405162461bcd60e51b815260206004820152600f60248201527f42616c616e6365206973207a65726f00000000000000000000000000000000006044820152606401610628565b610dcb6001600160a01b037f000000000000000000000000f667bf1e7a2e50abc3e55d1f297c5c5e37b3a598163383611b02565b50610dd560018055565b565b610ddf611a02565b6006544211610e305760405162461bcd60e51b815260206004820152601360248201527f50726573616c65206973206e6f74206f766572000000000000000000000000006044820152606401610628565b600954610e3b61127c565b10610e885760405162461bcd60e51b815260206004820152600f60248201527f536f6674636170207265616368656400000000000000000000000000000000006044820152606401610628565b600e547501000000000000000000000000000000000000000000900460ff1615610ef45760405162461bcd60e51b815260206004820152601160248201527f416c72656164792066696e616c697a65640000000000000000000000000000006044820152606401610628565b5f805b601054811015610f7a57335f908152601160209081526040808320848452909152812060010180549082905590819003610f315750610f7a565b5f828152600f6020526040902060020154610f4c90826127d4565b610f5a906305f5e10061280c565b610f64908461275d565b9250508080610f7290612770565b915050610ef7565b50805f03610fca5760405162461bcd60e51b815260206004820152600f60248201527f42616c616e6365206973207a65726f00000000000000000000000000000000006044820152606401610628565b600254610dcb906001600160a01b03163383611b02565b610fe96119bd565b600380547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b61102b6119bd565b7f000000000000000000000000f667bf1e7a2e50abc3e55d1f297c5c5e37b3a5986001600160a01b0316826001600160a01b0316036110ac5760405162461bcd60e51b815260206004820152601360248201527f43616e6e6f742072657363756520746f6b656e000000000000000000000000006044820152606401610628565b6002546001600160a01b039081169083160361112d57600e547501000000000000000000000000000000000000000000900460ff1661112d5760405162461bcd60e51b815260206004820152601560248201527f50726573616c65206e6f742066696e616c697a656400000000000000000000006044820152606401610628565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201525f906001600160a01b038416906370a0823190602401602060405180830381865afa15801561118a573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906111ae9190612836565b6040517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b038481166004830152602482018390529192509084169063a9059cbb906044016020604051808303815f875af1158015611217573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061123b919061284d565b50505050565b5f80805b6010548110156112765761125881610b76565b611262908361275d565b91508061126e81612770565b915050611245565b50919050565b5f80805b601054811015611276575f818152600f60205260409020600101546112a5908361275d565b9150806112b181612770565b915050611280565b5f546001600160a01b03168115806112d95750336001600160a01b038216145b6113255760405162461bcd60e51b815260206004820152600860248201527f4e6f744f776e65720000000000000000000000000000000000000000000000006044820152606401610628565b600e547501000000000000000000000000000000000000000000900460ff16156113915760405162461bcd60e51b815260206004820152601160248201527f416c72656164792066696e616c697a65640000000000000000000000000000006044820152606401610628565b6005545f036113e25760405162461bcd60e51b815260206004820152601760248201527f50726573616c65206e6f7420696e697469616c697a65640000000000000000006044820152606401610628565b60065442116114335760405162461bcd60e51b815260206004820152601360248201527f50726573616c65206973206e6f74206f766572000000000000000000000000006044820152606401610628565b81806114425750600654600754115b61148e5760405162461bcd60e51b815260206004820152601360248201527f50726573616c65206973206e6f74206f766572000000000000000000000000006044820152606401610628565b60095461149961127c565b10156114e75760405162461bcd60e51b815260206004820152601360248201527f536f6674636170206e6f742072656163686564000000000000000000000000006044820152606401610628565b6114ef611b38565b5050565b5f80805b601054811015611276575f818152600f6020526040902054611519908361275d565b91508061152581612770565b9150506114f7565b6115356119bd565b610dd55f6121aa565b6006545f90421061154e57505f90565b600654610aed904290612823565b5f80805b601054811015611276575f818152600f6020526040902060010154611585908361275d565b91508061159181612770565b915050611560565b6115a16119bd565b600480547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6115e3611a02565b6005545f036116345760405162461bcd60e51b815260206004820152601760248201527f50726573616c65206e6f7420696e697469616c697a65640000000000000000006044820152606401610628565b6005544210156116865760405162461bcd60e51b815260206004820152601a60248201527f50726573616c65206861736e27742073746172746564207965740000000000006044820152606401610628565b6006544211156116d85760405162461bcd60e51b815260206004820152600f60248201527f50726573616c65206973206f76657200000000000000000000000000000000006044820152606401610628565b336117255760405162461bcd60e51b815260206004820152601260248201527f6d73672e73656e646572206973207a65726f00000000000000000000000000006044820152606401610628565b805f036117745760405162461bcd60e51b815260206004820152600e60248201527f416d6f756e74206973207a65726f0000000000000000000000000000000000006044820152606401610628565b600a5460105482915f916117889190612823565b90505f805b82811015611905575f61179f82610b76565b5f838152600f6020526040812060020154919250906305f5e100906117c4908861280c565b6117ce91906127d4565b9050818111611850576117e18680612823565b955080600f5f8581526020019081526020015f206001015f828254611806919061275d565b9091555050335f9081526011602090815260408083208684529091528120600101805483929061183790849061275d565b909155506118479050818561275d565b93505050611905565b600a8390555f838152600f6020526040902060020154611874836305f5e10061280c565b61187e91906127d4565b6118889087612823565b955081600f5f8581526020019081526020015f206001015f8282546118ad919061275d565b9091555050335f908152601160209081526040808320868452909152812060010180548492906118de90849061275d565b909155506118ee9050828561275d565b9350505080806118fd90612770565b91505061178d565b5061192933306119158688612823565b6002546001600160a01b0316929190611a86565b60405181815233907fe3d4187f6ca4248660cc0ac8b8056515bac4a8132be2eca31d6d0cc170722a7e9060200160405180910390a2505050610acc60018055565b6119726119bd565b6001600160a01b0381166119b4576040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081525f6004820152602401610628565b610acc816121aa565b5f546001600160a01b03163314610dd5576040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152602401610628565b600260015403611a3e576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600155565b5f81157fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec7783900484111517611a78575f80fd5b506127109102611388010490565b6040516001600160a01b03848116602483015283811660448301526064820183905261123b9186918216906323b872dd906084015b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612211565b6040516001600160a01b03838116602483015260448201839052611b3391859182169063a9059cbb90606401611abb565b505050565b600e80547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff1675010000000000000000000000000000000000000000001790556002546040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201525f916001600160a01b0316906370a0823190602401602060405180830381865afa158015611bd7573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611bfb9190612836565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529091505f906001600160a01b037f000000000000000000000000f667bf1e7a2e50abc3e55d1f297c5c5e37b3a59816906370a0823190602401602060405180830381865afa158015611c7b573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611c9f9190612836565b90505f611caa61155c565b600c549091505f90611cbd908390611a45565b90505f611cca8285612823565b600c549091505f90611cdd908790611a45565b90505f611cea8288612823565b90508215611d81576040517f42966c68000000000000000000000000000000000000000000000000000000008152600481018490527f000000000000000000000000f667bf1e7a2e50abc3e55d1f297c5c5e37b3a5986001600160a01b0316906342966c68906024015f604051808303815f87803b158015611d6a575f80fd5b505af1158015611d7c573d5f803e3d5ffd5b505050505b8015611e1857600254600e546040517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b0391821660048201526024810184905291169063a9059cbb906044016020604051808303815f875af1158015611df2573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611e16919061284d565b505b6003546002546040517fc9c653960000000000000000000000000000000000000000000000000000000081526001600160a01b037f000000000000000000000000f667bf1e7a2e50abc3e55d1f297c5c5e37b3a59881166004830152918216602482015291169063c9c65396906044016020604051808303815f875af1158015611ea4573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611ec89190612868565b50600254600480546040517f095ea7b30000000000000000000000000000000000000000000000000000000081526001600160a01b0391821692810192909252602482018590529091169063095ea7b3906044016020604051808303815f875af1158015611f38573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611f5c919061284d565b50600480546040517f095ea7b30000000000000000000000000000000000000000000000000000000081526001600160a01b0391821692810192909252602482018690527f000000000000000000000000f667bf1e7a2e50abc3e55d1f297c5c5e37b3a598169063095ea7b3906044016020604051808303815f875af1158015611fe8573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061200c919061284d565b50600454600254600d545f926001600160a01b039081169263e8e33700927f000000000000000000000000f667bf1e7a2e50abc3e55d1f297c5c5e37b3a59892918216918a91899183918391166120654261012c61275d565b60405160e08a901b7fffffffff000000000000000000000000000000000000000000000000000000001681526001600160a01b039889166004820152968816602488015260448701959095526064860193909352608485019190915260a484015290921660c482015260e4810191909152610104016060604051808303815f875af11580156120f6573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061211a9190612883565b925050505f811161216d5760405162461bcd60e51b815260206004820152601160248201527f4c6971756964697479206973207a65726f0000000000000000000000000000006044820152606401610628565b6040514381527f839cf22e1ba87ce2f5b9bbf46cf0175a09eed52febdfaac8852478e68203c7639060200160405180910390a15050505050505050565b5f80546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f6122256001600160a01b0384168361228b565b905080515f14158015612249575080806020019051810190612247919061284d565b155b15611b33576040517f5274afe70000000000000000000000000000000000000000000000000000000081526001600160a01b0384166004820152602401610628565b606061229883835f61229f565b9392505050565b6060814710156122dd576040517fcd786059000000000000000000000000000000000000000000000000000000008152306004820152602401610628565b5f80856001600160a01b031684866040516122f891906128ae565b5f6040518083038185875af1925050503d805f8114612332576040519150601f19603f3d011682016040523d82523d5f602084013e612337565b606091505b5091509150612347868383612351565b9695505050505050565b60608261236657612361826123c6565b612298565b815115801561237d57506001600160a01b0384163b155b156123bf576040517f9996b3150000000000000000000000000000000000000000000000000000000081526001600160a01b0385166004820152602401610628565b5080612298565b8051156123d65780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0381168114610acc575f80fd5b803561242781612408565b919050565b5f6020828403121561243c575f80fd5b813561229881612408565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6040516060810167ffffffffffffffff8111828210171561249757612497612447565b60405290565b604051610140810167ffffffffffffffff8111828210171561249757612497612447565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561250857612508612447565b604052919050565b5f82601f83011261251f575f80fd5b8135602067ffffffffffffffff82111561253b5761253b612447565b612549818360051b016124c1565b82815260609283028501820192828201919087851115612567575f80fd5b8387015b858110156125ad5781818a031215612582575f8081fd5b61258a612474565b81358152858201358682015260408083013590820152845292840192810161256b565b5090979650505050505050565b5f602082840312156125ca575f80fd5b813567ffffffffffffffff808211156125e1575f80fd5b9083019061014082860312156125f5575f80fd5b6125fd61249d565b823581526020830135602082015260408301356040820152606083013560608201526080830135608082015260a083013560a082015260c083013560c082015261264960e0840161241c565b60e082015261010061265c81850161241c565b908201526101208381013583811115612673575f80fd5b61267f88828701612510565b918301919091525095945050505050565b5f602082840312156126a0575f80fd5b5035919050565b5f80604083850312156126b8575f80fd5b82356126c381612408565b946020939093013593505050565b5f80604083850312156126e2575f80fd5b82356126ed81612408565b915060208301356126fd81612408565b809150509250929050565b8015158114610acc575f80fd5b5f60208284031215612725575f80fd5b813561229881612708565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b80820180821115610b9457610b94612730565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036127a0576127a0612730565b5060010190565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f82612807577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b500490565b8082028115828204841417610b9457610b94612730565b81810381811115610b9457610b94612730565b5f60208284031215612846575f80fd5b5051919050565b5f6020828403121561285d575f80fd5b815161229881612708565b5f60208284031215612878575f80fd5b815161229881612408565b5f805f60608486031215612895575f80fd5b8351925060208401519150604084015190509250925092565b5f82515f5b818110156128cd57602081860181015185830152016128b3565b505f92019182525091905056fea2646970667358221220fc7d65ddc0835f99aef7cbd601d444670ae645f0b59e9bcb6c77a0adc95ee22f64736f6c63430008140033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000002dbeb1e61328256761e6b52d7b193b63cbe46d49000000000000000000000000f667bf1e7a2e50abc3e55d1f297c5c5e37b3a5980000000000000000000000005c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d
-----Decoded View---------------
Arg [0] : _owner (address): 0x2dbeb1E61328256761E6b52D7b193B63CBE46d49
Arg [1] : tokenAddress (address): 0xf667bF1e7A2E50Abc3e55d1f297C5C5e37b3a598
Arg [2] : factory_ (address): 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f
Arg [3] : router_ (address): 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 0000000000000000000000002dbeb1e61328256761e6b52d7b193b63cbe46d49
Arg [1] : 000000000000000000000000f667bf1e7a2e50abc3e55d1f297c5c5e37b3a598
Arg [2] : 0000000000000000000000005c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f
Arg [3] : 0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 26 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.