Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
1a823c2
multiversx-sc-abi crate, moved base/abi module there
andrei-marinica Feb 13, 2026
7ad991c
abi crate - type + contract abi modules
andrei-marinica Feb 13, 2026
5978afa
multiversx-sc-abi-derive-common crate, deduplicated type_abi macros &…
andrei-marinica Feb 19, 2026
709774b
derive crate fix
andrei-marinica Feb 20, 2026
8c87364
abi crate in abi build info
andrei-marinica Feb 20, 2026
3c2cc47
fmt
andrei-marinica Feb 20, 2026
572ba09
abi build info backwards compatibility
andrei-marinica Feb 20, 2026
d8affeb
abi crate build fix
andrei-marinica Feb 20, 2026
74f912d
cleanup
andrei-marinica Feb 23, 2026
df6c939
syn dependency fix
andrei-marinica Mar 3, 2026
a610bc8
crate description fix
andrei-marinica Mar 3, 2026
b76eab1
Merge pull request #2288 from multiversx/abi-crate
andrei-marinica Mar 3, 2026
dc362df
merge master -> feat/abi-crate
andrei-marinica Mar 3, 2026
e993afe
Merge pull request #2301 from multiversx/merge-abi
andrei-marinica Mar 3, 2026
fdf80d3
Merge branch 'master' into abi-merge
andrei-marinica May 26, 2026
f10f725
fix after merge
andrei-marinica May 26, 2026
e7b49e9
Merge pull request #2380 from multiversx/abi-merge
andrei-marinica May 27, 2026
9164947
Merge branch 'rc/v0.67' into abi-merge
andrei-marinica Jun 15, 2026
d5a7f1e
Merge pull request #2401 from multiversx/abi-merge
andrei-marinica Jun 15, 2026
ffb81ff
Merge branch 'rc/v0.67' into feat/abi-crate
andrei-marinica Sep 5, 2026
708f365
Merge pull request #2423 from multiversx/abi-merge
andrei-marinica Sep 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 30 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
resolver = "3"

members = [
"data/abi",
"data/abi-derive-common",
"data/abi-derive",
"data/codec",
"data/codec-derive",
"data/human-readable",
Expand Down
2 changes: 1 addition & 1 deletion chain/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ sha3 = { version = "0.12", optional = true }
ed25519-dalek = { version = "2.1", optional = true }

[dependencies.multiversx-sc-codec]
version = "=0.25.0"
version = "0.25.0"
path = "../../data/codec"
features = ["derive"]

Expand Down
2 changes: 1 addition & 1 deletion contracts/examples/multisig/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "multisig"
version = "1.0.0"
version = "0.0.0"
authors = ["Andrei Marinica <andrei.marinica@multiversx.com>"]
edition = "2024"
publish = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
"version": "0.0.0",
"gitVersion": "<git version here>"
},
"abi": {
"name": "multiversx-sc-abi",
"version": "0.25.0"
},
"framework": {
"name": "multiversx-sc",
"version": "0.66.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
"version": "0.0.0",
"gitVersion": "<git version here>"
},
"abi": {
"name": "multiversx-sc-abi",
"version": "0.25.0"
},
"framework": {
"name": "multiversx-sc",
"version": "0.66.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
"version": "0.0.0",
"gitVersion": "<git version here>"
},
"abi": {
"name": "multiversx-sc-abi",
"version": "0.25.0"
},
"framework": {
"name": "multiversx-sc",
"version": "0.66.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
"version": "0.0.0",
"gitVersion": "<git version here>"
},
"abi": {
"name": "multiversx-sc-abi",
"version": "0.25.0"
},
"framework": {
"name": "multiversx-sc",
"version": "0.66.2"
Expand Down
28 changes: 28 additions & 0 deletions data/abi-derive-common/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[package]
name = "multiversx-sc-abi-derive-common"
version = "0.25.0"
edition = "2024"
publish = false

authors = [
"Andrei Marinica <andrei.marinica@multiversx.com>",
"MultiversX <contact@multiversx.com>",
]
license = "GPL-3.0-only"
readme = "README.md"
repository = "https://github.com/multiversx/mx-sdk-rs"
homepage = "https://multiversx.com/"
documentation = "https://docs.multiversx.com/"
description = "MultiversX ABI common functionality for derive macros"
keywords = ["multiversx", "wasm", "webassembly", "blockchain", "contract"]
categories = [
"no-std",
"wasm",
"cryptography::cryptocurrencies",
"development-tools",
]

[dependencies]
proc-macro2 = "1.0"
quote = "1.0"
syn = { version = "2.0", features = ["full", "extra-traits"] }
10 changes: 10 additions & 0 deletions data/abi-derive-common/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# multiversx-sc-abi-derive-common

Common logic for the `TypeAbi` derive macros in MultiversX smart contracts.

This is a regular library crate (not a proc-macro crate) that contains the shared implementation used by both `multiversx-sc-abi-derive` and `multiversx-sc-derive`.

## Contents

- **`type_abi_derive`** — generates `TypeAbi` trait implementations for structs and enums
- **`parse`** — attribute parsing utilities (doc comments, macro attributes)
13 changes: 13 additions & 0 deletions data/abi-derive-common/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// ensure we don't run out of macro stack
#![recursion_limit = "1024"]
// TODO: remove once minimum version is 1.87+
#![allow(unknown_lints)]
#![allow(clippy::collapsible_if)]
#![allow(clippy::manual_is_multiple_of)]

/// Common code for derive macros, shared between `data/abi-derive` and `framework/derive`.
pub mod parse;

mod type_abi_derive;

pub use type_abi_derive::{TypeAbiImportCrate, type_abi_derive, type_abi_full};
1 change: 1 addition & 0 deletions data/abi-derive-common/src/parse.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod attributes;
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
use quote::ToTokens;

use super::{attr_names::*, util::*};

/// unlike the others, this is standard Rust,
/// all doc comments get automatically transformed into "doc" attributes
static ATTR_DOC: &str = "doc";

/// Doc comments are actually syntactic sugar for doc attributes,
/// so extracting doc comments means parsing "doc" attributes.
pub fn extract_doc(attrs: &[syn::Attribute]) -> Vec<String> {
const ATTR_DOC: &str = "doc";

attrs
.iter()
.filter(|attr| {
Expand Down Expand Up @@ -79,25 +75,3 @@ fn remove_backslashes(input: &str) -> String {
.replace("\\\"", "\"")
.replace("\\'", "'")
}

pub struct OutputNameAttribute {
pub output_name: String,
}

impl OutputNameAttribute {
pub fn parse(attr: &syn::Attribute) -> Option<Self> {
is_attr_one_string_arg(attr, ATTR_OUTPUT_NAME).map(|arg_str| OutputNameAttribute {
output_name: arg_str,
})
}
}

pub struct TitleAttribute {
pub title: String,
}

impl TitleAttribute {
pub fn parse(attr: &syn::Attribute) -> Option<Self> {
is_attr_one_string_arg(attr, ATTR_TITLE).map(|arg_str| TitleAttribute { title: arg_str })
}
}
Loading
Loading