Skip to content
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
35 changes: 7 additions & 28 deletions cosmwasm/cosmwasm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -797,6 +797,7 @@ _: {
lightclients,
apps,
private_key,
ucs04-chain-id,
rpc_url,
bech32_prefix,
gas_config,
Expand All @@ -817,26 +818,14 @@ _: {
cosmwasm-deployer
];
text = ''
DEPLOYER=$(
PRIVATE_KEY=${private_key} \
cosmwasm-deployer \
address-of-private-key \
--bech32-prefix ${bech32_prefix}
)
echo "deployer address: $DEPLOYER"
ADDRESSES=$(ibc-union-contract-addresses "$DEPLOYER")

PRIVATE_KEY=${private_key} \
RUST_LOG=info \
cosmwasm-deployer \
migrate \
upgrade \
--rpc-url ${rpc_url} \
--address "$(echo "$ADDRESSES" | jq '.lightclient."${
(get-lightclient (l: l.name == lc)).client-type
}"' -r)" \
--address ${(getDeployment ucs04-chain-id).lightclient.${lc}.address} \
--new-bytecode ${(mk-lightclient lc).release} \
${mk-gas-args gas_config} \
"$@"
${mk-gas-args gas_config} "$@"
'';
};
}
Expand Down Expand Up @@ -947,27 +936,17 @@ _: {
${name} = pkgs.writeShellApplication {
name = "${args.name}-${name}";
runtimeInputs = [
ibc-union-contract-addresses
cosmwasm-deployer
];
text = ''
DEPLOYER=$(
PRIVATE_KEY=${private_key} \
cosmwasm-deployer \
address-of-private-key \
--bech32-prefix ${bech32_prefix}
)
echo "deployer address: $DEPLOYER"
ADDRESSES=$(ibc-union-contract-addresses "$DEPLOYER")

PRIVATE_KEY=${private_key} \
RUST_LOG=info \
cosmwasm-deployer \
migrate \
upgrade \
--rpc-url ${rpc_url} \
--address "$(echo "$ADDRESSES" | jq '.core' -r)" \
--address ${(getDeployment ucs04-chain-id).core.address} \
--new-bytecode ${ibc-union.release} \
${mk-gas-args gas_config}
${mk-gas-args gas_config} "$@"
'';
};
}
Expand Down
10 changes: 3 additions & 7 deletions cosmwasm/cw-escrow-vault/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use crate::{
msg::{
ExecuteMsg, FungibleLaneConfig, InstantiateMsg, MigrateMsg, QueryMsg, RestrictedExecuteMsg,
},
state::{Admin, FungibleCounterparty, FungibleLane, IntentWhitelist, Zkgm},
state::{FungibleCounterparty, FungibleLane, IntentWhitelist, Zkgm},
};

/// Major state versions of this contract, used in the [`frissitheto`] migrations.
Expand Down Expand Up @@ -61,12 +61,8 @@ pub fn migrate(

Ok((Response::new(), Some(version::LATEST)))
},
|mut deps, msg, version| match version {
version::INIT => {
access_managed::init(deps.branch(), msg.access_managed_init_msg)?;
deps.storage.delete_item::<Admin>();
Ok((Response::default(), Some(version::MANAGED)))
}
|_, _, version| match version {
version::INIT => Err(StdError::generic_err("unsupported version: INIT").into()),
version::MANAGED => Ok((Response::default(), None)),
_ => Err(UpgradeError::UnknownStateVersion(version).into()),
},
Expand Down
4 changes: 1 addition & 3 deletions cosmwasm/cw-escrow-vault/src/msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ pub struct InstantiateMsg {
#[derive(Debug, Serialize, Deserialize)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
#[serde(deny_unknown_fields, rename_all = "snake_case")]
pub struct MigrateMsg {
pub access_managed_init_msg: access_managed::InitMsg,
}
pub struct MigrateMsg {}

#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
Expand Down
11 changes: 0 additions & 11 deletions cosmwasm/cw-escrow-vault/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,6 @@ impl ValueCodecViaEncoding for FungibleCounterparty {
type Encoding = Bincode;
}

pub enum Admin {}
impl Store for Admin {
const PREFIX: Prefix = Prefix::new(b"admin");

type Key = ();
type Value = Addr;
}
impl ValueCodecViaEncoding for Admin {
type Encoding = RawAddrEncoding;
}

pub enum Zkgm {}
impl Store for Zkgm {
const PREFIX: Prefix = Prefix::new(b"zkgm");
Expand Down
17 changes: 4 additions & 13 deletions cosmwasm/cw-unionversal-token/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ use crate::{
error::ContractError,
msg::{Cw20InstantiateMsg, ExecuteMsg, InitMsg, QueryMsg, RestrictedExecuteMsg},
state::{
Admin, Cw20ImplType, Cw20Type, FungibleCounterparty, FungibleLane, IntentWhitelist,
Minters, Zkgm,
Cw20ImplType, Cw20Type, FungibleCounterparty, FungibleLane, IntentWhitelist, Minters, Zkgm,
},
};

Expand Down Expand Up @@ -49,9 +48,7 @@ pub fn instantiate(_: DepsMut, _: Env, _: MessageInfo, _: ()) -> StdResult<Respo
}

#[derive(Debug, Serialize, Deserialize)]
pub struct MigrateMsg {
pub access_managed_init_msg: access_managed::InitMsg,
}
pub struct MigrateMsg {}

#[entry_point]
pub fn migrate(
Expand Down Expand Up @@ -93,14 +90,8 @@ pub fn migrate(
}?;
Ok((res, Some(version::LATEST)))
},
|mut deps, msg, version| match version {
version::INIT => {
access_managed::init(deps.branch(), msg.access_managed_init_msg)?;

deps.storage.delete_item::<Admin>();

Ok((Response::default(), Some(version::MANAGED)))
}
|_, _, version| match version {
version::INIT => Err(StdError::generic_err("unsupported version: INIT").into()),
version::MANAGED => Ok((Response::default(), None)),
_ => Err(UpgradeError::UnknownStateVersion(version).into()),
},
Expand Down
11 changes: 0 additions & 11 deletions cosmwasm/cw-unionversal-token/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,6 @@ impl ValueCodecViaEncoding for FungibleCounterparty {
type Encoding = Bincode;
}

pub enum Admin {}
impl Store for Admin {
const PREFIX: Prefix = Prefix::new(b"admin");

type Key = ();
type Value = Addr;
}
impl ValueCodecViaEncoding for Admin {
type Encoding = RawAddrEncoding;
}

pub enum Zkgm {}
impl Store for Zkgm {
const PREFIX: Prefix = Prefix::new(b"zkgm");
Expand Down
Loading