mouseless0x / rusty-sando

Implementation of a competitive v2/v3 multi-meat MEV sandwich bot written using Rust and Huff.
MIT License
782 stars 256 forks source link

Regarding the optimization issue of invoking contracts, #12

Closed xbhuang1994 closed 1 year ago

xbhuang1994 commented 1 year ago

we can see that in the code, the amount is passed by setting msg.value. It is well known that transferring funds incurs thousands of gas costs. Why not pack the amount using shr(uint32) + offset(uint8) into calldata? This would require less than one thousand gas costs.