#Using contracts from github in contractimport!

1 messages · Page 1 of 1 (latest)

worn kestrel
#

Is there a way of using contracts from github in contractimport! macro other than just cloning the contracts somewhere/using git submodules? Ideally, I'd just add the other contract as dependecy in Cargo.toml (this is already possible) and somehow use it in contractimport!.

urban forum
#

I tried to figure that out a few weeks ago and I couldn't get it to work but I also think it should be possible.

urban forum
#

This is what i tried that i couldn't get to work

[dependencies]
my_contract = { git = "https://github.com/username/repo", branch = "main" }

#

Tried to find my actual code where i was trying to get it to work, but that's pretty close

#

oh i remember why contractimport! didn't work, it required a wasm

#

So if you end up putting a build in your repo, then you can include it as it should clone the repo like:



contractimport!(
    file="my_contract/mywasm.wasm"
);
#

I had actually tried to figure out if there's some way to just include a bytestring that is the wasm

#

but i never got it working