difftreelog
refactor evm type names
in: master
30 files changed
pallets/common/src/erc.rsdiffbeforeafterboth35use crate::{35use crate::{36 Pallet, CollectionHandle, Config, CollectionProperties, SelfWeightOf,36 Pallet, CollectionHandle, Config, CollectionProperties, SelfWeightOf,37 eth::{37 eth::{38 Property as PropertyStruct, EthCrossAccount, CollectionPermissions as EvmPermissions,38 CollectionPermissions as EvmPermissions, CollectionLimitField as EvmCollectionLimits, self,39 CollectionLimitField as EvmCollectionLimits, self,40 },39 },41 weights::WeightInfo,40 weights::WeightInfo,122 fn set_collection_properties(121 fn set_collection_properties(123 &mut self,122 &mut self,124 caller: caller,123 caller: caller,125 properties: Vec<PropertyStruct>,124 properties: Vec<eth::Property>,126 ) -> Result<void> {125 ) -> Result<void> {127 let caller = T::CrossAccountId::from_eth(caller);126 let caller = T::CrossAccountId::from_eth(caller);128127129 let properties = properties128 let properties = properties130 .into_iter()129 .into_iter()131 .map(|PropertyStruct { key, value }| {130 .map(|eth::Property { key, value }| {132 let key = <Vec<u8>>::from(key)131 let key = <Vec<u8>>::from(key)133 .try_into()132 .try_into()134 .map_err(|_| "key too large")?;133 .map_err(|_| "key too large")?;196 ///195 ///197 /// @param keys Properties keys. Empty keys for all propertyes.196 /// @param keys Properties keys. Empty keys for all propertyes.198 /// @return Vector of properties key/value pairs.197 /// @return Vector of properties key/value pairs.199 fn collection_properties(&self, keys: Vec<string>) -> Result<Vec<PropertyStruct>> {198 fn collection_properties(&self, keys: Vec<string>) -> Result<Vec<eth::Property>> {200 let keys = keys199 let keys = keys201 .into_iter()200 .into_iter()202 .map(|key| {201 .map(|key| {218 let key =217 let key =219 string::from_utf8(p.key.into()).map_err(|e| Error::Revert(format!("{}", e)))?;218 string::from_utf8(p.key.into()).map_err(|e| Error::Revert(format!("{}", e)))?;220 let value = bytes(p.value.to_vec());219 let value = bytes(p.value.to_vec());221 Ok(PropertyStruct { key, value })220 Ok(eth::Property { key, value })222 })221 })223 .collect::<Result<Vec<_>>>()?;222 .collect::<Result<Vec<_>>>()?;224 Ok(properties)223 Ok(properties)248 fn set_collection_sponsor_cross(247 fn set_collection_sponsor_cross(249 &mut self,248 &mut self,250 caller: caller,249 caller: caller,251 sponsor: EthCrossAccount,250 sponsor: eth::CrossAccount,252 ) -> Result<void> {251 ) -> Result<void> {253 self.consume_store_reads_and_writes(1, 1)?;252 self.consume_store_reads_and_writes(1, 1)?;254253288 /// Get current sponsor.287 /// Get current sponsor.289 ///288 ///290 /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.289 /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.291 fn collection_sponsor(&self) -> Result<EthCrossAccount> {290 fn collection_sponsor(&self) -> Result<eth::CrossAccount> {292 let sponsor = match self.collection.sponsorship.sponsor() {291 let sponsor = match self.collection.sponsorship.sponsor() {293 Some(sponsor) => sponsor,292 Some(sponsor) => sponsor,294 None => return Ok(Default::default()),293 None => return Ok(Default::default()),295 };294 };296295297 Ok(EthCrossAccount::from_sub::<T>(&sponsor))296 Ok(eth::CrossAccount::from_sub::<T>(&sponsor))298 }297 }299298300 /// Get current collection limits.299 /// Get current collection limits.377 fn add_collection_admin_cross(376 fn add_collection_admin_cross(378 &mut self,377 &mut self,379 caller: caller,378 caller: caller,380 new_admin: EthCrossAccount,379 new_admin: eth::CrossAccount,381 ) -> Result<void> {380 ) -> Result<void> {382 self.consume_store_reads_and_writes(2, 2)?;381 self.consume_store_reads_and_writes(2, 2)?;383382392 fn remove_collection_admin_cross(391 fn remove_collection_admin_cross(393 &mut self,392 &mut self,394 caller: caller,393 caller: caller,395 admin: EthCrossAccount,394 admin: eth::CrossAccount,396 ) -> Result<void> {395 ) -> Result<void> {397 self.consume_store_reads_and_writes(2, 2)?;396 self.consume_store_reads_and_writes(2, 2)?;398397534 /// Checks that user allowed to operate with collection.533 /// Checks that user allowed to operate with collection.535 ///534 ///536 /// @param user User address to check.535 /// @param user User address to check.537 fn allowlisted_cross(&self, user: EthCrossAccount) -> Result<bool> {536 fn allowlisted_cross(&self, user: eth::CrossAccount) -> Result<bool> {538 let user = user.into_sub_cross_account::<T>()?;537 let user = user.into_sub_cross_account::<T>()?;539 Ok(Pallet::<T>::allowed(self.id, user))538 Ok(Pallet::<T>::allowed(self.id, user))540 }539 }558 fn add_to_collection_allow_list_cross(557 fn add_to_collection_allow_list_cross(559 &mut self,558 &mut self,560 caller: caller,559 caller: caller,561 user: EthCrossAccount,560 user: eth::CrossAccount,562 ) -> Result<void> {561 ) -> Result<void> {563 self.consume_store_writes(1)?;562 self.consume_store_writes(1)?;564563587 fn remove_from_collection_allow_list_cross(586 fn remove_from_collection_allow_list_cross(588 &mut self,587 &mut self,589 caller: caller,588 caller: caller,590 user: EthCrossAccount,589 user: eth::CrossAccount,591 ) -> Result<void> {590 ) -> Result<void> {592 self.consume_store_writes(1)?;591 self.consume_store_writes(1)?;593592625 ///624 ///626 /// @param user User cross account to verify625 /// @param user User cross account to verify627 /// @return "true" if account is the owner or admin626 /// @return "true" if account is the owner or admin628 fn is_owner_or_admin_cross(&self, user: EthCrossAccount) -> Result<bool> {627 fn is_owner_or_admin_cross(&self, user: eth::CrossAccount) -> Result<bool> {629 let user = user.into_sub_cross_account::<T>()?;628 let user = user.into_sub_cross_account::<T>()?;630 Ok(self.is_owner_or_admin(&user))629 Ok(self.is_owner_or_admin(&user))631 }630 }646 ///645 ///647 /// @return Tuble with sponsor address and his substrate mirror.646 /// @return Tuble with sponsor address and his substrate mirror.648 /// If address is canonical then substrate mirror is zero and vice versa.647 /// If address is canonical then substrate mirror is zero and vice versa.649 fn collection_owner(&self) -> Result<EthCrossAccount> {648 fn collection_owner(&self) -> Result<eth::CrossAccount> {650 Ok(EthCrossAccount::from_sub_cross_account::<T>(649 Ok(eth::CrossAccount::from_sub_cross_account::<T>(651 &T::CrossAccountId::from_sub(self.owner.clone()),650 &T::CrossAccountId::from_sub(self.owner.clone()),652 ))651 ))653 }652 }670 ///669 ///671 /// @return Vector of tuples with admins address and his substrate mirror.670 /// @return Vector of tuples with admins address and his substrate mirror.672 /// If address is canonical then substrate mirror is zero and vice versa.671 /// If address is canonical then substrate mirror is zero and vice versa.673 fn collection_admins(&self) -> Result<Vec<EthCrossAccount>> {672 fn collection_admins(&self) -> Result<Vec<eth::CrossAccount>> {674 let result = crate::IsAdmin::<T>::iter_prefix((self.id,))673 let result = crate::IsAdmin::<T>::iter_prefix((self.id,))675 .map(|(admin, _)| EthCrossAccount::from_sub_cross_account::<T>(&admin))674 .map(|(admin, _)| eth::CrossAccount::from_sub_cross_account::<T>(&admin))676 .collect();675 .collect();677 Ok(result)676 Ok(result)678 }677 }684 fn change_collection_owner_cross(683 fn change_collection_owner_cross(685 &mut self,684 &mut self,686 caller: caller,685 caller: caller,687 new_owner: EthCrossAccount,686 new_owner: eth::CrossAccount,688 ) -> Result<void> {687 ) -> Result<void> {689 self.consume_store_writes(1)?;688 self.consume_store_writes(1)?;690689695 }694 }696}695}697698/// ### Note699/// Do not forget to add: `self.consume_store_reads(1)?;`700fn check_is_owner_or_admin<T: Config>(701 caller: caller,702 collection: &CollectionHandle<T>,703) -> Result<T::CrossAccountId> {704 let caller = T::CrossAccountId::from_eth(caller);705 collection706 .check_is_owner_or_admin(&caller)707 .map_err(dispatch_to_evm::<T>)?;708 Ok(caller)709}710711/// ### Note712/// Do not forget to add: `self.consume_store_writes(1)?;`713fn save<T: Config>(collection: &CollectionHandle<T>) -> Result<void> {714 collection715 .check_is_internal()716 .map_err(dispatch_to_evm::<T>)?;717 collection.save().map_err(dispatch_to_evm::<T>)?;718 Ok(())719}720696721/// Contains static property keys and values.697/// Contains static property keys and values.722pub mod static_property {698pub mod static_property {pallets/common/src/eth.rsdiffbeforeafterboth686869/// Cross account struct69/// Cross account struct70#[derive(Debug, Default, AbiCoder)]70#[derive(Debug, Default, AbiCoder)]71pub struct EthCrossAccount {71pub struct CrossAccount {72 pub(crate) eth: address,72 pub(crate) eth: address,73 pub(crate) sub: uint256,73 pub(crate) sub: uint256,74}74}757576impl EthCrossAccount {76impl CrossAccount {77 /// Converts `CrossAccountId` to `EthCrossAccountId`77 /// Converts `CrossAccountId` to [`CrossAccount`]78 pub fn from_sub_cross_account<T>(cross_account_id: &T::CrossAccountId) -> Self78 pub fn from_sub_cross_account<T>(cross_account_id: &T::CrossAccountId) -> Self79 where79 where80 T: pallet_evm::Config,80 T: pallet_evm::Config,89 }89 }90 }90 }91 }91 }92 /// Creates `EthCrossAccount` from substrate account92 /// Creates [`CrossAccount`] from substrate account93 pub fn from_sub<T>(account_id: &T::AccountId) -> Self93 pub fn from_sub<T>(account_id: &T::AccountId) -> Self94 where94 where95 T: pallet_evm::Config,95 T: pallet_evm::Config,100 sub: uint256::from_big_endian(account_id.as_ref()),100 sub: uint256::from_big_endian(account_id.as_ref()),101 }101 }102 }102 }103 /// Converts `EthCrossAccount` to `CrossAccountId`103 /// Converts [`CrossAccount`] to `CrossAccountId`104 pub fn into_sub_cross_account<T>(&self) -> evm_coder::execution::Result<T::CrossAccountId>104 pub fn into_sub_cross_account<T>(&self) -> evm_coder::execution::Result<T::CrossAccountId>105 where105 where106 T: pallet_evm::Config,106 T: pallet_evm::Config,127 pub value: evm_coder::types::bytes,127 pub value: evm_coder::types::bytes,128}128}129129130/// [`CollectionLimits`](up_data_structs::CollectionLimits) representation for EVM.130/// [`CollectionLimits`](up_data_structs::CollectionLimits) fields representation for EVM.131#[derive(Debug, Default, Clone, Copy, AbiCoder)]131#[derive(Debug, Default, Clone, Copy, AbiCoder)]132#[repr(u8)]132#[repr(u8)]133pub enum CollectionLimitField {133pub enum CollectionLimitField {160 TransferEnabled,160 TransferEnabled,161}161}162162163/// [`CollectionLimits`](up_data_structs::CollectionLimits) field representation for EVM.163#[derive(Debug, Default, AbiCoder)]164#[derive(Debug, Default, AbiCoder)]164pub struct CollectionLimit {165pub struct CollectionLimit {165 field: CollectionLimitField,166 field: CollectionLimitField,168}169}169170170impl CollectionLimit {171impl CollectionLimit {172 /// Make [`CollectionLimit`] from [`CollectionLimitField`] and int value.171 pub fn from_int(field: CollectionLimitField, value: u32) -> Self {173 pub fn from_int(field: CollectionLimitField, value: u32) -> Self {172 Self {174 Self {173 field,175 field,176 }178 }177 }179 }178180181 /// Make [`CollectionLimit`] from [`CollectionLimitField`] and optional int value.179 pub fn from_opt_int(field: CollectionLimitField, value: Option<u32>) -> Self {182 pub fn from_opt_int(field: CollectionLimitField, value: Option<u32>) -> Self {180 value183 value181 .map(|v| Self {184 .map(|v| Self {190 })193 })191 }194 }192195196 /// Make [`CollectionLimit`] from [`CollectionLimitField`] and bool value.193 pub fn from_opt_bool(field: CollectionLimitField, value: Option<bool>) -> Self {197 pub fn from_opt_bool(field: CollectionLimitField, value: Option<bool>) -> Self {194 value198 value195 .map(|v| Self {199 .map(|v| Self {306}310}307311308impl PropertyPermission {312impl PropertyPermission {313 /// Make vector of [`PropertyPermission`] from [`up_data_structs::PropertyPermission`].309 pub fn into_vec(pp: up_data_structs::PropertyPermission) -> Vec<Self> {314 pub fn into_vec(pp: up_data_structs::PropertyPermission) -> Vec<Self> {310 vec![315 vec![311 PropertyPermission {316 PropertyPermission {323 ]328 ]324 }329 }325330331 /// Make [`up_data_structs::PropertyPermission`] from vector of [`PropertyPermission`].326 pub fn from_vec(permission: Vec<Self>) -> up_data_structs::PropertyPermission {332 pub fn from_vec(permission: Vec<Self>) -> up_data_structs::PropertyPermission {327 let mut token_permission = up_data_structs::PropertyPermission::default();333 let mut token_permission = up_data_structs::PropertyPermission::default();328334367}373}368374369impl TokenPropertyPermission {375impl TokenPropertyPermission {376 /// Convert vector of [`TokenPropertyPermission`] into vector of [`up_data_structs::PropertyKeyPermission`].370 pub fn into_property_key_permissions(377 pub fn into_property_key_permissions(371 permissions: Vec<TokenPropertyPermission>,378 permissions: Vec<TokenPropertyPermission>,372 ) -> evm_coder::execution::Result<Vec<up_data_structs::PropertyKeyPermission>> {379 ) -> evm_coder::execution::Result<Vec<up_data_structs::PropertyKeyPermission>> {pallets/evm-contract-helpers/src/eth.rsdiffbeforeafterboth25 types::*,25 types::*,26 ToLog,26 ToLog,27};27};28use pallet_common::eth::EthCrossAccount;29use pallet_evm::{28use pallet_evm::{30 ExitRevert, OnCreate, OnMethodCall, PrecompileResult, PrecompileFailure, PrecompileHandle,29 ExitRevert, OnCreate, OnMethodCall, PrecompileResult, PrecompileFailure, PrecompileHandle,31 account::CrossAccountId,30 account::CrossAccountId,175 ///174 ///176 /// @param contractAddress The contract for which a sponsor is requested.175 /// @param contractAddress The contract for which a sponsor is requested.177 /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.176 /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.178 fn sponsor(&self, contract_address: address) -> Result<EthCrossAccount> {177 fn sponsor(&self, contract_address: address) -> Result<pallet_common::eth::CrossAccount> {179 Ok(EthCrossAccount::from_sub_cross_account::<T>(178 Ok(179 pallet_common::eth::CrossAccount::from_sub_cross_account::<T>(180 &Pallet::<T>::get_sponsor(contract_address).ok_or("Contract has no sponsor")?,180 &Pallet::<T>::get_sponsor(contract_address).ok_or("Contract has no sponsor")?,181 ))181 ),182 )182 }183 }183184pallets/evm-contract-helpers/src/stubs/ContractHelpers.rawdiffbeforeafterbothbinary blob — no preview
pallets/evm-contract-helpers/src/stubs/ContractHelpers.soldiffbeforeafterboth96 /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.96 /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.97 /// @dev EVM selector for this function is: 0x766c4f37,97 /// @dev EVM selector for this function is: 0x766c4f37,98 /// or in textual repr: sponsor(address)98 /// or in textual repr: sponsor(address)99 function sponsor(address contractAddress) public view returns (EthCrossAccount memory) {99 function sponsor(address contractAddress) public view returns (CrossAccount memory) {100 require(false, stub_error);100 require(false, stub_error);101 contractAddress;101 contractAddress;102 dummy;102 dummy;103 return EthCrossAccount(0x0000000000000000000000000000000000000000, 0);103 return CrossAccount(0x0000000000000000000000000000000000000000, 0);104 }104 }105105106 /// Check tat contract has confirmed sponsor.106 /// Check tat contract has confirmed sponsor.266}266}267267268/// @dev Cross account struct268/// @dev Cross account struct269struct EthCrossAccount {269struct CrossAccount {270 address eth;270 address eth;271 uint256 sub;271 uint256 sub;272}272}pallets/fungible/src/erc.rsdiffbeforeafterboth27use pallet_common::{27use pallet_common::{28 CollectionHandle,28 CollectionHandle,29 erc::{CommonEvmHandler, PrecompileResult, CollectionCall},29 erc::{CommonEvmHandler, PrecompileResult, CollectionCall},30 eth::EthCrossAccount,31};30};32use sp_std::vec::Vec;31use sp_std::vec::Vec;33use pallet_evm::{account::CrossAccountId, PrecompileHandle};32use pallet_evm::{account::CrossAccountId, PrecompileHandle};175 }174 }176175177 #[weight(<SelfWeightOf<T>>::create_item())]176 #[weight(<SelfWeightOf<T>>::create_item())]178 fn mint_cross(&mut self, caller: caller, to: EthCrossAccount, amount: uint256) -> Result<bool> {177 fn mint_cross(178 &mut self,179 caller: caller,180 to: pallet_common::eth::CrossAccount,181 amount: uint256,182 ) -> Result<bool> {179 let caller = T::CrossAccountId::from_eth(caller);183 let caller = T::CrossAccountId::from_eth(caller);180 let to = to.into_sub_cross_account::<T>()?;184 let to = to.into_sub_cross_account::<T>()?;191 fn approve_cross(195 fn approve_cross(192 &mut self,196 &mut self,193 caller: caller,197 caller: caller,194 spender: EthCrossAccount,198 spender: pallet_common::eth::CrossAccount,195 amount: uint256,199 amount: uint256,196 ) -> Result<bool> {200 ) -> Result<bool> {197 let caller = T::CrossAccountId::from_eth(caller);201 let caller = T::CrossAccountId::from_eth(caller);232 fn burn_from_cross(236 fn burn_from_cross(233 &mut self,237 &mut self,234 caller: caller,238 caller: caller,235 from: EthCrossAccount,239 from: pallet_common::eth::CrossAccount,236 amount: uint256,240 amount: uint256,237 ) -> Result<bool> {241 ) -> Result<bool> {238 let caller = T::CrossAccountId::from_eth(caller);242 let caller = T::CrossAccountId::from_eth(caller);274 fn transfer_cross(278 fn transfer_cross(275 &mut self,279 &mut self,276 caller: caller,280 caller: caller,277 to: EthCrossAccount,281 to: pallet_common::eth::CrossAccount,278 amount: uint256,282 amount: uint256,279 ) -> Result<bool> {283 ) -> Result<bool> {280 let caller = T::CrossAccountId::from_eth(caller);284 let caller = T::CrossAccountId::from_eth(caller);292 fn transfer_from_cross(296 fn transfer_from_cross(293 &mut self,297 &mut self,294 caller: caller,298 caller: caller,295 from: EthCrossAccount,299 from: pallet_common::eth::CrossAccount,296 to: EthCrossAccount,300 to: pallet_common::eth::CrossAccount,297 amount: uint256,301 amount: uint256,298 ) -> Result<bool> {302 ) -> Result<bool> {299 let caller = T::CrossAccountId::from_eth(caller);303 let caller = T::CrossAccountId::from_eth(caller);pallets/fungible/src/stubs/UniqueFungible.rawdiffbeforeafterbothbinary blob — no preview
pallets/fungible/src/stubs/UniqueFungible.soldiffbeforeafterboth114 /// @param sponsor Cross account address of the sponsor from whose account funds will be debited for operations with the contract.114 /// @param sponsor Cross account address of the sponsor from whose account funds will be debited for operations with the contract.115 /// @dev EVM selector for this function is: 0x84a1d5a8,115 /// @dev EVM selector for this function is: 0x84a1d5a8,116 /// or in textual repr: setCollectionSponsorCross((address,uint256))116 /// or in textual repr: setCollectionSponsorCross((address,uint256))117 function setCollectionSponsorCross(EthCrossAccount memory sponsor) public {117 function setCollectionSponsorCross(CrossAccount memory sponsor) public {118 require(false, stub_error);118 require(false, stub_error);119 sponsor;119 sponsor;120 dummy = 0;120 dummy = 0;152 /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.152 /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.153 /// @dev EVM selector for this function is: 0x6ec0a9f1,153 /// @dev EVM selector for this function is: 0x6ec0a9f1,154 /// or in textual repr: collectionSponsor()154 /// or in textual repr: collectionSponsor()155 function collectionSponsor() public view returns (EthCrossAccount memory) {155 function collectionSponsor() public view returns (CrossAccount memory) {156 require(false, stub_error);156 require(false, stub_error);157 dummy;157 dummy;158 return EthCrossAccount(0x0000000000000000000000000000000000000000, 0);158 return CrossAccount(0x0000000000000000000000000000000000000000, 0);159 }159 }160160161 /// Get current collection limits.161 /// Get current collection limits.193 /// @param newAdmin Cross account administrator address.193 /// @param newAdmin Cross account administrator address.194 /// @dev EVM selector for this function is: 0x859aa7d6,194 /// @dev EVM selector for this function is: 0x859aa7d6,195 /// or in textual repr: addCollectionAdminCross((address,uint256))195 /// or in textual repr: addCollectionAdminCross((address,uint256))196 function addCollectionAdminCross(EthCrossAccount memory newAdmin) public {196 function addCollectionAdminCross(CrossAccount memory newAdmin) public {197 require(false, stub_error);197 require(false, stub_error);198 newAdmin;198 newAdmin;199 dummy = 0;199 dummy = 0;203 /// @param admin Cross account administrator address.203 /// @param admin Cross account administrator address.204 /// @dev EVM selector for this function is: 0x6c0cd173,204 /// @dev EVM selector for this function is: 0x6c0cd173,205 /// or in textual repr: removeCollectionAdminCross((address,uint256))205 /// or in textual repr: removeCollectionAdminCross((address,uint256))206 function removeCollectionAdminCross(EthCrossAccount memory admin) public {206 function removeCollectionAdminCross(CrossAccount memory admin) public {207 require(false, stub_error);207 require(false, stub_error);208 admin;208 admin;209 dummy = 0;209 dummy = 0;289 /// @param user User address to check.289 /// @param user User address to check.290 /// @dev EVM selector for this function is: 0x91b6df49,290 /// @dev EVM selector for this function is: 0x91b6df49,291 /// or in textual repr: allowlistedCross((address,uint256))291 /// or in textual repr: allowlistedCross((address,uint256))292 function allowlistedCross(EthCrossAccount memory user) public view returns (bool) {292 function allowlistedCross(CrossAccount memory user) public view returns (bool) {293 require(false, stub_error);293 require(false, stub_error);294 user;294 user;295 dummy;295 dummy;312 /// @param user User cross account address.312 /// @param user User cross account address.313 /// @dev EVM selector for this function is: 0xa0184a3a,313 /// @dev EVM selector for this function is: 0xa0184a3a,314 /// or in textual repr: addToCollectionAllowListCross((address,uint256))314 /// or in textual repr: addToCollectionAllowListCross((address,uint256))315 function addToCollectionAllowListCross(EthCrossAccount memory user) public {315 function addToCollectionAllowListCross(CrossAccount memory user) public {316 require(false, stub_error);316 require(false, stub_error);317 user;317 user;318 dummy = 0;318 dummy = 0;334 /// @param user User cross account address.334 /// @param user User cross account address.335 /// @dev EVM selector for this function is: 0x09ba452a,335 /// @dev EVM selector for this function is: 0x09ba452a,336 /// or in textual repr: removeFromCollectionAllowListCross((address,uint256))336 /// or in textual repr: removeFromCollectionAllowListCross((address,uint256))337 function removeFromCollectionAllowListCross(EthCrossAccount memory user) public {337 function removeFromCollectionAllowListCross(CrossAccount memory user) public {338 require(false, stub_error);338 require(false, stub_error);339 user;339 user;340 dummy = 0;340 dummy = 0;370 /// @return "true" if account is the owner or admin370 /// @return "true" if account is the owner or admin371 /// @dev EVM selector for this function is: 0x3e75a905,371 /// @dev EVM selector for this function is: 0x3e75a905,372 /// or in textual repr: isOwnerOrAdminCross((address,uint256))372 /// or in textual repr: isOwnerOrAdminCross((address,uint256))373 function isOwnerOrAdminCross(EthCrossAccount memory user) public view returns (bool) {373 function isOwnerOrAdminCross(CrossAccount memory user) public view returns (bool) {374 require(false, stub_error);374 require(false, stub_error);375 user;375 user;376 dummy;376 dummy;394 /// If address is canonical then substrate mirror is zero and vice versa.394 /// If address is canonical then substrate mirror is zero and vice versa.395 /// @dev EVM selector for this function is: 0xdf727d3b,395 /// @dev EVM selector for this function is: 0xdf727d3b,396 /// or in textual repr: collectionOwner()396 /// or in textual repr: collectionOwner()397 function collectionOwner() public view returns (EthCrossAccount memory) {397 function collectionOwner() public view returns (CrossAccount memory) {398 require(false, stub_error);398 require(false, stub_error);399 dummy;399 dummy;400 return EthCrossAccount(0x0000000000000000000000000000000000000000, 0);400 return CrossAccount(0x0000000000000000000000000000000000000000, 0);401 }401 }402402403 // /// Changes collection owner to another account403 // /// Changes collection owner to another account418 /// If address is canonical then substrate mirror is zero and vice versa.418 /// If address is canonical then substrate mirror is zero and vice versa.419 /// @dev EVM selector for this function is: 0x5813216b,419 /// @dev EVM selector for this function is: 0x5813216b,420 /// or in textual repr: collectionAdmins()420 /// or in textual repr: collectionAdmins()421 function collectionAdmins() public view returns (EthCrossAccount[] memory) {421 function collectionAdmins() public view returns (CrossAccount[] memory) {422 require(false, stub_error);422 require(false, stub_error);423 dummy;423 dummy;424 return new EthCrossAccount[](0);424 return new CrossAccount[](0);425 }425 }426426427 /// Changes collection owner to another account427 /// Changes collection owner to another account430 /// @param newOwner new owner cross account430 /// @param newOwner new owner cross account431 /// @dev EVM selector for this function is: 0x6496c497,431 /// @dev EVM selector for this function is: 0x6496c497,432 /// or in textual repr: changeCollectionOwnerCross((address,uint256))432 /// or in textual repr: changeCollectionOwnerCross((address,uint256))433 function changeCollectionOwnerCross(EthCrossAccount memory newOwner) public {433 function changeCollectionOwnerCross(CrossAccount memory newOwner) public {434 require(false, stub_error);434 require(false, stub_error);435 newOwner;435 newOwner;436 dummy = 0;436 dummy = 0;437 }437 }438}438}439439440/// @dev Cross account struct440/// @dev Cross account struct441struct EthCrossAccount {441struct CrossAccount {442 address eth;442 address eth;443 uint256 sub;443 uint256 sub;444}444}463 uint256[] field_1;463 uint256[] field_1;464}464}465465466/// @dev [`CollectionLimits`](up_data_structs::CollectionLimits) field representation for EVM.466struct CollectionLimit {467struct CollectionLimit {467 CollectionLimitField field;468 CollectionLimitField field;468 bool status;469 bool status;469 uint256 value;470 uint256 value;470}471}471472472/// @dev [`CollectionLimits`](up_data_structs::CollectionLimits) representation for EVM.473/// @dev [`CollectionLimits`](up_data_structs::CollectionLimits) fields representation for EVM.473enum CollectionLimitField {474enum CollectionLimitField {474 /// @dev How many tokens can a user have on one account.475 /// @dev How many tokens can a user have on one account.475 AccountTokenOwnership,476 AccountTokenOwnership,512513513 /// @dev EVM selector for this function is: 0x269e6158,514 /// @dev EVM selector for this function is: 0x269e6158,514 /// or in textual repr: mintCross((address,uint256),uint256)515 /// or in textual repr: mintCross((address,uint256),uint256)515 function mintCross(EthCrossAccount memory to, uint256 amount) public returns (bool) {516 function mintCross(CrossAccount memory to, uint256 amount) public returns (bool) {516 require(false, stub_error);517 require(false, stub_error);517 to;518 to;518 amount;519 amount;522523523 /// @dev EVM selector for this function is: 0x0ecd0ab0,524 /// @dev EVM selector for this function is: 0x0ecd0ab0,524 /// or in textual repr: approveCross((address,uint256),uint256)525 /// or in textual repr: approveCross((address,uint256),uint256)525 function approveCross(EthCrossAccount memory spender, uint256 amount) public returns (bool) {526 function approveCross(CrossAccount memory spender, uint256 amount) public returns (bool) {526 require(false, stub_error);527 require(false, stub_error);527 spender;528 spender;528 amount;529 amount;552 /// @param amount The amount that will be burnt.553 /// @param amount The amount that will be burnt.553 /// @dev EVM selector for this function is: 0xbb2f5a58,554 /// @dev EVM selector for this function is: 0xbb2f5a58,554 /// or in textual repr: burnFromCross((address,uint256),uint256)555 /// or in textual repr: burnFromCross((address,uint256),uint256)555 function burnFromCross(EthCrossAccount memory from, uint256 amount) public returns (bool) {556 function burnFromCross(CrossAccount memory from, uint256 amount) public returns (bool) {556 require(false, stub_error);557 require(false, stub_error);557 from;558 from;558 amount;559 amount;573574574 /// @dev EVM selector for this function is: 0x2ada85ff,575 /// @dev EVM selector for this function is: 0x2ada85ff,575 /// or in textual repr: transferCross((address,uint256),uint256)576 /// or in textual repr: transferCross((address,uint256),uint256)576 function transferCross(EthCrossAccount memory to, uint256 amount) public returns (bool) {577 function transferCross(CrossAccount memory to, uint256 amount) public returns (bool) {577 require(false, stub_error);578 require(false, stub_error);578 to;579 to;579 amount;580 amount;584 /// @dev EVM selector for this function is: 0xd5cf430b,585 /// @dev EVM selector for this function is: 0xd5cf430b,585 /// or in textual repr: transferFromCross((address,uint256),(address,uint256),uint256)586 /// or in textual repr: transferFromCross((address,uint256),(address,uint256),uint256)586 function transferFromCross(587 function transferFromCross(587 EthCrossAccount memory from,588 CrossAccount memory from,588 EthCrossAccount memory to,589 CrossAccount memory to,589 uint256 amount590 uint256 amount590 ) public returns (bool) {591 ) public returns (bool) {591 require(false, stub_error);592 require(false, stub_error);pallets/nonfungible/src/erc.rsdiffbeforeafterboth38use pallet_common::{38use pallet_common::{39 CollectionHandle, CollectionPropertyPermissions, CommonCollectionOperations,39 CollectionHandle, CollectionPropertyPermissions, CommonCollectionOperations,40 erc::{CommonEvmHandler, PrecompileResult, CollectionCall, static_property::key},40 erc::{CommonEvmHandler, PrecompileResult, CollectionCall, static_property::key},41 eth::{Property as PropertyStruct, EthCrossAccount},42};41};43use pallet_evm::{account::CrossAccountId, PrecompileHandle};42use pallet_evm::{account::CrossAccountId, PrecompileHandle};44use pallet_evm_coder_substrate::call;43use pallet_evm_coder_substrate::call;160 &mut self,159 &mut self,161 caller: caller,160 caller: caller,162 token_id: uint256,161 token_id: uint256,163 properties: Vec<PropertyStruct>,162 properties: Vec<pallet_common::eth::Property>,164 ) -> Result<()> {163 ) -> Result<()> {165 let caller = T::CrossAccountId::from_eth(caller);164 let caller = T::CrossAccountId::from_eth(caller);166 let token_id: u32 = token_id.try_into().map_err(|_| "token id overflow")?;165 let token_id: u32 = token_id.try_into().map_err(|_| "token id overflow")?;171170172 let properties = properties171 let properties = properties173 .into_iter()172 .into_iter()174 .map(|PropertyStruct { key, value }| {173 .map(|pallet_common::eth::Property { key, value }| {175 let key = <Vec<u8>>::from(key)174 let key = <Vec<u8>>::from(key)176 .try_into()175 .try_into()177 .map_err(|_| "key too large")?;176 .map_err(|_| "key too large")?;762 /// Returns the owner (in cross format) of the token.761 /// Returns the owner (in cross format) of the token.763 ///762 ///764 /// @param tokenId Id for the token.763 /// @param tokenId Id for the token.765 fn cross_owner_of(&self, token_id: uint256) -> Result<EthCrossAccount> {764 fn cross_owner_of(&self, token_id: uint256) -> Result<pallet_common::eth::CrossAccount> {766 Self::token_owner(&self, token_id.try_into()?)765 Self::token_owner(&self, token_id.try_into()?)767 .map(|o| EthCrossAccount::from_sub_cross_account::<T>(&o))766 .map(|o| pallet_common::eth::CrossAccount::from_sub_cross_account::<T>(&o))768 .ok_or(Error::Revert("key too large".into()))767 .ok_or(Error::Revert("key too large".into()))769 }768 }770769773 /// @param tokenId Id for the token.772 /// @param tokenId Id for the token.774 /// @param keys Properties keys. Empty keys for all propertyes.773 /// @param keys Properties keys. Empty keys for all propertyes.775 /// @return Vector of properties key/value pairs.774 /// @return Vector of properties key/value pairs.776 fn properties(&self, token_id: uint256, keys: Vec<string>) -> Result<Vec<PropertyStruct>> {775 fn properties(776 &self,777 token_id: uint256,778 keys: Vec<string>,779 ) -> Result<Vec<pallet_common::eth::Property>> {777 let keys = keys780 let keys = keys778 .into_iter()781 .into_iter()779 .map(|key| {782 .map(|key| {793 let key = string::from_utf8(p.key.to_vec())796 let key = string::from_utf8(p.key.to_vec())794 .map_err(|e| Error::Revert(alloc::format!("{}", e)))?;797 .map_err(|e| Error::Revert(alloc::format!("{}", e)))?;795 let value = bytes(p.value.to_vec());798 let value = bytes(p.value.to_vec());796 Ok(PropertyStruct { key, value })799 Ok(pallet_common::eth::Property { key, value })797 })800 })798 .collect::<Result<Vec<_>>>()801 .collect::<Result<Vec<_>>>()799 }802 }808 fn approve_cross(811 fn approve_cross(809 &mut self,812 &mut self,810 caller: caller,813 caller: caller,811 approved: EthCrossAccount,814 approved: pallet_common::eth::CrossAccount,812 token_id: uint256,815 token_id: uint256,813 ) -> Result<void> {816 ) -> Result<void> {814 let caller = T::CrossAccountId::from_eth(caller);817 let caller = T::CrossAccountId::from_eth(caller);847 fn transfer_cross(850 fn transfer_cross(848 &mut self,851 &mut self,849 caller: caller,852 caller: caller,850 to: EthCrossAccount,853 to: pallet_common::eth::CrossAccount,851 token_id: uint256,854 token_id: uint256,852 ) -> Result<void> {855 ) -> Result<void> {853 let caller = T::CrossAccountId::from_eth(caller);856 let caller = T::CrossAccountId::from_eth(caller);871 fn transfer_from_cross(874 fn transfer_from_cross(872 &mut self,875 &mut self,873 caller: caller,876 caller: caller,874 from: EthCrossAccount,877 from: pallet_common::eth::CrossAccount,875 to: EthCrossAccount,878 to: pallet_common::eth::CrossAccount,876 token_id: uint256,879 token_id: uint256,877 ) -> Result<void> {880 ) -> Result<void> {878 let caller = T::CrossAccountId::from_eth(caller);881 let caller = T::CrossAccountId::from_eth(caller);918 fn burn_from_cross(921 fn burn_from_cross(919 &mut self,922 &mut self,920 caller: caller,923 caller: caller,921 from: EthCrossAccount,924 from: pallet_common::eth::CrossAccount,922 token_id: uint256,925 token_id: uint256,923 ) -> Result<void> {926 ) -> Result<void> {924 let caller = T::CrossAccountId::from_eth(caller);927 let caller = T::CrossAccountId::from_eth(caller);1040 fn mint_cross(1043 fn mint_cross(1041 &mut self,1044 &mut self,1042 caller: caller,1045 caller: caller,1043 to: EthCrossAccount,1046 to: pallet_common::eth::CrossAccount,1044 properties: Vec<PropertyStruct>,1047 properties: Vec<pallet_common::eth::Property>,1045 ) -> Result<uint256> {1048 ) -> Result<uint256> {1046 let token_id = <TokensMinted<T>>::get(self.id)1049 let token_id = <TokensMinted<T>>::get(self.id)1047 .checked_add(1)1050 .checked_add(1)105110541052 let properties = properties1055 let properties = properties1053 .into_iter()1056 .into_iter()1054 .map(|PropertyStruct { key, value }| {1057 .map(|pallet_common::eth::Property { key, value }| {1055 let key = <Vec<u8>>::from(key)1058 let key = <Vec<u8>>::from(key)1056 .try_into()1059 .try_into()1057 .map_err(|_| "key too large")?;1060 .map_err(|_| "key too large")?;pallets/nonfungible/src/stubs/UniqueNFT.rawdiffbeforeafterbothbinary blob — no preview
pallets/nonfungible/src/stubs/UniqueNFT.soldiffbeforeafterboth258 /// @param sponsor Cross account address of the sponsor from whose account funds will be debited for operations with the contract.258 /// @param sponsor Cross account address of the sponsor from whose account funds will be debited for operations with the contract.259 /// @dev EVM selector for this function is: 0x84a1d5a8,259 /// @dev EVM selector for this function is: 0x84a1d5a8,260 /// or in textual repr: setCollectionSponsorCross((address,uint256))260 /// or in textual repr: setCollectionSponsorCross((address,uint256))261 function setCollectionSponsorCross(EthCrossAccount memory sponsor) public {261 function setCollectionSponsorCross(CrossAccount memory sponsor) public {262 require(false, stub_error);262 require(false, stub_error);263 sponsor;263 sponsor;264 dummy = 0;264 dummy = 0;296 /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.296 /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.297 /// @dev EVM selector for this function is: 0x6ec0a9f1,297 /// @dev EVM selector for this function is: 0x6ec0a9f1,298 /// or in textual repr: collectionSponsor()298 /// or in textual repr: collectionSponsor()299 function collectionSponsor() public view returns (EthCrossAccount memory) {299 function collectionSponsor() public view returns (CrossAccount memory) {300 require(false, stub_error);300 require(false, stub_error);301 dummy;301 dummy;302 return EthCrossAccount(0x0000000000000000000000000000000000000000, 0);302 return CrossAccount(0x0000000000000000000000000000000000000000, 0);303 }303 }304304305 /// Get current collection limits.305 /// Get current collection limits.337 /// @param newAdmin Cross account administrator address.337 /// @param newAdmin Cross account administrator address.338 /// @dev EVM selector for this function is: 0x859aa7d6,338 /// @dev EVM selector for this function is: 0x859aa7d6,339 /// or in textual repr: addCollectionAdminCross((address,uint256))339 /// or in textual repr: addCollectionAdminCross((address,uint256))340 function addCollectionAdminCross(EthCrossAccount memory newAdmin) public {340 function addCollectionAdminCross(CrossAccount memory newAdmin) public {341 require(false, stub_error);341 require(false, stub_error);342 newAdmin;342 newAdmin;343 dummy = 0;343 dummy = 0;347 /// @param admin Cross account administrator address.347 /// @param admin Cross account administrator address.348 /// @dev EVM selector for this function is: 0x6c0cd173,348 /// @dev EVM selector for this function is: 0x6c0cd173,349 /// or in textual repr: removeCollectionAdminCross((address,uint256))349 /// or in textual repr: removeCollectionAdminCross((address,uint256))350 function removeCollectionAdminCross(EthCrossAccount memory admin) public {350 function removeCollectionAdminCross(CrossAccount memory admin) public {351 require(false, stub_error);351 require(false, stub_error);352 admin;352 admin;353 dummy = 0;353 dummy = 0;433 /// @param user User address to check.433 /// @param user User address to check.434 /// @dev EVM selector for this function is: 0x91b6df49,434 /// @dev EVM selector for this function is: 0x91b6df49,435 /// or in textual repr: allowlistedCross((address,uint256))435 /// or in textual repr: allowlistedCross((address,uint256))436 function allowlistedCross(EthCrossAccount memory user) public view returns (bool) {436 function allowlistedCross(CrossAccount memory user) public view returns (bool) {437 require(false, stub_error);437 require(false, stub_error);438 user;438 user;439 dummy;439 dummy;456 /// @param user User cross account address.456 /// @param user User cross account address.457 /// @dev EVM selector for this function is: 0xa0184a3a,457 /// @dev EVM selector for this function is: 0xa0184a3a,458 /// or in textual repr: addToCollectionAllowListCross((address,uint256))458 /// or in textual repr: addToCollectionAllowListCross((address,uint256))459 function addToCollectionAllowListCross(EthCrossAccount memory user) public {459 function addToCollectionAllowListCross(CrossAccount memory user) public {460 require(false, stub_error);460 require(false, stub_error);461 user;461 user;462 dummy = 0;462 dummy = 0;478 /// @param user User cross account address.478 /// @param user User cross account address.479 /// @dev EVM selector for this function is: 0x09ba452a,479 /// @dev EVM selector for this function is: 0x09ba452a,480 /// or in textual repr: removeFromCollectionAllowListCross((address,uint256))480 /// or in textual repr: removeFromCollectionAllowListCross((address,uint256))481 function removeFromCollectionAllowListCross(EthCrossAccount memory user) public {481 function removeFromCollectionAllowListCross(CrossAccount memory user) public {482 require(false, stub_error);482 require(false, stub_error);483 user;483 user;484 dummy = 0;484 dummy = 0;514 /// @return "true" if account is the owner or admin514 /// @return "true" if account is the owner or admin515 /// @dev EVM selector for this function is: 0x3e75a905,515 /// @dev EVM selector for this function is: 0x3e75a905,516 /// or in textual repr: isOwnerOrAdminCross((address,uint256))516 /// or in textual repr: isOwnerOrAdminCross((address,uint256))517 function isOwnerOrAdminCross(EthCrossAccount memory user) public view returns (bool) {517 function isOwnerOrAdminCross(CrossAccount memory user) public view returns (bool) {518 require(false, stub_error);518 require(false, stub_error);519 user;519 user;520 dummy;520 dummy;538 /// If address is canonical then substrate mirror is zero and vice versa.538 /// If address is canonical then substrate mirror is zero and vice versa.539 /// @dev EVM selector for this function is: 0xdf727d3b,539 /// @dev EVM selector for this function is: 0xdf727d3b,540 /// or in textual repr: collectionOwner()540 /// or in textual repr: collectionOwner()541 function collectionOwner() public view returns (EthCrossAccount memory) {541 function collectionOwner() public view returns (CrossAccount memory) {542 require(false, stub_error);542 require(false, stub_error);543 dummy;543 dummy;544 return EthCrossAccount(0x0000000000000000000000000000000000000000, 0);544 return CrossAccount(0x0000000000000000000000000000000000000000, 0);545 }545 }546546547 // /// Changes collection owner to another account547 // /// Changes collection owner to another account562 /// If address is canonical then substrate mirror is zero and vice versa.562 /// If address is canonical then substrate mirror is zero and vice versa.563 /// @dev EVM selector for this function is: 0x5813216b,563 /// @dev EVM selector for this function is: 0x5813216b,564 /// or in textual repr: collectionAdmins()564 /// or in textual repr: collectionAdmins()565 function collectionAdmins() public view returns (EthCrossAccount[] memory) {565 function collectionAdmins() public view returns (CrossAccount[] memory) {566 require(false, stub_error);566 require(false, stub_error);567 dummy;567 dummy;568 return new EthCrossAccount[](0);568 return new CrossAccount[](0);569 }569 }570570571 /// Changes collection owner to another account571 /// Changes collection owner to another account574 /// @param newOwner new owner cross account574 /// @param newOwner new owner cross account575 /// @dev EVM selector for this function is: 0x6496c497,575 /// @dev EVM selector for this function is: 0x6496c497,576 /// or in textual repr: changeCollectionOwnerCross((address,uint256))576 /// or in textual repr: changeCollectionOwnerCross((address,uint256))577 function changeCollectionOwnerCross(EthCrossAccount memory newOwner) public {577 function changeCollectionOwnerCross(CrossAccount memory newOwner) public {578 require(false, stub_error);578 require(false, stub_error);579 newOwner;579 newOwner;580 dummy = 0;580 dummy = 0;581 }581 }582}582}583583584/// @dev Cross account struct584/// @dev Cross account struct585struct EthCrossAccount {585struct CrossAccount {586 address eth;586 address eth;587 uint256 sub;587 uint256 sub;588}588}607 uint256[] field_1;607 uint256[] field_1;608}608}609609610/// @dev [`CollectionLimits`](up_data_structs::CollectionLimits) field representation for EVM.610struct CollectionLimit {611struct CollectionLimit {611 CollectionLimitField field;612 CollectionLimitField field;612 bool status;613 bool status;613 uint256 value;614 uint256 value;614}615}615616616/// @dev [`CollectionLimits`](up_data_structs::CollectionLimits) representation for EVM.617/// @dev [`CollectionLimits`](up_data_structs::CollectionLimits) fields representation for EVM.617enum CollectionLimitField {618enum CollectionLimitField {618 /// @dev How many tokens can a user have on one account.619 /// @dev How many tokens can a user have on one account.619 AccountTokenOwnership,620 AccountTokenOwnership,813 /// @param tokenId Id for the token.814 /// @param tokenId Id for the token.814 /// @dev EVM selector for this function is: 0x2b29dace,815 /// @dev EVM selector for this function is: 0x2b29dace,815 /// or in textual repr: crossOwnerOf(uint256)816 /// or in textual repr: crossOwnerOf(uint256)816 function crossOwnerOf(uint256 tokenId) public view returns (EthCrossAccount memory) {817 function crossOwnerOf(uint256 tokenId) public view returns (CrossAccount memory) {817 require(false, stub_error);818 require(false, stub_error);818 tokenId;819 tokenId;819 dummy;820 dummy;820 return EthCrossAccount(0x0000000000000000000000000000000000000000, 0);821 return CrossAccount(0x0000000000000000000000000000000000000000, 0);821 }822 }822823823 /// Returns the token properties.824 /// Returns the token properties.843 /// @param tokenId The NFT to approve844 /// @param tokenId The NFT to approve844 /// @dev EVM selector for this function is: 0x0ecd0ab0,845 /// @dev EVM selector for this function is: 0x0ecd0ab0,845 /// or in textual repr: approveCross((address,uint256),uint256)846 /// or in textual repr: approveCross((address,uint256),uint256)846 function approveCross(EthCrossAccount memory approved, uint256 tokenId) public {847 function approveCross(CrossAccount memory approved, uint256 tokenId) public {847 require(false, stub_error);848 require(false, stub_error);848 approved;849 approved;849 tokenId;850 tokenId;871 /// @param tokenId The NFT to transfer872 /// @param tokenId The NFT to transfer872 /// @dev EVM selector for this function is: 0x2ada85ff,873 /// @dev EVM selector for this function is: 0x2ada85ff,873 /// or in textual repr: transferCross((address,uint256),uint256)874 /// or in textual repr: transferCross((address,uint256),uint256)874 function transferCross(EthCrossAccount memory to, uint256 tokenId) public {875 function transferCross(CrossAccount memory to, uint256 tokenId) public {875 require(false, stub_error);876 require(false, stub_error);876 to;877 to;877 tokenId;878 tokenId;887 /// @dev EVM selector for this function is: 0xd5cf430b,888 /// @dev EVM selector for this function is: 0xd5cf430b,888 /// or in textual repr: transferFromCross((address,uint256),(address,uint256),uint256)889 /// or in textual repr: transferFromCross((address,uint256),(address,uint256),uint256)889 function transferFromCross(890 function transferFromCross(890 EthCrossAccount memory from,891 CrossAccount memory from,891 EthCrossAccount memory to,892 CrossAccount memory to,892 uint256 tokenId893 uint256 tokenId893 ) public {894 ) public {894 require(false, stub_error);895 require(false, stub_error);921 /// @param tokenId The NFT to transfer922 /// @param tokenId The NFT to transfer922 /// @dev EVM selector for this function is: 0xbb2f5a58,923 /// @dev EVM selector for this function is: 0xbb2f5a58,923 /// or in textual repr: burnFromCross((address,uint256),uint256)924 /// or in textual repr: burnFromCross((address,uint256),uint256)924 function burnFromCross(EthCrossAccount memory from, uint256 tokenId) public {925 function burnFromCross(CrossAccount memory from, uint256 tokenId) public {925 require(false, stub_error);926 require(false, stub_error);926 from;927 from;927 tokenId;928 tokenId;973 /// @return uint256 The id of the newly minted token974 /// @return uint256 The id of the newly minted token974 /// @dev EVM selector for this function is: 0xb904db03,975 /// @dev EVM selector for this function is: 0xb904db03,975 /// or in textual repr: mintCross((address,uint256),(string,bytes)[])976 /// or in textual repr: mintCross((address,uint256),(string,bytes)[])976 function mintCross(EthCrossAccount memory to, Property[] memory properties) public returns (uint256) {977 function mintCross(CrossAccount memory to, Property[] memory properties) public returns (uint256) {977 require(false, stub_error);978 require(false, stub_error);978 to;979 to;979 properties;980 properties;pallets/refungible/src/erc.rsdiffbeforeafterboth33use pallet_common::{33use pallet_common::{34 CollectionHandle, CollectionPropertyPermissions, CommonCollectionOperations,34 CollectionHandle, CollectionPropertyPermissions, CommonCollectionOperations,35 erc::{CommonEvmHandler, CollectionCall, static_property::key},35 erc::{CommonEvmHandler, CollectionCall, static_property::key},36 eth::{Property as PropertyStruct, EthCrossAccount},37 Error as CommonError,36 Error as CommonError,38};37};39use pallet_evm::{account::CrossAccountId, PrecompileHandle};38use pallet_evm::{account::CrossAccountId, PrecompileHandle};163 &mut self,162 &mut self,164 caller: caller,163 caller: caller,165 token_id: uint256,164 token_id: uint256,166 properties: Vec<PropertyStruct>,165 properties: Vec<pallet_common::eth::Property>,167 ) -> Result<()> {166 ) -> Result<()> {168 let caller = T::CrossAccountId::from_eth(caller);167 let caller = T::CrossAccountId::from_eth(caller);169 let token_id: u32 = token_id.try_into().map_err(|_| "token id overflow")?;168 let token_id: u32 = token_id.try_into().map_err(|_| "token id overflow")?;174173175 let properties = properties174 let properties = properties176 .into_iter()175 .into_iter()177 .map(|PropertyStruct { key, value }| {176 .map(|pallet_common::eth::Property { key, value }| {178 let key = <Vec<u8>>::from(key)177 let key = <Vec<u8>>::from(key)179 .try_into()178 .try_into()180 .map_err(|_| "key too large")?;179 .map_err(|_| "key too large")?;797 /// Returns the owner (in cross format) of the token.796 /// Returns the owner (in cross format) of the token.798 ///797 ///799 /// @param tokenId Id for the token.798 /// @param tokenId Id for the token.800 fn cross_owner_of(&self, token_id: uint256) -> Result<EthCrossAccount> {799 fn cross_owner_of(&self, token_id: uint256) -> Result<pallet_common::eth::CrossAccount> {801 Self::token_owner(&self, token_id.try_into()?)800 Self::token_owner(&self, token_id.try_into()?)802 .map(|o| EthCrossAccount::from_sub_cross_account::<T>(&o))801 .map(|o| pallet_common::eth::CrossAccount::from_sub_cross_account::<T>(&o))803 .ok_or(Error::Revert("key too large".into()))802 .ok_or(Error::Revert("key too large".into()))804 }803 }805804808 /// @param tokenId Id for the token.807 /// @param tokenId Id for the token.809 /// @param keys Properties keys. Empty keys for all propertyes.808 /// @param keys Properties keys. Empty keys for all propertyes.810 /// @return Vector of properties key/value pairs.809 /// @return Vector of properties key/value pairs.811 fn properties(&self, token_id: uint256, keys: Vec<string>) -> Result<Vec<PropertyStruct>> {810 fn properties(811 &self,812 token_id: uint256,813 keys: Vec<string>,814 ) -> Result<Vec<pallet_common::eth::Property>> {812 let keys = keys815 let keys = keys813 .into_iter()816 .into_iter()814 .map(|key| {817 .map(|key| {828 let key = string::from_utf8(p.key.to_vec())831 let key = string::from_utf8(p.key.to_vec())829 .map_err(|e| Error::Revert(alloc::format!("{}", e)))?;832 .map_err(|e| Error::Revert(alloc::format!("{}", e)))?;830 let value = bytes(p.value.to_vec());833 let value = bytes(p.value.to_vec());831 Ok(PropertyStruct { key, value })834 Ok(pallet_common::eth::Property { key, value })832 })835 })833 .collect::<Result<Vec<_>>>()836 .collect::<Result<Vec<_>>>()834 }837 }865 fn transfer_cross(868 fn transfer_cross(866 &mut self,869 &mut self,867 caller: caller,870 caller: caller,868 to: EthCrossAccount,871 to: pallet_common::eth::CrossAccount,869 token_id: uint256,872 token_id: uint256,870 ) -> Result<void> {873 ) -> Result<void> {871 let caller = T::CrossAccountId::from_eth(caller);874 let caller = T::CrossAccountId::from_eth(caller);893 fn transfer_from_cross(896 fn transfer_from_cross(894 &mut self,897 &mut self,895 caller: caller,898 caller: caller,896 from: EthCrossAccount,899 from: pallet_common::eth::CrossAccount,897 to: EthCrossAccount,900 to: pallet_common::eth::CrossAccount,898 token_id: uint256,901 token_id: uint256,899 ) -> Result<void> {902 ) -> Result<void> {900 let caller = T::CrossAccountId::from_eth(caller);903 let caller = T::CrossAccountId::from_eth(caller);949 fn burn_from_cross(952 fn burn_from_cross(950 &mut self,953 &mut self,951 caller: caller,954 caller: caller,952 from: EthCrossAccount,955 from: pallet_common::eth::CrossAccount,953 token_id: uint256,956 token_id: uint256,954 ) -> Result<void> {957 ) -> Result<void> {955 let caller = T::CrossAccountId::from_eth(caller);958 let caller = T::CrossAccountId::from_eth(caller);1086 fn mint_cross(1089 fn mint_cross(1087 &mut self,1090 &mut self,1088 caller: caller,1091 caller: caller,1089 to: EthCrossAccount,1092 to: pallet_common::eth::CrossAccount,1090 properties: Vec<PropertyStruct>,1093 properties: Vec<pallet_common::eth::Property>,1091 ) -> Result<uint256> {1094 ) -> Result<uint256> {1092 let token_id = <TokensMinted<T>>::get(self.id)1095 let token_id = <TokensMinted<T>>::get(self.id)1093 .checked_add(1)1096 .checked_add(1)109711001098 let properties = properties1101 let properties = properties1099 .into_iter()1102 .into_iter()1100 .map(|PropertyStruct { key, value }| {1103 .map(|pallet_common::eth::Property { key, value }| {1101 let key = <Vec<u8>>::from(key)1104 let key = <Vec<u8>>::from(key)1102 .try_into()1105 .try_into()1103 .map_err(|_| "key too large")?;1106 .map_err(|_| "key too large")?;pallets/refungible/src/erc_token.rsdiffbeforeafterboth30use pallet_common::{30use pallet_common::{31 CommonWeightInfo,31 CommonWeightInfo,32 erc::{CommonEvmHandler, PrecompileResult},32 erc::{CommonEvmHandler, PrecompileResult},33 eth::{collection_id_to_address, EthCrossAccount},33 eth::collection_id_to_address,34};34};35use pallet_evm::{account::CrossAccountId, PrecompileHandle};35use pallet_evm::{account::CrossAccountId, PrecompileHandle};36use pallet_evm_coder_substrate::{call, dispatch_to_evm, WithRecorder};36use pallet_evm_coder_substrate::{call, dispatch_to_evm, WithRecorder};224 fn burn_from_cross(224 fn burn_from_cross(225 &mut self,225 &mut self,226 caller: caller,226 caller: caller,227 from: EthCrossAccount,227 from: pallet_common::eth::CrossAccount,228 amount: uint256,228 amount: uint256,229 ) -> Result<bool> {229 ) -> Result<bool> {230 let caller = T::CrossAccountId::from_eth(caller);230 let caller = T::CrossAccountId::from_eth(caller);250 fn approve_cross(250 fn approve_cross(251 &mut self,251 &mut self,252 caller: caller,252 caller: caller,253 spender: EthCrossAccount,253 spender: pallet_common::eth::CrossAccount,254 amount: uint256,254 amount: uint256,255 ) -> Result<bool> {255 ) -> Result<bool> {256 let caller = T::CrossAccountId::from_eth(caller);256 let caller = T::CrossAccountId::from_eth(caller);280 fn transfer_cross(280 fn transfer_cross(281 &mut self,281 &mut self,282 caller: caller,282 caller: caller,283 to: EthCrossAccount,283 to: pallet_common::eth::CrossAccount,284 amount: uint256,284 amount: uint256,285 ) -> Result<bool> {285 ) -> Result<bool> {286 let caller = T::CrossAccountId::from_eth(caller);286 let caller = T::CrossAccountId::from_eth(caller);303 fn transfer_from_cross(303 fn transfer_from_cross(304 &mut self,304 &mut self,305 caller: caller,305 caller: caller,306 from: EthCrossAccount,306 from: pallet_common::eth::CrossAccount,307 to: EthCrossAccount,307 to: pallet_common::eth::CrossAccount,308 amount: uint256,308 amount: uint256,309 ) -> Result<bool> {309 ) -> Result<bool> {310 let caller = T::CrossAccountId::from_eth(caller);310 let caller = T::CrossAccountId::from_eth(caller);pallets/refungible/src/lib.rsdiffbeforeafterboth929293use codec::{Encode, Decode, MaxEncodedLen};93use codec::{Encode, Decode, MaxEncodedLen};94use core::ops::Deref;94use core::ops::Deref;95use derivative::Derivative;96use evm_coder::ToLog;95use evm_coder::ToLog;97use frame_support::{96use frame_support::{BoundedVec, ensure, fail, storage::with_transaction, transactional};98 BoundedBTreeMap, BoundedVec, ensure, fail, storage::with_transaction, transactional,99 pallet_prelude::ConstU32,100};101use pallet_evm::{account::CrossAccountId, Pallet as PalletEvm};97use pallet_evm::{account::CrossAccountId, Pallet as PalletEvm};102use pallet_evm_coder_substrate::WithRecorder;98use pallet_evm_coder_substrate::WithRecorder;110use sp_runtime::{ArithmeticError, DispatchError, DispatchResult, TransactionOutcome};106use sp_runtime::{ArithmeticError, DispatchError, DispatchResult, TransactionOutcome};111use sp_std::{vec::Vec, vec, collections::btree_map::BTreeMap};107use sp_std::{vec::Vec, vec, collections::btree_map::BTreeMap};112use up_data_structs::{108use up_data_structs::{113 AccessMode, budget::Budget, CollectionId, CollectionFlags, CollectionPropertiesVec,109 AccessMode, budget::Budget, CollectionId, CollectionFlags, CreateCollectionData,114 CreateCollectionData, CustomDataLimit, mapping::TokenAddressMapping, MAX_ITEMS_PER_BATCH,110 CustomDataLimit, mapping::TokenAddressMapping, MAX_REFUNGIBLE_PIECES, Property, PropertyKey,115 MAX_REFUNGIBLE_PIECES, Property, PropertyKey, PropertyKeyPermission, PropertyPermission,111 PropertyKeyPermission, PropertyPermission, PropertyScope, PropertyValue, TokenId,116 PropertyScope, PropertyValue, TokenId, TrySetProperty, PropertiesPermissionMap,112 TrySetProperty, PropertiesPermissionMap, CreateRefungibleExMultipleOwners,117 CreateRefungibleExMultipleOwners,pallets/refungible/src/stubs/UniqueRefungible.rawdiffbeforeafterbothbinary blob — no preview
pallets/refungible/src/stubs/UniqueRefungible.soldiffbeforeafterboth258 /// @param sponsor Cross account address of the sponsor from whose account funds will be debited for operations with the contract.258 /// @param sponsor Cross account address of the sponsor from whose account funds will be debited for operations with the contract.259 /// @dev EVM selector for this function is: 0x84a1d5a8,259 /// @dev EVM selector for this function is: 0x84a1d5a8,260 /// or in textual repr: setCollectionSponsorCross((address,uint256))260 /// or in textual repr: setCollectionSponsorCross((address,uint256))261 function setCollectionSponsorCross(EthCrossAccount memory sponsor) public {261 function setCollectionSponsorCross(CrossAccount memory sponsor) public {262 require(false, stub_error);262 require(false, stub_error);263 sponsor;263 sponsor;264 dummy = 0;264 dummy = 0;296 /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.296 /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.297 /// @dev EVM selector for this function is: 0x6ec0a9f1,297 /// @dev EVM selector for this function is: 0x6ec0a9f1,298 /// or in textual repr: collectionSponsor()298 /// or in textual repr: collectionSponsor()299 function collectionSponsor() public view returns (EthCrossAccount memory) {299 function collectionSponsor() public view returns (CrossAccount memory) {300 require(false, stub_error);300 require(false, stub_error);301 dummy;301 dummy;302 return EthCrossAccount(0x0000000000000000000000000000000000000000, 0);302 return CrossAccount(0x0000000000000000000000000000000000000000, 0);303 }303 }304304305 /// Get current collection limits.305 /// Get current collection limits.337 /// @param newAdmin Cross account administrator address.337 /// @param newAdmin Cross account administrator address.338 /// @dev EVM selector for this function is: 0x859aa7d6,338 /// @dev EVM selector for this function is: 0x859aa7d6,339 /// or in textual repr: addCollectionAdminCross((address,uint256))339 /// or in textual repr: addCollectionAdminCross((address,uint256))340 function addCollectionAdminCross(EthCrossAccount memory newAdmin) public {340 function addCollectionAdminCross(CrossAccount memory newAdmin) public {341 require(false, stub_error);341 require(false, stub_error);342 newAdmin;342 newAdmin;343 dummy = 0;343 dummy = 0;347 /// @param admin Cross account administrator address.347 /// @param admin Cross account administrator address.348 /// @dev EVM selector for this function is: 0x6c0cd173,348 /// @dev EVM selector for this function is: 0x6c0cd173,349 /// or in textual repr: removeCollectionAdminCross((address,uint256))349 /// or in textual repr: removeCollectionAdminCross((address,uint256))350 function removeCollectionAdminCross(EthCrossAccount memory admin) public {350 function removeCollectionAdminCross(CrossAccount memory admin) public {351 require(false, stub_error);351 require(false, stub_error);352 admin;352 admin;353 dummy = 0;353 dummy = 0;433 /// @param user User address to check.433 /// @param user User address to check.434 /// @dev EVM selector for this function is: 0x91b6df49,434 /// @dev EVM selector for this function is: 0x91b6df49,435 /// or in textual repr: allowlistedCross((address,uint256))435 /// or in textual repr: allowlistedCross((address,uint256))436 function allowlistedCross(EthCrossAccount memory user) public view returns (bool) {436 function allowlistedCross(CrossAccount memory user) public view returns (bool) {437 require(false, stub_error);437 require(false, stub_error);438 user;438 user;439 dummy;439 dummy;456 /// @param user User cross account address.456 /// @param user User cross account address.457 /// @dev EVM selector for this function is: 0xa0184a3a,457 /// @dev EVM selector for this function is: 0xa0184a3a,458 /// or in textual repr: addToCollectionAllowListCross((address,uint256))458 /// or in textual repr: addToCollectionAllowListCross((address,uint256))459 function addToCollectionAllowListCross(EthCrossAccount memory user) public {459 function addToCollectionAllowListCross(CrossAccount memory user) public {460 require(false, stub_error);460 require(false, stub_error);461 user;461 user;462 dummy = 0;462 dummy = 0;478 /// @param user User cross account address.478 /// @param user User cross account address.479 /// @dev EVM selector for this function is: 0x09ba452a,479 /// @dev EVM selector for this function is: 0x09ba452a,480 /// or in textual repr: removeFromCollectionAllowListCross((address,uint256))480 /// or in textual repr: removeFromCollectionAllowListCross((address,uint256))481 function removeFromCollectionAllowListCross(EthCrossAccount memory user) public {481 function removeFromCollectionAllowListCross(CrossAccount memory user) public {482 require(false, stub_error);482 require(false, stub_error);483 user;483 user;484 dummy = 0;484 dummy = 0;514 /// @return "true" if account is the owner or admin514 /// @return "true" if account is the owner or admin515 /// @dev EVM selector for this function is: 0x3e75a905,515 /// @dev EVM selector for this function is: 0x3e75a905,516 /// or in textual repr: isOwnerOrAdminCross((address,uint256))516 /// or in textual repr: isOwnerOrAdminCross((address,uint256))517 function isOwnerOrAdminCross(EthCrossAccount memory user) public view returns (bool) {517 function isOwnerOrAdminCross(CrossAccount memory user) public view returns (bool) {518 require(false, stub_error);518 require(false, stub_error);519 user;519 user;520 dummy;520 dummy;538 /// If address is canonical then substrate mirror is zero and vice versa.538 /// If address is canonical then substrate mirror is zero and vice versa.539 /// @dev EVM selector for this function is: 0xdf727d3b,539 /// @dev EVM selector for this function is: 0xdf727d3b,540 /// or in textual repr: collectionOwner()540 /// or in textual repr: collectionOwner()541 function collectionOwner() public view returns (EthCrossAccount memory) {541 function collectionOwner() public view returns (CrossAccount memory) {542 require(false, stub_error);542 require(false, stub_error);543 dummy;543 dummy;544 return EthCrossAccount(0x0000000000000000000000000000000000000000, 0);544 return CrossAccount(0x0000000000000000000000000000000000000000, 0);545 }545 }546546547 // /// Changes collection owner to another account547 // /// Changes collection owner to another account562 /// If address is canonical then substrate mirror is zero and vice versa.562 /// If address is canonical then substrate mirror is zero and vice versa.563 /// @dev EVM selector for this function is: 0x5813216b,563 /// @dev EVM selector for this function is: 0x5813216b,564 /// or in textual repr: collectionAdmins()564 /// or in textual repr: collectionAdmins()565 function collectionAdmins() public view returns (EthCrossAccount[] memory) {565 function collectionAdmins() public view returns (CrossAccount[] memory) {566 require(false, stub_error);566 require(false, stub_error);567 dummy;567 dummy;568 return new EthCrossAccount[](0);568 return new CrossAccount[](0);569 }569 }570570571 /// Changes collection owner to another account571 /// Changes collection owner to another account574 /// @param newOwner new owner cross account574 /// @param newOwner new owner cross account575 /// @dev EVM selector for this function is: 0x6496c497,575 /// @dev EVM selector for this function is: 0x6496c497,576 /// or in textual repr: changeCollectionOwnerCross((address,uint256))576 /// or in textual repr: changeCollectionOwnerCross((address,uint256))577 function changeCollectionOwnerCross(EthCrossAccount memory newOwner) public {577 function changeCollectionOwnerCross(CrossAccount memory newOwner) public {578 require(false, stub_error);578 require(false, stub_error);579 newOwner;579 newOwner;580 dummy = 0;580 dummy = 0;581 }581 }582}582}583583584/// @dev Cross account struct584/// @dev Cross account struct585struct EthCrossAccount {585struct CrossAccount {586 address eth;586 address eth;587 uint256 sub;587 uint256 sub;588}588}607 uint256[] field_1;607 uint256[] field_1;608}608}609609610/// @dev [`CollectionLimits`](up_data_structs::CollectionLimits) field representation for EVM.610struct CollectionLimit {611struct CollectionLimit {611 CollectionLimitField field;612 CollectionLimitField field;612 bool status;613 bool status;613 uint256 value;614 uint256 value;614}615}615616616/// @dev [`CollectionLimits`](up_data_structs::CollectionLimits) representation for EVM.617/// @dev [`CollectionLimits`](up_data_structs::CollectionLimits) fields representation for EVM.617enum CollectionLimitField {618enum CollectionLimitField {618 /// @dev How many tokens can a user have on one account.619 /// @dev How many tokens can a user have on one account.619 AccountTokenOwnership,620 AccountTokenOwnership,811 /// @param tokenId Id for the token.812 /// @param tokenId Id for the token.812 /// @dev EVM selector for this function is: 0x2b29dace,813 /// @dev EVM selector for this function is: 0x2b29dace,813 /// or in textual repr: crossOwnerOf(uint256)814 /// or in textual repr: crossOwnerOf(uint256)814 function crossOwnerOf(uint256 tokenId) public view returns (EthCrossAccount memory) {815 function crossOwnerOf(uint256 tokenId) public view returns (CrossAccount memory) {815 require(false, stub_error);816 require(false, stub_error);816 tokenId;817 tokenId;817 dummy;818 dummy;818 return EthCrossAccount(0x0000000000000000000000000000000000000000, 0);819 return CrossAccount(0x0000000000000000000000000000000000000000, 0);819 }820 }820821821 /// Returns the token properties.822 /// Returns the token properties.856 /// @param tokenId The RFT to transfer857 /// @param tokenId The RFT to transfer857 /// @dev EVM selector for this function is: 0x2ada85ff,858 /// @dev EVM selector for this function is: 0x2ada85ff,858 /// or in textual repr: transferCross((address,uint256),uint256)859 /// or in textual repr: transferCross((address,uint256),uint256)859 function transferCross(EthCrossAccount memory to, uint256 tokenId) public {860 function transferCross(CrossAccount memory to, uint256 tokenId) public {860 require(false, stub_error);861 require(false, stub_error);861 to;862 to;862 tokenId;863 tokenId;872 /// @dev EVM selector for this function is: 0xd5cf430b,873 /// @dev EVM selector for this function is: 0xd5cf430b,873 /// or in textual repr: transferFromCross((address,uint256),(address,uint256),uint256)874 /// or in textual repr: transferFromCross((address,uint256),(address,uint256),uint256)874 function transferFromCross(875 function transferFromCross(875 EthCrossAccount memory from,876 CrossAccount memory from,876 EthCrossAccount memory to,877 CrossAccount memory to,877 uint256 tokenId878 uint256 tokenId878 ) public {879 ) public {879 require(false, stub_error);880 require(false, stub_error);908 /// @param tokenId The RFT to transfer909 /// @param tokenId The RFT to transfer909 /// @dev EVM selector for this function is: 0xbb2f5a58,910 /// @dev EVM selector for this function is: 0xbb2f5a58,910 /// or in textual repr: burnFromCross((address,uint256),uint256)911 /// or in textual repr: burnFromCross((address,uint256),uint256)911 function burnFromCross(EthCrossAccount memory from, uint256 tokenId) public {912 function burnFromCross(CrossAccount memory from, uint256 tokenId) public {912 require(false, stub_error);913 require(false, stub_error);913 from;914 from;914 tokenId;915 tokenId;960 /// @return uint256 The id of the newly minted token961 /// @return uint256 The id of the newly minted token961 /// @dev EVM selector for this function is: 0xb904db03,962 /// @dev EVM selector for this function is: 0xb904db03,962 /// or in textual repr: mintCross((address,uint256),(string,bytes)[])963 /// or in textual repr: mintCross((address,uint256),(string,bytes)[])963 function mintCross(EthCrossAccount memory to, Property[] memory properties) public returns (uint256) {964 function mintCross(CrossAccount memory to, Property[] memory properties) public returns (uint256) {964 require(false, stub_error);965 require(false, stub_error);965 to;966 to;966 properties;967 properties;pallets/refungible/src/stubs/UniqueRefungibleToken.rawdiffbeforeafterbothbinary blob — no preview
pallets/refungible/src/stubs/UniqueRefungibleToken.soldiffbeforeafterboth58 /// @param amount The amount that will be burnt.58 /// @param amount The amount that will be burnt.59 /// @dev EVM selector for this function is: 0xbb2f5a58,59 /// @dev EVM selector for this function is: 0xbb2f5a58,60 /// or in textual repr: burnFromCross((address,uint256),uint256)60 /// or in textual repr: burnFromCross((address,uint256),uint256)61 function burnFromCross(EthCrossAccount memory from, uint256 amount) public returns (bool) {61 function burnFromCross(CrossAccount memory from, uint256 amount) public returns (bool) {62 require(false, stub_error);62 require(false, stub_error);63 from;63 from;64 amount;64 amount;75 /// @param amount The amount of tokens to be spent.75 /// @param amount The amount of tokens to be spent.76 /// @dev EVM selector for this function is: 0x0ecd0ab0,76 /// @dev EVM selector for this function is: 0x0ecd0ab0,77 /// or in textual repr: approveCross((address,uint256),uint256)77 /// or in textual repr: approveCross((address,uint256),uint256)78 function approveCross(EthCrossAccount memory spender, uint256 amount) public returns (bool) {78 function approveCross(CrossAccount memory spender, uint256 amount) public returns (bool) {79 require(false, stub_error);79 require(false, stub_error);80 spender;80 spender;81 amount;81 amount;100 /// @param amount The amount to be transferred.100 /// @param amount The amount to be transferred.101 /// @dev EVM selector for this function is: 0x2ada85ff,101 /// @dev EVM selector for this function is: 0x2ada85ff,102 /// or in textual repr: transferCross((address,uint256),uint256)102 /// or in textual repr: transferCross((address,uint256),uint256)103 function transferCross(EthCrossAccount memory to, uint256 amount) public returns (bool) {103 function transferCross(CrossAccount memory to, uint256 amount) public returns (bool) {104 require(false, stub_error);104 require(false, stub_error);105 to;105 to;106 amount;106 amount;115 /// @dev EVM selector for this function is: 0xd5cf430b,115 /// @dev EVM selector for this function is: 0xd5cf430b,116 /// or in textual repr: transferFromCross((address,uint256),(address,uint256),uint256)116 /// or in textual repr: transferFromCross((address,uint256),(address,uint256),uint256)117 function transferFromCross(117 function transferFromCross(118 EthCrossAccount memory from,118 CrossAccount memory from,119 EthCrossAccount memory to,119 CrossAccount memory to,120 uint256 amount120 uint256 amount121 ) public returns (bool) {121 ) public returns (bool) {122 require(false, stub_error);122 require(false, stub_error);129}129}130130131/// @dev Cross account struct131/// @dev Cross account struct132struct EthCrossAccount {132struct CrossAccount {133 address eth;133 address eth;134 uint256 sub;134 uint256 sub;135}135}tests/src/eth/abi/contractHelpers.jsondiffbeforeafterboth226 { "internalType": "address", "name": "eth", "type": "address" },226 { "internalType": "address", "name": "eth", "type": "address" },227 { "internalType": "uint256", "name": "sub", "type": "uint256" }227 { "internalType": "uint256", "name": "sub", "type": "uint256" }228 ],228 ],229 "internalType": "struct EthCrossAccount",229 "internalType": "struct CrossAccount",230 "name": "",230 "name": "",231 "type": "tuple"231 "type": "tuple"232 }232 }tests/src/eth/abi/fungible.jsondiffbeforeafterboth56 { "internalType": "address", "name": "eth", "type": "address" },56 { "internalType": "address", "name": "eth", "type": "address" },57 { "internalType": "uint256", "name": "sub", "type": "uint256" }57 { "internalType": "uint256", "name": "sub", "type": "uint256" }58 ],58 ],59 "internalType": "struct EthCrossAccount",59 "internalType": "struct CrossAccount",60 "name": "newAdmin",60 "name": "newAdmin",61 "type": "tuple"61 "type": "tuple"62 }62 }73 { "internalType": "address", "name": "eth", "type": "address" },73 { "internalType": "address", "name": "eth", "type": "address" },74 { "internalType": "uint256", "name": "sub", "type": "uint256" }74 { "internalType": "uint256", "name": "sub", "type": "uint256" }75 ],75 ],76 "internalType": "struct EthCrossAccount",76 "internalType": "struct CrossAccount",77 "name": "user",77 "name": "user",78 "type": "tuple"78 "type": "tuple"79 }79 }100 { "internalType": "address", "name": "eth", "type": "address" },100 { "internalType": "address", "name": "eth", "type": "address" },101 { "internalType": "uint256", "name": "sub", "type": "uint256" }101 { "internalType": "uint256", "name": "sub", "type": "uint256" }102 ],102 ],103 "internalType": "struct EthCrossAccount",103 "internalType": "struct CrossAccount",104 "name": "user",104 "name": "user",105 "type": "tuple"105 "type": "tuple"106 }106 }127 { "internalType": "address", "name": "eth", "type": "address" },127 { "internalType": "address", "name": "eth", "type": "address" },128 { "internalType": "uint256", "name": "sub", "type": "uint256" }128 { "internalType": "uint256", "name": "sub", "type": "uint256" }129 ],129 ],130 "internalType": "struct EthCrossAccount",130 "internalType": "struct CrossAccount",131 "name": "spender",131 "name": "spender",132 "type": "tuple"132 "type": "tuple"133 },133 },154 { "internalType": "address", "name": "eth", "type": "address" },154 { "internalType": "address", "name": "eth", "type": "address" },155 { "internalType": "uint256", "name": "sub", "type": "uint256" }155 { "internalType": "uint256", "name": "sub", "type": "uint256" }156 ],156 ],157 "internalType": "struct EthCrossAccount",157 "internalType": "struct CrossAccount",158 "name": "from",158 "name": "from",159 "type": "tuple"159 "type": "tuple"160 },160 },172 { "internalType": "address", "name": "eth", "type": "address" },172 { "internalType": "address", "name": "eth", "type": "address" },173 { "internalType": "uint256", "name": "sub", "type": "uint256" }173 { "internalType": "uint256", "name": "sub", "type": "uint256" }174 ],174 ],175 "internalType": "struct EthCrossAccount",175 "internalType": "struct CrossAccount",176 "name": "newOwner",176 "name": "newOwner",177 "type": "tuple"177 "type": "tuple"178 }178 }191 { "internalType": "address", "name": "eth", "type": "address" },191 { "internalType": "address", "name": "eth", "type": "address" },192 { "internalType": "uint256", "name": "sub", "type": "uint256" }192 { "internalType": "uint256", "name": "sub", "type": "uint256" }193 ],193 ],194 "internalType": "struct EthCrossAccount[]",194 "internalType": "struct CrossAccount[]",195 "name": "",195 "name": "",196 "type": "tuple[]"196 "type": "tuple[]"197 }197 }279 { "internalType": "address", "name": "eth", "type": "address" },279 { "internalType": "address", "name": "eth", "type": "address" },280 { "internalType": "uint256", "name": "sub", "type": "uint256" }280 { "internalType": "uint256", "name": "sub", "type": "uint256" }281 ],281 ],282 "internalType": "struct EthCrossAccount",282 "internalType": "struct CrossAccount",283 "name": "",283 "name": "",284 "type": "tuple"284 "type": "tuple"285 }285 }322 { "internalType": "address", "name": "eth", "type": "address" },322 { "internalType": "address", "name": "eth", "type": "address" },323 { "internalType": "uint256", "name": "sub", "type": "uint256" }323 { "internalType": "uint256", "name": "sub", "type": "uint256" }324 ],324 ],325 "internalType": "struct EthCrossAccount",325 "internalType": "struct CrossAccount",326 "name": "",326 "name": "",327 "type": "tuple"327 "type": "tuple"328 }328 }381 { "internalType": "address", "name": "eth", "type": "address" },381 { "internalType": "address", "name": "eth", "type": "address" },382 { "internalType": "uint256", "name": "sub", "type": "uint256" }382 { "internalType": "uint256", "name": "sub", "type": "uint256" }383 ],383 ],384 "internalType": "struct EthCrossAccount",384 "internalType": "struct CrossAccount",385 "name": "user",385 "name": "user",386 "type": "tuple"386 "type": "tuple"387 }387 }425 { "internalType": "address", "name": "eth", "type": "address" },425 { "internalType": "address", "name": "eth", "type": "address" },426 { "internalType": "uint256", "name": "sub", "type": "uint256" }426 { "internalType": "uint256", "name": "sub", "type": "uint256" }427 ],427 ],428 "internalType": "struct EthCrossAccount",428 "internalType": "struct CrossAccount",429 "name": "to",429 "name": "to",430 "type": "tuple"430 "type": "tuple"431 },431 },450 { "internalType": "address", "name": "eth", "type": "address" },450 { "internalType": "address", "name": "eth", "type": "address" },451 { "internalType": "uint256", "name": "sub", "type": "uint256" }451 { "internalType": "uint256", "name": "sub", "type": "uint256" }452 ],452 ],453 "internalType": "struct EthCrossAccount",453 "internalType": "struct CrossAccount",454 "name": "admin",454 "name": "admin",455 "type": "tuple"455 "type": "tuple"456 }456 }474 { "internalType": "address", "name": "eth", "type": "address" },474 { "internalType": "address", "name": "eth", "type": "address" },475 { "internalType": "uint256", "name": "sub", "type": "uint256" }475 { "internalType": "uint256", "name": "sub", "type": "uint256" }476 ],476 ],477 "internalType": "struct EthCrossAccount",477 "internalType": "struct CrossAccount",478 "name": "user",478 "name": "user",479 "type": "tuple"479 "type": "tuple"480 }480 }565 { "internalType": "address", "name": "eth", "type": "address" },565 { "internalType": "address", "name": "eth", "type": "address" },566 { "internalType": "uint256", "name": "sub", "type": "uint256" }566 { "internalType": "uint256", "name": "sub", "type": "uint256" }567 ],567 ],568 "internalType": "struct EthCrossAccount",568 "internalType": "struct CrossAccount",569 "name": "sponsor",569 "name": "sponsor",570 "type": "tuple"570 "type": "tuple"571 }571 }615 { "internalType": "address", "name": "eth", "type": "address" },615 { "internalType": "address", "name": "eth", "type": "address" },616 { "internalType": "uint256", "name": "sub", "type": "uint256" }616 { "internalType": "uint256", "name": "sub", "type": "uint256" }617 ],617 ],618 "internalType": "struct EthCrossAccount",618 "internalType": "struct CrossAccount",619 "name": "to",619 "name": "to",620 "type": "tuple"620 "type": "tuple"621 },621 },644 { "internalType": "address", "name": "eth", "type": "address" },644 { "internalType": "address", "name": "eth", "type": "address" },645 { "internalType": "uint256", "name": "sub", "type": "uint256" }645 { "internalType": "uint256", "name": "sub", "type": "uint256" }646 ],646 ],647 "internalType": "struct EthCrossAccount",647 "internalType": "struct CrossAccount",648 "name": "from",648 "name": "from",649 "type": "tuple"649 "type": "tuple"650 },650 },653 { "internalType": "address", "name": "eth", "type": "address" },653 { "internalType": "address", "name": "eth", "type": "address" },654 { "internalType": "uint256", "name": "sub", "type": "uint256" }654 { "internalType": "uint256", "name": "sub", "type": "uint256" }655 ],655 ],656 "internalType": "struct EthCrossAccount",656 "internalType": "struct CrossAccount",657 "name": "to",657 "name": "to",658 "type": "tuple"658 "type": "tuple"659 },659 },tests/src/eth/abi/nonFungible.jsondiffbeforeafterboth87 { "internalType": "address", "name": "eth", "type": "address" },87 { "internalType": "address", "name": "eth", "type": "address" },88 { "internalType": "uint256", "name": "sub", "type": "uint256" }88 { "internalType": "uint256", "name": "sub", "type": "uint256" }89 ],89 ],90 "internalType": "struct EthCrossAccount",90 "internalType": "struct CrossAccount",91 "name": "newAdmin",91 "name": "newAdmin",92 "type": "tuple"92 "type": "tuple"93 }93 }104 { "internalType": "address", "name": "eth", "type": "address" },104 { "internalType": "address", "name": "eth", "type": "address" },105 { "internalType": "uint256", "name": "sub", "type": "uint256" }105 { "internalType": "uint256", "name": "sub", "type": "uint256" }106 ],106 ],107 "internalType": "struct EthCrossAccount",107 "internalType": "struct CrossAccount",108 "name": "user",108 "name": "user",109 "type": "tuple"109 "type": "tuple"110 }110 }121 { "internalType": "address", "name": "eth", "type": "address" },121 { "internalType": "address", "name": "eth", "type": "address" },122 { "internalType": "uint256", "name": "sub", "type": "uint256" }122 { "internalType": "uint256", "name": "sub", "type": "uint256" }123 ],123 ],124 "internalType": "struct EthCrossAccount",124 "internalType": "struct CrossAccount",125 "name": "user",125 "name": "user",126 "type": "tuple"126 "type": "tuple"127 }127 }148 { "internalType": "address", "name": "eth", "type": "address" },148 { "internalType": "address", "name": "eth", "type": "address" },149 { "internalType": "uint256", "name": "sub", "type": "uint256" }149 { "internalType": "uint256", "name": "sub", "type": "uint256" }150 ],150 ],151 "internalType": "struct EthCrossAccount",151 "internalType": "struct CrossAccount",152 "name": "approved",152 "name": "approved",153 "type": "tuple"153 "type": "tuple"154 },154 },184 { "internalType": "address", "name": "eth", "type": "address" },184 { "internalType": "address", "name": "eth", "type": "address" },185 { "internalType": "uint256", "name": "sub", "type": "uint256" }185 { "internalType": "uint256", "name": "sub", "type": "uint256" }186 ],186 ],187 "internalType": "struct EthCrossAccount",187 "internalType": "struct CrossAccount",188 "name": "from",188 "name": "from",189 "type": "tuple"189 "type": "tuple"190 },190 },202 { "internalType": "address", "name": "eth", "type": "address" },202 { "internalType": "address", "name": "eth", "type": "address" },203 { "internalType": "uint256", "name": "sub", "type": "uint256" }203 { "internalType": "uint256", "name": "sub", "type": "uint256" }204 ],204 ],205 "internalType": "struct EthCrossAccount",205 "internalType": "struct CrossAccount",206 "name": "newOwner",206 "name": "newOwner",207 "type": "tuple"207 "type": "tuple"208 }208 }221 { "internalType": "address", "name": "eth", "type": "address" },221 { "internalType": "address", "name": "eth", "type": "address" },222 { "internalType": "uint256", "name": "sub", "type": "uint256" }222 { "internalType": "uint256", "name": "sub", "type": "uint256" }223 ],223 ],224 "internalType": "struct EthCrossAccount[]",224 "internalType": "struct CrossAccount[]",225 "name": "",225 "name": "",226 "type": "tuple[]"226 "type": "tuple[]"227 }227 }309 { "internalType": "address", "name": "eth", "type": "address" },309 { "internalType": "address", "name": "eth", "type": "address" },310 { "internalType": "uint256", "name": "sub", "type": "uint256" }310 { "internalType": "uint256", "name": "sub", "type": "uint256" }311 ],311 ],312 "internalType": "struct EthCrossAccount",312 "internalType": "struct CrossAccount",313 "name": "",313 "name": "",314 "type": "tuple"314 "type": "tuple"315 }315 }352 { "internalType": "address", "name": "eth", "type": "address" },352 { "internalType": "address", "name": "eth", "type": "address" },353 { "internalType": "uint256", "name": "sub", "type": "uint256" }353 { "internalType": "uint256", "name": "sub", "type": "uint256" }354 ],354 ],355 "internalType": "struct EthCrossAccount",355 "internalType": "struct CrossAccount",356 "name": "",356 "name": "",357 "type": "tuple"357 "type": "tuple"358 }358 }385 { "internalType": "address", "name": "eth", "type": "address" },385 { "internalType": "address", "name": "eth", "type": "address" },386 { "internalType": "uint256", "name": "sub", "type": "uint256" }386 { "internalType": "uint256", "name": "sub", "type": "uint256" }387 ],387 ],388 "internalType": "struct EthCrossAccount",388 "internalType": "struct CrossAccount",389 "name": "",389 "name": "",390 "type": "tuple"390 "type": "tuple"391 }391 }459 { "internalType": "address", "name": "eth", "type": "address" },459 { "internalType": "address", "name": "eth", "type": "address" },460 { "internalType": "uint256", "name": "sub", "type": "uint256" }460 { "internalType": "uint256", "name": "sub", "type": "uint256" }461 ],461 ],462 "internalType": "struct EthCrossAccount",462 "internalType": "struct CrossAccount",463 "name": "user",463 "name": "user",464 "type": "tuple"464 "type": "tuple"465 }465 }483 { "internalType": "address", "name": "eth", "type": "address" },483 { "internalType": "address", "name": "eth", "type": "address" },484 { "internalType": "uint256", "name": "sub", "type": "uint256" }484 { "internalType": "uint256", "name": "sub", "type": "uint256" }485 ],485 ],486 "internalType": "struct EthCrossAccount",486 "internalType": "struct CrossAccount",487 "name": "to",487 "name": "to",488 "type": "tuple"488 "type": "tuple"489 },489 },579 { "internalType": "address", "name": "eth", "type": "address" },579 { "internalType": "address", "name": "eth", "type": "address" },580 { "internalType": "uint256", "name": "sub", "type": "uint256" }580 { "internalType": "uint256", "name": "sub", "type": "uint256" }581 ],581 ],582 "internalType": "struct EthCrossAccount",582 "internalType": "struct CrossAccount",583 "name": "admin",583 "name": "admin",584 "type": "tuple"584 "type": "tuple"585 }585 }603 { "internalType": "address", "name": "eth", "type": "address" },603 { "internalType": "address", "name": "eth", "type": "address" },604 { "internalType": "uint256", "name": "sub", "type": "uint256" }604 { "internalType": "uint256", "name": "sub", "type": "uint256" }605 ],605 ],606 "internalType": "struct EthCrossAccount",606 "internalType": "struct CrossAccount",607 "name": "user",607 "name": "user",608 "type": "tuple"608 "type": "tuple"609 }609 }727 { "internalType": "address", "name": "eth", "type": "address" },727 { "internalType": "address", "name": "eth", "type": "address" },728 { "internalType": "uint256", "name": "sub", "type": "uint256" }728 { "internalType": "uint256", "name": "sub", "type": "uint256" }729 ],729 ],730 "internalType": "struct EthCrossAccount",730 "internalType": "struct CrossAccount",731 "name": "sponsor",731 "name": "sponsor",732 "type": "tuple"732 "type": "tuple"733 }733 }881 { "internalType": "address", "name": "eth", "type": "address" },881 { "internalType": "address", "name": "eth", "type": "address" },882 { "internalType": "uint256", "name": "sub", "type": "uint256" }882 { "internalType": "uint256", "name": "sub", "type": "uint256" }883 ],883 ],884 "internalType": "struct EthCrossAccount",884 "internalType": "struct CrossAccount",885 "name": "to",885 "name": "to",886 "type": "tuple"886 "type": "tuple"887 },887 },910 { "internalType": "address", "name": "eth", "type": "address" },910 { "internalType": "address", "name": "eth", "type": "address" },911 { "internalType": "uint256", "name": "sub", "type": "uint256" }911 { "internalType": "uint256", "name": "sub", "type": "uint256" }912 ],912 ],913 "internalType": "struct EthCrossAccount",913 "internalType": "struct CrossAccount",914 "name": "from",914 "name": "from",915 "type": "tuple"915 "type": "tuple"916 },916 },919 { "internalType": "address", "name": "eth", "type": "address" },919 { "internalType": "address", "name": "eth", "type": "address" },920 { "internalType": "uint256", "name": "sub", "type": "uint256" }920 { "internalType": "uint256", "name": "sub", "type": "uint256" }921 ],921 ],922 "internalType": "struct EthCrossAccount",922 "internalType": "struct CrossAccount",923 "name": "to",923 "name": "to",924 "type": "tuple"924 "type": "tuple"925 },925 },tests/src/eth/abi/reFungible.jsondiffbeforeafterboth87 { "internalType": "address", "name": "eth", "type": "address" },87 { "internalType": "address", "name": "eth", "type": "address" },88 { "internalType": "uint256", "name": "sub", "type": "uint256" }88 { "internalType": "uint256", "name": "sub", "type": "uint256" }89 ],89 ],90 "internalType": "struct EthCrossAccount",90 "internalType": "struct CrossAccount",91 "name": "newAdmin",91 "name": "newAdmin",92 "type": "tuple"92 "type": "tuple"93 }93 }104 { "internalType": "address", "name": "eth", "type": "address" },104 { "internalType": "address", "name": "eth", "type": "address" },105 { "internalType": "uint256", "name": "sub", "type": "uint256" }105 { "internalType": "uint256", "name": "sub", "type": "uint256" }106 ],106 ],107 "internalType": "struct EthCrossAccount",107 "internalType": "struct CrossAccount",108 "name": "user",108 "name": "user",109 "type": "tuple"109 "type": "tuple"110 }110 }121 { "internalType": "address", "name": "eth", "type": "address" },121 { "internalType": "address", "name": "eth", "type": "address" },122 { "internalType": "uint256", "name": "sub", "type": "uint256" }122 { "internalType": "uint256", "name": "sub", "type": "uint256" }123 ],123 ],124 "internalType": "struct EthCrossAccount",124 "internalType": "struct CrossAccount",125 "name": "user",125 "name": "user",126 "type": "tuple"126 "type": "tuple"127 }127 }166 { "internalType": "address", "name": "eth", "type": "address" },166 { "internalType": "address", "name": "eth", "type": "address" },167 { "internalType": "uint256", "name": "sub", "type": "uint256" }167 { "internalType": "uint256", "name": "sub", "type": "uint256" }168 ],168 ],169 "internalType": "struct EthCrossAccount",169 "internalType": "struct CrossAccount",170 "name": "from",170 "name": "from",171 "type": "tuple"171 "type": "tuple"172 },172 },184 { "internalType": "address", "name": "eth", "type": "address" },184 { "internalType": "address", "name": "eth", "type": "address" },185 { "internalType": "uint256", "name": "sub", "type": "uint256" }185 { "internalType": "uint256", "name": "sub", "type": "uint256" }186 ],186 ],187 "internalType": "struct EthCrossAccount",187 "internalType": "struct CrossAccount",188 "name": "newOwner",188 "name": "newOwner",189 "type": "tuple"189 "type": "tuple"190 }190 }203 { "internalType": "address", "name": "eth", "type": "address" },203 { "internalType": "address", "name": "eth", "type": "address" },204 { "internalType": "uint256", "name": "sub", "type": "uint256" }204 { "internalType": "uint256", "name": "sub", "type": "uint256" }205 ],205 ],206 "internalType": "struct EthCrossAccount[]",206 "internalType": "struct CrossAccount[]",207 "name": "",207 "name": "",208 "type": "tuple[]"208 "type": "tuple[]"209 }209 }291 { "internalType": "address", "name": "eth", "type": "address" },291 { "internalType": "address", "name": "eth", "type": "address" },292 { "internalType": "uint256", "name": "sub", "type": "uint256" }292 { "internalType": "uint256", "name": "sub", "type": "uint256" }293 ],293 ],294 "internalType": "struct EthCrossAccount",294 "internalType": "struct CrossAccount",295 "name": "",295 "name": "",296 "type": "tuple"296 "type": "tuple"297 }297 }334 { "internalType": "address", "name": "eth", "type": "address" },334 { "internalType": "address", "name": "eth", "type": "address" },335 { "internalType": "uint256", "name": "sub", "type": "uint256" }335 { "internalType": "uint256", "name": "sub", "type": "uint256" }336 ],336 ],337 "internalType": "struct EthCrossAccount",337 "internalType": "struct CrossAccount",338 "name": "",338 "name": "",339 "type": "tuple"339 "type": "tuple"340 }340 }367 { "internalType": "address", "name": "eth", "type": "address" },367 { "internalType": "address", "name": "eth", "type": "address" },368 { "internalType": "uint256", "name": "sub", "type": "uint256" }368 { "internalType": "uint256", "name": "sub", "type": "uint256" }369 ],369 ],370 "internalType": "struct EthCrossAccount",370 "internalType": "struct CrossAccount",371 "name": "",371 "name": "",372 "type": "tuple"372 "type": "tuple"373 }373 }441 { "internalType": "address", "name": "eth", "type": "address" },441 { "internalType": "address", "name": "eth", "type": "address" },442 { "internalType": "uint256", "name": "sub", "type": "uint256" }442 { "internalType": "uint256", "name": "sub", "type": "uint256" }443 ],443 ],444 "internalType": "struct EthCrossAccount",444 "internalType": "struct CrossAccount",445 "name": "user",445 "name": "user",446 "type": "tuple"446 "type": "tuple"447 }447 }465 { "internalType": "address", "name": "eth", "type": "address" },465 { "internalType": "address", "name": "eth", "type": "address" },466 { "internalType": "uint256", "name": "sub", "type": "uint256" }466 { "internalType": "uint256", "name": "sub", "type": "uint256" }467 ],467 ],468 "internalType": "struct EthCrossAccount",468 "internalType": "struct CrossAccount",469 "name": "to",469 "name": "to",470 "type": "tuple"470 "type": "tuple"471 },471 },561 { "internalType": "address", "name": "eth", "type": "address" },561 { "internalType": "address", "name": "eth", "type": "address" },562 { "internalType": "uint256", "name": "sub", "type": "uint256" }562 { "internalType": "uint256", "name": "sub", "type": "uint256" }563 ],563 ],564 "internalType": "struct EthCrossAccount",564 "internalType": "struct CrossAccount",565 "name": "admin",565 "name": "admin",566 "type": "tuple"566 "type": "tuple"567 }567 }585 { "internalType": "address", "name": "eth", "type": "address" },585 { "internalType": "address", "name": "eth", "type": "address" },586 { "internalType": "uint256", "name": "sub", "type": "uint256" }586 { "internalType": "uint256", "name": "sub", "type": "uint256" }587 ],587 ],588 "internalType": "struct EthCrossAccount",588 "internalType": "struct CrossAccount",589 "name": "user",589 "name": "user",590 "type": "tuple"590 "type": "tuple"591 }591 }709 { "internalType": "address", "name": "eth", "type": "address" },709 { "internalType": "address", "name": "eth", "type": "address" },710 { "internalType": "uint256", "name": "sub", "type": "uint256" }710 { "internalType": "uint256", "name": "sub", "type": "uint256" }711 ],711 ],712 "internalType": "struct EthCrossAccount",712 "internalType": "struct CrossAccount",713 "name": "sponsor",713 "name": "sponsor",714 "type": "tuple"714 "type": "tuple"715 }715 }872 { "internalType": "address", "name": "eth", "type": "address" },872 { "internalType": "address", "name": "eth", "type": "address" },873 { "internalType": "uint256", "name": "sub", "type": "uint256" }873 { "internalType": "uint256", "name": "sub", "type": "uint256" }874 ],874 ],875 "internalType": "struct EthCrossAccount",875 "internalType": "struct CrossAccount",876 "name": "to",876 "name": "to",877 "type": "tuple"877 "type": "tuple"878 },878 },901 { "internalType": "address", "name": "eth", "type": "address" },901 { "internalType": "address", "name": "eth", "type": "address" },902 { "internalType": "uint256", "name": "sub", "type": "uint256" }902 { "internalType": "uint256", "name": "sub", "type": "uint256" }903 ],903 ],904 "internalType": "struct EthCrossAccount",904 "internalType": "struct CrossAccount",905 "name": "from",905 "name": "from",906 "type": "tuple"906 "type": "tuple"907 },907 },910 { "internalType": "address", "name": "eth", "type": "address" },910 { "internalType": "address", "name": "eth", "type": "address" },911 { "internalType": "uint256", "name": "sub", "type": "uint256" }911 { "internalType": "uint256", "name": "sub", "type": "uint256" }912 ],912 ],913 "internalType": "struct EthCrossAccount",913 "internalType": "struct CrossAccount",914 "name": "to",914 "name": "to",915 "type": "tuple"915 "type": "tuple"916 },916 },tests/src/eth/abi/reFungibleToken.jsondiffbeforeafterboth76 { "internalType": "address", "name": "eth", "type": "address" },76 { "internalType": "address", "name": "eth", "type": "address" },77 { "internalType": "uint256", "name": "sub", "type": "uint256" }77 { "internalType": "uint256", "name": "sub", "type": "uint256" }78 ],78 ],79 "internalType": "struct EthCrossAccount",79 "internalType": "struct CrossAccount",80 "name": "spender",80 "name": "spender",81 "type": "tuple"81 "type": "tuple"82 },82 },113 { "internalType": "address", "name": "eth", "type": "address" },113 { "internalType": "address", "name": "eth", "type": "address" },114 { "internalType": "uint256", "name": "sub", "type": "uint256" }114 { "internalType": "uint256", "name": "sub", "type": "uint256" }115 ],115 ],116 "internalType": "struct EthCrossAccount",116 "internalType": "struct CrossAccount",117 "name": "from",117 "name": "from",118 "type": "tuple"118 "type": "tuple"119 },119 },201 { "internalType": "address", "name": "eth", "type": "address" },201 { "internalType": "address", "name": "eth", "type": "address" },202 { "internalType": "uint256", "name": "sub", "type": "uint256" }202 { "internalType": "uint256", "name": "sub", "type": "uint256" }203 ],203 ],204 "internalType": "struct EthCrossAccount",204 "internalType": "struct CrossAccount",205 "name": "to",205 "name": "to",206 "type": "tuple"206 "type": "tuple"207 },207 },230 { "internalType": "address", "name": "eth", "type": "address" },230 { "internalType": "address", "name": "eth", "type": "address" },231 { "internalType": "uint256", "name": "sub", "type": "uint256" }231 { "internalType": "uint256", "name": "sub", "type": "uint256" }232 ],232 ],233 "internalType": "struct EthCrossAccount",233 "internalType": "struct CrossAccount",234 "name": "from",234 "name": "from",235 "type": "tuple"235 "type": "tuple"236 },236 },239 { "internalType": "address", "name": "eth", "type": "address" },239 { "internalType": "address", "name": "eth", "type": "address" },240 { "internalType": "uint256", "name": "sub", "type": "uint256" }240 { "internalType": "uint256", "name": "sub", "type": "uint256" }241 ],241 ],242 "internalType": "struct EthCrossAccount",242 "internalType": "struct CrossAccount",243 "name": "to",243 "name": "to",244 "type": "tuple"244 "type": "tuple"245 },245 },tests/src/eth/api/ContractHelpers.soldiffbeforeafterboth69 /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.69 /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.70 /// @dev EVM selector for this function is: 0x766c4f37,70 /// @dev EVM selector for this function is: 0x766c4f37,71 /// or in textual repr: sponsor(address)71 /// or in textual repr: sponsor(address)72 function sponsor(address contractAddress) external view returns (EthCrossAccount memory);72 function sponsor(address contractAddress) external view returns (CrossAccount memory);737374 /// Check tat contract has confirmed sponsor.74 /// Check tat contract has confirmed sponsor.75 ///75 ///172}172}173173174/// @dev Cross account struct174/// @dev Cross account struct175struct EthCrossAccount {175struct CrossAccount {176 address eth;176 address eth;177 uint256 sub;177 uint256 sub;178}178}tests/src/eth/api/UniqueFungible.soldiffbeforeafterboth78 /// @param sponsor Cross account address of the sponsor from whose account funds will be debited for operations with the contract.78 /// @param sponsor Cross account address of the sponsor from whose account funds will be debited for operations with the contract.79 /// @dev EVM selector for this function is: 0x84a1d5a8,79 /// @dev EVM selector for this function is: 0x84a1d5a8,80 /// or in textual repr: setCollectionSponsorCross((address,uint256))80 /// or in textual repr: setCollectionSponsorCross((address,uint256))81 function setCollectionSponsorCross(EthCrossAccount memory sponsor) external;81 function setCollectionSponsorCross(CrossAccount memory sponsor) external;828283 /// Whether there is a pending sponsor.83 /// Whether there is a pending sponsor.84 /// @dev EVM selector for this function is: 0x058ac185,84 /// @dev EVM selector for this function is: 0x058ac185,102 /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.102 /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.103 /// @dev EVM selector for this function is: 0x6ec0a9f1,103 /// @dev EVM selector for this function is: 0x6ec0a9f1,104 /// or in textual repr: collectionSponsor()104 /// or in textual repr: collectionSponsor()105 function collectionSponsor() external view returns (EthCrossAccount memory);105 function collectionSponsor() external view returns (CrossAccount memory);106106107 /// Get current collection limits.107 /// Get current collection limits.108 ///108 ///127 /// @param newAdmin Cross account administrator address.127 /// @param newAdmin Cross account administrator address.128 /// @dev EVM selector for this function is: 0x859aa7d6,128 /// @dev EVM selector for this function is: 0x859aa7d6,129 /// or in textual repr: addCollectionAdminCross((address,uint256))129 /// or in textual repr: addCollectionAdminCross((address,uint256))130 function addCollectionAdminCross(EthCrossAccount memory newAdmin) external;130 function addCollectionAdminCross(CrossAccount memory newAdmin) external;131131132 /// Remove collection admin.132 /// Remove collection admin.133 /// @param admin Cross account administrator address.133 /// @param admin Cross account administrator address.134 /// @dev EVM selector for this function is: 0x6c0cd173,134 /// @dev EVM selector for this function is: 0x6c0cd173,135 /// or in textual repr: removeCollectionAdminCross((address,uint256))135 /// or in textual repr: removeCollectionAdminCross((address,uint256))136 function removeCollectionAdminCross(EthCrossAccount memory admin) external;136 function removeCollectionAdminCross(CrossAccount memory admin) external;137137138 // /// Add collection admin.138 // /// Add collection admin.139 // /// @param newAdmin Address of the added administrator.139 // /// @param newAdmin Address of the added administrator.186 /// @param user User address to check.186 /// @param user User address to check.187 /// @dev EVM selector for this function is: 0x91b6df49,187 /// @dev EVM selector for this function is: 0x91b6df49,188 /// or in textual repr: allowlistedCross((address,uint256))188 /// or in textual repr: allowlistedCross((address,uint256))189 function allowlistedCross(EthCrossAccount memory user) external view returns (bool);189 function allowlistedCross(CrossAccount memory user) external view returns (bool);190190191 // /// Add the user to the allowed list.191 // /// Add the user to the allowed list.192 // ///192 // ///200 /// @param user User cross account address.200 /// @param user User cross account address.201 /// @dev EVM selector for this function is: 0xa0184a3a,201 /// @dev EVM selector for this function is: 0xa0184a3a,202 /// or in textual repr: addToCollectionAllowListCross((address,uint256))202 /// or in textual repr: addToCollectionAllowListCross((address,uint256))203 function addToCollectionAllowListCross(EthCrossAccount memory user) external;203 function addToCollectionAllowListCross(CrossAccount memory user) external;204204205 // /// Remove the user from the allowed list.205 // /// Remove the user from the allowed list.206 // ///206 // ///214 /// @param user User cross account address.214 /// @param user User cross account address.215 /// @dev EVM selector for this function is: 0x09ba452a,215 /// @dev EVM selector for this function is: 0x09ba452a,216 /// or in textual repr: removeFromCollectionAllowListCross((address,uint256))216 /// or in textual repr: removeFromCollectionAllowListCross((address,uint256))217 function removeFromCollectionAllowListCross(EthCrossAccount memory user) external;217 function removeFromCollectionAllowListCross(CrossAccount memory user) external;218218219 /// Switch permission for minting.219 /// Switch permission for minting.220 ///220 ///237 /// @return "true" if account is the owner or admin237 /// @return "true" if account is the owner or admin238 /// @dev EVM selector for this function is: 0x3e75a905,238 /// @dev EVM selector for this function is: 0x3e75a905,239 /// or in textual repr: isOwnerOrAdminCross((address,uint256))239 /// or in textual repr: isOwnerOrAdminCross((address,uint256))240 function isOwnerOrAdminCross(EthCrossAccount memory user) external view returns (bool);240 function isOwnerOrAdminCross(CrossAccount memory user) external view returns (bool);241241242 /// Returns collection type242 /// Returns collection type243 ///243 ///252 /// If address is canonical then substrate mirror is zero and vice versa.252 /// If address is canonical then substrate mirror is zero and vice versa.253 /// @dev EVM selector for this function is: 0xdf727d3b,253 /// @dev EVM selector for this function is: 0xdf727d3b,254 /// or in textual repr: collectionOwner()254 /// or in textual repr: collectionOwner()255 function collectionOwner() external view returns (EthCrossAccount memory);255 function collectionOwner() external view returns (CrossAccount memory);256256257 // /// Changes collection owner to another account257 // /// Changes collection owner to another account258 // ///258 // ///268 /// If address is canonical then substrate mirror is zero and vice versa.268 /// If address is canonical then substrate mirror is zero and vice versa.269 /// @dev EVM selector for this function is: 0x5813216b,269 /// @dev EVM selector for this function is: 0x5813216b,270 /// or in textual repr: collectionAdmins()270 /// or in textual repr: collectionAdmins()271 function collectionAdmins() external view returns (EthCrossAccount[] memory);271 function collectionAdmins() external view returns (CrossAccount[] memory);272272273 /// Changes collection owner to another account273 /// Changes collection owner to another account274 ///274 ///275 /// @dev Owner can be changed only by current owner275 /// @dev Owner can be changed only by current owner276 /// @param newOwner new owner cross account276 /// @param newOwner new owner cross account277 /// @dev EVM selector for this function is: 0x6496c497,277 /// @dev EVM selector for this function is: 0x6496c497,278 /// or in textual repr: changeCollectionOwnerCross((address,uint256))278 /// or in textual repr: changeCollectionOwnerCross((address,uint256))279 function changeCollectionOwnerCross(EthCrossAccount memory newOwner) external;279 function changeCollectionOwnerCross(CrossAccount memory newOwner) external;280}280}281281282/// @dev Cross account struct282/// @dev Cross account struct283struct EthCrossAccount {283struct CrossAccount {284 address eth;284 address eth;285 uint256 sub;285 uint256 sub;286}286}305 uint256[] field_1;305 uint256[] field_1;306}306}307307308/// @dev [`CollectionLimits`](up_data_structs::CollectionLimits) field representation for EVM.308struct CollectionLimit {309struct CollectionLimit {309 CollectionLimitField field;310 CollectionLimitField field;310 bool status;311 bool status;311 uint256 value;312 uint256 value;312}313}313314314/// @dev [`CollectionLimits`](up_data_structs::CollectionLimits) representation for EVM.315/// @dev [`CollectionLimits`](up_data_structs::CollectionLimits) fields representation for EVM.315enum CollectionLimitField {316enum CollectionLimitField {316 /// @dev How many tokens can a user have on one account.317 /// @dev How many tokens can a user have on one account.317 AccountTokenOwnership,318 AccountTokenOwnership,350351351 /// @dev EVM selector for this function is: 0x269e6158,352 /// @dev EVM selector for this function is: 0x269e6158,352 /// or in textual repr: mintCross((address,uint256),uint256)353 /// or in textual repr: mintCross((address,uint256),uint256)353 function mintCross(EthCrossAccount memory to, uint256 amount) external returns (bool);354 function mintCross(CrossAccount memory to, uint256 amount) external returns (bool);354355355 /// @dev EVM selector for this function is: 0x0ecd0ab0,356 /// @dev EVM selector for this function is: 0x0ecd0ab0,356 /// or in textual repr: approveCross((address,uint256),uint256)357 /// or in textual repr: approveCross((address,uint256),uint256)357 function approveCross(EthCrossAccount memory spender, uint256 amount) external returns (bool);358 function approveCross(CrossAccount memory spender, uint256 amount) external returns (bool);358359359 // /// Burn tokens from account360 // /// Burn tokens from account360 // /// @dev Function that burns an `amount` of the tokens of a given account,361 // /// @dev Function that burns an `amount` of the tokens of a given account,372 /// @param amount The amount that will be burnt.373 /// @param amount The amount that will be burnt.373 /// @dev EVM selector for this function is: 0xbb2f5a58,374 /// @dev EVM selector for this function is: 0xbb2f5a58,374 /// or in textual repr: burnFromCross((address,uint256),uint256)375 /// or in textual repr: burnFromCross((address,uint256),uint256)375 function burnFromCross(EthCrossAccount memory from, uint256 amount) external returns (bool);376 function burnFromCross(CrossAccount memory from, uint256 amount) external returns (bool);376377377 /// Mint tokens for multiple accounts.378 /// Mint tokens for multiple accounts.378 /// @param amounts array of pairs of account address and amount379 /// @param amounts array of pairs of account address and amount382383383 /// @dev EVM selector for this function is: 0x2ada85ff,384 /// @dev EVM selector for this function is: 0x2ada85ff,384 /// or in textual repr: transferCross((address,uint256),uint256)385 /// or in textual repr: transferCross((address,uint256),uint256)385 function transferCross(EthCrossAccount memory to, uint256 amount) external returns (bool);386 function transferCross(CrossAccount memory to, uint256 amount) external returns (bool);386387387 /// @dev EVM selector for this function is: 0xd5cf430b,388 /// @dev EVM selector for this function is: 0xd5cf430b,388 /// or in textual repr: transferFromCross((address,uint256),(address,uint256),uint256)389 /// or in textual repr: transferFromCross((address,uint256),(address,uint256),uint256)389 function transferFromCross(390 function transferFromCross(390 EthCrossAccount memory from,391 CrossAccount memory from,391 EthCrossAccount memory to,392 CrossAccount memory to,392 uint256 amount393 uint256 amount393 ) external returns (bool);394 ) external returns (bool);394}395}tests/src/eth/api/UniqueNFT.soldiffbeforeafterboth180 /// @param sponsor Cross account address of the sponsor from whose account funds will be debited for operations with the contract.180 /// @param sponsor Cross account address of the sponsor from whose account funds will be debited for operations with the contract.181 /// @dev EVM selector for this function is: 0x84a1d5a8,181 /// @dev EVM selector for this function is: 0x84a1d5a8,182 /// or in textual repr: setCollectionSponsorCross((address,uint256))182 /// or in textual repr: setCollectionSponsorCross((address,uint256))183 function setCollectionSponsorCross(EthCrossAccount memory sponsor) external;183 function setCollectionSponsorCross(CrossAccount memory sponsor) external;184184185 /// Whether there is a pending sponsor.185 /// Whether there is a pending sponsor.186 /// @dev EVM selector for this function is: 0x058ac185,186 /// @dev EVM selector for this function is: 0x058ac185,204 /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.204 /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.205 /// @dev EVM selector for this function is: 0x6ec0a9f1,205 /// @dev EVM selector for this function is: 0x6ec0a9f1,206 /// or in textual repr: collectionSponsor()206 /// or in textual repr: collectionSponsor()207 function collectionSponsor() external view returns (EthCrossAccount memory);207 function collectionSponsor() external view returns (CrossAccount memory);208208209 /// Get current collection limits.209 /// Get current collection limits.210 ///210 ///229 /// @param newAdmin Cross account administrator address.229 /// @param newAdmin Cross account administrator address.230 /// @dev EVM selector for this function is: 0x859aa7d6,230 /// @dev EVM selector for this function is: 0x859aa7d6,231 /// or in textual repr: addCollectionAdminCross((address,uint256))231 /// or in textual repr: addCollectionAdminCross((address,uint256))232 function addCollectionAdminCross(EthCrossAccount memory newAdmin) external;232 function addCollectionAdminCross(CrossAccount memory newAdmin) external;233233234 /// Remove collection admin.234 /// Remove collection admin.235 /// @param admin Cross account administrator address.235 /// @param admin Cross account administrator address.236 /// @dev EVM selector for this function is: 0x6c0cd173,236 /// @dev EVM selector for this function is: 0x6c0cd173,237 /// or in textual repr: removeCollectionAdminCross((address,uint256))237 /// or in textual repr: removeCollectionAdminCross((address,uint256))238 function removeCollectionAdminCross(EthCrossAccount memory admin) external;238 function removeCollectionAdminCross(CrossAccount memory admin) external;239239240 // /// Add collection admin.240 // /// Add collection admin.241 // /// @param newAdmin Address of the added administrator.241 // /// @param newAdmin Address of the added administrator.288 /// @param user User address to check.288 /// @param user User address to check.289 /// @dev EVM selector for this function is: 0x91b6df49,289 /// @dev EVM selector for this function is: 0x91b6df49,290 /// or in textual repr: allowlistedCross((address,uint256))290 /// or in textual repr: allowlistedCross((address,uint256))291 function allowlistedCross(EthCrossAccount memory user) external view returns (bool);291 function allowlistedCross(CrossAccount memory user) external view returns (bool);292292293 // /// Add the user to the allowed list.293 // /// Add the user to the allowed list.294 // ///294 // ///302 /// @param user User cross account address.302 /// @param user User cross account address.303 /// @dev EVM selector for this function is: 0xa0184a3a,303 /// @dev EVM selector for this function is: 0xa0184a3a,304 /// or in textual repr: addToCollectionAllowListCross((address,uint256))304 /// or in textual repr: addToCollectionAllowListCross((address,uint256))305 function addToCollectionAllowListCross(EthCrossAccount memory user) external;305 function addToCollectionAllowListCross(CrossAccount memory user) external;306306307 // /// Remove the user from the allowed list.307 // /// Remove the user from the allowed list.308 // ///308 // ///316 /// @param user User cross account address.316 /// @param user User cross account address.317 /// @dev EVM selector for this function is: 0x09ba452a,317 /// @dev EVM selector for this function is: 0x09ba452a,318 /// or in textual repr: removeFromCollectionAllowListCross((address,uint256))318 /// or in textual repr: removeFromCollectionAllowListCross((address,uint256))319 function removeFromCollectionAllowListCross(EthCrossAccount memory user) external;319 function removeFromCollectionAllowListCross(CrossAccount memory user) external;320320321 /// Switch permission for minting.321 /// Switch permission for minting.322 ///322 ///339 /// @return "true" if account is the owner or admin339 /// @return "true" if account is the owner or admin340 /// @dev EVM selector for this function is: 0x3e75a905,340 /// @dev EVM selector for this function is: 0x3e75a905,341 /// or in textual repr: isOwnerOrAdminCross((address,uint256))341 /// or in textual repr: isOwnerOrAdminCross((address,uint256))342 function isOwnerOrAdminCross(EthCrossAccount memory user) external view returns (bool);342 function isOwnerOrAdminCross(CrossAccount memory user) external view returns (bool);343343344 /// Returns collection type344 /// Returns collection type345 ///345 ///354 /// If address is canonical then substrate mirror is zero and vice versa.354 /// If address is canonical then substrate mirror is zero and vice versa.355 /// @dev EVM selector for this function is: 0xdf727d3b,355 /// @dev EVM selector for this function is: 0xdf727d3b,356 /// or in textual repr: collectionOwner()356 /// or in textual repr: collectionOwner()357 function collectionOwner() external view returns (EthCrossAccount memory);357 function collectionOwner() external view returns (CrossAccount memory);358358359 // /// Changes collection owner to another account359 // /// Changes collection owner to another account360 // ///360 // ///370 /// If address is canonical then substrate mirror is zero and vice versa.370 /// If address is canonical then substrate mirror is zero and vice versa.371 /// @dev EVM selector for this function is: 0x5813216b,371 /// @dev EVM selector for this function is: 0x5813216b,372 /// or in textual repr: collectionAdmins()372 /// or in textual repr: collectionAdmins()373 function collectionAdmins() external view returns (EthCrossAccount[] memory);373 function collectionAdmins() external view returns (CrossAccount[] memory);374374375 /// Changes collection owner to another account375 /// Changes collection owner to another account376 ///376 ///377 /// @dev Owner can be changed only by current owner377 /// @dev Owner can be changed only by current owner378 /// @param newOwner new owner cross account378 /// @param newOwner new owner cross account379 /// @dev EVM selector for this function is: 0x6496c497,379 /// @dev EVM selector for this function is: 0x6496c497,380 /// or in textual repr: changeCollectionOwnerCross((address,uint256))380 /// or in textual repr: changeCollectionOwnerCross((address,uint256))381 function changeCollectionOwnerCross(EthCrossAccount memory newOwner) external;381 function changeCollectionOwnerCross(CrossAccount memory newOwner) external;382}382}383383384/// @dev Cross account struct384/// @dev Cross account struct385struct EthCrossAccount {385struct CrossAccount {386 address eth;386 address eth;387 uint256 sub;387 uint256 sub;388}388}407 uint256[] field_1;407 uint256[] field_1;408}408}409409410/// @dev [`CollectionLimits`](up_data_structs::CollectionLimits) field representation for EVM.410struct CollectionLimit {411struct CollectionLimit {411 CollectionLimitField field;412 CollectionLimitField field;412 bool status;413 bool status;413 uint256 value;414 uint256 value;414}415}415416416/// @dev [`CollectionLimits`](up_data_structs::CollectionLimits) representation for EVM.417/// @dev [`CollectionLimits`](up_data_structs::CollectionLimits) fields representation for EVM.417enum CollectionLimitField {418enum CollectionLimitField {418 /// @dev How many tokens can a user have on one account.419 /// @dev How many tokens can a user have on one account.419 AccountTokenOwnership,420 AccountTokenOwnership,552 /// @param tokenId Id for the token.553 /// @param tokenId Id for the token.553 /// @dev EVM selector for this function is: 0x2b29dace,554 /// @dev EVM selector for this function is: 0x2b29dace,554 /// or in textual repr: crossOwnerOf(uint256)555 /// or in textual repr: crossOwnerOf(uint256)555 function crossOwnerOf(uint256 tokenId) external view returns (EthCrossAccount memory);556 function crossOwnerOf(uint256 tokenId) external view returns (CrossAccount memory);556557557 /// Returns the token properties.558 /// Returns the token properties.558 ///559 ///571 /// @param tokenId The NFT to approve572 /// @param tokenId The NFT to approve572 /// @dev EVM selector for this function is: 0x0ecd0ab0,573 /// @dev EVM selector for this function is: 0x0ecd0ab0,573 /// or in textual repr: approveCross((address,uint256),uint256)574 /// or in textual repr: approveCross((address,uint256),uint256)574 function approveCross(EthCrossAccount memory approved, uint256 tokenId) external;575 function approveCross(CrossAccount memory approved, uint256 tokenId) external;575576576 /// @notice Transfer ownership of an NFT577 /// @notice Transfer ownership of an NFT577 /// @dev Throws unless `msg.sender` is the current owner. Throws if `to`578 /// @dev Throws unless `msg.sender` is the current owner. Throws if `to`589 /// @param tokenId The NFT to transfer590 /// @param tokenId The NFT to transfer590 /// @dev EVM selector for this function is: 0x2ada85ff,591 /// @dev EVM selector for this function is: 0x2ada85ff,591 /// or in textual repr: transferCross((address,uint256),uint256)592 /// or in textual repr: transferCross((address,uint256),uint256)592 function transferCross(EthCrossAccount memory to, uint256 tokenId) external;593 function transferCross(CrossAccount memory to, uint256 tokenId) external;593594594 /// @notice Transfer ownership of an NFT from cross account address to cross account address595 /// @notice Transfer ownership of an NFT from cross account address to cross account address595 /// @dev Throws unless `msg.sender` is the current owner. Throws if `to`596 /// @dev Throws unless `msg.sender` is the current owner. Throws if `to`600 /// @dev EVM selector for this function is: 0xd5cf430b,601 /// @dev EVM selector for this function is: 0xd5cf430b,601 /// or in textual repr: transferFromCross((address,uint256),(address,uint256),uint256)602 /// or in textual repr: transferFromCross((address,uint256),(address,uint256),uint256)602 function transferFromCross(603 function transferFromCross(603 EthCrossAccount memory from,604 CrossAccount memory from,604 EthCrossAccount memory to,605 CrossAccount memory to,605 uint256 tokenId606 uint256 tokenId606 ) external;607 ) external;607608623 /// @param tokenId The NFT to transfer624 /// @param tokenId The NFT to transfer624 /// @dev EVM selector for this function is: 0xbb2f5a58,625 /// @dev EVM selector for this function is: 0xbb2f5a58,625 /// or in textual repr: burnFromCross((address,uint256),uint256)626 /// or in textual repr: burnFromCross((address,uint256),uint256)626 function burnFromCross(EthCrossAccount memory from, uint256 tokenId) external;627 function burnFromCross(CrossAccount memory from, uint256 tokenId) external;627628628 /// @notice Returns next free NFT ID.629 /// @notice Returns next free NFT ID.629 /// @dev EVM selector for this function is: 0x75794a3c,630 /// @dev EVM selector for this function is: 0x75794a3c,654 /// @return uint256 The id of the newly minted token655 /// @return uint256 The id of the newly minted token655 /// @dev EVM selector for this function is: 0xb904db03,656 /// @dev EVM selector for this function is: 0xb904db03,656 /// or in textual repr: mintCross((address,uint256),(string,bytes)[])657 /// or in textual repr: mintCross((address,uint256),(string,bytes)[])657 function mintCross(EthCrossAccount memory to, Property[] memory properties) external returns (uint256);658 function mintCross(CrossAccount memory to, Property[] memory properties) external returns (uint256);658}659}659660660/// @dev anonymous struct661/// @dev anonymous structtests/src/eth/api/UniqueRefungible.soldiffbeforeafterboth180 /// @param sponsor Cross account address of the sponsor from whose account funds will be debited for operations with the contract.180 /// @param sponsor Cross account address of the sponsor from whose account funds will be debited for operations with the contract.181 /// @dev EVM selector for this function is: 0x84a1d5a8,181 /// @dev EVM selector for this function is: 0x84a1d5a8,182 /// or in textual repr: setCollectionSponsorCross((address,uint256))182 /// or in textual repr: setCollectionSponsorCross((address,uint256))183 function setCollectionSponsorCross(EthCrossAccount memory sponsor) external;183 function setCollectionSponsorCross(CrossAccount memory sponsor) external;184184185 /// Whether there is a pending sponsor.185 /// Whether there is a pending sponsor.186 /// @dev EVM selector for this function is: 0x058ac185,186 /// @dev EVM selector for this function is: 0x058ac185,204 /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.204 /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.205 /// @dev EVM selector for this function is: 0x6ec0a9f1,205 /// @dev EVM selector for this function is: 0x6ec0a9f1,206 /// or in textual repr: collectionSponsor()206 /// or in textual repr: collectionSponsor()207 function collectionSponsor() external view returns (EthCrossAccount memory);207 function collectionSponsor() external view returns (CrossAccount memory);208208209 /// Get current collection limits.209 /// Get current collection limits.210 ///210 ///229 /// @param newAdmin Cross account administrator address.229 /// @param newAdmin Cross account administrator address.230 /// @dev EVM selector for this function is: 0x859aa7d6,230 /// @dev EVM selector for this function is: 0x859aa7d6,231 /// or in textual repr: addCollectionAdminCross((address,uint256))231 /// or in textual repr: addCollectionAdminCross((address,uint256))232 function addCollectionAdminCross(EthCrossAccount memory newAdmin) external;232 function addCollectionAdminCross(CrossAccount memory newAdmin) external;233233234 /// Remove collection admin.234 /// Remove collection admin.235 /// @param admin Cross account administrator address.235 /// @param admin Cross account administrator address.236 /// @dev EVM selector for this function is: 0x6c0cd173,236 /// @dev EVM selector for this function is: 0x6c0cd173,237 /// or in textual repr: removeCollectionAdminCross((address,uint256))237 /// or in textual repr: removeCollectionAdminCross((address,uint256))238 function removeCollectionAdminCross(EthCrossAccount memory admin) external;238 function removeCollectionAdminCross(CrossAccount memory admin) external;239239240 // /// Add collection admin.240 // /// Add collection admin.241 // /// @param newAdmin Address of the added administrator.241 // /// @param newAdmin Address of the added administrator.288 /// @param user User address to check.288 /// @param user User address to check.289 /// @dev EVM selector for this function is: 0x91b6df49,289 /// @dev EVM selector for this function is: 0x91b6df49,290 /// or in textual repr: allowlistedCross((address,uint256))290 /// or in textual repr: allowlistedCross((address,uint256))291 function allowlistedCross(EthCrossAccount memory user) external view returns (bool);291 function allowlistedCross(CrossAccount memory user) external view returns (bool);292292293 // /// Add the user to the allowed list.293 // /// Add the user to the allowed list.294 // ///294 // ///302 /// @param user User cross account address.302 /// @param user User cross account address.303 /// @dev EVM selector for this function is: 0xa0184a3a,303 /// @dev EVM selector for this function is: 0xa0184a3a,304 /// or in textual repr: addToCollectionAllowListCross((address,uint256))304 /// or in textual repr: addToCollectionAllowListCross((address,uint256))305 function addToCollectionAllowListCross(EthCrossAccount memory user) external;305 function addToCollectionAllowListCross(CrossAccount memory user) external;306306307 // /// Remove the user from the allowed list.307 // /// Remove the user from the allowed list.308 // ///308 // ///316 /// @param user User cross account address.316 /// @param user User cross account address.317 /// @dev EVM selector for this function is: 0x09ba452a,317 /// @dev EVM selector for this function is: 0x09ba452a,318 /// or in textual repr: removeFromCollectionAllowListCross((address,uint256))318 /// or in textual repr: removeFromCollectionAllowListCross((address,uint256))319 function removeFromCollectionAllowListCross(EthCrossAccount memory user) external;319 function removeFromCollectionAllowListCross(CrossAccount memory user) external;320320321 /// Switch permission for minting.321 /// Switch permission for minting.322 ///322 ///339 /// @return "true" if account is the owner or admin339 /// @return "true" if account is the owner or admin340 /// @dev EVM selector for this function is: 0x3e75a905,340 /// @dev EVM selector for this function is: 0x3e75a905,341 /// or in textual repr: isOwnerOrAdminCross((address,uint256))341 /// or in textual repr: isOwnerOrAdminCross((address,uint256))342 function isOwnerOrAdminCross(EthCrossAccount memory user) external view returns (bool);342 function isOwnerOrAdminCross(CrossAccount memory user) external view returns (bool);343343344 /// Returns collection type344 /// Returns collection type345 ///345 ///354 /// If address is canonical then substrate mirror is zero and vice versa.354 /// If address is canonical then substrate mirror is zero and vice versa.355 /// @dev EVM selector for this function is: 0xdf727d3b,355 /// @dev EVM selector for this function is: 0xdf727d3b,356 /// or in textual repr: collectionOwner()356 /// or in textual repr: collectionOwner()357 function collectionOwner() external view returns (EthCrossAccount memory);357 function collectionOwner() external view returns (CrossAccount memory);358358359 // /// Changes collection owner to another account359 // /// Changes collection owner to another account360 // ///360 // ///370 /// If address is canonical then substrate mirror is zero and vice versa.370 /// If address is canonical then substrate mirror is zero and vice versa.371 /// @dev EVM selector for this function is: 0x5813216b,371 /// @dev EVM selector for this function is: 0x5813216b,372 /// or in textual repr: collectionAdmins()372 /// or in textual repr: collectionAdmins()373 function collectionAdmins() external view returns (EthCrossAccount[] memory);373 function collectionAdmins() external view returns (CrossAccount[] memory);374374375 /// Changes collection owner to another account375 /// Changes collection owner to another account376 ///376 ///377 /// @dev Owner can be changed only by current owner377 /// @dev Owner can be changed only by current owner378 /// @param newOwner new owner cross account378 /// @param newOwner new owner cross account379 /// @dev EVM selector for this function is: 0x6496c497,379 /// @dev EVM selector for this function is: 0x6496c497,380 /// or in textual repr: changeCollectionOwnerCross((address,uint256))380 /// or in textual repr: changeCollectionOwnerCross((address,uint256))381 function changeCollectionOwnerCross(EthCrossAccount memory newOwner) external;381 function changeCollectionOwnerCross(CrossAccount memory newOwner) external;382}382}383383384/// @dev Cross account struct384/// @dev Cross account struct385struct EthCrossAccount {385struct CrossAccount {386 address eth;386 address eth;387 uint256 sub;387 uint256 sub;388}388}407 uint256[] field_1;407 uint256[] field_1;408}408}409409410/// @dev [`CollectionLimits`](up_data_structs::CollectionLimits) field representation for EVM.410struct CollectionLimit {411struct CollectionLimit {411 CollectionLimitField field;412 CollectionLimitField field;412 bool status;413 bool status;413 uint256 value;414 uint256 value;414}415}415416416/// @dev [`CollectionLimits`](up_data_structs::CollectionLimits) representation for EVM.417/// @dev [`CollectionLimits`](up_data_structs::CollectionLimits) fields representation for EVM.417enum CollectionLimitField {418enum CollectionLimitField {418 /// @dev How many tokens can a user have on one account.419 /// @dev How many tokens can a user have on one account.419 AccountTokenOwnership,420 AccountTokenOwnership,550 /// @param tokenId Id for the token.551 /// @param tokenId Id for the token.551 /// @dev EVM selector for this function is: 0x2b29dace,552 /// @dev EVM selector for this function is: 0x2b29dace,552 /// or in textual repr: crossOwnerOf(uint256)553 /// or in textual repr: crossOwnerOf(uint256)553 function crossOwnerOf(uint256 tokenId) external view returns (EthCrossAccount memory);554 function crossOwnerOf(uint256 tokenId) external view returns (CrossAccount memory);554555555 /// Returns the token properties.556 /// Returns the token properties.556 ///557 ///579 /// @param tokenId The RFT to transfer580 /// @param tokenId The RFT to transfer580 /// @dev EVM selector for this function is: 0x2ada85ff,581 /// @dev EVM selector for this function is: 0x2ada85ff,581 /// or in textual repr: transferCross((address,uint256),uint256)582 /// or in textual repr: transferCross((address,uint256),uint256)582 function transferCross(EthCrossAccount memory to, uint256 tokenId) external;583 function transferCross(CrossAccount memory to, uint256 tokenId) external;583584584 /// @notice Transfer ownership of an RFT585 /// @notice Transfer ownership of an RFT585 /// @dev Throws unless `msg.sender` is the current owner. Throws if `to`586 /// @dev Throws unless `msg.sender` is the current owner. Throws if `to`590 /// @dev EVM selector for this function is: 0xd5cf430b,591 /// @dev EVM selector for this function is: 0xd5cf430b,591 /// or in textual repr: transferFromCross((address,uint256),(address,uint256),uint256)592 /// or in textual repr: transferFromCross((address,uint256),(address,uint256),uint256)592 function transferFromCross(593 function transferFromCross(593 EthCrossAccount memory from,594 CrossAccount memory from,594 EthCrossAccount memory to,595 CrossAccount memory to,595 uint256 tokenId596 uint256 tokenId596 ) external;597 ) external;597598615 /// @param tokenId The RFT to transfer616 /// @param tokenId The RFT to transfer616 /// @dev EVM selector for this function is: 0xbb2f5a58,617 /// @dev EVM selector for this function is: 0xbb2f5a58,617 /// or in textual repr: burnFromCross((address,uint256),uint256)618 /// or in textual repr: burnFromCross((address,uint256),uint256)618 function burnFromCross(EthCrossAccount memory from, uint256 tokenId) external;619 function burnFromCross(CrossAccount memory from, uint256 tokenId) external;619620620 /// @notice Returns next free RFT ID.621 /// @notice Returns next free RFT ID.621 /// @dev EVM selector for this function is: 0x75794a3c,622 /// @dev EVM selector for this function is: 0x75794a3c,646 /// @return uint256 The id of the newly minted token647 /// @return uint256 The id of the newly minted token647 /// @dev EVM selector for this function is: 0xb904db03,648 /// @dev EVM selector for this function is: 0xb904db03,648 /// or in textual repr: mintCross((address,uint256),(string,bytes)[])649 /// or in textual repr: mintCross((address,uint256),(string,bytes)[])649 function mintCross(EthCrossAccount memory to, Property[] memory properties) external returns (uint256);650 function mintCross(CrossAccount memory to, Property[] memory properties) external returns (uint256);650651651 /// Returns EVM address for refungible token652 /// Returns EVM address for refungible token652 ///653 ///tests/src/eth/api/UniqueRefungibleToken.soldiffbeforeafterboth39 /// @param amount The amount that will be burnt.39 /// @param amount The amount that will be burnt.40 /// @dev EVM selector for this function is: 0xbb2f5a58,40 /// @dev EVM selector for this function is: 0xbb2f5a58,41 /// or in textual repr: burnFromCross((address,uint256),uint256)41 /// or in textual repr: burnFromCross((address,uint256),uint256)42 function burnFromCross(EthCrossAccount memory from, uint256 amount) external returns (bool);42 function burnFromCross(CrossAccount memory from, uint256 amount) external returns (bool);434344 /// @dev Approve the passed address to spend the specified amount of tokens on behalf of `msg.sender`.44 /// @dev Approve the passed address to spend the specified amount of tokens on behalf of `msg.sender`.45 /// Beware that changing an allowance with this method brings the risk that someone may use both the old45 /// Beware that changing an allowance with this method brings the risk that someone may use both the old50 /// @param amount The amount of tokens to be spent.50 /// @param amount The amount of tokens to be spent.51 /// @dev EVM selector for this function is: 0x0ecd0ab0,51 /// @dev EVM selector for this function is: 0x0ecd0ab0,52 /// or in textual repr: approveCross((address,uint256),uint256)52 /// or in textual repr: approveCross((address,uint256),uint256)53 function approveCross(EthCrossAccount memory spender, uint256 amount) external returns (bool);53 function approveCross(CrossAccount memory spender, uint256 amount) external returns (bool);545455 /// @dev Function that changes total amount of the tokens.55 /// @dev Function that changes total amount of the tokens.56 /// Throws if `msg.sender` doesn't owns all of the tokens.56 /// Throws if `msg.sender` doesn't owns all of the tokens.64 /// @param amount The amount to be transferred.64 /// @param amount The amount to be transferred.65 /// @dev EVM selector for this function is: 0x2ada85ff,65 /// @dev EVM selector for this function is: 0x2ada85ff,66 /// or in textual repr: transferCross((address,uint256),uint256)66 /// or in textual repr: transferCross((address,uint256),uint256)67 function transferCross(EthCrossAccount memory to, uint256 amount) external returns (bool);67 function transferCross(CrossAccount memory to, uint256 amount) external returns (bool);686869 /// @dev Transfer tokens from one address to another69 /// @dev Transfer tokens from one address to another70 /// @param from The address which you want to send tokens from70 /// @param from The address which you want to send tokens from73 /// @dev EVM selector for this function is: 0xd5cf430b,73 /// @dev EVM selector for this function is: 0xd5cf430b,74 /// or in textual repr: transferFromCross((address,uint256),(address,uint256),uint256)74 /// or in textual repr: transferFromCross((address,uint256),(address,uint256),uint256)75 function transferFromCross(75 function transferFromCross(76 EthCrossAccount memory from,76 CrossAccount memory from,77 EthCrossAccount memory to,77 CrossAccount memory to,78 uint256 amount78 uint256 amount79 ) external returns (bool);79 ) external returns (bool);80}80}818182/// @dev Cross account struct82/// @dev Cross account struct83struct EthCrossAccount {83struct CrossAccount {84 address eth;84 address eth;85 uint256 sub;85 uint256 sub;86}86}tests/src/eth/fractionalizer/Fractionalizer.soldiffbeforeafterboth3import {CollectionHelpers} from "../api/CollectionHelpers.sol";3import {CollectionHelpers} from "../api/CollectionHelpers.sol";4import {ContractHelpers} from "../api/ContractHelpers.sol";4import {ContractHelpers} from "../api/ContractHelpers.sol";5import {UniqueRefungibleToken} from "../api/UniqueRefungibleToken.sol";5import {UniqueRefungibleToken} from "../api/UniqueRefungibleToken.sol";6import {UniqueRefungible, EthCrossAccount} from "../api/UniqueRefungible.sol";6import {UniqueRefungible, CrossAccount} from "../api/UniqueRefungible.sol";7import {UniqueNFT} from "../api/UniqueNFT.sol";7import {UniqueNFT} from "../api/UniqueNFT.sol";889/// @dev Fractionalization contract. It stores mappings between NFT and RFT tokens,9/// @dev Fractionalization contract. It stores mappings between NFT and RFT tokens,63 "Wrong collection type. Collection is not refungible."63 "Wrong collection type. Collection is not refungible."64 );64 );65 require(65 require(66 refungibleContract.isOwnerOrAdminCross(EthCrossAccount({eth: address(this), sub: uint256(0)})),66 refungibleContract.isOwnerOrAdminCross(CrossAccount({eth: address(this), sub: uint256(0)})),67 "Fractionalizer contract should be an admin of the collection"67 "Fractionalizer contract should be an admin of the collection"68 );68 );69 rftCollection = _collection;69 rftCollection = _collection;tests/src/eth/util/playgrounds/types.tsdiffbeforeafterboth37 TransferEnabled38 TransferEnabled38}39}394040export interface EthCollectionLimit {41export interface CollectionLimit {41 field: CollectionLimitField,42 field: CollectionLimitField,42 status: boolean,43 status: boolean,43 value: bigint,44 value: bigint | number,44}45}4546