Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
MutationController
Compiler Version
v0.7.0+commit.9e61f92b
Optimization Enabled:
No with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
/**
* Forked from folia-app/folia-contracts: https://github.com/folia-app/folia-contracts
* Many thanks to Billy Rennekamp <https://github.com/okwme> and Folia <https://www.folia.app/> 💚
*/
pragma solidity ^0.7.0;
pragma experimental ABIEncoderV2;
import './MutationToken.sol';
import './Seeder.sol';
import './MutationControllerDB.sol';
import './MutationTraits.sol';
import 'openzeppelin-solidity/contracts/math/SafeMath.sol';
import 'openzeppelin-solidity/contracts/access/Ownable.sol';
import 'openzeppelin-solidity/contracts/utils/ReentrancyGuard.sol';
import 'openzeppelin-solidity/contracts/cryptography/ECDSA.sol';
contract MutationController is Ownable, ReentrancyGuard {
event MutationBought(uint256 tokenId, address recipient, uint256 paid);
using SafeMath for uint256;
uint256 public adminAbsolutePrice = 0.02 ether;
uint256 public adminFeePercent = 10; // %
bool public paused = false;
address payable public admin;
MutationToken public mutationToken;
MutationMetadata public mutationMetadata;
MutationControllerDB public db;
Seeder public seeder;
uint256 private nextTokenId = 1;
address public authorizedSigner;
uint256 public minMutationBlock = 0;
uint256 public maxMutationBlock = 88888888;
uint256 public maxSupply = 256;
modifier notPaused() {
require(!paused, 'MutationController: is paused');
_;
}
modifier onlyAdmin() {
require((msg.sender == admin), 'MutationController: You are not the admin');
_;
}
modifier onlyMutantHolderOrAdmin(uint256 _mutantTokenId) {
require(
seeder.ownerOf(_mutantTokenId) == msg.sender || msg.sender == admin,
'MutationController: you do not own that mutant or you are not admin'
);
_;
}
constructor(
MutationToken _mutationToken,
MutationMetadata _mutationMetadata,
Seeder _seeder,
address payable _admin,
address payable _authorizedSigner
) {
require(
_admin != address(0),
'MutationController: admin cannot be zero address'
);
require(
_authorizedSigner != address(0),
'MutationController: signer cannot be zero address'
);
require(
address(_mutationToken) != address(0),
'MutationController: token cannot be zero address'
);
require(
address(_mutationMetadata) != address(0),
'MutationController: metadata cannot be zero address'
);
require(
address(_seeder) != address(0),
'MutationController: seeder cannot be zero address'
);
mutationToken = _mutationToken;
mutationMetadata = _mutationMetadata;
seeder = _seeder;
admin = _admin;
authorizedSigner = _authorizedSigner;
}
function updateNextTokenId(uint256 _nextTokenId) public onlyOwner {
nextTokenId = _nextTokenId;
}
function updatePaused(bool _paused) public onlyOwner {
paused = _paused;
}
function updateadminAbsolutePrice(uint256 _price) public onlyOwner {
adminAbsolutePrice = _price;
}
function updateAuthorizedSigner(address _authorizedSigner) public onlyOwner {
require(
_authorizedSigner != address(0),
'MutationController: signer cannot be zero address'
);
authorizedSigner = _authorizedSigner;
}
function setHolderPublicMintPayoutWallet(
uint256 _mutantTokenId,
address _payoutWalletAddress
) public onlyMutantHolderOrAdmin(_mutantTokenId) {
require(
_payoutWalletAddress != address(0),
'MutationController: Payout wallet cannot be zero address'
);
// publicMintingPayoutWallet[_mutantTokenId] = _payoutWalletAddress;
db.setHolderPublicMintPayoutWallet(_mutantTokenId, _payoutWalletAddress);
}
function setPublicMintHolderShareAndPayoutAddressAndEnable(
uint256 _mutantTokenId,
uint256 _publicPrice,
address _payoutWalletAddress
) public {
setHolderShare(_mutantTokenId, _publicPrice);
setHolderPublicMintPayoutWallet(_mutantTokenId, _payoutWalletAddress);
setPublicMintEnabled(_mutantTokenId, true);
}
function setHolderShare(
uint256 _mutantTokenId,
uint256 _publicPrice
) public onlyMutantHolderOrAdmin(_mutantTokenId) {
db.setPublicMintHolderShare(_mutantTokenId, _publicPrice);
}
function setMaxSupply(uint256 _maxSupply) public onlyAdmin {
require(
_maxSupply >= nextTokenId - 1,
'cannot shrink max supply below current supply'
);
maxSupply = _maxSupply;
}
function setMinMutationBlock(uint256 _minMutationBlock) public onlyAdmin {
minMutationBlock = _minMutationBlock;
}
function setMaxMutationBlock(uint256 _maxMutationBlock) public onlyAdmin {
maxMutationBlock = _maxMutationBlock;
}
function getPublicHolderShare(
uint256 _tokenId
) public view returns (uint256 _price) {
return db.getPublicMintHolderShare(_tokenId);
}
function mint(
address _recipient,
string memory _mutantName,
Mutation memory _mutation,
uint256 _traits
) private returns (uint256 _mutationTokenId) {
require(_mutation.mutationBlock > minMutationBlock, 'Mutation too old');
require(_mutation.mutationBlock <= maxMutationBlock, 'Mutation too new');
require(nextTokenId <= maxSupply, 'Max. supply reached');
uint256 tokenId = nextTokenId++;
mutationMetadata.storeMutation(tokenId, _mutantName, _mutation, _traits);
mutationToken.mint(_recipient, tokenId);
return tokenId;
}
function adminMint(
address _recipient,
string memory _mutantName,
Mutation memory _mutation,
uint256 _traits
) public onlyAdmin returns (uint256 _mutationTokenId) {
return mint(_recipient, _mutantName, _mutation, _traits);
}
function setPublicMintEnabled(
uint256 _mutantTokenId,
bool _enabled
) public onlyMutantHolderOrAdmin(_mutantTokenId) {
db.setAllowPublicMint(_mutantTokenId, _enabled);
}
function getPublicMintEnabled(
uint256 _mutantTokenId
) public view returns (bool) {
return db.getPublicMintEnabled(_mutantTokenId);
}
function getPublicMintingPayoutWallet(
uint256 _mutantTokenId
) public view returns (address) {
return db.getPublicMintingPayoutWallet(_mutantTokenId);
}
function getTotalPublicMintPrice(
uint256 _mutantTokenId
) public view returns (uint256) {
uint256 holderShare = db.getPublicMintHolderShare(_mutantTokenId);
return
adminAbsolutePrice.add(
holderShare.mul(adminFeePercent.add(100)).div(100)
);
}
function buy(
address _recipient,
string memory _mutantName,
Mutation memory _mutation,
uint256 _traits,
bytes memory _signature
) public payable notPaused nonReentrant returns (uint256 _mutationTokenId) {
uint256 mutantTokenId = _mutation.birthBlock;
require(
db.getPublicMintEnabled(mutantTokenId),
'MutationController: Public mint needs to be allowed for this mutant'
);
uint256 holderShare = db.getPublicMintHolderShare(mutantTokenId);
require(
msg.value >= getTotalPublicMintPrice(mutantTokenId),
'MutationController: You did not send enough ether'
);
address holderShareWallet = db.getPublicMintingPayoutWallet(mutantTokenId);
require(
holderShareWallet != address(0),
'MutationController: No receiving mutant holder payout wallet set'
);
verifySignature(_mutantName, _mutation, _traits, _signature);
uint256 mutationTokenId = mint(_recipient, _mutantName, _mutation, _traits);
uint256 adminReceives = msg.value.sub(holderShare);
bool success;
(success, ) = admin.call{value: adminReceives}('');
require(success, 'MutationController: Admin failed to receive');
(success, ) = holderShareWallet.call{value: holderShare}('');
require(success, 'MutationController: Holder failed to receive');
emit MutationBought(mutationTokenId, _recipient, msg.value);
return mutationTokenId;
}
function buyAsHolder(
address _recipient,
string memory _mutantName,
Mutation memory _mutation,
uint256 _traits,
bytes memory _signature
)
public
payable
notPaused
nonReentrant
onlyMutantHolderOrAdmin(_mutation.birthBlock)
{
require(
msg.value >= adminAbsolutePrice,
'MutationController: You did not send enough ether'
);
verifySignature(_mutantName, _mutation, _traits, _signature);
uint256 tokenId = mint(_recipient, _mutantName, _mutation, _traits);
bool success;
(success, ) = admin.call{value: msg.value}('');
require(success, 'MutationController: Payout address failed to receive');
emit MutationBought(tokenId, _recipient, msg.value);
}
function updateAdmin(address payable _admin) public onlyOwner {
require(
_admin != address(0),
'MutationController: admin cannot be zero address'
);
admin = _admin;
}
function updateDB(MutationControllerDB _db) public onlyOwner {
db = _db;
}
// function updateTraitsContract(MutationTraits _mutationTraits) public onlyOwner {
// mutationTraits = _mutationTraits;
// }
function verifySignature(
string memory _mutantName,
Mutation memory _mutation,
uint256 _traits,
bytes memory _signature
) private view {
bytes32 messageHash = keccak256(
abi.encodePacked(
msg.sender,
_mutation.birthBlock,
_mutation.arweave,
_mutation.mutationBlock,
_mutation.mutationIndex,
_mutantName,
_traits
)
);
bytes32 ethSignedMessageHash = ECDSA.toEthSignedMessageHash(messageHash);
address recoveredSigner = ECDSA.recover(ethSignedMessageHash, _signature);
require(
recoveredSigner == authorizedSigner,
'MutationController: Invalid signature'
);
}
function updateMutationToken(MutationToken _mutationToken) public onlyOwner {
mutationToken = _mutationToken;
}
function updateMutationMetadata(
MutationMetadata _mutationMetadata
) public onlyOwner {
mutationMetadata = _mutationMetadata;
}
}// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; /// @title Base64 /// @author Brecht Devos - <[email protected]> /// @notice Provides a function for encoding some bytes in base64 library Base64 { string internal constant TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; function encode(bytes memory data) internal pure returns (string memory) { if (data.length == 0) return ""; // load the table into memory string memory table = TABLE; // 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) { } { dataPtr := add(dataPtr, 3) // read 3 bytes let input := mload(dataPtr) // write 4 characters mstore( resultPtr, shl(248, mload(add(tablePtr, and(shr(18, input), 0x3F)))) ) resultPtr := add(resultPtr, 1) mstore( resultPtr, shl(248, mload(add(tablePtr, and(shr(12, input), 0x3F)))) ) resultPtr := add(resultPtr, 1) mstore( resultPtr, shl(248, mload(add(tablePtr, and(shr(6, input), 0x3F)))) ) resultPtr := add(resultPtr, 1) mstore( resultPtr, shl(248, 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; } }
// SPDX-License-Identifier: MIT /* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <[email protected]> */ pragma solidity ^0.7.0; library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private pure { // Copy word-length chunks while possible for (; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) } dest += 32; src += 32; } // Copy remaining bytes uint mask = 256 ** (32 - len) - 1; assembly { let srcpart := and(mload(src), not(mask)) let destpart := and(mload(dest), mask) mstore(dest, or(destpart, srcpart)) } } /* * @dev Returns a slice containing the entire string. * @param self The string to make a slice from. * @return A newly allocated slice containing the entire string. */ function toSlice(string memory self) internal pure returns (slice memory) { uint ptr; assembly { ptr := add(self, 0x20) } return slice(bytes(self).length, ptr); } /* * @dev Returns a newly allocated string containing the concatenation of * `self` and `other`. * @param self The first slice to concatenate. * @param other The second slice to concatenate. * @return The concatenation of the two strings. */ function concat(slice memory self, slice memory other) internal pure returns (string memory) { string memory ret = new string(self._len + other._len); uint retptr; assembly { retptr := add(ret, 32) } memcpy(retptr, self._ptr, self._len); memcpy(retptr + self._len, other._ptr, other._len); return ret; } }
// SPDX-License-Identifier: MIT
/**
* Forked from folia-app/folia-contracts: https://github.com/folia-app/folia-contracts
* Many thanks to Billy Rennekamp <https://github.com/okwme> and Folia <https://www.folia.app/> 💚
*/
pragma solidity ^0.7.0;
/**
* Metadata contract is upgradeable and returns metadata about Token
*/
import './helpers/strings.sol';
contract Metadata {
using strings for *;
function tokenURI(
uint256 _tokenId
) public pure returns (string memory _infoUrl) {
string memory base = 'https://seeder.mutant.garden/v1/tokens/';
string memory id = uint2str(_tokenId);
return base.toSlice().concat(id.toSlice());
}
function uint2str(uint256 i) internal pure returns (string memory) {
if (i == 0) return '0';
uint256 j = i;
uint256 length;
while (j != 0) {
length++;
j /= 10;
}
bytes memory bstr = new bytes(length);
uint256 k = length - 1;
while (i != 0) {
uint256 _uint = 48 + (i % 10);
bstr[k--] = toBytes(_uint)[31];
i /= 10;
}
return string(bstr);
}
function toBytes(uint256 x) public pure returns (bytes memory b) {
b = new bytes(32);
assembly {
mstore(add(b, 32), x)
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
import 'openzeppelin-solidity/contracts/access/Ownable.sol';
contract MutationControllerDB is Ownable {
address public controller;
// map mutant tokenIds (birthBlock) to a boolean
mapping(uint256 => bool) public allowPublicMint;
// map mutant TokenIds to public minting price share
mapping(uint256 => uint256) public publicMintHolderShare;
// map mutant TokenIds to payout wallet addresses
mapping(uint256 => address) public publicMintingPayoutWallet;
function updateController(address _controller) public onlyAdminOrController {
controller = _controller;
}
modifier onlyAdminOrController() {
require(
(msg.sender == controller || msg.sender == owner()),
'MutationControllerDB: You are not an admin or controller'
);
_;
}
function batchSetPublicMintData(
uint256[] calldata _mutantTokenIds,
bool[] calldata _allowPublicMint,
uint256[] calldata _holderShares,
address[] calldata _payoutWallets
) public onlyAdminOrController {
require(
_mutantTokenIds.length == _allowPublicMint.length &&
_mutantTokenIds.length == _holderShares.length &&
_mutantTokenIds.length == _payoutWallets.length,
'MutationControllerDB: array length mismatch'
);
for (uint256 i = 0; i < _mutantTokenIds.length; i++) {
allowPublicMint[_mutantTokenIds[i]] = _allowPublicMint[i];
publicMintHolderShare[_mutantTokenIds[i]] = _holderShares[i];
publicMintingPayoutWallet[_mutantTokenIds[i]] = _payoutWallets[i];
}
}
function setAllowPublicMint(
uint256 _mutantTokenId,
bool _enabled
) public onlyAdminOrController {
allowPublicMint[_mutantTokenId] = _enabled;
}
function setHolderPublicMintPayoutWallet(
uint256 _mutantTokenId,
address _payoutWalletAddress
) public onlyAdminOrController {
publicMintingPayoutWallet[_mutantTokenId] = _payoutWalletAddress;
}
function setPublicMintHolderShare(
uint256 _mutantTokenId,
uint256 _publicPrice
) public onlyAdminOrController {
publicMintHolderShare[_mutantTokenId] = _publicPrice;
}
function getPublicMintHolderShare(
uint256 _tokenId
) public view returns (uint256) {
return publicMintHolderShare[_tokenId];
}
function getPublicMintEnabled(
uint256 _mutantTokenId
) public view returns (bool) {
return allowPublicMint[_mutantTokenId];
}
function getPublicMintingPayoutWallet(
uint256 _mutantTokenId
) public view returns (address) {
return publicMintingPayoutWallet[_mutantTokenId];
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
pragma experimental ABIEncoderV2;
import 'openzeppelin-solidity/contracts/access/Ownable.sol';
import 'openzeppelin-solidity/contracts/math/SafeMath.sol';
import './helpers/Base64.sol';
import './MutationController.sol';
import './MutationTraits.sol';
import './MutationMetadataDB.sol';
contract MutationMetadata is Ownable {
using SafeMath for uint256;
string private constant JSON_PROTOCOL_URI = 'data:application/json;base64,';
address public controller;
// string public titleSeparator = ' ⟋ ';
// string public descriptionText = 'Mutant Garden Seeder Mutation';
uint8 private constant TRAIT_BYTE_INDEX_COMPLEXITY = 0;
uint8 private constant TRAIT_BYTE_INDEX_CODING_GENES = 1;
uint8 private constant TRAIT_BYTE_INDEX_GENERATION = 2;
uint8 private constant TRAIT_BYTE_INDEX_ENTROPY = 3;
uint8 private constant TRAIT_BYTE_INDEX_DEVELOPMENT = 4;
uint256 private constant STRING_DB_GENERAL_NAMES = 0;
uint256 private constant STRING_DB_GENERATIONS = 1;
uint256 private constant STRING_DB_COMPLEXITIES = 2;
uint256 private constant STRING_DB_DEVELOPMENT_KINDS = 3;
uint256 private constant STRING_DB_TRAIT_NAMES = 4;
uint256 private constant STRING_DB_TRAIT_NAMES__COMPLEXITY_PERCENTAGE = 0;
uint256 private constant STRING_DB_TRAIT_NAMES__COMPLEXITY = 1;
uint256 private constant STRING_DB_TRAIT_NAMES__CODING_GENES_PERCENTAGE = 2;
uint256 private constant STRING_DB_TRAIT_NAMES__ENTROPY_PERCENTAGE = 3;
uint256 private constant STRING_DB_TRAIT_NAMES__DEVELOPMENT = 4;
uint256 private constant STRING_DB_TRAIT_NAMES__BIRTH_BLOCK = 5;
uint256 private constant STRING_DB_TRAIT_NAMES__MUTATION_BLOCK = 6;
uint256 private constant STRING_DB_TRAIT_NAMES__MUTATION_INDEX = 7;
uint256 private constant STRING_DB_TRAIT_NAMES__NAME = 8;
uint256 private constant STRING_DB_TRAIT_NAMES__RELEASE = 9;
uint256 private constant STRING_DB_GENERAL_NAMES__NAME_SEPARATOR = 0;
uint256 private constant STRING_DB_GENERAL_NAMES__DESCRIPTION = 1;
uint256 private constant STRING_DB_GENERAL_NAMES__REMAINING_SNIPPET = 2;
MutationMetadataDB public db;
MutationTraits public traits;
function updateController(address _controller) public onlyAdminOrController {
controller = _controller;
}
function updateTraitsContract(
MutationTraits _mutationTraits
) public onlyAdminOrController {
traits = _mutationTraits;
}
modifier onlyAdminOrController() {
require(
(msg.sender == controller || msg.sender == owner()),
'MutationMetadata: You are not an owner or controller'
);
_;
}
function setMutationMetadataDB(
MutationMetadataDB _db
) public onlyAdminOrController {
db = _db;
}
function storeMutation(
uint256 _tokenId,
string memory _mutantName,
Mutation memory _mutation,
uint256 _traits
) public onlyAdminOrController {
require(
!isMutantMutationAlreadyStored(
_mutation.birthBlock,
_mutation.mutationBlock
),
'mutation already exists'
);
bytes memory n = bytes(db.getMutantNameByBirthBlock(_mutation.birthBlock));
if (n.length == 0) {
db.setMutantNameByBirthBlock(_mutation.birthBlock, _mutantName);
}
db.setMutation(_tokenId, _mutation);
db.setTokenIdByMutantBirthAndMutation(
_mutation.birthBlock,
_mutation.mutationBlock,
_tokenId
);
traits.setTraits(_tokenId, _traits);
}
function getTokenIdByMutantMutation(
uint256 _birthBlock,
uint256 _mutationBlock
) public view returns (uint256) {
return db.getTokenIdByMutantBirthAndMutation(_birthBlock, _mutationBlock);
}
function getMutationByTokenId(
uint256 _tokenId
) public view returns (Mutation memory) {
Mutation memory mutation = db.getMutation(_tokenId);
require(mutation.birthBlock != 0, 'Mutation does not exist');
return mutation;
}
function getTokenData(
uint256 _tokenId
) public view returns (string memory, Mutation memory) {
Mutation memory mutation = db.getMutation(_tokenId); //mutations[_tokenId];
require(mutation.birthBlock != 0, 'Mutation does not exist');
string memory mutantName = db.getMutantNameByBirthBlock(
mutation.birthBlock
);
return (mutantName, mutation);
}
function getMutantNameByBirthBlock(
uint256 _birthBlock
) public view returns (string memory) {
return db.getMutantNameByBirthBlock(_birthBlock);
}
function isMutantMutationAlreadyStored(
uint256 _birthBlock,
uint256 _mutationBlock
) public view returns (bool) {
uint256 tokenId = db.getTokenIdByMutantBirthAndMutation(
_birthBlock,
_mutationBlock
);
return tokenId != 0;
}
function tokenURI(
uint256 _tokenId
) public view returns (string memory _infoUrl) {
Mutation memory mutation = db.getMutation(_tokenId);
require(mutation.birthBlock != 0, 'Mutation does not exist');
string memory mutantName = db.getMutantNameByBirthBlock(
mutation.birthBlock
);
string memory mutationString = mutation.mutationIndex == 0
? 'birth'
: uint2str(mutation.mutationIndex);
bytes memory json = abi.encodePacked(
'{"name":"',
getTokenNameTitle(mutantName, mutationString),
'",',
'"description":"',
getDescriptionText(),
'","traits":[',
attributesJSON(_tokenId, mutation, mutantName),
'],"image":"ar://',
mutation.arweave,
'",',
otherProperties(_tokenId),
'}'
);
return string(abi.encodePacked(JSON_PROTOCOL_URI, Base64.encode(json)));
}
function getTokenNameTitle(
string memory mutantName,
string memory mutationString
) internal view returns (bytes memory) {
string memory titleSeparator = traits.getKeyValue(
STRING_DB_GENERAL_NAMES,
STRING_DB_GENERAL_NAMES__NAME_SEPARATOR
);
return abi.encodePacked(mutantName, titleSeparator, mutationString);
}
function getDescriptionText() internal view returns (string memory) {
return
traits.getKeyValue(
STRING_DB_GENERAL_NAMES,
STRING_DB_GENERAL_NAMES__DESCRIPTION
);
}
function otherProperties(
uint256 _tokenId
) internal view returns (bytes memory) {
string memory remainingJSONSnippet = traits.getKeyValue(
STRING_DB_GENERAL_NAMES,
STRING_DB_GENERAL_NAMES__REMAINING_SNIPPET
);
return
abi.encodePacked(
'"tokenID":',
uint2str(_tokenId),
remainingJSONSnippet
// ',"aspect_ratio": 1,"artist":"Harm van den Dorpel","collection_name":"Mutant Garden Seeder Mutations","license":"CC BY-NC 4.0"'
);
}
function attributesJSON(
uint256 _tokenId,
Mutation memory _mutation,
string memory _mutantName
) internal view returns (bytes memory) {
return
abi.encodePacked(
traitsPart1(_tokenId, _mutation, _mutantName),
traitsPart2(_tokenId)
);
}
function traitsPart1(
uint256 _tokenId,
Mutation memory mutation,
string memory mutantName
) internal view returns (bytes memory) {
return
abi.encodePacked(
mutantNameTraitJSON(mutantName),
birthBlockTraitJSON(mutation.birthBlock),
mutationNumberAndBlockTraitsJSON(mutation),
developmentTraitJSON(_tokenId)
);
}
function traitsPart2(uint256 _tokenId) internal view returns (bytes memory) {
uint256 traitCodingGenesRatio = traits.getByte(
_tokenId,
TRAIT_BYTE_INDEX_CODING_GENES
);
return
abi.encodePacked(
complexityTraitsJSON(_tokenId),
entropyTraitJSON(_tokenId),
codingGenesTraitsJSON(traitCodingGenesRatio),
generationTraitJSON(_tokenId)
);
}
function mutationNumberAndBlockTraitsJSON(
Mutation memory mutation
) internal view returns (bytes memory) {
string memory mutationIndexTraitLabel = traits.getKeyValue(
STRING_DB_TRAIT_NAMES,
STRING_DB_TRAIT_NAMES__MUTATION_INDEX
);
string memory mutationBlockTraitLabel = traits.getKeyValue(
STRING_DB_TRAIT_NAMES,
STRING_DB_TRAIT_NAMES__MUTATION_BLOCK
);
return
abi.encodePacked(
'{"trait_type":"',
mutationIndexTraitLabel,
'","value":',
uint2str(mutation.mutationIndex),
'},{"trait_type":"',
mutationBlockTraitLabel,
'","value":',
uint2str(mutation.mutationBlock),
'},'
);
}
function codingGenesTraitsJSON(
uint256 traitCodingGenesRatio
) internal view returns (bytes memory) {
string memory codingGenesTraitLabel = traits.getKeyValue(
STRING_DB_TRAIT_NAMES,
STRING_DB_TRAIT_NAMES__CODING_GENES_PERCENTAGE
);
return
abi.encodePacked(
'{"trait_type":"',
codingGenesTraitLabel,
'","max_value":100,"value":',
uint2str(traitCodingGenesRatio),
'},'
);
}
function birthBlockTraitJSON(
uint256 birthBlock
) internal view returns (bytes memory) {
string memory birthBlockTraitLabel = traits.getKeyValue(
STRING_DB_TRAIT_NAMES,
STRING_DB_TRAIT_NAMES__BIRTH_BLOCK
);
return
abi.encodePacked(
'{"trait_type":"',
birthBlockTraitLabel,
'","value":',
uint2str(birthBlock),
'},'
);
}
function mutantNameTraitJSON(
string memory mutantName
) internal view returns (bytes memory) {
string memory nameTraitLabel = traits.getKeyValue(
STRING_DB_TRAIT_NAMES,
STRING_DB_TRAIT_NAMES__NAME
);
return
abi.encodePacked(
'{"trait_type":"',
nameTraitLabel,
'","value":"',
mutantName,
'"},'
);
}
function generationTraitJSON(
uint256 _tokenId
) internal view returns (bytes memory) {
uint8 generation = traits.getByte(_tokenId, TRAIT_BYTE_INDEX_GENERATION);
string memory generationString = traits.getKeyValue(
STRING_DB_GENERATIONS,
generation
);
string memory releaseTraitLabel = traits.getKeyValue(
STRING_DB_TRAIT_NAMES,
STRING_DB_TRAIT_NAMES__RELEASE
);
return
abi.encodePacked(
'{"trait_type":"',
releaseTraitLabel,
'","value":"',
generationString,
'"}'
);
}
function entropyTraitJSON(
uint256 _tokenId
) internal view returns (bytes memory) {
uint256 entropy = uint256(
traits.getByte(_tokenId, TRAIT_BYTE_INDEX_ENTROPY)
);
string memory entropyTraitLabel = traits.getKeyValue(
STRING_DB_TRAIT_NAMES,
STRING_DB_TRAIT_NAMES__ENTROPY_PERCENTAGE
);
return
abi.encodePacked(
'{"trait_type":"',
entropyTraitLabel,
'","max_value":100,"value":',
uint2str(entropy),
'},'
);
}
function developmentTraitJSON(
uint256 _tokenId
) internal view returns (bytes memory) {
uint8 developmentIndex = traits.getByte(
_tokenId,
TRAIT_BYTE_INDEX_DEVELOPMENT
);
string memory developmentString = traits.getKeyValue(
STRING_DB_DEVELOPMENT_KINDS,
developmentIndex
);
string memory developmentTraitLabel = traits.getKeyValue(
STRING_DB_TRAIT_NAMES,
STRING_DB_TRAIT_NAMES__DEVELOPMENT
);
return
abi.encodePacked(
'{"trait_type":"',
developmentTraitLabel,
'","value":"',
developmentString,
'"},'
);
}
function complexityTraitsJSON(
uint256 _tokenId
) internal view returns (bytes memory) {
uint8 complexityNumber = traits.getByte(
_tokenId,
TRAIT_BYTE_INDEX_COMPLEXITY
);
uint256 complexityStringIndex = uint256(complexityNumber).div(10);
string memory complexityString = traits.getKeyValue(
STRING_DB_COMPLEXITIES,
complexityStringIndex
);
string memory complexityPercentageTraitLabel = traits.getKeyValue(
STRING_DB_TRAIT_NAMES,
STRING_DB_TRAIT_NAMES__COMPLEXITY_PERCENTAGE
);
string memory complexityTraitLabel = traits.getKeyValue(
STRING_DB_TRAIT_NAMES,
STRING_DB_TRAIT_NAMES__COMPLEXITY
);
return
abi.encodePacked(
'{"trait_type":"',
complexityPercentageTraitLabel,
'","max_value":100, "value":',
uint2str(complexityNumber),
'},{"trait_type":"',
complexityTraitLabel,
'","value":"',
complexityString,
'"},'
);
}
function uint2str(uint256 i) internal pure returns (string memory) {
if (i == 0) return '0';
uint256 j = i;
uint256 length;
while (j != 0) {
length++;
j /= 10;
}
bytes memory bstr = new bytes(length);
uint256 k = length - 1;
while (i != 0) {
uint256 _uint = 48 + (i % 10);
bstr[k--] = toBytes(_uint)[31];
i /= 10;
}
return string(bstr);
}
function toBytes(uint256 x) internal pure returns (bytes memory b) {
b = new bytes(32);
assembly {
mstore(add(b, 32), x)
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
pragma experimental ABIEncoderV2;
import 'openzeppelin-solidity/contracts/access/Ownable.sol';
struct Mutation {
uint256 birthBlock;
uint256 mutationBlock;
uint256 mutationIndex; // 0 = birth
string arweave;
}
contract MutationMetadataDB is Ownable {
// maps birthBlock to fixed data
address public mutationMetadata;
mapping(uint256 => string) private mutantNames;
// maps tokenId to mutation data
mapping(uint256 => Mutation) private mutations;
// birthBlock => mutationBlock => tokenId
mapping(uint256 => mapping(uint256 => uint256))
private tokenIdByMutantMutation;
modifier onlyMetadata() {
require(
(msg.sender == mutationMetadata || msg.sender == owner()),
'MutationMetadataDB: You are not an owner or metadata contract'
);
_;
}
function updateMutationMetadata(address _mutationMetadata) public onlyOwner {
mutationMetadata = _mutationMetadata;
}
function getMutantNameByBirthBlock(
uint256 _birthBlock
) public view returns (string memory) {
return mutantNames[_birthBlock];
}
function getTokenIdByMutantBirthAndMutation(
uint256 _birthBlock,
uint256 _mutationBlock
) public view returns (uint256 _tokenId) {
return tokenIdByMutantMutation[_birthBlock][_mutationBlock];
}
function getMutation(uint256 _tokenId) public view returns (Mutation memory) {
return mutations[_tokenId];
}
function setMutantNameByBirthBlock(
uint256 _birthBlock,
string memory _mutantName
) public onlyMetadata {
mutantNames[_birthBlock] = _mutantName;
}
function setTokenIdByMutantBirthAndMutation(
uint256 _birthBlock,
uint256 _mutationBlock,
uint256 _tokenId
) public onlyMetadata {
tokenIdByMutantMutation[_birthBlock][_mutationBlock] = _tokenId;
}
function setMutation(
uint256 _tokenId,
Mutation memory _mutation
) public onlyMetadata {
mutations[_tokenId] = _mutation;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
import 'openzeppelin-solidity/contracts/token/ERC721/ERC721.sol';
import 'openzeppelin-solidity/contracts/token/ERC20/IERC20.sol';
import 'openzeppelin-solidity/contracts/access/Ownable.sol';
import './MutationMetadata.sol';
contract MutationToken is ERC721, Ownable {
address public metadata;
address public controller;
address public admin;
modifier onlyAdminOrController() {
require(
(msg.sender == controller || msg.sender == admin),
'MutationToken: You are not an admin or controller'
);
_;
}
constructor(
string memory name,
string memory symbol,
address _metadata,
address _admin
) ERC721(name, symbol) {
metadata = _metadata;
admin = _admin;
}
function mint(
address recipient,
uint256 tokenId
) public onlyAdminOrController {
_safeMint(recipient, tokenId);
}
function burn(uint256 tokenId) public onlyAdminOrController {
_burn(tokenId);
}
function updateMetadata(address _metadata) public onlyAdminOrController {
metadata = _metadata;
}
function updateController(address _controller) public onlyAdminOrController {
controller = _controller;
}
function updateAdmin(address _admin) public onlyOwner {
admin = _admin;
}
function tokenURI(
uint256 _tokenId
) public view virtual override returns (string memory _infoUrl) {
return MutationMetadata(metadata).tokenURI(_tokenId);
}
/**
* @dev Moves Token to a certain address.
* @param _to The address to receive the Token.
* @param _amount The amount of Token to be transferred.
* @param _token The address of the Token to be transferred.
*/
function recoverERC20(
address _to,
uint256 _amount,
address _token
) public onlyOwner returns (bool) {
require(_amount <= IERC20(_token).balanceOf(address(this)));
return IERC20(_token).transfer(_to, _amount);
}
}// SPDX-License-Identifier: MIT
pragma experimental ABIEncoderV2;
pragma solidity ^0.7.0;
import 'openzeppelin-solidity/contracts/access/Ownable.sol';
contract MutationTraits is Ownable {
address public mutationMetadata;
// mapping from mutationTokenId to a packed uint256, each byte can be used as a trait (0-255)
mapping(uint256 => uint256) public tokenTraits;
mapping(uint256 => mapping(uint256 => string)) public keyValues;
modifier onlyMetadata() {
require(
(msg.sender == mutationMetadata || msg.sender == owner()),
'MutationTraits: You are not an owner or metadata contract'
);
_;
}
function updateMutationMetadata(
address _mutationMetadata
) public onlyMetadata {
mutationMetadata = _mutationMetadata;
}
function setKeyValue(
uint256 db,
uint256 id,
string memory value
) public onlyMetadata {
keyValues[db][id] = value;
}
function batchSetTraits(
uint256[] calldata _tokenIds,
uint256[] calldata _traits
) public onlyMetadata {
require(
_tokenIds.length == _traits.length,
'MutationTraits: array length mismatch'
);
for (uint256 i = 0; i < _tokenIds.length; i++) {
tokenTraits[_tokenIds[i]] = _traits[i];
}
}
function batchSetKeyValues(
uint256[] calldata _dbs,
uint256[] calldata _ids,
string[] calldata _values
) public onlyMetadata {
require(
_dbs.length == _ids.length && _ids.length == _values.length,
'MutationTraits: array length mismatch'
);
for (uint256 i = 0; i < _dbs.length; i++) {
keyValues[_dbs[i]][_ids[i]] = _values[i];
}
}
function getKeyValue(
uint256 db,
uint256 id
) public view returns (string memory) {
return keyValues[db][id];
}
function setTraits(uint256 _tokenId, uint256 _traits) public onlyMetadata {
tokenTraits[_tokenId] = _traits;
}
function getTraits(uint256 _tokenId) public view returns (uint256) {
return tokenTraits[_tokenId];
}
function getByte(
uint256 tokenId,
uint8 byteIndex
) public view returns (uint8) {
require(byteIndex < 32, 'Byte index out of range');
return uint8((tokenTraits[tokenId] >> (8 * byteIndex)) & 0xFF);
}
function getBytes(
uint256 tokenId,
uint8 startIndex,
uint8 count
) public view returns (uint8[] memory) {
require(startIndex + count <= 32, 'Range out of bounds');
uint8[] memory result = new uint8[](count);
uint256 packed = tokenTraits[tokenId];
for (uint8 i = 0; i < count; i++) {
result[i] = uint8((packed >> (8 * (startIndex + i))) & 0xFF);
}
return result;
}
}// SPDX-License-Identifier: MIT
/**
* Forked from folia-app/folia-contracts: https://github.com/folia-app/folia-contracts
* Many thanks to Billy Rennekamp <https://github.com/okwme> and Folia <https://www.folia.app/> 💚
*/
pragma solidity ^0.7.0;
import 'openzeppelin-solidity/contracts/token/ERC721/ERC721.sol';
import 'openzeppelin-solidity/contracts/token/ERC20/IERC20.sol';
import 'openzeppelin-solidity/contracts/access/Ownable.sol';
// import "openzeppelin-solidity/contracts/access/AccessControl.sol";
import './Metadata.sol';
contract Seeder is ERC721, Ownable {
// using Roles for Roles.Role;
// Roles.Role private _admins;
// uint8 admins;
address public metadata;
address public controller;
modifier onlyAdminOrController() {
// require(
// (_admins.has(msg.sender) || msg.sender == controller),
// "You are not an admin or controller"
// );
_;
}
constructor(
string memory name,
string memory symbol,
address _metadata
) ERC721(name, symbol) {
metadata = _metadata;
// _admins.add(msg.sender);
// admins += 1;
}
function mint(
address recipient,
uint256 tokenId
) public onlyAdminOrController returns (uint256) {
_mint(recipient, tokenId);
}
function burn(uint256 tokenId) public onlyAdminOrController {
// _burn(ownerOf(tokenId), tokenId);
}
function updateMetadata(address _metadata) public onlyAdminOrController {
metadata = _metadata;
}
function updateController(address _controller) public onlyAdminOrController {
controller = _controller;
}
function addAdmin(address _admin) public onlyOwner {
// _admins.add(_admin);
// admins += 1;
}
function removeAdmin(address _admin) public onlyOwner {
// require(admins > 1, "Cannot remove the last admin");
// _admins.remove(_admin);
// admins -= 1;
}
function tokenURI(
uint256 _tokenId
) public view virtual override returns (string memory _infoUrl) {
return Metadata(metadata).tokenURI(_tokenId);
}
/**
* @dev Moves Token to a certain address.
* @param _to The address to receive the Token.
* @param _amount The amount of Token to be transferred.
* @param _token The address of the Token to be transferred.
*/
function moveToken(
address _to,
uint256 _amount,
address _token
) public onlyAdminOrController returns (bool) {
require(_amount <= IERC20(_token).balanceOf(address(this)));
return IERC20(_token).transfer(_to, _amount);
}
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
*
* These functions can be used to verify that a message was signed by the holder
* of the private keys of a given address.
*/
library ECDSA {
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature`. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*/
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
// Check the signature length
if (signature.length != 65) {
revert("ECDSA: invalid signature length");
}
// Divide the signature in r, s and v variables
bytes32 r;
bytes32 s;
uint8 v;
// ecrecover takes the signature parameters, and the only way to get them
// currently is to use assembly.
// solhint-disable-next-line no-inline-assembly
assembly {
r := mload(add(signature, 0x20))
s := mload(add(signature, 0x40))
v := byte(0, mload(add(signature, 0x60)))
}
return recover(hash, v, r, s);
}
/**
* @dev Overload of {ECDSA-recover-bytes32-bytes-} that receives the `v`,
* `r` and `s` signature fields separately.
*/
function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {
// EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
// unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
// the valid range for s in (281): 0 < s < secp256k1n ÷ 2 + 1, and for v in (282): v ∈ {27, 28}. Most
// signatures from current libraries generate a unique signature with an s-value in the lower half order.
//
// If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
// with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
// vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
// these malleable signatures as well.
require(uint256(s) <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0, "ECDSA: invalid signature 's' value");
require(v == 27 || v == 28, "ECDSA: invalid signature 'v' value");
// If the signature is valid (and not malleable), return the signer address
address signer = ecrecover(hash, v, r, s);
require(signer != address(0), "ECDSA: invalid signature");
return signer;
}
/**
* @dev Returns an Ethereum Signed Message, created from a `hash`. This
* replicates the behavior of the
* https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign[`eth_sign`]
* JSON-RPC method.
*
* See {recover}.
*/
function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
// 32 is the length in bytes of hash,
// enforced by the type signature above
return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
}
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
import "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts may inherit from this and call {_registerInterface} to declare
* their support of an interface.
*/
abstract contract ERC165 is IERC165 {
/*
* bytes4(keccak256('supportsInterface(bytes4)')) == 0x01ffc9a7
*/
bytes4 private constant _INTERFACE_ID_ERC165 = 0x01ffc9a7;
/**
* @dev Mapping of interface ids to whether or not it's supported.
*/
mapping(bytes4 => bool) private _supportedInterfaces;
constructor () internal {
// Derived contracts need only register support for their own interfaces,
// we register support for ERC165 itself here
_registerInterface(_INTERFACE_ID_ERC165);
}
/**
* @dev See {IERC165-supportsInterface}.
*
* Time complexity O(1), guaranteed to always use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return _supportedInterfaces[interfaceId];
}
/**
* @dev Registers the contract as an implementer of the interface defined by
* `interfaceId`. Support of the actual ERC165 interface is automatic and
* registering its interface id is not required.
*
* See {IERC165-supportsInterface}.
*
* Requirements:
*
* - `interfaceId` cannot be the ERC165 invalid interface (`0xffffffff`).
*/
function _registerInterface(bytes4 interfaceId) internal virtual {
require(interfaceId != 0xffffffff, "ERC165: invalid interface id");
_supportedInterfaces[interfaceId] = true;
}
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
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) {
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) {
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) {
// 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) {
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) {
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) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @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) {
require(b <= a, "SafeMath: subtraction overflow");
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) {
if (a == 0) return 0;
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @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. 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) internal pure returns (uint256) {
require(b > 0, "SafeMath: division by zero");
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) {
require(b > 0, "SafeMath: modulo by zero");
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) {
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.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryDiv}.
*
* 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) {
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) {
require(b > 0, errorMessage);
return a % b;
}
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
import "../../utils/Context.sol";
import "./IERC721.sol";
import "./IERC721Metadata.sol";
import "./IERC721Enumerable.sol";
import "./IERC721Receiver.sol";
import "../../introspection/ERC165.sol";
import "../../math/SafeMath.sol";
import "../../utils/Address.sol";
import "../../utils/EnumerableSet.sol";
import "../../utils/EnumerableMap.sol";
import "../../utils/Strings.sol";
/**
* @title ERC721 Non-Fungible Token Standard basic implementation
* @dev see https://eips.ethereum.org/EIPS/eip-721
*/
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable {
using SafeMath for uint256;
using Address for address;
using EnumerableSet for EnumerableSet.UintSet;
using EnumerableMap for EnumerableMap.UintToAddressMap;
using Strings for uint256;
// Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
// which can be also obtained as `IERC721Receiver(0).onERC721Received.selector`
bytes4 private constant _ERC721_RECEIVED = 0x150b7a02;
// Mapping from holder address to their (enumerable) set of owned tokens
mapping (address => EnumerableSet.UintSet) private _holderTokens;
// Enumerable mapping from token ids to their owners
EnumerableMap.UintToAddressMap private _tokenOwners;
// 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;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Optional mapping for token URIs
mapping (uint256 => string) private _tokenURIs;
// Base URI
string private _baseURI;
/*
* bytes4(keccak256('balanceOf(address)')) == 0x70a08231
* bytes4(keccak256('ownerOf(uint256)')) == 0x6352211e
* bytes4(keccak256('approve(address,uint256)')) == 0x095ea7b3
* bytes4(keccak256('getApproved(uint256)')) == 0x081812fc
* bytes4(keccak256('setApprovalForAll(address,bool)')) == 0xa22cb465
* bytes4(keccak256('isApprovedForAll(address,address)')) == 0xe985e9c5
* bytes4(keccak256('transferFrom(address,address,uint256)')) == 0x23b872dd
* bytes4(keccak256('safeTransferFrom(address,address,uint256)')) == 0x42842e0e
* bytes4(keccak256('safeTransferFrom(address,address,uint256,bytes)')) == 0xb88d4fde
*
* => 0x70a08231 ^ 0x6352211e ^ 0x095ea7b3 ^ 0x081812fc ^
* 0xa22cb465 ^ 0xe985e9c5 ^ 0x23b872dd ^ 0x42842e0e ^ 0xb88d4fde == 0x80ac58cd
*/
bytes4 private constant _INTERFACE_ID_ERC721 = 0x80ac58cd;
/*
* bytes4(keccak256('name()')) == 0x06fdde03
* bytes4(keccak256('symbol()')) == 0x95d89b41
* bytes4(keccak256('tokenURI(uint256)')) == 0xc87b56dd
*
* => 0x06fdde03 ^ 0x95d89b41 ^ 0xc87b56dd == 0x5b5e139f
*/
bytes4 private constant _INTERFACE_ID_ERC721_METADATA = 0x5b5e139f;
/*
* bytes4(keccak256('totalSupply()')) == 0x18160ddd
* bytes4(keccak256('tokenOfOwnerByIndex(address,uint256)')) == 0x2f745c59
* bytes4(keccak256('tokenByIndex(uint256)')) == 0x4f6ccce7
*
* => 0x18160ddd ^ 0x2f745c59 ^ 0x4f6ccce7 == 0x780e9d63
*/
bytes4 private constant _INTERFACE_ID_ERC721_ENUMERABLE = 0x780e9d63;
/**
* @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
*/
constructor (string memory name_, string memory symbol_) public {
_name = name_;
_symbol = symbol_;
// register the supported interfaces to conform to ERC721 via ERC165
_registerInterface(_INTERFACE_ID_ERC721);
_registerInterface(_INTERFACE_ID_ERC721_METADATA);
_registerInterface(_INTERFACE_ID_ERC721_ENUMERABLE);
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner) public view virtual override returns (uint256) {
require(owner != address(0), "ERC721: balance query for the zero address");
return _holderTokens[owner].length();
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
return _tokenOwners.get(tokenId, "ERC721: owner query for nonexistent token");
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
string memory _tokenURI = _tokenURIs[tokenId];
string memory base = baseURI();
// If there is no base URI, return the token URI.
if (bytes(base).length == 0) {
return _tokenURI;
}
// If both are set, concatenate the baseURI and tokenURI (via abi.encodePacked).
if (bytes(_tokenURI).length > 0) {
return string(abi.encodePacked(base, _tokenURI));
}
// If there is a baseURI but no tokenURI, concatenate the tokenID to the baseURI.
return string(abi.encodePacked(base, tokenId.toString()));
}
/**
* @dev Returns the base URI set via {_setBaseURI}. This will be
* automatically added as a prefix in {tokenURI} to each token's URI, or
* to the token ID if no specific URI is set for that token ID.
*/
function baseURI() public view virtual returns (string memory) {
return _baseURI;
}
/**
* @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) {
return _holderTokens[owner].at(index);
}
/**
* @dev See {IERC721Enumerable-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
// _tokenOwners are indexed by tokenIds, so .length() returns the number of tokenIds
return _tokenOwners.length();
}
/**
* @dev See {IERC721Enumerable-tokenByIndex}.
*/
function tokenByIndex(uint256 index) public view virtual override returns (uint256) {
(uint256 tokenId, ) = _tokenOwners.at(index);
return tokenId;
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address to, uint256 tokenId) public virtual override {
address owner = ERC721.ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(_msgSender() == owner || ERC721.isApprovedForAll(owner, _msgSender()),
"ERC721: approve caller is not owner nor approved for all"
);
_approve(to, tokenId);
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view virtual override returns (address) {
require(_exists(tokenId), "ERC721: approved query for nonexistent token");
return _tokenApprovals[tokenId];
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
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);
}
/**
* @dev See {IERC721-isApprovedForAll}.
*/
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
return _operatorApprovals[owner][operator];
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(address from, address to, uint256 tokenId) public virtual override {
//solhint-disable-next-line max-line-length
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_transfer(from, to, tokenId);
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(address from, address to, uint256 tokenId) public virtual override {
safeTransferFrom(from, to, tokenId, "");
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_safeTransfer(from, to, tokenId, _data);
}
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* `_data` is additional data, it has no specified format and it is sent in call to `to`.
*
* This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
* implement alternative mechanisms to perform token transfer, such as signature-based.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeTransfer(address from, address to, uint256 tokenId, bytes memory _data) internal virtual {
_transfer(from, to, tokenId);
require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
*
* Tokens start existing when they are minted (`_mint`),
* and stop existing when they are burned (`_burn`).
*/
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return _tokenOwners.contains(tokenId);
}
/**
* @dev Returns whether `spender` is allowed to manage `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
require(_exists(tokenId), "ERC721: operator query for nonexistent token");
address owner = ERC721.ownerOf(tokenId);
return (spender == owner || getApproved(tokenId) == spender || ERC721.isApprovedForAll(owner, spender));
}
/**
* @dev Safely mints `tokenId` and transfers it to `to`.
*
* Requirements:
d*
* - `tokenId` must not exist.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeMint(address to, uint256 tokenId) internal virtual {
_safeMint(to, tokenId, "");
}
/**
* @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
* forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
*/
function _safeMint(address to, uint256 tokenId, bytes memory _data) internal virtual {
_mint(to, tokenId);
require(_checkOnERC721Received(address(0), to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
}
/**
* @dev Mints `tokenId` and transfers it to `to`.
*
* WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
*
* Requirements:
*
* - `tokenId` must not exist.
* - `to` cannot be the zero address.
*
* Emits a {Transfer} event.
*/
function _mint(address to, uint256 tokenId) internal virtual {
require(to != address(0), "ERC721: mint to the zero address");
require(!_exists(tokenId), "ERC721: token already minted");
_beforeTokenTransfer(address(0), to, tokenId);
_holderTokens[to].add(tokenId);
_tokenOwners.set(tokenId, to);
emit Transfer(address(0), to, tokenId);
}
/**
* @dev Destroys `tokenId`.
* The approval is cleared when the token is burned.
*
* Requirements:
*
* - `tokenId` must exist.
*
* Emits a {Transfer} event.
*/
function _burn(uint256 tokenId) internal virtual {
address owner = ERC721.ownerOf(tokenId); // internal owner
_beforeTokenTransfer(owner, address(0), tokenId);
// Clear approvals
_approve(address(0), tokenId);
// Clear metadata (if any)
if (bytes(_tokenURIs[tokenId]).length != 0) {
delete _tokenURIs[tokenId];
}
_holderTokens[owner].remove(tokenId);
_tokenOwners.remove(tokenId);
emit Transfer(owner, address(0), tokenId);
}
/**
* @dev Transfers `tokenId` from `from` to `to`.
* As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
*
* Emits a {Transfer} event.
*/
function _transfer(address from, address to, uint256 tokenId) internal virtual {
require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own"); // internal owner
require(to != address(0), "ERC721: transfer to the zero address");
_beforeTokenTransfer(from, to, tokenId);
// Clear approvals from the previous owner
_approve(address(0), tokenId);
_holderTokens[from].remove(tokenId);
_holderTokens[to].add(tokenId);
_tokenOwners.set(tokenId, to);
emit Transfer(from, to, tokenId);
}
/**
* @dev Sets `_tokenURI` as the tokenURI of `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual {
require(_exists(tokenId), "ERC721Metadata: URI set of nonexistent token");
_tokenURIs[tokenId] = _tokenURI;
}
/**
* @dev Internal function to set the base URI for all token IDs. It is
* automatically added as a prefix to the value returned in {tokenURI},
* or to the token ID if {tokenURI} is empty.
*/
function _setBaseURI(string memory baseURI_) internal virtual {
_baseURI = baseURI_;
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param from address representing the previous owner of the given token ID
* @param to target address that will receive the tokens
* @param tokenId uint256 ID of the token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory _data)
private returns (bool)
{
if (!to.isContract()) {
return true;
}
bytes memory returndata = to.functionCall(abi.encodeWithSelector(
IERC721Receiver(to).onERC721Received.selector,
_msgSender(),
from,
tokenId,
_data
), "ERC721: transfer to non ERC721Receiver implementer");
bytes4 retval = abi.decode(returndata, (bytes4));
return (retval == _ERC721_RECEIVED);
}
/**
* @dev Approve `to` to operate on `tokenId`
*
* Emits an {Approval} event.
*/
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ERC721.ownerOf(tokenId), to, tokenId); // internal owner
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, ``from``'s `tokenId` will be burned.
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal virtual { }
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.2 <0.8.0;
import "../../introspection/IERC165.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(address from, address to, uint256 tokenId) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 tokenId) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.2 <0.8.0;
import "./IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Enumerable is IERC721 {
/**
* @dev Returns the total amount of tokens stored by the contract.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns a token ID owned by `owner` at a given `index` of its token list.
* Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId);
/**
* @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
* Use along with {totalSupply} to enumerate all tokens.
*/
function tokenByIndex(uint256 index) external view returns (uint256);
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.2 <0.8.0;
import "./IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional metadata extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Metadata is IERC721 {
/**
* @dev Returns the token collection name.
*/
function name() external view returns (string memory);
/**
* @dev Returns the token collection symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) external view returns (string memory);
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
interface IERC721Receiver {
/**
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
* by `operator` from `from`, this function is called.
*
* It must return its Solidity selector to confirm the token transfer.
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
*
* The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.
*/
function onERC721Received(address operator, address from, uint256 tokenId, bytes calldata data) external returns (bytes4);
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.2 <0.8.0;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain`call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: value }(data);
return _verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.staticcall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.delegatecall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Library for managing an enumerable variant of Solidity's
* https://solidity.readthedocs.io/en/latest/types.html#mapping-types[`mapping`]
* type.
*
* Maps have the following properties:
*
* - Entries are added, removed, and checked for existence in constant time
* (O(1)).
* - Entries are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableMap for EnumerableMap.UintToAddressMap;
*
* // Declare a set state variable
* EnumerableMap.UintToAddressMap private myMap;
* }
* ```
*
* As of v3.0.0, only maps of type `uint256 -> address` (`UintToAddressMap`) are
* supported.
*/
library EnumerableMap {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Map type with
// bytes32 keys and values.
// The Map implementation uses private functions, and user-facing
// implementations (such as Uint256ToAddressMap) are just wrappers around
// the underlying Map.
// This means that we can only create new EnumerableMaps for types that fit
// in bytes32.
struct MapEntry {
bytes32 _key;
bytes32 _value;
}
struct Map {
// Storage of map keys and values
MapEntry[] _entries;
// Position of the entry defined by a key in the `entries` array, plus 1
// because index 0 means a key is not in the map.
mapping (bytes32 => uint256) _indexes;
}
/**
* @dev Adds a key-value pair to a map, or updates the value for an existing
* key. O(1).
*
* Returns true if the key was added to the map, that is if it was not
* already present.
*/
function _set(Map storage map, bytes32 key, bytes32 value) private returns (bool) {
// We read and store the key's index to prevent multiple reads from the same storage slot
uint256 keyIndex = map._indexes[key];
if (keyIndex == 0) { // Equivalent to !contains(map, key)
map._entries.push(MapEntry({ _key: key, _value: value }));
// The entry is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
map._indexes[key] = map._entries.length;
return true;
} else {
map._entries[keyIndex - 1]._value = value;
return false;
}
}
/**
* @dev Removes a key-value pair from a map. O(1).
*
* Returns true if the key was removed from the map, that is if it was present.
*/
function _remove(Map storage map, bytes32 key) private returns (bool) {
// We read and store the key's index to prevent multiple reads from the same storage slot
uint256 keyIndex = map._indexes[key];
if (keyIndex != 0) { // Equivalent to contains(map, key)
// To delete a key-value pair from the _entries array in O(1), we swap the entry to delete with the last one
// in the array, and then remove the last entry (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = keyIndex - 1;
uint256 lastIndex = map._entries.length - 1;
// When the entry to delete is the last one, the swap operation is unnecessary. However, since this occurs
// so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.
MapEntry storage lastEntry = map._entries[lastIndex];
// Move the last entry to the index where the entry to delete is
map._entries[toDeleteIndex] = lastEntry;
// Update the index for the moved entry
map._indexes[lastEntry._key] = toDeleteIndex + 1; // All indexes are 1-based
// Delete the slot where the moved entry was stored
map._entries.pop();
// Delete the index for the deleted slot
delete map._indexes[key];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the key is in the map. O(1).
*/
function _contains(Map storage map, bytes32 key) private view returns (bool) {
return map._indexes[key] != 0;
}
/**
* @dev Returns the number of key-value pairs in the map. O(1).
*/
function _length(Map storage map) private view returns (uint256) {
return map._entries.length;
}
/**
* @dev Returns the key-value pair stored at position `index` in the map. O(1).
*
* Note that there are no guarantees on the ordering of entries inside the
* array, and it may change when more entries are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Map storage map, uint256 index) private view returns (bytes32, bytes32) {
require(map._entries.length > index, "EnumerableMap: index out of bounds");
MapEntry storage entry = map._entries[index];
return (entry._key, entry._value);
}
/**
* @dev Tries to returns the value associated with `key`. O(1).
* Does not revert if `key` is not in the map.
*/
function _tryGet(Map storage map, bytes32 key) private view returns (bool, bytes32) {
uint256 keyIndex = map._indexes[key];
if (keyIndex == 0) return (false, 0); // Equivalent to contains(map, key)
return (true, map._entries[keyIndex - 1]._value); // All indexes are 1-based
}
/**
* @dev Returns the value associated with `key`. O(1).
*
* Requirements:
*
* - `key` must be in the map.
*/
function _get(Map storage map, bytes32 key) private view returns (bytes32) {
uint256 keyIndex = map._indexes[key];
require(keyIndex != 0, "EnumerableMap: nonexistent key"); // Equivalent to contains(map, key)
return map._entries[keyIndex - 1]._value; // All indexes are 1-based
}
/**
* @dev Same as {_get}, with a custom error message when `key` is not in the map.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {_tryGet}.
*/
function _get(Map storage map, bytes32 key, string memory errorMessage) private view returns (bytes32) {
uint256 keyIndex = map._indexes[key];
require(keyIndex != 0, errorMessage); // Equivalent to contains(map, key)
return map._entries[keyIndex - 1]._value; // All indexes are 1-based
}
// UintToAddressMap
struct UintToAddressMap {
Map _inner;
}
/**
* @dev Adds a key-value pair to a map, or updates the value for an existing
* key. O(1).
*
* Returns true if the key was added to the map, that is if it was not
* already present.
*/
function set(UintToAddressMap storage map, uint256 key, address value) internal returns (bool) {
return _set(map._inner, bytes32(key), bytes32(uint256(uint160(value))));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the key was removed from the map, that is if it was present.
*/
function remove(UintToAddressMap storage map, uint256 key) internal returns (bool) {
return _remove(map._inner, bytes32(key));
}
/**
* @dev Returns true if the key is in the map. O(1).
*/
function contains(UintToAddressMap storage map, uint256 key) internal view returns (bool) {
return _contains(map._inner, bytes32(key));
}
/**
* @dev Returns the number of elements in the map. O(1).
*/
function length(UintToAddressMap storage map) internal view returns (uint256) {
return _length(map._inner);
}
/**
* @dev Returns the element stored at position `index` in the set. O(1).
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintToAddressMap storage map, uint256 index) internal view returns (uint256, address) {
(bytes32 key, bytes32 value) = _at(map._inner, index);
return (uint256(key), address(uint160(uint256(value))));
}
/**
* @dev Tries to returns the value associated with `key`. O(1).
* Does not revert if `key` is not in the map.
*
* _Available since v3.4._
*/
function tryGet(UintToAddressMap storage map, uint256 key) internal view returns (bool, address) {
(bool success, bytes32 value) = _tryGet(map._inner, bytes32(key));
return (success, address(uint160(uint256(value))));
}
/**
* @dev Returns the value associated with `key`. O(1).
*
* Requirements:
*
* - `key` must be in the map.
*/
function get(UintToAddressMap storage map, uint256 key) internal view returns (address) {
return address(uint160(uint256(_get(map._inner, bytes32(key)))));
}
/**
* @dev Same as {get}, with a custom error message when `key` is not in the map.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryGet}.
*/
function get(UintToAddressMap storage map, uint256 key, string memory errorMessage) internal view returns (address) {
return address(uint160(uint256(_get(map._inner, bytes32(key), errorMessage))));
}
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
* and `uint256` (`UintSet`) are supported.
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping (bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) { // Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
// When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
// so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.
bytes32 lastvalue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastvalue;
// Update the index for the moved value
set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
require(set._values.length > index, "EnumerableSet: index out of bounds");
return set._values[index];
}
// Bytes32Set
struct Bytes32Set {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _add(set._inner, value);
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _remove(set._inner, value);
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
return _contains(set._inner, value);
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(Bytes32Set storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
return _at(set._inner, index);
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint160(uint256(_at(set._inner, index))));
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor () internal {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and make it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
// On the first call to nonReentrant, _notEntered will be true
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
_;
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev String operations.
*/
library Strings {
/**
* @dev Converts a `uint256` to its ASCII `string` 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);
uint256 index = digits - 1;
temp = value;
while (temp != 0) {
buffer[index--] = bytes1(uint8(48 + temp % 10));
temp /= 10;
}
return string(buffer);
}
}{
"optimizer": {
"enabled": false,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"contract MutationToken","name":"_mutationToken","type":"address"},{"internalType":"contract MutationMetadata","name":"_mutationMetadata","type":"address"},{"internalType":"contract Seeder","name":"_seeder","type":"address"},{"internalType":"address payable","name":"_admin","type":"address"},{"internalType":"address payable","name":"_authorizedSigner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"paid","type":"uint256"}],"name":"MutationBought","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"admin","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"adminAbsolutePrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"adminFeePercent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"string","name":"_mutantName","type":"string"},{"components":[{"internalType":"uint256","name":"birthBlock","type":"uint256"},{"internalType":"uint256","name":"mutationBlock","type":"uint256"},{"internalType":"uint256","name":"mutationIndex","type":"uint256"},{"internalType":"string","name":"arweave","type":"string"}],"internalType":"struct Mutation","name":"_mutation","type":"tuple"},{"internalType":"uint256","name":"_traits","type":"uint256"}],"name":"adminMint","outputs":[{"internalType":"uint256","name":"_mutationTokenId","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"authorizedSigner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"string","name":"_mutantName","type":"string"},{"components":[{"internalType":"uint256","name":"birthBlock","type":"uint256"},{"internalType":"uint256","name":"mutationBlock","type":"uint256"},{"internalType":"uint256","name":"mutationIndex","type":"uint256"},{"internalType":"string","name":"arweave","type":"string"}],"internalType":"struct Mutation","name":"_mutation","type":"tuple"},{"internalType":"uint256","name":"_traits","type":"uint256"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"buy","outputs":[{"internalType":"uint256","name":"_mutationTokenId","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"string","name":"_mutantName","type":"string"},{"components":[{"internalType":"uint256","name":"birthBlock","type":"uint256"},{"internalType":"uint256","name":"mutationBlock","type":"uint256"},{"internalType":"uint256","name":"mutationIndex","type":"uint256"},{"internalType":"string","name":"arweave","type":"string"}],"internalType":"struct Mutation","name":"_mutation","type":"tuple"},{"internalType":"uint256","name":"_traits","type":"uint256"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"buyAsHolder","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"db","outputs":[{"internalType":"contract MutationControllerDB","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getPublicHolderShare","outputs":[{"internalType":"uint256","name":"_price","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_mutantTokenId","type":"uint256"}],"name":"getPublicMintEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_mutantTokenId","type":"uint256"}],"name":"getPublicMintingPayoutWallet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_mutantTokenId","type":"uint256"}],"name":"getTotalPublicMintPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxMutationBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minMutationBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mutationMetadata","outputs":[{"internalType":"contract MutationMetadata","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mutationToken","outputs":[{"internalType":"contract MutationToken","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"seeder","outputs":[{"internalType":"contract Seeder","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_mutantTokenId","type":"uint256"},{"internalType":"address","name":"_payoutWalletAddress","type":"address"}],"name":"setHolderPublicMintPayoutWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_mutantTokenId","type":"uint256"},{"internalType":"uint256","name":"_publicPrice","type":"uint256"}],"name":"setHolderShare","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxMutationBlock","type":"uint256"}],"name":"setMaxMutationBlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxSupply","type":"uint256"}],"name":"setMaxSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_minMutationBlock","type":"uint256"}],"name":"setMinMutationBlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_mutantTokenId","type":"uint256"},{"internalType":"bool","name":"_enabled","type":"bool"}],"name":"setPublicMintEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_mutantTokenId","type":"uint256"},{"internalType":"uint256","name":"_publicPrice","type":"uint256"},{"internalType":"address","name":"_payoutWalletAddress","type":"address"}],"name":"setPublicMintHolderShareAndPayoutAddressAndEnable","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"_admin","type":"address"}],"name":"updateAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_authorizedSigner","type":"address"}],"name":"updateAuthorizedSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract MutationControllerDB","name":"_db","type":"address"}],"name":"updateDB","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract MutationMetadata","name":"_mutationMetadata","type":"address"}],"name":"updateMutationMetadata","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract MutationToken","name":"_mutationToken","type":"address"}],"name":"updateMutationToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_nextTokenId","type":"uint256"}],"name":"updateNextTokenId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_paused","type":"bool"}],"name":"updatePaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_price","type":"uint256"}],"name":"updateadminAbsolutePrice","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
608060405266470de4df820000600255600a6003556000600460006101000a81548160ff02191690831515021790555060016009556000600b5563054c5638600c55610100600d553480156200005457600080fd5b50604051620054be380380620054be83398181016040528101906200007a919062000524565b60006200008c620004c060201b60201c565b9050806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35060018081905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415620001a4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200019b90620007f2565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141562000217576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200020e90620007d0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614156200028a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620002819062000814565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415620002fd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620002f490620007ae565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141562000370576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620003679062000836565b60405180910390fd5b84600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555083600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600460016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505050505062000955565b600033905090565b600081519050620004d981620008ed565b92915050565b600081519050620004f08162000907565b92915050565b600081519050620005078162000921565b92915050565b6000815190506200051e816200093b565b92915050565b600080600080600060a086880312156200053d57600080fd5b60006200054d88828901620004f6565b95505060206200056088828901620004df565b945050604062000573888289016200050d565b93505060606200058688828901620004c8565b92505060806200059988828901620004c8565b9150509295509295909350565b6000620005b560338362000858565b91507f4d75746174696f6e436f6e74726f6c6c65723a206d657461646174612063616e60008301527f6e6f74206265207a65726f2061646472657373000000000000000000000000006020830152604082019050919050565b60006200061d60318362000858565b91507f4d75746174696f6e436f6e74726f6c6c65723a207369676e65722063616e6e6f60008301527f74206265207a65726f20616464726573730000000000000000000000000000006020830152604082019050919050565b60006200068560308362000858565b91507f4d75746174696f6e436f6e74726f6c6c65723a2061646d696e2063616e6e6f7460008301527f206265207a65726f2061646472657373000000000000000000000000000000006020830152604082019050919050565b6000620006ed60308362000858565b91507f4d75746174696f6e436f6e74726f6c6c65723a20746f6b656e2063616e6e6f7460008301527f206265207a65726f2061646472657373000000000000000000000000000000006020830152604082019050919050565b60006200075560318362000858565b91507f4d75746174696f6e436f6e74726f6c6c65723a207365656465722063616e6e6f60008301527f74206265207a65726f20616464726573730000000000000000000000000000006020830152604082019050919050565b60006020820190508181036000830152620007c981620005a6565b9050919050565b60006020820190508181036000830152620007eb816200060e565b9050919050565b600060208201905081810360008301526200080d8162000676565b9050919050565b600060208201905081810360008301526200082f81620006de565b9050919050565b60006020820190508181036000830152620008518162000746565b9050919050565b600082825260208201905092915050565b60006200087682620008cd565b9050919050565b60006200088a82620008cd565b9050919050565b60006200089e8262000869565b9050919050565b6000620008b28262000869565b9050919050565b6000620008c68262000869565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b620008f8816200087d565b81146200090457600080fd5b50565b620009128162000891565b81146200091e57600080fd5b50565b6200092c81620008a5565b81146200093857600080fd5b50565b6200094681620008b9565b81146200095257600080fd5b50565b614b5980620009656000396000f3fe60806040526004361061021a5760003560e01c8063715018a611610123578063b6f581a6116100ab578063d5abeb011161006f578063d5abeb011461079f578063e2f273bd146107ca578063e42c21d2146107f3578063f2fde38b1461081e578063f851a440146108475761021a565b8063b6f581a6146106ce578063bff1e13f146106f9578063c546b1a614610722578063c771909c1461074b578063cc72115d146107765761021a565b80638da5cb5b116100f25780638da5cb5b146105f15780638ffcd6b71461061c578063952cf2bf1461063857806399b1ce9114610661578063a5a1b6da146106915761021a565b8063715018a61461055d5780637e3657231461057457806380118f241461059d5780638c7fb793146105c65761021a565b80634d655aff116101a65780636a87f309116101755780636a87f3091461048c5780636e5e4080146104b75780636ebfc55f146104e05780636ee5fc611461050b5780636f8b44b0146105345761021a565b80634d655aff146103e25780635c975abb1461040d578063669ed93514610438578063684931ed146104615761021a565b8063204f8b79116101ed578063204f8b79146102eb5780632a99e0a21461031457806346cd94b814610351578063477d60051461038e57806349b0d993146103b75761021a565b806308cdc2a81461021f57806309449724146102485780630c365cc9146102855780630ec26401146102ae575b600080fd5b34801561022b57600080fd5b506102466004803603810190610241919061332e565b610872565b005b34801561025457600080fd5b5061026f600480360381019061026a91906131dc565b61090b565b60405161027c91906146cb565b60405180910390f35b34801561029157600080fd5b506102ac60048036038101906102a791906133fb565b6109b3565b005b3480156102ba57600080fd5b506102d560048036038101906102d091906133fb565b610a39565b6040516102e29190614220565b60405180910390f35b3480156102f757600080fd5b50610312600480360381019061030d9190613380565b610aed565b005b34801561032057600080fd5b5061033b600480360381019061033691906133fb565b610bad565b60405161034891906146cb565b60405180910390f35b34801561035d57600080fd5b50610378600480360381019061037391906133fb565b610cb4565b604051610385919061427f565b60405180910390f35b34801561039a57600080fd5b506103b560048036038101906103b091906133fb565b610d68565b005b3480156103c357600080fd5b506103cc610e02565b6040516103d991906146cb565b60405180910390f35b3480156103ee57600080fd5b506103f7610e08565b60405161040491906142df565b60405180910390f35b34801561041957600080fd5b50610422610e2e565b60405161042f919061427f565b60405180910390f35b34801561044457600080fd5b5061045f600480360381019061045a9190613161565b610e41565b005b34801561046d57600080fd5b50610476610f71565b6040516104839190614330565b60405180910390f35b34801561049857600080fd5b506104a1610f97565b6040516104ae91906146cb565b60405180910390f35b3480156104c357600080fd5b506104de60048036038101906104d991906133a9565b610f9d565b005b3480156104ec57600080fd5b506104f561105d565b60405161050291906146cb565b60405180910390f35b34801561051757600080fd5b50610532600480360381019061052d91906134c5565b611063565b005b34801561054057600080fd5b5061055b600480360381019061055691906133fb565b611268565b005b34801561056957600080fd5b5061057261134a565b005b34801561058057600080fd5b5061059b600480360381019061059691906133d2565b611484565b005b3480156105a957600080fd5b506105c460048036038101906105bf9190613489565b611544565b005b3480156105d257600080fd5b506105db611749565b6040516105e891906146cb565b60405180910390f35b3480156105fd57600080fd5b5061060661174f565b6040516106139190614220565b60405180910390f35b6106366004803603810190610631919061326f565b611778565b005b34801561064457600080fd5b5061065f600480360381019061065a91906133fb565b611b08565b005b61067b6004803603810190610676919061326f565b611ba2565b60405161068891906146cb565b60405180910390f35b34801561069d57600080fd5b506106b860048036038101906106b391906133fb565b612151565b6040516106c591906146cb565b60405180910390f35b3480156106da57600080fd5b506106e3612205565b6040516106f091906142fa565b60405180910390f35b34801561070557600080fd5b50610720600480360381019061071b919061344d565b61222b565b005b34801561072e57600080fd5b50610749600480360381019061074491906133fb565b6124a0565b005b34801561075757600080fd5b50610760612526565b60405161076d9190614220565b60405180910390f35b34801561078257600080fd5b5061079d60048036038101906107989190613501565b61254c565b005b3480156107ab57600080fd5b506107b4612570565b6040516107c191906146cb565b60405180910390f35b3480156107d657600080fd5b506107f160048036038101906107ec91906131b3565b612576565b005b3480156107ff57600080fd5b506108086126a6565b6040516108159190614315565b60405180910390f35b34801561082a57600080fd5b5061084560048036038101906108409190613161565b6126cc565b005b34801561085357600080fd5b5061085c612875565b604051610869919061423b565b60405180910390f35b61087a61289b565b73ffffffffffffffffffffffffffffffffffffffff1661089861174f565b73ffffffffffffffffffffffffffffffffffffffff16146108ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108e5906145eb565b60405180910390fd5b80600460006101000a81548160ff02191690831515021790555050565b6000600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461099d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109949061462b565b60405180910390fd5b6109a9858585856128a3565b9050949350505050565b6109bb61289b565b73ffffffffffffffffffffffffffffffffffffffff166109d961174f565b73ffffffffffffffffffffffffffffffffffffffff1614610a2f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a26906145eb565b60405180910390fd5b8060098190555050565b6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630ec26401836040518263ffffffff1660e01b8152600401610a9691906146cb565b60206040518083038186803b158015610aae57600080fd5b505afa158015610ac2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae6919061318a565b9050919050565b610af561289b565b73ffffffffffffffffffffffffffffffffffffffff16610b1361174f565b73ffffffffffffffffffffffffffffffffffffffff1614610b69576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b60906145eb565b60405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bd825b5b846040518263ffffffff1660e01b8152600401610c0b91906146cb565b60206040518083038186803b158015610c2357600080fd5b505afa158015610c37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c5b9190613424565b9050610cac610c9b6064610c8d610c7e6064600354612ac090919063ffffffff16565b85612b1590919063ffffffff16565b612b8590919063ffffffff16565b600254612ac090919063ffffffff16565b915050919050565b6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166346cd94b8836040518263ffffffff1660e01b8152600401610d1191906146cb565b60206040518083038186803b158015610d2957600080fd5b505afa158015610d3d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d619190613357565b9050919050565b600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610df8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610def9061462b565b60405180910390fd5b80600c8190555050565b60025481565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600460009054906101000a900460ff1681565b610e4961289b565b73ffffffffffffffffffffffffffffffffffffffff16610e6761174f565b73ffffffffffffffffffffffffffffffffffffffff1614610ebd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eb4906145eb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610f2d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f24906144eb565b60405180910390fd5b80600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600c5481565b610fa561289b565b73ffffffffffffffffffffffffffffffffffffffff16610fc361174f565b73ffffffffffffffffffffffffffffffffffffffff1614611019576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611010906145eb565b60405180910390fd5b80600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600b5481565b813373ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e836040518263ffffffff1660e01b81526004016110d691906146cb565b60206040518083038186803b1580156110ee57600080fd5b505afa158015611102573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611126919061318a565b73ffffffffffffffffffffffffffffffffffffffff1614806111955750600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6111d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111cb9061464b565b60405180910390fd5b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f95ac77784846040518363ffffffff1660e01b81526004016112319291906147c2565b600060405180830381600087803b15801561124b57600080fd5b505af115801561125f573d6000803e3d6000fd5b50505050505050565b600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146112f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ef9061462b565b60405180910390fd5b600160095403811015611340576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113379061436b565b60405180910390fd5b80600d8190555050565b61135261289b565b73ffffffffffffffffffffffffffffffffffffffff1661137061174f565b73ffffffffffffffffffffffffffffffffffffffff16146113c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113bd906145eb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b61148c61289b565b73ffffffffffffffffffffffffffffffffffffffff166114aa61174f565b73ffffffffffffffffffffffffffffffffffffffff1614611500576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114f7906145eb565b60405180910390fd5b80600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b813373ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e836040518263ffffffff1660e01b81526004016115b791906146cb565b60206040518083038186803b1580156115cf57600080fd5b505afa1580156115e3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611607919061318a565b73ffffffffffffffffffffffffffffffffffffffff1614806116765750600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6116b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ac9061464b565b60405180910390fd5b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663418d0e8384846040518363ffffffff1660e01b8152600401611712929190614746565b600060405180830381600087803b15801561172c57600080fd5b505af1158015611740573d6000803e3d6000fd5b50505050505050565b60035481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600460009054906101000a900460ff16156117c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117bf906143cb565b60405180910390fd5b6002600154141561180e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118059061468b565b60405180910390fd5b600260018190555082600001513373ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e836040518263ffffffff1660e01b815260040161188d91906146cb565b60206040518083038186803b1580156118a557600080fd5b505afa1580156118b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118dd919061318a565b73ffffffffffffffffffffffffffffffffffffffff16148061194c5750600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61198b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119829061464b565b60405180910390fd5b6002543410156119d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119c79061460b565b60405180910390fd5b6119dc85858585612bdb565b60006119ea878787876128a3565b90506000600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1634604051611a349061420b565b60006040518083038185875af1925050503d8060008114611a71576040519150601f19603f3d011682016040523d82523d6000602084013e611a76565b606091505b50508091505080611abc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ab39061438b565b60405180910390fd5b7f6d8641fcfa3345036cff80abce1ebfdf2d1c20ee151d629ff8cbe4ce064979ac828934604051611aef9392919061470f565b60405180910390a1505050600180819055505050505050565b600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611b98576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b8f9061462b565b60405180910390fd5b80600b8190555050565b6000600460009054906101000a900460ff1615611bf4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611beb906143cb565b60405180910390fd5b60026001541415611c3a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c319061468b565b60405180910390fd5b6002600181905550600084600001519050600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166346cd94b8826040518263ffffffff1660e01b8152600401611ca691906146cb565b60206040518083038186803b158015611cbe57600080fd5b505afa158015611cd2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cf69190613357565b611d35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d2c9061446b565b60405180910390fd5b6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bd825b5b836040518263ffffffff1660e01b8152600401611d9291906146cb565b60206040518083038186803b158015611daa57600080fd5b505afa158015611dbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611de29190613424565b9050611ded82610bad565b341015611e2f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e269061460b565b60405180910390fd5b6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630ec26401846040518263ffffffff1660e01b8152600401611e8c91906146cb565b60206040518083038186803b158015611ea457600080fd5b505afa158015611eb8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611edc919061318a565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611f4e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f459061466b565b60405180910390fd5b611f5a88888888612bdb565b6000611f688a8a8a8a6128a3565b90506000611f7f8434612cd690919063ffffffff16565b90506000600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1682604051611fc99061420b565b60006040518083038185875af1925050503d8060008114612006576040519150601f19603f3d011682016040523d82523d6000602084013e61200b565b606091505b50508091505080612051576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120489061454b565b60405180910390fd5b8373ffffffffffffffffffffffffffffffffffffffff16856040516120759061420b565b60006040518083038185875af1925050503d80600081146120b2576040519150601f19603f3d011682016040523d82523d6000602084013e6120b7565b606091505b505080915050806120fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120f49061444b565b60405180910390fd5b7f6d8641fcfa3345036cff80abce1ebfdf2d1c20ee151d629ff8cbe4ce064979ac838d346040516121309392919061470f565b60405180910390a18296505050505050506001808190555095945050505050565b6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bd825b5b836040518263ffffffff1660e01b81526004016121ae91906146cb565b60206040518083038186803b1580156121c657600080fd5b505afa1580156121da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121fe9190613424565b9050919050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b813373ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e836040518263ffffffff1660e01b815260040161229e91906146cb565b60206040518083038186803b1580156122b657600080fd5b505afa1580156122ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122ee919061318a565b73ffffffffffffffffffffffffffffffffffffffff16148061235d5750600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61239c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123939061464b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561240c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612403906146ab565b60405180910390fd5b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bff1e13f84846040518363ffffffff1660e01b81526004016124699291906146e6565b600060405180830381600087803b15801561248357600080fd5b505af1158015612497573d6000803e3d6000fd5b50505050505050565b6124a861289b565b73ffffffffffffffffffffffffffffffffffffffff166124c661174f565b73ffffffffffffffffffffffffffffffffffffffff161461251c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612513906145eb565b60405180910390fd5b8060028190555050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6125568383611063565b612560838261222b565b61256b836001611544565b505050565b600d5481565b61257e61289b565b73ffffffffffffffffffffffffffffffffffffffff1661259c61174f565b73ffffffffffffffffffffffffffffffffffffffff16146125f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e9906145eb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612662576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126599061452b565b60405180910390fd5b80600460016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6126d461289b565b73ffffffffffffffffffffffffffffffffffffffff166126f261174f565b73ffffffffffffffffffffffffffffffffffffffff1614612748576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161273f906145eb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156127b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127af906143eb565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600033905090565b6000600b548360200151116128ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128e49061440b565b60405180910390fd5b600c5483602001511115612936576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161292d906145cb565b60405180910390fd5b600d54600954111561297d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612974906145ab565b60405180910390fd5b600060096000815480929190600101919050559050600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ea61831d828787876040518563ffffffff1660e01b81526004016129f3949392919061476f565b600060405180830381600087803b158015612a0d57600080fd5b505af1158015612a21573d6000803e3d6000fd5b50505050600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f1987836040518363ffffffff1660e01b8152600401612a82929190614256565b600060405180830381600087803b158015612a9c57600080fd5b505af1158015612ab0573d6000803e3d6000fd5b5050505080915050949350505050565b600080828401905083811015612b0b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b029061442b565b60405180910390fd5b8091505092915050565b600080831415612b285760009050612b7f565b6000828402905082848281612b3957fe5b0414612b7a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b719061458b565b60405180910390fd5b809150505b92915050565b6000808211612bc9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612bc09061450b565b60405180910390fd5b818381612bd257fe5b04905092915050565b60003384600001518560600151866020015187604001518988604051602001612c0a979695949392919061416c565b6040516020818303038152906040528051906020012090506000612c2d82612d26565b90506000612c3b8285612d56565b9050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614612ccd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612cc4906144cb565b60405180910390fd5b50505050505050565b600082821115612d1b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d129061448b565b60405180910390fd5b818303905092915050565b600081604051602001612d3991906141e5565b604051602081830303815290604052805190602001209050919050565b60006041825114612d9c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d93906143ab565b60405180910390fd5b60008060006020850151925060408501519150606085015160001a9050612dc586828585612dd0565b935050505092915050565b60007f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08260001c1115612e38576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e2f906144ab565b60405180910390fd5b601b8460ff161480612e4d5750601c8460ff16145b612e8c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e839061456b565b60405180910390fd5b600060018686868660405160008152602001604052604051612eb1949392919061429a565b6020604051602081039080840390855afa158015612ed3573d6000803e3d6000fd5b505050602060405103519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612f4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612f469061434b565b60405180910390fd5b80915050949350505050565b600081359050612f6a81614a82565b92915050565b600081519050612f7f81614a82565b92915050565b600081359050612f9481614a99565b92915050565b600081359050612fa981614ab0565b92915050565b600081519050612fbe81614ab0565b92915050565b600082601f830112612fd557600080fd5b8135612fe8612fe382614818565b6147eb565b9150808252602083016020830185838301111561300457600080fd5b61300f8382846149ea565b50505092915050565b60008135905061302781614ac7565b92915050565b60008135905061303c81614ade565b92915050565b60008135905061305181614af5565b92915050565b600082601f83011261306857600080fd5b813561307b61307682614844565b6147eb565b9150808252602083016020830185838301111561309757600080fd5b6130a28382846149ea565b50505092915050565b6000608082840312156130bd57600080fd5b6130c760806147eb565b905060006130d784828501613137565b60008301525060206130eb84828501613137565b60208301525060406130ff84828501613137565b604083015250606082013567ffffffffffffffff81111561311f57600080fd5b61312b84828501613057565b60608301525092915050565b60008135905061314681614b0c565b92915050565b60008151905061315b81614b0c565b92915050565b60006020828403121561317357600080fd5b600061318184828501612f5b565b91505092915050565b60006020828403121561319c57600080fd5b60006131aa84828501612f70565b91505092915050565b6000602082840312156131c557600080fd5b60006131d384828501612f85565b91505092915050565b600080600080608085870312156131f257600080fd5b600061320087828801612f5b565b945050602085013567ffffffffffffffff81111561321d57600080fd5b61322987828801613057565b935050604085013567ffffffffffffffff81111561324657600080fd5b613252878288016130ab565b925050606061326387828801613137565b91505092959194509250565b600080600080600060a0868803121561328757600080fd5b600061329588828901612f5b565b955050602086013567ffffffffffffffff8111156132b257600080fd5b6132be88828901613057565b945050604086013567ffffffffffffffff8111156132db57600080fd5b6132e7888289016130ab565b93505060606132f888828901613137565b925050608086013567ffffffffffffffff81111561331557600080fd5b61332188828901612fc4565b9150509295509295909350565b60006020828403121561334057600080fd5b600061334e84828501612f9a565b91505092915050565b60006020828403121561336957600080fd5b600061337784828501612faf565b91505092915050565b60006020828403121561339257600080fd5b60006133a084828501613018565b91505092915050565b6000602082840312156133bb57600080fd5b60006133c98482850161302d565b91505092915050565b6000602082840312156133e457600080fd5b60006133f284828501613042565b91505092915050565b60006020828403121561340d57600080fd5b600061341b84828501613137565b91505092915050565b60006020828403121561343657600080fd5b60006134448482850161314c565b91505092915050565b6000806040838503121561346057600080fd5b600061346e85828601613137565b925050602061347f85828601612f5b565b9150509250929050565b6000806040838503121561349c57600080fd5b60006134aa85828601613137565b92505060206134bb85828601612f9a565b9150509250929050565b600080604083850312156134d857600080fd5b60006134e685828601613137565b92505060206134f785828601613137565b9150509250929050565b60008060006060848603121561351657600080fd5b600061352486828701613137565b935050602061353586828701613137565b925050604061354686828701612f5b565b9150509250925092565b613559816148c5565b82525050565b61357061356b826148c5565b614a2c565b82525050565b61357f816148b3565b82525050565b61358e816148d7565b82525050565b61359d816148e3565b82525050565b6135b46135af826148e3565b614a3e565b82525050565b6135c38161495a565b82525050565b6135d28161497e565b82525050565b6135e1816149a2565b82525050565b6135f0816149c6565b82525050565b600061360182614870565b61360b8185614886565b935061361b8185602086016149f9565b61362481614a64565b840191505092915050565b600061363a82614870565b6136448185614897565b93506136548185602086016149f9565b61365d81614a64565b840191505092915050565b600061367382614870565b61367d81856148a8565b935061368d8185602086016149f9565b80840191505092915050565b60006136a6601883614897565b91507f45434453413a20696e76616c6964207369676e617475726500000000000000006000830152602082019050919050565b60006136e6602d83614897565b91507f63616e6e6f7420736872696e6b206d617820737570706c792062656c6f77206360008301527f757272656e7420737570706c79000000000000000000000000000000000000006020830152604082019050919050565b600061374c603483614897565b91507f4d75746174696f6e436f6e74726f6c6c65723a205061796f757420616464726560008301527f7373206661696c656420746f20726563656976650000000000000000000000006020830152604082019050919050565b60006137b2601f83614897565b91507f45434453413a20696e76616c6964207369676e6174757265206c656e677468006000830152602082019050919050565b60006137f2601c836148a8565b91507f19457468657265756d205369676e6564204d6573736167653a0a3332000000006000830152601c82019050919050565b6000613832601d83614897565b91507f4d75746174696f6e436f6e74726f6c6c65723a206973207061757365640000006000830152602082019050919050565b6000613872602683614897565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006138d8601083614897565b91507f4d75746174696f6e20746f6f206f6c64000000000000000000000000000000006000830152602082019050919050565b6000613918601b83614897565b91507f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006000830152602082019050919050565b6000613958602c83614897565b91507f4d75746174696f6e436f6e74726f6c6c65723a20486f6c646572206661696c6560008301527f6420746f207265636569766500000000000000000000000000000000000000006020830152604082019050919050565b60006139be604383614897565b91507f4d75746174696f6e436f6e74726f6c6c65723a205075626c6963206d696e742060008301527f6e6565647320746f20626520616c6c6f77656420666f722074686973206d757460208301527f616e7400000000000000000000000000000000000000000000000000000000006040830152606082019050919050565b6000613a4a601e83614897565b91507f536166654d6174683a207375627472616374696f6e206f766572666c6f7700006000830152602082019050919050565b6000613a8a602283614897565b91507f45434453413a20696e76616c6964207369676e6174757265202773272076616c60008301527f75650000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613af0602583614897565b91507f4d75746174696f6e436f6e74726f6c6c65723a20496e76616c6964207369676e60008301527f61747572650000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613b56603183614897565b91507f4d75746174696f6e436f6e74726f6c6c65723a207369676e65722063616e6e6f60008301527f74206265207a65726f20616464726573730000000000000000000000000000006020830152604082019050919050565b6000613bbc601a83614897565b91507f536166654d6174683a206469766973696f6e206279207a65726f0000000000006000830152602082019050919050565b6000613bfc603083614897565b91507f4d75746174696f6e436f6e74726f6c6c65723a2061646d696e2063616e6e6f7460008301527f206265207a65726f2061646472657373000000000000000000000000000000006020830152604082019050919050565b6000613c62602b83614897565b91507f4d75746174696f6e436f6e74726f6c6c65723a2041646d696e206661696c656460008301527f20746f20726563656976650000000000000000000000000000000000000000006020830152604082019050919050565b6000613cc8602283614897565b91507f45434453413a20696e76616c6964207369676e6174757265202776272076616c60008301527f75650000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613d2e602183614897565b91507f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008301527f77000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613d94601383614897565b91507f4d61782e20737570706c792072656163686564000000000000000000000000006000830152602082019050919050565b6000613dd4601083614897565b91507f4d75746174696f6e20746f6f206e6577000000000000000000000000000000006000830152602082019050919050565b6000613e14602083614897565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b6000613e54603183614897565b91507f4d75746174696f6e436f6e74726f6c6c65723a20596f7520646964206e6f742060008301527f73656e6420656e6f7567682065746865720000000000000000000000000000006020830152604082019050919050565b6000613eba602983614897565b91507f4d75746174696f6e436f6e74726f6c6c65723a20596f7520617265206e6f742060008301527f7468652061646d696e00000000000000000000000000000000000000000000006020830152604082019050919050565b6000613f2060008361487b565b9150600082019050919050565b6000613f3a604383614897565b91507f4d75746174696f6e436f6e74726f6c6c65723a20796f7520646f206e6f74206f60008301527f776e2074686174206d7574616e74206f7220796f7520617265206e6f7420616460208301527f6d696e00000000000000000000000000000000000000000000000000000000006040830152606082019050919050565b6000613fc6604083614897565b91507f4d75746174696f6e436f6e74726f6c6c65723a204e6f20726563656976696e6760008301527f206d7574616e7420686f6c646572207061796f75742077616c6c6574207365746020830152604082019050919050565b600061402c601f83614897565b91507f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006000830152602082019050919050565b600061406c603883614897565b91507f4d75746174696f6e436f6e74726f6c6c65723a205061796f75742077616c6c6560008301527f742063616e6e6f74206265207a65726f206164647265737300000000000000006020830152604082019050919050565b60006080830160008301516140dd6000860182614128565b5060208301516140f06020860182614128565b5060408301516141036040860182614128565b506060830151848203606086015261411b82826135f6565b9150508091505092915050565b61413181614943565b82525050565b61414081614943565b82525050565b61415761415282614943565b614a5a565b82525050565b6141668161494d565b82525050565b6000614178828a61355f565b6014820191506141888289614146565b6020820191506141988288613668565b91506141a48287614146565b6020820191506141b48286614146565b6020820191506141c48285613668565b91506141d08284614146565b60208201915081905098975050505050505050565b60006141f0826137e5565b91506141fc82846135a3565b60208201915081905092915050565b600061421682613f13565b9150819050919050565b60006020820190506142356000830184613576565b92915050565b60006020820190506142506000830184613550565b92915050565b600060408201905061426b6000830185613576565b6142786020830184614137565b9392505050565b60006020820190506142946000830184613585565b92915050565b60006080820190506142af6000830187613594565b6142bc602083018661415d565b6142c96040830185613594565b6142d66060830184613594565b95945050505050565b60006020820190506142f460008301846135ba565b92915050565b600060208201905061430f60008301846135c9565b92915050565b600060208201905061432a60008301846135d8565b92915050565b600060208201905061434560008301846135e7565b92915050565b6000602082019050818103600083015261436481613699565b9050919050565b60006020820190508181036000830152614384816136d9565b9050919050565b600060208201905081810360008301526143a48161373f565b9050919050565b600060208201905081810360008301526143c4816137a5565b9050919050565b600060208201905081810360008301526143e481613825565b9050919050565b6000602082019050818103600083015261440481613865565b9050919050565b60006020820190508181036000830152614424816138cb565b9050919050565b600060208201905081810360008301526144448161390b565b9050919050565b600060208201905081810360008301526144648161394b565b9050919050565b60006020820190508181036000830152614484816139b1565b9050919050565b600060208201905081810360008301526144a481613a3d565b9050919050565b600060208201905081810360008301526144c481613a7d565b9050919050565b600060208201905081810360008301526144e481613ae3565b9050919050565b6000602082019050818103600083015261450481613b49565b9050919050565b6000602082019050818103600083015261452481613baf565b9050919050565b6000602082019050818103600083015261454481613bef565b9050919050565b6000602082019050818103600083015261456481613c55565b9050919050565b6000602082019050818103600083015261458481613cbb565b9050919050565b600060208201905081810360008301526145a481613d21565b9050919050565b600060208201905081810360008301526145c481613d87565b9050919050565b600060208201905081810360008301526145e481613dc7565b9050919050565b6000602082019050818103600083015261460481613e07565b9050919050565b6000602082019050818103600083015261462481613e47565b9050919050565b6000602082019050818103600083015261464481613ead565b9050919050565b6000602082019050818103600083015261466481613f2d565b9050919050565b6000602082019050818103600083015261468481613fb9565b9050919050565b600060208201905081810360008301526146a48161401f565b9050919050565b600060208201905081810360008301526146c48161405f565b9050919050565b60006020820190506146e06000830184614137565b92915050565b60006040820190506146fb6000830185614137565b6147086020830184613576565b9392505050565b60006060820190506147246000830186614137565b6147316020830185613576565b61473e6040830184614137565b949350505050565b600060408201905061475b6000830185614137565b6147686020830184613585565b9392505050565b60006080820190506147846000830187614137565b8181036020830152614796818661362f565b905081810360408301526147aa81856140c5565b90506147b96060830184614137565b95945050505050565b60006040820190506147d76000830185614137565b6147e46020830184614137565b9392505050565b6000604051905081810181811067ffffffffffffffff8211171561480e57600080fd5b8060405250919050565b600067ffffffffffffffff82111561482f57600080fd5b601f19601f8301169050602081019050919050565b600067ffffffffffffffff82111561485b57600080fd5b601f19601f8301169050602081019050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b60006148be82614923565b9050919050565b60006148d082614923565b9050919050565b60008115159050919050565b6000819050919050565b60006148f8826148b3565b9050919050565b600061490a826148b3565b9050919050565b600061491c826148b3565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006149658261496c565b9050919050565b600061497782614923565b9050919050565b600061498982614990565b9050919050565b600061499b82614923565b9050919050565b60006149ad826149b4565b9050919050565b60006149bf82614923565b9050919050565b60006149d1826149d8565b9050919050565b60006149e382614923565b9050919050565b82818337600083830152505050565b60005b83811015614a175780820151818401526020810190506149fc565b83811115614a26576000848401525b50505050565b6000614a3782614a48565b9050919050565b6000819050919050565b6000614a5382614a75565b9050919050565b6000819050919050565b6000601f19601f8301169050919050565b60008160601b9050919050565b614a8b816148b3565b8114614a9657600080fd5b50565b614aa2816148c5565b8114614aad57600080fd5b50565b614ab9816148d7565b8114614ac457600080fd5b50565b614ad0816148ed565b8114614adb57600080fd5b50565b614ae7816148ff565b8114614af257600080fd5b50565b614afe81614911565b8114614b0957600080fd5b50565b614b1581614943565b8114614b2057600080fd5b5056fea264697066735822122023e3d5cf2e7d78bd51fec6e3c02f6e52b42287a5460e351d3413f851d5c5691e64736f6c6343000700003300000000000000000000000077661cf15fbc9635a12bd038ecec705274eae2f9000000000000000000000000d3ba7cc97ea2ac3d3ec341d5851f0f22981bb9a500000000000000000000000020c70bdfcc398c1f06ba81730c8b52ace3af7cc30000000000000000000000009011eb570d1be09ea4d10f38c119dcdf29725c410000000000000000000000009011eb570d1be09ea4d10f38c119dcdf29725c41
Deployed Bytecode
0x60806040526004361061021a5760003560e01c8063715018a611610123578063b6f581a6116100ab578063d5abeb011161006f578063d5abeb011461079f578063e2f273bd146107ca578063e42c21d2146107f3578063f2fde38b1461081e578063f851a440146108475761021a565b8063b6f581a6146106ce578063bff1e13f146106f9578063c546b1a614610722578063c771909c1461074b578063cc72115d146107765761021a565b80638da5cb5b116100f25780638da5cb5b146105f15780638ffcd6b71461061c578063952cf2bf1461063857806399b1ce9114610661578063a5a1b6da146106915761021a565b8063715018a61461055d5780637e3657231461057457806380118f241461059d5780638c7fb793146105c65761021a565b80634d655aff116101a65780636a87f309116101755780636a87f3091461048c5780636e5e4080146104b75780636ebfc55f146104e05780636ee5fc611461050b5780636f8b44b0146105345761021a565b80634d655aff146103e25780635c975abb1461040d578063669ed93514610438578063684931ed146104615761021a565b8063204f8b79116101ed578063204f8b79146102eb5780632a99e0a21461031457806346cd94b814610351578063477d60051461038e57806349b0d993146103b75761021a565b806308cdc2a81461021f57806309449724146102485780630c365cc9146102855780630ec26401146102ae575b600080fd5b34801561022b57600080fd5b506102466004803603810190610241919061332e565b610872565b005b34801561025457600080fd5b5061026f600480360381019061026a91906131dc565b61090b565b60405161027c91906146cb565b60405180910390f35b34801561029157600080fd5b506102ac60048036038101906102a791906133fb565b6109b3565b005b3480156102ba57600080fd5b506102d560048036038101906102d091906133fb565b610a39565b6040516102e29190614220565b60405180910390f35b3480156102f757600080fd5b50610312600480360381019061030d9190613380565b610aed565b005b34801561032057600080fd5b5061033b600480360381019061033691906133fb565b610bad565b60405161034891906146cb565b60405180910390f35b34801561035d57600080fd5b50610378600480360381019061037391906133fb565b610cb4565b604051610385919061427f565b60405180910390f35b34801561039a57600080fd5b506103b560048036038101906103b091906133fb565b610d68565b005b3480156103c357600080fd5b506103cc610e02565b6040516103d991906146cb565b60405180910390f35b3480156103ee57600080fd5b506103f7610e08565b60405161040491906142df565b60405180910390f35b34801561041957600080fd5b50610422610e2e565b60405161042f919061427f565b60405180910390f35b34801561044457600080fd5b5061045f600480360381019061045a9190613161565b610e41565b005b34801561046d57600080fd5b50610476610f71565b6040516104839190614330565b60405180910390f35b34801561049857600080fd5b506104a1610f97565b6040516104ae91906146cb565b60405180910390f35b3480156104c357600080fd5b506104de60048036038101906104d991906133a9565b610f9d565b005b3480156104ec57600080fd5b506104f561105d565b60405161050291906146cb565b60405180910390f35b34801561051757600080fd5b50610532600480360381019061052d91906134c5565b611063565b005b34801561054057600080fd5b5061055b600480360381019061055691906133fb565b611268565b005b34801561056957600080fd5b5061057261134a565b005b34801561058057600080fd5b5061059b600480360381019061059691906133d2565b611484565b005b3480156105a957600080fd5b506105c460048036038101906105bf9190613489565b611544565b005b3480156105d257600080fd5b506105db611749565b6040516105e891906146cb565b60405180910390f35b3480156105fd57600080fd5b5061060661174f565b6040516106139190614220565b60405180910390f35b6106366004803603810190610631919061326f565b611778565b005b34801561064457600080fd5b5061065f600480360381019061065a91906133fb565b611b08565b005b61067b6004803603810190610676919061326f565b611ba2565b60405161068891906146cb565b60405180910390f35b34801561069d57600080fd5b506106b860048036038101906106b391906133fb565b612151565b6040516106c591906146cb565b60405180910390f35b3480156106da57600080fd5b506106e3612205565b6040516106f091906142fa565b60405180910390f35b34801561070557600080fd5b50610720600480360381019061071b919061344d565b61222b565b005b34801561072e57600080fd5b50610749600480360381019061074491906133fb565b6124a0565b005b34801561075757600080fd5b50610760612526565b60405161076d9190614220565b60405180910390f35b34801561078257600080fd5b5061079d60048036038101906107989190613501565b61254c565b005b3480156107ab57600080fd5b506107b4612570565b6040516107c191906146cb565b60405180910390f35b3480156107d657600080fd5b506107f160048036038101906107ec91906131b3565b612576565b005b3480156107ff57600080fd5b506108086126a6565b6040516108159190614315565b60405180910390f35b34801561082a57600080fd5b5061084560048036038101906108409190613161565b6126cc565b005b34801561085357600080fd5b5061085c612875565b604051610869919061423b565b60405180910390f35b61087a61289b565b73ffffffffffffffffffffffffffffffffffffffff1661089861174f565b73ffffffffffffffffffffffffffffffffffffffff16146108ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108e5906145eb565b60405180910390fd5b80600460006101000a81548160ff02191690831515021790555050565b6000600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461099d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109949061462b565b60405180910390fd5b6109a9858585856128a3565b9050949350505050565b6109bb61289b565b73ffffffffffffffffffffffffffffffffffffffff166109d961174f565b73ffffffffffffffffffffffffffffffffffffffff1614610a2f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a26906145eb565b60405180910390fd5b8060098190555050565b6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630ec26401836040518263ffffffff1660e01b8152600401610a9691906146cb565b60206040518083038186803b158015610aae57600080fd5b505afa158015610ac2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae6919061318a565b9050919050565b610af561289b565b73ffffffffffffffffffffffffffffffffffffffff16610b1361174f565b73ffffffffffffffffffffffffffffffffffffffff1614610b69576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b60906145eb565b60405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bd825b5b846040518263ffffffff1660e01b8152600401610c0b91906146cb565b60206040518083038186803b158015610c2357600080fd5b505afa158015610c37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c5b9190613424565b9050610cac610c9b6064610c8d610c7e6064600354612ac090919063ffffffff16565b85612b1590919063ffffffff16565b612b8590919063ffffffff16565b600254612ac090919063ffffffff16565b915050919050565b6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166346cd94b8836040518263ffffffff1660e01b8152600401610d1191906146cb565b60206040518083038186803b158015610d2957600080fd5b505afa158015610d3d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d619190613357565b9050919050565b600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610df8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610def9061462b565b60405180910390fd5b80600c8190555050565b60025481565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600460009054906101000a900460ff1681565b610e4961289b565b73ffffffffffffffffffffffffffffffffffffffff16610e6761174f565b73ffffffffffffffffffffffffffffffffffffffff1614610ebd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eb4906145eb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610f2d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f24906144eb565b60405180910390fd5b80600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600c5481565b610fa561289b565b73ffffffffffffffffffffffffffffffffffffffff16610fc361174f565b73ffffffffffffffffffffffffffffffffffffffff1614611019576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611010906145eb565b60405180910390fd5b80600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600b5481565b813373ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e836040518263ffffffff1660e01b81526004016110d691906146cb565b60206040518083038186803b1580156110ee57600080fd5b505afa158015611102573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611126919061318a565b73ffffffffffffffffffffffffffffffffffffffff1614806111955750600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6111d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111cb9061464b565b60405180910390fd5b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f95ac77784846040518363ffffffff1660e01b81526004016112319291906147c2565b600060405180830381600087803b15801561124b57600080fd5b505af115801561125f573d6000803e3d6000fd5b50505050505050565b600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146112f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ef9061462b565b60405180910390fd5b600160095403811015611340576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113379061436b565b60405180910390fd5b80600d8190555050565b61135261289b565b73ffffffffffffffffffffffffffffffffffffffff1661137061174f565b73ffffffffffffffffffffffffffffffffffffffff16146113c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113bd906145eb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b61148c61289b565b73ffffffffffffffffffffffffffffffffffffffff166114aa61174f565b73ffffffffffffffffffffffffffffffffffffffff1614611500576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114f7906145eb565b60405180910390fd5b80600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b813373ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e836040518263ffffffff1660e01b81526004016115b791906146cb565b60206040518083038186803b1580156115cf57600080fd5b505afa1580156115e3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611607919061318a565b73ffffffffffffffffffffffffffffffffffffffff1614806116765750600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6116b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ac9061464b565b60405180910390fd5b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663418d0e8384846040518363ffffffff1660e01b8152600401611712929190614746565b600060405180830381600087803b15801561172c57600080fd5b505af1158015611740573d6000803e3d6000fd5b50505050505050565b60035481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600460009054906101000a900460ff16156117c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117bf906143cb565b60405180910390fd5b6002600154141561180e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118059061468b565b60405180910390fd5b600260018190555082600001513373ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e836040518263ffffffff1660e01b815260040161188d91906146cb565b60206040518083038186803b1580156118a557600080fd5b505afa1580156118b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118dd919061318a565b73ffffffffffffffffffffffffffffffffffffffff16148061194c5750600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61198b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119829061464b565b60405180910390fd5b6002543410156119d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119c79061460b565b60405180910390fd5b6119dc85858585612bdb565b60006119ea878787876128a3565b90506000600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1634604051611a349061420b565b60006040518083038185875af1925050503d8060008114611a71576040519150601f19603f3d011682016040523d82523d6000602084013e611a76565b606091505b50508091505080611abc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ab39061438b565b60405180910390fd5b7f6d8641fcfa3345036cff80abce1ebfdf2d1c20ee151d629ff8cbe4ce064979ac828934604051611aef9392919061470f565b60405180910390a1505050600180819055505050505050565b600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611b98576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b8f9061462b565b60405180910390fd5b80600b8190555050565b6000600460009054906101000a900460ff1615611bf4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611beb906143cb565b60405180910390fd5b60026001541415611c3a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c319061468b565b60405180910390fd5b6002600181905550600084600001519050600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166346cd94b8826040518263ffffffff1660e01b8152600401611ca691906146cb565b60206040518083038186803b158015611cbe57600080fd5b505afa158015611cd2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cf69190613357565b611d35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d2c9061446b565b60405180910390fd5b6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bd825b5b836040518263ffffffff1660e01b8152600401611d9291906146cb565b60206040518083038186803b158015611daa57600080fd5b505afa158015611dbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611de29190613424565b9050611ded82610bad565b341015611e2f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e269061460b565b60405180910390fd5b6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630ec26401846040518263ffffffff1660e01b8152600401611e8c91906146cb565b60206040518083038186803b158015611ea457600080fd5b505afa158015611eb8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611edc919061318a565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611f4e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f459061466b565b60405180910390fd5b611f5a88888888612bdb565b6000611f688a8a8a8a6128a3565b90506000611f7f8434612cd690919063ffffffff16565b90506000600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1682604051611fc99061420b565b60006040518083038185875af1925050503d8060008114612006576040519150601f19603f3d011682016040523d82523d6000602084013e61200b565b606091505b50508091505080612051576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120489061454b565b60405180910390fd5b8373ffffffffffffffffffffffffffffffffffffffff16856040516120759061420b565b60006040518083038185875af1925050503d80600081146120b2576040519150601f19603f3d011682016040523d82523d6000602084013e6120b7565b606091505b505080915050806120fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120f49061444b565b60405180910390fd5b7f6d8641fcfa3345036cff80abce1ebfdf2d1c20ee151d629ff8cbe4ce064979ac838d346040516121309392919061470f565b60405180910390a18296505050505050506001808190555095945050505050565b6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bd825b5b836040518263ffffffff1660e01b81526004016121ae91906146cb565b60206040518083038186803b1580156121c657600080fd5b505afa1580156121da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121fe9190613424565b9050919050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b813373ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e836040518263ffffffff1660e01b815260040161229e91906146cb565b60206040518083038186803b1580156122b657600080fd5b505afa1580156122ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122ee919061318a565b73ffffffffffffffffffffffffffffffffffffffff16148061235d5750600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61239c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123939061464b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561240c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612403906146ab565b60405180910390fd5b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bff1e13f84846040518363ffffffff1660e01b81526004016124699291906146e6565b600060405180830381600087803b15801561248357600080fd5b505af1158015612497573d6000803e3d6000fd5b50505050505050565b6124a861289b565b73ffffffffffffffffffffffffffffffffffffffff166124c661174f565b73ffffffffffffffffffffffffffffffffffffffff161461251c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612513906145eb565b60405180910390fd5b8060028190555050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6125568383611063565b612560838261222b565b61256b836001611544565b505050565b600d5481565b61257e61289b565b73ffffffffffffffffffffffffffffffffffffffff1661259c61174f565b73ffffffffffffffffffffffffffffffffffffffff16146125f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e9906145eb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612662576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126599061452b565b60405180910390fd5b80600460016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6126d461289b565b73ffffffffffffffffffffffffffffffffffffffff166126f261174f565b73ffffffffffffffffffffffffffffffffffffffff1614612748576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161273f906145eb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156127b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127af906143eb565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600033905090565b6000600b548360200151116128ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128e49061440b565b60405180910390fd5b600c5483602001511115612936576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161292d906145cb565b60405180910390fd5b600d54600954111561297d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612974906145ab565b60405180910390fd5b600060096000815480929190600101919050559050600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ea61831d828787876040518563ffffffff1660e01b81526004016129f3949392919061476f565b600060405180830381600087803b158015612a0d57600080fd5b505af1158015612a21573d6000803e3d6000fd5b50505050600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f1987836040518363ffffffff1660e01b8152600401612a82929190614256565b600060405180830381600087803b158015612a9c57600080fd5b505af1158015612ab0573d6000803e3d6000fd5b5050505080915050949350505050565b600080828401905083811015612b0b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b029061442b565b60405180910390fd5b8091505092915050565b600080831415612b285760009050612b7f565b6000828402905082848281612b3957fe5b0414612b7a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b719061458b565b60405180910390fd5b809150505b92915050565b6000808211612bc9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612bc09061450b565b60405180910390fd5b818381612bd257fe5b04905092915050565b60003384600001518560600151866020015187604001518988604051602001612c0a979695949392919061416c565b6040516020818303038152906040528051906020012090506000612c2d82612d26565b90506000612c3b8285612d56565b9050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614612ccd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612cc4906144cb565b60405180910390fd5b50505050505050565b600082821115612d1b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d129061448b565b60405180910390fd5b818303905092915050565b600081604051602001612d3991906141e5565b604051602081830303815290604052805190602001209050919050565b60006041825114612d9c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d93906143ab565b60405180910390fd5b60008060006020850151925060408501519150606085015160001a9050612dc586828585612dd0565b935050505092915050565b60007f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08260001c1115612e38576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e2f906144ab565b60405180910390fd5b601b8460ff161480612e4d5750601c8460ff16145b612e8c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e839061456b565b60405180910390fd5b600060018686868660405160008152602001604052604051612eb1949392919061429a565b6020604051602081039080840390855afa158015612ed3573d6000803e3d6000fd5b505050602060405103519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612f4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612f469061434b565b60405180910390fd5b80915050949350505050565b600081359050612f6a81614a82565b92915050565b600081519050612f7f81614a82565b92915050565b600081359050612f9481614a99565b92915050565b600081359050612fa981614ab0565b92915050565b600081519050612fbe81614ab0565b92915050565b600082601f830112612fd557600080fd5b8135612fe8612fe382614818565b6147eb565b9150808252602083016020830185838301111561300457600080fd5b61300f8382846149ea565b50505092915050565b60008135905061302781614ac7565b92915050565b60008135905061303c81614ade565b92915050565b60008135905061305181614af5565b92915050565b600082601f83011261306857600080fd5b813561307b61307682614844565b6147eb565b9150808252602083016020830185838301111561309757600080fd5b6130a28382846149ea565b50505092915050565b6000608082840312156130bd57600080fd5b6130c760806147eb565b905060006130d784828501613137565b60008301525060206130eb84828501613137565b60208301525060406130ff84828501613137565b604083015250606082013567ffffffffffffffff81111561311f57600080fd5b61312b84828501613057565b60608301525092915050565b60008135905061314681614b0c565b92915050565b60008151905061315b81614b0c565b92915050565b60006020828403121561317357600080fd5b600061318184828501612f5b565b91505092915050565b60006020828403121561319c57600080fd5b60006131aa84828501612f70565b91505092915050565b6000602082840312156131c557600080fd5b60006131d384828501612f85565b91505092915050565b600080600080608085870312156131f257600080fd5b600061320087828801612f5b565b945050602085013567ffffffffffffffff81111561321d57600080fd5b61322987828801613057565b935050604085013567ffffffffffffffff81111561324657600080fd5b613252878288016130ab565b925050606061326387828801613137565b91505092959194509250565b600080600080600060a0868803121561328757600080fd5b600061329588828901612f5b565b955050602086013567ffffffffffffffff8111156132b257600080fd5b6132be88828901613057565b945050604086013567ffffffffffffffff8111156132db57600080fd5b6132e7888289016130ab565b93505060606132f888828901613137565b925050608086013567ffffffffffffffff81111561331557600080fd5b61332188828901612fc4565b9150509295509295909350565b60006020828403121561334057600080fd5b600061334e84828501612f9a565b91505092915050565b60006020828403121561336957600080fd5b600061337784828501612faf565b91505092915050565b60006020828403121561339257600080fd5b60006133a084828501613018565b91505092915050565b6000602082840312156133bb57600080fd5b60006133c98482850161302d565b91505092915050565b6000602082840312156133e457600080fd5b60006133f284828501613042565b91505092915050565b60006020828403121561340d57600080fd5b600061341b84828501613137565b91505092915050565b60006020828403121561343657600080fd5b60006134448482850161314c565b91505092915050565b6000806040838503121561346057600080fd5b600061346e85828601613137565b925050602061347f85828601612f5b565b9150509250929050565b6000806040838503121561349c57600080fd5b60006134aa85828601613137565b92505060206134bb85828601612f9a565b9150509250929050565b600080604083850312156134d857600080fd5b60006134e685828601613137565b92505060206134f785828601613137565b9150509250929050565b60008060006060848603121561351657600080fd5b600061352486828701613137565b935050602061353586828701613137565b925050604061354686828701612f5b565b9150509250925092565b613559816148c5565b82525050565b61357061356b826148c5565b614a2c565b82525050565b61357f816148b3565b82525050565b61358e816148d7565b82525050565b61359d816148e3565b82525050565b6135b46135af826148e3565b614a3e565b82525050565b6135c38161495a565b82525050565b6135d28161497e565b82525050565b6135e1816149a2565b82525050565b6135f0816149c6565b82525050565b600061360182614870565b61360b8185614886565b935061361b8185602086016149f9565b61362481614a64565b840191505092915050565b600061363a82614870565b6136448185614897565b93506136548185602086016149f9565b61365d81614a64565b840191505092915050565b600061367382614870565b61367d81856148a8565b935061368d8185602086016149f9565b80840191505092915050565b60006136a6601883614897565b91507f45434453413a20696e76616c6964207369676e617475726500000000000000006000830152602082019050919050565b60006136e6602d83614897565b91507f63616e6e6f7420736872696e6b206d617820737570706c792062656c6f77206360008301527f757272656e7420737570706c79000000000000000000000000000000000000006020830152604082019050919050565b600061374c603483614897565b91507f4d75746174696f6e436f6e74726f6c6c65723a205061796f757420616464726560008301527f7373206661696c656420746f20726563656976650000000000000000000000006020830152604082019050919050565b60006137b2601f83614897565b91507f45434453413a20696e76616c6964207369676e6174757265206c656e677468006000830152602082019050919050565b60006137f2601c836148a8565b91507f19457468657265756d205369676e6564204d6573736167653a0a3332000000006000830152601c82019050919050565b6000613832601d83614897565b91507f4d75746174696f6e436f6e74726f6c6c65723a206973207061757365640000006000830152602082019050919050565b6000613872602683614897565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006138d8601083614897565b91507f4d75746174696f6e20746f6f206f6c64000000000000000000000000000000006000830152602082019050919050565b6000613918601b83614897565b91507f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006000830152602082019050919050565b6000613958602c83614897565b91507f4d75746174696f6e436f6e74726f6c6c65723a20486f6c646572206661696c6560008301527f6420746f207265636569766500000000000000000000000000000000000000006020830152604082019050919050565b60006139be604383614897565b91507f4d75746174696f6e436f6e74726f6c6c65723a205075626c6963206d696e742060008301527f6e6565647320746f20626520616c6c6f77656420666f722074686973206d757460208301527f616e7400000000000000000000000000000000000000000000000000000000006040830152606082019050919050565b6000613a4a601e83614897565b91507f536166654d6174683a207375627472616374696f6e206f766572666c6f7700006000830152602082019050919050565b6000613a8a602283614897565b91507f45434453413a20696e76616c6964207369676e6174757265202773272076616c60008301527f75650000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613af0602583614897565b91507f4d75746174696f6e436f6e74726f6c6c65723a20496e76616c6964207369676e60008301527f61747572650000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613b56603183614897565b91507f4d75746174696f6e436f6e74726f6c6c65723a207369676e65722063616e6e6f60008301527f74206265207a65726f20616464726573730000000000000000000000000000006020830152604082019050919050565b6000613bbc601a83614897565b91507f536166654d6174683a206469766973696f6e206279207a65726f0000000000006000830152602082019050919050565b6000613bfc603083614897565b91507f4d75746174696f6e436f6e74726f6c6c65723a2061646d696e2063616e6e6f7460008301527f206265207a65726f2061646472657373000000000000000000000000000000006020830152604082019050919050565b6000613c62602b83614897565b91507f4d75746174696f6e436f6e74726f6c6c65723a2041646d696e206661696c656460008301527f20746f20726563656976650000000000000000000000000000000000000000006020830152604082019050919050565b6000613cc8602283614897565b91507f45434453413a20696e76616c6964207369676e6174757265202776272076616c60008301527f75650000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613d2e602183614897565b91507f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008301527f77000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613d94601383614897565b91507f4d61782e20737570706c792072656163686564000000000000000000000000006000830152602082019050919050565b6000613dd4601083614897565b91507f4d75746174696f6e20746f6f206e6577000000000000000000000000000000006000830152602082019050919050565b6000613e14602083614897565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b6000613e54603183614897565b91507f4d75746174696f6e436f6e74726f6c6c65723a20596f7520646964206e6f742060008301527f73656e6420656e6f7567682065746865720000000000000000000000000000006020830152604082019050919050565b6000613eba602983614897565b91507f4d75746174696f6e436f6e74726f6c6c65723a20596f7520617265206e6f742060008301527f7468652061646d696e00000000000000000000000000000000000000000000006020830152604082019050919050565b6000613f2060008361487b565b9150600082019050919050565b6000613f3a604383614897565b91507f4d75746174696f6e436f6e74726f6c6c65723a20796f7520646f206e6f74206f60008301527f776e2074686174206d7574616e74206f7220796f7520617265206e6f7420616460208301527f6d696e00000000000000000000000000000000000000000000000000000000006040830152606082019050919050565b6000613fc6604083614897565b91507f4d75746174696f6e436f6e74726f6c6c65723a204e6f20726563656976696e6760008301527f206d7574616e7420686f6c646572207061796f75742077616c6c6574207365746020830152604082019050919050565b600061402c601f83614897565b91507f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006000830152602082019050919050565b600061406c603883614897565b91507f4d75746174696f6e436f6e74726f6c6c65723a205061796f75742077616c6c6560008301527f742063616e6e6f74206265207a65726f206164647265737300000000000000006020830152604082019050919050565b60006080830160008301516140dd6000860182614128565b5060208301516140f06020860182614128565b5060408301516141036040860182614128565b506060830151848203606086015261411b82826135f6565b9150508091505092915050565b61413181614943565b82525050565b61414081614943565b82525050565b61415761415282614943565b614a5a565b82525050565b6141668161494d565b82525050565b6000614178828a61355f565b6014820191506141888289614146565b6020820191506141988288613668565b91506141a48287614146565b6020820191506141b48286614146565b6020820191506141c48285613668565b91506141d08284614146565b60208201915081905098975050505050505050565b60006141f0826137e5565b91506141fc82846135a3565b60208201915081905092915050565b600061421682613f13565b9150819050919050565b60006020820190506142356000830184613576565b92915050565b60006020820190506142506000830184613550565b92915050565b600060408201905061426b6000830185613576565b6142786020830184614137565b9392505050565b60006020820190506142946000830184613585565b92915050565b60006080820190506142af6000830187613594565b6142bc602083018661415d565b6142c96040830185613594565b6142d66060830184613594565b95945050505050565b60006020820190506142f460008301846135ba565b92915050565b600060208201905061430f60008301846135c9565b92915050565b600060208201905061432a60008301846135d8565b92915050565b600060208201905061434560008301846135e7565b92915050565b6000602082019050818103600083015261436481613699565b9050919050565b60006020820190508181036000830152614384816136d9565b9050919050565b600060208201905081810360008301526143a48161373f565b9050919050565b600060208201905081810360008301526143c4816137a5565b9050919050565b600060208201905081810360008301526143e481613825565b9050919050565b6000602082019050818103600083015261440481613865565b9050919050565b60006020820190508181036000830152614424816138cb565b9050919050565b600060208201905081810360008301526144448161390b565b9050919050565b600060208201905081810360008301526144648161394b565b9050919050565b60006020820190508181036000830152614484816139b1565b9050919050565b600060208201905081810360008301526144a481613a3d565b9050919050565b600060208201905081810360008301526144c481613a7d565b9050919050565b600060208201905081810360008301526144e481613ae3565b9050919050565b6000602082019050818103600083015261450481613b49565b9050919050565b6000602082019050818103600083015261452481613baf565b9050919050565b6000602082019050818103600083015261454481613bef565b9050919050565b6000602082019050818103600083015261456481613c55565b9050919050565b6000602082019050818103600083015261458481613cbb565b9050919050565b600060208201905081810360008301526145a481613d21565b9050919050565b600060208201905081810360008301526145c481613d87565b9050919050565b600060208201905081810360008301526145e481613dc7565b9050919050565b6000602082019050818103600083015261460481613e07565b9050919050565b6000602082019050818103600083015261462481613e47565b9050919050565b6000602082019050818103600083015261464481613ead565b9050919050565b6000602082019050818103600083015261466481613f2d565b9050919050565b6000602082019050818103600083015261468481613fb9565b9050919050565b600060208201905081810360008301526146a48161401f565b9050919050565b600060208201905081810360008301526146c48161405f565b9050919050565b60006020820190506146e06000830184614137565b92915050565b60006040820190506146fb6000830185614137565b6147086020830184613576565b9392505050565b60006060820190506147246000830186614137565b6147316020830185613576565b61473e6040830184614137565b949350505050565b600060408201905061475b6000830185614137565b6147686020830184613585565b9392505050565b60006080820190506147846000830187614137565b8181036020830152614796818661362f565b905081810360408301526147aa81856140c5565b90506147b96060830184614137565b95945050505050565b60006040820190506147d76000830185614137565b6147e46020830184614137565b9392505050565b6000604051905081810181811067ffffffffffffffff8211171561480e57600080fd5b8060405250919050565b600067ffffffffffffffff82111561482f57600080fd5b601f19601f8301169050602081019050919050565b600067ffffffffffffffff82111561485b57600080fd5b601f19601f8301169050602081019050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b60006148be82614923565b9050919050565b60006148d082614923565b9050919050565b60008115159050919050565b6000819050919050565b60006148f8826148b3565b9050919050565b600061490a826148b3565b9050919050565b600061491c826148b3565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006149658261496c565b9050919050565b600061497782614923565b9050919050565b600061498982614990565b9050919050565b600061499b82614923565b9050919050565b60006149ad826149b4565b9050919050565b60006149bf82614923565b9050919050565b60006149d1826149d8565b9050919050565b60006149e382614923565b9050919050565b82818337600083830152505050565b60005b83811015614a175780820151818401526020810190506149fc565b83811115614a26576000848401525b50505050565b6000614a3782614a48565b9050919050565b6000819050919050565b6000614a5382614a75565b9050919050565b6000819050919050565b6000601f19601f8301169050919050565b60008160601b9050919050565b614a8b816148b3565b8114614a9657600080fd5b50565b614aa2816148c5565b8114614aad57600080fd5b50565b614ab9816148d7565b8114614ac457600080fd5b50565b614ad0816148ed565b8114614adb57600080fd5b50565b614ae7816148ff565b8114614af257600080fd5b50565b614afe81614911565b8114614b0957600080fd5b50565b614b1581614943565b8114614b2057600080fd5b5056fea264697066735822122023e3d5cf2e7d78bd51fec6e3c02f6e52b42287a5460e351d3413f851d5c5691e64736f6c63430007000033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000077661cf15fbc9635a12bd038ecec705274eae2f9000000000000000000000000d3ba7cc97ea2ac3d3ec341d5851f0f22981bb9a500000000000000000000000020c70bdfcc398c1f06ba81730c8b52ace3af7cc30000000000000000000000009011eb570d1be09ea4d10f38c119dcdf29725c410000000000000000000000009011eb570d1be09ea4d10f38c119dcdf29725c41
-----Decoded View---------------
Arg [0] : _mutationToken (address): 0x77661CF15FBC9635a12bd038ECeC705274EaE2F9
Arg [1] : _mutationMetadata (address): 0xd3Ba7cc97Ea2ac3d3eC341D5851F0F22981bb9A5
Arg [2] : _seeder (address): 0x20C70BDFCc398C1f06bA81730c8B52ACE3af7cc3
Arg [3] : _admin (address): 0x9011Eb570D1bE09eA4d10f38c119DCDF29725c41
Arg [4] : _authorizedSigner (address): 0x9011Eb570D1bE09eA4d10f38c119DCDF29725c41
-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 00000000000000000000000077661cf15fbc9635a12bd038ecec705274eae2f9
Arg [1] : 000000000000000000000000d3ba7cc97ea2ac3d3ec341d5851f0f22981bb9a5
Arg [2] : 00000000000000000000000020c70bdfcc398c1f06ba81730c8b52ace3af7cc3
Arg [3] : 0000000000000000000000009011eb570d1be09ea4d10f38c119dcdf29725c41
Arg [4] : 0000000000000000000000009011eb570d1be09ea4d10f38c119dcdf29725c41
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.