forked from SugarFunge/sugarfunge-integration
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.rs
38 lines (31 loc) · 1.04 KB
/
build.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
use ethcontract_generate::loaders::TruffleLoader;
use ethcontract_generate::ContractBuilder;
fn main() {
let out_dir = std::env::var("OUT_DIR").unwrap();
{
let dest = std::path::Path::new(&out_dir).join("SugarFungeAsset.rs");
let artifact = TruffleLoader::new()
.load_from_file("./contracts/SugarFunge/SugarFungeAsset.json")
.unwrap();
for contract in artifact.iter() {
ContractBuilder::new()
.generate(contract)
.unwrap()
.write_to_file(&dest)
.unwrap();
}
}
{
let dest = std::path::Path::new(&out_dir).join("Wrapped1155Factory.rs");
let artifact = TruffleLoader::new()
.load_from_file("./contracts/ErcWrapper/Wrapped1155Factory.json")
.unwrap();
for contract in artifact.iter() {
ContractBuilder::new()
.generate(contract)
.unwrap()
.write_to_file(&dest)
.unwrap();
}
}
}