Skip to content
This repository was archived by the owner on May 20, 2026. It is now read-only.

AstarNetwork/chain-extension-contracts

Repository files navigation

⚠️ 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.

Chain Extension contracts

This repository contains crates of chain extension that you can use in your contracts.

Extended documentation

To know which chain extension is available in which networks and have more info about it please visit the official Chain Extension docs

Purpose

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

Versions

ink! v5.0.0-rc

Chain Extensions

Pallet Assets

This crate exposes AssetsExtension struct that implement all functions of pallet-assets chain extension.

Usage

  1. add assets_extension in your Cargo.toml and to the std features
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",
]
  1. Add use statement in your contract module and declare AssetsExtension type
use assets_extension::{AssetsError, AssetsExtension as _AssetsExtension};

type AssetsExtension = _AssetsExtension<DefaultEnvironment>;
  1. 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)

License

Apache 2.0

🏗️ How to use - Contracts

💫 Build

Use these instructions to set up your ink!/Rust environment
Run this command to compile contract:

yarn
yarn compile
  1. Run the tests Ensure a local node is running
yarn test

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors