To build a Soroban contract to deploy or run, use the
cargo build command.
cargo build --target wasm32-unknown-unknown --release
release profile outlined in Configure the Release Profile, otherwise
the contract will exceed Soroban's size limits.
.wasm file will be outputted in the
target directory. The
.wasm file is
the built contract.
.wasm file contains the logic of the contract, as well as the contract's
specification that can be imported into other contracts who wish to call it.
This is the only artifact needed to deploy the contract, share the interface
with others, or integration test against the contract.
To further optimize builds to be as small as possible, see Optimizing Builds.