Created
October 7, 2021 11:13
-
-
Save MCarlomagno/bbdd51719de0a453840b7bc5d57d4aec to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Future<DeployedContract> getContract() async { | |
// abi.json is the contract metadata, you can download it from the remix IDE | |
String abi = await rootBundle.loadString("assets/abi.json"); | |
String contractAddress = "my_contract_address"; // e.g. 0xd66C81d9b781152e2D9be07Ccdf2303A77B7163c | |
String contractName = "my_contract_name"; // you must set your own contract name here | |
DeployedContract contract = DeployedContract( | |
ContractAbi.fromJson(abi, contractName), | |
EthereumAddress.fromHex(contractAddress), | |
); | |
return contract; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment