y-pakorn / flutter_web3

Web3 Ethereum, Etherjs and Wallet Connect wrapper for Flutter Web.
Other
136 stars 46 forks source link

ERC721 Support #55

Open ronmegini opened 1 year ago

ronmegini commented 1 year ago

Description: I believe that support for ERC721 is an essential feature in this module.

ronmegini commented 1 year ago

As far as I know, it doesn't supported yet, please correct me if I'm wrong.

4xMafole commented 1 year ago

@ronmegini Currently, it does not. Only support ERC20 contract. But still you can use this package to create ERC721 contracts.

ronmegini commented 1 year ago

@ronmegini Currently, it does not. Only support ERC20 contract. But still you can use this package to create ERC721 contracts.

I am talking about interaction with already deployed ERC721 contracts' functions. Is there an estimated deployment time for this?

ronmegini commented 1 year ago

I think creating a PR for this ability although Im not very experienced with dart. Is this project active? Someone can review the code and approve the PR?

4xMafole commented 1 year ago

Do you mean like so ?

  Future<String> _mintNFT( 
     String collectionAddress, 
     String dataURI, 
   ) async { 
     //Getting the contract deployed 
     Contract deployedContract = Contract( 
         collectionAddress, NFTContract.contractABI, provider!.getSigner()); 

     //Send the function and data to interact with the contract 
     final transaction = await deployedContract.send('mint', [dataURI]); 

     //Getting the receipt from the transaction 
     final receipt = await transaction.wait(); 

     //Returning the transaction hash 
     return receipt.transactionHash; 
   } 
ronmegini commented 1 year ago

@4xMafole I thought about creating new ContractERC721 (same as ContractERC20), according to ERC721 standards