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.
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
rustup component add rust-src
cargo install --force --locked cargo-contract --version 3.2.0
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
cd contract
cargo contract build --release
cargo test --release --features e2e-tests
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.
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/