Skip to content

Commit

Permalink
Merge pull request #72 from oraidex/hotfix/migrate-factory-msg
Browse files Browse the repository at this point in the history
chore: hotfix factory migrate msg
  • Loading branch information
tubackkhoa authored Dec 25, 2024
2 parents 3cededc + 824a6b6 commit 700daad
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
7 changes: 1 addition & 6 deletions contracts/oraiswap_factory/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,6 @@ pub fn query_pairs(

#[cfg_attr(not(feature = "library"), entry_point)]
pub fn migrate(deps: DepsMut, _env: Env, msg: MigrateMsg) -> StdResult<Response> {
let old_config = CONFIG.load(deps.storage)?;
let config = Config {
oracle_addr: deps.api.addr_canonicalize(msg.oracle_addr.as_str())?,
owner: deps.api.addr_canonicalize(msg.owner.as_str())?,
Expand All @@ -449,11 +448,7 @@ pub fn migrate(deps: DepsMut, _env: Env, msg: MigrateMsg) -> StdResult<Response>
.commission_rate
.unwrap_or(DEFAULT_COMMISSION_RATE.to_string()),
operator_fee: msg.operator_fee.unwrap_or(DEFAULT_OPERATOR_FEE.to_string()),
operator: deps.api.addr_canonicalize(
msg.operator
.unwrap_or(old_config.owner.to_string())
.as_str(),
)?,
operator: deps.api.addr_canonicalize(&msg.operator)?,
};

CONFIG.save(deps.storage, &config)?;
Expand Down
2 changes: 1 addition & 1 deletion packages/oraiswap/src/factory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ pub struct MigrateMsg {
pub oracle_addr: Addr,
pub commission_rate: Option<String>,
pub operator_fee: Option<String>,
pub operator: Option<String>,
pub operator: String,
}

// We define a custom struct for each query response
Expand Down

0 comments on commit 700daad

Please sign in to comment.