How to start using Leo Wallet and create a contract with tokens

Kristina
3 min readJun 20, 2023

--

Leo Wallet is a wallet for working with tokens and smart contracts on the blockchain. To start using Leo Wallet, follow the instructions below.

Step 1: Installing Leo Wallet

First of all, you need to download and install Leo Wallet. Make sure you are downloading a wallet version that is at least 0.0.18. If you already have Leo Wallet installed, uninstall it and reinstall it to make sure you have the latest version.

Step 2: Deploy the contract

Follow the link: https://demo.leo.app/deploy.

Copy the contract code and paste it into the “Program” field:

program the_liolikus.aleo;

record Token:
owner as address.private;
amount as u64.private;


function mint:
input r0 as address.private;
input r1 as u64.private;
cast r0 r1 into r2 as Token.record;
output r2 as Token.record;


function transfer:
input r0 as Token.record;
input r1 as address.private;
input r2 as u64.private;
sub r0.amount r2 into r3;
cast r0.owner r3 into r4 as Token.record;
cast r1 r2 into r5 as Token.record;
output r4 as Token.record;
output r5 as Token.record;

Then choose a unique name for your contract. To do this, follow the link: https://explorer.hamp.app/programs and enter the expected contract name in the search field.

If you see a “404” message, it means the contract name is free.

Change the contract name

program the_liolikus.aleo;

to your unique one

program Example.aleo;

Enter the required fee in the “fee” field.

12000000

Then click “Submit”.

The contract deployment process will open in a new window, which will take about 5–10–15 minutes, depending on the power of your computer. If everything is done correctly, you will see the deploy transaction in your wallet.

Step 3: Token minting

Follow the link: https://demo.leo.app/execute.

Paste in the Program ID, which is the name of the contract you created in the previous step. As an example: Example. aleo

Function Name

mint

Inputs

YOUR_WALLET_ADDRESS
1000u64

Then enter the number of tokens you want to create. If, for example, you want to create 1000 tokens, enter “1000u64”. If you want to create 985 tokens, enter “985u64” and so on.

Fee

1000000

If everything is done correctly, you will see the transaction in your wallet.

You have now successfully set up Leo Wallet and created a token contract. You can use these tokens for various blockchain and smart contract transactions.

Website | Twitter | Discord | GitHub | LeoWallet |

Prepared the article (Article in Ukrainian)
Discord: Kristos#6419
Twitter: @CiBzrpr0HGjysFN

--

--

No responses yet