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

use/include contract with a single step #13

@snd

Description

@snd

currently to test a contract with sol-rs one needs to:

compile it in a build script: https://github.com/paritytech/sol-rs/blob/aed4bb377db6bf7459e5ee3792e1d7cddfb45cef/example/build.rs#L4

use_contract! on the ABI file: https://github.com/paritytech/sol-rs/blob/aed4bb377db6bf7459e5ee3792e1d7cddfb45cef/example/src/main.rs#L15

load code from the bin file: https://github.com/paritytech/sol-rs/blob/aed4bb377db6bf7459e5ee3792e1d7cddfb45cef/example/src/main.rs#L20

ideally it would require a single step. wishful thinking:

use_contract!(badgereg, "BadgeReg", "res/BadgeReg.sol");

let contract = badgereg::BadgeReg::default();

let mut evm = solaris::evm();

let owner = 3.into();
let _address = evm.with_sender(owner).deploy(&contract);

the API should allow support the convenient single step as well as the individual steps.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions