Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sei-protocol/sei-cosmwasm

Sei utilities for usage in cosmwasm smart contracts
https://github.com/sei-protocol/sei-cosmwasm

Last synced: 4 days ago
JSON representation

Sei utilities for usage in cosmwasm smart contracts

Awesome Lists containing this project

README

        

# Sei-Cosmwasm Package

This repository contains the sei-cosmwasm package to support smart contract querying and messages to the modules in sei-chain. It also includes an example contract that can be used to test package behavior locally and can be used as a reference for implementation details to include sei-chain integration in your smart contracts.

## Build Sei Tester Contract

```shell
docker run --rm -v "$(pwd)":/code \
--mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
cosmwasm/rust-optimizer:0.14.0
```

## Testing with LocalSei

### Store Contract Code

```shell
seid tx wasm store artifacts/sei_tester.wasm -y --from --chain-id -b block --gas=3000000 --fees=1000sei
```

Make sure to note the code ID for the contract from the tx response. You can also find it in the list of uploaded code with this query:

```shell
seid q wasm list-code
```

### Instantiate Contract

```shell
seid tx wasm instantiate '{}' -y --no-admin --from --chain-id --gas=1500000 --fees=1000sei -b block --label sei-tester
```

Make sure to note the contract address for the contract from the tx response. You can also find it with this query:

```shell
seid q wasm list-contract-by-code
```

### Query Smart Contract

```shell
seid q wasm contract-state smart
```

The json literal may look something like this:

```json
'{"exchange_rates": {}}'
```