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: made the main func more gas efficient #11

Merged
merged 1 commit into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/protocol/TSender.huff
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,13 @@

0x00 calldataload 0xE0 shr

dup1 __FUNC_SIG(airdropERC20) eq airdropERC20 jumpi
// We don't dup1 because we want to be as gas efficient
// with the airdrop as possible
__FUNC_SIG(airdropERC20) eq airdropERC20 jumpi

dup1 __FUNC_SIG(areListsValid) eq areListsValid jumpi
// This means, for areListsValid, we need to get the selector again
0x00 calldataload 0xE0 shr
__FUNC_SIG(areListsValid) eq areListsValid jumpi

endcall:
0x00 0x00 revert
Expand Down
2 changes: 1 addition & 1 deletion src/protocol/TSender_NoCheck.huff
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
#define macro MAIN() = takes (0) returns (0) {
0x00 calldataload 0xE0 shr

dup1 __FUNC_SIG(airdropERC20) eq airdropERC20 jumpi
__FUNC_SIG(airdropERC20) eq airdropERC20 jumpi

0x00 0x00 revert

Expand Down