git.delta.rocks / unique-network / refs/commits / 32d865721ac4

difftreelog

misk: Remove and hiede some minting metods and events

Trubnikov Sergey2023-01-12parent: #5c9ffb7.patch.diff
in: master

12 files changed

modifiedpallets/nonfungible/src/erc.rsdiffbeforeafterboth
291 },291 },
292}292}
293
294#[derive(ToLog)]
295pub enum ERC721UniqueMintableEvents {
296 #[allow(dead_code)]
297 MintingFinished {},
298}
299293
300/// @title ERC-721 Non-Fungible Token Standard, optional metadata extension294/// @title ERC-721 Non-Fungible Token Standard, optional metadata extension
301/// @dev See https://eips.ethereum.org/EIPS/eip-721295/// @dev See https://eips.ethereum.org/EIPS/eip-721
544}538}
545539
546/// @title ERC721 minting logic.540/// @title ERC721 minting logic.
547#[solidity_interface(name = ERC721UniqueMintable, events(ERC721UniqueMintableEvents))]541#[solidity_interface(name = ERC721UniqueMintable)]
548impl<T: Config> NonfungibleHandle<T> {542impl<T: Config> NonfungibleHandle<T> {
549 fn minting_finished(&self) -> Result<bool> {
550 Ok(false)
551 }
552
553 /// @notice Function to mint a token.543 /// @notice Function to mint a token.
554 /// @param to The new owner544 /// @param to The new owner
680 Ok(true)670 Ok(true)
681 }671 }
682
683 /// @dev Not implemented
684 fn finish_minting(&mut self, _caller: caller) -> Result<bool> {
685 Err("not implementable".into())
686 }
687}672}
688673
689fn get_token_property<T: Config>(674fn get_token_property<T: Config>(
modifiedpallets/nonfungible/src/stubs/UniqueNFT.soldiffbeforeafterboth
700 }700 }
701}701}
702
703/// @dev inlined interface
704contract ERC721UniqueMintableEvents {
705 event MintingFinished();
706}
707702
708/// @title ERC721 minting logic.703/// @title ERC721 minting logic.
709/// @dev the ERC-165 identifier for this interface is 0x476ff149704/// @dev the ERC-165 identifier for this interface is 0x3fd94ea6
710contract ERC721UniqueMintable is Dummy, ERC165, ERC721UniqueMintableEvents {705contract ERC721UniqueMintable is Dummy, ERC165 {
711 /// @dev EVM selector for this function is: 0x05d2035b,
712 /// or in textual repr: mintingFinished()
713 function mintingFinished() public view returns (bool) {
714 require(false, stub_error);
715 dummy;
716 return false;
717 }
718
719 /// @notice Function to mint a token.706 /// @notice Function to mint a token.
720 /// @param to The new owner707 /// @param to The new owner
774 // return false;760 // return false;
775 // }761 // }
776762
777 /// @dev Not implemented
778 /// @dev EVM selector for this function is: 0x7d64bcb4,
779 /// or in textual repr: finishMinting()
780 function finishMinting() public returns (bool) {
781 require(false, stub_error);
782 dummy = 0;
783 return false;
784 }
785}763}
786764
787/// @title Unique extensions for ERC721.765/// @title Unique extensions for ERC721.
modifiedpallets/refungible/src/erc.rsdiffbeforeafterboth
288 },288 },
289}289}
290
291#[derive(ToLog)]
292pub enum ERC721UniqueMintableEvents {
293 /// @dev Not supported
294 #[allow(dead_code)]
295 MintingFinished {},
296}
297290
298/// @title ERC-721 Non-Fungible Token Standard, optional metadata extension291/// @title ERC-721 Non-Fungible Token Standard, optional metadata extension
299/// @dev See https://eips.ethereum.org/EIPS/eip-721292/// @dev See https://eips.ethereum.org/EIPS/eip-721
576}569}
577570
578/// @title ERC721 minting logic.571/// @title ERC721 minting logic.
579#[solidity_interface(name = ERC721UniqueMintable, events(ERC721UniqueMintableEvents))]572#[solidity_interface(name = ERC721UniqueMintable)]
580impl<T: Config> RefungibleHandle<T> {573impl<T: Config> RefungibleHandle<T> {
581 fn minting_finished(&self) -> Result<bool> {
582 Ok(false)
583 }
584
585 /// @notice Function to mint a token.574 /// @notice Function to mint a token.
586 /// @param to The new owner575 /// @param to The new owner
719 Ok(true)708 Ok(true)
720 }709 }
721
722 /// @dev Not implemented
723 fn finish_minting(&mut self, _caller: caller) -> Result<bool> {
724 Err("not implementable".into())
725 }
726}710}
727711
728fn get_token_property<T: Config>(712fn get_token_property<T: Config>(
modifiedpallets/refungible/src/erc_token.rsdiffbeforeafterboth
25 ops::Deref,25 ops::Deref,
26};26};
27use evm_coder::{27use evm_coder::{
28 abi::AbiType, ToLog, execution::*, generate_stubgen, solidity_interface, types::*, weight,28 abi::AbiType, ToLog, execution::*, generate_stubgen, solidity_interface, solidity, types::*,
29 weight,
29};30};
30use pallet_common::{31use pallet_common::{
206 /// @param from The account whose tokens will be burnt.207 /// @param from The account whose tokens will be burnt.
207 /// @param amount The amount that will be burnt.208 /// @param amount The amount that will be burnt.
208 #[weight(<SelfWeightOf<T>>::burn_from())]209 #[weight(<SelfWeightOf<T>>::burn_from())]
210 #[solidity(hide)]
209 fn burn_from(&mut self, caller: caller, from: address, amount: uint256) -> Result<bool> {211 fn burn_from(&mut self, caller: caller, from: address, amount: uint256) -> Result<bool> {
210 let caller = T::CrossAccountId::from_eth(caller);212 let caller = T::CrossAccountId::from_eth(caller);
211 let from = T::CrossAccountId::from_eth(from);213 let from = T::CrossAccountId::from_eth(from);
modifiedpallets/refungible/src/stubs/UniqueRefungible.soldiffbeforeafterboth
700 }700 }
701}701}
702
703/// @dev inlined interface
704contract ERC721UniqueMintableEvents {
705 event MintingFinished();
706}
707702
708/// @title ERC721 minting logic.703/// @title ERC721 minting logic.
709/// @dev the ERC-165 identifier for this interface is 0x476ff149704/// @dev the ERC-165 identifier for this interface is 0x3fd94ea6
710contract ERC721UniqueMintable is Dummy, ERC165, ERC721UniqueMintableEvents {705contract ERC721UniqueMintable is Dummy, ERC165 {
711 /// @dev EVM selector for this function is: 0x05d2035b,
712 /// or in textual repr: mintingFinished()
713 function mintingFinished() public view returns (bool) {
714 require(false, stub_error);
715 dummy;
716 return false;
717 }
718
719 /// @notice Function to mint a token.706 /// @notice Function to mint a token.
720 /// @param to The new owner707 /// @param to The new owner
774 // return false;760 // return false;
775 // }761 // }
776762
777 /// @dev Not implemented
778 /// @dev EVM selector for this function is: 0x7d64bcb4,
779 /// or in textual repr: finishMinting()
780 function finishMinting() public returns (bool) {
781 require(false, stub_error);
782 dummy = 0;
783 return false;
784 }
785}763}
786764
787/// @title Unique extensions for ERC721.765/// @title Unique extensions for ERC721.
modifiedpallets/refungible/src/stubs/UniqueRefungibleToken.rawdiffbeforeafterboth

binary blob — no preview

modifiedpallets/refungible/src/stubs/UniqueRefungibleToken.soldiffbeforeafterboth
3838
39/// @dev the ERC-165 identifier for this interface is 0xe17a7d2b39/// @dev the ERC-165 identifier for this interface is 0xe17a7d2b
40contract ERC20UniqueExtensions is Dummy, ERC165 {40contract ERC20UniqueExtensions is Dummy, ERC165 {
41 /// @dev Function that burns an amount of the token of a given account,41 // /// @dev Function that burns an amount of the token of a given account,
42 /// deducting from the sender's allowance for said account.42 // /// deducting from the sender's allowance for said account.
43 /// @param from The account whose tokens will be burnt.43 // /// @param from The account whose tokens will be burnt.
44 /// @param amount The amount that will be burnt.44 // /// @param amount The amount that will be burnt.
45 /// @dev EVM selector for this function is: 0x79cc6790,45 // /// @dev EVM selector for this function is: 0x79cc6790,
46 /// or in textual repr: burnFrom(address,uint256)46 // /// or in textual repr: burnFrom(address,uint256)
47 function burnFrom(address from, uint256 amount) public returns (bool) {47 // function burnFrom(address from, uint256 amount) public returns (bool) {
48 require(false, stub_error);48 // require(false, stub_error);
49 from;49 // from;
50 amount;50 // amount;
51 dummy = 0;51 // dummy = 0;
52 return false;52 // return false;
53 }53 // }
5454
55 /// @dev Function that burns an amount of the token of a given account,55 /// @dev Function that burns an amount of the token of a given account,
56 /// deducting from the sender's allowance for said account.56 /// deducting from the sender's allowance for said account.
modifiedruntime/common/ethereum/sponsoring/refungible.rsdiffbeforeafterboth
265265
266 match call {266 match call {
267 // Readonly267 // Readonly
268 ERC165Call(_, _) | MintingFinished => None,268 ERC165Call(_, _) => None,
269269
270 // Not sponsored270 // Not sponsored
271 FinishMinting => None,271 FinishMinting => None,
modifiedtests/src/eth/api/UniqueNFT.soldiffbeforeafterboth
483 function burn(uint256 tokenId) external;483 function burn(uint256 tokenId) external;
484}484}
485
486/// @dev inlined interface
487interface ERC721UniqueMintableEvents {
488 event MintingFinished();
489}
490485
491/// @title ERC721 minting logic.486/// @title ERC721 minting logic.
492/// @dev the ERC-165 identifier for this interface is 0x476ff149487/// @dev the ERC-165 identifier for this interface is 0x3fd94ea6
493interface ERC721UniqueMintable is Dummy, ERC165, ERC721UniqueMintableEvents {488interface ERC721UniqueMintable is Dummy, ERC165 {
494 /// @dev EVM selector for this function is: 0x05d2035b,
495 /// or in textual repr: mintingFinished()
496 function mintingFinished() external view returns (bool);
497
498 /// @notice Function to mint a token.489 /// @notice Function to mint a token.
499 /// @param to The new owner490 /// @param to The new owner
529 // /// or in textual repr: mintWithTokenURI(address,uint256,string)519 // /// or in textual repr: mintWithTokenURI(address,uint256,string)
530 // function mintWithTokenURI(address to, uint256 tokenId, string memory tokenUri) external returns (bool);520 // function mintWithTokenURI(address to, uint256 tokenId, string memory tokenUri) external returns (bool);
531521
532 /// @dev Not implemented
533 /// @dev EVM selector for this function is: 0x7d64bcb4,
534 /// or in textual repr: finishMinting()
535 function finishMinting() external returns (bool);
536}522}
537523
538/// @title Unique extensions for ERC721.524/// @title Unique extensions for ERC721.
modifiedtests/src/eth/api/UniqueRefungible.soldiffbeforeafterboth
483 function burn(uint256 tokenId) external;483 function burn(uint256 tokenId) external;
484}484}
485
486/// @dev inlined interface
487interface ERC721UniqueMintableEvents {
488 event MintingFinished();
489}
490485
491/// @title ERC721 minting logic.486/// @title ERC721 minting logic.
492/// @dev the ERC-165 identifier for this interface is 0x476ff149487/// @dev the ERC-165 identifier for this interface is 0x3fd94ea6
493interface ERC721UniqueMintable is Dummy, ERC165, ERC721UniqueMintableEvents {488interface ERC721UniqueMintable is Dummy, ERC165 {
494 /// @dev EVM selector for this function is: 0x05d2035b,
495 /// or in textual repr: mintingFinished()
496 function mintingFinished() external view returns (bool);
497
498 /// @notice Function to mint a token.489 /// @notice Function to mint a token.
499 /// @param to The new owner490 /// @param to The new owner
529 // /// or in textual repr: mintWithTokenURI(address,uint256,string)519 // /// or in textual repr: mintWithTokenURI(address,uint256,string)
530 // function mintWithTokenURI(address to, uint256 tokenId, string memory tokenUri) external returns (bool);520 // function mintWithTokenURI(address to, uint256 tokenId, string memory tokenUri) external returns (bool);
531521
532 /// @dev Not implemented
533 /// @dev EVM selector for this function is: 0x7d64bcb4,
534 /// or in textual repr: finishMinting()
535 function finishMinting() external returns (bool);
536}522}
537523
538/// @title Unique extensions for ERC721.524/// @title Unique extensions for ERC721.
modifiedtests/src/eth/api/UniqueRefungibleToken.soldiffbeforeafterboth
2525
26/// @dev the ERC-165 identifier for this interface is 0xe17a7d2b26/// @dev the ERC-165 identifier for this interface is 0xe17a7d2b
27interface ERC20UniqueExtensions is Dummy, ERC165 {27interface ERC20UniqueExtensions is Dummy, ERC165 {
28 /// @dev Function that burns an amount of the token of a given account,28 // /// @dev Function that burns an amount of the token of a given account,
29 /// deducting from the sender's allowance for said account.29 // /// deducting from the sender's allowance for said account.
30 /// @param from The account whose tokens will be burnt.30 // /// @param from The account whose tokens will be burnt.
31 /// @param amount The amount that will be burnt.31 // /// @param amount The amount that will be burnt.
32 /// @dev EVM selector for this function is: 0x79cc6790,32 // /// @dev EVM selector for this function is: 0x79cc6790,
33 /// or in textual repr: burnFrom(address,uint256)33 // /// or in textual repr: burnFrom(address,uint256)
34 function burnFrom(address from, uint256 amount) external returns (bool);34 // function burnFrom(address from, uint256 amount) external returns (bool);
3535
36 /// @dev Function that burns an amount of the token of a given account,36 /// @dev Function that burns an amount of the token of a given account,
37 /// deducting from the sender's allowance for said account.37 /// deducting from the sender's allowance for said account.
modifiedtests/src/eth/base.test.tsdiffbeforeafterboth
108 await checkInterface(helper, '0x5b5e139f', false, true);108 await checkInterface(helper, '0x5b5e139f', false, true);
109 });109 });
110
111 itEth('ERC721UniqueMintable - 0x476ff149 - support', async ({helper}) => {
112 await checkInterface(helper, '0x476ff149', true, true);
113 });
114110
115 itEth('ERC721Enumerable - 0x780e9d63 - support', async ({helper}) => {111 itEth('ERC721Enumerable - 0x780e9d63 - support', async ({helper}) => {
116 await checkInterface(helper, '0x780e9d63', true, true);112 await checkInterface(helper, '0x780e9d63', true, true);