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

Possible optimizations by avoiding extcodesize #292

Open
shuhuiluo opened this issue May 9, 2023 · 0 comments
Open

Possible optimizations by avoiding extcodesize #292

shuhuiluo opened this issue May 9, 2023 · 0 comments

Comments

@shuhuiluo
Copy link
Contributor

Consider using low level call or inline assembly for calling balanceOf, ownerOf, getReserves, swap, etc.

For example for command BALANCE_CHECK_ERC20,

success = (ERC20(token).balanceOf(owner) >= minBalance);
if (!success) output = abi.encodePacked(BalanceTooLow.selector);

it isn't necessary to invoke extcodesize by using the interface. This also applies to all calls made to PERMIT2.

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

No branches or pull requests

1 participant