Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added versioning for the multicall #9

Merged
merged 1 commit into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,3 @@ This repo contains smart contracts which help power Squid's functionalities in t
| ------------------------------------- | ------------------------------------------------ |
| [`multicall`](contracts/multicall) | CosmWasm compatible multicall contract |
| [`osmosis-router`](contracts/osmosis) | Osmosis router with post action token forwarding |

## mainnet deployment config

Store wasm:
https://www.mintscan.io/osmosis/tx/AE7E17CFA2DF0D9B7300CBB3580AF468AEE9C1DDAE8890FD1B79BF290A4EEBA7/?height=13998652
Code Id 555

Contract creation:
https://www.mintscan.io/osmosis/tx/BD7B7179F697B8E29C7D7B0F017E7D94C2C3513B09887AD47DFB78BB085B0B59/?height=13998691

Contract address
"osmo1n6ney9tsf55etz9nrmzyd8wa7e64qd3s06a74fqs30ka8pps6cvqtsycr6"
2 changes: 1 addition & 1 deletion contracts/multicall/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "multicall"
version = "1.2.4"
version = "1.2.5"
authors = ["0xsquid"]
edition = "2021"

Expand Down
9 changes: 9 additions & 0 deletions contracts/multicall/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -313,3 +313,12 @@ Second - since `msg` field in a wasm call must be a base64 encoded Binary object
```

Note: since there is no updates for wasm message field it can be alredy specified as a binary value. Here it is shown for explanaition purposes.

## Mainnet deployment config

Store wasm: https://www.mintscan.io/osmosis/tx/AE7E17CFA2DF0D9B7300CBB3580AF468AEE9C1DDAE8890FD1B79BF290A4EEBA7/?height=13998652
Code Id `555`

Contract creation: https://www.mintscan.io/osmosis/tx/BD7B7179F697B8E29C7D7B0F017E7D94C2C3513B09887AD47DFB78BB085B0B59/?height=13998691

Contract address: `osmo1n6ney9tsf55etz9nrmzyd8wa7e64qd3s06a74fqs30ka8pps6cvqtsycr6`
19 changes: 16 additions & 3 deletions contracts/multicall/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use cosmwasm_std::entry_point;
use cosmwasm_std::{
to_json_binary, Binary, Deps, DepsMut, Env, MessageInfo, Reply, Response, StdResult,
};
use cw2::set_contract_version;
use ibc_tracking::{ibc, msg::IBCLifecycleComplete};
use shared::SerializableJson;

Expand All @@ -12,6 +13,11 @@ use crate::{
queries, ContractError,
};

/// Contract name that is used for migration.
const CONTRACT_NAME: &str = "squid-multicall";
/// Contract version that is used for migration.
const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION");

/// ## Description
/// Creates a new contract with the specified parameters in the [`InstantiateMsg`].
/// Returns the default [`Response`] object if the operation was successful, otherwise returns
Expand All @@ -26,11 +32,13 @@ use crate::{
/// * **_msg** is a message of type [`InstantiateMsg`] which contains the basic settings for creating a contract
#[cfg_attr(not(feature = "library"), entry_point)]
pub fn instantiate(
_deps: DepsMut,
deps: DepsMut,
_env: Env,
_info: MessageInfo,
_msg: InstantiateMsg,
) -> Result<Response, ContractError> {
set_contract_version(deps.storage, CONTRACT_NAME, CONTRACT_VERSION)?;

Ok(Response::default())
}

Expand Down Expand Up @@ -154,6 +162,11 @@ pub fn query(deps: Deps<SerializableJson>, _env: Env, msg: QueryMsg) -> StdResul
///
/// * **_msg** is an object of type [`MigrateMsg`].
#[cfg_attr(not(feature = "library"), entry_point)]
pub fn migrate(_deps: DepsMut, _env: Env, _msg: MigrateMsg) -> Result<Response, ContractError> {
Ok(Response::default())
pub fn migrate(deps: DepsMut, _env: Env, _msg: MigrateMsg) -> Result<Response, ContractError> {
set_contract_version(deps.storage, CONTRACT_NAME, CONTRACT_VERSION)?;

Ok(Response::new().add_attributes(vec![
("new_contract_name", CONTRACT_NAME),
("new_contract_version", CONTRACT_VERSION),
]))
}
Loading