coinbase / smart-wallet

MIT License
258 stars 47 forks source link

Make entryPoint a constant #54

Closed wilsoncusack closed 3 months ago

wilsoncusack commented 3 months ago

Supersedes #31

Stylistic change. The entryPoint function was a carryover from originally building on Solady ERC-4337. For Solady, it may make more sense to have a function which can be overridden to allow different EntryPoint versions. In our case, a Smart Wallet using a different EntryPoint version should be considered an entirely different Smart Wallet version.

If one is attempting to use Smart Wallet on a chain where v0.6 has a different address, the constant value can be updated.

wilsoncusack commented 3 months ago

Gas diff at 999_999 optimizer runs bottom is main image (5)

and no optimizer runs bottom is main image (4)

Seems optimizer is better at optimizing functions than constants, but think we will still prefer constant here

wilsoncusack commented 3 months ago

Upon further debating with @xenoliss, we've decide to leave the code as is incase it makes it easier for others to inherit and change to different entry point versions