the import! macro located in /crates/zink/abi/abi_macro, is currently written for tests, based on the logic of parsing ABI into rust signatures, we'd introduce the interface of foreign language integration with it
// struct Foo(Address);
import!("Foo", "../foo.json")
// we haven't had this interface yet but let's assume we have
struct MyContract {
foo: Foo, // this is the address of Foo
};
impl MyContract {
fn get_bar(&self) -> i32 {
// run contract call
//
// evm::contract_all(
// address: foo.address,
// method: "bar",
// args: []
// );
self.foo.bar()
}
}
contracts with this macro would be pretty like the -sys crates in rust, we can simply wrap some ABIs and make them a zink library, for example, we can wrap the whole openzepplin libraries for zink contracts to use, and as a result, for calling these libraries, we can keep our interface, like
use foo_zsys::Foo;
struct MyContract {
foo: Foo,
}
// ...
which would be the same calling a contract written in zink!
the
import!macro located in/crates/zink/abi/abi_macro, is currently written for tests, based on the logic of parsingABIinto rust signatures, we'd introduce the interface of foreign language integration with itcontracts with this macro would be pretty like the
-syscrates in rust, we can simply wrap some ABIs and make them a zink library, for example, we can wrap the whole openzepplin libraries for zink contracts to use, and as a result, for calling these libraries, we can keep our interface, likewhich would be the same calling a contract written in zink!