Skip to content

Commit

Permalink
Insert access control check for pause/unpause functionality inside th…
Browse files Browse the repository at this point in the history
…e move sec. guidelines (#713)
  • Loading branch information
GotenJBZ authored Nov 20, 2024
1 parent 6f85100 commit 6dfd02f
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -694,11 +694,13 @@ module 0x42::example {
}
public entry fun pause_protocol(admin: &signer) {
assert!(signer::address_of(admin)==@protocol_address, ERR_NOT_ADMIN);
let state = borrow_global_mut<State>(@protocol_address);
state.is_paused = true;
}
public entry fun resume_protocol(admin: &signer) {
assert!(signer::address_of(admin)==@protocol_address, ERR_NOT_ADMIN);
let state = borrow_global_mut<State>(@protocol_address);
state.is_paused = false;
}
Expand Down

0 comments on commit 6dfd02f

Please sign in to comment.