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

bad transferFrom access control rule #66

Closed
wants to merge 4 commits into from
Closed

Conversation

morsiiik
Copy link
Contributor

No description provided.

- requires: INPUT_TO and INPUT_FROM
pattern-either:
- patterns:
- pattern: $TOKEN.transferFrom(...,$FROM,...);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't $FROM always be the first argument in transferFrom?

pattern-either:
- patterns:
- pattern: $TOKEN.transferFrom(...,$FROM,...);
- pattern: $TOKEN.transferFrom(...,$TO,...);
Copy link
Collaborator

Choose a reason for hiding this comment

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

And $TO is always second in transferFrom

- pattern: $TOKEN.safeTransferFrom(...,$FROM,...);
- pattern: $TOKEN.safeTransferFrom(...,$TO,...);
- patterns:
- pattern: $HELPER.transferFrom($TOKEN,...,$FROM,...);
Copy link
Collaborator

Choose a reason for hiding this comment

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

if TransferHelper is used $FROM is always second argument

- pattern: $TOKEN.safeTransferFrom(...,$TO,...);
- patterns:
- pattern: $HELPER.transferFrom($TOKEN,...,$FROM,...);
- pattern: $HELPER.transferFrom($TOKEN,...,$TO,...);
Copy link
Collaborator

Choose a reason for hiding this comment

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

And $TO is always third

@@ -0,0 +1,51 @@
rules:
- id: bad-transferFrom-access-control
Copy link
Collaborator

Choose a reason for hiding this comment

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

rule id should be lower case

@Raz0r
Copy link
Collaborator

Raz0r commented Aug 15, 2024

Don't forget to update README as well

@morsiiik morsiiik closed this Aug 15, 2024
@morsiiik morsiiik deleted the transferFrom-rule branch August 15, 2024 10:44
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