Feature Tip: Add private address tag to any address under My Name Tag !
ERC-20
DeFi
Overview
Max Total Supply
1,000,000,000 MAGNET
Holders
907 (0.00%)
Market
Price
$0.00 @ 0.000000 ETH
Onchain Market Cap
$20,680.00
Circulating Supply Market Cap
$0.00
Other Info
Token Contract (WITH 18 Decimals)
Balance
0.762389226361401938 MAGNETValue
$0.00 ( ~0 Eth) [0.0000%]Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
YieldMagnetToken
Compiler Version
v0.8.22+commit.4fc1097e
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol"; import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol"; /// @title This is official MAGNET Token contract ERC20 used in the Yield Magnet platform /// @author Yield Magnet Team struct StakingContract { address contractAddress; uint8 percentage; } contract YieldMagnetToken is ERC20, Ownable { using SafeERC20 for IERC20; /*////////////////////////////////////////////////////////////// TAX VARIABLES //////////////////////////////////////////////////////////////*/ struct WalletState { bool isMarketPair; bool isExemptFromTax; } // Saves gas! mapping(address => WalletState) public walletStates; // Set to 10/10 when trading is open. SetTaxes can only set it // up to 10/10. uint8 public buyTax = 0; uint8 public sellTax = 0; // Must always add up to 100. uint8 public platformPercentage = 60; uint8 public stakerPercentage = 20; uint8 public lpPercentage = 20; // When set is true, tax will no longer be change-able. bool private _isTaxRenounced = false; bool private _isTaxEnabled = true; /*////////////////////////////////////////////////////////////// CONTRACT SWAP //////////////////////////////////////////////////////////////*/ // Once switched on, can never be switched off. bool public isTradingOpen = false; bool private _inSwap = false; uint256 public taxDistributionThreshold = 5_000_000 * 10 ** 18; /*////////////////////////////////////////////////////////////// UNISWAP //////////////////////////////////////////////////////////////*/ IUniswapV2Router02 public uniswapV2Router; /*////////////////////////////////////////////////////////////// TAX RECIPIENTS //////////////////////////////////////////////////////////////*/ // Platform cut will be sent to this address. // Defaults to contract creator. address public taxAddress; // LP tokens will be sent to this address. // Defaults to contract creator. address public lpAddress; // Staking cut will be distributed to these contracts. // The percentages must always add up to 100. StakingContract[] private _stakingContracts; /*////////////////////////////////////////////////////////////// EVENTS //////////////////////////////////////////////////////////////*/ event TaxDistributed( uint256 platformCut, uint256 stakersCut, uint256 liquidityCut ); event LiquidityAdded(uint256 tokenAmount, uint256 ethAmount); event PlatformTaxDistributed(uint256 amount); event UniswapRouterUpdated(address newRouter); event ExcludedFromFeesUpdated(address wallet, bool isExcluded); event MarketPairUpdated(address pair, bool isMarketPair); event StakingContractsUpdated( address[] stakingContracts, uint8[] percentages ); event TaxAddressUpdated(address newTaxAddress); event LpAddressUpdated(address newLpAddress); event TradingOpen(); event TaxRenounced(); event TaxStatusUpdated(bool isTaxEnabled); event TaxesUpdated(uint8 buyTax, uint8 sellTax); event DistributionThresholdUpdated(uint256 newThreshold); event DistributionPercentagesUpdated( uint8 platformPercentage, uint8 stakerPercentage, uint8 lpPercentage ); /*////////////////////////////////////////////////////////////// MAIN LOGIC //////////////////////////////////////////////////////////////*/ constructor() ERC20("Yield Magnet", "MAGNET") Ownable(msg.sender) { super._update(address(0), msg.sender, (1_000_000_000 * 10 ** 18)); address uniswapV2Router02Address = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( uniswapV2Router02Address ); // Create the pair and mark it as a market pair to enable taxes. address uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router = _uniswapV2Router; _approve(address(this), uniswapV2Router02Address, type(uint256).max); setMarketPair(uniswapV2Pair, true); taxAddress = msg.sender; lpAddress = msg.sender; // Exclude owner, this contract and Uniswap router from fees. walletStates[msg.sender] = WalletState({ isMarketPair: false, isExemptFromTax: true }); emit ExcludedFromFeesUpdated(msg.sender, true); walletStates[address(this)] = WalletState({ isMarketPair: false, isExemptFromTax: true }); emit ExcludedFromFeesUpdated(address(this), true); walletStates[uniswapV2Router02Address] = WalletState({ isMarketPair: false, isExemptFromTax: true }); emit ExcludedFromFeesUpdated(uniswapV2Router02Address, true); } receive() external payable {} /// @notice Returns if an address is excluded from tax. function isTaxExempt(address account_) external view returns (bool) { return walletStates[account_].isExemptFromTax; } /// @notice Returns if the tax is enabled or not. Tax only exists on market pairs. function isTaxEnabled() external view returns (bool) { return _isTaxEnabled; } /// @notice Returns if tax is renounced, meaning that the taxes cannot be changed. function isTaxRenounced() external view returns (bool) { return _isTaxRenounced; } /// @notice _update function overrides the _update function from the perent contract and contains logic for tax and tax distribution /// @dev this override function will be called from the top level transfer and transferFrom function whenever user initates transfer or buy and sell happens /// @dev this function breaks _mint. Use super._update instead. /// @param from address from the amount will be transfered /// @param to address to where the amount will be transfered /// @param amount number of tokens to transfer function _update( address from, address to, uint256 amount ) internal override { // Parent ERC20 already checks that from/to are not zero address. uint256 fromBalance = balanceOf(from); require( fromBalance >= amount, "ERC20: transfer amount exceeds balance" ); WalletState memory fromState = walletStates[from]; WalletState memory toState = walletStates[to]; bool isTaxExempt_ = (fromState.isExemptFromTax || toState.isExemptFromTax); uint256 taxAmount; if(fromState.isMarketPair || toState.isMarketPair) { require(isTradingOpen || msg.sender == owner() || tx.origin == owner(), "Trading not open yet"); } if (fromState.isMarketPair && isTaxExempt_ == false && _isTaxEnabled) { taxAmount = (amount * buyTax) / 100; } else if ( toState.isMarketPair && isTaxExempt_ == false && _isTaxEnabled ) { taxAmount = (amount * sellTax) / 100; } else { taxAmount = 0; } if ( balanceOf(address(this)) > taxDistributionThreshold && _inSwap == false && fromState.isMarketPair == false && // Don't swap on buys. toState.isMarketPair == true // Only swap on sells. ) { try this.distributeTax() {} catch(bytes memory) {} } if (taxAmount != 0 && _inSwap == false) { super._update(from, to, amount - taxAmount); super._update(from, address(this), taxAmount); } else { super._update(from, to, amount); } } modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } /// @notice Distributes the collected tax to the platform, stakers and liquidity. function distributeTax() external lockTheSwap { require(msg.sender == address(this) || msg.sender == owner(), "owner/contract only"); uint256 contractBalance = balanceOf(address(this)); uint256 platformCut = (contractBalance * platformPercentage) / 100; uint256 stakerCut = (contractBalance * stakerPercentage) / 100; uint256 lpCut = (contractBalance * lpPercentage) / 100; require( (platformCut + stakerCut + lpCut) <= balanceOf(address(this)), "YieldMagnet: Can't distribute the funds" ); _distributeStakersCut(stakerCut); _handleLiquidityAndPlatformCut(platformCut, lpCut); emit TaxDistributed(platformCut, stakerCut, lpCut); } /// @notice Distributes the stakers cut to the staking contracts. /// @dev All staking contract's percentages must add up to exactly 100. function _distributeStakersCut(uint256 stakersCut_) private { for (uint256 i = 0; i < _stakingContracts.length; i++) { StakingContract memory sc = _stakingContracts[i]; uint256 stakerContractCut = (sc.percentage * stakersCut_) / 100; super._update(address(this), sc.contractAddress, stakerContractCut); } } /// @notice Distributes liquidity and platform cut. Swaps both to ETH, adds liquidity, and sends the remaining ETH to the tax address. /// @param platformCut amount of tokens to swap and send as ETH to taxAddress. /// @param lpCut half tokens are swapped, half added to liquidity. function _handleLiquidityAndPlatformCut(uint256 platformCut, uint256 lpCut) private { uint256 initBal = address(this).balance; _swapTokensForEth(lpCut/2 - 1 + platformCut); if(lpCut > 0) { uint256 receiveBalance = address(this).balance - initBal; uint256 ethForLiq = receiveBalance * lpCut / (lpCut + platformCut); _addLiquidity(lpCut/2, ethForLiq); emit LiquidityAdded(lpCut/2, ethForLiq); } // Send any remaining ETH to the tax address. This will equal to the platform cut. uint256 amount = address(this).balance; (bool success,) = taxAddress.call{value: amount}(""); require(success, "YieldMagnet: Failed to send ETH to tax address"); emit PlatformTaxDistributed(amount); } /// @notice Swaps the token amount to ETH using the Uniswap V2 router. function _swapTokensForEth(uint256 tokenAmount_) private { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); require( tokenAmount_ > 0, "YieldMagnet: Token amount less then 0 for token swap" ); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount_, 0, path, address(this), block.timestamp ); } /// @notice Adds liquidity to the Uniswap V2 pair. LP tokens are sent to the lpAddress. /// @dev Approvals happen when setting the router address. function _addLiquidity(uint256 tokenAmount_, uint256 ethAmount_) private { uniswapV2Router.addLiquidityETH{value: ethAmount_}( address(this), tokenAmount_, 0, 0, lpAddress, block.timestamp ); } /*////////////////////////////////////////////////////////////// STAKING CONTRACTS //////////////////////////////////////////////////////////////*/ /// @notice Retrieves the Staking contract address and their percentages. function getStakingContracts() public view returns (StakingContract[] memory) { return _stakingContracts; } /// @notice Sets the staking contracts and their respective percentages. Percentages must add up to 100. /// @dev Deletes any previous _stakingContracts. /// @param stakingContracts_ The array of Staking contract addresses /// @param percentages_ The array of Staking contract distribution perccentages function updateStakingContracts( address[] memory stakingContracts_, uint8[] memory percentages_ ) external onlyOwner { require( stakingContracts_.length == percentages_.length, "YieldMagnet: No of address and No of Percentages doesn't match!" ); require(stakingContracts_.length <= 10, "YieldMagnet: Max 10 staking contracts allowed!"); // Clear the existing staking contracts. delete _stakingContracts; uint8 totalPercent = 0; for (uint256 i = 0; i < stakingContracts_.length; i++) { require( percentages_[i] >= 0 && percentages_[i] <= 100, "YieldMagnet: percentage should be between 0 to 100!" ); require( stakingContracts_[i] != address(0), "YieldMagnet: Staking contract may not be 0x0" ); _stakingContracts.push( StakingContract(stakingContracts_[i], percentages_[i]) ); totalPercent += percentages_[i]; } require( totalPercent == 100, "YieldMagnet: Total Percentage should be 100." ); emit StakingContractsUpdated(stakingContracts_, percentages_); } /*////////////////////////////////////////////////////////////// OWNER FUNCTIONS //////////////////////////////////////////////////////////////*/ /// @notice Opens the trading, enabling taxes. Can only be called once. function openTrading() external onlyOwner { require(isTradingOpen == false, "Trading already open"); isTradingOpen = true; buyTax = 10; sellTax = 10; emit TradingOpen(); } /// @notice Renounces the tax, meaning that it can never be changed again. function renounceTax() public onlyOwner { _isTaxRenounced = true; emit TaxRenounced(); } /// @notice Sets the Uniswap router address to use for swapping taxes and adding liquidity. function updateUniswapRouter(address newRouter) external onlyOwner { address oldAddress = address(uniswapV2Router); require(oldAddress != newRouter, "Address already set"); _approve(address(this), oldAddress, 0); _approve(address(this), newRouter, type(uint256).max); uniswapV2Router = IUniswapV2Router02(newRouter); emit UniswapRouterUpdated(newRouter); } /// @notice Sets an address's tax exempt status. function setTaxExempt(address account, bool isExempt) external onlyOwner { require(account != address(this), "Can't change contract"); WalletState memory state = walletStates[account]; state.isExemptFromTax = isExempt; walletStates[account] = state; emit ExcludedFromFeesUpdated(account, isExempt); } /// @notice Toggles if tax is enabled or not. function setTaxEnabled(bool taxStatus_) external onlyOwner { _isTaxEnabled = taxStatus_; emit TaxStatusUpdated(taxStatus_); } /// @notice Set the receiver of platform taxes. function setTaxAddress(address newTaxAddress_) external onlyOwner { taxAddress = newTaxAddress_; emit TaxAddressUpdated(newTaxAddress_); } /// @notice Sets the address that will receive LP tokens from liquidity adds. function setLpAddress(address newLpAddress_) external onlyOwner { lpAddress = newLpAddress_; emit LpAddressUpdated(newLpAddress_); } /// @notice Sets the tax percentages for buy and sell. Can only be called before tax is renounced. /// @dev it sets buyTax to the newBuyTax_ and sellTax to the newSellTax_ /// @param newBuyTax_ new buy tax. Cannot exceed 10. /// @param newSellTax_ new sell tax. Cannot exceed 10. function setTaxAmount( uint8 newBuyTax_, uint8 newSellTax_ ) external onlyOwner { require(_isTaxRenounced == false, "YieldMagnet: Tax is renounced!"); require( newBuyTax_ <= 10 && newSellTax_ <= 10, "YieldMagnet: Tax Should be less then 10!" ); buyTax = newBuyTax_; sellTax = newSellTax_; emit TaxesUpdated(newBuyTax_, newSellTax_); } /// @notice setMarketPair updates the market pair status. Taxes apply from/to market pairs. function setMarketPair(address account, bool value) public onlyOwner { require(account != address(this), "cant change contract"); WalletState memory state = walletStates[account]; state.isMarketPair = value; walletStates[account] = state; emit MarketPairUpdated(account, value); } /// @notice Updates the tax distribution percentage between platform, stakers and liquidity. /// @dev sum of all three percentage must be == 100 for proper distribution. /// @param platformPercentage_ percentage for the platform /// @param stakerPercentage_ percentage for the stakers /// @param lpPercentage_ percentage for the liquidity function setDistributionPercentage( uint8 platformPercentage_, uint8 stakerPercentage_, uint8 lpPercentage_ ) external onlyOwner { require( (platformPercentage_ + stakerPercentage_ + lpPercentage_) == 100, "YieldMagnet: Percentage should sum to 100!" ); platformPercentage = platformPercentage_; stakerPercentage = stakerPercentage_; lpPercentage = lpPercentage_; emit DistributionPercentagesUpdated( platformPercentage_, stakerPercentage_, lpPercentage_ ); } /// @notice Changes the balance threshold for when tax is distributed. /// @dev it sets taxDistributionThreshold to newTaxDistributionThreshold_ also multiply it with the decimals /// @param newTaxDistributionThreshold_ number of whole tokens for the threshold. Decimals are added automatically. function changeTaxDistributionThreshold( uint256 newTaxDistributionThreshold_ ) external onlyOwner { require( newTaxDistributionThreshold_ > 0, "YieldMagnet: Threshold can't be 0" ); taxDistributionThreshold = newTaxDistributionThreshold_ * 10 ** 18; emit DistributionThresholdUpdated(newTaxDistributionThreshold_); } /// @notice Rescue any tokens that are stuck in the contract. function rescueStuckTokens( address tokenAddress_, uint256 amount_ ) external onlyOwner { require(amount_ > 0, "YieldMagnet: amount can't be 0"); IERC20 token = IERC20(tokenAddress_); token.safeTransfer(msg.sender, amount_); } /// @notice Rescues any ETH that are stuck in the contract. function rescueStuckETH(uint256 amount_) external onlyOwner { require(amount_ > 0, "YieldMagnet: amount can't be 0"); (bool success,) = msg.sender.call{value: amount_}(""); require(success, "failed to send eth"); } }
pragma solidity >=0.5.0; 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.6.2; import './IUniswapV2Router01.sol'; 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: 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) (token/ERC20/extensions/ERC20Burnable.sol) pragma solidity ^0.8.20; import {ERC20} from "../ERC20.sol"; import {Context} from "../../../utils/Context.sol"; /** * @dev Extension of {ERC20} that allows token holders to destroy both their own * tokens and those that they have an allowance for, in a way that can be * recognized off-chain (via event analysis). */ abstract contract ERC20Burnable is Context, ERC20 { /** * @dev Destroys a `value` amount of tokens from the caller. * * See {ERC20-_burn}. */ function burn(uint256 value) public virtual { _burn(_msgSender(), value); } /** * @dev Destroys a `value` amount of tokens from `account`, deducting from * the caller's allowance. * * See {ERC20-_burn} and {ERC20-allowance}. * * Requirements: * * - the caller must have allowance for ``accounts``'s tokens of at least * `value`. */ function burnFrom(address account, uint256 value) public virtual { _spendAllowance(account, _msgSender(), value); _burn(account, value); } }
// 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) (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); } } } }
pragma solidity >=0.6.2; 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); }
// 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) (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) (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) (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/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); }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"allowance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"ERC20InsufficientAllowance","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"ERC20InsufficientBalance","type":"error"},{"inputs":[{"internalType":"address","name":"approver","type":"address"}],"name":"ERC20InvalidApprover","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC20InvalidReceiver","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"ERC20InvalidSender","type":"error"},{"inputs":[{"internalType":"address","name":"spender","type":"address"}],"name":"ERC20InvalidSpender","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"platformPercentage","type":"uint8"},{"indexed":false,"internalType":"uint8","name":"stakerPercentage","type":"uint8"},{"indexed":false,"internalType":"uint8","name":"lpPercentage","type":"uint8"}],"name":"DistributionPercentagesUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newThreshold","type":"uint256"}],"name":"DistributionThresholdUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"wallet","type":"address"},{"indexed":false,"internalType":"bool","name":"isExcluded","type":"bool"}],"name":"ExcludedFromFeesUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"ethAmount","type":"uint256"}],"name":"LiquidityAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newLpAddress","type":"address"}],"name":"LpAddressUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"pair","type":"address"},{"indexed":false,"internalType":"bool","name":"isMarketPair","type":"bool"}],"name":"MarketPairUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PlatformTaxDistributed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address[]","name":"stakingContracts","type":"address[]"},{"indexed":false,"internalType":"uint8[]","name":"percentages","type":"uint8[]"}],"name":"StakingContractsUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newTaxAddress","type":"address"}],"name":"TaxAddressUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"platformCut","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"stakersCut","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"liquidityCut","type":"uint256"}],"name":"TaxDistributed","type":"event"},{"anonymous":false,"inputs":[],"name":"TaxRenounced","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"isTaxEnabled","type":"bool"}],"name":"TaxStatusUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"buyTax","type":"uint8"},{"indexed":false,"internalType":"uint8","name":"sellTax","type":"uint8"}],"name":"TaxesUpdated","type":"event"},{"anonymous":false,"inputs":[],"name":"TradingOpen","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newRouter","type":"address"}],"name":"UniswapRouterUpdated","type":"event"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"buyTax","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"newTaxDistributionThreshold_","type":"uint256"}],"name":"changeTaxDistributionThreshold","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"distributeTax","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getStakingContracts","outputs":[{"components":[{"internalType":"address","name":"contractAddress","type":"address"},{"internalType":"uint8","name":"percentage","type":"uint8"}],"internalType":"struct StakingContract[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isTaxEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account_","type":"address"}],"name":"isTaxExempt","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isTaxRenounced","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isTradingOpen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lpAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lpPercentage","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"openTrading","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"platformPercentage","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceTax","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount_","type":"uint256"}],"name":"rescueStuckETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress_","type":"address"},{"internalType":"uint256","name":"amount_","type":"uint256"}],"name":"rescueStuckTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sellTax","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"platformPercentage_","type":"uint8"},{"internalType":"uint8","name":"stakerPercentage_","type":"uint8"},{"internalType":"uint8","name":"lpPercentage_","type":"uint8"}],"name":"setDistributionPercentage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newLpAddress_","type":"address"}],"name":"setLpAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bool","name":"value","type":"bool"}],"name":"setMarketPair","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newTaxAddress_","type":"address"}],"name":"setTaxAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"newBuyTax_","type":"uint8"},{"internalType":"uint8","name":"newSellTax_","type":"uint8"}],"name":"setTaxAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"taxStatus_","type":"bool"}],"name":"setTaxEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bool","name":"isExempt","type":"bool"}],"name":"setTaxExempt","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stakerPercentage","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"taxAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"taxDistributionThreshold","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"uniswapV2Router","outputs":[{"internalType":"contract IUniswapV2Router02","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"stakingContracts_","type":"address[]"},{"internalType":"uint8[]","name":"percentages_","type":"uint8[]"}],"name":"updateStakingContracts","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newRouter","type":"address"}],"name":"updateUniswapRouter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"walletStates","outputs":[{"internalType":"bool","name":"isMarketPair","type":"bool"},{"internalType":"bool","name":"isExemptFromTax","type":"bool"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
6080604052600780546001600160481b03191666010014143c00001790556a0422ca8b0a00a42500000060085534801562000038575f80fd5b50336040518060400160405280600c81526020016b165a595b1908135859db995d60a21b81525060405180604001604052806006815260200165135051d3915560d21b81525081600390816200008f919062000842565b5060046200009e828262000842565b5050506001600160a01b038116620000d057604051631e4fbdf760e01b81525f60048201526024015b60405180910390fd5b620000db8162000405565b50620000f55f336b033b2e3c9fd0803ce800000062000456565b5f737a250d5630b4cf539739df2c5dacb4c659f2488d90505f8190505f816001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200014f573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906200017591906200090e565b6001600160a01b031663c9c6539630846001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015620001c1573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190620001e791906200090e565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303815f875af115801562000232573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906200025891906200090e565b600980546001600160a01b0319166001600160a01b03851617905590506200028330845f1962000585565b6200029081600162000599565b600a8054336001600160a01b03199182168117909255600b8054909116821790556040805180820182525f80825260016020808401828152868452600682529285902093518454935161ffff1990941690151561ff00191617610100931515939093029290921790925582519384528301525f80516020620034bb833981519152910160405180910390a16040805180820182525f8082526001602080840182815230808552600683529386902094518554915161ffff1990921690151561ff0019161761010091151591909102179093558351918252918101919091525f80516020620034bb833981519152910160405180910390a16040805180820182525f808252600160208084018281526001600160a01b038916808552600683529386902094518554915161ffff1990921690151561ff0019161761010091151591909102179093558351918252918101919091525f80516020620034bb833981519152910160405180910390a150505062000963565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b6001600160a01b03831662000484578060025f8282546200047891906200093d565b90915550620004f69050565b6001600160a01b0383165f9081526020819052604090205481811015620004d85760405163391434e360e21b81526001600160a01b03851660048201526024810182905260448101839052606401620000c7565b6001600160a01b0384165f9081526020819052604090209082900390555b6001600160a01b038216620005145760028054829003905562000532565b6001600160a01b0382165f9081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516200057891815260200190565b60405180910390a3505050565b6200059483838360016200069b565b505050565b620005a362000774565b306001600160a01b03831603620005fd5760405162461bcd60e51b815260206004820152601460248201527f63616e74206368616e676520636f6e74726163740000000000000000000000006044820152606401620000c7565b6001600160a01b0382165f81815260066020818152604080842081518083018352815461010080820460ff1615158387019081528a1515808552988a90529686528251965115150261ff00199615159690961661ffff1990911617949094179055805194855290840192909252917f160ff69a72bc70f3e792a86c87d27070e421562197f032d96bcab11c5010222e910160405180910390a1505050565b6001600160a01b038416620006c65760405163e602df0560e01b81525f6004820152602401620000c7565b6001600160a01b038316620006f157604051634a1406b160e11b81525f6004820152602401620000c7565b6001600160a01b038085165f90815260016020908152604080832093871683529290522082905580156200076e57826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516200076591815260200190565b60405180910390a35b50505050565b6005546001600160a01b03163314620007a35760405163118cdaa760e01b8152336004820152602401620000c7565b565b634e487b7160e01b5f52604160045260245ffd5b600181811c90821680620007ce57607f821691505b602082108103620007ed57634e487b7160e01b5f52602260045260245ffd5b50919050565b601f8211156200059457805f5260205f20601f840160051c810160208510156200081a5750805b601f840160051c820191505b818110156200083b575f815560010162000826565b5050505050565b81516001600160401b038111156200085e576200085e620007a5565b62000876816200086f8454620007b9565b84620007f3565b602080601f831160018114620008ac575f8415620008945750858301515b5f19600386901b1c1916600185901b17855562000906565b5f85815260208120601f198616915b82811015620008dc57888601518255948401946001909101908401620008bb565b5085821015620008fa57878501515f19600388901b60f8161c191681555b505060018460011b0185555b505050505050565b5f602082840312156200091f575f80fd5b81516001600160a01b038116811462000936575f80fd5b9392505050565b808201808211156200095d57634e487b7160e01b5f52601160045260245ffd5b92915050565b612b4a80620009715f395ff3fe60806040526004361061024c575f3560e01c80638da5cb5b11610134578063b7bda68f116100b3578063cc2b976c11610078578063cc2b976c14610706578063dad8a03214610726578063dd62ed3e14610747578063e6c1909b1461078b578063f2fde38b146107a9578063fc7ebebd146107c8575f80fd5b8063b7bda68f14610677578063c16dd4a414610696578063c6af580b146106b5578063c9567bf9146106d4578063cc1776d3146106e8575f80fd5b80639b4dc8cc116100f95780639b4dc8cc146105dc578063a1883d26146105fb578063a89d5b2a1461061a578063a9059cbb14610639578063b5998a0614610658575f80fd5b80638da5cb5b1461052a5780638fecae6914610547578063908bb2ae1461055b57806395d89b411461057a57806398962f361461058e575f80fd5b8063313ce567116101cb57806356a060a21161019057806356a060a2146104655780636f5e02121461048557806370a08231146104a4578063715018a6146104d8578063765682a5146104ec5780637957f3e01461050b575f80fd5b8063313ce567146103db5780633f9cfbee146103ee5780633fc16c0c1461040d57806347e30f0f1461042c5780634f7041a51461044c575f80fd5b806318160ddd1161021157806318160ddd146103395780631a425616146103575780631dc610401461036c5780631f7418971461038b57806323b872dd146103bc575f80fd5b806306fdde0314610257578063095ea7b3146102815780630f3d9c9f146102b05780631694505e146102c657806316c2be6b146102fd575f80fd5b3661025357005b5f80fd5b348015610262575f80fd5b5061026b6107e9565b604051610278919061250b565b60405180910390f35b34801561028c575f80fd5b506102a061029b366004612551565b610879565b6040519015158152602001610278565b3480156102bb575f80fd5b506102c4610892565b005b3480156102d1575f80fd5b506009546102e5906001600160a01b031681565b6040516001600160a01b039091168152602001610278565b348015610308575f80fd5b506102a061031736600461257b565b6001600160a01b03165f90815260066020526040902054610100900460ff1690565b348015610344575f80fd5b506002545b604051908152602001610278565b348015610362575f80fd5b5061034960085481565b348015610377575f80fd5b506102c46103863660046125a3565b610a78565b348015610396575f80fd5b506007546103aa9062010000900460ff1681565b60405160ff9091168152602001610278565b3480156103c7575f80fd5b506102a06103d63660046125da565b610b6d565b3480156103e6575f80fd5b5060126103aa565b3480156103f9575f80fd5b506102c4610408366004612618565b610b92565b348015610418575f80fd5b506102c461042736600461271f565b610c77565b348015610437575f80fd5b506007546103aa906301000000900460ff1681565b348015610457575f80fd5b506007546103aa9060ff1681565b348015610470575f80fd5b506007546102a090600160381b900460ff1681565b348015610490575f80fd5b506102c461049f36600461257b565b61101f565b3480156104af575f80fd5b506103496104be36600461257b565b6001600160a01b03165f9081526020819052604090205490565b3480156104e3575f80fd5b506102c461107c565b3480156104f7575f80fd5b506102c46105063660046127db565b61108f565b348015610516575f80fd5b506102c461052536600461280c565b6111c6565b348015610535575f80fd5b506005546001600160a01b03166102e5565b348015610552575f80fd5b506102c46112ce565b348015610566575f80fd5b506102c461057536600461257b565b611317565b348015610585575f80fd5b5061026b6113d9565b348015610599575f80fd5b506105c56105a836600461257b565b60066020525f908152604090205460ff8082169161010090041682565b604080519215158352901515602083015201610278565b3480156105e7575f80fd5b50600b546102e5906001600160a01b031681565b348015610606575f80fd5b506102c461061536600461257b565b6113e8565b348015610625575f80fd5b506102c4610634366004612618565b61143e565b348015610644575f80fd5b506102a0610653366004612551565b6114e4565b348015610663575f80fd5b506102c4610672366004612551565b6114f1565b348015610682575f80fd5b50600a546102e5906001600160a01b031681565b3480156106a1575f80fd5b506102c46106b03660046125a3565b611562565b3480156106c0575f80fd5b506102c46106cf36600461284c565b61164f565b3480156106df575f80fd5b506102c46116a7565b3480156106f3575f80fd5b506007546103aa90610100900460ff1681565b348015610711575f80fd5b5060075465010000000000900460ff166102a0565b348015610731575f80fd5b5061073a611745565b6040516102789190612867565b348015610752575f80fd5b506103496107613660046128c1565b6001600160a01b039182165f90815260016020908152604080832093909416825291909152205490565b348015610796575f80fd5b50600754600160301b900460ff166102a0565b3480156107b4575f80fd5b506102c46107c336600461257b565b6117b9565b3480156107d3575f80fd5b506007546103aa90640100000000900460ff1681565b6060600380546107f8906128ed565b80601f0160208091040260200160405190810160405280929190818152602001828054610824906128ed565b801561086f5780601f106108465761010080835404028352916020019161086f565b820191905f5260205f20905b81548152906001019060200180831161085257829003601f168201915b5050505050905090565b5f336108868185856117f6565b60019150505b92915050565b6007805460ff60401b1916600160401b179055333014806108bd57506005546001600160a01b031633145b6109045760405162461bcd60e51b81526020600482015260136024820152726f776e65722f636f6e7472616374206f6e6c7960681b60448201526064015b60405180910390fd5b305f9081526020819052604081205460075490919060649061092f9062010000900460ff1684612939565b6109399190612950565b6007549091505f90606490610958906301000000900460ff1685612939565b6109629190612950565b6007549091505f9060649061098290640100000000900460ff1686612939565b61098c9190612950565b305f90815260208190526040902054909150816109a9848661296f565b6109b3919061296f565b1115610a115760405162461bcd60e51b815260206004820152602760248201527f5969656c644d61676e65743a2043616e27742064697374726962757465207468604482015266652066756e647360c81b60648201526084016108fb565b610a1a82611803565b610a24838261188a565b60408051848152602081018490529081018290527ffd3bc8cbcb80e2c149c0afd0c43c5481efe524348d615ffb006c32e490f60add9060600160405180910390a150506007805460ff60401b191690555050565b610a80611a38565b306001600160a01b03831603610ad05760405162461bcd60e51b815260206004820152601560248201527410d85b89dd0818da185b99d94818dbdb9d1c9858dd605a1b60448201526064016108fb565b6001600160a01b0382165f81815260066020818152604080842081518083018352815460ff811615158252881515828601818152978990529585528151965115156101000261ff00199715159790971661ffff199091161795909517905580519485529084019190915290917fe4cbcfb1a60e2c589f335f74c6c57b0be57eb6c50eb56442d8a67735dba70cad91015b60405180910390a1505050565b5f33610b7a858285611a65565b610b85858585611ae0565b60019150505b9392505050565b610b9a611a38565b5f8111610be95760405162461bcd60e51b815260206004820152601e60248201527f5969656c644d61676e65743a20616d6f756e742063616e27742062652030000060448201526064016108fb565b6040515f90339083908381818185875af1925050503d805f8114610c28576040519150601f19603f3d011682016040523d82523d5f602084013e610c2d565b606091505b5050905080610c735760405162461bcd60e51b81526020600482015260126024820152710ccc2d2d8cac840e8de40e6cadcc840cae8d60731b60448201526064016108fb565b5050565b610c7f611a38565b8051825114610cf65760405162461bcd60e51b815260206004820152603f60248201527f5969656c644d61676e65743a204e6f206f66206164647265737320616e64204e60448201527f6f206f662050657263656e746167657320646f65736e2774206d61746368210060648201526084016108fb565b600a82511115610d5f5760405162461bcd60e51b815260206004820152602e60248201527f5969656c644d61676e65743a204d6178203130207374616b696e6720636f6e7460448201526d726163747320616c6c6f7765642160901b60648201526084016108fb565b610d6a600c5f6124b0565b5f805b8351811015610f85575f838281518110610d8957610d89612982565b602002602001015160ff1610158015610dbf57506064838281518110610db157610db1612982565b602002602001015160ff1611155b610e285760405162461bcd60e51b815260206004820152603460248201527f5969656c644d61676e65743a2070657263656e746167652073686f756c64206260448201527365206265747765656e20203020746f203130302160601b60648201526084016108fb565b5f6001600160a01b0316848281518110610e4457610e44612982565b60200260200101516001600160a01b031603610eb75760405162461bcd60e51b815260206004820152602c60248201527f5969656c644d61676e65743a205374616b696e6720636f6e7472616374206d6160448201526b079206e6f74206265203078360a41b60648201526084016108fb565b600c6040518060400160405280868481518110610ed657610ed6612982565b60200260200101516001600160a01b03168152602001858481518110610efe57610efe612982565b60209081029190910181015160ff90811690925283546001810185555f948552938190208351940180549390910151909116600160a01b026001600160a81b03199092166001600160a01b03909316929092171790558251839082908110610f6857610f68612982565b602002602001015182610f7b9190612996565b9150600101610d6d565b508060ff16606414610fee5760405162461bcd60e51b815260206004820152602c60248201527f5969656c644d61676e65743a20546f74616c2050657263656e7461676520736860448201526b37bab632103132901898181760a11b60648201526084016108fb565b7fa2a4d80ab12a039dfb7e05de1b8ae37a3db49a98d9476aae11e3898513b999998383604051610b609291906129f2565b611027611a38565b600b80546001600160a01b0319166001600160a01b0383169081179091556040519081527f81633f85afc8dc8573ddb012d0e43fa48cd7ffe95f106b9dff15376f34f77aec906020015b60405180910390a150565b611084611a38565b61108d5f611b3d565b565b611097611a38565b60075465010000000000900460ff16156110f35760405162461bcd60e51b815260206004820152601e60248201527f5969656c644d61676e65743a205461782069732072656e6f756e63656421000060448201526064016108fb565b600a8260ff161115801561110b5750600a8160ff1611155b6111685760405162461bcd60e51b815260206004820152602860248201527f5969656c644d61676e65743a205461782053686f756c64206265206c657373206044820152677468656e2031302160c01b60648201526084016108fb565b6007805460ff84811661ffff199092168217610100918516918202179092556040805191825260208201929092527f0d211fd62d1f720ff6d62d0ba7033ce4b592fb609b9579ee24b947c5bbe2e13f91015b60405180910390a15050565b6111ce611a38565b806111d98385612996565b6111e39190612996565b60ff166064146112485760405162461bcd60e51b815260206004820152602a60248201527f5969656c644d61676e65743a2050657263656e746167652073686f756c642073604482015269756d20746f203130302160b01b60648201526084016108fb565b6007805463ffff000019166201000060ff86811691820263ff00000019169290921763010000008684169081029190911764ff00000000191664010000000093861693840217909355604080519182526020820193909352918201527f3ffa57fb974c33bbb764b7f7ab54e4f17e801de986a52b04284e054d7c7e026f90606001610b60565b6112d6611a38565b6007805465ff00000000001916650100000000001790556040517f7fd247c16eb04b80fe08395ad1b812b3cc5fb21905986ceece7d2f2fde913541905f90a1565b61131f611a38565b6009546001600160a01b0390811690821681036113745760405162461bcd60e51b81526020600482015260136024820152721059191c995cdcc8185b1c9958591e481cd95d606a1b60448201526064016108fb565b61137f30825f6117f6565b61138b30835f196117f6565b600980546001600160a01b0319166001600160a01b0384169081179091556040519081527f455a5e52b7c01aa52d717db42e17b6610b0c2c96560c85b7e5adcdd254bfc17c906020016111ba565b6060600480546107f8906128ed565b6113f0611a38565b600a80546001600160a01b0319166001600160a01b0383169081179091556040519081527ffa575a2937f4d8860715335c80a51e975f276f15a8717f4ad9d5ad153d3011ce90602001611071565b611446611a38565b5f811161149f5760405162461bcd60e51b815260206004820152602160248201527f5969656c644d61676e65743a205468726573686f6c642063616e2774206265206044820152600360fc1b60648201526084016108fb565b6114b181670de0b6b3a7640000612939565b6008556040518181527f864e12506dcc59e84111281e695dd1b19dc5271daf1cd2a249708a115ba224e690602001611071565b5f33610886818585611ae0565b6114f9611a38565b5f81116115485760405162461bcd60e51b815260206004820152601e60248201527f5969656c644d61676e65743a20616d6f756e742063616e27742062652030000060448201526064016108fb565b8161155d6001600160a01b0382163384611b8e565b505050565b61156a611a38565b306001600160a01b038316036115b95760405162461bcd60e51b815260206004820152601460248201527318d85b9d0818da185b99d94818dbdb9d1c9858dd60621b60448201526064016108fb565b6001600160a01b0382165f81815260066020818152604080842081518083018352815461010080820460ff1615158387019081528a1515808552988a90529686528251965115150261ff00199615159690961661ffff1990911617949094179055805194855290840192909252917f160ff69a72bc70f3e792a86c87d27070e421562197f032d96bcab11c5010222e9101610b60565b611657611a38565b60078054821515600160301b0266ff000000000000199091161790556040517ffcee2f8a7deb8619b3bf35fc6bb132f28f41cb8e3a2a2758ecc1e051fa0ce7169061107190831515815260200190565b6116af611a38565b600754600160381b900460ff16156117005760405162461bcd60e51b81526020600482015260146024820152732a3930b234b7339030b63932b0b23c9037b832b760611b60448201526064016108fb565b6007805467ff0000000000ffff1916670100000000000a0a1790556040517f08fd3d05bd9c1e39a2044b0a4e2fed4621113adaeeae8fc57e9f4a06777ecf07905f90a1565b6060600c805480602002602001604051908101604052809291908181526020015f905b828210156117b0575f84815260209081902060408051808201909152908401546001600160a01b0381168252600160a01b900460ff1681830152825260019092019101611768565b50505050905090565b6117c1611a38565b6001600160a01b0381166117ea57604051631e4fbdf760e01b81525f60048201526024016108fb565b6117f381611b3d565b50565b61155d8383836001611be0565b5f5b600c54811015610c73575f600c828154811061182357611823612982565b5f9182526020808320604080518082019091529201546001600160a01b0381168352600160a01b900460ff16908201819052909250606490611866908690612939565b6118709190612950565b905061188030835f015183611cb2565b5050600101611805565b476118b583600161189c600286612950565b6118a69190612a4a565b6118b0919061296f565b611dd8565b8115611943575f6118c68247612a4a565b90505f6118d3858561296f565b6118dd8584612939565b6118e79190612950565b90506118fd6118f7600286612950565b82611f8e565b7f38f8a0c92f4c5b0b6877f878cb4c0c8d348a47b76d716c8e78f425043df9515b611929600286612950565b60408051918252602082018490520160405180910390a150505b600a5460405147915f916001600160a01b039091169083908381818185875af1925050503d805f8114611991576040519150601f19603f3d011682016040523d82523d5f602084013e611996565b606091505b50509050806119fe5760405162461bcd60e51b815260206004820152602e60248201527f5969656c644d61676e65743a204661696c656420746f2073656e64204554482060448201526d746f20746178206164647265737360901b60648201526084016108fb565b6040518281527fcc479326940dbeabc56141d9670d6fb0433ec9e11a86ef148c7c9a075dc24a349060200160405180910390a15050505050565b6005546001600160a01b0316331461108d5760405163118cdaa760e01b81523360048201526024016108fb565b6001600160a01b038381165f908152600160209081526040808320938616835292905220545f198114611ada5781811015611acc57604051637dc7a0d960e11b81526001600160a01b038416600482015260248101829052604481018390526064016108fb565b611ada84848484035f611be0565b50505050565b6001600160a01b038316611b0957604051634b637e8f60e11b81525f60048201526024016108fb565b6001600160a01b038216611b325760405163ec442f0560e01b81525f60048201526024016108fb565b61155d838383612027565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b17905261155d90849061234d565b6001600160a01b038416611c095760405163e602df0560e01b81525f60048201526024016108fb565b6001600160a01b038316611c3257604051634a1406b160e11b81525f60048201526024016108fb565b6001600160a01b038085165f9081526001602090815260408083209387168352929052208290558015611ada57826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051611ca491815260200190565b60405180910390a350505050565b6001600160a01b038316611cdc578060025f828254611cd1919061296f565b90915550611d4c9050565b6001600160a01b0383165f9081526020819052604090205481811015611d2e5760405163391434e360e21b81526001600160a01b038516600482015260248101829052604481018390526064016108fb565b6001600160a01b0384165f9081526020819052604090209082900390555b6001600160a01b038216611d6857600280548290039055611d86565b6001600160a01b0382165f9081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051611dcb91815260200190565b60405180910390a3505050565b6040805160028082526060820183525f9260208301908036833701905050905030815f81518110611e0b57611e0b612982565b6001600160a01b03928316602091820292909201810191909152600954604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611e62573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611e869190612a5d565b81600181518110611e9957611e99612982565b60200260200101906001600160a01b031690816001600160a01b0316815250505f8211611f255760405162461bcd60e51b815260206004820152603460248201527f5969656c644d61676e65743a20546f6b656e20616d6f756e74206c6573732074604482015273068656e203020666f7220746f6b656e20737761760641b60648201526084016108fb565b60095460405163791ac94760e01b81526001600160a01b039091169063791ac94790611f5d9085905f90869030904290600401612a78565b5f604051808303815f87803b158015611f74575f80fd5b505af1158015611f86573d5f803e3d5ffd5b505050505050565b600954600b5460405163f305d71960e01b8152306004820152602481018590525f6044820181905260648201526001600160a01b0391821660848201524260a482015291169063f305d71990839060c40160606040518083038185885af1158015611ffb573d5f803e3d5ffd5b50505050506040513d601f19601f820116820180604052508101906120209190612ab3565b5050505050565b6001600160a01b0383165f908152602081905260409020548181101561209e5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016108fb565b6001600160a01b038085165f90815260066020818152604080842081518083018352905460ff808216151583526101009182900481161515838601908152978b168752948452828620835180850190945254808616151584520490931615159181019190915292519092919080612116575081602001515b90505f835f015180612126575082515b156121a557600754600160381b900460ff168061214d57506005546001600160a01b031633145b8061216257506005546001600160a01b031632145b6121a55760405162461bcd60e51b8152602060048201526014602482015273151c98591a5b99c81b9bdd081bdc195b881e595d60621b60448201526064016108fb565b835180156121b1575081155b80156121c65750600754600160301b900460ff165b156121ef576007546064906121de9060ff1688612939565b6121e89190612950565b9050612230565b825180156121fb575081155b80156122105750600754600160301b900460ff165b1561222d576007546064906121de90610100900460ff1688612939565b505f5b600854305f908152602081905260409020541180156122595750600754600160401b900460ff16155b801561226457508351155b80156122735750825115156001145b156122f657306001600160a01b0316630f3d9c9f6040518163ffffffff1660e01b81526004015f604051808303815f87803b1580156122b0575f80fd5b505af19250505080156122c1575060015b6122f6573d8080156122ee576040519150601f19603f3d011682016040523d82523d5f602084013e6122f3565b606091505b50505b801580159061230f5750600754600160401b900460ff16155b15612338576123288888612323848a612a4a565b611cb2565b612333883083611cb2565b612343565b612343888888611cb2565b5050505050505050565b5f6123616001600160a01b038416836123ae565b905080515f141580156123855750808060200190518101906123839190612ade565b155b1561155d57604051635274afe760e01b81526001600160a01b03841660048201526024016108fb565b6060610b8b83835f845f80856001600160a01b031684866040516123d29190612af9565b5f6040518083038185875af1925050503d805f811461240c576040519150601f19603f3d011682016040523d82523d5f602084013e612411565b606091505b509150915061242186838361242b565b9695505050505050565b6060826124405761243b82612487565b610b8b565b815115801561245757506001600160a01b0384163b155b1561248057604051639996b31560e01b81526001600160a01b03851660048201526024016108fb565b5080610b8b565b8051156124975780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b5080545f8255905f5260205f20908101906117f391905b808211156124e55780546001600160a81b03191681556001016124c7565b5090565b5f5b838110156125035781810151838201526020016124eb565b50505f910152565b602081525f82518060208401526125298160408501602087016124e9565b601f01601f19169190910160400192915050565b6001600160a01b03811681146117f3575f80fd5b5f8060408385031215612562575f80fd5b823561256d8161253d565b946020939093013593505050565b5f6020828403121561258b575f80fd5b8135610b8b8161253d565b80151581146117f3575f80fd5b5f80604083850312156125b4575f80fd5b82356125bf8161253d565b915060208301356125cf81612596565b809150509250929050565b5f805f606084860312156125ec575f80fd5b83356125f78161253d565b925060208401356126078161253d565b929592945050506040919091013590565b5f60208284031215612628575f80fd5b5035919050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561266c5761266c61262f565b604052919050565b5f67ffffffffffffffff82111561268d5761268d61262f565b5060051b60200190565b803560ff811681146126a7575f80fd5b919050565b5f82601f8301126126bb575f80fd5b813560206126d06126cb83612674565b612643565b8083825260208201915060208460051b8701019350868411156126f1575f80fd5b602086015b848110156127145761270781612697565b83529183019183016126f6565b509695505050505050565b5f8060408385031215612730575f80fd5b823567ffffffffffffffff80821115612747575f80fd5b818501915085601f83011261275a575f80fd5b8135602061276a6126cb83612674565b82815260059290921b84018101918181019089841115612788575f80fd5b948201945b838610156127af5785356127a08161253d565b8252948201949082019061278d565b965050860135925050808211156127c4575f80fd5b506127d1858286016126ac565b9150509250929050565b5f80604083850312156127ec575f80fd5b6127f583612697565b915061280360208401612697565b90509250929050565b5f805f6060848603121561281e575f80fd5b61282784612697565b925061283560208501612697565b915061284360408501612697565b90509250925092565b5f6020828403121561285c575f80fd5b8135610b8b81612596565b602080825282518282018190525f919060409081850190868401855b828110156128b457815180516001600160a01b0316855286015160ff16868501529284019290850190600101612883565b5091979650505050505050565b5f80604083850312156128d2575f80fd5b82356128dd8161253d565b915060208301356125cf8161253d565b600181811c9082168061290157607f821691505b60208210810361291f57634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52601160045260245ffd5b808202811582820484141761088c5761088c612925565b5f8261296a57634e487b7160e01b5f52601260045260245ffd5b500490565b8082018082111561088c5761088c612925565b634e487b7160e01b5f52603260045260245ffd5b60ff818116838216019081111561088c5761088c612925565b5f815180845260208085019450602084015f5b838110156129e75781516001600160a01b0316875295820195908201906001016129c2565b509495945050505050565b604081525f612a0460408301856129af565b8281036020848101919091528451808352858201928201905f5b81811015612a3d57845160ff1683529383019391830191600101612a1e565b5090979650505050505050565b8181038181111561088c5761088c612925565b5f60208284031215612a6d575f80fd5b8151610b8b8161253d565b85815284602082015260a060408201525f612a9660a08301866129af565b6001600160a01b0394909416606083015250608001529392505050565b5f805f60608486031215612ac5575f80fd5b8351925060208401519150604084015190509250925092565b5f60208284031215612aee575f80fd5b8151610b8b81612596565b5f8251612b0a8184602087016124e9565b919091019291505056fea264697066735822122018d0142424a413472c9d56de097cb3c2c370fe7a51a56efd4ae43f7f8380016764736f6c63430008160033e4cbcfb1a60e2c589f335f74c6c57b0be57eb6c50eb56442d8a67735dba70cad
Deployed Bytecode
0x60806040526004361061024c575f3560e01c80638da5cb5b11610134578063b7bda68f116100b3578063cc2b976c11610078578063cc2b976c14610706578063dad8a03214610726578063dd62ed3e14610747578063e6c1909b1461078b578063f2fde38b146107a9578063fc7ebebd146107c8575f80fd5b8063b7bda68f14610677578063c16dd4a414610696578063c6af580b146106b5578063c9567bf9146106d4578063cc1776d3146106e8575f80fd5b80639b4dc8cc116100f95780639b4dc8cc146105dc578063a1883d26146105fb578063a89d5b2a1461061a578063a9059cbb14610639578063b5998a0614610658575f80fd5b80638da5cb5b1461052a5780638fecae6914610547578063908bb2ae1461055b57806395d89b411461057a57806398962f361461058e575f80fd5b8063313ce567116101cb57806356a060a21161019057806356a060a2146104655780636f5e02121461048557806370a08231146104a4578063715018a6146104d8578063765682a5146104ec5780637957f3e01461050b575f80fd5b8063313ce567146103db5780633f9cfbee146103ee5780633fc16c0c1461040d57806347e30f0f1461042c5780634f7041a51461044c575f80fd5b806318160ddd1161021157806318160ddd146103395780631a425616146103575780631dc610401461036c5780631f7418971461038b57806323b872dd146103bc575f80fd5b806306fdde0314610257578063095ea7b3146102815780630f3d9c9f146102b05780631694505e146102c657806316c2be6b146102fd575f80fd5b3661025357005b5f80fd5b348015610262575f80fd5b5061026b6107e9565b604051610278919061250b565b60405180910390f35b34801561028c575f80fd5b506102a061029b366004612551565b610879565b6040519015158152602001610278565b3480156102bb575f80fd5b506102c4610892565b005b3480156102d1575f80fd5b506009546102e5906001600160a01b031681565b6040516001600160a01b039091168152602001610278565b348015610308575f80fd5b506102a061031736600461257b565b6001600160a01b03165f90815260066020526040902054610100900460ff1690565b348015610344575f80fd5b506002545b604051908152602001610278565b348015610362575f80fd5b5061034960085481565b348015610377575f80fd5b506102c46103863660046125a3565b610a78565b348015610396575f80fd5b506007546103aa9062010000900460ff1681565b60405160ff9091168152602001610278565b3480156103c7575f80fd5b506102a06103d63660046125da565b610b6d565b3480156103e6575f80fd5b5060126103aa565b3480156103f9575f80fd5b506102c4610408366004612618565b610b92565b348015610418575f80fd5b506102c461042736600461271f565b610c77565b348015610437575f80fd5b506007546103aa906301000000900460ff1681565b348015610457575f80fd5b506007546103aa9060ff1681565b348015610470575f80fd5b506007546102a090600160381b900460ff1681565b348015610490575f80fd5b506102c461049f36600461257b565b61101f565b3480156104af575f80fd5b506103496104be36600461257b565b6001600160a01b03165f9081526020819052604090205490565b3480156104e3575f80fd5b506102c461107c565b3480156104f7575f80fd5b506102c46105063660046127db565b61108f565b348015610516575f80fd5b506102c461052536600461280c565b6111c6565b348015610535575f80fd5b506005546001600160a01b03166102e5565b348015610552575f80fd5b506102c46112ce565b348015610566575f80fd5b506102c461057536600461257b565b611317565b348015610585575f80fd5b5061026b6113d9565b348015610599575f80fd5b506105c56105a836600461257b565b60066020525f908152604090205460ff8082169161010090041682565b604080519215158352901515602083015201610278565b3480156105e7575f80fd5b50600b546102e5906001600160a01b031681565b348015610606575f80fd5b506102c461061536600461257b565b6113e8565b348015610625575f80fd5b506102c4610634366004612618565b61143e565b348015610644575f80fd5b506102a0610653366004612551565b6114e4565b348015610663575f80fd5b506102c4610672366004612551565b6114f1565b348015610682575f80fd5b50600a546102e5906001600160a01b031681565b3480156106a1575f80fd5b506102c46106b03660046125a3565b611562565b3480156106c0575f80fd5b506102c46106cf36600461284c565b61164f565b3480156106df575f80fd5b506102c46116a7565b3480156106f3575f80fd5b506007546103aa90610100900460ff1681565b348015610711575f80fd5b5060075465010000000000900460ff166102a0565b348015610731575f80fd5b5061073a611745565b6040516102789190612867565b348015610752575f80fd5b506103496107613660046128c1565b6001600160a01b039182165f90815260016020908152604080832093909416825291909152205490565b348015610796575f80fd5b50600754600160301b900460ff166102a0565b3480156107b4575f80fd5b506102c46107c336600461257b565b6117b9565b3480156107d3575f80fd5b506007546103aa90640100000000900460ff1681565b6060600380546107f8906128ed565b80601f0160208091040260200160405190810160405280929190818152602001828054610824906128ed565b801561086f5780601f106108465761010080835404028352916020019161086f565b820191905f5260205f20905b81548152906001019060200180831161085257829003601f168201915b5050505050905090565b5f336108868185856117f6565b60019150505b92915050565b6007805460ff60401b1916600160401b179055333014806108bd57506005546001600160a01b031633145b6109045760405162461bcd60e51b81526020600482015260136024820152726f776e65722f636f6e7472616374206f6e6c7960681b60448201526064015b60405180910390fd5b305f9081526020819052604081205460075490919060649061092f9062010000900460ff1684612939565b6109399190612950565b6007549091505f90606490610958906301000000900460ff1685612939565b6109629190612950565b6007549091505f9060649061098290640100000000900460ff1686612939565b61098c9190612950565b305f90815260208190526040902054909150816109a9848661296f565b6109b3919061296f565b1115610a115760405162461bcd60e51b815260206004820152602760248201527f5969656c644d61676e65743a2043616e27742064697374726962757465207468604482015266652066756e647360c81b60648201526084016108fb565b610a1a82611803565b610a24838261188a565b60408051848152602081018490529081018290527ffd3bc8cbcb80e2c149c0afd0c43c5481efe524348d615ffb006c32e490f60add9060600160405180910390a150506007805460ff60401b191690555050565b610a80611a38565b306001600160a01b03831603610ad05760405162461bcd60e51b815260206004820152601560248201527410d85b89dd0818da185b99d94818dbdb9d1c9858dd605a1b60448201526064016108fb565b6001600160a01b0382165f81815260066020818152604080842081518083018352815460ff811615158252881515828601818152978990529585528151965115156101000261ff00199715159790971661ffff199091161795909517905580519485529084019190915290917fe4cbcfb1a60e2c589f335f74c6c57b0be57eb6c50eb56442d8a67735dba70cad91015b60405180910390a1505050565b5f33610b7a858285611a65565b610b85858585611ae0565b60019150505b9392505050565b610b9a611a38565b5f8111610be95760405162461bcd60e51b815260206004820152601e60248201527f5969656c644d61676e65743a20616d6f756e742063616e27742062652030000060448201526064016108fb565b6040515f90339083908381818185875af1925050503d805f8114610c28576040519150601f19603f3d011682016040523d82523d5f602084013e610c2d565b606091505b5050905080610c735760405162461bcd60e51b81526020600482015260126024820152710ccc2d2d8cac840e8de40e6cadcc840cae8d60731b60448201526064016108fb565b5050565b610c7f611a38565b8051825114610cf65760405162461bcd60e51b815260206004820152603f60248201527f5969656c644d61676e65743a204e6f206f66206164647265737320616e64204e60448201527f6f206f662050657263656e746167657320646f65736e2774206d61746368210060648201526084016108fb565b600a82511115610d5f5760405162461bcd60e51b815260206004820152602e60248201527f5969656c644d61676e65743a204d6178203130207374616b696e6720636f6e7460448201526d726163747320616c6c6f7765642160901b60648201526084016108fb565b610d6a600c5f6124b0565b5f805b8351811015610f85575f838281518110610d8957610d89612982565b602002602001015160ff1610158015610dbf57506064838281518110610db157610db1612982565b602002602001015160ff1611155b610e285760405162461bcd60e51b815260206004820152603460248201527f5969656c644d61676e65743a2070657263656e746167652073686f756c64206260448201527365206265747765656e20203020746f203130302160601b60648201526084016108fb565b5f6001600160a01b0316848281518110610e4457610e44612982565b60200260200101516001600160a01b031603610eb75760405162461bcd60e51b815260206004820152602c60248201527f5969656c644d61676e65743a205374616b696e6720636f6e7472616374206d6160448201526b079206e6f74206265203078360a41b60648201526084016108fb565b600c6040518060400160405280868481518110610ed657610ed6612982565b60200260200101516001600160a01b03168152602001858481518110610efe57610efe612982565b60209081029190910181015160ff90811690925283546001810185555f948552938190208351940180549390910151909116600160a01b026001600160a81b03199092166001600160a01b03909316929092171790558251839082908110610f6857610f68612982565b602002602001015182610f7b9190612996565b9150600101610d6d565b508060ff16606414610fee5760405162461bcd60e51b815260206004820152602c60248201527f5969656c644d61676e65743a20546f74616c2050657263656e7461676520736860448201526b37bab632103132901898181760a11b60648201526084016108fb565b7fa2a4d80ab12a039dfb7e05de1b8ae37a3db49a98d9476aae11e3898513b999998383604051610b609291906129f2565b611027611a38565b600b80546001600160a01b0319166001600160a01b0383169081179091556040519081527f81633f85afc8dc8573ddb012d0e43fa48cd7ffe95f106b9dff15376f34f77aec906020015b60405180910390a150565b611084611a38565b61108d5f611b3d565b565b611097611a38565b60075465010000000000900460ff16156110f35760405162461bcd60e51b815260206004820152601e60248201527f5969656c644d61676e65743a205461782069732072656e6f756e63656421000060448201526064016108fb565b600a8260ff161115801561110b5750600a8160ff1611155b6111685760405162461bcd60e51b815260206004820152602860248201527f5969656c644d61676e65743a205461782053686f756c64206265206c657373206044820152677468656e2031302160c01b60648201526084016108fb565b6007805460ff84811661ffff199092168217610100918516918202179092556040805191825260208201929092527f0d211fd62d1f720ff6d62d0ba7033ce4b592fb609b9579ee24b947c5bbe2e13f91015b60405180910390a15050565b6111ce611a38565b806111d98385612996565b6111e39190612996565b60ff166064146112485760405162461bcd60e51b815260206004820152602a60248201527f5969656c644d61676e65743a2050657263656e746167652073686f756c642073604482015269756d20746f203130302160b01b60648201526084016108fb565b6007805463ffff000019166201000060ff86811691820263ff00000019169290921763010000008684169081029190911764ff00000000191664010000000093861693840217909355604080519182526020820193909352918201527f3ffa57fb974c33bbb764b7f7ab54e4f17e801de986a52b04284e054d7c7e026f90606001610b60565b6112d6611a38565b6007805465ff00000000001916650100000000001790556040517f7fd247c16eb04b80fe08395ad1b812b3cc5fb21905986ceece7d2f2fde913541905f90a1565b61131f611a38565b6009546001600160a01b0390811690821681036113745760405162461bcd60e51b81526020600482015260136024820152721059191c995cdcc8185b1c9958591e481cd95d606a1b60448201526064016108fb565b61137f30825f6117f6565b61138b30835f196117f6565b600980546001600160a01b0319166001600160a01b0384169081179091556040519081527f455a5e52b7c01aa52d717db42e17b6610b0c2c96560c85b7e5adcdd254bfc17c906020016111ba565b6060600480546107f8906128ed565b6113f0611a38565b600a80546001600160a01b0319166001600160a01b0383169081179091556040519081527ffa575a2937f4d8860715335c80a51e975f276f15a8717f4ad9d5ad153d3011ce90602001611071565b611446611a38565b5f811161149f5760405162461bcd60e51b815260206004820152602160248201527f5969656c644d61676e65743a205468726573686f6c642063616e2774206265206044820152600360fc1b60648201526084016108fb565b6114b181670de0b6b3a7640000612939565b6008556040518181527f864e12506dcc59e84111281e695dd1b19dc5271daf1cd2a249708a115ba224e690602001611071565b5f33610886818585611ae0565b6114f9611a38565b5f81116115485760405162461bcd60e51b815260206004820152601e60248201527f5969656c644d61676e65743a20616d6f756e742063616e27742062652030000060448201526064016108fb565b8161155d6001600160a01b0382163384611b8e565b505050565b61156a611a38565b306001600160a01b038316036115b95760405162461bcd60e51b815260206004820152601460248201527318d85b9d0818da185b99d94818dbdb9d1c9858dd60621b60448201526064016108fb565b6001600160a01b0382165f81815260066020818152604080842081518083018352815461010080820460ff1615158387019081528a1515808552988a90529686528251965115150261ff00199615159690961661ffff1990911617949094179055805194855290840192909252917f160ff69a72bc70f3e792a86c87d27070e421562197f032d96bcab11c5010222e9101610b60565b611657611a38565b60078054821515600160301b0266ff000000000000199091161790556040517ffcee2f8a7deb8619b3bf35fc6bb132f28f41cb8e3a2a2758ecc1e051fa0ce7169061107190831515815260200190565b6116af611a38565b600754600160381b900460ff16156117005760405162461bcd60e51b81526020600482015260146024820152732a3930b234b7339030b63932b0b23c9037b832b760611b60448201526064016108fb565b6007805467ff0000000000ffff1916670100000000000a0a1790556040517f08fd3d05bd9c1e39a2044b0a4e2fed4621113adaeeae8fc57e9f4a06777ecf07905f90a1565b6060600c805480602002602001604051908101604052809291908181526020015f905b828210156117b0575f84815260209081902060408051808201909152908401546001600160a01b0381168252600160a01b900460ff1681830152825260019092019101611768565b50505050905090565b6117c1611a38565b6001600160a01b0381166117ea57604051631e4fbdf760e01b81525f60048201526024016108fb565b6117f381611b3d565b50565b61155d8383836001611be0565b5f5b600c54811015610c73575f600c828154811061182357611823612982565b5f9182526020808320604080518082019091529201546001600160a01b0381168352600160a01b900460ff16908201819052909250606490611866908690612939565b6118709190612950565b905061188030835f015183611cb2565b5050600101611805565b476118b583600161189c600286612950565b6118a69190612a4a565b6118b0919061296f565b611dd8565b8115611943575f6118c68247612a4a565b90505f6118d3858561296f565b6118dd8584612939565b6118e79190612950565b90506118fd6118f7600286612950565b82611f8e565b7f38f8a0c92f4c5b0b6877f878cb4c0c8d348a47b76d716c8e78f425043df9515b611929600286612950565b60408051918252602082018490520160405180910390a150505b600a5460405147915f916001600160a01b039091169083908381818185875af1925050503d805f8114611991576040519150601f19603f3d011682016040523d82523d5f602084013e611996565b606091505b50509050806119fe5760405162461bcd60e51b815260206004820152602e60248201527f5969656c644d61676e65743a204661696c656420746f2073656e64204554482060448201526d746f20746178206164647265737360901b60648201526084016108fb565b6040518281527fcc479326940dbeabc56141d9670d6fb0433ec9e11a86ef148c7c9a075dc24a349060200160405180910390a15050505050565b6005546001600160a01b0316331461108d5760405163118cdaa760e01b81523360048201526024016108fb565b6001600160a01b038381165f908152600160209081526040808320938616835292905220545f198114611ada5781811015611acc57604051637dc7a0d960e11b81526001600160a01b038416600482015260248101829052604481018390526064016108fb565b611ada84848484035f611be0565b50505050565b6001600160a01b038316611b0957604051634b637e8f60e11b81525f60048201526024016108fb565b6001600160a01b038216611b325760405163ec442f0560e01b81525f60048201526024016108fb565b61155d838383612027565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b17905261155d90849061234d565b6001600160a01b038416611c095760405163e602df0560e01b81525f60048201526024016108fb565b6001600160a01b038316611c3257604051634a1406b160e11b81525f60048201526024016108fb565b6001600160a01b038085165f9081526001602090815260408083209387168352929052208290558015611ada57826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051611ca491815260200190565b60405180910390a350505050565b6001600160a01b038316611cdc578060025f828254611cd1919061296f565b90915550611d4c9050565b6001600160a01b0383165f9081526020819052604090205481811015611d2e5760405163391434e360e21b81526001600160a01b038516600482015260248101829052604481018390526064016108fb565b6001600160a01b0384165f9081526020819052604090209082900390555b6001600160a01b038216611d6857600280548290039055611d86565b6001600160a01b0382165f9081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051611dcb91815260200190565b60405180910390a3505050565b6040805160028082526060820183525f9260208301908036833701905050905030815f81518110611e0b57611e0b612982565b6001600160a01b03928316602091820292909201810191909152600954604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611e62573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611e869190612a5d565b81600181518110611e9957611e99612982565b60200260200101906001600160a01b031690816001600160a01b0316815250505f8211611f255760405162461bcd60e51b815260206004820152603460248201527f5969656c644d61676e65743a20546f6b656e20616d6f756e74206c6573732074604482015273068656e203020666f7220746f6b656e20737761760641b60648201526084016108fb565b60095460405163791ac94760e01b81526001600160a01b039091169063791ac94790611f5d9085905f90869030904290600401612a78565b5f604051808303815f87803b158015611f74575f80fd5b505af1158015611f86573d5f803e3d5ffd5b505050505050565b600954600b5460405163f305d71960e01b8152306004820152602481018590525f6044820181905260648201526001600160a01b0391821660848201524260a482015291169063f305d71990839060c40160606040518083038185885af1158015611ffb573d5f803e3d5ffd5b50505050506040513d601f19601f820116820180604052508101906120209190612ab3565b5050505050565b6001600160a01b0383165f908152602081905260409020548181101561209e5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016108fb565b6001600160a01b038085165f90815260066020818152604080842081518083018352905460ff808216151583526101009182900481161515838601908152978b168752948452828620835180850190945254808616151584520490931615159181019190915292519092919080612116575081602001515b90505f835f015180612126575082515b156121a557600754600160381b900460ff168061214d57506005546001600160a01b031633145b8061216257506005546001600160a01b031632145b6121a55760405162461bcd60e51b8152602060048201526014602482015273151c98591a5b99c81b9bdd081bdc195b881e595d60621b60448201526064016108fb565b835180156121b1575081155b80156121c65750600754600160301b900460ff165b156121ef576007546064906121de9060ff1688612939565b6121e89190612950565b9050612230565b825180156121fb575081155b80156122105750600754600160301b900460ff165b1561222d576007546064906121de90610100900460ff1688612939565b505f5b600854305f908152602081905260409020541180156122595750600754600160401b900460ff16155b801561226457508351155b80156122735750825115156001145b156122f657306001600160a01b0316630f3d9c9f6040518163ffffffff1660e01b81526004015f604051808303815f87803b1580156122b0575f80fd5b505af19250505080156122c1575060015b6122f6573d8080156122ee576040519150601f19603f3d011682016040523d82523d5f602084013e6122f3565b606091505b50505b801580159061230f5750600754600160401b900460ff16155b15612338576123288888612323848a612a4a565b611cb2565b612333883083611cb2565b612343565b612343888888611cb2565b5050505050505050565b5f6123616001600160a01b038416836123ae565b905080515f141580156123855750808060200190518101906123839190612ade565b155b1561155d57604051635274afe760e01b81526001600160a01b03841660048201526024016108fb565b6060610b8b83835f845f80856001600160a01b031684866040516123d29190612af9565b5f6040518083038185875af1925050503d805f811461240c576040519150601f19603f3d011682016040523d82523d5f602084013e612411565b606091505b509150915061242186838361242b565b9695505050505050565b6060826124405761243b82612487565b610b8b565b815115801561245757506001600160a01b0384163b155b1561248057604051639996b31560e01b81526001600160a01b03851660048201526024016108fb565b5080610b8b565b8051156124975780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b5080545f8255905f5260205f20908101906117f391905b808211156124e55780546001600160a81b03191681556001016124c7565b5090565b5f5b838110156125035781810151838201526020016124eb565b50505f910152565b602081525f82518060208401526125298160408501602087016124e9565b601f01601f19169190910160400192915050565b6001600160a01b03811681146117f3575f80fd5b5f8060408385031215612562575f80fd5b823561256d8161253d565b946020939093013593505050565b5f6020828403121561258b575f80fd5b8135610b8b8161253d565b80151581146117f3575f80fd5b5f80604083850312156125b4575f80fd5b82356125bf8161253d565b915060208301356125cf81612596565b809150509250929050565b5f805f606084860312156125ec575f80fd5b83356125f78161253d565b925060208401356126078161253d565b929592945050506040919091013590565b5f60208284031215612628575f80fd5b5035919050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561266c5761266c61262f565b604052919050565b5f67ffffffffffffffff82111561268d5761268d61262f565b5060051b60200190565b803560ff811681146126a7575f80fd5b919050565b5f82601f8301126126bb575f80fd5b813560206126d06126cb83612674565b612643565b8083825260208201915060208460051b8701019350868411156126f1575f80fd5b602086015b848110156127145761270781612697565b83529183019183016126f6565b509695505050505050565b5f8060408385031215612730575f80fd5b823567ffffffffffffffff80821115612747575f80fd5b818501915085601f83011261275a575f80fd5b8135602061276a6126cb83612674565b82815260059290921b84018101918181019089841115612788575f80fd5b948201945b838610156127af5785356127a08161253d565b8252948201949082019061278d565b965050860135925050808211156127c4575f80fd5b506127d1858286016126ac565b9150509250929050565b5f80604083850312156127ec575f80fd5b6127f583612697565b915061280360208401612697565b90509250929050565b5f805f6060848603121561281e575f80fd5b61282784612697565b925061283560208501612697565b915061284360408501612697565b90509250925092565b5f6020828403121561285c575f80fd5b8135610b8b81612596565b602080825282518282018190525f919060409081850190868401855b828110156128b457815180516001600160a01b0316855286015160ff16868501529284019290850190600101612883565b5091979650505050505050565b5f80604083850312156128d2575f80fd5b82356128dd8161253d565b915060208301356125cf8161253d565b600181811c9082168061290157607f821691505b60208210810361291f57634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52601160045260245ffd5b808202811582820484141761088c5761088c612925565b5f8261296a57634e487b7160e01b5f52601260045260245ffd5b500490565b8082018082111561088c5761088c612925565b634e487b7160e01b5f52603260045260245ffd5b60ff818116838216019081111561088c5761088c612925565b5f815180845260208085019450602084015f5b838110156129e75781516001600160a01b0316875295820195908201906001016129c2565b509495945050505050565b604081525f612a0460408301856129af565b8281036020848101919091528451808352858201928201905f5b81811015612a3d57845160ff1683529383019391830191600101612a1e565b5090979650505050505050565b8181038181111561088c5761088c612925565b5f60208284031215612a6d575f80fd5b8151610b8b8161253d565b85815284602082015260a060408201525f612a9660a08301866129af565b6001600160a01b0394909416606083015250608001529392505050565b5f805f60608486031215612ac5575f80fd5b8351925060208401519150604084015190509250925092565b5f60208284031215612aee575f80fd5b8151610b8b81612596565b5f8251612b0a8184602087016124e9565b919091019291505056fea264697066735822122018d0142424a413472c9d56de097cb3c2c370fe7a51a56efd4ae43f7f8380016764736f6c63430008160033
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.