How to connect web3 contract with flutter

576 views Asked by At

I want to create a web d-App with flutter. I use flutter_web3 to connect to a metamask wallet on the browser with this code:

  final access = await ethereum!.requestAccount();
  if (access.isNotEmpty) currentAddress = access.first;

It connects successfully and I can get the address of the account. also I have these functions in solidity:

pragma solidity ^0.8.0;
contract Money {
uint public money = 0;

function getMoney() public view returns(uint256) {
    return money;
}

function updateMoney() external {
    money += 1;
}
}

Also, I have the contract address, RPC URL, and an abi.json file. So, How can I call getMoney function and updateMoney function with the contract?

0

There are 0 answers