From 2a20af1bc94cae0ce975b534df18436360e91881 Mon Sep 17 00:00:00 2001 From: marco ilardi Date: Wed, 20 Nov 2024 17:34:49 +0100 Subject: [PATCH] Insert access controll check for pause/unpause functionality inside the move sec. guidelines --- .../pages/en/build/smart-contracts/move-security-guidelines.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/nextra/pages/en/build/smart-contracts/move-security-guidelines.mdx b/apps/nextra/pages/en/build/smart-contracts/move-security-guidelines.mdx index 08b70b0e4..cbde6dfee 100644 --- a/apps/nextra/pages/en/build/smart-contracts/move-security-guidelines.mdx +++ b/apps/nextra/pages/en/build/smart-contracts/move-security-guidelines.mdx @@ -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(@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(@protocol_address); state.is_paused = false; }