Yes. At the time of this writing we currently don't have anything similar to Truffle for deploying multiple contracts. We've been organizing multiple contracts into their own directories and then using a parent-level build-all.sh
script that essentially runs a directory's build.sh
.
An example would be the Chainlink repository here:
https://github.com/smartcontractkit/near-protocol-contracts
So for instance, one of the three contracts (oracle
in this case) has its own directory with a build.sh
script:
#!/bin/bash
cargo build --target wasm32-unknown-unknown --release
mkdir -p ./res
cp target/wasm32-unknown-unknown/release/oracle.wasm ./res
Note: when building smart contracts on NEAR you may see cargo build…
commands that have more flags than are shown here. In this particular example, those flags have been moved to the .cargo/config
file:
[build]
rustflags = ["-C", "link-args=-s"]
This helps for cross-platform compatibility, particularly with Windows.
Then at the parent level of the project there's a simple bash script that runs the child scripts like so:
#!/bin/bash
cd near-link-token && ./scripts/build && cd ..
cd oracle && ./scripts/build && cd ..
cd client && ./scripts/build && cd ..
We do look forward to having a more robust deployment mechanism in the future.