Create smart contract with flutter and web3dart

1,071

web3dart doesn't support to create a new smart contract at the moment.

Share:
1,071
Auryn
Author by

Auryn

Full Stack Dev @ SAP Find my blog here: https://blog.auryn.dev/

Updated on December 09, 2022

Comments

  • Auryn
    Auryn over 1 year

    I am currently trying to create a smart contract with flutter and web3dart. I am able to read a created smart contract with the abi. but I can't find a way, to create a new one.

    reading was pretty simple:

    var ticketABI = ContractABI.parseFromJSON(_TICKET_ABI_EXTRACT, "Ticket");
    
    var ticketContract = new DeployedContract(ticketABI, new EthereumAddress(_TICKET_ADDRESS), ethClient, credentials);
    
    var getTicketCreator = ticketContract.findFunctionsByName("getTicketInformation").first;
    
    var ticketResponse = await new Transaction(keys: credentials, maximumGas: 0)
              .prepareForCall(ticketContract, getTicketCreator, [])
              .call(ethClient);
    
    var ticket = new Ticket.fromResponse(ticketResponse);
    

    But I cannot figure out how to create a new smart contract.

    Does anyone Know how-to?

    Thanks