Skip to content

Commit

Permalink
optimizooor
Browse files Browse the repository at this point in the history
  • Loading branch information
nicobevilacqua committed Apr 5, 2023
1 parent 1dbc087 commit 1282236
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/Add1.huff
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


#define macro MAIN() = takes(0) returns(0) {
0x00 calldataload 0xe0 shr // [func selector]
returndatasize calldataload 0xe0 shr // [func selector]
__FUNC_SIG(add1) eq implementation jumpi // go to function body
returndatasize dup1 revert // revert otherwise

Expand Down
4 changes: 2 additions & 2 deletions src/CalldataLength.huff
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
*/

#define macro MAIN() = takes(0) returns(0) {
calldatasize 0x00 mstore
0x20 0x00 return
calldatasize returndatasize mstore
0x20 returndatasize return
}
8 changes: 4 additions & 4 deletions src/Create.huff
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@

#define macro MAKE_CONTRACT() = takes(0) returns(0) {
0x63FFFFFFFF6000526004601CF3
0x00
returndatasize
mstore

0x0D
0x00
returndatasize
dup1
create

0x00 mstore
0x20 0x00 return
returndatasize mstore
0x20 returndatasize return
}
2 changes: 1 addition & 1 deletion src/Distributor.huff
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
gas // [gas, to, amount, 0x00, 0x00, 0x00, 0x00]
call // [success]

0x00 lt success jumpi
returndatasize lt success jumpi

returndatasize dup1 revert

Expand Down
4 changes: 2 additions & 2 deletions src/MyEtherBalance.huff
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
*/

#define macro MAIN() = takes(0) returns(0) {
caller balance 0x00 mstore
0x20 0x00 return
caller balance returndatasize mstore
0x20 returndatasize return
}

0 comments on commit 1282236

Please sign in to comment.