Contracts
š Smart contracts for the Axone protocol
Install / Use
/learn @axone-protocol/ContractsREADME
š AXONE Smart Contracts
CosmWasm contracts for the AXONE network.
⨠Smart Contracts
This repository hosts the smart contracts at the heart of the AXONE ecosystem, powering on-chain governance and resource management on the AXONE network.
Built on CosmWasm and the Abstract SDK, these contracts constitute the functional core of the protocol. They act as the on-chain operating system, responsible for orchestrating off-chain resources, empowering sovereign agents, and enforcing verifiable governance.
This foundation allows AXONE to go beyond simple transactions, enabling the execution of complex agreements and logic-based interactions directly on the blockchain.
šļø Governance
<table> <tr> <th rowspan="4" width="30%"> <div align="center"> <img alt="axone-gov logo" src="contracts/axone-gov/axone-gov-card.webp" width="150px"/> <div><b>axone-gov</b></div> <div> <sub><a href="contracts/axone-gov/README.md">ā Tech documentation</a></sub> </div> </th> </tr> <tr> <td> <a href="#-maturity"> <img alt="status: intermediate" src="https://img.shields.io/badge/status-š£-black?style=for-the-badge" /> </a> </td> </tr> <tr> <td> <p> The <b>Governance Engine</b> of the protocol. It attaches governance capabilities to any resource represented by an <a href="https://docs.abstract.money/">Abstract Account (AA)</a>. </p> <p> It utilizes <b>Prolog constitutions</b> to strictly define and enforce governance rules, allowing for highly flexible and programmable organizational logic. </p> </td> </tr> <tr> <td> <img alt="type: governance" src="https://img.shields.io/badge/type-šļø%20governance-darkslateblue?style=for-the-badge" /> <a href="https://en.wikipedia.org/wiki/Prolog" target="_blank"> <img alt="kind: logic" src="https://img.shields.io/badge/kind-š§ %20logic-moccasin?style=for-the-badge" /> </a> </td> </tr> </table>Smart Contracts designed to enable on-chain decision making, rule enforcement and organizational structure.
šŖŖ Verifiable Credentials
<table> <tr> <th rowspan="4" width="30%"> <div align="center"> <img alt="axone-vc logo" src="contracts/axone-vc/axone-vc-card.webp" width="150px"/> <div><b>axone-vc</b></div> <div> <sub><a href="contracts/axone-vc/README.md">ā Tech documentation</a></sub> </div> </th> </tr> <tr> <td> <a href="#-maturity"> <img alt="status: initial" src="https://img.shields.io/badge/status-š„-black?style=for-the-badge" /> </a> </td> </tr> <tr> <td> <p> The <b>Verifiable Credential</b> contract of the protocol. It is intended to bind a credential authority to an <a href="https://docs.abstract.money/">Abstract Account (AA)</a> and manage credential lifecycle and verification. </p> <p> It targets RDF dataset-based credentials and provides the contract surface for submission, revocation, suspension, reinstatement and verification. </p> </td> </tr> <tr> <td> <img alt="type: credential" src="https://img.shields.io/badge/type-šŖŖ%20credential-seagreen?style=for-the-badge" /> <img alt="kind: verifiable credential" src="https://img.shields.io/badge/kind-ā %20verifiable%20credential-lightskyblue?style=for-the-badge" /> </td> </tr> </table>Smart Contracts designed to issue, track and verify verifiable credentials on-chain.
š„ Maturity
The maturity of each contract is indicated by the following emojis.
š„ - Genesis Stage
This stage represents the initial spark or idea that leads to the development of the Smart Contract.
š„ - Initial Stage
The Smart Contract is still in its infancy, with basic functionalities just being implemented. It is still under development, and its evolution may lead to breaking changes. It is not recommended for production use.
š£ - Intermediate Stage
The Smart Contract has undergone a number of tests and improvements, and presents a coherent functional package, but may still lack some advanced features or optimizations. It can be used in production in testnets.
š„ - Mature Stage
The Smart Contract is fully developed and tested. It's considered safe for production use, offering robust features and optimized performance.
š Directory Structure
The project is structured around a set of Rust workspaces, each defining a Smart Contract.
.
āāā contracts
ā āāā <contract>
ā āāā Cargo.toml
ā āāā examples
ā āāā schema
ā āāā src
āāā packages
ā āāā <package>
ā āāā Cargo.toml
ā āāā examples
ā āāā src
āāāā Cargo.toml
š Build
šØ Pre-requisites
Be sure you have the following tools installed:
- Rust v1.81 or higher
- cargo-make v0.36.3 or higher
- Docker
- jq v1.6 or higher
- npx v8.19.2 or higher
And the following common GNU Core utilities:
š§ Environment setup
For deployment to networks (testnet/mainnet), copy the example environment file and configure your credentials:
cp .env.example .env
Then edit .env and add your deployment wallet mnemonics:
# For testnet deployments
TEST_MNEMONIC="your testnet wallet mnemonic here"
# For mainnet deployments (ā ļø keep this private!)
MAIN_MNEMONIC="your mainnet wallet mnemonic here"
For local development, the default LOCAL_MNEMONIC in .env.example is safe to use.
ļæ½š ļø Available Tasks
The project uses cargo-make to manage common development tasks. Here are the main tasks available:
<!-- TASKS -->Build
----------
build - No Description.
release-wasm - Build optimized wasm using CosmWasm optimizer and provide checksums
schema - Generate JSON schemas for all contracts.
wasm - No Description.
Chain Management
----------
chain - Run the axoned CLI using the chain's home directory under a Docker container.
chain-add-keys - Add a set of predefined keys (recovered from the seed phrases) to the chain.
chain-init-folder - Initialize deploy folder to make sure scripts have the right permission (needed for linux)
chain-initialize - Initialize the chain with a validator's key and a set of predefined keys. ā ļø The home directory is cleaned before.
chain-logs - Show the chain's container logs.
chain-start - Run the full node axoned application using the chain's home directory under a Docker container.
chain-stop - Stop the chain's container.
Cleanup
----------
clean - Clean all artifacts (cargo, docs, and chain).
clean-cargo - Clean cargo build artifacts.
clean-chain - Clean the chain data (ā ļø definitively).
clean-docs - Clean documentation folder.
Code Quality
----------
format - Format all files (Rust and TOML).
format-rust - Format rust sources files. (rustfmt provided by rust-toolchain.toml)
format-toml - Format toml file
lint - Check all linting (Rust, Cargo, and TOML).
lint-cargo - Check all Cargo linting (toml files and dependencies).
lint-cargo-deps - Check for unused dependencies.
lint-cargo-toml - Check lint of all Cargo.toml files.
lint-cargo-toml-file - Check lint of the given toml file
lint-rust - Check all Rust linting (formatting and clippy).
lint-rust-clippy - Check lint of all sources files (clippy via rust-toolchain.toml).
lint-rust-format - Check formatting and derives order (rustfmt via rust-toolchain.toml).
lint-toml - Check lint of all toml files.
Contract Inspection
----------
contract-inspect - Inspect a specific contract deployed to the chain.
contract-list - List all the contracts deployed to the chain.
Contract Interaction
----------
contract-execute - Execute a command on a specific contract. The contract must be already deployed and instantiated.
contract-query - Query a specific contract. The contract must be already deployed and instantiated.
Deployment
----------
deploy-abstract - Deploy Abstract infrast
