--- a/pallets/refungible/src/erc.rs +++ b/pallets/refungible/src/erc.rs @@ -195,16 +195,18 @@ #[solidity_interface(name = ERC721Metadata)] impl RefungibleHandle { - /// @notice A descriptive name for a collection of RFTs in this contract - fn name(&self) -> Result { - Ok(decode_utf16(self.name.iter().copied()) - .map(|r| r.unwrap_or(REPLACEMENT_CHARACTER)) - .collect::()) + /// @notice A descriptive name for a collection of NFTs in this contract + /// @dev real implementation of this function lies in `ERC721UniqueExtensions` + #[solidity(hide, rename_selector = "name")] + fn name_proxy(&self) -> Result { + self.name() } - /// @notice An abbreviated name for RFTs in this contract - fn symbol(&self) -> Result { - Ok(string::from_utf8_lossy(&self.token_prefix).into()) + /// @notice An abbreviated name for NFTs in this contract + /// @dev real implementation of this function lies in `ERC721UniqueExtensions` + #[solidity(hide, rename_selector = "symbol")] + fn symbol_proxy(&self) -> Result { + self.symbol() } /// @notice A distinct Uniform Resource Identifier (URI) for a given asset. @@ -596,6 +598,18 @@ /// @title Unique extensions for ERC721. #[solidity_interface(name = ERC721UniqueExtensions)] impl RefungibleHandle { + /// @notice A descriptive name for a collection of NFTs in this contract + fn name(&self) -> Result { + Ok(decode_utf16(self.name.iter().copied()) + .map(|r| r.unwrap_or(REPLACEMENT_CHARACTER)) + .collect::()) + } + + /// @notice An abbreviated name for NFTs in this contract + fn symbol(&self) -> Result { + Ok(string::from_utf8_lossy(&self.token_prefix).into()) + } + /// @notice Transfer ownership of an RFT /// @dev Throws unless `msg.sender` is the current owner. Throws if `to` /// is the zero address. Throws if `tokenId` is not a valid RFT.