Skip to content

Commit

Permalink
No-admin-concurrency
Browse files Browse the repository at this point in the history
  • Loading branch information
Kayanski committed Nov 27, 2024
1 parent a647229 commit 2cb3604
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions framework/contracts/account/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ pub enum AccountError {
#[error("The caller ({caller}) is not the owner account's account ({account}). Only account can create sub-accounts for itself.", )]
SubAccountCreatorNotAccount { caller: String, account: String },

#[error("You can't chain admin calls")]
CantChainAdminCalls {},

#[error("Abstract Account Address don't match to the Contract address")]
AbsAccInvalidAddr {
abstract_account: String,
Expand Down
3 changes: 3 additions & 0 deletions framework/contracts/account/src/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ pub fn admin_execute(
) -> AccountResult {
ownership::assert_nested_owner(deps.storage, &deps.querier, &info.sender)?;

if CALLING_TO_AS_ADMIN.exists(deps.storage) {
return Err(AccountError::CantChainAdminCalls {});

Check warning on line 96 in framework/contracts/account/src/execution.rs

View check run for this annotation

Codecov / codecov/patch

framework/contracts/account/src/execution.rs#L96

Added line #L96 was not covered by tests
}
CALLING_TO_AS_ADMIN.save(deps.storage, &addr)?;

let msg = SubMsg::reply_on_success(
Expand Down

0 comments on commit 2cb3604

Please sign in to comment.