ERC-721
Overview
Max Total Supply
142 Resilience
Holders
142
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Balance
1 ResilienceLoading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
IllustrationOfResilience
Compiler Version
v0.8.21+commit.d9974bed
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.18; library LibString { function toString(int256 value) internal pure returns (string memory str) { if (value >= 0) return toString(uint256(value)); unchecked { str = toString(uint256(-value)); /// @solidity memory-safe-assembly assembly { // Note: This is only safe because we over-allocate memory // and write the string from right to left in toString(uint256), // and thus can be sure that sub(str, 1) is an unused memory location. let length := mload(str) // Load the string length. // Put the - character at the start of the string contents. mstore(str, 45) // 45 is the ASCII code for the - character. str := sub(str, 1) // Move back the string pointer by a byte. mstore(str, add(length, 1)) // Update the string length. } } } 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 160 bytes // to keep the free memory pointer word aligned. We'll need 1 word for the length, 1 word for the // trailing zeros padding, and 3 other words for a max of 78 digits. In total: 5 * 32 = 160 bytes. let newFreeMemoryPointer := add(mload(0x40), 160) // Update the free memory pointer to avoid overriding our string. mstore(0x40, newFreeMemoryPointer) // Assign str to the end of the zone of newly allocated memory. str := sub(newFreeMemoryPointer, 32) // Clean the last word of memory it may not be overwritten. mstore(str, 0) // Cache the end of the memory to calculate the length later. let end := str // We write the string from rightmost digit to leftmost digit. // The following is essentially a do-while loop that also handles the zero case. // prettier-ignore for { let temp := value } 1 {} { // Move the pointer 1 byte to the left. str := 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) // prettier-ignore if iszero(temp) { break } } // Compute and cache the final total length of the string. let length := sub(end, str) // Move the pointer 32 bytes leftwards to make room for the length. str := sub(str, 32) // Store the string's length at the start of memory allocated for our string. mstore(str, length) } } } abstract contract Owned { /*////////////////////////////////////////////////////////////// EVENTS //////////////////////////////////////////////////////////////*/ event OwnershipTransferred(address indexed user, address indexed newOwner); /*////////////////////////////////////////////////////////////// OWNERSHIP STORAGE //////////////////////////////////////////////////////////////*/ address public owner; modifier onlyOwner() virtual { require(msg.sender == owner, "UNAUTHORIZED"); _; } /*////////////////////////////////////////////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////*/ constructor(address _owner) { owner = _owner; emit OwnershipTransferred(address(0), _owner); } /*////////////////////////////////////////////////////////////// OWNERSHIP LOGIC //////////////////////////////////////////////////////////////*/ function transferOwnership(address newOwner) public virtual onlyOwner { owner = newOwner; emit OwnershipTransferred(msg.sender, newOwner); } } library SSTORE2 { uint256 internal constant DATA_OFFSET = 1; /*////////////////////////////////////////////////////////////// WRITE LOGIC //////////////////////////////////////////////////////////////*/ function write(bytes memory data) internal returns (address pointer) { bytes memory runtimeCode = abi.encodePacked(hex"00", data); bytes memory creationCode = abi.encodePacked( hex"60_0B_59_81_38_03_80_92_59_39_F3", runtimeCode ); /// @solidity memory-safe-assembly assembly { // Deploy a new contract with the generated creation code. // We start 32 bytes into the code to avoid copying the byte length. pointer := create(0, add(creationCode, 32), mload(creationCode)) } require(pointer != address(0), "DEPLOYMENT_FAILED"); } /*////////////////////////////////////////////////////////////// READ LOGIC //////////////////////////////////////////////////////////////*/ function read(address pointer) internal view returns (bytes memory) { return readBytecode(pointer, DATA_OFFSET, pointer.code.length - DATA_OFFSET); } function read(address pointer, uint256 start) internal view returns (bytes memory) { start += DATA_OFFSET; return readBytecode(pointer, start, pointer.code.length - start); } function read( address pointer, uint256 start, uint256 end ) internal view returns (bytes memory) { start += DATA_OFFSET; end += DATA_OFFSET; require(pointer.code.length >= end, "OUT_OF_BOUNDS"); return readBytecode(pointer, start, end - start); } /*////////////////////////////////////////////////////////////// INTERNAL HELPER LOGIC //////////////////////////////////////////////////////////////*/ function readBytecode( address pointer, uint256 start, uint256 size ) private view returns (bytes memory data) { /// @solidity memory-safe-assembly assembly { // Get a pointer to some free memory. data := mload(0x40) mstore(0x40, add(data, and(add(add(size, 32), 31), not(31)))) mstore(data, size) extcodecopy(pointer, add(data, 32), start, size) } } } abstract contract ERC721 { /*////////////////////////////////////////////////////////////// EVENTS //////////////////////////////////////////////////////////////*/ event Transfer(address indexed from, address indexed to, uint256 indexed id); event Approval(address indexed owner, address indexed spender, uint256 indexed id); event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /*////////////////////////////////////////////////////////////// METADATA STORAGE/LOGIC //////////////////////////////////////////////////////////////*/ string public name; string public symbol; function tokenURI(uint256 id) public view virtual returns (string memory); /*////////////////////////////////////////////////////////////// ERC721 BALANCE/OWNER STORAGE //////////////////////////////////////////////////////////////*/ mapping(uint256 => address) internal _ownerOf; mapping(address => uint256) internal _balanceOf; function ownerOf(uint256 id) public view virtual returns (address owner) { require((owner = _ownerOf[id]) != address(0), "NOT_MINTED"); } function balanceOf(address owner) public view virtual returns (uint256) { require(owner != address(0), "ZERO_ADDRESS"); return _balanceOf[owner]; } /*////////////////////////////////////////////////////////////// ERC721 APPROVAL STORAGE //////////////////////////////////////////////////////////////*/ mapping(uint256 => address) public getApproved; mapping(address => mapping(address => bool)) public isApprovedForAll; /*////////////////////////////////////////////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////*/ constructor(string memory _name, string memory _symbol) { name = _name; symbol = _symbol; } /*////////////////////////////////////////////////////////////// ERC721 LOGIC //////////////////////////////////////////////////////////////*/ function approve(address spender, uint256 id) public virtual { address owner = _ownerOf[id]; require(msg.sender == owner || isApprovedForAll[owner][msg.sender], "NOT_AUTHORIZED"); getApproved[id] = spender; emit Approval(owner, spender, id); } function setApprovalForAll(address operator, bool approved) public virtual { isApprovedForAll[msg.sender][operator] = approved; emit ApprovalForAll(msg.sender, operator, approved); } function transferFrom( address from, address to, uint256 id ) public virtual { require(from == _ownerOf[id], "WRONG_FROM"); require(to != address(0), "INVALID_RECIPIENT"); require( msg.sender == from || isApprovedForAll[from][msg.sender] || msg.sender == getApproved[id], "NOT_AUTHORIZED" ); // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. unchecked { _balanceOf[from]--; _balanceOf[to]++; } _ownerOf[id] = to; delete getApproved[id]; emit Transfer(from, to, id); } function safeTransferFrom( address from, address to, uint256 id ) public virtual { transferFrom(from, to, id); require( to.code.length == 0 || ERC721TokenReceiver(to).onERC721Received(msg.sender, from, id, "") == ERC721TokenReceiver.onERC721Received.selector, "UNSAFE_RECIPIENT" ); } function safeTransferFrom( address from, address to, uint256 id, bytes calldata data ) public virtual { transferFrom(from, to, id); require( to.code.length == 0 || ERC721TokenReceiver(to).onERC721Received(msg.sender, from, id, data) == ERC721TokenReceiver.onERC721Received.selector, "UNSAFE_RECIPIENT" ); } /*////////////////////////////////////////////////////////////// ERC165 LOGIC //////////////////////////////////////////////////////////////*/ function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) { return interfaceId == 0x01ffc9a7 || // ERC165 Interface ID for ERC165 interfaceId == 0x80ac58cd || // ERC165 Interface ID for ERC721 interfaceId == 0x5b5e139f; // ERC165 Interface ID for ERC721Metadata } /*////////////////////////////////////////////////////////////// INTERNAL MINT/BURN LOGIC //////////////////////////////////////////////////////////////*/ function _mint(address to, uint256 id) internal virtual { require(to != address(0), "INVALID_RECIPIENT"); require(_ownerOf[id] == address(0), "ALREADY_MINTED"); // Counter overflow is incredibly unrealistic. unchecked { _balanceOf[to]++; } _ownerOf[id] = to; emit Transfer(address(0), to, id); } function _burn(uint256 id) internal virtual { address owner = _ownerOf[id]; require(owner != address(0), "NOT_MINTED"); // Ownership check above ensures no underflow. unchecked { _balanceOf[owner]--; } delete _ownerOf[id]; delete getApproved[id]; emit Transfer(owner, address(0), id); } /*////////////////////////////////////////////////////////////// INTERNAL SAFE MINT LOGIC //////////////////////////////////////////////////////////////*/ function _safeMint(address to, uint256 id) internal virtual { _mint(to, id); require( to.code.length == 0 || ERC721TokenReceiver(to).onERC721Received(msg.sender, address(0), id, "") == ERC721TokenReceiver.onERC721Received.selector, "UNSAFE_RECIPIENT" ); } function _safeMint( address to, uint256 id, bytes memory data ) internal virtual { _mint(to, id); require( to.code.length == 0 || ERC721TokenReceiver(to).onERC721Received(msg.sender, address(0), id, data) == ERC721TokenReceiver.onERC721Received.selector, "UNSAFE_RECIPIENT" ); } } abstract contract ERC721TokenReceiver { function onERC721Received( address, address, uint256, bytes calldata ) external virtual returns (bytes4) { return ERC721TokenReceiver.onERC721Received.selector; } } abstract contract SS2ERC721Base is ERC721 { /*////////////////////////////////////////////////////////////// CONSTANTS //////////////////////////////////////////////////////////////*/ uint256 internal constant WORD_SIZE = 32; uint256 internal constant ADDRESS_SIZE_BYTES = 20; uint256 internal constant ADDRESS_OFFSET_BITS = 96; uint256 internal constant FREE_MEM_PTR = 0x40; uint256 internal constant SSTORE2_DATA_OFFSET = 1; uint256 internal constant ERROR_STRING_SELECTOR = 0x08c379a0; // Error(string) uint256 internal constant SSTORE2_CREATION_CODE_PREFIX = 0x600B5981380380925939F3; // see SSTORE2.sol uint256 internal constant SSTORE2_CREATION_CODE_OFFSET = 12; // prefix length + 1 for a 0 byte // The `Transfer` event signature is given by: // `keccak256(bytes("Transfer(address,address,uint256)"))`. bytes32 internal constant TRANSFER_EVENT_SIGNATURE = 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef; // The mask of the lower 160 bits for addresses. uint256 internal constant BITMASK_ADDRESS = (1 << 160) - 1; /// @dev a flag for _balanceIndicator uint256 internal constant SKIP_PRIMARY_BALANCE = 1 << 255; /// @dev a flag for _ownerIndicator /// @dev use a different value then SKIP_PRIMARY_BALANCE to avoid confusion uint256 internal constant BURNED = 1 << 254; uint256 internal constant BALANCE_MASK = type(uint256).max >> 1; /*////////////////////////////////////////////////////////////// MUTABLE STORAGE //////////////////////////////////////////////////////////////*/ /// @dev mapping from token id to indicator (owner address plus burned flag packed in the higher bits) mapping(uint256 => uint256) internal _ownerIndicator; /// @dev 255-bit balance + 1-bit not primary owner flag /// /// - ownerIndicator[id] == 0 == (not_burned, address(0)) /// means that there is no secondary owner for id and we should fall back to the primary owner check /// /// - ownerIndicator[id] == (burned, address(0)) /// means that address(0) *is* the secondary owner, no need to fall back on the primary owner check /// /// - ownerIndicator[id] == (not_burned, owner) /// means that `owner` is the secondary owner, no need to fall back on the primary owner check mapping(address => uint256) internal _balanceIndicator; /*////////////////////////////////////////////////////////////// VIEW FUNCTIONS //////////////////////////////////////////////////////////////*/ /// implementations must override this function to return the number of tokens minted function _ownersPrimaryLength() internal view virtual returns (uint256); /// implementations must override this function to return the primary owner of a token /// or address(0) if the token does not exist function _ownerOfPrimary(uint256 id) internal view virtual returns (address owner); /// @dev performs no bounds check, just a raw extcodecopy on the pointer /// @return addr the address at the given pointer (may include 0 bytes if reading past the end of the pointer) function SSTORE2_readRawAddress(address pointer, uint256 start) internal view returns (address addr) { // we're going to read 20 bytes from the pointer in the first scratch space slot uint256 dest_offset = 12; assembly { start := add(start, 1) // add the SSTORE2 DATA_OFFSET // clear it the first scratch space slot mstore(0, 0) extcodecopy(pointer, dest_offset, start, 20) addr := mload(0) } } function _getOwnerSecondary(uint256 id) internal view returns (address owner) { owner = address(uint160(_ownerIndicator[id])); } function _setOwnerSecondary(uint256 id, address owner) internal { if (owner == address(0)) { _setBurned(id); } else { // we don't expect this to be called after burning, so no need to carry over the BURNED flag _ownerIndicator[id] = uint160(owner); } } function _hasBeenBurned(uint256 id) internal view returns (bool) { return _ownerIndicator[id] & BURNED != 0; } /// @dev sets the burned flag *and* sets the owner to address(0) function _setBurned(uint256 id) internal { _ownerIndicator[id] = BURNED; } // binary search of the address based on _ownerOfPrimary // performs O(log n) sloads // relies on the assumption that the list of addresses is sorted and contains no duplicates // returns 1 if the address is found in _ownersPrimary, 0 if not function _balanceOfPrimary(address owner) internal view returns (uint256) { uint256 low = 1; uint256 high = _ownersPrimaryLength(); uint256 mid = (low + high) / 2; // TODO: unchecked while (low <= high) { address midOwner = _ownerOfPrimary(mid); if (midOwner == owner) { return 1; } else if (midOwner < owner) { low = mid + 1; } else { high = mid - 1; } mid = (low + high) / 2; } return 0; } /// @dev for internal use -- does not revert on unminted token ids function __ownerOf(uint256 id) internal view returns (address owner) { uint256 ownerIndicator = _ownerIndicator[id]; owner = address(uint160(ownerIndicator)); if (ownerIndicator & BURNED == BURNED) { // normally 0, but return what has been set in the mapping in case inherited contract changes it return owner; } // we use 0 as a sentinel value, meaning that we can't burn by setting the owner to address(0) if (owner == address(0)) { owner = _ownerOfPrimary(id); } } function ownerOf(uint256 id) public view virtual override returns (address owner) { owner = __ownerOf(id); require(owner != address(0), "NOT_MINTED"); } function balanceOf(address owner) public view virtual override returns (uint256 balance) { require(owner != address(0), "ZERO_ADDRESS"); uint256 balanceIndicator = _balanceIndicator[owner]; balance = balanceIndicator & BALANCE_MASK; if (balanceIndicator & SKIP_PRIMARY_BALANCE == 0) { balance += _balanceOfPrimary(owner); } } /*////////////////////////////////////////////////////////////// ERC721 LOGIC //////////////////////////////////////////////////////////////*/ function approve(address spender, uint256 id) public virtual override { // need to use the ownerOf getter here instead of directly accessing the storage address owner = __ownerOf(id); require(msg.sender == owner || isApprovedForAll[owner][msg.sender], "NOT_AUTHORIZED"); getApproved[id] = spender; emit Approval(owner, spender, id); } function transferFrom(address from, address to, uint256 id) public virtual override { require( msg.sender == from || isApprovedForAll[from][msg.sender] || msg.sender == getApproved[id], "NOT_AUTHORIZED" ); require(to != address(0), "INVALID_RECIPIENT"); address owner = _moveTokenTo(id, to); require(from == owner, "WRONG_FROM"); unchecked { ++_balanceIndicator[to]; } } /// @dev needs to be overridden here to invoke our custom version of transferFrom function safeTransferFrom(address from, address to, uint256 id) public virtual override { transferFrom(from, to, id); require( to.code.length == 0 || ERC721TokenReceiver(to).onERC721Received(msg.sender, from, id, "") == ERC721TokenReceiver.onERC721Received.selector, "UNSAFE_RECIPIENT" ); } /// @dev needs to be overridden here to invoke our custom version of transferFrom function safeTransferFrom(address from, address to, uint256 id, bytes calldata data) public virtual override { transferFrom(from, to, id); require( to.code.length == 0 || ERC721TokenReceiver(to).onERC721Received(msg.sender, from, id, data) == ERC721TokenReceiver.onERC721Received.selector, "UNSAFE_RECIPIENT" ); } function _burn(uint256 id) internal virtual override { _moveTokenTo(id, address(0)); } function _moveTokenTo(uint256 id, address to) private returns (address owner) { owner = _getOwnerSecondary(id); if (owner == address(0)) { owner = _ownerOfPrimary(id); require(owner != address(0), "NOT_MINTED"); _balanceIndicator[owner] |= SKIP_PRIMARY_BALANCE; } else { unchecked { --_balanceIndicator[owner]; } } _setOwnerSecondary(id, to); delete getApproved[id]; emit Transfer(owner, to, id); } /*////////////////////////////////////////////////////////////// INTERNAL SAFE MINT LOGIC //////////////////////////////////////////////////////////////*/ /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory data) internal returns (bool) { if (to.code.length == 0) { return true; } try ERC721TokenReceiver(to).onERC721Received(msg.sender, from, tokenId, data) returns (bytes4 retval) { return retval == ERC721TokenReceiver.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("UNSAFE_RECIPIENT"); } else { /// @solidity memory-safe-assembly assembly { revert(add(32, reason), mload(reason)) } } } } } abstract contract SS2ERC721 is SS2ERC721Base { address internal _ownersPrimaryPointer; /*////////////////////////////////////////////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////*/ constructor(string memory _name, string memory _symbol) ERC721(_name, _symbol) {} /*////////////////////////////////////////////////////////////// OWNER / BALANCE LOGIC //////////////////////////////////////////////////////////////*/ function _ownersPrimaryLength() internal view override returns (uint256) { if (_ownersPrimaryPointer == address(0)) { return 0; } // checked math will underflow if _ownersPrimaryPointer.code.length == 0 return (_ownersPrimaryPointer.code.length - 1) / 20; } function _ownerOfPrimary(uint256 id) internal view override returns (address owner) { // this is an internal method, so return address(0) and let the caller decide if they want to revert if (id == 0) { return address(0); } address pointer = _ownersPrimaryPointer; if (pointer == address(0)) { return address(0); } unchecked { // can not underflow because we checked id != 0 uint256 zeroBasedId = id - 1; // this can overflow! uint256 start = zeroBasedId * 20; // check for overflow and exit cleanly if it happens if (start < zeroBasedId) { return address(0); } owner = SSTORE2_readRawAddress(pointer, start); } } /*////////////////////////////////////////////////////////////// INTERNAL MINT/BURN LOGIC //////////////////////////////////////////////////////////////*/ /// @dev this function creates a new SSTORE2 pointer, and saves it /// @dev reading addresses from calldata means we can assemble the creation code with a single memory copy function _mint(bytes calldata addresses) internal virtual returns (uint256 numMinted) { assembly { function revert_invalid_addresses() { let ptr := mload(FREE_MEM_PTR) mstore(ptr, shl(224, ERROR_STRING_SELECTOR)) mstore(add(ptr, 0x04), WORD_SIZE) // String offset mstore(add(ptr, 0x24), 17) // Revert reason length mstore(add(ptr, 0x44), "INVALID_ADDRESSES") revert(ptr, 0x64) // Revert data length is 4 bytes for selector and 3 slots of 0x20 bytes } function revert_already_minted() { let ptr := mload(FREE_MEM_PTR) mstore(ptr, shl(224, ERROR_STRING_SELECTOR)) mstore(add(ptr, 0x04), WORD_SIZE) // String offset mstore(add(ptr, 0x24), 14) // Revert reason length mstore(add(ptr, 0x44), "ALREADY_MINTED") revert(ptr, 0x64) // Revert data length is 4 bytes for selector and 3 slots of 0x20 bytes } function revert_not_sorted() { let ptr := mload(FREE_MEM_PTR) mstore(ptr, shl(224, ERROR_STRING_SELECTOR)) mstore(add(ptr, 0x04), WORD_SIZE) // String offset mstore(add(ptr, 0x24), 20) // Revert reason length mstore(add(ptr, 0x44), "ADDRESSES_NOT_SORTED") revert(ptr, 0x64) // Revert data length is 4 bytes for selector and 3 slots of 0x20 bytes } let stored_primary_pointer := sload(_ownersPrimaryPointer.slot) let primary_pointer := and(stored_primary_pointer, BITMASK_ADDRESS) // if the primary pointer is already set, we can't mint // note: we don't clean the upper bits of the address, we check against the full word if gt(primary_pointer, 0) { revert_already_minted() } // we expect addresses.length to be > 0 if eq(addresses.length, 0) { revert_invalid_addresses() } // we expect the SSTORE2 pointer to contain a list of packed addresses // so the length must be a multiple of 20 bytes if gt(mod(addresses.length, ADDRESS_SIZE_BYTES), 0) { revert_invalid_addresses() } // the SSTORE2 creation code is SSTORE2_CREATION_CODE_PREFIX + addresses_data let creation_code_len := add(SSTORE2_CREATION_CODE_OFFSET, addresses.length) let creation_code_ptr := mload(FREE_MEM_PTR) // copy the creation code prefix // this sets up the memory at creation_code_ptr with the following word: // 600B5981380380925939F3000000000000000000000000000000000000000000 // this also has the advantage of storing fresh 0 bytes mstore( creation_code_ptr, shl( 168, // shift the prefix to the left by 21 bytes SSTORE2_CREATION_CODE_PREFIX ) ) // copy the address data in memory after the creation code prefix // after this call, the memory at creation_code_ptr will look like this: // 600B5981380380925939F300AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA // note that the 00 bytes between the prefix and the first address is guaranteed to be clean // because of the shl above let addresses_data_ptr := add(creation_code_ptr, SSTORE2_CREATION_CODE_OFFSET) calldatacopy( addresses_data_ptr, // destOffset in memory addresses.offset, // offset in calldata addresses.length // length ) numMinted := div(addresses.length, ADDRESS_SIZE_BYTES) let prev := 0 for { let i := 0 } lt(i, numMinted) {} { // compute the pointer to the recipient address let to_ptr := add(addresses_data_ptr, mul(i, ADDRESS_SIZE_BYTES)) // mload loads a whole 32-byte word, so we get the 20 bytes we want plus 12 bytes we don't: // AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBB // so we shift right by 12 bytes to get rid of the extra bytes and align the address: // 000000000000000000000000AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA // this guarantees that the high bits of `to` are clean let to := shr(ADDRESS_OFFSET_BITS, mload(to_ptr)) // make sure that the addresses are sorted, the binary search in balanceOf relies on it if iszero(gt(to, prev)) { revert_not_sorted() } prev := to // counter increment, can not overflow // increment before emitting the event, because the first valid tokenId is 1 i := add(i, 1) // emit the Transfer event log4( 0, // dataOffset 0, // dataSize TRANSFER_EVENT_SIGNATURE, // topic1 = signature 0, // topic2 = from to, // topic3 = to i // topic4 = tokenId ) } // perform the SSTORE2 write let clean_pointer := create( 0, // value creation_code_ptr, // offset creation_code_len // length ) // we need to restore the upper bits that may have been set if data was packed in the same slot // stored_primary_pointer is either 0 (if the slot was clean) or [12-bytes || address(0)] // so we OR it with the clean pointer to restore the upper bits sstore(_ownersPrimaryPointer.slot, or(clean_pointer, stored_primary_pointer)) } } /// @dev specialized version that performs a batch mint with no safeMint checks /// @dev this function reads from an existing SSTORE2 pointer, and saves it function _mint(address pointer) internal virtual returns (uint256 numMinted) { assembly { function revert_invalid_addresses() { let ptr := mload(FREE_MEM_PTR) mstore(ptr, shl(224, ERROR_STRING_SELECTOR)) mstore(add(ptr, 0x04), WORD_SIZE) // String offset mstore(add(ptr, 0x24), 17) // Revert reason length mstore(add(ptr, 0x44), "INVALID_ADDRESSES") revert(ptr, 0x64) // Revert data length is 4 bytes for selector and 3 slots of 0x20 bytes } function revert_already_minted() { let ptr := mload(FREE_MEM_PTR) mstore(ptr, shl(224, ERROR_STRING_SELECTOR)) mstore(add(ptr, 0x04), WORD_SIZE) // String offset mstore(add(ptr, 0x24), 14) // Revert reason length mstore(add(ptr, 0x44), "ALREADY_MINTED") revert(ptr, 0x64) // Revert data length is 4 bytes for selector and 3 slots of 0x20 bytes } function revert_not_sorted() { let ptr := mload(FREE_MEM_PTR) mstore(ptr, shl(224, ERROR_STRING_SELECTOR)) mstore(add(ptr, 0x04), WORD_SIZE) // String offset mstore(add(ptr, 0x24), 20) // Revert reason length mstore(add(ptr, 0x44), "ADDRESSES_NOT_SORTED") revert(ptr, 0x64) // Revert data length is 4 bytes for selector and 3 slots of 0x20 bytes } let stored_primary_pointer := sload(_ownersPrimaryPointer.slot) let primary_pointer := and(stored_primary_pointer, BITMASK_ADDRESS) // if the primary pointer is already set, we can't mint // note: we don't clean the upper bits of the address, we check against the full word if gt(primary_pointer, 0) { revert_already_minted() } // zero-out the upper bits of `pointer` let clean_pointer := and(pointer, BITMASK_ADDRESS) let pointer_codesize := extcodesize(clean_pointer) // if pointer_codesize is 0, then it is not an SSTORE2 pointer // if pointer_codesize is 1, then it may be a valid but empty SSTORE2 pointer if lt(pointer_codesize, 2) { revert_invalid_addresses() } // subtract 1 because SSTORE2 prepends the data with a `00` byte (a STOP opcode) // can not overflow because pointer_codesize is at least 2 let addresses_length := sub(pointer_codesize, 1) // we expect the SSTORE2 pointer to contain a list of packed addresses // so the length must be a multiple of 20 bytes if gt(mod(addresses_length, ADDRESS_SIZE_BYTES), 0) { revert_invalid_addresses() } // perform the SSTORE2 read, store the data in memory at `addresses_data` let addresses_data := mload(FREE_MEM_PTR) extcodecopy( clean_pointer, // address addresses_data, // memory offset SSTORE2_DATA_OFFSET, // destination offset addresses_length // size ) numMinted := div(addresses_length, ADDRESS_SIZE_BYTES) let prev := 0 for { let i := 0 } lt(i, numMinted) {} { // compute the pointer to the recipient address let to_ptr := add(addresses_data, mul(i, ADDRESS_SIZE_BYTES)) // mload loads a whole 32-byte word, so we get the 20 bytes we want plus 12 bytes we don't: // AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBB // so we shift right by 12 bytes to get rid of the extra bytes and align the address: // 000000000000000000000000AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA // this guarantees that the high bits of `to` are clean let to := shr(ADDRESS_OFFSET_BITS, mload(to_ptr)) // make sure that the addresses are sorted, the binary search in balanceOf relies on it if iszero(gt(to, prev)) { revert_not_sorted() } prev := to // counter increment, can not overflow // increment before emitting the event, because the first valid tokenId is 1 i := add(i, 1) // emit the Transfer event log4( 0, // dataOffset 0, // dataSize TRANSFER_EVENT_SIGNATURE, // topic1 = signature 0, // topic2 = from to, // topic3 = to i // topic4 = tokenId ) } // we need to restore the upper bits that may have been set if data was packed in the same slot // stored_primary_pointer is either 0 (if the slot was clean) or [12-bytes || address(0)] // so we OR it with the clean pointer to restore the upper bits sstore(_ownersPrimaryPointer.slot, or(clean_pointer, stored_primary_pointer)) } } function _safeMint(address pointer) internal virtual returns (uint256 numMinted) { numMinted = _safeMint(pointer, ""); } /// @dev specialized version that performs a batch mint with a safeMint check at each iteration /// @dev in _safeMint, we try to keep assembly usage at a minimum function _safeMint(address pointer, bytes memory data) internal virtual returns (uint256 numMinted) { require(_ownersPrimaryPointer == address(0), "ALREADY_MINTED"); bytes memory addresses = SSTORE2.read(pointer); uint256 length = addresses.length; require(length > 0 && length % 20 == 0, "INVALID_ADDRESSES"); numMinted = length / 20; address prev = address(0); for (uint256 i = 0; i < numMinted;) { address to; assembly { to := shr(96, mload(add(addresses, add(32, mul(i, 20))))) i := add(i, 1) } // enforce that the addresses are sorted with no duplicates, and no zero addresses require(to > prev, "ADDRESSES_NOT_SORTED"); prev = to; emit Transfer(address(0), to, i); require(_checkOnERC721Received(address(0), to, i, data), "UNSAFE_RECIPIENT"); } _ownersPrimaryPointer = pointer; } } contract IllustrationOfResilience is SS2ERC721, Owned { using LibString for uint256; string public baseURI; constructor(address _owner, string memory _name, string memory _symbol, string memory _baseURI) Owned(_owner) SS2ERC721(_name, _symbol) { baseURI = _baseURI; } function mintBatch(bytes calldata packedRecipients) public onlyOwner { _mint(packedRecipients); } /*////////////////////////////////////////////////////////////// VIEW FUNCTIONS //////////////////////////////////////////////////////////////*/ function tokenURI(uint256 id) public view override returns (string memory) { require(id != 0 && id <= totalSupply(), "NOT_MINTED"); return string.concat(baseURI, id.toString()); } function totalSupply() public view returns (uint256) { return _ownersPrimaryLength(); } }
{ "remappings": [ "SS2ERC721/=lib/SS2ERC721/src/", "ds-test/=lib/forge-std/lib/ds-test/src/", "forge-std/=lib/forge-std/src/", "solmate/=lib/SS2ERC721/lib/solmate/src/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "paris", "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"string","name":"_baseURI","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"balance","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"packedRecipients","type":"bytes"}],"name":"mintBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"owner","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60806040523480156200001157600080fd5b50604051620017a1380380620017a1833981016040819052620000349162000185565b83838381816000620000478382620002c6565b506001620000568282620002c6565b5050600980546001600160a01b0319166001600160a01b038616908117909155604051909350600092507f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091508290a350600a620000b58282620002c6565b505050505062000392565b634e487b7160e01b600052604160045260246000fd5b600082601f830112620000e857600080fd5b81516001600160401b0380821115620001055762000105620000c0565b604051601f8301601f19908116603f01168101908282118183101715620001305762000130620000c0565b816040528381526020925086838588010111156200014d57600080fd5b600091505b8382101562000171578582018301518183018401529082019062000152565b600093810190920192909252949350505050565b600080600080608085870312156200019c57600080fd5b84516001600160a01b0381168114620001b457600080fd5b60208601519094506001600160401b0380821115620001d257600080fd5b620001e088838901620000d6565b94506040870151915080821115620001f757600080fd5b6200020588838901620000d6565b935060608701519150808211156200021c57600080fd5b506200022b87828801620000d6565b91505092959194509250565b600181811c908216806200024c57607f821691505b6020821081036200026d57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620002c157600081815260208120601f850160051c810160208610156200029c5750805b601f850160051c820191505b81811015620002bd57828155600101620002a8565b5050505b505050565b81516001600160401b03811115620002e257620002e2620000c0565b620002fa81620002f3845462000237565b8462000273565b602080601f831160018114620003325760008415620003195750858301515b600019600386901b1c1916600185901b178555620002bd565b600085815260208120601f198616915b82811015620003635788860151825594840194600190910190840162000342565b5085821015620003825787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6113ff80620003a26000396000f3fe608060405234801561001057600080fd5b50600436106101165760003560e01c806370a08231116100a2578063b88d4fde11610071578063b88d4fde14610246578063c87b56dd14610259578063e985e9c51461026c578063f2fde38b1461029a578063faac67e3146102ad57600080fd5b806370a08231146102055780638da5cb5b1461021857806395d89b411461022b578063a22cb4651461023357600080fd5b806318160ddd116100e957806318160ddd146101ae57806323b872dd146101c457806342842e0e146101d75780636352211e146101ea5780636c0360eb146101fd57600080fd5b806301ffc9a71461011b57806306fdde0314610143578063081812fc14610158578063095ea7b314610199575b600080fd5b61012e610129366004610f50565b6102c0565b60405190151581526020015b60405180910390f35b61014b610312565b60405161013a9190610f98565b610181610166366004610fcb565b6004602052600090815260409020546001600160a01b031681565b6040516001600160a01b03909116815260200161013a565b6101ac6101a7366004610ffb565b6103a0565b005b6101b6610485565b60405190815260200161013a565b6101ac6101d2366004611025565b610494565b6101ac6101e5366004611025565b6105f5565b6101816101f8366004610fcb565b6106ed565b61014b610725565b6101b6610213366004611061565b610732565b600954610181906001600160a01b031681565b61014b6107c7565b6101ac61024136600461107c565b6107d4565b6101ac610254366004611101565b610840565b61014b610267366004610fcb565b610928565b61012e61027a366004611170565b600560209081526000928352604080842090915290825290205460ff1681565b6101ac6102a8366004611061565b61098e565b6101ac6102bb3660046111a3565b610a23565b60006301ffc9a760e01b6001600160e01b0319831614806102f157506380ac58cd60e01b6001600160e01b03198316145b8061030c5750635b5e139f60e01b6001600160e01b03198316145b92915050565b6000805461031f906111e5565b80601f016020809104026020016040519081016040528092919081815260200182805461034b906111e5565b80156103985780601f1061036d57610100808354040283529160200191610398565b820191906000526020600020905b81548152906001019060200180831161037b57829003601f168201915b505050505081565b60006103ab82610a76565b9050336001600160a01b03821614806103e757506001600160a01b038116600090815260056020908152604080832033845290915290205460ff165b6104295760405162461bcd60e51b815260206004820152600e60248201526d1393d517d055551213d49256915160921b60448201526064015b60405180910390fd5b60008281526004602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b600061048f610ab4565b905090565b336001600160a01b03841614806104ce57506001600160a01b038316600090815260056020908152604080832033845290915290205460ff165b806104ef57506000818152600460205260409020546001600160a01b031633145b61052c5760405162461bcd60e51b815260206004820152600e60248201526d1393d517d055551213d49256915160921b6044820152606401610420565b6001600160a01b0382166105765760405162461bcd60e51b81526020600482015260116024820152701253959053125117d49150d25412515395607a1b6044820152606401610420565b60006105828284610af3565b9050806001600160a01b0316846001600160a01b0316146105d25760405162461bcd60e51b815260206004820152600a60248201526957524f4e475f46524f4d60b01b6044820152606401610420565b50506001600160a01b031660009081526007602052604090208054600101905550565b610600838383610494565b6001600160a01b0382163b15806106a95750604051630a85bd0160e11b8082523360048301526001600160a01b03858116602484015260448301849052608060648401526000608484015290919084169063150b7a029060a4016020604051808303816000875af1158015610679573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061069d9190611219565b6001600160e01b031916145b6106e85760405162461bcd60e51b815260206004820152601060248201526f155394d0519157d49150d2541251539560821b6044820152606401610420565b505050565b60006106f882610a76565b90506001600160a01b0381166107205760405162461bcd60e51b815260040161042090611236565b919050565b600a805461031f906111e5565b60006001600160a01b0382166107795760405162461bcd60e51b815260206004820152600c60248201526b5a45524f5f4144445245535360a01b6044820152606401610420565b506001600160a01b0381166000908152600760205260408120546001600160ff1b03811691600160ff1b821690036107c1576107b483610bec565b6107be9083611270565b91505b50919050565b6001805461031f906111e5565b3360008181526005602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b61084b858585610494565b6001600160a01b0384163b15806108e25750604051630a85bd0160e11b808252906001600160a01b0386169063150b7a02906108939033908a90899089908990600401611283565b6020604051808303816000875af11580156108b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d69190611219565b6001600160e01b031916145b6109215760405162461bcd60e51b815260206004820152601060248201526f155394d0519157d49150d2541251539560821b6044820152606401610420565b5050505050565b60608115801590610940575061093c610485565b8211155b61095c5760405162461bcd60e51b815260040161042090611236565b600a61096783610cb2565b6040516020016109789291906112f3565b6040516020818303038152906040529050919050565b6009546001600160a01b031633146109d75760405162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b6044820152606401610420565b600980546001600160a01b0319166001600160a01b03831690811790915560405133907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a350565b6009546001600160a01b03163314610a6c5760405162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b6044820152606401610420565b6106e88282610cf6565b60008181526006602052604090205480600360fe1b600160fe1b821601610a9d5750919050565b6001600160a01b0382166107c1576107be83610e79565b6008546000906001600160a01b0316610acd5750600090565b600854601490610ae9906001906001600160a01b03163b611394565b61048f91906113a7565b6000828152600660205260409020546001600160a01b038116610b6857610b1983610e79565b90506001600160a01b038116610b415760405162461bcd60e51b815260040161042090611236565b6001600160a01b03811660009081526007602052604090208054600160ff1b179055610b89565b6001600160a01b038116600090815260076020526040902080546000190190555b610b938383610ed4565b60008381526004602052604080822080546001600160a01b03191690555184916001600160a01b0385811692908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a492915050565b6000600181610bf9610ab4565b905060006002610c098385611270565b610c1391906113a7565b90505b818311610ca7576000610c2882610e79565b9050856001600160a01b0316816001600160a01b031603610c4f5750600195945050505050565b856001600160a01b0316816001600160a01b03161015610c7b57610c74826001611270565b9350610c89565b610c86600183611394565b92505b6002610c958486611270565b610c9f91906113a7565b915050610c16565b506000949350505050565b606060a06040510180604052602081039150506000815280825b600183039250600a81066030018353600a900480610ccc5750819003601f19909101908152919050565b6000610da8565b60405162461bcd60e51b8152602060048201526011602482015270494e56414c49445f41444452455353455360781b6044820152606481fd5b60405162461bcd60e51b815260206004820152600e60248201526d1053149150511657d3525395115160921b6044820152606481fd5b60405162461bcd60e51b8152602060048201526014602482015273105111149154d4d154d7d393d517d4d3d495115160621b6044820152606481fd5b6008546001600160a01b0381168015610dc357610dc3610d36565b5082610dd157610dd1610cfd565b6014830615610de257610de2610cfd565b82600c016040516a600b5981380380925939f360a81b8152600c8101858782376014860494506000805b86811015610e61576014810283015160601c828111610e2d57610e2d610d6c565b915060010181818160007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a450610e0c565b50505081816000f09290921760085550909392505050565b600081600003610e8b57506000919050565b6008546001600160a01b031680610ea55750600092915050565b60001983016014810281811015610ec157506000949350505050565b610ecb8382610f18565b95945050505050565b6001600160a01b038116610efa57506000908152600660205260409020600160fe1b9055565b60008281526006602052604090206001600160a01b03821690555050565b600080805260019190910190600c60148382863c505060005192915050565b6001600160e01b031981168114610f4d57600080fd5b50565b600060208284031215610f6257600080fd5b8135610f6d81610f37565b9392505050565b60005b83811015610f8f578181015183820152602001610f77565b50506000910152565b6020815260008251806020840152610fb7816040850160208701610f74565b601f01601f19169190910160400192915050565b600060208284031215610fdd57600080fd5b5035919050565b80356001600160a01b038116811461072057600080fd5b6000806040838503121561100e57600080fd5b61101783610fe4565b946020939093013593505050565b60008060006060848603121561103a57600080fd5b61104384610fe4565b925061105160208501610fe4565b9150604084013590509250925092565b60006020828403121561107357600080fd5b610f6d82610fe4565b6000806040838503121561108f57600080fd5b61109883610fe4565b9150602083013580151581146110ad57600080fd5b809150509250929050565b60008083601f8401126110ca57600080fd5b50813567ffffffffffffffff8111156110e257600080fd5b6020830191508360208285010111156110fa57600080fd5b9250929050565b60008060008060006080868803121561111957600080fd5b61112286610fe4565b945061113060208701610fe4565b935060408601359250606086013567ffffffffffffffff81111561115357600080fd5b61115f888289016110b8565b969995985093965092949392505050565b6000806040838503121561118357600080fd5b61118c83610fe4565b915061119a60208401610fe4565b90509250929050565b600080602083850312156111b657600080fd5b823567ffffffffffffffff8111156111cd57600080fd5b6111d9858286016110b8565b90969095509350505050565b600181811c908216806111f957607f821691505b6020821081036107c157634e487b7160e01b600052602260045260246000fd5b60006020828403121561122b57600080fd5b8151610f6d81610f37565b6020808252600a90820152691393d517d3525395115160b21b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b8082018082111561030c5761030c61125a565b6001600160a01b038681168252851660208201526040810184905260806060820181905281018290526000828460a0840137600060a0848401015260a0601f19601f85011683010190509695505050505050565b600081516112e9818560208601610f74565b9290920192915050565b600080845481600182811c91508083168061130f57607f831692505b6020808410820361132e57634e487b7160e01b86526022600452602486fd5b818015611342576001811461135757611384565b60ff1986168952841515850289019650611384565b60008b81526020902060005b8681101561137c5781548b820152908501908301611363565b505084890196505b505050505050610ecb81856112d7565b8181038181111561030c5761030c61125a565b6000826113c457634e487b7160e01b600052601260045260246000fd5b50049056fea2646970667358221220c0cb25739c0fd0e46d1996d8c3d484f3357c0ff233ec20f5e0b5f6a9dfd772ea64736f6c634300081500330000000000000000000000003cc7d128930b723529803061b879260340c9803a000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000001a496c6c757374726174696f6e204f6620526573696c69656e6365000000000000000000000000000000000000000000000000000000000000000000000000000a526573696c69656e6365000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000042697066733a2f2f6261666b72656967707276796d346867636f6979666961707a6f737378346f6f656f74776f6e766f746335613777366c6975796372653737367375000000000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101165760003560e01c806370a08231116100a2578063b88d4fde11610071578063b88d4fde14610246578063c87b56dd14610259578063e985e9c51461026c578063f2fde38b1461029a578063faac67e3146102ad57600080fd5b806370a08231146102055780638da5cb5b1461021857806395d89b411461022b578063a22cb4651461023357600080fd5b806318160ddd116100e957806318160ddd146101ae57806323b872dd146101c457806342842e0e146101d75780636352211e146101ea5780636c0360eb146101fd57600080fd5b806301ffc9a71461011b57806306fdde0314610143578063081812fc14610158578063095ea7b314610199575b600080fd5b61012e610129366004610f50565b6102c0565b60405190151581526020015b60405180910390f35b61014b610312565b60405161013a9190610f98565b610181610166366004610fcb565b6004602052600090815260409020546001600160a01b031681565b6040516001600160a01b03909116815260200161013a565b6101ac6101a7366004610ffb565b6103a0565b005b6101b6610485565b60405190815260200161013a565b6101ac6101d2366004611025565b610494565b6101ac6101e5366004611025565b6105f5565b6101816101f8366004610fcb565b6106ed565b61014b610725565b6101b6610213366004611061565b610732565b600954610181906001600160a01b031681565b61014b6107c7565b6101ac61024136600461107c565b6107d4565b6101ac610254366004611101565b610840565b61014b610267366004610fcb565b610928565b61012e61027a366004611170565b600560209081526000928352604080842090915290825290205460ff1681565b6101ac6102a8366004611061565b61098e565b6101ac6102bb3660046111a3565b610a23565b60006301ffc9a760e01b6001600160e01b0319831614806102f157506380ac58cd60e01b6001600160e01b03198316145b8061030c5750635b5e139f60e01b6001600160e01b03198316145b92915050565b6000805461031f906111e5565b80601f016020809104026020016040519081016040528092919081815260200182805461034b906111e5565b80156103985780601f1061036d57610100808354040283529160200191610398565b820191906000526020600020905b81548152906001019060200180831161037b57829003601f168201915b505050505081565b60006103ab82610a76565b9050336001600160a01b03821614806103e757506001600160a01b038116600090815260056020908152604080832033845290915290205460ff165b6104295760405162461bcd60e51b815260206004820152600e60248201526d1393d517d055551213d49256915160921b60448201526064015b60405180910390fd5b60008281526004602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b600061048f610ab4565b905090565b336001600160a01b03841614806104ce57506001600160a01b038316600090815260056020908152604080832033845290915290205460ff165b806104ef57506000818152600460205260409020546001600160a01b031633145b61052c5760405162461bcd60e51b815260206004820152600e60248201526d1393d517d055551213d49256915160921b6044820152606401610420565b6001600160a01b0382166105765760405162461bcd60e51b81526020600482015260116024820152701253959053125117d49150d25412515395607a1b6044820152606401610420565b60006105828284610af3565b9050806001600160a01b0316846001600160a01b0316146105d25760405162461bcd60e51b815260206004820152600a60248201526957524f4e475f46524f4d60b01b6044820152606401610420565b50506001600160a01b031660009081526007602052604090208054600101905550565b610600838383610494565b6001600160a01b0382163b15806106a95750604051630a85bd0160e11b8082523360048301526001600160a01b03858116602484015260448301849052608060648401526000608484015290919084169063150b7a029060a4016020604051808303816000875af1158015610679573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061069d9190611219565b6001600160e01b031916145b6106e85760405162461bcd60e51b815260206004820152601060248201526f155394d0519157d49150d2541251539560821b6044820152606401610420565b505050565b60006106f882610a76565b90506001600160a01b0381166107205760405162461bcd60e51b815260040161042090611236565b919050565b600a805461031f906111e5565b60006001600160a01b0382166107795760405162461bcd60e51b815260206004820152600c60248201526b5a45524f5f4144445245535360a01b6044820152606401610420565b506001600160a01b0381166000908152600760205260408120546001600160ff1b03811691600160ff1b821690036107c1576107b483610bec565b6107be9083611270565b91505b50919050565b6001805461031f906111e5565b3360008181526005602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b61084b858585610494565b6001600160a01b0384163b15806108e25750604051630a85bd0160e11b808252906001600160a01b0386169063150b7a02906108939033908a90899089908990600401611283565b6020604051808303816000875af11580156108b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d69190611219565b6001600160e01b031916145b6109215760405162461bcd60e51b815260206004820152601060248201526f155394d0519157d49150d2541251539560821b6044820152606401610420565b5050505050565b60608115801590610940575061093c610485565b8211155b61095c5760405162461bcd60e51b815260040161042090611236565b600a61096783610cb2565b6040516020016109789291906112f3565b6040516020818303038152906040529050919050565b6009546001600160a01b031633146109d75760405162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b6044820152606401610420565b600980546001600160a01b0319166001600160a01b03831690811790915560405133907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a350565b6009546001600160a01b03163314610a6c5760405162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b6044820152606401610420565b6106e88282610cf6565b60008181526006602052604090205480600360fe1b600160fe1b821601610a9d5750919050565b6001600160a01b0382166107c1576107be83610e79565b6008546000906001600160a01b0316610acd5750600090565b600854601490610ae9906001906001600160a01b03163b611394565b61048f91906113a7565b6000828152600660205260409020546001600160a01b038116610b6857610b1983610e79565b90506001600160a01b038116610b415760405162461bcd60e51b815260040161042090611236565b6001600160a01b03811660009081526007602052604090208054600160ff1b179055610b89565b6001600160a01b038116600090815260076020526040902080546000190190555b610b938383610ed4565b60008381526004602052604080822080546001600160a01b03191690555184916001600160a01b0385811692908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a492915050565b6000600181610bf9610ab4565b905060006002610c098385611270565b610c1391906113a7565b90505b818311610ca7576000610c2882610e79565b9050856001600160a01b0316816001600160a01b031603610c4f5750600195945050505050565b856001600160a01b0316816001600160a01b03161015610c7b57610c74826001611270565b9350610c89565b610c86600183611394565b92505b6002610c958486611270565b610c9f91906113a7565b915050610c16565b506000949350505050565b606060a06040510180604052602081039150506000815280825b600183039250600a81066030018353600a900480610ccc5750819003601f19909101908152919050565b6000610da8565b60405162461bcd60e51b8152602060048201526011602482015270494e56414c49445f41444452455353455360781b6044820152606481fd5b60405162461bcd60e51b815260206004820152600e60248201526d1053149150511657d3525395115160921b6044820152606481fd5b60405162461bcd60e51b8152602060048201526014602482015273105111149154d4d154d7d393d517d4d3d495115160621b6044820152606481fd5b6008546001600160a01b0381168015610dc357610dc3610d36565b5082610dd157610dd1610cfd565b6014830615610de257610de2610cfd565b82600c016040516a600b5981380380925939f360a81b8152600c8101858782376014860494506000805b86811015610e61576014810283015160601c828111610e2d57610e2d610d6c565b915060010181818160007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a450610e0c565b50505081816000f09290921760085550909392505050565b600081600003610e8b57506000919050565b6008546001600160a01b031680610ea55750600092915050565b60001983016014810281811015610ec157506000949350505050565b610ecb8382610f18565b95945050505050565b6001600160a01b038116610efa57506000908152600660205260409020600160fe1b9055565b60008281526006602052604090206001600160a01b03821690555050565b600080805260019190910190600c60148382863c505060005192915050565b6001600160e01b031981168114610f4d57600080fd5b50565b600060208284031215610f6257600080fd5b8135610f6d81610f37565b9392505050565b60005b83811015610f8f578181015183820152602001610f77565b50506000910152565b6020815260008251806020840152610fb7816040850160208701610f74565b601f01601f19169190910160400192915050565b600060208284031215610fdd57600080fd5b5035919050565b80356001600160a01b038116811461072057600080fd5b6000806040838503121561100e57600080fd5b61101783610fe4565b946020939093013593505050565b60008060006060848603121561103a57600080fd5b61104384610fe4565b925061105160208501610fe4565b9150604084013590509250925092565b60006020828403121561107357600080fd5b610f6d82610fe4565b6000806040838503121561108f57600080fd5b61109883610fe4565b9150602083013580151581146110ad57600080fd5b809150509250929050565b60008083601f8401126110ca57600080fd5b50813567ffffffffffffffff8111156110e257600080fd5b6020830191508360208285010111156110fa57600080fd5b9250929050565b60008060008060006080868803121561111957600080fd5b61112286610fe4565b945061113060208701610fe4565b935060408601359250606086013567ffffffffffffffff81111561115357600080fd5b61115f888289016110b8565b969995985093965092949392505050565b6000806040838503121561118357600080fd5b61118c83610fe4565b915061119a60208401610fe4565b90509250929050565b600080602083850312156111b657600080fd5b823567ffffffffffffffff8111156111cd57600080fd5b6111d9858286016110b8565b90969095509350505050565b600181811c908216806111f957607f821691505b6020821081036107c157634e487b7160e01b600052602260045260246000fd5b60006020828403121561122b57600080fd5b8151610f6d81610f37565b6020808252600a90820152691393d517d3525395115160b21b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b8082018082111561030c5761030c61125a565b6001600160a01b038681168252851660208201526040810184905260806060820181905281018290526000828460a0840137600060a0848401015260a0601f19601f85011683010190509695505050505050565b600081516112e9818560208601610f74565b9290920192915050565b600080845481600182811c91508083168061130f57607f831692505b6020808410820361132e57634e487b7160e01b86526022600452602486fd5b818015611342576001811461135757611384565b60ff1986168952841515850289019650611384565b60008b81526020902060005b8681101561137c5781548b820152908501908301611363565b505084890196505b505050505050610ecb81856112d7565b8181038181111561030c5761030c61125a565b6000826113c457634e487b7160e01b600052601260045260246000fd5b50049056fea2646970667358221220c0cb25739c0fd0e46d1996d8c3d484f3357c0ff233ec20f5e0b5f6a9dfd772ea64736f6c63430008150033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000003cc7d128930b723529803061b879260340c9803a000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000001a496c6c757374726174696f6e204f6620526573696c69656e6365000000000000000000000000000000000000000000000000000000000000000000000000000a526573696c69656e6365000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000042697066733a2f2f6261666b72656967707276796d346867636f6979666961707a6f737378346f6f656f74776f6e766f746335613777366c6975796372653737367375000000000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : _owner (address): 0x3Cc7D128930B723529803061B879260340C9803a
Arg [1] : _name (string): Illustration Of Resilience
Arg [2] : _symbol (string): Resilience
Arg [3] : _baseURI (string): ipfs://bafkreigprvym4hgcoiyfiapzossx4ooeotwonvotc5a7w6liuycre776su
-----Encoded View---------------
12 Constructor Arguments found :
Arg [0] : 0000000000000000000000003cc7d128930b723529803061b879260340c9803a
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [2] : 00000000000000000000000000000000000000000000000000000000000000c0
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000100
Arg [4] : 000000000000000000000000000000000000000000000000000000000000001a
Arg [5] : 496c6c757374726174696f6e204f6620526573696c69656e6365000000000000
Arg [6] : 000000000000000000000000000000000000000000000000000000000000000a
Arg [7] : 526573696c69656e636500000000000000000000000000000000000000000000
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000042
Arg [9] : 697066733a2f2f6261666b72656967707276796d346867636f6979666961707a
Arg [10] : 6f737378346f6f656f74776f6e766f746335613777366c697579637265373736
Arg [11] : 7375000000000000000000000000000000000000000000000000000000000000
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.