ERC-1155
Overview
Max Total Supply
2,400 ZS4LZFYQV3
Holders
1
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x59058a10...1aE45be6B The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
MultiUserToken
Compiler Version
v0.5.16+commit.9c3226ce
Contract Source Code (Solidity Multiple files format)
pragma solidity ^0.5.0; pragma experimental ABIEncoderV2; import "./ERC1155.sol"; /// @title MultiToken /// @notice ERC1155 token contract with the support of secondary fees. contract MultiToken is Ownable, SignerRole, ERC1155Base { /// @notice Tokens name; string public name; /// @notice Tokens symbol. string public symbol; /// @notice The contract constructor. /// @param _name - The value for the `name`. /// @param _symbol - The value for the `symbol`. /// @param signer - The address of the initial signer. /// @param contractURI - The URI with contract metadata. /// The metadata should be a JSON object with fields: `id, name, description, image, external_link`. /// If the URI containts `{address}` template in its body, then the template must be substituted with the contract address. /// @param tokenURIPrefix - The URI prefix for all the tokens. Usually set to ipfs gateway. constructor(string memory _name, string memory _symbol, address signer, string memory contractURI, string memory tokenURIPrefix) ERC1155Base(contractURI, tokenURIPrefix) public { name = _name; symbol = _symbol; _addSigner(signer); _registerInterface(bytes4(keccak256('MINT_WITH_ADDRESS'))); } /// @notice This function can be called by the contract owner and it adds an address as a new signer. /// The signer will authorize token minting by signing token ids. /// @param account - The address of a new signer. function addSigner(address account) public onlyOwner { _addSigner(account); } /// @notice This function can be called by the contract owner and it removes an address from signers pool. /// @param account - The address of a signer to remove. function removeSigner(address account) public onlyOwner { _removeSigner(account); } /// @notice The function for token minting. It creates a new token. /// Must contain the signature of the format: `sha3(tokenContract.address.toLowerCase() + tokenId)`. /// Where `tokenContract.address` is the address of the contract and tokenId is the id in uint256 hex format. /// 0 as uint256 must look like this: `0000000000000000000000000000000000000000000000000000000000000000`. /// The message **must not contain** the standard prefix. /// @param id - The id of a new token (`tokenId`). /// @param v - v parameter of the ECDSA signature. /// @param r - r parameter of the ECDSA signature. /// @param s - s parameter of the ECDSA signature. /// @param fees - An array of the secondary fees for this token. /// @param supply - The supply amount for the token. /// @param uri - The URI suffix for the token. The suffix with `tokenURIPrefix` usually complements ipfs link to metadata object. /// The URI must link to JSON object with various fields: `name, description, image, external_url, attributes`. /// Can also contain another various fields. function mint(uint256 id, uint8 v, bytes32 r, bytes32 s, Fee[] memory fees, uint256 supply, string memory uri) public { require(isSigner(ecrecover(keccak256(abi.encodePacked(this, id)), v, r, s)), "signer should sign tokenId"); _mint(id, fees, supply, uri); } } /** * @title MultiUserToken * @dev Only owner can mint tokens. */ contract MultiUserToken is MultiToken { /// @notice Token minting event. event CreateERC1155_v1(address indexed creator, string name, string symbol); /// @notice The contract constructor. /// @param name - The value for the `name`. /// @param symbol - The value for the `symbol`. /// @param contractURI - The URI with contract metadata. /// The metadata should be a JSON object with fields: `id, name, description, image, external_link`. /// If the URI containts `{address}` template in its body, then the template must be substituted with the contract address. /// @param tokenURIPrefix - The URI prefix for all the tokens. Usually set to ipfs gateway. /// @param signer - The address of the initial signer. constructor(string memory name, string memory symbol, string memory contractURI, string memory tokenURIPrefix, address signer) MultiToken(name, symbol, signer, contractURI, tokenURIPrefix) public { emit CreateERC1155_v1(msg.sender, name, symbol); } /// @notice The function for token minting. It creates a new token. Can be called only by the contract owner. /// Must contain the signature of the format: `sha3(tokenContract.address.toLowerCase() + tokenId)`. /// Where `tokenContract.address` is the address of the contract and tokenId is the id in uint256 hex format. /// 0 as uint256 must look like this: `0000000000000000000000000000000000000000000000000000000000000000`. /// The message **must not contain** the standard prefix. /// @param id - The id of a new token (`tokenId`). /// @param v - v parameter of the ECDSA signature. /// @param r - r parameter of the ECDSA signature. /// @param s - s parameter of the ECDSA signature. /// @param fees - An array of the secondary fees for this token. /// @param supply - The supply amount for the token. /// @param uri - The URI suffix for the token. The suffix with `tokenURIPrefix` usually complements ipfs link to metadata object. /// The URI must link to JSON object with various fields: `name, description, image, external_url, attributes`. /// Can also contain another various fields. function mint(uint256 id, uint8 v, bytes32 r, bytes32 s, Fee[] memory fees, uint256 supply, string memory uri) onlyOwner public { super.mint(id, v, r, s, fees, supply, uri); } }
pragma solidity ^0.5.0; import "./libs.sol"; import "./Roles.sol"; import "./ERC165.sol"; /// @title AbstractSale /// @notice Base contract for `ERC721Sale` and `ERC1155Sale`. contract AbstractSale is Ownable { using UintLibrary for uint256; using AddressLibrary for address; using StringLibrary for string; using SafeMath for uint256; bytes4 private constant _INTERFACE_ID_FEES = 0xb7799584; /// @notice The amount of buyer's fee. Represented as percents * 100 (100% - 10000. 1% - 100). uint public buyerFee = 0; /// @notice The address to which all the fees are transfered. address payable public beneficiary; /* An ECDSA signature. */ struct Sig { /* v parameter */ uint8 v; /* r parameter */ bytes32 r; /* s parameter */ bytes32 s; } /// @notice The contract constructor. /// @param _beneficiary - The value for `beneficiary`. constructor(address payable _beneficiary) public { beneficiary = _beneficiary; } /// @notice Set new buyer fee value. Can only be called by the contract owner. /// Fee value is represented as percents * 100 (100% - 10000. 1% - 100). /// @param _buyerFee - New fee value percents times 100 format. function setBuyerFee(uint256 _buyerFee) public onlyOwner { buyerFee = _buyerFee; } /// @notice Set new address as fee recipient. Can only be called by the contract owner. /// @param _beneficiary - New `beneficiary` address. function setBeneficiary(address payable _beneficiary) public onlyOwner { beneficiary = _beneficiary; } function prepareMessage(address token, uint256 tokenId, uint256 price, uint256 fee, uint256 nonce) internal pure returns (string memory) { string memory result = string(strConcat( bytes(token.toString()), bytes(". tokenId: "), bytes(tokenId.toString()), bytes(". price: "), bytes(price.toString()), bytes(". nonce: "), bytes(nonce.toString()) )); if (fee != 0) { return result.append(". fee: ", fee.toString()); } else { return result; } } function strConcat(bytes memory _ba, bytes memory _bb, bytes memory _bc, bytes memory _bd, bytes memory _be, bytes memory _bf, bytes memory _bg) internal pure returns (bytes memory) { bytes memory resultBytes = new bytes(_ba.length + _bb.length + _bc.length + _bd.length + _be.length + _bf.length + _bg.length); uint k = 0; for (uint i = 0; i < _ba.length; i++) resultBytes[k++] = _ba[i]; for (uint i = 0; i < _bb.length; i++) resultBytes[k++] = _bb[i]; for (uint i = 0; i < _bc.length; i++) resultBytes[k++] = _bc[i]; for (uint i = 0; i < _bd.length; i++) resultBytes[k++] = _bd[i]; for (uint i = 0; i < _be.length; i++) resultBytes[k++] = _be[i]; for (uint i = 0; i < _bf.length; i++) resultBytes[k++] = _bf[i]; for (uint i = 0; i < _bg.length; i++) resultBytes[k++] = _bg[i]; return resultBytes; } function transferEther(IERC165 token, uint256 tokenId, address payable owner, uint256 total, uint256 sellerFee) internal { uint value = transferFeeToBeneficiary(total, sellerFee); if (token.supportsInterface(_INTERFACE_ID_FEES)) { HasSecondarySaleFees withFees = HasSecondarySaleFees(address(token)); address payable[] memory recipients = withFees.getFeeRecipients(tokenId); uint[] memory fees = withFees.getFeeBps(tokenId); require(fees.length == recipients.length); for (uint256 i = 0; i < fees.length; i++) { (uint newValue, uint current) = subFee(value, total.mul(fees[i]).div(10000)); value = newValue; recipients[i].transfer(current); } } owner.transfer(value); } function transferFeeToBeneficiary(uint total, uint sellerFee) internal returns (uint) { (uint value, uint sellerFeeValue) = subFee(total, total.mul(sellerFee).div(10000)); uint buyerFeeValue = total.mul(buyerFee).div(10000); uint beneficiaryFee = buyerFeeValue.add(sellerFeeValue); if (beneficiaryFee > 0) { beneficiary.transfer(beneficiaryFee); } return value; } function subFee(uint value, uint fee) internal pure returns (uint newValue, uint realFee) { if (value > fee) { newValue = value - fee; realFee = fee; } else { newValue = 0; realFee = value; } } }
pragma solidity ^0.5.0; import "./ERC165.sol"; import "./Roles.sol"; import "./HasTokenURI.sol"; /** @title ERC-1155 Multi Token Standard @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1155.md Note: The ERC-165 identifier for this interface is 0xd9b67a26. */ contract IERC1155 is IERC165 { /** @dev Either `TransferSingle` or `TransferBatch` MUST emit when tokens are transferred, including zero value transfers as well as minting or burning (see "Safe Transfer Rules" section of the standard). The `_operator` argument MUST be msg.sender. The `_from` argument MUST be the address of the holder whose balance is decreased. The `_to` argument MUST be the address of the recipient whose balance is increased. The `_id` argument MUST be the token type being transferred. The `_value` argument MUST be the number of tokens the holder balance is decreased by and match what the recipient balance is increased by. When minting/creating tokens, the `_from` argument MUST be set to `0x0` (i.e. zero address). When burning/destroying tokens, the `_to` argument MUST be set to `0x0` (i.e. zero address). */ event TransferSingle(address indexed _operator, address indexed _from, address indexed _to, uint256 _id, uint256 _value); /** @dev Either `TransferSingle` or `TransferBatch` MUST emit when tokens are transferred, including zero value transfers as well as minting or burning (see "Safe Transfer Rules" section of the standard). The `_operator` argument MUST be msg.sender. The `_from` argument MUST be the address of the holder whose balance is decreased. The `_to` argument MUST be the address of the recipient whose balance is increased. The `_ids` argument MUST be the list of tokens being transferred. The `_values` argument MUST be the list of number of tokens (matching the list and order of tokens specified in _ids) the holder balance is decreased by and match what the recipient balance is increased by. When minting/creating tokens, the `_from` argument MUST be set to `0x0` (i.e. zero address). When burning/destroying tokens, the `_to` argument MUST be set to `0x0` (i.e. zero address). */ event TransferBatch(address indexed _operator, address indexed _from, address indexed _to, uint256[] _ids, uint256[] _values); /** @dev MUST emit when approval for a second party/operator address to manage all tokens for an owner address is enabled or disabled (absense of an event assumes disabled). */ event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved); /** @dev MUST emit when the URI is updated for a token ID. URIs are defined in RFC 3986. The URI MUST point a JSON file that conforms to the "ERC-1155 Metadata URI JSON Schema". */ event URI(string _value, uint256 indexed _id); /** @notice Transfers `_value` amount of an `_id` from the `_from` address to the `_to` address specified (with safety call). @dev Caller must be approved to manage the tokens being transferred out of the `_from` account (see "Approval" section of the standard). MUST revert if `_to` is the zero address. MUST revert if balance of holder for token `_id` is lower than the `_value` sent. MUST revert on any other error. MUST emit the `TransferSingle` event to reflect the balance change (see "Safe Transfer Rules" section of the standard). After the above conditions are met, this function MUST check if `_to` is a smart contract (e.g. code size > 0). If so, it MUST call `onERC1155Received` on `_to` and act appropriately (see "Safe Transfer Rules" section of the standard). @param _from Source address @param _to Target address @param _id ID of the token type @param _value Transfer amount @param _data Additional data with no specified format, MUST be sent unaltered in call to `onERC1155Received` on `_to` */ function safeTransferFrom(address _from, address _to, uint256 _id, uint256 _value, bytes calldata _data) external; /** @notice Transfers `_values` amount(s) of `_ids` from the `_from` address to the `_to` address specified (with safety call). @dev Caller must be approved to manage the tokens being transferred out of the `_from` account (see "Approval" section of the standard). MUST revert if `_to` is the zero address. MUST revert if length of `_ids` is not the same as length of `_values`. MUST revert if any of the balance(s) of the holder(s) for token(s) in `_ids` is lower than the respective amount(s) in `_values` sent to the recipient. MUST revert on any other error. MUST emit `TransferSingle` or `TransferBatch` event(s) such that all the balance changes are reflected (see "Safe Transfer Rules" section of the standard). Balance changes and events MUST follow the ordering of the arrays (_ids[0]/_values[0] before _ids[1]/_values[1], etc). After the above conditions for the transfer(s) in the batch are met, this function MUST check if `_to` is a smart contract (e.g. code size > 0). If so, it MUST call the relevant `ERC1155TokenReceiver` hook(s) on `_to` and act appropriately (see "Safe Transfer Rules" section of the standard). @param _from Source address @param _to Target address @param _ids IDs of each token type (order and length must match _values array) @param _values Transfer amounts per token type (order and length must match _ids array) @param _data Additional data with no specified format, MUST be sent unaltered in call to the `ERC1155TokenReceiver` hook(s) on `_to` */ function safeBatchTransferFrom(address _from, address _to, uint256[] calldata _ids, uint256[] calldata _values, bytes calldata _data) external; /** @notice Get the balance of an account's Tokens. @param _owner The address of the token holder @param _id ID of the Token @return The _owner's balance of the Token type requested */ function balanceOf(address _owner, uint256 _id) external view returns (uint256); /** @notice Get the balance of multiple account/token pairs @param _owners The addresses of the token holders @param _ids ID of the Tokens @return The _owner's balance of the Token types requested (i.e. balance for each (owner, id) pair) */ function balanceOfBatch(address[] calldata _owners, uint256[] calldata _ids) external view returns (uint256[] memory); /** @notice Enable or disable approval for a third party ("operator") to manage all of the caller's tokens. @dev MUST emit the ApprovalForAll event on success. @param _operator Address to add to the set of authorized operators @param _approved True if the operator is approved, false to revoke approval */ function setApprovalForAll(address _operator, bool _approved) external; /** @notice Queries the approval status of an operator for a given owner. @param _owner The owner of the Tokens @param _operator Address of authorized operator @return True if the operator is approved, false if not */ function isApprovedForAll(address _owner, address _operator) external view returns (bool); } /** Note: Simple contract to use as base for const vals */ contract CommonConstants { bytes4 constant internal ERC1155_ACCEPTED = 0xf23a6e61; // bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)")) bytes4 constant internal ERC1155_BATCH_ACCEPTED = 0xbc197c81; // bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)")) } /** Note: The ERC-165 identifier for this interface is 0x4e2312e0. */ interface ERC1155TokenReceiver { /** @notice Handle the receipt of a single ERC1155 token type. @dev An ERC1155-compliant smart contract MUST call this function on the token recipient contract, at the end of a `safeTransferFrom` after the balance has been updated. This function MUST return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` (i.e. 0xf23a6e61) if it accepts the transfer. This function MUST revert if it rejects the transfer. Return of any other value than the prescribed keccak256 generated value MUST result in the transaction being reverted by the caller. @param _operator The address which initiated the transfer (i.e. msg.sender) @param _from The address which previously owned the token @param _id The ID of the token being transferred @param _value The amount of tokens being transferred @param _data Additional data with no specified format @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` */ function onERC1155Received(address _operator, address _from, uint256 _id, uint256 _value, bytes calldata _data) external returns(bytes4); /** @notice Handle the receipt of multiple ERC1155 token types. @dev An ERC1155-compliant smart contract MUST call this function on the token recipient contract, at the end of a `safeBatchTransferFrom` after the balances have been updated. This function MUST return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` (i.e. 0xbc197c81) if it accepts the transfer(s). This function MUST revert if it rejects the transfer(s). Return of any other value than the prescribed keccak256 generated value MUST result in the transaction being reverted by the caller. @param _operator The address which initiated the batch transfer (i.e. msg.sender) @param _from The address which previously owned the token @param _ids An array containing ids of each token being transferred (order and length must match _values array) @param _values An array containing amounts of each token being transferred (order and length must match _ids array) @param _data Additional data with no specified format @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` */ function onERC1155BatchReceived(address _operator, address _from, uint256[] calldata _ids, uint256[] calldata _values, bytes calldata _data) external returns(bytes4); } /** Note: The ERC-165 identifier for this interface is 0x0e89341c. */ interface IERC1155Metadata_URI { /** @notice A distinct Uniform Resource Identifier (URI) for a given token. @dev URIs are defined in RFC 3986. The URI may point to a JSON file that conforms to the "ERC-1155 Metadata URI JSON Schema". @return URI string */ function uri(uint256 _id) external view returns (string memory); } /** Note: The ERC-165 identifier for this interface is 0x0e89341c. */ contract ERC1155Metadata_URI is IERC1155Metadata_URI, HasTokenURI { constructor(string memory _tokenURIPrefix) HasTokenURI(_tokenURIPrefix) public { } function uri(uint256 _id) external view returns (string memory) { return _tokenURI(_id); } } contract ERC1155 is IERC1155, ERC165, CommonConstants { using SafeMath for uint256; using Address for address; // id => (owner => balance) mapping (uint256 => mapping(address => uint256)) internal balances; // owner => (operator => approved) mapping (address => mapping(address => bool)) internal operatorApproval; /////////////////////////////////////////// ERC165 ////////////////////////////////////////////// /* bytes4(keccak256("safeTransferFrom(address,address,uint256,uint256,bytes)")) ^ bytes4(keccak256("safeBatchTransferFrom(address,address,uint256[],uint256[],bytes)")) ^ bytes4(keccak256("balanceOf(address,uint256)")) ^ bytes4(keccak256("balanceOfBatch(address[],uint256[])")) ^ bytes4(keccak256("setApprovalForAll(address,bool)")) ^ bytes4(keccak256("isApprovedForAll(address,address)")); */ bytes4 constant private INTERFACE_SIGNATURE_ERC1155 = 0xd9b67a26; /////////////////////////////////////////// CONSTRUCTOR ////////////////////////////////////////// constructor() public { _registerInterface(INTERFACE_SIGNATURE_ERC1155); } /////////////////////////////////////////// ERC1155 ////////////////////////////////////////////// /** @notice Transfers `_value` amount of an `_id` from the `_from` address to the `_to` address specified (with safety call). @dev Caller must be approved to manage the tokens being transferred out of the `_from` account (see "Approval" section of the standard). MUST revert if `_to` is the zero address. MUST revert if balance of holder for token `_id` is lower than the `_value` sent. MUST revert on any other error. MUST emit the `TransferSingle` event to reflect the balance change (see "Safe Transfer Rules" section of the standard). After the above conditions are met, this function MUST check if `_to` is a smart contract (e.g. code size > 0). If so, it MUST call `onERC1155Received` on `_to` and act appropriately (see "Safe Transfer Rules" section of the standard). @param _from Source address @param _to Target address @param _id ID of the token type @param _value Transfer amount @param _data Additional data with no specified format, MUST be sent unaltered in call to `onERC1155Received` on `_to` */ function safeTransferFrom(address _from, address _to, uint256 _id, uint256 _value, bytes calldata _data) external { require(_to != address(0x0), "_to must be non-zero."); require(_from == msg.sender || operatorApproval[_from][msg.sender] == true, "Need operator approval for 3rd party transfers."); // SafeMath will throw with insuficient funds _from // or if _id is not valid (balance will be 0) balances[_id][_from] = balances[_id][_from].sub(_value); balances[_id][_to] = _value.add(balances[_id][_to]); // MUST emit event emit TransferSingle(msg.sender, _from, _to, _id, _value); // Now that the balance is updated and the event was emitted, // call onERC1155Received if the destination is a contract. if (_to.isContract()) { _doSafeTransferAcceptanceCheck(msg.sender, _from, _to, _id, _value, _data); } } /** @notice Transfers `_values` amount(s) of `_ids` from the `_from` address to the `_to` address specified (with safety call). @dev Caller must be approved to manage the tokens being transferred out of the `_from` account (see "Approval" section of the standard). MUST revert if `_to` is the zero address. MUST revert if length of `_ids` is not the same as length of `_values`. MUST revert if any of the balance(s) of the holder(s) for token(s) in `_ids` is lower than the respective amount(s) in `_values` sent to the recipient. MUST revert on any other error. MUST emit `TransferSingle` or `TransferBatch` event(s) such that all the balance changes are reflected (see "Safe Transfer Rules" section of the standard). Balance changes and events MUST follow the ordering of the arrays (_ids[0]/_values[0] before _ids[1]/_values[1], etc). After the above conditions for the transfer(s) in the batch are met, this function MUST check if `_to` is a smart contract (e.g. code size > 0). If so, it MUST call the relevant `ERC1155TokenReceiver` hook(s) on `_to` and act appropriately (see "Safe Transfer Rules" section of the standard). @param _from Source address @param _to Target address @param _ids IDs of each token type (order and length must match _values array) @param _values Transfer amounts per token type (order and length must match _ids array) @param _data Additional data with no specified format, MUST be sent unaltered in call to the `ERC1155TokenReceiver` hook(s) on `_to` */ function safeBatchTransferFrom(address _from, address _to, uint256[] calldata _ids, uint256[] calldata _values, bytes calldata _data) external { // MUST Throw on errors require(_to != address(0x0), "destination address must be non-zero."); require(_ids.length == _values.length, "_ids and _values array lenght must match."); require(_from == msg.sender || operatorApproval[_from][msg.sender] == true, "Need operator approval for 3rd party transfers."); for (uint256 i = 0; i < _ids.length; ++i) { uint256 id = _ids[i]; uint256 value = _values[i]; // SafeMath will throw with insuficient funds _from // or if _id is not valid (balance will be 0) balances[id][_from] = balances[id][_from].sub(value); balances[id][_to] = value.add(balances[id][_to]); } // Note: instead of the below batch versions of event and acceptance check you MAY have emitted a TransferSingle // event and a subsequent call to _doSafeTransferAcceptanceCheck in above loop for each balance change instead. // Or emitted a TransferSingle event for each in the loop and then the single _doSafeBatchTransferAcceptanceCheck below. // However it is implemented the balance changes and events MUST match when a check (i.e. calling an external contract) is done. // MUST emit event emit TransferBatch(msg.sender, _from, _to, _ids, _values); // Now that the balances are updated and the events are emitted, // call onERC1155BatchReceived if the destination is a contract. if (_to.isContract()) { _doSafeBatchTransferAcceptanceCheck(msg.sender, _from, _to, _ids, _values, _data); } } /** @notice Get the balance of an account's Tokens. @param _owner The address of the token holder @param _id ID of the Token @return The _owner's balance of the Token type requested */ function balanceOf(address _owner, uint256 _id) external view returns (uint256) { // The balance of any account can be calculated from the Transfer events history. // However, since we need to keep the balances to validate transfer request, // there is no extra cost to also privide a querry function. return balances[_id][_owner]; } /** @notice Get the balance of multiple account/token pairs @param _owners The addresses of the token holders @param _ids ID of the Tokens @return The _owner's balance of the Token types requested (i.e. balance for each (owner, id) pair) */ function balanceOfBatch(address[] calldata _owners, uint256[] calldata _ids) external view returns (uint256[] memory) { require(_owners.length == _ids.length); uint256[] memory balances_ = new uint256[](_owners.length); for (uint256 i = 0; i < _owners.length; ++i) { balances_[i] = balances[_ids[i]][_owners[i]]; } return balances_; } /** @notice Enable or disable approval for a third party ("operator") to manage all of the caller's tokens. @dev MUST emit the ApprovalForAll event on success. @param _operator Address to add to the set of authorized operators @param _approved True if the operator is approved, false to revoke approval */ function setApprovalForAll(address _operator, bool _approved) external { operatorApproval[msg.sender][_operator] = _approved; emit ApprovalForAll(msg.sender, _operator, _approved); } /** @notice Queries the approval status of an operator for a given owner. @param _owner The owner of the Tokens @param _operator Address of authorized operator @return True if the operator is approved, false if not */ function isApprovedForAll(address _owner, address _operator) external view returns (bool) { return operatorApproval[_owner][_operator]; } /////////////////////////////////////////// Internal ////////////////////////////////////////////// function _doSafeTransferAcceptanceCheck(address _operator, address _from, address _to, uint256 _id, uint256 _value, bytes memory _data) internal { // If this was a hybrid standards solution you would have to check ERC165(_to).supportsInterface(0x4e2312e0) here but as this is a pure implementation of an ERC-1155 token set as recommended by // the standard, it is not necessary. The below should revert in all failure cases i.e. _to isn't a receiver, or it is and either returns an unknown value or it reverts in the call to indicate non-acceptance. // Note: if the below reverts in the onERC1155Received function of the _to address you will have an undefined revert reason returned rather than the one in the require test. // If you want predictable revert reasons consider using low level _to.call() style instead so the revert does not bubble up and you can revert yourself on the ERC1155_ACCEPTED test. require(ERC1155TokenReceiver(_to).onERC1155Received(_operator, _from, _id, _value, _data) == ERC1155_ACCEPTED, "contract returned an unknown value from onERC1155Received"); } function _doSafeBatchTransferAcceptanceCheck(address _operator, address _from, address _to, uint256[] memory _ids, uint256[] memory _values, bytes memory _data) internal { // If this was a hybrid standards solution you would have to check ERC165(_to).supportsInterface(0x4e2312e0) here but as this is a pure implementation of an ERC-1155 token set as recommended by // the standard, it is not necessary. The below should revert in all failure cases i.e. _to isn't a receiver, or it is and either returns an unknown value or it reverts in the call to indicate non-acceptance. // Note: if the below reverts in the onERC1155BatchReceived function of the _to address you will have an undefined revert reason returned rather than the one in the require test. // If you want predictable revert reasons consider using low level _to.call() style instead so the revert does not bubble up and you can revert yourself on the ERC1155_BATCH_ACCEPTED test. require(ERC1155TokenReceiver(_to).onERC1155BatchReceived(_operator, _from, _ids, _values, _data) == ERC1155_BATCH_ACCEPTED, "contract returned an unknown value from onERC1155BatchReceived"); } } contract ERC1155Base is HasSecondarySaleFees, Ownable, ERC1155Metadata_URI, HasContractURI, ERC1155 { struct Fee { address payable recipient; uint256 value; } /// @notice id => creator mapping (uint256 => address) public creators; /// @notice id => fees mapping (uint256 => Fee[]) public fees; constructor(string memory contractURI, string memory tokenURIPrefix) HasContractURI(contractURI) ERC1155Metadata_URI(tokenURIPrefix) public { } /** @notice Get the secondary fee recipients of the token. @param id - The id of the token. @return An array of fee recipient addresses. */ function getFeeRecipients(uint256 id) public view returns (address payable[] memory) { Fee[] memory _fees = fees[id]; address payable[] memory result = new address payable[](_fees.length); for (uint i = 0; i < _fees.length; i++) { result[i] = _fees[i].recipient; } return result; } /** @notice Get the secondary fee amounts of the token. @param id - The id of the token. @return An array of fee amount values. */ function getFeeBps(uint256 id) public view returns (uint[] memory) { Fee[] memory _fees = fees[id]; uint[] memory result = new uint[](_fees.length); for (uint i = 0; i < _fees.length; i++) { result[i] = _fees[i].value; } return result; } /// @notice Creates a new token type and assings _initialSupply to minter function _mint(uint256 _id, Fee[] memory _fees, uint256 _supply, string memory _uri) internal { require(creators[_id] == address(0x0), "Token is already minted"); require(_supply != 0, "Supply should be positive"); require(bytes(_uri).length > 0, "uri should be set"); creators[_id] = msg.sender; address[] memory recipients = new address[](_fees.length); uint[] memory bps = new uint[](_fees.length); for (uint i = 0; i < _fees.length; i++) { require(_fees[i].recipient != address(0x0), "Recipient should be present"); require(_fees[i].value != 0, "Fee value should be positive"); fees[_id].push(_fees[i]); recipients[i] = _fees[i].recipient; bps[i] = _fees[i].value; } if (_fees.length > 0) { emit SecondarySaleFees(_id, recipients, bps); } balances[_id][msg.sender] = _supply; _setTokenURI(_id, _uri); // Transfer event with mint semantic emit TransferSingle(msg.sender, address(0x0), msg.sender, _id, _supply); emit URI(_uri, _id); } /// @notice Burns the token. function burn(address _owner, uint256 _id, uint256 _value) external { require(_owner == msg.sender || operatorApproval[_owner][msg.sender] == true, "Need operator approval for 3rd party burns."); // SafeMath will throw with insuficient funds _owner // or if _id is not valid (balance will be 0) balances[_id][_owner] = balances[_id][_owner].sub(_value); // MUST emit event emit TransferSingle(msg.sender, _owner, address(0x0), _id, _value); } /** * @dev Internal function to set the token URI for a given token. * Reverts if the token ID does not exist. * @param tokenId uint256 ID of the token to set its URI * @param uri string URI to assign */ function _setTokenURI(uint256 tokenId, string memory uri) internal { require(creators[tokenId] != address(0x0), "_setTokenURI: Token should exist"); super._setTokenURI(tokenId, uri); } /// @notice Sets the URI prefix for all tokens. function setTokenURIPrefix(string memory tokenURIPrefix) public onlyOwner { _setTokenURIPrefix(tokenURIPrefix); } /// @notice Sets the URI of the contract metadata. function setContractURI(string memory contractURI) public onlyOwner { _setContractURI(contractURI); } }
pragma solidity ^0.5.0; pragma experimental ABIEncoderV2; import "./Roles.sol"; import "./ERC1155.sol"; import "./AbstractSale.sol"; import "./TransferProxy.sol"; /// @title ERC1155SaleNonceHolder /// @notice The contract manages nonce values for the sales. contract ERC1155SaleNonceHolder is OwnableOperatorRole { /// @notice Token nonces. /// @dev keccak256(token, owner, tokenId) => nonce mapping(bytes32 => uint256) public nonces; /// @notice The amount of selled tokens for the tokenId. /// @dev keccak256(token, owner, tokenId, nonce) => completed amount mapping(bytes32 => uint256) public completed; /// @notice Get nonce value for the token. /// @param token - Token's contract address. /// @param tokenId - Token id. /// @param owner - The address of the token owner. /// @return The nonce value. function getNonce(address token, uint256 tokenId, address owner) view public returns (uint256) { return nonces[getNonceKey(token, tokenId, owner)]; } /// @notice Sets new nonce value for the token. Can only be called by the operator. /// @param token - Token's contract address. /// @param tokenId - Token id. /// @param owner - The address of the token owner. /// @param nonce - The new value for the nonce. function setNonce(address token, uint256 tokenId, address owner, uint256 nonce) public onlyOperator { nonces[getNonceKey(token, tokenId, owner)] = nonce; } /// @notice Encode the token info to use as a key for `nonces` mapping. /// @param token - Token's contract address. /// @param tokenId - Token id. /// @param owner - The address of the token owner. /// @return Encoded key for the token. function getNonceKey(address token, uint256 tokenId, address owner) pure public returns (bytes32) { return keccak256(abi.encodePacked(token, tokenId, owner)); } /// @notice Get the amount of selled tokens. /// @param token - Token's contract address. /// @param tokenId - Token id. /// @param owner - The address of the token owner. /// @param nonce - The nonce value of the sale. /// @return Selled tokens count for the sale with specific nonce. function getCompleted(address token, uint256 tokenId, address owner, uint256 nonce) view public returns (uint256) { return completed[getCompletedKey(token, tokenId, owner, nonce)]; } /// @notice Sets the new amount of selled tokens. Can be called only by the contract operator. /// @param token - Token's contract address. /// @param tokenId - Token id. /// @param owner - The address of the token owner. /// @param nonce - The nonce value of the sale. /// @param _completed - The new completed value to set. function setCompleted(address token, uint256 tokenId, address owner, uint256 nonce, uint256 _completed) public onlyOperator { completed[getCompletedKey(token, tokenId, owner, nonce)] = _completed; } /// @notice Encode order key to use as a key of `completed` mapping. /// @param token - Token's contract address. /// @param tokenId - Token id. /// @param owner - The address of the token owner. /// @param nonce - The nonce value of the sale. /// @return Encoded key. function getCompletedKey(address token, uint256 tokenId, address owner, uint256 nonce) pure public returns (bytes32) { return keccak256(abi.encodePacked(token, tokenId, owner, nonce)); } } /// @title ERC1155Sale /// @notice Allows users to exchange ERC1155Sale tokens for the Ether. contract ERC1155Sale is Ownable, AbstractSale { using StringLibrary for string; event CloseOrder(address indexed token, uint256 indexed tokenId, address owner, uint256 nonce); event Buy(address indexed token, uint256 indexed tokenId, address owner, uint256 price, address buyer, uint256 value); bytes constant EMPTY = ""; /// @notice The address of a transfer proxy for ERC721 and ERC1155 tokens. TransferProxy public transferProxy; /// @notice The address of a nonce manager contract. ERC1155SaleNonceHolder public nonceHolder; /// @param _transferProxy - The address of a deployed TransferProxy contract. /// @param _nonceHolder - The address of a deployed ERC1155SaleNonceHolder contract. /// @param beneficiary - The address of a fee recipient. constructor(TransferProxy _transferProxy, ERC1155SaleNonceHolder _nonceHolder, address payable beneficiary) AbstractSale(beneficiary) public { transferProxy = _transferProxy; nonceHolder = _nonceHolder; } /// @notice This function is called to buy ERC1151 token in exchange for ETH. /// @notice ERC1155 token must be approved for this contract before calling this function. /// @notice To pay with ETH, transaction must send ether within the calling transaction. /// @notice Buyer's payment value is calculated as `price * buying + buyerFee%`. `buyerFee` can be obtaind by calling buyerFee() function of this contract (inherited from AbstractSale). /// @param token - ERC1151 token contracy address. /// @param tokenId - ERC1151 token id for sale. /// @param owner - The address of the ERC1151 token owner. /// @param selling - The total amount of ERC1155 token for sale. /// @param buying - The amount of ERC1155 tokens to buy in this function call. /// @param price - The price of ERC1151 token in WEI. /// @param sellerFee - Amount for seller's fee. Represented as percents * 100 (100% => 10000. 1% => 100). /// @param signature - Signed message with parameters of the format: `${token.address.toLowerCase()}. tokenId: ${tokenId}. price: ${price}. nonce: ${nonce}. fee: ${sellerFee}. value: ${selling}` /// If sellerFee is zero, than the format is `${token.address.toLowerCase()}. tokenId: ${tokenId}. price: ${price}. nonce: ${nonce}. value: ${selling}` /// Where token.address.toLowerCase() is the address of the ERC1151 token contract (parameter `value`). /// The `nonce` can be obtained from the nonceHolder with `getNonce` function. /// Message must be prefixed with: `"\x19Ethereum Signed Message:\n" + message.length`. /// Some libraries, for example web3.accounts.sign, will automatically prefix the message. function buy(IERC1155 token, uint256 tokenId, address payable owner, uint256 selling, uint256 buying, uint256 price, uint256 sellerFee, Sig memory signature) public payable { uint256 nonce = verifySignature(address(token), tokenId, owner, selling, price, sellerFee, signature); uint256 total = price.mul(buying); uint256 buyerFeeValue = total.mul(buyerFee).div(10000); require(total + buyerFeeValue == msg.value, "msg.value is incorrect"); bool closed = verifyOpenAndModifyState(address(token), tokenId, owner, nonce, selling, buying); transferProxy.erc1155safeTransferFrom(token, owner, msg.sender, tokenId, buying, EMPTY); transferEther(token, tokenId, owner, total, sellerFee); emit Buy(address(token), tokenId, owner, price, msg.sender, buying); if (closed) { emit CloseOrder(address(token), tokenId, owner, nonce + 1); } } /// @notice Cancel the token sale order. Can be called only by the token owner. /// The function makes signed buy message invalid by increasing the nonce for the token. /// @param token - The address of the token contract. /// @param tokenId - The token id. function cancel(address token, uint256 tokenId) public payable { uint nonce = nonceHolder.getNonce(token, tokenId, msg.sender); nonceHolder.setNonce(token, tokenId, msg.sender, nonce + 1); emit CloseOrder(token, tokenId, msg.sender, nonce + 1); } function verifySignature(address token, uint256 tokenId, address payable owner, uint256 selling, uint256 price, uint256 sellerFee, Sig memory signature) view internal returns (uint256 nonce) { nonce = nonceHolder.getNonce(token, tokenId, owner); require(prepareMessage(token, tokenId, price, selling, sellerFee, nonce).recover(signature.v, signature.r, signature.s) == owner, "incorrect signature"); } function verifyOpenAndModifyState(address token, uint256 tokenId, address payable owner, uint256 nonce, uint256 selling, uint256 buying) internal returns (bool) { uint comp = nonceHolder.getCompleted(token, tokenId, owner, nonce).add(buying); require(comp <= selling); nonceHolder.setCompleted(token, tokenId, owner, nonce, comp); if (comp == selling) { nonceHolder.setNonce(token, tokenId, owner, nonce + 1); return true; } return false; } function prepareMessage(address token, uint256 tokenId, uint256 price, uint256 value, uint256 fee, uint256 nonce) internal pure returns (string memory) { return prepareMessage(token, tokenId, price, fee, nonce).append(". value: ", value.toString()); } }
pragma solidity ^0.5.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); } /** * @dev Implementation of the {IERC165} interface. * * Contracts may inherit from this and call {_registerInterface} to declare * their support of an interface. */ 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) external view 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 { require(interfaceId != 0xffffffff, "ERC165: invalid interface id"); _supportedInterfaces[interfaceId] = true; } } contract HasContractURI is ERC165 { string public contractURI; /* * bytes4(keccak256('contractURI()')) == 0xe8a3d485 */ bytes4 private constant _INTERFACE_ID_CONTRACT_URI = 0xe8a3d485; constructor(string memory _contractURI) public { contractURI = _contractURI; _registerInterface(_INTERFACE_ID_CONTRACT_URI); } /** * @dev Internal function to set the contract URI * @param _contractURI string URI prefix to assign */ function _setContractURI(string memory _contractURI) internal { contractURI = _contractURI; } } contract HasSecondarySaleFees is ERC165 { event SecondarySaleFees(uint256 tokenId, address[] recipients, uint[] bps); /* * bytes4(keccak256('getFeeBps(uint256)')) == 0x0ebd4c7f * bytes4(keccak256('getFeeRecipients(uint256)')) == 0xb9c4d9fb * * => 0x0ebd4c7f ^ 0xb9c4d9fb == 0xb7799584 */ bytes4 private constant _INTERFACE_ID_FEES = 0xb7799584; constructor() public { _registerInterface(_INTERFACE_ID_FEES); } function getFeeRecipients(uint256 id) public view returns (address payable[] memory); function getFeeBps(uint256 id) public view returns (uint[] memory); }
pragma solidity ^0.5.0; import "./libs.sol"; import "./ERC165.sol"; import "./Roles.sol"; import "./HasTokenURI.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ contract IERC721 is IERC165 { event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of NFTs in `owner`'s account. */ function balanceOf(address owner) public view returns (uint256 balance); /** * @dev Returns the owner of the NFT specified by `tokenId`. */ function ownerOf(uint256 tokenId) public view returns (address owner); /** * @dev Transfers a specific NFT (`tokenId`) from one account (`from`) to * another (`to`). * * * * Requirements: * - `from`, `to` cannot be zero. * - `tokenId` must be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move this * NFT by either {approve} or {setApprovalForAll}. */ function safeTransferFrom(address from, address to, uint256 tokenId) public; /** * @dev Transfers a specific NFT (`tokenId`) from one account (`from`) to * another (`to`). * * Requirements: * - If the caller is not `from`, it must be approved to move this NFT by * either {approve} or {setApprovalForAll}. */ function transferFrom(address from, address to, uint256 tokenId) public; function approve(address to, uint256 tokenId) public; function getApproved(uint256 tokenId) public view returns (address operator); function setApprovalForAll(address operator, bool _approved) public; function isApprovedForAll(address owner, address operator) public view returns (bool); function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public; } /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ contract IERC721Receiver { /** * @notice Handle the receipt of an NFT * @dev The ERC721 smart contract calls this function on the recipient * after a {IERC721-safeTransferFrom}. This function MUST return the function selector, * otherwise the caller will revert the transaction. The selector to be * returned can be obtained as `this.onERC721Received.selector`. This * function MAY throw to revert and reject the transfer. * Note: the ERC721 contract address is always the message sender. * @param operator The address which called `safeTransferFrom` function * @param from The address which previously owned the token * @param tokenId The NFT identifier which is being transferred * @param data Additional data with no specified format * @return bytes4 `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))` */ function onERC721Received(address operator, address from, uint256 tokenId, bytes memory data) public returns (bytes4); } /** * @title ERC721 Non-Fungible Token Standard basic implementation * @dev see https://eips.ethereum.org/EIPS/eip-721 */ contract ERC721 is Context, ERC165, IERC721 { using SafeMath for uint256; using Address for address; using Counters for Counters.Counter; // 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 token ID to owner mapping (uint256 => address) private _tokenOwner; // Mapping from token ID to approved address mapping (uint256 => address) private _tokenApprovals; // Mapping from owner to number of owned token mapping (address => Counters.Counter) private _ownedTokensCount; // Mapping from owner to operator approvals mapping (address => mapping (address => bool)) private _operatorApprovals; /* * 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 ^ 0xe985e9c ^ 0x23b872dd ^ 0x42842e0e ^ 0xb88d4fde == 0x80ac58cd */ bytes4 private constant _INTERFACE_ID_ERC721 = 0x80ac58cd; constructor () public { // register the supported interfaces to conform to ERC721 via ERC165 _registerInterface(_INTERFACE_ID_ERC721); } /** * @dev Gets the balance of the specified address. * @param owner address to query the balance of * @return uint256 representing the amount owned by the passed address */ function balanceOf(address owner) public view returns (uint256) { require(owner != address(0), "ERC721: balance query for the zero address"); return _ownedTokensCount[owner].current(); } /** * @dev Gets the owner of the specified token ID. * @param tokenId uint256 ID of the token to query the owner of * @return address currently marked as the owner of the given token ID */ function ownerOf(uint256 tokenId) public view returns (address) { address owner = _tokenOwner[tokenId]; require(owner != address(0), "ERC721: owner query for nonexistent token"); return owner; } /** * @dev Approves another address to transfer the given token ID * The zero address indicates there is no approved address. * There can only be one approved address per token at a given time. * Can only be called by the token owner or an approved operator. * @param to address to be approved for the given token ID * @param tokenId uint256 ID of the token to be approved */ function approve(address to, uint256 tokenId) public { address owner = ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require(_msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not owner nor approved for all" ); _tokenApprovals[tokenId] = to; emit Approval(owner, to, tokenId); } /** * @dev Gets the approved address for a token ID, or zero if no address set * Reverts if the token ID does not exist. * @param tokenId uint256 ID of the token to query the approval of * @return address currently approved for the given token ID */ function getApproved(uint256 tokenId) public view returns (address) { require(_exists(tokenId), "ERC721: approved query for nonexistent token"); return _tokenApprovals[tokenId]; } /** * @dev Sets or unsets the approval of a given operator * An operator is allowed to transfer all tokens of the sender on their behalf. * @param to operator address to set the approval * @param approved representing the status of the approval to be set */ function setApprovalForAll(address to, bool approved) public { require(to != _msgSender(), "ERC721: approve to caller"); _operatorApprovals[_msgSender()][to] = approved; emit ApprovalForAll(_msgSender(), to, approved); } /** * @dev Tells whether an operator is approved by a given owner. * @param owner owner address which you want to query the approval of * @param operator operator address which you want to query the approval of * @return bool whether the given operator is approved by the given owner */ function isApprovedForAll(address owner, address operator) public view returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev Transfers the ownership of a given token ID to another address. * Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * Requires the msg.sender to be the owner, approved, or operator. * @param from current owner of the token * @param to address to receive the ownership of the given token ID * @param tokenId uint256 ID of the token to be transferred */ function transferFrom(address from, address to, uint256 tokenId) public { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _transferFrom(from, to, tokenId); } /** * @dev Safely transfers the ownership of a given token ID to another address * If the target address is a contract, it must implement {IERC721Receiver-onERC721Received}, * which is called upon a safe transfer, and return the magic value * `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise, * the transfer is reverted. * Requires the msg.sender to be the owner, approved, or operator * @param from current owner of the token * @param to address to receive the ownership of the given token ID * @param tokenId uint256 ID of the token to be transferred */ function safeTransferFrom(address from, address to, uint256 tokenId) public { safeTransferFrom(from, to, tokenId, ""); } /** * @dev Safely transfers the ownership of a given token ID to another address * If the target address is a contract, it must implement {IERC721Receiver-onERC721Received}, * which is called upon a safe transfer, and return the magic value * `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise, * the transfer is reverted. * Requires the _msgSender() to be the owner, approved, or operator * @param from current owner of the token * @param to address to receive the ownership of the given token ID * @param tokenId uint256 ID of the token to be transferred * @param _data bytes data to send along with a safe transfer check */ function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _safeTransferFrom(from, to, tokenId, _data); } /** * @dev Safely transfers the ownership of a given token ID to another address * If the target address is a contract, it must implement `onERC721Received`, * which is called upon a safe transfer, and return the magic value * `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise, * the transfer is reverted. * Requires the msg.sender to be the owner, approved, or operator * @param from current owner of the token * @param to address to receive the ownership of the given token ID * @param tokenId uint256 ID of the token to be transferred * @param _data bytes data to send along with a safe transfer check */ function _safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) internal { _transferFrom(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Returns whether the specified token exists. * @param tokenId uint256 ID of the token to query the existence of * @return bool whether the token exists */ function _exists(uint256 tokenId) internal view returns (bool) { address owner = _tokenOwner[tokenId]; return owner != address(0); } /** * @dev Returns whether the given spender can transfer a given token ID. * @param spender address of the spender to query * @param tokenId uint256 ID of the token to be transferred * @return bool whether the msg.sender is approved for the given token ID, * is an operator of the owner, or is the owner of the token */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view returns (bool) { require(_exists(tokenId), "ERC721: operator query for nonexistent token"); address owner = ownerOf(tokenId); return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender)); } /** * @dev Internal function to safely mint a new token. * Reverts if the given token ID already exists. * If the target address is a contract, it must implement `onERC721Received`, * which is called upon a safe transfer, and return the magic value * `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise, * the transfer is reverted. * @param to The address that will own the minted token * @param tokenId uint256 ID of the token to be minted */ function _safeMint(address to, uint256 tokenId) internal { _safeMint(to, tokenId, ""); } /** * @dev Internal function to safely mint a new token. * Reverts if the given token ID already exists. * If the target address is a contract, it must implement `onERC721Received`, * which is called upon a safe transfer, and return the magic value * `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise, * the transfer is reverted. * @param to The address that will own the minted token * @param tokenId uint256 ID of the token to be minted * @param _data bytes data to send along with a safe transfer check */ function _safeMint(address to, uint256 tokenId, bytes memory _data) internal { _mint(to, tokenId); require(_checkOnERC721Received(address(0), to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Internal function to mint a new token. * Reverts if the given token ID already exists. * @param to The address that will own the minted token * @param tokenId uint256 ID of the token to be minted */ function _mint(address to, uint256 tokenId) internal { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _tokenOwner[tokenId] = to; _ownedTokensCount[to].increment(); emit Transfer(address(0), to, tokenId); } /** * @dev Internal function to burn a specific token. * Reverts if the token does not exist. * Deprecated, use {_burn} instead. * @param owner owner of the token to burn * @param tokenId uint256 ID of the token being burned */ function _burn(address owner, uint256 tokenId) internal { require(ownerOf(tokenId) == owner, "ERC721: burn of token that is not own"); _clearApproval(tokenId); _ownedTokensCount[owner].decrement(); _tokenOwner[tokenId] = address(0); emit Transfer(owner, address(0), tokenId); } /** * @dev Internal function to burn a specific token. * Reverts if the token does not exist. * @param tokenId uint256 ID of the token being burned */ function _burn(uint256 tokenId) internal { _burn(ownerOf(tokenId), tokenId); } /** * @dev Internal function to transfer ownership of a given token ID to another address. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * @param from current owner of the token * @param to address to receive the ownership of the given token ID * @param tokenId uint256 ID of the token to be transferred */ function _transferFrom(address from, address to, uint256 tokenId) internal { require(ownerOf(tokenId) == from, "ERC721: transfer of token that is not own"); require(to != address(0), "ERC721: transfer to the zero address"); _clearApproval(tokenId); _ownedTokensCount[from].decrement(); _ownedTokensCount[to].increment(); _tokenOwner[tokenId] = to; emit Transfer(from, to, tokenId); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * This is an internal detail of the `ERC721` contract and its use is deprecated. * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param _data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory _data) internal returns (bool) { if (!to.isContract()) { return true; } // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = to.call(abi.encodeWithSelector( IERC721Receiver(to).onERC721Received.selector, _msgSender(), from, tokenId, _data )); if (!success) { if (returndata.length > 0) { // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert("ERC721: transfer to non ERC721Receiver implementer"); } } else { bytes4 retval = abi.decode(returndata, (bytes4)); return (retval == _ERC721_RECEIVED); } } /** * @dev Private function to clear current approval of a given token ID. * @param tokenId uint256 ID of the token to be transferred */ function _clearApproval(uint256 tokenId) private { if (_tokenApprovals[tokenId] != address(0)) { _tokenApprovals[tokenId] = address(0); } } } /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ contract IERC721Metadata is IERC721 { function name() external view returns (string memory); function symbol() external view returns (string memory); function tokenURI(uint256 tokenId) external view returns (string memory); } /** * @title ERC721 Burnable Token * @dev ERC721 Token that can be irreversibly burned (destroyed). */ contract ERC721Burnable is Context, ERC721 { /** * @dev Burns a specific ERC721 token. * @param tokenId uint256 id of the ERC721 token to be burned. */ function burn(uint256 tokenId) public { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721Burnable: caller is not owner nor approved"); _burn(tokenId); } } /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ contract IERC721Enumerable is IERC721 { function totalSupply() public view returns (uint256); function tokenOfOwnerByIndex(address owner, uint256 index) public view returns (uint256 tokenId); function tokenByIndex(uint256 index) public view returns (uint256); } /** * @title ERC-721 Non-Fungible Token with optional enumeration extension logic * @dev See https://eips.ethereum.org/EIPS/eip-721 */ contract ERC721Enumerable is Context, ERC165, ERC721, IERC721Enumerable { // Mapping from owner to list of owned token IDs mapping(address => uint256[]) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex; // Array with all token ids, used for enumeration uint256[] private _allTokens; // Mapping from token id to position in the allTokens array mapping(uint256 => uint256) private _allTokensIndex; /* * 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 Constructor function. */ constructor () public { // register the supported interface to conform to ERC721Enumerable via ERC165 _registerInterface(_INTERFACE_ID_ERC721_ENUMERABLE); } /** * @dev Gets the token ID at a given index of the tokens list of the requested owner. * @param owner address owning the tokens list to be accessed * @param index uint256 representing the index to be accessed of the requested tokens list * @return uint256 token ID at the given index of the tokens list owned by the requested address */ function tokenOfOwnerByIndex(address owner, uint256 index) public view returns (uint256) { require(index < balanceOf(owner), "ERC721Enumerable: owner index out of bounds"); return _ownedTokens[owner][index]; } /** * @dev Gets the total amount of tokens stored by the contract. * @return uint256 representing the total amount of tokens */ function totalSupply() public view returns (uint256) { return _allTokens.length; } /** * @dev Gets the token ID at a given index of all the tokens in this contract * Reverts if the index is greater or equal to the total number of tokens. * @param index uint256 representing the index to be accessed of the tokens list * @return uint256 token ID at the given index of the tokens list */ function tokenByIndex(uint256 index) public view returns (uint256) { require(index < totalSupply(), "ERC721Enumerable: global index out of bounds"); return _allTokens[index]; } /** * @dev Internal function to transfer ownership of a given token ID to another address. * As opposed to transferFrom, this imposes no restrictions on msg.sender. * @param from current owner of the token * @param to address to receive the ownership of the given token ID * @param tokenId uint256 ID of the token to be transferred */ function _transferFrom(address from, address to, uint256 tokenId) internal { super._transferFrom(from, to, tokenId); _removeTokenFromOwnerEnumeration(from, tokenId); _addTokenToOwnerEnumeration(to, tokenId); } /** * @dev Internal function to mint a new token. * Reverts if the given token ID already exists. * @param to address the beneficiary that will own the minted token * @param tokenId uint256 ID of the token to be minted */ function _mint(address to, uint256 tokenId) internal { super._mint(to, tokenId); _addTokenToOwnerEnumeration(to, tokenId); _addTokenToAllTokensEnumeration(tokenId); } /** * @dev Internal function to burn a specific token. * Reverts if the token does not exist. * Deprecated, use {ERC721-_burn} instead. * @param owner owner of the token to burn * @param tokenId uint256 ID of the token being burned */ function _burn(address owner, uint256 tokenId) internal { super._burn(owner, tokenId); _removeTokenFromOwnerEnumeration(owner, tokenId); // Since tokenId will be deleted, we can clear its slot in _ownedTokensIndex to trigger a gas refund _ownedTokensIndex[tokenId] = 0; _removeTokenFromAllTokensEnumeration(tokenId); } /** * @dev Gets the list of token IDs of the requested owner. * @param owner address owning the tokens * @return uint256[] List of token IDs owned by the requested address */ function _tokensOfOwner(address owner) internal view returns (uint256[] storage) { return _ownedTokens[owner]; } /** * @dev Private function to add a token to this extension's ownership-tracking data structures. * @param to address representing the new owner of the given token ID * @param tokenId uint256 ID of the token to be added to the tokens list of the given address */ function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { _ownedTokensIndex[tokenId] = _ownedTokens[to].length; _ownedTokens[to].push(tokenId); } /** * @dev Private function to add a token to this extension's token tracking data structures. * @param tokenId uint256 ID of the token to be added to the tokens list */ function _addTokenToAllTokensEnumeration(uint256 tokenId) private { _allTokensIndex[tokenId] = _allTokens.length; _allTokens.push(tokenId); } /** * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for * gas optimizations e.g. when performing a transfer operation (avoiding double writes). * This has O(1) time complexity, but alters the order of the _ownedTokens array. * @param from address representing the previous owner of the given token ID * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address */ function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private { // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = _ownedTokens[from].length.sub(1); uint256 tokenIndex = _ownedTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary if (tokenIndex != lastTokenIndex) { uint256 lastTokenId = _ownedTokens[from][lastTokenIndex]; _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index } // This also deletes the contents at the last position of the array _ownedTokens[from].length--; // Note that _ownedTokensIndex[tokenId] hasn't been cleared: it still points to the old slot (now occupied by // lastTokenId, or just over the end of the array if the token was the last one). } /** * @dev Private function to remove a token from this extension's token tracking data structures. * This has O(1) time complexity, but alters the order of the _allTokens array. * @param tokenId uint256 ID of the token to be removed from the tokens list */ function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private { // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = _allTokens.length.sub(1); uint256 tokenIndex = _allTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding // an 'if' statement (like in _removeTokenFromOwnerEnumeration) uint256 lastTokenId = _allTokens[lastTokenIndex]; _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index // This also deletes the contents at the last position of the array _allTokens.length--; _allTokensIndex[tokenId] = 0; } } /** * @title Full ERC721 Token with support for tokenURIPrefix * This implementation includes all the required and some optional functionality of the ERC721 standard * Moreover, it includes approve all functionality using operator terminology * @dev see https://eips.ethereum.org/EIPS/eip-721 */ contract ERC721Base is HasSecondarySaleFees, ERC721, HasContractURI, HasTokenURI, ERC721Enumerable { // Token name string public name; // Token symbol string public symbol; /** @notice Describes a fee. @param recipient - Fee recipient address. @param value - Fee amount in percents * 100. */ struct Fee { address payable recipient; uint256 value; } // id => fees mapping (uint256 => Fee[]) public fees; /* * 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; /** * @dev Constructor function */ constructor (string memory _name, string memory _symbol, string memory contractURI, string memory _tokenURIPrefix) HasContractURI(contractURI) HasTokenURI(_tokenURIPrefix) public { name = _name; symbol = _symbol; // register the supported interfaces to conform to ERC721 via ERC165 _registerInterface(_INTERFACE_ID_ERC721_METADATA); } /** @notice Get the secondary fee recipients of the token. @param id - The id of the token. @return An array of fee recipient addresses. */ function getFeeRecipients(uint256 id) public view returns (address payable[] memory) { Fee[] memory _fees = fees[id]; address payable[] memory result = new address payable[](_fees.length); for (uint i = 0; i < _fees.length; i++) { result[i] = _fees[i].recipient; } return result; } /** @notice Get the secondary fee amounts of the token. @param id - The id of the token. @return An array of fee amount values. */ function getFeeBps(uint256 id) public view returns (uint[] memory) { Fee[] memory _fees = fees[id]; uint[] memory result = new uint[](_fees.length); for (uint i = 0; i < _fees.length; i++) { result[i] = _fees[i].value; } return result; } function _mint(address to, uint256 tokenId, Fee[] memory _fees) internal { _mint(to, tokenId); address[] memory recipients = new address[](_fees.length); uint[] memory bps = new uint[](_fees.length); for (uint i = 0; i < _fees.length; i++) { require(_fees[i].recipient != address(0x0), "Recipient should be present"); require(_fees[i].value != 0, "Fee value should be positive"); fees[tokenId].push(_fees[i]); recipients[i] = _fees[i].recipient; bps[i] = _fees[i].value; } if (_fees.length > 0) { emit SecondarySaleFees(tokenId, recipients, bps); } } /** * @dev Returns an URI for a given token ID. * Throws if the token ID does not exist. May return an empty string. * @param tokenId uint256 ID of the token to query */ function tokenURI(uint256 tokenId) external view returns (string memory) { require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); return super._tokenURI(tokenId); } /** * @dev Internal function to set the token URI for a given token. * Reverts if the token ID does not exist. * @param tokenId uint256 ID of the token to set its URI * @param uri string URI to assign */ function _setTokenURI(uint256 tokenId, string memory uri) internal { require(_exists(tokenId), "ERC721Metadata: URI set of nonexistent token"); super._setTokenURI(tokenId, uri); } /** * @dev Internal function to burn a specific token. * Reverts if the token does not exist. * Deprecated, use _burn(uint256) instead. * @param owner owner of the token to burn * @param tokenId uint256 ID of the token being burned by the msg.sender */ function _burn(address owner, uint256 tokenId) internal { super._burn(owner, tokenId); _clearTokenURI(tokenId); } }
pragma solidity ^0.5.0; pragma experimental ABIEncoderV2; import "./Roles.sol"; import "./ERC721.sol"; import "./ERC1155.sol"; import "./AbstractSale.sol"; import "./TransferProxy.sol"; /// @title IERC721Sale contract IERC721Sale { function getNonce(IERC721 token, uint256 tokenId) view public returns (uint256); } /// @title ERC721SaleNonceHolder /// @notice The contract manages nonce values for the sales. contract ERC721SaleNonceHolder is OwnableOperatorRole { /// @notice token nonces mapping(bytes32 => uint256) public nonces; /// @notice Previous nonce manager contract address. IERC721Sale public previous; /// @notice The contract constructor. /// @param _previous - The value of the previous nonce manager contract. constructor(IERC721Sale _previous) public { previous = _previous; } /// @notice Get nonce value for the token. /// @param token - Token's contract address. /// @param tokenId - Token id. /// @return The nonce value. function getNonce(IERC721 token, uint256 tokenId) view public returns (uint256) { uint256 newNonce = nonces[getPositionKey(token, tokenId)]; if (newNonce != 0) { return newNonce; } if (address(previous) == address(0x0)) { return 0; } return previous.getNonce(token, tokenId); } /// @notice Sets new nonce value for the token. Can only be called by the operator. /// @param token - Token's contract address. /// @param tokenId - Token id. /// @param nonce - The new value for the nonce. function setNonce(IERC721 token, uint256 tokenId, uint256 nonce) public onlyOperator { nonces[getPositionKey(token, tokenId)] = nonce; } /// @notice Encode the token info to use as a mapping key. /// @param token - Token's contract address. /// @param tokenId - Token id. /// @return Encoded key for the token. function getPositionKey(IERC721 token, uint256 tokenId) pure public returns (bytes32) { return keccak256(abi.encodePacked(token, tokenId)); } } /// @title ERC721Sale /// @notice Allows users to exchange ERC721 tokens for the Ether. contract ERC721Sale is Ownable, IERC721Receiver, AbstractSale { using AddressLibrary for address; using UintLibrary for uint256; using StringLibrary for string; event Cancel(address indexed token, uint256 indexed tokenId, address owner, uint256 nonce); event Buy(address indexed token, uint256 indexed tokenId, address seller, address buyer, uint256 price, uint256 nonce); /// @notice The address of a transfer proxy for ERC721 and ERC1155 tokens. TransferProxy public transferProxy; /// @notice The address of a nonce manager contract. ERC721SaleNonceHolder public nonceHolder; /// @param _transferProxy - The address of a deployed TransferProxy contract. /// @param _nonceHolder - The address of a deployed ERC721SaleNonceHolder contract. /// @param beneficiary - The address of a fee recipient. constructor(TransferProxy _transferProxy, ERC721SaleNonceHolder _nonceHolder, address payable beneficiary) AbstractSale(beneficiary) public { transferProxy = _transferProxy; nonceHolder = _nonceHolder; } /// @notice Cancel the token sale order. Can be called only by the token owner. /// The function makes signed buy message invalid by increasing the nonce for the token. /// @param token - The address of the token contract. /// @param tokenId - The token id. function cancel(IERC721 token, uint256 tokenId) public { address owner = token.ownerOf(tokenId); require(owner == msg.sender, "not an owner"); uint256 nonce = nonceHolder.getNonce(token, tokenId) + 1; nonceHolder.setNonce(token, tokenId, nonce); emit Cancel(address(token), tokenId, owner, nonce); } /// @notice This function is called to buy ERC721 token in exchange for ETH. /// @notice ERC721 token must be approved for this contract before calling this function. /// @notice To pay with ETH, transaction must send ether within the calling transaction. /// @notice Buyer's payment value is calculated as `price + buyerFee%`. `buyerFee` can be obtaind by calling buyerFee() function of this contract (inherited from AbstractSale). /// @param token - ERC721 token contracy address. /// @param tokenId - ERC721 token id for sale. /// @param price - The price of ERC721 token in WEI. /// @param sellerFee - Amount for seller's fee. Represented as percents * 100 (100% => 10000. 1% => 100). /// @param signature - Signed message with parameters of the format: `${token.address.toLowerCase()}. tokenId: ${tokenId}. price: ${price}. nonce: ${nonce}. fee: ${sellerFee}` /// If sellerFee is zero, than the format is `${token.address.toLowerCase()}. tokenId: ${tokenId}. price: ${price}. nonce: ${nonce}` /// Where token.address.toLowerCase() is the address of the ERC721 token contract (parameter `value`). /// The `nonce` can be obtained from the nonceHolder with `getNonce` function. /// Message must be prefixed with: `"\x19Ethereum Signed Message:\n" + message.length`. /// Some libraries, for example web3.accounts.sign, will automatically prefix the message. function buy(IERC721 token, uint256 tokenId, uint256 price, uint256 sellerFee, Sig memory signature) public payable { address payable owner = address(uint160(token.ownerOf(tokenId))); uint256 nonce = nonceHolder.getNonce(token, tokenId); uint256 buyerFeeValue = price.mul(buyerFee).div(10000); require(msg.value == price + buyerFeeValue, "msg.value is incorrect"); require(owner == prepareMessage(address(token), tokenId, price, sellerFee, nonce).recover(signature.v, signature.r, signature.s), "owner should sign correct message"); transferProxy.erc721safeTransferFrom(token, owner, msg.sender, tokenId); transferEther(token, tokenId, owner, price, sellerFee); nonceHolder.setNonce(token, tokenId, nonce + 1); emit Buy(address(token), tokenId, owner, msg.sender, price, nonce + 1); } /// @notice Standard ERC721 receiver function implementation. function onERC721Received(address, address, uint256, bytes memory) public returns (bytes4) { return this.onERC721Received.selector; } }
pragma solidity ^0.5.0; pragma experimental ABIEncoderV2; import "./libs.sol"; import "./Roles.sol"; import "./ERC165.sol"; import "./IERC20.sol"; import "./TransferProxy.sol"; /// @title ExchangeDomainV1 /// @notice Describes all the structs that are used in exchnages. contract ExchangeDomainV1 { enum AssetType {ETH, ERC20, ERC1155, ERC721, ERC721Deprecated} struct Asset { address token; uint tokenId; AssetType assetType; } struct OrderKey { /* who signed the order */ address owner; /* random number */ uint salt; /* what has owner */ Asset sellAsset; /* what wants owner */ Asset buyAsset; } struct Order { OrderKey key; /* how much has owner (in wei, or UINT256_MAX if ERC-721) */ uint selling; /* how much wants owner (in wei, or UINT256_MAX if ERC-721) */ uint buying; /* fee for selling. Represented as percents * 100 (100% - 10000. 1% - 100)*/ uint sellerFee; } /* An ECDSA signature. */ struct Sig { /* v parameter */ uint8 v; /* r parameter */ bytes32 r; /* s parameter */ bytes32 s; } } /// @title ExchangeStateV1 /// @notice Tracks the amount of selled tokens in the order. contract ExchangeStateV1 is OwnableOperatorRole { // keccak256(OrderKey) => completed mapping(bytes32 => uint256) public completed; /// @notice Get the amount of selled tokens. /// @param key - the `OrderKey` struct. /// @return Selled tokens count for the order. function getCompleted(ExchangeDomainV1.OrderKey calldata key) view external returns (uint256) { return completed[getCompletedKey(key)]; } /// @notice Sets the new amount of selled tokens. Can be called only by the contract operator. /// @param key - the `OrderKey` struct. /// @param newCompleted - The new value to set. function setCompleted(ExchangeDomainV1.OrderKey calldata key, uint256 newCompleted) external onlyOperator { completed[getCompletedKey(key)] = newCompleted; } /// @notice Encode order key to use as the mapping key. /// @param key - the `OrderKey` struct. /// @return Encoded order key. function getCompletedKey(ExchangeDomainV1.OrderKey memory key) pure public returns (bytes32) { return keccak256(abi.encodePacked(key.owner, key.sellAsset.token, key.sellAsset.tokenId, key.buyAsset.token, key.buyAsset.tokenId, key.salt)); } } /// @title ExchangeOrdersHolderV1 /// @notice Optionally holds orders, which can be exchanged without order's holder signature. contract ExchangeOrdersHolderV1 { mapping(bytes32 => OrderParams) internal orders; struct OrderParams { /* how much has owner (in wei, or UINT256_MAX if ERC-721) */ uint selling; /* how much wants owner (in wei, or UINT256_MAX if ERC-721) */ uint buying; /* fee for selling */ uint sellerFee; } /// @notice This function can be called to add the order to the contract, so it can be exchanged without signature. /// Can be called only by the order owner. /// @param order - The order struct to add. function add(ExchangeDomainV1.Order calldata order) external { require(msg.sender == order.key.owner, "order could be added by owner only"); bytes32 key = prepareKey(order); orders[key] = OrderParams(order.selling, order.buying, order.sellerFee); } /// @notice This function checks if order was added to the orders holder contract. /// @param order - The order struct to check. /// @return true if order is present in the contract's data. function exists(ExchangeDomainV1.Order calldata order) external view returns (bool) { bytes32 key = prepareKey(order); OrderParams memory params = orders[key]; return params.buying == order.buying && params.selling == order.selling && params.sellerFee == order.sellerFee; } function prepareKey(ExchangeDomainV1.Order memory order) internal pure returns (bytes32) { return keccak256(abi.encode( order.key.sellAsset.token, order.key.sellAsset.tokenId, order.key.owner, order.key.buyAsset.token, order.key.buyAsset.tokenId, order.key.salt )); } } /// @title Token Exchange contract. /// @notice Supports ETH, ERC20, ERC721 and ERC1155 tokens. /// @notice This contracts relies on offchain signatures for order and fees verification. contract ExchangeV1 is Ownable, ExchangeDomainV1 { using SafeMath for uint; using UintLibrary for uint; using StringLibrary for string; using BytesLibrary for bytes32; enum FeeSide {NONE, SELL, BUY} event Buy( address indexed sellToken, uint256 indexed sellTokenId, uint256 sellValue, address owner, address buyToken, uint256 buyTokenId, uint256 buyValue, address buyer, uint256 amount, uint256 salt ); event Cancel( address indexed sellToken, uint256 indexed sellTokenId, address owner, address buyToken, uint256 buyTokenId, uint256 salt ); bytes4 private constant _INTERFACE_ID_FEES = 0xb7799584; uint256 private constant UINT256_MAX = 2 ** 256 - 1; address payable public beneficiary; address public buyerFeeSigner; /// @notice The address of a transfer proxy for ERC721 and ERC1155 tokens. TransferProxy public transferProxy; /// @notice The address of a transfer proxy for deprecated ERC721 tokens. Does not use safe transfer. TransferProxyForDeprecated public transferProxyForDeprecated; /// @notice The address of a transfer proxy for ERC20 tokens. ERC20TransferProxy public erc20TransferProxy; /// @notice The address of a state contract, which counts the amount of selled tokens. ExchangeStateV1 public state; /// @notice The address of a orders holder contract, which can contain unsigned orders. ExchangeOrdersHolderV1 public ordersHolder; /// @notice Contract constructor. /// @param _transferProxy - The address of a deployed TransferProxy contract. /// @param _transferProxyForDeprecated - The address of a deployed TransferProxyForDeprecated contract. /// @param _erc20TransferProxy - The address of a deployed ERC20TransferProxy contract. /// @param _state - The address of a deployed ExchangeStateV1 contract. /// @param _ordersHolder - The address of a deployed ExchangeOrdersHolderV1 contract. /// @param _beneficiary - The address wich will receive collected fees. /// @param _buyerFeeSigner - The address to sign buyer's fees for orders. constructor( TransferProxy _transferProxy, TransferProxyForDeprecated _transferProxyForDeprecated, ERC20TransferProxy _erc20TransferProxy, ExchangeStateV1 _state, ExchangeOrdersHolderV1 _ordersHolder, address payable _beneficiary, address _buyerFeeSigner ) public { transferProxy = _transferProxy; transferProxyForDeprecated = _transferProxyForDeprecated; erc20TransferProxy = _erc20TransferProxy; state = _state; ordersHolder = _ordersHolder; beneficiary = _beneficiary; buyerFeeSigner = _buyerFeeSigner; } /// @notice This function is called by contract owner and sets fee receiver address. /// @param newBeneficiary - new address, who where all the fees will be transfered function setBeneficiary(address payable newBeneficiary) external onlyOwner { beneficiary = newBeneficiary; } /// @notice This function is called by contract owner and sets fee signer address. /// @param newBuyerFeeSigner - new address, which will sign buyer's fees for orders function setBuyerFeeSigner(address newBuyerFeeSigner) external onlyOwner { buyerFeeSigner = newBuyerFeeSigner; } /// @notice This function is called to execute the exchange. /// @notice ERC20, ERC721 or ERC1155 tokens from buyer's or seller's side must be approved for this contract before calling this function. /// @notice To pay with ETH, transaction must send ether within the calling transaction. /// @notice Buyer's payment value is calculated as `order.buying * amount / order.selling + buyerFee%`. /// @dev Emits Buy event. /// @param order - Order struct (see ExchangeDomainV1). /// @param sig - Signed order message. To generate the message call `prepareMessage` function. /// Message must be prefixed with: `"\x19Ethereum Signed Message:\n" + message.length`. /// For example, web3.accounts.sign will automatically prefix the message. /// Also, the signature might be all zeroes, if specified order record was added to the ordersHolder. /// @param buyerFee - Amount for buyer's fee. Represented as percents * 100 (100% => 10000. 1% => 100). /// @param buyerFeeSig - Signed order + buyerFee message. To generate the message call prepareBuyerFeeMessage function. /// Message must be prefixed with: `"\x19Ethereum Signed Message:\n" + message.length`. /// For example, web3.accounts.sign will automatically prefix the message. /// @param amount - Amount of tokens to buy. /// @param buyer - The buyer's address. function exchange( Order calldata order, Sig calldata sig, uint buyerFee, Sig calldata buyerFeeSig, uint amount, address buyer ) payable external { validateOrderSig(order, sig); validateBuyerFeeSig(order, buyerFee, buyerFeeSig); uint paying = order.buying.mul(amount).div(order.selling); verifyOpenAndModifyOrderState(order.key, order.selling, amount); require(order.key.sellAsset.assetType != AssetType.ETH, "ETH is not supported on sell side"); if (order.key.buyAsset.assetType == AssetType.ETH) { validateEthTransfer(paying, buyerFee); } FeeSide feeSide = getFeeSide(order.key.sellAsset.assetType, order.key.buyAsset.assetType); if (buyer == address(0x0)) { buyer = msg.sender; } transferWithFeesPossibility(order.key.sellAsset, amount, order.key.owner, buyer, feeSide == FeeSide.SELL, buyerFee, order.sellerFee, order.key.buyAsset); transferWithFeesPossibility(order.key.buyAsset, paying, msg.sender, order.key.owner, feeSide == FeeSide.BUY, order.sellerFee, buyerFee, order.key.sellAsset); emitBuy(order, amount, buyer); } function validateEthTransfer(uint value, uint buyerFee) internal view { uint256 buyerFeeValue = value.bp(buyerFee); require(msg.value == value + buyerFeeValue, "msg.value is incorrect"); } /// @notice Cancel the token exchange order. Can be called only by the order owner. /// The function makes all exchnage calls for this order revert with error. /// @param key - The OrderKey struct of the order. function cancel(OrderKey calldata key) external { require(key.owner == msg.sender, "not an owner"); state.setCompleted(key, UINT256_MAX); emit Cancel(key.sellAsset.token, key.sellAsset.tokenId, msg.sender, key.buyAsset.token, key.buyAsset.tokenId, key.salt); } function validateOrderSig( Order memory order, Sig memory sig ) internal view { if (sig.v == 0 && sig.r == bytes32(0x0) && sig.s == bytes32(0x0)) { require(ordersHolder.exists(order), "incorrect signature"); } else { require(prepareMessage(order).recover(sig.v, sig.r, sig.s) == order.key.owner, "incorrect signature"); } } function validateBuyerFeeSig( Order memory order, uint buyerFee, Sig memory sig ) internal view { require(prepareBuyerFeeMessage(order, buyerFee).recover(sig.v, sig.r, sig.s) == buyerFeeSigner, "incorrect buyer fee signature"); } /// @notice This function generates fee message to sign for exchange call. /// @param order - Order struct. /// @param fee - Fee amount. /// @return Encoded (order, fee) message, wich should be signed by the buyerFeeSigner. Does not contain standard prefix. function prepareBuyerFeeMessage(Order memory order, uint fee) public pure returns (string memory) { return keccak256(abi.encode(order, fee)).toString(); } /// @notice This function generates order message to sign for exchange call. /// @param order - Order struct. /// @return Encoded order message, wich should be signed by the token owner. Does not contain standard prefix. function prepareMessage(Order memory order) public pure returns (string memory) { return keccak256(abi.encode(order)).toString(); } function transferWithFeesPossibility(Asset memory firstType, uint value, address from, address to, bool hasFee, uint256 sellerFee, uint256 buyerFee, Asset memory secondType) internal { if (!hasFee) { transfer(firstType, value, from, to); } else { transferWithFees(firstType, value, from, to, sellerFee, buyerFee, secondType); } } function transfer(Asset memory asset, uint value, address from, address to) internal { if (asset.assetType == AssetType.ETH) { address payable toPayable = address(uint160(to)); toPayable.transfer(value); } else if (asset.assetType == AssetType.ERC20) { require(asset.tokenId == 0, "tokenId should be 0"); erc20TransferProxy.erc20safeTransferFrom(IERC20(asset.token), from, to, value); } else if (asset.assetType == AssetType.ERC721) { require(value == 1, "value should be 1 for ERC-721"); transferProxy.erc721safeTransferFrom(IERC721(asset.token), from, to, asset.tokenId); } else if (asset.assetType == AssetType.ERC721Deprecated) { require(value == 1, "value should be 1 for ERC-721"); transferProxyForDeprecated.erc721TransferFrom(IERC721(asset.token), from, to, asset.tokenId); } else { transferProxy.erc1155safeTransferFrom(IERC1155(asset.token), from, to, asset.tokenId, value, ""); } } function transferWithFees(Asset memory firstType, uint value, address from, address to, uint256 sellerFee, uint256 buyerFee, Asset memory secondType) internal { uint restValue = transferFeeToBeneficiary(firstType, from, value, sellerFee, buyerFee); if ( secondType.assetType == AssetType.ERC1155 && IERC1155(secondType.token).supportsInterface(_INTERFACE_ID_FEES) || (secondType.assetType == AssetType.ERC721 || secondType.assetType == AssetType.ERC721Deprecated) && IERC721(secondType.token).supportsInterface(_INTERFACE_ID_FEES) ) { HasSecondarySaleFees withFees = HasSecondarySaleFees(secondType.token); address payable[] memory recipients = withFees.getFeeRecipients(secondType.tokenId); uint[] memory fees = withFees.getFeeBps(secondType.tokenId); require(fees.length == recipients.length); for (uint256 i = 0; i < fees.length; i++) { (uint newRestValue, uint current) = subFeeInBp(restValue, value, fees[i]); restValue = newRestValue; transfer(firstType, current, from, recipients[i]); } } address payable toPayable = address(uint160(to)); transfer(firstType, restValue, from, toPayable); } function transferFeeToBeneficiary(Asset memory asset, address from, uint total, uint sellerFee, uint buyerFee) internal returns (uint) { (uint restValue, uint sellerFeeValue) = subFeeInBp(total, total, sellerFee); uint buyerFeeValue = total.bp(buyerFee); uint beneficiaryFee = buyerFeeValue.add(sellerFeeValue); if (beneficiaryFee > 0) { transfer(asset, beneficiaryFee, from, beneficiary); } return restValue; } function emitBuy(Order memory order, uint amount, address buyer) internal { emit Buy(order.key.sellAsset.token, order.key.sellAsset.tokenId, order.selling, order.key.owner, order.key.buyAsset.token, order.key.buyAsset.tokenId, order.buying, buyer, amount, order.key.salt ); } function subFeeInBp(uint value, uint total, uint feeInBp) internal pure returns (uint newValue, uint realFee) { return subFee(value, total.bp(feeInBp)); } function subFee(uint value, uint fee) internal pure returns (uint newValue, uint realFee) { if (value > fee) { newValue = value - fee; realFee = fee; } else { newValue = 0; realFee = value; } } function verifyOpenAndModifyOrderState(OrderKey memory key, uint selling, uint amount) internal { uint completed = state.getCompleted(key); uint newCompleted = completed.add(amount); require(newCompleted <= selling, "not enough stock of order for buying"); state.setCompleted(key, newCompleted); } function getFeeSide(AssetType sellType, AssetType buyType) internal pure returns (FeeSide) { if ((sellType == AssetType.ERC721 || sellType == AssetType.ERC721Deprecated) && (buyType == AssetType.ERC721 || buyType == AssetType.ERC721Deprecated)) { return FeeSide.NONE; } if (uint(sellType) > uint(buyType)) { return FeeSide.BUY; } return FeeSide.SELL; } }
pragma solidity ^0.5.0; import "./libs.sol"; contract HasTokenURI { using StringLibrary for string; //Token URI prefix string public tokenURIPrefix; // Optional mapping for token URIs mapping(uint256 => string) private _tokenURIs; constructor(string memory _tokenURIPrefix) public { tokenURIPrefix = _tokenURIPrefix; } /** * @dev Returns an URI for a given token ID. * Throws if the token ID does not exist. May return an empty string. * @param tokenId uint256 ID of the token to query */ function _tokenURI(uint256 tokenId) internal view returns (string memory) { return tokenURIPrefix.append(_tokenURIs[tokenId]); } /** * @dev Internal function to set the token URI for a given token. * Reverts if the token ID does not exist. * @param tokenId uint256 ID of the token to set its URI * @param uri string URI to assign */ function _setTokenURI(uint256 tokenId, string memory uri) internal { _tokenURIs[tokenId] = uri; } /** * @dev Internal function to set the token URI prefix. * @param _tokenURIPrefix string URI prefix to assign */ function _setTokenURIPrefix(string memory _tokenURIPrefix) internal { tokenURIPrefix = _tokenURIPrefix; } function _clearTokenURI(uint256 tokenId) internal { if (bytes(_tokenURIs[tokenId]).length != 0) { delete _tokenURIs[tokenId]; } } }
pragma solidity ^0.5.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. Does not include * the optional functions; to access them see {ERC20Detailed}. */ 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); }
pragma solidity ^0.5.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, 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) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. * * _Available since v2.4.0._ */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @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) { // 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 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts 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) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. * * _Available since v2.4.0._ */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message 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. * * _Available since v2.4.0._ */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } /** * @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) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } /** * @dev Converts an `address` into `address payable`. Note that this is * simply a type cast: the actual underlying value is not changed. * * _Available since v2.4.0._ */ function toPayable(address account) internal pure returns (address payable) { return address(uint160(account)); } /** * @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]. * * _Available since v2.4.0._ */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-call-value (bool success, ) = recipient.call.value(amount)(""); require(success, "Address: unable to send value, recipient may have reverted"); } } /** * @title Counters * @author Matt Condon (@shrugs) * @dev Provides counters that can only be incremented or decremented by one. This can be used e.g. to track the number * of elements in a mapping, issuing ERC721 ids, or counting request ids. * * Include with `using Counters for Counters.Counter;` * Since it is not possible to overflow a 256 bit integer with increments of one, `increment` can skip the {SafeMath} * overflow check, thereby saving gas. This does assume however correct usage, in that the underlying `_value` is never * directly accessed. */ library Counters { using SafeMath for uint256; struct Counter { // This variable should never be directly accessed by users of the library: interactions must be restricted to // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add // this feature: see https://github.com/ethereum/solidity/issues/4637 uint256 _value; // default: 0 } function current(Counter storage counter) internal view returns (uint256) { return counter._value; } function increment(Counter storage counter) internal { // The {SafeMath} overflow check can be skipped here, see the comment at the top counter._value += 1; } function decrement(Counter storage counter) internal { counter._value = counter._value.sub(1); } } library UintLibrary { using SafeMath for uint; function toString(uint256 i) internal pure returns (string memory) { if (i == 0) { return "0"; } uint j = i; uint len; while (j != 0) { len++; j /= 10; } bytes memory bstr = new bytes(len); uint k = len - 1; while (i != 0) { bstr[k--] = byte(uint8(48 + i % 10)); i /= 10; } return string(bstr); } function bp(uint value, uint bpValue) internal pure returns (uint) { return value.mul(bpValue).div(10000); } } library StringLibrary { using UintLibrary for uint256; function append(string memory _a, string memory _b) internal pure returns (string memory) { bytes memory _ba = bytes(_a); bytes memory _bb = bytes(_b); bytes memory bab = new bytes(_ba.length + _bb.length); uint k = 0; for (uint i = 0; i < _ba.length; i++) bab[k++] = _ba[i]; for (uint i = 0; i < _bb.length; i++) bab[k++] = _bb[i]; return string(bab); } function append(string memory _a, string memory _b, string memory _c) internal pure returns (string memory) { bytes memory _ba = bytes(_a); bytes memory _bb = bytes(_b); bytes memory _bc = bytes(_c); bytes memory bbb = new bytes(_ba.length + _bb.length + _bc.length); uint k = 0; for (uint i = 0; i < _ba.length; i++) bbb[k++] = _ba[i]; for (uint i = 0; i < _bb.length; i++) bbb[k++] = _bb[i]; for (uint i = 0; i < _bc.length; i++) bbb[k++] = _bc[i]; return string(bbb); } function recover(string memory message, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) { bytes memory msgBytes = bytes(message); bytes memory fullMessage = concat( bytes("\x19Ethereum Signed Message:\n"), bytes(msgBytes.length.toString()), msgBytes, new bytes(0), new bytes(0), new bytes(0), new bytes(0) ); return ecrecover(keccak256(fullMessage), v, r, s); } function concat(bytes memory _ba, bytes memory _bb, bytes memory _bc, bytes memory _bd, bytes memory _be, bytes memory _bf, bytes memory _bg) internal pure returns (bytes memory) { bytes memory resultBytes = new bytes(_ba.length + _bb.length + _bc.length + _bd.length + _be.length + _bf.length + _bg.length); uint k = 0; for (uint i = 0; i < _ba.length; i++) resultBytes[k++] = _ba[i]; for (uint i = 0; i < _bb.length; i++) resultBytes[k++] = _bb[i]; for (uint i = 0; i < _bc.length; i++) resultBytes[k++] = _bc[i]; for (uint i = 0; i < _bd.length; i++) resultBytes[k++] = _bd[i]; for (uint i = 0; i < _be.length; i++) resultBytes[k++] = _be[i]; for (uint i = 0; i < _bf.length; i++) resultBytes[k++] = _bf[i]; for (uint i = 0; i < _bg.length; i++) resultBytes[k++] = _bg[i]; return resultBytes; } } library AddressLibrary { function toString(address _addr) internal pure returns (string memory) { bytes32 value = bytes32(uint256(_addr)); bytes memory alphabet = "0123456789abcdef"; bytes memory str = new bytes(42); str[0] = '0'; str[1] = 'x'; for (uint256 i = 0; i < 20; i++) { str[2+i*2] = alphabet[uint8(value[i + 12] >> 4)]; str[3+i*2] = alphabet[uint8(value[i + 12] & 0x0f)]; } return string(str); } } library BytesLibrary { function toString(bytes32 value) internal pure returns (string memory) { bytes memory alphabet = "0123456789abcdef"; bytes memory str = new bytes(64); for (uint256 i = 0; i < 32; i++) { str[i*2] = alphabet[uint8(value[i] >> 4)]; str[1+i*2] = alphabet[uint8(value[i] & 0x0f)]; } return string(str); } } library ECDSA { /** * @dev Recover signer address from a message by using their signature * @param hash bytes32 message, the hash is the signed message. What is recovered is the signer address. * @param signature bytes signature, the signature is generated using web3.eth.sign() */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { bytes32 r; bytes32 s; uint8 v; // Check the signature length if (signature.length != 65) { return (address(0)); } // Divide the signature in r, s and v variables // 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))) } // Version of signature should be 27 or 28, but 0 and 1 are also possible versions if (v < 27) { v += 27; } // If the version is correct return the signer address if (v != 27 && v != 28) { return (address(0)); } else { return ecrecover(hash, v, r, s); } } /** * toEthSignedMessageHash * @dev prefix a bytes32 value with "\x19Ethereum Signed Message:" * and hash the result */ 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.4.22 <0.9.0; contract Migrations { address public owner = msg.sender; uint public last_completed_migration; modifier restricted() { require( msg.sender == owner, "This function is restricted to the contract's owner" ); _; } function setCompleted(uint completed) public restricted { last_completed_migration = completed; } }
pragma solidity ^0.5.0; pragma experimental ABIEncoderV2; import "./libs.sol"; import "./Roles.sol"; import "./ERC721.sol"; /** * @title MintableOwnableToken * @dev anyone can mint token. */ contract MintableOwnableToken is Ownable, ERC721, IERC721Metadata, ERC721Burnable, ERC721Base, SignerRole { /// @notice Token minting event. event CreateERC721_v4(address indexed creator, string name, string symbol); /// @notice The contract constructor. /// @param name - The value for the `name`. /// @param symbol - The value for the `symbol`. /// @param contractURI - The URI with contract metadata. /// The metadata should be a JSON object with fields: `id, name, description, image, external_link`. /// If the URI containts `{address}` template in its body, then the template must be substituted with the contract address. /// @param tokenURIPrefix - The URI prefix for all the tokens. Usually set to ipfs gateway. /// @param signer - The address of the initial signer. constructor (string memory name, string memory symbol, string memory contractURI, string memory tokenURIPrefix, address signer) public ERC721Base(name, symbol, contractURI, tokenURIPrefix) { emit CreateERC721_v4(msg.sender, name, symbol); _addSigner(signer); _registerInterface(bytes4(keccak256('MINT_WITH_ADDRESS'))); } /// @notice The function for token minting. It creates a new token. /// Must contain the signature of the format: `sha3(tokenContract.address.toLowerCase() + tokenId)`. /// Where `tokenContract.address` is the address of the contract and tokenId is the id in uint256 hex format. /// 0 as uint256 must look like this: `0000000000000000000000000000000000000000000000000000000000000000`. /// The message **must not contain** the standard prefix. /// @param tokenId - The id of a new token. /// @param v - v parameter of the ECDSA signature. /// @param r - r parameter of the ECDSA signature. /// @param s - s parameter of the ECDSA signature. /// @param _fees - An array of the secondary fees for this token. /// @param tokenURI - The suffix with `tokenURIPrefix` usually complements ipfs link to metadata object. /// The URI must link to JSON object with various fields: `name, description, image, external_url, attributes`. /// Can also contain another various fields. function mint(uint256 tokenId, uint8 v, bytes32 r, bytes32 s, Fee[] memory _fees, string memory tokenURI) public { require(isSigner(ecrecover(keccak256(abi.encodePacked(this, tokenId)), v, r, s)), "signer should sign tokenId"); _mint(msg.sender, tokenId, _fees); _setTokenURI(tokenId, tokenURI); } /// @notice This function can be called by the contract owner and it adds an address as a new signer. /// The signer will authorize token minting by signing token ids. /// @param account - The address of a new signer. function addSigner(address account) public onlyOwner { _addSigner(account); } /// @notice This function can be called by the contract owner and it removes an address from signers pool. /// @param account - The address of a signer to remove. function removeSigner(address account) public onlyOwner { _removeSigner(account); } /// @notice Sets the URI prefix for all tokens. function setTokenURIPrefix(string memory tokenURIPrefix) public onlyOwner { _setTokenURIPrefix(tokenURIPrefix); } /// @notice Sets the URI for the contract metadata. function setContractURI(string memory contractURI) public onlyOwner { _setContractURI(contractURI); } } /** * @title MintableUserToken * @dev Only owner can mint tokens. */ contract MintableUserToken is MintableOwnableToken { /// @notice The contract constructor. /// @param name - The value for the `name`. /// @param symbol - The value for the `symbol`. /// @param contractURI - The URI with contract metadata. /// The metadata should be a JSON object with fields: `id, name, description, image, external_link`. /// If the URI containts `{address}` template in its body, then the template must be substituted with the contract address. /// @param tokenURIPrefix - The URI prefix for all the tokens. Usually set to ipfs gateway. /// @param signer - The address of the initial signer. constructor(string memory name, string memory symbol, string memory contractURI, string memory tokenURIPrefix, address signer) MintableOwnableToken(name, symbol, contractURI, tokenURIPrefix, signer) public {} /// @notice The function for token minting. It creates a new token. Can be called only by the contract owner. /// Must contain the signature of the format: `sha3(tokenContract.address.toLowerCase() + tokenId)`. /// Where `tokenContract.address` is the address of the contract and tokenId is the id in uint256 hex format. /// 0 as uint256 must look like this: `0000000000000000000000000000000000000000000000000000000000000000`. /// The message **must not contain** the standard prefix. /// @param tokenId - The id of a new token. /// @param v - v parameter of the ECDSA signature. /// @param r - r parameter of the ECDSA signature. /// @param s - s parameter of the ECDSA signature. /// @param _fees - An array of the secondary fees for this token. /// @param tokenURI - The suffix with `tokenURIPrefix` usually complements ipfs link to metadata object. /// The URI must link to JSON object with various fields: `name, description, image, external_url, attributes`. /// Can also contain another various fields. function mint(uint256 tokenId, uint8 v, bytes32 r, bytes32 s, Fee[] memory _fees, string memory tokenURI) onlyOwner public { super.mint(tokenId, v, r, s, _fees, tokenURI); } }
pragma solidity ^0.5.0; /** * @title Roles * @dev Library for managing addresses assigned to a Role. */ library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev Give an account access to this role. */ function add(Role storage role, address account) internal { require(!has(role, account), "Roles: account already has role"); role.bearer[account] = true; } /** * @dev Remove an account's access to this role. */ function remove(Role storage role, address account) internal { require(has(role, account), "Roles: account does not have role"); role.bearer[account] = false; } /** * @dev Check if an account has this role. * @return bool */ function has(Role storage role, address account) internal view returns (bool) { require(account != address(0), "Roles: account is the zero address"); return role.bearer[account]; } } /* * @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. */ contract Context { // Empty internal constructor, to prevent people from mistakenly deploying // an instance of this contract, which should be used via inheritance. constructor () internal { } // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns (address payable) { return msg.sender; } function _msgData() internal view returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } /** * @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. * * 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. */ 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 returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(isOwner(), "Ownable: caller is not the owner"); _; } /** * @dev Returns true if the caller is the current owner. */ function isOwner() public view returns (bool) { return _msgSender() == _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 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 onlyOwner { _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). */ function _transferOwnership(address newOwner) internal { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } /** * @title SignerRole * @dev A signer role contract. */ contract SignerRole is Context { using Roles for Roles.Role; event SignerAdded(address indexed account); event SignerRemoved(address indexed account); Roles.Role private _signers; constructor () internal { _addSigner(_msgSender()); } /** * @dev Makes function callable only if sender is a signer. */ modifier onlySigner() { require(isSigner(_msgSender()), "SignerRole: caller does not have the Signer role"); _; } /** * @dev Checks if the address is a signer. */ function isSigner(address account) public view returns (bool) { return _signers.has(account); } /** * @dev Makes the address a signer. Only other signers can add new signers. */ function addSigner(address account) public onlySigner { _addSigner(account); } /** * @dev Removes the address from signers. Signer can be renounced only by himself. */ function renounceSigner() public { _removeSigner(_msgSender()); } function _addSigner(address account) internal { _signers.add(account); emit SignerAdded(account); } function _removeSigner(address account) internal { _signers.remove(account); emit SignerRemoved(account); } } /** * @title OperatorRole * @dev An operator role contract. */ contract OperatorRole is Context { using Roles for Roles.Role; event OperatorAdded(address indexed account); event OperatorRemoved(address indexed account); Roles.Role private _operators; constructor () internal { } /** * @dev Makes function callable only if sender is an operator. */ modifier onlyOperator() { require(isOperator(_msgSender()), "OperatorRole: caller does not have the Operator role"); _; } /** * @dev Checks if the address is an operator. */ function isOperator(address account) public view returns (bool) { return _operators.has(account); } function _addOperator(address account) internal { _operators.add(account); emit OperatorAdded(account); } function _removeOperator(address account) internal { _operators.remove(account); emit OperatorRemoved(account); } } /** * @title OwnableOperatorRole * @dev Allows owner to add and remove operators. */ contract OwnableOperatorRole is Ownable, OperatorRole { /** * @dev Makes the address an operator. Only owner can call this function. */ function addOperator(address account) public onlyOwner { _addOperator(account); } /** * @dev Removes the address from operators. Only owner can call this function. */ function removeOperator(address account) public onlyOwner { _removeOperator(account); } } contract PauserRole { using Roles for Roles.Role; event PauserAdded(address indexed account); event PauserRemoved(address indexed account); Roles.Role private _pausers; constructor () internal { _addPauser(msg.sender); } modifier onlyPauser() { require(isPauser(msg.sender)); _; } function isPauser(address account) public view returns (bool) { return _pausers.has(account); } function addPauser(address account) public onlyPauser { _addPauser(account); } function renouncePauser() public { _removePauser(msg.sender); } function _addPauser(address account) internal { _pausers.add(account); emit PauserAdded(account); } function _removePauser(address account) internal { _pausers.remove(account); emit PauserRemoved(account); } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is PauserRole { event Paused(address account); event Unpaused(address account); bool private _paused; constructor () internal { _paused = false; } /** * @return true if the contract is paused, false otherwise. */ function paused() public view returns (bool) { return _paused; } /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!_paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(_paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() public onlyPauser whenNotPaused { _paused = true; emit Paused(msg.sender); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() public onlyPauser whenPaused { _paused = false; emit Unpaused(msg.sender); } }
pragma solidity ^0.5.0; import "./Roles.sol"; import "./ERC721.sol"; import "./ERC1155.sol"; import "./IERC20.sol"; /// @notice ERC721 and ERC1155 transfer proxy. contract TransferProxy is OwnableOperatorRole { /// @notice Calls safeTransferFrom for ERC721. /// @notice Can be called only by operator. function erc721safeTransferFrom(IERC721 token, address from, address to, uint256 tokenId) external onlyOperator { token.safeTransferFrom(from, to, tokenId); } /// @notice Calls safeTransferFrom for ERC1155. /// @notice Can be called only by operator. function erc1155safeTransferFrom(IERC1155 token, address from, address to, uint256 id, uint256 value, bytes calldata data) external onlyOperator { token.safeTransferFrom(from, to, id, value, data); } } /// @notice Transfer proxy for ERC721 tokens whithout safe transfer support. contract TransferProxyForDeprecated is OwnableOperatorRole { /// @notice Calls transferFrom for ERC721. /// @notice Can be called only by operator. function erc721TransferFrom(IERC721 token, address from, address to, uint256 tokenId) external onlyOperator { token.transferFrom(from, to, tokenId); } } /// @notice ERC20 transfer proxy. contract ERC20TransferProxy is OwnableOperatorRole { /// @notice Calls transferFrom for ERC20 and fails on error. /// @notice Can be called only by operator. function erc20safeTransferFrom(IERC20 token, address from, address to, uint256 value) external onlyOperator { require(token.transferFrom(from, to, value), "failure while transferring"); } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"string","name":"contractURI","type":"string"},{"internalType":"string","name":"tokenURIPrefix","type":"string"},{"internalType":"address","name":"signer","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_owner","type":"address"},{"indexed":true,"internalType":"address","name":"_operator","type":"address"},{"indexed":false,"internalType":"bool","name":"_approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"creator","type":"address"},{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"}],"name":"CreateERC1155_v1","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address[]","name":"recipients","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"bps","type":"uint256[]"}],"name":"SecondarySaleFees","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"}],"name":"SignerAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"}],"name":"SignerRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_operator","type":"address"},{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":true,"internalType":"address","name":"_to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"_ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"_values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_operator","type":"address"},{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":true,"internalType":"address","name":"_to","type":"address"},{"indexed":false,"internalType":"uint256","name":"_id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"_value","type":"string"},{"indexed":true,"internalType":"uint256","name":"_id","type":"uint256"}],"name":"URI","type":"event"},{"constant":false,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"addSigner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address[]","name":"_owners","type":"address[]"},{"internalType":"uint256[]","name":"_ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"burn","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"creators","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"fees","outputs":[{"internalType":"address payable","name":"recipient","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getFeeBps","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getFeeRecipients","outputs":[{"internalType":"address payable[]","name":"","type":"address[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isOwner","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"isSigner","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"},{"components":[{"internalType":"address payable","name":"recipient","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"internalType":"struct ERC1155Base.Fee[]","name":"fees","type":"tuple[]"},{"internalType":"uint256","name":"supply","type":"uint256"},{"internalType":"string","name":"uri","type":"string"}],"name":"mint","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"removeSigner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"renounceOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"renounceSigner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256[]","name":"_ids","type":"uint256[]"},{"internalType":"uint256[]","name":"_values","type":"uint256[]"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_operator","type":"address"},{"internalType":"bool","name":"_approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"string","name":"contractURI","type":"string"}],"name":"setContractURI","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"string","name":"tokenURIPrefix","type":"string"}],"name":"setTokenURIPrefix","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"tokenURIPrefix","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"}]
Contract Creation Code
60806040523480156200001157600080fd5b506040516200365b3803806200365b833981016040819052620000349162000489565b84848285858181818180620000596301ffc9a760e01b6001600160e01b036200022316565b62000074632dde656160e21b6001600160e01b036200022316565b6000620000896001600160e01b036200027e16565b600180546001600160a01b0319166001600160a01b038316908117909155604051919250906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350620000fd620000ee6001600160e01b036200027e16565b6001600160e01b036200028316565b8051620001129060039060208401906200037e565b505081516200012a915060059060208401906200037e565b506200014663e8a3d48560e01b6001600160e01b036200022316565b5062000162636cdb3d1360e11b6001600160e01b036200022316565b505084516200017990600a9060208801906200037e565b5083516200018f90600b9060208701906200037e565b50620001a4836001600160e01b036200028316565b620001ce604051620001b69062000693565b6040519081900390206001600160e01b036200022316565b5050505050336001600160a01b03167f658fd9a983a35f4a0bb697abb2c6971d688010d8bc264928a164ae391b87472c868660405162000210929190620006a0565b60405180910390a25050505050620007d1565b6001600160e01b03198082161415620002595760405162461bcd60e51b81526004016200025090620006e3565b60405180910390fd5b6001600160e01b0319166000908152602081905260409020805460ff19166001179055565b335b90565b6200029e816002620002d560201b62001b611790919060201c565b6040516001600160a01b038216907f47d1c22a25bb3a5d4e481b9b1e6944c2eade3181a0a20b495ed61d35b5323f2490600090a250565b620002ea82826001600160e01b036200032f16565b156200030a5760405162461bcd60e51b81526004016200025090620006d1565b6001600160a01b0316600090815260209190915260409020805460ff19166001179055565b60006001600160a01b0382166200035a5760405162461bcd60e51b81526004016200025090620006f5565b506001600160a01b03811660009081526020839052604090205460ff165b92915050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10620003c157805160ff1916838001178555620003f1565b82800160010185558215620003f1579182015b82811115620003f1578251825591602001919060010190620003d4565b50620003ff92915062000403565b5090565b6200028091905b80821115620003ff57600081556001016200040a565b80516200037881620007b7565b600082601f8301126200043f57600080fd5b81516200045662000450826200072e565b62000707565b915080825260208301602083018583830111156200047357600080fd5b620004808382846200077a565b50505092915050565b600080600080600060a08688031215620004a257600080fd5b85516001600160401b03811115620004b957600080fd5b620004c7888289016200042d565b95505060208601516001600160401b03811115620004e457600080fd5b620004f2888289016200042d565b94505060408601516001600160401b038111156200050f57600080fd5b6200051d888289016200042d565b93505060608601516001600160401b038111156200053a57600080fd5b62000548888289016200042d565b92505060806200055b8882890162000420565b9150509295509295909350565b6000620005758262000756565b6200058181856200075a565b9350620005938185602086016200077a565b6200059e81620007ad565b9093019392505050565b6000620005b7601f836200075a565b7f526f6c65733a206163636f756e7420616c72656164792068617320726f6c6500815260200192915050565b6000620005f2601c836200075a565b7f4552433136353a20696e76616c696420696e7465726661636520696400000000815260200192915050565b60006200062d6022836200075a565b7f526f6c65733a206163636f756e7420697320746865207a65726f206164647265815261737360f01b602082015260400192915050565b60006200067360118362000763565b704d494e545f574954485f4144445245535360781b815260110192915050565b6000620003788262000664565b60408082528101620006b3818562000568565b90508181036020830152620006c9818462000568565b949350505050565b602080825281016200037881620005a8565b602080825281016200037881620005e3565b6020808252810162000378816200061e565b6040518181016001600160401b03811182821017156200072657600080fd5b604052919050565b60006001600160401b038211156200074557600080fd5b506020601f91909101601f19160190565b5190565b90815260200190565b919050565b60006001600160a01b03821662000378565b60005b83811015620007975781810151838201526020016200077d565b83811115620007a7576000848401525b50505050565b601f01601f191690565b620007c28162000768565b8114620007ce57600080fd5b50565b612e7a80620007e16000396000f3fe608060405234801561001057600080fd5b50600436106101c35760003560e01c806395d89b41116100f9578063e5c8b03d11610097578063eb12d61e11610071578063eb12d61e1461039f578063f242432a146103b2578063f2fde38b146103c5578063f5298aca146103d8576101c3565b8063e5c8b03d1461037c578063e8a3d48514610384578063e985e9c51461038c576101c3565b8063b9c4d9fb116100d3578063b9c4d9fb1461032e578063c0ac99831461034e578063c6bf326214610356578063cd53d08e14610369576101c3565b806395d89b411461030057806399e0dd7c14610308578063a22cb4651461031b576101c3565b80634e1273f4116101665780637df73e27116101405780637df73e27146102bd5780638da5cb5b146102d05780638f32d59b146102e5578063938e3d7b146102ed576101c3565b80634e1273f4146102815780636308f1cd14610294578063715018a6146102b5576101c3565b80630e316ab7116101a25780630e316ab7146102265780630e89341c1461023b5780630ebd4c7f1461024e5780632eb2c2d61461026e576101c3565b8062fdd58e146101c857806301ffc9a7146101f157806306fdde0314610211575b600080fd5b6101db6101d6366004612062565b6103eb565b6040516101e89190612c98565b60405180910390f35b6102046101ff36600461214d565b610415565b6040516101e89190612afb565b610219610434565b6040516101e89190612b47565b610239610234366004611e84565b6104c2565b005b6102196102493660046121bd565b6104fb565b61026161025c3660046121bd565b610506565b6040516101e89190612aea565b61023961027c366004611edc565b6105f9565b61026161028f3660046120df565b6108ef565b6102a76102a23660046121db565b6109c9565b6040516101e89291906129e6565b610239610a0c565b6102046102cb366004611e84565b610a7a565b6102d8610a8d565b6040516101e891906129d8565b610204610a9d565b6102396102fb366004612189565b610ac3565b610219610af0565b610239610316366004612189565b610b4b565b610239610329366004612032565b610b78565b61034161033c3660046121bd565b610be7565b6040516101e89190612aa8565b610219610cdf565b6102396103643660046121fa565b610d3a565b6102d86103773660046121bd565b610d76565b610239610d91565b610219610da3565b61020461039a366004611ea2565b610dfe565b6102396103ad366004611e84565b610e2c565b6102396103c0366004611fa3565b610e59565b6102396103d3366004611e84565b611013565b6102396103e6366004612092565b611040565b60008181526006602090815260408083206001600160a01b03861684529091529020545b92915050565b6001600160e01b03191660009081526020819052604090205460ff1690565b600a805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104ba5780601f1061048f576101008083540402835291602001916104ba565b820191906000526020600020905b81548152906001019060200180831161049d57829003601f168201915b505050505081565b6104ca610a9d565b6104ef5760405162461bcd60e51b81526004016104e690612bf8565b60405180910390fd5b6104f881611138565b50565b606061040f82611180565b60008181526009602090815260408083208054825181850281018501909352808352606094859484015b82821015610578576000848152602090819020604080518082019091526002850290910180546001600160a01b03168252600190810154828401529083529092019101610530565b505050509050606081516040519080825280602002602001820160405280156105ab578160200160208202803883390190505b50905060005b82518110156105f1578281815181106105c657fe5b6020026020010151602001518282815181106105de57fe5b60209081029190910101526001016105b1565b509392505050565b6001600160a01b03871661061f5760405162461bcd60e51b81526004016104e690612ba8565b84831461063e5760405162461bcd60e51b81526004016104e690612c38565b6001600160a01b03881633148061067d57506001600160a01b038816600090815260076020908152604080832033845290915290205460ff1615156001145b6106995760405162461bcd60e51b81526004016104e690612bd8565b60005b858110156107ce5760008787838181106106b257fe5b90506020020135905060008686848181106106c957fe5b90506020020135905061071b816006600085815260200190815260200160002060008e6001600160a01b03166001600160a01b03168152602001908152602001600020546112bb90919063ffffffff16565b6006600084815260200190815260200160002060008d6001600160a01b03166001600160a01b031681526020019081526020016000208190555061079e6006600084815260200190815260200160002060008c6001600160a01b03166001600160a01b03168152602001908152602001600020548261130490919063ffffffff16565b60009283526006602090815260408085206001600160a01b038e168652909152909220919091555060010161069c565b50866001600160a01b0316886001600160a01b0316336001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb898989896040516108229493929190612ab9565b60405180910390a461083c876001600160a01b0316611329565b156108e5576108e533898989898080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808d0282810182019093528c82529093508c92508b91829185019084908082843760009201919091525050604080516020601f8c018190048102820181019092528a815292508a915089908190840183828082843760009201919091525061136592505050565b5050505050505050565b60608382146108fd57600080fd5b604080518581526020808702820101909152606090858015610929578160200160208202803883390190505b50905060005b858110156109bf576006600086868481811061094757fe5b905060200201358152602001908152602001600020600088888481811061096a57fe5b905060200201602061097f9190810190611e84565b6001600160a01b03166001600160a01b03168152602001908152602001600020548282815181106109ac57fe5b602090810291909101015260010161092f565b5095945050505050565b600960205281600052604060002081815481106109e257fe5b6000918252602090912060029091020180546001909101546001600160a01b039091169250905082565b610a14610a9d565b610a305760405162461bcd60e51b81526004016104e690612bf8565b6001546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600180546001600160a01b0319169055565b600061040f60028363ffffffff61141416565b6001546001600160a01b03165b90565b6001546000906001600160a01b0316610ab461145c565b6001600160a01b031614905090565b610acb610a9d565b610ae75760405162461bcd60e51b81526004016104e690612bf8565b6104f881611460565b600b805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104ba5780601f1061048f576101008083540402835291602001916104ba565b610b53610a9d565b610b6f5760405162461bcd60e51b81526004016104e690612bf8565b6104f881611477565b3360008181526007602090815260408083206001600160a01b038716808552925291829020805460ff191685151517905590519091907f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3190610bdb908590612afb565b60405180910390a35050565b60008181526009602090815260408083208054825181850281018501909352808352606094859484015b82821015610c59576000848152602090819020604080518082019091526002850290910180546001600160a01b03168252600190810154828401529083529092019101610c11565b50505050905060608151604051908082528060200260200182016040528015610c8c578160200160208202803883390190505b50905060005b82518110156105f157828181518110610ca757fe5b602002602001015160000151828281518110610cbf57fe5b6001600160a01b0390921660209283029190910190910152600101610c92565b6003805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104ba5780601f1061048f576101008083540402835291602001916104ba565b610d42610a9d565b610d5e5760405162461bcd60e51b81526004016104e690612bf8565b610d6d8787878787878761148a565b50505050505050565b6008602052600090815260409020546001600160a01b031681565b610da1610d9c61145c565b611138565b565b6005805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104ba5780601f1061048f576101008083540402835291602001916104ba565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b610e34610a9d565b610e505760405162461bcd60e51b81526004016104e690612bf8565b6104f881611531565b6001600160a01b038516610e7f5760405162461bcd60e51b81526004016104e690612c68565b6001600160a01b038616331480610ebe57506001600160a01b038616600090815260076020908152604080832033845290915290205460ff1615156001145b610eda5760405162461bcd60e51b81526004016104e690612bd8565b60008481526006602090815260408083206001600160a01b038a168452909152902054610f0d908463ffffffff6112bb16565b60008581526006602090815260408083206001600160a01b038b81168552925280832093909355871681522054610f45908490611304565b60008581526006602090815260408083206001600160a01b03808b168086529190935292819020939093559151909188169033907fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6290610fa89089908990612cda565b60405180910390a4610fc2856001600160a01b0316611329565b1561100b5761100b338787878787878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061157992505050565b505050505050565b61101b610a9d565b6110375760405162461bcd60e51b81526004016104e690612bf8565b6104f881611628565b6001600160a01b03831633148061107f57506001600160a01b038316600090815260076020908152604080832033845290915290205460ff1615156001145b61109b5760405162461bcd60e51b81526004016104e690612bc8565b60008281526006602090815260408083206001600160a01b03871684529091529020546110ce908263ffffffff6112bb16565b60008381526006602090815260408083206001600160a01b038816808552925280832093909355915190919033907fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f629061112b9087908790612cda565b60405180910390a4505050565b61114960028263ffffffff6116aa16565b6040516001600160a01b038216907f3525e22824a8a7df2c9a6029941c824cf95b6447f1e13d5128fd3826d35afe8b90600090a250565b6000818152600460209081526040918290208054835160026001831615610100026000190190921691909104601f810184900484028201840190945283815260609361040f9391929183018282801561121a5780601f106111ef5761010080835404028352916020019161121a565b820191906000526020600020905b8154815290600101906020018083116111fd57829003601f168201915b505060038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152955091935091508301828280156112a85780601f1061127d576101008083540402835291602001916112a8565b820191906000526020600020905b81548152906001019060200180831161128b57829003601f168201915b50505050506116f290919063ffffffff16565b60006112fd83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506117e7565b9392505050565b6000828201838110156112fd5760405162461bcd60e51b81526004016104e690612b88565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081811480159061135d57508115155b949350505050565b60405163bc197c8160e01b808252906001600160a01b0386169063bc197c819061139b908a908a90899089908990600401612a01565b602060405180830381600087803b1580156113b557600080fd5b505af11580156113c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506113ed919081019061216b565b6001600160e01b0319161461100b5760405162461bcd60e51b81526004016104e690612be8565b60006001600160a01b03821661143c5760405162461bcd60e51b81526004016104e690612c08565b506001600160a01b03166000908152602091909152604090205460ff1690565b3390565b8051611473906005906020840190611c0a565b5050565b8051611473906003906020840190611c0a565b611509600130896040516020016114a29291906129b2565b60405160208183030381529060405280519060200120888888604051600081526020016040526040516114d89493929190612b09565b6020604051602081039080840390855afa1580156114fa573d6000803e3d6000fd5b50505060206040510351610a7a565b6115255760405162461bcd60e51b81526004016104e690612c78565b610d6d87848484611813565b61154260028263ffffffff611b6116565b6040516001600160a01b038216907f47d1c22a25bb3a5d4e481b9b1e6944c2eade3181a0a20b495ed61d35b5323f2490600090a250565b60405163f23a6e6160e01b808252906001600160a01b0386169063f23a6e61906115af908a908a90899089908990600401612a61565b602060405180830381600087803b1580156115c957600080fd5b505af11580156115dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611601919081019061216b565b6001600160e01b0319161461100b5760405162461bcd60e51b81526004016104e690612c58565b6001600160a01b03811661164e5760405162461bcd60e51b81526004016104e690612b78565b6001546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600180546001600160a01b0319166001600160a01b0392909216919091179055565b6116b48282611414565b6116d05760405162461bcd60e51b81526004016104e690612bb8565b6001600160a01b0316600090815260209190915260409020805460ff19169055565b6060808390506060839050606081518351016040519080825280601f01601f19166020018201604052801561172e576020820181803883390190505b5090506000805b84518110156117865784818151811061174a57fe5b602001015160f81c60f81b83838060010194508151811061176757fe5b60200101906001600160f81b031916908160001a905350600101611735565b5060005b83518110156117db5783818151811061179f57fe5b602001015160f81c60f81b8383806001019450815181106117bc57fe5b60200101906001600160f81b031916908160001a90535060010161178a565b50909695505050505050565b6000818484111561180b5760405162461bcd60e51b81526004016104e69190612b47565b505050900390565b6000848152600860205260409020546001600160a01b0316156118485760405162461bcd60e51b81526004016104e690612c18565b816118655760405162461bcd60e51b81526004016104e690612c28565b60008151116118865760405162461bcd60e51b81526004016104e690612c88565b60008481526008602090815260409182902080546001600160a01b0319163317905584518251818152818302810190920190925260609180156118d3578160200160208202803883390190505b50905060608451604051908082528060200260200182016040528015611903578160200160208202803883390190505b50905060005b8551811015611a765760006001600160a01b031686828151811061192957fe5b6020026020010151600001516001600160a01b0316141561195c5760405162461bcd60e51b81526004016104e690612c48565b85818151811061196857fe5b602002602001015160200151600014156119945760405162461bcd60e51b81526004016104e690612b58565b600087815260096020526040902086518790839081106119b057fe5b602090810291909101810151825460018082018555600094855293839020825160029092020180546001600160a01b0319166001600160a01b039092169190911781559101519101558551869082908110611a0757fe5b602002602001015160000151838281518110611a1f57fe5b60200260200101906001600160a01b031690816001600160a01b031681525050858181518110611a4b57fe5b602002602001015160200151828281518110611a6357fe5b6020908102919091010152600101611909565b50845115611aba577f99aba1d63749cfd5ad1afda7c4663840924d54eb5f005bbbeadedc6ec13674b2868383604051611ab193929190612ca6565b60405180910390a15b60008681526006602090815260408083203384529091529020849055611ae08684611bad565b604051339060009082907fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6290611b19908b908a90612cda565b60405180910390a4857f6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b84604051611b519190612b47565b60405180910390a2505050505050565b611b6b8282611414565b15611b885760405162461bcd60e51b81526004016104e690612b68565b6001600160a01b0316600090815260209190915260409020805460ff19166001179055565b6000828152600860205260409020546001600160a01b0316611be15760405162461bcd60e51b81526004016104e690612b98565b611473828260008281526004602090815260409091208251611c0592840190611c0a565b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611c4b57805160ff1916838001178555611c78565b82800160010185558215611c78579182015b82811115611c78578251825591602001919060010190611c5d565b50611c84929150611c88565b5090565b610a9a91905b80821115611c845760008155600101611c8e565b803561040f81612dff565b60008083601f840112611cbf57600080fd5b5081356001600160401b03811115611cd657600080fd5b602083019150836020820283011115611cee57600080fd5b9250929050565b600082601f830112611d0657600080fd5b8135611d19611d1482612d0e565b612ce8565b91508181835260208401935060208101905083856040840282011115611d3e57600080fd5b60005b83811015611d6c5781611d548882611e32565b84525060209092019160409190910190600101611d41565b5050505092915050565b803561040f81612e13565b803561040f81612e1c565b803561040f81612e25565b805161040f81612e25565b60008083601f840112611db457600080fd5b5081356001600160401b03811115611dcb57600080fd5b602083019150836001820283011115611cee57600080fd5b600082601f830112611df457600080fd5b8135611e02611d1482612d2e565b91508082526020830160208301858383011115611e1e57600080fd5b611e29838284612da2565b50505092915050565b600060408284031215611e4457600080fd5b611e4e6040612ce8565b90506000611e5c8484611ca2565b8252506020611e6d84848301611d81565b60208301525092915050565b803561040f81612e2e565b600060208284031215611e9657600080fd5b600061135d8484611ca2565b60008060408385031215611eb557600080fd5b6000611ec18585611ca2565b9250506020611ed285828601611ca2565b9150509250929050565b60008060008060008060008060a0898b031215611ef857600080fd5b6000611f048b8b611ca2565b9850506020611f158b828c01611ca2565b97505060408901356001600160401b03811115611f3157600080fd5b611f3d8b828c01611cad565b965096505060608901356001600160401b03811115611f5b57600080fd5b611f678b828c01611cad565b945094505060808901356001600160401b03811115611f8557600080fd5b611f918b828c01611da2565b92509250509295985092959890939650565b60008060008060008060a08789031215611fbc57600080fd5b6000611fc88989611ca2565b9650506020611fd989828a01611ca2565b9550506040611fea89828a01611d81565b9450506060611ffb89828a01611d81565b93505060808701356001600160401b0381111561201757600080fd5b61202389828a01611da2565b92509250509295509295509295565b6000806040838503121561204557600080fd5b60006120518585611ca2565b9250506020611ed285828601611d76565b6000806040838503121561207557600080fd5b60006120818585611ca2565b9250506020611ed285828601611d81565b6000806000606084860312156120a757600080fd5b60006120b38686611ca2565b93505060206120c486828701611d81565b92505060406120d586828701611d81565b9150509250925092565b600080600080604085870312156120f557600080fd5b84356001600160401b0381111561210b57600080fd5b61211787828801611cad565b945094505060208501356001600160401b0381111561213557600080fd5b61214187828801611cad565b95989497509550505050565b60006020828403121561215f57600080fd5b600061135d8484611d8c565b60006020828403121561217d57600080fd5b600061135d8484611d97565b60006020828403121561219b57600080fd5b81356001600160401b038111156121b157600080fd5b61135d84828501611de3565b6000602082840312156121cf57600080fd5b600061135d8484611d81565b600080604083850312156121ee57600080fd5b60006120818585611d81565b600080600080600080600060e0888a03121561221557600080fd5b60006122218a8a611d81565b97505060206122328a828b01611e79565b96505060406122438a828b01611d81565b95505060606122548a828b01611d81565b94505060808801356001600160401b0381111561227057600080fd5b61227c8a828b01611cf5565b93505060a061228d8a828b01611d81565b92505060c08801356001600160401b038111156122a957600080fd5b6122b58a828b01611de3565b91505092959891949750929550565b60006122d083836122e4565b505060200190565b60006122d0838361242a565b6122ed81612d68565b82525050565b60006122fe82612d5b565b6123088185612d5f565b935061231383612d55565b8060005b8381101561234157815161232b88826122c4565b975061233683612d55565b925050600101612317565b509495945050505050565b600061235782612d5b565b6123618185612d5f565b935061236c83612d55565b8060005b8381101561234157815161238488826122c4565b975061238f83612d55565b925050600101612370565b60006123a68385612d5f565b93506001600160fb1b038311156123bc57600080fd5b6020830292506123cd838584612da2565b50500190565b60006123de82612d5b565b6123e88185612d5f565b93506123f383612d55565b8060005b8381101561234157815161240b88826122d8565b975061241683612d55565b9250506001016123f7565b6122ed81612d73565b6122ed81610a9a565b600061243e82612d5b565b6124488185612d5f565b9350612458818560208601612dae565b61246181612def565b9093019392505050565b6122ed61247782612d97565b612dde565b6000612489601c83612d5f565b7f4665652076616c75652073686f756c6420626520706f73697469766500000000815260200192915050565b60006124c2601f83612d5f565b7f526f6c65733a206163636f756e7420616c72656164792068617320726f6c6500815260200192915050565b60006124fb602683612d5f565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206181526564647265737360d01b602082015260400192915050565b6000612543601b83612d5f565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000815260200192915050565b600061257c602083612d5f565b7f5f736574546f6b656e5552493a20546f6b656e2073686f756c64206578697374815260200192915050565b60006125b5602583612d5f565b7f64657374696e6174696f6e2061646472657373206d757374206265206e6f6e2d8152643d32b9379760d91b602082015260400192915050565b60006125fc602183612d5f565b7f526f6c65733a206163636f756e7420646f6573206e6f74206861766520726f6c8152606560f81b602082015260400192915050565b600061263f602b83612d5f565b7f4e656564206f70657261746f7220617070726f76616c20666f7220337264207081526a30b93a3c90313ab937399760a91b602082015260400192915050565b600061268c602f83612d5f565b7f4e656564206f70657261746f7220617070726f76616c20666f7220337264207081526e30b93a3c903a3930b739b332b9399760891b602082015260400192915050565b60006126dd603e83612d5f565b7f636f6e74726163742072657475726e656420616e20756e6b6e6f776e2076616c81527f75652066726f6d206f6e45524331313535426174636852656365697665640000602082015260400192915050565b600061273c602083612d5f565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572815260200192915050565b6000612775602283612d5f565b7f526f6c65733a206163636f756e7420697320746865207a65726f206164647265815261737360f01b602082015260400192915050565b60006127b9601783612d5f565b7f546f6b656e20697320616c7265616479206d696e746564000000000000000000815260200192915050565b60006127f2601983612d5f565b7f537570706c792073686f756c6420626520706f73697469766500000000000000815260200192915050565b600061282b602983612d5f565b7f5f69647320616e64205f76616c756573206172726179206c656e676874206d7581526839ba1036b0ba31b41760b91b602082015260400192915050565b6000612876601b83612d5f565b7f526563697069656e742073686f756c642062652070726573656e740000000000815260200192915050565b60006128af603983612d5f565b7f636f6e74726163742072657475726e656420616e20756e6b6e6f776e2076616c81527f75652066726f6d206f6e45524331313535526563656976656400000000000000602082015260400192915050565b600061290e601583612d5f565b742fba379036bab9ba103132903737b716bd32b9379760591b815260200192915050565b600061293f601a83612d5f565b7f7369676e65722073686f756c64207369676e20746f6b656e4964000000000000815260200192915050565b6000612978601183612d5f565b701d5c9a481cda1bdd5b19081899481cd95d607a1b815260200192915050565b6122ed6129a482610a9a565b610a9a565b6122ed81612d91565b60006129be828561246b565b6014820191506129ce8284612998565b5060200192915050565b6020810161040f82846122e4565b604081016129f482856122e4565b6112fd602083018461242a565b60a08101612a0f82886122e4565b612a1c60208301876122e4565b8181036040830152612a2e81866123d3565b90508181036060830152612a4281856123d3565b90508181036080830152612a568184612433565b979650505050505050565b60a08101612a6f82886122e4565b612a7c60208301876122e4565b612a89604083018661242a565b612a96606083018561242a565b8181036080830152612a568184612433565b602080825281016112fd818461234c565b60408082528101612acb81868861239a565b90508181036020830152612ae081848661239a565b9695505050505050565b602080825281016112fd81846123d3565b6020810161040f8284612421565b60808101612b17828761242a565b612b2460208301866129a9565b612b31604083018561242a565b612b3e606083018461242a565b95945050505050565b602080825281016112fd8184612433565b6020808252810161040f8161247c565b6020808252810161040f816124b5565b6020808252810161040f816124ee565b6020808252810161040f81612536565b6020808252810161040f8161256f565b6020808252810161040f816125a8565b6020808252810161040f816125ef565b6020808252810161040f81612632565b6020808252810161040f8161267f565b6020808252810161040f816126d0565b6020808252810161040f8161272f565b6020808252810161040f81612768565b6020808252810161040f816127ac565b6020808252810161040f816127e5565b6020808252810161040f8161281e565b6020808252810161040f81612869565b6020808252810161040f816128a2565b6020808252810161040f81612901565b6020808252810161040f81612932565b6020808252810161040f8161296b565b6020810161040f828461242a565b60608101612cb4828661242a565b8181036020830152612cc681856122f3565b90508181036040830152612b3e81846123d3565b604081016129f4828561242a565b6040518181016001600160401b0381118282101715612d0657600080fd5b604052919050565b60006001600160401b03821115612d2457600080fd5b5060209081020190565b60006001600160401b03821115612d4457600080fd5b506020601f91909101601f19160190565b60200190565b5190565b90815260200190565b600061040f82612d85565b151590565b6001600160e01b03191690565b6001600160a01b031690565b60ff1690565b600061040f82612d68565b82818337506000910152565b60005b83811015612dc9578181015183820152602001612db1565b83811115612dd8576000848401525b50505050565b600061040f82600061040f82612df9565b601f01601f191690565b60601b90565b612e0881612d68565b81146104f857600080fd5b612e0881612d73565b612e0881610a9a565b612e0881612d78565b612e0881612d9156fea365627a7a7231582031ea53b58e372cf641e58dde79c6747401bdb4938ba30fafef4cb00bdbe9b8f06c6578706572696d656e74616cf564736f6c6343000510004000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000155377696e676b6965204e465420556e697665727365000000000000000000000000000000000000000000000000000000000000000000000000000000000000055357494e47000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002e516d614178743846417a6e5470484d58386b45484d626b313234783745486479453177395a5a74534e626a6638770000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007697066733a2f2f00000000000000000000000000000000000000000000000000
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101c35760003560e01c806395d89b41116100f9578063e5c8b03d11610097578063eb12d61e11610071578063eb12d61e1461039f578063f242432a146103b2578063f2fde38b146103c5578063f5298aca146103d8576101c3565b8063e5c8b03d1461037c578063e8a3d48514610384578063e985e9c51461038c576101c3565b8063b9c4d9fb116100d3578063b9c4d9fb1461032e578063c0ac99831461034e578063c6bf326214610356578063cd53d08e14610369576101c3565b806395d89b411461030057806399e0dd7c14610308578063a22cb4651461031b576101c3565b80634e1273f4116101665780637df73e27116101405780637df73e27146102bd5780638da5cb5b146102d05780638f32d59b146102e5578063938e3d7b146102ed576101c3565b80634e1273f4146102815780636308f1cd14610294578063715018a6146102b5576101c3565b80630e316ab7116101a25780630e316ab7146102265780630e89341c1461023b5780630ebd4c7f1461024e5780632eb2c2d61461026e576101c3565b8062fdd58e146101c857806301ffc9a7146101f157806306fdde0314610211575b600080fd5b6101db6101d6366004612062565b6103eb565b6040516101e89190612c98565b60405180910390f35b6102046101ff36600461214d565b610415565b6040516101e89190612afb565b610219610434565b6040516101e89190612b47565b610239610234366004611e84565b6104c2565b005b6102196102493660046121bd565b6104fb565b61026161025c3660046121bd565b610506565b6040516101e89190612aea565b61023961027c366004611edc565b6105f9565b61026161028f3660046120df565b6108ef565b6102a76102a23660046121db565b6109c9565b6040516101e89291906129e6565b610239610a0c565b6102046102cb366004611e84565b610a7a565b6102d8610a8d565b6040516101e891906129d8565b610204610a9d565b6102396102fb366004612189565b610ac3565b610219610af0565b610239610316366004612189565b610b4b565b610239610329366004612032565b610b78565b61034161033c3660046121bd565b610be7565b6040516101e89190612aa8565b610219610cdf565b6102396103643660046121fa565b610d3a565b6102d86103773660046121bd565b610d76565b610239610d91565b610219610da3565b61020461039a366004611ea2565b610dfe565b6102396103ad366004611e84565b610e2c565b6102396103c0366004611fa3565b610e59565b6102396103d3366004611e84565b611013565b6102396103e6366004612092565b611040565b60008181526006602090815260408083206001600160a01b03861684529091529020545b92915050565b6001600160e01b03191660009081526020819052604090205460ff1690565b600a805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104ba5780601f1061048f576101008083540402835291602001916104ba565b820191906000526020600020905b81548152906001019060200180831161049d57829003601f168201915b505050505081565b6104ca610a9d565b6104ef5760405162461bcd60e51b81526004016104e690612bf8565b60405180910390fd5b6104f881611138565b50565b606061040f82611180565b60008181526009602090815260408083208054825181850281018501909352808352606094859484015b82821015610578576000848152602090819020604080518082019091526002850290910180546001600160a01b03168252600190810154828401529083529092019101610530565b505050509050606081516040519080825280602002602001820160405280156105ab578160200160208202803883390190505b50905060005b82518110156105f1578281815181106105c657fe5b6020026020010151602001518282815181106105de57fe5b60209081029190910101526001016105b1565b509392505050565b6001600160a01b03871661061f5760405162461bcd60e51b81526004016104e690612ba8565b84831461063e5760405162461bcd60e51b81526004016104e690612c38565b6001600160a01b03881633148061067d57506001600160a01b038816600090815260076020908152604080832033845290915290205460ff1615156001145b6106995760405162461bcd60e51b81526004016104e690612bd8565b60005b858110156107ce5760008787838181106106b257fe5b90506020020135905060008686848181106106c957fe5b90506020020135905061071b816006600085815260200190815260200160002060008e6001600160a01b03166001600160a01b03168152602001908152602001600020546112bb90919063ffffffff16565b6006600084815260200190815260200160002060008d6001600160a01b03166001600160a01b031681526020019081526020016000208190555061079e6006600084815260200190815260200160002060008c6001600160a01b03166001600160a01b03168152602001908152602001600020548261130490919063ffffffff16565b60009283526006602090815260408085206001600160a01b038e168652909152909220919091555060010161069c565b50866001600160a01b0316886001600160a01b0316336001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb898989896040516108229493929190612ab9565b60405180910390a461083c876001600160a01b0316611329565b156108e5576108e533898989898080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808d0282810182019093528c82529093508c92508b91829185019084908082843760009201919091525050604080516020601f8c018190048102820181019092528a815292508a915089908190840183828082843760009201919091525061136592505050565b5050505050505050565b60608382146108fd57600080fd5b604080518581526020808702820101909152606090858015610929578160200160208202803883390190505b50905060005b858110156109bf576006600086868481811061094757fe5b905060200201358152602001908152602001600020600088888481811061096a57fe5b905060200201602061097f9190810190611e84565b6001600160a01b03166001600160a01b03168152602001908152602001600020548282815181106109ac57fe5b602090810291909101015260010161092f565b5095945050505050565b600960205281600052604060002081815481106109e257fe5b6000918252602090912060029091020180546001909101546001600160a01b039091169250905082565b610a14610a9d565b610a305760405162461bcd60e51b81526004016104e690612bf8565b6001546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600180546001600160a01b0319169055565b600061040f60028363ffffffff61141416565b6001546001600160a01b03165b90565b6001546000906001600160a01b0316610ab461145c565b6001600160a01b031614905090565b610acb610a9d565b610ae75760405162461bcd60e51b81526004016104e690612bf8565b6104f881611460565b600b805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104ba5780601f1061048f576101008083540402835291602001916104ba565b610b53610a9d565b610b6f5760405162461bcd60e51b81526004016104e690612bf8565b6104f881611477565b3360008181526007602090815260408083206001600160a01b038716808552925291829020805460ff191685151517905590519091907f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3190610bdb908590612afb565b60405180910390a35050565b60008181526009602090815260408083208054825181850281018501909352808352606094859484015b82821015610c59576000848152602090819020604080518082019091526002850290910180546001600160a01b03168252600190810154828401529083529092019101610c11565b50505050905060608151604051908082528060200260200182016040528015610c8c578160200160208202803883390190505b50905060005b82518110156105f157828181518110610ca757fe5b602002602001015160000151828281518110610cbf57fe5b6001600160a01b0390921660209283029190910190910152600101610c92565b6003805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104ba5780601f1061048f576101008083540402835291602001916104ba565b610d42610a9d565b610d5e5760405162461bcd60e51b81526004016104e690612bf8565b610d6d8787878787878761148a565b50505050505050565b6008602052600090815260409020546001600160a01b031681565b610da1610d9c61145c565b611138565b565b6005805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104ba5780601f1061048f576101008083540402835291602001916104ba565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b610e34610a9d565b610e505760405162461bcd60e51b81526004016104e690612bf8565b6104f881611531565b6001600160a01b038516610e7f5760405162461bcd60e51b81526004016104e690612c68565b6001600160a01b038616331480610ebe57506001600160a01b038616600090815260076020908152604080832033845290915290205460ff1615156001145b610eda5760405162461bcd60e51b81526004016104e690612bd8565b60008481526006602090815260408083206001600160a01b038a168452909152902054610f0d908463ffffffff6112bb16565b60008581526006602090815260408083206001600160a01b038b81168552925280832093909355871681522054610f45908490611304565b60008581526006602090815260408083206001600160a01b03808b168086529190935292819020939093559151909188169033907fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6290610fa89089908990612cda565b60405180910390a4610fc2856001600160a01b0316611329565b1561100b5761100b338787878787878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061157992505050565b505050505050565b61101b610a9d565b6110375760405162461bcd60e51b81526004016104e690612bf8565b6104f881611628565b6001600160a01b03831633148061107f57506001600160a01b038316600090815260076020908152604080832033845290915290205460ff1615156001145b61109b5760405162461bcd60e51b81526004016104e690612bc8565b60008281526006602090815260408083206001600160a01b03871684529091529020546110ce908263ffffffff6112bb16565b60008381526006602090815260408083206001600160a01b038816808552925280832093909355915190919033907fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f629061112b9087908790612cda565b60405180910390a4505050565b61114960028263ffffffff6116aa16565b6040516001600160a01b038216907f3525e22824a8a7df2c9a6029941c824cf95b6447f1e13d5128fd3826d35afe8b90600090a250565b6000818152600460209081526040918290208054835160026001831615610100026000190190921691909104601f810184900484028201840190945283815260609361040f9391929183018282801561121a5780601f106111ef5761010080835404028352916020019161121a565b820191906000526020600020905b8154815290600101906020018083116111fd57829003601f168201915b505060038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152955091935091508301828280156112a85780601f1061127d576101008083540402835291602001916112a8565b820191906000526020600020905b81548152906001019060200180831161128b57829003601f168201915b50505050506116f290919063ffffffff16565b60006112fd83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506117e7565b9392505050565b6000828201838110156112fd5760405162461bcd60e51b81526004016104e690612b88565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081811480159061135d57508115155b949350505050565b60405163bc197c8160e01b808252906001600160a01b0386169063bc197c819061139b908a908a90899089908990600401612a01565b602060405180830381600087803b1580156113b557600080fd5b505af11580156113c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506113ed919081019061216b565b6001600160e01b0319161461100b5760405162461bcd60e51b81526004016104e690612be8565b60006001600160a01b03821661143c5760405162461bcd60e51b81526004016104e690612c08565b506001600160a01b03166000908152602091909152604090205460ff1690565b3390565b8051611473906005906020840190611c0a565b5050565b8051611473906003906020840190611c0a565b611509600130896040516020016114a29291906129b2565b60405160208183030381529060405280519060200120888888604051600081526020016040526040516114d89493929190612b09565b6020604051602081039080840390855afa1580156114fa573d6000803e3d6000fd5b50505060206040510351610a7a565b6115255760405162461bcd60e51b81526004016104e690612c78565b610d6d87848484611813565b61154260028263ffffffff611b6116565b6040516001600160a01b038216907f47d1c22a25bb3a5d4e481b9b1e6944c2eade3181a0a20b495ed61d35b5323f2490600090a250565b60405163f23a6e6160e01b808252906001600160a01b0386169063f23a6e61906115af908a908a90899089908990600401612a61565b602060405180830381600087803b1580156115c957600080fd5b505af11580156115dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611601919081019061216b565b6001600160e01b0319161461100b5760405162461bcd60e51b81526004016104e690612c58565b6001600160a01b03811661164e5760405162461bcd60e51b81526004016104e690612b78565b6001546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600180546001600160a01b0319166001600160a01b0392909216919091179055565b6116b48282611414565b6116d05760405162461bcd60e51b81526004016104e690612bb8565b6001600160a01b0316600090815260209190915260409020805460ff19169055565b6060808390506060839050606081518351016040519080825280601f01601f19166020018201604052801561172e576020820181803883390190505b5090506000805b84518110156117865784818151811061174a57fe5b602001015160f81c60f81b83838060010194508151811061176757fe5b60200101906001600160f81b031916908160001a905350600101611735565b5060005b83518110156117db5783818151811061179f57fe5b602001015160f81c60f81b8383806001019450815181106117bc57fe5b60200101906001600160f81b031916908160001a90535060010161178a565b50909695505050505050565b6000818484111561180b5760405162461bcd60e51b81526004016104e69190612b47565b505050900390565b6000848152600860205260409020546001600160a01b0316156118485760405162461bcd60e51b81526004016104e690612c18565b816118655760405162461bcd60e51b81526004016104e690612c28565b60008151116118865760405162461bcd60e51b81526004016104e690612c88565b60008481526008602090815260409182902080546001600160a01b0319163317905584518251818152818302810190920190925260609180156118d3578160200160208202803883390190505b50905060608451604051908082528060200260200182016040528015611903578160200160208202803883390190505b50905060005b8551811015611a765760006001600160a01b031686828151811061192957fe5b6020026020010151600001516001600160a01b0316141561195c5760405162461bcd60e51b81526004016104e690612c48565b85818151811061196857fe5b602002602001015160200151600014156119945760405162461bcd60e51b81526004016104e690612b58565b600087815260096020526040902086518790839081106119b057fe5b602090810291909101810151825460018082018555600094855293839020825160029092020180546001600160a01b0319166001600160a01b039092169190911781559101519101558551869082908110611a0757fe5b602002602001015160000151838281518110611a1f57fe5b60200260200101906001600160a01b031690816001600160a01b031681525050858181518110611a4b57fe5b602002602001015160200151828281518110611a6357fe5b6020908102919091010152600101611909565b50845115611aba577f99aba1d63749cfd5ad1afda7c4663840924d54eb5f005bbbeadedc6ec13674b2868383604051611ab193929190612ca6565b60405180910390a15b60008681526006602090815260408083203384529091529020849055611ae08684611bad565b604051339060009082907fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6290611b19908b908a90612cda565b60405180910390a4857f6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b84604051611b519190612b47565b60405180910390a2505050505050565b611b6b8282611414565b15611b885760405162461bcd60e51b81526004016104e690612b68565b6001600160a01b0316600090815260209190915260409020805460ff19166001179055565b6000828152600860205260409020546001600160a01b0316611be15760405162461bcd60e51b81526004016104e690612b98565b611473828260008281526004602090815260409091208251611c0592840190611c0a565b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611c4b57805160ff1916838001178555611c78565b82800160010185558215611c78579182015b82811115611c78578251825591602001919060010190611c5d565b50611c84929150611c88565b5090565b610a9a91905b80821115611c845760008155600101611c8e565b803561040f81612dff565b60008083601f840112611cbf57600080fd5b5081356001600160401b03811115611cd657600080fd5b602083019150836020820283011115611cee57600080fd5b9250929050565b600082601f830112611d0657600080fd5b8135611d19611d1482612d0e565b612ce8565b91508181835260208401935060208101905083856040840282011115611d3e57600080fd5b60005b83811015611d6c5781611d548882611e32565b84525060209092019160409190910190600101611d41565b5050505092915050565b803561040f81612e13565b803561040f81612e1c565b803561040f81612e25565b805161040f81612e25565b60008083601f840112611db457600080fd5b5081356001600160401b03811115611dcb57600080fd5b602083019150836001820283011115611cee57600080fd5b600082601f830112611df457600080fd5b8135611e02611d1482612d2e565b91508082526020830160208301858383011115611e1e57600080fd5b611e29838284612da2565b50505092915050565b600060408284031215611e4457600080fd5b611e4e6040612ce8565b90506000611e5c8484611ca2565b8252506020611e6d84848301611d81565b60208301525092915050565b803561040f81612e2e565b600060208284031215611e9657600080fd5b600061135d8484611ca2565b60008060408385031215611eb557600080fd5b6000611ec18585611ca2565b9250506020611ed285828601611ca2565b9150509250929050565b60008060008060008060008060a0898b031215611ef857600080fd5b6000611f048b8b611ca2565b9850506020611f158b828c01611ca2565b97505060408901356001600160401b03811115611f3157600080fd5b611f3d8b828c01611cad565b965096505060608901356001600160401b03811115611f5b57600080fd5b611f678b828c01611cad565b945094505060808901356001600160401b03811115611f8557600080fd5b611f918b828c01611da2565b92509250509295985092959890939650565b60008060008060008060a08789031215611fbc57600080fd5b6000611fc88989611ca2565b9650506020611fd989828a01611ca2565b9550506040611fea89828a01611d81565b9450506060611ffb89828a01611d81565b93505060808701356001600160401b0381111561201757600080fd5b61202389828a01611da2565b92509250509295509295509295565b6000806040838503121561204557600080fd5b60006120518585611ca2565b9250506020611ed285828601611d76565b6000806040838503121561207557600080fd5b60006120818585611ca2565b9250506020611ed285828601611d81565b6000806000606084860312156120a757600080fd5b60006120b38686611ca2565b93505060206120c486828701611d81565b92505060406120d586828701611d81565b9150509250925092565b600080600080604085870312156120f557600080fd5b84356001600160401b0381111561210b57600080fd5b61211787828801611cad565b945094505060208501356001600160401b0381111561213557600080fd5b61214187828801611cad565b95989497509550505050565b60006020828403121561215f57600080fd5b600061135d8484611d8c565b60006020828403121561217d57600080fd5b600061135d8484611d97565b60006020828403121561219b57600080fd5b81356001600160401b038111156121b157600080fd5b61135d84828501611de3565b6000602082840312156121cf57600080fd5b600061135d8484611d81565b600080604083850312156121ee57600080fd5b60006120818585611d81565b600080600080600080600060e0888a03121561221557600080fd5b60006122218a8a611d81565b97505060206122328a828b01611e79565b96505060406122438a828b01611d81565b95505060606122548a828b01611d81565b94505060808801356001600160401b0381111561227057600080fd5b61227c8a828b01611cf5565b93505060a061228d8a828b01611d81565b92505060c08801356001600160401b038111156122a957600080fd5b6122b58a828b01611de3565b91505092959891949750929550565b60006122d083836122e4565b505060200190565b60006122d0838361242a565b6122ed81612d68565b82525050565b60006122fe82612d5b565b6123088185612d5f565b935061231383612d55565b8060005b8381101561234157815161232b88826122c4565b975061233683612d55565b925050600101612317565b509495945050505050565b600061235782612d5b565b6123618185612d5f565b935061236c83612d55565b8060005b8381101561234157815161238488826122c4565b975061238f83612d55565b925050600101612370565b60006123a68385612d5f565b93506001600160fb1b038311156123bc57600080fd5b6020830292506123cd838584612da2565b50500190565b60006123de82612d5b565b6123e88185612d5f565b93506123f383612d55565b8060005b8381101561234157815161240b88826122d8565b975061241683612d55565b9250506001016123f7565b6122ed81612d73565b6122ed81610a9a565b600061243e82612d5b565b6124488185612d5f565b9350612458818560208601612dae565b61246181612def565b9093019392505050565b6122ed61247782612d97565b612dde565b6000612489601c83612d5f565b7f4665652076616c75652073686f756c6420626520706f73697469766500000000815260200192915050565b60006124c2601f83612d5f565b7f526f6c65733a206163636f756e7420616c72656164792068617320726f6c6500815260200192915050565b60006124fb602683612d5f565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206181526564647265737360d01b602082015260400192915050565b6000612543601b83612d5f565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000815260200192915050565b600061257c602083612d5f565b7f5f736574546f6b656e5552493a20546f6b656e2073686f756c64206578697374815260200192915050565b60006125b5602583612d5f565b7f64657374696e6174696f6e2061646472657373206d757374206265206e6f6e2d8152643d32b9379760d91b602082015260400192915050565b60006125fc602183612d5f565b7f526f6c65733a206163636f756e7420646f6573206e6f74206861766520726f6c8152606560f81b602082015260400192915050565b600061263f602b83612d5f565b7f4e656564206f70657261746f7220617070726f76616c20666f7220337264207081526a30b93a3c90313ab937399760a91b602082015260400192915050565b600061268c602f83612d5f565b7f4e656564206f70657261746f7220617070726f76616c20666f7220337264207081526e30b93a3c903a3930b739b332b9399760891b602082015260400192915050565b60006126dd603e83612d5f565b7f636f6e74726163742072657475726e656420616e20756e6b6e6f776e2076616c81527f75652066726f6d206f6e45524331313535426174636852656365697665640000602082015260400192915050565b600061273c602083612d5f565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572815260200192915050565b6000612775602283612d5f565b7f526f6c65733a206163636f756e7420697320746865207a65726f206164647265815261737360f01b602082015260400192915050565b60006127b9601783612d5f565b7f546f6b656e20697320616c7265616479206d696e746564000000000000000000815260200192915050565b60006127f2601983612d5f565b7f537570706c792073686f756c6420626520706f73697469766500000000000000815260200192915050565b600061282b602983612d5f565b7f5f69647320616e64205f76616c756573206172726179206c656e676874206d7581526839ba1036b0ba31b41760b91b602082015260400192915050565b6000612876601b83612d5f565b7f526563697069656e742073686f756c642062652070726573656e740000000000815260200192915050565b60006128af603983612d5f565b7f636f6e74726163742072657475726e656420616e20756e6b6e6f776e2076616c81527f75652066726f6d206f6e45524331313535526563656976656400000000000000602082015260400192915050565b600061290e601583612d5f565b742fba379036bab9ba103132903737b716bd32b9379760591b815260200192915050565b600061293f601a83612d5f565b7f7369676e65722073686f756c64207369676e20746f6b656e4964000000000000815260200192915050565b6000612978601183612d5f565b701d5c9a481cda1bdd5b19081899481cd95d607a1b815260200192915050565b6122ed6129a482610a9a565b610a9a565b6122ed81612d91565b60006129be828561246b565b6014820191506129ce8284612998565b5060200192915050565b6020810161040f82846122e4565b604081016129f482856122e4565b6112fd602083018461242a565b60a08101612a0f82886122e4565b612a1c60208301876122e4565b8181036040830152612a2e81866123d3565b90508181036060830152612a4281856123d3565b90508181036080830152612a568184612433565b979650505050505050565b60a08101612a6f82886122e4565b612a7c60208301876122e4565b612a89604083018661242a565b612a96606083018561242a565b8181036080830152612a568184612433565b602080825281016112fd818461234c565b60408082528101612acb81868861239a565b90508181036020830152612ae081848661239a565b9695505050505050565b602080825281016112fd81846123d3565b6020810161040f8284612421565b60808101612b17828761242a565b612b2460208301866129a9565b612b31604083018561242a565b612b3e606083018461242a565b95945050505050565b602080825281016112fd8184612433565b6020808252810161040f8161247c565b6020808252810161040f816124b5565b6020808252810161040f816124ee565b6020808252810161040f81612536565b6020808252810161040f8161256f565b6020808252810161040f816125a8565b6020808252810161040f816125ef565b6020808252810161040f81612632565b6020808252810161040f8161267f565b6020808252810161040f816126d0565b6020808252810161040f8161272f565b6020808252810161040f81612768565b6020808252810161040f816127ac565b6020808252810161040f816127e5565b6020808252810161040f8161281e565b6020808252810161040f81612869565b6020808252810161040f816128a2565b6020808252810161040f81612901565b6020808252810161040f81612932565b6020808252810161040f8161296b565b6020810161040f828461242a565b60608101612cb4828661242a565b8181036020830152612cc681856122f3565b90508181036040830152612b3e81846123d3565b604081016129f4828561242a565b6040518181016001600160401b0381118282101715612d0657600080fd5b604052919050565b60006001600160401b03821115612d2457600080fd5b5060209081020190565b60006001600160401b03821115612d4457600080fd5b506020601f91909101601f19160190565b60200190565b5190565b90815260200190565b600061040f82612d85565b151590565b6001600160e01b03191690565b6001600160a01b031690565b60ff1690565b600061040f82612d68565b82818337506000910152565b60005b83811015612dc9578181015183820152602001612db1565b83811115612dd8576000848401525b50505050565b600061040f82600061040f82612df9565b601f01601f191690565b60601b90565b612e0881612d68565b81146104f857600080fd5b612e0881612d73565b612e0881610a9a565b612e0881612d78565b612e0881612d9156fea365627a7a7231582031ea53b58e372cf641e58dde79c6747401bdb4938ba30fafef4cb00bdbe9b8f06c6578706572696d656e74616cf564736f6c63430005100040
Deployed Bytecode Sourcemap
3403:2419:11:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3403:2419:11;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;18409:369:1;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;1619:133:3;;;;;;;;;:::i;:::-;;;;;;;;268:18:11;;;:::i;:::-;;;;;;;;1796:95;;;;;;;;;:::i;:::-;;11344:102:1;;;;;;;;;:::i;24070:293::-;;;;;;;;;:::i;:::-;;;;;;;;16397:1768;;;;;;;;;:::i;19077:394::-;;;;;;;;;:::i;23177:38::-;;;;;;;;;:::i;:::-;;;;;;;;;3704:137:12;;;:::i;5044:107::-;;;;;;;;;:::i;2919:77::-;;;:::i;:::-;;;;;;;;3270:92;;;:::i;26805:113:1:-;;;;;;;;;:::i;323:20:11:-;;;:::i;26619:125:1:-;;;;;;;;;:::i;19825:202::-;;;;;;;;;:::i;23556:337::-;;;;;;;;;:::i;:::-;;;;;;;;134:28:7;;;:::i;5633:187:11:-;;;;;;;;;:::i;23100:44:1:-;;;;;;;;;:::i;5452:77:12:-;;;:::i;2381:25:3:-;;;:::i;20306:149:1:-;;;;;;;;;:::i;1530:89:11:-;;;;;;;;;:::i;13840:927:1:-;;;;;;;;;:::i;3990:107:12:-;;;;;;;;;:::i;25621:497:1:-;;;;;;;;;:::i;18409:369::-;18480:7;18750:13;;;:8;:13;;;;;;;;-1:-1:-1;;;;;18750:21:1;;;;;;;;;;18409:369;;;;;:::o;1619:133:3:-;-1:-1:-1;;;;;;1712:33:3;1689:4;1712:33;;;;;;;;;;;;;;1619:133::o;268:18:11:-;;;;;;;;;;;;;;;-1:-1:-1;;268:18:11;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;1796:95::-;3123:9:12;:7;:9::i;:::-;3115:54;;;;-1:-1:-1;;;3115:54:12;;;;;;;;;;;;;;;;;1862:22:11;1876:7;1862:13;:22::i;:::-;1796:95;:::o;11344:102:1:-;11393:13;11425:14;11435:3;11425:9;:14::i;24070:293::-;24168:8;;;;:4;:8;;;;;;;;24147:29;;;;;;;;;;;;;;;;;24122:13;;;;24147:29;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;24147:29:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;24186:20;24220:5;:12;24209:24;;;;;;;;;;;;;;;;;;;;;;29:2:-1;21:6;17:15;117:4;105:10;97:6;88:34;136:17;;-1:-1;24209:24:1;-1:-1:-1;24186:47:1;-1:-1:-1;24248:6:1;24243:91;24264:5;:12;24260:1;:16;24243:91;;;24309:5;24315:1;24309:8;;;;;;;;;;;;;;:14;;;24297:6;24304:1;24297:9;;;;;;;;;;;;;;;;;:26;24278:3;;24243:91;;;-1:-1:-1;24350:6:1;24070:293;-1:-1:-1;;;24070:293:1:o;16397:1768::-;-1:-1:-1;;;;;16591:19:1;;16583:69;;;;-1:-1:-1;;;16583:69:1;;;;;;;;;16670:29;;;16662:83;;;;-1:-1:-1;;;16662:83:1;;;;;;;;;-1:-1:-1;;;;;16763:19:1;;16772:10;16763:19;;:66;;-1:-1:-1;;;;;;16786:23:1;;;;;;:16;:23;;;;;;;;16810:10;16786:35;;;;;;;;;;:43;;:35;:43;16763:66;16755:126;;;;-1:-1:-1;;;16755:126:1;;;;;;;;;16897:9;16892:380;16912:15;;;16892:380;;;16948:10;16961:4;;16966:1;16961:7;;;;;;;;;;;;;16948:20;;16982:13;16998:7;;17006:1;16998:10;;;;;;;;;;;;;16982:26;;17167:30;17191:5;17167:8;:12;17176:2;17167:12;;;;;;;;;;;:19;17180:5;-1:-1:-1;;;;;17167:19:1;-1:-1:-1;;;;;17167:19:1;;;;;;;;;;;;;:23;;:30;;;;:::i;:::-;17145:8;:12;17154:2;17145:12;;;;;;;;;;;:19;17158:5;-1:-1:-1;;;;;17145:19:1;-1:-1:-1;;;;;17145:19:1;;;;;;;;;;;;:52;;;;17233:28;17243:8;:12;17252:2;17243:12;;;;;;;;;;;:17;17256:3;-1:-1:-1;;;;;17243:17:1;-1:-1:-1;;;;;17243:17:1;;;;;;;;;;;;;17233:5;:9;;:28;;;;:::i;:::-;17211:12;;;;:8;:12;;;;;;;;-1:-1:-1;;;;;17211:17:1;;;;;;;;;;:50;;;;-1:-1:-1;16929:3:1;;16892:380;;;;17855:3;-1:-1:-1;;;;;17822:52:1;17848:5;-1:-1:-1;;;;;17822:52:1;17836:10;-1:-1:-1;;;;;17822:52:1;;17860:4;;17866:7;;17822:52;;;;;;;;;;;;;;;;;;18035:16;:3;-1:-1:-1;;;;;18035:14:1;;:16::i;:::-;18031:128;;;18067:81;18103:10;18115:5;18122:3;18127:4;;18067:81;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;;18067:81:1;;;;;;;;;;;;;;;;;;;;-1:-1:-1;18133:7:1;;-1:-1:-1;18133:7:1;;;;18067:81;;;18133:7;;18067:81;18133:7;18067:81;1:33:-1;99:1;81:16;;74:27;;;;-1:-1;;18067:81:1;;;;137:4:-1;18067:81:1;;;;;;;;;;;;;;;;;;-1:-1:-1;18142:5:1;;-1:-1:-1;18142:5:1;;;;18067:81;;18142:5;;;;18067:81;1:33:-1;99:1;81:16;;74:27;;;;-1:-1;18067:35:1;;-1:-1:-1;;;18067:81:1:i;:::-;16397:1768;;;;;;;;:::o;19077:394::-;19177:16;19214:29;;;19206:38;;;;;;19284:29;;;;;;;;;;;;;;;;19255:26;;19298:7;19284:29;;;;;;;29:2:-1;21:6;17:15;117:4;105:10;97:6;88:34;136:17;;-1:-1;19284:29:1;-1:-1:-1;19255:58:1;-1:-1:-1;19329:9:1;19324:114;19344:18;;;19324:114;;;19398:8;:17;19407:4;;19412:1;19407:7;;;;;;;;;;;;;19398:17;;;;;;;;;;;:29;19416:7;;19424:1;19416:10;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;19398:29:1;-1:-1:-1;;;;;19398:29:1;;;;;;;;;;;;;19383:9;19393:1;19383:12;;;;;;;;;;;;;;;;;:44;19364:3;;19324:114;;;-1:-1:-1;19455:9:1;19077:394;-1:-1:-1;;;;;19077:394:1:o;23177:38::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;23177:38:1;;;;-1:-1:-1;23177:38:1;-1:-1:-1;23177:38:1;:::o;3704:137:12:-;3123:9;:7;:9::i;:::-;3115:54;;;;-1:-1:-1;;;3115:54:12;;;;;;;;;3786:6;;3765:40;;3802:1;;-1:-1:-1;;;;;3786:6:12;;3765:40;;3802:1;;3765:40;3815:6;:19;;-1:-1:-1;;;;;;3815:19:12;;;3704:137::o;5044:107::-;5100:4;5123:21;:8;5136:7;5123:21;:12;:21;:::i;2919:77::-;2983:6;;-1:-1:-1;;;;;2983:6:12;2919:77;;:::o;3270:92::-;3349:6;;3310:4;;-1:-1:-1;;;;;3349:6:12;3333:12;:10;:12::i;:::-;-1:-1:-1;;;;;3333:22:12;;3326:29;;3270:92;:::o;26805:113:1:-;3123:9:12;:7;:9::i;:::-;3115:54;;;;-1:-1:-1;;;3115:54:12;;;;;;;;;26883:28:1;26899:11;26883:15;:28::i;323:20:11:-;;;;;;;;;;;;;;;-1:-1:-1;;323:20:11;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;26619:125:1;3123:9:12;:7;:9::i;:::-;3115:54;;;;-1:-1:-1;;;3115:54:12;;;;;;;;;26703:34:1;26722:14;26703:18;:34::i;19825:202::-;19923:10;19906:28;;;;:16;:28;;;;;;;;-1:-1:-1;;;;;19906:39:1;;;;;;;;;;;:51;;-1:-1:-1;;19906:51:1;;;;;;;19972:48;;19906:39;;19923:10;19972:48;;;;19906:51;;19972:48;;;;;;;;;;19825:202;;:::o;23556:337::-;23672:8;;;;:4;:8;;;;;;;;23651:29;;;;;;;;;;;;;;;;;23615:24;;;;23651:29;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;23651:29:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23690:31;23746:5;:12;23724:35;;;;;;;;;;;;;;;;;;;;;;29:2:-1;21:6;17:15;117:4;105:10;97:6;88:34;136:17;;-1:-1;23724:35:1;-1:-1:-1;23690:69:1;-1:-1:-1;23774:6:1;23769:95;23790:5;:12;23786:1;:16;23769:95;;;23835:5;23841:1;23835:8;;;;;;;;;;;;;;:18;;;23823:6;23830:1;23823:9;;;;;;;;-1:-1:-1;;;;;23823:30:1;;;:9;;;;;;;;;;;:30;23804:3;;23769:95;;134:28:7;;;;;;;;;;;;;;;-1:-1:-1;;134:28:7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5633:187:11;3123:9:12;:7;:9::i;:::-;3115:54;;;;-1:-1:-1;;;3115:54:12;;;;;;;;;5771:42:11;5782:2;5786:1;5789;5792;5795:4;5801:6;5809:3;5771:10;:42::i;:::-;5633:187;;;;;;;:::o;23100:44:1:-;;;;;;;;;;;;-1:-1:-1;;;;;23100:44:1;;:::o;5452:77:12:-;5495:27;5509:12;:10;:12::i;:::-;5495:13;:27::i;:::-;5452:77::o;2381:25:3:-;;;;;;;;;;;;;;;-1:-1:-1;;2381:25:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;20306:149:1;-1:-1:-1;;;;;20413:24:1;;;20390:4;20413:24;;;:16;:24;;;;;;;;:35;;;;;;;;;;;;;;;20306:149::o;1530:89:11:-;3123:9:12;:7;:9::i;:::-;3115:54;;;;-1:-1:-1;;;3115:54:12;;;;;;;;;1593:19:11;1604:7;1593:10;:19::i;13840:927:1:-;-1:-1:-1;;;;;13973:19:1;;13965:53;;;;-1:-1:-1;;;13965:53:1;;;;;;;;;-1:-1:-1;;;;;14036:19:1;;14045:10;14036:19;;:66;;-1:-1:-1;;;;;;14059:23:1;;;;;;:16;:23;;;;;;;;14083:10;14059:35;;;;;;;;;;:43;;:35;:43;14036:66;14028:126;;;;-1:-1:-1;;;14028:126:1;;;;;;;;;14302:13;;;;:8;:13;;;;;;;;-1:-1:-1;;;;;14302:20:1;;;;;;;;;;:32;;14327:6;14302:32;:24;:32;:::i;:::-;14279:13;;;;:8;:13;;;;;;;;-1:-1:-1;;;;;14279:20:1;;;;;;;;;;:55;;;;14378:18;;;;;;14367:30;;:6;;:10;:30::i;:::-;14344:13;;;;:8;:13;;;;;;;;-1:-1:-1;;;;;14344:18:1;;;;;;;;;;;;;;:53;;;;14440:51;;14344:18;;14440:51;;;14455:10;;14440:51;;;;14353:3;;14484:6;;14440:51;;;;;;;;;;14644:16;:3;-1:-1:-1;;;;;14644:14:1;;:16::i;:::-;14640:121;;;14676:74;14707:10;14719:5;14726:3;14731;14736:6;14744:5;;14676:74;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;14676:30:1;;-1:-1:-1;;;14676:74:1:i;:::-;13840:927;;;;;;:::o;3990:107:12:-;3123:9;:7;:9::i;:::-;3115:54;;;;-1:-1:-1;;;3115:54:12;;;;;;;;;4062:28;4081:8;4062:18;:28::i;25621:497:1:-;-1:-1:-1;;;;;25708:20:1;;25718:10;25708:20;;:68;;-1:-1:-1;;;;;;25732:24:1;;;;;;:16;:24;;;;;;;;25757:10;25732:36;;;;;;;;;;:44;;:36;:44;25708:68;25700:124;;;;-1:-1:-1;;;25700:124:1;;;;;;;;;25974:13;;;;:8;:13;;;;;;;;-1:-1:-1;;;;;25974:21:1;;;;;;;;;;:33;;26000:6;25974:33;:25;:33;:::i;:::-;25950:13;;;;:8;:13;;;;;;;;-1:-1:-1;;;;;25950:21:1;;;;;;;;;;:57;;;;26050:61;;25950:13;;:21;26065:10;;26050:61;;;;25959:3;;26104:6;;26050:61;;;;;;;;;;25621:497;;;:::o;5660:127:12:-;5719:24;:8;5735:7;5719:24;:15;:24;:::i;:::-;5758:22;;-1:-1:-1;;;;;5758:22:12;;;;;;;;5660:127;:::o;559:140:7:-;672:19;;;;:10;:19;;;;;;;;;650:42;;;;;;;;;;;-1:-1:-1;;650:42:7;;;;;;;;;;;;;;;;;;;;;;;;;;618:13;;650:42;;;;672:19;650:42;;672:19;650:42;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;650:14:7;:21;;;;;;;;-1:-1:-1;;650:21:7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;650:14:7;;-1:-1:-1;650:21:7;-1:-1:-1;650:21:7;;:14;:21;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:42;;;;:::i;1274:134:14:-;1332:7;1358:43;1362:1;1365;1358:43;;;;;;;;;;;;;;;;;:3;:43::i;:::-;1351:50;1274:134;-1:-1:-1;;;1274:134:14:o;834:176::-;892:7;923:5;;;946:6;;;;938:46;;;;-1:-1:-1;;;938:46:14;;;;;;;;5959:610;6019:4;6480:20;;6325:66;6519:23;;;;;;:42;;-1:-1:-1;6546:15:14;;;6519:42;6511:51;5959:610;-1:-1:-1;;;;5959:610:14:o;21696:1181:1:-;22689:88;;-1:-1:-1;;;22689:88:1;;;22781:22;-1:-1:-1;;;;;22689:48:1;;;7810:10;;22689:88;;22738:9;;22749:5;;22756:4;;22762:7;;22771:5;;22689:88;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;22689:88:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;22689:88:1;;;;;;;101:4:-1;97:9;90:4;84;80:15;76:31;69:5;65:43;126:6;120:4;113:20;0:138;22689:88:1;;;;;;;;;-1:-1:-1;;;;;;22689:114:1;;22681:189;;;;-1:-1:-1;;;22681:189:1;;;;;;;;779:200:12;851:4;-1:-1:-1;;;;;875:21:12;;867:68;;;;-1:-1:-1;;;867:68:12;;;;;;;;;-1:-1:-1;;;;;;952:20:12;:11;:20;;;;;;;;;;;;;;;779:200::o;1746:96::-;1825:10;1746:96;:::o;2831:105:3:-;2903:26;;;;:11;;:26;;;;;:::i;:::-;;2831:105;:::o;1186:117:7:-;1264:32;;;;:14;;:32;;;;;:::i;3051:279:11:-;3187:67;3196:57;3233:4;3239:2;3216:26;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;3216:26:11;;;3206:37;;;;;;3245:1;3248;3251;3196:57;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3196:57:11;;;;;;;;3187:8;:67::i;:::-;3179:106;;;;-1:-1:-1;;;3179:106:11;;;;;;;;;3295:28;3301:2;3305:4;3311:6;3319:3;3295:5;:28::i;5535:119:12:-;5591:21;:8;5604:7;5591:21;:12;:21;:::i;:::-;5627:20;;-1:-1:-1;;;;;5627:20:12;;;;;;;;5535:119;:::o;20562:1128:1:-;21520:81;;-1:-1:-1;;;21520:81:1;;;21605:16;-1:-1:-1;;;;;21520:43:1;;;7663:10;;21520:81;;21564:9;;21575:5;;21582:3;;21587:6;;21595:5;;21520:81;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;21520:81:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;21520:81:1;;;;;;;101:4:-1;97:9;90:4;84;80:15;76:31;69:5;65:43;126:6;120:4;113:20;0:138;21520:81:1;;;;;;;;;-1:-1:-1;;;;;;21520:101:1;;21512:171;;;;-1:-1:-1;;;21512:171:1;;;;;;;;4198:225:12;-1:-1:-1;;;;;4271:22:12;;4263:73;;;;-1:-1:-1;;;4263:73:12;;;;;;;;;4372:6;;4351:38;;-1:-1:-1;;;;;4351:38:12;;;;4372:6;;4351:38;;4372:6;;4351:38;4399:6;:17;;-1:-1:-1;;;;;;4399:17:12;-1:-1:-1;;;;;4399:17:12;;;;;;;;;;4198:225::o;510:180::-;589:18;593:4;599:7;589:3;:18::i;:::-;581:64;;;;-1:-1:-1;;;581:64:12;;;;;;;;;-1:-1:-1;;;;;655:20:12;678:5;655:20;;;;;;;;;;;:28;;-1:-1:-1;;655:28:12;;;510:180::o;10349:414:14:-;10424:13;10449:16;10474:2;10449:28;;10487:16;10512:2;10487:28;;10525:16;10567:3;:10;10554:3;:10;:23;10544:34;;;;;;;;;;;;;;;;;;;;;;;;;21:6:-1;;104:10;10544:34:14;87::-1;135:17;;-1:-1;10544:34:14;-1:-1:-1;10525:53:14;-1:-1:-1;10588:6:14;;10608:55;10629:3;:10;10625:1;:14;10608:55;;;10657:3;10661:1;10657:6;;;;;;;;;;;;;;;;10646:3;10650;;;;;;10646:8;;;;;;;;;;;:17;-1:-1:-1;;;;;10646:17:14;;;;;;;;-1:-1:-1;10641:3:14;;10608:55;;;-1:-1:-1;10678:6:14;10673:55;10694:3;:10;10690:1;:14;10673:55;;;10722:3;10726:1;10722:6;;;;;;;;;;;;;;;;10711:3;10715;;;;;;10711:8;;;;;;;;;;;:17;-1:-1:-1;;;;;10711:17:14;;;;;;;;-1:-1:-1;10706:3:14;;10673:55;;;-1:-1:-1;10752:3:14;;10349:414;-1:-1:-1;;;;;;10349:414:14:o;1732:187::-;1818:7;1853:12;1845:6;;;;1837:29;;;;-1:-1:-1;;;1837:29:14;;;;;;;;;;-1:-1:-1;;;1888:5:14;;;1732:187::o;24447:1135:1:-;24584:3;24559:13;;;:8;:13;;;;;;-1:-1:-1;;;;;24559:13:1;:29;24551:65;;;;-1:-1:-1;;;24551:65:1;;;;;;;;;24634:12;24626:50;;;;-1:-1:-1;;;24626:50:1;;;;;;;;;24715:1;24700:4;24694:18;:22;24686:52;;;;-1:-1:-1;;;24686:52:1;;;;;;;;;24749:13;;;;:8;:13;;;;;;;;;:26;;-1:-1:-1;;;;;;24749:26:1;24765:10;24749:26;;;24829:12;;24815:27;;;;;;;;;;;;;;;;24785;;24815;;;;;;;29:2:-1;21:6;17:15;117:4;105:10;97:6;88:34;136:17;;-1:-1;24815:27:1;;24785:57;;24852:17;24883:5;:12;24872:24;;;;;;;;;;;;;;;;;;;;;;29:2:-1;21:6;17:15;117:4;105:10;97:6;88:34;136:17;;-1:-1;24872:24:1;-1:-1:-1;24852:44:1;-1:-1:-1;24911:6:1;24906:336;24927:5;:12;24923:1;:16;24906:336;;;24998:3;-1:-1:-1;;;;;24968:34:1;:5;24974:1;24968:8;;;;;;;;;;;;;;:18;;;-1:-1:-1;;;;;24968:34:1;;;24960:74;;;;-1:-1:-1;;;24960:74:1;;;;;;;;;25056:5;25062:1;25056:8;;;;;;;;;;;;;;:14;;;25074:1;25056:19;;25048:60;;;;-1:-1:-1;;;25048:60:1;;;;;;;;;25122:9;;;;:4;:9;;;;;25137:8;;:5;;25143:1;;25137:8;;;;;;;;;;;;;;;;;27:10:-1;;39:1;23:18;;;45:23;;-1:-1;25122:24:1;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;25122:24:1;-1:-1:-1;;;;;25122:24:1;;;;;;;;;;;;;;;25176:8;;;;25182:1;;25176:8;;;;;;;;;;;;:18;;;25160:10;25171:1;25160:13;;;;;;;;;;;;;:34;-1:-1:-1;;;;;25160:34:1;;;-1:-1:-1;;;;;25160:34:1;;;;;25217:5;25223:1;25217:8;;;;;;;;;;;;;;:14;;;25208:3;25212:1;25208:6;;;;;;;;;;;;;;;;;:23;24941:3;;24906:336;;;-1:-1:-1;25255:12:1;;:16;25251:91;;25292:39;25310:3;25315:10;25327:3;25292:39;;;;;;;;;;;;;;;;;25251:91;25351:13;;;;:8;:13;;;;;;;;25365:10;25351:25;;;;;;;:35;;;25396:23;25360:3;25414:4;25396:12;:23::i;:::-;25480:66;;25521:10;;25515:3;;25521:10;;25480:66;;;;25533:3;;25538:7;;25480:66;;;;;;;;;;25571:3;25561:14;25565:4;25561:14;;;;;;;;;;;;;;;24447:1135;;;;;;:::o;260:175:12:-;337:18;341:4;347:7;337:3;:18::i;:::-;336:19;328:63;;;;-1:-1:-1;;;328:63:12;;;;;;;;;-1:-1:-1;;;;;401:20:12;:11;:20;;;;;;;;;;;:27;;-1:-1:-1;;401:27:12;424:4;401:27;;;260:175::o;26357:204:1:-;26471:3;26442:17;;;:8;:17;;;;;;-1:-1:-1;;;;;26442:17:1;26434:78;;;;-1:-1:-1;;;26434:78:1;;;;;;;;;26522:32;26541:7;26550:3;1015:19:7;;;;:10;:19;;;;;;;;:25;;;;;;;;:::i;:::-;;938:109;;:::o;3403:2419:11:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;3403:2419:11;;;-1:-1:-1;3403:2419:11;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;5:130:-1;72:20;;97:33;72:20;97:33;;313:352;;;443:3;436:4;428:6;424:17;420:27;410:2;;461:1;458;451:12;410:2;-1:-1;481:20;;-1:-1;;;;;510:30;;507:2;;;553:1;550;543:12;507:2;587:4;579:6;575:17;563:29;;638:3;630:4;622:6;618:17;608:8;604:32;601:41;598:2;;;655:1;652;645:12;598:2;403:262;;;;;;706:758;;840:3;833:4;825:6;821:17;817:27;807:2;;858:1;855;848:12;807:2;895:6;882:20;917:97;932:81;1006:6;932:81;;;917:97;;;908:106;;1031:5;1056:6;1049:5;1042:21;1086:4;1078:6;1074:17;1064:27;;1108:4;1103:3;1099:14;1092:21;;1161:6;1208:3;1200:4;1192:6;1188:17;1183:3;1179:27;1176:36;1173:2;;;1225:1;1222;1215:12;1173:2;1250:1;1235:223;1260:6;1257:1;1254:13;1235:223;;;1318:3;1340:54;1390:3;1378:10;1340:54;;;1328:67;;-1:-1;1418:4;1409:14;;;;1446:4;1437:14;;;;;1282:1;1275:9;1235:223;;;1239:14;800:664;;;;;;;;1850:124;1914:20;;1939:30;1914:20;1939:30;;1981:130;2048:20;;2073:33;2048:20;2073:33;;2118:128;2184:20;;2209:32;2184:20;2209:32;;2253:132;2330:13;;2348:32;2330:13;2348:32;;2406:336;;;2520:3;2513:4;2505:6;2501:17;2497:27;2487:2;;2538:1;2535;2528:12;2487:2;-1:-1;2558:20;;-1:-1;;;;;2587:30;;2584:2;;;2630:1;2627;2620:12;2584:2;2664:4;2656:6;2652:17;2640:29;;2715:3;2707:4;2699:6;2695:17;2685:8;2681:32;2678:41;2675:2;;;2732:1;2729;2722:12;2751:442;;2853:3;2846:4;2838:6;2834:17;2830:27;2820:2;;2871:1;2868;2861:12;2820:2;2908:6;2895:20;2930:65;2945:49;2987:6;2945:49;;2930:65;2921:74;;3015:6;3008:5;3001:21;3051:4;3043:6;3039:17;3084:4;3077:5;3073:16;3119:3;3110:6;3105:3;3101:16;3098:25;3095:2;;;3136:1;3133;3126:12;3095:2;3146:41;3180:6;3175:3;3170;3146:41;;;2813:380;;;;;;;;3230:473;;3336:4;3324:9;3319:3;3315:19;3311:30;3308:2;;;3354:1;3351;3344:12;3308:2;3372:20;3387:4;3372:20;;;3363:29;-1:-1;3447:1;3479:57;3532:3;3512:9;3479:57;;;3454:83;;-1:-1;3599:2;3632:49;3677:3;3653:22;;;3632:49;;;3625:4;3618:5;3614:16;3607:75;3558:135;3302:401;;;;;3847:126;3912:20;;3937:31;3912:20;3937:31;;3980:241;;4084:2;4072:9;4063:7;4059:23;4055:32;4052:2;;;4100:1;4097;4090:12;4052:2;4135:1;4152:53;4197:7;4177:9;4152:53;;4228:366;;;4349:2;4337:9;4328:7;4324:23;4320:32;4317:2;;;4365:1;4362;4355:12;4317:2;4400:1;4417:53;4462:7;4442:9;4417:53;;;4407:63;;4379:97;4507:2;4525:53;4570:7;4561:6;4550:9;4546:22;4525:53;;;4515:63;;4486:98;4311:283;;;;;;4601:1179;;;;;;;;;4862:3;4850:9;4841:7;4837:23;4833:33;4830:2;;;4879:1;4876;4869:12;4830:2;4914:1;4931:53;4976:7;4956:9;4931:53;;;4921:63;;4893:97;5021:2;5039:53;5084:7;5075:6;5064:9;5060:22;5039:53;;;5029:63;;5000:98;5157:2;5146:9;5142:18;5129:32;-1:-1;;;;;5173:6;5170:30;5167:2;;;5213:1;5210;5203:12;5167:2;5241:80;5313:7;5304:6;5293:9;5289:22;5241:80;;;5231:90;;;;5108:219;5386:2;5375:9;5371:18;5358:32;-1:-1;;;;;5402:6;5399:30;5396:2;;;5442:1;5439;5432:12;5396:2;5470:80;5542:7;5533:6;5522:9;5518:22;5470:80;;;5460:90;;;;5337:219;5615:3;5604:9;5600:19;5587:33;-1:-1;;;;;5632:6;5629:30;5626:2;;;5672:1;5669;5662:12;5626:2;5700:64;5756:7;5747:6;5736:9;5732:22;5700:64;;;5690:74;;;;5566:204;4824:956;;;;;;;;;;;;5787:867;;;;;;;5978:3;5966:9;5957:7;5953:23;5949:33;5946:2;;;5995:1;5992;5985:12;5946:2;6030:1;6047:53;6092:7;6072:9;6047:53;;;6037:63;;6009:97;6137:2;6155:53;6200:7;6191:6;6180:9;6176:22;6155:53;;;6145:63;;6116:98;6245:2;6263:53;6308:7;6299:6;6288:9;6284:22;6263:53;;;6253:63;;6224:98;6353:2;6371:53;6416:7;6407:6;6396:9;6392:22;6371:53;;;6361:63;;6332:98;6489:3;6478:9;6474:19;6461:33;-1:-1;;;;;6506:6;6503:30;6500:2;;;6546:1;6543;6536:12;6500:2;6574:64;6630:7;6621:6;6610:9;6606:22;6574:64;;;6564:74;;;;6440:204;5940:714;;;;;;;;;6661:360;;;6779:2;6767:9;6758:7;6754:23;6750:32;6747:2;;;6795:1;6792;6785:12;6747:2;6830:1;6847:53;6892:7;6872:9;6847:53;;;6837:63;;6809:97;6937:2;6955:50;6997:7;6988:6;6977:9;6973:22;6955:50;;7028:366;;;7149:2;7137:9;7128:7;7124:23;7120:32;7117:2;;;7165:1;7162;7155:12;7117:2;7200:1;7217:53;7262:7;7242:9;7217:53;;;7207:63;;7179:97;7307:2;7325:53;7370:7;7361:6;7350:9;7346:22;7325:53;;7401:491;;;;7539:2;7527:9;7518:7;7514:23;7510:32;7507:2;;;7555:1;7552;7545:12;7507:2;7590:1;7607:53;7652:7;7632:9;7607:53;;;7597:63;;7569:97;7697:2;7715:53;7760:7;7751:6;7740:9;7736:22;7715:53;;;7705:63;;7676:98;7805:2;7823:53;7868:7;7859:6;7848:9;7844:22;7823:53;;;7813:63;;7784:98;7501:391;;;;;;7899:678;;;;;8090:2;8078:9;8069:7;8065:23;8061:32;8058:2;;;8106:1;8103;8096:12;8058:2;8141:31;;-1:-1;;;;;8181:30;;8178:2;;;8224:1;8221;8214:12;8178:2;8252:80;8324:7;8315:6;8304:9;8300:22;8252:80;;;8242:90;;;;8120:218;8397:2;8386:9;8382:18;8369:32;-1:-1;;;;;8413:6;8410:30;8407:2;;;8453:1;8450;8443:12;8407:2;8481:80;8553:7;8544:6;8533:9;8529:22;8481:80;;;8052:525;;;;-1:-1;8471:90;-1:-1;;;;8052:525;8584:239;;8687:2;8675:9;8666:7;8662:23;8658:32;8655:2;;;8703:1;8700;8693:12;8655:2;8738:1;8755:52;8799:7;8779:9;8755:52;;8830:261;;8944:2;8932:9;8923:7;8919:23;8915:32;8912:2;;;8960:1;8957;8950:12;8912:2;8995:1;9012:63;9067:7;9047:9;9012:63;;9098:347;;9212:2;9200:9;9191:7;9187:23;9183:32;9180:2;;;9228:1;9225;9218:12;9180:2;9263:31;;-1:-1;;;;;9303:30;;9300:2;;;9346:1;9343;9336:12;9300:2;9366:63;9421:7;9412:6;9401:9;9397:22;9366:63;;9452:241;;9556:2;9544:9;9535:7;9531:23;9527:32;9524:2;;;9572:1;9569;9562:12;9524:2;9607:1;9624:53;9669:7;9649:9;9624:53;;9700:366;;;9821:2;9809:9;9800:7;9796:23;9792:32;9789:2;;;9837:1;9834;9827:12;9789:2;9872:1;9889:53;9934:7;9914:9;9889:53;;10073:1267;;;;;;;;10329:3;10317:9;10308:7;10304:23;10300:33;10297:2;;;10346:1;10343;10336:12;10297:2;10381:1;10398:53;10443:7;10423:9;10398:53;;;10388:63;;10360:97;10488:2;10506:51;10549:7;10540:6;10529:9;10525:22;10506:51;;;10496:61;;10467:96;10594:2;10612:53;10657:7;10648:6;10637:9;10633:22;10612:53;;;10602:63;;10573:98;10702:2;10720:53;10765:7;10756:6;10745:9;10741:22;10720:53;;;10710:63;;10681:98;10838:3;10827:9;10823:19;10810:33;-1:-1;;;;;10855:6;10852:30;10849:2;;;10895:1;10892;10885:12;10849:2;10915:95;11002:7;10993:6;10982:9;10978:22;10915:95;;;10905:105;;10789:227;11047:3;11066:53;11111:7;11102:6;11091:9;11087:22;11066:53;;;11056:63;;11026:99;11184:3;11173:9;11169:19;11156:33;-1:-1;;;;;11201:6;11198:30;11195:2;;;11241:1;11238;11231:12;11195:2;11261:63;11316:7;11307:6;11296:9;11292:22;11261:63;;;11251:73;;11135:195;10291:1049;;;;;;;;;;;11348:205;;11451:62;11509:3;11501:6;11451:62;;;-1:-1;;11542:4;11533:14;;11444:109;11744:173;;11831:46;11873:3;11865:6;11831:46;;11925:127;12014:32;12040:5;12014:32;;;12009:3;12002:45;11996:56;;;12464:690;;12609:54;12657:5;12609:54;;;12676:86;12755:6;12750:3;12676:86;;;12669:93;;12783:56;12833:5;12783:56;;;12859:7;12887:1;12872:260;12897:6;12894:1;12891:13;12872:260;;;12964:6;12958:13;12985:63;13044:3;13029:13;12985:63;;;12978:70;;13065:60;13118:6;13065:60;;;13055:70;-1:-1;;12919:1;12912:9;12872:260;;;-1:-1;13145:3;;12588:566;-1:-1;;;;;12588:566;13209:754;;13370:62;13426:5;13370:62;;;13445:94;13532:6;13527:3;13445:94;;;13438:101;;13560:64;13618:5;13560:64;;;13644:7;13672:1;13657:284;13682:6;13679:1;13676:13;13657:284;;;13749:6;13743:13;13770:79;13845:3;13830:13;13770:79;;;13763:86;;13866:68;13927:6;13866:68;;;13856:78;-1:-1;;13704:1;13697:9;13657:284;;14002:467;;14148:86;14227:6;14222:3;14148:86;;;14141:93;;-1:-1;;;;;14253:6;14250:78;14247:2;;;14341:1;14338;14331:12;14247:2;14374:4;14366:6;14362:17;14352:27;;14391:43;14427:6;14422:3;14415:5;14391:43;;;-1:-1;;14447:16;;14134:335;14508:690;;14653:54;14701:5;14653:54;;;14720:86;14799:6;14794:3;14720:86;;;14713:93;;14827:56;14877:5;14827:56;;;14903:7;14931:1;14916:260;14941:6;14938:1;14935:13;14916:260;;;15008:6;15002:13;15029:63;15088:3;15073:13;15029:63;;;15022:70;;15109:60;15162:6;15109:60;;;15099:70;-1:-1;;14963:1;14956:9;14916:260;;15206:104;15283:21;15298:5;15283:21;;15317:113;15400:24;15418:5;15400:24;;15437:343;;15547:38;15579:5;15547:38;;;15597:70;15660:6;15655:3;15597:70;;;15590:77;;15672:52;15717:6;15712:3;15705:4;15698:5;15694:16;15672:52;;;15745:29;15767:6;15745:29;;;15736:39;;;;15527:253;-1:-1;;;15527:253;15787:203;15907:77;15927:56;15977:5;15927:56;;;15907:77;;16698:328;;16858:67;16922:2;16917:3;16858:67;;;16958:30;16938:51;;17017:2;17008:12;;16844:182;-1:-1;;16844:182;17035:331;;17195:67;17259:2;17254:3;17195:67;;;17295:33;17275:54;;17357:2;17348:12;;17181:185;-1:-1;;17181:185;17375:375;;17535:67;17599:2;17594:3;17535:67;;;17635:34;17615:55;;-1:-1;;;17699:2;17690:12;;17683:30;17741:2;17732:12;;17521:229;-1:-1;;17521:229;17759:327;;17919:67;17983:2;17978:3;17919:67;;;18019:29;17999:50;;18077:2;18068:12;;17905:181;-1:-1;;17905:181;18095:332;;18255:67;18319:2;18314:3;18255:67;;;18355:34;18335:55;;18418:2;18409:12;;18241:186;-1:-1;;18241:186;18436:374;;18596:67;18660:2;18655:3;18596:67;;;18696:34;18676:55;;-1:-1;;;18760:2;18751:12;;18744:29;18801:2;18792:12;;18582:228;-1:-1;;18582:228;18819:370;;18979:67;19043:2;19038:3;18979:67;;;19079:34;19059:55;;-1:-1;;;19143:2;19134:12;;19127:25;19180:2;19171:12;;18965:224;-1:-1;;18965:224;19198:380;;19358:67;19422:2;19417:3;19358:67;;;19458:34;19438:55;;-1:-1;;;19522:2;19513:12;;19506:35;19569:2;19560:12;;19344:234;-1:-1;;19344:234;19587:384;;19747:67;19811:2;19806:3;19747:67;;;19847:34;19827:55;;-1:-1;;;19911:2;19902:12;;19895:39;19962:2;19953:12;;19733:238;-1:-1;;19733:238;19980:399;;20140:67;20204:2;20199:3;20140:67;;;20240:34;20220:55;;20309:32;20304:2;20295:12;;20288:54;20370:2;20361:12;;20126:253;-1:-1;;20126:253;20388:332;;20548:67;20612:2;20607:3;20548:67;;;20648:34;20628:55;;20711:2;20702:12;;20534:186;-1:-1;;20534:186;20729:371;;20889:67;20953:2;20948:3;20889:67;;;20989:34;20969:55;;-1:-1;;;21053:2;21044:12;;21037:26;21091:2;21082:12;;20875:225;-1:-1;;20875:225;21109:323;;21269:67;21333:2;21328:3;21269:67;;;21369:25;21349:46;;21423:2;21414:12;;21255:177;-1:-1;;21255:177;21441:325;;21601:67;21665:2;21660:3;21601:67;;;21701:27;21681:48;;21757:2;21748:12;;21587:179;-1:-1;;21587:179;21775:378;;21935:67;21999:2;21994:3;21935:67;;;22035:34;22015:55;;-1:-1;;;22099:2;22090:12;;22083:33;22144:2;22135:12;;21921:232;-1:-1;;21921:232;22162:327;;22322:67;22386:2;22381:3;22322:67;;;22422:29;22402:50;;22480:2;22471:12;;22308:181;-1:-1;;22308:181;22498:394;;22658:67;22722:2;22717:3;22658:67;;;22758:34;22738:55;;22827:27;22822:2;22813:12;;22806:49;22883:2;22874:12;;22644:248;-1:-1;;22644:248;22901:321;;23061:67;23125:2;23120:3;23061:67;;;-1:-1;;;23141:44;;23213:2;23204:12;;23047:175;-1:-1;;23047:175;23231:326;;23391:67;23455:2;23450:3;23391:67;;;23491:28;23471:49;;23548:2;23539:12;;23377:180;-1:-1;;23377:180;23566:317;;23726:67;23790:2;23785:3;23726:67;;;-1:-1;;;23806:40;;23874:2;23865:12;;23712:171;-1:-1;;23712:171;24121:152;24222:45;24242:24;24260:5;24242:24;;;24222:45;;24280:107;24359:22;24375:5;24359:22;;24394:421;;24560:94;24650:3;24641:6;24560:94;;;24676:2;24671:3;24667:12;24660:19;;24690:75;24761:3;24752:6;24690:75;;;-1:-1;24787:2;24778:12;;24548:267;-1:-1;;24548:267;24822:213;24940:2;24925:18;;24954:71;24929:9;24998:6;24954:71;;25042:356;25204:2;25189:18;;25218:87;25193:9;25278:6;25218:87;;;25316:72;25384:2;25373:9;25369:18;25360:6;25316:72;;25405:1039;25753:3;25738:19;;25768:71;25742:9;25812:6;25768:71;;;25850:72;25918:2;25907:9;25903:18;25894:6;25850:72;;;25970:9;25964:4;25960:20;25955:2;25944:9;25940:18;25933:48;25995:108;26098:4;26089:6;25995:108;;;25987:116;;26151:9;26145:4;26141:20;26136:2;26125:9;26121:18;26114:48;26176:108;26279:4;26270:6;26176:108;;;26168:116;;26333:9;26327:4;26323:20;26317:3;26306:9;26302:19;26295:49;26358:76;26429:4;26420:6;26358:76;;;26350:84;25724:720;-1:-1;;;;;;;25724:720;26451:743;26699:3;26684:19;;26714:71;26688:9;26758:6;26714:71;;;26796:72;26864:2;26853:9;26849:18;26840:6;26796:72;;;26879;26947:2;26936:9;26932:18;26923:6;26879:72;;;26962;27030:2;27019:9;27015:18;27006:6;26962:72;;;27083:9;27077:4;27073:20;27067:3;27056:9;27052:19;27045:49;27108:76;27179:4;27170:6;27108:76;;27201:393;27385:2;27399:47;;;27370:18;;27460:124;27370:18;27570:6;27460:124;;27601:660;27867:2;27881:47;;;27852:18;;27942:118;27852:18;28046:6;28038;27942:118;;;27934:126;;28108:9;28102:4;28098:20;28093:2;28082:9;28078:18;28071:48;28133:118;28246:4;28237:6;28229;28133:118;;;28125:126;27838:423;-1:-1;;;;;;27838:423;28268:361;28436:2;28450:47;;;28421:18;;28511:108;28421:18;28605:6;28511:108;;28636:201;28748:2;28733:18;;28762:65;28737:9;28800:6;28762:65;;28844:539;29042:3;29027:19;;29057:71;29031:9;29101:6;29057:71;;;29139:68;29203:2;29192:9;29188:18;29179:6;29139:68;;;29218:72;29286:2;29275:9;29271:18;29262:6;29218:72;;;29301;29369:2;29358:9;29354:18;29345:6;29301:72;;;29013:370;;;;;;;;29390:293;29524:2;29538:47;;;29509:18;;29599:74;29509:18;29659:6;29599:74;;29998:407;30189:2;30203:47;;;30174:18;;30264:131;30174:18;30264:131;;30412:407;30603:2;30617:47;;;30588:18;;30678:131;30588:18;30678:131;;30826:407;31017:2;31031:47;;;31002:18;;31092:131;31002:18;31092:131;;31240:407;31431:2;31445:47;;;31416:18;;31506:131;31416:18;31506:131;;31654:407;31845:2;31859:47;;;31830:18;;31920:131;31830:18;31920:131;;32068:407;32259:2;32273:47;;;32244:18;;32334:131;32244:18;32334:131;;32482:407;32673:2;32687:47;;;32658:18;;32748:131;32658:18;32748:131;;32896:407;33087:2;33101:47;;;33072:18;;33162:131;33072:18;33162:131;;33310:407;33501:2;33515:47;;;33486:18;;33576:131;33486:18;33576:131;;33724:407;33915:2;33929:47;;;33900:18;;33990:131;33900:18;33990:131;;34138:407;34329:2;34343:47;;;34314:18;;34404:131;34314:18;34404:131;;34552:407;34743:2;34757:47;;;34728:18;;34818:131;34728:18;34818:131;;34966:407;35157:2;35171:47;;;35142:18;;35232:131;35142:18;35232:131;;35380:407;35571:2;35585:47;;;35556:18;;35646:131;35556:18;35646:131;;35794:407;35985:2;35999:47;;;35970:18;;36060:131;35970:18;36060:131;;36208:407;36399:2;36413:47;;;36384:18;;36474:131;36384:18;36474:131;;36622:407;36813:2;36827:47;;;36798:18;;36888:131;36798:18;36888:131;;37036:407;37227:2;37241:47;;;37212:18;;37302:131;37212:18;37302:131;;37450:407;37641:2;37655:47;;;37626:18;;37716:131;37626:18;37716:131;;37864:407;38055:2;38069:47;;;38040:18;;38130:131;38040:18;38130:131;;38278:213;38396:2;38381:18;;38410:71;38385:9;38454:6;38410:71;;38498:731;38772:2;38757:18;;38786:71;38761:9;38830:6;38786:71;;;38905:9;38899:4;38895:20;38890:2;38879:9;38875:18;38868:48;38930:108;39033:4;39024:6;38930:108;;;38922:116;;39086:9;39080:4;39076:20;39071:2;39060:9;39056:18;39049:48;39111:108;39214:4;39205:6;39111:108;;39236:324;39382:2;39367:18;;39396:71;39371:9;39440:6;39396:71;;39567:256;39629:2;39623:9;39655:17;;;-1:-1;;;;;39715:34;;39751:22;;;39712:62;39709:2;;;39787:1;39784;39777:12;39709:2;39803;39796:22;39607:216;;-1:-1;39607:216;39830:321;;-1:-1;;;;;39998:6;39995:30;39992:2;;;40038:1;40035;40028:12;39992:2;-1:-1;40073:4;40061:17;;;40126:15;;39929:222;40158:322;;-1:-1;;;;;40294:6;40291:30;40288:2;;;40334:1;40331;40324:12;40288:2;-1:-1;40465:4;40401;40378:17;;;;-1:-1;;40374:33;40455:15;;40225:255;40487:151;40611:4;40602:14;;40559:79;40969:137;41072:12;;41043:63;42145:178;42263:19;;;42312:4;42303:14;;42256:67;43056:91;;43118:24;43136:5;43118:24;;43260:85;43326:13;43319:21;;43302:43;43431:144;-1:-1;;;;;;43492:78;;43475:100;43582:121;-1:-1;;;;;43644:54;;43627:76;43789:81;43860:4;43849:16;;43832:38;43877:159;;43975:56;44025:5;43975:56;;44178:145;44259:6;44254:3;44249;44236:30;-1:-1;44315:1;44297:16;;44290:27;44229:94;44332:268;44397:1;44404:101;44418:6;44415:1;44412:13;44404:101;;;44485:11;;;44479:18;44466:11;;;44459:39;44440:2;44433:10;44404:101;;;44520:6;44517:1;44514:13;44511:2;;;44585:1;44576:6;44571:3;44567:16;44560:27;44511:2;44381:219;;;;;44608:95;;44672:26;44692:5;44710:89;44774:20;44788:5;44774:20;;44887:97;44975:2;44955:14;-1:-1;;44951:28;;44935:49;44992:94;45066:2;45062:14;;45034:52;45094:117;45163:24;45181:5;45163:24;;;45156:5;45153:35;45143:2;;45202:1;45199;45192:12;45358:111;45424:21;45439:5;45424:21;;45476:117;45545:24;45563:5;45545:24;;45600:115;45668:23;45685:5;45668:23;;45846:113;45913:22;45929:5;45913:22;
Swarm Source
bzzr://31ea53b58e372cf641e58dde79c6747401bdb4938ba30fafef4cb00bdbe9b8f0
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.