Unverified Commit f32c3aff authored by Michael Müller's avatar Michael Müller Committed by GitHub
Browse files

Update `delegator` readme (#766)

parent 2f3b36e3
Pipeline #134958 passed with stages
in 45 minutes and 19 seconds
......@@ -9,7 +9,12 @@ It consists in total of 4 different smart contract:
- Subber: Decreases a value in the Accumulator smart contract
- Accumulator: Owns a simple `i32` value that can be incremented or decremented
In order to test this bundle of smart contracts you need to do the following:
In order to test this bundle of smart contracts you need to execute the
following steps.
You can upload the contracts using our [Canvas UI](https://paritytech.github.io/canvas-ui/#/).
If you want to test it locally, our [Canvas Node](https://paritytech.github.io/ink-docs/getting-started/setup#installing-the-canvas-node)
is an easy way to get a local smart contract chain running.
1. Compile all contracts using the `./build-all.sh` script.
You will receive the respective `.contract` bundles for all the smart contracts in the `target/ink/` folder:
......@@ -17,10 +22,12 @@ In order to test this bundle of smart contracts you need to do the following:
* `target/ink/adder/adder.contract`
* `target/ink/subber/subber.contract`
* `target/ink/accumulator/accumulator.contract`
1. Upload the `.contract` bundle of Accumulator, Adder, Subber and the Delegator to the chain.
While doing so note down their respective code hashes. You will see the contract hash on the success page
(or success event) after having uploaded the contract to the chain.
1. Upload the `.contract` bundle of Accumulator, Adder and Subber to the chain.
1. Note down the respective code hashes of the uploaded contracts. You can
copy the contract hashes [from the page of uploaded contracts](https://paritytech.github.io/canvas-ui/#/instantiate):<br/>
[<img src="./.images/code-hashes.png" width="600" alt="Code Hashes Overview" />](https://paritytech.github.io/canvas-ui/#/instantiate)
1. Instantiate the Delegator smart contract given all of the code hashes and a starting value.
Make sure the endowment is big enough (if you're using our `canvas-node` it's `1000000`).
The Delegator smart contract will take over the work of instantiating the other smart contracts for you.
1. Now you are able to run the operations provided by the Delegator smart contract.
Namely `delegate` to delegate the call to either the Adder or the Subber to either increase or decrease
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment