ERC-721
Overview
Max Total Supply
0 m
Holders
133
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Balance
1 mLoading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
Merge
Compiler Version
v0.8.6+commit.11564f7e
Optimization Enabled:
Yes with 1000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.6; /** * smatthewenglish oOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOo niftynathan * OoOoOoOoOoOoOoOoOoOoOoOoOoO OoOoOoOoOoOoOoOoOoOoOoOoOoOo * OoOoOoOoOoOoOoOoOoOoO OoOoOoOoOoOoOoOoOoOoOo * OoOoOoOoOoOoOoOoOo OoOoOoOoOoOoOoOoOo * OoOoOoOoOoOoOo oOoOoOoOoOoOoOo * OoOoOoOoOoOo OoOoOoOoOoOo * OoOoOoOoOo OoOoOoOoOo * OoOoOoOo OoOoOoOo * OoOoOo OoOoOo * OoOoO oOoOo * OoOo OoOo * OoO oOo * Oo oO * Oo oO * O O * O O * O O * O O * O O * Oo oO * Oo oO * OoO oOo * OoOo OoOo * OoOoO oOoOo * OoOoOo OoOoOo * OoOoOoOo OoOoOoOo * OoOoOoOoOo OoOoOoOoOo * OoOoOoOoOoOo OoOoOoOoOoOo * OoOoOoOoOoOoOo oOoOoOoOoOoOoOo * OoOoOoOoOoOoOoOoOo OoOoOoOoOoOoOoOoOo * OoOoOoOoOoOoOoOoOoOoO OoOoOoOoOoOoOoOoOoOoOo * OoOoOoOoOoOoOoOoOoOoOoOoOoO OoOoOoOoOoOoOoOoOoOoOoOoOoOo * soliditygoldminerz oOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOo reviewed by manifold.xyz */ import {SafeMath} from "../util/SafeMath.sol"; import {IMergeMetadata} from "./MergeMetadata.sol"; interface INiftyRegistry { function isValidNiftySender(address sending_key) external view returns (bool); } interface IERC721Receiver { function onERC721Received(address operator, address from, uint256 tokenId, bytes calldata data) external returns (bytes4); } interface IERC165 { function supportsInterface(bytes4 interfaceId) external view returns (bool); } interface ERC721 is IERC165 { event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed fromAddress, address indexed toAddress); event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); event ApprovalForAll(address indexed owner, address indexed operator, bool approved); function balanceOf(address owner) external view returns (uint256 balance); function ownerOf(uint256 tokenId) external view returns (address owner); function safeTransferFrom(address from, address to, uint256 tokenId) external; function transferFrom(address from, address to, uint256 tokenId) external; function approve(address to, uint256 tokenId) external; function getApproved(uint256 tokenId) external view returns (address operator); function setApprovalForAll(address operator, bool _approved) external; function isApprovedForAll(address owner, address operator) external view returns (bool); function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external; } interface ERC721Metadata { function name() external view returns (string memory _name); function symbol() external view returns (string memory _symbol); function tokenURI(uint256 _tokenId) external view returns (string memory); } contract Merge is ERC721, ERC721Metadata { using SafeMath for uint256; IMergeMetadata public _metadataGenerator; string private _name; string private _symbol; bool public _mintingFinalized; uint256 public _countMint; uint256 public _countToken; uint256 immutable public _percentageTotal; uint256 public _percentageRoyalty; uint256 public _alphaMass; uint256 public _alphaId; uint256 public _massTotal; address public _pak; address public _dead; address public _omnibus; address public _receiver; address immutable public _registry; event AlphaMassUpdate(uint256 indexed tokenId, uint256 alphaMass); event MassUpdate(uint256 indexed tokenIdBurned, uint256 indexed tokenIdPersist, uint256 mass); // Mapping of addresses disbarred from holding any token. mapping (address => bool) private _blacklistAddress; // Mapping of address allowed to hold multiple tokens. mapping (address => bool) private _whitelistAddress; // Mapping from owner address to token ID. mapping (address => uint256) private _tokens; // Mapping owner address to token count. mapping (address => uint256) private _balances; // Mapping from token ID to owner address. mapping (uint256 => address) private _owners; // 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; // Mapping token ID to mass value. mapping (uint256 => uint256) private _values; // Mapping token ID to all quantity merged into it. mapping (uint256 => uint256) private _mergeCount; function getMergeCount(uint256 tokenId) public view returns (uint256 mergeCount) { require(_exists(tokenId), "ERC721: operator query for nonexistent token"); return _mergeCount[tokenId]; } modifier onlyPak() { require(_msgSender() == _pak, "Merge: msg.sender is not pak"); _; } modifier onlyValidWhitelist() { require(_whitelistAddress[_msgSender()], "Merge: Invalid msg.sender"); _; } modifier onlyValidSender() { require(INiftyRegistry(_registry).isValidNiftySender(_msgSender()), "Merge: Invalid msg.sender"); _; } /** * @dev Set the values carefully! * * Requirements: * * - `registry_` enforce access control on state-changing ops * - `omnibus_` for efficient minting of initial token stock * - `metadataGenerator_` * - `pak_` - Initial pak address (0x2Ce780D7c743A57791B835a9d6F998B15BBbA5a4) * */ constructor(address registry_, address omnibus_, address metadataGenerator_, address pak_) { _registry = registry_; _omnibus = omnibus_; _metadataGenerator = IMergeMetadata(metadataGenerator_); _name = "merge."; _symbol = "m"; _pak = pak_; _receiver = pak_; _dead = 0x000000000000000000000000000000000000dEaD; _percentageTotal = 10000; _percentageRoyalty = 1000; _blacklistAddress[address(this)] = true; _whitelistAddress[omnibus_] = true; } function name() public view virtual override returns (string memory) { return _name; } function symbol() public view virtual override returns (string memory) { return _symbol; } function totalSupply() public view returns (uint256) { return _countToken; } function merge(uint256 tokenIdRcvr, uint256 tokenIdSndr) external onlyValidWhitelist returns (uint256 tokenIdDead) { address ownerOfTokenIdRcvr = ownerOf(tokenIdRcvr); address ownerOfTokenIdSndr = ownerOf(tokenIdSndr); require(ownerOfTokenIdRcvr == ownerOfTokenIdSndr, "Merge: Illegal argument disparate owner."); require(_msgSender() == ownerOfTokenIdRcvr, "ERC721: msg.sender is not token owner."); return _merge(tokenIdRcvr, tokenIdSndr, ownerOfTokenIdRcvr, ownerOfTokenIdSndr); } function _transfer(address from, address to, uint256 tokenId) internal { require(_exists(tokenId), "ERC721: transfer attempt for nonexistent token"); require(ownerOf(tokenId) == from, "ERC721: transfer of token that is not own"); require(to != address(0), "ERC721: transfer to the zero address"); require(!_blacklistAddress[to], "Merge: transfer attempt to blacklist address"); require(from != to, "ERC721: transfer attempt to self"); if(to == _dead){ _burn(tokenId); return; } _approve(address(0), tokenId); bool fromIsWhitelisted = isWhitelisted(from); bool toIsWhitelisted = isWhitelisted(to); if(!fromIsWhitelisted && toIsWhitelisted){ delete _tokens[from]; _owners[tokenId] = to; _balances[to] += 1; delete _balances[from]; emit Transfer(from, to, tokenId); return; } if(fromIsWhitelisted && toIsWhitelisted) { _balances[to] += 1; _balances[from] -= 1; _owners[tokenId] = to; emit Transfer(from, to, tokenId); return; } if(_tokens[to] == 0){ _tokens[to] = tokenId; _owners[tokenId] = to; _balances[to] += 1; _balances[from] -= 1; emit Transfer(from, to, tokenId); return; } emit Transfer(from, to, tokenId); uint256 tokenIdRcvr = _tokens[to]; uint256 tokenIdSndr = tokenId; uint256 tokenIdDead = _merge(tokenIdRcvr, tokenIdSndr, to, from); if(tokenIdDead == tokenIdRcvr){ _owners[tokenIdSndr] = to; _tokens[to] = tokenIdSndr; } else { _owners[tokenIdRcvr] = to; _tokens[to] = tokenIdRcvr; } delete _owners[tokenIdDead]; } function _merge(uint256 tokenIdRcvr, uint256 tokenIdSndr, address ownerRcvr, address ownerSndr) internal returns (uint256 tokenIdDead) { require(tokenIdRcvr != tokenIdSndr, "Merge: Illegal argument identical tokenId."); uint256 massRcvr = decodeMass(_values[tokenIdRcvr]); uint256 massSndr = decodeMass(_values[tokenIdSndr]); if(!_whitelistAddress[ownerRcvr]){ _balances[ownerRcvr] = 1; } _balances[ownerSndr] -= 1; uint256 massSmall = massRcvr; uint256 massLarge = massSndr; uint256 tokenIdSmall = tokenIdRcvr; uint256 tokenIdLarge = tokenIdSndr; if (massRcvr >= massSndr) { massSmall = massSndr; massLarge = massRcvr; tokenIdSmall = tokenIdSndr; tokenIdLarge = tokenIdRcvr; } emit Transfer(ownerOf(tokenIdSmall), address(0), tokenIdSmall); _values[tokenIdLarge] += massSmall; uint256 combinedMass = massLarge + massSmall; if(combinedMass > _alphaMass) { _alphaId = tokenIdLarge; _alphaMass = combinedMass; emit AlphaMassUpdate(_alphaId, combinedMass); } _mergeCount[tokenIdLarge]++; delete _values[tokenIdSmall]; _countToken -= 1; emit MassUpdate(tokenIdSmall, tokenIdLarge, combinedMass); return tokenIdSmall; } function setRoyaltyBips(uint256 percentageRoyalty_) external onlyPak { require(percentageRoyalty_ <= _percentageTotal, "Merge: Illegal argument more than 100%"); _percentageRoyalty = percentageRoyalty_; } function royaltyInfo(uint256 tokenId, uint256 salePrice) external view returns (address, uint256) { uint256 royaltyAmount = (salePrice * _percentageRoyalty) / _percentageTotal; return (_receiver, royaltyAmount); } function setBlacklistAddress(address address_, bool status) external onlyPak { require(address_ != _omnibus, "Merge: Illegal argument address_ is _omnibus."); _blacklistAddress[address_] = status; } function setPak(address pak_) external onlyPak { _pak = pak_; } function setRoyaltyReceiver(address receiver_) external onlyPak { _receiver = receiver_; } function setMetadataGenerator(address metadataGenerator_) external onlyPak { _metadataGenerator = IMergeMetadata(metadataGenerator_); } function whitelistUpdate(address address_, bool status) external onlyPak { if(address_ == _omnibus){ require(status != false, "Merge: Illegal argument _omnibus can't be removed."); } if(status == false) { require(balanceOf(address_) <= 1, "Merge: Address with more than one token can't be removed."); } _whitelistAddress[address_] = status; } function isWhitelisted(address address_) public view returns (bool) { return _whitelistAddress[address_]; } function isBlacklisted(address address_) public view returns (bool) { return _blacklistAddress[address_]; } function ownerOf(uint256 tokenId) public view override returns (address) { require(_exists(tokenId), "ERC721: owner query for nonexistent token"); return _owners[tokenId]; } /** * @dev Generate the NFTs of this collection. * * [20001000, 20000900, ] * * Requirements: * * - `values_` provided as a list of addresses, each of * which implicitly corresponds to a tokenId, * derrived by the index of the value in the * input array. The values map to a color * attribute. * * Emits a series of {Transfer} events. */ function mint(uint256[] memory values_) external onlyValidSender { require(!_mintingFinalized, "Merge: Minting is finalized."); uint256 index = _countMint; uint256 massAdded = 0; uint256 alphaId = _alphaId; uint256 alphaMass = _alphaMass; for (uint256 i = 1; i <= values_.length; i++) { index = _countMint + i; _values[index] = values_[i - 1]; _owners[index] = _omnibus; (uint256 class, uint256 mass) = decodeClassAndMass(values_[i - 1]); require(class > 0 && class <= 4, "Merge: Class must be between 1 and 4."); require(mass > 0 && mass < 99999999, "Merge: Mass must be between 1 and 99999999."); if(alphaMass < mass){ alphaMass = mass; alphaId = index; } massAdded += mass; emit Transfer(address(0), _omnibus, index); } _countMint += values_.length; _countToken += values_.length; _balances[_omnibus] = _countMint; _massTotal += massAdded; if(_alphaId != alphaId) { _alphaId = alphaId; _alphaMass = alphaMass; emit AlphaMassUpdate(alphaId, alphaMass); } } function finalize() external onlyPak { _mintingFinalized = true; } function safeTransferFrom(address from, address to, uint256 tokenId) public virtual override { safeTransferFrom(from, to, tokenId, ""); } function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer"); } function transferFrom(address from, address to, uint256 tokenId) public virtual override { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _transfer(from, to, tokenId); } function balanceOf(address owner) public view override returns (uint256) { return _balances[owner]; } function massOf(uint256 tokenId) public view virtual returns (uint256) { return decodeMass(_values[tokenId]); } function getValueOf(uint256 tokenId) public view virtual returns (uint256) { return _values[tokenId]; } function tokenOf(address owner) public view virtual returns (uint256) { uint256 token = _tokens[owner]; return token; } function approve(address to, uint256 tokenId) public virtual override { address owner = ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require(_msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not owner nor approved for all" ); _tokenApprovals[tokenId] = to; emit Approval(ownerOf(tokenId), to, tokenId); } function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ownerOf(tokenId), to, tokenId); } function getApproved(uint256 tokenId) public view virtual override returns (address) { require(_exists(tokenId), "ERC721: operator query for nonexistent token"); return _tokenApprovals[tokenId]; } function setApprovalForAll(address operator, bool approved) public virtual override { require(operator != _msgSender(), "ERC721: approve to caller"); _operatorApprovals[_msgSender()][operator] = approved; emit ApprovalForAll(_msgSender(), operator, approved); } function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } function _exists(uint256 tokenId) internal view returns (bool) { return _values[tokenId] != 0; } function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { require(_exists(tokenId), "ERC721: operator query for nonexistent token"); address owner = ownerOf(tokenId); return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender)); } function tokenURI(uint256 tokenId) public virtual view override returns (string memory) { require(_exists(tokenId), "ERC721: operator query for nonexistent token"); return _metadataGenerator.tokenMetadata( tokenId, decodeClass(_values[tokenId]), decodeMass(_values[tokenId]), decodeMass(_values[_alphaId]), tokenId == _alphaId, getMergeCount(tokenId)); } function encodeClassAndMass(uint256 class, uint256 mass) public pure returns (uint256) { require(class > 0 && class <= 4, "Merge: Class must be between 1 and 4."); require(mass > 0 && mass < 99999999, "Merge: Mass must be between 1 and 99999999."); return ((class * 100000000) + mass); } function decodeClassAndMass(uint256 value) public pure returns (uint256, uint256) { uint256 class = value.div(100000000); uint256 mass = value.sub(class.mul(100000000)); require(class > 0 && class <= 4, "Merge: Class must be between 1 and 4."); require(mass > 0 && mass < 99999999, "Merge: Mass must be between 1 and 99999999."); return (class, mass); } function decodeClass(uint256 value) public pure returns (uint256) { return value.div(100000000); } function decodeMass(uint256 value) public pure returns (uint256) { return value.sub(decodeClass(value).mul(100000000)); } function _msgSender() internal view returns (address) { return msg.sender; } function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory _data) private returns (bool) { if (isContract(to)) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) { return retval == IERC721Receiver(to).onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } // solhint-disable-next-line no-inline-assembly assembly { revert(add(32, reason), mload(reason)) } } } return true; } function isContract(address account) internal view returns (bool) { uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { bytes4 _ERC165_ = 0x01ffc9a7; bytes4 _ERC721_ = 0x80ac58cd; bytes4 _ERC2981_ = 0x2a55205a; bytes4 _ERC721Metadata_ = 0x5b5e139f; return interfaceId == _ERC165_ || interfaceId == _ERC721_ || interfaceId == _ERC2981_ || interfaceId == _ERC721Metadata_; } function burn(uint256 tokenId) public { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not owner nor approved"); _burn(tokenId); } function _burn(uint256 tokenId) internal { address owner = ownerOf(tokenId); _approve(address(0), tokenId); _massTotal -= decodeMass(_values[tokenId]); delete _tokens[owner]; delete _owners[tokenId]; delete _values[tokenId]; _countToken -= 1; _balances[owner] -= 1; emit MassUpdate(tokenId, 0, 0); emit Transfer(owner, address(0), tokenId); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler * now has built in overflow checking. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.6; /** * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX .*** XXXXXXXXXXXXXXXXXXXXXXXXXXXXX * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ,********* XXXXXXXXXXXXXXXXXXXXXXXXXXX * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX *************** XXXXXXXXXXXXXXXXXXXXXXXX * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX .******************* XXXXXXXXXXXXXXXXXXXXXX * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX *********** ********** XXXXXXXXXXXXXXXXXXX * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX *********** *********** XXXXXXXXXXXXXXXXX * XXXXXXXXXXXXXXXXXXXXXXXXXXXX *********** *************** XXXXXXXXXXXXXX * XXXXXXXXXXXXXXXXXXXXXXXXXX *********** **** ********* XXXXXXXXXXXXX * XXXXXXXXXXXXXXXXXXXXXXXXXX ********* *** *** ********* XXXXXXXXXXXX * XXXXXXXXXXXXXXXXXXXXXXXXXX ********** ***** *********** XXXXXXXXXXXXXX * XXXXXXXXXXXXXXXXXXXXXX /////.************* *********** XXXXXXXXXXXXXXX * XXXXXXXXXXXXXXXXXXX /////////...*********** ************ XXXXXXXXXXXXXXXXX * XXXXXXXXXXXXXXXXX/ ///////////..... ///////// /////////// XXXXXXXXXXXXXXXXXXX * XXXXXXXXXXXXXXXX / //////........./////////////////// XXXXXXXXXXXXXXXXXXXXX * XXXXXXXXXXXXXXXXXXXX .///////...........////////////// XXXXXXXXXXXXXXXXXXXXXXXX * XXXXXXXXXXXXXXXXXXX .///////.....//..//// ///////// XXXXXXXXXXXXXXXXXXXXXXXXXXX * XXXXXXXXXXXXXXXXX# ///////////////////// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX * XXXXXXXXXXXXXXX //////////////////// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX * XXXXXXXXXXXX ////////////// ////// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */ import {ABDKMath64x64} from "../util/ABDKMath64x64.sol"; import {Base64} from "../util/Base64.sol"; import {Roots} from "../util/Roots.sol"; import {Strings} from "../util/Strings.sol"; interface IMergeMetadata { function tokenMetadata( uint256 tokenId, uint256 rarity, uint256 tokenMass, uint256 alphaMass, bool isAlpha, uint256 mergeCount) external view returns (string memory); } contract MergeMetadata is IMergeMetadata { struct ERC721MetadataStructure { bool isImageLinked; string name; string description; string createdBy; string image; ERC721MetadataAttribute[] attributes; } struct ERC721MetadataAttribute { bool includeDisplayType; bool includeTraitType; bool isValueAString; string displayType; string traitType; string value; } using ABDKMath64x64 for int128; using Base64 for string; using Roots for uint; using Strings for uint256; address public owner; string private _name; string private _imageBaseURI; string private _imageExtension; uint256 private _maxRadius; string[] private _imageParts; mapping (string => string) private _classStyles; string constant private _RADIUS_TAG = '<RADIUS>'; string constant private _CLASS_TAG = '<CLASS>'; string constant private _CLASS_STYLE_TAG = '<CLASS_STYLE>'; constructor() { owner = msg.sender; _name = "m"; _imageBaseURI = ""; // Set to empty string - results in on-chain SVG generation by default unless this is set later _imageExtension = ""; // Set to empty string - can be changed later to remain empty, .png, .mp4, etc _maxRadius = 1000; // Deploy with default SVG image parts - can be completely replaced later _imageParts.push("<svg xmlns='http://www.w3.org/2000/svg' version='1.1' width='2000' height='2000'>"); _imageParts.push("<style>"); _imageParts.push(".m1 #c{fill: #fff;}"); _imageParts.push(".m1 #r{fill: #000;}"); _imageParts.push(".m2 #c{fill: #fc3;}"); _imageParts.push(".m2 #r{fill: #000;}"); _imageParts.push(".m3 #c{fill: #fff;}"); _imageParts.push(".m3 #r{fill: #33f;}"); _imageParts.push(".m4 #c{fill: #fff;}"); _imageParts.push(".m4 #r{fill: #f33;}"); _imageParts.push(".a #c{fill: #000 !important;}"); _imageParts.push(".a #r{fill: #fff !important;}"); _imageParts.push(_CLASS_STYLE_TAG); _imageParts.push("</style>"); _imageParts.push("<g class='"); _imageParts.push(_CLASS_TAG); _imageParts.push("'>"); _imageParts.push("<rect id='r' width='2000' height='2000'/>"); _imageParts.push("<circle id='c' cx='1000' cy='1000' r='"); _imageParts.push(_RADIUS_TAG); _imageParts.push("'/>"); _imageParts.push("</g>"); _imageParts.push("</svg>"); } function setName(string calldata name_) external { _requireOnlyOwner(); _name = name_; } function setImageBaseURI(string calldata imageBaseURI_, string calldata imageExtension_) external { _requireOnlyOwner(); _imageBaseURI = imageBaseURI_; _imageExtension = imageExtension_; } function setMaxRadius(uint256 maxRadius_) external { _requireOnlyOwner(); _maxRadius = maxRadius_; } function tokenMetadata(uint256 tokenId, uint256 rarity, uint256 tokenMass, uint256 alphaMass, bool isAlpha, uint256 mergeCount) external view override returns (string memory) { string memory base64Json = Base64.encode(bytes(string(abi.encodePacked(_getJson(tokenId, rarity, tokenMass, alphaMass, isAlpha, mergeCount))))); return string(abi.encodePacked('data:application/json;base64,', base64Json)); } function updateImageParts(string[] memory imageParts_) public { _requireOnlyOwner(); _imageParts = imageParts_; } function updateClassStyle(string calldata cssClass, string calldata cssStyle) external { _requireOnlyOwner(); _classStyles[cssClass] = cssStyle; } function getClassStyle(string memory cssClass) public view returns (string memory) { return _classStyles[cssClass]; } function name() public view returns (string memory) { return _name; } function imageBaseURI() public view returns (string memory) { return _imageBaseURI; } function imageExtension() public view returns (string memory) { return _imageExtension; } function maxRadius() public view returns (uint256) { return _maxRadius; } function getClassString(uint256 tokenId, uint256 rarity, bool isAlpha, bool offchainImage) public pure returns (string memory) { return _getClassString(tokenId, rarity, isAlpha, offchainImage); } function _getJson(uint256 tokenId, uint256 rarity, uint256 tokenMass, uint256 alphaMass, bool isAlpha, uint256 mergeCount) private view returns (string memory) { string memory imageData = bytes(_imageBaseURI).length == 0 ? _getSvg(tokenId, rarity, tokenMass, alphaMass, isAlpha) : string(abi.encodePacked(imageBaseURI(), _getClassString(tokenId, rarity, isAlpha, true), "_", uint256(int256(_getScaledRadius(tokenMass, alphaMass, _maxRadius).toInt())).toString(), imageExtension())); ERC721MetadataStructure memory metadata = ERC721MetadataStructure({ isImageLinked: bytes(_imageBaseURI).length > 0, name: string(abi.encodePacked(name(), "(", tokenMass.toString(), ") #", tokenId.toString())), description: tokenMass.toString(), createdBy: "Pak", image: imageData, attributes: _getJsonAttributes(tokenId, rarity, tokenMass, mergeCount, isAlpha) }); return _generateERC721Metadata(metadata); } function _getJsonAttributes(uint256 tokenId, uint256 rarity, uint256 tokenMass, uint256 mergeCount, bool isAlpha) private pure returns (ERC721MetadataAttribute[] memory) { uint256 tensDigit = tokenId % 100 / 10; uint256 onesDigit = tokenId % 10; uint256 class = tensDigit * 10 + onesDigit; ERC721MetadataAttribute[] memory metadataAttributes = new ERC721MetadataAttribute[](5); metadataAttributes[0] = _getERC721MetadataAttribute(false, true, false, "", "Mass", tokenMass.toString()); metadataAttributes[1] = _getERC721MetadataAttribute(false, true, false, "", "Alpha", isAlpha ? "1" : "0"); metadataAttributes[2] = _getERC721MetadataAttribute(false, true, false, "", "Tier", rarity.toString()); metadataAttributes[3] = _getERC721MetadataAttribute(false, true, false, "", "Class", class.toString()); metadataAttributes[4] = _getERC721MetadataAttribute(false, true, false, "", "Merges", mergeCount.toString()); return metadataAttributes; } function _getERC721MetadataAttribute(bool includeDisplayType, bool includeTraitType, bool isValueAString, string memory displayType, string memory traitType, string memory value) private pure returns (ERC721MetadataAttribute memory) { ERC721MetadataAttribute memory attribute = ERC721MetadataAttribute({ includeDisplayType: includeDisplayType, includeTraitType: includeTraitType, isValueAString: isValueAString, displayType: displayType, traitType: traitType, value: value }); return attribute; } function _getSvg(uint256 tokenId, uint256 rarity, uint256 tokenMass, uint256 alphaMass, bool isAlpha) private view returns (string memory) { bytes memory byteString; for (uint i = 0; i < _imageParts.length; i++) { if (_checkTag(_imageParts[i], _RADIUS_TAG)) { byteString = abi.encodePacked(byteString, _floatToString(_getScaledRadius(tokenMass, alphaMass, _maxRadius))); } else if (_checkTag(_imageParts[i], _CLASS_TAG)) { byteString = abi.encodePacked(byteString, _getClassString(tokenId, rarity, isAlpha, false)); } else if (_checkTag(_imageParts[i], _CLASS_STYLE_TAG)) { uint256 tensDigit = tokenId % 100 / 10; uint256 onesDigit = tokenId % 10; uint256 class = tensDigit * 10 + onesDigit; string memory classCss = getClassStyle(_getTokenIdClass(class)); if(bytes(classCss).length > 0) { byteString = abi.encodePacked(byteString, classCss); } } else { byteString = abi.encodePacked(byteString, _imageParts[i]); } } return string(byteString); } function _getScaledRadius(uint256 tokenMass, uint256 alphaMass, uint256 maximumRadius) private pure returns (int128) { int128 radiusMass = _getRadius64x64(tokenMass); int128 radiusAlphaMass = _getRadius64x64(alphaMass); int128 scalePercentage = ABDKMath64x64.div(radiusMass, radiusAlphaMass); int128 scaledRadius = ABDKMath64x64.mul(ABDKMath64x64.fromUInt(maximumRadius), scalePercentage); if(uint256(int256(scaledRadius.toInt())) == 0) { scaledRadius = ABDKMath64x64.fromUInt(1); } return scaledRadius; } // Radius = Cube Root(Mass) * Cube Root (0.23873241463) // Radius = Cube Root(Mass) * 0.62035049089 function _getRadius64x64(uint256 mass) private pure returns (int128) { int128 cubeRootScalar = ABDKMath64x64.divu(62035049089, 100000000000); int128 cubeRootMass = ABDKMath64x64.divu(mass.nthRoot(3, 6, 32), 1000000); int128 radius = ABDKMath64x64.mul(cubeRootMass, cubeRootScalar); return radius; } function _generateERC721Metadata(ERC721MetadataStructure memory metadata) private pure returns (string memory) { bytes memory byteString; byteString = abi.encodePacked( byteString, _openJsonObject()); byteString = abi.encodePacked( byteString, _pushJsonPrimitiveStringAttribute("name", metadata.name, true)); byteString = abi.encodePacked( byteString, _pushJsonPrimitiveStringAttribute("description", metadata.description, true)); byteString = abi.encodePacked( byteString, _pushJsonPrimitiveStringAttribute("created_by", metadata.createdBy, true)); if(metadata.isImageLinked) { byteString = abi.encodePacked( byteString, _pushJsonPrimitiveStringAttribute("image", metadata.image, true)); } else { byteString = abi.encodePacked( byteString, _pushJsonPrimitiveStringAttribute("image_data", metadata.image, true)); } byteString = abi.encodePacked( byteString, _pushJsonComplexAttribute("attributes", _getAttributes(metadata.attributes), false)); byteString = abi.encodePacked( byteString, _closeJsonObject()); return string(byteString); } function _getAttributes(ERC721MetadataAttribute[] memory attributes) private pure returns (string memory) { bytes memory byteString; byteString = abi.encodePacked( byteString, _openJsonArray()); for (uint i = 0; i < attributes.length; i++) { ERC721MetadataAttribute memory attribute = attributes[i]; byteString = abi.encodePacked( byteString, _pushJsonArrayElement(_getAttribute(attribute), i < (attributes.length - 1))); } byteString = abi.encodePacked( byteString, _closeJsonArray()); return string(byteString); } function _getAttribute(ERC721MetadataAttribute memory attribute) private pure returns (string memory) { bytes memory byteString; byteString = abi.encodePacked( byteString, _openJsonObject()); if(attribute.includeDisplayType) { byteString = abi.encodePacked( byteString, _pushJsonPrimitiveStringAttribute("display_type", attribute.displayType, true)); } if(attribute.includeTraitType) { byteString = abi.encodePacked( byteString, _pushJsonPrimitiveStringAttribute("trait_type", attribute.traitType, true)); } if(attribute.isValueAString) { byteString = abi.encodePacked( byteString, _pushJsonPrimitiveStringAttribute("value", attribute.value, false)); } else { byteString = abi.encodePacked( byteString, _pushJsonPrimitiveNonStringAttribute("value", attribute.value, false)); } byteString = abi.encodePacked( byteString, _closeJsonObject()); return string(byteString); } function _getClassString(uint256 tokenId, uint256 rarity, bool isAlpha, bool offchainImage) private pure returns (string memory) { bytes memory byteString; byteString = abi.encodePacked(byteString, _getRarityClass(rarity)); if(isAlpha) { byteString = abi.encodePacked( byteString, string(abi.encodePacked(offchainImage ? "_" : " ", "a"))); } uint256 tensDigit = tokenId % 100 / 10; uint256 onesDigit = tokenId % 10; uint256 class = tensDigit * 10 + onesDigit; byteString = abi.encodePacked( byteString, string(abi.encodePacked(offchainImage ? "_" : " ", _getTokenIdClass(class)))); return string(byteString); } function _getRarityClass(uint256 rarity) private pure returns (string memory) { return string(abi.encodePacked("m", rarity.toString())); } function _getTokenIdClass(uint256 class) private pure returns (string memory) { return string(abi.encodePacked("c", class.toString())); } function _checkTag(string storage a, string memory b) private pure returns (bool) { return (keccak256(abi.encodePacked((a))) == keccak256(abi.encodePacked((b)))); } function _floatToString(int128 value) private pure returns (string memory) { uint256 decimal4 = (value & 0xFFFFFFFFFFFFFFFF).mulu(10000); return string(abi.encodePacked(uint256(int256(value.toInt())).toString(), '.', _decimal4ToString(decimal4))); } function _decimal4ToString(uint256 decimal4) private pure returns (string memory) { bytes memory decimal4Characters = new bytes(4); for (uint i = 0; i < 4; i++) { decimal4Characters[3 - i] = bytes1(uint8(0x30 + decimal4 % 10)); decimal4 /= 10; } return string(abi.encodePacked(decimal4Characters)); } function _requireOnlyOwner() private view { require(msg.sender == owner, "You are not the owner"); } function _openJsonObject() private pure returns (string memory) { return string(abi.encodePacked("{")); } function _closeJsonObject() private pure returns (string memory) { return string(abi.encodePacked("}")); } function _openJsonArray() private pure returns (string memory) { return string(abi.encodePacked("[")); } function _closeJsonArray() private pure returns (string memory) { return string(abi.encodePacked("]")); } function _pushJsonPrimitiveStringAttribute(string memory key, string memory value, bool insertComma) private pure returns (string memory) { return string(abi.encodePacked('"', key, '": "', value, '"', insertComma ? ',' : '')); } function _pushJsonPrimitiveNonStringAttribute(string memory key, string memory value, bool insertComma) private pure returns (string memory) { return string(abi.encodePacked('"', key, '": ', value, insertComma ? ',' : '')); } function _pushJsonComplexAttribute(string memory key, string memory value, bool insertComma) private pure returns (string memory) { return string(abi.encodePacked('"', key, '": ', value, insertComma ? ',' : '')); } function _pushJsonArrayElement(string memory value, bool insertComma) private pure returns (string memory) { return string(abi.encodePacked(value, insertComma ? ',' : '')); } }
// SPDX-License-Identifier: BSD-4-Clause /* * ABDK Math 64.64 Smart Contract Library. Copyright © 2019 by ABDK Consulting. * Author: Mikhail Vladimirov <[email protected]> */ pragma solidity ^0.8.6; /** * Smart contract library of mathematical functions operating with signed * 64.64-bit fixed point numbers. Signed 64.64-bit fixed point number is * basically a simple fraction whose numerator is signed 128-bit integer and * denominator is 2^64. As long as denominator is always the same, there is no * need to store it, thus in Solidity signed 64.64-bit fixed point numbers are * represented by int128 type holding only the numerator. */ library ABDKMath64x64 { /* * Minimum value signed 64.64-bit fixed point number may have. */ int128 private constant MIN_64x64 = -0x80000000000000000000000000000000; /* * Maximum value signed 64.64-bit fixed point number may have. */ int128 private constant MAX_64x64 = 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; /** * Convert signed 256-bit integer number into signed 64.64-bit fixed point * number. Revert on overflow. * * @param x signed 256-bit integer number * @return signed 64.64-bit fixed point number */ function fromInt (int256 x) internal pure returns (int128) { unchecked { require (x >= -0x8000000000000000 && x <= 0x7FFFFFFFFFFFFFFF); return int128 (x << 64); } } /** * Convert signed 64.64 fixed point number into signed 64-bit integer number * rounding down. * * @param x signed 64.64-bit fixed point number * @return signed 64-bit integer number */ function toInt (int128 x) internal pure returns (int64) { unchecked { return int64 (x >> 64); } } /** * Convert unsigned 256-bit integer number into signed 64.64-bit fixed point * number. Revert on overflow. * * @param x unsigned 256-bit integer number * @return signed 64.64-bit fixed point number */ function fromUInt (uint256 x) internal pure returns (int128) { unchecked { require (x <= 0x7FFFFFFFFFFFFFFF); return int128 (int256 (x << 64)); } } /** * Convert signed 64.64 fixed point number into unsigned 64-bit integer * number rounding down. Revert on underflow. * * @param x signed 64.64-bit fixed point number * @return unsigned 64-bit integer number */ function toUInt (int128 x) internal pure returns (uint64) { unchecked { require (x >= 0); return uint64 (uint128 (x >> 64)); } } /** * Convert signed 128.128 fixed point number into signed 64.64-bit fixed point * number rounding down. Revert on overflow. * * @param x signed 128.128-bin fixed point number * @return signed 64.64-bit fixed point number */ function from128x128 (int256 x) internal pure returns (int128) { unchecked { int256 result = x >> 64; require (result >= MIN_64x64 && result <= MAX_64x64); return int128 (result); } } /** * Convert signed 64.64 fixed point number into signed 128.128 fixed point * number. * * @param x signed 64.64-bit fixed point number * @return signed 128.128 fixed point number */ function to128x128 (int128 x) internal pure returns (int256) { unchecked { return int256 (x) << 64; } } /** * Calculate x + y. Revert on overflow. * * @param x signed 64.64-bit fixed point number * @param y signed 64.64-bit fixed point number * @return signed 64.64-bit fixed point number */ function add (int128 x, int128 y) internal pure returns (int128) { unchecked { int256 result = int256(x) + y; require (result >= MIN_64x64 && result <= MAX_64x64); return int128 (result); } } /** * Calculate x - y. Revert on overflow. * * @param x signed 64.64-bit fixed point number * @param y signed 64.64-bit fixed point number * @return signed 64.64-bit fixed point number */ function sub (int128 x, int128 y) internal pure returns (int128) { unchecked { int256 result = int256(x) - y; require (result >= MIN_64x64 && result <= MAX_64x64); return int128 (result); } } /** * Calculate x * y rounding down. Revert on overflow. * * @param x signed 64.64-bit fixed point number * @param y signed 64.64-bit fixed point number * @return signed 64.64-bit fixed point number */ function mul (int128 x, int128 y) internal pure returns (int128) { unchecked { int256 result = int256(x) * y >> 64; require (result >= MIN_64x64 && result <= MAX_64x64); return int128 (result); } } /** * Calculate x * y rounding towards zero, where x is signed 64.64 fixed point * number and y is signed 256-bit integer number. Revert on overflow. * * @param x signed 64.64 fixed point number * @param y signed 256-bit integer number * @return signed 256-bit integer number */ function muli (int128 x, int256 y) internal pure returns (int256) { unchecked { if (x == MIN_64x64) { require (y >= -0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF && y <= 0x1000000000000000000000000000000000000000000000000); return -y << 63; } else { bool negativeResult = false; if (x < 0) { x = -x; negativeResult = true; } if (y < 0) { y = -y; // We rely on overflow behavior here negativeResult = !negativeResult; } uint256 absoluteResult = mulu (x, uint256 (y)); if (negativeResult) { require (absoluteResult <= 0x8000000000000000000000000000000000000000000000000000000000000000); return -int256 (absoluteResult); // We rely on overflow behavior here } else { require (absoluteResult <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF); return int256 (absoluteResult); } } } } /** * Calculate x * y rounding down, where x is signed 64.64 fixed point number * and y is unsigned 256-bit integer number. Revert on overflow. * * @param x signed 64.64 fixed point number * @param y unsigned 256-bit integer number * @return unsigned 256-bit integer number */ function mulu (int128 x, uint256 y) internal pure returns (uint256) { unchecked { if (y == 0) return 0; require (x >= 0); uint256 lo = (uint256 (int256 (x)) * (y & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)) >> 64; uint256 hi = uint256 (int256 (x)) * (y >> 128); require (hi <= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF); hi <<= 64; require (hi <= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF - lo); return hi + lo; } } /** * Calculate x / y rounding towards zero. Revert on overflow or when y is * zero. * * @param x signed 64.64-bit fixed point number * @param y signed 64.64-bit fixed point number * @return signed 64.64-bit fixed point number */ function div (int128 x, int128 y) internal pure returns (int128) { unchecked { require (y != 0); int256 result = (int256 (x) << 64) / y; require (result >= MIN_64x64 && result <= MAX_64x64); return int128 (result); } } /** * Calculate x / y rounding towards zero, where x and y are signed 256-bit * integer numbers. Revert on overflow or when y is zero. * * @param x signed 256-bit integer number * @param y signed 256-bit integer number * @return signed 64.64-bit fixed point number */ function divi (int256 x, int256 y) internal pure returns (int128) { unchecked { require (y != 0); bool negativeResult = false; if (x < 0) { x = -x; // We rely on overflow behavior here negativeResult = true; } if (y < 0) { y = -y; // We rely on overflow behavior here negativeResult = !negativeResult; } uint128 absoluteResult = divuu (uint256 (x), uint256 (y)); if (negativeResult) { require (absoluteResult <= 0x80000000000000000000000000000000); return -int128 (absoluteResult); // We rely on overflow behavior here } else { require (absoluteResult <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF); return int128 (absoluteResult); // We rely on overflow behavior here } } } /** * Calculate x / y rounding towards zero, where x and y are unsigned 256-bit * integer numbers. Revert on overflow or when y is zero. * * @param x unsigned 256-bit integer number * @param y unsigned 256-bit integer number * @return signed 64.64-bit fixed point number */ function divu (uint256 x, uint256 y) internal pure returns (int128) { unchecked { require (y != 0); uint128 result = divuu (x, y); require (result <= uint128 (MAX_64x64)); return int128 (result); } } /** * Calculate -x. Revert on overflow. * * @param x signed 64.64-bit fixed point number * @return signed 64.64-bit fixed point number */ function neg (int128 x) internal pure returns (int128) { unchecked { require (x != MIN_64x64); return -x; } } /** * Calculate |x|. Revert on overflow. * * @param x signed 64.64-bit fixed point number * @return signed 64.64-bit fixed point number */ function abs (int128 x) internal pure returns (int128) { unchecked { require (x != MIN_64x64); return x < 0 ? -x : x; } } /** * Calculate 1 / x rounding towards zero. Revert on overflow or when x is * zero. * * @param x signed 64.64-bit fixed point number * @return signed 64.64-bit fixed point number */ function inv (int128 x) internal pure returns (int128) { unchecked { require (x != 0); int256 result = int256 (0x100000000000000000000000000000000) / x; require (result >= MIN_64x64 && result <= MAX_64x64); return int128 (result); } } /** * Calculate arithmetics average of x and y, i.e. (x + y) / 2 rounding down. * * @param x signed 64.64-bit fixed point number * @param y signed 64.64-bit fixed point number * @return signed 64.64-bit fixed point number */ function avg (int128 x, int128 y) internal pure returns (int128) { unchecked { return int128 ((int256 (x) + int256 (y)) >> 1); } } /** * Calculate geometric average of x and y, i.e. sqrt (x * y) rounding down. * Revert on overflow or in case x * y is negative. * * @param x signed 64.64-bit fixed point number * @param y signed 64.64-bit fixed point number * @return signed 64.64-bit fixed point number */ function gavg (int128 x, int128 y) internal pure returns (int128) { unchecked { int256 m = int256 (x) * int256 (y); require (m >= 0); require (m < 0x4000000000000000000000000000000000000000000000000000000000000000); return int128 (sqrtu (uint256 (m))); } } /** * Calculate x^y assuming 0^0 is 1, where x is signed 64.64 fixed point number * and y is unsigned 256-bit integer number. Revert on overflow. * * @param x signed 64.64-bit fixed point number * @param y uint256 value * @return signed 64.64-bit fixed point number */ function pow (int128 x, uint256 y) internal pure returns (int128) { unchecked { bool negative = x < 0 && y & 1 == 1; uint256 absX = uint128 (x < 0 ? -x : x); uint256 absResult; absResult = 0x100000000000000000000000000000000; if (absX <= 0x10000000000000000) { absX <<= 63; while (y != 0) { if (y & 0x1 != 0) { absResult = absResult * absX >> 127; } absX = absX * absX >> 127; if (y & 0x2 != 0) { absResult = absResult * absX >> 127; } absX = absX * absX >> 127; if (y & 0x4 != 0) { absResult = absResult * absX >> 127; } absX = absX * absX >> 127; if (y & 0x8 != 0) { absResult = absResult * absX >> 127; } absX = absX * absX >> 127; y >>= 4; } absResult >>= 64; } else { uint256 absXShift = 63; if (absX < 0x1000000000000000000000000) { absX <<= 32; absXShift -= 32; } if (absX < 0x10000000000000000000000000000) { absX <<= 16; absXShift -= 16; } if (absX < 0x1000000000000000000000000000000) { absX <<= 8; absXShift -= 8; } if (absX < 0x10000000000000000000000000000000) { absX <<= 4; absXShift -= 4; } if (absX < 0x40000000000000000000000000000000) { absX <<= 2; absXShift -= 2; } if (absX < 0x80000000000000000000000000000000) { absX <<= 1; absXShift -= 1; } uint256 resultShift = 0; while (y != 0) { require (absXShift < 64); if (y & 0x1 != 0) { absResult = absResult * absX >> 127; resultShift += absXShift; if (absResult > 0x100000000000000000000000000000000) { absResult >>= 1; resultShift += 1; } } absX = absX * absX >> 127; absXShift <<= 1; if (absX >= 0x100000000000000000000000000000000) { absX >>= 1; absXShift += 1; } y >>= 1; } require (resultShift < 64); absResult >>= 64 - resultShift; } int256 result = negative ? -int256 (absResult) : int256 (absResult); require (result >= MIN_64x64 && result <= MAX_64x64); return int128 (result); } } /** * Calculate sqrt (x) rounding down. Revert if x < 0. * * @param x signed 64.64-bit fixed point number * @return signed 64.64-bit fixed point number */ function sqrt (int128 x) internal pure returns (int128) { unchecked { require (x >= 0); return int128 (sqrtu (uint256 (int256 (x)) << 64)); } } /** * Calculate binary logarithm of x. Revert if x <= 0. * * @param x signed 64.64-bit fixed point number * @return signed 64.64-bit fixed point number */ function log_2 (int128 x) internal pure returns (int128) { unchecked { require (x > 0); int256 msb = 0; int256 xc = x; if (xc >= 0x10000000000000000) { xc >>= 64; msb += 64; } if (xc >= 0x100000000) { xc >>= 32; msb += 32; } if (xc >= 0x10000) { xc >>= 16; msb += 16; } if (xc >= 0x100) { xc >>= 8; msb += 8; } if (xc >= 0x10) { xc >>= 4; msb += 4; } if (xc >= 0x4) { xc >>= 2; msb += 2; } if (xc >= 0x2) msb += 1; // No need to shift xc anymore int256 result = msb - 64 << 64; uint256 ux = uint256 (int256 (x)) << uint256 (127 - msb); for (int256 bit = 0x8000000000000000; bit > 0; bit >>= 1) { ux *= ux; uint256 b = ux >> 255; ux >>= 127 + b; result += bit * int256 (b); } return int128 (result); } } /** * Calculate natural logarithm of x. Revert if x <= 0. * * @param x signed 64.64-bit fixed point number * @return signed 64.64-bit fixed point number */ function ln (int128 x) internal pure returns (int128) { unchecked { require (x > 0); return int128 (int256 ( uint256 (int256 (log_2 (x))) * 0xB17217F7D1CF79ABC9E3B39803F2F6AF >> 128)); } } /** * Calculate binary exponent of x. Revert on overflow. * * @param x signed 64.64-bit fixed point number * @return signed 64.64-bit fixed point number */ function exp_2 (int128 x) internal pure returns (int128) { unchecked { require (x < 0x400000000000000000); // Overflow if (x < -0x400000000000000000) return 0; // Underflow uint256 result = 0x80000000000000000000000000000000; if (x & 0x8000000000000000 > 0) result = result * 0x16A09E667F3BCC908B2FB1366EA957D3E >> 128; if (x & 0x4000000000000000 > 0) result = result * 0x1306FE0A31B7152DE8D5A46305C85EDEC >> 128; if (x & 0x2000000000000000 > 0) result = result * 0x1172B83C7D517ADCDF7C8C50EB14A791F >> 128; if (x & 0x1000000000000000 > 0) result = result * 0x10B5586CF9890F6298B92B71842A98363 >> 128; if (x & 0x800000000000000 > 0) result = result * 0x1059B0D31585743AE7C548EB68CA417FD >> 128; if (x & 0x400000000000000 > 0) result = result * 0x102C9A3E778060EE6F7CACA4F7A29BDE8 >> 128; if (x & 0x200000000000000 > 0) result = result * 0x10163DA9FB33356D84A66AE336DCDFA3F >> 128; if (x & 0x100000000000000 > 0) result = result * 0x100B1AFA5ABCBED6129AB13EC11DC9543 >> 128; if (x & 0x80000000000000 > 0) result = result * 0x10058C86DA1C09EA1FF19D294CF2F679B >> 128; if (x & 0x40000000000000 > 0) result = result * 0x1002C605E2E8CEC506D21BFC89A23A00F >> 128; if (x & 0x20000000000000 > 0) result = result * 0x100162F3904051FA128BCA9C55C31E5DF >> 128; if (x & 0x10000000000000 > 0) result = result * 0x1000B175EFFDC76BA38E31671CA939725 >> 128; if (x & 0x8000000000000 > 0) result = result * 0x100058BA01FB9F96D6CACD4B180917C3D >> 128; if (x & 0x4000000000000 > 0) result = result * 0x10002C5CC37DA9491D0985C348C68E7B3 >> 128; if (x & 0x2000000000000 > 0) result = result * 0x1000162E525EE054754457D5995292026 >> 128; if (x & 0x1000000000000 > 0) result = result * 0x10000B17255775C040618BF4A4ADE83FC >> 128; if (x & 0x800000000000 > 0) result = result * 0x1000058B91B5BC9AE2EED81E9B7D4CFAB >> 128; if (x & 0x400000000000 > 0) result = result * 0x100002C5C89D5EC6CA4D7C8ACC017B7C9 >> 128; if (x & 0x200000000000 > 0) result = result * 0x10000162E43F4F831060E02D839A9D16D >> 128; if (x & 0x100000000000 > 0) result = result * 0x100000B1721BCFC99D9F890EA06911763 >> 128; if (x & 0x80000000000 > 0) result = result * 0x10000058B90CF1E6D97F9CA14DBCC1628 >> 128; if (x & 0x40000000000 > 0) result = result * 0x1000002C5C863B73F016468F6BAC5CA2B >> 128; if (x & 0x20000000000 > 0) result = result * 0x100000162E430E5A18F6119E3C02282A5 >> 128; if (x & 0x10000000000 > 0) result = result * 0x1000000B1721835514B86E6D96EFD1BFE >> 128; if (x & 0x8000000000 > 0) result = result * 0x100000058B90C0B48C6BE5DF846C5B2EF >> 128; if (x & 0x4000000000 > 0) result = result * 0x10000002C5C8601CC6B9E94213C72737A >> 128; if (x & 0x2000000000 > 0) result = result * 0x1000000162E42FFF037DF38AA2B219F06 >> 128; if (x & 0x1000000000 > 0) result = result * 0x10000000B17217FBA9C739AA5819F44F9 >> 128; if (x & 0x800000000 > 0) result = result * 0x1000000058B90BFCDEE5ACD3C1CEDC823 >> 128; if (x & 0x400000000 > 0) result = result * 0x100000002C5C85FE31F35A6A30DA1BE50 >> 128; if (x & 0x200000000 > 0) result = result * 0x10000000162E42FF0999CE3541B9FFFCF >> 128; if (x & 0x100000000 > 0) result = result * 0x100000000B17217F80F4EF5AADDA45554 >> 128; if (x & 0x80000000 > 0) result = result * 0x10000000058B90BFBF8479BD5A81B51AD >> 128; if (x & 0x40000000 > 0) result = result * 0x1000000002C5C85FDF84BD62AE30A74CC >> 128; if (x & 0x20000000 > 0) result = result * 0x100000000162E42FEFB2FED257559BDAA >> 128; if (x & 0x10000000 > 0) result = result * 0x1000000000B17217F7D5A7716BBA4A9AE >> 128; if (x & 0x8000000 > 0) result = result * 0x100000000058B90BFBE9DDBAC5E109CCE >> 128; if (x & 0x4000000 > 0) result = result * 0x10000000002C5C85FDF4B15DE6F17EB0D >> 128; if (x & 0x2000000 > 0) result = result * 0x1000000000162E42FEFA494F1478FDE05 >> 128; if (x & 0x1000000 > 0) result = result * 0x10000000000B17217F7D20CF927C8E94C >> 128; if (x & 0x800000 > 0) result = result * 0x1000000000058B90BFBE8F71CB4E4B33D >> 128; if (x & 0x400000 > 0) result = result * 0x100000000002C5C85FDF477B662B26945 >> 128; if (x & 0x200000 > 0) result = result * 0x10000000000162E42FEFA3AE53369388C >> 128; if (x & 0x100000 > 0) result = result * 0x100000000000B17217F7D1D351A389D40 >> 128; if (x & 0x80000 > 0) result = result * 0x10000000000058B90BFBE8E8B2D3D4EDE >> 128; if (x & 0x40000 > 0) result = result * 0x1000000000002C5C85FDF4741BEA6E77E >> 128; if (x & 0x20000 > 0) result = result * 0x100000000000162E42FEFA39FE95583C2 >> 128; if (x & 0x10000 > 0) result = result * 0x1000000000000B17217F7D1CFB72B45E1 >> 128; if (x & 0x8000 > 0) result = result * 0x100000000000058B90BFBE8E7CC35C3F0 >> 128; if (x & 0x4000 > 0) result = result * 0x10000000000002C5C85FDF473E242EA38 >> 128; if (x & 0x2000 > 0) result = result * 0x1000000000000162E42FEFA39F02B772C >> 128; if (x & 0x1000 > 0) result = result * 0x10000000000000B17217F7D1CF7D83C1A >> 128; if (x & 0x800 > 0) result = result * 0x1000000000000058B90BFBE8E7BDCBE2E >> 128; if (x & 0x400 > 0) result = result * 0x100000000000002C5C85FDF473DEA871F >> 128; if (x & 0x200 > 0) result = result * 0x10000000000000162E42FEFA39EF44D91 >> 128; if (x & 0x100 > 0) result = result * 0x100000000000000B17217F7D1CF79E949 >> 128; if (x & 0x80 > 0) result = result * 0x10000000000000058B90BFBE8E7BCE544 >> 128; if (x & 0x40 > 0) result = result * 0x1000000000000002C5C85FDF473DE6ECA >> 128; if (x & 0x20 > 0) result = result * 0x100000000000000162E42FEFA39EF366F >> 128; if (x & 0x10 > 0) result = result * 0x1000000000000000B17217F7D1CF79AFA >> 128; if (x & 0x8 > 0) result = result * 0x100000000000000058B90BFBE8E7BCD6D >> 128; if (x & 0x4 > 0) result = result * 0x10000000000000002C5C85FDF473DE6B2 >> 128; if (x & 0x2 > 0) result = result * 0x1000000000000000162E42FEFA39EF358 >> 128; if (x & 0x1 > 0) result = result * 0x10000000000000000B17217F7D1CF79AB >> 128; result >>= uint256 (int256 (63 - (x >> 64))); require (result <= uint256 (int256 (MAX_64x64))); return int128 (int256 (result)); } } /** * Calculate natural exponent of x. Revert on overflow. * * @param x signed 64.64-bit fixed point number * @return signed 64.64-bit fixed point number */ function exp (int128 x) internal pure returns (int128) { unchecked { require (x < 0x400000000000000000); // Overflow if (x < -0x400000000000000000) return 0; // Underflow return exp_2 ( int128 (int256 (x) * 0x171547652B82FE1777D0FFDA0D23A7D12 >> 128)); } } /** * Calculate x / y rounding towards zero, where x and y are unsigned 256-bit * integer numbers. Revert on overflow or when y is zero. * * @param x unsigned 256-bit integer number * @param y unsigned 256-bit integer number * @return unsigned 64.64-bit fixed point number */ function divuu (uint256 x, uint256 y) private pure returns (uint128) { unchecked { require (y != 0); uint256 result; if (x <= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF) result = (x << 64) / y; else { uint256 msb = 192; uint256 xc = x >> 192; if (xc >= 0x100000000) { xc >>= 32; msb += 32; } if (xc >= 0x10000) { xc >>= 16; msb += 16; } if (xc >= 0x100) { xc >>= 8; msb += 8; } if (xc >= 0x10) { xc >>= 4; msb += 4; } if (xc >= 0x4) { xc >>= 2; msb += 2; } if (xc >= 0x2) msb += 1; // No need to shift xc anymore result = (x << 255 - msb) / ((y - 1 >> msb - 191) + 1); require (result <= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF); uint256 hi = result * (y >> 128); uint256 lo = result * (y & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF); uint256 xh = x >> 192; uint256 xl = x << 64; if (xl < lo) xh -= 1; xl -= lo; // We rely on overflow behavior here lo = hi << 128; if (xl < lo) xh -= 1; xl -= lo; // We rely on overflow behavior here assert (xh == hi >> 128); result += xl / y; } require (result <= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF); return uint128 (result); } } /** * Calculate sqrt (x) rounding down, where x is unsigned 256-bit integer * number. * * @param x unsigned 256-bit integer number * @return unsigned 128-bit integer number */ function sqrtu (uint256 x) private pure returns (uint128) { unchecked { if (x == 0) return 0; else { uint256 xx = x; uint256 r = 1; if (xx >= 0x100000000000000000000000000000000) { xx >>= 128; r <<= 64; } if (xx >= 0x10000000000000000) { xx >>= 64; r <<= 32; } if (xx >= 0x100000000) { xx >>= 32; r <<= 16; } if (xx >= 0x10000) { xx >>= 16; r <<= 8; } if (xx >= 0x100) { xx >>= 8; r <<= 4; } if (xx >= 0x10) { xx >>= 4; r <<= 2; } if (xx >= 0x8) { r <<= 1; } r = (r + x / r) >> 1; r = (r + x / r) >> 1; r = (r + x / r) >> 1; r = (r + x / r) >> 1; r = (r + x / r) >> 1; r = (r + x / r) >> 1; r = (r + x / r) >> 1; // Seven iterations should be enough uint256 r1 = x / r; return uint128 (r < r1 ? r : r1); } } } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0; /// @title Base64 /// @author Brecht Devos - <[email protected]> /// @notice Provides functions for encoding/decoding base64 library Base64 { string internal constant TABLE_ENCODE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; bytes internal constant TABLE_DECODE = hex"0000000000000000000000000000000000000000000000000000000000000000" hex"00000000000000000000003e0000003f3435363738393a3b3c3d000000000000" hex"00000102030405060708090a0b0c0d0e0f101112131415161718190000000000" hex"001a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132330000000000"; function encode(bytes memory data) internal pure returns (string memory) { if (data.length == 0) return ''; // load the table into memory string memory table = TABLE_ENCODE; // multiply by 4/3 rounded up uint256 encodedLen = 4 * ((data.length + 2) / 3); // add some extra buffer at the end required for the writing string memory result = new string(encodedLen + 32); assembly { // set the actual output length mstore(result, encodedLen) // prepare the lookup table let tablePtr := add(table, 1) // input ptr let dataPtr := data let endPtr := add(dataPtr, mload(data)) // result ptr, jump over length let resultPtr := add(result, 32) // run over the input, 3 bytes at a time for {} lt(dataPtr, endPtr) {} { // read 3 bytes dataPtr := add(dataPtr, 3) let input := mload(dataPtr) // write 4 characters mstore8(resultPtr, mload(add(tablePtr, and(shr(18, input), 0x3F)))) resultPtr := add(resultPtr, 1) mstore8(resultPtr, mload(add(tablePtr, and(shr(12, input), 0x3F)))) resultPtr := add(resultPtr, 1) mstore8(resultPtr, mload(add(tablePtr, and(shr( 6, input), 0x3F)))) resultPtr := add(resultPtr, 1) mstore8(resultPtr, mload(add(tablePtr, and( input, 0x3F)))) resultPtr := add(resultPtr, 1) } // padding with '=' switch mod(mload(data), 3) case 1 { mstore(sub(resultPtr, 2), shl(240, 0x3d3d)) } case 2 { mstore(sub(resultPtr, 1), shl(248, 0x3d)) } } return result; } function decode(string memory _data) internal pure returns (bytes memory) { bytes memory data = bytes(_data); if (data.length == 0) return new bytes(0); require(data.length % 4 == 0, "invalid base64 decoder input"); // load the table into memory bytes memory table = TABLE_DECODE; // every 4 characters represent 3 bytes uint256 decodedLen = (data.length / 4) * 3; // add some extra buffer at the end required for the writing bytes memory result = new bytes(decodedLen + 32); assembly { // padding with '=' let lastBytes := mload(add(data, mload(data))) if eq(and(lastBytes, 0xFF), 0x3d) { decodedLen := sub(decodedLen, 1) if eq(and(lastBytes, 0xFFFF), 0x3d3d) { decodedLen := sub(decodedLen, 1) } } // set the actual output length mstore(result, decodedLen) // prepare the lookup table let tablePtr := add(table, 1) // input ptr let dataPtr := data let endPtr := add(dataPtr, mload(data)) // result ptr, jump over length let resultPtr := add(result, 32) // run over the input, 4 characters at a time for {} lt(dataPtr, endPtr) {} { // read 4 characters dataPtr := add(dataPtr, 4) let input := mload(dataPtr) // write 3 bytes let output := add( add( shl(18, and(mload(add(tablePtr, and(shr(24, input), 0xFF))), 0xFF)), shl(12, and(mload(add(tablePtr, and(shr(16, input), 0xFF))), 0xFF))), add( shl( 6, and(mload(add(tablePtr, and(shr( 8, input), 0xFF))), 0xFF)), and(mload(add(tablePtr, and( input , 0xFF))), 0xFF) ) ) mstore(resultPtr, shl(232, output)) resultPtr := add(resultPtr, 3) } } return result; } }
pragma solidity ^0.8.6; library Roots { // calculates a^(1/n) to dp decimal places // maxIts bounds the number of iterations performed function nthRoot(uint _a, uint _n, uint _dp, uint _maxIts) pure internal returns(uint) { assert (_n > 1); // The scale factor is a crude way to turn everything into integer calcs. // Actually do (a * (10 ^ ((dp + 1) * n))) ^ (1/n) // We calculate to one extra dp and round at the end uint one = 10 ** (1 + _dp); uint a0 = one ** _n * _a; // Initial guess: 1.0 uint xNew = one; uint iter = 0; while (iter < _maxIts) { uint x = xNew; uint t0 = x ** (_n - 1); if (x * t0 > a0) { xNew = x - (x - a0 / t0) / _n; } else { xNew = x + (a0 / t0 - x) / _n; } ++iter; if(xNew == x) { break; } } // Round to nearest in the last dp. return (xNew + 5) / 10; } }
/** * @dev String operations. */ library Strings { bytes16 private constant alphabet = "0123456789abcdef"; /** * @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); } }
{ "optimizer": { "enabled": true, "runs": 1000 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"registry_","type":"address"},{"internalType":"address","name":"omnibus_","type":"address"},{"internalType":"address","name":"metadataGenerator_","type":"address"},{"internalType":"address","name":"pak_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"alphaMass","type":"uint256"}],"name":"AlphaMassUpdate","type":"event"},{"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":"uint256","name":"fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toTokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"fromAddress","type":"address"},{"indexed":true,"internalType":"address","name":"toAddress","type":"address"}],"name":"ConsecutiveTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenIdBurned","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"tokenIdPersist","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"mass","type":"uint256"}],"name":"MassUpdate","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":[],"name":"_alphaId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_alphaMass","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_countMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_countToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_dead","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_massTotal","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_metadataGenerator","outputs":[{"internalType":"contract IMergeMetadata","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_mintingFinalized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_omnibus","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_pak","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_percentageRoyalty","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_percentageTotal","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_receiver","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_registry","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","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":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"value","type":"uint256"}],"name":"decodeClass","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"value","type":"uint256"}],"name":"decodeClassAndMass","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"value","type":"uint256"}],"name":"decodeMass","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"class","type":"uint256"},{"internalType":"uint256","name":"mass","type":"uint256"}],"name":"encodeClassAndMass","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"finalize","outputs":[],"stateMutability":"nonpayable","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":"getMergeCount","outputs":[{"internalType":"uint256","name":"mergeCount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getValueOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":[{"internalType":"address","name":"address_","type":"address"}],"name":"isBlacklisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"address_","type":"address"}],"name":"isWhitelisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"massOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenIdRcvr","type":"uint256"},{"internalType":"uint256","name":"tokenIdSndr","type":"uint256"}],"name":"merge","outputs":[{"internalType":"uint256","name":"tokenIdDead","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"values_","type":"uint256[]"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"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"},{"internalType":"uint256","name":"salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"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":[{"internalType":"address","name":"address_","type":"address"},{"internalType":"bool","name":"status","type":"bool"}],"name":"setBlacklistAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"metadataGenerator_","type":"address"}],"name":"setMetadataGenerator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"pak_","type":"address"}],"name":"setPak","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"percentageRoyalty_","type":"uint256"}],"name":"setRoyaltyBips","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"receiver_","type":"address"}],"name":"setRoyaltyReceiver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"tokenOf","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":"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":"address_","type":"address"},{"internalType":"bool","name":"status","type":"bool"}],"name":"whitelistUpdate","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60c06040523480156200001157600080fd5b506040516200347e3803806200347e83398101604081905262000034916200021a565b6001600160601b0319606085901b1660a052600c80546001600160a01b038581166001600160a01b03199283161790925560008054928516929091169190911790556040805180820190915260068082526536b2b933b29760d11b6020909201918252620000a59160019162000157565b50604080518082019091526001808252606d60f81b6020909201918252620000d09160029162000157565b50600a80546001600160a01b039283166001600160a01b03199182168117909255600d80548216909217909155600b805490911661dead1790556127106080526103e8600655306000908152600e60209081526040808320805460ff199081166001908117909255969094168352600f909152902080549093161790915550620002b49050565b828054620001659062000277565b90600052602060002090601f016020900481019282620001895760008555620001d4565b82601f10620001a457805160ff1916838001178555620001d4565b82800160010185558215620001d4579182015b82811115620001d4578251825591602001919060010190620001b7565b50620001e2929150620001e6565b5090565b5b80821115620001e25760008155600101620001e7565b80516001600160a01b03811681146200021557600080fd5b919050565b600080600080608085870312156200023157600080fd5b6200023c85620001fd565b93506200024c60208601620001fd565b92506200025c60408601620001fd565b91506200026c60608601620001fd565b905092959194509250565b600181811c908216806200028c57607f821691505b60208210811415620002ae57634e487b7160e01b600052602260045260246000fd5b50919050565b60805160a05160601c61318c620002f26000396000818161059501526119df0152600081816105cf01528181610bca0152610e55015261318c6000f3fe608060405234801561001057600080fd5b506004361061032b5760003560e01c80636352211e116101b2578063c87b56dd116100f9578063e985e9c5116100a2578063f8e93ef91161007c578063f8e93ef91461072f578063fb1fac1814610742578063fe575a871461074b578063ff5b6ab11461077757600080fd5b8063e985e9c5146106d7578063eafe706e14610713578063ef0ceec71461072657600080fd5b8063dbf65de0116100d3578063dbf65de0146106a4578063dcfb3833146106b7578063e2da569b146106ca57600080fd5b8063c87b56dd1461066b578063c94e3c971461067e578063d1c2babb1461069157600080fd5b806395d89b411161015b578063a8bbd73311610135578063a8bbd73314610632578063b88d4fde14610645578063bf3e6d9a1461065857600080fd5b806395d89b4114610604578063a22cb4651461060c578063a75551601461061f57600080fd5b80638dc251e31161018c5780638dc251e3146105b75780639121ac0d146105ca57806393777369146105f157600080fd5b80636352211e1461055457806370a082311461056757806379cbc5fa1461059057600080fd5b80633af32abf1161027657806343fa2c9c1161021f57806355d5f963116101f957806355d5f9631461051b57806361ec1bb61461052e578063629a53341461054157600080fd5b806343fa2c9c146104f75780634bb278f3146105005780635342271d1461050857600080fd5b806342842e0e1161025057806342842e0e146104a857806342966c68146104bb57806342ec38e2146104ce57600080fd5b80633af32abf1461046a5780633afb4f7314610496578063426a64a41461049f57600080fd5b80630ab2b6b9116102d85780632a55205a116102b25780632a55205a146104125780632ca1aa1b14610444578063351c56b51461045757600080fd5b80630ab2b6b9146103d757806318160ddd146103f757806323b872dd146103ff57600080fd5b806306fdde031161030957806306fdde031461039a578063081812fc146103af578063095ea7b3146103c257600080fd5b806301ffc9a714610330578063029108911461035857806302964ff11461036f575b600080fd5b61034361033e366004612e51565b61079f565b60405190151581526020015b60405180910390f35b61036160085481565b60405190815260200161034f565b600d54610382906001600160a01b031681565b6040516001600160a01b03909116815260200161034f565b6103a2610881565b60405161034f9190612f92565b6103826103bd366004612ef9565b610913565b6103d56103d0366004612d5d565b6109a4565b005b6103616103e5366004612ef9565b60009081526015602052604090205490565b600554610361565b6103d561040d366004612c3f565b610b36565b610425610420366004612f12565b610bc3565b604080516001600160a01b03909316835260208301919091520161034f565b610361610452366004612ef9565b610c18565b600c54610382906001600160a01b031681565b610343610478366004612bf1565b6001600160a01b03166000908152600f602052604090205460ff1690565b61036160045481565b61036160075481565b6103d56104b6366004612c3f565b610c9b565b6103d56104c9366004612ef9565b610cb6565b6103616104dc366004612bf1565b6001600160a01b031660009081526010602052604090205490565b61036160065481565b6103d5610d3d565b610361610516366004612ef9565b610daf565b600054610382906001600160a01b031681565b61036161053c366004612ef9565b610dd8565b6103d561054f366004612ef9565b610df0565b610382610562366004612ef9565b610eee565b610361610575366004612bf1565b6001600160a01b031660009081526011602052604090205490565b6103827f000000000000000000000000000000000000000000000000000000000000000081565b6103d56105c5366004612bf1565b610f8b565b6103617f000000000000000000000000000000000000000000000000000000000000000081565b6103d56105ff366004612bf1565b611010565b6103a2611095565b6103d561061a366004612d26565b6110a4565b6103d561062d366004612d26565b611169565b6103d5610640366004612bf1565b61127b565b6103d5610653366004612c7b565b611300565b610361610666366004612f12565b61140b565b6103a2610679366004612ef9565b61150a565b600a54610382906001600160a01b031681565b61036161069f366004612f12565b611681565b6103d56106b2366004612d26565b611814565b600b54610382906001600160a01b031681565b6003546103439060ff1681565b6103436106e5366004612c0c565b6001600160a01b03918216600090815260146020908152604080832093909416825291909152205460ff1690565b610361610721366004612ef9565b6119c5565b61036160095481565b6103d561073d366004612d87565b6119d5565b61036160055481565b610343610759366004612bf1565b6001600160a01b03166000908152600e602052604090205460ff1690565b61078a610785366004612ef9565b611ddc565b6040805192835260208301919091520161034f565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007f80ac58cd000000000000000000000000000000000000000000000000000000007f2a55205a000000000000000000000000000000000000000000000000000000007f5b5e139f000000000000000000000000000000000000000000000000000000006001600160e01b0319861684148061084957506001600160e01b0319868116908416145b8061086057506001600160e01b0319868116908316145b8061087757506001600160e01b0319868116908216145b9695505050505050565b6060600180546108909061309a565b80601f01602080910402602001604051908101604052809291908181526020018280546108bc9061309a565b80156109095780601f106108de57610100808354040283529160200191610909565b820191906000526020600020905b8154815290600101906020018083116108ec57829003601f168201915b5050505050905090565b6000818152601560205260408120546109885760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152601360205260409020546001600160a01b031690565b60006109af82610eee565b9050806001600160a01b0316836001600160a01b03161415610a395760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f7200000000000000000000000000000000000000000000000000000000000000606482015260840161097f565b336001600160a01b0382161480610a555750610a5581336106e5565b610ac75760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000606482015260840161097f565b600082815260136020526040902080546001600160a01b0319166001600160a01b0385169081179091558290610afc82610eee565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a4505050565b610b41335b82611ef4565b610bb35760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f766564000000000000000000000000000000606482015260840161097f565b610bbe838383611fe2565b505050565b60008060007f000000000000000000000000000000000000000000000000000000000000000060065485610bf79190613038565b610c019190613016565b600d546001600160a01b0316969095509350505050565b600081815260156020526040812054610c885760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b606482015260840161097f565b5060009081526016602052604090205490565b610bbe83838360405180602001604052806000815250611300565b610cbf33610b3b565b610d315760405162461bcd60e51b815260206004820152602860248201527f4552433732313a2063616c6c6572206973206e6f74206f776e6572206e6f722060448201527f617070726f766564000000000000000000000000000000000000000000000000606482015260840161097f565b610d3a8161262b565b50565b600a546001600160a01b0316336001600160a01b031614610da05760405162461bcd60e51b815260206004820152601c60248201527f4d657267653a206d73672e73656e646572206973206e6f742070616b00000000604482015260640161097f565b6003805460ff19166001179055565b6000610dd2610dcb6305f5e100610dc5856119c5565b9061276b565b8390612777565b92915050565b600081815260156020526040812054610dd290610daf565b600a546001600160a01b0316336001600160a01b031614610e535760405162461bcd60e51b815260206004820152601c60248201527f4d657267653a206d73672e73656e646572206973206e6f742070616b00000000604482015260640161097f565b7f0000000000000000000000000000000000000000000000000000000000000000811115610ee95760405162461bcd60e51b815260206004820152602660248201527f4d657267653a20496c6c6567616c20617267756d656e74206d6f72652074686160448201527f6e20313030250000000000000000000000000000000000000000000000000000606482015260840161097f565b600655565b600081815260156020526040812054610f6f5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201527f656e7420746f6b656e0000000000000000000000000000000000000000000000606482015260840161097f565b506000908152601260205260409020546001600160a01b031690565b600a546001600160a01b0316336001600160a01b031614610fee5760405162461bcd60e51b815260206004820152601c60248201527f4d657267653a206d73672e73656e646572206973206e6f742070616b00000000604482015260640161097f565b600d80546001600160a01b0319166001600160a01b0392909216919091179055565b600a546001600160a01b0316336001600160a01b0316146110735760405162461bcd60e51b815260206004820152601c60248201527f4d657267653a206d73672e73656e646572206973206e6f742070616b00000000604482015260640161097f565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6060600280546108909061309a565b6001600160a01b0382163314156110fd5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604482015260640161097f565b3360008181526014602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b600a546001600160a01b0316336001600160a01b0316146111cc5760405162461bcd60e51b815260206004820152601c60248201527f4d657267653a206d73672e73656e646572206973206e6f742070616b00000000604482015260640161097f565b600c546001600160a01b03838116911614156112505760405162461bcd60e51b815260206004820152602d60248201527f4d657267653a20496c6c6567616c20617267756d656e7420616464726573735f60448201527f206973205f6f6d6e696275732e00000000000000000000000000000000000000606482015260840161097f565b6001600160a01b03919091166000908152600e60205260409020805460ff1916911515919091179055565b600a546001600160a01b0316336001600160a01b0316146112de5760405162461bcd60e51b815260206004820152601c60248201527f4d657267653a206d73672e73656e646572206973206e6f742070616b00000000604482015260640161097f565b600a80546001600160a01b0319166001600160a01b0392909216919091179055565b61130a3383611ef4565b61137c5760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f766564000000000000000000000000000000606482015260840161097f565b611387848484611fe2565b61139384848484612783565b6114055760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e7465720000000000000000000000000000606482015260840161097f565b50505050565b6000808311801561141d575060048311155b6114775760405162461bcd60e51b815260206004820152602560248201527f4d657267653a20436c617373206d757374206265206265747765656e203120616044820152643732101a1760d91b606482015260840161097f565b60008211801561148a57506305f5e0ff82105b6114ea5760405162461bcd60e51b815260206004820152602b60248201527f4d657267653a204d617373206d757374206265206265747765656e203120616e60448201526a32101c9c9c9c9c9c9c9c9760a91b606482015260840161097f565b816114f9846305f5e100613038565b6115039190612ffe565b9392505050565b60008181526015602052604090205460609061157d5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b606482015260840161097f565b6000805483825260156020526040909120546001600160a01b039091169063592fa5cc9084906115ac906119c5565b6000868152601560205260409020546115c490610daf565b6008546000908152601560205260409020546115df90610daf565b60085488146115ed89610c18565b6040516001600160e01b031960e089901b16815260048101969096526024860194909452604485019290925260648401521515608483015260a482015260c40160006040518083038186803b15801561164557600080fd5b505afa158015611659573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610dd29190810190612e8b565b336000908152600f602052604081205460ff166116e05760405162461bcd60e51b815260206004820152601960248201527f4d657267653a20496e76616c6964206d73672e73656e64657200000000000000604482015260640161097f565b60006116eb84610eee565b905060006116f884610eee565b9050806001600160a01b0316826001600160a01b0316146117815760405162461bcd60e51b815260206004820152602860248201527f4d657267653a20496c6c6567616c20617267756d656e7420646973706172617460448201527f65206f776e65722e000000000000000000000000000000000000000000000000606482015260840161097f565b336001600160a01b038316146117ff5760405162461bcd60e51b815260206004820152602660248201527f4552433732313a206d73672e73656e646572206973206e6f7420746f6b656e2060448201527f6f776e65722e0000000000000000000000000000000000000000000000000000606482015260840161097f565b61180b858584846128dd565b95945050505050565b600a546001600160a01b0316336001600160a01b0316146118775760405162461bcd60e51b815260206004820152601c60248201527f4d657267653a206d73672e73656e646572206973206e6f742070616b00000000604482015260640161097f565b600c546001600160a01b038381169116141561190057806119005760405162461bcd60e51b815260206004820152603260248201527f4d657267653a20496c6c6567616c20617267756d656e74205f6f6d6e6962757360448201527f2063616e27742062652072656d6f7665642e0000000000000000000000000000606482015260840161097f565b8061199a576001611926836001600160a01b031660009081526011602052604090205490565b111561199a5760405162461bcd60e51b815260206004820152603960248201527f4d657267653a20416464726573732077697468206d6f7265207468616e206f6e60448201527f6520746f6b656e2063616e27742062652072656d6f7665642e00000000000000606482015260840161097f565b6001600160a01b03919091166000908152600f60205260409020805460ff1916911515919091179055565b6000610dd2826305f5e100612b5b565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001663e37ce6fa336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260240160206040518083038186803b158015611a4457600080fd5b505afa158015611a58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a7c9190612e34565b611ac85760405162461bcd60e51b815260206004820152601960248201527f4d657267653a20496e76616c6964206d73672e73656e64657200000000000000604482015260640161097f565b60035460ff1615611b1b5760405162461bcd60e51b815260206004820152601c60248201527f4d657267653a204d696e74696e672069732066696e616c697a65642e00000000604482015260640161097f565b6004546008546007546000919060015b85518111611d225780600454611b419190612ffe565b945085611b4f600183613057565b81518110611b5f57611b5f613106565b602090810291909101810151600087815260158352604080822092909255600c54601290935290812080546001600160a01b0319166001600160a01b039093169290921790915580611bd388611bb6600186613057565b81518110611bc657611bc6613106565b6020026020010151611ddc565b91509150600082118015611be8575060048211155b611c425760405162461bcd60e51b815260206004820152602560248201527f4d657267653a20436c617373206d757374206265206265747765656e203120616044820152643732101a1760d91b606482015260840161097f565b600081118015611c5557506305f5e0ff81105b611cb55760405162461bcd60e51b815260206004820152602b60248201527f4d657267653a204d617373206d757374206265206265747765656e203120616e60448201526a32101c9c9c9c9c9c9c9c9760a91b606482015260840161097f565b80841015611cc4578093508694505b611cce8187612ffe565b600c5460405191975088916001600160a01b03909116906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a450508080611d1a906130d5565b915050611b2b565b50845160046000828254611d369190612ffe565b9091555050845160058054600090611d4f908490612ffe565b9091555050600454600c546001600160a01b031660009081526011602052604081209190915560098054859290611d87908490612ffe565b90915550506008548214611dd5576008829055600781905560405181815282907fdd1fd86a575cfed4833cea35236e5c94a92cead19b6d0e8e1b89ed586981ab509060200160405180910390a25b5050505050565b60008080611dee846305f5e100612b5b565b90506000611e0a611e03836305f5e10061276b565b8690612777565b9050600082118015611e1d575060048211155b611e775760405162461bcd60e51b815260206004820152602560248201527f4d657267653a20436c617373206d757374206265206265747765656e203120616044820152643732101a1760d91b606482015260840161097f565b600081118015611e8a57506305f5e0ff81105b611eea5760405162461bcd60e51b815260206004820152602b60248201527f4d657267653a204d617373206d757374206265206265747765656e203120616e60448201526a32101c9c9c9c9c9c9c9c9760a91b606482015260840161097f565b9094909350915050565b600081815260156020526040812054611f645760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b606482015260840161097f565b6000611f6f83610eee565b9050806001600160a01b0316846001600160a01b03161480611faa5750836001600160a01b0316611f9f84610913565b6001600160a01b0316145b80611fda57506001600160a01b0380821660009081526014602090815260408083209388168352929052205460ff165b949350505050565b6000818152601560205260409020546120635760405162461bcd60e51b815260206004820152602e60248201527f4552433732313a207472616e7366657220617474656d707420666f72206e6f6e60448201527f6578697374656e7420746f6b656e000000000000000000000000000000000000606482015260840161097f565b826001600160a01b031661207682610eee565b6001600160a01b0316146120f25760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201527f73206e6f74206f776e0000000000000000000000000000000000000000000000606482015260840161097f565b6001600160a01b03821661216d5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f7265737300000000000000000000000000000000000000000000000000000000606482015260840161097f565b6001600160a01b0382166000908152600e602052604090205460ff16156121fc5760405162461bcd60e51b815260206004820152602c60248201527f4d657267653a207472616e7366657220617474656d707420746f20626c61636b60448201527f6c69737420616464726573730000000000000000000000000000000000000000606482015260840161097f565b816001600160a01b0316836001600160a01b0316141561225e5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a207472616e7366657220617474656d707420746f2073656c66604482015260640161097f565b600b546001600160a01b038381169116141561227d57610bbe8161262b565b612288600082612b67565b6001600160a01b038381166000908152600f602052604080822054928516825290205460ff9182169116811580156122bd5750805b1561236d576001600160a01b0385811660009081526010602090815260408083208390558683526012825280832080546001600160a01b03191694891694851790559282526011905290812080546001929061231a908490612ffe565b90915550506001600160a01b03808616600081815260116020526040808220829055518693881692917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a45050505050565b8180156123775750805b15612436576001600160a01b03841660009081526011602052604081208054600192906123a5908490612ffe565b90915550506001600160a01b03851660009081526011602052604081208054600192906123d3908490613057565b909155505060008381526012602052604080822080546001600160a01b0319166001600160a01b0388811691821790925591518693918916917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a45050505050565b6001600160a01b03841660009081526010602052604090205461251b576001600160a01b03841660008181526010602090815260408083208790558683526012825280832080546001600160a01b03191685179055928252601190529081208054600192906124a6908490612ffe565b90915550506001600160a01b03851660009081526011602052604081208054600192906124d4908490613057565b909155505060405183906001600160a01b0380871691908816907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90600090a45050505050565b82846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a46001600160a01b0384166000908152601060205260408120549084906125848383898b6128dd565b9050828114156125cc57600082815260126020908152604080832080546001600160a01b0319166001600160a01b038c16908117909155835260109091529020829055612606565b600083815260126020908152604080832080546001600160a01b0319166001600160a01b038c169081179091558352601090915290208390555b600090815260126020526040902080546001600160a01b031916905550505050505050565b600061263682610eee565b9050612643600083612b67565b60008281526015602052604090205461265b90610daf565b6009600082825461266c9190613057565b90915550506001600160a01b03811660009081526010602090815260408083208390558483526012825280832080546001600160a01b03191690556015909152812081905560058054600192906126c4908490613057565b90915550506001600160a01b03811660009081526011602052604081208054600192906126f2908490613057565b909155505060405160008082529083907f7ba170514e8ea35827dbbd10c6d3376ca77ff64b62e4b0a395bac9b142dc81dc9060200160405180910390a360405182906000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b60006115038284613038565b60006115038284613057565b6000833b156128d257604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906127be903390899088908890600401612f60565b602060405180830381600087803b1580156127d857600080fd5b505af1925050508015612808575060408051601f3d908101601f1916820190925261280591810190612e6e565b60015b6128b8573d808015612836576040519150601f19603f3d011682016040523d82523d6000602084013e61283b565b606091505b5080516128b05760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e7465720000000000000000000000000000606482015260840161097f565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611fda565b506001949350505050565b6000838514156129555760405162461bcd60e51b815260206004820152602a60248201527f4d657267653a20496c6c6567616c20617267756d656e74206964656e7469636160448201527f6c20746f6b656e49642e00000000000000000000000000000000000000000000606482015260840161097f565b60008581526015602052604081205461296d90610daf565b6000868152601560205260408120549192509061298990610daf565b6001600160a01b0386166000908152600f602052604090205490915060ff166129c9576001600160a01b0385166000908152601160205260409020600190555b6001600160a01b03841660009081526011602052604081208054600192906129f2908490613057565b90915550829050818888828410612a0f5750839250849150889050895b816000612a1b82610eee565b6001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a460008181526015602052604081208054869290612a6e908490612ffe565b9091555060009050612a808585612ffe565b9050600754811115612acc576008829055600781905560405181815282907fdd1fd86a575cfed4833cea35236e5c94a92cead19b6d0e8e1b89ed586981ab509060200160405180910390a25b6000828152601660205260408120805491612ae6836130d5565b909155505060008381526015602052604081208190556005805460019290612b0f908490613057565b9091555050604051818152829084907f7ba170514e8ea35827dbbd10c6d3376ca77ff64b62e4b0a395bac9b142dc81dc9060200160405180910390a350909a9950505050505050505050565b60006115038284613016565b600081815260136020526040902080546001600160a01b0319166001600160a01b0384169081179091558190612b9c82610eee565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b80356001600160a01b0381168114612bec57600080fd5b919050565b600060208284031215612c0357600080fd5b61150382612bd5565b60008060408385031215612c1f57600080fd5b612c2883612bd5565b9150612c3660208401612bd5565b90509250929050565b600080600060608486031215612c5457600080fd5b612c5d84612bd5565b9250612c6b60208501612bd5565b9150604084013590509250925092565b60008060008060808587031215612c9157600080fd5b612c9a85612bd5565b9350612ca860208601612bd5565b925060408501359150606085013567ffffffffffffffff811115612ccb57600080fd5b8501601f81018713612cdc57600080fd5b8035612cef612cea82612fd6565b612fa5565b818152886020838501011115612d0457600080fd5b8160208401602083013760006020838301015280935050505092959194509250565b60008060408385031215612d3957600080fd5b612d4283612bd5565b91506020830135612d5281613132565b809150509250929050565b60008060408385031215612d7057600080fd5b612d7983612bd5565b946020939093013593505050565b60006020808385031215612d9a57600080fd5b823567ffffffffffffffff80821115612db257600080fd5b818501915085601f830112612dc657600080fd5b813581811115612dd857612dd861311c565b8060051b9150612de9848301612fa5565b8181528481019084860184860187018a1015612e0457600080fd5b600095505b83861015612e27578035835260019590950194918601918601612e09565b5098975050505050505050565b600060208284031215612e4657600080fd5b815161150381613132565b600060208284031215612e6357600080fd5b813561150381613140565b600060208284031215612e8057600080fd5b815161150381613140565b600060208284031215612e9d57600080fd5b815167ffffffffffffffff811115612eb457600080fd5b8201601f81018413612ec557600080fd5b8051612ed3612cea82612fd6565b818152856020838501011115612ee857600080fd5b61180b82602083016020860161306e565b600060208284031215612f0b57600080fd5b5035919050565b60008060408385031215612f2557600080fd5b50508035926020909101359150565b60008151808452612f4c81602086016020860161306e565b601f01601f19169290920160200192915050565b60006001600160a01b038087168352808616602084015250836040830152608060608301526108776080830184612f34565b6020815260006115036020830184612f34565b604051601f8201601f1916810167ffffffffffffffff81118282101715612fce57612fce61311c565b604052919050565b600067ffffffffffffffff821115612ff057612ff061311c565b50601f01601f191660200190565b60008219821115613011576130116130f0565b500190565b60008261303357634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615613052576130526130f0565b500290565b600082821015613069576130696130f0565b500390565b60005b83811015613089578181015183820152602001613071565b838111156114055750506000910152565b600181811c908216806130ae57607f821691505b602082108114156130cf57634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156130e9576130e96130f0565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b8015158114610d3a57600080fd5b6001600160e01b031981168114610d3a57600080fdfea2646970667358221220c0881db4473ef4231de6d14a3a83306a6ab9a66ac1277ee796a71046bac2994864736f6c634300080600330000000000000000000000006e53130ddff21e3bc963ee902005223b9a202106000000000000000000000000e052113bd7d7700d623414a0a4585bcae754e9d50000000000000000000000004e1e18aaccdf9acfd2e8847654a3871dfd234f020000000000000000000000002ce780d7c743a57791b835a9d6f998b15bbba5a4
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061032b5760003560e01c80636352211e116101b2578063c87b56dd116100f9578063e985e9c5116100a2578063f8e93ef91161007c578063f8e93ef91461072f578063fb1fac1814610742578063fe575a871461074b578063ff5b6ab11461077757600080fd5b8063e985e9c5146106d7578063eafe706e14610713578063ef0ceec71461072657600080fd5b8063dbf65de0116100d3578063dbf65de0146106a4578063dcfb3833146106b7578063e2da569b146106ca57600080fd5b8063c87b56dd1461066b578063c94e3c971461067e578063d1c2babb1461069157600080fd5b806395d89b411161015b578063a8bbd73311610135578063a8bbd73314610632578063b88d4fde14610645578063bf3e6d9a1461065857600080fd5b806395d89b4114610604578063a22cb4651461060c578063a75551601461061f57600080fd5b80638dc251e31161018c5780638dc251e3146105b75780639121ac0d146105ca57806393777369146105f157600080fd5b80636352211e1461055457806370a082311461056757806379cbc5fa1461059057600080fd5b80633af32abf1161027657806343fa2c9c1161021f57806355d5f963116101f957806355d5f9631461051b57806361ec1bb61461052e578063629a53341461054157600080fd5b806343fa2c9c146104f75780634bb278f3146105005780635342271d1461050857600080fd5b806342842e0e1161025057806342842e0e146104a857806342966c68146104bb57806342ec38e2146104ce57600080fd5b80633af32abf1461046a5780633afb4f7314610496578063426a64a41461049f57600080fd5b80630ab2b6b9116102d85780632a55205a116102b25780632a55205a146104125780632ca1aa1b14610444578063351c56b51461045757600080fd5b80630ab2b6b9146103d757806318160ddd146103f757806323b872dd146103ff57600080fd5b806306fdde031161030957806306fdde031461039a578063081812fc146103af578063095ea7b3146103c257600080fd5b806301ffc9a714610330578063029108911461035857806302964ff11461036f575b600080fd5b61034361033e366004612e51565b61079f565b60405190151581526020015b60405180910390f35b61036160085481565b60405190815260200161034f565b600d54610382906001600160a01b031681565b6040516001600160a01b03909116815260200161034f565b6103a2610881565b60405161034f9190612f92565b6103826103bd366004612ef9565b610913565b6103d56103d0366004612d5d565b6109a4565b005b6103616103e5366004612ef9565b60009081526015602052604090205490565b600554610361565b6103d561040d366004612c3f565b610b36565b610425610420366004612f12565b610bc3565b604080516001600160a01b03909316835260208301919091520161034f565b610361610452366004612ef9565b610c18565b600c54610382906001600160a01b031681565b610343610478366004612bf1565b6001600160a01b03166000908152600f602052604090205460ff1690565b61036160045481565b61036160075481565b6103d56104b6366004612c3f565b610c9b565b6103d56104c9366004612ef9565b610cb6565b6103616104dc366004612bf1565b6001600160a01b031660009081526010602052604090205490565b61036160065481565b6103d5610d3d565b610361610516366004612ef9565b610daf565b600054610382906001600160a01b031681565b61036161053c366004612ef9565b610dd8565b6103d561054f366004612ef9565b610df0565b610382610562366004612ef9565b610eee565b610361610575366004612bf1565b6001600160a01b031660009081526011602052604090205490565b6103827f0000000000000000000000006e53130ddff21e3bc963ee902005223b9a20210681565b6103d56105c5366004612bf1565b610f8b565b6103617f000000000000000000000000000000000000000000000000000000000000271081565b6103d56105ff366004612bf1565b611010565b6103a2611095565b6103d561061a366004612d26565b6110a4565b6103d561062d366004612d26565b611169565b6103d5610640366004612bf1565b61127b565b6103d5610653366004612c7b565b611300565b610361610666366004612f12565b61140b565b6103a2610679366004612ef9565b61150a565b600a54610382906001600160a01b031681565b61036161069f366004612f12565b611681565b6103d56106b2366004612d26565b611814565b600b54610382906001600160a01b031681565b6003546103439060ff1681565b6103436106e5366004612c0c565b6001600160a01b03918216600090815260146020908152604080832093909416825291909152205460ff1690565b610361610721366004612ef9565b6119c5565b61036160095481565b6103d561073d366004612d87565b6119d5565b61036160055481565b610343610759366004612bf1565b6001600160a01b03166000908152600e602052604090205460ff1690565b61078a610785366004612ef9565b611ddc565b6040805192835260208301919091520161034f565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007f80ac58cd000000000000000000000000000000000000000000000000000000007f2a55205a000000000000000000000000000000000000000000000000000000007f5b5e139f000000000000000000000000000000000000000000000000000000006001600160e01b0319861684148061084957506001600160e01b0319868116908416145b8061086057506001600160e01b0319868116908316145b8061087757506001600160e01b0319868116908216145b9695505050505050565b6060600180546108909061309a565b80601f01602080910402602001604051908101604052809291908181526020018280546108bc9061309a565b80156109095780601f106108de57610100808354040283529160200191610909565b820191906000526020600020905b8154815290600101906020018083116108ec57829003601f168201915b5050505050905090565b6000818152601560205260408120546109885760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152601360205260409020546001600160a01b031690565b60006109af82610eee565b9050806001600160a01b0316836001600160a01b03161415610a395760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f7200000000000000000000000000000000000000000000000000000000000000606482015260840161097f565b336001600160a01b0382161480610a555750610a5581336106e5565b610ac75760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000606482015260840161097f565b600082815260136020526040902080546001600160a01b0319166001600160a01b0385169081179091558290610afc82610eee565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a4505050565b610b41335b82611ef4565b610bb35760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f766564000000000000000000000000000000606482015260840161097f565b610bbe838383611fe2565b505050565b60008060007f000000000000000000000000000000000000000000000000000000000000271060065485610bf79190613038565b610c019190613016565b600d546001600160a01b0316969095509350505050565b600081815260156020526040812054610c885760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b606482015260840161097f565b5060009081526016602052604090205490565b610bbe83838360405180602001604052806000815250611300565b610cbf33610b3b565b610d315760405162461bcd60e51b815260206004820152602860248201527f4552433732313a2063616c6c6572206973206e6f74206f776e6572206e6f722060448201527f617070726f766564000000000000000000000000000000000000000000000000606482015260840161097f565b610d3a8161262b565b50565b600a546001600160a01b0316336001600160a01b031614610da05760405162461bcd60e51b815260206004820152601c60248201527f4d657267653a206d73672e73656e646572206973206e6f742070616b00000000604482015260640161097f565b6003805460ff19166001179055565b6000610dd2610dcb6305f5e100610dc5856119c5565b9061276b565b8390612777565b92915050565b600081815260156020526040812054610dd290610daf565b600a546001600160a01b0316336001600160a01b031614610e535760405162461bcd60e51b815260206004820152601c60248201527f4d657267653a206d73672e73656e646572206973206e6f742070616b00000000604482015260640161097f565b7f0000000000000000000000000000000000000000000000000000000000002710811115610ee95760405162461bcd60e51b815260206004820152602660248201527f4d657267653a20496c6c6567616c20617267756d656e74206d6f72652074686160448201527f6e20313030250000000000000000000000000000000000000000000000000000606482015260840161097f565b600655565b600081815260156020526040812054610f6f5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201527f656e7420746f6b656e0000000000000000000000000000000000000000000000606482015260840161097f565b506000908152601260205260409020546001600160a01b031690565b600a546001600160a01b0316336001600160a01b031614610fee5760405162461bcd60e51b815260206004820152601c60248201527f4d657267653a206d73672e73656e646572206973206e6f742070616b00000000604482015260640161097f565b600d80546001600160a01b0319166001600160a01b0392909216919091179055565b600a546001600160a01b0316336001600160a01b0316146110735760405162461bcd60e51b815260206004820152601c60248201527f4d657267653a206d73672e73656e646572206973206e6f742070616b00000000604482015260640161097f565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6060600280546108909061309a565b6001600160a01b0382163314156110fd5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604482015260640161097f565b3360008181526014602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b600a546001600160a01b0316336001600160a01b0316146111cc5760405162461bcd60e51b815260206004820152601c60248201527f4d657267653a206d73672e73656e646572206973206e6f742070616b00000000604482015260640161097f565b600c546001600160a01b03838116911614156112505760405162461bcd60e51b815260206004820152602d60248201527f4d657267653a20496c6c6567616c20617267756d656e7420616464726573735f60448201527f206973205f6f6d6e696275732e00000000000000000000000000000000000000606482015260840161097f565b6001600160a01b03919091166000908152600e60205260409020805460ff1916911515919091179055565b600a546001600160a01b0316336001600160a01b0316146112de5760405162461bcd60e51b815260206004820152601c60248201527f4d657267653a206d73672e73656e646572206973206e6f742070616b00000000604482015260640161097f565b600a80546001600160a01b0319166001600160a01b0392909216919091179055565b61130a3383611ef4565b61137c5760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f766564000000000000000000000000000000606482015260840161097f565b611387848484611fe2565b61139384848484612783565b6114055760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e7465720000000000000000000000000000606482015260840161097f565b50505050565b6000808311801561141d575060048311155b6114775760405162461bcd60e51b815260206004820152602560248201527f4d657267653a20436c617373206d757374206265206265747765656e203120616044820152643732101a1760d91b606482015260840161097f565b60008211801561148a57506305f5e0ff82105b6114ea5760405162461bcd60e51b815260206004820152602b60248201527f4d657267653a204d617373206d757374206265206265747765656e203120616e60448201526a32101c9c9c9c9c9c9c9c9760a91b606482015260840161097f565b816114f9846305f5e100613038565b6115039190612ffe565b9392505050565b60008181526015602052604090205460609061157d5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b606482015260840161097f565b6000805483825260156020526040909120546001600160a01b039091169063592fa5cc9084906115ac906119c5565b6000868152601560205260409020546115c490610daf565b6008546000908152601560205260409020546115df90610daf565b60085488146115ed89610c18565b6040516001600160e01b031960e089901b16815260048101969096526024860194909452604485019290925260648401521515608483015260a482015260c40160006040518083038186803b15801561164557600080fd5b505afa158015611659573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610dd29190810190612e8b565b336000908152600f602052604081205460ff166116e05760405162461bcd60e51b815260206004820152601960248201527f4d657267653a20496e76616c6964206d73672e73656e64657200000000000000604482015260640161097f565b60006116eb84610eee565b905060006116f884610eee565b9050806001600160a01b0316826001600160a01b0316146117815760405162461bcd60e51b815260206004820152602860248201527f4d657267653a20496c6c6567616c20617267756d656e7420646973706172617460448201527f65206f776e65722e000000000000000000000000000000000000000000000000606482015260840161097f565b336001600160a01b038316146117ff5760405162461bcd60e51b815260206004820152602660248201527f4552433732313a206d73672e73656e646572206973206e6f7420746f6b656e2060448201527f6f776e65722e0000000000000000000000000000000000000000000000000000606482015260840161097f565b61180b858584846128dd565b95945050505050565b600a546001600160a01b0316336001600160a01b0316146118775760405162461bcd60e51b815260206004820152601c60248201527f4d657267653a206d73672e73656e646572206973206e6f742070616b00000000604482015260640161097f565b600c546001600160a01b038381169116141561190057806119005760405162461bcd60e51b815260206004820152603260248201527f4d657267653a20496c6c6567616c20617267756d656e74205f6f6d6e6962757360448201527f2063616e27742062652072656d6f7665642e0000000000000000000000000000606482015260840161097f565b8061199a576001611926836001600160a01b031660009081526011602052604090205490565b111561199a5760405162461bcd60e51b815260206004820152603960248201527f4d657267653a20416464726573732077697468206d6f7265207468616e206f6e60448201527f6520746f6b656e2063616e27742062652072656d6f7665642e00000000000000606482015260840161097f565b6001600160a01b03919091166000908152600f60205260409020805460ff1916911515919091179055565b6000610dd2826305f5e100612b5b565b6001600160a01b037f0000000000000000000000006e53130ddff21e3bc963ee902005223b9a2021061663e37ce6fa336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260240160206040518083038186803b158015611a4457600080fd5b505afa158015611a58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a7c9190612e34565b611ac85760405162461bcd60e51b815260206004820152601960248201527f4d657267653a20496e76616c6964206d73672e73656e64657200000000000000604482015260640161097f565b60035460ff1615611b1b5760405162461bcd60e51b815260206004820152601c60248201527f4d657267653a204d696e74696e672069732066696e616c697a65642e00000000604482015260640161097f565b6004546008546007546000919060015b85518111611d225780600454611b419190612ffe565b945085611b4f600183613057565b81518110611b5f57611b5f613106565b602090810291909101810151600087815260158352604080822092909255600c54601290935290812080546001600160a01b0319166001600160a01b039093169290921790915580611bd388611bb6600186613057565b81518110611bc657611bc6613106565b6020026020010151611ddc565b91509150600082118015611be8575060048211155b611c425760405162461bcd60e51b815260206004820152602560248201527f4d657267653a20436c617373206d757374206265206265747765656e203120616044820152643732101a1760d91b606482015260840161097f565b600081118015611c5557506305f5e0ff81105b611cb55760405162461bcd60e51b815260206004820152602b60248201527f4d657267653a204d617373206d757374206265206265747765656e203120616e60448201526a32101c9c9c9c9c9c9c9c9760a91b606482015260840161097f565b80841015611cc4578093508694505b611cce8187612ffe565b600c5460405191975088916001600160a01b03909116906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a450508080611d1a906130d5565b915050611b2b565b50845160046000828254611d369190612ffe565b9091555050845160058054600090611d4f908490612ffe565b9091555050600454600c546001600160a01b031660009081526011602052604081209190915560098054859290611d87908490612ffe565b90915550506008548214611dd5576008829055600781905560405181815282907fdd1fd86a575cfed4833cea35236e5c94a92cead19b6d0e8e1b89ed586981ab509060200160405180910390a25b5050505050565b60008080611dee846305f5e100612b5b565b90506000611e0a611e03836305f5e10061276b565b8690612777565b9050600082118015611e1d575060048211155b611e775760405162461bcd60e51b815260206004820152602560248201527f4d657267653a20436c617373206d757374206265206265747765656e203120616044820152643732101a1760d91b606482015260840161097f565b600081118015611e8a57506305f5e0ff81105b611eea5760405162461bcd60e51b815260206004820152602b60248201527f4d657267653a204d617373206d757374206265206265747765656e203120616e60448201526a32101c9c9c9c9c9c9c9c9760a91b606482015260840161097f565b9094909350915050565b600081815260156020526040812054611f645760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b606482015260840161097f565b6000611f6f83610eee565b9050806001600160a01b0316846001600160a01b03161480611faa5750836001600160a01b0316611f9f84610913565b6001600160a01b0316145b80611fda57506001600160a01b0380821660009081526014602090815260408083209388168352929052205460ff165b949350505050565b6000818152601560205260409020546120635760405162461bcd60e51b815260206004820152602e60248201527f4552433732313a207472616e7366657220617474656d707420666f72206e6f6e60448201527f6578697374656e7420746f6b656e000000000000000000000000000000000000606482015260840161097f565b826001600160a01b031661207682610eee565b6001600160a01b0316146120f25760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201527f73206e6f74206f776e0000000000000000000000000000000000000000000000606482015260840161097f565b6001600160a01b03821661216d5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f7265737300000000000000000000000000000000000000000000000000000000606482015260840161097f565b6001600160a01b0382166000908152600e602052604090205460ff16156121fc5760405162461bcd60e51b815260206004820152602c60248201527f4d657267653a207472616e7366657220617474656d707420746f20626c61636b60448201527f6c69737420616464726573730000000000000000000000000000000000000000606482015260840161097f565b816001600160a01b0316836001600160a01b0316141561225e5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a207472616e7366657220617474656d707420746f2073656c66604482015260640161097f565b600b546001600160a01b038381169116141561227d57610bbe8161262b565b612288600082612b67565b6001600160a01b038381166000908152600f602052604080822054928516825290205460ff9182169116811580156122bd5750805b1561236d576001600160a01b0385811660009081526010602090815260408083208390558683526012825280832080546001600160a01b03191694891694851790559282526011905290812080546001929061231a908490612ffe565b90915550506001600160a01b03808616600081815260116020526040808220829055518693881692917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a45050505050565b8180156123775750805b15612436576001600160a01b03841660009081526011602052604081208054600192906123a5908490612ffe565b90915550506001600160a01b03851660009081526011602052604081208054600192906123d3908490613057565b909155505060008381526012602052604080822080546001600160a01b0319166001600160a01b0388811691821790925591518693918916917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a45050505050565b6001600160a01b03841660009081526010602052604090205461251b576001600160a01b03841660008181526010602090815260408083208790558683526012825280832080546001600160a01b03191685179055928252601190529081208054600192906124a6908490612ffe565b90915550506001600160a01b03851660009081526011602052604081208054600192906124d4908490613057565b909155505060405183906001600160a01b0380871691908816907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90600090a45050505050565b82846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a46001600160a01b0384166000908152601060205260408120549084906125848383898b6128dd565b9050828114156125cc57600082815260126020908152604080832080546001600160a01b0319166001600160a01b038c16908117909155835260109091529020829055612606565b600083815260126020908152604080832080546001600160a01b0319166001600160a01b038c169081179091558352601090915290208390555b600090815260126020526040902080546001600160a01b031916905550505050505050565b600061263682610eee565b9050612643600083612b67565b60008281526015602052604090205461265b90610daf565b6009600082825461266c9190613057565b90915550506001600160a01b03811660009081526010602090815260408083208390558483526012825280832080546001600160a01b03191690556015909152812081905560058054600192906126c4908490613057565b90915550506001600160a01b03811660009081526011602052604081208054600192906126f2908490613057565b909155505060405160008082529083907f7ba170514e8ea35827dbbd10c6d3376ca77ff64b62e4b0a395bac9b142dc81dc9060200160405180910390a360405182906000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b60006115038284613038565b60006115038284613057565b6000833b156128d257604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906127be903390899088908890600401612f60565b602060405180830381600087803b1580156127d857600080fd5b505af1925050508015612808575060408051601f3d908101601f1916820190925261280591810190612e6e565b60015b6128b8573d808015612836576040519150601f19603f3d011682016040523d82523d6000602084013e61283b565b606091505b5080516128b05760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e7465720000000000000000000000000000606482015260840161097f565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611fda565b506001949350505050565b6000838514156129555760405162461bcd60e51b815260206004820152602a60248201527f4d657267653a20496c6c6567616c20617267756d656e74206964656e7469636160448201527f6c20746f6b656e49642e00000000000000000000000000000000000000000000606482015260840161097f565b60008581526015602052604081205461296d90610daf565b6000868152601560205260408120549192509061298990610daf565b6001600160a01b0386166000908152600f602052604090205490915060ff166129c9576001600160a01b0385166000908152601160205260409020600190555b6001600160a01b03841660009081526011602052604081208054600192906129f2908490613057565b90915550829050818888828410612a0f5750839250849150889050895b816000612a1b82610eee565b6001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a460008181526015602052604081208054869290612a6e908490612ffe565b9091555060009050612a808585612ffe565b9050600754811115612acc576008829055600781905560405181815282907fdd1fd86a575cfed4833cea35236e5c94a92cead19b6d0e8e1b89ed586981ab509060200160405180910390a25b6000828152601660205260408120805491612ae6836130d5565b909155505060008381526015602052604081208190556005805460019290612b0f908490613057565b9091555050604051818152829084907f7ba170514e8ea35827dbbd10c6d3376ca77ff64b62e4b0a395bac9b142dc81dc9060200160405180910390a350909a9950505050505050505050565b60006115038284613016565b600081815260136020526040902080546001600160a01b0319166001600160a01b0384169081179091558190612b9c82610eee565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b80356001600160a01b0381168114612bec57600080fd5b919050565b600060208284031215612c0357600080fd5b61150382612bd5565b60008060408385031215612c1f57600080fd5b612c2883612bd5565b9150612c3660208401612bd5565b90509250929050565b600080600060608486031215612c5457600080fd5b612c5d84612bd5565b9250612c6b60208501612bd5565b9150604084013590509250925092565b60008060008060808587031215612c9157600080fd5b612c9a85612bd5565b9350612ca860208601612bd5565b925060408501359150606085013567ffffffffffffffff811115612ccb57600080fd5b8501601f81018713612cdc57600080fd5b8035612cef612cea82612fd6565b612fa5565b818152886020838501011115612d0457600080fd5b8160208401602083013760006020838301015280935050505092959194509250565b60008060408385031215612d3957600080fd5b612d4283612bd5565b91506020830135612d5281613132565b809150509250929050565b60008060408385031215612d7057600080fd5b612d7983612bd5565b946020939093013593505050565b60006020808385031215612d9a57600080fd5b823567ffffffffffffffff80821115612db257600080fd5b818501915085601f830112612dc657600080fd5b813581811115612dd857612dd861311c565b8060051b9150612de9848301612fa5565b8181528481019084860184860187018a1015612e0457600080fd5b600095505b83861015612e27578035835260019590950194918601918601612e09565b5098975050505050505050565b600060208284031215612e4657600080fd5b815161150381613132565b600060208284031215612e6357600080fd5b813561150381613140565b600060208284031215612e8057600080fd5b815161150381613140565b600060208284031215612e9d57600080fd5b815167ffffffffffffffff811115612eb457600080fd5b8201601f81018413612ec557600080fd5b8051612ed3612cea82612fd6565b818152856020838501011115612ee857600080fd5b61180b82602083016020860161306e565b600060208284031215612f0b57600080fd5b5035919050565b60008060408385031215612f2557600080fd5b50508035926020909101359150565b60008151808452612f4c81602086016020860161306e565b601f01601f19169290920160200192915050565b60006001600160a01b038087168352808616602084015250836040830152608060608301526108776080830184612f34565b6020815260006115036020830184612f34565b604051601f8201601f1916810167ffffffffffffffff81118282101715612fce57612fce61311c565b604052919050565b600067ffffffffffffffff821115612ff057612ff061311c565b50601f01601f191660200190565b60008219821115613011576130116130f0565b500190565b60008261303357634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615613052576130526130f0565b500290565b600082821015613069576130696130f0565b500390565b60005b83811015613089578181015183820152602001613071565b838111156114055750506000910152565b600181811c908216806130ae57607f821691505b602082108114156130cf57634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156130e9576130e96130f0565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b8015158114610d3a57600080fd5b6001600160e01b031981168114610d3a57600080fdfea2646970667358221220c0881db4473ef4231de6d14a3a83306a6ab9a66ac1277ee796a71046bac2994864736f6c63430008060033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000006e53130ddff21e3bc963ee902005223b9a202106000000000000000000000000e052113bd7d7700d623414a0a4585bcae754e9d50000000000000000000000004e1e18aaccdf9acfd2e8847654a3871dfd234f020000000000000000000000002ce780d7c743a57791b835a9d6f998b15bbba5a4
-----Decoded View---------------
Arg [0] : registry_ (address): 0x6e53130dDfF21E3BC963Ee902005223b9A202106
Arg [1] : omnibus_ (address): 0xE052113bd7D7700d623414a0a4585BCaE754E9d5
Arg [2] : metadataGenerator_ (address): 0x4e1e18aaCCDf9acFd2E8847654A3871dfD234F02
Arg [3] : pak_ (address): 0x2Ce780D7c743A57791B835a9d6F998B15BBbA5a4
-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 0000000000000000000000006e53130ddff21e3bc963ee902005223b9a202106
Arg [1] : 000000000000000000000000e052113bd7d7700d623414a0a4585bcae754e9d5
Arg [2] : 0000000000000000000000004e1e18aaccdf9acfd2e8847654a3871dfd234f02
Arg [3] : 0000000000000000000000002ce780d7c743a57791b835a9d6f998b15bbba5a4
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.