Source Code
Overview
ETH Balance
0 ETH
More Info
ContractCreator
Multichain Info
N/A
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Latest 2 internal transactions
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
11169358 | 315 days ago | Contract Creation | 0 ETH | |||
11169358 | 315 days ago | Contract Creation | 0 ETH |
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
PeterTraits
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 200 runs
Other Settings:
london EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; // OpenZeppelin Imports import { ERC721 } from '@openzeppelin/contracts/token/ERC721/ERC721.sol'; import { ERC721Enumerable } from '@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol'; import { Ownable } from '@openzeppelin/contracts/access/Ownable.sol'; // TODO: solady import { Utils } from './common/Utils.sol'; // Renderers import { TraitsRenderer } from './renderers/TraitsRenderer.sol'; import { RenderHelper } from "./renderers/RenderHelper.sol"; import { BodyRenderer } from './renderers/BodyRenderer.sol'; // Associated Interfaces and Libraries import { ITraitStorage } from './interfaces/ITraitStorage.sol'; import { TraitCategory } from './TraitCategory.sol'; import "forge-std/console.sol"; // DEPLOY: remove contract PeterTraits is ERC721Enumerable, ITraitStorage, Ownable { BodyRenderer public bodyRenderer; /// @dev We use this database for persistent storage. Traits traits; string constant SVG_START = '<svg shape-rendering="crispEdges" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg"><style>rect{width:1px; height: 1px;} .bg{width:30px; height: 30px;} </style><rect class="bg" fill="#0D6E9D"/>'; uint8 constant INITIAL_TRAIT_NUMBER = 2; address public minter; // An address that will be used to sign newly incoming traits address public signer; TraitsRenderer public traitsRenderer; // ShirtType to SVG code mapping(string => string) shirtTypeToSVG; // PantType to SVG code mapping(string => string) pantsTypeToSVG; mapping(uint256 => TraitMetadata) public tokenIdToMetadata; // this gets populated on mint with the commit-reveal, so a new incoming token id will get mapped to an existing TraitMetadata object, so multiple token ids will have the same TraitMetadata object (e.g. there are 9 token ids that are Blue Shirts, they're not consecutive, most likely but could be, a la art blocks engine) mapping(uint256 => string) public tokenIdToMetadataString; // e.g. Blue Hoodie => { // traitName: 'Blue Hoodie', traitType: TraitCategory.Name.Shirt, traitPath: 'svg code' // } mapping(string => TraitMetadata) public traitNameToMetadata; /// Errors error MsgSenderNotMinter(); /// Modifiers modifier onlyMinter { if (msg.sender != minter) revert MsgSenderNotMinter(); _; } constructor() ERC721("PeterTraits", "PTR") { traitsRenderer = new TraitsRenderer(); bodyRenderer = new BodyRenderer(); // Shirt addNewTrait('Hoodie Black', TraitCategory.Name.Shirt, '<path fill="#000" d="M10 9h1v1h-1zM11 9h1v1h-1zM12 9h1v1h-1zM13 9h1v1h-1zM14 9h1v1h-1zM15 9h1v1h-1zM16 9h1v1h-1zM17 9h1v1h-1zM18 9h1v1h-1zM19 9h1v1h-1zM9 10h1v1H9zM10 10h1v1h-1zM11 10h1v1h-1zM19 10h1v1h-1zM20 10h1v1h-1zM9 11h1v1H9zM10 11h1v1h-1zM20 11h1v1h-1zM9 12h1v1H9zM10 12h1v1h-1zM20 12h1v1h-1zM9 13h1v1H9zM10 13h1v1h-1zM20 13h1v1h-1zM9 14h1v1H9zM10 14h1v1h-1zM20 14h1v1h-1zM10 15h1v1h-1zM11 15h1v1h-1zM19 15h1v1h-1zM20 15h1v1h-1zM11 16h1v1h-1zM12 16h1v1h-1zM13 16h1v1h-1zM17 16h1v1h-1zM18 16h1v1h-1zM19 16h1v1h-1zM10 17h1v1h-1zM11 17h1v1h-1zM12 17h1v1h-1z"/><path fill="#ECEDED" d="M13 17h1v1h-1z"/><path fill="#000" d="M14 17h1v1h-1zM15 17h1v1h-1zM16 17h1v1h-1z"/><path fill="#ECEDED" d="M17 17h1v1h-1z"/><path fill="#000" d="M18 17h1v1h-1zM9 18h1v1H9zM9 19h1v1H9zM18 19h1v1h-1zM10 18h1v1h-1zM10 19h1v1h-1zM19 19h1v1h-1zM11 18h1v1h-1zM12 18h1v1h-1zM13 18h1v1h-1zM14 18h1v1h-1zM15 18h1v1h-1zM16 18h1v1h-1zM17 18h1v1h-1zM18 18h1v1h-1zM19 18h1v1h-1zM11 19h1v1h-1zM11 20h1v1h-1zM12 20h1v1h-1zM13 20h1v1h-1zM14 20h1v1h-1zM15 20h1v1h-1zM16 20h1v1h-1zM17 20h1v1h-1zM12 19h1v1h-1zM13 19h1v1h-1zM14 19h1v1h-1zM15 19h1v1h-1zM16 19h1v1h-1zM17 19h1v1h-1z"/>' ); addNewTrait('Hoodie Red', TraitCategory.Name.Shirt, '<path fill="#EA0000" d="M10 9h1v1h-1zM11 9h1v1h-1zM12 9h1v1h-1zM13 9h1v1h-1zM14 9h1v1h-1zM15 9h1v1h-1zM16 9h1v1h-1zM17 9h1v1h-1zM18 9h1v1h-1zM19 9h1v1h-1zM9 10h1v1H9zM10 10h1v1h-1zM11 10h1v1h-1zM19 10h1v1h-1zM20 10h1v1h-1zM9 11h1v1H9zM10 11h1v1h-1zM20 11h1v1h-1zM9 12h1v1H9zM10 12h1v1h-1zM20 12h1v1h-1zM9 13h1v1H9zM10 13h1v1h-1zM20 13h1v1h-1zM9 14h1v1H9zM10 14h1v1h-1zM20 14h1v1h-1zM10 15h1v1h-1zM11 15h1v1h-1zM19 15h1v1h-1zM20 15h1v1h-1zM11 16h1v1h-1zM12 16h1v1h-1zM13 16h1v1h-1zM17 16h1v1h-1zM18 16h1v1h-1zM19 16h1v1h-1zM10 17h1v1h-1zM11 17h1v1h-1zM12 17h1v1h-1z"/><path fill="#ECEDED" d="M13 17h1v1h-1z"/><path fill="#EA0000" d="M14 17h1v1h-1zM15 17h1v1h-1zM16 17h1v1h-1z"/><path fill="#ECEDED" d="M17 17h1v1h-1z"/><path fill="#EA0000" d="M18 17h1v1h-1zM9 18h1v1H9zM9 19h1v1H9zM18 19h1v1h-1zM10 18h1v1h-1zM10 19h1v1h-1zM19 19h1v1h-1zM11 18h1v1h-1zM12 18h1v1h-1zM13 18h1v1h-1zM14 18h1v1h-1zM15 18h1v1h-1zM16 18h1v1h-1zM17 18h1v1h-1zM18 18h1v1h-1zM19 18h1v1h-1zM11 19h1v1h-1zM11 20h1v1h-1zM12 20h1v1h-1zM13 20h1v1h-1zM14 20h1v1h-1zM15 20h1v1h-1zM16 20h1v1h-1zM17 20h1v1h-1zM12 19h1v1h-1zM13 19h1v1h-1zM14 19h1v1h-1zM15 19h1v1h-1zM16 19h1v1h-1zM17 19h1v1h-1z"/>' ); addNewTrait('Blue Stripes', TraitCategory.Name.Shirt, '<rect x="11" y="16" fill="#1A2099"></rect> <rect x="12" y="16" fill="#1A2099"></rect> <rect x="17" y="16" fill="#1A2099"></rect> <rect x="10" y="17" fill="#1A2099"></rect> <rect x="11" y="17" fill="#1A2099"></rect> <rect x="12" y="17" fill="#1A2099"></rect> <rect x="13" y="17" fill="#1A2099"></rect> <rect x="14" y="17" fill="#F1F6F8"></rect> <rect x="15" y="17" fill="#F1F6F8"></rect> <rect x="16" y="17" fill="#F1F6F8"></rect> <rect x="17" y="17" fill="#1A2099"></rect> <rect x="18" y="17" fill="#1A2099"></rect> <rect x="9" y="18" fill="#1A2099"></rect> <rect x="10" y="18" fill="#1A2099"></rect> <rect x="11" y="18" fill="#1A2099"></rect> <rect x="12" y="18" fill="#1A2099"></rect> <rect x="13" y="18" fill="#1A2099"></rect> <rect x="14" y="18" fill="#F1F6F8"></rect> <rect x="15" y="18" fill="#F1F6F8"></rect> <rect x="16" y="18" fill="#E7E6E5"></rect> <rect x="17" y="18" fill="#1A2099"></rect> <rect x="18" y="18" fill="#1A2099"></rect> <rect x="19" y="18" fill="#1A2099"></rect> <rect x="9" y="19" fill="#1A2099"></rect> <rect x="10" y="19" fill="#1A2099"></rect> <rect x="11" y="19" fill="#1A2099"></rect> <rect x="12" y="19" fill="#1A2099"></rect> <rect x="13" y="19" fill="#1A2099"></rect> <rect x="14" y="19" fill="#F1F6F8"></rect> <rect x="15" y="19" fill="#F1F6F8"></rect> <rect x="16" y="19" fill="#F1F6F8"></rect> <rect x="17" y="19" fill="#1A2099"></rect> <rect x="18" y="19" fill="#1A2099"></rect> <rect x="19" y="19" fill="#1A2099"></rect> <rect x="11" y="20" fill="#1A2099"></rect> <rect x="12" y="20" fill="#1A2099"></rect> <rect x="13" y="20" fill="#1A2099"></rect> <rect x="14" y="20" fill="#F1F6F8"></rect> <rect x="15" y="20" fill="#F1F6F8"></rect> <rect x="16" y="20" fill="#F1F6F8"></rect> <rect x="17" y="20" fill="#1A2099"></rect>' ); // Pants addNewTrait('Blue', TraitCategory.Name.Pants, '<rect x="11" y="21" width="1" height="1" fill="#0038CB"></rect> <rect x="12" y="21" width="1" height="1" fill="#013FE0"></rect> <rect x="13" y="21" width="1" height="1" fill="#013FE0"></rect> <rect x="14" y="21" width="1" height="1" fill="#0038CB"></rect> <rect x="15" y="21" width="1" height="1" fill="#013FE0"></rect> <rect x="16" y="21" width="1" height="1" fill="#013FE0"></rect> <rect x="17" y="21" width="1" height="1" fill="#0038CB"></rect> <rect x="11" y="22" width="1" height="1" fill="#013FE0"></rect> <rect x="12" y="22" width="1" height="1" fill="#013FE0"></rect> <rect x="13" y="22" width="1" height="1" fill="#013FE0"></rect> <rect x="15" y="22" width="1" height="1" fill="#013FE0"></rect> <rect x="16" y="22" width="1" height="1" fill="#013FE0"></rect> <rect x="17" y="22" width="1" height="1" fill="#013FE0"></rect>' ); addNewTrait('Purple', TraitCategory.Name.Pants, '<rect x="11" y="21" width="1" height="1" fill="#6C0B81" /> <rect x="12" y="21" width="1" height="1" fill="#7A0D92" /> <rect x="13" y="21" width="1" height="1" fill="#7A0D92" /> <rect x="14" y="21" width="1" height="1" fill="#6C0B81" /> <rect x="15" y="21" width="1" height="1" fill="#7A0D92" /> <rect x="16" y="21" width="1" height="1" fill="#7A0D92" /> <rect x="17" y="21" width="1" height="1" fill="#6C0B81" /> <rect x="11" y="22" width="1" height="1" fill="#7A0D92" /> <rect x="12" y="22" width="1" height="1" fill="#7A0D92" /> <rect x="13" y="22" width="1" height="1" fill="#7A0D92" /> <rect x="15" y="22" width="1" height="1" fill="#7A0D92" /> <rect x="16" y="22" width="1" height="1" fill="#7A0D92" /> <rect x="17" y="22" width="1" height="1" fill="#7A0D92" />' ); addNewTrait('Green', TraitCategory.Name.Pants, '<path d="M12 21H11V22H12V21Z" fill="#118907"/> <path d="M13 21H12V22H13V21Z" fill="#1BA00F"/> <path d="M14 21H13V22H14V21Z" fill="#1BA00F"/> <path d="M15 21H14V22H15V21Z" fill="#118907"/> <path d="M16 21H15V22H16V21Z" fill="#1BA00F"/> <path d="M17 21H16V22H17V21Z" fill="#1BA00F"/> <path d="M18 21H17V22H18V21Z" fill="#118907"/> <path d="M12 22H11V23H12V22Z" fill="#1BA00F"/> <path d="M13 22H12V23H13V22Z" fill="#1BA00F"/> <path d="M14 22H13V23H14V22Z" fill="#1BA00F"/> <path d="M16 22H15V23H16V22Z" fill="#1BA00F"/> <path d="M17 22H16V23H17V22Z" fill="#1BA00F"/> <path d="M18 22H17V23H18V22Z" fill="#1BA00F"/>'); // for (uint i; i < 3; ++i) { // DEPLOY: remove // safeMint(address(this)); // Mints 3 sets of traits // } } // todo: look to put back in onlyOwner function addNewTrait(string memory _traitName, TraitCategory.Name _traitType, string memory _traitPath) public { TraitMetadata storage metadata = traitNameToMetadata[_traitName]; /* // commenting out for now // todo: add checks of some kind // Check if we already have it if (keccak256(bytes(metadata.traitName)) != keccak256(bytes(''))) { revert('Trait already exists'); } */ metadata.traitName = _traitName; metadata.traitType = _traitType; metadata.traitPath = _traitPath; } // mints to a smart contract address that implements onERC721Received function safeMint(address to) public returns (uint256[] memory) { // TODO: add onlyMinter modifier // TODO: check supply? // TODO: add back in onlyMinter modifier uint256[] memory mintedIds = new uint256[](INITIAL_TRAIT_NUMBER); // Mint INITIAL_TRAIT_NUMBER traits for now /// mmm... when initially minting are we hardcoding 3 traits or some sort of RNG? for(uint i; i < INITIAL_TRAIT_NUMBER; i++) { uint tokenId = totalSupply() + 1; _safeMint(to, tokenId); mintedIds[i] = tokenId; if(i == 0) { // commit-reveal would determine the shirt type if (tokenId == 1) { tokenIdToMetadataString[tokenId] = 'Hoodie Black'; } else if (tokenId == 3) { tokenIdToMetadataString[tokenId] = 'Hoodie Red'; } else { tokenIdToMetadataString[tokenId] = 'Blue Stripes'; } } else { // commit-reveal would determine the pants type if (tokenId == 2) { tokenIdToMetadataString[tokenId] = 'Blue'; } else if (tokenId == 4) { tokenIdToMetadataString[tokenId] = 'Purple'; } else { tokenIdToMetadataString[tokenId] = 'Green'; } } } return mintedIds; } function tokenURI(uint256 _tokenId) public view override returns (string memory) { // _requireOwned(tokenId); // todo: put back in? return renderAsDataUri(_tokenId); } function getTrait(uint256 _tokenId) internal view returns (ITraitStorage.Trait memory trait) { ITraitStorage.StoredTrait memory stored = traits.all[_tokenId]; trait.stored = stored; } function getTraitType(uint256 _tokenId) public view returns (TraitCategory.Name) { return traits.all[_tokenId].traitType; } function renderAsDataUri(uint256 _tokenId) public view returns (string memory) { string memory fullSvg; string memory traitSvg; string memory attributes; string memory bodyGhostSvg = bodyRenderer.getGhostSVG(); TraitMetadata memory metadata = traitNameToMetadata[tokenIdToMetadataString[_tokenId]]; traitSvg = metadata.traitPath; TraitCategory.Name traitTypeEnum = metadata.traitType; string memory traitTypeString = TraitCategory.toString(traitTypeEnum); attributes = RenderHelper.getTraitAsJson(traitTypeString, metadata.traitName); /* // Get trait from storage - OLD METHOD Trait memory trait = getTrait(_tokenId); (traitSvg, attributes) = traitsRenderer.getSVGFromStoredTrait(trait.stored); if (bytes(attributes).length == 0) attributes = '"attributes":[]'; // todo: remove, stops json error from happening locally */ fullSvg = string.concat( SVG_START, bodyGhostSvg, traitSvg, '</svg>' ); // string memory combinedSVG = svg; string memory image = string.concat( '"image":"data:image/svg+xml;base64,', Utils.encode(bytes(fullSvg)), '"' ); string memory json = string.concat( '{"name":"Peter Trait #', Utils.toString(_tokenId), '","description":"This is just a test",', attributes, ',', image, '}' ); return string.concat("data:application/json;base64,", Utils.encode(bytes(json))); } function walletOfOwner(address _owner) public view returns(uint256[] memory) { uint256 tokenCount = balanceOf(_owner); uint256[] memory tokensId = new uint256[](tokenCount); for(uint256 i; i < tokenCount; ++i){ tokensId[i] = tokenOfOwnerByIndex(_owner, i); } return tokensId; } // Owner // TODO: PUT BACK IN /* function setMinter(address _mainContractAddress) public onlyOwner { minter = _mainContractAddress; } function setRenderContract(address _address) public onlyOwner { traitsRenderer = TraitsRenderer(_address); } // TODO: look at other contracts for signing logic, import ECDSA, etc. function setSigner(address _signer) public onlyOwner { signer = _signer; } */ function supportsInterface(bytes4 interfaceId) public view override(ERC721Enumerable) returns (bool) { return super.supportsInterface(interfaceId); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/ERC721.sol) pragma solidity ^0.8.0; import "./IERC721.sol"; import "./IERC721Receiver.sol"; import "./extensions/IERC721Metadata.sol"; import "../../utils/Address.sol"; import "../../utils/Context.sol"; import "../../utils/Strings.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _owners; // Mapping owner address to token count mapping(address => uint256) private _balances; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ERC721: address zero is not a valid owner"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _owners[tokenId]; require(owner != address(0), "ERC721: invalid token ID"); return owner; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { _requireMinted(tokenId); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not token owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { _requireMinted(tokenId); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner nor approved"); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory data ) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner nor approved"); _safeTransfer(from, to, tokenId, data); } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * `data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer( address from, address to, uint256 tokenId, bytes memory data ) internal virtual { _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _owners[tokenId] != address(0); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { address owner = ERC721.ownerOf(tokenId); return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint( address to, uint256 tokenId, bytes memory data ) internal virtual { _mint(to, tokenId); require( _checkOnERC721Received(address(0), to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId); _balances[to] += 1; _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); _afterTokenTransfer(address(0), to, tokenId); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId); // Clear approvals _approve(address(0), tokenId); _balances[owner] -= 1; delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); _afterTokenTransfer(owner, address(0), tokenId); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) internal virtual { require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId); // Clear approvals from the previous owner _approve(address(0), tokenId); _balances[from] -= 1; _balances[to] += 1; _owners[tokenId] = to; emit Transfer(from, to, tokenId); _afterTokenTransfer(from, to, tokenId); } /** * @dev Approve `to` to operate on `tokenId` * * Emits an {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721.ownerOf(tokenId), to, tokenId); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits an {ApprovalForAll} event. */ function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { require(owner != operator, "ERC721: approve to caller"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Reverts if the `tokenId` has not been minted yet. */ function _requireMinted(uint256 tokenId) internal view virtual { require(_exists(tokenId), "ERC721: invalid token ID"); } /** * @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 ) private returns (bool) { if (to.isContract()) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) { return retval == IERC721Receiver.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { /// @solidity memory-safe-assembly assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/ERC721Enumerable.sol) pragma solidity ^0.8.0; import "../ERC721.sol"; import "./IERC721Enumerable.sol"; /** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */ abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex; // Array with all token ids, used for enumeration uint256[] private _allTokens; // Mapping from token id to position in the allTokens array mapping(uint256 => uint256) private _allTokensIndex; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) { return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */ function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) { require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds"); return _ownedTokens[owner][index]; } /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _allTokens.length; } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view virtual override returns (uint256) { require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds"); return _allTokens[index]; } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` cannot be the zero address. * - `to` cannot be the zero address. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override { super._beforeTokenTransfer(from, to, tokenId); if (from == address(0)) { _addTokenToAllTokensEnumeration(tokenId); } else if (from != to) { _removeTokenFromOwnerEnumeration(from, tokenId); } if (to == address(0)) { _removeTokenFromAllTokensEnumeration(tokenId); } else if (to != from) { _addTokenToOwnerEnumeration(to, tokenId); } } /** * @dev Private function to add a token to this extension's ownership-tracking data structures. * @param to address representing the new owner of the given token ID * @param tokenId uint256 ID of the token to be added to the tokens list of the given address */ function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { uint256 length = ERC721.balanceOf(to); _ownedTokens[to][length] = tokenId; _ownedTokensIndex[tokenId] = length; } /** * @dev Private function to add a token to this extension's token tracking data structures. * @param tokenId uint256 ID of the token to be added to the tokens list */ function _addTokenToAllTokensEnumeration(uint256 tokenId) private { _allTokensIndex[tokenId] = _allTokens.length; _allTokens.push(tokenId); } /** * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for * gas optimizations e.g. when performing a transfer operation (avoiding double writes). * This has O(1) time complexity, but alters the order of the _ownedTokens array. * @param from address representing the previous owner of the given token ID * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address */ function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private { // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = ERC721.balanceOf(from) - 1; uint256 tokenIndex = _ownedTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary if (tokenIndex != lastTokenIndex) { uint256 lastTokenId = _ownedTokens[from][lastTokenIndex]; _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index } // This also deletes the contents at the last position of the array delete _ownedTokensIndex[tokenId]; delete _ownedTokens[from][lastTokenIndex]; } /** * @dev Private function to remove a token from this extension's token tracking data structures. * This has O(1) time complexity, but alters the order of the _allTokens array. * @param tokenId uint256 ID of the token to be removed from the tokens list */ function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private { // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = _allTokens.length - 1; uint256 tokenIndex = _allTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding // an 'if' statement (like in _removeTokenFromOwnerEnumeration) uint256 lastTokenId = _allTokens[lastTokenIndex]; _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index // This also deletes the contents at the last position of the array delete _allTokensIndex[tokenId]; _allTokens.pop(); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; library Utils { uint256 internal constant MULTIPLIER = 100; uint256 internal constant GOLDEN_RATIO = 161803; /** * Compute the largest integer smaller than or equal to the square root of `n` */ // function floorSqrt(uint256 n) internal pure returns (uint256) { unchecked { // if (n > 0) { // uint256 x = n / 2 + 1; // uint256 y = (x + n / x) / 2; // while (x > y) { // x = y; // y = (x + n / x) / 2; // } // return x; // } // return 0; // }} /** * Compute the smallest integer larger than or equal to the square root of `n` */ // function ceilSqrt(uint256 n) internal pure returns (uint256) { unchecked { // uint256 x = floorSqrt(n); // return x ** 2 == n ? x : x + 1; // }} // function lerp(int256 targetFrom, int256 targetTo, int256 currentFrom, int256 currentTo, int current) internal pure returns (int256) { unchecked { // int256 t = 0;a // int256 divisor = currentTo - currentFrom - 1; // if (divisor > 0) { // t = (current - currentFrom) * int256(MULTIPLIER) / (divisor); // } // return targetFrom * int256(MULTIPLIER) + t * (targetTo - targetFrom); // }} function toByteArray(bytes32 _bytes32) internal pure returns (bytes memory result) { uint8 i = 0; while(i < 32 && _bytes32[i] != 0) { i++; } bytes memory bytesArray = new bytes(i); for (i = 0; i < 32 && _bytes32[i] != 0; i++) { bytesArray[i] = _bytes32[i]; } return bytesArray; } function toString(bytes32 _bytes32) internal pure returns (string memory result) { return string(toByteArray(_bytes32)); } // todo: check this function toStringBytes3(bytes3 _bytes) public pure returns (string memory) { bytes memory hexChars = "0123456789abcdef"; bytes memory hexString = new bytes(6); // Since bytes3 contains 3 bytes, resulting in 6 hex characters for (uint i = 0; i < 3; i++) { hexString[i * 2] = hexChars[uint8(_bytes[i] >> 4)]; hexString[1 + i * 2] = hexChars[uint8(_bytes[i] & 0x0f)]; } return string(hexString); } /* Gas Efficient uint/int to string functions Copied from: https://github.com/Vectorized/solady/blob/main/src/utils/LibString.sol */ /// @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)); } /// @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. } } /// @dev Encodes `data` using the base64 encoding described in RFC 4648. /// See: https://datatracker.ietf.org/doc/html/rfc4648 /// @param fileSafe Whether to replace '+' with '-' and '/' with '_'. /// @param noPadding Whether to strip away the padding. function encode(bytes memory data, bool fileSafe, bool noPadding) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { let dataLength := mload(data) if dataLength { // Multiply by 4/3 rounded up. // The `shl(2, ...)` is equivalent to multiplying by 4. let encodedLength := shl(2, div(add(dataLength, 2), 3)) // Set `result` to point to the start of the free memory. result := mload(0x40) // Store the table into the scratch space. // Offsetted by -1 byte so that the `mload` will load the character. // We will rewrite the free memory pointer at `0x40` later with // the allocated size. // The magic constant 0x0670 will turn "-_" into "+/". mstore(0x1f, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdef") mstore(0x3f, xor("ghijklmnopqrstuvwxyz0123456789-_", mul(iszero(fileSafe), 0x0670))) // Skip the first slot, which stores the length. let ptr := add(result, 0x20) let end := add(ptr, encodedLength) // Run over the input, 3 bytes at a time. for {} 1 {} { data := add(data, 3) // Advance 3 bytes. let input := mload(data) // Write 4 bytes. Optimized for fewer stack operations. mstore8(0, mload(and(shr(18, input), 0x3F))) mstore8(1, mload(and(shr(12, input), 0x3F))) mstore8(2, mload(and(shr(6, input), 0x3F))) mstore8(3, mload(and(input, 0x3F))) mstore(ptr, mload(0x00)) ptr := add(ptr, 4) // Advance 4 bytes. if iszero(lt(ptr, end)) { break } } mstore(0x40, add(end, 0x20)) // Allocate the memory. // Equivalent to `o = [0, 2, 1][dataLength % 3]`. let o := div(2, mod(dataLength, 3)) // Offset `ptr` and pad with '='. We can simply write over the end. mstore(sub(ptr, o), shl(240, 0x3d3d)) // Set `o` to zero if there is padding. o := mul(iszero(iszero(noPadding)), o) mstore(sub(ptr, o), 0) // Zeroize the slot after the string. mstore(result, sub(encodedLength, o)) // Store the length. } } } /// @dev Encodes `data` using the base64 encoding described in RFC 4648. /// Equivalent to `encode(data, false, false)`. function encode(bytes memory data) internal pure returns (string memory result) { result = encode(data, false, false); } /// @dev Encodes `data` using the base64 encoding described in RFC 4648. /// Equivalent to `encode(data, fileSafe, false)`. function encode(bytes memory data, bool fileSafe) internal pure returns (string memory result) { result = encode(data, fileSafe, false); } // /// @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)) // } // } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import { RenderHelper } from "./RenderHelper.sol"; import { Random, RandomCtx } from '../common/Random.sol'; import { IPeterStorage } from '../interfaces/IPeterStorage.sol'; import { ITraitStorage } from '../interfaces/ITraitStorage.sol'; import { Division } from "../common/Division.sol"; contract TraitsRenderer { /* string constant SVG_START = '<svg shape-rendering="crispEdges" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg"><style>rect{width:1px; height: 1px;} .bg{width:30px; height: 30px;} </style><rect class="bg" fill="#0D6E9D"/>'; // todo: maybe a getSVG and a getFullSVG method? // function getSVG(uint tokenId) public pure returns (string memory svg, string memory traitsAsString) { function getSVGFromStoredPeter(IPeterStorage.StoredPeter memory storedPeter) public pure returns (string memory, string memory) { string memory svg; string memory traitsAsString; // SHIRT RandomCtx memory rndCtx = Random.initCtx(storedPeter.shirtId); string memory typeName = RenderHelper.randomShirt(rndCtx); // returns Shirt 001 etc traitsAsString = RenderHelper.stringTrait('Shirt', typeName); svg = PeterShapes.renderShirtFromName(typeName); // PANTS rndCtx = Random.initCtx(storedPeter.pantsId); typeName = RenderHelper.randomPants(rndCtx); // returns Shirt 001 etc traitsAsString = string.concat(traitsAsString, ',', RenderHelper.stringTrait('Pants', typeName)); svg = string.concat(svg, PeterShapes.renderPantsFromName(typeName)); return (svg, traitsAsString); } function getSVGFromStoredTrait(ITraitStorage.StoredTrait memory storedTrait) public pure returns (string memory svg, string memory traitAsString) { RandomCtx memory rndCtx = Random.initCtx(storedTrait.tokenId); svg = ''; traitAsString = ''; // yuck... todo: check for better way, maybe ENUMs? if (keccak256(abi.encodePacked(storedTrait.traitType)) == keccak256(abi.encodePacked("Shirt"))) { string memory typeName = RenderHelper.randomShirt(rndCtx); // returns Shirt 001 etc traitAsString = RenderHelper.getTraitAsJson('Shirt', typeName); svg = PeterShapes.renderShirtFromName(typeName); } if (keccak256(abi.encodePacked(storedTrait.traitType)) == keccak256(abi.encodePacked("Pants"))) { string memory typeName = RenderHelper.randomPants(rndCtx); // returns Shirt 001 etc traitAsString = RenderHelper.getTraitAsJson('Pants', typeName); svg = PeterShapes.renderPantsFromName(typeName); } } */ /* function getSVGForTokenId(uint _tokenId) public pure returns (string memory svg, string memory traitsAsString) { // SHIRT RandomCtx memory rndCtx = Random.initCtx(_tokenId); RenderHelper.TraitsInfo memory shirtTraits = RenderHelper.randomTraits(rndCtx); traitsAsString = RenderHelper.getTraitsAsJson(shirtTraits); svg = string.concat(PeterShapes.renderShirt(shirtTraits)); } */ } library PeterShapes { // these are all optimised by https://svgomg.net/ getting them down to 3KB from 6KB but combining areas string private constant HAIR_001 = '<rect x="13" y="5" fill="#D700A8" /> <rect x="14" y="5" fill="#D700A8" /> <rect x="15" y="5" fill="#D700A8" /> <rect x="16" y="5" fill="#D700A8" /> <rect x="17" y="5" fill="#D700A8" /> <rect x="18" y="5" fill="#D700A8" /> <rect x="19" y="5" fill="#D700A8" /> <rect x="11" y="6" fill="#D700A8" /> <rect x="12" y="6" fill="#C30098" /> <rect x="13" y="6" fill="#C30098" /> <rect x="14" y="6" fill="#C30098" /> <rect x="15" y="6" fill="#C30098" /> <rect x="16" y="6" fill="#C30098" /> <rect x="17" y="6" fill="#C30098" /> <rect x="18" y="6" fill="#C30098" /> <rect x="19" y="6" fill="#D700A8" /> <rect x="20" y="6" fill="#D700A8" /> <rect x="11" y="7" fill="#C30098" /> <rect x="12" y="7" fill="#C30098" /> <rect x="13" y="7" fill="#C30098" /> <rect x="14" y="7" fill="#C30098" /> <rect x="15" y="7" fill="#C30098" /> <rect x="16" y="7" fill="#C30098" /> <rect x="17" y="7" fill="#C30098" /> <rect x="18" y="7" fill="#C30098" /> <rect x="19" y="7" fill="#C30098" /> <rect x="20" y="7" fill="#D700A8" /> <rect x="10" y="8" fill="#D700A8" /> <rect x="11" y="8" fill="#C30098" /> <rect x="12" y="8" fill="#C30098" /> <rect x="13" y="8" fill="#C30098" /> <rect x="14" y="8" fill="#C30098" /> <rect x="15" y="8" fill="#C30098" /> <rect x="16" y="8" fill="#C30098" /> <rect x="17" y="8" fill="#C30098" /> <rect x="18" y="8" fill="#C30098" /> <rect x="19" y="8" fill="#C30098" /> <rect x="10" y="9" fill="#C30098" /> <rect x="11" y="9" fill="#C30098" /> <rect x="12" y="9" fill="#C30098" /> <rect x="13" y="9" fill="#C30098" /> <rect x="14" y="9" fill="#C30098" /> <rect x="15" y="9" fill="#C30098" /> <rect x="16" y="9" fill="#C30098" /> <rect x="17" y="9" fill="#C30098" /> <rect x="18" y="9" fill="#C30098" /> <rect x="19" y="9" fill="#C30098" /> <rect x="10" y="10" fill="#C30098" /> <rect x="11" y="10" fill="#C30098" /> <rect x="10" y="11" fill="#C30098" />'; string private constant HAIR_002 = '<rect x="12" y="7" fill="#D700A8" /> <rect x="13" y="7" fill="#D700A8" /> <rect x="14" y="7" fill="#D700A8" /> <rect x="15" y="7" fill="#D700A8" /> <rect x="16" y="7" fill="#B2008B" /> <rect x="17" y="7" fill="#B2008B" /> <rect x="11" y="8" fill="#D700A8" /> <rect x="12" y="8" fill="#D700A8" /> <rect x="13" y="8" fill="#D700A8" /> <rect x="14" y="8" fill="#D700A8" /> <rect x="15" y="8" fill="#D700A8" /> <rect x="16" y="8" fill="#B2008B" /> <rect x="17" y="8" fill="#B2008B" /> <rect x="10" y="9" fill="#D700A8" /> <rect x="11" y="9" fill="#D700A8" /> <rect x="16" y="9" fill="#B2008B" /> <rect x="17" y="9" fill="#B2008B" /> <rect x="10" y="10" fill="#D700A8" /> <rect x="10" y="11" fill="#D700A8" />'; // string private constant HAIR_003 = '<rect x="12" y="7" fill="#00C700"></rect> <rect x="13" y="7" fill="#00C700"></rect> <rect x="14" y="7" fill="#00C700"></rect> <rect x="15" y="7" fill="#00C700"></rect> <rect x="16" y="7" fill="#00A700"></rect> <rect x="17" y="7" fill="#00A700"></rect> <rect x="11" y="8" fill="#00C700"></rect> <rect x="12" y="8" fill="#00C700"></rect> <rect x="13" y="8" fill="#00C700"></rect> <rect x="14" y="8" fill="#00C700"></rect> <rect x="15" y="8" fill="#00C700"></rect> <rect x="16" y="8" fill="#00A700"></rect> <rect x="17" y="8" fill="#00A700"></rect> <rect x="10" y="9" fill="#00C700"></rect> <rect x="11" y="9" fill="#00C700"></rect> <rect x="16" y="9" fill="#00A700"></rect> <rect x="17" y="9" fill="#00A700"></rect> <rect x="10" y="10" fill="#00C700"></rect> <rect x="10" y="11" fill="#00C700"></rect>'; string private constant SHIRT_001 = '<path fill="#000" d="M10 9h1v1h-1zM11 9h1v1h-1zM12 9h1v1h-1zM13 9h1v1h-1zM14 9h1v1h-1zM15 9h1v1h-1zM16 9h1v1h-1zM17 9h1v1h-1zM18 9h1v1h-1zM19 9h1v1h-1zM9 10h1v1H9zM10 10h1v1h-1zM11 10h1v1h-1zM19 10h1v1h-1zM20 10h1v1h-1zM9 11h1v1H9zM10 11h1v1h-1zM20 11h1v1h-1zM9 12h1v1H9zM10 12h1v1h-1zM20 12h1v1h-1zM9 13h1v1H9zM10 13h1v1h-1zM20 13h1v1h-1zM9 14h1v1H9zM10 14h1v1h-1zM20 14h1v1h-1zM10 15h1v1h-1zM11 15h1v1h-1zM19 15h1v1h-1zM20 15h1v1h-1zM11 16h1v1h-1zM12 16h1v1h-1zM13 16h1v1h-1zM17 16h1v1h-1zM18 16h1v1h-1zM19 16h1v1h-1zM10 17h1v1h-1zM11 17h1v1h-1zM12 17h1v1h-1z"/><path fill="#ECEDED" d="M13 17h1v1h-1z"/><path fill="#000" d="M14 17h1v1h-1zM15 17h1v1h-1zM16 17h1v1h-1z"/><path fill="#ECEDED" d="M17 17h1v1h-1z"/><path fill="#000" d="M18 17h1v1h-1zM9 18h1v1H9zM9 19h1v1H9zM18 19h1v1h-1zM10 18h1v1h-1zM10 19h1v1h-1zM19 19h1v1h-1zM11 18h1v1h-1zM12 18h1v1h-1zM13 18h1v1h-1zM14 18h1v1h-1zM15 18h1v1h-1zM16 18h1v1h-1zM17 18h1v1h-1zM18 18h1v1h-1zM19 18h1v1h-1zM11 19h1v1h-1zM11 20h1v1h-1zM12 20h1v1h-1zM13 20h1v1h-1zM14 20h1v1h-1zM15 20h1v1h-1zM16 20h1v1h-1zM17 20h1v1h-1zM12 19h1v1h-1zM13 19h1v1h-1zM14 19h1v1h-1zM15 19h1v1h-1zM16 19h1v1h-1zM17 19h1v1h-1z"/>'; string private constant SHIRT_002 = '<path fill="#EA0000" d="M10 9h1v1h-1zM11 9h1v1h-1zM12 9h1v1h-1zM13 9h1v1h-1zM14 9h1v1h-1zM15 9h1v1h-1zM16 9h1v1h-1zM17 9h1v1h-1zM18 9h1v1h-1zM19 9h1v1h-1zM9 10h1v1H9zM10 10h1v1h-1zM11 10h1v1h-1zM19 10h1v1h-1zM20 10h1v1h-1zM9 11h1v1H9zM10 11h1v1h-1zM20 11h1v1h-1zM9 12h1v1H9zM10 12h1v1h-1zM20 12h1v1h-1zM9 13h1v1H9zM10 13h1v1h-1zM20 13h1v1h-1zM9 14h1v1H9zM10 14h1v1h-1zM20 14h1v1h-1zM10 15h1v1h-1zM11 15h1v1h-1zM19 15h1v1h-1zM20 15h1v1h-1zM11 16h1v1h-1zM12 16h1v1h-1zM13 16h1v1h-1zM17 16h1v1h-1zM18 16h1v1h-1zM19 16h1v1h-1zM10 17h1v1h-1zM11 17h1v1h-1zM12 17h1v1h-1z"/><path fill="#ECEDED" d="M13 17h1v1h-1z"/><path fill="#EA0000" d="M14 17h1v1h-1zM15 17h1v1h-1zM16 17h1v1h-1z"/><path fill="#ECEDED" d="M17 17h1v1h-1z"/><path fill="#EA0000" d="M18 17h1v1h-1zM9 18h1v1H9zM9 19h1v1H9zM18 19h1v1h-1zM10 18h1v1h-1zM10 19h1v1h-1zM19 19h1v1h-1zM11 18h1v1h-1zM12 18h1v1h-1zM13 18h1v1h-1zM14 18h1v1h-1zM15 18h1v1h-1zM16 18h1v1h-1zM17 18h1v1h-1zM18 18h1v1h-1zM19 18h1v1h-1zM11 19h1v1h-1zM11 20h1v1h-1zM12 20h1v1h-1zM13 20h1v1h-1zM14 20h1v1h-1zM15 20h1v1h-1zM16 20h1v1h-1zM17 20h1v1h-1zM12 19h1v1h-1zM13 19h1v1h-1zM14 19h1v1h-1zM15 19h1v1h-1zM16 19h1v1h-1zM17 19h1v1h-1z"/>'; // string private constant SHIRT_003 = '<rect x="11" y="16" fill="#1A2099"></rect> <rect x="12" y="16" fill="#1A2099"></rect> <rect x="17" y="16" fill="#1A2099"></rect> <rect x="10" y="17" fill="#1A2099"></rect> <rect x="11" y="17" fill="#1A2099"></rect> <rect x="12" y="17" fill="#1A2099"></rect> <rect x="13" y="17" fill="#1A2099"></rect> <rect x="14" y="17" fill="#F1F6F8"></rect> <rect x="15" y="17" fill="#F1F6F8"></rect> <rect x="16" y="17" fill="#F1F6F8"></rect> <rect x="17" y="17" fill="#1A2099"></rect> <rect x="18" y="17" fill="#1A2099"></rect> <rect x="9" y="18" fill="#1A2099"></rect> <rect x="10" y="18" fill="#1A2099"></rect> <rect x="11" y="18" fill="#1A2099"></rect> <rect x="12" y="18" fill="#1A2099"></rect> <rect x="13" y="18" fill="#1A2099"></rect> <rect x="14" y="18" fill="#F1F6F8"></rect> <rect x="15" y="18" fill="#F1F6F8"></rect> <rect x="16" y="18" fill="#E7E6E5"></rect> <rect x="17" y="18" fill="#1A2099"></rect> <rect x="18" y="18" fill="#1A2099"></rect> <rect x="19" y="18" fill="#1A2099"></rect> <rect x="9" y="19" fill="#1A2099"></rect> <rect x="10" y="19" fill="#1A2099"></rect> <rect x="11" y="19" fill="#1A2099"></rect> <rect x="12" y="19" fill="#1A2099"></rect> <rect x="13" y="19" fill="#1A2099"></rect> <rect x="14" y="19" fill="#F1F6F8"></rect> <rect x="15" y="19" fill="#F1F6F8"></rect> <rect x="16" y="19" fill="#F1F6F8"></rect> <rect x="17" y="19" fill="#1A2099"></rect> <rect x="18" y="19" fill="#1A2099"></rect> <rect x="19" y="19" fill="#1A2099"></rect> <rect x="11" y="20" fill="#1A2099"></rect> <rect x="12" y="20" fill="#1A2099"></rect> <rect x="13" y="20" fill="#1A2099"></rect> <rect x="14" y="20" fill="#F1F6F8"></rect> <rect x="15" y="20" fill="#F1F6F8"></rect> <rect x="16" y="20" fill="#F1F6F8"></rect> <rect x="17" y="20" fill="#1A2099"></rect>'; string private constant PANTS_001 = '<rect x="11" y="21" width="1" height="1" fill="#6C0B81" /> <rect x="12" y="21" width="1" height="1" fill="#7A0D92" /> <rect x="13" y="21" width="1" height="1" fill="#7A0D92" /> <rect x="14" y="21" width="1" height="1" fill="#6C0B81" /> <rect x="15" y="21" width="1" height="1" fill="#7A0D92" /> <rect x="16" y="21" width="1" height="1" fill="#7A0D92" /> <rect x="17" y="21" width="1" height="1" fill="#6C0B81" /> <rect x="11" y="22" width="1" height="1" fill="#7A0D92" /> <rect x="12" y="22" width="1" height="1" fill="#7A0D92" /> <rect x="13" y="22" width="1" height="1" fill="#7A0D92" /> <rect x="15" y="22" width="1" height="1" fill="#7A0D92" /> <rect x="16" y="22" width="1" height="1" fill="#7A0D92" /> <rect x="17" y="22" width="1" height="1" fill="#7A0D92" />'; string private constant PANTS_002 = '<rect x="11" y="21" width="1" height="1" fill="#0038CB"></rect> <rect x="12" y="21" width="1" height="1" fill="#013FE0"></rect> <rect x="13" y="21" width="1" height="1" fill="#013FE0"></rect> <rect x="14" y="21" width="1" height="1" fill="#0038CB"></rect> <rect x="15" y="21" width="1" height="1" fill="#013FE0"></rect> <rect x="16" y="21" width="1" height="1" fill="#013FE0"></rect> <rect x="17" y="21" width="1" height="1" fill="#0038CB"></rect> <rect x="11" y="22" width="1" height="1" fill="#013FE0"></rect> <rect x="12" y="22" width="1" height="1" fill="#013FE0"></rect> <rect x="13" y="22" width="1" height="1" fill="#013FE0"></rect> <rect x="15" y="22" width="1" height="1" fill="#013FE0"></rect> <rect x="16" y="22" width="1" height="1" fill="#013FE0"></rect> <rect x="17" y="22" width="1" height="1" fill="#013FE0"></rect>'; // string private constant PANTS_003 = '<path d="M12 21H11V22H12V21Z" fill="#118907"/> <path d="M13 21H12V22H13V21Z" fill="#1BA00F"/> <path d="M14 21H13V22H14V21Z" fill="#1BA00F"/> <path d="M15 21H14V22H15V21Z" fill="#118907"/> <path d="M16 21H15V22H16V21Z" fill="#1BA00F"/> <path d="M17 21H16V22H17V21Z" fill="#1BA00F"/> <path d="M18 21H17V22H18V21Z" fill="#118907"/> <path d="M12 22H11V23H12V22Z" fill="#1BA00F"/> <path d="M13 22H12V23H13V22Z" fill="#1BA00F"/> <path d="M14 22H13V23H14V22Z" fill="#1BA00F"/> <path d="M16 22H15V23H16V22Z" fill="#1BA00F"/> <path d="M17 22H16V23H17V22Z" fill="#1BA00F"/> <path d="M18 22H17V23H18V22Z" fill="#1BA00F"/>'; /* function renderHair(PeterTraits.TraitsInfo memory traits) internal pure returns (string memory svg) { if(traits.hair == PeterTraits.Hair.HAIR_001) { svg = HAIR_001; } if(traits.hair == PeterTraits.Hair.HAIR_002) { svg = HAIR_002; } // if(traits.hair == PeterTraits.Hair.HAIR_003) { // svg = HAIR_003; // } } function renderShirt(RenderHelper.TraitsInfo memory traits) internal pure returns (string memory svg) { if(traits.shirt == RenderHelper.Shirt.SHIRT_001) { svg = SHIRT_001; } if(traits.shirt == RenderHelper.Shirt.SHIRT_002) { svg = SHIRT_002; } // if(traits.shirt == PeterTraits.Shirt.SHIRT_003) { // svg = SHIRT_003; // } } function renderShirtFromName(string memory typeName) internal pure returns (string memory svg) { if (keccak256(abi.encodePacked(typeName)) == keccak256(abi.encodePacked("Shirt 001"))) { svg = SHIRT_001; } if (keccak256(abi.encodePacked(typeName)) == keccak256(abi.encodePacked("Shirt 002"))) { svg = SHIRT_002; } } function renderPants(RenderHelper.TraitsInfo memory traits) internal pure returns (string memory svg) { if(traits.pants == RenderHelper.Pants.PANTS_001) { svg = PANTS_001; } if(traits.pants == RenderHelper.Pants.PANTS_002) { svg = PANTS_002; } // if(traits.pants == PeterTraits.Pants.PANTS_003) { // svg = PANTS_003; // } } // yuck! function renderPantsFromName(string memory typeName) internal pure returns (string memory svg) { if (keccak256(abi.encodePacked(typeName)) == keccak256(abi.encodePacked("Pants 001"))) { svg = PANTS_001; } if (keccak256(abi.encodePacked(typeName)) == keccak256(abi.encodePacked("Pants 002"))) { svg = PANTS_002; } } // function renderShoes(RenderHelper.TraitsInfo memory traits) internal pure returns (string memory svg) { // if(traits.shoes == RenderHelper.Shoes.SHOES_001) { // svg = SHOES_001; // } // if(traits.shoes == RenderHelper.Shoes.PANTSHOES_002) { // svg = SHOES_002; // } // } */ }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import { Utils } from '../common/Utils.sol'; import { Random, RandomCtx } from '../common/Random.sol'; library RenderHelper { /* enum Body { BODY_001, BODY_002, BODY_003 } function toString(Body body) internal pure returns (string memory) { if (body == Body.BODY_002) return "Body 002"; if (body == Body.BODY_003) return "Body 003"; return "Body 001"; } function randomBody(RandomCtx memory rndCtx) internal pure returns (string memory) { Body body = Body(Random.randWithProbabilities(rndCtx, Random.probabilityArray(50, 50))); return toString(body); } enum Hair { HAIR_001, HAIR_002, HAIR_003 } enum Shirt { SHIRT_001, SHIRT_002, SHIRT_003 } enum Pants { PANTS_001, PANTS_002, PANTS_003 } enum Shoes { SHOES_001, SHOES_002, SHOES_003 } struct TraitsInfo { Body body; // Hair hair; Shirt shirt; Pants pants; Shoes shoes; } function toString(Hair hair) internal pure returns (string memory) { if (hair == Hair.HAIR_002) return "Hair 002"; // if (hair == Hair.HAIR_003) return "Hair 003"; return "Hair 001"; } function toString(Shirt shirt) internal pure returns (string memory) { if (shirt == Shirt.SHIRT_002) return "Shirt 002"; // if (shirt == Shirt.SHIRT_003) return "Shirt 003"; return "Shirt 001"; } function toString(Pants pants) internal pure returns (string memory) { if (pants == Pants.PANTS_002) return "Pants 002"; // if (pants == Pants.PANTS_003) return "Pants 003"; return "Pants 001"; } function toString(Shoes shoes) internal pure returns (string memory) { if (shoes == Shoes.SHOES_002) return "Shoes 002"; // if (shoes == Shoes.SHOES_003) return "Shoes 003"; return "Shoes 001"; } function randomTraits(RandomCtx memory rndCtx) internal pure returns (TraitsInfo memory) { TraitsInfo memory traits = TraitsInfo({ body: Body(Random.randWithProbabilities(rndCtx, Random.probabilityArray(50, 50))), shirt: Shirt(Random.randWithProbabilities(rndCtx, Random.probabilityArray(50, 50))), // hair: Hair(Random.randWithProbabilities(rndCtx, Random.probabilityArray(50, 50))), pants: Pants(Random.randWithProbabilities(rndCtx, Random.probabilityArray(50, 50))), shoes: Shoes(Random.randWithProbabilities(rndCtx, Random.probabilityArray(50, 50))) }); return traits; } function randomShirt(RandomCtx memory rndCtx) internal pure returns (string memory) { Shirt shirt = Shirt(Random.randWithProbabilities(rndCtx, Random.probabilityArray(50, 50))); return toString(shirt); } function randomPants(RandomCtx memory rndCtx) internal pure returns (string memory) { Pants pants = Pants(Random.randWithProbabilities(rndCtx, Random.probabilityArray(50, 50))); return toString(pants); } function randomShoes(RandomCtx memory rndCtx) internal pure returns (string memory) { Shoes shoes = Shoes(Random.randWithProbabilities(rndCtx, Random.probabilityArray(50, 50))); return toString(shoes); } function getTraitsAsJson(TraitsInfo memory traits) internal pure returns (string memory) { string memory result = string.concat( stringTrait("Body", toString(traits.body)), ',', // stringTrait("Hair", toString(traits.hair)), ',', stringTrait("Shirt", toString(traits.shirt)), ',', stringTrait("Pants", toString(traits.pants)) // stringTrait("Shoes", toString(traits.shoes)) ); return string.concat('"attributes":[', result, ']'); } */ function getTraitAsJson(string memory traitName, string memory traitValue) internal pure returns (string memory) { string memory result = string.concat( stringTrait(traitName,traitValue) ); return string.concat( '"attributes":[', result, ']' ); } function stringTrait(string memory traitName, string memory traitValue) internal pure returns (string memory) { return string.concat( '{"trait_type":"', traitName, '","value":"', traitValue, '"}' ); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import { Random, RandomCtx } from '../common/Random.sol'; import { RenderHelper } from "./RenderHelper.sol"; import { IPeterStorage } from '../interfaces/IPeterStorage.sol'; /// A render contract that returns the SVG for the body contract BodyRenderer { // string constant SVG_START = '<svg shape-rendering="crispEdges" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg"><style>rect{width:1px; height: 1px;} .bg{width:30px; height: 30px;} </style><rect class="bg" fill="#0D6E9D"/>'; string private constant BODY_001 = '<path fill="#EFB15E" d="M11 23h1v1h-1zM12 23h1v1h-1zM16 23h1v1h-1zM17 23h1v1h-1zM11 21h1v1h-1zM12 21h1v1h-1zM13 21h1v1h-1zM14 21h1v1h-1zM15 21h1v1h-1zM16 21h1v1h-1zM17 21h1v1h-1zM11 22h1v1h-1zM12 22h1v1h-1zM13 22h1v1h-1zM15 22h1v1h-1zM16 22h1v1h-1zM17 22h1v1h-1zM11 17h1v1h-1zM12 17h1v1h-1zM13 17h1v1h-1zM14 17h1v1h-1zM15 17h1v1h-1zM16 17h1v1h-1zM17 17h1v1h-1zM11 18h1v1h-1z"/><path fill="#D69743" d="M12 18h1v1h-1z"/><path fill="#EFB15E" d="M14 18h1v1h-1zM15 18h1v1h-1z"/><path fill="#D69743" d="M16 18h1v1h-1z"/><path fill="#EFB15E" d="M11 19h1v1h-1zM11 20h1v1h-1zM12 20h1v1h-1zM13 20h1v1h-1zM14 20h1v1h-1zM15 20h1v1h-1zM16 20h1v1h-1zM17 20h1v1h-1zM12 19h1v1h-1zM13 19h1v1h-1zM14 19h1v1h-1zM15 19h1v1h-1zM16 19h1v1h-1zM17 19h1v1h-1zM18 17h1v1h-1zM18 18h1v1h-1zM19 18h1v1h-1z"/><path fill="#D69743" d="M18 19h1v1h-1zM18 20h1v1h-1z"/><path fill="#EFB15E" d="M19 19h1v1h-1zM19 20h1v1h-1zM10 17h1v1h-1zM9 18h1v1H9zM9 19h1v1H9zM9 20h1v1H9z"/><path fill="#D69743" d="M10 19h1v1h-1zM10 20h1v1h-1z"/><path fill="#EFB15E" d="M10 18h1v1h-1zM13 18h1v1h-1zM17 18h1v1h-1z"/><path fill="#D69743" d="M11 16h1v1h-1zM12 16h1v1h-1zM13 16h1v1h-1zM14 16h1v1h-1zM15 16h1v1h-1zM16 16h1v1h-1zM17 16h1v1h-1z"/><path fill="#EFB15E" d="M15 15h1v1h-1zM16 15h1v1h-1zM11 9h1v1h-1zM14 12h1v1h-1zM12 9h1v1h-1zM13 9h1v1h-1zM14 9h1v1h-1zM15 9h1v1h-1zM16 9h1v1h-1zM17 9h1v1h-1zM18 9h1v1h-1zM10 10h1v1h-1zM11 10h1v1h-1zM12 10h1v1h-1zM13 10h1v1h-1zM14 10h1v1h-1zM15 10h1v1h-1zM16 10h1v1h-1zM17 10h1v1h-1zM18 10h1v1h-1zM19 10h1v1h-1zM10 11h1v1h-1zM11 11h1v1h-1zM12 11h1v1h-1zM13 11h1v1h-1zM14 11h1v1h-1zM15 11h1v1h-1zM16 11h1v1h-1zM17 11h1v1h-1zM18 11h1v1h-1zM19 11h1v1h-1zM10 12h1v1h-1zM11 12h1v1h-1zM15 12h1v1h-1zM16 12h1v1h-1zM10 13h1v1h-1zM11 13h1v1h-1zM10 14h1v1h-1zM11 14h1v1h-1zM13 14h1v1h-1zM14 14h1v1h-1zM15 14h1v1h-1zM16 14h1v1h-1zM17 14h1v1h-1zM18 14h1v1h-1zM19 14h1v1h-1zM11 15h1v1h-1zM12 15h1v1h-1zM13 15h1v1h-1zM14 15h1v1h-1zM17 15h1v1h-1zM18 15h1v1h-1zM12 14h1v1h-1zM19 13h1v1h-1zM19 12h1v1h-1z"/><path fill="#D69743" d="M9 12h1v1H9zM9 13h1v1H9z"/><path fill="#000" d="M18 12h1v1h-1zM18 13h1v1h-1z"/><path fill="#fff" d="M17 13h1v1h-1zM17 12h1v1h-1z"/><path fill="#000" d="M13 12h1v1h-1z"/><path fill="#fff" d="M12 12h1v1h-1zM12 13h1v1h-1z"/><path fill="#000" d="M13 13h1v1h-1z"/><path fill="#D69743" d="M15 13h1v1h-1zM14 13h1v1h-1zM16 13h1v1h-1z"/>'; string private constant BODY_002 = '<path fill="#BA8136" d="M11 23h1v1h-1zM12 23h1v1h-1zM16 23h1v1h-1zM17 23h1v1h-1zM11 21h1v1h-1zM12 21h1v1h-1zM13 21h1v1h-1zM14 21h1v1h-1zM15 21h1v1h-1zM16 21h1v1h-1zM17 21h1v1h-1zM11 22h1v1h-1zM12 22h1v1h-1zM13 22h1v1h-1zM15 22h1v1h-1zM16 22h1v1h-1zM17 22h1v1h-1zM11 17h1v1h-1zM12 17h1v1h-1zM13 17h1v1h-1zM14 17h1v1h-1zM15 17h1v1h-1zM16 17h1v1h-1zM17 17h1v1h-1zM11 18h1v1h-1z"/><path fill="#9A6D2E" d="M12 18h1v1h-1z"/><path fill="#BA8136" d="M14 18h1v1h-1zM15 18h1v1h-1z"/><path fill="#9A6D2E" d="M16 18h1v1h-1z"/><path fill="#BA8136" d="M11 19h1v1h-1zM11 20h1v1h-1zM12 20h1v1h-1zM13 20h1v1h-1zM14 20h1v1h-1zM15 20h1v1h-1zM16 20h1v1h-1zM17 20h1v1h-1zM12 19h1v1h-1zM13 19h1v1h-1zM14 19h1v1h-1zM15 19h1v1h-1zM16 19h1v1h-1zM17 19h1v1h-1zM18 17h1v1h-1zM18 18h1v1h-1zM19 18h1v1h-1z"/><path fill="#9A6D2E" d="M18 19h1v1h-1zM18 20h1v1h-1z"/><path fill="#BA8136" d="M19 19h1v1h-1zM19 20h1v1h-1zM10 17h1v1h-1zM9 18h1v1H9zM9 19h1v1H9zM9 20h1v1H9z"/><path fill="#9A6D2E" d="M10 19h1v1h-1zM10 20h1v1h-1z"/><path fill="#BA8136" d="M10 18h1v1h-1zM13 18h1v1h-1zM17 18h1v1h-1z"/><path fill="#9A6D2E" d="M11 16h1v1h-1zM12 16h1v1h-1zM13 16h1v1h-1zM14 16h1v1h-1zM15 16h1v1h-1zM16 16h1v1h-1zM17 16h1v1h-1z"/><path fill="#BA8136" d="M15 15h1v1h-1zM16 15h1v1h-1zM11 9h1v1h-1zM14 12h1v1h-1zM12 9h1v1h-1zM13 9h1v1h-1zM14 9h1v1h-1zM15 9h1v1h-1zM16 9h1v1h-1zM17 9h1v1h-1zM18 9h1v1h-1zM10 10h1v1h-1zM11 10h1v1h-1zM12 10h1v1h-1zM13 10h1v1h-1zM14 10h1v1h-1zM15 10h1v1h-1zM16 10h1v1h-1zM17 10h1v1h-1zM18 10h1v1h-1zM19 10h1v1h-1zM10 11h1v1h-1zM11 11h1v1h-1zM12 11h1v1h-1zM13 11h1v1h-1zM14 11h1v1h-1zM15 11h1v1h-1zM16 11h1v1h-1zM17 11h1v1h-1zM18 11h1v1h-1zM19 11h1v1h-1zM10 12h1v1h-1zM11 12h1v1h-1zM15 12h1v1h-1zM16 12h1v1h-1zM10 13h1v1h-1zM11 13h1v1h-1zM10 14h1v1h-1zM11 14h1v1h-1zM13 14h1v1h-1zM14 14h1v1h-1zM15 14h1v1h-1zM16 14h1v1h-1zM17 14h1v1h-1zM18 14h1v1h-1zM19 14h1v1h-1zM11 15h1v1h-1zM12 15h1v1h-1zM13 15h1v1h-1zM14 15h1v1h-1zM17 15h1v1h-1zM18 15h1v1h-1zM12 14h1v1h-1zM19 13h1v1h-1zM19 12h1v1h-1z"/><path fill="#9A6D2E" d="M9 12h1v1H9zM9 13h1v1H9z"/><path fill="#000" d="M18 12h1v1h-1zM18 13h1v1h-1z"/><path fill="#fff" d="M17 13h1v1h-1zM17 12h1v1h-1z"/><path fill="#000" d="M13 12h1v1h-1z"/><path fill="#fff" d="M12 12h1v1h-1zM12 13h1v1h-1z"/><path fill="#000" d="M13 13h1v1h-1z"/><path fill="#9A6D2E" d="M15 13h1v1h-1zM14 13h1v1h-1zM16 13h1v1h-1z"/>'; // string private constant BODY_003 = '<path fill="#8A5E24" d="M11 23h1v1h-1zM12 23h1v1h-1zM16 23h1v1h-1zM17 23h1v1h-1zM11 21h1v1h-1zM12 21h1v1h-1zM13 21h1v1h-1zM14 21h1v1h-1zM15 21h1v1h-1zM16 21h1v1h-1zM17 21h1v1h-1zM11 22h1v1h-1zM12 22h1v1h-1zM13 22h1v1h-1zM15 22h1v1h-1zM16 22h1v1h-1zM17 22h1v1h-1zM11 17h1v1h-1zM12 17h1v1h-1zM13 17h1v1h-1zM14 17h1v1h-1zM15 17h1v1h-1zM16 17h1v1h-1zM17 17h1v1h-1zM11 18h1v1h-1z"/><path fill="#77511E" d="M12 18h1v1h-1z"/><path fill="#8A5E24" d="M14 18h1v1h-1zM15 18h1v1h-1z"/><path fill="#77511E" d="M16 18h1v1h-1z"/><path fill="#8A5E24" d="M11 19h1v1h-1zM11 20h1v1h-1zM12 20h1v1h-1zM13 20h1v1h-1zM14 20h1v1h-1zM15 20h1v1h-1zM16 20h1v1h-1zM17 20h1v1h-1zM12 19h1v1h-1zM13 19h1v1h-1zM14 19h1v1h-1zM15 19h1v1h-1zM16 19h1v1h-1zM17 19h1v1h-1zM18 17h1v1h-1zM18 18h1v1h-1zM19 18h1v1h-1z"/><path fill="#77511E" d="M18 19h1v1h-1zM18 20h1v1h-1z"/><path fill="#8A5E24" d="M19 19h1v1h-1zM19 20h1v1h-1zM10 17h1v1h-1zM9 18h1v1H9zM9 19h1v1H9zM9 20h1v1H9z"/><path fill="#77511E" d="M10 19h1v1h-1zM10 20h1v1h-1z"/><path fill="#8A5E24" d="M10 18h1v1h-1zM13 18h1v1h-1zM17 18h1v1h-1z"/><path fill="#77511E" d="M11 16h1v1h-1zM12 16h1v1h-1zM13 16h1v1h-1zM14 16h1v1h-1zM15 16h1v1h-1zM16 16h1v1h-1zM17 16h1v1h-1z"/><path fill="#8A5E24" d="M15 15h1v1h-1zM16 15h1v1h-1zM11 9h1v1h-1zM14 12h1v1h-1zM12 9h1v1h-1zM13 9h1v1h-1zM14 9h1v1h-1zM15 9h1v1h-1zM16 9h1v1h-1zM17 9h1v1h-1zM18 9h1v1h-1zM10 10h1v1h-1zM11 10h1v1h-1zM12 10h1v1h-1zM13 10h1v1h-1zM14 10h1v1h-1zM15 10h1v1h-1zM16 10h1v1h-1zM17 10h1v1h-1zM18 10h1v1h-1zM19 10h1v1h-1zM10 11h1v1h-1zM11 11h1v1h-1zM12 11h1v1h-1zM13 11h1v1h-1zM14 11h1v1h-1zM15 11h1v1h-1zM16 11h1v1h-1zM17 11h1v1h-1zM18 11h1v1h-1zM19 11h1v1h-1zM10 12h1v1h-1zM11 12h1v1h-1zM15 12h1v1h-1zM16 12h1v1h-1zM10 13h1v1h-1zM11 13h1v1h-1zM10 14h1v1h-1zM11 14h1v1h-1zM13 14h1v1h-1zM14 14h1v1h-1zM15 14h1v1h-1zM16 14h1v1h-1zM17 14h1v1h-1zM18 14h1v1h-1zM19 14h1v1h-1zM11 15h1v1h-1zM12 15h1v1h-1zM13 15h1v1h-1zM14 15h1v1h-1zM17 15h1v1h-1zM18 15h1v1h-1zM12 14h1v1h-1zM19 13h1v1h-1zM19 12h1v1h-1z"/><path fill="#77511E" d="M9 12h1v1H9zM9 13h1v1H9z"/><path fill="#000" d="M18 12h1v1h-1zM18 13h1v1h-1z"/><path fill="#fff" d="M17 13h1v1h-1zM17 12h1v1h-1z"/><path fill="#000" d="M13 12h1v1h-1z"/><path fill="#fff" d="M12 12h1v1h-1zM12 13h1v1h-1z"/><path fill="#000" d="M13 13h1v1h-1z"/><path fill="#77511E" d="M15 13h1v1h-1zM14 13h1v1h-1zM16 13h1v1h-1z"/>'; /* // OLD WAY // todo: maybe a getSVG and a getFullSVG method? function getSVG(IPeterStorage.StoredPeter memory storedPeter) public pure returns (string memory svg, string memory traitAsString) { RandomCtx memory rndCtx = Random.initCtx(storedPeter.tokenId); string memory typeName = RenderHelper.randomBody(rndCtx); // returns Shirt 001 etc traitAsString = RenderHelper.stringTrait('Body', typeName); svg = renderBodyFromName(typeName); } */ function getSVG(IPeterStorage.Peter memory peter) public pure returns (string memory, string memory) { if (peter.bodyIndex == 0) { return (BODY_001, RenderHelper.stringTrait('Body', 'Body 001') ); } if (peter.bodyIndex == 1) { return (BODY_002, RenderHelper.stringTrait('Body', 'Body 002') ); } return (BODY_001, RenderHelper.stringTrait('Body', 'Body 001') ); // return (BODY_003, RenderHelper.stringTrait('Body', 'Body 003') ); } function getGhostSVG() public pure returns (string memory svg) { // TODO: PRNG here for different bodies perhaps svg = string.concat( '<g class="g" style="opacity: 50%;">', BODY_001, '</g>' ); } /* function renderBodyFromName(string memory typeName) internal pure returns (string memory svg) { if (keccak256(abi.encodePacked(typeName)) == keccak256(abi.encodePacked("Body 001"))) { return svg = BODY_001; } return svg = BODY_002; // if (keccak256(abi.encodePacked(typeName)) == keccak256(abi.encodePacked("Body 002"))) { // svg = BODY_002; // } // TODO - BODY_003 } */ }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import { TraitCategory } from '../TraitCategory.sol'; interface ITraitStorage { struct Traits { mapping(uint256 => StoredTrait) all; } struct Trait { StoredTrait stored; } struct StoredTrait { uint256 tokenId; // probs don't need this TraitCategory.Name traitType; // e.g. Shirt // TODO: rename to category string traitName; // e.g. Hoodie Black // string traitPath; // e.g. the svg code minus the top and bottom svg tags | TODO } struct TraitMetadata { string traitName; // e.g. 'Blue Shirt', same as key, redundant for now TraitCategory.Name traitType; // e.g. TraitCategory.Name.Shirt string traitPath; // e.g. the svg code minus the top and bottom svg tags // maybe a property in here for the attributes array values } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; library TraitCategory { // TODO: add bg as a trait? enum Name { Hat, // 0 Hair, // 1 Glasses, // 2 Handheld, // 3 Shirt, // 4 Pants, // 5 Shoes // 6 } function toString(Name name) public pure returns (string memory) { if (name == Name.Hat) return "Hat"; if (name == Name.Hair) return "Hair"; if (name == Name.Glasses) return "Glasses"; if (name == Name.Handheld) return "Handheld"; if (name == Name.Shirt) return "Shirt"; if (name == Name.Pants) return "Pants"; if (name == Name.Shoes) return "Shoes"; return ""; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.4.22 <0.9.0; library console { address constant CONSOLE_ADDRESS = address(0x000000000000000000636F6e736F6c652e6c6f67); function _sendLogPayload(bytes memory payload) private view { uint256 payloadLength = payload.length; address consoleAddress = CONSOLE_ADDRESS; /// @solidity memory-safe-assembly assembly { let payloadStart := add(payload, 32) let r := staticcall(gas(), consoleAddress, payloadStart, payloadLength, 0, 0) } } function log() internal view { _sendLogPayload(abi.encodeWithSignature("log()")); } function logInt(int p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(int)", p0)); } function logUint(uint p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint)", p0)); } function logString(string memory p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(string)", p0)); } function logBool(bool p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool)", p0)); } function logAddress(address p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(address)", p0)); } function logBytes(bytes memory p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes)", p0)); } function logBytes1(bytes1 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes1)", p0)); } function logBytes2(bytes2 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes2)", p0)); } function logBytes3(bytes3 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes3)", p0)); } function logBytes4(bytes4 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes4)", p0)); } function logBytes5(bytes5 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes5)", p0)); } function logBytes6(bytes6 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes6)", p0)); } function logBytes7(bytes7 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes7)", p0)); } function logBytes8(bytes8 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes8)", p0)); } function logBytes9(bytes9 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes9)", p0)); } function logBytes10(bytes10 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes10)", p0)); } function logBytes11(bytes11 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes11)", p0)); } function logBytes12(bytes12 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes12)", p0)); } function logBytes13(bytes13 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes13)", p0)); } function logBytes14(bytes14 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes14)", p0)); } function logBytes15(bytes15 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes15)", p0)); } function logBytes16(bytes16 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes16)", p0)); } function logBytes17(bytes17 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes17)", p0)); } function logBytes18(bytes18 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes18)", p0)); } function logBytes19(bytes19 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes19)", p0)); } function logBytes20(bytes20 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes20)", p0)); } function logBytes21(bytes21 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes21)", p0)); } function logBytes22(bytes22 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes22)", p0)); } function logBytes23(bytes23 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes23)", p0)); } function logBytes24(bytes24 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes24)", p0)); } function logBytes25(bytes25 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes25)", p0)); } function logBytes26(bytes26 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes26)", p0)); } function logBytes27(bytes27 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes27)", p0)); } function logBytes28(bytes28 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes28)", p0)); } function logBytes29(bytes29 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes29)", p0)); } function logBytes30(bytes30 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes30)", p0)); } function logBytes31(bytes31 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes31)", p0)); } function logBytes32(bytes32 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes32)", p0)); } function log(uint p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint)", p0)); } function log(string memory p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(string)", p0)); } function log(bool p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool)", p0)); } function log(address p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(address)", p0)); } function log(uint p0, uint p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint)", p0, p1)); } function log(uint p0, string memory p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string)", p0, p1)); } function log(uint p0, bool p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool)", p0, p1)); } function log(uint p0, address p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address)", p0, p1)); } function log(string memory p0, uint p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint)", p0, p1)); } function log(string memory p0, string memory p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string)", p0, p1)); } function log(string memory p0, bool p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool)", p0, p1)); } function log(string memory p0, address p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address)", p0, p1)); } function log(bool p0, uint p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint)", p0, p1)); } function log(bool p0, string memory p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string)", p0, p1)); } function log(bool p0, bool p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool)", p0, p1)); } function log(bool p0, address p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address)", p0, p1)); } function log(address p0, uint p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint)", p0, p1)); } function log(address p0, string memory p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string)", p0, p1)); } function log(address p0, bool p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool)", p0, p1)); } function log(address p0, address p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address)", p0, p1)); } function log(uint p0, uint p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint)", p0, p1, p2)); } function log(uint p0, uint p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,string)", p0, p1, p2)); } function log(uint p0, uint p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool)", p0, p1, p2)); } function log(uint p0, uint p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,address)", p0, p1, p2)); } function log(uint p0, string memory p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,uint)", p0, p1, p2)); } function log(uint p0, string memory p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,string)", p0, p1, p2)); } function log(uint p0, string memory p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,bool)", p0, p1, p2)); } function log(uint p0, string memory p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,address)", p0, p1, p2)); } function log(uint p0, bool p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint)", p0, p1, p2)); } function log(uint p0, bool p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,string)", p0, p1, p2)); } function log(uint p0, bool p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool)", p0, p1, p2)); } function log(uint p0, bool p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,address)", p0, p1, p2)); } function log(uint p0, address p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,uint)", p0, p1, p2)); } function log(uint p0, address p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,string)", p0, p1, p2)); } function log(uint p0, address p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,bool)", p0, p1, p2)); } function log(uint p0, address p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,address)", p0, p1, p2)); } function log(string memory p0, uint p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,uint)", p0, p1, p2)); } function log(string memory p0, uint p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,string)", p0, p1, p2)); } function log(string memory p0, uint p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,bool)", p0, p1, p2)); } function log(string memory p0, uint p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,address)", p0, p1, p2)); } function log(string memory p0, string memory p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,uint)", p0, p1, p2)); } function log(string memory p0, string memory p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,string)", p0, p1, p2)); } function log(string memory p0, string memory p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,bool)", p0, p1, p2)); } function log(string memory p0, string memory p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,address)", p0, p1, p2)); } function log(string memory p0, bool p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint)", p0, p1, p2)); } function log(string memory p0, bool p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,string)", p0, p1, p2)); } function log(string memory p0, bool p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool)", p0, p1, p2)); } function log(string memory p0, bool p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,address)", p0, p1, p2)); } function log(string memory p0, address p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,uint)", p0, p1, p2)); } function log(string memory p0, address p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,string)", p0, p1, p2)); } function log(string memory p0, address p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,bool)", p0, p1, p2)); } function log(string memory p0, address p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,address)", p0, p1, p2)); } function log(bool p0, uint p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint)", p0, p1, p2)); } function log(bool p0, uint p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,string)", p0, p1, p2)); } function log(bool p0, uint p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool)", p0, p1, p2)); } function log(bool p0, uint p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,address)", p0, p1, p2)); } function log(bool p0, string memory p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint)", p0, p1, p2)); } function log(bool p0, string memory p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,string)", p0, p1, p2)); } function log(bool p0, string memory p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool)", p0, p1, p2)); } function log(bool p0, string memory p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,address)", p0, p1, p2)); } function log(bool p0, bool p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint)", p0, p1, p2)); } function log(bool p0, bool p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string)", p0, p1, p2)); } function log(bool p0, bool p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool)", p0, p1, p2)); } function log(bool p0, bool p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address)", p0, p1, p2)); } function log(bool p0, address p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint)", p0, p1, p2)); } function log(bool p0, address p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,string)", p0, p1, p2)); } function log(bool p0, address p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool)", p0, p1, p2)); } function log(bool p0, address p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,address)", p0, p1, p2)); } function log(address p0, uint p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,uint)", p0, p1, p2)); } function log(address p0, uint p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,string)", p0, p1, p2)); } function log(address p0, uint p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,bool)", p0, p1, p2)); } function log(address p0, uint p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,address)", p0, p1, p2)); } function log(address p0, string memory p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,uint)", p0, p1, p2)); } function log(address p0, string memory p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,string)", p0, p1, p2)); } function log(address p0, string memory p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,bool)", p0, p1, p2)); } function log(address p0, string memory p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,address)", p0, p1, p2)); } function log(address p0, bool p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint)", p0, p1, p2)); } function log(address p0, bool p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,string)", p0, p1, p2)); } function log(address p0, bool p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool)", p0, p1, p2)); } function log(address p0, bool p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,address)", p0, p1, p2)); } function log(address p0, address p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,uint)", p0, p1, p2)); } function log(address p0, address p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,string)", p0, p1, p2)); } function log(address p0, address p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,bool)", p0, p1, p2)); } function log(address p0, address p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,address)", p0, p1, p2)); } function log(uint p0, uint p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint,uint)", p0, p1, p2, p3)); } function log(uint p0, uint p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint,string)", p0, p1, p2, p3)); } function log(uint p0, uint p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint,bool)", p0, p1, p2, p3)); } function log(uint p0, uint p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint,address)", p0, p1, p2, p3)); } function log(uint p0, uint p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,string,uint)", p0, p1, p2, p3)); } function log(uint p0, uint p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,string,string)", p0, p1, p2, p3)); } function log(uint p0, uint p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,string,bool)", p0, p1, p2, p3)); } function log(uint p0, uint p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,string,address)", p0, p1, p2, p3)); } function log(uint p0, uint p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool,uint)", p0, p1, p2, p3)); } function log(uint p0, uint p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool,string)", p0, p1, p2, p3)); } function log(uint p0, uint p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool,bool)", p0, p1, p2, p3)); } function log(uint p0, uint p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool,address)", p0, p1, p2, p3)); } function log(uint p0, uint p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,address,uint)", p0, p1, p2, p3)); } function log(uint p0, uint p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,address,string)", p0, p1, p2, p3)); } function log(uint p0, uint p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,address,bool)", p0, p1, p2, p3)); } function log(uint p0, uint p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,address,address)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,uint,uint)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,uint,string)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,uint,bool)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,uint,address)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,string,uint)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,string,string)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,string,bool)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,string,address)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,bool,uint)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,bool,string)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,bool,bool)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,bool,address)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,address,uint)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,address,string)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,address,bool)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,address,address)", p0, p1, p2, p3)); } function log(uint p0, bool p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint,uint)", p0, p1, p2, p3)); } function log(uint p0, bool p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint,string)", p0, p1, p2, p3)); } function log(uint p0, bool p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint,bool)", p0, p1, p2, p3)); } function log(uint p0, bool p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint,address)", p0, p1, p2, p3)); } function log(uint p0, bool p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,string,uint)", p0, p1, p2, p3)); } function log(uint p0, bool p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,string,string)", p0, p1, p2, p3)); } function log(uint p0, bool p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,string,bool)", p0, p1, p2, p3)); } function log(uint p0, bool p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,string,address)", p0, p1, p2, p3)); } function log(uint p0, bool p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool,uint)", p0, p1, p2, p3)); } function log(uint p0, bool p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool,string)", p0, p1, p2, p3)); } function log(uint p0, bool p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool,bool)", p0, p1, p2, p3)); } function log(uint p0, bool p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool,address)", p0, p1, p2, p3)); } function log(uint p0, bool p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,address,uint)", p0, p1, p2, p3)); } function log(uint p0, bool p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,address,string)", p0, p1, p2, p3)); } function log(uint p0, bool p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,address,bool)", p0, p1, p2, p3)); } function log(uint p0, bool p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,address,address)", p0, p1, p2, p3)); } function log(uint p0, address p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,uint,uint)", p0, p1, p2, p3)); } function log(uint p0, address p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,uint,string)", p0, p1, p2, p3)); } function log(uint p0, address p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,uint,bool)", p0, p1, p2, p3)); } function log(uint p0, address p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,uint,address)", p0, p1, p2, p3)); } function log(uint p0, address p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,string,uint)", p0, p1, p2, p3)); } function log(uint p0, address p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,string,string)", p0, p1, p2, p3)); } function log(uint p0, address p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,string,bool)", p0, p1, p2, p3)); } function log(uint p0, address p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,string,address)", p0, p1, p2, p3)); } function log(uint p0, address p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,bool,uint)", p0, p1, p2, p3)); } function log(uint p0, address p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,bool,string)", p0, p1, p2, p3)); } function log(uint p0, address p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,bool,bool)", p0, p1, p2, p3)); } function log(uint p0, address p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,bool,address)", p0, p1, p2, p3)); } function log(uint p0, address p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,address,uint)", p0, p1, p2, p3)); } function log(uint p0, address p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,address,string)", p0, p1, p2, p3)); } function log(uint p0, address p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,address,bool)", p0, p1, p2, p3)); } function log(uint p0, address p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,address,address)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,uint,uint)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,uint,string)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,uint,bool)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,uint,address)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,string,uint)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,string,string)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,string,bool)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,string,address)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,bool,uint)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,bool,string)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,bool,bool)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,bool,address)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,address,uint)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,address,string)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,address,bool)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,address,address)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,uint,uint)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,uint,string)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,uint,bool)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,uint,address)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,string,uint)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,string,string)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,string,bool)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,string,address)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,uint)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,string)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,bool)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,address)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,address,uint)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,address,string)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,address,bool)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,address,address)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint,uint)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint,string)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint,bool)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint,address)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,uint)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,string)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,bool)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,address)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,uint)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,string)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,bool)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,address)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,uint)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,string)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,bool)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,address)", p0, p1, p2, p3)); } function log(string memory p0, address p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,uint,uint)", p0, p1, p2, p3)); } function log(string memory p0, address p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,uint,string)", p0, p1, p2, p3)); } function log(string memory p0, address p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,uint,bool)", p0, p1, p2, p3)); } function log(string memory p0, address p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,uint,address)", p0, p1, p2, p3)); } function log(string memory p0, address p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,string,uint)", p0, p1, p2, p3)); } function log(string memory p0, address p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,string,string)", p0, p1, p2, p3)); } function log(string memory p0, address p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,string,bool)", p0, p1, p2, p3)); } function log(string memory p0, address p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,string,address)", p0, p1, p2, p3)); } function log(string memory p0, address p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,uint)", p0, p1, p2, p3)); } function log(string memory p0, address p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,string)", p0, p1, p2, p3)); } function log(string memory p0, address p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,bool)", p0, p1, p2, p3)); } function log(string memory p0, address p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,address)", p0, p1, p2, p3)); } function log(string memory p0, address p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,address,uint)", p0, p1, p2, p3)); } function log(string memory p0, address p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,address,string)", p0, p1, p2, p3)); } function log(string memory p0, address p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,address,bool)", p0, p1, p2, p3)); } function log(string memory p0, address p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,address,address)", p0, p1, p2, p3)); } function log(bool p0, uint p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint,uint)", p0, p1, p2, p3)); } function log(bool p0, uint p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint,string)", p0, p1, p2, p3)); } function log(bool p0, uint p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint,bool)", p0, p1, p2, p3)); } function log(bool p0, uint p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint,address)", p0, p1, p2, p3)); } function log(bool p0, uint p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,string,uint)", p0, p1, p2, p3)); } function log(bool p0, uint p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,string,string)", p0, p1, p2, p3)); } function log(bool p0, uint p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,string,bool)", p0, p1, p2, p3)); } function log(bool p0, uint p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,string,address)", p0, p1, p2, p3)); } function log(bool p0, uint p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool,uint)", p0, p1, p2, p3)); } function log(bool p0, uint p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool,string)", p0, p1, p2, p3)); } function log(bool p0, uint p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool,bool)", p0, p1, p2, p3)); } function log(bool p0, uint p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool,address)", p0, p1, p2, p3)); } function log(bool p0, uint p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,address,uint)", p0, p1, p2, p3)); } function log(bool p0, uint p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,address,string)", p0, p1, p2, p3)); } function log(bool p0, uint p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,address,bool)", p0, p1, p2, p3)); } function log(bool p0, uint p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,address,address)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint,uint)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint,string)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint,bool)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint,address)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,uint)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,string)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,bool)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,address)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,uint)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,string)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,bool)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,address)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,uint)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,string)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,bool)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,address)", p0, p1, p2, p3)); } function log(bool p0, bool p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint,uint)", p0, p1, p2, p3)); } function log(bool p0, bool p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint,string)", p0, p1, p2, p3)); } function log(bool p0, bool p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint,bool)", p0, p1, p2, p3)); } function log(bool p0, bool p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint,address)", p0, p1, p2, p3)); } function log(bool p0, bool p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,uint)", p0, p1, p2, p3)); } function log(bool p0, bool p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,string)", p0, p1, p2, p3)); } function log(bool p0, bool p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,bool)", p0, p1, p2, p3)); } function log(bool p0, bool p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,address)", p0, p1, p2, p3)); } function log(bool p0, bool p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,uint)", p0, p1, p2, p3)); } function log(bool p0, bool p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,string)", p0, p1, p2, p3)); } function log(bool p0, bool p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,bool)", p0, p1, p2, p3)); } function log(bool p0, bool p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,address)", p0, p1, p2, p3)); } function log(bool p0, bool p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,uint)", p0, p1, p2, p3)); } function log(bool p0, bool p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,string)", p0, p1, p2, p3)); } function log(bool p0, bool p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,bool)", p0, p1, p2, p3)); } function log(bool p0, bool p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,address)", p0, p1, p2, p3)); } function log(bool p0, address p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint,uint)", p0, p1, p2, p3)); } function log(bool p0, address p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint,string)", p0, p1, p2, p3)); } function log(bool p0, address p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint,bool)", p0, p1, p2, p3)); } function log(bool p0, address p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint,address)", p0, p1, p2, p3)); } function log(bool p0, address p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,uint)", p0, p1, p2, p3)); } function log(bool p0, address p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,string)", p0, p1, p2, p3)); } function log(bool p0, address p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,bool)", p0, p1, p2, p3)); } function log(bool p0, address p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,address)", p0, p1, p2, p3)); } function log(bool p0, address p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,uint)", p0, p1, p2, p3)); } function log(bool p0, address p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,string)", p0, p1, p2, p3)); } function log(bool p0, address p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,bool)", p0, p1, p2, p3)); } function log(bool p0, address p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,address)", p0, p1, p2, p3)); } function log(bool p0, address p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,uint)", p0, p1, p2, p3)); } function log(bool p0, address p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,string)", p0, p1, p2, p3)); } function log(bool p0, address p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,bool)", p0, p1, p2, p3)); } function log(bool p0, address p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,address)", p0, p1, p2, p3)); } function log(address p0, uint p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,uint,uint)", p0, p1, p2, p3)); } function log(address p0, uint p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,uint,string)", p0, p1, p2, p3)); } function log(address p0, uint p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,uint,bool)", p0, p1, p2, p3)); } function log(address p0, uint p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,uint,address)", p0, p1, p2, p3)); } function log(address p0, uint p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,string,uint)", p0, p1, p2, p3)); } function log(address p0, uint p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,string,string)", p0, p1, p2, p3)); } function log(address p0, uint p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,string,bool)", p0, p1, p2, p3)); } function log(address p0, uint p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,string,address)", p0, p1, p2, p3)); } function log(address p0, uint p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,bool,uint)", p0, p1, p2, p3)); } function log(address p0, uint p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,bool,string)", p0, p1, p2, p3)); } function log(address p0, uint p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,bool,bool)", p0, p1, p2, p3)); } function log(address p0, uint p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,bool,address)", p0, p1, p2, p3)); } function log(address p0, uint p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,address,uint)", p0, p1, p2, p3)); } function log(address p0, uint p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,address,string)", p0, p1, p2, p3)); } function log(address p0, uint p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,address,bool)", p0, p1, p2, p3)); } function log(address p0, uint p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,address,address)", p0, p1, p2, p3)); } function log(address p0, string memory p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,uint,uint)", p0, p1, p2, p3)); } function log(address p0, string memory p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,uint,string)", p0, p1, p2, p3)); } function log(address p0, string memory p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,uint,bool)", p0, p1, p2, p3)); } function log(address p0, string memory p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,uint,address)", p0, p1, p2, p3)); } function log(address p0, string memory p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,string,uint)", p0, p1, p2, p3)); } function log(address p0, string memory p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,string,string)", p0, p1, p2, p3)); } function log(address p0, string memory p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,string,bool)", p0, p1, p2, p3)); } function log(address p0, string memory p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,string,address)", p0, p1, p2, p3)); } function log(address p0, string memory p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,uint)", p0, p1, p2, p3)); } function log(address p0, string memory p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,string)", p0, p1, p2, p3)); } function log(address p0, string memory p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,bool)", p0, p1, p2, p3)); } function log(address p0, string memory p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,address)", p0, p1, p2, p3)); } function log(address p0, string memory p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,address,uint)", p0, p1, p2, p3)); } function log(address p0, string memory p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,address,string)", p0, p1, p2, p3)); } function log(address p0, string memory p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,address,bool)", p0, p1, p2, p3)); } function log(address p0, string memory p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,address,address)", p0, p1, p2, p3)); } function log(address p0, bool p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint,uint)", p0, p1, p2, p3)); } function log(address p0, bool p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint,string)", p0, p1, p2, p3)); } function log(address p0, bool p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint,bool)", p0, p1, p2, p3)); } function log(address p0, bool p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint,address)", p0, p1, p2, p3)); } function log(address p0, bool p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,uint)", p0, p1, p2, p3)); } function log(address p0, bool p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,string)", p0, p1, p2, p3)); } function log(address p0, bool p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,bool)", p0, p1, p2, p3)); } function log(address p0, bool p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,address)", p0, p1, p2, p3)); } function log(address p0, bool p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,uint)", p0, p1, p2, p3)); } function log(address p0, bool p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,string)", p0, p1, p2, p3)); } function log(address p0, bool p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,bool)", p0, p1, p2, p3)); } function log(address p0, bool p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,address)", p0, p1, p2, p3)); } function log(address p0, bool p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,uint)", p0, p1, p2, p3)); } function log(address p0, bool p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,string)", p0, p1, p2, p3)); } function log(address p0, bool p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,bool)", p0, p1, p2, p3)); } function log(address p0, bool p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,address)", p0, p1, p2, p3)); } function log(address p0, address p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,uint,uint)", p0, p1, p2, p3)); } function log(address p0, address p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,uint,string)", p0, p1, p2, p3)); } function log(address p0, address p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,uint,bool)", p0, p1, p2, p3)); } function log(address p0, address p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,uint,address)", p0, p1, p2, p3)); } function log(address p0, address p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,string,uint)", p0, p1, p2, p3)); } function log(address p0, address p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,string,string)", p0, p1, p2, p3)); } function log(address p0, address p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,string,bool)", p0, p1, p2, p3)); } function log(address p0, address p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,string,address)", p0, p1, p2, p3)); } function log(address p0, address p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,uint)", p0, p1, p2, p3)); } function log(address p0, address p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,string)", p0, p1, p2, p3)); } function log(address p0, address p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,bool)", p0, p1, p2, p3)); } function log(address p0, address p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,address)", p0, p1, p2, p3)); } function log(address p0, address p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,address,uint)", p0, p1, p2, p3)); } function log(address p0, address p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,address,string)", p0, p1, p2, p3)); } function log(address p0, address p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,address,bool)", p0, p1, p2, p3)); } function log(address p0, address p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,address,address)", p0, p1, p2, p3)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - 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 tokenId, bytes calldata data ) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}. * - 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 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Enumerable is IERC721 { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256); /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import "./Division.sol"; import "./RandomCtx.sol"; library Random { function initCtx(uint256 startingSeed) internal pure returns (RandomCtx memory) { // some 10 digit prime numbers // 1024243321, 1024383257, 1028910301, 1111111231, 1111211111 // 1317313771, 1500000001, 2999999929, 3333323333, 4332221111 // 5111111191, 6668999101, 7000000001, 8018018081, 9199999999 return RandomCtx(startingSeed, 5111111191 * startingSeed); } function setSeed(RandomCtx memory ctx, uint256 startingSeed) internal pure { ctx.seed = startingSeed; } // function setSeedFromConract(RandomCtx memory ctx, uint256 startingSeed) internal view { // ctx.seed = uint256(keccak256( // abi.encode( // startingSeed, // blockhash(block.number - 1), // block.coinbase, // block.prevrandao, // block.timestamp // ) // )); // } function randInt(RandomCtx memory ctx) internal pure returns (uint256) { ctx.counter++; ctx.seed = uint256(keccak256( abi.encode( ctx.seed, ctx.counter ) )); return ctx.seed; } function randUInt32(RandomCtx memory ctx) internal pure returns (uint32) { return uint32(int32(randRange(ctx, 0, 2147483647))); // positive only to accomodate SEED in SVG } function randFloat(RandomCtx memory ctx, uint8 decimalPlaces, int256 from, int256 to, int256 denominator) internal pure returns (string memory result) { int256 rInt = randRange(ctx, from, to); result = Division.divisionStr(decimalPlaces, rInt, denominator); } function randWithProbabilities(RandomCtx memory ctx, bytes memory probabilities) internal pure returns (uint8) { unchecked { uint256 probSum = 0; for (uint8 i = 0; i < probabilities.length; i++) { probSum += uint256(uint8(probabilities[i])); } int256 rnd = Random.randRange(ctx, 1, int256(probSum)); probSum = 0; for (uint8 i = 0; i < probabilities.length; i++) { probSum += uint256(uint8(probabilities[i])); if (int256(probSum) >= rnd) { return i; } } return 0; }} function randRange(RandomCtx memory ctx, int256 from, int256 to) internal pure returns (int256) { unchecked { if (from > to) { to = from; } uint256 rnd = randInt(ctx); return from + int256(rnd >> 1) % (to - from + 1); }} /** * * @param ctx - context * @param minusProbability - 0 to 100 percents */ function randSign(RandomCtx memory ctx, int256 minusProbability) internal pure returns (int256) { if (randRange(ctx, 1, 100) <= minusProbability) { return -1; } return 1; } /** * * @param ctx - context * @param trueProbability - 0 to 100 percents */ function randBool(RandomCtx memory ctx, int256 trueProbability) internal pure returns (bool) { return (randRange(ctx, 1, 100) <= trueProbability); } function randWithProbabilities(RandomCtx memory ctx, uint16[] memory probabilities) internal pure returns (uint8) { unchecked { uint probSum = 0; for (uint8 i = 0; i < probabilities.length; i++) { probSum += uint(probabilities[i]); } int rnd = Random.randRange(ctx, 1, int(probSum)); probSum = 0; for (uint8 i = 0; i < probabilities.length; i++) { probSum += uint(probabilities[i]); if (int(probSum) >= rnd) { return i; } } return 0; }} function probabilityArray(uint16 a0, uint16 a1) internal pure returns (uint16[] memory) { uint16[] memory result = new uint16[](2); result[0] = a0; result[1] = a1; return result; } function probabilityArray(uint16 a0, uint16 a1, uint16 a2) internal pure returns (uint16[] memory) { uint16[] memory result = new uint16[](3); result[0] = a0; result[1] = a1; result[2] = a2; return result; } function probabilityArray(uint16 a0, uint16 a1, uint16 a2, uint16 a3) internal pure returns (uint16[] memory) { uint16[] memory result = new uint16[](4); result[0] = a0; result[1] = a1; result[2] = a2; result[3] = a3; return result; } function probabilityArray(uint16 a0, uint16 a1, uint16 a2, uint16 a3, uint16 a4) internal pure returns (uint16[] memory) { uint16[] memory result = new uint16[](5); result[0] = a0; result[1] = a1; result[2] = a2; result[3] = a3; result[4] = a4; return result; } function probabilityArray(uint16 a0, uint16 a1, uint16 a2, uint16 a3, uint16 a4, uint16 a5) internal pure returns (uint16[] memory) { uint16[] memory result = new uint16[](6); result[0] = a0; result[1] = a1; result[2] = a2; result[3] = a3; result[4] = a4; result[5] = a5; return result; } function probabilityArray(uint16 a0, uint16 a1, uint16 a2, uint16 a3, uint16 a4, uint16 a5, uint16 a6) internal pure returns (uint16[] memory) { uint16[] memory result = new uint16[](7); result[0] = a0; result[1] = a1; result[2] = a2; result[3] = a3; result[4] = a4; result[5] = a5; result[6] = a6; return result; } function probabilityArray(uint16 a0, uint16 a1, uint16 a2, uint16 a3, uint16 a4, uint16 a5, uint16 a6, uint16 a7) internal pure returns (uint16[] memory) { uint16[] memory result = new uint16[](8); result[0] = a0; result[1] = a1; result[2] = a2; result[3] = a3; result[4] = a4; result[5] = a5; result[6] = a6; result[7] = a7; return result; } function probabilityArray(uint16 a0, uint16 a1, uint16 a2, uint16 a3, uint16 a4, uint16 a5, uint16 a6, uint16 a7, uint16 a8) internal pure returns (uint16[] memory) { uint16[] memory result = new uint16[](9); result[0] = a0; result[1] = a1; result[2] = a2; result[3] = a3; result[4] = a4; result[5] = a5; result[6] = a6; result[7] = a7; result[8] = a8; return result; } function probabilityArray(uint16 a0, uint16 a1, uint16 a2, uint16 a3, uint16 a4, uint16 a5, uint16 a6, uint16 a7, uint16 a8, uint16 a9) internal pure returns (uint16[] memory) { uint16[] memory result = new uint16[](10); result[0] = a0; result[1] = a1; result[2] = a2; result[3] = a3; result[4] = a4; result[5] = a5; result[6] = a6; result[7] = a7; result[8] = a8; result[9] = a9; return result; } function probabilityArray(uint16 a0, uint16 a1, uint16 a2, uint16 a3, uint16 a4, uint16 a5, uint16 a6, uint16 a7, uint16 a8, uint16 a9, uint16 a10) internal pure returns (uint16[] memory) { uint16[] memory result = new uint16[](11); result[0] = a0; result[1] = a1; result[2] = a2; result[3] = a3; result[4] = a4; result[5] = a5; result[6] = a6; result[7] = a7; result[8] = a8; result[9] = a9; result[10] = a10; return result; } function probabilityArray(uint16 a0, uint16 a1, uint16 a2, uint16 a3, uint16 a4, uint16 a5, uint16 a6, uint16 a7, uint16 a8, uint16 a9, uint16 a10, uint16 a11, uint16 a12) internal pure returns (uint16[] memory) { uint16[] memory result = new uint16[](13); result[0] = a0; result[1] = a1; result[2] = a2; result[3] = a3; result[4] = a4; result[5] = a5; result[6] = a6; result[7] = a7; result[8] = a8; result[9] = a9; result[10] = a10; result[11] = a11; result[12] = a12; return result; } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; /// A shared interface for data storage of the Peter interface IPeterStorage { // The token id in the traits contract of each corresponding trait to be layered on the Peter from the PeterTraits contract struct StoredPeter { uint256 tokenId; // uint256 hatId; // uint256 hairId; // uint256 glassesId; // uint256 handheldId; uint256 shirtId; uint256 pantsId; // uint256 shoesId; uint32 epoch; uint16 seed; } // An individual Peter struct Peter { StoredPeter stored; bool isRevealed; uint256 seed; uint8 bodyIndex; } // copy pasta from the legendary Checks contract by jalil + mouseDev struct Epoch { uint128 randomness; // The source of randomness for tokens from this epoch uint64 revealBlock; // The block at which this epoch was / is revealed bool committed; // Whether the epoch has been instantiated bool revealed; // Whether the epoch has been revealed } // Token id => Peter struct Peters { mapping(uint256 => StoredPeter) all; mapping(uint256 => Epoch) epochs; // All epochs uint256 epoch; // The current epoch index } event NewEpoch( uint256 indexed epoch, uint64 indexed revealBlock ); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import "./Utils.sol"; library Division { using Utils for int256; function division(uint8 decimalPlaces, int256 numerator, int256 denominator) pure internal returns(int256 quotient, int256 remainder, string memory result) { unchecked { int256 factor = int256(10**decimalPlaces); quotient = numerator / denominator; bool rounding = 2 * ((numerator * factor) % denominator) >= denominator; remainder = (numerator * factor / denominator) % factor; if (rounding) { remainder += 1; } result = string(abi.encodePacked(quotient.toString(), '.', numToFixedLengthStr(decimalPlaces, remainder))); }} function divisionStr(uint8 decimalPlaces, int256 numerator, int256 denominator) pure internal returns(string memory) { string memory result; (,,result) = division(decimalPlaces, numerator, denominator); return result; } function numToFixedLengthStr(uint256 decimalPlaces, int256 num) pure internal returns(string memory result) { unchecked { bytes memory byteString; for (uint256 i = 0; i < decimalPlaces; i++) { int256 remainder = num % 10; byteString = abi.encodePacked(remainder.toString(), byteString); num = num/10; } result = string(byteString); }} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; struct RandomCtx { uint256 seed; uint256 counter; }
{ "remappings": [ "ds-test/=lib/forge-std/lib/ds-test/src/", "forge-std/=lib/forge-std/src/", "@openzeppelin/=lib/openzeppelin-contracts/", "openzeppelin-contracts/=lib/openzeppelin-contracts/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs" }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "london", "libraries": { "src/TraitCategory.sol": { "TraitCategory": "0x7b4edb34e407e9cbc5371e8e6df4309b474dd516" } } }
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"MsgSenderNotMinter","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","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":"previousOwner","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":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"string","name":"_traitName","type":"string"},{"internalType":"enum TraitCategory.Name","name":"_traitType","type":"uint8"},{"internalType":"string","name":"_traitPath","type":"string"}],"name":"addNewTrait","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"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":"bodyRenderer","outputs":[{"internalType":"contract BodyRenderer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getTraitType","outputs":[{"internalType":"enum TraitCategory.Name","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minter","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":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"renderAsDataUri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"safeMint","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","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":"tokenId","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":[],"name":"signer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","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":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenIdToMetadata","outputs":[{"internalType":"string","name":"traitName","type":"string"},{"internalType":"enum TraitCategory.Name","name":"traitType","type":"uint8"},{"internalType":"string","name":"traitPath","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenIdToMetadataString","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","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":"string","name":"","type":"string"}],"name":"traitNameToMetadata","outputs":[{"internalType":"string","name":"traitName","type":"string"},{"internalType":"enum TraitCategory.Name","name":"traitType","type":"uint8"},{"internalType":"string","name":"traitPath","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"traitsRenderer","outputs":[{"internalType":"contract TraitsRenderer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"walletOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60806040523480156200001157600080fd5b506040518060400160405280600b81526020016a506574657254726169747360a81b81525060405180604001604052806003815260200162282a2960e91b81525081600090816200006391906200047a565b5060016200007282826200047a565b5050506200008f62000089620002f060201b60201c565b620002f4565b6040516200009d90620003ba565b604051809103906000f080158015620000ba573d6000803e3d6000fd5b50600f80546001600160a01b0319166001600160a01b0392909216919091179055604051620000e990620003c7565b604051809103906000f08015801562000106573d6000803e3d6000fd5b50600b60006101000a8154816001600160a01b0302191690836001600160a01b031602179055506200017b6040518060400160405280600c81526020016b486f6f64696520426c61636b60a01b8152506004604051806104a00160405280610480815260200162004777610480913962000346565b620001c76040518060400160405280600a815260200169121bdbd91a594814995960b21b8152506004604051806104c001604052806104898152602001620058a1610489913962000346565b620002156040518060400160405280600c81526020016b426c7565205374726970657360a01b8152506004604051806107400160405280610709815260200162005198610709913962000346565b6200025b60405180604001604052806004815260200163426c756560e01b815250600560405180610360016040528061033f815260200162004bf761033f913962000346565b620002a360405180604001604052806006815260200165507572706c6560d01b81525060056040518061032001604052806102fe815260200162005d2a6102fe913962000346565b620002ea6040518060400160405280600581526020016423b932b2b760d91b8152506005604051806102a00160405280610262815260200162004f36610262913962000346565b6200058d565b3390565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60006014846040516200035a919062000546565b9081526040519081900360200190209050806200037885826200047a565b5060018082018054859260ff19909116908360068111156200039e576200039e62000577565b021790555060028101620003b383826200047a565b5050505050565b605c8062002fb083390190565b61176b806200300c83390190565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200040057607f821691505b6020821081036200042157634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200047557600081815260208120601f850160051c81016020861015620004505750805b601f850160051c820191505b8181101562000471578281556001016200045c565b5050505b505050565b81516001600160401b03811115620004965762000496620003d5565b620004ae81620004a78454620003eb565b8462000427565b602080601f831160018114620004e65760008415620004cd5750858301515b600019600386901b1c1916600185901b17855562000471565b600085815260208120601f198616915b828110156200051757888601518255948401946001909101908401620004f6565b5085821015620005365787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000825160005b818110156200056957602081860181015185830152016200054d565b506000920191825250919050565b634e487b7160e01b600052602160045260246000fd5b612a13806200059d6000396000f3fe608060405234801561001057600080fd5b50600436106101e55760003560e01c806370a082311161010f578063b88d4fde116100a2578063e8a1268d11610071578063e8a1268d1461041f578063e985e9c514610452578063ef5e23971461048e578063f2fde38b146104a157600080fd5b8063b88d4fde146103c4578063bbe6c23f146103d7578063bf64db1d146103ea578063c87b56dd1461040c57600080fd5b806393d3bae5116100de57806393d3bae51461038357806395d89b4114610396578063a1d626801461039e578063a22cb465146103b157600080fd5b806370a0823114610344578063715018a6146103575780638da5cb5b1461035f5780638f57b7381461037057600080fd5b8063238ac9331161018757806342842e0e1161015657806342842e0e146102f8578063438b63001461030b5780634f6ccce71461031e5780636352211e1461033157600080fd5b8063238ac9331461029f57806323b872dd146102b25780632f745c59146102c557806340d097c3146102d857600080fd5b8063081812fc116101c3578063081812fc14610252578063095ea7b31461026557806318160ddd1461027a57806319f4a9861461028c57600080fd5b806301ffc9a7146101ea57806306fdde03146102125780630754617214610227575b600080fd5b6101fd6101f8366004611e7a565b6104b4565b60405190151581526020015b60405180910390f35b61021a6104c5565b6040516102099190611eee565b600d5461023a906001600160a01b031681565b6040516001600160a01b039091168152602001610209565b61023a610260366004611f01565b610557565b610278610273366004611f36565b61057e565b005b6008545b604051908152602001610209565b61021a61029a366004611f01565b610698565b600e5461023a906001600160a01b031681565b6102786102c0366004611f60565b610732565b61027e6102d3366004611f36565b610763565b6102eb6102e6366004611f9c565b6107f9565b6040516102099190611fb7565b610278610306366004611f60565b610a36565b6102eb610319366004611f9c565b610a51565b61027e61032c366004611f01565b610af1565b61023a61033f366004611f01565b610b84565b61027e610352366004611f9c565b610be4565b610278610c6a565b600a546001600160a01b031661023a565b600b5461023a906001600160a01b031681565b600f5461023a906001600160a01b031681565b61021a610c7e565b61021a6103ac366004611f01565b610c8d565b6102786103bf366004611ffb565b611017565b6102786103d23660046120e4565b611026565b6102786103e5366004612180565b61105e565b6103fd6103f8366004611f01565b6110c9565b60405161020993929190612234565b61021a61041a366004611f01565b611204565b61044561042d366004611f01565b6000908152600c602052604090206001015460ff1690565b6040516102099190612270565b6101fd61046036600461227e565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b6103fd61049c3660046122b1565b61120f565b6102786104af366004611f9c565b611235565b60006104bf826112ae565b92915050565b6060600080546104d4906122e6565b80601f0160208091040260200160405190810160405280929190818152602001828054610500906122e6565b801561054d5780601f106105225761010080835404028352916020019161054d565b820191906000526020600020905b81548152906001019060200180831161053057829003601f168201915b5050505050905090565b6000610562826112d3565b506000908152600460205260409020546001600160a01b031690565b600061058982610b84565b9050806001600160a01b0316836001600160a01b0316036105fb5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b038216148061061757506106178133610460565b6106895760405162461bcd60e51b815260206004820152603e60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c000060648201526084016105f2565b6106938383611332565b505050565b601360205260009081526040902080546106b1906122e6565b80601f01602080910402602001604051908101604052809291908181526020018280546106dd906122e6565b801561072a5780601f106106ff5761010080835404028352916020019161072a565b820191906000526020600020905b81548152906001019060200180831161070d57829003601f168201915b505050505081565b61073c33826113a0565b6107585760405162461bcd60e51b81526004016105f290612320565b61069383838361141f565b600061076e83610be4565b82106107d05760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b60648201526084016105f2565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b6040805160028082526060808301845292600092919060208301908036833701905050905060005b6002811015610a2f57600061083560085490565b610840906001612384565b905061084c85826115c6565b8083838151811061085f5761085f612397565b6020026020010181815250508160000361095357806001036108c5576040518060400160405280600c81526020016b486f6f64696520426c61636b60a01b8152506013600083815260200190815260200160002090816108bf91906123fb565b50610a1c565b8060030361090f576040518060400160405280600a815260200169121bdbd91a594814995960b21b8152506013600083815260200190815260200160002090816108bf91906123fb565b6040518060400160405280600c81526020016b426c7565205374726970657360a01b8152506013600083815260200190815260200160002090816108bf91906123fb565b806002036109975760405180604001604052806004815260200163426c756560e01b8152506013600083815260200190815260200160002090816108bf91906123fb565b806004036109dd5760405180604001604052806006815260200165507572706c6560d01b8152506013600083815260200190815260200160002090816108bf91906123fb565b6040518060400160405280600581526020016423b932b2b760d91b815250601360008381526020019081526020016000209081610a1a91906123fb565b505b5080610a27816124bb565b915050610821565b5092915050565b61069383838360405180602001604052806000815250611026565b60606000610a5e83610be4565b905060008167ffffffffffffffff811115610a7b57610a7b612037565b604051908082528060200260200182016040528015610aa4578160200160208202803683370190505b50905060005b82811015610ae957610abc8582610763565b828281518110610ace57610ace612397565b6020908102919091010152610ae2816124bb565b9050610aaa565b509392505050565b6000610afc60085490565b8210610b5f5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b60648201526084016105f2565b60088281548110610b7257610b72612397565b90600052602060002001549050919050565b6000818152600260205260408120546001600160a01b0316806104bf5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016105f2565b60006001600160a01b038216610c4e5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b60648201526084016105f2565b506001600160a01b031660009081526003602052604090205490565b610c726115e0565b610c7c600061163a565b565b6060600180546104d4906122e6565b6060806060806000600b60009054906101000a90046001600160a01b03166001600160a01b0316635db2edce6040518163ffffffff1660e01b8152600401600060405180830381865afa158015610ce8573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610d1091908101906124d4565b60008781526013602052604080822090519293509091601491610d329161254b565b9081526020016040518091039020604051806060016040529081600082018054610d5b906122e6565b80601f0160208091040260200160405190810160405280929190818152602001828054610d87906122e6565b8015610dd45780601f10610da957610100808354040283529160200191610dd4565b820191906000526020600020905b815481529060010190602001808311610db757829003601f168201915b5050509183525050600182015460209091019060ff166006811115610dfb57610dfb6121fc565b6006811115610e0c57610e0c6121fc565b8152602001600282018054610e20906122e6565b80601f0160208091040260200160405190810160405280929190818152602001828054610e4c906122e6565b8015610e995780601f10610e6e57610100808354040283529160200191610e99565b820191906000526020600020905b815481529060010190602001808311610e7c57829003601f168201915b5050505050815250509050806040015193506000816020015190506000737b4edb34e407e9cbc5371e8e6df4309b474dd51663037d07a2836040518263ffffffff1660e01b8152600401610eed9190612270565b600060405180830381865af4158015610f0a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610f3291908101906124d4565b9050610f4281846000015161168c565b945060405180610100016040528060d2815260200161290c60d291398487604051602001610f72939291906125c1565b60405160208183030381529060405296506000610f8e886116e4565b604051602001610f9e9190612615565b60405160208183030381529060405290506000610fba8b6116f2565b8783604051602001610fce93929190612671565b6040516020818303038152906040529050610fe8816116e4565b604051602001610ff8919061272c565b6040516020818303038152906040529950505050505050505050919050565b611022338383611736565b5050565b61103033836113a0565b61104c5760405162461bcd60e51b81526004016105f290612320565b61105884848484611804565b50505050565b60006014846040516110709190612771565b90815260405190819003602001902090508061108c85826123fb565b5060018082018054859260ff19909116908360068111156110af576110af6121fc565b0217905550600281016110c283826123fb565b5050505050565b6012602052600090815260409020805481906110e4906122e6565b80601f0160208091040260200160405190810160405280929190818152602001828054611110906122e6565b801561115d5780601f106111325761010080835404028352916020019161115d565b820191906000526020600020905b81548152906001019060200180831161114057829003601f168201915b5050506001840154600285018054949560ff909216949193509150611181906122e6565b80601f01602080910402602001604051908101604052809291908181526020018280546111ad906122e6565b80156111fa5780601f106111cf576101008083540402835291602001916111fa565b820191906000526020600020905b8154815290600101906020018083116111dd57829003601f168201915b5050505050905083565b60606104bf82610c8d565b80516020818301810180516014825292820191909301209152805481906110e4906122e6565b61123d6115e0565b6001600160a01b0381166112a25760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f2565b6112ab8161163a565b50565b60006001600160e01b0319821663780e9d6360e01b14806104bf57506104bf82611837565b6000818152600260205260409020546001600160a01b03166112ab5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016105f2565b600081815260046020526040902080546001600160a01b0319166001600160a01b038416908117909155819061136782610b84565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000806113ac83610b84565b9050806001600160a01b0316846001600160a01b031614806113f357506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b806114175750836001600160a01b031661140c84610557565b6001600160a01b0316145b949350505050565b826001600160a01b031661143282610b84565b6001600160a01b0316146114965760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b60648201526084016105f2565b6001600160a01b0382166114f85760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016105f2565b611503838383611887565b61150e600082611332565b6001600160a01b038316600090815260036020526040812080546001929061153790849061278d565b90915550506001600160a01b0382166000908152600360205260408120805460019290611565908490612384565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b61102282826040518060200160405280600081525061193f565b600a546001600160a01b03163314610c7c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105f2565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6060600061169a8484611972565b6040516020016116aa9190612771565b6040516020818303038152906040529050806040516020016116cc91906127a0565b60405160208183030381529060405291505092915050565b60606104bf8260008061199e565b60606080604051019050602081016040526000815280600019835b928101926030600a8206018453600a90048061170d575050819003601f19909101908152919050565b816001600160a01b0316836001600160a01b0316036117975760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016105f2565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b61180f84848461141f565b61181b84848484611a85565b6110585760405162461bcd60e51b81526004016105f2906127e2565b60006001600160e01b031982166380ac58cd60e01b148061186857506001600160e01b03198216635b5e139f60e01b145b806104bf57506301ffc9a760e01b6001600160e01b03198316146104bf565b6001600160a01b0383166118e2576118dd81600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b611905565b816001600160a01b0316836001600160a01b031614611905576119058382611b86565b6001600160a01b03821661191c5761069381611c23565b826001600160a01b0316826001600160a01b031614610693576106938282611cd2565b6119498383611d16565b6119566000848484611a85565b6106935760405162461bcd60e51b81526004016105f2906127e2565b60608282604051602001611987929190612834565b604051602081830303815290604052905092915050565b606083518015610ae9576003600282010460021b60405192507f4142434445464748494a4b4c4d4e4f505152535455565758595a616263646566601f526106708515027f6768696a6b6c6d6e6f707172737475767778797a303132333435363738392d5f18603f52602083018181015b6003880197508751603f8160121c1651600053603f81600c1c1651600153603f8160061c1651600253603f811651600353506000518252600482019150808210611a0e57602001604052613d3d60f01b60038406600204808303919091526000861515909102918290035290038252509392505050565b60006001600160a01b0384163b15611b7b57604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290611ac99033908990889088906004016128a5565b6020604051808303816000875af1925050508015611b04575060408051601f3d908101601f19168201909252611b01918101906128d8565b60015b611b61573d808015611b32576040519150601f19603f3d011682016040523d82523d6000602084013e611b37565b606091505b508051600003611b595760405162461bcd60e51b81526004016105f2906127e2565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611417565b506001949350505050565b60006001611b9384610be4565b611b9d919061278d565b600083815260076020526040902054909150808214611bf0576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b600854600090611c359060019061278d565b60008381526009602052604081205460088054939450909284908110611c5d57611c5d612397565b906000526020600020015490508060088381548110611c7e57611c7e612397565b6000918252602080832090910192909255828152600990915260408082208490558582528120556008805480611cb657611cb66128f5565b6001900381819060005260206000200160009055905550505050565b6000611cdd83610be4565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b6001600160a01b038216611d6c5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016105f2565b6000818152600260205260409020546001600160a01b031615611dd15760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016105f2565b611ddd60008383611887565b6001600160a01b0382166000908152600360205260408120805460019290611e06908490612384565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6001600160e01b0319811681146112ab57600080fd5b600060208284031215611e8c57600080fd5b8135611e9781611e64565b9392505050565b60005b83811015611eb9578181015183820152602001611ea1565b50506000910152565b60008151808452611eda816020860160208601611e9e565b601f01601f19169290920160200192915050565b602081526000611e976020830184611ec2565b600060208284031215611f1357600080fd5b5035919050565b80356001600160a01b0381168114611f3157600080fd5b919050565b60008060408385031215611f4957600080fd5b611f5283611f1a565b946020939093013593505050565b600080600060608486031215611f7557600080fd5b611f7e84611f1a565b9250611f8c60208501611f1a565b9150604084013590509250925092565b600060208284031215611fae57600080fd5b611e9782611f1a565b6020808252825182820181905260009190848201906040850190845b81811015611fef57835183529284019291840191600101611fd3565b50909695505050505050565b6000806040838503121561200e57600080fd5b61201783611f1a565b91506020830135801515811461202c57600080fd5b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561207657612076612037565b604052919050565b600067ffffffffffffffff82111561209857612098612037565b50601f01601f191660200190565b60006120b96120b48461207e565b61204d565b90508281528383830111156120cd57600080fd5b828260208301376000602084830101529392505050565b600080600080608085870312156120fa57600080fd5b61210385611f1a565b935061211160208601611f1a565b925060408501359150606085013567ffffffffffffffff81111561213457600080fd5b8501601f8101871361214557600080fd5b612154878235602084016120a6565b91505092959194509250565b600082601f83011261217157600080fd5b611e97838335602085016120a6565b60008060006060848603121561219557600080fd5b833567ffffffffffffffff808211156121ad57600080fd5b6121b987838801612160565b945060208601359150600782106121cf57600080fd5b909250604085013590808211156121e557600080fd5b506121f286828701612160565b9150509250925092565b634e487b7160e01b600052602160045260246000fd5b6007811061223057634e487b7160e01b600052602160045260246000fd5b9052565b6060815260006122476060830186611ec2565b6122546020840186612212565b82810360408401526122668185611ec2565b9695505050505050565b602081016104bf8284612212565b6000806040838503121561229157600080fd5b61229a83611f1a565b91506122a860208401611f1a565b90509250929050565b6000602082840312156122c357600080fd5b813567ffffffffffffffff8111156122da57600080fd5b61141784828501612160565b600181811c908216806122fa57607f821691505b60208210810361231a57634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252602e908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526d1c881b9bdc88185c1c1c9bdd995960921b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b808201808211156104bf576104bf61236e565b634e487b7160e01b600052603260045260246000fd5b601f82111561069357600081815260208120601f850160051c810160208610156123d45750805b601f850160051c820191505b818110156123f3578281556001016123e0565b505050505050565b815167ffffffffffffffff81111561241557612415612037565b6124298161242384546122e6565b846123ad565b602080601f83116001811461245e57600084156124465750858301515b600019600386901b1c1916600185901b1785556123f3565b600085815260208120601f198616915b8281101561248d5788860151825594840194600190910190840161246e565b50858210156124ab5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000600182016124cd576124cd61236e565b5060010190565b6000602082840312156124e657600080fd5b815167ffffffffffffffff8111156124fd57600080fd5b8201601f8101841361250e57600080fd5b805161251c6120b48261207e565b81815285602083850101111561253157600080fd5b612542826020830160208601611e9e565b95945050505050565b6000808354612559816122e6565b600182811680156125715760018114612586576125b5565b60ff19841687528215158302870194506125b5565b8760005260208060002060005b858110156125ac5781548a820152908401908201612593565b50505082870194505b50929695505050505050565b600084516125d3818460208901611e9e565b8451908301906125e7818360208901611e9e565b84519101906125fa818360208801611e9e565b651e17b9bb339f60d11b910190815260060195945050505050565b7f22696d616765223a22646174613a696d6167652f7376672b786d6c3b626173658152620d8d0b60ea1b602082015260008251612659816023850160208701611e9e565b601160f91b6023939091019283015250602401919050565b757b226e616d65223a225065746572205472616974202360501b815283516000906126a3816016850160208901611e9e565b7f222c226465736372697074696f6e223a2254686973206973206a757374206120601691840191820152651d195cdd088b60d21b603682015284516126ef81603c840160208901611e9e565b600b60fa1b603c9290910191820152835161271181603d840160208801611e9e565b607d60f81b603d9290910191820152603e0195945050505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c00000081526000825161276481601d850160208701611e9e565b91909101601d0192915050565b60008251612783818460208701611e9e565b9190910192915050565b818103818111156104bf576104bf61236e565b6d2261747472696275746573223a5b60901b815281516000906127ca81600e850160208701611e9e565b605d60f81b600e939091019283015250600f01919050565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6e3d913a3930b4ba2fba3cb832911d1160891b8152825160009061285f81600f850160208801611e9e565b6a1116113b30b63ab2911d1160a91b600f91840191820152835161288a81601a840160208801611e9e565b61227d60f01b601a9290910191820152601c01949350505050565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061226690830184611ec2565b6000602082840312156128ea57600080fd5b8151611e9781611e64565b634e487b7160e01b600052603160045260246000fdfe3c7376672073686170652d72656e646572696e673d2263726973704564676573222076696577426f783d22302030203330203330222066696c6c3d226e6f6e652220786d6c6e733d22687474703a2f2f7777772e77332e6f72672f323030302f737667223e3c7374796c653e726563747b77696474683a3170783b206865696768743a203170783b7d202e62677b77696474683a333070783b206865696768743a20333070783b7d203c2f7374796c653e3c7265637420636c6173733d226267222066696c6c3d2223304436453944222f3ea264697066735822122080d328ac9e32be24cff425922dcf4b130089d86ff403f487497e221ea4b5a14564736f6c634300081100336080604052348015600f57600080fd5b50603f80601d6000396000f3fe6080604052600080fdfea2646970667358221220e874cbccd2559fe46b063480b3c3bc0ccf4f5a44323e7e564c648c4ac007741c64736f6c63430008110033608060405234801561001057600080fd5b5061174b806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80635db2edce1461003b578063dbaea22914610059575b600080fd5b61004361007a565b6040516100509190610284565b60405180910390f35b61006c61006736600461032c565b6100bc565b6040516100509291906103e5565b60606040518061094001604052806109198152602001610dfd61091991396040516020016100a89190610413565b604051602081830303815290604052905090565b606080826060015160ff16600003610139576040518061094001604052806109198152602001610dfd610919913961013060405180604001604052806004815260200163426f647960e01b81525060405180604001604052806008815260200167426f64792030303160c01b815250610208565b91509150915091565b826060015160ff166001036101aa5760405180610940016040528061091981526020016104e4610919913961013060405180604001604052806004815260200163426f647960e01b815250604051806040016040528060088152602001672137b23c9018181960c11b815250610208565b6040518061094001604052806109198152602001610dfd610919913961013060405180604001604052806004815260200163426f647960e01b81525060405180604001604052806008815260200167426f64792030303160c01b8152505b6060828260405160200161021d929190610472565b604051602081830303815290604052905092915050565b60005b8381101561024f578181015183820152602001610237565b50506000910152565b60008151808452610270816020860160208601610234565b601f01601f19169290920160200192915050565b6020815260006102976020830184610258565b9392505050565b6040516080810167ffffffffffffffff811182821017156102cf57634e487b7160e01b600052604160045260246000fd5b60405290565b60405160a0810167ffffffffffffffff811182821017156102cf57634e487b7160e01b600052604160045260246000fd5b8035801515811461031657600080fd5b919050565b803560ff8116811461031657600080fd5b600081830361010081121561034057600080fd5b61034861029e565b60a082121561035657600080fd5b61035e6102d5565b9150833582526020840135602083015260408401356040830152606084013563ffffffff8116811461038f57600080fd5b6060830152608084013561ffff811681146103a957600080fd5b60808301528181526103bd60a08501610306565b602082015260c084013560408201526103d860e0850161031b565b6060820152949350505050565b6040815260006103f86040830185610258565b828103602084015261040a8185610258565b95945050505050565b7f3c6720636c6173733d226722207374796c653d226f7061636974793a203530258152621d911f60e91b602082015260008251610457816023850160208701610234565b631e17b39f60e11b6023939091019283015250602701919050565b6e3d913a3930b4ba2fba3cb832911d1160891b8152825160009061049d81600f850160208801610234565b6a1116113b30b63ab2911d1160a91b600f9184019182015283516104c881601a840160208801610234565b61227d60f01b601a9290910191820152601c0194935050505056fe3c706174682066696c6c3d22234241383133362220643d224d313120323368317631682d317a4d313220323368317631682d317a4d313620323368317631682d317a4d313720323368317631682d317a4d313120323168317631682d317a4d313220323168317631682d317a4d313320323168317631682d317a4d313420323168317631682d317a4d313520323168317631682d317a4d313620323168317631682d317a4d313720323168317631682d317a4d313120323268317631682d317a4d313220323268317631682d317a4d313320323268317631682d317a4d313520323268317631682d317a4d313620323268317631682d317a4d313720323268317631682d317a4d313120313768317631682d317a4d313220313768317631682d317a4d313320313768317631682d317a4d313420313768317631682d317a4d313520313768317631682d317a4d313620313768317631682d317a4d313720313768317631682d317a4d313120313868317631682d317a222f3e3c706174682066696c6c3d22233941364432452220643d224d313220313868317631682d317a222f3e3c706174682066696c6c3d22234241383133362220643d224d313420313868317631682d317a4d313520313868317631682d317a222f3e3c706174682066696c6c3d22233941364432452220643d224d313620313868317631682d317a222f3e3c706174682066696c6c3d22234241383133362220643d224d313120313968317631682d317a4d313120323068317631682d317a4d313220323068317631682d317a4d313320323068317631682d317a4d313420323068317631682d317a4d313520323068317631682d317a4d313620323068317631682d317a4d313720323068317631682d317a4d313220313968317631682d317a4d313320313968317631682d317a4d313420313968317631682d317a4d313520313968317631682d317a4d313620313968317631682d317a4d313720313968317631682d317a4d313820313768317631682d317a4d313820313868317631682d317a4d313920313868317631682d317a222f3e3c706174682066696c6c3d22233941364432452220643d224d313820313968317631682d317a4d313820323068317631682d317a222f3e3c706174682066696c6c3d22234241383133362220643d224d313920313968317631682d317a4d313920323068317631682d317a4d313020313768317631682d317a4d392031386831763148397a4d392031396831763148397a4d392032306831763148397a222f3e3c706174682066696c6c3d22233941364432452220643d224d313020313968317631682d317a4d313020323068317631682d317a222f3e3c706174682066696c6c3d22234241383133362220643d224d313020313868317631682d317a4d313320313868317631682d317a4d313720313868317631682d317a222f3e3c706174682066696c6c3d22233941364432452220643d224d313120313668317631682d317a4d313220313668317631682d317a4d313320313668317631682d317a4d313420313668317631682d317a4d313520313668317631682d317a4d313620313668317631682d317a4d313720313668317631682d317a222f3e3c706174682066696c6c3d22234241383133362220643d224d313520313568317631682d317a4d313620313568317631682d317a4d3131203968317631682d317a4d313420313268317631682d317a4d3132203968317631682d317a4d3133203968317631682d317a4d3134203968317631682d317a4d3135203968317631682d317a4d3136203968317631682d317a4d3137203968317631682d317a4d3138203968317631682d317a4d313020313068317631682d317a4d313120313068317631682d317a4d313220313068317631682d317a4d313320313068317631682d317a4d313420313068317631682d317a4d313520313068317631682d317a4d313620313068317631682d317a4d313720313068317631682d317a4d313820313068317631682d317a4d313920313068317631682d317a4d313020313168317631682d317a4d313120313168317631682d317a4d313220313168317631682d317a4d313320313168317631682d317a4d313420313168317631682d317a4d313520313168317631682d317a4d313620313168317631682d317a4d313720313168317631682d317a4d313820313168317631682d317a4d313920313168317631682d317a4d313020313268317631682d317a4d313120313268317631682d317a4d313520313268317631682d317a4d313620313268317631682d317a4d313020313368317631682d317a4d313120313368317631682d317a4d313020313468317631682d317a4d313120313468317631682d317a4d313320313468317631682d317a4d313420313468317631682d317a4d313520313468317631682d317a4d313620313468317631682d317a4d313720313468317631682d317a4d313820313468317631682d317a4d313920313468317631682d317a4d313120313568317631682d317a4d313220313568317631682d317a4d313320313568317631682d317a4d313420313568317631682d317a4d313720313568317631682d317a4d313820313568317631682d317a4d313220313468317631682d317a4d313920313368317631682d317a4d313920313268317631682d317a222f3e3c706174682066696c6c3d22233941364432452220643d224d392031326831763148397a4d392031336831763148397a222f3e3c706174682066696c6c3d22233030302220643d224d313820313268317631682d317a4d313820313368317631682d317a222f3e3c706174682066696c6c3d22236666662220643d224d313720313368317631682d317a4d313720313268317631682d317a222f3e3c706174682066696c6c3d22233030302220643d224d313320313268317631682d317a222f3e3c706174682066696c6c3d22236666662220643d224d313220313268317631682d317a4d313220313368317631682d317a222f3e3c706174682066696c6c3d22233030302220643d224d313320313368317631682d317a222f3e3c706174682066696c6c3d22233941364432452220643d224d313520313368317631682d317a4d313420313368317631682d317a4d313620313368317631682d317a222f3e3c706174682066696c6c3d22234546423135452220643d224d313120323368317631682d317a4d313220323368317631682d317a4d313620323368317631682d317a4d313720323368317631682d317a4d313120323168317631682d317a4d313220323168317631682d317a4d313320323168317631682d317a4d313420323168317631682d317a4d313520323168317631682d317a4d313620323168317631682d317a4d313720323168317631682d317a4d313120323268317631682d317a4d313220323268317631682d317a4d313320323268317631682d317a4d313520323268317631682d317a4d313620323268317631682d317a4d313720323268317631682d317a4d313120313768317631682d317a4d313220313768317631682d317a4d313320313768317631682d317a4d313420313768317631682d317a4d313520313768317631682d317a4d313620313768317631682d317a4d313720313768317631682d317a4d313120313868317631682d317a222f3e3c706174682066696c6c3d22234436393734332220643d224d313220313868317631682d317a222f3e3c706174682066696c6c3d22234546423135452220643d224d313420313868317631682d317a4d313520313868317631682d317a222f3e3c706174682066696c6c3d22234436393734332220643d224d313620313868317631682d317a222f3e3c706174682066696c6c3d22234546423135452220643d224d313120313968317631682d317a4d313120323068317631682d317a4d313220323068317631682d317a4d313320323068317631682d317a4d313420323068317631682d317a4d313520323068317631682d317a4d313620323068317631682d317a4d313720323068317631682d317a4d313220313968317631682d317a4d313320313968317631682d317a4d313420313968317631682d317a4d313520313968317631682d317a4d313620313968317631682d317a4d313720313968317631682d317a4d313820313768317631682d317a4d313820313868317631682d317a4d313920313868317631682d317a222f3e3c706174682066696c6c3d22234436393734332220643d224d313820313968317631682d317a4d313820323068317631682d317a222f3e3c706174682066696c6c3d22234546423135452220643d224d313920313968317631682d317a4d313920323068317631682d317a4d313020313768317631682d317a4d392031386831763148397a4d392031396831763148397a4d392032306831763148397a222f3e3c706174682066696c6c3d22234436393734332220643d224d313020313968317631682d317a4d313020323068317631682d317a222f3e3c706174682066696c6c3d22234546423135452220643d224d313020313868317631682d317a4d313320313868317631682d317a4d313720313868317631682d317a222f3e3c706174682066696c6c3d22234436393734332220643d224d313120313668317631682d317a4d313220313668317631682d317a4d313320313668317631682d317a4d313420313668317631682d317a4d313520313668317631682d317a4d313620313668317631682d317a4d313720313668317631682d317a222f3e3c706174682066696c6c3d22234546423135452220643d224d313520313568317631682d317a4d313620313568317631682d317a4d3131203968317631682d317a4d313420313268317631682d317a4d3132203968317631682d317a4d3133203968317631682d317a4d3134203968317631682d317a4d3135203968317631682d317a4d3136203968317631682d317a4d3137203968317631682d317a4d3138203968317631682d317a4d313020313068317631682d317a4d313120313068317631682d317a4d313220313068317631682d317a4d313320313068317631682d317a4d313420313068317631682d317a4d313520313068317631682d317a4d313620313068317631682d317a4d313720313068317631682d317a4d313820313068317631682d317a4d313920313068317631682d317a4d313020313168317631682d317a4d313120313168317631682d317a4d313220313168317631682d317a4d313320313168317631682d317a4d313420313168317631682d317a4d313520313168317631682d317a4d313620313168317631682d317a4d313720313168317631682d317a4d313820313168317631682d317a4d313920313168317631682d317a4d313020313268317631682d317a4d313120313268317631682d317a4d313520313268317631682d317a4d313620313268317631682d317a4d313020313368317631682d317a4d313120313368317631682d317a4d313020313468317631682d317a4d313120313468317631682d317a4d313320313468317631682d317a4d313420313468317631682d317a4d313520313468317631682d317a4d313620313468317631682d317a4d313720313468317631682d317a4d313820313468317631682d317a4d313920313468317631682d317a4d313120313568317631682d317a4d313220313568317631682d317a4d313320313568317631682d317a4d313420313568317631682d317a4d313720313568317631682d317a4d313820313568317631682d317a4d313220313468317631682d317a4d313920313368317631682d317a4d313920313268317631682d317a222f3e3c706174682066696c6c3d22234436393734332220643d224d392031326831763148397a4d392031336831763148397a222f3e3c706174682066696c6c3d22233030302220643d224d313820313268317631682d317a4d313820313368317631682d317a222f3e3c706174682066696c6c3d22236666662220643d224d313720313368317631682d317a4d313720313268317631682d317a222f3e3c706174682066696c6c3d22233030302220643d224d313320313268317631682d317a222f3e3c706174682066696c6c3d22236666662220643d224d313220313268317631682d317a4d313220313368317631682d317a222f3e3c706174682066696c6c3d22233030302220643d224d313320313368317631682d317a222f3e3c706174682066696c6c3d22234436393734332220643d224d313520313368317631682d317a4d313420313368317631682d317a4d313620313368317631682d317a222f3ea2646970667358221220030fb2d2c87c389d57ab6efe77cad0236dfa08fbaf58363efaa2dccf279e4dfb64736f6c634300081100333c706174682066696c6c3d22233030302220643d224d3130203968317631682d317a4d3131203968317631682d317a4d3132203968317631682d317a4d3133203968317631682d317a4d3134203968317631682d317a4d3135203968317631682d317a4d3136203968317631682d317a4d3137203968317631682d317a4d3138203968317631682d317a4d3139203968317631682d317a4d392031306831763148397a4d313020313068317631682d317a4d313120313068317631682d317a4d313920313068317631682d317a4d323020313068317631682d317a4d392031316831763148397a4d313020313168317631682d317a4d323020313168317631682d317a4d392031326831763148397a4d313020313268317631682d317a4d323020313268317631682d317a4d392031336831763148397a4d313020313368317631682d317a4d323020313368317631682d317a4d392031346831763148397a4d313020313468317631682d317a4d323020313468317631682d317a4d313020313568317631682d317a4d313120313568317631682d317a4d313920313568317631682d317a4d323020313568317631682d317a4d313120313668317631682d317a4d313220313668317631682d317a4d313320313668317631682d317a4d313720313668317631682d317a4d313820313668317631682d317a4d313920313668317631682d317a4d313020313768317631682d317a4d313120313768317631682d317a4d313220313768317631682d317a222f3e3c706174682066696c6c3d22234543454445442220643d224d313320313768317631682d317a222f3e3c706174682066696c6c3d22233030302220643d224d313420313768317631682d317a4d313520313768317631682d317a4d313620313768317631682d317a222f3e3c706174682066696c6c3d22234543454445442220643d224d313720313768317631682d317a222f3e3c706174682066696c6c3d22233030302220643d224d313820313768317631682d317a4d392031386831763148397a4d392031396831763148397a4d313820313968317631682d317a4d313020313868317631682d317a4d313020313968317631682d317a4d313920313968317631682d317a4d313120313868317631682d317a4d313220313868317631682d317a4d313320313868317631682d317a4d313420313868317631682d317a4d313520313868317631682d317a4d313620313868317631682d317a4d313720313868317631682d317a4d313820313868317631682d317a4d313920313868317631682d317a4d313120313968317631682d317a4d313120323068317631682d317a4d313220323068317631682d317a4d313320323068317631682d317a4d313420323068317631682d317a4d313520323068317631682d317a4d313620323068317631682d317a4d313720323068317631682d317a4d313220313968317631682d317a4d313320313968317631682d317a4d313420313968317631682d317a4d313520313968317631682d317a4d313620313968317631682d317a4d313720313968317631682d317a222f3e3c7265637420783d2231312220793d223231222077696474683d223122206865696768743d2231222066696c6c3d2223303033384342223e3c2f726563743e203c7265637420783d2231322220793d223231222077696474683d223122206865696768743d2231222066696c6c3d2223303133464530223e3c2f726563743e203c7265637420783d2231332220793d223231222077696474683d223122206865696768743d2231222066696c6c3d2223303133464530223e3c2f726563743e203c7265637420783d2231342220793d223231222077696474683d223122206865696768743d2231222066696c6c3d2223303033384342223e3c2f726563743e203c7265637420783d2231352220793d223231222077696474683d223122206865696768743d2231222066696c6c3d2223303133464530223e3c2f726563743e203c7265637420783d2231362220793d223231222077696474683d223122206865696768743d2231222066696c6c3d2223303133464530223e3c2f726563743e203c7265637420783d2231372220793d223231222077696474683d223122206865696768743d2231222066696c6c3d2223303033384342223e3c2f726563743e203c7265637420783d2231312220793d223232222077696474683d223122206865696768743d2231222066696c6c3d2223303133464530223e3c2f726563743e203c7265637420783d2231322220793d223232222077696474683d223122206865696768743d2231222066696c6c3d2223303133464530223e3c2f726563743e203c7265637420783d2231332220793d223232222077696474683d223122206865696768743d2231222066696c6c3d2223303133464530223e3c2f726563743e203c7265637420783d2231352220793d223232222077696474683d223122206865696768743d2231222066696c6c3d2223303133464530223e3c2f726563743e203c7265637420783d2231362220793d223232222077696474683d223122206865696768743d2231222066696c6c3d2223303133464530223e3c2f726563743e203c7265637420783d2231372220793d223232222077696474683d223122206865696768743d2231222066696c6c3d2223303133464530223e3c2f726563743e3c7061746820643d224d31322032314831315632324831325632315a222066696c6c3d2223313138393037222f3e203c7061746820643d224d31332032314831325632324831335632315a222066696c6c3d2223314241303046222f3e203c7061746820643d224d31342032314831335632324831345632315a222066696c6c3d2223314241303046222f3e203c7061746820643d224d31352032314831345632324831355632315a222066696c6c3d2223313138393037222f3e203c7061746820643d224d31362032314831355632324831365632315a222066696c6c3d2223314241303046222f3e203c7061746820643d224d31372032314831365632324831375632315a222066696c6c3d2223314241303046222f3e203c7061746820643d224d31382032314831375632324831385632315a222066696c6c3d2223313138393037222f3e203c7061746820643d224d31322032324831315632334831325632325a222066696c6c3d2223314241303046222f3e203c7061746820643d224d31332032324831325632334831335632325a222066696c6c3d2223314241303046222f3e203c7061746820643d224d31342032324831335632334831345632325a222066696c6c3d2223314241303046222f3e203c7061746820643d224d31362032324831355632334831365632325a222066696c6c3d2223314241303046222f3e203c7061746820643d224d31372032324831365632334831375632325a222066696c6c3d2223314241303046222f3e203c7061746820643d224d31382032324831375632334831385632325a222066696c6c3d2223314241303046222f3e3c7265637420783d2231312220793d22313622202066696c6c3d2223314132303939223e3c2f726563743e203c7265637420783d2231322220793d22313622202066696c6c3d2223314132303939223e3c2f726563743e203c7265637420783d2231372220793d22313622202066696c6c3d2223314132303939223e3c2f726563743e203c7265637420783d2231302220793d22313722202066696c6c3d2223314132303939223e3c2f726563743e203c7265637420783d2231312220793d22313722202066696c6c3d2223314132303939223e3c2f726563743e203c7265637420783d2231322220793d22313722202066696c6c3d2223314132303939223e3c2f726563743e203c7265637420783d2231332220793d22313722202066696c6c3d2223314132303939223e3c2f726563743e203c7265637420783d2231342220793d22313722202066696c6c3d2223463146364638223e3c2f726563743e203c7265637420783d2231352220793d22313722202066696c6c3d2223463146364638223e3c2f726563743e203c7265637420783d2231362220793d22313722202066696c6c3d2223463146364638223e3c2f726563743e203c7265637420783d2231372220793d22313722202066696c6c3d2223314132303939223e3c2f726563743e203c7265637420783d2231382220793d22313722202066696c6c3d2223314132303939223e3c2f726563743e203c7265637420783d22392220793d22313822202066696c6c3d2223314132303939223e3c2f726563743e203c7265637420783d2231302220793d22313822202066696c6c3d2223314132303939223e3c2f726563743e203c7265637420783d2231312220793d22313822202066696c6c3d2223314132303939223e3c2f726563743e203c7265637420783d2231322220793d22313822202066696c6c3d2223314132303939223e3c2f726563743e203c7265637420783d2231332220793d22313822202066696c6c3d2223314132303939223e3c2f726563743e203c7265637420783d2231342220793d22313822202066696c6c3d2223463146364638223e3c2f726563743e203c7265637420783d2231352220793d22313822202066696c6c3d2223463146364638223e3c2f726563743e203c7265637420783d2231362220793d22313822202066696c6c3d2223453745364535223e3c2f726563743e203c7265637420783d2231372220793d22313822202066696c6c3d2223314132303939223e3c2f726563743e203c7265637420783d2231382220793d22313822202066696c6c3d2223314132303939223e3c2f726563743e203c7265637420783d2231392220793d22313822202066696c6c3d2223314132303939223e3c2f726563743e203c7265637420783d22392220793d22313922202066696c6c3d2223314132303939223e3c2f726563743e203c7265637420783d2231302220793d22313922202066696c6c3d2223314132303939223e3c2f726563743e203c7265637420783d2231312220793d22313922202066696c6c3d2223314132303939223e3c2f726563743e203c7265637420783d2231322220793d22313922202066696c6c3d2223314132303939223e3c2f726563743e203c7265637420783d2231332220793d22313922202066696c6c3d2223314132303939223e3c2f726563743e203c7265637420783d2231342220793d22313922202066696c6c3d2223463146364638223e3c2f726563743e203c7265637420783d2231352220793d22313922202066696c6c3d2223463146364638223e3c2f726563743e203c7265637420783d2231362220793d22313922202066696c6c3d2223463146364638223e3c2f726563743e203c7265637420783d2231372220793d22313922202066696c6c3d2223314132303939223e3c2f726563743e203c7265637420783d2231382220793d22313922202066696c6c3d2223314132303939223e3c2f726563743e203c7265637420783d2231392220793d22313922202066696c6c3d2223314132303939223e3c2f726563743e203c7265637420783d2231312220793d22323022202066696c6c3d2223314132303939223e3c2f726563743e203c7265637420783d2231322220793d22323022202066696c6c3d2223314132303939223e3c2f726563743e203c7265637420783d2231332220793d22323022202066696c6c3d2223314132303939223e3c2f726563743e203c7265637420783d2231342220793d22323022202066696c6c3d2223463146364638223e3c2f726563743e203c7265637420783d2231352220793d22323022202066696c6c3d2223463146364638223e3c2f726563743e203c7265637420783d2231362220793d22323022202066696c6c3d2223463146364638223e3c2f726563743e203c7265637420783d2231372220793d22323022202066696c6c3d2223314132303939223e3c2f726563743e3c706174682066696c6c3d22234541303030302220643d224d3130203968317631682d317a4d3131203968317631682d317a4d3132203968317631682d317a4d3133203968317631682d317a4d3134203968317631682d317a4d3135203968317631682d317a4d3136203968317631682d317a4d3137203968317631682d317a4d3138203968317631682d317a4d3139203968317631682d317a4d392031306831763148397a4d313020313068317631682d317a4d313120313068317631682d317a4d313920313068317631682d317a4d323020313068317631682d317a4d392031316831763148397a4d313020313168317631682d317a4d323020313168317631682d317a4d392031326831763148397a4d313020313268317631682d317a4d323020313268317631682d317a4d392031336831763148397a4d313020313368317631682d317a4d323020313368317631682d317a4d392031346831763148397a4d313020313468317631682d317a4d323020313468317631682d317a4d313020313568317631682d317a4d313120313568317631682d317a4d313920313568317631682d317a4d323020313568317631682d317a4d313120313668317631682d317a4d313220313668317631682d317a4d313320313668317631682d317a4d313720313668317631682d317a4d313820313668317631682d317a4d313920313668317631682d317a4d313020313768317631682d317a4d313120313768317631682d317a4d313220313768317631682d317a222f3e3c706174682066696c6c3d22234543454445442220643d224d313320313768317631682d317a222f3e3c706174682066696c6c3d22234541303030302220643d224d313420313768317631682d317a4d313520313768317631682d317a4d313620313768317631682d317a222f3e3c706174682066696c6c3d22234543454445442220643d224d313720313768317631682d317a222f3e3c706174682066696c6c3d22234541303030302220643d224d313820313768317631682d317a4d392031386831763148397a4d392031396831763148397a4d313820313968317631682d317a4d313020313868317631682d317a4d313020313968317631682d317a4d313920313968317631682d317a4d313120313868317631682d317a4d313220313868317631682d317a4d313320313868317631682d317a4d313420313868317631682d317a4d313520313868317631682d317a4d313620313868317631682d317a4d313720313868317631682d317a4d313820313868317631682d317a4d313920313868317631682d317a4d313120313968317631682d317a4d313120323068317631682d317a4d313220323068317631682d317a4d313320323068317631682d317a4d313420323068317631682d317a4d313520323068317631682d317a4d313620323068317631682d317a4d313720323068317631682d317a4d313220313968317631682d317a4d313320313968317631682d317a4d313420313968317631682d317a4d313520313968317631682d317a4d313620313968317631682d317a4d313720313968317631682d317a222f3e3c7265637420783d2231312220793d223231222077696474683d223122206865696768743d2231222066696c6c3d222336433042383122202f3e203c7265637420783d2231322220793d223231222077696474683d223122206865696768743d2231222066696c6c3d222337413044393222202f3e203c7265637420783d2231332220793d223231222077696474683d223122206865696768743d2231222066696c6c3d222337413044393222202f3e203c7265637420783d2231342220793d223231222077696474683d223122206865696768743d2231222066696c6c3d222336433042383122202f3e203c7265637420783d2231352220793d223231222077696474683d223122206865696768743d2231222066696c6c3d222337413044393222202f3e203c7265637420783d2231362220793d223231222077696474683d223122206865696768743d2231222066696c6c3d222337413044393222202f3e203c7265637420783d2231372220793d223231222077696474683d223122206865696768743d2231222066696c6c3d222336433042383122202f3e203c7265637420783d2231312220793d223232222077696474683d223122206865696768743d2231222066696c6c3d222337413044393222202f3e203c7265637420783d2231322220793d223232222077696474683d223122206865696768743d2231222066696c6c3d222337413044393222202f3e203c7265637420783d2231332220793d223232222077696474683d223122206865696768743d2231222066696c6c3d222337413044393222202f3e203c7265637420783d2231352220793d223232222077696474683d223122206865696768743d2231222066696c6c3d222337413044393222202f3e203c7265637420783d2231362220793d223232222077696474683d223122206865696768743d2231222066696c6c3d222337413044393222202f3e203c7265637420783d2231372220793d223232222077696474683d223122206865696768743d2231222066696c6c3d222337413044393222202f3e
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101e55760003560e01c806370a082311161010f578063b88d4fde116100a2578063e8a1268d11610071578063e8a1268d1461041f578063e985e9c514610452578063ef5e23971461048e578063f2fde38b146104a157600080fd5b8063b88d4fde146103c4578063bbe6c23f146103d7578063bf64db1d146103ea578063c87b56dd1461040c57600080fd5b806393d3bae5116100de57806393d3bae51461038357806395d89b4114610396578063a1d626801461039e578063a22cb465146103b157600080fd5b806370a0823114610344578063715018a6146103575780638da5cb5b1461035f5780638f57b7381461037057600080fd5b8063238ac9331161018757806342842e0e1161015657806342842e0e146102f8578063438b63001461030b5780634f6ccce71461031e5780636352211e1461033157600080fd5b8063238ac9331461029f57806323b872dd146102b25780632f745c59146102c557806340d097c3146102d857600080fd5b8063081812fc116101c3578063081812fc14610252578063095ea7b31461026557806318160ddd1461027a57806319f4a9861461028c57600080fd5b806301ffc9a7146101ea57806306fdde03146102125780630754617214610227575b600080fd5b6101fd6101f8366004611e7a565b6104b4565b60405190151581526020015b60405180910390f35b61021a6104c5565b6040516102099190611eee565b600d5461023a906001600160a01b031681565b6040516001600160a01b039091168152602001610209565b61023a610260366004611f01565b610557565b610278610273366004611f36565b61057e565b005b6008545b604051908152602001610209565b61021a61029a366004611f01565b610698565b600e5461023a906001600160a01b031681565b6102786102c0366004611f60565b610732565b61027e6102d3366004611f36565b610763565b6102eb6102e6366004611f9c565b6107f9565b6040516102099190611fb7565b610278610306366004611f60565b610a36565b6102eb610319366004611f9c565b610a51565b61027e61032c366004611f01565b610af1565b61023a61033f366004611f01565b610b84565b61027e610352366004611f9c565b610be4565b610278610c6a565b600a546001600160a01b031661023a565b600b5461023a906001600160a01b031681565b600f5461023a906001600160a01b031681565b61021a610c7e565b61021a6103ac366004611f01565b610c8d565b6102786103bf366004611ffb565b611017565b6102786103d23660046120e4565b611026565b6102786103e5366004612180565b61105e565b6103fd6103f8366004611f01565b6110c9565b60405161020993929190612234565b61021a61041a366004611f01565b611204565b61044561042d366004611f01565b6000908152600c602052604090206001015460ff1690565b6040516102099190612270565b6101fd61046036600461227e565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b6103fd61049c3660046122b1565b61120f565b6102786104af366004611f9c565b611235565b60006104bf826112ae565b92915050565b6060600080546104d4906122e6565b80601f0160208091040260200160405190810160405280929190818152602001828054610500906122e6565b801561054d5780601f106105225761010080835404028352916020019161054d565b820191906000526020600020905b81548152906001019060200180831161053057829003601f168201915b5050505050905090565b6000610562826112d3565b506000908152600460205260409020546001600160a01b031690565b600061058982610b84565b9050806001600160a01b0316836001600160a01b0316036105fb5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b038216148061061757506106178133610460565b6106895760405162461bcd60e51b815260206004820152603e60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c000060648201526084016105f2565b6106938383611332565b505050565b601360205260009081526040902080546106b1906122e6565b80601f01602080910402602001604051908101604052809291908181526020018280546106dd906122e6565b801561072a5780601f106106ff5761010080835404028352916020019161072a565b820191906000526020600020905b81548152906001019060200180831161070d57829003601f168201915b505050505081565b61073c33826113a0565b6107585760405162461bcd60e51b81526004016105f290612320565b61069383838361141f565b600061076e83610be4565b82106107d05760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b60648201526084016105f2565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b6040805160028082526060808301845292600092919060208301908036833701905050905060005b6002811015610a2f57600061083560085490565b610840906001612384565b905061084c85826115c6565b8083838151811061085f5761085f612397565b6020026020010181815250508160000361095357806001036108c5576040518060400160405280600c81526020016b486f6f64696520426c61636b60a01b8152506013600083815260200190815260200160002090816108bf91906123fb565b50610a1c565b8060030361090f576040518060400160405280600a815260200169121bdbd91a594814995960b21b8152506013600083815260200190815260200160002090816108bf91906123fb565b6040518060400160405280600c81526020016b426c7565205374726970657360a01b8152506013600083815260200190815260200160002090816108bf91906123fb565b806002036109975760405180604001604052806004815260200163426c756560e01b8152506013600083815260200190815260200160002090816108bf91906123fb565b806004036109dd5760405180604001604052806006815260200165507572706c6560d01b8152506013600083815260200190815260200160002090816108bf91906123fb565b6040518060400160405280600581526020016423b932b2b760d91b815250601360008381526020019081526020016000209081610a1a91906123fb565b505b5080610a27816124bb565b915050610821565b5092915050565b61069383838360405180602001604052806000815250611026565b60606000610a5e83610be4565b905060008167ffffffffffffffff811115610a7b57610a7b612037565b604051908082528060200260200182016040528015610aa4578160200160208202803683370190505b50905060005b82811015610ae957610abc8582610763565b828281518110610ace57610ace612397565b6020908102919091010152610ae2816124bb565b9050610aaa565b509392505050565b6000610afc60085490565b8210610b5f5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b60648201526084016105f2565b60088281548110610b7257610b72612397565b90600052602060002001549050919050565b6000818152600260205260408120546001600160a01b0316806104bf5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016105f2565b60006001600160a01b038216610c4e5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b60648201526084016105f2565b506001600160a01b031660009081526003602052604090205490565b610c726115e0565b610c7c600061163a565b565b6060600180546104d4906122e6565b6060806060806000600b60009054906101000a90046001600160a01b03166001600160a01b0316635db2edce6040518163ffffffff1660e01b8152600401600060405180830381865afa158015610ce8573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610d1091908101906124d4565b60008781526013602052604080822090519293509091601491610d329161254b565b9081526020016040518091039020604051806060016040529081600082018054610d5b906122e6565b80601f0160208091040260200160405190810160405280929190818152602001828054610d87906122e6565b8015610dd45780601f10610da957610100808354040283529160200191610dd4565b820191906000526020600020905b815481529060010190602001808311610db757829003601f168201915b5050509183525050600182015460209091019060ff166006811115610dfb57610dfb6121fc565b6006811115610e0c57610e0c6121fc565b8152602001600282018054610e20906122e6565b80601f0160208091040260200160405190810160405280929190818152602001828054610e4c906122e6565b8015610e995780601f10610e6e57610100808354040283529160200191610e99565b820191906000526020600020905b815481529060010190602001808311610e7c57829003601f168201915b5050505050815250509050806040015193506000816020015190506000737b4edb34e407e9cbc5371e8e6df4309b474dd51663037d07a2836040518263ffffffff1660e01b8152600401610eed9190612270565b600060405180830381865af4158015610f0a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610f3291908101906124d4565b9050610f4281846000015161168c565b945060405180610100016040528060d2815260200161290c60d291398487604051602001610f72939291906125c1565b60405160208183030381529060405296506000610f8e886116e4565b604051602001610f9e9190612615565b60405160208183030381529060405290506000610fba8b6116f2565b8783604051602001610fce93929190612671565b6040516020818303038152906040529050610fe8816116e4565b604051602001610ff8919061272c565b6040516020818303038152906040529950505050505050505050919050565b611022338383611736565b5050565b61103033836113a0565b61104c5760405162461bcd60e51b81526004016105f290612320565b61105884848484611804565b50505050565b60006014846040516110709190612771565b90815260405190819003602001902090508061108c85826123fb565b5060018082018054859260ff19909116908360068111156110af576110af6121fc565b0217905550600281016110c283826123fb565b5050505050565b6012602052600090815260409020805481906110e4906122e6565b80601f0160208091040260200160405190810160405280929190818152602001828054611110906122e6565b801561115d5780601f106111325761010080835404028352916020019161115d565b820191906000526020600020905b81548152906001019060200180831161114057829003601f168201915b5050506001840154600285018054949560ff909216949193509150611181906122e6565b80601f01602080910402602001604051908101604052809291908181526020018280546111ad906122e6565b80156111fa5780601f106111cf576101008083540402835291602001916111fa565b820191906000526020600020905b8154815290600101906020018083116111dd57829003601f168201915b5050505050905083565b60606104bf82610c8d565b80516020818301810180516014825292820191909301209152805481906110e4906122e6565b61123d6115e0565b6001600160a01b0381166112a25760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f2565b6112ab8161163a565b50565b60006001600160e01b0319821663780e9d6360e01b14806104bf57506104bf82611837565b6000818152600260205260409020546001600160a01b03166112ab5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016105f2565b600081815260046020526040902080546001600160a01b0319166001600160a01b038416908117909155819061136782610b84565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000806113ac83610b84565b9050806001600160a01b0316846001600160a01b031614806113f357506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b806114175750836001600160a01b031661140c84610557565b6001600160a01b0316145b949350505050565b826001600160a01b031661143282610b84565b6001600160a01b0316146114965760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b60648201526084016105f2565b6001600160a01b0382166114f85760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016105f2565b611503838383611887565b61150e600082611332565b6001600160a01b038316600090815260036020526040812080546001929061153790849061278d565b90915550506001600160a01b0382166000908152600360205260408120805460019290611565908490612384565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b61102282826040518060200160405280600081525061193f565b600a546001600160a01b03163314610c7c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105f2565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6060600061169a8484611972565b6040516020016116aa9190612771565b6040516020818303038152906040529050806040516020016116cc91906127a0565b60405160208183030381529060405291505092915050565b60606104bf8260008061199e565b60606080604051019050602081016040526000815280600019835b928101926030600a8206018453600a90048061170d575050819003601f19909101908152919050565b816001600160a01b0316836001600160a01b0316036117975760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016105f2565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b61180f84848461141f565b61181b84848484611a85565b6110585760405162461bcd60e51b81526004016105f2906127e2565b60006001600160e01b031982166380ac58cd60e01b148061186857506001600160e01b03198216635b5e139f60e01b145b806104bf57506301ffc9a760e01b6001600160e01b03198316146104bf565b6001600160a01b0383166118e2576118dd81600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b611905565b816001600160a01b0316836001600160a01b031614611905576119058382611b86565b6001600160a01b03821661191c5761069381611c23565b826001600160a01b0316826001600160a01b031614610693576106938282611cd2565b6119498383611d16565b6119566000848484611a85565b6106935760405162461bcd60e51b81526004016105f2906127e2565b60608282604051602001611987929190612834565b604051602081830303815290604052905092915050565b606083518015610ae9576003600282010460021b60405192507f4142434445464748494a4b4c4d4e4f505152535455565758595a616263646566601f526106708515027f6768696a6b6c6d6e6f707172737475767778797a303132333435363738392d5f18603f52602083018181015b6003880197508751603f8160121c1651600053603f81600c1c1651600153603f8160061c1651600253603f811651600353506000518252600482019150808210611a0e57602001604052613d3d60f01b60038406600204808303919091526000861515909102918290035290038252509392505050565b60006001600160a01b0384163b15611b7b57604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290611ac99033908990889088906004016128a5565b6020604051808303816000875af1925050508015611b04575060408051601f3d908101601f19168201909252611b01918101906128d8565b60015b611b61573d808015611b32576040519150601f19603f3d011682016040523d82523d6000602084013e611b37565b606091505b508051600003611b595760405162461bcd60e51b81526004016105f2906127e2565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611417565b506001949350505050565b60006001611b9384610be4565b611b9d919061278d565b600083815260076020526040902054909150808214611bf0576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b600854600090611c359060019061278d565b60008381526009602052604081205460088054939450909284908110611c5d57611c5d612397565b906000526020600020015490508060088381548110611c7e57611c7e612397565b6000918252602080832090910192909255828152600990915260408082208490558582528120556008805480611cb657611cb66128f5565b6001900381819060005260206000200160009055905550505050565b6000611cdd83610be4565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b6001600160a01b038216611d6c5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016105f2565b6000818152600260205260409020546001600160a01b031615611dd15760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016105f2565b611ddd60008383611887565b6001600160a01b0382166000908152600360205260408120805460019290611e06908490612384565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6001600160e01b0319811681146112ab57600080fd5b600060208284031215611e8c57600080fd5b8135611e9781611e64565b9392505050565b60005b83811015611eb9578181015183820152602001611ea1565b50506000910152565b60008151808452611eda816020860160208601611e9e565b601f01601f19169290920160200192915050565b602081526000611e976020830184611ec2565b600060208284031215611f1357600080fd5b5035919050565b80356001600160a01b0381168114611f3157600080fd5b919050565b60008060408385031215611f4957600080fd5b611f5283611f1a565b946020939093013593505050565b600080600060608486031215611f7557600080fd5b611f7e84611f1a565b9250611f8c60208501611f1a565b9150604084013590509250925092565b600060208284031215611fae57600080fd5b611e9782611f1a565b6020808252825182820181905260009190848201906040850190845b81811015611fef57835183529284019291840191600101611fd3565b50909695505050505050565b6000806040838503121561200e57600080fd5b61201783611f1a565b91506020830135801515811461202c57600080fd5b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561207657612076612037565b604052919050565b600067ffffffffffffffff82111561209857612098612037565b50601f01601f191660200190565b60006120b96120b48461207e565b61204d565b90508281528383830111156120cd57600080fd5b828260208301376000602084830101529392505050565b600080600080608085870312156120fa57600080fd5b61210385611f1a565b935061211160208601611f1a565b925060408501359150606085013567ffffffffffffffff81111561213457600080fd5b8501601f8101871361214557600080fd5b612154878235602084016120a6565b91505092959194509250565b600082601f83011261217157600080fd5b611e97838335602085016120a6565b60008060006060848603121561219557600080fd5b833567ffffffffffffffff808211156121ad57600080fd5b6121b987838801612160565b945060208601359150600782106121cf57600080fd5b909250604085013590808211156121e557600080fd5b506121f286828701612160565b9150509250925092565b634e487b7160e01b600052602160045260246000fd5b6007811061223057634e487b7160e01b600052602160045260246000fd5b9052565b6060815260006122476060830186611ec2565b6122546020840186612212565b82810360408401526122668185611ec2565b9695505050505050565b602081016104bf8284612212565b6000806040838503121561229157600080fd5b61229a83611f1a565b91506122a860208401611f1a565b90509250929050565b6000602082840312156122c357600080fd5b813567ffffffffffffffff8111156122da57600080fd5b61141784828501612160565b600181811c908216806122fa57607f821691505b60208210810361231a57634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252602e908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526d1c881b9bdc88185c1c1c9bdd995960921b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b808201808211156104bf576104bf61236e565b634e487b7160e01b600052603260045260246000fd5b601f82111561069357600081815260208120601f850160051c810160208610156123d45750805b601f850160051c820191505b818110156123f3578281556001016123e0565b505050505050565b815167ffffffffffffffff81111561241557612415612037565b6124298161242384546122e6565b846123ad565b602080601f83116001811461245e57600084156124465750858301515b600019600386901b1c1916600185901b1785556123f3565b600085815260208120601f198616915b8281101561248d5788860151825594840194600190910190840161246e565b50858210156124ab5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000600182016124cd576124cd61236e565b5060010190565b6000602082840312156124e657600080fd5b815167ffffffffffffffff8111156124fd57600080fd5b8201601f8101841361250e57600080fd5b805161251c6120b48261207e565b81815285602083850101111561253157600080fd5b612542826020830160208601611e9e565b95945050505050565b6000808354612559816122e6565b600182811680156125715760018114612586576125b5565b60ff19841687528215158302870194506125b5565b8760005260208060002060005b858110156125ac5781548a820152908401908201612593565b50505082870194505b50929695505050505050565b600084516125d3818460208901611e9e565b8451908301906125e7818360208901611e9e565b84519101906125fa818360208801611e9e565b651e17b9bb339f60d11b910190815260060195945050505050565b7f22696d616765223a22646174613a696d6167652f7376672b786d6c3b626173658152620d8d0b60ea1b602082015260008251612659816023850160208701611e9e565b601160f91b6023939091019283015250602401919050565b757b226e616d65223a225065746572205472616974202360501b815283516000906126a3816016850160208901611e9e565b7f222c226465736372697074696f6e223a2254686973206973206a757374206120601691840191820152651d195cdd088b60d21b603682015284516126ef81603c840160208901611e9e565b600b60fa1b603c9290910191820152835161271181603d840160208801611e9e565b607d60f81b603d9290910191820152603e0195945050505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c00000081526000825161276481601d850160208701611e9e565b91909101601d0192915050565b60008251612783818460208701611e9e565b9190910192915050565b818103818111156104bf576104bf61236e565b6d2261747472696275746573223a5b60901b815281516000906127ca81600e850160208701611e9e565b605d60f81b600e939091019283015250600f01919050565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6e3d913a3930b4ba2fba3cb832911d1160891b8152825160009061285f81600f850160208801611e9e565b6a1116113b30b63ab2911d1160a91b600f91840191820152835161288a81601a840160208801611e9e565b61227d60f01b601a9290910191820152601c01949350505050565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061226690830184611ec2565b6000602082840312156128ea57600080fd5b8151611e9781611e64565b634e487b7160e01b600052603160045260246000fdfe3c7376672073686170652d72656e646572696e673d2263726973704564676573222076696577426f783d22302030203330203330222066696c6c3d226e6f6e652220786d6c6e733d22687474703a2f2f7777772e77332e6f72672f323030302f737667223e3c7374796c653e726563747b77696474683a3170783b206865696768743a203170783b7d202e62677b77696474683a333070783b206865696768743a20333070783b7d203c2f7374796c653e3c7265637420636c6173733d226267222066696c6c3d2223304436453944222f3ea264697066735822122080d328ac9e32be24cff425922dcf4b130089d86ff403f487497e221ea4b5a14564736f6c63430008110033
Loading...
Loading
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.