Skip to content

Commit

Permalink
Adding showcase scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
mgralinski-bright committed Jul 6, 2023
1 parent 29b7731 commit 34bb7f4
Show file tree
Hide file tree
Showing 28 changed files with 335 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Bright Disputes
This project is a dApp for raising and solving the disputes on the Substrate-based blockchains.
This project is a dApp for raising and solving the disputes on the Substrate-based blockchains. Process of building and running smart contract can be found in the sections bellow. Showcase scenario can be found in the [documentation](https://github.com/bright/bright-disputes/blob/main/doc/README.md).

## Prerequisites
1. `cargo-contract 2.x`
Expand Down
134 changes: 134 additions & 0 deletions doc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
# Bright Disputes - showcase
This document present a showcase for the Bright Disputes. We are going to use a [Substrate Contract UI](https://contracts-ui.substrate.io/) for interaction with our dApp.

Before starting interaction with smart contract, we will need first to build and deploy it on our local node. To do this please fallow the instruction from the [README](https://github.com/bright/bright-disputes/blob/main/README.md) file. We have provide a set of testing accounts:
[Owner](https://github.com/bright/bright-disputes/blob/main/doc/accounts/5ChhBGUJJLxPk2EJzDN6aeuA7yx7bBBGxgZx5iSr9rMhegrM.json), [Defendant](https://github.com/bright/bright-disputes/blob/main/doc/accounts/5Fhhzf8ZNH2mkP5YddoJ6kj6PfsnB49BxReRopc6CRvqVNrQ.json), [Jure1](https://github.com/bright/bright-disputes/blob/main/doc/accounts/5CFysjxm4tWyePnpELf4xG2o3ZvQV5WVdfvcETn552rYA8h9.json), [Jure2](https://github.com/bright/bright-disputes/blob/main/doc/accounts/5DfNSomECQZkpJJPi8CnBt3aFSAcbDJHy48xaqBkkAc5vVYJ.json), [Jure3](https://github.com/bright/bright-disputes/blob/main/doc/accounts/5CS8L2eS3sbYUcR6b5cvH93DZWiwCGXH4WJzSwTcHmAZekUj.json), [Jure4](https://github.com/bright/bright-disputes/blob/main/doc/accounts/5CSdvQ1mG1j6tsyMib46kFHpwdUqizvWs1NTHGLzQWpNRbrK.json), [Jure5](https://github.com/bright/bright-disputes/blob/main/doc/accounts/5CSvSo9vt1eu4d93EobfA6au8bheGLbkTdvATLb9RPVKgu9b.json), [Jure6](https://github.com/bright/bright-disputes/blob/main/doc/accounts/5CS1o2oMdptJ2owGABQd8Q2TJXSYnLiQjKMWRGnRnSw36RwP.json), [Jure7](https://github.com/bright/bright-disputes/blob/main/doc/accounts/5CSdKZuEYAbaH1nB8rbxqJU5PDtgTtCB5pj4abqQAhimdLU1.json), which are pre founded with some tokens. Password for all accounts is the same and it is: `123456` :)

### Create a dispute
When contract was successfully deployed to the aleph-node, we can create a dispute, by selecting `createDispute` extrinsic. We are going to use `Owner` account as a caller, and point `Defendant` account in the `defendantId`. We should also provide a link for the dispute description (`ownerLink`). Owner should also define an escrow amount, which will need to be deposit by all participates of the dispute. In our case we select `50`, and we also place the same amount in the `Value` filed. Those tokens are going to be transferred from our `Owner` account to the smart contract.

<center>

![Extrinsics](https://github.com/bright/bright-disputes/blob/main/doc/images/create_dispute.png)

</center>

### Confirm Defendant
Second step in the dispute process is confirmation of the defendant. We are going to select a `Defendant` account, and chose `confirmDefendant` extrinsic. Inputs for this message are: `dispute_id` which is going to be `1` and the `defendantLink` which is going to be link to defendant description of the dispute.

<center>

![Extrinsics](https://github.com/bright/bright-disputes/blob/main/doc/images/confirm_defendant.png)

</center>

### Jure / Judge registration
We are going to register accounts `Jure1`, `Jure2`, `Jure3`, `Jure4`, `Jure5`, `Jure6`, `Jure7` as an juries for the Bright Disputes. Some of them are going to be picked as Juries and one as Judge for our dispute case. First they need to register as an active Jure. We can do it by selecting their accounts as a Callers and picking a `registerAsAnActiveJure` extrinsic.

<center>

![Extrinsics](https://github.com/bright/bright-disputes/blob/main/doc/images/register_jure.png)

</center>

### Process Dispute: assign juries
Now `Owner` of the dispute can start dispute round by calling `processDisputeRound`, as an input passing `dispute_id` which is `1`.

<center>

![Extrinsics](https://github.com/bright/bright-disputes/blob/main/doc/images/process_dispute__assign_juries.png)

</center>

Now we can check if Juries and Judge where truly assigned to the dispute. We can call `getDispute` extrinsic, and check accounts of the Juries and Judge:

<center>

![Extrinsics](https://github.com/bright/bright-disputes/blob/main/doc/images/get_dispute_picking_juries.png)

</center>

From what we see accounts of `Jure1`, `Jure2`, `Jure3` are assigned as jure role, and the `Jure4` is a judge.

### Juries / Judge confirmation
Next step is to confirm participation of the juries and judge in the dispute. Juries need to call `confirmJureParticipationInDispute`

<center>

![Extrinsics](https://github.com/bright/bright-disputes/blob/main/doc/images/confirm_jure.png)

</center>

and judge will call `confirmJudgeParticipationInDispute`

<center>

![Extrinsics](https://github.com/bright/bright-disputes/blob/main/doc/images/confirm_judge.png)

</center>

Please note that as well juries and the judge will need to pay the same escrow as owner and defendant of the dispute.

### Process Dispute: voting phase
Now `Owner` of the dispute will once again call `processDisputeRound` extrinsic. At this stage, smart contract check if all juries and judge confirms their participation in the dispute. If they have not, than new dispute round will be started and once again juries and judge (whose haven not confirmed their participation) are going to be assigned. No we can move to the voting phase

<center>

![Extrinsics](https://github.com/bright/bright-disputes/blob/main/doc/images/get_dispute_start_voting.png)

</center>

where juries are requested to vote. They can do it by calling `vote` extrinsic, and passing `dispute_id` as `1` and vote value which can be `0` - vote against `Defendant` or `1` - vote against `Owner`.

<center>

![Extrinsics](https://github.com/bright/bright-disputes/blob/main/doc/images/jure_vote.png)

</center>

We can check if all juries have vote by getting the dispute:

<center>

![Extrinsics](https://github.com/bright/bright-disputes/blob/main/doc/images/get_dispute_voting_ends.png)

</center>

### Process Dispute: count the votes
At this stage once again `Owner` of the dispute will call `processDisputeRound` extrinsic. Smart contract will check if all juries have voted and move to the count the votes phase.

<center>

![Extrinsics](https://github.com/bright/bright-disputes/blob/main/doc/images/process_dispute__voting.png)

</center>

Now is the judge role to count the votes. In our case judge, who is `Jure4`, will call `processDisputeRound` extrinsic.

<center>

![Extrinsics](https://github.com/bright/bright-disputes/blob/main/doc/images/process_dispute__count_votes.png)

</center>

We can check if the dispute result was set:

<center>

![Extrinsics](https://github.com/bright/bright-disputes/blob/main/doc/images/get_dispute_ended.png)

</center>

### Distribute the deposit
The last stage of the dispute process is to split the dispute deposit, by calling `distributeDeposit`. Deposit will be distributed to:
* owner
* defendant
* judge
* juries - who where in the majority of the votes
For all juries and judges who haven't fullfil their duties, their escrow will be lost and split to others. The same rule stands for the juries who were in the minority of the votes.

<center>

![Extrinsics](https://github.com/bright/bright-disputes/blob/main/doc/images/distribute_deposit.png)

</center>
20 changes: 20 additions & 0 deletions doc/accounts/5CFysjxm4tWyePnpELf4xG2o3ZvQV5WVdfvcETn552rYA8h9.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"encoded": "dQSSjgVqkXaLlpZs9Gm8MSx6tdxfyEkbrJ3g54nog5AAgAAAAQAAAAgAAAD5OHcXcDf/Iz47FEI61eL1CHHqDiHJ9oyjakDi2NU7VZC0alGTUeww9zA4OcwbnZIeW1i0OadjjmvtiiYt8r5Ai/vTbzOjNRrqzovvFlEnHJxgYIiIWLPHSE70ERWOPcA+obNPyIpwZQ7Wh74+mZoe7gpQHzZlBjQFD5wW/U+eo0wnjdwhUxoexz7REScRmiprRmhziRO2L23tOffo",
"encoding": {
"content": [
"pkcs8",
"sr25519"
],
"type": [
"scrypt",
"xsalsa20-poly1305"
],
"version": "3"
},
"address": "5CFysjxm4tWyePnpELf4xG2o3ZvQV5WVdfvcETn552rYA8h9",
"meta": {
"name": "Jure1",
"tags": [],
"whenCreated": 1688624542924
}
}
20 changes: 20 additions & 0 deletions doc/accounts/5CS1o2oMdptJ2owGABQd8Q2TJXSYnLiQjKMWRGnRnSw36RwP.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"encoded": "6aFQ1aE5cOCO8+sdFx3kKl9j8H7PGkuSx6aht8WJaCsAgAAAAQAAAAgAAADkeKBgSA+TEUtHELRzoDF/TtiQEUuo6KjgjjUoaVOjlQ+uFcO1ypo5zFKalWOL5KRmcJJ/NmC141LzEkNPnFzAc+su+CwPED2B+MHRZDBkPeCNON7/S33ewzvuSXOzbdWGolEJdtihz5cTDeX5tsJP24R5r6scMnrwELIl9yii6hdWTLvFXcdS5OZ58lQudjKgmJc3Yvh4S5uQ8qw9",
"encoding": {
"content": [
"pkcs8",
"sr25519"
],
"type": [
"scrypt",
"xsalsa20-poly1305"
],
"version": "3"
},
"address": "5CS1o2oMdptJ2owGABQd8Q2TJXSYnLiQjKMWRGnRnSw36RwP",
"meta": {
"name": "Jure6",
"tags": [],
"whenCreated": 1688629403803
}
}
20 changes: 20 additions & 0 deletions doc/accounts/5CS8L2eS3sbYUcR6b5cvH93DZWiwCGXH4WJzSwTcHmAZekUj.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"encoded": "FlUpIHBorjSrr5qsjagCNCu5rgdDm5vD1VliLVTAnT8AgAAAAQAAAAgAAAClYL89h2Iv0P6QOO/868g4DIISjyz+rX/sVCtlE8hAYxGBronw9Rfc3Gha5Vb1P8nMkwT5ZVVu0OYDgdq5S4D3arj6ENNSGBGTfqoa7cgpxS512v554DWEiL1+Snj59U2PV82Oh9vVPd6I8rrlS9xnwTzNH4XpFmFrX9RVjMnTgwcTjnzmRCs2C0TODjTWDt/2WNE+Ccp88NwfDP4d",
"encoding": {
"content": [
"pkcs8",
"sr25519"
],
"type": [
"scrypt",
"xsalsa20-poly1305"
],
"version": "3"
},
"address": "5CS8L2eS3sbYUcR6b5cvH93DZWiwCGXH4WJzSwTcHmAZekUj",
"meta": {
"name": "Jure3",
"tags": [],
"whenCreated": 1688628965613
}
}
20 changes: 20 additions & 0 deletions doc/accounts/5CSdKZuEYAbaH1nB8rbxqJU5PDtgTtCB5pj4abqQAhimdLU1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"encoded": "HlI17Oa/78lxSsFQKPWJXsFze2wo5ga4NMSZrs+KwmYAgAAAAQAAAAgAAADueVw/FJv/w21flUtfxw3b07FygFS/zN+eH52ZTF3+ohejlPIHD15RS3E8HafANIe2uC/nyDp+lBeS6qDsyiMrVxCKLz69XCTREnnQfNffMwUikf0owpYqNy/ga33xFRrLhv2g0zLvXi6C03q+4sVgl0eqk9QKeLzbjJa/qbQT/v7D02vN+xm576ImcWqJsFJpz5UA2BmQw3jit2Q9",
"encoding": {
"content": [
"pkcs8",
"sr25519"
],
"type": [
"scrypt",
"xsalsa20-poly1305"
],
"version": "3"
},
"address": "5CSdKZuEYAbaH1nB8rbxqJU5PDtgTtCB5pj4abqQAhimdLU1",
"meta": {
"name": "Jure7",
"tags": [],
"whenCreated": 1688628993493
}
}
20 changes: 20 additions & 0 deletions doc/accounts/5CSdvQ1mG1j6tsyMib46kFHpwdUqizvWs1NTHGLzQWpNRbrK.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"encoded": "8ul9ioVBEF3vDTNNpeY5NggDOfm/XzVeTIJcB07lRlsAgAAAAQAAAAgAAADzUEasdvLHsHdnpM+ueHCwAcwjWjejsmphYuea4bPpT2bPjFu2DsfqI+XRGq1L8U0kTpHK15zpnne78PpyeZDmpkdn2j2RVbAU+n6OWHdF6cTjgx5KY3fE0qTsKAh0UlktjmBqCWlJQZR4FAlnbqCDUYl9BwOOOUDrjK5heF8OUOOm3JICmcGuG7fj6tIROci5PUHem4CiVH27EN3A",
"encoding": {
"content": [
"pkcs8",
"sr25519"
],
"type": [
"scrypt",
"xsalsa20-poly1305"
],
"version": "3"
},
"address": "5CSdvQ1mG1j6tsyMib46kFHpwdUqizvWs1NTHGLzQWpNRbrK",
"meta": {
"name": "Jure4",
"tags": [],
"whenCreated": 1688629013135
}
}
20 changes: 20 additions & 0 deletions doc/accounts/5CSvSo9vt1eu4d93EobfA6au8bheGLbkTdvATLb9RPVKgu9b.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"encoded": "Dqjm19O3Pcq7i5KL9CqCTqGVBC76VC0mFVkj37wBS64AgAAAAQAAAAgAAABuhHhDwH/CwC/Jkq1ESPuRyPSfg2xNCD12JPGVenkPjBLs/1a51BHsWDFd+Pa4PS/xe0oEFCdsBK6NYYoQC8/oz+pmN+/Hxbx2zhybh0MWW4WF6a51Oi2gajyxW8/+G0EXWZDukcLaeKv+b6g2gdNy5XsAMbzA4MaeCODN7OAdpSqgfOchp29tPPEEY5lzZudcPtd3/tVcDR9iqae9",
"encoding": {
"content": [
"pkcs8",
"sr25519"
],
"type": [
"scrypt",
"xsalsa20-poly1305"
],
"version": "3"
},
"address": "5CSvSo9vt1eu4d93EobfA6au8bheGLbkTdvATLb9RPVKgu9b",
"meta": {
"name": "Jure5",
"tags": [],
"whenCreated": 1688629387296
}
}
20 changes: 20 additions & 0 deletions doc/accounts/5ChhBGUJJLxPk2EJzDN6aeuA7yx7bBBGxgZx5iSr9rMhegrM.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"encoded": "uxqAFTjx+ofXO6Isgcq8jCdx331e4qIZBAOCTBt3IyoAgAAAAQAAAAgAAAA3MnaY9uRjPL9xDFxEN8Y8wf9lerF8Xz3ZEJMWw7cSi+y+tdI0NgsMHjIh5uWEA73GkHIiJk5+2JL6W+C1CAQi7+OLchowPNO0cwgDMXVB90vfCgo20r4vBRUFeRj0HK5IJylORhuPX/5JdI1/ZLBbEU6SVpBcSys63EnYS4nYBZluLd0Av/4PYtY5sMoS5MCvI/Ol4qKOfGykSn9O",
"encoding": {
"content": [
"pkcs8",
"sr25519"
],
"type": [
"scrypt",
"xsalsa20-poly1305"
],
"version": "3"
},
"address": "5ChhBGUJJLxPk2EJzDN6aeuA7yx7bBBGxgZx5iSr9rMhegrM",
"meta": {
"name": "Owner",
"tags": [],
"whenCreated": 1688632776424
}
}
20 changes: 20 additions & 0 deletions doc/accounts/5DfNSomECQZkpJJPi8CnBt3aFSAcbDJHy48xaqBkkAc5vVYJ.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"encoded": "RGRkYZQWtD/yj97A0zVUMygCQuvQsienwfZ/0X9QvMoAgAAAAQAAAAgAAAC4xG3Udc0LG32zMDWab7veB1g4mgM8AyMZRLobUYTLOmffZb+bO9N70/aLNg7dDpVP3Ww0BVyImK0iG56cMyG3rkiYVcQ536YdT7nuNCPHZwnqawrI05A27Dh9Bnv+tV34tYGkbtn7UK+iV/UW0LV7RHorMohsNgZO1hRDP/yXsyzVIvSczR+jUdrQ0AXQ1RaKYlsc1l6Xzt7vBOvB",
"encoding": {
"content": [
"pkcs8",
"sr25519"
],
"type": [
"scrypt",
"xsalsa20-poly1305"
],
"version": "3"
},
"address": "5DfNSomECQZkpJJPi8CnBt3aFSAcbDJHy48xaqBkkAc5vVYJ",
"meta": {
"name": "Jure2",
"tags": [],
"whenCreated": 1688628924438
}
}
20 changes: 20 additions & 0 deletions doc/accounts/5Fhhzf8ZNH2mkP5YddoJ6kj6PfsnB49BxReRopc6CRvqVNrQ.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"encoded": "B5CTeAPQ+EVPMpK/Jagtcw5SfnCzVIhNWrcFJtWKnckAgAAAAQAAAAgAAACrqsYBavakWM6c/CSRYSNy3TZBgBoJAXeBftH8BRiFR0zBpfMz+2/P94BphyLiPOSQaUcUTCrJULZVdhjxGf2DZZYgSFGCh2E6oLyl3kurpftB51G/ziI+5BoujBjBrwZEt6to+y66CVRyjtemmcbo+dXD/Tj5rV4Bb/K116x3/KHTMkff/vnUYHCkcQx82DJy588vmiRNsEElHt9M",
"encoding": {
"content": [
"pkcs8",
"sr25519"
],
"type": [
"scrypt",
"xsalsa20-poly1305"
],
"version": "3"
},
"address": "5Fhhzf8ZNH2mkP5YddoJ6kj6PfsnB49BxReRopc6CRvqVNrQ",
"meta": {
"name": "Defendant",
"tags": [],
"whenCreated": 1688632813079
}
}
Binary file added doc/images/confirm_defendant.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/confirm_judge.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/confirm_jure.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/create_dispute.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/distribute_deposit.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/get_dispute_counting_votes.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/get_dispute_ended.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/get_dispute_picking_juries.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/get_dispute_start_voting.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/get_dispute_voting_ends.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/jure_vote.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/process_dispute__assign_juries.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/process_dispute__confirmed_juries.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/process_dispute__count_votes.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/process_dispute__voting.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/register_jure.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 20 additions & 10 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ MICHAL=//2
MICHAL_PUBKEY=5H8rhTXiLiXAe9yhnnQrCuz6bvbwrcTddMJa9KfsX9mi26sj
ADMIN=//Alice
ADMIN_PUBKEY=5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
OWNER_PUBKEY=5ChhBGUJJLxPk2EJzDN6aeuA7yx7bBBGxgZx5iSr9rMhegrM
DEFENDAT_PUBKEY=5Fhhzf8ZNH2mkP5YddoJ6kj6PfsnB49BxReRopc6CRvqVNrQ
JURE_1_PUBKEY=5CFysjxm4tWyePnpELf4xG2o3ZvQV5WVdfvcETn552rYA8h9
JURE_2_PUBKEY=5DfNSomECQZkpJJPi8CnBt3aFSAcbDJHy48xaqBkkAc5vVYJ
JURE_3_PUBKEY=5CS8L2eS3sbYUcR6b5cvH93DZWiwCGXH4WJzSwTcHmAZekUj
JURE_4_PUBKEY=5CSdvQ1mG1j6tsyMib46kFHpwdUqizvWs1NTHGLzQWpNRbrK
JURE_5_PUBKEY=5CSvSo9vt1eu4d93EobfA6au8bheGLbkTdvATLb9RPVKgu9b
JURE_6_PUBKEY=5CS1o2oMdptJ2owGABQd8Q2TJXSYnLiQjKMWRGnRnSw36RwP
JUDGE_PUBKEY=5CSdKZuEYAbaH1nB8rbxqJU5PDtgTtCB5pj4abqQAhimdLU1

# tokenomics
TOKEN_PER_PERSON=1000
Expand Down Expand Up @@ -109,11 +118,11 @@ build() {
}

random_salt() {
hexdump -vn16 -e'4/4 "%08X" 1 "\n"' /dev/urandom
hexdump -vn16 -e'4/4 "%08X" 1 "\n"' /dev/urandom
}

contract_instantiate() {
docker_ink_dev "cargo contract instantiate --skip-confirm --url ${NODE} --suri ${ADMIN} --output-json --salt 0x$(random_salt) ${1}"
docker_ink_dev "cargo contract instantiate --skip-confirm --url ${NODE} --suri ${ADMIN} --output-json --salt 0x$(random_salt) ${1}"
}

deploy_contract() {
Expand All @@ -133,18 +142,19 @@ store_contract_addres() {
}

transfer() {
$DOCKER_SH \
--network host \
${CLIAIN_IMAGE} \
-c "/usr/local/bin/cliain --node ${NODE} --seed ${ADMIN} transfer --amount-in-tokens ${TOKEN_PER_PERSON} --to-account ${1}" 1>/dev/null
$DOCKER_SH \
--network host \
${CLIAIN_IMAGE} \
-c "/usr/local/bin/cliain --node ${NODE} --seed ${ADMIN} transfer --amount-in-tokens ${TOKEN_PER_PERSON} --to-account ${1}" 1>/dev/null

log_progress "✅ Transferred ${TOKEN_PER_PERSON} to ${1}"
log_progress "✅ Transferred ${TOKEN_PER_PERSON} to ${1}"
}

prefund_users() {
for recipient in "${DAMIAN_PUBKEY}" "${HANS_PUBKEY}" "${MICHAL_PUBKEY}"; do
transfer ${recipient}
done
for recipient in "${DAMIAN_PUBKEY}" "${HANS_PUBKEY}" "${MICHAL_PUBKEY}" "${OWNER_PUBKEY}" "${DEFENDAT_PUBKEY}" "${JURE_1_PUBKEY}" \
"${JURE_2_PUBKEY}" "${JURE_3_PUBKEY}" "${JURE_4_PUBKEY}" "${JURE_5_PUBKEY}" "${JURE_6_PUBKEY}" "${JUDGE_PUBKEY}"; do
transfer ${recipient}
done
}

# ------------------------------------------------------------------------------------------------------
Expand Down

0 comments on commit 34bb7f4

Please sign in to comment.