Skip to content

Commit a8befa0

Browse files
committed
use_contract! macro
1 parent 269b53f commit a8befa0

File tree

9 files changed

+626
-10
lines changed

9 files changed

+626
-10
lines changed

Cargo.lock

+45-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[workspace]
2-
members = ["ethabi", "cli"]
2+
members = ["ethabi", "cli", "derive", "contract", "tests"]

contract/Cargo.toml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[package]
2+
name = "ethabi-contract"
3+
version = "0.1.0"
4+
authors = ["debris <[email protected]>"]

contract/src/lib.rs

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#[macro_export]
2+
macro_rules! use_contract {
3+
($module: ident, $name: expr, $path: expr) => {
4+
pub mod $module {
5+
#[derive(EthabiContract)]
6+
#[ethabi_contract_options(name = $name, path = $path)]
7+
struct _Dummy;
8+
}
9+
}
10+
}

derive/Cargo.toml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[package]
2+
name = "ethabi-derive"
3+
version = "0.1.0"
4+
authors = ["debris <[email protected]>"]
5+
6+
[lib]
7+
proc-macro = true
8+
9+
[dependencies]
10+
ethabi = { path = "../ethabi" }
11+
heck = "0.2"
12+
syn = "0.11.11"
13+
quote = "0.3.15"

0 commit comments

Comments
 (0)