You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 13, 2024. It is now read-only.
I try to use my abi data to create a contract (as shown at the end), but always crash at a same place.
I just simply read json data from my .json file and than parsed it as a string:
self.web3 =Web3.newWeb3(URL(string:"http://localhost:8545")!)!
// ABI
guard let path =Bundle.main.path(forResource:"abi", ofType:"json"),let abiString =try?String(contentsOf:URL(fileURLWithPath: path))else{fatalError("Can not get abi data")}
// Contract
self.contract =self.web3.contract(abiString, at:EthereumAddress(self.contractAddress))!
When I run my program, it would crash at the last line in code snap above, giving an error in console:
I try to use my abi data to create a contract (as shown at the end), but always crash at a same place.
I just simply read json data from my .json file and than parsed it as a string:
When I run my program, it would crash at the last line in code snap above, giving an error in console:
Am I missing something?
The abi data I used:
The text was updated successfully, but these errors were encountered: