mouseless-eth / rusty-sando

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

Huff constant documentation #3

Closed pygeek closed 1 year ago

pygeek commented 1 year ago

Can you explain the purpose of the following constants:

#define constant PAIR_INIT_CODE_HASH = 0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54
#define constant HELPER = 0x2B5AD5c4795c026514f8317c7a215E218DcCD6cF

I see no documentation on these constants, and it seems at very least, HELPER needs to be changed prior to deployment.

Thanks

Sharktoothman commented 1 year ago

Did this get fixed? Were you able to deploy?

pygeek commented 1 year ago

@vehctor it seems like HELPER needs to be changed as this is where eth is swept to on contract selfdestruct according to the sandwch.huff code?

xbhuang1994 commented 1 year ago

The HELPER is an address with the rights to delete contracts, withdraw Ethereum or WETH. This can be consistent with SEARCHER, and needs to be modified in the Huff code during deployment. The PAIR_INIT_CODE_HASH is one of the constant values used to calculate the address of the Uniswap v3 pair contract. The specific Solidity implementation can be more easily understood by looking at the Uniswap v3 factory contract code.