difftreelog
fix hide mintWithTokenURI and temporary unhide mintBulk
in: master
10 files changed
pallets/nonfungible/src/erc.rsdiffbeforeafterboth--- a/pallets/nonfungible/src/erc.rs
+++ b/pallets/nonfungible/src/erc.rs
@@ -510,7 +510,7 @@
/// @param to The new owner
/// @param tokenId ID of the minted NFT
/// @param tokenUri Token URI that would be stored in the NFT properties
- #[solidity(/*hide,*/ rename_selector = "mintWithTokenURI")]
+ #[solidity(hide, rename_selector = "mintWithTokenURI")]
#[weight(<SelfWeightOf<T>>::create_item())]
fn mint_with_token_uri_check_id(
&mut self,
@@ -668,7 +668,7 @@
/// should be obtained with `nextTokenId` method
/// @param to The new owner
/// @param tokenIds IDs of the minted NFTs
- #[solidity(hide)]
+ // #[solidity(hide)]
#[weight(<SelfWeightOf<T>>::create_multiple_items(token_ids.len() as u32))]
fn mint_bulk(&mut self, caller: caller, to: address, token_ids: Vec<uint256>) -> Result<bool> {
let caller = T::CrossAccountId::from_eth(caller);
pallets/nonfungible/src/stubs/UniqueNFT.rawdiffbeforeafterbothbinary blob — no preview
pallets/nonfungible/src/stubs/UniqueNFT.soldiffbeforeafterboth1// SPDX-License-Identifier: OTHER2// This code is automatically generated34pragma solidity >=0.8.0 <0.9.0;56/// @dev common stubs holder7contract Dummy {8 uint8 dummy;9 string stub_error = "this contract is implemented in native";10}1112contract ERC165 is Dummy {13 function supportsInterface(bytes4 interfaceID) external view returns (bool) {14 require(false, stub_error);15 interfaceID;16 return true;17 }18}1920/// @title A contract that allows to set and delete token properties and change token property permissions.21/// @dev the ERC-165 identifier for this interface is 0x4136937722contract TokenProperties is Dummy, ERC165 {23 /// @notice Set permissions for token property.24 /// @dev Throws error if `msg.sender` is not admin or owner of the collection.25 /// @param key Property key.26 /// @param isMutable Permission to mutate property.27 /// @param collectionAdmin Permission to mutate property by collection admin if property is mutable.28 /// @param tokenOwner Permission to mutate property by token owner if property is mutable.29 /// @dev EVM selector for this function is: 0x222d97fa,30 /// or in textual repr: setTokenPropertyPermission(string,bool,bool,bool)31 function setTokenPropertyPermission(32 string memory key,33 bool isMutable,34 bool collectionAdmin,35 bool tokenOwner36 ) public {37 require(false, stub_error);38 key;39 isMutable;40 collectionAdmin;41 tokenOwner;42 dummy = 0;43 }4445 /// @notice Set token property value.46 /// @dev Throws error if `msg.sender` has no permission to edit the property.47 /// @param tokenId ID of the token.48 /// @param key Property key.49 /// @param value Property value.50 /// @dev EVM selector for this function is: 0x1752d67b,51 /// or in textual repr: setProperty(uint256,string,bytes)52 function setProperty(53 uint256 tokenId,54 string memory key,55 bytes memory value56 ) public {57 require(false, stub_error);58 tokenId;59 key;60 value;61 dummy = 0;62 }6364 /// @notice Delete token property value.65 /// @dev Throws error if `msg.sender` has no permission to edit the property.66 /// @param tokenId ID of the token.67 /// @param key Property key.68 /// @dev EVM selector for this function is: 0x066111d1,69 /// or in textual repr: deleteProperty(uint256,string)70 function deleteProperty(uint256 tokenId, string memory key) public {71 require(false, stub_error);72 tokenId;73 key;74 dummy = 0;75 }7677 /// @notice Get token property value.78 /// @dev Throws error if key not found79 /// @param tokenId ID of the token.80 /// @param key Property key.81 /// @return Property value bytes82 /// @dev EVM selector for this function is: 0x7228c327,83 /// or in textual repr: property(uint256,string)84 function property(uint256 tokenId, string memory key) public view returns (bytes memory) {85 require(false, stub_error);86 tokenId;87 key;88 dummy;89 return hex"";90 }91}9293/// @title A contract that allows you to work with collections.94/// @dev the ERC-165 identifier for this interface is 0x3e1e808395contract Collection is Dummy, ERC165 {96 /// Set collection property.97 ///98 /// @param key Property key.99 /// @param value Propery value.100 /// @dev EVM selector for this function is: 0x2f073f66,101 /// or in textual repr: setCollectionProperty(string,bytes)102 function setCollectionProperty(string memory key, bytes memory value) public {103 require(false, stub_error);104 key;105 value;106 dummy = 0;107 }108109 /// Delete collection property.110 ///111 /// @param key Property key.112 /// @dev EVM selector for this function is: 0x7b7debce,113 /// or in textual repr: deleteCollectionProperty(string)114 function deleteCollectionProperty(string memory key) public {115 require(false, stub_error);116 key;117 dummy = 0;118 }119120 /// Get collection property.121 ///122 /// @dev Throws error if key not found.123 ///124 /// @param key Property key.125 /// @return bytes The property corresponding to the key.126 /// @dev EVM selector for this function is: 0xcf24fd6d,127 /// or in textual repr: collectionProperty(string)128 function collectionProperty(string memory key) public view returns (bytes memory) {129 require(false, stub_error);130 key;131 dummy;132 return hex"";133 }134135 /// Set the sponsor of the collection.136 ///137 /// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.138 ///139 /// @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract.140 /// @dev EVM selector for this function is: 0x7623402e,141 /// or in textual repr: setCollectionSponsor(address)142 function setCollectionSponsor(address sponsor) public {143 require(false, stub_error);144 sponsor;145 dummy = 0;146 }147148 /// Whether there is a pending sponsor.149 /// @dev EVM selector for this function is: 0x058ac185,150 /// or in textual repr: hasCollectionPendingSponsor()151 function hasCollectionPendingSponsor() public view returns (bool) {152 require(false, stub_error);153 dummy;154 return false;155 }156157 /// Collection sponsorship confirmation.158 ///159 /// @dev After setting the sponsor for the collection, it must be confirmed with this function.160 /// @dev EVM selector for this function is: 0x3c50e97a,161 /// or in textual repr: confirmCollectionSponsorship()162 function confirmCollectionSponsorship() public {163 require(false, stub_error);164 dummy = 0;165 }166167 /// Remove collection sponsor.168 /// @dev EVM selector for this function is: 0x6e0326a3,169 /// or in textual repr: removeCollectionSponsor()170 function removeCollectionSponsor() public {171 require(false, stub_error);172 dummy = 0;173 }174175 /// Get current sponsor.176 ///177 /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.178 /// @dev EVM selector for this function is: 0x6ec0a9f1,179 /// or in textual repr: collectionSponsor()180 function collectionSponsor() public view returns (Tuple17 memory) {181 require(false, stub_error);182 dummy;183 return Tuple17(0x0000000000000000000000000000000000000000, 0);184 }185186 /// Set limits for the collection.187 /// @dev Throws error if limit not found.188 /// @param limit Name of the limit. Valid names:189 /// "accountTokenOwnershipLimit",190 /// "sponsoredDataSize",191 /// "sponsoredDataRateLimit",192 /// "tokenLimit",193 /// "sponsorTransferTimeout",194 /// "sponsorApproveTimeout"195 /// @param value Value of the limit.196 /// @dev EVM selector for this function is: 0x6a3841db,197 /// or in textual repr: setCollectionLimit(string,uint32)198 function setCollectionLimit(string memory limit, uint32 value) public {199 require(false, stub_error);200 limit;201 value;202 dummy = 0;203 }204205 /// Set limits for the collection.206 /// @dev Throws error if limit not found.207 /// @param limit Name of the limit. Valid names:208 /// "ownerCanTransfer",209 /// "ownerCanDestroy",210 /// "transfersEnabled"211 /// @param value Value of the limit.212 /// @dev EVM selector for this function is: 0x993b7fba,213 /// or in textual repr: setCollectionLimit(string,bool)214 function setCollectionLimit(string memory limit, bool value) public {215 require(false, stub_error);216 limit;217 value;218 dummy = 0;219 }220221 /// Get contract address.222 /// @dev EVM selector for this function is: 0xf6b4dfb4,223 /// or in textual repr: contractAddress()224 function contractAddress() public view returns (address) {225 require(false, stub_error);226 dummy;227 return 0x0000000000000000000000000000000000000000;228 }229230 /// Add collection admin.231 /// @param newAdmin Address of the added administrator.232 /// @dev EVM selector for this function is: 0x92e462c7,233 /// or in textual repr: addCollectionAdmin(address)234 function addCollectionAdmin(address newAdmin) public {235 require(false, stub_error);236 newAdmin;237 dummy = 0;238 }239240 /// Remove collection admin.241 ///242 /// @param admin Address of the removed administrator.243 /// @dev EVM selector for this function is: 0xfafd7b42,244 /// or in textual repr: removeCollectionAdmin(address)245 function removeCollectionAdmin(address admin) public {246 require(false, stub_error);247 admin;248 dummy = 0;249 }250251 /// Toggle accessibility of collection nesting.252 ///253 /// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'254 /// @dev EVM selector for this function is: 0x112d4586,255 /// or in textual repr: setCollectionNesting(bool)256 function setCollectionNesting(bool enable) public {257 require(false, stub_error);258 enable;259 dummy = 0;260 }261262 /// Toggle accessibility of collection nesting.263 ///264 /// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'265 /// @param collections Addresses of collections that will be available for nesting.266 /// @dev EVM selector for this function is: 0x64872396,267 /// or in textual repr: setCollectionNesting(bool,address[])268 function setCollectionNesting(bool enable, address[] memory collections) public {269 require(false, stub_error);270 enable;271 collections;272 dummy = 0;273 }274275 /// Set the collection access method.276 /// @param mode Access mode277 /// 0 for Normal278 /// 1 for AllowList279 /// @dev EVM selector for this function is: 0x41835d4c,280 /// or in textual repr: setCollectionAccess(uint8)281 function setCollectionAccess(uint8 mode) public {282 require(false, stub_error);283 mode;284 dummy = 0;285 }286287 /// Checks that user allowed to operate with collection.288 ///289 /// @param user User address to check.290 /// @dev EVM selector for this function is: 0xd63a8e11,291 /// or in textual repr: allowed(address)292 function allowed(address user) public view returns (bool) {293 require(false, stub_error);294 user;295 dummy;296 return false;297 }298299 /// Add the user to the allowed list.300 ///301 /// @param user Address of a trusted user.302 /// @dev EVM selector for this function is: 0x67844fe6,303 /// or in textual repr: addToCollectionAllowList(address)304 function addToCollectionAllowList(address user) public {305 require(false, stub_error);306 user;307 dummy = 0;308 }309310 /// Remove the user from the allowed list.311 ///312 /// @param user Address of a removed user.313 /// @dev EVM selector for this function is: 0x85c51acb,314 /// or in textual repr: removeFromCollectionAllowList(address)315 function removeFromCollectionAllowList(address user) public {316 require(false, stub_error);317 user;318 dummy = 0;319 }320321 /// Switch permission for minting.322 ///323 /// @param mode Enable if "true".324 /// @dev EVM selector for this function is: 0x00018e84,325 /// or in textual repr: setCollectionMintMode(bool)326 function setCollectionMintMode(bool mode) public {327 require(false, stub_error);328 mode;329 dummy = 0;330 }331332 /// Check that account is the owner or admin of the collection333 ///334 /// @param user account to verify335 /// @return "true" if account is the owner or admin336 /// @dev EVM selector for this function is: 0x9811b0c7,337 /// or in textual repr: isOwnerOrAdmin(address)338 function isOwnerOrAdmin(address user) public view returns (bool) {339 require(false, stub_error);340 user;341 dummy;342 return false;343 }344345 /// Returns collection type346 ///347 /// @return `Fungible` or `NFT` or `ReFungible`348 /// @dev EVM selector for this function is: 0xd34b55b8,349 /// or in textual repr: uniqueCollectionType()350 function uniqueCollectionType() public view returns (string memory) {351 require(false, stub_error);352 dummy;353 return "";354 }355356 /// Get collection owner.357 ///358 /// @return Tuble with sponsor address and his substrate mirror.359 /// If address is canonical then substrate mirror is zero and vice versa.360 /// @dev EVM selector for this function is: 0xdf727d3b,361 /// or in textual repr: collectionOwner()362 function collectionOwner() public view returns (Tuple17 memory) {363 require(false, stub_error);364 dummy;365 return Tuple17(0x0000000000000000000000000000000000000000, 0);366 }367368 /// Changes collection owner to another account369 ///370 /// @dev Owner can be changed only by current owner371 /// @param newOwner new owner account372 /// @dev EVM selector for this function is: 0x13af4035,373 /// or in textual repr: setOwner(address)374 function setOwner(address newOwner) public {375 require(false, stub_error);376 newOwner;377 dummy = 0;378 }379}380381/// @dev anonymous struct382struct Tuple17 {383 address field_0;384 uint256 field_1;385}386387/// @title ERC-721 Non-Fungible Token Standard, optional metadata extension388/// @dev See https://eips.ethereum.org/EIPS/eip-721389/// @dev the ERC-165 identifier for this interface is 0x5b5e139f390contract ERC721Metadata is Dummy, ERC165 {391 // /// @notice A descriptive name for a collection of NFTs in this contract392 // /// @dev real implementation of this function lies in `ERC721UniqueExtensions`393 // /// @dev EVM selector for this function is: 0x06fdde03,394 // /// or in textual repr: name()395 // function name() public view returns (string memory) {396 // require(false, stub_error);397 // dummy;398 // return "";399 // }400401 // /// @notice An abbreviated name for NFTs in this contract402 // /// @dev real implementation of this function lies in `ERC721UniqueExtensions`403 // /// @dev EVM selector for this function is: 0x95d89b41,404 // /// or in textual repr: symbol()405 // function symbol() public view returns (string memory) {406 // require(false, stub_error);407 // dummy;408 // return "";409 // }410411 /// @notice A distinct Uniform Resource Identifier (URI) for a given asset.412 ///413 /// @dev If the token has a `url` property and it is not empty, it is returned.414 /// Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`.415 /// If the collection property `baseURI` is empty or absent, return "" (empty string)416 /// otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix417 /// otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings).418 ///419 /// @return token's const_metadata420 /// @dev EVM selector for this function is: 0xc87b56dd,421 /// or in textual repr: tokenURI(uint256)422 function tokenURI(uint256 tokenId) public view returns (string memory) {423 require(false, stub_error);424 tokenId;425 dummy;426 return "";427 }428}429430/// @title ERC721 Token that can be irreversibly burned (destroyed).431/// @dev the ERC-165 identifier for this interface is 0x42966c68432contract ERC721Burnable is Dummy, ERC165 {433 /// @notice Burns a specific ERC721 token.434 /// @dev Throws unless `msg.sender` is the current NFT owner, or an authorized435 /// operator of the current owner.436 /// @param tokenId The NFT to approve437 /// @dev EVM selector for this function is: 0x42966c68,438 /// or in textual repr: burn(uint256)439 function burn(uint256 tokenId) public {440 require(false, stub_error);441 tokenId;442 dummy = 0;443 }444}445446/// @dev inlined interface447contract ERC721UniqueMintableEvents {448 event MintingFinished();449}450451/// @title ERC721 minting logic.452/// @dev the ERC-165 identifier for this interface is 0x476ff149453contract ERC721UniqueMintable is Dummy, ERC165, ERC721UniqueMintableEvents {454 /// @dev EVM selector for this function is: 0x05d2035b,455 /// or in textual repr: mintingFinished()456 function mintingFinished() public view returns (bool) {457 require(false, stub_error);458 dummy;459 return false;460 }461462 /// @notice Function to mint token.463 /// @param to The new owner464 /// @return uint256 The id of the newly minted token465 /// @dev EVM selector for this function is: 0x6a627842,466 /// or in textual repr: mint(address)467 function mint(address to) public returns (uint256) {468 require(false, stub_error);469 to;470 dummy = 0;471 return 0;472 }473474 // /// @notice Function to mint token.475 // /// @dev `tokenId` should be obtained with `nextTokenId` method,476 // /// unlike standard, you can't specify it manually477 // /// @param to The new owner478 // /// @param tokenId ID of the minted NFT479 // /// @dev EVM selector for this function is: 0x40c10f19,480 // /// or in textual repr: mint(address,uint256)481 // function mint(address to, uint256 tokenId) public returns (bool) {482 // require(false, stub_error);483 // to;484 // tokenId;485 // dummy = 0;486 // return false;487 // }488489 /// @notice Function to mint token with the given tokenUri.490 /// @param to The new owner491 /// @param tokenUri Token URI that would be stored in the NFT properties492 /// @return uint256 The id of the newly minted token493 /// @dev EVM selector for this function is: 0x45c17782,494 /// or in textual repr: mintWithTokenURI(address,string)495 function mintWithTokenURI(address to, string memory tokenUri) public returns (uint256) {496 require(false, stub_error);497 to;498 tokenUri;499 dummy = 0;500 return 0;501 }502503 /// @notice Function to mint token with the given tokenUri.504 /// @dev `tokenId` should be obtained with `nextTokenId` method,505 /// unlike standard, you can't specify it manually506 /// @param to The new owner507 /// @param tokenId ID of the minted NFT508 /// @param tokenUri Token URI that would be stored in the NFT properties509 /// @dev EVM selector for this function is: 0x50bb4e7f,510 /// or in textual repr: mintWithTokenURI(address,uint256,string)511 function mintWithTokenURI(512 address to,513 uint256 tokenId,514 string memory tokenUri515 ) public returns (bool) {516 require(false, stub_error);517 to;518 tokenId;519 tokenUri;520 dummy = 0;521 return false;522 }523524 /// @dev Not implemented525 /// @dev EVM selector for this function is: 0x7d64bcb4,526 /// or in textual repr: finishMinting()527 function finishMinting() public returns (bool) {528 require(false, stub_error);529 dummy = 0;530 return false;531 }532}533534/// @title Unique extensions for ERC721.535/// @dev the ERC-165 identifier for this interface is 0x4468500d536contract ERC721UniqueExtensions is Dummy, ERC165 {537 /// @notice A descriptive name for a collection of NFTs in this contract538 /// @dev EVM selector for this function is: 0x06fdde03,539 /// or in textual repr: name()540 function name() public view returns (string memory) {541 require(false, stub_error);542 dummy;543 return "";544 }545546 /// @notice An abbreviated name for NFTs in this contract547 /// @dev EVM selector for this function is: 0x95d89b41,548 /// or in textual repr: symbol()549 function symbol() public view returns (string memory) {550 require(false, stub_error);551 dummy;552 return "";553 }554555 /// @notice Transfer ownership of an NFT556 /// @dev Throws unless `msg.sender` is the current owner. Throws if `to`557 /// is the zero address. Throws if `tokenId` is not a valid NFT.558 /// @param to The new owner559 /// @param tokenId The NFT to transfer560 /// @dev EVM selector for this function is: 0xa9059cbb,561 /// or in textual repr: transfer(address,uint256)562 function transfer(address to, uint256 tokenId) public {563 require(false, stub_error);564 to;565 tokenId;566 dummy = 0;567 }568569 /// @notice Burns a specific ERC721 token.570 /// @dev Throws unless `msg.sender` is the current owner or an authorized571 /// operator for this NFT. Throws if `from` is not the current owner. Throws572 /// if `to` is the zero address. Throws if `tokenId` is not a valid NFT.573 /// @param from The current owner of the NFT574 /// @param tokenId The NFT to transfer575 /// @dev EVM selector for this function is: 0x79cc6790,576 /// or in textual repr: burnFrom(address,uint256)577 function burnFrom(address from, uint256 tokenId) public {578 require(false, stub_error);579 from;580 tokenId;581 dummy = 0;582 }583584 /// @notice Returns next free NFT ID.585 /// @dev EVM selector for this function is: 0x75794a3c,586 /// or in textual repr: nextTokenId()587 function nextTokenId() public view returns (uint256) {588 require(false, stub_error);589 dummy;590 return 0;591 }592593 // /// @notice Function to mint multiple tokens.594 // /// @dev `tokenIds` should be an array of consecutive numbers and first number595 // /// should be obtained with `nextTokenId` method596 // /// @param to The new owner597 // /// @param tokenIds IDs of the minted NFTs598 // /// @dev EVM selector for this function is: 0x44a9945e,599 // /// or in textual repr: mintBulk(address,uint256[])600 // function mintBulk(address to, uint256[] memory tokenIds) public returns (bool) {601 // require(false, stub_error);602 // to;603 // tokenIds;604 // dummy = 0;605 // return false;606 // }607608 /// @notice Function to mint multiple tokens with the given tokenUris.609 /// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive610 /// numbers and first number should be obtained with `nextTokenId` method611 /// @param to The new owner612 /// @param tokens array of pairs of token ID and token URI for minted tokens613 /// @dev EVM selector for this function is: 0x36543006,614 /// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[])615 function mintBulkWithTokenURI(address to, Tuple6[] memory tokens) public returns (bool) {616 require(false, stub_error);617 to;618 tokens;619 dummy = 0;620 return false;621 }622}623624/// @dev anonymous struct625struct Tuple6 {626 uint256 field_0;627 string field_1;628}629630/// @title ERC-721 Non-Fungible Token Standard, optional enumeration extension631/// @dev See https://eips.ethereum.org/EIPS/eip-721632/// @dev the ERC-165 identifier for this interface is 0x780e9d63633contract ERC721Enumerable is Dummy, ERC165 {634 /// @notice Enumerate valid NFTs635 /// @param index A counter less than `totalSupply()`636 /// @return The token identifier for the `index`th NFT,637 /// (sort order not specified)638 /// @dev EVM selector for this function is: 0x4f6ccce7,639 /// or in textual repr: tokenByIndex(uint256)640 function tokenByIndex(uint256 index) public view returns (uint256) {641 require(false, stub_error);642 index;643 dummy;644 return 0;645 }646647 /// @dev Not implemented648 /// @dev EVM selector for this function is: 0x2f745c59,649 /// or in textual repr: tokenOfOwnerByIndex(address,uint256)650 function tokenOfOwnerByIndex(address owner, uint256 index) public view returns (uint256) {651 require(false, stub_error);652 owner;653 index;654 dummy;655 return 0;656 }657658 /// @notice Count NFTs tracked by this contract659 /// @return A count of valid NFTs tracked by this contract, where each one of660 /// them has an assigned and queryable owner not equal to the zero address661 /// @dev EVM selector for this function is: 0x18160ddd,662 /// or in textual repr: totalSupply()663 function totalSupply() public view returns (uint256) {664 require(false, stub_error);665 dummy;666 return 0;667 }668}669670/// @dev inlined interface671contract ERC721Events {672 event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);673 event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);674 event ApprovalForAll(address indexed owner, address indexed operator, bool approved);675}676677/// @title ERC-721 Non-Fungible Token Standard678/// @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md679/// @dev the ERC-165 identifier for this interface is 0x80ac58cd680contract ERC721 is Dummy, ERC165, ERC721Events {681 /// @notice Count all NFTs assigned to an owner682 /// @dev NFTs assigned to the zero address are considered invalid, and this683 /// function throws for queries about the zero address.684 /// @param owner An address for whom to query the balance685 /// @return The number of NFTs owned by `owner`, possibly zero686 /// @dev EVM selector for this function is: 0x70a08231,687 /// or in textual repr: balanceOf(address)688 function balanceOf(address owner) public view returns (uint256) {689 require(false, stub_error);690 owner;691 dummy;692 return 0;693 }694695 /// @notice Find the owner of an NFT696 /// @dev NFTs assigned to zero address are considered invalid, and queries697 /// about them do throw.698 /// @param tokenId The identifier for an NFT699 /// @return The address of the owner of the NFT700 /// @dev EVM selector for this function is: 0x6352211e,701 /// or in textual repr: ownerOf(uint256)702 function ownerOf(uint256 tokenId) public view returns (address) {703 require(false, stub_error);704 tokenId;705 dummy;706 return 0x0000000000000000000000000000000000000000;707 }708709 /// @dev Not implemented710 /// @dev EVM selector for this function is: 0xb88d4fde,711 /// or in textual repr: safeTransferFrom(address,address,uint256,bytes)712 function safeTransferFrom(713 address from,714 address to,715 uint256 tokenId,716 bytes memory data717 ) public {718 require(false, stub_error);719 from;720 to;721 tokenId;722 data;723 dummy = 0;724 }725726 /// @dev Not implemented727 /// @dev EVM selector for this function is: 0x42842e0e,728 /// or in textual repr: safeTransferFrom(address,address,uint256)729 function safeTransferFrom(730 address from,731 address to,732 uint256 tokenId733 ) public {734 require(false, stub_error);735 from;736 to;737 tokenId;738 dummy = 0;739 }740741 /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE742 /// TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE743 /// THEY MAY BE PERMANENTLY LOST744 /// @dev Throws unless `msg.sender` is the current owner or an authorized745 /// operator for this NFT. Throws if `from` is not the current owner. Throws746 /// if `to` is the zero address. Throws if `tokenId` is not a valid NFT.747 /// @param from The current owner of the NFT748 /// @param to The new owner749 /// @param tokenId The NFT to transfer750 /// @dev EVM selector for this function is: 0x23b872dd,751 /// or in textual repr: transferFrom(address,address,uint256)752 function transferFrom(753 address from,754 address to,755 uint256 tokenId756 ) public {757 require(false, stub_error);758 from;759 to;760 tokenId;761 dummy = 0;762 }763764 /// @notice Set or reaffirm the approved address for an NFT765 /// @dev The zero address indicates there is no approved address.766 /// @dev Throws unless `msg.sender` is the current NFT owner, or an authorized767 /// operator of the current owner.768 /// @param approved The new approved NFT controller769 /// @param tokenId The NFT to approve770 /// @dev EVM selector for this function is: 0x095ea7b3,771 /// or in textual repr: approve(address,uint256)772 function approve(address approved, uint256 tokenId) public {773 require(false, stub_error);774 approved;775 tokenId;776 dummy = 0;777 }778779 /// @dev Not implemented780 /// @dev EVM selector for this function is: 0xa22cb465,781 /// or in textual repr: setApprovalForAll(address,bool)782 function setApprovalForAll(address operator, bool approved) public {783 require(false, stub_error);784 operator;785 approved;786 dummy = 0;787 }788789 /// @dev Not implemented790 /// @dev EVM selector for this function is: 0x081812fc,791 /// or in textual repr: getApproved(uint256)792 function getApproved(uint256 tokenId) public view returns (address) {793 require(false, stub_error);794 tokenId;795 dummy;796 return 0x0000000000000000000000000000000000000000;797 }798799 /// @dev Not implemented800 /// @dev EVM selector for this function is: 0xe985e9c5,801 /// or in textual repr: isApprovedForAll(address,address)802 function isApprovedForAll(address owner, address operator) public view returns (address) {803 require(false, stub_error);804 owner;805 operator;806 dummy;807 return 0x0000000000000000000000000000000000000000;808 }809}810811contract UniqueNFT is812 Dummy,813 ERC165,814 ERC721,815 ERC721Enumerable,816 ERC721UniqueExtensions,817 ERC721UniqueMintable,818 ERC721Burnable,819 ERC721Metadata,820 Collection,821 TokenProperties822{}pallets/refungible/src/erc.rsdiffbeforeafterboth--- a/pallets/refungible/src/erc.rs
+++ b/pallets/refungible/src/erc.rs
@@ -536,7 +536,7 @@
/// @param to The new owner
/// @param tokenId ID of the minted RFT
/// @param tokenUri Token URI that would be stored in the RFT properties
- #[solidity(/*hide,*/ rename_selector = "mintWithTokenURI")]
+ #[solidity(hide, rename_selector = "mintWithTokenURI")]
#[weight(<SelfWeightOf<T>>::create_item())]
fn mint_with_token_uri_check_id(
&mut self,
@@ -705,7 +705,7 @@
/// should be obtained with `nextTokenId` method
/// @param to The new owner
/// @param tokenIds IDs of the minted RFTs
- #[solidity(hide)]
+ // #[solidity(hide)]
#[weight(<SelfWeightOf<T>>::create_multiple_items(token_ids.len() as u32))]
fn mint_bulk(&mut self, caller: caller, to: address, token_ids: Vec<uint256>) -> Result<bool> {
let caller = T::CrossAccountId::from_eth(caller);
pallets/refungible/src/stubs/UniqueRefungible.rawdiffbeforeafterbothbinary blob — no preview
pallets/refungible/src/stubs/UniqueRefungible.soldiffbeforeafterboth--- a/pallets/refungible/src/stubs/UniqueRefungible.sol
+++ b/pallets/refungible/src/stubs/UniqueRefungible.sol
@@ -498,26 +498,22 @@
return 0;
}
- /// @notice Function to mint token with the given tokenUri.
- /// @dev `tokenId` should be obtained with `nextTokenId` method,
- /// unlike standard, you can't specify it manually
- /// @param to The new owner
- /// @param tokenId ID of the minted RFT
- /// @param tokenUri Token URI that would be stored in the RFT properties
- /// @dev EVM selector for this function is: 0x50bb4e7f,
- /// or in textual repr: mintWithTokenURI(address,uint256,string)
- function mintWithTokenURI(
- address to,
- uint256 tokenId,
- string memory tokenUri
- ) public returns (bool) {
- require(false, stub_error);
- to;
- tokenId;
- tokenUri;
- dummy = 0;
- return false;
- }
+ // /// @notice Function to mint token with the given tokenUri.
+ // /// @dev `tokenId` should be obtained with `nextTokenId` method,
+ // /// unlike standard, you can't specify it manually
+ // /// @param to The new owner
+ // /// @param tokenId ID of the minted RFT
+ // /// @param tokenUri Token URI that would be stored in the RFT properties
+ // /// @dev EVM selector for this function is: 0x50bb4e7f,
+ // /// or in textual repr: mintWithTokenURI(address,uint256,string)
+ // function mintWithTokenURI(address to, uint256 tokenId, string memory tokenUri) public returns (bool) {
+ // require(false, stub_error);
+ // to;
+ // tokenId;
+ // tokenUri;
+ // dummy = 0;
+ // return false;
+ // }
/// @dev Not implemented
/// @dev EVM selector for this function is: 0x7d64bcb4,
@@ -590,20 +586,20 @@
return 0;
}
- // /// @notice Function to mint multiple tokens.
- // /// @dev `tokenIds` should be an array of consecutive numbers and first number
- // /// should be obtained with `nextTokenId` method
- // /// @param to The new owner
- // /// @param tokenIds IDs of the minted RFTs
- // /// @dev EVM selector for this function is: 0x44a9945e,
- // /// or in textual repr: mintBulk(address,uint256[])
- // function mintBulk(address to, uint256[] memory tokenIds) public returns (bool) {
- // require(false, stub_error);
- // to;
- // tokenIds;
- // dummy = 0;
- // return false;
- // }
+ /// @notice Function to mint multiple tokens.
+ /// @dev `tokenIds` should be an array of consecutive numbers and first number
+ /// should be obtained with `nextTokenId` method
+ /// @param to The new owner
+ /// @param tokenIds IDs of the minted RFTs
+ /// @dev EVM selector for this function is: 0x44a9945e,
+ /// or in textual repr: mintBulk(address,uint256[])
+ function mintBulk(address to, uint256[] memory tokenIds) public returns (bool) {
+ require(false, stub_error);
+ to;
+ tokenIds;
+ dummy = 0;
+ return false;
+ }
/// @notice Function to mint multiple tokens with the given tokenUris.
/// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive
tests/src/eth/api/UniqueNFT.soldiffbeforeafterboth--- a/tests/src/eth/api/UniqueNFT.sol
+++ b/tests/src/eth/api/UniqueNFT.sol
@@ -332,19 +332,15 @@
/// or in textual repr: mintWithTokenURI(address,string)
function mintWithTokenURI(address to, string memory tokenUri) external returns (uint256);
- /// @notice Function to mint token with the given tokenUri.
- /// @dev `tokenId` should be obtained with `nextTokenId` method,
- /// unlike standard, you can't specify it manually
- /// @param to The new owner
- /// @param tokenId ID of the minted NFT
- /// @param tokenUri Token URI that would be stored in the NFT properties
- /// @dev EVM selector for this function is: 0x50bb4e7f,
- /// or in textual repr: mintWithTokenURI(address,uint256,string)
- function mintWithTokenURI(
- address to,
- uint256 tokenId,
- string memory tokenUri
- ) external returns (bool);
+ // /// @notice Function to mint token with the given tokenUri.
+ // /// @dev `tokenId` should be obtained with `nextTokenId` method,
+ // /// unlike standard, you can't specify it manually
+ // /// @param to The new owner
+ // /// @param tokenId ID of the minted NFT
+ // /// @param tokenUri Token URI that would be stored in the NFT properties
+ // /// @dev EVM selector for this function is: 0x50bb4e7f,
+ // /// or in textual repr: mintWithTokenURI(address,uint256,string)
+ // function mintWithTokenURI(address to, uint256 tokenId, string memory tokenUri) external returns (bool);
/// @dev Not implemented
/// @dev EVM selector for this function is: 0x7d64bcb4,
@@ -389,14 +385,14 @@
/// or in textual repr: nextTokenId()
function nextTokenId() external view returns (uint256);
- // /// @notice Function to mint multiple tokens.
- // /// @dev `tokenIds` should be an array of consecutive numbers and first number
- // /// should be obtained with `nextTokenId` method
- // /// @param to The new owner
- // /// @param tokenIds IDs of the minted NFTs
- // /// @dev EVM selector for this function is: 0x44a9945e,
- // /// or in textual repr: mintBulk(address,uint256[])
- // function mintBulk(address to, uint256[] memory tokenIds) external returns (bool);
+ /// @notice Function to mint multiple tokens.
+ /// @dev `tokenIds` should be an array of consecutive numbers and first number
+ /// should be obtained with `nextTokenId` method
+ /// @param to The new owner
+ /// @param tokenIds IDs of the minted NFTs
+ /// @dev EVM selector for this function is: 0x44a9945e,
+ /// or in textual repr: mintBulk(address,uint256[])
+ function mintBulk(address to, uint256[] memory tokenIds) external returns (bool);
/// @notice Function to mint multiple tokens with the given tokenUris.
/// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive
tests/src/eth/api/UniqueRefungible.soldiffbeforeafterboth--- a/tests/src/eth/api/UniqueRefungible.sol
+++ b/tests/src/eth/api/UniqueRefungible.sol
@@ -330,19 +330,15 @@
/// or in textual repr: mintWithTokenURI(address,string)
function mintWithTokenURI(address to, string memory tokenUri) external returns (uint256);
- /// @notice Function to mint token with the given tokenUri.
- /// @dev `tokenId` should be obtained with `nextTokenId` method,
- /// unlike standard, you can't specify it manually
- /// @param to The new owner
- /// @param tokenId ID of the minted RFT
- /// @param tokenUri Token URI that would be stored in the RFT properties
- /// @dev EVM selector for this function is: 0x50bb4e7f,
- /// or in textual repr: mintWithTokenURI(address,uint256,string)
- function mintWithTokenURI(
- address to,
- uint256 tokenId,
- string memory tokenUri
- ) external returns (bool);
+ // /// @notice Function to mint token with the given tokenUri.
+ // /// @dev `tokenId` should be obtained with `nextTokenId` method,
+ // /// unlike standard, you can't specify it manually
+ // /// @param to The new owner
+ // /// @param tokenId ID of the minted RFT
+ // /// @param tokenUri Token URI that would be stored in the RFT properties
+ // /// @dev EVM selector for this function is: 0x50bb4e7f,
+ // /// or in textual repr: mintWithTokenURI(address,uint256,string)
+ // function mintWithTokenURI(address to, uint256 tokenId, string memory tokenUri) external returns (bool);
/// @dev Not implemented
/// @dev EVM selector for this function is: 0x7d64bcb4,
@@ -389,14 +385,14 @@
/// or in textual repr: nextTokenId()
function nextTokenId() external view returns (uint256);
- // /// @notice Function to mint multiple tokens.
- // /// @dev `tokenIds` should be an array of consecutive numbers and first number
- // /// should be obtained with `nextTokenId` method
- // /// @param to The new owner
- // /// @param tokenIds IDs of the minted RFTs
- // /// @dev EVM selector for this function is: 0x44a9945e,
- // /// or in textual repr: mintBulk(address,uint256[])
- // function mintBulk(address to, uint256[] memory tokenIds) external returns (bool);
+ /// @notice Function to mint multiple tokens.
+ /// @dev `tokenIds` should be an array of consecutive numbers and first number
+ /// should be obtained with `nextTokenId` method
+ /// @param to The new owner
+ /// @param tokenIds IDs of the minted RFTs
+ /// @dev EVM selector for this function is: 0x44a9945e,
+ /// or in textual repr: mintBulk(address,uint256[])
+ function mintBulk(address to, uint256[] memory tokenIds) external returns (bool);
/// @notice Function to mint multiple tokens with the given tokenUris.
/// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive
tests/src/eth/nonFungibleAbi.jsondiffbeforeafterboth--- a/tests/src/eth/nonFungibleAbi.json
+++ b/tests/src/eth/nonFungibleAbi.json
@@ -269,6 +269,16 @@
{
"inputs": [
{ "internalType": "address", "name": "to", "type": "address" },
+ { "internalType": "uint256[]", "name": "tokenIds", "type": "uint256[]" }
+ ],
+ "name": "mintBulk",
+ "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ { "internalType": "address", "name": "to", "type": "address" },
{
"components": [
{ "internalType": "uint256", "name": "field_0", "type": "uint256" },
@@ -291,17 +301,6 @@
],
"name": "mintWithTokenURI",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "inputs": [
- { "internalType": "address", "name": "to", "type": "address" },
- { "internalType": "uint256", "name": "tokenId", "type": "uint256" },
- { "internalType": "string", "name": "tokenUri", "type": "string" }
- ],
- "name": "mintWithTokenURI",
- "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
"stateMutability": "nonpayable",
"type": "function"
},
tests/src/eth/reFungibleAbi.jsondiffbeforeafterboth--- a/tests/src/eth/reFungibleAbi.json
+++ b/tests/src/eth/reFungibleAbi.json
@@ -269,6 +269,16 @@
{
"inputs": [
{ "internalType": "address", "name": "to", "type": "address" },
+ { "internalType": "uint256[]", "name": "tokenIds", "type": "uint256[]" }
+ ],
+ "name": "mintBulk",
+ "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ { "internalType": "address", "name": "to", "type": "address" },
{
"components": [
{ "internalType": "uint256", "name": "field_0", "type": "uint256" },
@@ -291,17 +301,6 @@
],
"name": "mintWithTokenURI",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "inputs": [
- { "internalType": "address", "name": "to", "type": "address" },
- { "internalType": "uint256", "name": "tokenId", "type": "uint256" },
- { "internalType": "string", "name": "tokenUri", "type": "string" }
- ],
- "name": "mintWithTokenURI",
- "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
"stateMutability": "nonpayable",
"type": "function"
},