Skip to main content
Before you can instantiate a contract, the compiled Wasm binary must be uploaded to the chain. The upload method on SigningCosmWasmClient handles gzip compression, transaction signing, and returns a codeId you use for instantiation.

Basic Upload

CosmJS automatically gzip-compresses the Wasm bytes before submitting the transaction. The upload method uses a tighter gas multiplier of 1.1x (instead of the default 1.4x) for "auto" fee estimation because code upload simulation is very accurate.

Upload with Access Restrictions

You can restrict who is allowed to instantiate your uploaded code:

Upload Result

The UploadResult contains everything you need to proceed with instantiation:

Next Steps

Instantiating Contracts

Create contract instances from uploaded code.

Gas and Advanced Usage

Gas estimation, simulation, and fee configuration.