-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Don't use env::signer_account_id
Instead use env::predecessor_account_id. Using signer_account_id has the same problems of using tx.origin in Ethereum. See link below for more details: ethereum/solidity#683
- Loading branch information
Showing
4 changed files
with
30 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#[macro_export] | ||
macro_rules! impl_admin_controlled { | ||
($contract: ident, $paused: ident) => { | ||
use admin_controlled::{AdminControlled as AdminControlledInner, Mask as MaskInner}; | ||
use near_sdk as near_sdk_inner; | ||
|
||
#[near_bindgen] | ||
impl AdminControlledInner for $contract { | ||
#[result_serializer(borsh)] | ||
fn get_paused(&self) -> MaskInner { | ||
self.$paused | ||
} | ||
|
||
#[result_serializer(borsh)] | ||
fn set_paused(&mut self, #[serializer(borsh)] paused: MaskInner) { | ||
near_sdk_inner::assert_self(); | ||
self.$paused = paused; | ||
} | ||
} | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters