xmodules

Crates.ioxmodules
lib.rsxmodules
version0.1.2
sourcesrc
created_at2023-01-04 13:35:06.641463
updated_at2023-01-08 13:25:47.93173
descriptionSmart contracts modules for MultiversX blockchain
homepage
repositoryhttps://github.com/StakeGold/sc-xmodules-rs
max_upload_size
id750833
size12,149
Vlad Nedelcu (vladNed)

documentation

https://github.com/StakeGold/sc-xmodules-rs/blob/main/README.md

README

Buidly X-Modules

Usage

Check out the latest release of the library on crates.io by following this link xmodules crate. The version is specified in the install instructions or directly add them in your Cargo.toml file for the smart contract with:

[dependencies.xmodules]
version = "x.x.x"

In your smart contract main lib entry inherit the module you want to use directly on the contract trait:

use xmodules::my_module;

#[elrond_wasm::contract]
pub trait MyContract: my_module::MyModule {
    ...

Or use it on another module, but beware the contract also needs to implement the trait

use xmodules::my_module;

#[elrond_wasm::module]
pub trait MyOtherModule: my_module::MyModule {
    ...

#[elrond_wasm::contract]
pub trait MyContract:
    MyOtherModule +
    my_module::MyModule
{
    ...
Commit count: 29

cargo fmt