⚠️ 20-05-2026: This repository is archived and no longer maintain. WASM smart contracts are deprecated and chain extensions will be removed from Astar network soon. The repository code is kept as reference material.
This repository contains crates of chain extension that you can use in your contracts.
To know which chain extension is available in which networks and have more info about it please visit the official Chain Extension docs
In crates folder you will find the chain extension struct that implements callable functions.
In contracts folder you will find full implementation of the chain extension struct and its integration tests in tests folder
This crate exposes AssetsExtension struct that implement all functions of pallet-assets chain extension.
Usage
- add
assets_extensionin yourCargo.tomland to thestdfeatures
assets_extension = { git = "https://github.com/AstarNetwork/chain-extension-contracts", default-features = false }
[features]
default = ["std"]
std = [
"ink/std",
"scale/std",
"scale-info/std",
"assets_extension/std",
]- Add use statement in your contract module and declare AssetsExtension type
use assets_extension::{AssetsError, AssetsExtension as _AssetsExtension};
type AssetsExtension = _AssetsExtension<DefaultEnvironment>;- Use struct functions directly in your contract
AssetsExtension::mint(asset_id, beneficiary, amount)?;Note: As precompiles in Solidity, the contract is the caller (the Origin of the call in the runtime)
Apache 2.0
Use these instructions to set up your ink!/Rust environment
Run this command to compile contract:
yarn
yarn compile- Run the tests Ensure a local node is running
yarn test