At Clause Inc. we are building a platform for smart legal contracts that targets all the major distributed ledger technologies, including the Ethereum blockchain.
In this article we look at five basic verbs that can be applied to Ethereum Smart Contracts: Connect, Compile, Deploy, Query and Modify.
In this first post we are publishing explanatory web3 1.0.x code to:
1. Connect to a local or remote Ethereum node using RPC and the web3 library
2. Compile a Solidity smart contract from source
3. Deploy the compiled contract, signing the deploy transaction using a private key
4. Query the state of a smart contract by calling read-only methods
5. Modify the state of the smart contract by submitting a transaction signed using a private key
For our purposes it is necessary to be able to automate all of these steps without manual human interaction, so the code shows how to programmatically sign transactions using a private key.
All the usual disclaimers apply: this is test code and has not been deployed to the Ethereum mainnet, or used in production. Use it at your own risk! Please don’t hesitate to file issues on the GitHub repository or post comments.