Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
TokenTracker
Latest 19 from a total of 19 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Approve | 19231552 | 201 days ago | IN | 0 ETH | 0.00093338 | ||||
Approve | 19216322 | 203 days ago | IN | 0 ETH | 0.00102483 | ||||
Approve | 19216294 | 203 days ago | IN | 0 ETH | 0.00128113 | ||||
Approve | 19216290 | 203 days ago | IN | 0 ETH | 0.0016395 | ||||
Approve | 19216281 | 203 days ago | IN | 0 ETH | 0.00124102 | ||||
Approve | 19216279 | 203 days ago | IN | 0 ETH | 0.001293 | ||||
Approve | 19216270 | 203 days ago | IN | 0 ETH | 0.0012699 | ||||
Approve | 19216223 | 203 days ago | IN | 0 ETH | 0.00118112 | ||||
Approve | 19216221 | 203 days ago | IN | 0 ETH | 0.00125302 | ||||
Approve | 19216220 | 203 days ago | IN | 0 ETH | 0.00144429 | ||||
Approve | 19216216 | 203 days ago | IN | 0 ETH | 0.00144985 | ||||
Approve | 19216216 | 203 days ago | IN | 0 ETH | 0.00154594 | ||||
Approve | 19216215 | 203 days ago | IN | 0 ETH | 0.00148496 | ||||
Approve | 19216210 | 203 days ago | IN | 0 ETH | 0.00179841 | ||||
Approve | 19216209 | 203 days ago | IN | 0 ETH | 0.00174353 | ||||
Approve | 19216209 | 203 days ago | IN | 0 ETH | 0.00183999 | ||||
Approve | 19216209 | 203 days ago | IN | 0 ETH | 0.00183999 | ||||
Approve | 19216152 | 203 days ago | IN | 0 ETH | 0.00129448 | ||||
0x60806040 | 19216092 | 203 days ago | IN | 0 ETH | 0.13948552 |
Latest 1 internal transaction
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
19216092 | 203 days ago | Contract Creation | 0 ETH |
Loading...
Loading
Contract Name:
DN404Rocks
Compiler Version
v0.8.19+commit.7dd6d404
Contract Source Code (Solidity Multiple files format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "./DN404.sol"; import "./DN404Mirror.sol"; import {Ownable} from "./Ownable.sol"; import {LibString} from "./LibString.sol"; import {SafeTransferLib} from "./SafeTransferLib.sol"; contract DN404Rocks is DN404, Ownable { string private _name; string private _symbol; string private _baseURI; constructor( address initialSupplyOwner ) { _initializeOwner(msg.sender); _name = "DN404 Rocks"; _symbol = "DNROCKS"; address mirror = address(new DN404Mirror(msg.sender)); _initializeDN404(10000 * 10 ** 18, initialSupplyOwner, mirror); } function name() public view override returns (string memory) { return _name; } function symbol() public view override returns (string memory) { return _symbol; } function tokenURI(uint256 tokenId) public view override returns (string memory result) { uint8 seed = uint8(bytes1(keccak256(abi.encodePacked(tokenId)))); string memory image; string memory color; if (seed <= 100) { image = "green.gif"; color = "Green"; } else if (seed <= 160) { image = "Blue.gif"; color = "Blue"; } else if (seed <= 210) { image = "brown.gif"; color = "Purple"; } else if (seed <= 240) { image = "WhiteGreen.gif"; color = "Orange"; } else if (seed <= 255) { image = "Red.gif"; color = "Red"; } string memory jsonPreImage = string.concat( string.concat( string.concat('{"name": "DNROCKS #', LibString.toString(tokenId)), '","description":"A collection of 10,000 Replicants enabled by DN404, an experimental token standard.","external_url":"https://dn404rocks.com/","image":"' ), string.concat(_baseURI, image) ); string memory jsonPostImage = string.concat( '","attributes":[{"trait_type":"Color","value":"', color ); string memory jsonPostTraits = '"}]}'; return string.concat( "data:application/json;utf8,", string.concat( string.concat(jsonPreImage, jsonPostImage), jsonPostTraits ) ); } function setBaseURI(string calldata baseURI_) public onlyOwner { _baseURI = baseURI_; } function withdraw() public onlyOwner { SafeTransferLib.safeTransferAllETH(msg.sender); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /// @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(); /// @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 */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @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; /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* 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 { // 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); $.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(); unchecked { t.fromBalance -= amount; fromAddressData.balance = uint96(t.fromBalance); toAddressData.balance = uint96(t.toBalance = toAddressData.balance + amount); 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); } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* 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 pragma solidity ^0.8.4; /// @notice Library for converting numbers into strings and other string operations. /// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/LibString.sol) /// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/LibString.sol) /// /// @dev Note: /// For performance and bytecode compactness, most of the string operations are restricted to /// byte strings (7-bit ASCII), except where otherwise specified. /// Usage of byte string operations on charsets with runes spanning two or more bytes /// can lead to undefined behavior. library LibString { /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* CUSTOM ERRORS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev The length of the output is too small to contain all the hex digits. error HexLengthInsufficient(); /// @dev The length of the string is more than 32 bytes. error TooBigForSmallString(); /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* CONSTANTS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev The constant returned when the `search` is not found in the string. uint256 internal constant NOT_FOUND = type(uint256).max; /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* DECIMAL OPERATIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Returns the base 10 decimal representation of `value`. function toString(uint256 value) internal pure returns (string memory str) { /// @solidity memory-safe-assembly assembly { // The maximum value of a uint256 contains 78 digits (1 byte per digit), but // we allocate 0xa0 bytes to keep the free memory pointer 32-byte word aligned. // We will need 1 word for the trailing zeros padding, 1 word for the length, // and 3 words for a maximum of 78 digits. str := add(mload(0x40), 0x80) // Update the free memory pointer to allocate. mstore(0x40, add(str, 0x20)) // Zeroize the slot after the string. mstore(str, 0) // Cache the end of the memory to calculate the length later. let end := str let w := not(0) // Tsk. // We write the string from rightmost digit to leftmost digit. // The following is essentially a do-while loop that also handles the zero case. for { let temp := value } 1 {} { str := add(str, w) // `sub(str, 1)`. // Write the character to the pointer. // The ASCII index of the '0' character is 48. mstore8(str, add(48, mod(temp, 10))) // Keep dividing `temp` until zero. temp := div(temp, 10) if iszero(temp) { break } } let length := sub(end, str) // Move the pointer 32 bytes leftwards to make room for the length. str := sub(str, 0x20) // Store the length. mstore(str, length) } } /// @dev Returns the base 10 decimal representation of `value`. function toString(int256 value) internal pure returns (string memory str) { if (value >= 0) { return toString(uint256(value)); } unchecked { str = toString(~uint256(value) + 1); } /// @solidity memory-safe-assembly assembly { // We still have some spare memory space on the left, // as we have allocated 3 words (96 bytes) for up to 78 digits. let length := mload(str) // Load the string length. mstore(str, 0x2d) // Store the '-' character. str := sub(str, 1) // Move back the string pointer by a byte. mstore(str, add(length, 1)) // Update the string length. } } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* HEXADECIMAL OPERATIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Returns the hexadecimal representation of `value`, /// left-padded to an input length of `length` bytes. /// The output is prefixed with "0x" encoded using 2 hexadecimal digits per byte, /// giving a total length of `length * 2 + 2` bytes. /// Reverts if `length` is too small for the output to contain all the digits. function toHexString(uint256 value, uint256 length) internal pure returns (string memory str) { str = toHexStringNoPrefix(value, length); /// @solidity memory-safe-assembly assembly { let strLength := add(mload(str), 2) // Compute the length. mstore(str, 0x3078) // Write the "0x" prefix. str := sub(str, 2) // Move the pointer. mstore(str, strLength) // Write the length. } } /// @dev Returns the hexadecimal representation of `value`, /// left-padded to an input length of `length` bytes. /// The output is prefixed with "0x" encoded using 2 hexadecimal digits per byte, /// giving a total length of `length * 2` bytes. /// Reverts if `length` is too small for the output to contain all the digits. function toHexStringNoPrefix(uint256 value, uint256 length) internal pure returns (string memory str) { /// @solidity memory-safe-assembly assembly { // We need 0x20 bytes for the trailing zeros padding, `length * 2` bytes // for the digits, 0x02 bytes for the prefix, and 0x20 bytes for the length. // We add 0x20 to the total and round down to a multiple of 0x20. // (0x20 + 0x20 + 0x02 + 0x20) = 0x62. str := add(mload(0x40), and(add(shl(1, length), 0x42), not(0x1f))) // Allocate the memory. mstore(0x40, add(str, 0x20)) // Zeroize the slot after the string. mstore(str, 0) // Cache the end to calculate the length later. let end := str // Store "0123456789abcdef" in scratch space. mstore(0x0f, 0x30313233343536373839616263646566) let start := sub(str, add(length, length)) let w := not(1) // Tsk. let temp := value // We write the string from rightmost digit to leftmost digit. // The following is essentially a do-while loop that also handles the zero case. for {} 1 {} { str := add(str, w) // `sub(str, 2)`. mstore8(add(str, 1), mload(and(temp, 15))) mstore8(str, mload(and(shr(4, temp), 15))) temp := shr(8, temp) if iszero(xor(str, start)) { break } } if temp { mstore(0x00, 0x2194895a) // `HexLengthInsufficient()`. revert(0x1c, 0x04) } // Compute the string's length. let strLength := sub(end, str) // Move the pointer and write the length. str := sub(str, 0x20) mstore(str, strLength) } } /// @dev Returns the hexadecimal representation of `value`. /// The output is prefixed with "0x" and encoded using 2 hexadecimal digits per byte. /// As address are 20 bytes long, the output will left-padded to have /// a length of `20 * 2 + 2` bytes. function toHexString(uint256 value) internal pure returns (string memory str) { str = toHexStringNoPrefix(value); /// @solidity memory-safe-assembly assembly { let strLength := add(mload(str), 2) // Compute the length. mstore(str, 0x3078) // Write the "0x" prefix. str := sub(str, 2) // Move the pointer. mstore(str, strLength) // Write the length. } } /// @dev Returns the hexadecimal representation of `value`. /// The output is prefixed with "0x". /// The output excludes leading "0" from the `toHexString` output. /// `0x00: "0x0", 0x01: "0x1", 0x12: "0x12", 0x123: "0x123"`. function toMinimalHexString(uint256 value) internal pure returns (string memory str) { str = toHexStringNoPrefix(value); /// @solidity memory-safe-assembly assembly { let o := eq(byte(0, mload(add(str, 0x20))), 0x30) // Whether leading zero is present. let strLength := add(mload(str), 2) // Compute the length. mstore(add(str, o), 0x3078) // Write the "0x" prefix, accounting for leading zero. str := sub(add(str, o), 2) // Move the pointer, accounting for leading zero. mstore(str, sub(strLength, o)) // Write the length, accounting for leading zero. } } /// @dev Returns the hexadecimal representation of `value`. /// The output excludes leading "0" from the `toHexStringNoPrefix` output. /// `0x00: "0", 0x01: "1", 0x12: "12", 0x123: "123"`. function toMinimalHexStringNoPrefix(uint256 value) internal pure returns (string memory str) { str = toHexStringNoPrefix(value); /// @solidity memory-safe-assembly assembly { let o := eq(byte(0, mload(add(str, 0x20))), 0x30) // Whether leading zero is present. let strLength := mload(str) // Get the length. str := add(str, o) // Move the pointer, accounting for leading zero. mstore(str, sub(strLength, o)) // Write the length, accounting for leading zero. } } /// @dev Returns the hexadecimal representation of `value`. /// The output is encoded using 2 hexadecimal digits per byte. /// As address are 20 bytes long, the output will left-padded to have /// a length of `20 * 2` bytes. function toHexStringNoPrefix(uint256 value) internal pure returns (string memory str) { /// @solidity memory-safe-assembly assembly { // We need 0x20 bytes for the trailing zeros padding, 0x20 bytes for the length, // 0x02 bytes for the prefix, and 0x40 bytes for the digits. // The next multiple of 0x20 above (0x20 + 0x20 + 0x02 + 0x40) is 0xa0. str := add(mload(0x40), 0x80) // Allocate the memory. mstore(0x40, add(str, 0x20)) // Zeroize the slot after the string. mstore(str, 0) // Cache the end to calculate the length later. let end := str // Store "0123456789abcdef" in scratch space. mstore(0x0f, 0x30313233343536373839616263646566) let w := not(1) // Tsk. // We write the string from rightmost digit to leftmost digit. // The following is essentially a do-while loop that also handles the zero case. for { let temp := value } 1 {} { str := add(str, w) // `sub(str, 2)`. mstore8(add(str, 1), mload(and(temp, 15))) mstore8(str, mload(and(shr(4, temp), 15))) temp := shr(8, temp) if iszero(temp) { break } } // Compute the string's length. let strLength := sub(end, str) // Move the pointer and write the length. str := sub(str, 0x20) mstore(str, strLength) } } /// @dev Returns the hexadecimal representation of `value`. /// The output is prefixed with "0x", encoded using 2 hexadecimal digits per byte, /// and the alphabets are capitalized conditionally according to /// https://eips.ethereum.org/EIPS/eip-55 function toHexStringChecksummed(address value) internal pure returns (string memory str) { str = toHexString(value); /// @solidity memory-safe-assembly assembly { let mask := shl(6, div(not(0), 255)) // `0b010000000100000000 ...` let o := add(str, 0x22) let hashed := and(keccak256(o, 40), mul(34, mask)) // `0b10001000 ... ` let t := shl(240, 136) // `0b10001000 << 240` for { let i := 0 } 1 {} { mstore(add(i, i), mul(t, byte(i, hashed))) i := add(i, 1) if eq(i, 20) { break } } mstore(o, xor(mload(o), shr(1, and(mload(0x00), and(mload(o), mask))))) o := add(o, 0x20) mstore(o, xor(mload(o), shr(1, and(mload(0x20), and(mload(o), mask))))) } } /// @dev Returns the hexadecimal representation of `value`. /// The output is prefixed with "0x" and encoded using 2 hexadecimal digits per byte. function toHexString(address value) internal pure returns (string memory str) { str = toHexStringNoPrefix(value); /// @solidity memory-safe-assembly assembly { let strLength := add(mload(str), 2) // Compute the length. mstore(str, 0x3078) // Write the "0x" prefix. str := sub(str, 2) // Move the pointer. mstore(str, strLength) // Write the length. } } /// @dev Returns the hexadecimal representation of `value`. /// The output is encoded using 2 hexadecimal digits per byte. function toHexStringNoPrefix(address value) internal pure returns (string memory str) { /// @solidity memory-safe-assembly assembly { str := mload(0x40) // Allocate the memory. // We need 0x20 bytes for the trailing zeros padding, 0x20 bytes for the length, // 0x02 bytes for the prefix, and 0x28 bytes for the digits. // The next multiple of 0x20 above (0x20 + 0x20 + 0x02 + 0x28) is 0x80. mstore(0x40, add(str, 0x80)) // Store "0123456789abcdef" in scratch space. mstore(0x0f, 0x30313233343536373839616263646566) str := add(str, 2) mstore(str, 40) let o := add(str, 0x20) mstore(add(o, 40), 0) value := shl(96, value) // We write the string from rightmost digit to leftmost digit. // The following is essentially a do-while loop that also handles the zero case. for { let i := 0 } 1 {} { let p := add(o, add(i, i)) let temp := byte(i, value) mstore8(add(p, 1), mload(and(temp, 15))) mstore8(p, mload(shr(4, temp))) i := add(i, 1) if eq(i, 20) { break } } } } /// @dev Returns the hex encoded string from the raw bytes. /// The output is encoded using 2 hexadecimal digits per byte. function toHexString(bytes memory raw) internal pure returns (string memory str) { str = toHexStringNoPrefix(raw); /// @solidity memory-safe-assembly assembly { let strLength := add(mload(str), 2) // Compute the length. mstore(str, 0x3078) // Write the "0x" prefix. str := sub(str, 2) // Move the pointer. mstore(str, strLength) // Write the length. } } /// @dev Returns the hex encoded string from the raw bytes. /// The output is encoded using 2 hexadecimal digits per byte. function toHexStringNoPrefix(bytes memory raw) internal pure returns (string memory str) { /// @solidity memory-safe-assembly assembly { let length := mload(raw) str := add(mload(0x40), 2) // Skip 2 bytes for the optional prefix. mstore(str, add(length, length)) // Store the length of the output. // Store "0123456789abcdef" in scratch space. mstore(0x0f, 0x30313233343536373839616263646566) let o := add(str, 0x20) let end := add(raw, length) for {} iszero(eq(raw, end)) {} { raw := add(raw, 1) mstore8(add(o, 1), mload(and(mload(raw), 15))) mstore8(o, mload(and(shr(4, mload(raw)), 15))) o := add(o, 2) } mstore(o, 0) // Zeroize the slot after the string. mstore(0x40, add(o, 0x20)) // Allocate the memory. } } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* RUNE STRING OPERATIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Returns the number of UTF characters in the string. function runeCount(string memory s) internal pure returns (uint256 result) { /// @solidity memory-safe-assembly assembly { if mload(s) { mstore(0x00, div(not(0), 255)) mstore(0x20, 0x0202020202020202020202020202020202020202020202020303030304040506) let o := add(s, 0x20) let end := add(o, mload(s)) for { result := 1 } 1 { result := add(result, 1) } { o := add(o, byte(0, mload(shr(250, mload(o))))) if iszero(lt(o, end)) { break } } } } } /// @dev Returns if this string is a 7-bit ASCII string. /// (i.e. all characters codes are in [0..127]) function is7BitASCII(string memory s) internal pure returns (bool result) { /// @solidity memory-safe-assembly assembly { let mask := shl(7, div(not(0), 255)) result := 1 let n := mload(s) if n { let o := add(s, 0x20) let end := add(o, n) let last := mload(end) mstore(end, 0) for {} 1 {} { if and(mask, mload(o)) { result := 0 break } o := add(o, 0x20) if iszero(lt(o, end)) { break } } mstore(end, last) } } } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* BYTE STRING OPERATIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ // For performance and bytecode compactness, byte string operations are restricted // to 7-bit ASCII strings. All offsets are byte offsets, not UTF character offsets. // Usage of byte string operations on charsets with runes spanning two or more bytes // can lead to undefined behavior. /// @dev Returns `subject` all occurrences of `search` replaced with `replacement`. function replace(string memory subject, string memory search, string memory replacement) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { let subjectLength := mload(subject) let searchLength := mload(search) let replacementLength := mload(replacement) subject := add(subject, 0x20) search := add(search, 0x20) replacement := add(replacement, 0x20) result := add(mload(0x40), 0x20) let subjectEnd := add(subject, subjectLength) if iszero(gt(searchLength, subjectLength)) { let subjectSearchEnd := add(sub(subjectEnd, searchLength), 1) let h := 0 if iszero(lt(searchLength, 0x20)) { h := keccak256(search, searchLength) } let m := shl(3, sub(0x20, and(searchLength, 0x1f))) let s := mload(search) for {} 1 {} { let t := mload(subject) // Whether the first `searchLength % 32` bytes of // `subject` and `search` matches. if iszero(shr(m, xor(t, s))) { if h { if iszero(eq(keccak256(subject, searchLength), h)) { mstore(result, t) result := add(result, 1) subject := add(subject, 1) if iszero(lt(subject, subjectSearchEnd)) { break } continue } } // Copy the `replacement` one word at a time. for { let o := 0 } 1 {} { mstore(add(result, o), mload(add(replacement, o))) o := add(o, 0x20) if iszero(lt(o, replacementLength)) { break } } result := add(result, replacementLength) subject := add(subject, searchLength) if searchLength { if iszero(lt(subject, subjectSearchEnd)) { break } continue } } mstore(result, t) result := add(result, 1) subject := add(subject, 1) if iszero(lt(subject, subjectSearchEnd)) { break } } } let resultRemainder := result result := add(mload(0x40), 0x20) let k := add(sub(resultRemainder, result), sub(subjectEnd, subject)) // Copy the rest of the string one word at a time. for {} lt(subject, subjectEnd) {} { mstore(resultRemainder, mload(subject)) resultRemainder := add(resultRemainder, 0x20) subject := add(subject, 0x20) } result := sub(result, 0x20) let last := add(add(result, 0x20), k) // Zeroize the slot after the string. mstore(last, 0) mstore(0x40, add(last, 0x20)) // Allocate the memory. mstore(result, k) // Store the length. } } /// @dev Returns the byte index of the first location of `search` in `subject`, /// searching from left to right, starting from `from`. /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `search` is not found. function indexOf(string memory subject, string memory search, uint256 from) internal pure returns (uint256 result) { /// @solidity memory-safe-assembly assembly { for { let subjectLength := mload(subject) } 1 {} { if iszero(mload(search)) { if iszero(gt(from, subjectLength)) { result := from break } result := subjectLength break } let searchLength := mload(search) let subjectStart := add(subject, 0x20) result := not(0) // Initialize to `NOT_FOUND`. subject := add(subjectStart, from) let end := add(sub(add(subjectStart, subjectLength), searchLength), 1) let m := shl(3, sub(0x20, and(searchLength, 0x1f))) let s := mload(add(search, 0x20)) if iszero(and(lt(subject, end), lt(from, subjectLength))) { break } if iszero(lt(searchLength, 0x20)) { for { let h := keccak256(add(search, 0x20), searchLength) } 1 {} { if iszero(shr(m, xor(mload(subject), s))) { if eq(keccak256(subject, searchLength), h) { result := sub(subject, subjectStart) break } } subject := add(subject, 1) if iszero(lt(subject, end)) { break } } break } for {} 1 {} { if iszero(shr(m, xor(mload(subject), s))) { result := sub(subject, subjectStart) break } subject := add(subject, 1) if iszero(lt(subject, end)) { break } } break } } } /// @dev Returns the byte index of the first location of `search` in `subject`, /// searching from left to right. /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `search` is not found. function indexOf(string memory subject, string memory search) internal pure returns (uint256 result) { result = indexOf(subject, search, 0); } /// @dev Returns the byte index of the first location of `search` in `subject`, /// searching from right to left, starting from `from`. /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `search` is not found. function lastIndexOf(string memory subject, string memory search, uint256 from) internal pure returns (uint256 result) { /// @solidity memory-safe-assembly assembly { for {} 1 {} { result := not(0) // Initialize to `NOT_FOUND`. let searchLength := mload(search) if gt(searchLength, mload(subject)) { break } let w := result let fromMax := sub(mload(subject), searchLength) if iszero(gt(fromMax, from)) { from := fromMax } let end := add(add(subject, 0x20), w) subject := add(add(subject, 0x20), from) if iszero(gt(subject, end)) { break } // As this function is not too often used, // we shall simply use keccak256 for smaller bytecode size. for { let h := keccak256(add(search, 0x20), searchLength) } 1 {} { if eq(keccak256(subject, searchLength), h) { result := sub(subject, add(end, 1)) break } subject := add(subject, w) // `sub(subject, 1)`. if iszero(gt(subject, end)) { break } } break } } } /// @dev Returns the byte index of the first location of `search` in `subject`, /// searching from right to left. /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `search` is not found. function lastIndexOf(string memory subject, string memory search) internal pure returns (uint256 result) { result = lastIndexOf(subject, search, uint256(int256(-1))); } /// @dev Returns true if `search` is found in `subject`, false otherwise. function contains(string memory subject, string memory search) internal pure returns (bool) { return indexOf(subject, search) != NOT_FOUND; } /// @dev Returns whether `subject` starts with `search`. function startsWith(string memory subject, string memory search) internal pure returns (bool result) { /// @solidity memory-safe-assembly assembly { let searchLength := mload(search) // Just using keccak256 directly is actually cheaper. // forgefmt: disable-next-item result := and( iszero(gt(searchLength, mload(subject))), eq( keccak256(add(subject, 0x20), searchLength), keccak256(add(search, 0x20), searchLength) ) ) } } /// @dev Returns whether `subject` ends with `search`. function endsWith(string memory subject, string memory search) internal pure returns (bool result) { /// @solidity memory-safe-assembly assembly { let searchLength := mload(search) let subjectLength := mload(subject) // Whether `search` is not longer than `subject`. let withinRange := iszero(gt(searchLength, subjectLength)) // Just using keccak256 directly is actually cheaper. // forgefmt: disable-next-item result := and( withinRange, eq( keccak256( // `subject + 0x20 + max(subjectLength - searchLength, 0)`. add(add(subject, 0x20), mul(withinRange, sub(subjectLength, searchLength))), searchLength ), keccak256(add(search, 0x20), searchLength) ) ) } } /// @dev Returns `subject` repeated `times`. function repeat(string memory subject, uint256 times) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { let subjectLength := mload(subject) if iszero(or(iszero(times), iszero(subjectLength))) { subject := add(subject, 0x20) result := mload(0x40) let output := add(result, 0x20) for {} 1 {} { // Copy the `subject` one word at a time. for { let o := 0 } 1 {} { mstore(add(output, o), mload(add(subject, o))) o := add(o, 0x20) if iszero(lt(o, subjectLength)) { break } } output := add(output, subjectLength) times := sub(times, 1) if iszero(times) { break } } mstore(output, 0) // Zeroize the slot after the string. let resultLength := sub(output, add(result, 0x20)) mstore(result, resultLength) // Store the length. // Allocate the memory. mstore(0x40, add(result, add(resultLength, 0x20))) } } } /// @dev Returns a copy of `subject` sliced from `start` to `end` (exclusive). /// `start` and `end` are byte offsets. function slice(string memory subject, uint256 start, uint256 end) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { let subjectLength := mload(subject) if iszero(gt(subjectLength, end)) { end := subjectLength } if iszero(gt(subjectLength, start)) { start := subjectLength } if lt(start, end) { result := mload(0x40) let resultLength := sub(end, start) mstore(result, resultLength) subject := add(subject, start) let w := not(0x1f) // Copy the `subject` one word at a time, backwards. for { let o := and(add(resultLength, 0x1f), w) } 1 {} { mstore(add(result, o), mload(add(subject, o))) o := add(o, w) // `sub(o, 0x20)`. if iszero(o) { break } } // Zeroize the slot after the string. mstore(add(add(result, 0x20), resultLength), 0) // Allocate memory for the length and the bytes, // rounded up to a multiple of 32. mstore(0x40, add(result, and(add(resultLength, 0x3f), w))) } } } /// @dev Returns a copy of `subject` sliced from `start` to the end of the string. /// `start` is a byte offset. function slice(string memory subject, uint256 start) internal pure returns (string memory result) { result = slice(subject, start, uint256(int256(-1))); } /// @dev Returns all the indices of `search` in `subject`. /// The indices are byte offsets. function indicesOf(string memory subject, string memory search) internal pure returns (uint256[] memory result) { /// @solidity memory-safe-assembly assembly { let subjectLength := mload(subject) let searchLength := mload(search) if iszero(gt(searchLength, subjectLength)) { subject := add(subject, 0x20) search := add(search, 0x20) result := add(mload(0x40), 0x20) let subjectStart := subject let subjectSearchEnd := add(sub(add(subject, subjectLength), searchLength), 1) let h := 0 if iszero(lt(searchLength, 0x20)) { h := keccak256(search, searchLength) } let m := shl(3, sub(0x20, and(searchLength, 0x1f))) let s := mload(search) for {} 1 {} { let t := mload(subject) // Whether the first `searchLength % 32` bytes of // `subject` and `search` matches. if iszero(shr(m, xor(t, s))) { if h { if iszero(eq(keccak256(subject, searchLength), h)) { subject := add(subject, 1) if iszero(lt(subject, subjectSearchEnd)) { break } continue } } // Append to `result`. mstore(result, sub(subject, subjectStart)) result := add(result, 0x20) // Advance `subject` by `searchLength`. subject := add(subject, searchLength) if searchLength { if iszero(lt(subject, subjectSearchEnd)) { break } continue } } subject := add(subject, 1) if iszero(lt(subject, subjectSearchEnd)) { break } } let resultEnd := result // Assign `result` to the free memory pointer. result := mload(0x40) // Store the length of `result`. mstore(result, shr(5, sub(resultEnd, add(result, 0x20)))) // Allocate memory for result. // We allocate one more word, so this array can be recycled for {split}. mstore(0x40, add(resultEnd, 0x20)) } } } /// @dev Returns a arrays of strings based on the `delimiter` inside of the `subject` string. function split(string memory subject, string memory delimiter) internal pure returns (string[] memory result) { uint256[] memory indices = indicesOf(subject, delimiter); /// @solidity memory-safe-assembly assembly { let w := not(0x1f) let indexPtr := add(indices, 0x20) let indicesEnd := add(indexPtr, shl(5, add(mload(indices), 1))) mstore(add(indicesEnd, w), mload(subject)) mstore(indices, add(mload(indices), 1)) let prevIndex := 0 for {} 1 {} { let index := mload(indexPtr) mstore(indexPtr, 0x60) if iszero(eq(index, prevIndex)) { let element := mload(0x40) let elementLength := sub(index, prevIndex) mstore(element, elementLength) // Copy the `subject` one word at a time, backwards. for { let o := and(add(elementLength, 0x1f), w) } 1 {} { mstore(add(element, o), mload(add(add(subject, prevIndex), o))) o := add(o, w) // `sub(o, 0x20)`. if iszero(o) { break } } // Zeroize the slot after the string. mstore(add(add(element, 0x20), elementLength), 0) // Allocate memory for the length and the bytes, // rounded up to a multiple of 32. mstore(0x40, add(element, and(add(elementLength, 0x3f), w))) // Store the `element` into the array. mstore(indexPtr, element) } prevIndex := add(index, mload(delimiter)) indexPtr := add(indexPtr, 0x20) if iszero(lt(indexPtr, indicesEnd)) { break } } result := indices if iszero(mload(delimiter)) { result := add(indices, 0x20) mstore(result, sub(mload(indices), 2)) } } } /// @dev Returns a concatenated string of `a` and `b`. /// Cheaper than `string.concat()` and does not de-align the free memory pointer. function concat(string memory a, string memory b) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { let w := not(0x1f) result := mload(0x40) let aLength := mload(a) // Copy `a` one word at a time, backwards. for { let o := and(add(aLength, 0x20), w) } 1 {} { mstore(add(result, o), mload(add(a, o))) o := add(o, w) // `sub(o, 0x20)`. if iszero(o) { break } } let bLength := mload(b) let output := add(result, aLength) // Copy `b` one word at a time, backwards. for { let o := and(add(bLength, 0x20), w) } 1 {} { mstore(add(output, o), mload(add(b, o))) o := add(o, w) // `sub(o, 0x20)`. if iszero(o) { break } } let totalLength := add(aLength, bLength) let last := add(add(result, 0x20), totalLength) // Zeroize the slot after the string. mstore(last, 0) // Stores the length. mstore(result, totalLength) // Allocate memory for the length and the bytes, // rounded up to a multiple of 32. mstore(0x40, and(add(last, 0x1f), w)) } } /// @dev Returns a copy of the string in either lowercase or UPPERCASE. /// WARNING! This function is only compatible with 7-bit ASCII strings. function toCase(string memory subject, bool toUpper) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { let length := mload(subject) if length { result := add(mload(0x40), 0x20) subject := add(subject, 1) let flags := shl(add(70, shl(5, toUpper)), 0x3ffffff) let w := not(0) for { let o := length } 1 {} { o := add(o, w) let b := and(0xff, mload(add(subject, o))) mstore8(add(result, o), xor(b, and(shr(b, flags), 0x20))) if iszero(o) { break } } result := mload(0x40) mstore(result, length) // Store the length. let last := add(add(result, 0x20), length) mstore(last, 0) // Zeroize the slot after the string. mstore(0x40, add(last, 0x20)) // Allocate the memory. } } } /// @dev Returns a string from a small bytes32 string. /// `s` must be null-terminated, or behavior will be undefined. function fromSmallString(bytes32 s) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { result := mload(0x40) let n := 0 for {} byte(n, s) { n := add(n, 1) } {} // Scan for '\0'. mstore(result, n) let o := add(result, 0x20) mstore(o, s) mstore(add(o, n), 0) mstore(0x40, add(result, 0x40)) } } /// @dev Returns the small string, with all bytes after the first null byte zeroized. function normalizeSmallString(bytes32 s) internal pure returns (bytes32 result) { /// @solidity memory-safe-assembly assembly { for {} byte(result, s) { result := add(result, 1) } {} // Scan for '\0'. mstore(0x00, s) mstore(result, 0x00) result := mload(0x00) } } /// @dev Returns the string as a normalized null-terminated small string. function toSmallString(string memory s) internal pure returns (bytes32 result) { /// @solidity memory-safe-assembly assembly { result := mload(s) if iszero(lt(result, 33)) { mstore(0x00, 0xec92f9a3) // `TooBigForSmallString()`. revert(0x1c, 0x04) } result := shl(shl(3, sub(32, result)), mload(add(s, result))) } } /// @dev Returns a lowercased copy of the string. /// WARNING! This function is only compatible with 7-bit ASCII strings. function lower(string memory subject) internal pure returns (string memory result) { result = toCase(subject, false); } /// @dev Returns an UPPERCASED copy of the string. /// WARNING! This function is only compatible with 7-bit ASCII strings. function upper(string memory subject) internal pure returns (string memory result) { result = toCase(subject, true); } /// @dev Escapes the string to be used within HTML tags. function escapeHTML(string memory s) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { let end := add(s, mload(s)) result := add(mload(0x40), 0x20) // Store the bytes of the packed offsets and strides into the scratch space. // `packed = (stride << 5) | offset`. Max offset is 20. Max stride is 6. mstore(0x1f, 0x900094) mstore(0x08, 0xc0000000a6ab) // Store ""&'<>" into the scratch space. mstore(0x00, shl(64, 0x2671756f743b26616d703b262333393b266c743b2667743b)) for {} iszero(eq(s, end)) {} { s := add(s, 1) let c := and(mload(s), 0xff) // Not in `["\"","'","&","<",">"]`. if iszero(and(shl(c, 1), 0x500000c400000000)) { mstore8(result, c) result := add(result, 1) continue } let t := shr(248, mload(c)) mstore(result, mload(and(t, 0x1f))) result := add(result, shr(5, t)) } let last := result mstore(last, 0) // Zeroize the slot after the string. result := mload(0x40) mstore(result, sub(last, add(result, 0x20))) // Store the length. mstore(0x40, add(last, 0x20)) // Allocate the memory. } } /// @dev Escapes the string to be used within double-quotes in a JSON. /// If `addDoubleQuotes` is true, the result will be enclosed in double-quotes. function escapeJSON(string memory s, bool addDoubleQuotes) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { let end := add(s, mload(s)) result := add(mload(0x40), 0x20) if addDoubleQuotes { mstore8(result, 34) result := add(1, result) } // Store "\\u0000" in scratch space. // Store "0123456789abcdef" in scratch space. // Also, store `{0x08:"b", 0x09:"t", 0x0a:"n", 0x0c:"f", 0x0d:"r"}`. // into the scratch space. mstore(0x15, 0x5c75303030303031323334353637383961626364656662746e006672) // Bitmask for detecting `["\"","\\"]`. let e := or(shl(0x22, 1), shl(0x5c, 1)) for {} iszero(eq(s, end)) {} { s := add(s, 1) let c := and(mload(s), 0xff) if iszero(lt(c, 0x20)) { if iszero(and(shl(c, 1), e)) { // Not in `["\"","\\"]`. mstore8(result, c) result := add(result, 1) continue } mstore8(result, 0x5c) // "\\". mstore8(add(result, 1), c) result := add(result, 2) continue } if iszero(and(shl(c, 1), 0x3700)) { // Not in `["\b","\t","\n","\f","\d"]`. mstore8(0x1d, mload(shr(4, c))) // Hex value. mstore8(0x1e, mload(and(c, 15))) // Hex value. mstore(result, mload(0x19)) // "\\u00XX". result := add(result, 6) continue } mstore8(result, 0x5c) // "\\". mstore8(add(result, 1), mload(add(c, 8))) result := add(result, 2) } if addDoubleQuotes { mstore8(result, 34) result := add(1, result) } let last := result mstore(last, 0) // Zeroize the slot after the string. result := mload(0x40) mstore(result, sub(last, add(result, 0x20))) // Store the length. mstore(0x40, add(last, 0x20)) // Allocate the memory. } } /// @dev Escapes the string to be used within double-quotes in a JSON. function escapeJSON(string memory s) internal pure returns (string memory result) { result = escapeJSON(s, false); } /// @dev Returns whether `a` equals `b`. function eq(string memory a, string memory b) internal pure returns (bool result) { /// @solidity memory-safe-assembly assembly { result := eq(keccak256(add(a, 0x20), mload(a)), keccak256(add(b, 0x20), mload(b))) } } /// @dev Returns whether `a` equals `b`, where `b` is a null-terminated small string. function eqs(string memory a, bytes32 b) internal pure returns (bool result) { /// @solidity memory-safe-assembly assembly { // These should be evaluated on compile time, as far as possible. let m := not(shl(7, div(not(iszero(b)), 255))) // `0x7f7f ...`. let x := not(or(m, or(b, add(m, and(b, m))))) let r := shl(7, iszero(iszero(shr(128, x)))) r := or(r, shl(6, iszero(iszero(shr(64, shr(r, x)))))) r := or(r, shl(5, lt(0xffffffff, shr(r, x)))) r := or(r, shl(4, lt(0xffff, shr(r, x)))) r := or(r, shl(3, lt(0xff, shr(r, x)))) // forgefmt: disable-next-item result := gt(eq(mload(a), add(iszero(x), xor(31, shr(3, r)))), xor(shr(add(8, r), b), shr(add(8, r), mload(add(a, 0x20))))) } } /// @dev Packs a single string with its length into a single word. /// Returns `bytes32(0)` if the length is zero or greater than 31. function packOne(string memory a) internal pure returns (bytes32 result) { /// @solidity memory-safe-assembly assembly { // We don't need to zero right pad the string, // since this is our own custom non-standard packing scheme. result := mul( // Load the length and the bytes. mload(add(a, 0x1f)), // `length != 0 && length < 32`. Abuses underflow. // Assumes that the length is valid and within the block gas limit. lt(sub(mload(a), 1), 0x1f) ) } } /// @dev Unpacks a string packed using {packOne}. /// Returns the empty string if `packed` is `bytes32(0)`. /// If `packed` is not an output of {packOne}, the output behavior is undefined. function unpackOne(bytes32 packed) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { // Grab the free memory pointer. result := mload(0x40) // Allocate 2 words (1 for the length, 1 for the bytes). mstore(0x40, add(result, 0x40)) // Zeroize the length slot. mstore(result, 0) // Store the length and bytes. mstore(add(result, 0x1f), packed) // Right pad with zeroes. mstore(add(add(result, 0x20), mload(result)), 0) } } /// @dev Packs two strings with their lengths into a single word. /// Returns `bytes32(0)` if combined length is zero or greater than 30. function packTwo(string memory a, string memory b) internal pure returns (bytes32 result) { /// @solidity memory-safe-assembly assembly { let aLength := mload(a) // We don't need to zero right pad the strings, // since this is our own custom non-standard packing scheme. result := mul( // Load the length and the bytes of `a` and `b`. or( shl(shl(3, sub(0x1f, aLength)), mload(add(a, aLength))), mload(sub(add(b, 0x1e), aLength)) ), // `totalLength != 0 && totalLength < 31`. Abuses underflow. // Assumes that the lengths are valid and within the block gas limit. lt(sub(add(aLength, mload(b)), 1), 0x1e) ) } } /// @dev Unpacks strings packed using {packTwo}. /// Returns the empty strings if `packed` is `bytes32(0)`. /// If `packed` is not an output of {packTwo}, the output behavior is undefined. function unpackTwo(bytes32 packed) internal pure returns (string memory resultA, string memory resultB) { /// @solidity memory-safe-assembly assembly { // Grab the free memory pointer. resultA := mload(0x40) resultB := add(resultA, 0x40) // Allocate 2 words for each string (1 for the length, 1 for the byte). Total 4 words. mstore(0x40, add(resultB, 0x40)) // Zeroize the length slots. mstore(resultA, 0) mstore(resultB, 0) // Store the lengths and bytes. mstore(add(resultA, 0x1f), packed) mstore(add(resultB, 0x1f), mload(add(add(resultA, 0x20), mload(resultA)))) // Right pad with zeroes. mstore(add(add(resultA, 0x20), mload(resultA)), 0) mstore(add(add(resultB, 0x20), mload(resultB)), 0) } } /// @dev Directly returns `a` without copying. function directReturn(string memory a) internal pure { assembly { // Assumes that the string does not start from the scratch space. let retStart := sub(a, 0x20) let retSize := add(mload(a), 0x40) // Right pad with zeroes. Just in case the string is produced // by a method that doesn't zero right pad. mstore(add(retStart, retSize), 0) // Store the return offset. mstore(retStart, 0x20) // End the transaction, returning the string. return(retStart, retSize) } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /// @notice Simple single owner authorization mixin. /// @author Solady (https://github.com/vectorized/solady/blob/main/src/auth/Ownable.sol) /// /// @dev Note: /// This implementation does NOT auto-initialize the owner to `msg.sender`. /// You MUST call the `_initializeOwner` in the constructor / initializer. /// /// While the ownable portion follows /// [EIP-173](https://eips.ethereum.org/EIPS/eip-173) for compatibility, /// the nomenclature for the 2-step ownership handover may be unique to this codebase. abstract contract Ownable { /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* CUSTOM ERRORS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev The caller is not authorized to call the function. error Unauthorized(); /// @dev The `newOwner` cannot be the zero address. error NewOwnerIsZeroAddress(); /// @dev The `pendingOwner` does not have a valid handover request. error NoHandoverRequest(); /// @dev Cannot double-initialize. error AlreadyInitialized(); /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* EVENTS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev The ownership is transferred from `oldOwner` to `newOwner`. /// This event is intentionally kept the same as OpenZeppelin's Ownable to be /// compatible with indexers and [EIP-173](https://eips.ethereum.org/EIPS/eip-173), /// despite it not being as lightweight as a single argument event. event OwnershipTransferred(address indexed oldOwner, address indexed newOwner); /// @dev An ownership handover to `pendingOwner` has been requested. event OwnershipHandoverRequested(address indexed pendingOwner); /// @dev The ownership handover to `pendingOwner` has been canceled. event OwnershipHandoverCanceled(address indexed pendingOwner); /// @dev `keccak256(bytes("OwnershipTransferred(address,address)"))`. uint256 private constant _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE = 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0; /// @dev `keccak256(bytes("OwnershipHandoverRequested(address)"))`. uint256 private constant _OWNERSHIP_HANDOVER_REQUESTED_EVENT_SIGNATURE = 0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d; /// @dev `keccak256(bytes("OwnershipHandoverCanceled(address)"))`. uint256 private constant _OWNERSHIP_HANDOVER_CANCELED_EVENT_SIGNATURE = 0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92; /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* STORAGE */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev The owner slot is given by: /// `bytes32(~uint256(uint32(bytes4(keccak256("_OWNER_SLOT_NOT")))))`. /// It is intentionally chosen to be a high value /// to avoid collision with lower slots. /// The choice of manual storage layout is to enable compatibility /// with both regular and upgradeable contracts. bytes32 internal constant _OWNER_SLOT = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927; /// The ownership handover slot of `newOwner` is given by: /// ``` /// mstore(0x00, or(shl(96, user), _HANDOVER_SLOT_SEED)) /// let handoverSlot := keccak256(0x00, 0x20) /// ``` /// It stores the expiry timestamp of the two-step ownership handover. uint256 private constant _HANDOVER_SLOT_SEED = 0x389a75e1; /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* INTERNAL FUNCTIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Override to return true to make `_initializeOwner` prevent double-initialization. function _guardInitializeOwner() internal pure virtual returns (bool guard) {} /// @dev Initializes the owner directly without authorization guard. /// This function must be called upon initialization, /// regardless of whether the contract is upgradeable or not. /// This is to enable generalization to both regular and upgradeable contracts, /// and to save gas in case the initial owner is not the caller. /// For performance reasons, this function will not check if there /// is an existing owner. function _initializeOwner(address newOwner) internal virtual { if (_guardInitializeOwner()) { /// @solidity memory-safe-assembly assembly { let ownerSlot := _OWNER_SLOT if sload(ownerSlot) { mstore(0x00, 0x0dc149f0) // `AlreadyInitialized()`. revert(0x1c, 0x04) } // Clean the upper 96 bits. newOwner := shr(96, shl(96, newOwner)) // Store the new value. sstore(ownerSlot, or(newOwner, shl(255, iszero(newOwner)))) // Emit the {OwnershipTransferred} event. log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, 0, newOwner) } } else { /// @solidity memory-safe-assembly assembly { // Clean the upper 96 bits. newOwner := shr(96, shl(96, newOwner)) // Store the new value. sstore(_OWNER_SLOT, newOwner) // Emit the {OwnershipTransferred} event. log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, 0, newOwner) } } } /// @dev Sets the owner directly without authorization guard. function _setOwner(address newOwner) internal virtual { if (_guardInitializeOwner()) { /// @solidity memory-safe-assembly assembly { let ownerSlot := _OWNER_SLOT // Clean the upper 96 bits. newOwner := shr(96, shl(96, newOwner)) // Emit the {OwnershipTransferred} event. log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, sload(ownerSlot), newOwner) // Store the new value. sstore(ownerSlot, or(newOwner, shl(255, iszero(newOwner)))) } } else { /// @solidity memory-safe-assembly assembly { let ownerSlot := _OWNER_SLOT // Clean the upper 96 bits. newOwner := shr(96, shl(96, newOwner)) // Emit the {OwnershipTransferred} event. log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, sload(ownerSlot), newOwner) // Store the new value. sstore(ownerSlot, newOwner) } } } /// @dev Throws if the sender is not the owner. function _checkOwner() internal view virtual { /// @solidity memory-safe-assembly assembly { // If the caller is not the stored owner, revert. if iszero(eq(caller(), sload(_OWNER_SLOT))) { mstore(0x00, 0x82b42900) // `Unauthorized()`. revert(0x1c, 0x04) } } } /// @dev Returns how long a two-step ownership handover is valid for in seconds. /// Override to return a different value if needed. /// Made internal to conserve bytecode. Wrap it in a public function if needed. function _ownershipHandoverValidFor() internal view virtual returns (uint64) { return 48 * 3600; } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* PUBLIC UPDATE FUNCTIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Allows the owner to transfer the ownership to `newOwner`. function transferOwnership(address newOwner) public payable virtual onlyOwner { /// @solidity memory-safe-assembly assembly { if iszero(shl(96, newOwner)) { mstore(0x00, 0x7448fbae) // `NewOwnerIsZeroAddress()`. revert(0x1c, 0x04) } } _setOwner(newOwner); } /// @dev Allows the owner to renounce their ownership. function renounceOwnership() public payable virtual onlyOwner { _setOwner(address(0)); } /// @dev Request a two-step ownership handover to the caller. /// The request will automatically expire in 48 hours (172800 seconds) by default. function requestOwnershipHandover() public payable virtual { unchecked { uint256 expires = block.timestamp + _ownershipHandoverValidFor(); /// @solidity memory-safe-assembly assembly { // Compute and set the handover slot to `expires`. mstore(0x0c, _HANDOVER_SLOT_SEED) mstore(0x00, caller()) sstore(keccak256(0x0c, 0x20), expires) // Emit the {OwnershipHandoverRequested} event. log2(0, 0, _OWNERSHIP_HANDOVER_REQUESTED_EVENT_SIGNATURE, caller()) } } } /// @dev Cancels the two-step ownership handover to the caller, if any. function cancelOwnershipHandover() public payable virtual { /// @solidity memory-safe-assembly assembly { // Compute and set the handover slot to 0. mstore(0x0c, _HANDOVER_SLOT_SEED) mstore(0x00, caller()) sstore(keccak256(0x0c, 0x20), 0) // Emit the {OwnershipHandoverCanceled} event. log2(0, 0, _OWNERSHIP_HANDOVER_CANCELED_EVENT_SIGNATURE, caller()) } } /// @dev Allows the owner to complete the two-step ownership handover to `pendingOwner`. /// Reverts if there is no existing ownership handover requested by `pendingOwner`. function completeOwnershipHandover(address pendingOwner) public payable virtual onlyOwner { /// @solidity memory-safe-assembly assembly { // Compute and set the handover slot to 0. mstore(0x0c, _HANDOVER_SLOT_SEED) mstore(0x00, pendingOwner) let handoverSlot := keccak256(0x0c, 0x20) // If the handover does not exist, or has expired. if gt(timestamp(), sload(handoverSlot)) { mstore(0x00, 0x6f5e8818) // `NoHandoverRequest()`. revert(0x1c, 0x04) } // Set the handover slot to 0. sstore(handoverSlot, 0) } _setOwner(pendingOwner); } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* PUBLIC READ FUNCTIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Returns the owner of the contract. function owner() public view virtual returns (address result) { /// @solidity memory-safe-assembly assembly { result := sload(_OWNER_SLOT) } } /// @dev Returns the expiry timestamp for the two-step ownership handover to `pendingOwner`. function ownershipHandoverExpiresAt(address pendingOwner) public view virtual returns (uint256 result) { /// @solidity memory-safe-assembly assembly { // Compute the handover slot. mstore(0x0c, _HANDOVER_SLOT_SEED) mstore(0x00, pendingOwner) // Load the handover slot. result := sload(keccak256(0x0c, 0x20)) } } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* MODIFIERS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Marks a function as only callable by the owner. modifier onlyOwner() virtual { _checkOwner(); _; } }
// 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) ) ) } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"initialSupplyOwner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadyInitialized","type":"error"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"DNAlreadyInitialized","type":"error"},{"inputs":[],"name":"InsufficientAllowance","type":"error"},{"inputs":[],"name":"InsufficientBalance","type":"error"},{"inputs":[],"name":"LinkMirrorContractFailed","type":"error"},{"inputs":[],"name":"MirrorAddressIsZero","type":"error"},{"inputs":[],"name":"NewOwnerIsZeroAddress","type":"error"},{"inputs":[],"name":"NoHandoverRequest","type":"error"},{"inputs":[],"name":"SenderNotMirror","type":"error"},{"inputs":[],"name":"TokenDoesNotExist","type":"error"},{"inputs":[],"name":"TotalSupplyOverflow","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"Unauthorized","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":"amount","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipHandoverCanceled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipHandoverRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"target","type":"address"},{"indexed":false,"internalType":"bool","name":"status","type":"bool"}],"name":"SkipNFTSet","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":"amount","type":"uint256"}],"name":"Transfer","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cancelOwnershipHandover","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"pendingOwner","type":"address"}],"name":"completeOwnershipHandover","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"a","type":"address"}],"name":"getSkipNFT","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mirrorERC721","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"result","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"pendingOwner","type":"address"}],"name":"ownershipHandoverExpiresAt","outputs":[{"internalType":"uint256","name":"result","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"requestOwnershipHandover","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"string","name":"baseURI_","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"result","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"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60806040523480156200001157600080fd5b50604051620058e7380380620058e783398181016040528101906200003791906200076e565b62000048336200013860201b60201c565b6040518060400160405280600b81526020017f444e34303420526f636b73000000000000000000000000000000000000000000815250600090816200008e919062000a1a565b506040518060400160405280600781526020017f444e524f434b530000000000000000000000000000000000000000000000000081525060019081620000d5919062000a1a565b50600033604051620000e790620006f6565b620000f3919062000b12565b604051809103906000f08015801562000110573d6000803e3d6000fd5b5090506200013069021e19e0c9bab240000083836200021e60201b60201c565b505062000b97565b620001486200051c60201b60201c565b15620001c6577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278054156200018557630dc149f06000526004601cfd5b8160601b60601c9150811560ff1b821781558160007f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3506200021b565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927558060007f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a35b50565b6000620002306200052160201b60201c565b905060008160000160049054906101000a900463ffffffff1663ffffffff161462000287576040517fead4d2e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603620002ee576040517f39a84a7b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b620002ff826200053260201b60201c565b60018160000160046101000a81548163ffffffff021916908363ffffffff160217905550818160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008411156200051657600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603620003d7576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6b0de0b6b39983494c589bffff8411156200041e576040517fe5cfe95700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8381600001600c6101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550600062000464846200056860201b60201c565b9050848160000160146101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508373ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef87604051620004f9919062000b40565b60405180910390a3620005148460016200062960201b60201c565b505b50505050565b600090565b600068a20d6e21d0e5255308905090565b630f4599e560005233602052602060006024601c6000855af160016000511416620005655763d125259c6000526004601cfd5b50565b6000806200057b6200052160201b60201c565b90508060080160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002091506000600183600001600b9054906101000a900460ff161660ff16036200062357600060019050620005f784620006eb60201b60201c565b1562000604576002811790505b8083600001600b6101000a81548160ff021916908360ff160217905550505b50919050565b60006200063c836200056860201b60201c565b90508115156000600283600001600b9054906101000a900460ff161660ff1614151515146200069657600281600001600b8282829054906101000a900460ff161892506101000a81548160ff021916908360ff1602179055505b8273ffffffffffffffffffffffffffffffffffffffff167fb5a1de456fff688115a4f75380060c23c8532d14ff85f687cc871456d642039383604051620006de919062000b7a565b60405180910390a2505050565b6000813b9050919050565b61137f806200456883390190565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620007368262000709565b9050919050565b620007488162000729565b81146200075457600080fd5b50565b60008151905062000768816200073d565b92915050565b60006020828403121562000787576200078662000704565b5b6000620007978482850162000757565b91505092915050565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806200082257607f821691505b602082108103620008385762000837620007da565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b600060088302620008a27fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8262000863565b620008ae868362000863565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b6000620008fb620008f5620008ef84620008c6565b620008d0565b620008c6565b9050919050565b6000819050919050565b6200091783620008da565b6200092f620009268262000902565b84845462000870565b825550505050565b600090565b6200094662000937565b620009538184846200090c565b505050565b5b818110156200097b576200096f6000826200093c565b60018101905062000959565b5050565b601f821115620009ca5762000994816200083e565b6200099f8462000853565b81016020851015620009af578190505b620009c7620009be8562000853565b83018262000958565b50505b505050565b600082821c905092915050565b6000620009ef60001984600802620009cf565b1980831691505092915050565b600062000a0a8383620009dc565b9150826002028217905092915050565b62000a2582620007a0565b67ffffffffffffffff81111562000a415762000a40620007ab565b5b62000a4d825462000809565b62000a5a8282856200097f565b600060209050601f83116001811462000a92576000841562000a7d578287015190505b62000a898582620009fc565b86555062000af9565b601f19841662000aa2866200083e565b60005b8281101562000acc5784890151825560018201915060208501945060208101905062000aa5565b8683101562000aec578489015162000ae8601f891682620009dc565b8355505b6001600288020188555050505b505050505050565b62000b0c8162000729565b82525050565b600060208201905062000b29600083018462000b01565b92915050565b62000b3a81620008c6565b82525050565b600060208201905062000b57600083018462000b2f565b92915050565b60008115159050919050565b62000b748162000b5d565b82525050565b600060208201905062000b91600083018462000b69565b92915050565b6139c18062000ba76000396000f3fe60806040526004361061012e5760003560e01c806355f804b3116100ab578063a9059cbb1161006f578063a9059cbb14610b43578063c87b56dd14610b80578063dd62ed3e14610bbd578063f04e283e14610bfa578063f2fde38b14610c16578063fee81cf414610c3257610135565b806355f804b314610a7d57806370a0823114610aa6578063715018a614610ae35780638da5cb5b14610aed57806395d89b4114610b1857610135565b8063274e430b116100f2578063274e430b146109c9578063313ce56714610a065780633ccfd60b14610a315780634ef41efc14610a4857806354d1f13d14610a7357610135565b806306fdde03146108ef578063095ea7b31461091a57806318160ddd1461095757806323b872dd1461098257806325692962146109bf57610135565b3661013557005b600061013f610c6f565b9050600060e061014f6000610c80565b901c905063e985e9c581036102bd578160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146101e7576040517fce5a776b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6044600036905010156101f957600080fd5b60006102056004610c80565b905060006102136024610c80565b90506102ba8460030160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166102af5760006102b2565b60015b60ff16610c8b565b50505b636352211e810361039a578160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610351576040517fce5a776b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60246000369050101561036357600080fd5b600061036f6004610c80565b905061039861037d82610c95565b73ffffffffffffffffffffffffffffffffffffffff16610c8b565b505b63e5eb36c88103610493578160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461042e576040517fce5a776b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60846000369050101561044057600080fd5b600061044c6004610c80565b9050600061045a6024610c80565b905060006104686044610c80565b905060006104766064610c80565b905061048484848484610ce6565b61048e6001610c8b565b505050505b63813500fc810361057f578160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610527576040517fce5a776b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60646000369050101561053957600080fd5b60006105456004610c80565b90506000806105546024610c80565b1415905060006105646044610c80565b90506105718383836112e0565b61057b6001610c8b565b5050505b63d10b6e0c810361067c578160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610613576040517fce5a776b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60646000369050101561062557600080fd5b60006106316004610c80565b9050600061063f6024610c80565b9050600061064d6044610c80565b905061067861065d848484611382565b73ffffffffffffffffffffffffffffffffffffffff16610c8b565b5050505b63081812fc8103610759578160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610710576040517fce5a776b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60246000369050101561072257600080fd5b600061072e6004610c80565b905061075761073c8261153f565b73ffffffffffffffffffffffffffffffffffffffff16610c8b565b505b63f5b100ea8103610820578160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146107ed576040517fce5a776b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6024600036905010156107ff57600080fd5b600061080b6004610c80565b905061081e610819826115c4565b610c8b565b505b63e2c7928181036108d7578160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108b4576040517fce5a776b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6004600036905010156108c657600080fd5b6108d66108d161162f565b610c8b565b5b63b7a94eb881036108ed576108ec6001610c8b565b5b005b3480156108fb57600080fd5b50610904611658565b6040516109119190612eae565b60405180910390f35b34801561092657600080fd5b50610941600480360381019061093c9190612f6e565b6116ea565b60405161094e9190612fc9565b60405180910390f35b34801561096357600080fd5b5061096c6117ea565b6040516109799190612ff3565b60405180910390f35b34801561098e57600080fd5b506109a960048036038101906109a4919061300e565b611823565b6040516109b69190612fc9565b60405180910390f35b6109c76119b2565b005b3480156109d557600080fd5b506109f060048036038101906109eb9190613061565b611a06565b6040516109fd9190612fc9565b60405180910390f35b348015610a1257600080fd5b50610a1b611aa8565b604051610a2891906130aa565b60405180910390f35b348015610a3d57600080fd5b50610a46611ab1565b005b348015610a5457600080fd5b50610a5d611ac4565b604051610a6a91906130d4565b60405180910390f35b610a7b611af7565b005b348015610a8957600080fd5b50610aa46004803603810190610a9f9190613154565b611b33565b005b348015610ab257600080fd5b50610acd6004803603810190610ac89190613061565b611b51565b604051610ada9190612ff3565b60405180910390f35b610aeb611bcc565b005b348015610af957600080fd5b50610b02611be0565b604051610b0f91906130d4565b60405180910390f35b348015610b2457600080fd5b50610b2d611c09565b604051610b3a9190612eae565b60405180910390f35b348015610b4f57600080fd5b50610b6a6004803603810190610b659190612f6e565b611c9b565b604051610b779190612fc9565b60405180910390f35b348015610b8c57600080fd5b50610ba76004803603810190610ba291906131a1565b611cb2565b604051610bb49190612eae565b60405180910390f35b348015610bc957600080fd5b50610be46004803603810190610bdf91906131ce565b6120c0565b604051610bf19190612ff3565b60405180910390f35b610c146004803603810190610c0f9190613061565b612150565b005b610c306004803603810190610c2b9190613061565b612191565b005b348015610c3e57600080fd5b50610c596004803603810190610c549190613061565b6121bb565b604051610c669190612ff3565b60405180910390f35b600068a20d6e21d0e5255308905090565b600081359050919050565b8060005260206000f35b6000610ca0826121d6565b610cd6576040517fceea21b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610cdf82612217565b9050919050565b6000610cf0610c6f565b9050600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1603610d58576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000816002016000610d7584600701610d7088612282565b612290565b63ffffffff1663ffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614610e17576040517fa114810000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8573ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610f76578160030160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610f755781600401600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610f74576040517f59c896be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b5b6000610f81876122be565b90506000610f8e876122be565b9050670de0b6b3a76400008260000160148282829054906101000a90046bffffffffffffffffffffffff16610fc39190613255565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550670de0b6b3a76400008160000160148282829054906101000a90046bffffffffffffffffffffffff160192506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055506110688460070161105988612282565b611063848b61236d565b612469565b83600401600087815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905560006111298560060160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002084600001601081819054906101000a900463ffffffff166001900391906101000a81548163ffffffff021916908363ffffffff160217905563ffffffff16612290565b63ffffffff1690506111968560060160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002061118a876007016111858b61249d565b612290565b63ffffffff1683612469565b600082600001601081819054906101000a900463ffffffff168092919060010191906101000a81548163ffffffff021916908363ffffffff16021790555063ffffffff169050611206866007016111ec8461249d565b611201896007016111fc8d61249d565b612290565b612469565b6112518660060160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020828a612469565b611267866007016112618a61249d565b83612469565b50508673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef670de0b6b3a76400006040516112ce9190612ff3565b60405180910390a35050505050505050565b816112e9610c6f565b60030160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550505050565b60008061138d610c6f565b905060008160020160006113ac846007016113a789612282565b612290565b63ffffffff1663ffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16146114df578160030160008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166114de576040517fcfb3b94200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b8582600401600087815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080925050509392505050565b600061154a826121d6565b611580576040517fceea21b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611588610c6f565b600401600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60006115ce610c6f565b60080160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160109054906101000a900463ffffffff1663ffffffff169050919050565b6000611639610c6f565b60000160089054906101000a900463ffffffff1663ffffffff16905090565b606060008054611667906132c4565b80601f0160208091040260200160405190810160405280929190818152602001828054611693906132c4565b80156116e05780601f106116b5576101008083540402835291602001916116e0565b820191906000526020600020905b8154815290600101906020018083116116c357829003601f168201915b5050505050905090565b6000806116f5610c6f565b9050828160050160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040516117d79190612ff3565b60405180910390a3600191505092915050565b60006117f4610c6f565b600001600c9054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff16905090565b60008061182e610c6f565b905060008160050160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff811461199a5780841115611914576040517f13be252b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8381038260050160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6119a58686866124ad565b6001925050509392505050565b60006119bc612b5f565b67ffffffffffffffff164201905063389a75e1600c5233600052806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d600080a250565b600080611a11610c6f565b60080160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000600182600001600b9054906101000a900460ff161660ff1603611a8357611a7b83612b6a565b915050611aa3565b6000600282600001600b9054906101000a900460ff161660ff1614159150505b919050565b60006012905090565b611ab9612b75565b611ac233612bad565b565b6000611ace610c6f565b60010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b63389a75e1600c523360005260006020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92600080a2565b611b3b612b75565b818160029182611b4c9291906134db565b505050565b6000611b5b610c6f565b60080160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160149054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff169050919050565b611bd4612b75565b611bde6000612bcc565b565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b606060018054611c18906132c4565b80601f0160208091040260200160405190810160405280929190818152602001828054611c44906132c4565b8015611c915780601f10611c6657610100808354040283529160200191611c91565b820191906000526020600020905b815481529060010190602001808311611c7457829003601f168201915b5050505050905090565b6000611ca83384846124ad565b6001905092915050565b6060600082604051602001611cc791906135cc565b6040516020818303038152906040528051906020012060f81c905060608060648360ff1611611d65576040518060400160405280600981526020017f677265656e2e676966000000000000000000000000000000000000000000000081525091506040518060400160405280600581526020017f477265656e0000000000000000000000000000000000000000000000000000008152509050611f65565b60a08360ff1611611de5576040518060400160405280600881526020017f426c75652e67696600000000000000000000000000000000000000000000000081525091506040518060400160405280600481526020017f426c7565000000000000000000000000000000000000000000000000000000008152509050611f64565b60d28360ff1611611e65576040518060400160405280600981526020017f62726f776e2e676966000000000000000000000000000000000000000000000081525091506040518060400160405280600681526020017f507572706c6500000000000000000000000000000000000000000000000000008152509050611f63565b60f08360ff1611611ee5576040518060400160405280600e81526020017f5768697465477265656e2e67696600000000000000000000000000000000000081525091506040518060400160405280600681526020017f4f72616e676500000000000000000000000000000000000000000000000000008152509050611f62565b60ff8360ff1611611f61576040518060400160405280600781526020017f5265642e6769660000000000000000000000000000000000000000000000000081525091506040518060400160405280600381526020017f526564000000000000000000000000000000000000000000000000000000000081525090505b5b5b5b5b6000611f7086612c94565b604051602001611f809190613649565b604051602081830303815290604052604051602001611f9f9190613753565b604051602081830303815290604052600284604051602001611fc29291906137f8565b604051602081830303815290604052604051602001611fe292919061381c565b604051602081830303815290604052905060008260405160200161200691906138b2565b604051602081830303815290604052905060006040518060400160405280600481526020017f227d5d7d000000000000000000000000000000000000000000000000000000008152509050828260405160200161206492919061381c565b6040516020818303038152906040528160405160200161208592919061381c565b6040516020818303038152906040526040516020016120a491906138fa565b6040516020818303038152906040529650505050505050919050565b60006120ca610c6f565b60050160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b612158612b75565b63389a75e1600c52806000526020600c20805442111561218057636f5e88186000526004601cfd5b600081555061218e81612bcc565b50565b612199612b75565b8060601b6121af57637448fbae6000526004601cfd5b6121b881612bcc565b50565b600063389a75e1600c52816000526020600c20549050919050565b60008073ffffffffffffffffffffffffffffffffffffffff166121f883612217565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b600080612222610c6f565b905080600201600061223f8360070161223a87612282565b612290565b63ffffffff1663ffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16915050919050565b6000600182901b9050919050565b6000600560078316901b836000016000600385901c815260200190815260200160002054901c905092915050565b6000806122c9610c6f565b90508060080160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002091506000600183600001600b9054906101000a900460ff161660ff16036123675760006001905061233c84612b6a565b15612348576002811790505b8083600001600b6101000a81548160ff021916908360ff160217905550505b50919050565b600080612378610c6f565b905083600001600c9054906101000a900463ffffffff16915060008263ffffffff16036124625780600001600081819054906101000a900463ffffffff166123bf90613930565b91906101000a81548163ffffffff021916908363ffffffff160217905591508184600001600c6101000a81548163ffffffff021916908363ffffffff160217905550828160020160008463ffffffff1663ffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b5092915050565b826020528160031c60005260406000206007831660051b815463ffffffff8482841c188116831b8218845550505050505050565b600060018083901b019050919050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603612513576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600061251d610c6f565b9050600061252a856122be565b90506000612537856122be565b9050612541612dce565b8260000160109054906101000a900463ffffffff1663ffffffff168160800181815250508160000160109054906101000a900463ffffffff1663ffffffff168160a00181815250508260000160149054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff1681604001818152505080604001518511156125fb576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8481604001818151039150818152505080604001518360000160146101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550848260000160149054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff160181606001818152508260000160146101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055506126d38160800151670de0b6b3a76400008360400151816126cd576126cc61395c565b5b04612ce5565b8160000181815250506000600283600001600b9054906101000a900460ff161660ff1603612777578573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff16036127435780600001518160800151038160a00181815250505b61276d670de0b6b3a76400008260600151816127625761276161395c565b5b048260a00151612ce5565b8160200181815250505b600061278c8260200151836000015101612cf6565b905060008260000151146128cf5760008560060160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600083608001519050600084600001518203905084600001518860000160088282829054906101000a900463ffffffff160392506101000a81548163ffffffff021916908363ffffffff160217905550808760000160106101000a81548163ffffffff021916908363ffffffff1602179055505b6000612866848460019003945084612290565b63ffffffff16905061287e8960070182600080612d23565b88600401600082815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556128c3858d836001612d69565b50808203612853575050505b6000826020015114612ab45760008560060160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060008360a00151905060008460200151820190506000612940878c61236d565b90506000670de0b6b3a76400008a600001600c9054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff16816129865761298561395c565b5b04905060008a60000160049054906101000a900463ffffffff1663ffffffff16905087602001518b60000160088282829054906101000a900463ffffffff160192506101000a81548163ffffffff021916908363ffffffff160217905550838960000160106101000a81548163ffffffff021916908363ffffffff1602179055505b5b6000612a208c600701612a1b84612282565b612290565b63ffffffff1614612a435781816001019150811115612a3e57600190505b612a09565b612a4e868683612469565b612a638b600701828588806001019950612d23565b612a70878e836000612d69565b81816001019150811115612a8357600190505b838503612a0857808b60000160046101000a81548163ffffffff021916908363ffffffff1602179055505050505050505b600081600001515114612af057612aef818660010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16612d8b565b5b508573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef87604051612b4e9190612ff3565b60405180910390a350505050505050565b60006202a300905090565b6000813b9050919050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927543314612bab576382b429006000526004601cfd5b565b60003860003847855af1612bc95763b12d13eb6000526004601cfd5b50565b612bd4612dc9565b15612c3a577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3811560ff1b8217815550612c91565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3818155505b50565b60606080604051019050602081016040526000815280600019835b600115612cd0578184019350600a81066030018453600a8104905080612caf575b50828203602084039350808452505050919050565b600081830382841102905092915050565b612cfe612e04565b6040805101828152806020018360051b81016040528183528083602001525050919050565b8163ffffffff168160201b17846020528360021c60005260406000206003851660061b815467ffffffffffffffff8482841c188116831b82188455505050505050505050565b8360200151818360081b8560601b171781526020810185602001525050505050565b81516040810363263c69d68152602080820152815160051b60440160208282601c85016000885af1600183511416612dc257600082fd5b5050505050565b600090565b6040518060c001604052806000815260200160008152602001600081526020016000815260200160008152602001600081525090565b604051806040016040528060608152602001600081525090565b600081519050919050565b600082825260208201905092915050565b60005b83811015612e58578082015181840152602081019050612e3d565b60008484015250505050565b6000601f19601f8301169050919050565b6000612e8082612e1e565b612e8a8185612e29565b9350612e9a818560208601612e3a565b612ea381612e64565b840191505092915050565b60006020820190508181036000830152612ec88184612e75565b905092915050565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612f0582612eda565b9050919050565b612f1581612efa565b8114612f2057600080fd5b50565b600081359050612f3281612f0c565b92915050565b6000819050919050565b612f4b81612f38565b8114612f5657600080fd5b50565b600081359050612f6881612f42565b92915050565b60008060408385031215612f8557612f84612ed0565b5b6000612f9385828601612f23565b9250506020612fa485828601612f59565b9150509250929050565b60008115159050919050565b612fc381612fae565b82525050565b6000602082019050612fde6000830184612fba565b92915050565b612fed81612f38565b82525050565b60006020820190506130086000830184612fe4565b92915050565b60008060006060848603121561302757613026612ed0565b5b600061303586828701612f23565b935050602061304686828701612f23565b925050604061305786828701612f59565b9150509250925092565b60006020828403121561307757613076612ed0565b5b600061308584828501612f23565b91505092915050565b600060ff82169050919050565b6130a48161308e565b82525050565b60006020820190506130bf600083018461309b565b92915050565b6130ce81612efa565b82525050565b60006020820190506130e960008301846130c5565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f840112613114576131136130ef565b5b8235905067ffffffffffffffff811115613131576131306130f4565b5b60208301915083600182028301111561314d5761314c6130f9565b5b9250929050565b6000806020838503121561316b5761316a612ed0565b5b600083013567ffffffffffffffff81111561318957613188612ed5565b5b613195858286016130fe565b92509250509250929050565b6000602082840312156131b7576131b6612ed0565b5b60006131c584828501612f59565b91505092915050565b600080604083850312156131e5576131e4612ed0565b5b60006131f385828601612f23565b925050602061320485828601612f23565b9150509250929050565b60006bffffffffffffffffffffffff82169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006132608261320e565b915061326b8361320e565b925082820390506bffffffffffffffffffffffff81111561328f5761328e613226565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806132dc57607f821691505b6020821081036132ef576132ee613295565b5b50919050565b600082905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026133917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82613354565b61339b8683613354565b95508019841693508086168417925050509392505050565b6000819050919050565b60006133d86133d36133ce84612f38565b6133b3565b612f38565b9050919050565b6000819050919050565b6133f2836133bd565b6134066133fe826133df565b848454613361565b825550505050565b600090565b61341b61340e565b6134268184846133e9565b505050565b5b8181101561344a5761343f600082613413565b60018101905061342c565b5050565b601f82111561348f576134608161332f565b61346984613344565b81016020851015613478578190505b61348c61348485613344565b83018261342b565b50505b505050565b600082821c905092915050565b60006134b260001984600802613494565b1980831691505092915050565b60006134cb83836134a1565b9150826002028217905092915050565b6134e583836132f5565b67ffffffffffffffff8111156134fe576134fd613300565b5b61350882546132c4565b61351382828561344e565b6000601f8311600181146135425760008415613530578287013590505b61353a85826134bf565b8655506135a2565b601f1984166135508661332f565b60005b8281101561357857848901358255600182019150602085019450602081019050613553565b868310156135955784890135613591601f8916826134a1565b8355505b6001600288020188555050505b50505050505050565b6000819050919050565b6135c66135c182612f38565b6135ab565b82525050565b60006135d882846135b5565b60208201915081905092915050565b7f7b226e616d65223a2022444e524f434b53202300000000000000000000000000815250565b600081905092915050565b600061362382612e1e565b61362d818561360d565b935061363d818560208601612e3a565b80840191505092915050565b6000613654826135e7565b6013820191506136648284613618565b915081905092915050565b7f222c226465736372697074696f6e223a224120636f6c6c656374696f6e206f6660008201527f2031302c303030205265706c6963616e747320656e61626c656420627920444e60208201527f3430342c20616e206578706572696d656e74616c20746f6b656e207374616e6460408201527f6172642e222c2265787465726e616c5f75726c223a2268747470733a2f2f646e60608201527f343034726f636b732e636f6d2f222c22696d616765223a220000000000000000608082015250565b600061373d60988361360d565b91506137488261366f565b609882019050919050565b600061375f8284613618565b915061376a82613730565b915081905092915050565b60008154613782816132c4565b61378c818661360d565b945060018216600081146137a757600181146137bc576137ef565b60ff19831686528115158202860193506137ef565b6137c58561332f565b60005b838110156137e7578154818901526001820191506020810190506137c8565b838801955050505b50505092915050565b60006138048285613775565b91506138108284613618565b91508190509392505050565b60006138288285613618565b91506138348284613618565b91508190509392505050565b7f222c2261747472696275746573223a5b7b2274726169745f74797065223a224360008201527f6f6c6f72222c2276616c7565223a220000000000000000000000000000000000602082015250565b600061389c602f8361360d565b91506138a782613840565b602f82019050919050565b60006138bd8261388f565b91506138c98284613618565b915081905092915050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b757466382c0000000000815250565b6000613905826138d4565b601b820191506139158284613618565b915081905092915050565b600063ffffffff82169050919050565b600061393b82613920565b915063ffffffff820361395157613950613226565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fdfea2646970667358221220c02bc6464fe9ff64a156c26444f47aad053adafa0ed4aa1ba1a3e4bffe55fc2c64736f6c6343000813003360806040523480156200001157600080fd5b506040516200137f3803806200137f83398181016040528101906200003791906200010b565b80620000486200009060201b60201c565b60010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506200013d565b6000683602298b8c10b01230905090565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620000d382620000a6565b9050919050565b620000e581620000c6565b8114620000f157600080fd5b50565b6000815190506200010581620000da565b92915050565b600060208284031215620001245762000123620000a1565b5b60006200013484828501620000f4565b91505092915050565b611232806200014d6000396000f3fe6080604052600436106100ec5760003560e01c80636352211e1161008a578063a22cb46511610059578063a22cb46514610607578063b88d4fde14610630578063c87b56dd14610659578063e985e9c514610696576100f3565b80636352211e1461053757806370a082311461057457806395d89b41146105b157806397e5311c146105dc576100f3565b8063095ea7b3116100c6578063095ea7b31461049e57806318160ddd146104c757806323b872dd146104f257806342842e0e1461051b576100f3565b806301ffc9a7146103f957806306fdde0314610436578063081812fc14610461576100f3565b366100f357005b60006100fd6106d3565b9050600060e061010d60006106e4565b901c905063263c69d68103610229578160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146101a5576040517f363cb31200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b602036103d60003e6004356024018036103d60003e602081033560051b81018036103d60003e5b80821461021e5781358060601c816001168260a01b60a81c811583028284027fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600038a45050508160200191506101cc565b600160005260206000f35b630f4599e581036103f757600073ffffffffffffffffffffffffffffffffffffffff168260010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461031f578160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166102d160046106e4565b73ffffffffffffffffffffffffffffffffffffffff161461031e576040517fc59ec47a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b600073ffffffffffffffffffffffffffffffffffffffff168260000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146103a9576040517fbf656a4600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b338260000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160005260206000f35b005b34801561040557600080fd5b50610420600480360381019061041b9190610d79565b6106ef565b60405161042d9190610dc1565b60405180910390f35b34801561044257600080fd5b5061044b610714565b6040516104589190610e6c565b60405180910390f35b34801561046d57600080fd5b5061048860048036038101906104839190610ec4565b61076e565b6040516104959190610f32565b60405180910390f35b3480156104aa57600080fd5b506104c560048036038101906104c09190610f79565b6107b6565b005b3480156104d357600080fd5b506104dc61083c565b6040516104e99190610fc8565b60405180910390f35b3480156104fe57600080fd5b5061051960048036038101906105149190610fe3565b61087b565b005b61053560048036038101906105309190610fe3565b61090a565b005b34801561054357600080fd5b5061055e60048036038101906105599190610ec4565b610944565b60405161056b9190610f32565b60405180910390f35b34801561058057600080fd5b5061059b60048036038101906105969190611036565b61098c565b6040516105a89190610fc8565b60405180910390f35b3480156105bd57600080fd5b506105c66109d7565b6040516105d39190610e6c565b60405180910390f35b3480156105e857600080fd5b506105f1610a31565b6040516105fe9190610f32565b60405180910390f35b34801561061357600080fd5b5061062e6004803603810190610629919061108f565b610aca565b005b34801561063c57600080fd5b5061065760048036038101906106529190611134565b610b4f565b005b34801561066557600080fd5b50610680600480360381019061067b9190610ec4565b610bc0565b60405161068d9190610e6c565b60405180910390f35b3480156106a257600080fd5b506106bd60048036038101906106b891906111bc565b610c20565b6040516106ca9190610dc1565b60405180910390f35b6000683602298b8c10b01230905090565b600081359050919050565b60008160e01c635b5e139f81146380ac58cd82146301ffc9a783141717915050919050565b60606000610720610a31565b905060405191506306fdde036000526000806004601c845afa610746573d6000833e3d82fd5b60206000803e6020600051833e8151602060005101602084013e815160208301016040525090565b600080610779610a31565b905063081812fc60005282602052602060006024601c845afa601f3d11166107a8573d60006040513e3d604051fd5b600c5160601c915050919050565b60006107c0610a31565b90508260601b60601c925060405163d10b6e0c600052836020528260405233606052602060006064601c34865af1601f3d1116610800573d6000823e3d81fd5b8060405260006060528284600c5160601c7f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600038a450505050565b600080610847610a31565b905063e2c79281600052602060006004601c845afa601f3d1116610872573d60006040513e3d604051fd5b60005191505090565b6000610885610a31565b90508360601b60601c93508260601b60601c925060405163e5eb36c881528460208201528360408201528260608201523360808201526020816084601c840134865af16001825114166108db573d6000823e3d81fd5b8284867fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600038a45050505050565b61091583838361087b565b61091e82610c7f565b1561093f5761093e83838360405180602001604052806000815250610c8a565b5b505050565b60008061094f610a31565b9050636352211e60005282602052602060006024601c845afa601f3d111661097e573d60006040513e3d604051fd5b600c5160601c915050919050565b600080610997610a31565b90508260601b60601c60205263f5b100ea600052602060006024601c845afa601f3d11166109cc573d60006040513e3d604051fd5b600051915050919050565b606060006109e3610a31565b905060405191506395d89b416000526000806004601c845afa610a09573d6000833e3d82fd5b60206000803e6020600051833e8151602060005101602084013e815160208301016040525090565b6000610a3b6106d3565b60000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610ac7576040517f5b2a47ae00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b90565b6000610ad4610a31565b90508260601b60601c925060405163813500fc6000528360205282151560405233606052602060006064601c34865af160016000511416610b18573d6000823e3d81fd5b83337f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160206040a380604052600060605250505050565b610b5a85858561087b565b610b6384610c7f565b15610bb957610bb885858585858080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610c8a565b5b5050505050565b60606000610bcc610a31565b905060405191508260205263c87b56dd6000526000806024601c845afa610bf6573d6000833e3d82fd5b60206000803e6020600051833e8151602060005101602084013e8151602083010160405250919050565b600080610c2b610a31565b9050604051836040528460601b602c526fe985e9c5000000000000000000000000600c52602060006044601c855afa601f3d1116610c6c573d6000823e3d81fd5b8060405260005115159250505092915050565b6000813b9050919050565b60405163150b7a028082523360208301528560601b60601c604083015283606083015260808083015282518060a08401528015610cd1578060c08401826020870160045afa505b60208360a48301601c860160008a5af1610cf5573d15610cf4573d6000843e3d83fd5b5b8160e01b835114610d0e5763d1a57ed66000526004601cfd5b50505050505050565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b610d5681610d21565b8114610d6157600080fd5b50565b600081359050610d7381610d4d565b92915050565b600060208284031215610d8f57610d8e610d17565b5b6000610d9d84828501610d64565b91505092915050565b60008115159050919050565b610dbb81610da6565b82525050565b6000602082019050610dd66000830184610db2565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610e16578082015181840152602081019050610dfb565b60008484015250505050565b6000601f19601f8301169050919050565b6000610e3e82610ddc565b610e488185610de7565b9350610e58818560208601610df8565b610e6181610e22565b840191505092915050565b60006020820190508181036000830152610e868184610e33565b905092915050565b6000819050919050565b610ea181610e8e565b8114610eac57600080fd5b50565b600081359050610ebe81610e98565b92915050565b600060208284031215610eda57610ed9610d17565b5b6000610ee884828501610eaf565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610f1c82610ef1565b9050919050565b610f2c81610f11565b82525050565b6000602082019050610f476000830184610f23565b92915050565b610f5681610f11565b8114610f6157600080fd5b50565b600081359050610f7381610f4d565b92915050565b60008060408385031215610f9057610f8f610d17565b5b6000610f9e85828601610f64565b9250506020610faf85828601610eaf565b9150509250929050565b610fc281610e8e565b82525050565b6000602082019050610fdd6000830184610fb9565b92915050565b600080600060608486031215610ffc57610ffb610d17565b5b600061100a86828701610f64565b935050602061101b86828701610f64565b925050604061102c86828701610eaf565b9150509250925092565b60006020828403121561104c5761104b610d17565b5b600061105a84828501610f64565b91505092915050565b61106c81610da6565b811461107757600080fd5b50565b60008135905061108981611063565b92915050565b600080604083850312156110a6576110a5610d17565b5b60006110b485828601610f64565b92505060206110c58582860161107a565b9150509250929050565b600080fd5b600080fd5b600080fd5b60008083601f8401126110f4576110f36110cf565b5b8235905067ffffffffffffffff811115611111576111106110d4565b5b60208301915083600182028301111561112d5761112c6110d9565b5b9250929050565b6000806000806000608086880312156111505761114f610d17565b5b600061115e88828901610f64565b955050602061116f88828901610f64565b945050604061118088828901610eaf565b935050606086013567ffffffffffffffff8111156111a1576111a0610d1c565b5b6111ad888289016110de565b92509250509295509295909350565b600080604083850312156111d3576111d2610d17565b5b60006111e185828601610f64565b92505060206111f285828601610f64565b915050925092905056fea26469706673582212207f00429b21f9da0621586027c73774f4708a59fab81464ae13f19455b2acd10964736f6c63430008130033000000000000000000000000071b2d01c1cc180a079f864187a238e37585e1ee
Deployed Bytecode
0x60806040526004361061012e5760003560e01c806355f804b3116100ab578063a9059cbb1161006f578063a9059cbb14610b43578063c87b56dd14610b80578063dd62ed3e14610bbd578063f04e283e14610bfa578063f2fde38b14610c16578063fee81cf414610c3257610135565b806355f804b314610a7d57806370a0823114610aa6578063715018a614610ae35780638da5cb5b14610aed57806395d89b4114610b1857610135565b8063274e430b116100f2578063274e430b146109c9578063313ce56714610a065780633ccfd60b14610a315780634ef41efc14610a4857806354d1f13d14610a7357610135565b806306fdde03146108ef578063095ea7b31461091a57806318160ddd1461095757806323b872dd1461098257806325692962146109bf57610135565b3661013557005b600061013f610c6f565b9050600060e061014f6000610c80565b901c905063e985e9c581036102bd578160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146101e7576040517fce5a776b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6044600036905010156101f957600080fd5b60006102056004610c80565b905060006102136024610c80565b90506102ba8460030160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166102af5760006102b2565b60015b60ff16610c8b565b50505b636352211e810361039a578160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610351576040517fce5a776b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60246000369050101561036357600080fd5b600061036f6004610c80565b905061039861037d82610c95565b73ffffffffffffffffffffffffffffffffffffffff16610c8b565b505b63e5eb36c88103610493578160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461042e576040517fce5a776b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60846000369050101561044057600080fd5b600061044c6004610c80565b9050600061045a6024610c80565b905060006104686044610c80565b905060006104766064610c80565b905061048484848484610ce6565b61048e6001610c8b565b505050505b63813500fc810361057f578160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610527576040517fce5a776b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60646000369050101561053957600080fd5b60006105456004610c80565b90506000806105546024610c80565b1415905060006105646044610c80565b90506105718383836112e0565b61057b6001610c8b565b5050505b63d10b6e0c810361067c578160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610613576040517fce5a776b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60646000369050101561062557600080fd5b60006106316004610c80565b9050600061063f6024610c80565b9050600061064d6044610c80565b905061067861065d848484611382565b73ffffffffffffffffffffffffffffffffffffffff16610c8b565b5050505b63081812fc8103610759578160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610710576040517fce5a776b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60246000369050101561072257600080fd5b600061072e6004610c80565b905061075761073c8261153f565b73ffffffffffffffffffffffffffffffffffffffff16610c8b565b505b63f5b100ea8103610820578160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146107ed576040517fce5a776b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6024600036905010156107ff57600080fd5b600061080b6004610c80565b905061081e610819826115c4565b610c8b565b505b63e2c7928181036108d7578160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108b4576040517fce5a776b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6004600036905010156108c657600080fd5b6108d66108d161162f565b610c8b565b5b63b7a94eb881036108ed576108ec6001610c8b565b5b005b3480156108fb57600080fd5b50610904611658565b6040516109119190612eae565b60405180910390f35b34801561092657600080fd5b50610941600480360381019061093c9190612f6e565b6116ea565b60405161094e9190612fc9565b60405180910390f35b34801561096357600080fd5b5061096c6117ea565b6040516109799190612ff3565b60405180910390f35b34801561098e57600080fd5b506109a960048036038101906109a4919061300e565b611823565b6040516109b69190612fc9565b60405180910390f35b6109c76119b2565b005b3480156109d557600080fd5b506109f060048036038101906109eb9190613061565b611a06565b6040516109fd9190612fc9565b60405180910390f35b348015610a1257600080fd5b50610a1b611aa8565b604051610a2891906130aa565b60405180910390f35b348015610a3d57600080fd5b50610a46611ab1565b005b348015610a5457600080fd5b50610a5d611ac4565b604051610a6a91906130d4565b60405180910390f35b610a7b611af7565b005b348015610a8957600080fd5b50610aa46004803603810190610a9f9190613154565b611b33565b005b348015610ab257600080fd5b50610acd6004803603810190610ac89190613061565b611b51565b604051610ada9190612ff3565b60405180910390f35b610aeb611bcc565b005b348015610af957600080fd5b50610b02611be0565b604051610b0f91906130d4565b60405180910390f35b348015610b2457600080fd5b50610b2d611c09565b604051610b3a9190612eae565b60405180910390f35b348015610b4f57600080fd5b50610b6a6004803603810190610b659190612f6e565b611c9b565b604051610b779190612fc9565b60405180910390f35b348015610b8c57600080fd5b50610ba76004803603810190610ba291906131a1565b611cb2565b604051610bb49190612eae565b60405180910390f35b348015610bc957600080fd5b50610be46004803603810190610bdf91906131ce565b6120c0565b604051610bf19190612ff3565b60405180910390f35b610c146004803603810190610c0f9190613061565b612150565b005b610c306004803603810190610c2b9190613061565b612191565b005b348015610c3e57600080fd5b50610c596004803603810190610c549190613061565b6121bb565b604051610c669190612ff3565b60405180910390f35b600068a20d6e21d0e5255308905090565b600081359050919050565b8060005260206000f35b6000610ca0826121d6565b610cd6576040517fceea21b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610cdf82612217565b9050919050565b6000610cf0610c6f565b9050600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1603610d58576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000816002016000610d7584600701610d7088612282565b612290565b63ffffffff1663ffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614610e17576040517fa114810000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8573ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610f76578160030160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610f755781600401600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610f74576040517f59c896be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b5b6000610f81876122be565b90506000610f8e876122be565b9050670de0b6b3a76400008260000160148282829054906101000a90046bffffffffffffffffffffffff16610fc39190613255565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550670de0b6b3a76400008160000160148282829054906101000a90046bffffffffffffffffffffffff160192506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055506110688460070161105988612282565b611063848b61236d565b612469565b83600401600087815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905560006111298560060160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002084600001601081819054906101000a900463ffffffff166001900391906101000a81548163ffffffff021916908363ffffffff160217905563ffffffff16612290565b63ffffffff1690506111968560060160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002061118a876007016111858b61249d565b612290565b63ffffffff1683612469565b600082600001601081819054906101000a900463ffffffff168092919060010191906101000a81548163ffffffff021916908363ffffffff16021790555063ffffffff169050611206866007016111ec8461249d565b611201896007016111fc8d61249d565b612290565b612469565b6112518660060160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020828a612469565b611267866007016112618a61249d565b83612469565b50508673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef670de0b6b3a76400006040516112ce9190612ff3565b60405180910390a35050505050505050565b816112e9610c6f565b60030160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550505050565b60008061138d610c6f565b905060008160020160006113ac846007016113a789612282565b612290565b63ffffffff1663ffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16146114df578160030160008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166114de576040517fcfb3b94200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b8582600401600087815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080925050509392505050565b600061154a826121d6565b611580576040517fceea21b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611588610c6f565b600401600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60006115ce610c6f565b60080160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160109054906101000a900463ffffffff1663ffffffff169050919050565b6000611639610c6f565b60000160089054906101000a900463ffffffff1663ffffffff16905090565b606060008054611667906132c4565b80601f0160208091040260200160405190810160405280929190818152602001828054611693906132c4565b80156116e05780601f106116b5576101008083540402835291602001916116e0565b820191906000526020600020905b8154815290600101906020018083116116c357829003601f168201915b5050505050905090565b6000806116f5610c6f565b9050828160050160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040516117d79190612ff3565b60405180910390a3600191505092915050565b60006117f4610c6f565b600001600c9054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff16905090565b60008061182e610c6f565b905060008160050160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff811461199a5780841115611914576040517f13be252b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8381038260050160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6119a58686866124ad565b6001925050509392505050565b60006119bc612b5f565b67ffffffffffffffff164201905063389a75e1600c5233600052806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d600080a250565b600080611a11610c6f565b60080160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000600182600001600b9054906101000a900460ff161660ff1603611a8357611a7b83612b6a565b915050611aa3565b6000600282600001600b9054906101000a900460ff161660ff1614159150505b919050565b60006012905090565b611ab9612b75565b611ac233612bad565b565b6000611ace610c6f565b60010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b63389a75e1600c523360005260006020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92600080a2565b611b3b612b75565b818160029182611b4c9291906134db565b505050565b6000611b5b610c6f565b60080160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160149054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff169050919050565b611bd4612b75565b611bde6000612bcc565b565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b606060018054611c18906132c4565b80601f0160208091040260200160405190810160405280929190818152602001828054611c44906132c4565b8015611c915780601f10611c6657610100808354040283529160200191611c91565b820191906000526020600020905b815481529060010190602001808311611c7457829003601f168201915b5050505050905090565b6000611ca83384846124ad565b6001905092915050565b6060600082604051602001611cc791906135cc565b6040516020818303038152906040528051906020012060f81c905060608060648360ff1611611d65576040518060400160405280600981526020017f677265656e2e676966000000000000000000000000000000000000000000000081525091506040518060400160405280600581526020017f477265656e0000000000000000000000000000000000000000000000000000008152509050611f65565b60a08360ff1611611de5576040518060400160405280600881526020017f426c75652e67696600000000000000000000000000000000000000000000000081525091506040518060400160405280600481526020017f426c7565000000000000000000000000000000000000000000000000000000008152509050611f64565b60d28360ff1611611e65576040518060400160405280600981526020017f62726f776e2e676966000000000000000000000000000000000000000000000081525091506040518060400160405280600681526020017f507572706c6500000000000000000000000000000000000000000000000000008152509050611f63565b60f08360ff1611611ee5576040518060400160405280600e81526020017f5768697465477265656e2e67696600000000000000000000000000000000000081525091506040518060400160405280600681526020017f4f72616e676500000000000000000000000000000000000000000000000000008152509050611f62565b60ff8360ff1611611f61576040518060400160405280600781526020017f5265642e6769660000000000000000000000000000000000000000000000000081525091506040518060400160405280600381526020017f526564000000000000000000000000000000000000000000000000000000000081525090505b5b5b5b5b6000611f7086612c94565b604051602001611f809190613649565b604051602081830303815290604052604051602001611f9f9190613753565b604051602081830303815290604052600284604051602001611fc29291906137f8565b604051602081830303815290604052604051602001611fe292919061381c565b604051602081830303815290604052905060008260405160200161200691906138b2565b604051602081830303815290604052905060006040518060400160405280600481526020017f227d5d7d000000000000000000000000000000000000000000000000000000008152509050828260405160200161206492919061381c565b6040516020818303038152906040528160405160200161208592919061381c565b6040516020818303038152906040526040516020016120a491906138fa565b6040516020818303038152906040529650505050505050919050565b60006120ca610c6f565b60050160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b612158612b75565b63389a75e1600c52806000526020600c20805442111561218057636f5e88186000526004601cfd5b600081555061218e81612bcc565b50565b612199612b75565b8060601b6121af57637448fbae6000526004601cfd5b6121b881612bcc565b50565b600063389a75e1600c52816000526020600c20549050919050565b60008073ffffffffffffffffffffffffffffffffffffffff166121f883612217565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b600080612222610c6f565b905080600201600061223f8360070161223a87612282565b612290565b63ffffffff1663ffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16915050919050565b6000600182901b9050919050565b6000600560078316901b836000016000600385901c815260200190815260200160002054901c905092915050565b6000806122c9610c6f565b90508060080160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002091506000600183600001600b9054906101000a900460ff161660ff16036123675760006001905061233c84612b6a565b15612348576002811790505b8083600001600b6101000a81548160ff021916908360ff160217905550505b50919050565b600080612378610c6f565b905083600001600c9054906101000a900463ffffffff16915060008263ffffffff16036124625780600001600081819054906101000a900463ffffffff166123bf90613930565b91906101000a81548163ffffffff021916908363ffffffff160217905591508184600001600c6101000a81548163ffffffff021916908363ffffffff160217905550828160020160008463ffffffff1663ffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b5092915050565b826020528160031c60005260406000206007831660051b815463ffffffff8482841c188116831b8218845550505050505050565b600060018083901b019050919050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603612513576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600061251d610c6f565b9050600061252a856122be565b90506000612537856122be565b9050612541612dce565b8260000160109054906101000a900463ffffffff1663ffffffff168160800181815250508160000160109054906101000a900463ffffffff1663ffffffff168160a00181815250508260000160149054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff1681604001818152505080604001518511156125fb576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8481604001818151039150818152505080604001518360000160146101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550848260000160149054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff160181606001818152508260000160146101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055506126d38160800151670de0b6b3a76400008360400151816126cd576126cc61395c565b5b04612ce5565b8160000181815250506000600283600001600b9054906101000a900460ff161660ff1603612777578573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff16036127435780600001518160800151038160a00181815250505b61276d670de0b6b3a76400008260600151816127625761276161395c565b5b048260a00151612ce5565b8160200181815250505b600061278c8260200151836000015101612cf6565b905060008260000151146128cf5760008560060160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600083608001519050600084600001518203905084600001518860000160088282829054906101000a900463ffffffff160392506101000a81548163ffffffff021916908363ffffffff160217905550808760000160106101000a81548163ffffffff021916908363ffffffff1602179055505b6000612866848460019003945084612290565b63ffffffff16905061287e8960070182600080612d23565b88600401600082815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556128c3858d836001612d69565b50808203612853575050505b6000826020015114612ab45760008560060160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060008360a00151905060008460200151820190506000612940878c61236d565b90506000670de0b6b3a76400008a600001600c9054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff16816129865761298561395c565b5b04905060008a60000160049054906101000a900463ffffffff1663ffffffff16905087602001518b60000160088282829054906101000a900463ffffffff160192506101000a81548163ffffffff021916908363ffffffff160217905550838960000160106101000a81548163ffffffff021916908363ffffffff1602179055505b5b6000612a208c600701612a1b84612282565b612290565b63ffffffff1614612a435781816001019150811115612a3e57600190505b612a09565b612a4e868683612469565b612a638b600701828588806001019950612d23565b612a70878e836000612d69565b81816001019150811115612a8357600190505b838503612a0857808b60000160046101000a81548163ffffffff021916908363ffffffff1602179055505050505050505b600081600001515114612af057612aef818660010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16612d8b565b5b508573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef87604051612b4e9190612ff3565b60405180910390a350505050505050565b60006202a300905090565b6000813b9050919050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927543314612bab576382b429006000526004601cfd5b565b60003860003847855af1612bc95763b12d13eb6000526004601cfd5b50565b612bd4612dc9565b15612c3a577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3811560ff1b8217815550612c91565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3818155505b50565b60606080604051019050602081016040526000815280600019835b600115612cd0578184019350600a81066030018453600a8104905080612caf575b50828203602084039350808452505050919050565b600081830382841102905092915050565b612cfe612e04565b6040805101828152806020018360051b81016040528183528083602001525050919050565b8163ffffffff168160201b17846020528360021c60005260406000206003851660061b815467ffffffffffffffff8482841c188116831b82188455505050505050505050565b8360200151818360081b8560601b171781526020810185602001525050505050565b81516040810363263c69d68152602080820152815160051b60440160208282601c85016000885af1600183511416612dc257600082fd5b5050505050565b600090565b6040518060c001604052806000815260200160008152602001600081526020016000815260200160008152602001600081525090565b604051806040016040528060608152602001600081525090565b600081519050919050565b600082825260208201905092915050565b60005b83811015612e58578082015181840152602081019050612e3d565b60008484015250505050565b6000601f19601f8301169050919050565b6000612e8082612e1e565b612e8a8185612e29565b9350612e9a818560208601612e3a565b612ea381612e64565b840191505092915050565b60006020820190508181036000830152612ec88184612e75565b905092915050565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612f0582612eda565b9050919050565b612f1581612efa565b8114612f2057600080fd5b50565b600081359050612f3281612f0c565b92915050565b6000819050919050565b612f4b81612f38565b8114612f5657600080fd5b50565b600081359050612f6881612f42565b92915050565b60008060408385031215612f8557612f84612ed0565b5b6000612f9385828601612f23565b9250506020612fa485828601612f59565b9150509250929050565b60008115159050919050565b612fc381612fae565b82525050565b6000602082019050612fde6000830184612fba565b92915050565b612fed81612f38565b82525050565b60006020820190506130086000830184612fe4565b92915050565b60008060006060848603121561302757613026612ed0565b5b600061303586828701612f23565b935050602061304686828701612f23565b925050604061305786828701612f59565b9150509250925092565b60006020828403121561307757613076612ed0565b5b600061308584828501612f23565b91505092915050565b600060ff82169050919050565b6130a48161308e565b82525050565b60006020820190506130bf600083018461309b565b92915050565b6130ce81612efa565b82525050565b60006020820190506130e960008301846130c5565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f840112613114576131136130ef565b5b8235905067ffffffffffffffff811115613131576131306130f4565b5b60208301915083600182028301111561314d5761314c6130f9565b5b9250929050565b6000806020838503121561316b5761316a612ed0565b5b600083013567ffffffffffffffff81111561318957613188612ed5565b5b613195858286016130fe565b92509250509250929050565b6000602082840312156131b7576131b6612ed0565b5b60006131c584828501612f59565b91505092915050565b600080604083850312156131e5576131e4612ed0565b5b60006131f385828601612f23565b925050602061320485828601612f23565b9150509250929050565b60006bffffffffffffffffffffffff82169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006132608261320e565b915061326b8361320e565b925082820390506bffffffffffffffffffffffff81111561328f5761328e613226565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806132dc57607f821691505b6020821081036132ef576132ee613295565b5b50919050565b600082905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026133917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82613354565b61339b8683613354565b95508019841693508086168417925050509392505050565b6000819050919050565b60006133d86133d36133ce84612f38565b6133b3565b612f38565b9050919050565b6000819050919050565b6133f2836133bd565b6134066133fe826133df565b848454613361565b825550505050565b600090565b61341b61340e565b6134268184846133e9565b505050565b5b8181101561344a5761343f600082613413565b60018101905061342c565b5050565b601f82111561348f576134608161332f565b61346984613344565b81016020851015613478578190505b61348c61348485613344565b83018261342b565b50505b505050565b600082821c905092915050565b60006134b260001984600802613494565b1980831691505092915050565b60006134cb83836134a1565b9150826002028217905092915050565b6134e583836132f5565b67ffffffffffffffff8111156134fe576134fd613300565b5b61350882546132c4565b61351382828561344e565b6000601f8311600181146135425760008415613530578287013590505b61353a85826134bf565b8655506135a2565b601f1984166135508661332f565b60005b8281101561357857848901358255600182019150602085019450602081019050613553565b868310156135955784890135613591601f8916826134a1565b8355505b6001600288020188555050505b50505050505050565b6000819050919050565b6135c66135c182612f38565b6135ab565b82525050565b60006135d882846135b5565b60208201915081905092915050565b7f7b226e616d65223a2022444e524f434b53202300000000000000000000000000815250565b600081905092915050565b600061362382612e1e565b61362d818561360d565b935061363d818560208601612e3a565b80840191505092915050565b6000613654826135e7565b6013820191506136648284613618565b915081905092915050565b7f222c226465736372697074696f6e223a224120636f6c6c656374696f6e206f6660008201527f2031302c303030205265706c6963616e747320656e61626c656420627920444e60208201527f3430342c20616e206578706572696d656e74616c20746f6b656e207374616e6460408201527f6172642e222c2265787465726e616c5f75726c223a2268747470733a2f2f646e60608201527f343034726f636b732e636f6d2f222c22696d616765223a220000000000000000608082015250565b600061373d60988361360d565b91506137488261366f565b609882019050919050565b600061375f8284613618565b915061376a82613730565b915081905092915050565b60008154613782816132c4565b61378c818661360d565b945060018216600081146137a757600181146137bc576137ef565b60ff19831686528115158202860193506137ef565b6137c58561332f565b60005b838110156137e7578154818901526001820191506020810190506137c8565b838801955050505b50505092915050565b60006138048285613775565b91506138108284613618565b91508190509392505050565b60006138288285613618565b91506138348284613618565b91508190509392505050565b7f222c2261747472696275746573223a5b7b2274726169745f74797065223a224360008201527f6f6c6f72222c2276616c7565223a220000000000000000000000000000000000602082015250565b600061389c602f8361360d565b91506138a782613840565b602f82019050919050565b60006138bd8261388f565b91506138c98284613618565b915081905092915050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b757466382c0000000000815250565b6000613905826138d4565b601b820191506139158284613618565b915081905092915050565b600063ffffffff82169050919050565b600061393b82613920565b915063ffffffff820361395157613950613226565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fdfea2646970667358221220c02bc6464fe9ff64a156c26444f47aad053adafa0ed4aa1ba1a3e4bffe55fc2c64736f6c63430008130033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000071b2d01c1cc180a079f864187a238e37585e1ee
-----Decoded View---------------
Arg [0] : initialSupplyOwner (address): 0x071B2d01C1Cc180a079f864187A238E37585e1eE
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000071b2d01c1cc180a079f864187a238e37585e1ee
Deployed Bytecode Sourcemap
245:2397:2:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;29526:22:0;29551:18;:16;:18::i;:::-;29526:43;;29580:18;29624:3;29601:19;29615:4;29601:13;:19::i;:::-;:26;;29580:47;;29704:10;29690;:24;29686:369;;29748:1;:14;;;;;;;;;;;;29734:28;;:10;:28;;;29730:58;;29771:17;;;;;;;;;;;;;;29730:58;29824:4;29806:8;;:15;;:22;29802:36;;;29830:8;;;29802:36;29853:13;29885:19;29899:4;29885:13;:19::i;:::-;29853:53;;29920:16;29955:19;29969:4;29955:13;:19::i;:::-;29920:56;;29991:53;29999:1;:19;;:26;30019:5;29999:26;;;;;;;;;;;;;;;:36;30026:8;29999:36;;;;;;;;;;;;;;;;;;;;;;;;;:44;;30042:1;29999:44;;;30038:1;29999:44;29991:53;;:7;:53::i;:::-;29716:339;;29686:369;30113:10;30099;:24;30095:255;;30157:1;:14;;;;;;;;;;;;30143:28;;:10;:28;;;30139:58;;30180:17;;;;;;;;;;;;;;30139:58;30233:4;30215:8;;:15;;:22;30211:36;;;30239:8;;;30211:36;30262:10;30275:19;30289:4;30275:13;:19::i;:::-;30262:32;;30309:30;30325:12;30334:2;30325:8;:12::i;:::-;30309:30;;:7;:30::i;:::-;30125:225;30095:255;30440:10;30426;:24;30422:491;;30484:1;:14;;;;;;;;;;;;30470:28;;:10;:28;;;30466:58;;30507:17;;;;;;;;;;;;;;30466:58;30560:4;30542:8;;:15;;:22;30538:36;;;30566:8;;;30538:36;30589:12;30620:19;30634:4;30620:13;:19::i;:::-;30589:52;;30655:10;30684:19;30698:4;30684:13;:19::i;:::-;30655:50;;30719:10;30732:19;30746:4;30732:13;:19::i;:::-;30719:32;;30765:17;30801:19;30815:4;30801:13;:19::i;:::-;30765:57;;30837:41;30854:4;30860:2;30864;30868:9;30837:16;:41::i;:::-;30892:10;30900:1;30892:7;:10::i;:::-;30452:461;;;;30422:491;30994:10;30980;:24;30976:441;;31038:1;:14;;;;;;;;;;;;31024:28;;:10;:28;;;31020:58;;31061:17;;;;;;;;;;;;;;31020:58;31114:4;31096:8;;:15;;:22;31092:36;;;31120:8;;;31092:36;31143:15;31177:19;31191:4;31177:13;:19::i;:::-;31143:55;;31212:11;31249:1;31226:19;31240:4;31226:13;:19::i;:::-;:24;;31212:38;;31264:17;31300:19;31314:4;31300:13;:19::i;:::-;31264:57;;31336:46;31355:7;31364:6;31372:9;31336:18;:46::i;:::-;31396:10;31404:1;31396:7;:10::i;:::-;31006:411;;;30976:441;31494:10;31480;:24;31476:418;;31538:1;:14;;;;;;;;;;;;31524:28;;:10;:28;;;31520:58;;31561:17;;;;;;;;;;;;;;31520:58;31614:4;31596:8;;:15;;:22;31592:36;;;31620:8;;;31592:36;31643:15;31677:19;31691:4;31677:13;:19::i;:::-;31643:55;;31712:10;31725:19;31739:4;31725:13;:19::i;:::-;31712:32;;31758:17;31794:19;31808:4;31794:13;:19::i;:::-;31758:57;;31830:53;31846:35;31858:7;31867:2;31871:9;31846:11;:35::i;:::-;31830:53;;:7;:53::i;:::-;31506:388;;;31476:418;31956:10;31942;:24;31938:259;;32000:1;:14;;;;;;;;;;;;31986:28;;:10;:28;;;31982:58;;32023:17;;;;;;;;;;;;;;31982:58;32076:4;32058:8;;:15;;:22;32054:36;;;32082:8;;;32054:36;32105:10;32118:19;32132:4;32118:13;:19::i;:::-;32105:32;;32152:34;32168:16;32181:2;32168:12;:16::i;:::-;32152:34;;:7;:34::i;:::-;31968:229;31938:259;32260:10;32246;:24;32242:275;;32304:1;:14;;;;;;;;;;;;32290:28;;:10;:28;;;32286:58;;32327:17;;;;;;;;;;;;;;32286:58;32380:4;32362:8;;:15;;:22;32358:36;;;32386:8;;;32358:36;32409:13;32441:19;32455:4;32441:13;:19::i;:::-;32409:53;;32477:29;32485:20;32499:5;32485:13;:20::i;:::-;32477:7;:29::i;:::-;32272:245;32242:275;32575:10;32561;:24;32557:204;;32619:1;:14;;;;;;;;;;;;32605:28;;:10;:28;;;32601:58;;32642:17;;;;;;;;;;;;;;32601:58;32695:4;32677:8;;:15;;:22;32673:36;;;32701:8;;;32673:36;32724:26;32732:17;:15;:17::i;:::-;32724:7;:26::i;:::-;32557:204;32820:10;32806;:24;32802:65;;32846:10;32854:1;32846:7;:10::i;:::-;32802:65;29516:3368;675:90:2;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;9732:267:0;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;9026:124;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;11323:497;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;9021:617:4;;;:::i;:::-;;23823:278:0;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;8890:74;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;2540:100:2;;;;;;;;;;;;;:::i;:::-;;26113:117:0;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;9720:456:4;;;:::i;:::-;;2435:99:2;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;9216:141:0;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;8762:100:4;;;:::i;:::-;;11408:182;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;771:94:2;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;10497:147:0;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;871:1556:2;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;9452:149:0;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;10363:708:4;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;8348:349;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;11693:435;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;6180:314:0;6239:22;6410:20;6400:30;;6180:314;:::o;35847:197::-;35908:13;36021:6;36008:20;35999:29;;35847:197;;;:::o;36134:179::-;36264:1;36258:4;36251:15;36292:4;36286;36279:18;27048:160;27109:7;27133:11;27141:2;27133:7;:11::i;:::-;27128:44;;27153:19;;;;;;;;;;;;;;27128:44;27189:12;27198:2;27189:8;:12::i;:::-;27182:19;;27048:160;;;:::o;20880:1466::-;21010:22;21035:18;:16;:18::i;:::-;21010:43;;21082:1;21068:16;;:2;:16;;;21064:52;;21093:23;;;;;;;;;;;;;;21064:52;21127:13;21143:1;:16;;:49;21160:31;21165:1;:4;;21171:19;21187:2;21171:15;:19::i;:::-;21160:4;:31::i;:::-;21143:49;;;;;;;;;;;;;;;;;;;;;;;;;21127:65;;21215:5;21207:13;;:4;:13;;;21203:54;;21229:28;;;;;;;;;;;;;;21203:54;21285:4;21272:17;;:9;:17;;;21268:244;;21310:1;:19;;:25;21330:4;21310:25;;;;;;;;;;;;;;;:36;21336:9;21310:36;;;;;;;;;;;;;;;;;;;;;;;;;21305:197;;21383:1;:16;;:20;21400:2;21383:20;;;;;;;;;;;;;;;;;;;;;21370:33;;:9;:33;;;21366:122;;21434:35;;;;;;;;;;;;;;21366:122;21305:197;21268:244;21522:35;21560:18;21573:4;21560:12;:18::i;:::-;21522:56;;21588:33;21624:16;21637:2;21624:12;:16::i;:::-;21588:52;;3537:8;21651:15;:23;;;:39;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;3537:8;21725:13;:21;;;:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;21777:76;21782:1;:4;;21788:19;21804:2;21788:15;:19::i;:::-;21809:43;21834:13;21849:2;21809:24;:43::i;:::-;21777:4;:76::i;:::-;21874:1;:16;;:20;21891:2;21874:20;;;;;;;;;;;;21867:27;;;;;;;;;;;21909:17;21929:50;21934:1;:7;;:13;21942:4;21934:13;;;;;;;;;;;;;;;21951:15;:27;;;21949:29;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;21929:50;;:4;:50::i;:::-;21909:70;;;;21993:67;21998:1;:7;;:13;22006:4;21998:13;;;;;;;;;;;;;;;22013:27;22018:1;:4;;22024:15;22036:2;22024:11;:15::i;:::-;22013:4;:27::i;:::-;21993:67;;22049:9;21993:4;:67::i;:::-;22075:9;22087:13;:25;;;:27;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;22075:39;;;;22128:63;22133:1;:4;;22139:22;22151:9;22139:11;:22::i;:::-;22163:27;22168:1;:4;;22174:15;22186:2;22174:11;:15::i;:::-;22163:4;:27::i;:::-;22128:4;:63::i;:::-;22205:32;22210:1;:7;;:11;22218:2;22210:11;;;;;;;;;;;;;;;22223:1;22233:2;22205:4;:32::i;:::-;22251:38;22256:1;:4;;22262:15;22274:2;22262:11;:15::i;:::-;22286:1;22251:4;:38::i;:::-;21701:599;;22330:2;22315:24;;22324:4;22315:24;;;3537:8;22315:24;;;;;;:::i;:::-;;;;;;;;21000:1346;;;;20880:1466;;;;:::o;28540:202::-;28727:8;28667:18;:16;:18::i;:::-;:36;;:47;28704:9;28667:47;;;;;;;;;;;;;;;:57;28715:8;28667:57;;;;;;;;;;;;;;;;:68;;;;;;;;;;;;;;;;;;28540:202;;;:::o;27909:509::-;28028:7;28051:22;28076:18;:16;:18::i;:::-;28051:43;;28105:13;28121:1;:16;;:49;28138:31;28143:1;:4;;28149:19;28165:2;28149:15;:19::i;:::-;28138:4;:31::i;:::-;28121:49;;;;;;;;;;;;;;;;;;;;;;;;;28105:65;;28198:5;28185:18;;:9;:18;;;28181:167;;28224:1;:19;;:26;28244:5;28224:26;;;;;;;;;;;;;;;:37;28251:9;28224:37;;;;;;;;;;;;;;;;;;;;;;;;;28219:119;;28288:35;;;;;;;;;;;;;;28219:119;28181:167;28381:7;28358:1;:16;;:20;28375:2;28358:20;;;;;;;;;;;;:30;;;;;;;;;;;;;;;;;;28406:5;28399:12;;;;27909:509;;;;;:::o;27506:189::-;27571:7;27595:11;27603:2;27595:7;:11::i;:::-;27590:44;;27615:19;;;;;;;;;;;;;;27590:44;27651:18;:16;:18::i;:::-;:33;;:37;27685:2;27651:37;;;;;;;;;;;;;;;;;;;;;27644:44;;27506:189;;;:::o;26451:151::-;26520:7;26546:18;:16;:18::i;:::-;:30;;:37;26577:5;26546:37;;;;;;;;;;;;;;;:49;;;;;;;;;;;;26539:56;;;;26451:151;;;:::o;26279:124::-;26337:7;26363:18;:16;:18::i;:::-;:33;;;;;;;;;;;;26356:40;;;;26279:124;:::o;675:90:2:-;721:13;753:5;746:12;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;675:90;:::o;9732:267:0:-;9806:4;9822:22;9847:18;:16;:18::i;:::-;9822:43;;9911:6;9876:1;:11;;:23;9888:10;9876:23;;;;;;;;;;;;;;;:32;9900:7;9876:32;;;;;;;;;;;;;;;:41;;;;9954:7;9933:37;;9942:10;9933:37;;;9963:6;9933:37;;;;;;:::i;:::-;;;;;;;;9988:4;9981:11;;;9732:267;;;;:::o;9026:124::-;9078:7;9112:18;:16;:18::i;:::-;:30;;;;;;;;;;;;9104:39;;9097:46;;9026:124;:::o;11323:497::-;11411:4;11427:22;11452:18;:16;:18::i;:::-;11427:43;;11481:15;11499:1;:11;;:17;11511:4;11499:17;;;;;;;;;;;;;;;:29;11517:10;11499:29;;;;;;;;;;;;;;;;11481:47;;11554:17;11543:7;:28;11539:215;;11600:7;11591:6;:16;11587:52;;;11616:23;;;;;;;;;;;;;;11587:52;11723:6;11713:7;:16;11681:1;:11;;:17;11693:4;11681:17;;;;;;;;;;;;;;;:29;11699:10;11681:29;;;;;;;;;;;;;;;:48;;;;11539:215;11764:27;11774:4;11780:2;11784:6;11764:9;:27::i;:::-;11809:4;11802:11;;;;11323:497;;;;;:::o;9021:617:4:-;9114:15;9150:28;:26;:28::i;:::-;9132:46;;:15;:46;9114:64;;9346:19;9340:4;9333:33;9396:8;9390:4;9383:22;9452:7;9445:4;9439;9429:21;9422:38;9599:8;9552:45;9549:1;9546;9541:67;9248:374;9021:617::o;23823:278:0:-;23883:4;23899:21;23923:18;:16;:18::i;:::-;:30;;:33;23954:1;23923:33;;;;;;;;;;;;;;;23899:57;;24014:1;3912:6;23970:1;:7;;;;;;;;;;;;:40;:45;;;23966:69;;24024:11;24033:1;24024:8;:11::i;:::-;24017:18;;;;;23966:69;24093:1;4046:6;24052:1;:7;;;;;;;;;;;;:37;:42;;;;24045:49;;;23823:278;;;;:::o;8890:74::-;8931:5;8955:2;8948:9;;8890:74;:::o;2540:100:2:-;12517:13:4;:11;:13::i;:::-;2587:46:2::1;2622:10;2587:34;:46::i;:::-;2540:100::o:0;26113:117:0:-;26166:7;26192:18;:16;:18::i;:::-;:31;;;;;;;;;;;;26185:38;;26113:117;:::o;9720:456:4:-;9922:19;9916:4;9909:33;9968:8;9962:4;9955:22;10020:1;10013:4;10007;9997:21;9990:32;10151:8;10105:44;10102:1;10099;10094:66;9720:456::o;2435:99:2:-;12517:13:4;:11;:13::i;:::-;2519:8:2::1;;2508;:19;;;;;;;:::i;:::-;;2435:99:::0;;:::o;9216:141:0:-;9279:7;9305:18;:16;:18::i;:::-;:30;;:37;9336:5;9305:37;;;;;;;;;;;;;;;:45;;;;;;;;;;;;9298:52;;;;9216:141;;;:::o;8762:100:4:-;12517:13;:11;:13::i;:::-;8834:21:::1;8852:1;8834:9;:21::i;:::-;8762:100::o:0;11408:182::-;11454:14;11562:11;11556:18;11546:28;;11408:182;:::o;771:94:2:-;819:13;851:7;844:14;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;771:94;:::o;10497:147:0:-;10567:4;10583:33;10593:10;10605:2;10609:6;10583:9;:33::i;:::-;10633:4;10626:11;;10497:147;;;;:::o;871:1556:2:-;936:20;968:10;1021:7;1004:25;;;;;;;;:::i;:::-;;;;;;;;;;;;;994:36;;;;;;981:51;;968:64;;1042:19;1071;1112:3;1104:4;:11;;;1100:475;;1131:19;;;;;;;;;;;;;;;;;;;1164:15;;;;;;;;;;;;;;;;;;;1100:475;;;1208:3;1200:4;:11;;;1196:379;;1227:18;;;;;;;;;;;;;;;;;;;1259:14;;;;;;;;;;;;;;;;;;;1196:379;;;1302:3;1294:4;:11;;;1290:285;;1321:19;;;;;;;;;;;;;;;;;;;1354:16;;;;;;;;;;;;;;;;;;;1290:285;;;1399:3;1391:4;:11;;;1387:188;;1418:24;;;;;;;;;;;;;;;;;;;1456:16;;;;;;;;;;;;;;;;;;;1387:188;;;1501:3;1493:4;:11;;;1489:86;;1520:17;;;;;;;;;;;;;;;;;;;1551:13;;;;;;;;;;;;;;;;;;;1489:86;1387:188;1290:285;1196:379;1100:475;1584:26;1708:27;1727:7;1708:18;:27::i;:::-;1671:65;;;;;;;;:::i;:::-;;;;;;;;;;;;;1640:282;;;;;;;;:::i;:::-;;;;;;;;;;;;;1950:8;1960:5;1936:30;;;;;;;;;:::i;:::-;;;;;;;;;;;;;1613:363;;;;;;;;;:::i;:::-;;;;;;;;;;;;;1584:392;;1986:27;2106:5;2016:105;;;;;;;;:::i;:::-;;;;;;;;;;;;;1986:135;;2131:28;:37;;;;;;;;;;;;;;;;;;;2324:12;2338:13;2310:42;;;;;;;;;:::i;:::-;;;;;;;;;;;;;2374:14;2275:131;;;;;;;;;:::i;:::-;;;;;;;;;;;;;2197:223;;;;;;;;:::i;:::-;;;;;;;;;;;;;2178:242;;;;;;;;871:1556;;;:::o;9452:149:0:-;9524:7;9550:18;:16;:18::i;:::-;:28;;:35;9579:5;9550:35;;;;;;;;;;;;;;;:44;9586:7;9550:44;;;;;;;;;;;;;;;;9543:51;;9452:149;;;;:::o;10363:708:4:-;12517:13;:11;:13::i;:::-;10597:19:::1;10591:4;10584:33;10643:12;10637:4;10630:26;10705:4;10699;10689:21;10811:12;10805:19;10792:11;10789:36;10786:157;;;10857:10;10851:4;10844:24;10924:4;10918;10911:18;10786:157;11020:1;11006:12;10999:23;10515:517;11041:23;11051:12;11041:9;:23::i;:::-;10363:708:::0;:::o;8348:349::-;12517:13;:11;:13::i;:::-;8520:8:::1;8516:2;8512:17;8502:150;;8562:10;8556:4;8549:24;8633:4;8627;8620:18;8502:150;8671:19;8681:8;8671:9;:19::i;:::-;8348:349:::0;:::o;11693:435::-;11812:14;11963:19;11957:4;11950:33;12009:12;12003:4;11996:26;12106:4;12100;12090:21;12084:28;12074:38;;11693:435;;;:::o;27257:116:0:-;27317:4;27364:1;27340:26;;:12;27349:2;27340:8;:12::i;:::-;:26;;;;27333:33;;27257:116;;;:::o;26737:196::-;26798:7;26817:22;26842:18;:16;:18::i;:::-;26817:43;;26877:1;:16;;:49;26894:31;26899:1;:4;;26905:19;26921:2;26905:15;:19::i;:::-;26894:4;:31::i;:::-;26877:49;;;;;;;;;;;;;;;;;;;;;;;;;26870:56;;;26737:196;;;:::o;36593:97::-;36651:7;36682:1;36677;:6;;36670:13;;36593:97;;;:::o;36931:164::-;37005:13;37085:1;37079;37071:5;:9;37070:16;;37046:3;:7;;:19;37063:1;37054:5;:10;;37046:19;;;;;;;;;;;;:41;;37030:58;;36931:164;;;;:::o;24762:398::-;24821:21;24854:22;24879:18;:16;:18::i;:::-;24854:43;;24911:1;:13;;:16;24925:1;24911:16;;;;;;;;;;;;;;;24907:20;;24986:1;3912:6;24942:1;:7;;;;;;;;;;;;:40;:45;;;24938:216;;25003:11;3912:6;25003:44;;25065:11;25074:1;25065:8;:11::i;:::-;25061:53;;;4046:6;25078:36;;;;25061:53;25138:5;25128:1;:7;;;:15;;;;;;;;;;;;;;;;;;24989:165;24938:216;24844:316;24762:398;;;:::o;25321:457::-;25452:19;25487:22;25512:18;:16;:18::i;:::-;25487:43;;25555:13;:26;;;;;;;;;;;;25540:41;;25611:1;25595:12;:17;;;25591:181;;25645:1;:12;;;25643:14;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;25628:29;;25700:12;25671:13;:26;;;:41;;;;;;;;;;;;;;;;;;25759:2;25726:1;:16;;:30;25743:12;25726:30;;;;;;;;;;;;;;;;:35;;;;;;;;;;;;;;;;;;25591:181;25477:301;25321:457;;;;:::o;37160:531::-;37323:8;37317:4;37310:22;37365:5;37362:1;37358:13;37352:4;37345:27;37410:4;37404;37394:21;37472:1;37465:5;37461:13;37458:1;37454:21;37534:1;37528:8;37581:10;37665:5;37661:1;37658;37654:9;37650:21;37647:1;37643:29;37640:1;37636:37;37633:1;37629:45;37626:1;37619:56;37296:389;;;;37160:531;;;:::o;36733:133::-;36787:7;36848:1;36843;36838;:6;;36837:12;36830:19;;36733:133;;;:::o;17271:3197::-;17377:1;17363:16;;:2;:16;;;17359:52;;17388:23;;;;;;;;;;;;;;17359:52;17422:22;17447:18;:16;:18::i;:::-;17422:43;;17476:35;17514:18;17527:4;17514:12;:18::i;:::-;17476:56;;17542:33;17578:16;17591:2;17578:12;:16::i;:::-;17542:52;;17605:23;;:::i;:::-;17658:15;:27;;;;;;;;;;;;17638:47;;:1;:17;;:47;;;;;17713:13;:25;;;;;;;;;;;;17695:43;;:1;:15;;:43;;;;;17764:15;:23;;;;;;;;;;;;17748:39;;:1;:13;;:39;;;;;17811:1;:13;;;17802:6;:22;17798:56;;;17833:21;;;;;;;;;;;;;;17798:56;17906:6;17889:1;:13;;:23;;;;;;;;;;;17959:1;:13;;;17926:15;:23;;;:47;;;;;;;;;;;;;;;;;;18056:6;18032:13;:21;;;;;;;;;;;;:30;;;18018:1;:11;;:44;;;;17987:13;:21;;;:76;;;;;;;;;;;;;;;;;;18098:54;18112:1;:17;;;3537:8;18131:1;:13;;;:20;;;;;:::i;:::-;;;18098:13;:54::i;:::-;18078:1;:17;;:74;;;;;18224:1;4046:6;18171:13;:19;;;;;;;;;;;;:49;:54;;;18167:252;;18257:2;18249:10;;:4;:10;;;18245:71;;18299:1;:17;;;18279:1;:17;;;:37;18261:1;:15;;:55;;;;;18245:71;18354:50;3537:8;18368:1;:11;;;:18;;;;;:::i;:::-;;;18388:1;:15;;;18354:13;:50::i;:::-;18334:1;:17;;:70;;;;;18167:252;18433:29;18465:56;18503:1;:17;;;18483:1;:17;;;:37;18465:17;:56::i;:::-;18433:88;;18561:1;18540;:17;;;:22;18536:690;;18582:27;18612:1;:7;;:13;18620:4;18612:13;;;;;;;;;;;;;;;18582:43;;18643:17;18663:1;:17;;;18643:37;;18698:15;18728:1;:17;;;18716:9;:29;18698:47;;18790:1;:17;;;18763:1;:16;;;:45;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;18863:7;18826:15;:27;;;:45;;;;;;;;;;;;;;;;;;18919:293;18944:10;18957:28;18962:9;18973:11;;;;;;;18957:4;:28::i;:::-;18944:41;;;;19007:43;19035:1;:4;;19041:2;19045:1;19048;19007:27;:43::i;:::-;19079:1;:16;;:20;19096:2;19079:20;;;;;;;;;;;;19072:27;;;;;;;;;;;19121:42;19139:10;19151:4;19157:2;19161:1;19121:17;:42::i;:::-;18922:260;19203:7;19190:9;:20;18919:293;;18564:662;;;18536:690;19265:1;19244;:17;;;:22;19240:1048;;19286:25;19314:1;:7;;:11;19322:2;19314:11;;;;;;;;;;;;;;;19286:39;;19343:15;19361:1;:15;;;19343:33;;19394:13;19420:1;:17;;;19410:7;:27;19394:43;;19455:14;19472:43;19497:13;19512:2;19472:24;:43::i;:::-;19455:60;;19533:16;3537:8;19552:1;:13;;;;;;;;;;;;:20;;;;;;;:::i;:::-;;;19533:39;;19590:10;19603:1;:13;;;;;;;;;;;;19590:26;;;;19661:1;:17;;;19634:1;:16;;;:45;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;19732:5;19697:13;:25;;;:41;;;;;;;;;;;;;;;;;;19786:444;19811:121;19853:1;19818:31;19823:1;:4;;19829:19;19845:2;19829:15;:19::i;:::-;19818:4;:31::i;:::-;:36;;;19811:121;;19893:8;19886:4;;;;;;:15;19882:27;;;19908:1;19903:6;;19882:27;19811:121;;;19953:34;19958:7;19967;19983:2;19953:4;:34::i;:::-;20009:65;20037:1;:4;;20043:2;20047:7;20063:9;;;;;;20009:27;:65::i;:::-;20096:40;20114:10;20126:2;20130;20134:1;20096:17;:40::i;:::-;20169:8;20162:4;;;;;;:15;20158:27;;;20184:1;20179:6;;20158:27;20223:5;20212:7;:16;19786:444;;20270:2;20247:1;:13;;;:26;;;;;;;;;;;;;;;;;;19268:1020;;;;;;19240:1048;20332:1;20306:10;:15;;;:22;:27;20302:109;;20353:43;20369:10;20381:1;:14;;;;;;;;;;;;20353:15;:43::i;:::-;20302:109;17865:2556;20450:2;20435:26;;20444:4;20435:26;;;20454:6;20435:26;;;;;;:::i;:::-;;;;;;;;17349:3119;;;;17271:3197;;;:::o;7878:110:4:-;7947:6;7972:9;7965:16;;7878:110;:::o;35576:212:0:-;35627:11;35738:1;35726:14;35716:24;;35576:212;;;:::o;7292:355:4:-;7504:11;7498:18;7488:8;7485:32;7475:156;;7550:10;7544:4;7537:24;7612:4;7606;7599:18;7475:156;7292:355::o;3515:406:5:-;3781:4;3769:10;3763:4;3751:10;3736:13;3732:2;3725:5;3720:66;3710:195;;3819:10;3813:4;3806:24;3886:4;3880;3873:18;3710:195;3515:406;:::o;6145:1089:4:-;6213:23;:21;:23::i;:::-;6209:1019;;;6343:11;6443:8;6439:2;6435:17;6431:2;6427:26;6415:38;;6597:8;6585:9;6579:16;6539:38;6536:1;6533;6528:78;6710:8;6703:16;6698:3;6694:26;6684:8;6681:40;6670:9;6663:59;6308:428;6209:1019;;;6857:11;6957:8;6953:2;6949:17;6945:2;6941:26;6929:38;;7111:8;7099:9;7093:16;7053:38;7050:1;7047;7042:78;7195:8;7184:9;7177:27;6822:396;6209:1019;6145:1089;:::o;1947:1641:3:-;2003:17;2448:4;2441;2435:11;2431:22;2424:29;;2547:4;2542:3;2538:14;2532:4;2525:28;2628:1;2623:3;2616:14;2729:3;2759:1;2755:6;2968:5;2950:402;2976:1;2950:402;;;3015:1;3010:3;3006:11;2999:18;;3201:2;3195:4;3191:13;3187:2;3183:22;3178:3;3170:36;3293:2;3287:4;3283:13;3275:21;;3323:4;2950:402;3313:25;2950:402;2954:21;3389:3;3384;3380:13;3502:4;3497:3;3493:14;3486:21;;3565:6;3560:3;3553:19;2084:1498;;;1947:1641;;;:::o;36357:199:0:-;36424:9;36537:1;36534;36530:9;36526:1;36523;36520:8;36516:24;36511:29;;36357:199;;;;:::o;33602:440::-;33662:20;;:::i;:::-;33789:4;33782;33776:11;33772:22;33864:1;33858:4;33851:15;33903:4;33897;33893:15;33953:1;33950;33946:9;33938:6;33934:22;33928:4;33921:36;33980:4;33977:1;33970:15;34019:6;34015:1;34009:4;34005:12;33998:28;33746:290;;33602:440;;;:::o;37761:691::-;38045:9;38033:10;38029:26;38016:10;38012:2;38008:19;38005:51;38082:8;38076:4;38069:22;38124:2;38121:1;38117:10;38111:4;38104:24;38166:4;38160;38150:21;38225:1;38221:2;38217:10;38214:1;38210:18;38287:1;38281:8;38334:18;38426:5;38422:1;38419;38415:9;38411:21;38408:1;38404:29;38401:1;38397:37;38394:1;38390:45;38387:1;38380:56;37978:468;;;;;37761:691;;;;:::o;34145:367::-;34373:1;34367:4;34363:12;34357:19;34435:7;34429:2;34426:1;34422:10;34418:1;34414:2;34410:10;34407:26;34404:39;34396:6;34389:55;34490:4;34482:6;34478:17;34474:1;34468:4;34464:12;34457:39;34329:177;34145:367;;;;:::o;34608:622::-;34773:1;34767:8;34807:4;34801;34797:15;34865:10;34862:1;34855:21;34939:4;34932;34929:1;34925:12;34918:26;35034:4;35028:11;35025:1;35021:19;35015:4;35011:30;35159:4;35156:1;35153;35146:4;35143:1;35139:12;35136:1;35128:6;35121:5;35116:48;35112:1;35108;35102:8;35099:15;35095:70;35085:129;;35195:4;35192:1;35185:15;35085:129;34741:483;;;34608:622;;:::o;4348:78:4:-;4412:10;4348:78;:::o;-1:-1:-1:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;:::o;7:99:6:-;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;1553:117;1662:1;1659;1652: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:329::-;4482:6;4531:2;4519:9;4510:7;4506:23;4502:32;4499:119;;;4537:79;;:::i;:::-;4499:119;4657:1;4682:53;4727:7;4718:6;4707:9;4703:22;4682:53;:::i;:::-;4672:63;;4628:117;4423:329;;;;:::o;4758:86::-;4793:7;4833:4;4826:5;4822:16;4811:27;;4758:86;;;:::o;4850:112::-;4933:22;4949:5;4933:22;:::i;:::-;4928:3;4921:35;4850:112;;:::o;4968:214::-;5057:4;5095:2;5084:9;5080:18;5072:26;;5108:67;5172:1;5161:9;5157:17;5148:6;5108:67;:::i;:::-;4968:214;;;;:::o;5188:118::-;5275:24;5293:5;5275:24;:::i;:::-;5270:3;5263:37;5188:118;;:::o;5312:222::-;5405:4;5443:2;5432:9;5428:18;5420:26;;5456:71;5524:1;5513:9;5509:17;5500:6;5456:71;:::i;:::-;5312:222;;;;:::o;5540:117::-;5649:1;5646;5639:12;5663:117;5772:1;5769;5762:12;5786:117;5895:1;5892;5885:12;5923:553;5981:8;5991:6;6041:3;6034:4;6026:6;6022:17;6018:27;6008:122;;6049:79;;:::i;:::-;6008:122;6162:6;6149:20;6139:30;;6192:18;6184:6;6181:30;6178:117;;;6214:79;;:::i;:::-;6178:117;6328:4;6320:6;6316:17;6304:29;;6382:3;6374:4;6366:6;6362:17;6352:8;6348:32;6345:41;6342:128;;;6389:79;;:::i;:::-;6342:128;5923:553;;;;;:::o;6482:529::-;6553:6;6561;6610:2;6598:9;6589:7;6585:23;6581:32;6578:119;;;6616:79;;:::i;:::-;6578:119;6764:1;6753:9;6749:17;6736:31;6794:18;6786:6;6783:30;6780:117;;;6816:79;;:::i;:::-;6780:117;6929:65;6986:7;6977:6;6966:9;6962:22;6929:65;:::i;:::-;6911:83;;;;6707:297;6482:529;;;;;:::o;7017:329::-;7076:6;7125:2;7113:9;7104:7;7100:23;7096:32;7093:119;;;7131:79;;:::i;:::-;7093:119;7251:1;7276:53;7321:7;7312:6;7301:9;7297:22;7276:53;:::i;:::-;7266:63;;7222:117;7017:329;;;;:::o;7352:474::-;7420:6;7428;7477:2;7465:9;7456:7;7452:23;7448:32;7445:119;;;7483:79;;:::i;:::-;7445:119;7603:1;7628:53;7673:7;7664:6;7653:9;7649:22;7628:53;:::i;:::-;7618:63;;7574:117;7730:2;7756:53;7801:7;7792:6;7781:9;7777:22;7756:53;:::i;:::-;7746:63;;7701:118;7352:474;;;;;:::o;7832:109::-;7868:7;7908:26;7901:5;7897:38;7886:49;;7832:109;;;:::o;7947:180::-;7995:77;7992:1;7985:88;8092:4;8089:1;8082:15;8116:4;8113:1;8106:15;8133:216;8172:4;8192:19;8209:1;8192:19;:::i;:::-;8187:24;;8225:19;8242:1;8225:19;:::i;:::-;8220:24;;8268:1;8265;8261:9;8253:17;;8292:26;8286:4;8283:36;8280:62;;;8322:18;;:::i;:::-;8280:62;8133:216;;;;:::o;8355:180::-;8403:77;8400:1;8393:88;8500:4;8497:1;8490:15;8524:4;8521:1;8514:15;8541:320;8585:6;8622:1;8616:4;8612:12;8602:22;;8669:1;8663:4;8659:12;8690:18;8680:81;;8746:4;8738:6;8734:17;8724:27;;8680:81;8808:2;8800:6;8797:14;8777:18;8774:38;8771:84;;8827:18;;:::i;:::-;8771:84;8592:269;8541:320;;;:::o;8867:97::-;8926:6;8954:3;8944:13;;8867:97;;;;:::o;8970:180::-;9018:77;9015:1;9008:88;9115:4;9112:1;9105:15;9139:4;9136:1;9129:15;9156:141;9205:4;9228:3;9220:11;;9251:3;9248:1;9241:14;9285:4;9282:1;9272:18;9264:26;;9156:141;;;:::o;9303:93::-;9340:6;9387:2;9382;9375:5;9371:14;9367:23;9357:33;;9303:93;;;:::o;9402:107::-;9446:8;9496:5;9490:4;9486:16;9465:37;;9402:107;;;;:::o;9515:393::-;9584:6;9634:1;9622:10;9618:18;9657:97;9687:66;9676:9;9657:97;:::i;:::-;9775:39;9805:8;9794:9;9775:39;:::i;:::-;9763:51;;9847:4;9843:9;9836:5;9832:21;9823:30;;9896:4;9886:8;9882:19;9875:5;9872:30;9862:40;;9591:317;;9515:393;;;;;:::o;9914:60::-;9942:3;9963:5;9956:12;;9914:60;;;:::o;9980:142::-;10030:9;10063:53;10081:34;10090:24;10108:5;10090:24;:::i;:::-;10081:34;:::i;:::-;10063:53;:::i;:::-;10050:66;;9980:142;;;:::o;10128:75::-;10171:3;10192:5;10185:12;;10128:75;;;:::o;10209:269::-;10319:39;10350:7;10319:39;:::i;:::-;10380:91;10429:41;10453:16;10429:41;:::i;:::-;10421:6;10414:4;10408:11;10380:91;:::i;:::-;10374:4;10367:105;10285:193;10209:269;;;:::o;10484:73::-;10529:3;10484:73;:::o;10563:189::-;10640:32;;:::i;:::-;10681:65;10739:6;10731;10725:4;10681:65;:::i;:::-;10616:136;10563:189;;:::o;10758:186::-;10818:120;10835:3;10828:5;10825:14;10818:120;;;10889:39;10926:1;10919:5;10889:39;:::i;:::-;10862:1;10855:5;10851:13;10842:22;;10818:120;;;10758:186;;:::o;10950:543::-;11051:2;11046:3;11043:11;11040:446;;;11085:38;11117:5;11085:38;:::i;:::-;11169:29;11187:10;11169:29;:::i;:::-;11159:8;11155:44;11352:2;11340:10;11337:18;11334:49;;;11373:8;11358:23;;11334:49;11396:80;11452:22;11470:3;11452:22;:::i;:::-;11442:8;11438:37;11425:11;11396:80;:::i;:::-;11055:431;;11040:446;10950:543;;;:::o;11499:117::-;11553:8;11603:5;11597:4;11593:16;11572:37;;11499:117;;;;:::o;11622:169::-;11666:6;11699:51;11747:1;11743:6;11735:5;11732:1;11728:13;11699:51;:::i;:::-;11695:56;11780:4;11774;11770:15;11760:25;;11673:118;11622:169;;;;:::o;11796:295::-;11872:4;12018:29;12043:3;12037:4;12018:29;:::i;:::-;12010:37;;12080:3;12077:1;12073:11;12067:4;12064:21;12056:29;;11796:295;;;;:::o;12096:1403::-;12220:44;12260:3;12255;12220:44;:::i;:::-;12329:18;12321:6;12318:30;12315:56;;;12351:18;;:::i;:::-;12315:56;12395:38;12427:4;12421:11;12395:38;:::i;:::-;12480:67;12540:6;12532;12526:4;12480:67;:::i;:::-;12574:1;12603:2;12595:6;12592:14;12620:1;12615:632;;;;13291:1;13308:6;13305:84;;;13364:9;13359:3;13355:19;13342:33;13333:42;;13305:84;13415:67;13475:6;13468:5;13415:67;:::i;:::-;13409:4;13402:81;13264:229;12585:908;;12615:632;12667:4;12663:9;12655:6;12651:22;12701:37;12733:4;12701:37;:::i;:::-;12760:1;12774:215;12788:7;12785:1;12782:14;12774:215;;;12874:9;12869:3;12865:19;12852:33;12844:6;12837:49;12925:1;12917:6;12913:14;12903:24;;12972:2;12961:9;12957:18;12944:31;;12811:4;12808:1;12804:12;12799:17;;12774:215;;;13017:6;13008:7;13005:19;13002:186;;;13082:9;13077:3;13073:19;13060:33;13125:48;13167:4;13159:6;13155:17;13144:9;13125:48;:::i;:::-;13117:6;13110:64;13025:163;13002:186;13234:1;13230;13222:6;13218:14;13214:22;13208:4;13201:36;12622:625;;;12585:908;;12195:1304;;;12096:1403;;;:::o;13505:79::-;13544:7;13573:5;13562:16;;13505:79;;;:::o;13590:157::-;13695:45;13715:24;13733:5;13715:24;:::i;:::-;13695:45;:::i;:::-;13690:3;13683:58;13590:157;;:::o;13753:256::-;13865:3;13880:75;13951:3;13942:6;13880:75;:::i;:::-;13980:2;13975:3;13971:12;13964:19;;14000:3;13993:10;;13753:256;;;;:::o;14015:242::-;14184:66;14179:3;14172:79;14015:242;:::o;14263:148::-;14365:11;14402:3;14387:18;;14263:148;;;;:::o;14417:390::-;14523:3;14551:39;14584:5;14551:39;:::i;:::-;14606:89;14688:6;14683:3;14606:89;:::i;:::-;14599:96;;14704:65;14762:6;14757:3;14750:4;14743:5;14739:16;14704:65;:::i;:::-;14794:6;14789:3;14785:16;14778:23;;14527:280;14417:390;;;;:::o;14813:542::-;15036:3;15051:138;15185:3;15051:138;:::i;:::-;15214:2;15209:3;15205:12;15198:19;;15234:95;15325:3;15316:6;15234:95;:::i;:::-;15227:102;;15346:3;15339:10;;14813:542;;;;:::o;15361:555::-;15501:66;15497:1;15489:6;15485:14;15478:90;15602:34;15597:2;15589:6;15585:15;15578:59;15671:34;15666:2;15658:6;15654:15;15647:59;15740:66;15735:2;15727:6;15723:15;15716:91;15842:66;15836:3;15828:6;15824:16;15817:92;15361:555;:::o;15922:404::-;16082:3;16103:86;16185:3;16180;16103:86;:::i;:::-;16096:93;;16198;16287:3;16198:93;:::i;:::-;16316:3;16311;16307:13;16300:20;;15922:404;;;:::o;16332:541::-;16565:3;16587:95;16678:3;16669:6;16587:95;:::i;:::-;16580:102;;16699:148;16843:3;16699:148;:::i;:::-;16692:155;;16864:3;16857:10;;16332:541;;;;:::o;16903:874::-;17006:3;17043:5;17037:12;17072:36;17098:9;17072:36;:::i;:::-;17124:89;17206:6;17201:3;17124:89;:::i;:::-;17117:96;;17244:1;17233:9;17229:17;17260:1;17255:166;;;;17435:1;17430:341;;;;17222:549;;17255:166;17339:4;17335:9;17324;17320:25;17315:3;17308:38;17401:6;17394:14;17387:22;17379:6;17375:35;17370:3;17366:45;17359:52;;17255:166;;17430:341;17497:38;17529:5;17497:38;:::i;:::-;17557:1;17571:154;17585:6;17582:1;17579:13;17571:154;;;17659:7;17653:14;17649:1;17644:3;17640:11;17633:35;17709:1;17700:7;17696:15;17685:26;;17607:4;17604:1;17600:12;17595:17;;17571:154;;;17754:6;17749:3;17745:16;17738:23;;17437:334;;17222:549;;17010:767;;16903:874;;;;:::o;17783:429::-;17960:3;17982:92;18070:3;18061:6;17982:92;:::i;:::-;17975:99;;18091:95;18182:3;18173:6;18091:95;:::i;:::-;18084:102;;18203:3;18196:10;;17783:429;;;;;:::o;18218:435::-;18398:3;18420:95;18511:3;18502:6;18420:95;:::i;:::-;18413:102;;18532:95;18623:3;18614:6;18532:95;:::i;:::-;18525:102;;18644:3;18637:10;;18218:435;;;;;:::o;18659:315::-;18799:66;18795:1;18787:6;18783:14;18776:90;18900:66;18895:2;18887:6;18883:15;18876:91;18659:315;:::o;18980:402::-;19140:3;19161:85;19243:2;19238:3;19161:85;:::i;:::-;19154:92;;19255:93;19344:3;19255:93;:::i;:::-;19373:2;19368:3;19364:12;19357:19;;18980:402;;;:::o;19388:541::-;19621:3;19643:148;19787:3;19643:148;:::i;:::-;19636:155;;19808:95;19899:3;19890:6;19808:95;:::i;:::-;19801:102;;19920:3;19913:10;;19388:541;;;;:::o;19935:205::-;20104:29;20099:3;20092:42;19935:205;:::o;20146:542::-;20369:3;20384:138;20518:3;20384:138;:::i;:::-;20547:2;20542:3;20538:12;20531:19;;20567:95;20658:3;20649:6;20567:95;:::i;:::-;20560:102;;20679:3;20672:10;;20146:542;;;;:::o;20694:93::-;20730:7;20770:10;20763:5;20759:22;20748:33;;20694:93;;;:::o;20793:175::-;20831:3;20854:23;20871:5;20854:23;:::i;:::-;20845:32;;20899:10;20892:5;20889:21;20886:47;;20913:18;;:::i;:::-;20886:47;20960:1;20953:5;20949:13;20942:20;;20793:175;;;:::o;20974:180::-;21022:77;21019:1;21012:88;21119:4;21116:1;21109:15;21143:4;21140:1;21133:15
Swarm Source
ipfs://7f00429b21f9da0621586027c73774f4708a59fab81464ae13f19455b2acd109
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 26 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.