Skip to content

An example and test project showcasing the integration of a PSP22 token smart contract (built with OpenBrush) into a Rust Yew app. This dApp provides a simple dashboard to display the total supply of the token and the balance of the current account.

License

Notifications You must be signed in to change notification settings

chriamue/yew-psp22-dashboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yew-psp22-dashboard

An example and test project showcasing the integration of a PSP22 token smart contract (built with OpenBrush) into a Rust Yew app. This dApp provides a simple dashboard to display the total supply of the token and the balance of the current account.

Source

This is a changed copy of

https://github.com/paritytech/subxt/tree/master/examples/wasm-example

and

https://github.com/Brushfam/openbrush-contracts/tree/main/examples/psp22_extensions/mintable

Pre-requisites

rustup component add rust-src
cargo install --force --locked cargo-contract --version 3.2.0

Test Node

Start a testnode with the following command:

cargo install contracts-node --git https://github.com/paritytech/substrate-contracts-node.git --tag v0.31.0 --force
substrate-contracts-node --base-path chain

Build the Contract

cd contract
cargo contract build --release

Test the Contract

cargo test --release --features e2e-tests

Deploy Contracts

Open the substrate UI at https://contracts-ui.substrate.io/?rpc=ws://127.0.0.1:9944 and deploy the contracts.

Open the Polkadot Apps UI at https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9944#/accounts

to send some tokens from Alice to your account.

Run DApp

cd dapp
wasm-pack test --firefox --headless
trunk serve

or run the following command to build the dApp and serve it with a local server:

trunk build --release
cd dist
python3 -m http.server 8080

Open the dApp at http://localhost:8080/

About

An example and test project showcasing the integration of a PSP22 token smart contract (built with OpenBrush) into a Rust Yew app. This dApp provides a simple dashboard to display the total supply of the token and the balance of the current account.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published