@@ -9,18 +9,25 @@ It consists in total of 4 different smart contract:
9
9
- Subber: Decreases a value in the Accumulator smart contract
10
10
- Accumulator: Owns a simple ` i32 ` value that can be incremented or decremented
11
11
12
- In order to test this bundle of smart contracts you need to do the following:
12
+ In order to test this bundle of smart contracts you need to execute the
13
+ following steps.
14
+
15
+ You can upload the contracts using our [ Canvas UI] ( https://paritytech.github.io/canvas-ui/#/ ) .
16
+ If you want to test it locally, our [ Canvas Node] ( https://paritytech.github.io/ink-docs/getting-started/setup#installing-the-canvas-node )
17
+ is an easy way to get a local smart contract chain running.
13
18
14
19
1 . Compile all contracts using the ` ./build-all.sh ` script.
15
20
You will receive the respective ` .contract ` bundles for all the smart contracts in the ` target/ink/ ` folder:
16
21
* ` target/ink/delegator.contract `
17
22
* ` target/ink/adder/adder.contract `
18
23
* ` target/ink/subber/subber.contract `
19
24
* ` target/ink/accumulator/accumulator.contract `
20
- 1 . Upload the ` .contract ` bundle of Accumulator, Adder, Subber and the Delegator to the chain.
21
- While doing so note down their respective code hashes. You will see the contract hash on the success page
22
- (or success event) after having uploaded the contract to the chain.
25
+ 1 . Upload the ` .contract ` bundle of Accumulator, Adder and Subber to the chain.
26
+ 1 . Note down the respective code hashes of the uploaded contracts. You can
27
+ copy the contract hashes [ from the page of uploaded contracts] ( https://paritytech.github.io/canvas-ui/#/instantiate ) :<br />
28
+ [ <img src =" ./.images/code-hashes.png " width =" 600 " alt =" Code Hashes Overview " />] ( https://paritytech.github.io/canvas-ui/#/instantiate )
23
29
1 . Instantiate the Delegator smart contract given all of the code hashes and a starting value.
30
+ Make sure the endowment is big enough (if you're using our ` canvas-node ` it's ` 1000000 ` ).
24
31
The Delegator smart contract will take over the work of instantiating the other smart contracts for you.
25
32
1 . Now you are able to run the operations provided by the Delegator smart contract.
26
33
Namely ` delegate ` to delegate the call to either the Adder or the Subber to either increase or decrease
0 commit comments