git.delta.rocks / unique-network / refs/commits / 98f7ab5af769

difftreelog

fix single owner

PraetorP2022-12-05parent: #2880b7f.patch.diff
in: master

1 file changed

modifiedpallets/refungible/src/erc.rsdiffbeforeafterboth
34 CollectionHandle, CollectionPropertyPermissions, CommonCollectionOperations,34 CollectionHandle, CollectionPropertyPermissions, CommonCollectionOperations,
35 erc::{CommonEvmHandler, CollectionCall, static_property::key},35 erc::{CommonEvmHandler, CollectionCall, static_property::key},
36 eth::EthCrossAccount,36 eth::EthCrossAccount,
37 Error as CommonError,
37};38};
38use pallet_evm::{account::CrossAccountId, PrecompileHandle};39use pallet_evm::{account::CrossAccountId, PrecompileHandle};
39use pallet_evm_coder_substrate::{call, dispatch_to_evm};40use pallet_evm_coder_substrate::{call, dispatch_to_evm};
509 collection.consume_store_reads(1)?;510 collection.consume_store_reads(1)?;
510 let total_supply = <TotalSupply<T>>::get((collection.id, token));511 let total_supply = <TotalSupply<T>>::get((collection.id, token));
512
513 if owner_balance == 0 {
514 return Err(dispatch_to_evm::<T>(
515 <CommonError<T>>::TokenValueTooLow.into(),
516 ));
517 }
518
511 if total_supply != owner_balance {519 if total_supply != owner_balance {
512 return Err("token has multiple owners".into());520 return Err("token has multiple owners".into());