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

fix: Don't use env::signer_account_id #524

Closed
wants to merge 1 commit into from
Closed

Conversation

mfornet
Copy link
Contributor

@mfornet mfornet commented Mar 11, 2021

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

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
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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using use in macros is not a very good idea, because it silently imports names into the surrounding namespace. Also, it assumes that near_sdk and admin_controlled crates are present in the list of dependencies of the current crate under their original names.

A more robust solution would be to not use use and to use fully qualifying names starting with $crate (because $crate is the only top-level name such that you know for sure what it refers to).

@mfornet mfornet closed this Mar 14, 2021
@mfornet mfornet deleted the avoid_signer_id branch April 7, 2021 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants