Skip to main content
Under Proposal 115, no new CosmWasm contracts can be deployed on Sei. The examples below apply to pre-existing CosmWasm contracts only. Calls to instantiate() revert.
You can use the Sei precompiles like any standard smart contract on the EVM. For example, this page uses ethers.js to query an existing CosmWasm contract and execute actions on it.

Setup

To install ethers, run this command in a terminal in your project directory:
This example uses the CosmWasm precompile:

Using the contract

Next, set up a provider and a contract to interact with Sei:

Querying & executing a CosmWasm contract

When you have the contract instance, you can send query and execute messages to any CosmWasm smart contract. The example below assumes a counter contract with a get_count function.

Executing a payable function

This example executes the donate method on the same contract. It is similar to the increment method, but it also receives funds from the user and stores them in the contract.
For payable contracts, attach native SEI through msg.value.