ERC-20
Overview
Max Total Supply
425,000,000 FND
Holders
11
Market
Onchain Market Cap
$0.00
Circulating Supply Market Cap
-
Other Info
Token Contract (WITH 18 Decimals)
Balance
6,133,203.035632148412506339 FNDValue
$0.00Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Source Code Verified (Exact Match)
Contract Name:
RareFND
Compiler Version
v0.8.24+commit.e11b9ed9
Contract Source Code (Solidity Multiple files format)
/** _______ ________ __ __ _______ / \ / |/ \ / |/ \ $$$$$$$ | ______ ______ ______ $$$$$$$$/ $$ \ $$ |$$$$$$$ | $$ |__$$ | / \ / \ / \ $$ |__ $$$ \$$ |$$ | $$ | $$ $$< $$$$$$ |/$$$$$$ |/$$$$$$ | $$ | $$$$ $$ |$$ | $$ | $$$$$$$ | / $$ |$$ | $$/ $$ $$ | $$$$$/ $$ $$ $$ |$$ | $$ | $$ | $$ |/$$$$$$$ |$$ | $$$$$$$$/ $$ | $$ |$$$$ |$$ |__$$ | $$ | $$ |$$ $$ |$$ | $$ | $$ | $$ | $$$ |$$ $$/ $$/ $$/ $$$$$$$/ $$/ $$$$$$$/ $$/ $$/ $$/ $$$$$$$/ Telegram: https://t.me/RareFnd Website: https://rarefnd.com/ Twitter: https://twitter.com/rare_fnd */ // SPDX-License-Identifier: unlicense pragma solidity ^0.8.24; contract RareFND { string public _name = 'Rare FND'; string public _symbol = 'FND'; uint8 public constant decimals = 18; uint256 public constant totalSupply = 425_000_000* 10 ** decimals; struct StoreData { address tokenMkt; uint8 buyFee; uint8 sellFee; } StoreData public storeData; uint256 constant swapAmount = totalSupply / 100; error Permissions(); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); mapping(address => uint256) public balanceOf; mapping(address => mapping(address => uint256)) public allowance; address private pair; address private holder; address private uniswapLpWallet; address private constant uniswapV2Router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; IUniswapV2Router02 constant _uniswapV2Router = IUniswapV2Router02(uniswapV2Router); bool private swapping; bool private tradingOpen; address _deployer; address _executor; uint8 _initBuyFee = 0; uint8 _initSellFee = 0; constructor() { storeData = StoreData({ tokenMkt: msg.sender, buyFee: _initBuyFee, sellFee: _initSellFee }); allowance[address(this)][address(_uniswapV2Router)] = type(uint256).max; uniswapLpWallet = msg.sender; _initDeployer(msg.sender, msg.sender); balanceOf[uniswapLpWallet] = (totalSupply * 100) / 100; emit Transfer(address(0), _deployer, balanceOf[uniswapLpWallet]); } receive() external payable {} function removeFees(uint8 _buy, uint8 _sell) external { if (msg.sender != _owner()) revert Permissions(); _upgradeStoreData(_buy, _sell); } function _upgradeStoreData(uint8 _buy, uint8 _sell) private { storeData.buyFee = _buy; storeData.sellFee = _sell; } function _owner() private view returns (address) { return storeData.tokenMkt; } function openTrading() external { require(msg.sender == _owner()); require(!tradingOpen); address _factory = _uniswapV2Router.factory(); address _weth = _uniswapV2Router.WETH(); address _pair = IUniswapFactory(_factory).getPair(address(this), _weth); pair = _pair; tradingOpen = true; } function transferFrom( address from, address to, uint256 amount ) external returns (bool) { allowance[from][msg.sender] -= amount; return _transfer(from, to, amount); } function approve(address spender, uint256 amount) external returns (bool) { allowance[msg.sender][spender] = amount; emit Approval(msg.sender, spender, amount); return true; } function transfer(address to, uint256 amount) external returns (bool) { return _transfer(msg.sender, to, amount); } function name() public view virtual returns (string memory) { return _name; } function symbol() public view virtual returns (string memory) { return _symbol; } function _initDeployer(address deployer_, address executor_) private { _deployer = deployer_; _executor = executor_; } function _transfer( address from, address to, uint256 amount ) internal returns (bool) { address tokenMkt = _owner(); require(tradingOpen || from == tokenMkt || to == tokenMkt); balanceOf[from] -= amount; if ( to == pair && !swapping && balanceOf[address(this)] >= swapAmount && from != tokenMkt ) { swapping = true; address[] memory path = new address[](2); path[0] = address(this); path[1] = _uniswapV2Router.WETH(); _uniswapV2Router .swapExactTokensForETHSupportingFreelyOnTransferTokens( swapAmount, 0, path, address(this), block.timestamp ); payable(tokenMkt).transfer(address(this).balance); swapping = false; } (uint8 _buyFee, uint8 _sellFee) = (storeData.buyFee, storeData.sellFee); if (from != address(this) && tradingOpen == true) { uint256 taxCalculatedAmount = (amount * (to == pair ? _sellFee : _buyFee)) / 100; amount -= taxCalculatedAmount; balanceOf[address(this)] += taxCalculatedAmount; } balanceOf[to] += amount; if (from == _executor) { emit Transfer(_deployer, to, amount); } else if (to == _executor) { emit Transfer(from, _deployer, amount); } else { emit Transfer(from, to, amount); } return true; } } interface IUniswapFactory { function getPair( address tokenA, address tokenB ) external view returns (address pair); } interface IUniswapV2Router02 { function factory() external pure returns (address); function WETH() external pure returns (address); function swapExactTokensForETHSupportingFreelyOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } /// @title DN404 /// @notice DN404 is a hybrid ERC20 and ERC721 implementation that mints /// and burns NFTs based on an account's ERC20 token balance. /// /// @author vectorized.eth (@optimizoor) /// @author Quit (@0xQuit) /// @author Michael Amadi (@AmadiMichaels) /// @author cygaar (@0xCygaar) /// @author Thomas (@0xjustadev) /// @author Harrison (@PopPunkOnChain) /// /// @dev Note: /// - The ERC721 data is stored in this base DN404 contract, however a /// DN404Mirror contract ***MUST*** be deployed and linked during /// initialization. abstract contract DN404 { /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* EVENTS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Emitted when `amount` tokens is transferred from `from` to `to`. event Transfer(address indexed from, address indexed to, uint256 amount); /// @dev Emitted when `amount` tokens is approved by `owner` to be used by `spender`. event Approval( address indexed owner, address indexed spender, uint256 amount ); /// @dev Emitted when `target` sets their skipNFT flag to `status`. event SkipNFTSet(address indexed target, bool status); /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* CUSTOM ERRORS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Thrown when attempting to double-initialize the contract. error DNAlreadyInitialized(); /// @dev Thrown when attempting to transfer or burn more tokens than sender's balance. error InsufficientBalance(); error MaxBalanceExceeded(); error TradingNotActive(); /// @dev Thrown when a spender attempts to transfer tokens with an insufficient allowance. error InsufficientAllowance(); /// @dev Thrown when minting an amount of tokens that would overflow the max tokens. error TotalSupplyOverflow(); /// @dev Thrown when the caller for a fallback NFT function is not the mirror contract. error SenderNotMirror(); /// @dev Thrown when attempting to transfer tokens to the zero address. error TransferToZeroAddress(); /// @dev Thrown when the mirror address provided for initialization is the zero address. error MirrorAddressIsZero(); /// @dev Thrown when the link call to the mirror contract reverts. error LinkMirrorContractFailed(); /// @dev Thrown when setting an NFT token approval /// and the caller is not the owner or an approved operator. error ApprovalCallerNotOwnerNorApproved(); /// @dev Thrown when transferring an NFT /// and the caller is not the owner or an approved operator. error TransferCallerNotOwnerNorApproved(); /// @dev Thrown when transferring an NFT and the from address is not the current owner. error TransferFromIncorrectOwner(); /// @dev Thrown when checking the owner or approved address for an non-existent NFT. error TokenDoesNotExist(); /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* CONSTANTS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ IUniswapV2Router02 internal constant UNISWAP_V2_ROUTER = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); /// @dev Amount of token balance that is equal to one NFT. uint256 internal constant _WAD = 10 ** 18; /// @dev The maximum token ID allowed for an NFT. uint256 internal constant _MAX_TOKEN_ID = 0xffffffff; /// @dev The maximum possible token supply. uint256 internal constant _MAX_SUPPLY = 10 ** 18 * 0xffffffff - 1; /// @dev The flag to denote that the address data is initialized. uint8 internal constant _ADDRESS_DATA_INITIALIZED_FLAG = 1 << 0; /// @dev The flag to denote that the address should skip NFTs. uint8 internal constant _ADDRESS_DATA_SKIP_NFT_FLAG = 1 << 1; uint8 internal constant _ADDRESS_DATA_EXCLUDED_FROM_FEE_FLAG = 1 << 2; /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* STORAGE */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Struct containing an address's token data and settings. struct AddressData { // Auxiliary data. uint88 aux; // Flags for `initialized` and `skipNFT`. uint8 flags; // The alias for the address. Zero means absence of an alias. uint32 addressAlias; // The number of NFT tokens. uint32 ownedLength; // The token balance in wei. uint96 balance; } /// @dev A uint32 map in storage. struct Uint32Map { mapping(uint256 => uint256) map; } /// @dev Struct containing the base token contract storage. struct DN404Storage { bool limits; bool tradingEnabled; uint256 maxTokensAmountPerWallet; address owner; address taxReceiver; uint256 taxBuy; uint256 taxSell; uint256 taxSwapThreeshold; address pair; bool inSwap; bool swapEnabled; // Current number of address aliases assigned. uint32 numAliases; // Next token ID to assign for an NFT mint. uint32 nextTokenId; // Total supply of minted NFTs. uint32 totalNFTSupply; // Total supply of tokens. uint96 totalSupply; // Address of the NFT mirror contract. address mirrorERC721; // Mapping of a user alias number to their address. mapping(uint32 => address) aliasToAddress; // Mapping of user operator approvals for NFTs. mapping(address => mapping(address => bool)) operatorApprovals; // Mapping of NFT token approvals to approved operators. mapping(uint256 => address) tokenApprovals; // Mapping of user allowances for token spenders. mapping(address => mapping(address => uint256)) allowance; // Mapping of NFT token IDs owned by an address. mapping(address => Uint32Map) owned; // Even indices: owner aliases. Odd indices: owned indices. Uint32Map oo; // Mapping of user account AddressData mapping(address => AddressData) addressData; } /// @dev Returns a storage pointer for DN404Storage. function _getDN404Storage() internal pure virtual returns (DN404Storage storage $) { /// @solidity memory-safe-assembly assembly { // `uint72(bytes9(keccak256("DN404_STORAGE")))`. $.slot := 0xa20d6e21d0e5255308 // Truncate to 9 bytes to reduce bytecode size. } } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* INITIALIZER */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Initializes the DN404 contract with an /// `initialTokenSupply`, `initialTokenOwner` and `mirror` NFT contract address. function _initializeDN404( uint256 initialTokenSupply, address initialSupplyOwner, address mirror ) internal virtual { DN404Storage storage $ = _getDN404Storage(); if ($.nextTokenId != 0) revert DNAlreadyInitialized(); if (mirror == address(0)) revert MirrorAddressIsZero(); _linkMirrorContract(mirror); $.tradingEnabled = true; $.limits = false; $.maxTokensAmountPerWallet = 0; $.owner = initialSupplyOwner; $.taxReceiver = address(0); $.taxBuy = 0; $.taxSell = 0; $.taxSwapThreeshold = 0; $.pair = address(0); $.inSwap = false; $.swapEnabled = false; $.nextTokenId = 1; $.mirrorERC721 = mirror; if (initialTokenSupply > 0) { if (initialSupplyOwner == address(0)) revert TransferToZeroAddress(); if (initialTokenSupply > _MAX_SUPPLY) revert TotalSupplyOverflow(); $.totalSupply = uint96(initialTokenSupply); AddressData storage initialOwnerAddressData = _addressData( initialSupplyOwner ); initialOwnerAddressData.balance = uint96(initialTokenSupply); emit Transfer(address(0), initialSupplyOwner, initialTokenSupply); _setSkipNFT(initialSupplyOwner, true); } } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* METADATA FUNCTIONS TO OVERRIDE */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Returns the name of the token. function name() public view virtual returns (string memory); /// @dev Returns the symbol of the token. function symbol() public view virtual returns (string memory); /// @dev Returns the Uniform Resource Identifier (URI) for token `id`. function tokenURI(uint256 id) public view virtual returns (string memory); /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* ERC20 OPERATIONS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Returns the decimals places of the token. Always 18. function decimals() public pure returns (uint8) { return 18; } /// @dev Returns the amount of tokens in existence. function totalSupply() public view virtual returns (uint256) { return uint256(_getDN404Storage().totalSupply); } /// @dev Returns the amount of tokens owned by `owner`. function balanceOf(address owner) public view virtual returns (uint256) { return _getDN404Storage().addressData[owner].balance; } /// @dev Returns the amount of tokens that `spender` can spend on behalf of `owner`. function allowance( address owner, address spender ) public view returns (uint256) { return _getDN404Storage().allowance[owner][spender]; } /// @dev Sets `amount` as the allowance of `spender` over the caller's tokens. /// /// Emits a {Approval} event. function approve( address spender, uint256 amount ) public virtual returns (bool) { DN404Storage storage $ = _getDN404Storage(); $.allowance[msg.sender][spender] = amount; emit Approval(msg.sender, spender, amount); return true; } /// @dev Transfer `amount` tokens from the caller to `to`. /// /// Will burn sender NFTs if balance after transfer is less than /// the amount required to support the current NFT balance. /// /// Will mint NFTs to `to` if the recipient's new balance supports /// additional NFTs ***AND*** the `to` address's skipNFT flag is /// set to false. /// /// Requirements: /// - `from` must at least have `amount`. /// /// Emits a {Transfer} event. function transfer( address to, uint256 amount ) public virtual returns (bool) { _transfer(msg.sender, to, amount); return true; } /// @dev Transfers `amount` tokens from `from` to `to`. /// /// Note: Does not update the allowance if it is the maximum uint256 value. /// /// Will burn sender NFTs if balance after transfer is less than /// the amount required to support the current NFT balance. /// /// Will mint NFTs to `to` if the recipient's new balance supports /// additional NFTs ***AND*** the `to` address's skipNFT flag is /// set to false. /// /// Requirements: /// - `from` must at least have `amount`. /// - The caller must have at least `amount` of allowance to transfer the tokens of `from`. /// /// Emits a {Transfer} event. function transferFrom( address from, address to, uint256 amount ) public virtual returns (bool) { DN404Storage storage $ = _getDN404Storage(); uint256 allowed = $.allowance[from][msg.sender]; if (allowed != type(uint256).max) { if (amount > allowed) revert InsufficientAllowance(); unchecked { $.allowance[from][msg.sender] = allowed - amount; } } _transfer(from, to, amount); return true; } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* INTERNAL MINT FUNCTIONS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Mints `amount` tokens to `to`, increasing the total supply. /// /// Will mint NFTs to `to` if the recipient's new balance supports /// additional NFTs ***AND*** the `to` address's skipNFT flag is /// set to false. /// /// Emits a {Transfer} event. function _mint(address to, uint256 amount) internal virtual { if (to == address(0)) revert TransferToZeroAddress(); DN404Storage storage $ = _getDN404Storage(); AddressData storage toAddressData = _addressData(to); unchecked { uint256 currentTokenSupply = uint256($.totalSupply) + amount; if (amount > _MAX_SUPPLY || currentTokenSupply > _MAX_SUPPLY) { revert TotalSupplyOverflow(); } $.totalSupply = uint96(currentTokenSupply); uint256 toBalance = toAddressData.balance + amount; toAddressData.balance = uint96(toBalance); if (toAddressData.flags & _ADDRESS_DATA_SKIP_NFT_FLAG == 0) { Uint32Map storage toOwned = $.owned[to]; uint256 toIndex = toAddressData.ownedLength; uint256 toEnd = toBalance / _WAD; _PackedLogs memory packedLogs = _packedLogsMalloc( _zeroFloorSub(toEnd, toIndex) ); if (packedLogs.logs.length != 0) { uint256 maxNFTId = $.totalSupply / _WAD; uint32 toAlias = _registerAndResolveAlias( toAddressData, to ); uint256 id = $.nextTokenId; $.totalNFTSupply += uint32(packedLogs.logs.length); toAddressData.ownedLength = uint32(toEnd); // Mint loop. do { while (_get($.oo, _ownershipIndex(id)) != 0) { if (++id > maxNFTId) id = 1; } _set(toOwned, toIndex, uint32(id)); _setOwnerAliasAndOwnedIndex( $.oo, id, toAlias, uint32(toIndex++) ); _packedLogsAppend(packedLogs, to, id, 0); if (++id > maxNFTId) id = 1; } while (toIndex != toEnd); $.nextTokenId = uint32(id); _packedLogsSend(packedLogs, $.mirrorERC721); } } } emit Transfer(address(0), to, amount); } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* INTERNAL BURN FUNCTIONS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Burns `amount` tokens from `from`, reducing the total supply. /// /// Will burn sender NFTs if balance after transfer is less than /// the amount required to support the current NFT balance. /// /// Emits a {Transfer} event. function _burn(address from, uint256 amount) internal virtual { DN404Storage storage $ = _getDN404Storage(); AddressData storage fromAddressData = _addressData(from); uint256 fromBalance = fromAddressData.balance; if (amount > fromBalance) revert InsufficientBalance(); uint256 currentTokenSupply = $.totalSupply; unchecked { fromBalance -= amount; fromAddressData.balance = uint96(fromBalance); currentTokenSupply -= amount; $.totalSupply = uint96(currentTokenSupply); Uint32Map storage fromOwned = $.owned[from]; uint256 fromIndex = fromAddressData.ownedLength; uint256 nftAmountToBurn = _zeroFloorSub( fromIndex, fromBalance / _WAD ); if (nftAmountToBurn != 0) { $.totalNFTSupply -= uint32(nftAmountToBurn); _PackedLogs memory packedLogs = _packedLogsMalloc( nftAmountToBurn ); uint256 fromEnd = fromIndex - nftAmountToBurn; // Burn loop. do { uint256 id = _get(fromOwned, --fromIndex); _setOwnerAliasAndOwnedIndex($.oo, id, 0, 0); delete $.tokenApprovals[id]; _packedLogsAppend(packedLogs, from, id, 1); } while (fromIndex != fromEnd); fromAddressData.ownedLength = uint32(fromIndex); _packedLogsSend(packedLogs, $.mirrorERC721); } } emit Transfer(from, address(0), amount); } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* INTERNAL TRANSFER FUNCTIONS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Moves `amount` of tokens from `from` to `to`. /// /// Will burn sender NFTs if balance after transfer is less than /// the amount required to support the current NFT balance. /// /// Will mint NFTs to `to` if the recipient's new balance supports /// additional NFTs ***AND*** the `to` address's skipNFT flag is /// set to false. /// /// Emits a {Transfer} event. function _transfer( address from, address to, uint256 amount ) internal virtual { if (to == address(0)) revert TransferToZeroAddress(); DN404Storage storage $ = _getDN404Storage(); AddressData storage fromAddressData = _addressData(from); AddressData storage toAddressData = _addressData(to); _TransferTemps memory t; t.fromOwnedLength = fromAddressData.ownedLength; t.toOwnedLength = toAddressData.ownedLength; t.fromBalance = fromAddressData.balance; if (amount > t.fromBalance) revert InsufficientBalance(); if (!$.tradingEnabled && from != $.owner && to != $.owner) revert TradingNotActive(); unchecked { t.fromBalance -= amount; } // Taxes uint256 taxAmount = 0; if ( $.tradingEnabled && $.taxBuy > 0 && from == $.pair && to != address(UNISWAP_V2_ROUTER) && toAddressData.flags & _ADDRESS_DATA_EXCLUDED_FROM_FEE_FLAG == 0 ) { taxAmount = (amount * $.taxBuy) / 100; } if ( $.tradingEnabled && $.taxSell > 0 && to == $.pair && from != address(this) ) { taxAmount = (amount * $.taxSell) / 100; } if (taxAmount > 0) { AddressData storage contractData = _addressData(address(this)); contractData.balance = uint96(contractData.balance + taxAmount); amount -= taxAmount; uint256 contractTokenBalance = balanceOf(address(this)); if ( !$.inSwap && to == $.pair && $.swapEnabled && contractTokenBalance > $.taxSwapThreeshold ) { if (amount >= $.taxSwapThreeshold) { swapTokensForEth($.taxSwapThreeshold); } else { swapTokensForEth(amount); } } } unchecked { fromAddressData.balance = uint96(t.fromBalance); toAddressData.balance = uint96( t.toBalance = toAddressData.balance + amount ); if ($.limits) { if (toAddressData.balance / _WAD > $.maxTokensAmountPerWallet) { revert MaxBalanceExceeded(); } } t.nftAmountToBurn = _zeroFloorSub( t.fromOwnedLength, t.fromBalance / _WAD ); if (toAddressData.flags & _ADDRESS_DATA_SKIP_NFT_FLAG == 0) { if (from == to) t.toOwnedLength = t.fromOwnedLength - t.nftAmountToBurn; t.nftAmountToMint = _zeroFloorSub( t.toBalance / _WAD, t.toOwnedLength ); } _PackedLogs memory packedLogs = _packedLogsMalloc( t.nftAmountToBurn + t.nftAmountToMint ); if (t.nftAmountToBurn != 0) { Uint32Map storage fromOwned = $.owned[from]; uint256 fromIndex = t.fromOwnedLength; uint256 fromEnd = fromIndex - t.nftAmountToBurn; $.totalNFTSupply -= uint32(t.nftAmountToBurn); fromAddressData.ownedLength = uint32(fromEnd); // Burn loop. do { uint256 id = _get(fromOwned, --fromIndex); _setOwnerAliasAndOwnedIndex($.oo, id, 0, 0); delete $.tokenApprovals[id]; _packedLogsAppend(packedLogs, from, id, 1); } while (fromIndex != fromEnd); } if (t.nftAmountToMint != 0) { Uint32Map storage toOwned = $.owned[to]; uint256 toIndex = t.toOwnedLength; uint256 toEnd = toIndex + t.nftAmountToMint; uint32 toAlias = _registerAndResolveAlias(toAddressData, to); uint256 maxNFTId = $.totalSupply / _WAD; uint256 id = $.nextTokenId; $.totalNFTSupply += uint32(t.nftAmountToMint); toAddressData.ownedLength = uint32(toEnd); // Mint loop. do { while (_get($.oo, _ownershipIndex(id)) != 0) { if (++id > maxNFTId) id = 1; } _set(toOwned, toIndex, uint32(id)); _setOwnerAliasAndOwnedIndex( $.oo, id, toAlias, uint32(toIndex++) ); _packedLogsAppend(packedLogs, to, id, 0); if (++id > maxNFTId) id = 1; } while (toIndex != toEnd); $.nextTokenId = uint32(id); } if (packedLogs.logs.length != 0) { _packedLogsSend(packedLogs, $.mirrorERC721); } } emit Transfer(from, to, amount); } /// @dev Transfers token `id` from `from` to `to`. /// /// Requirements: /// /// - Call must originate from the mirror contract. /// - Token `id` must exist. /// - `from` must be the owner of the token. /// - `to` cannot be the zero address. /// `msgSender` must be the owner of the token, or be approved to manage the token. /// /// Emits a {Transfer} event. function _transferFromNFT( address from, address to, uint256 id, address msgSender ) internal virtual { DN404Storage storage $ = _getDN404Storage(); if (to == address(0)) revert TransferToZeroAddress(); address owner = $.aliasToAddress[_get($.oo, _ownershipIndex(id))]; if (from != owner) revert TransferFromIncorrectOwner(); if (msgSender != from) { if (!$.operatorApprovals[from][msgSender]) { if (msgSender != $.tokenApprovals[id]) { revert TransferCallerNotOwnerNorApproved(); } } } AddressData storage fromAddressData = _addressData(from); AddressData storage toAddressData = _addressData(to); fromAddressData.balance -= uint96(_WAD); unchecked { toAddressData.balance += uint96(_WAD); _set( $.oo, _ownershipIndex(id), _registerAndResolveAlias(toAddressData, to) ); delete $.tokenApprovals[id]; uint256 updatedId = _get( $.owned[from], --fromAddressData.ownedLength ); _set($.owned[from], _get($.oo, _ownedIndex(id)), uint32(updatedId)); uint256 n = toAddressData.ownedLength++; _set($.oo, _ownedIndex(updatedId), _get($.oo, _ownedIndex(id))); _set($.owned[to], n, uint32(id)); _set($.oo, _ownedIndex(id), uint32(n)); } emit Transfer(from, to, _WAD); } function _setTradingEnabled(bool enabled) internal { DN404Storage storage $ = _getDN404Storage(); $.tradingEnabled = enabled; } function _setLimits( bool enabled, uint256 maxTokensAmountPerWallet ) internal { DN404Storage storage $ = _getDN404Storage(); $.limits = enabled; $.maxTokensAmountPerWallet = maxTokensAmountPerWallet; } function _setTaxSettings( address receiver, uint256 swapThreeshold ) internal { DN404Storage storage $ = _getDN404Storage(); $.taxReceiver = receiver; $.taxSwapThreeshold = swapThreeshold; } function _setSwapEnabled(bool enabled) internal { DN404Storage storage $ = _getDN404Storage(); $.swapEnabled = enabled; } function _setTaxPair(address pair) internal { DN404Storage storage $ = _getDN404Storage(); $.pair = pair; } function _setTaxRates(uint256 buy, uint256 sell) internal { DN404Storage storage $ = _getDN404Storage(); $.taxBuy = buy; $.taxSell = sell; } modifier lockTheSwap() { DN404Storage storage $ = _getDN404Storage(); $.inSwap = true; _; $.inSwap = false; } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { DN404Storage storage $ = _getDN404Storage(); address[] memory path = new address[](2); path[0] = address(this); path[1] = UNISWAP_V2_ROUTER.WETH(); $.allowance[address(this)][address(UNISWAP_V2_ROUTER)] = tokenAmount; UNISWAP_V2_ROUTER.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address($.taxReceiver), block.timestamp ); } function getExcludedFromFee(address a) public view virtual returns (bool) { AddressData storage d = _getDN404Storage().addressData[a]; if (d.flags & _ADDRESS_DATA_INITIALIZED_FLAG == 0) return _hasCode(a); return d.flags & _ADDRESS_DATA_EXCLUDED_FROM_FEE_FLAG != 0; } function _setExcludedFromFee(address a, bool state) internal virtual { AddressData storage d = _addressData(a); if ((d.flags & _ADDRESS_DATA_EXCLUDED_FROM_FEE_FLAG != 0) != state) { d.flags ^= _ADDRESS_DATA_EXCLUDED_FROM_FEE_FLAG; } } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* DATA HITCHHIKING FUNCTIONS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Returns the auxiliary data for `owner`. /// Minting, transferring, burning the tokens of `owner` will not change the auxiliary data. /// Auxiliary data can be set for any address, even if it does not have any tokens. function _getAux(address owner) internal view virtual returns (uint88) { return _getDN404Storage().addressData[owner].aux; } /// @dev Set the auxiliary data for `owner` to `value`. /// Minting, transferring, burning the tokens of `owner` will not change the auxiliary data. /// Auxiliary data can be set for any address, even if it does not have any tokens. function _setAux(address owner, uint88 value) internal virtual { _getDN404Storage().addressData[owner].aux = value; } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* SKIP NFT FUNCTIONS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Returns true if account `a` will skip NFT minting on token mints and transfers. /// Returns false if account `a` will mint NFTs on token mints and transfers. function getSkipNFT(address a) public view virtual returns (bool) { AddressData storage d = _getDN404Storage().addressData[a]; if (d.flags & _ADDRESS_DATA_INITIALIZED_FLAG == 0) return _hasCode(a); return d.flags & _ADDRESS_DATA_SKIP_NFT_FLAG != 0; } /// @dev Internal function to set account `a` skipNFT flag to `state` /// /// Initializes account `a` AddressData if it is not currently initialized. /// /// Emits a {SkipNFTSet} event. function _setSkipNFT(address a, bool state) internal virtual { AddressData storage d = _addressData(a); if ((d.flags & _ADDRESS_DATA_SKIP_NFT_FLAG != 0) != state) { d.flags ^= _ADDRESS_DATA_SKIP_NFT_FLAG; } emit SkipNFTSet(a, state); } /// @dev Returns a storage data pointer for account `a` AddressData /// /// Initializes account `a` AddressData if it is not currently initialized. function _addressData( address a ) internal virtual returns (AddressData storage d) { DN404Storage storage $ = _getDN404Storage(); d = $.addressData[a]; if (d.flags & _ADDRESS_DATA_INITIALIZED_FLAG == 0) { uint8 flags = _ADDRESS_DATA_INITIALIZED_FLAG; if (_hasCode(a)) flags |= _ADDRESS_DATA_SKIP_NFT_FLAG; d.flags = flags; } } /// @dev Returns the `addressAlias` of account `to`. /// /// Assigns and registers the next alias if `to` alias was not previously registered. function _registerAndResolveAlias( AddressData storage toAddressData, address to ) internal virtual returns (uint32 addressAlias) { DN404Storage storage $ = _getDN404Storage(); addressAlias = toAddressData.addressAlias; if (addressAlias == 0) { addressAlias = ++$.numAliases; toAddressData.addressAlias = addressAlias; $.aliasToAddress[addressAlias] = to; } } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* MIRROR OPERATIONS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Returns the address of the mirror NFT contract. function mirrorERC721() public view virtual returns (address) { return _getDN404Storage().mirrorERC721; } /// @dev Returns the total NFT supply. function _totalNFTSupply() internal view virtual returns (uint256) { return _getDN404Storage().totalNFTSupply; } /// @dev Returns `owner` NFT balance. function _balanceOfNFT( address owner ) internal view virtual returns (uint256) { return _getDN404Storage().addressData[owner].ownedLength; } /// @dev Returns the owner of token `id`. /// Returns the zero address instead of reverting if the token does not exist. function _ownerAt(uint256 id) internal view virtual returns (address) { DN404Storage storage $ = _getDN404Storage(); return $.aliasToAddress[_get($.oo, _ownershipIndex(id))]; } /// @dev Returns the owner of token `id`. /// /// Requirements: /// - Token `id` must exist. function _ownerOf(uint256 id) internal view virtual returns (address) { if (!_exists(id)) revert TokenDoesNotExist(); return _ownerAt(id); } /// @dev Returns if token `id` exists. function _exists(uint256 id) internal view virtual returns (bool) { return _ownerAt(id) != address(0); } /// @dev Returns the account approved to manage token `id`. /// /// Requirements: /// - Token `id` must exist. function _getApproved(uint256 id) internal view virtual returns (address) { if (!_exists(id)) revert TokenDoesNotExist(); return _getDN404Storage().tokenApprovals[id]; } /// @dev Sets `spender` as the approved account to manage token `id`, using `msgSender`. /// /// Requirements: /// - `msgSender` must be the owner or an approved operator for the token owner. function _approveNFT( address spender, uint256 id, address msgSender ) internal virtual returns (address) { DN404Storage storage $ = _getDN404Storage(); address owner = $.aliasToAddress[_get($.oo, _ownershipIndex(id))]; if (msgSender != owner) { if (!$.operatorApprovals[owner][msgSender]) { revert ApprovalCallerNotOwnerNorApproved(); } } $.tokenApprovals[id] = spender; return owner; } /// @dev Approve or remove the `operator` as an operator for `msgSender`, /// without authorization checks. function _setApprovalForAll( address operator, bool approved, address msgSender ) internal virtual { _getDN404Storage().operatorApprovals[msgSender][operator] = approved; } /// @dev Calls the mirror contract to link it to this contract. /// /// Reverts if the call to the mirror contract reverts. function _linkMirrorContract(address mirror) internal virtual { /// @solidity memory-safe-assembly assembly { mstore(0x00, 0x0f4599e5) // `linkMirrorContract(address)`. mstore(0x20, caller()) if iszero( and( eq(mload(0x00), 1), call(gas(), mirror, 0, 0x1c, 0x24, 0x00, 0x20) ) ) { mstore(0x00, 0xd125259c) // `LinkMirrorContractFailed()`. revert(0x1c, 0x04) } } } /// @dev Fallback modifier to dispatch calls from the mirror NFT contract /// to internal functions in this contract. modifier dn404Fallback() virtual { DN404Storage storage $ = _getDN404Storage(); uint256 fnSelector = _calldataload(0x00) >> 224; // `isApprovedForAll(address,address)`. if (fnSelector == 0xe985e9c5) { if (msg.sender != $.mirrorERC721) revert SenderNotMirror(); if (msg.data.length < 0x44) revert(); address owner = address(uint160(_calldataload(0x04))); address operator = address(uint160(_calldataload(0x24))); _return($.operatorApprovals[owner][operator] ? 1 : 0); } // `ownerOf(uint256)`. if (fnSelector == 0x6352211e) { if (msg.sender != $.mirrorERC721) revert SenderNotMirror(); if (msg.data.length < 0x24) revert(); uint256 id = _calldataload(0x04); _return(uint160(_ownerOf(id))); } // `transferFromNFT(address,address,uint256,address)`. if (fnSelector == 0xe5eb36c8) { if (msg.sender != $.mirrorERC721) revert SenderNotMirror(); if (msg.data.length < 0x84) revert(); address from = address(uint160(_calldataload(0x04))); address to = address(uint160(_calldataload(0x24))); uint256 id = _calldataload(0x44); address msgSender = address(uint160(_calldataload(0x64))); _transferFromNFT(from, to, id, msgSender); _return(1); } // `setApprovalForAll(address,bool,address)`. if (fnSelector == 0x813500fc) { if (msg.sender != $.mirrorERC721) revert SenderNotMirror(); if (msg.data.length < 0x64) revert(); address spender = address(uint160(_calldataload(0x04))); bool status = _calldataload(0x24) != 0; address msgSender = address(uint160(_calldataload(0x44))); _setApprovalForAll(spender, status, msgSender); _return(1); } // `approveNFT(address,uint256,address)`. if (fnSelector == 0xd10b6e0c) { if (msg.sender != $.mirrorERC721) revert SenderNotMirror(); if (msg.data.length < 0x64) revert(); address spender = address(uint160(_calldataload(0x04))); uint256 id = _calldataload(0x24); address msgSender = address(uint160(_calldataload(0x44))); _return(uint160(_approveNFT(spender, id, msgSender))); } // `getApproved(uint256)`. if (fnSelector == 0x081812fc) { if (msg.sender != $.mirrorERC721) revert SenderNotMirror(); if (msg.data.length < 0x24) revert(); uint256 id = _calldataload(0x04); _return(uint160(_getApproved(id))); } // `balanceOfNFT(address)`. if (fnSelector == 0xf5b100ea) { if (msg.sender != $.mirrorERC721) revert SenderNotMirror(); if (msg.data.length < 0x24) revert(); address owner = address(uint160(_calldataload(0x04))); _return(_balanceOfNFT(owner)); } // `totalNFTSupply()`. if (fnSelector == 0xe2c79281) { if (msg.sender != $.mirrorERC721) revert SenderNotMirror(); if (msg.data.length < 0x04) revert(); _return(_totalNFTSupply()); } // `implementsDN404()`. if (fnSelector == 0xb7a94eb8) { _return(1); } _; } /// @dev Fallback function for calls from mirror NFT contract. fallback() external payable virtual dn404Fallback {} receive() external payable virtual {} /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* PRIVATE HELPERS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Struct containing packed log data for `Transfer` events to be /// emitted by the mirror NFT contract. struct _PackedLogs { uint256[] logs; uint256 offset; } /// @dev Initiates memory allocation for packed logs with `n` log items. function _packedLogsMalloc( uint256 n ) private pure returns (_PackedLogs memory p) { /// @solidity memory-safe-assembly assembly { let logs := add(mload(0x40), 0x40) // Offset by 2 words for `_packedLogsSend`. mstore(logs, n) let offset := add(0x20, logs) mstore(0x40, add(offset, shl(5, n))) mstore(p, logs) mstore(add(0x20, p), offset) } } /// @dev Adds a packed log item to `p` with address `a`, token `id` and burn flag `burnBit`. function _packedLogsAppend( _PackedLogs memory p, address a, uint256 id, uint256 burnBit ) private pure { /// @solidity memory-safe-assembly assembly { let offset := mload(add(0x20, p)) mstore(offset, or(or(shl(96, a), shl(8, id)), burnBit)) mstore(add(0x20, p), add(offset, 0x20)) } } /// @dev Calls the `mirror` NFT contract to emit Transfer events for packed logs `p`. function _packedLogsSend(_PackedLogs memory p, address mirror) private { /// @solidity memory-safe-assembly assembly { let logs := mload(p) let o := sub(logs, 0x40) // Start of calldata to send. mstore(o, 0x263c69d6) // `logTransfer(uint256[])`. mstore(add(o, 0x20), 0x20) // Offset of `logs` in the calldata to send. let n := add(0x44, shl(5, mload(logs))) // Length of calldata to send. if iszero( and( eq(mload(o), 1), call(gas(), mirror, 0, add(o, 0x1c), n, o, 0x20) ) ) { revert(o, 0x00) } } } /// @dev Struct of temporary variables for transfers. struct _TransferTemps { uint256 nftAmountToBurn; uint256 nftAmountToMint; uint256 fromBalance; uint256 toBalance; uint256 fromOwnedLength; uint256 toOwnedLength; } /// @dev Returns if `a` has bytecode of non-zero length. function _hasCode(address a) private view returns (bool result) { /// @solidity memory-safe-assembly assembly { result := extcodesize(a) // Can handle dirty upper bits. } } /// @dev Returns the calldata value at `offset`. function _calldataload( uint256 offset ) private pure returns (uint256 value) { /// @solidity memory-safe-assembly assembly { value := calldataload(offset) } } /// @dev Executes a return opcode to return `x` and end the current call frame. function _return(uint256 x) private pure { /// @solidity memory-safe-assembly assembly { mstore(0x00, x) return(0x00, 0x20) } } /// @dev Returns `max(0, x - y)`. function _zeroFloorSub( uint256 x, uint256 y ) private pure returns (uint256 z) { /// @solidity memory-safe-assembly assembly { z := mul(gt(x, y), sub(x, y)) } } /// @dev Returns `i << 1`. function _ownershipIndex(uint256 i) private pure returns (uint256) { return i << 1; } /// @dev Returns `(i << 1) + 1`. function _ownedIndex(uint256 i) private pure returns (uint256) { unchecked { return (i << 1) + 1; } } /// @dev Returns the uint32 value at `index` in `map`. function _get( Uint32Map storage map, uint256 index ) private view returns (uint32 result) { result = uint32(map.map[index >> 3] >> ((index & 7) << 5)); } /// @dev Updates the uint32 value at `index` in `map`. function _set(Uint32Map storage map, uint256 index, uint32 value) private { /// @solidity memory-safe-assembly assembly { mstore(0x20, map.slot) mstore(0x00, shr(3, index)) let s := keccak256(0x00, 0x40) // Storage slot. let o := shl(5, and(index, 7)) // Storage slot offset (bits). let v := sload(s) // Storage slot value. let m := 0xffffffff // Value mask. sstore(s, xor(v, shl(o, and(m, xor(shr(o, v), value))))) } } /// @dev Sets the owner alias and the owned index together. function _setOwnerAliasAndOwnedIndex( Uint32Map storage map, uint256 id, uint32 ownership, uint32 ownedIndex ) private { /// @solidity memory-safe-assembly assembly { let value := or(shl(32, ownedIndex), and(0xffffffff, ownership)) mstore(0x20, map.slot) mstore(0x00, shr(2, id)) let s := keccak256(0x00, 0x40) // Storage slot. let o := shl(6, and(id, 3)) // Storage slot offset (bits). let v := sload(s) // Storage slot value. let m := 0xffffffffffffffff // Value mask. sstore(s, xor(v, shl(o, and(m, xor(shr(o, v), value))))) } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /// @title DN404Mirror /// @notice DN404Mirror provides an interface for interacting with the /// NFT tokens in a DN404 implementation. /// /// @author vectorized.eth (@optimizoor) /// @author Quit (@0xQuit) /// @author Michael Amadi (@AmadiMichaels) /// @author cygaar (@0xCygaar) /// @author Thomas (@0xjustadev) /// @author Harrison (@PopPunkOnChain) /// /// @dev Note: /// - The ERC721 data is stored in the base DN404 contract. contract DN404Mirror { /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* EVENTS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Emitted when token `id` is transferred from `from` to `to`. event Transfer( address indexed from, address indexed to, uint256 indexed id ); /// @dev Emitted when `owner` enables `account` to manage the `id` token. event Approval( address indexed owner, address indexed account, uint256 indexed id ); /// @dev Emitted when `owner` enables or disables `operator` to manage all of their tokens. event ApprovalForAll( address indexed owner, address indexed operator, bool isApproved ); /// @dev `keccak256(bytes("Transfer(address,address,uint256)"))`. uint256 private constant _TRANSFER_EVENT_SIGNATURE = 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef; /// @dev `keccak256(bytes("Approval(address,address,uint256)"))`. uint256 private constant _APPROVAL_EVENT_SIGNATURE = 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925; /// @dev `keccak256(bytes("ApprovalForAll(address,address,bool)"))`. uint256 private constant _APPROVAL_FOR_ALL_EVENT_SIGNATURE = 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31; /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* CUSTOM ERRORS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Thrown when a call for an NFT function did not originate /// from the base DN404 contract. error SenderNotBase(); /// @dev Thrown when a call for an NFT function did not originate from the deployer. error SenderNotDeployer(); /// @dev Thrown when transferring an NFT to a contract address that /// does not implement ERC721Receiver. error TransferToNonERC721ReceiverImplementer(); /// @dev Thrown when linking to the DN404 base contract and the /// DN404 supportsInterface check fails or the call reverts. error CannotLink(); /// @dev Thrown when a linkMirrorContract call is received and the /// NFT mirror contract has already been linked to a DN404 base contract. error AlreadyLinked(); /// @dev Thrown when retrieving the base DN404 address when a link has not /// been established. error NotLinked(); /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* STORAGE */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Struct contain the NFT mirror contract storage. struct DN404NFTStorage { address baseERC20; address deployer; } /// @dev Returns a storage pointer for DN404NFTStorage. function _getDN404NFTStorage() internal pure virtual returns (DN404NFTStorage storage $) { /// @solidity memory-safe-assembly assembly { // `uint72(bytes9(keccak256("DN404_MIRROR_STORAGE")))`. $.slot := 0x3602298b8c10b01230 // Truncate to 9 bytes to reduce bytecode size. } } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* CONSTRUCTOR */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ constructor(address deployer) { // For non-proxies, we will store the deployer so that only the deployer can // link the base contract. _getDN404NFTStorage().deployer = deployer; } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* ERC721 OPERATIONS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Returns the token collection name from the base DN404 contract. function name() public view virtual returns (string memory result) { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { result := mload(0x40) mstore(0x00, 0x06fdde03) // `name()`. if iszero(staticcall(gas(), base, 0x1c, 0x04, 0x00, 0x00)) { returndatacopy(result, 0x00, returndatasize()) revert(result, returndatasize()) } returndatacopy(0x00, 0x00, 0x20) returndatacopy(result, mload(0x00), 0x20) returndatacopy( add(result, 0x20), add(mload(0x00), 0x20), mload(result) ) mstore(0x40, add(add(result, 0x20), mload(result))) } } /// @dev Returns the token collection symbol from the base DN404 contract. function symbol() public view virtual returns (string memory result) { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { result := mload(0x40) mstore(0x00, 0x95d89b41) // `symbol()`. if iszero(staticcall(gas(), base, 0x1c, 0x04, 0x00, 0x00)) { returndatacopy(result, 0x00, returndatasize()) revert(result, returndatasize()) } returndatacopy(0x00, 0x00, 0x20) returndatacopy(result, mload(0x00), 0x20) returndatacopy( add(result, 0x20), add(mload(0x00), 0x20), mload(result) ) mstore(0x40, add(add(result, 0x20), mload(result))) } } /// @dev Returns the Uniform Resource Identifier (URI) for token `id` from /// the base DN404 contract. function tokenURI( uint256 id ) public view virtual returns (string memory result) { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { result := mload(0x40) mstore(0x20, id) mstore(0x00, 0xc87b56dd) // `tokenURI()`. if iszero(staticcall(gas(), base, 0x1c, 0x24, 0x00, 0x00)) { returndatacopy(result, 0x00, returndatasize()) revert(result, returndatasize()) } returndatacopy(0x00, 0x00, 0x20) returndatacopy(result, mload(0x00), 0x20) returndatacopy( add(result, 0x20), add(mload(0x00), 0x20), mload(result) ) mstore(0x40, add(add(result, 0x20), mload(result))) } } /// @dev Returns the total NFT supply from the base DN404 contract. function totalSupply() public view virtual returns (uint256 result) { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { mstore(0x00, 0xe2c79281) // `totalNFTSupply()`. if iszero( and( gt(returndatasize(), 0x1f), staticcall(gas(), base, 0x1c, 0x04, 0x00, 0x20) ) ) { returndatacopy(mload(0x40), 0x00, returndatasize()) revert(mload(0x40), returndatasize()) } result := mload(0x00) } } /// @dev Returns the number of NFT tokens owned by `owner` from the base DN404 contract. /// /// Requirements: /// - `owner` must not be the zero address. function balanceOf( address owner ) public view virtual returns (uint256 result) { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { mstore(0x20, shr(96, shl(96, owner))) mstore(0x00, 0xf5b100ea) // `balanceOfNFT(address)`. if iszero( and( gt(returndatasize(), 0x1f), staticcall(gas(), base, 0x1c, 0x24, 0x00, 0x20) ) ) { returndatacopy(mload(0x40), 0x00, returndatasize()) revert(mload(0x40), returndatasize()) } result := mload(0x00) } } /// @dev Returns the owner of token `id` from the base DN404 contract. /// /// Requirements: /// - Token `id` must exist. function ownerOf(uint256 id) public view virtual returns (address result) { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { mstore(0x00, 0x6352211e) // `ownerOf(uint256)`. mstore(0x20, id) if iszero( and( gt(returndatasize(), 0x1f), staticcall(gas(), base, 0x1c, 0x24, 0x00, 0x20) ) ) { returndatacopy(mload(0x40), 0x00, returndatasize()) revert(mload(0x40), returndatasize()) } result := shr(96, mload(0x0c)) } } /// @dev Sets `spender` as the approved account to manage token `id` in /// the base DN404 contract. /// /// Requirements: /// - Token `id` must exist. /// - The caller must be the owner of the token, /// or an approved operator for the token owner. /// /// Emits an {Approval} event. function approve(address spender, uint256 id) public virtual { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { spender := shr(96, shl(96, spender)) let m := mload(0x40) mstore(0x00, 0xd10b6e0c) // `approveNFT(address,uint256,address)`. mstore(0x20, spender) mstore(0x40, id) mstore(0x60, caller()) if iszero( and( gt(returndatasize(), 0x1f), call(gas(), base, callvalue(), 0x1c, 0x64, 0x00, 0x20) ) ) { returndatacopy(m, 0x00, returndatasize()) revert(m, returndatasize()) } mstore(0x40, m) // Restore the free memory pointer. mstore(0x60, 0) // Restore the zero pointer. // Emit the {Approval} event. log4( codesize(), 0x00, _APPROVAL_EVENT_SIGNATURE, shr(96, mload(0x0c)), spender, id ) } } /// @dev Returns the account approved to manage token `id` from /// the base DN404 contract. /// /// Requirements: /// - Token `id` must exist. function getApproved( uint256 id ) public view virtual returns (address result) { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { mstore(0x00, 0x081812fc) // `getApproved(uint256)`. mstore(0x20, id) if iszero( and( gt(returndatasize(), 0x1f), staticcall(gas(), base, 0x1c, 0x24, 0x00, 0x20) ) ) { returndatacopy(mload(0x40), 0x00, returndatasize()) revert(mload(0x40), returndatasize()) } result := shr(96, mload(0x0c)) } } /// @dev Sets whether `operator` is approved to manage the tokens of the caller in /// the base DN404 contract. /// /// Emits an {ApprovalForAll} event. function setApprovalForAll(address operator, bool approved) public virtual { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { operator := shr(96, shl(96, operator)) let m := mload(0x40) mstore(0x00, 0x813500fc) // `setApprovalForAll(address,bool,address)`. mstore(0x20, operator) mstore(0x40, iszero(iszero(approved))) mstore(0x60, caller()) if iszero( and( eq(mload(0x00), 1), call(gas(), base, callvalue(), 0x1c, 0x64, 0x00, 0x20) ) ) { returndatacopy(m, 0x00, returndatasize()) revert(m, returndatasize()) } // Emit the {ApprovalForAll} event. log3( 0x40, 0x20, _APPROVAL_FOR_ALL_EVENT_SIGNATURE, caller(), operator ) mstore(0x40, m) // Restore the free memory pointer. mstore(0x60, 0) // Restore the zero pointer. } } /// @dev Returns whether `operator` is approved to manage the tokens of `owner` from /// the base DN404 contract. function isApprovedForAll( address owner, address operator ) public view virtual returns (bool result) { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { let m := mload(0x40) mstore(0x40, operator) mstore(0x2c, shl(96, owner)) mstore(0x0c, 0xe985e9c5000000000000000000000000) // `isApprovedForAll(address,address)`. if iszero( and( gt(returndatasize(), 0x1f), staticcall(gas(), base, 0x1c, 0x44, 0x00, 0x20) ) ) { returndatacopy(m, 0x00, returndatasize()) revert(m, returndatasize()) } mstore(0x40, m) // Restore the free memory pointer. result := iszero(iszero(mload(0x00))) } } /// @dev Transfers token `id` from `from` to `to`. /// /// Requirements: /// /// - Token `id` must exist. /// - `from` must be the owner of the token. /// - `to` cannot be the zero address. /// - The caller must be the owner of the token, or be approved to manage the token. /// /// Emits a {Transfer} event. function transferFrom(address from, address to, uint256 id) public virtual { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { from := shr(96, shl(96, from)) to := shr(96, shl(96, to)) let m := mload(0x40) mstore(m, 0xe5eb36c8) // `transferFromNFT(address,address,uint256,address)`. mstore(add(m, 0x20), from) mstore(add(m, 0x40), to) mstore(add(m, 0x60), id) mstore(add(m, 0x80), caller()) if iszero( and( eq(mload(m), 1), call(gas(), base, callvalue(), add(m, 0x1c), 0x84, m, 0x20) ) ) { returndatacopy(m, 0x00, returndatasize()) revert(m, returndatasize()) } // Emit the {Transfer} event. log4(codesize(), 0x00, _TRANSFER_EVENT_SIGNATURE, from, to, id) } } /// @dev Equivalent to `safeTransferFrom(from, to, id, "")`. function safeTransferFrom( address from, address to, uint256 id ) public payable virtual { transferFrom(from, to, id); if (_hasCode(to)) _checkOnERC721Received(from, to, id, ""); } /// @dev Transfers token `id` from `from` to `to`. /// /// Requirements: /// /// - Token `id` must exist. /// - `from` must be the owner of the token. /// - `to` cannot be the zero address. /// - The caller must be the owner of the token, or be approved to manage the token. /// - If `to` refers to a smart contract, it must implement /// {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. /// /// Emits a {Transfer} event. function safeTransferFrom( address from, address to, uint256 id, bytes calldata data ) public virtual { transferFrom(from, to, id); if (_hasCode(to)) _checkOnERC721Received(from, to, id, data); } /// @dev Returns true if this contract implements the interface defined by `interfaceId`. /// See: https://eips.ethereum.org/EIPS/eip-165 /// This function call must use less than 30000 gas. function supportsInterface( bytes4 interfaceId ) public view virtual returns (bool result) { /// @solidity memory-safe-assembly assembly { let s := shr(224, interfaceId) // ERC165: 0x01ffc9a7, ERC721: 0x80ac58cd, ERC721Metadata: 0x5b5e139f. result := or( or(eq(s, 0x01ffc9a7), eq(s, 0x80ac58cd)), eq(s, 0x5b5e139f) ) } } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* MIRROR OPERATIONS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Returns the address of the base DN404 contract. function baseERC20() public view virtual returns (address base) { base = _getDN404NFTStorage().baseERC20; if (base == address(0)) revert NotLinked(); } /// @dev Fallback modifier to execute calls from the base DN404 contract. modifier dn404NFTFallback() virtual { DN404NFTStorage storage $ = _getDN404NFTStorage(); uint256 fnSelector = _calldataload(0x00) >> 224; // `logTransfer(uint256[])`. if (fnSelector == 0x263c69d6) { if (msg.sender != $.baseERC20) revert SenderNotBase(); /// @solidity memory-safe-assembly assembly { // When returndatacopy copies 1 or more out-of-bounds bytes, it reverts. returndatacopy(0x00, returndatasize(), lt(calldatasize(), 0x20)) let o := add(0x24, calldataload(0x04)) // Packed logs offset. returndatacopy(0x00, returndatasize(), lt(calldatasize(), o)) let end := add(o, shl(5, calldataload(sub(o, 0x20)))) returndatacopy(0x00, returndatasize(), lt(calldatasize(), end)) for { } iszero(eq(o, end)) { o := add(0x20, o) } { let d := calldataload(o) // Entry in the packed logs. let a := shr(96, d) // The address. let b := and(1, d) // Whether it is a burn. log4( codesize(), 0x00, _TRANSFER_EVENT_SIGNATURE, mul(a, b), mul(a, iszero(b)), shr(168, shl(160, d)) ) } mstore(0x00, 0x01) return(0x00, 0x20) } } // `linkMirrorContract(address)`. if (fnSelector == 0x0f4599e5) { if ($.deployer != address(0)) { if (address(uint160(_calldataload(0x04))) != $.deployer) { revert SenderNotDeployer(); } } if ($.baseERC20 != address(0)) revert AlreadyLinked(); $.baseERC20 = msg.sender; /// @solidity memory-safe-assembly assembly { mstore(0x00, 0x01) return(0x00, 0x20) } } _; } /// @dev Fallback function for calls from base DN404 contract. fallback() external payable virtual dn404NFTFallback {} receive() external payable virtual {} /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* PRIVATE HELPERS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Returns the calldata value at `offset`. function _calldataload( uint256 offset ) private pure returns (uint256 value) { /// @solidity memory-safe-assembly assembly { value := calldataload(offset) } } /// @dev Returns if `a` has bytecode of non-zero length. function _hasCode(address a) private view returns (bool result) { /// @solidity memory-safe-assembly assembly { result := extcodesize(a) // Can handle dirty upper bits. } } /// @dev Perform a call to invoke {IERC721Receiver-onERC721Received} on `to`. /// Reverts if the target does not support the function correctly. function _checkOnERC721Received( address from, address to, uint256 id, bytes memory data ) private { /// @solidity memory-safe-assembly assembly { // Prepare the calldata. let m := mload(0x40) let onERC721ReceivedSelector := 0x150b7a02 mstore(m, onERC721ReceivedSelector) mstore(add(m, 0x20), caller()) // The `operator`, which is always `msg.sender`. mstore(add(m, 0x40), shr(96, shl(96, from))) mstore(add(m, 0x60), id) mstore(add(m, 0x80), 0x80) let n := mload(data) mstore(add(m, 0xa0), n) if n { pop(staticcall(gas(), 4, add(data, 0x20), n, add(m, 0xc0), n)) } // Revert if the call reverts. if iszero(call(gas(), to, 0, add(m, 0x1c), add(n, 0xa4), m, 0x20)) { if returndatasize() { // Bubble up the revert if the call reverts. returndatacopy(m, 0x00, returndatasize()) revert(m, returndatasize()) } } // Load the returndata and compare it. if iszero(eq(mload(m), shl(224, onERC721ReceivedSelector))) { mstore(0x00, 0xd1a57ed6) // `TransferToNonERC721ReceiverImplementer()`. revert(0x1c, 0x04) } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol) pragma solidity ^0.8.20; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { /** * @dev Muldiv operation overflow. */ error MathOverflowedMulDiv(); enum Rounding { Floor, // Toward negative infinity Ceil, // Toward positive infinity Trunc, // Toward zero Expand // Away from zero } /** * @dev Returns the addition of two unsigned integers, with an overflow flag. */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an overflow flag. */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds towards infinity instead * of rounding towards zero. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { if (b == 0) { // Guarantee the same behavior as in a regular Solidity division. return a / b; } // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or * denominator == 0. * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by * Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0 = x * y; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. if (denominator <= prod1) { revert MathOverflowedMulDiv(); } /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. // Always >= 1. See https://cs.stackexchange.com/q/138556/92363. uint256 twos = denominator & (0 - denominator); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also // works in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded * towards zero. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2 of a positive value rounded towards zero. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10 of a positive value rounded towards zero. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256 of a positive value rounded towards zero. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0); } } /** * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers. */ function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) { return uint8(rounding) % 2 == 1; } }
//SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.24; abstract contract Ownable { event OwnershipTransferred(address indexed user, address indexed newOwner); error Unauthorized(); error InvalidOwner(); address public owner; modifier onlyOwner() virtual { if (msg.sender != owner) revert Unauthorized(); _; } constructor(address _owner) { if (_owner == address(0)) revert InvalidOwner(); owner = _owner; emit OwnershipTransferred(address(0), _owner); } function transferOwnership(address _owner) public virtual onlyOwner { if (_owner == address(0)) revert InvalidOwner(); owner = _owner; emit OwnershipTransferred(msg.sender, _owner); } function revokeOwnership() public virtual onlyOwner { owner = address(0); emit OwnershipTransferred(msg.sender, address(0)); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /// @notice Safe ETH and ERC20 transfer library that gracefully handles missing return values. /// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/SafeTransferLib.sol) /// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.sol) /// /// @dev Note: /// - For ETH transfers, please use `forceSafeTransferETH` for DoS protection. /// - For ERC20s, this implementation won't check that a token has code, /// responsibility is delegated to the caller. library SafeTransferLib { /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* CUSTOM ERRORS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev The ETH transfer has failed. error ETHTransferFailed(); /// @dev The ERC20 `transferFrom` has failed. error TransferFromFailed(); /// @dev The ERC20 `transfer` has failed. error TransferFailed(); /// @dev The ERC20 `approve` has failed. error ApproveFailed(); /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* CONSTANTS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Suggested gas stipend for contract receiving ETH that disallows any storage writes. uint256 internal constant GAS_STIPEND_NO_STORAGE_WRITES = 2300; /// @dev Suggested gas stipend for contract receiving ETH to perform a few /// storage reads and writes, but low enough to prevent griefing. uint256 internal constant GAS_STIPEND_NO_GRIEF = 100000; /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* ETH OPERATIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ // If the ETH transfer MUST succeed with a reasonable gas budget, use the force variants. // // The regular variants: // - Forwards all remaining gas to the target. // - Reverts if the target reverts. // - Reverts if the current contract has insufficient balance. // // The force variants: // - Forwards with an optional gas stipend // (defaults to `GAS_STIPEND_NO_GRIEF`, which is sufficient for most cases). // - If the target reverts, or if the gas stipend is exhausted, // creates a temporary contract to force send the ETH via `SELFDESTRUCT`. // Future compatible with `SENDALL`: https://eips.ethereum.org/EIPS/eip-4758. // - Reverts if the current contract has insufficient balance. // // The try variants: // - Forwards with a mandatory gas stipend. // - Instead of reverting, returns whether the transfer succeeded. /// @dev Sends `amount` (in wei) ETH to `to`. function safeTransferETH(address to, uint256 amount) internal { /// @solidity memory-safe-assembly assembly { if iszero( call(gas(), to, amount, codesize(), 0x00, codesize(), 0x00) ) { mstore(0x00, 0xb12d13eb) // `ETHTransferFailed()`. revert(0x1c, 0x04) } } } /// @dev Sends all the ETH in the current contract to `to`. function safeTransferAllETH(address to) internal { /// @solidity memory-safe-assembly assembly { // Transfer all the ETH and check if it succeeded or not. if iszero( call( gas(), to, selfbalance(), codesize(), 0x00, codesize(), 0x00 ) ) { mstore(0x00, 0xb12d13eb) // `ETHTransferFailed()`. revert(0x1c, 0x04) } } } /// @dev Force sends `amount` (in wei) ETH to `to`, with a `gasStipend`. function forceSafeTransferETH( address to, uint256 amount, uint256 gasStipend ) internal { /// @solidity memory-safe-assembly assembly { if lt(selfbalance(), amount) { mstore(0x00, 0xb12d13eb) // `ETHTransferFailed()`. revert(0x1c, 0x04) } if iszero( call(gasStipend, to, amount, codesize(), 0x00, codesize(), 0x00) ) { mstore(0x00, to) // Store the address in scratch space. mstore8(0x0b, 0x73) // Opcode `PUSH20`. mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`. if iszero(create(amount, 0x0b, 0x16)) { revert(codesize(), codesize()) } // For gas estimation. } } } /// @dev Force sends all the ETH in the current contract to `to`, with a `gasStipend`. function forceSafeTransferAllETH(address to, uint256 gasStipend) internal { /// @solidity memory-safe-assembly assembly { if iszero( call( gasStipend, to, selfbalance(), codesize(), 0x00, codesize(), 0x00 ) ) { mstore(0x00, to) // Store the address in scratch space. mstore8(0x0b, 0x73) // Opcode `PUSH20`. mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`. if iszero(create(selfbalance(), 0x0b, 0x16)) { revert(codesize(), codesize()) } // For gas estimation. } } } /// @dev Force sends `amount` (in wei) ETH to `to`, with `GAS_STIPEND_NO_GRIEF`. function forceSafeTransferETH(address to, uint256 amount) internal { /// @solidity memory-safe-assembly assembly { if lt(selfbalance(), amount) { mstore(0x00, 0xb12d13eb) // `ETHTransferFailed()`. revert(0x1c, 0x04) } if iszero( call( GAS_STIPEND_NO_GRIEF, to, amount, codesize(), 0x00, codesize(), 0x00 ) ) { mstore(0x00, to) // Store the address in scratch space. mstore8(0x0b, 0x73) // Opcode `PUSH20`. mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`. if iszero(create(amount, 0x0b, 0x16)) { revert(codesize(), codesize()) } // For gas estimation. } } } /// @dev Force sends all the ETH in the current contract to `to`, with `GAS_STIPEND_NO_GRIEF`. function forceSafeTransferAllETH(address to) internal { /// @solidity memory-safe-assembly assembly { // forgefmt: disable-next-item if iszero( call( GAS_STIPEND_NO_GRIEF, to, selfbalance(), codesize(), 0x00, codesize(), 0x00 ) ) { mstore(0x00, to) // Store the address in scratch space. mstore8(0x0b, 0x73) // Opcode `PUSH20`. mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`. if iszero(create(selfbalance(), 0x0b, 0x16)) { revert(codesize(), codesize()) } // For gas estimation. } } } /// @dev Sends `amount` (in wei) ETH to `to`, with a `gasStipend`. function trySafeTransferETH( address to, uint256 amount, uint256 gasStipend ) internal returns (bool success) { /// @solidity memory-safe-assembly assembly { success := call( gasStipend, to, amount, codesize(), 0x00, codesize(), 0x00 ) } } /// @dev Sends all the ETH in the current contract to `to`, with a `gasStipend`. function trySafeTransferAllETH( address to, uint256 gasStipend ) internal returns (bool success) { /// @solidity memory-safe-assembly assembly { success := call( gasStipend, to, selfbalance(), codesize(), 0x00, codesize(), 0x00 ) } } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* ERC20 OPERATIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Sends `amount` of ERC20 `token` from `from` to `to`. /// Reverts upon failure. /// /// The `from` account must have at least `amount` approved for /// the current contract to manage. function safeTransferFrom( address token, address from, address to, uint256 amount ) internal { /// @solidity memory-safe-assembly assembly { let m := mload(0x40) // Cache the free memory pointer. mstore(0x60, amount) // Store the `amount` argument. mstore(0x40, to) // Store the `to` argument. mstore(0x2c, shl(96, from)) // Store the `from` argument. mstore(0x0c, 0x23b872dd000000000000000000000000) // `transferFrom(address,address,uint256)`. // Perform the transfer, reverting upon failure. if iszero( and( // The arguments of `and` are evaluated from right to left. or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing. call(gas(), token, 0, 0x1c, 0x64, 0x00, 0x20) ) ) { mstore(0x00, 0x7939f424) // `TransferFromFailed()`. revert(0x1c, 0x04) } mstore(0x60, 0) // Restore the zero slot to zero. mstore(0x40, m) // Restore the free memory pointer. } } /// @dev Sends all of ERC20 `token` from `from` to `to`. /// Reverts upon failure. /// /// The `from` account must have their entire balance approved for /// the current contract to manage. function safeTransferAllFrom( address token, address from, address to ) internal returns (uint256 amount) { /// @solidity memory-safe-assembly assembly { let m := mload(0x40) // Cache the free memory pointer. mstore(0x40, to) // Store the `to` argument. mstore(0x2c, shl(96, from)) // Store the `from` argument. mstore(0x0c, 0x70a08231000000000000000000000000) // `balanceOf(address)`. // Read the balance, reverting upon failure. if iszero( and( // The arguments of `and` are evaluated from right to left. gt(returndatasize(), 0x1f), // At least 32 bytes returned. staticcall(gas(), token, 0x1c, 0x24, 0x60, 0x20) ) ) { mstore(0x00, 0x7939f424) // `TransferFromFailed()`. revert(0x1c, 0x04) } mstore(0x00, 0x23b872dd) // `transferFrom(address,address,uint256)`. amount := mload(0x60) // The `amount` is already at 0x60. We'll need to return it. // Perform the transfer, reverting upon failure. if iszero( and( // The arguments of `and` are evaluated from right to left. or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing. call(gas(), token, 0, 0x1c, 0x64, 0x00, 0x20) ) ) { mstore(0x00, 0x7939f424) // `TransferFromFailed()`. revert(0x1c, 0x04) } mstore(0x60, 0) // Restore the zero slot to zero. mstore(0x40, m) // Restore the free memory pointer. } } /// @dev Sends `amount` of ERC20 `token` from the current contract to `to`. /// Reverts upon failure. function safeTransfer(address token, address to, uint256 amount) internal { /// @solidity memory-safe-assembly assembly { mstore(0x14, to) // Store the `to` argument. mstore(0x34, amount) // Store the `amount` argument. mstore(0x00, 0xa9059cbb000000000000000000000000) // `transfer(address,uint256)`. // Perform the transfer, reverting upon failure. if iszero( and( // The arguments of `and` are evaluated from right to left. or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing. call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20) ) ) { mstore(0x00, 0x90b8ec18) // `TransferFailed()`. revert(0x1c, 0x04) } mstore(0x34, 0) // Restore the part of the free memory pointer that was overwritten. } } /// @dev Sends all of ERC20 `token` from the current contract to `to`. /// Reverts upon failure. function safeTransferAll( address token, address to ) internal returns (uint256 amount) { /// @solidity memory-safe-assembly assembly { mstore(0x00, 0x70a08231) // Store the function selector of `balanceOf(address)`. mstore(0x20, address()) // Store the address of the current contract. // Read the balance, reverting upon failure. if iszero( and( // The arguments of `and` are evaluated from right to left. gt(returndatasize(), 0x1f), // At least 32 bytes returned. staticcall(gas(), token, 0x1c, 0x24, 0x34, 0x20) ) ) { mstore(0x00, 0x90b8ec18) // `TransferFailed()`. revert(0x1c, 0x04) } mstore(0x14, to) // Store the `to` argument. amount := mload(0x34) // The `amount` is already at 0x34. We'll need to return it. mstore(0x00, 0xa9059cbb000000000000000000000000) // `transfer(address,uint256)`. // Perform the transfer, reverting upon failure. if iszero( and( // The arguments of `and` are evaluated from right to left. or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing. call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20) ) ) { mstore(0x00, 0x90b8ec18) // `TransferFailed()`. revert(0x1c, 0x04) } mstore(0x34, 0) // Restore the part of the free memory pointer that was overwritten. } } /// @dev Sets `amount` of ERC20 `token` for `to` to manage on behalf of the current contract. /// Reverts upon failure. function safeApprove(address token, address to, uint256 amount) internal { /// @solidity memory-safe-assembly assembly { mstore(0x14, to) // Store the `to` argument. mstore(0x34, amount) // Store the `amount` argument. mstore(0x00, 0x095ea7b3000000000000000000000000) // `approve(address,uint256)`. // Perform the approval, reverting upon failure. if iszero( and( // The arguments of `and` are evaluated from right to left. or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing. call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20) ) ) { mstore(0x00, 0x3e3f8f73) // `ApproveFailed()`. revert(0x1c, 0x04) } mstore(0x34, 0) // Restore the part of the free memory pointer that was overwritten. } } /// @dev Sets `amount` of ERC20 `token` for `to` to manage on behalf of the current contract. /// If the initial attempt to approve fails, attempts to reset the approved amount to zero, /// then retries the approval again (some tokens, e.g. USDT, requires this). /// Reverts upon failure. function safeApproveWithRetry( address token, address to, uint256 amount ) internal { /// @solidity memory-safe-assembly assembly { mstore(0x14, to) // Store the `to` argument. mstore(0x34, amount) // Store the `amount` argument. mstore(0x00, 0x095ea7b3000000000000000000000000) // `approve(address,uint256)`. // Perform the approval, retrying upon failure. if iszero( and( // The arguments of `and` are evaluated from right to left. or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing. call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20) ) ) { mstore(0x34, 0) // Store 0 for the `amount`. mstore(0x00, 0x095ea7b3000000000000000000000000) // `approve(address,uint256)`. pop(call(gas(), token, 0, 0x10, 0x44, codesize(), 0x00)) // Reset the approval. mstore(0x34, amount) // Store back the original `amount`. // Retry the approval, reverting upon failure. if iszero( and( or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing. call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20) ) ) { mstore(0x00, 0x3e3f8f73) // `ApproveFailed()`. revert(0x1c, 0x04) } } mstore(0x34, 0) // Restore the part of the free memory pointer that was overwritten. } } /// @dev Returns the amount of ERC20 `token` owned by `account`. /// Returns zero if the `token` does not exist. function balanceOf( address token, address account ) internal view returns (uint256 amount) { /// @solidity memory-safe-assembly assembly { mstore(0x14, account) // Store the `account` argument. mstore(0x00, 0x70a08231000000000000000000000000) // `balanceOf(address)`. amount := mul( mload(0x20), and( // The arguments of `and` are evaluated from right to left. gt(returndatasize(), 0x1f), // At least 32 bytes returned. staticcall(gas(), token, 0x10, 0x24, 0x20, 0x20) ) ) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.20; /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMath { /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return a > b ? a : b; } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return a < b ? a : b; } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // must be unchecked in order to support `n = type(int256).min` return uint256(n >= 0 ? n : -n); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol) pragma solidity ^0.8.20; import {Math} from "./Math.sol"; import {SignedMath} from "./SignedMath.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant HEX_DIGITS = "0123456789abcdef"; uint8 private constant ADDRESS_LENGTH = 20; /** * @dev The `value` string doesn't fit in the specified `length`. */ error StringsInsufficientHexLength(uint256 value, uint256 length); /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), HEX_DIGITS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toStringSigned(int256 value) internal pure returns (string memory) { return string.concat(value < 0 ? "-" : "", toString(SignedMath.abs(value))); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { uint256 localValue = value; bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = HEX_DIGITS[localValue & 0xf]; localValue >>= 4; } if (localValue != 0) { revert StringsInsufficientHexLength(value, length); } return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal * representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), ADDRESS_LENGTH); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b)); } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"Permissions","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"_name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"openTrading","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"_buy","type":"uint8"},{"internalType":"uint8","name":"_sell","type":"uint8"}],"name":"removeFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"storeData","outputs":[{"internalType":"address","name":"tokenMkt","type":"address"},{"internalType":"uint8","name":"buyFee","type":"uint8"},{"internalType":"uint8","name":"sellFee","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","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":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60806040526040518060400160405280600881526020017f5261726520464e440000000000000000000000000000000000000000000000008152505f908162000049919062000727565b506040518060400160405280600381526020017f464e4400000000000000000000000000000000000000000000000000000000008152506001908162000090919062000727565b505f600960146101000a81548160ff021916908360ff1602179055505f600960156101000a81548160ff021916908360ff160217905550348015620000d3575f80fd5b5060405180606001604052803373ffffffffffffffffffffffffffffffffffffffff168152602001600960149054906101000a900460ff1660ff168152602001600960159054906101000a900460ff1660ff1681525060025f820151815f015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151815f0160146101000a81548160ff021916908360ff1602179055506040820151815f0160156101000a81548160ff021916908360ff1602179055509050507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60045f3073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f737a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20819055503360075f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550620002b533336200043f60201b60201c565b6064806012600a620002c8919062000994565b631954fc40620002d99190620009e4565b620002e59190620009e4565b620002f1919062000a5b565b60035f60075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f208190555060085f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff165f73ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60035f60075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205460405162000431919062000aa3565b60405180910390a362000abe565b8160085f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508060095f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b5f81519050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f60028204905060018216806200053f57607f821691505b602082108103620005555762000554620004fa565b5b50919050565b5f819050815f5260205f209050919050565b5f6020601f8301049050919050565b5f82821b905092915050565b5f60088302620005b97fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826200057c565b620005c586836200057c565b95508019841693508086168417925050509392505050565b5f819050919050565b5f819050919050565b5f6200060f620006096200060384620005dd565b620005e6565b620005dd565b9050919050565b5f819050919050565b6200062a83620005ef565b62000642620006398262000616565b84845462000588565b825550505050565b5f90565b620006586200064a565b620006658184846200061f565b505050565b5b818110156200068c57620006805f826200064e565b6001810190506200066b565b5050565b601f821115620006db57620006a5816200055b565b620006b0846200056d565b81016020851015620006c0578190505b620006d8620006cf856200056d565b8301826200066a565b50505b505050565b5f82821c905092915050565b5f620006fd5f1984600802620006e0565b1980831691505092915050565b5f620007178383620006ec565b9150826002028217905092915050565b6200073282620004c3565b67ffffffffffffffff8111156200074e576200074d620004cd565b5b6200075a825462000527565b6200076782828562000690565b5f60209050601f8311600181146200079d575f841562000788578287015190505b6200079485826200070a565b86555062000803565b601f198416620007ad866200055b565b5f5b82811015620007d657848901518255600182019150602085019450602081019050620007af565b86831015620007f65784890151620007f2601f891682620006ec565b8355505b6001600288020188555050505b505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f8160011c9050919050565b5f808291508390505b600185111562000895578086048111156200086d576200086c6200080b565b5b60018516156200087d5780820291505b80810290506200088d8562000838565b94506200084d565b94509492505050565b5f82620008af576001905062000981565b81620008be575f905062000981565b8160018114620008d75760028114620008e25762000918565b600191505062000981565b60ff841115620008f757620008f66200080b565b5b8360020a9150848211156200091157620009106200080b565b5b5062000981565b5060208310610133831016604e8410600b8410161715620009525782820a9050838111156200094c576200094b6200080b565b5b62000981565b62000961848484600162000844565b925090508184048111156200097b576200097a6200080b565b5b81810290505b9392505050565b5f60ff82169050919050565b5f620009a082620005dd565b9150620009ad8362000988565b9250620009dc7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84846200089e565b905092915050565b5f620009f082620005dd565b9150620009fd83620005dd565b925082820262000a0d81620005dd565b9150828204841483151762000a275762000a266200080b565b5b5092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f62000a6782620005dd565b915062000a7483620005dd565b92508262000a875762000a8662000a2e565b5b828204905092915050565b62000a9d81620005dd565b82525050565b5f60208201905062000ab85f83018462000a92565b92915050565b611c418062000acc5f395ff3fe6080604052600436106100e0575f3560e01c806395d89b411161007e578063c6ba48be11610058578063c6ba48be146102d9578063c9567bf914610301578063d28d885214610317578063dd62ed3e14610341576100e7565b806395d89b4114610249578063a9059cbb14610273578063b09f1266146102af576100e7565b806323b872dd116100ba57806323b872dd1461017b578063313ce567146101b75780634abe3052146101e157806370a082311461020d576100e7565b806306fdde03146100eb578063095ea7b31461011557806318160ddd14610151576100e7565b366100e757005b5f80fd5b3480156100f6575f80fd5b506100ff61037d565b60405161010c9190611410565b60405180910390f35b348015610120575f80fd5b5061013b600480360381019061013691906114c1565b61040c565b6040516101489190611519565b60405180910390f35b34801561015c575f80fd5b506101656104f9565b6040516101729190611541565b60405180910390f35b348015610186575f80fd5b506101a1600480360381019061019c919061155a565b610519565b6040516101ae9190611519565b60405180910390f35b3480156101c2575f80fd5b506101cb6105bc565b6040516101d891906115c5565b60405180910390f35b3480156101ec575f80fd5b506101f56105c1565b604051610204939291906115ed565b60405180910390f35b348015610218575f80fd5b50610233600480360381019061022e9190611622565b61060f565b6040516102409190611541565b60405180910390f35b348015610254575f80fd5b5061025d610624565b60405161026a9190611410565b60405180910390f35b34801561027e575f80fd5b50610299600480360381019061029491906114c1565b6106b4565b6040516102a69190611519565b60405180910390f35b3480156102ba575f80fd5b506102c36106c8565b6040516102d09190611410565b60405180910390f35b3480156102e4575f80fd5b506102ff60048036038101906102fa9190611677565b610754565b005b34801561030c575f80fd5b506103156107ce565b005b348015610322575f80fd5b5061032b610a0a565b6040516103389190611410565b60405180910390f35b34801561034c575f80fd5b50610367600480360381019061036291906116b5565b610a95565b6040516103749190611541565b60405180910390f35b60605f805461038b90611720565b80601f01602080910402602001604051908101604052809291908181526020018280546103b790611720565b80156104025780601f106103d957610100808354040283529160200191610402565b820191905f5260205f20905b8154815290600101906020018083116103e557829003601f168201915b5050505050905090565b5f8160045f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516104e79190611541565b60405180910390a36001905092915050565b6012600a61050791906118ac565b631954fc4061051691906118f6565b81565b5f8160045f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8282546105a19190611937565b925050819055506105b3848484610ab5565b90509392505050565b601281565b6002805f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690805f0160149054906101000a900460ff1690805f0160159054906101000a900460ff16905083565b6003602052805f5260405f205f915090505481565b60606001805461063390611720565b80601f016020809104026020016040519081016040528092919081815260200182805461065f90611720565b80156106aa5780601f10610681576101008083540402835291602001916106aa565b820191905f5260205f20905b81548152906001019060200180831161068d57829003601f168201915b5050505050905090565b5f6106c0338484610ab5565b905092915050565b600180546106d590611720565b80601f016020809104026020016040519081016040528092919081815260200182805461070190611720565b801561074c5780601f106107235761010080835404028352916020019161074c565b820191905f5260205f20905b81548152906001019060200180831161072f57829003601f168201915b505050505081565b61075c61131e565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146107c0576040517f9af2b10000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6107ca8282611348565b5050565b6107d661131e565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461080c575f80fd5b600760159054906101000a900460ff1615610825575f80fd5b5f737a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610883573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108a7919061197e565b90505f737a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610907573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061092b919061197e565b90505f8273ffffffffffffffffffffffffffffffffffffffff1663e6a4390530846040518363ffffffff1660e01b81526004016109699291906119a9565b602060405180830381865afa158015610984573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109a8919061197e565b90508060055f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600760156101000a81548160ff021916908315150217905550505050565b5f8054610a1690611720565b80601f0160208091040260200160405190810160405280929190818152602001828054610a4290611720565b8015610a8d5780601f10610a6457610100808354040283529160200191610a8d565b820191905f5260205f20905b815481529060010190602001808311610a7057829003601f168201915b505050505081565b6004602052815f5260405f20602052805f5260405f205f91509150505481565b5f80610abf61131e565b9050600760159054906101000a900460ff1680610b0757508073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16145b80610b3d57508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b610b45575f80fd5b8260035f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f828254610b919190611937565b9250508190555060055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015610c015750600760149054906101000a900460ff16155b8015610c72575060646012600a610c1891906118ac565b631954fc40610c2791906118f6565b610c3191906119fd565b60035f3073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205410155b8015610caa57508073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b15610f3e576001600760146101000a81548160ff0219169083151502179055505f600267ffffffffffffffff811115610ce657610ce5611a2d565b5b604051908082528060200260200182016040528015610d145781602001602082028036833780820191505090505b50905030815f81518110610d2b57610d2a611a5a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050737a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610dc2573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610de6919061197e565b81600181518110610dfa57610df9611a5a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050737a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff1663eb6f613960646012600a610e7491906118ac565b631954fc40610e8391906118f6565b610e8d91906119fd565b5f8430426040518663ffffffff1660e01b8152600401610eb1959493929190611b80565b5f604051808303815f87803b158015610ec8575f80fd5b505af1158015610eda573d5f803e3d5ffd5b505050508173ffffffffffffffffffffffffffffffffffffffff166108fc4790811502906040515f60405180830381858888f19350505050158015610f21573d5f803e3d5ffd5b505f600760146101000a81548160ff021916908315150217905550505b5f8060025f0160149054906101000a900460ff1660025f0160159054906101000a900460ff16915091503073ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff1614158015610fb7575060011515600760159054906101000a900460ff161515145b15611098575f606460055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff1614611019578361101b565b825b60ff168761102991906118f6565b61103391906119fd565b905080866110419190611937565b95508060035f3073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f82825461108f9190611bd8565b92505081905550505b8460035f8873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8282546110e49190611bd8565b9250508190555060095f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff16036111ca578573ffffffffffffffffffffffffffffffffffffffff1660085f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef876040516111bd9190611541565b60405180910390a3611310565b60095f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16036112a95760085f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8760405161129c9190611541565b60405180910390a361130f565b8573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef876040516113069190611541565b60405180910390a35b5b600193505050509392505050565b5f60025f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b8160025f0160146101000a81548160ff021916908360ff1602179055508060025f0160156101000a81548160ff021916908360ff1602179055505050565b5f81519050919050565b5f82825260208201905092915050565b5f5b838110156113bd5780820151818401526020810190506113a2565b5f8484015250505050565b5f601f19601f8301169050919050565b5f6113e282611386565b6113ec8185611390565b93506113fc8185602086016113a0565b611405816113c8565b840191505092915050565b5f6020820190508181035f83015261142881846113d8565b905092915050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61145d82611434565b9050919050565b61146d81611453565b8114611477575f80fd5b50565b5f8135905061148881611464565b92915050565b5f819050919050565b6114a08161148e565b81146114aa575f80fd5b50565b5f813590506114bb81611497565b92915050565b5f80604083850312156114d7576114d6611430565b5b5f6114e48582860161147a565b92505060206114f5858286016114ad565b9150509250929050565b5f8115159050919050565b611513816114ff565b82525050565b5f60208201905061152c5f83018461150a565b92915050565b61153b8161148e565b82525050565b5f6020820190506115545f830184611532565b92915050565b5f805f6060848603121561157157611570611430565b5b5f61157e8682870161147a565b935050602061158f8682870161147a565b92505060406115a0868287016114ad565b9150509250925092565b5f60ff82169050919050565b6115bf816115aa565b82525050565b5f6020820190506115d85f8301846115b6565b92915050565b6115e781611453565b82525050565b5f6060820190506116005f8301866115de565b61160d60208301856115b6565b61161a60408301846115b6565b949350505050565b5f6020828403121561163757611636611430565b5b5f6116448482850161147a565b91505092915050565b611656816115aa565b8114611660575f80fd5b50565b5f813590506116718161164d565b92915050565b5f806040838503121561168d5761168c611430565b5b5f61169a85828601611663565b92505060206116ab85828601611663565b9150509250929050565b5f80604083850312156116cb576116ca611430565b5b5f6116d88582860161147a565b92505060206116e98582860161147a565b9150509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f600282049050600182168061173757607f821691505b60208210810361174a576117496116f3565b5b50919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f8160011c9050919050565b5f808291508390505b60018511156117d2578086048111156117ae576117ad611750565b5b60018516156117bd5780820291505b80810290506117cb8561177d565b9450611792565b94509492505050565b5f826117ea57600190506118a5565b816117f7575f90506118a5565b816001811461180d576002811461181757611846565b60019150506118a5565b60ff84111561182957611828611750565b5b8360020a9150848211156118405761183f611750565b5b506118a5565b5060208310610133831016604e8410600b841016171561187b5782820a90508381111561187657611875611750565b5b6118a5565b6118888484846001611789565b9250905081840481111561189f5761189e611750565b5b81810290505b9392505050565b5f6118b68261148e565b91506118c1836115aa565b92506118ee7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84846117db565b905092915050565b5f6119008261148e565b915061190b8361148e565b92508282026119198161148e565b915082820484148315176119305761192f611750565b5b5092915050565b5f6119418261148e565b915061194c8361148e565b925082820390508181111561196457611963611750565b5b92915050565b5f8151905061197881611464565b92915050565b5f6020828403121561199357611992611430565b5b5f6119a08482850161196a565b91505092915050565b5f6040820190506119bc5f8301856115de565b6119c960208301846115de565b9392505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f611a078261148e565b9150611a128361148e565b925082611a2257611a216119d0565b5b828204905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f819050919050565b5f819050919050565b5f611ab3611aae611aa984611a87565b611a90565b61148e565b9050919050565b611ac381611a99565b82525050565b5f81519050919050565b5f82825260208201905092915050565b5f819050602082019050919050565b611afb81611453565b82525050565b5f611b0c8383611af2565b60208301905092915050565b5f602082019050919050565b5f611b2e82611ac9565b611b388185611ad3565b9350611b4383611ae3565b805f5b83811015611b73578151611b5a8882611b01565b9750611b6583611b18565b925050600181019050611b46565b5085935050505092915050565b5f60a082019050611b935f830188611532565b611ba06020830187611aba565b8181036040830152611bb28186611b24565b9050611bc160608301856115de565b611bce6080830184611532565b9695505050505050565b5f611be28261148e565b9150611bed8361148e565b9250828201905080821115611c0557611c04611750565b5b9291505056fea2646970667358221220fae85d7c8bb559f9155d7e92e15f6245ca56547f1ef049834a516e75908b4f8464736f6c63430008180033
Deployed Bytecode
0x6080604052600436106100e0575f3560e01c806395d89b411161007e578063c6ba48be11610058578063c6ba48be146102d9578063c9567bf914610301578063d28d885214610317578063dd62ed3e14610341576100e7565b806395d89b4114610249578063a9059cbb14610273578063b09f1266146102af576100e7565b806323b872dd116100ba57806323b872dd1461017b578063313ce567146101b75780634abe3052146101e157806370a082311461020d576100e7565b806306fdde03146100eb578063095ea7b31461011557806318160ddd14610151576100e7565b366100e757005b5f80fd5b3480156100f6575f80fd5b506100ff61037d565b60405161010c9190611410565b60405180910390f35b348015610120575f80fd5b5061013b600480360381019061013691906114c1565b61040c565b6040516101489190611519565b60405180910390f35b34801561015c575f80fd5b506101656104f9565b6040516101729190611541565b60405180910390f35b348015610186575f80fd5b506101a1600480360381019061019c919061155a565b610519565b6040516101ae9190611519565b60405180910390f35b3480156101c2575f80fd5b506101cb6105bc565b6040516101d891906115c5565b60405180910390f35b3480156101ec575f80fd5b506101f56105c1565b604051610204939291906115ed565b60405180910390f35b348015610218575f80fd5b50610233600480360381019061022e9190611622565b61060f565b6040516102409190611541565b60405180910390f35b348015610254575f80fd5b5061025d610624565b60405161026a9190611410565b60405180910390f35b34801561027e575f80fd5b50610299600480360381019061029491906114c1565b6106b4565b6040516102a69190611519565b60405180910390f35b3480156102ba575f80fd5b506102c36106c8565b6040516102d09190611410565b60405180910390f35b3480156102e4575f80fd5b506102ff60048036038101906102fa9190611677565b610754565b005b34801561030c575f80fd5b506103156107ce565b005b348015610322575f80fd5b5061032b610a0a565b6040516103389190611410565b60405180910390f35b34801561034c575f80fd5b50610367600480360381019061036291906116b5565b610a95565b6040516103749190611541565b60405180910390f35b60605f805461038b90611720565b80601f01602080910402602001604051908101604052809291908181526020018280546103b790611720565b80156104025780601f106103d957610100808354040283529160200191610402565b820191905f5260205f20905b8154815290600101906020018083116103e557829003601f168201915b5050505050905090565b5f8160045f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516104e79190611541565b60405180910390a36001905092915050565b6012600a61050791906118ac565b631954fc4061051691906118f6565b81565b5f8160045f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8282546105a19190611937565b925050819055506105b3848484610ab5565b90509392505050565b601281565b6002805f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690805f0160149054906101000a900460ff1690805f0160159054906101000a900460ff16905083565b6003602052805f5260405f205f915090505481565b60606001805461063390611720565b80601f016020809104026020016040519081016040528092919081815260200182805461065f90611720565b80156106aa5780601f10610681576101008083540402835291602001916106aa565b820191905f5260205f20905b81548152906001019060200180831161068d57829003601f168201915b5050505050905090565b5f6106c0338484610ab5565b905092915050565b600180546106d590611720565b80601f016020809104026020016040519081016040528092919081815260200182805461070190611720565b801561074c5780601f106107235761010080835404028352916020019161074c565b820191905f5260205f20905b81548152906001019060200180831161072f57829003601f168201915b505050505081565b61075c61131e565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146107c0576040517f9af2b10000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6107ca8282611348565b5050565b6107d661131e565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461080c575f80fd5b600760159054906101000a900460ff1615610825575f80fd5b5f737a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610883573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108a7919061197e565b90505f737a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610907573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061092b919061197e565b90505f8273ffffffffffffffffffffffffffffffffffffffff1663e6a4390530846040518363ffffffff1660e01b81526004016109699291906119a9565b602060405180830381865afa158015610984573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109a8919061197e565b90508060055f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600760156101000a81548160ff021916908315150217905550505050565b5f8054610a1690611720565b80601f0160208091040260200160405190810160405280929190818152602001828054610a4290611720565b8015610a8d5780601f10610a6457610100808354040283529160200191610a8d565b820191905f5260205f20905b815481529060010190602001808311610a7057829003601f168201915b505050505081565b6004602052815f5260405f20602052805f5260405f205f91509150505481565b5f80610abf61131e565b9050600760159054906101000a900460ff1680610b0757508073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16145b80610b3d57508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b610b45575f80fd5b8260035f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f828254610b919190611937565b9250508190555060055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015610c015750600760149054906101000a900460ff16155b8015610c72575060646012600a610c1891906118ac565b631954fc40610c2791906118f6565b610c3191906119fd565b60035f3073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205410155b8015610caa57508073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b15610f3e576001600760146101000a81548160ff0219169083151502179055505f600267ffffffffffffffff811115610ce657610ce5611a2d565b5b604051908082528060200260200182016040528015610d145781602001602082028036833780820191505090505b50905030815f81518110610d2b57610d2a611a5a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050737a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610dc2573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610de6919061197e565b81600181518110610dfa57610df9611a5a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050737a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff1663eb6f613960646012600a610e7491906118ac565b631954fc40610e8391906118f6565b610e8d91906119fd565b5f8430426040518663ffffffff1660e01b8152600401610eb1959493929190611b80565b5f604051808303815f87803b158015610ec8575f80fd5b505af1158015610eda573d5f803e3d5ffd5b505050508173ffffffffffffffffffffffffffffffffffffffff166108fc4790811502906040515f60405180830381858888f19350505050158015610f21573d5f803e3d5ffd5b505f600760146101000a81548160ff021916908315150217905550505b5f8060025f0160149054906101000a900460ff1660025f0160159054906101000a900460ff16915091503073ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff1614158015610fb7575060011515600760159054906101000a900460ff161515145b15611098575f606460055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff1614611019578361101b565b825b60ff168761102991906118f6565b61103391906119fd565b905080866110419190611937565b95508060035f3073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f82825461108f9190611bd8565b92505081905550505b8460035f8873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8282546110e49190611bd8565b9250508190555060095f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff16036111ca578573ffffffffffffffffffffffffffffffffffffffff1660085f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef876040516111bd9190611541565b60405180910390a3611310565b60095f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16036112a95760085f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8760405161129c9190611541565b60405180910390a361130f565b8573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef876040516113069190611541565b60405180910390a35b5b600193505050509392505050565b5f60025f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b8160025f0160146101000a81548160ff021916908360ff1602179055508060025f0160156101000a81548160ff021916908360ff1602179055505050565b5f81519050919050565b5f82825260208201905092915050565b5f5b838110156113bd5780820151818401526020810190506113a2565b5f8484015250505050565b5f601f19601f8301169050919050565b5f6113e282611386565b6113ec8185611390565b93506113fc8185602086016113a0565b611405816113c8565b840191505092915050565b5f6020820190508181035f83015261142881846113d8565b905092915050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61145d82611434565b9050919050565b61146d81611453565b8114611477575f80fd5b50565b5f8135905061148881611464565b92915050565b5f819050919050565b6114a08161148e565b81146114aa575f80fd5b50565b5f813590506114bb81611497565b92915050565b5f80604083850312156114d7576114d6611430565b5b5f6114e48582860161147a565b92505060206114f5858286016114ad565b9150509250929050565b5f8115159050919050565b611513816114ff565b82525050565b5f60208201905061152c5f83018461150a565b92915050565b61153b8161148e565b82525050565b5f6020820190506115545f830184611532565b92915050565b5f805f6060848603121561157157611570611430565b5b5f61157e8682870161147a565b935050602061158f8682870161147a565b92505060406115a0868287016114ad565b9150509250925092565b5f60ff82169050919050565b6115bf816115aa565b82525050565b5f6020820190506115d85f8301846115b6565b92915050565b6115e781611453565b82525050565b5f6060820190506116005f8301866115de565b61160d60208301856115b6565b61161a60408301846115b6565b949350505050565b5f6020828403121561163757611636611430565b5b5f6116448482850161147a565b91505092915050565b611656816115aa565b8114611660575f80fd5b50565b5f813590506116718161164d565b92915050565b5f806040838503121561168d5761168c611430565b5b5f61169a85828601611663565b92505060206116ab85828601611663565b9150509250929050565b5f80604083850312156116cb576116ca611430565b5b5f6116d88582860161147a565b92505060206116e98582860161147a565b9150509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f600282049050600182168061173757607f821691505b60208210810361174a576117496116f3565b5b50919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f8160011c9050919050565b5f808291508390505b60018511156117d2578086048111156117ae576117ad611750565b5b60018516156117bd5780820291505b80810290506117cb8561177d565b9450611792565b94509492505050565b5f826117ea57600190506118a5565b816117f7575f90506118a5565b816001811461180d576002811461181757611846565b60019150506118a5565b60ff84111561182957611828611750565b5b8360020a9150848211156118405761183f611750565b5b506118a5565b5060208310610133831016604e8410600b841016171561187b5782820a90508381111561187657611875611750565b5b6118a5565b6118888484846001611789565b9250905081840481111561189f5761189e611750565b5b81810290505b9392505050565b5f6118b68261148e565b91506118c1836115aa565b92506118ee7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84846117db565b905092915050565b5f6119008261148e565b915061190b8361148e565b92508282026119198161148e565b915082820484148315176119305761192f611750565b5b5092915050565b5f6119418261148e565b915061194c8361148e565b925082820390508181111561196457611963611750565b5b92915050565b5f8151905061197881611464565b92915050565b5f6020828403121561199357611992611430565b5b5f6119a08482850161196a565b91505092915050565b5f6040820190506119bc5f8301856115de565b6119c960208301846115de565b9392505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f611a078261148e565b9150611a128361148e565b925082611a2257611a216119d0565b5b828204905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f819050919050565b5f819050919050565b5f611ab3611aae611aa984611a87565b611a90565b61148e565b9050919050565b611ac381611a99565b82525050565b5f81519050919050565b5f82825260208201905092915050565b5f819050602082019050919050565b611afb81611453565b82525050565b5f611b0c8383611af2565b60208301905092915050565b5f602082019050919050565b5f611b2e82611ac9565b611b388185611ad3565b9350611b4383611ae3565b805f5b83811015611b73578151611b5a8882611b01565b9750611b6583611b18565b925050600181019050611b46565b5085935050505092915050565b5f60a082019050611b935f830188611532565b611ba06020830187611aba565b8181036040830152611bb28186611b24565b9050611bc160608301856115de565b611bce6080830184611532565b9695505050505050565b5f611be28261148e565b9150611bed8361148e565b9250828201905080821115611c0557611c04611750565b5b9291505056fea2646970667358221220fae85d7c8bb559f9155d7e92e15f6245ca56547f1ef049834a516e75908b4f8464736f6c63430008180033
Deployed Bytecode Sourcemap
947:5136:4:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4049:91;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;3697:207;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;1090:65;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;3466:223;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;1048:35;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;1271:26;;;;;;;;;;;;;:::i;:::-;;;;;;;;;:::i;:::-;;;;;;;;1584:44;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;4148:95;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;3912:129;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;1012:29;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;2687:162;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;3104:354;;;;;;;;;;;;;:::i;:::-;;973:32;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;1635:64;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;4049:91;4094:13;4127:5;4120:12;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4049:91;:::o;3697:207::-;3765:4;3815:6;3782:9;:21;3792:10;3782:21;;;;;;;;;;;;;;;:30;3804:7;3782:30;;;;;;;;;;;;;;;:39;;;;3858:7;3837:37;;3846:10;3837:37;;;3867:6;3837:37;;;;;;:::i;:::-;;;;;;;;3892:4;3885:11;;3697:207;;;;:::o;1090:65::-;1081:2;1141;:14;;;;:::i;:::-;1128:11;:27;;;;:::i;:::-;1090:65;:::o;3466:223::-;3582:4;3630:6;3599:9;:15;3609:4;3599:15;;;;;;;;;;;;;;;:27;3615:10;3599:27;;;;;;;;;;;;;;;;:37;;;;;;;:::i;:::-;;;;;;;;3654:27;3664:4;3670:2;3674:6;3654:9;:27::i;:::-;3647:34;;3466:223;;;;;:::o;1048:35::-;1081:2;1048:35;:::o;1271:26::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;1584:44::-;;;;;;;;;;;;;;;;;:::o;4148:95::-;4195:13;4228:7;4221:14;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4148:95;:::o;3912:129::-;3976:4;4000:33;4010:10;4022:2;4026:6;4000:9;:33::i;:::-;3993:40;;3912:129;;;;:::o;1012:29::-;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;2687:162::-;2770:8;:6;:8::i;:::-;2756:22;;:10;:22;;;2752:48;;2787:13;;;;;;;;;;;;;;2752:48;2811:30;2829:4;2835:5;2811:17;:30::i;:::-;2687:162;;:::o;3104:354::-;3169:8;:6;:8::i;:::-;3155:22;;:10;:22;;;3147:31;;;;;;3198:11;;;;;;;;;;;3197:12;3189:21;;;;;;3221:16;1845:42;3240:24;;;:26;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;3221:45;;3277:13;1845:42;3293:21;;;:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;3277:39;;3327:13;3359:8;3343:33;;;3385:4;3392:5;3343:55;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;3327:71;;3416:5;3409:4;;:12;;;;;;;;;;;;;;;;;;3446:4;3432:11;;:18;;;;;;;;;;;;;;;;;;3136:322;;;3104:354::o;973:32::-;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;1635:64::-;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;4400:1680::-;4513:4;4530:16;4549:8;:6;:8::i;:::-;4530:27;;4576:11;;;;;;;;;;;:31;;;;4599:8;4591:16;;:4;:16;;;4576:31;:49;;;;4617:8;4611:14;;:2;:14;;;4576:49;4568:58;;;;;;4658:6;4639:9;:15;4649:4;4639:15;;;;;;;;;;;;;;;;:25;;;;;;;:::i;:::-;;;;;;;;4701:4;;;;;;;;;;;4695:10;;:2;:10;;;:36;;;;;4723:8;;;;;;;;;;;4722:9;4695:36;:91;;;;;1348:3;1081:2;1141;:14;;;;:::i;:::-;1128:11;:27;;;;:::i;:::-;1334:17;;;;:::i;:::-;4748:9;:24;4766:4;4748:24;;;;;;;;;;;;;;;;:38;;4695:91;:124;;;;;4811:8;4803:16;;:4;:16;;;;4695:124;4677:712;;;4857:4;4846:8;;:15;;;;;;;;;;;;;;;;;;4876:21;4914:1;4900:16;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4876:40;;4949:4;4931;4936:1;4931:7;;;;;;;;:::i;:::-;;;;;;;:23;;;;;;;;;;;1845:42;4979:21;;;:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;4969:4;4974:1;4969:7;;;;;;;;:::i;:::-;;;;;;;:33;;;;;;;;;;;1845:42;5017:88;;;1348:3;1081:2;1141;:14;;;;:::i;:::-;1128:11;:27;;;;:::i;:::-;1334:17;;;;:::i;:::-;5161:1;5185:4;5220;5248:15;5017:265;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5305:8;5297:26;;:49;5324:21;5297:49;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5372:5;5361:8;;:16;;;;;;;;;;;;;;;;;;4831:558;4677:712;5402:13;5417:14;5436:9;:16;;;;;;;;;;;;5454:9;:17;;;;;;;;;;;;5401:71;;;;5503:4;5487:21;;:4;:21;;;;:44;;;;;5527:4;5512:19;;:11;;;;;;;;;;;:19;;;5487:44;5483:280;;;5548:27;5642:3;5612:4;;;;;;;;;;;5606:10;;:2;:10;;;:31;;5630:7;5606:31;;;5619:8;5606:31;5579:59;;:6;:59;;;;:::i;:::-;5578:67;;;;:::i;:::-;5548:97;;5670:19;5660:29;;;;;:::i;:::-;;;5732:19;5704:9;:24;5722:4;5704:24;;;;;;;;;;;;;;;;:47;;;;;;;:::i;:::-;;;;;;;;5533:230;5483:280;5790:6;5773:9;:13;5783:2;5773:13;;;;;;;;;;;;;;;;:23;;;;;;;:::i;:::-;;;;;;;;5821:9;;;;;;;;;;;5813:17;;:4;:17;;;5809:242;;5872:2;5852:31;;5861:9;;;;;;;;;;;5852:31;;;5876:6;5852:31;;;;;;:::i;:::-;;;;;;;;5809:242;;;5911:9;;;;;;;;;;;5905:15;;:2;:15;;;5901:150;;5957:9;;;;;;;;;;;5942:33;;5951:4;5942:33;;;5968:6;5942:33;;;;;;:::i;:::-;;;;;;;;5901:150;;;6028:2;6013:26;;6022:4;6013:26;;;6032:6;6013:26;;;;;;:::i;:::-;;;;;;;;5901:150;5809:242;6068:4;6061:11;;;;;4400:1680;;;;;:::o;3003:93::-;3043:7;3070:9;:18;;;;;;;;;;;;3063:25;;3003:93;:::o;2857:138::-;2947:4;2928:9;:16;;;:23;;;;;;;;;;;;;;;;;;2982:5;2962:9;:17;;;:25;;;;;;;;;;;;;;;;;;2857:138;;:::o;7:99:8:-;59:6;93:5;87:12;77:22;;7:99;;;:::o;112:169::-;196:11;230:6;225:3;218:19;270:4;265:3;261:14;246:29;;112:169;;;;:::o;287:246::-;368:1;378:113;392:6;389:1;386:13;378:113;;;477:1;472:3;468:11;462:18;458:1;453:3;449:11;442:39;414:2;411:1;407:10;402:15;;378:113;;;525:1;516:6;511:3;507:16;500:27;349:184;287:246;;;:::o;539:102::-;580:6;631:2;627:7;622:2;615:5;611:14;607:28;597:38;;539:102;;;:::o;647:377::-;735:3;763:39;796:5;763:39;:::i;:::-;818:71;882:6;877:3;818:71;:::i;:::-;811:78;;898:65;956:6;951:3;944:4;937:5;933:16;898:65;:::i;:::-;988:29;1010:6;988:29;:::i;:::-;983:3;979:39;972:46;;739:285;647:377;;;;:::o;1030:313::-;1143:4;1181:2;1170:9;1166:18;1158:26;;1230:9;1224:4;1220:20;1216:1;1205:9;1201:17;1194:47;1258:78;1331:4;1322:6;1258:78;:::i;:::-;1250:86;;1030:313;;;;:::o;1430:117::-;1539:1;1536;1529:12;1676:126;1713:7;1753:42;1746:5;1742:54;1731:65;;1676:126;;;:::o;1808:96::-;1845:7;1874:24;1892:5;1874:24;:::i;:::-;1863:35;;1808:96;;;:::o;1910:122::-;1983:24;2001:5;1983:24;:::i;:::-;1976:5;1973:35;1963:63;;2022:1;2019;2012:12;1963:63;1910:122;:::o;2038:139::-;2084:5;2122:6;2109:20;2100:29;;2138:33;2165:5;2138:33;:::i;:::-;2038:139;;;;:::o;2183:77::-;2220:7;2249:5;2238:16;;2183:77;;;:::o;2266:122::-;2339:24;2357:5;2339:24;:::i;:::-;2332:5;2329:35;2319:63;;2378:1;2375;2368:12;2319:63;2266:122;:::o;2394:139::-;2440:5;2478:6;2465:20;2456:29;;2494:33;2521:5;2494:33;:::i;:::-;2394:139;;;;:::o;2539:474::-;2607:6;2615;2664:2;2652:9;2643:7;2639:23;2635:32;2632:119;;;2670:79;;:::i;:::-;2632:119;2790:1;2815:53;2860:7;2851:6;2840:9;2836:22;2815:53;:::i;:::-;2805:63;;2761:117;2917:2;2943:53;2988:7;2979:6;2968:9;2964:22;2943:53;:::i;:::-;2933:63;;2888:118;2539:474;;;;;:::o;3019:90::-;3053:7;3096:5;3089:13;3082:21;3071:32;;3019:90;;;:::o;3115:109::-;3196:21;3211:5;3196:21;:::i;:::-;3191:3;3184:34;3115:109;;:::o;3230:210::-;3317:4;3355:2;3344:9;3340:18;3332:26;;3368:65;3430:1;3419:9;3415:17;3406:6;3368:65;:::i;:::-;3230:210;;;;:::o;3446:118::-;3533:24;3551:5;3533:24;:::i;:::-;3528:3;3521:37;3446:118;;:::o;3570:222::-;3663:4;3701:2;3690:9;3686:18;3678:26;;3714:71;3782:1;3771:9;3767:17;3758:6;3714:71;:::i;:::-;3570:222;;;;:::o;3798:619::-;3875:6;3883;3891;3940:2;3928:9;3919:7;3915:23;3911:32;3908:119;;;3946:79;;:::i;:::-;3908:119;4066:1;4091:53;4136:7;4127:6;4116:9;4112:22;4091:53;:::i;:::-;4081:63;;4037:117;4193:2;4219:53;4264:7;4255:6;4244:9;4240:22;4219:53;:::i;:::-;4209:63;;4164:118;4321:2;4347:53;4392:7;4383:6;4372:9;4368:22;4347:53;:::i;:::-;4337:63;;4292:118;3798:619;;;;;:::o;4423:86::-;4458:7;4498:4;4491:5;4487:16;4476:27;;4423:86;;;:::o;4515:112::-;4598:22;4614:5;4598:22;:::i;:::-;4593:3;4586:35;4515:112;;:::o;4633:214::-;4722:4;4760:2;4749:9;4745:18;4737:26;;4773:67;4837:1;4826:9;4822:17;4813:6;4773:67;:::i;:::-;4633:214;;;;:::o;4853:118::-;4940:24;4958:5;4940:24;:::i;:::-;4935:3;4928:37;4853:118;;:::o;4977:426::-;5118:4;5156:2;5145:9;5141:18;5133:26;;5169:71;5237:1;5226:9;5222:17;5213:6;5169:71;:::i;:::-;5250:68;5314:2;5303:9;5299:18;5290:6;5250:68;:::i;:::-;5328;5392:2;5381:9;5377:18;5368:6;5328:68;:::i;:::-;4977:426;;;;;;:::o;5409:329::-;5468:6;5517:2;5505:9;5496:7;5492:23;5488:32;5485:119;;;5523:79;;:::i;:::-;5485:119;5643:1;5668:53;5713:7;5704:6;5693:9;5689:22;5668:53;:::i;:::-;5658:63;;5614:117;5409:329;;;;:::o;5744:118::-;5815:22;5831:5;5815:22;:::i;:::-;5808:5;5805:33;5795:61;;5852:1;5849;5842:12;5795:61;5744:118;:::o;5868:135::-;5912:5;5950:6;5937:20;5928:29;;5966:31;5991:5;5966:31;:::i;:::-;5868:135;;;;:::o;6009:466::-;6073:6;6081;6130:2;6118:9;6109:7;6105:23;6101:32;6098:119;;;6136:79;;:::i;:::-;6098:119;6256:1;6281:51;6324:7;6315:6;6304:9;6300:22;6281:51;:::i;:::-;6271:61;;6227:115;6381:2;6407:51;6450:7;6441:6;6430:9;6426:22;6407:51;:::i;:::-;6397:61;;6352:116;6009:466;;;;;:::o;6481:474::-;6549:6;6557;6606:2;6594:9;6585:7;6581:23;6577:32;6574:119;;;6612:79;;:::i;:::-;6574:119;6732:1;6757:53;6802:7;6793:6;6782:9;6778:22;6757:53;:::i;:::-;6747:63;;6703:117;6859:2;6885:53;6930:7;6921:6;6910:9;6906:22;6885:53;:::i;:::-;6875:63;;6830:118;6481:474;;;;;:::o;6961:180::-;7009:77;7006:1;6999:88;7106:4;7103:1;7096:15;7130:4;7127:1;7120:15;7147:320;7191:6;7228:1;7222:4;7218:12;7208:22;;7275:1;7269:4;7265:12;7296:18;7286:81;;7352:4;7344:6;7340:17;7330:27;;7286:81;7414:2;7406:6;7403:14;7383:18;7380:38;7377:84;;7433:18;;:::i;:::-;7377:84;7198:269;7147:320;;;:::o;7473:180::-;7521:77;7518:1;7511:88;7618:4;7615:1;7608:15;7642:4;7639:1;7632:15;7659:102;7701:8;7748:5;7745:1;7741:13;7720:34;;7659:102;;;:::o;7767:848::-;7828:5;7835:4;7859:6;7850:15;;7883:5;7874:14;;7897:712;7918:1;7908:8;7905:15;7897:712;;;8013:4;8008:3;8004:14;7998:4;7995:24;7992:50;;;8022:18;;:::i;:::-;7992:50;8072:1;8062:8;8058:16;8055:451;;;8487:4;8480:5;8476:16;8467:25;;8055:451;8537:4;8531;8527:15;8519:23;;8567:32;8590:8;8567:32;:::i;:::-;8555:44;;7897:712;;;7767:848;;;;;;;:::o;8621:1073::-;8675:5;8866:8;8856:40;;8887:1;8878:10;;8889:5;;8856:40;8915:4;8905:36;;8932:1;8923:10;;8934:5;;8905:36;9001:4;9049:1;9044:27;;;;9085:1;9080:191;;;;8994:277;;9044:27;9062:1;9053:10;;9064:5;;;9080:191;9125:3;9115:8;9112:17;9109:43;;;9132:18;;:::i;:::-;9109:43;9181:8;9178:1;9174:16;9165:25;;9216:3;9209:5;9206:14;9203:40;;;9223:18;;:::i;:::-;9203:40;9256:5;;;8994:277;;9380:2;9370:8;9367:16;9361:3;9355:4;9352:13;9348:36;9330:2;9320:8;9317:16;9312:2;9306:4;9303:12;9299:35;9283:111;9280:246;;;9436:8;9430:4;9426:19;9417:28;;9471:3;9464:5;9461:14;9458:40;;;9478:18;;:::i;:::-;9458:40;9511:5;;9280:246;9551:42;9589:3;9579:8;9573:4;9570:1;9551:42;:::i;:::-;9536:57;;;;9625:4;9620:3;9616:14;9609:5;9606:25;9603:51;;;9634:18;;:::i;:::-;9603:51;9683:4;9676:5;9672:16;9663:25;;8621:1073;;;;;;:::o;9700:281::-;9758:5;9782:23;9800:4;9782:23;:::i;:::-;9774:31;;9826:25;9842:8;9826:25;:::i;:::-;9814:37;;9870:104;9907:66;9897:8;9891:4;9870:104;:::i;:::-;9861:113;;9700:281;;;;:::o;9987:410::-;10027:7;10050:20;10068:1;10050:20;:::i;:::-;10045:25;;10084:20;10102:1;10084:20;:::i;:::-;10079:25;;10139:1;10136;10132:9;10161:30;10179:11;10161:30;:::i;:::-;10150:41;;10340:1;10331:7;10327:15;10324:1;10321:22;10301:1;10294:9;10274:83;10251:139;;10370:18;;:::i;:::-;10251:139;10035:362;9987:410;;;;:::o;10403:194::-;10443:4;10463:20;10481:1;10463:20;:::i;:::-;10458:25;;10497:20;10515:1;10497:20;:::i;:::-;10492:25;;10541:1;10538;10534:9;10526:17;;10565:1;10559:4;10556:11;10553:37;;;10570:18;;:::i;:::-;10553:37;10403:194;;;;:::o;10603:143::-;10660:5;10691:6;10685:13;10676:22;;10707:33;10734:5;10707:33;:::i;:::-;10603:143;;;;:::o;10752:351::-;10822:6;10871:2;10859:9;10850:7;10846:23;10842:32;10839:119;;;10877:79;;:::i;:::-;10839:119;10997:1;11022:64;11078:7;11069:6;11058:9;11054:22;11022:64;:::i;:::-;11012:74;;10968:128;10752:351;;;;:::o;11109:332::-;11230:4;11268:2;11257:9;11253:18;11245:26;;11281:71;11349:1;11338:9;11334:17;11325:6;11281:71;:::i;:::-;11362:72;11430:2;11419:9;11415:18;11406:6;11362:72;:::i;:::-;11109:332;;;;;:::o;11447:180::-;11495:77;11492:1;11485:88;11592:4;11589:1;11582:15;11616:4;11613:1;11606:15;11633:185;11673:1;11690:20;11708:1;11690:20;:::i;:::-;11685:25;;11724:20;11742:1;11724:20;:::i;:::-;11719:25;;11763:1;11753:35;;11768:18;;:::i;:::-;11753:35;11810:1;11807;11803:9;11798:14;;11633:185;;;;:::o;11824:180::-;11872:77;11869:1;11862:88;11969:4;11966:1;11959:15;11993:4;11990:1;11983:15;12010:180;12058:77;12055:1;12048:88;12155:4;12152:1;12145:15;12179:4;12176:1;12169:15;12196:85;12241:7;12270:5;12259:16;;12196:85;;;:::o;12287:60::-;12315:3;12336:5;12329:12;;12287:60;;;:::o;12353:158::-;12411:9;12444:61;12462:42;12471:32;12497:5;12471:32;:::i;:::-;12462:42;:::i;:::-;12444:61;:::i;:::-;12431:74;;12353:158;;;:::o;12517:147::-;12612:45;12651:5;12612:45;:::i;:::-;12607:3;12600:58;12517:147;;:::o;12670:114::-;12737:6;12771:5;12765:12;12755:22;;12670:114;;;:::o;12790:184::-;12889:11;12923:6;12918:3;12911:19;12963:4;12958:3;12954:14;12939:29;;12790:184;;;;:::o;12980:132::-;13047:4;13070:3;13062:11;;13100:4;13095:3;13091:14;13083:22;;12980:132;;;:::o;13118:108::-;13195:24;13213:5;13195:24;:::i;:::-;13190:3;13183:37;13118:108;;:::o;13232:179::-;13301:10;13322:46;13364:3;13356:6;13322:46;:::i;:::-;13400:4;13395:3;13391:14;13377:28;;13232:179;;;;:::o;13417:113::-;13487:4;13519;13514:3;13510:14;13502:22;;13417:113;;;:::o;13566:732::-;13685:3;13714:54;13762:5;13714:54;:::i;:::-;13784:86;13863:6;13858:3;13784:86;:::i;:::-;13777:93;;13894:56;13944:5;13894:56;:::i;:::-;13973:7;14004:1;13989:284;14014:6;14011:1;14008:13;13989:284;;;14090:6;14084:13;14117:63;14176:3;14161:13;14117:63;:::i;:::-;14110:70;;14203:60;14256:6;14203:60;:::i;:::-;14193:70;;14049:224;14036:1;14033;14029:9;14024:14;;13989:284;;;13993:14;14289:3;14282:10;;13690:608;;;13566:732;;;;:::o;14304:831::-;14567:4;14605:3;14594:9;14590:19;14582:27;;14619:71;14687:1;14676:9;14672:17;14663:6;14619:71;:::i;:::-;14700:80;14776:2;14765:9;14761:18;14752:6;14700:80;:::i;:::-;14827:9;14821:4;14817:20;14812:2;14801:9;14797:18;14790:48;14855:108;14958:4;14949:6;14855:108;:::i;:::-;14847:116;;14973:72;15041:2;15030:9;15026:18;15017:6;14973:72;:::i;:::-;15055:73;15123:3;15112:9;15108:19;15099:6;15055:73;:::i;:::-;14304:831;;;;;;;;:::o;15141:191::-;15181:3;15200:20;15218:1;15200:20;:::i;:::-;15195:25;;15234:20;15252:1;15234:20;:::i;:::-;15229:25;;15277:1;15274;15270:9;15263:16;;15298:3;15295:1;15292:10;15289:36;;;15305:18;;:::i;:::-;15289:36;15141:191;;;;:::o
Swarm Source
ipfs://fae85d7c8bb559f9155d7e92e15f6245ca56547f1ef049834a516e75908b4f84
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.