difftreelog
fix nft collection check
in: master
1 file changed
pallets/nft/src/eth/mod.rsdiffbeforeafterboth606061fn call_internal<T: Config>(sender: H160, collection: &CollectionHandle<T>, method_id: u32, mut input: AbiReader) -> Result<AbiWriter, Option<&'static str>> {61fn call_internal<T: Config>(sender: H160, collection: &CollectionHandle<T>, method_id: u32, mut input: AbiReader) -> Result<AbiWriter, Option<&'static str>> {62 let erc20 = matches!(collection.mode, CollectionMode::Fungible(_));62 let erc20 = matches!(collection.mode, CollectionMode::Fungible(_));63 let erc721 = matches!(collection.mode, CollectionMode::ReFungible);63 let erc721 = matches!(collection.mode, CollectionMode::NFT);646465 Ok(match method_id {65 Ok(match method_id {66 // function name() external view returns (string memory)66 // function name() external view returns (string memory)90 } 90 } 91 }91 }92 // function totalSupply() external view returns (uint256)92 // function totalSupply() external view returns (uint256)93 0x18160ddd if erc20 => {93 0x18160ddd if erc20 || erc721 => {94 // TODO: can't be implemented, as we don't track total amount of fungibles94 // TODO: can't be implemented, as we don't track total amount of fungibles95 crate::abi_encode!(uint256(0))95 crate::abi_encode!(uint256(0))96 }96 }