Skip to content

The Mesh team presents an Aiken library to make devs' lives easier

The Mesh team presents an Aiken library to make devs' lives easier

The Escrow contract is the trusted intermediary that allows two parties to safely exchange assets, holding them until both parties agree and sign the Tx. Let’s try it!

To do so, you’ll need two preprod wallets (to simulate the two parties in agreement).

:white_check_mark:Step 1: Go to https://meshjs.dev/smart-contracts/escrow

:white_check_mark:Step 2: Connect one of the preprod wallets (user B) and mint a Mesh token.

:white_check_mark:Step 3: With the other preprod wallet (user A), go to “Initiate Escrow”, and initiate it.

:white_check_mark:Step 4: Refresh the page. With the preprod wallet that holds the Mesh token (user B), go to “Recipient Deposit” and click on “Deposit”.

If you check the wallet, the Mesh token should be gone.

:white_check_mark:Step 5: Refresh the page and connect the wallet that initiated the Escrow (user A).

:phone:Beware: only connect the wallet, don’t mint a new Mesh token again.

Now, go to “Complete Escrow” and click on “Sign Transaction”.

:white_check_mark:Step 6: Still in “Complete Escrow”, switch to the wallet that deposited the Mesh token (user B). Click on “Complete Escrow”.

If you check user B’s wallet, you’ll notice that 10 tAda have arrived. And if you check user A’s wallet, you’ll see that a Mesh token has arrived.

:white_check_mark:Step 7: Let’s try the “Cancel Escrow” option. To do so, repeat steps 2, 3, and 4. Next, proceed to “Cancel Escrow” and click on the “Cancel Escrow” button using either wallet (user A or user B).

:pancakes:Would you like to take a look at the source code of the Aiken Escrow contract? For sure!

Go to https://github.com/MeshJS/mesh/tree/main/packages/contracts/src/escrow

Mesh: making life :sun_behind_small_cloud:easier for developers