bitbankinc / exchangeDepositContract

27 stars 8 forks source link

Make the proxy bytecode immutable and defined in the constructor #6

Closed junderw closed 4 years ago

junderw commented 4 years ago

Slightly lowers the proxy deploy cost and greatly improves readability.

junderw commented 4 years ago

This is a fairly straightforward change, but it might take a little time to parse it.

Alternatively, I have the ProxyFactory idea from Nick working with a constructor here (on a separate branch), it also lowers the gas usage by a few.

https://github.com/junderw/exchangeDepositContract/commit/234d7fa862bccd68e74d9650695f32876411dc34

  1. I am leaning toward this PR instead of the ProxyFactory. If someone can do a quick review I would appreciate it.
  2. If there are any merit/demerits I'm missing for the ProxyFactory method, I would love to hear as many as possible to help us make a decision (Down the road maybe)

@maurelian @wolflo

junderw commented 4 years ago

TIL changing from public to private increased the gas cost for deploy by 22, putting it 1 gas over master. :laughing:

I guess it doesn't really matter, since anyone can see the deployed bytecode by just looking at the transaction history.

So I force-pushed it to private, then back to public. The bytecode can be public, I guess.

junderw commented 4 years ago

Alternative to #7

junderw commented 4 years ago

Closing in favor of #7