Open jedahan opened 5 years ago
Sounds good.
Contract::from_json(<solidity-compiler-output-json>)
Contract::from_abi(<abi-json-file)
Solidity-generated json also contains the entire bytecode, that is not strictly necessary for interacting with the contract.
.deploy()
method could change as well, cause we need to provide the bytecode there, while we could read it from the sol.json file.
PRs welcome.
So I tried doing
Contract::from_json
against @0x/contract-artifacts/artifacts/ZRXToken.json, but ran into an error where there was an unexpected map.Turns out,
Contract::from_json
wanted just the.compiledOutput.abi
portion of that file (as an array).I am wondering if it would be more user friendly if we either had from_json detect and support
.compiledOutput.abi
, and possibly rename the current from_json to from_abi.I could also be misunderstanding what an artifact is in which case I can maybe make a PR to add some helpful hints in the docs to beginners like myself. Or perhaps more user friendly error messages.