main.rs 374 Bytes
Newer Older
1
2
3
4
5
6
extern crate contract;

extern "Rust" {
    fn __ink_generate_metadata() -> ink_abi::InkProject;
}

7
fn main() -> Result<(), std::io::Error> {
8
9
    let ink_project = unsafe { __ink_generate_metadata() };
    let contents = serde_json::to_string_pretty(&ink_project)?;
10
11
12
13
    std::fs::create_dir("target").ok();
    std::fs::write("target/metadata.json", contents)?;
    Ok(())
}