git.delta.rocks / unique-network / refs/commits / ee71bd998b3e

difftreelog

feat Add custum signature with unlimited nesting.

Trubnikov Sergey2022-10-19parent: #01896ba.patch.diff
in: master

17 files changed

modifiedcrates/evm-coder/procedural/src/solidity_interface.rsdiffbeforeafterboth
21// https://doc.rust-lang.org/reference/procedural-macros.html21// https://doc.rust-lang.org/reference/procedural-macros.html
2222
23use proc_macro2::{TokenStream, Group};23use proc_macro2::{TokenStream, Group};
24use quote::{quote, ToTokens};24use quote::{quote, ToTokens, format_ident};
25use inflector::cases;25use inflector::cases;
26use std::fmt::Write;26use std::fmt::Write;
27use syn::{27use syn::{
725 }725 }
726 }726 }
727
728 fn expand_selector(&self) -> proc_macro2::TokenStream {
729 let custom_signature = self.expand_custom_signature();
730 quote! {
731 {
732 let a = ::evm_coder::sha3_const::Keccak256::new()
733 .update(#custom_signature.as_bytes())
734 .finalize();
735 [a[0], a[1], a[2], a[3]]
736 }
737 }
738 }
739727
740 fn expand_const(&self) -> proc_macro2::TokenStream {728 fn expand_const(&self) -> proc_macro2::TokenStream {
741 let screaming_name = &self.screaming_name;729 let screaming_name = &self.screaming_name;
730 let screaming_name_signature = format_ident!("{}_SIGNATURE", &self.screaming_name);
742 let selector_str = &self.selector_str;731 let selector_str = &self.selector_str;
743 let selector = &self.expand_selector();732 let custom_signature = self.expand_custom_signature();
744 quote! {733 quote! {
734 const #screaming_name_signature: ::evm_coder::custom_signature::FunctionSignature = #custom_signature;
745 #[doc = #selector_str]735 #[doc = #selector_str]
746 const #screaming_name: ::evm_coder::types::bytes4 = #selector;736 const #screaming_name: ::evm_coder::types::bytes4 = {
737 let a = ::evm_coder::sha3_const::Keccak256::new()
738 .update_with_size(&Self::#screaming_name_signature.signature, Self::#screaming_name_signature.signature_len)
739 .finalize();
740 [a[0], a[1], a[2], a[3]]
741 };
747 }742 }
748 }743 }
749744
847 }842 }
848843
849 fn expand_custom_signature(&self) -> proc_macro2::TokenStream {844 fn expand_custom_signature(&self) -> proc_macro2::TokenStream {
850 let mut first_comma = true;
851 let mut custom_signature = TokenStream::new();845 let mut custom_signature = TokenStream::new();
852 let mut template = self.camel_name.clone() + "(";846
853 self.args847 self.args
854 .iter()848 .iter()
855 .filter_map(|a| {849 .filter_map(|a| {
863 }857 }
864 })858 })
865 .for_each(|ident| {859 .for_each(|ident| {
866 if !first_comma {
867 custom_signature.extend(quote!(,));
868 template.push(',');
869 } else {
870 first_comma = false;
871 };
872 template.push_str("{}");
873 let ident_str = ident.to_string();
874 match ident_str.as_str() {
875 "address" | "uint8" | "uint16" | "uint32" | "uint64" | "uint128"
876 | "uint256" | "bytes4" | "topic" | "string" | "bytes" | "void" | "caller"
877 | "bool" | "" => {
878 custom_signature.extend(quote!(#ident_str));
879 }
880 _ => {
881 custom_signature.extend(quote! {860 custom_signature.extend(quote! {
882 #ident::SIGNATURE_STRING861 (<#ident>::SIGNATURE, <#ident>::SIGNATURE_LEN)
883 });862 });
884 }
885 }
886 });863 });
887864
888 template.push(')');
889 let mut template = quote!(#template);865 let func_name = self.camel_name.clone();
890 template.extend(quote!(,));
891 template.extend(custom_signature);
892 let custom_signature_group = Group::new(proc_macro2::Delimiter::Parenthesis, template);866 let func_name = quote!(FunctionName::new(#func_name));
893 let mut custom_signature = quote! {867 custom_signature =
894 ::evm_coder::const_format::formatcp!868 quote!({ ::evm_coder::make_signature!(new fn(& #func_name),#custom_signature) });
895 };869
896 custom_signature.extend(custom_signature_group.to_token_stream());870 // println!("!!!!! {}", custom_signature);
897871
898 println!("!!!!! {}", custom_signature);
899 custom_signature872 custom_signature
900 }873 }
901874
915 .map(MethodArg::expand_solidity_argument);888 .map(MethodArg::expand_solidity_argument);
916 let docs = &self.docs;889 let docs = &self.docs;
917 let selector_str = &self.selector_str;890 let selector_str = &self.selector_str;
918 let selector = &self.expand_selector();891 let screaming_name = &self.screaming_name;
919 let hide = self.hide;892 let hide = self.hide;
920 let custom_signature = self.expand_custom_signature();893 let custom_signature = self.expand_custom_signature();
894 let custom_signature = quote!(
895 {
896 const cs: FunctionSignature = #custom_signature;
897 cs
898 }
899 );
900 // println!("!!!!! {}", custom_signature);
921 let is_payable = self.has_value_args;901 let is_payable = self.has_value_args;
922 quote! {902 let out = quote! {
923 SolidityFunction {903 SolidityFunction {
924 docs: &[#(#docs),*],904 docs: &[#(#docs),*],
925 selector_str: #selector_str,905 selector_str: #selector_str,
926 hide: #hide,906 hide: #hide,
927 selector: u32::from_be_bytes(#selector),907 selector: u32::from_be_bytes(Self::#screaming_name),
928 custom_signature: #custom_signature,908 custom_signature: #custom_signature,
929 name: #camel_name,909 name: #camel_name,
930 mutability: #mutability,910 mutability: #mutability,
936 ),916 ),
937 result: <UnnamedArgument<#result>>::default(),917 result: <UnnamedArgument<#result>>::default(),
938 }918 }
939 }919 };
920 // println!("@@@ {}", out);
921 out
940 }922 }
941}923}
942924
addedcrates/evm-coder/src/custom_signature.rsdiffbeforeafterboth

no changes

modifiedcrates/evm-coder/src/lib.rsdiffbeforeafterboth
15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
1616
17#![doc = include_str!("../README.md")]17#![doc = include_str!("../README.md")]
18// #![deny(missing_docs)]
18#![deny(missing_docs)]19#![warn(missing_docs)]
20#![macro_use]
19#![cfg_attr(not(feature = "std"), no_std)]21#![cfg_attr(not(feature = "std"), no_std)]
20#[cfg(not(feature = "std"))]22#[cfg(not(feature = "std"))]
21extern crate alloc;23extern crate alloc;
26pub use events::{ToLog, ToTopic};28pub use events::{ToLog, ToTopic};
27use execution::DispatchInfo;29use execution::DispatchInfo;
28pub mod execution;30pub mod execution;
31#[macro_use]
32pub mod custom_signature;
2933
30/// Derives call enum implementing [`crate::Callable`], [`crate::Weighted`]34/// Derives call enum implementing [`crate::Callable`], [`crate::Weighted`]
31/// and [`crate::Call`] from impl block.35/// and [`crate::Call`] from impl block.
118 use alloc::{vec::Vec};122 use alloc::{vec::Vec};
119 use pallet_evm::account::CrossAccountId;123 use pallet_evm::account::CrossAccountId;
120 use primitive_types::{U256, H160, H256};124 use primitive_types::{U256, H160, H256};
125 use core::str::from_utf8;
126
127 use crate::custom_signature::SIGNATURE_SIZE_LIMIT;
128
129 pub trait Signature {
130 const SIGNATURE: [u8; SIGNATURE_SIZE_LIMIT];
131 const SIGNATURE_LEN: usize;
132
133 fn as_str() -> &'static str {
134 from_utf8(&Self::SIGNATURE[..Self::SIGNATURE_LEN]).expect("bad utf-8")
135 }
136 }
137
138 impl Signature for bool {
139 make_signature!(new fixed("bool"));
140 }
141
142 macro_rules! define_simple_type {
143 (type $ident:ident = $ty:ty) => {
144 pub type $ident = $ty;
145 impl Signature for $ty {
146 make_signature!(new fixed(stringify!($ident)));
147 }
148 };
149 }
121150
122 pub type address = H160;151 define_simple_type!(type address = H160);
123152
124 pub type uint8 = u8;153 define_simple_type!(type uint8 = u8);
125 pub type uint16 = u16;154 define_simple_type!(type uint16 = u16);
126 pub type uint32 = u32;155 define_simple_type!(type uint32 = u32);
127 pub type uint64 = u64;156 define_simple_type!(type uint64 = u64);
128 pub type uint128 = u128;157 define_simple_type!(type uint128 = u128);
129 pub type uint256 = U256;158 define_simple_type!(type uint256 = U256);
130
131 pub type bytes4 = [u8; 4];159 define_simple_type!(type bytes4 = [u8; 4]);
132160
133 pub type topic = H256;161 define_simple_type!(type topic = H256);
134162
135 #[cfg(not(feature = "std"))]163 #[cfg(not(feature = "std"))]
136 pub type string = ::alloc::string::String;164 define_simple_type!(type string = ::alloc::string::String);
137 #[cfg(feature = "std")]165 #[cfg(feature = "std")]
138 pub type string = ::std::string::String;166 define_simple_type!(type string = ::std::string::String);
139167
140 #[derive(Default, Debug)]168 #[derive(Default, Debug)]
141 pub struct bytes(pub Vec<u8>);169 pub struct bytes(pub Vec<u8>);
170 impl Signature for bytes {
171 make_signature!(new fixed("bytes"));
172 }
142173
143 /// Solidity doesn't have `void` type, however we have special implementation174 /// Solidity doesn't have `void` type, however we have special implementation
144 /// for empty tuple return type175 /// for empty tuple return type
230 }261 }
231 }262 }
232263
233 impl SignatureString for EthCrossAccount {264 impl Signature for EthCrossAccount {
234 const SIGNATURE_STRING: &'static str = "(address,uint256)";265 make_signature!(new fixed("(address,uint256)"));
235 }266 }
236
237 pub trait SignatureString {
238 const SIGNATURE_STRING: &'static str;
239 }
240267
241 /// Convert `CrossAccountId` to `uint256`.268 /// Convert `CrossAccountId` to `uint256`.
242 pub fn convert_cross_account_to_uint256<T: pallet_evm::account::Config>(269 pub fn convert_cross_account_to_uint256<T: pallet_evm::account::Config>(
modifiedcrates/evm-coder/src/solidity.rsdiffbeforeafterboth
30 marker::PhantomData,30 marker::PhantomData,
31 cell::{Cell, RefCell},31 cell::{Cell, RefCell},
32 cmp::Reverse,32 cmp::Reverse,
33 str::from_utf8,
33};34};
34use impl_trait_for_tuples::impl_for_tuples;35use impl_trait_for_tuples::impl_for_tuples;
35use crate::types::*;36use crate::{types::*, custom_signature::FunctionSignature};
3637
37#[derive(Default)]38#[derive(Default)]
38pub struct TypeCollector {39pub struct TypeCollector {
487 pub selector_str: &'static str,488 pub selector_str: &'static str,
488 pub selector: u32,489 pub selector: u32,
489 pub hide: bool,490 pub hide: bool,
490 pub custom_signature: &'static str,491 pub custom_signature: FunctionSignature,
491 pub name: &'static str,492 pub name: &'static str,
492 pub args: A,493 pub args: A,
493 pub result: R,494 pub result: R,
513 writeln!(514 writeln!(
514 writer,515 writer,
515 "\t{hide_comment}/// or in textual repr: {}",516 "\t{hide_comment}/// or in textual repr: {}",
517 // from_utf8(self.custom_signature.as_str()).expect("bad utf8")
516 self.custom_signature518 self.selector_str
517 )?;519 )?;
518 write!(writer, "\t{hide_comment}function {}(", self.name)?;520 write!(writer, "\t{hide_comment}function {}(", self.name)?;
519 self.args.solidity_name(writer, tc)?;521 self.args.solidity_name(writer, tc)?;
modifiedpallets/common/src/erc.rsdiffbeforeafterboth
21 types::*,21 types::*,
22 execution::{Result, Error},22 execution::{Result, Error},
23 weight,23 weight,
24 custom_signature::{FunctionName, FunctionSignature},
25 make_signature,
24};26};
25pub use pallet_evm::{PrecompileOutput, PrecompileResult, PrecompileHandle, account::CrossAccountId};27pub use pallet_evm::{PrecompileOutput, PrecompileResult, PrecompileHandle, account::CrossAccountId};
26use pallet_evm_coder_substrate::dispatch_to_evm;28use pallet_evm_coder_substrate::dispatch_to_evm;
modifiedpallets/evm-contract-helpers/src/eth.rsdiffbeforeafterboth
25 generate_stubgen, solidity_interface,
26 types::*,
27 ToLog,
28 custom_signature::{FunctionName, FunctionSignature},
29 make_signature,
24};30};
25use pallet_evm::{31use pallet_evm::{
26 ExitRevert, OnCreate, OnMethodCall, PrecompileResult, PrecompileFailure, PrecompileHandle,32 ExitRevert, OnCreate, OnMethodCall, PrecompileResult, PrecompileFailure, PrecompileHandle,
modifiedpallets/fungible/src/erc.rsdiffbeforeafterboth
25 execution::*,
26 generate_stubgen, solidity_interface,
27 types::*,
28 weight,
29 custom_signature::{FunctionName, FunctionSignature},
30 make_signature,
31};
24use pallet_common::eth::convert_tuple_to_cross_account;32use pallet_common::eth::convert_tuple_to_cross_account;
25use up_data_structs::CollectionMode;33use up_data_structs::CollectionMode;
modifiedpallets/nonfungible/src/erc.rsdiffbeforeafterboth
30 execution::*,
31 generate_stubgen, solidity, solidity_interface,
32 types::*,
33 weight,
34 custom_signature::{FunctionName, FunctionSignature},
35 make_signature,
36};
29use frame_support::BoundedVec;37use frame_support::BoundedVec;
30use up_data_structs::{38use up_data_structs::{
modifiedpallets/nonfungible/src/stubs/UniqueNFT.soldiffbeforeafterboth
104}104}
105105
106/// @title A contract that allows you to work with collections.106/// @title A contract that allows you to work with collections.
107<<<<<<< HEAD
107/// @dev the ERC-165 identifier for this interface is 0xb3152af3108/// @dev the ERC-165 identifier for this interface is 0xb3152af3
109=======
110/// @dev the ERC-165 identifier for this interface is 0x674be726
111>>>>>>> feat: Add custum signature with unlimited nesting.
108contract Collection is Dummy, ERC165 {112contract Collection is Dummy, ERC165 {
109 /// Set collection property.113 /// Set collection property.
110 ///114 ///
198 /// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.202 /// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.
199 ///203 ///
200 /// @param sponsor Cross account address of the sponsor from whose account funds will be debited for operations with the contract.204 /// @param sponsor Cross account address of the sponsor from whose account funds will be debited for operations with the contract.
201 /// @dev EVM selector for this function is: 0x84a1d5a8,205 /// @dev EVM selector for this function is: 0x403e96a7,
202 /// or in textual repr: setCollectionSponsorCross((address,uint256))206 /// or in textual repr: setCollectionSponsorCross((address,uint256))
203 function setCollectionSponsorCross(Tuple6 memory sponsor) public {207 function setCollectionSponsorCross(Tuple6 memory sponsor) public {
204 require(false, stub_error);208 require(false, stub_error);
239 /// @dev EVM selector for this function is: 0x6ec0a9f1,243 /// @dev EVM selector for this function is: 0x6ec0a9f1,
240 /// or in textual repr: collectionSponsor()244 /// or in textual repr: collectionSponsor()
241<<<<<<< HEAD245<<<<<<< HEAD
246<<<<<<< HEAD
242 function collectionSponsor() public view returns (Tuple6 memory) {247 function collectionSponsor() public view returns (Tuple6 memory) {
243 require(false, stub_error);248 require(false, stub_error);
244 dummy;249 dummy;
249 dummy;254 dummy;
250 return Tuple19(0x0000000000000000000000000000000000000000, 0);255 return Tuple19(0x0000000000000000000000000000000000000000, 0);
251>>>>>>> feat: add `EthCrossAccount` type256>>>>>>> feat: add `EthCrossAccount` type
257=======
258 function collectionSponsor() public view returns (Tuple8 memory) {
259 require(false, stub_error);
260 dummy;
261 return Tuple8(0x0000000000000000000000000000000000000000, 0);
262>>>>>>> feat: Add custum signature with unlimited nesting.
252 }263 }
253264
254 /// Set limits for the collection.265 /// Set limits for the collection.
297308
298 /// Add collection admin.309 /// Add collection admin.
299 /// @param newAdmin Cross account administrator address.310 /// @param newAdmin Cross account administrator address.
300 /// @dev EVM selector for this function is: 0x859aa7d6,311 /// @dev EVM selector for this function is: 0x62e3c7c2,
301 /// or in textual repr: addCollectionAdminCross((address,uint256))312 /// or in textual repr: addCollectionAdminCross((address,uint256))
302 function addCollectionAdminCross(Tuple6 memory newAdmin) public {313 function addCollectionAdminCross(Tuple6 memory newAdmin) public {
303 require(false, stub_error);314 require(false, stub_error);
307318
308 /// Remove collection admin.319 /// Remove collection admin.
309 /// @param admin Cross account administrator address.320 /// @param admin Cross account administrator address.
310 /// @dev EVM selector for this function is: 0x6c0cd173,321 /// @dev EVM selector for this function is: 0x810d1503,
311 /// or in textual repr: removeCollectionAdminCross((address,uint256))322 /// or in textual repr: removeCollectionAdminCross((address,uint256))
312 function removeCollectionAdminCross(Tuple6 memory admin) public {323 function removeCollectionAdminCross(Tuple6 memory admin) public {
313 require(false, stub_error);324 require(false, stub_error);
351 ///362 ///
352 /// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'363 /// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
353 /// @param collections Addresses of collections that will be available for nesting.364 /// @param collections Addresses of collections that will be available for nesting.
354 /// @dev EVM selector for this function is: 0x64872396,365 /// @dev EVM selector for this function is: 0x112d4586,
355 /// or in textual repr: setCollectionNesting(bool,address[])366 /// or in textual repr: setCollectionNesting(bool,address[])
356 function setCollectionNesting(bool enable, address[] memory collections) public {367 function setCollectionNesting(bool enable, address[] memory collections) public {
357 require(false, stub_error);368 require(false, stub_error);
398 /// Add user to allowed list.409 /// Add user to allowed list.
399 ///410 ///
400 /// @param user User cross account address.411 /// @param user User cross account address.
401 /// @dev EVM selector for this function is: 0xa0184a3a,412 /// @dev EVM selector for this function is: 0xf074da88,
402 /// or in textual repr: addToCollectionAllowListCross((address,uint256))413 /// or in textual repr: addToCollectionAllowListCross((address,uint256))
403 function addToCollectionAllowListCross(Tuple6 memory user) public {414 function addToCollectionAllowListCross(Tuple6 memory user) public {
404 require(false, stub_error);415 require(false, stub_error);
420 /// Remove user from allowed list.431 /// Remove user from allowed list.
421 ///432 ///
422 /// @param user User cross account address.433 /// @param user User cross account address.
423 /// @dev EVM selector for this function is: 0x09ba452a,434 /// @dev EVM selector for this function is: 0xc00df45c,
424 /// or in textual repr: removeFromCollectionAllowListCross((address,uint256))435 /// or in textual repr: removeFromCollectionAllowListCross((address,uint256))
425 function removeFromCollectionAllowListCross(Tuple6 memory user) public {436 function removeFromCollectionAllowListCross(Tuple6 memory user) public {
426 require(false, stub_error);437 require(false, stub_error);
456 ///467 ///
457 /// @param user User cross account to verify468 /// @param user User cross account to verify
458 /// @return "true" if account is the owner or admin469 /// @return "true" if account is the owner or admin
459 /// @dev EVM selector for this function is: 0x3e75a905,470 /// @dev EVM selector for this function is: 0x5aba3351,
460 /// or in textual repr: isOwnerOrAdminCross((address,uint256))471 /// or in textual repr: isOwnerOrAdminCross((address,uint256))
461 function isOwnerOrAdminCross(Tuple6 memory user) public view returns (bool) {472 function isOwnerOrAdminCross(Tuple6 memory user) public view returns (bool) {
462 require(false, stub_error);473 require(false, stub_error);
483 /// @dev EVM selector for this function is: 0xdf727d3b,494 /// @dev EVM selector for this function is: 0xdf727d3b,
484 /// or in textual repr: collectionOwner()495 /// or in textual repr: collectionOwner()
485<<<<<<< HEAD496<<<<<<< HEAD
497<<<<<<< HEAD
486 function collectionOwner() public view returns (Tuple6 memory) {498 function collectionOwner() public view returns (Tuple6 memory) {
487 require(false, stub_error);499 require(false, stub_error);
488 dummy;500 dummy;
493 dummy;505 dummy;
494 return Tuple19(0x0000000000000000000000000000000000000000, 0);506 return Tuple19(0x0000000000000000000000000000000000000000, 0);
495>>>>>>> feat: add `EthCrossAccount` type507>>>>>>> feat: add `EthCrossAccount` type
508=======
509 function collectionOwner() public view returns (Tuple8 memory) {
510 require(false, stub_error);
511 dummy;
512 return Tuple8(0x0000000000000000000000000000000000000000, 0);
513>>>>>>> feat: Add custum signature with unlimited nesting.
496 }514 }
497515
498 /// Changes collection owner to another account516 /// Changes collection owner to another account
523 ///541 ///
524 /// @dev Owner can be changed only by current owner542 /// @dev Owner can be changed only by current owner
525 /// @param newOwner new owner cross account543 /// @param newOwner new owner cross account
526 /// @dev EVM selector for this function is: 0xe5c9913f,544 /// @dev EVM selector for this function is: 0xbdff793d,
527 /// or in textual repr: setOwnerCross((address,uint256))545 /// or in textual repr: setOwnerCross((address,uint256))
528 function setOwnerCross(Tuple6 memory newOwner) public {546 function setOwnerCross(Tuple6 memory newOwner) public {
529 require(false, stub_error);547 require(false, stub_error);
532 }550 }
533}551}
534552
553<<<<<<< HEAD
535/// @dev anonymous struct554/// @dev anonymous struct
536struct Tuple19 {555struct Tuple19 {
537 address field_0;556 address field_0;
581 }600 }
582}601}
583602
603=======
604>>>>>>> feat: Add custum signature with unlimited nesting.
584/// @title ERC721 Token that can be irreversibly burned (destroyed).605/// @title ERC721 Token that can be irreversibly burned (destroyed).
585/// @dev the ERC-165 identifier for this interface is 0x42966c68606/// @dev the ERC-165 identifier for this interface is 0x42966c68
586contract ERC721Burnable is Dummy, ERC165 {607contract ERC721Burnable is Dummy, ERC165 {
682}703}
683704
684/// @title Unique extensions for ERC721.705/// @title Unique extensions for ERC721.
706<<<<<<< HEAD
685/// @dev the ERC-165 identifier for this interface is 0x244543ee707/// @dev the ERC-165 identifier for this interface is 0x244543ee
708=======
709/// @dev the ERC-165 identifier for this interface is 0xcc97cb35
710>>>>>>> feat: Add custum signature with unlimited nesting.
686contract ERC721UniqueExtensions is Dummy, ERC165 {711contract ERC721UniqueExtensions is Dummy, ERC165 {
687 /// @notice A descriptive name for a collection of NFTs in this contract712 /// @notice A descriptive name for a collection of NFTs in this contract
688 /// @dev EVM selector for this function is: 0x06fdde03,713 /// @dev EVM selector for this function is: 0x06fdde03,
708 /// operator of the current owner.733 /// operator of the current owner.
709 /// @param approved The new substrate address approved NFT controller734 /// @param approved The new substrate address approved NFT controller
710 /// @param tokenId The NFT to approve735 /// @param tokenId The NFT to approve
711 /// @dev EVM selector for this function is: 0x0ecd0ab0,736 /// @dev EVM selector for this function is: 0x106fdb59,
712 /// or in textual repr: approveCross((address,uint256),uint256)737 /// or in textual repr: approveCross((address,uint256),uint256)
713 function approveCross(Tuple6 memory approved, uint256 tokenId) public {738 function approveCross(Tuple6 memory approved, uint256 tokenId) public {
714 require(false, stub_error);739 require(false, stub_error);
738 /// @param to Cross acccount address of new owner763 /// @param to Cross acccount address of new owner
739 /// @param tokenId The NFT to transfer764 /// @param tokenId The NFT to transfer
740 /// @dev EVM selector for this function is: 0xd5cf430b,765 /// @dev EVM selector for this function is: 0xd5cf430b,
741 /// or in textual repr: transferFromCross((address,uint256),(address,uint256),uint256)766 /// or in textual repr: transferFromCross(EthCrossAccount,EthCrossAccount,uint256)
742 function transferFromCross(767 function transferFromCross(
768<<<<<<< HEAD
743 Tuple6 memory from,769 Tuple6 memory from,
744 Tuple6 memory to,770 Tuple6 memory to,
771=======
772 EthCrossAccount memory from,
773 EthCrossAccount memory to,
774>>>>>>> feat: Add custum signature with unlimited nesting.
745 uint256 tokenId775 uint256 tokenId
746 ) public {776 ) public {
747 require(false, stub_error);777 require(false, stub_error);
772 /// if `to` is the zero address. Throws if `tokenId` is not a valid NFT.802 /// if `to` is the zero address. Throws if `tokenId` is not a valid NFT.
773 /// @param from The current owner of the NFT803 /// @param from The current owner of the NFT
774 /// @param tokenId The NFT to transfer804 /// @param tokenId The NFT to transfer
775 /// @dev EVM selector for this function is: 0xbb2f5a58,805 /// @dev EVM selector for this function is: 0xa8106d4a,
776 /// or in textual repr: burnFromCross((address,uint256),uint256)806 /// or in textual repr: burnFromCross((address,uint256),uint256)
777 function burnFromCross(Tuple6 memory from, uint256 tokenId) public {807 function burnFromCross(Tuple6 memory from, uint256 tokenId) public {
778 require(false, stub_error);808 require(false, stub_error);
819 // return false;849 // return false;
820 // }850 // }
821851
852<<<<<<< HEAD
822}853}
823854
824/// @dev anonymous struct855/// @dev anonymous struct
825struct Tuple8 {856struct Tuple8 {
857=======
858 /// @notice Function to mint multiple tokens.
859 /// @dev `tokenIds` should be an array of consecutive numbers and first number
860 /// should be obtained with `nextTokenId` method
861 /// @param to The new owner
862 /// @param tokenIds IDs of the minted NFTs
863 /// @dev EVM selector for this function is: 0xf9d9a5a3,
864 /// or in textual repr: mintBulk(address,uint256[])
865 function mintBulk(address to, uint256[] memory tokenIds) public returns (bool) {
866 require(false, stub_error);
867 to;
868 tokenIds;
869 dummy = 0;
870 return false;
871 }
872
873 /// @notice Function to mint multiple tokens with the given tokenUris.
874 /// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive
875 /// numbers and first number should be obtained with `nextTokenId` method
876 /// @param to The new owner
877 /// @param tokens array of pairs of token ID and token URI for minted tokens
878 /// @dev EVM selector for this function is: 0xfd4e2a99,
879 /// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[])
880 function mintBulkWithTokenURI(address to, Tuple12[] memory tokens) public returns (bool) {
881 require(false, stub_error);
882 to;
883 tokens;
884 dummy = 0;
885 return false;
886 }
887}
888
889/// @dev anonymous struct
890struct Tuple12 {
891>>>>>>> feat: Add custum signature with unlimited nesting.
826 uint256 field_0;892 uint256 field_0;
827 string field_1;893 string field_1;
828}894}
838 address eth;904 address eth;
839 uint256 sub;905 uint256 sub;
840>>>>>>> feat: add `EthCrossAccount` type906>>>>>>> feat: add `EthCrossAccount` type
907}
908
909/// @dev anonymous struct
910struct Tuple8 {
911 address field_0;
912 uint256 field_1;
841}913}
842914
843/// @title ERC-721 Non-Fungible Token Standard, optional enumeration extension915/// @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
modifiedpallets/refungible/src/erc.rsdiffbeforeafterboth
31 execution::*,
32 generate_stubgen, solidity, solidity_interface,
33 types::*,
34 weight,
35 custom_signature::{FunctionName, FunctionSignature},
36 make_signature,
37};
30use frame_support::{BoundedBTreeMap, BoundedVec};38use frame_support::{BoundedBTreeMap, BoundedVec};
31use pallet_common::{39use pallet_common::{
modifiedpallets/refungible/src/erc_token.rsdiffbeforeafterboth
34 execution::*,
35 generate_stubgen, solidity_interface,
36 types::*,
37 weight,
38 custom_signature::{FunctionName, FunctionSignature},
39 make_signature,
40};
33use pallet_common::{41use pallet_common::{
34 CommonWeightInfo,42 CommonWeightInfo,
modifiedpallets/unique/src/eth/mod.rsdiffbeforeafterboth
1818
19use core::marker::PhantomData;19use core::marker::PhantomData;
20use ethereum as _;20use ethereum as _;
21use evm_coder::{execution::*, generate_stubgen, solidity, solidity_interface, types::*, weight};21use evm_coder::{
22 execution::*,
23 generate_stubgen, solidity, solidity_interface,
24 types::*,
25 custom_signature::{FunctionName, FunctionSignature},
26 make_signature,
27, weight};
22use frame_support::{traits::Get, storage::StorageNMap};28use frame_support::{traits::Get, storage::StorageNMap};
23use crate::sp_api_hidden_includes_decl_storage::hidden_include::StorageDoubleMap;29use crate::sp_api_hidden_includes_decl_storage::hidden_include::StorageDoubleMap;
24use crate::Pallet;30use crate::Pallet;
modifiedtests/src/eth/api/UniqueNFT.soldiffbeforeafterboth
70}70}
7171
72/// @title A contract that allows you to work with collections.72/// @title A contract that allows you to work with collections.
73<<<<<<< HEAD
73/// @dev the ERC-165 identifier for this interface is 0xb3152af374/// @dev the ERC-165 identifier for this interface is 0xb3152af3
75=======
76/// @dev the ERC-165 identifier for this interface is 0x674be726
77>>>>>>> feat: Add custum signature with unlimited nesting.
74interface Collection is Dummy, ERC165 {78interface Collection is Dummy, ERC165 {
75 /// Set collection property.79 /// Set collection property.
76 ///80 ///
133 /// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.137 /// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.
134 ///138 ///
135 /// @param sponsor Cross account address of the sponsor from whose account funds will be debited for operations with the contract.139 /// @param sponsor Cross account address of the sponsor from whose account funds will be debited for operations with the contract.
136 /// @dev EVM selector for this function is: 0x84a1d5a8,140 /// @dev EVM selector for this function is: 0x403e96a7,
137 /// or in textual repr: setCollectionSponsorCross((address,uint256))141 /// or in textual repr: setCollectionSponsorCross((address,uint256))
138 function setCollectionSponsorCross(Tuple6 memory sponsor) external;142 function setCollectionSponsorCross(Tuple6 memory sponsor) external;
139143
193197
194 /// Add collection admin.198 /// Add collection admin.
195 /// @param newAdmin Cross account administrator address.199 /// @param newAdmin Cross account administrator address.
196 /// @dev EVM selector for this function is: 0x859aa7d6,200 /// @dev EVM selector for this function is: 0x62e3c7c2,
197 /// or in textual repr: addCollectionAdminCross((address,uint256))201 /// or in textual repr: addCollectionAdminCross((address,uint256))
198 function addCollectionAdminCross(Tuple6 memory newAdmin) external;202 function addCollectionAdminCross(Tuple6 memory newAdmin) external;
199203
200 /// Remove collection admin.204 /// Remove collection admin.
201 /// @param admin Cross account administrator address.205 /// @param admin Cross account administrator address.
202 /// @dev EVM selector for this function is: 0x6c0cd173,206 /// @dev EVM selector for this function is: 0x810d1503,
203 /// or in textual repr: removeCollectionAdminCross((address,uint256))207 /// or in textual repr: removeCollectionAdminCross((address,uint256))
204 function removeCollectionAdminCross(Tuple6 memory admin) external;208 function removeCollectionAdminCross(Tuple6 memory admin) external;
205209
227 ///231 ///
228 /// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'232 /// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
229 /// @param collections Addresses of collections that will be available for nesting.233 /// @param collections Addresses of collections that will be available for nesting.
230 /// @dev EVM selector for this function is: 0x64872396,234 /// @dev EVM selector for this function is: 0x112d4586,
231 /// or in textual repr: setCollectionNesting(bool,address[])235 /// or in textual repr: setCollectionNesting(bool,address[])
232 function setCollectionNesting(bool enable, address[] memory collections) external;236 function setCollectionNesting(bool enable, address[] memory collections) external;
233237
256 /// Add user to allowed list.260 /// Add user to allowed list.
257 ///261 ///
258 /// @param user User cross account address.262 /// @param user User cross account address.
259 /// @dev EVM selector for this function is: 0xa0184a3a,263 /// @dev EVM selector for this function is: 0xf074da88,
260 /// or in textual repr: addToCollectionAllowListCross((address,uint256))264 /// or in textual repr: addToCollectionAllowListCross((address,uint256))
261 function addToCollectionAllowListCross(Tuple6 memory user) external;265 function addToCollectionAllowListCross(Tuple6 memory user) external;
262266
270 /// Remove user from allowed list.274 /// Remove user from allowed list.
271 ///275 ///
272 /// @param user User cross account address.276 /// @param user User cross account address.
273 /// @dev EVM selector for this function is: 0x09ba452a,277 /// @dev EVM selector for this function is: 0xc00df45c,
274 /// or in textual repr: removeFromCollectionAllowListCross((address,uint256))278 /// or in textual repr: removeFromCollectionAllowListCross((address,uint256))
275 function removeFromCollectionAllowListCross(Tuple6 memory user) external;279 function removeFromCollectionAllowListCross(Tuple6 memory user) external;
276280
293 ///297 ///
294 /// @param user User cross account to verify298 /// @param user User cross account to verify
295 /// @return "true" if account is the owner or admin299 /// @return "true" if account is the owner or admin
296 /// @dev EVM selector for this function is: 0x3e75a905,300 /// @dev EVM selector for this function is: 0x5aba3351,
297 /// or in textual repr: isOwnerOrAdminCross((address,uint256))301 /// or in textual repr: isOwnerOrAdminCross((address,uint256))
298 function isOwnerOrAdminCross(Tuple6 memory user) external view returns (bool);302 function isOwnerOrAdminCross(Tuple6 memory user) external view returns (bool);
299303
332 ///336 ///
333 /// @dev Owner can be changed only by current owner337 /// @dev Owner can be changed only by current owner
334 /// @param newOwner new owner cross account338 /// @param newOwner new owner cross account
335 /// @dev EVM selector for this function is: 0xe5c9913f,339 /// @dev EVM selector for this function is: 0xbdff793d,
336 /// or in textual repr: setOwnerCross((address,uint256))340 /// or in textual repr: setOwnerCross((address,uint256))
337 function setOwnerCross(Tuple6 memory newOwner) external;341 function setOwnerCross(Tuple6 memory newOwner) external;
338}342}
339343
344<<<<<<< HEAD
340/// @dev anonymous struct345/// @dev anonymous struct
341struct Tuple19 {346struct Tuple19 {
342 address field_0;347 address field_0;
373 function tokenURI(uint256 tokenId) external view returns (string memory);378 function tokenURI(uint256 tokenId) external view returns (string memory);
374}379}
375380
381=======
382>>>>>>> feat: Add custum signature with unlimited nesting.
376/// @title ERC721 Token that can be irreversibly burned (destroyed).383/// @title ERC721 Token that can be irreversibly burned (destroyed).
377/// @dev the ERC-165 identifier for this interface is 0x42966c68384/// @dev the ERC-165 identifier for this interface is 0x42966c68
378interface ERC721Burnable is Dummy, ERC165 {385interface ERC721Burnable is Dummy, ERC165 {
438}445}
439446
440/// @title Unique extensions for ERC721.447/// @title Unique extensions for ERC721.
448<<<<<<< HEAD
441/// @dev the ERC-165 identifier for this interface is 0x244543ee449/// @dev the ERC-165 identifier for this interface is 0x244543ee
450=======
451/// @dev the ERC-165 identifier for this interface is 0xcc97cb35
452>>>>>>> feat: Add custum signature with unlimited nesting.
442interface ERC721UniqueExtensions is Dummy, ERC165 {453interface ERC721UniqueExtensions is Dummy, ERC165 {
443 /// @notice A descriptive name for a collection of NFTs in this contract454 /// @notice A descriptive name for a collection of NFTs in this contract
444 /// @dev EVM selector for this function is: 0x06fdde03,455 /// @dev EVM selector for this function is: 0x06fdde03,
456 /// operator of the current owner.467 /// operator of the current owner.
457 /// @param approved The new substrate address approved NFT controller468 /// @param approved The new substrate address approved NFT controller
458 /// @param tokenId The NFT to approve469 /// @param tokenId The NFT to approve
459 /// @dev EVM selector for this function is: 0x0ecd0ab0,470 /// @dev EVM selector for this function is: 0x106fdb59,
460 /// or in textual repr: approveCross((address,uint256),uint256)471 /// or in textual repr: approveCross((address,uint256),uint256)
461 function approveCross(Tuple6 memory approved, uint256 tokenId) external;472 function approveCross(Tuple6 memory approved, uint256 tokenId) external;
462473
476 /// @param to Cross acccount address of new owner487 /// @param to Cross acccount address of new owner
477 /// @param tokenId The NFT to transfer488 /// @param tokenId The NFT to transfer
478 /// @dev EVM selector for this function is: 0xd5cf430b,489 /// @dev EVM selector for this function is: 0xd5cf430b,
479 /// or in textual repr: transferFromCross((address,uint256),(address,uint256),uint256)490 /// or in textual repr: transferFromCross(EthCrossAccount,EthCrossAccount,uint256)
480 function transferFromCross(491 function transferFromCross(
492<<<<<<< HEAD
481 Tuple6 memory from,493 Tuple6 memory from,
482 Tuple6 memory to,494 Tuple6 memory to,
495=======
496 EthCrossAccount memory from,
497 EthCrossAccount memory to,
498>>>>>>> feat: Add custum signature with unlimited nesting.
483 uint256 tokenId499 uint256 tokenId
484 ) external;500 ) external;
485501
499 /// if `to` is the zero address. Throws if `tokenId` is not a valid NFT.515 /// if `to` is the zero address. Throws if `tokenId` is not a valid NFT.
500 /// @param from The current owner of the NFT516 /// @param from The current owner of the NFT
501 /// @param tokenId The NFT to transfer517 /// @param tokenId The NFT to transfer
502 /// @dev EVM selector for this function is: 0xbb2f5a58,518 /// @dev EVM selector for this function is: 0xa8106d4a,
503 /// or in textual repr: burnFromCross((address,uint256),uint256)519 /// or in textual repr: burnFromCross((address,uint256),uint256)
504 function burnFromCross(Tuple6 memory from, uint256 tokenId) external;520 function burnFromCross(Tuple6 memory from, uint256 tokenId) external;
505521
506 /// @notice Returns next free NFT ID.522 /// @notice Returns next free NFT ID.
507 /// @dev EVM selector for this function is: 0x75794a3c,523 /// @dev EVM selector for this function is: 0x75794a3c,
508 /// or in textual repr: nextTokenId()524 /// or in textual repr: nextTokenId()
509 function nextTokenId() external view returns (uint256);525 function nextTokenId() external view returns (uint256);
526<<<<<<< HEAD
510 // /// @notice Function to mint multiple tokens.527 // /// @notice Function to mint multiple tokens.
511 // /// @dev `tokenIds` should be an array of consecutive numbers and first number528 // /// @dev `tokenIds` should be an array of consecutive numbers and first number
512 // /// should be obtained with `nextTokenId` method529 // /// should be obtained with `nextTokenId` method
528545
529/// @dev anonymous struct546/// @dev anonymous struct
530struct Tuple8 {547struct Tuple8 {
548=======
549
550 /// @notice Function to mint multiple tokens.
551 /// @dev `tokenIds` should be an array of consecutive numbers and first number
552 /// should be obtained with `nextTokenId` method
553 /// @param to The new owner
554 /// @param tokenIds IDs of the minted NFTs
555 /// @dev EVM selector for this function is: 0xf9d9a5a3,
556 /// or in textual repr: mintBulk(address,uint256[])
557 function mintBulk(address to, uint256[] memory tokenIds) external returns (bool);
558
559 /// @notice Function to mint multiple tokens with the given tokenUris.
560 /// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive
561 /// numbers and first number should be obtained with `nextTokenId` method
562 /// @param to The new owner
563 /// @param tokens array of pairs of token ID and token URI for minted tokens
564 /// @dev EVM selector for this function is: 0xfd4e2a99,
565 /// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[])
566 function mintBulkWithTokenURI(address to, Tuple12[] memory tokens) external returns (bool);
567}
568
569/// @dev anonymous struct
570struct Tuple12 {
571>>>>>>> feat: Add custum signature with unlimited nesting.
531 uint256 field_0;572 uint256 field_0;
532 string field_1;573 string field_1;
574}
575
576/// @dev anonymous struct
577struct Tuple8 {
578 address field_0;
579 uint256 field_1;
533}580}
534581
535/// @dev anonymous struct582/// @dev anonymous struct
modifiedtests/src/eth/nonFungible.test.tsdiffbeforeafterboth
409 expect(cost < BigInt(0.2 * Number(helper.balance.getOneTokenNominal())));409 expect(cost < BigInt(0.2 * Number(helper.balance.getOneTokenNominal())));
410 });410 });
411411
412 itEth('Can perform transferFromCross()', async ({helper, privateKey}) => {412 itEth.only('Can perform transferFromCross()', async ({helper, privateKey}) => {
413 const alice = privateKey('//Alice');413 const alice = privateKey('//Alice');
414 const collection = await helper.nft.mintCollection(alice, {name: 'A', description: 'B', tokenPrefix: 'C'});414 const collection = await helper.nft.mintCollection(alice, {name: 'A', description: 'B', tokenPrefix: 'C'});
415415
modifiedtests/src/eth/nonFungibleAbi.jsondiffbeforeafterboth
251 { "internalType": "uint256", "name": "field_1", "type": "uint256" }251 { "internalType": "uint256", "name": "field_1", "type": "uint256" }
252 ],252 ],
253<<<<<<< HEAD253<<<<<<< HEAD
254<<<<<<< HEAD
254 "internalType": "struct Tuple6",255 "internalType": "struct Tuple6",
255=======256=======
256 "internalType": "struct Tuple19",257 "internalType": "struct Tuple19",
257>>>>>>> feat: add `EthCrossAccount` type258>>>>>>> feat: add `EthCrossAccount` type
259=======
260 "internalType": "struct Tuple8",
261>>>>>>> feat: Add custum signature with unlimited nesting.
258 "name": "",262 "name": "",
259 "type": "tuple"263 "type": "tuple"
260 }264 }
263 "type": "function"267 "type": "function"
264 },268 },
265 {269 {
270<<<<<<< HEAD
266 "inputs": [271 "inputs": [
267 { "internalType": "string[]", "name": "keys", "type": "string[]" }272 { "internalType": "string[]", "name": "keys", "type": "string[]" }
268 ],273 ],
278 "type": "tuple[]"283 "type": "tuple[]"
279 }284 }
280 ],285 ],
286=======
287 "inputs": [{ "internalType": "string", "name": "key", "type": "string" }],
288 "name": "collectionProperty",
289 "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }],
290>>>>>>> feat: Add custum signature with unlimited nesting.
281 "stateMutability": "view",291 "stateMutability": "view",
282 "type": "function"292 "type": "function"
283 },293 },
298 { "internalType": "uint256", "name": "field_1", "type": "uint256" }308 { "internalType": "uint256", "name": "field_1", "type": "uint256" }
299 ],309 ],
300<<<<<<< HEAD310<<<<<<< HEAD
311<<<<<<< HEAD
301 "internalType": "struct Tuple6",312 "internalType": "struct Tuple6",
302=======313=======
303 "internalType": "struct Tuple19",314 "internalType": "struct Tuple19",
304>>>>>>> feat: add `EthCrossAccount` type315>>>>>>> feat: add `EthCrossAccount` type
316=======
317 "internalType": "struct Tuple8",
318>>>>>>> feat: Add custum signature with unlimited nesting.
305 "name": "",319 "name": "",
306 "type": "tuple"320 "type": "tuple"
307 }321 }
324 "type": "function"338 "type": "function"
325 },339 },
326 {340 {
341<<<<<<< HEAD
327 "inputs": [342 "inputs": [
328 { "internalType": "string[]", "name": "keys", "type": "string[]" }343 { "internalType": "string[]", "name": "keys", "type": "string[]" }
329 ],344 ],
333 "type": "function"348 "type": "function"
334 },349 },
335 {350 {
351=======
352>>>>>>> feat: Add custum signature with unlimited nesting.
336 "inputs": [{ "internalType": "string", "name": "key", "type": "string" }],353 "inputs": [{ "internalType": "string", "name": "key", "type": "string" }],
337 "name": "deleteCollectionProperty",354 "name": "deleteCollectionProperty",
338 "outputs": [],355 "outputs": [],
409 "type": "function"426 "type": "function"
410 },427 },
411 {428 {
429<<<<<<< HEAD
412 "inputs": [{ "internalType": "address", "name": "to", "type": "address" }],430 "inputs": [{ "internalType": "address", "name": "to", "type": "address" }],
413 "name": "mint",431 "name": "mint",
414 "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],432 "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
433=======
434 "inputs": [
435 { "internalType": "address", "name": "to", "type": "address" },
436 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }
437 ],
438 "name": "mint",
439 "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
440>>>>>>> feat: Add custum signature with unlimited nesting.
415 "stateMutability": "nonpayable",441 "stateMutability": "nonpayable",
416 "type": "function"442 "type": "function"
417 },443 },
418 {444 {
419 "inputs": [445 "inputs": [
420 { "internalType": "address", "name": "to", "type": "address" },446 { "internalType": "address", "name": "to", "type": "address" },
447<<<<<<< HEAD
421 { "internalType": "string", "name": "tokenUri", "type": "string" }448 { "internalType": "string", "name": "tokenUri", "type": "string" }
422 ],449 ],
423 "name": "mintWithTokenURI",450 "name": "mintWithTokenURI",
424 "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],451 "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
452=======
453 { "internalType": "uint256[]", "name": "tokenIds", "type": "uint256[]" }
454 ],
455 "name": "mintBulk",
456 "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
425 "stateMutability": "nonpayable",457 "stateMutability": "nonpayable",
426 "type": "function"458 "type": "function"
427 },459 },
428 {460 {
461 "inputs": [
462 { "internalType": "address", "name": "to", "type": "address" },
463 {
464 "components": [
465 { "internalType": "uint256", "name": "field_0", "type": "uint256" },
466 { "internalType": "string", "name": "field_1", "type": "string" }
467 ],
468 "internalType": "struct Tuple12[]",
469 "name": "tokens",
470 "type": "tuple[]"
471 }
472 ],
473 "name": "mintBulkWithTokenURI",
474 "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
475 "stateMutability": "nonpayable",
476 "type": "function"
477 },
478 {
479 "inputs": [
480 { "internalType": "address", "name": "to", "type": "address" },
481 { "internalType": "uint256", "name": "tokenId", "type": "uint256" },
482 { "internalType": "string", "name": "tokenUri", "type": "string" }
483 ],
484 "name": "mintWithTokenURI",
485 "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
486>>>>>>> feat: Add custum signature with unlimited nesting.
487 "stateMutability": "nonpayable",
488 "type": "function"
489 },
490 {
429 "inputs": [],491 "inputs": [],
430 "name": "mintingFinished",492 "name": "mintingFinished",
431 "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],493 "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
614 },676 },
615 {677 {
616 "inputs": [678 "inputs": [
679<<<<<<< HEAD
617 {680 {
618 "components": [681 "components": [
619 { "internalType": "string", "name": "field_0", "type": "string" },682 { "internalType": "string", "name": "field_0", "type": "string" },
623 "name": "properties",686 "name": "properties",
624 "type": "tuple[]"687 "type": "tuple[]"
625 }688 }
689=======
690 { "internalType": "string", "name": "key", "type": "string" },
691 { "internalType": "bytes", "name": "value", "type": "bytes" }
692>>>>>>> feat: Add custum signature with unlimited nesting.
626 ],693 ],
627 "name": "setCollectionProperties",694 "name": "setCollectionProperties",
628 "outputs": [],695 "outputs": [],
667 },734 },
668 {735 {
669 "inputs": [736 "inputs": [
737<<<<<<< HEAD
670 {738 {
671 "components": [739 "components": [
672 { "internalType": "address", "name": "field_0", "type": "address" },740 { "internalType": "address", "name": "field_0", "type": "address" },
676 "name": "newOwner",744 "name": "newOwner",
677 "type": "tuple"745 "type": "tuple"
678 }746 }
747=======
748 { "internalType": "address", "name": "newOwner", "type": "address" }
749>>>>>>> feat: Add custum signature with unlimited nesting.
679 ],750 ],
680 "name": "setOwnerCross",751 "name": "setOwnerCross",
681 "outputs": [],752 "outputs": [],
687 { "internalType": "uint256", "name": "tokenId", "type": "uint256" },758 { "internalType": "uint256", "name": "tokenId", "type": "uint256" },
688 {759 {
689 "components": [760 "components": [
761<<<<<<< HEAD
690 { "internalType": "string", "name": "field_0", "type": "string" },762 { "internalType": "string", "name": "field_0", "type": "string" },
691 { "internalType": "bytes", "name": "field_1", "type": "bytes" }763 { "internalType": "bytes", "name": "field_1", "type": "bytes" }
764=======
765 { "internalType": "address", "name": "field_0", "type": "address" },
766 { "internalType": "uint256", "name": "field_1", "type": "uint256" }
767>>>>>>> feat: Add custum signature with unlimited nesting.
692 ],768 ],
693 "internalType": "struct Tuple19[]",769 "internalType": "struct Tuple19[]",
694 "name": "properties",770 "name": "properties",
799 "inputs": [875 "inputs": [
800 {876 {
801 "components": [877 "components": [
878<<<<<<< HEAD
802 { "internalType": "address", "name": "field_0", "type": "address" },879 { "internalType": "address", "name": "field_0", "type": "address" },
803 { "internalType": "uint256", "name": "field_1", "type": "uint256" }880 { "internalType": "uint256", "name": "field_1", "type": "uint256" }
881=======
882 { "internalType": "address", "name": "eth", "type": "address" },
883 { "internalType": "uint256", "name": "sub", "type": "uint256" }
884>>>>>>> feat: Add custum signature with unlimited nesting.
804 ],885 ],
805<<<<<<< HEAD886<<<<<<< HEAD
806 "internalType": "struct Tuple6",887 "internalType": "struct Tuple6",
812 },893 },
813 {894 {
814 "components": [895 "components": [
896<<<<<<< HEAD
815 { "internalType": "address", "name": "field_0", "type": "address" },897 { "internalType": "address", "name": "field_0", "type": "address" },
816 { "internalType": "uint256", "name": "field_1", "type": "uint256" }898 { "internalType": "uint256", "name": "field_1", "type": "uint256" }
899=======
900 { "internalType": "address", "name": "eth", "type": "address" },
901 { "internalType": "uint256", "name": "sub", "type": "uint256" }
902>>>>>>> feat: Add custum signature with unlimited nesting.
817 ],903 ],
818<<<<<<< HEAD904<<<<<<< HEAD
819 "internalType": "struct Tuple6",905 "internalType": "struct Tuple6",
modifiedtests/src/eth/util/playgrounds/types.tsdiffbeforeafterboth
14 args: { [key: string]: string }14 args: { [key: string]: string }
15};15};
16export interface TEthCrossAccount {16export interface TEthCrossAccount {
17 readonly 0: string,17 readonly eth: string,
18 readonly 1: string | Uint8Array,18 readonly sub: string | Uint8Array,
19 readonly field_0: string,
20 readonly field_1: string | Uint8Array,
21}19}
2220
23export type EthProperty = string[];21export type EthProperty = string[];
modifiedtests/src/eth/util/playgrounds/unique.dev.tsdiffbeforeafterboth
364export class EthCrossAccountGroup extends EthGroupBase {364export class EthCrossAccountGroup extends EthGroupBase {
365 fromAddress(address: TEthereumAccount): TEthCrossAccount {365 fromAddress(address: TEthereumAccount): TEthCrossAccount {
366 return {366 return {
367 0: address,367 eth: address,
368 1: '0',368 sub: '0',
369 field_0: address,
370 field_1: '0',
371 };369 };
372 }370 }
373371
374 fromKeyringPair(keyring: IKeyringPair): TEthCrossAccount {372 fromKeyringPair(keyring: IKeyringPair): TEthCrossAccount {
375 return {373 return {
376 0: '0x0000000000000000000000000000000000000000',374 eth: '0x0000000000000000000000000000000000000000',
377 1: keyring.addressRaw,375 sub: keyring.addressRaw,
378 field_0: '0x0000000000000000000000000000000000000000',
379 field_1: keyring.addressRaw,
380 };376 };
381 }377 }
382}378}
429 ethAddress: EthAddressGroup;425 ethAddress: EthAddressGroup;
430 ethNativeContract: NativeContractGroup;426 ethNativeContract: NativeContractGroup;
431 ethContract: ContractGroup;427 ethContract: ContractGroup;
432 ethCrossAccount: EthCrossAccountGroup;
433 ethProperty: EthPropertyGroup;428 ethProperty: EthPropertyGroup;
434429
435 constructor(logger: { log: (msg: any, level: any) => void, level: any }, options: {[key: string]: any} = {}) {430 constructor(logger: { log: (msg: any, level: any) => void, level: any }, options: {[key: string]: any} = {}) {