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

feat: add AllocationExtension.sol #654

Merged
merged 12 commits into from
Aug 30, 2024
Merged

feat: add AllocationExtension.sol #654

merged 12 commits into from
Aug 30, 2024

Conversation

0xAustrian
Copy link

No description provided.

@0xAustrian 0xAustrian self-assigned this Aug 26, 2024
Copy link
Author

Choose a reason for hiding this comment

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

I had to create another mocks folder with a custom mock for the extension, since Smock does not work well with abstract contracts.

Copy link

@0xOneTony 0xOneTony left a comment

Choose a reason for hiding this comment

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

Couple small comments, other than that looks good!

Choose a reason for hiding this comment

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

Let's follow the example of the AlloUnit.t.sol with the naming, so it is easier as well to filter with forge only the unit tests. So we should change the file name to AllocationExtensionUnit.t.sol

@0xOneTony 0xOneTony marked this pull request as ready for review August 28, 2024 10:57
// all tokens allowed
if (allowedTokens[address(0)]) return true;

if (allowedTokens[_token]) return true;
Copy link
Member

Choose a reason for hiding this comment

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

nitpick but worth ?

Suggested change
if (allowedTokens[_token]) return true;
if (
allowedTokens[address(0)] || // all tokens allowed
allowedTokens[_token]
) return true;

Copy link

@ilpepepig ilpepepig Aug 28, 2024

Choose a reason for hiding this comment

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

Splitting the if in two instead of using || saves a bit of gas if I remember correctly.

Copy link
Author

Choose a reason for hiding this comment

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

Because of gas saving and readability I will keep it as is.

Copy link
Member

@thelostone-mc thelostone-mc left a comment

Choose a reason for hiding this comment

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

lgtm. added a nitpick but not important

@0xOneTony 0xOneTony merged commit 5e5ec81 into v2.1 Aug 30, 2024
1 check passed
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.

4 participants