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

Allow admin to pause/unpause subdao #744

Merged
merged 13 commits into from
Mar 25, 2024
Prev Previous commit
Next Next commit
Do not explicitly exclude core contract for unpause
The only way the DAO can unpause is through an admin that is not itself
  • Loading branch information
ismellike committed Sep 8, 2023
commit 0b36544ddce1bf3a7291731fb9d2a526cddc3473
8 changes: 4 additions & 4 deletions contracts/dao-dao-core/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ pub fn execute(
execute_proposal_hook(deps.as_ref(), info.sender, msgs)
}
ExecuteMsg::Pause { duration } => execute_pause(deps, env, info.sender, duration),
ExecuteMsg::Unpause {} => execute_unpause(deps, env, info.sender),
ExecuteMsg::Unpause {} => execute_unpause(deps, info.sender),
ExecuteMsg::Receive(_) => execute_receive_cw20(deps, info.sender),
ExecuteMsg::ReceiveNft(_) => execute_receive_cw721(deps, info.sender),
ExecuteMsg::RemoveItem { key } => execute_remove_item(deps, env, info.sender, key),
Expand Down Expand Up @@ -184,11 +184,11 @@ pub fn execute_pause(
.add_attribute("until", until.to_string()))
}

pub fn execute_unpause(deps: DepsMut, env: Env, sender: Addr) -> Result<Response, ContractError> {
pub fn execute_unpause(deps: DepsMut, sender: Addr) -> Result<Response, ContractError> {
let admin = ADMIN.load(deps.storage)?;

// Only the admin may call this method excluding the core contract.
if sender != admin || sender == env.contract.address {
// Only the admin may call this method.
if sender != admin {
return Err(ContractError::Unauthorized {});
}

Expand Down
Loading