Open zhiqiangxu opened 9 months ago
I don't think the gas savings should compare with storage loads since immutable data are not loaded from storage in the first place, it's loaded from code, so it should compare with that of codecopy, which will be more or less the same in both cases.
This is in comparison to a normal proxy clone Remember that with clone, implementation code is all the same, so any immutable are also same and so not parametrizable.
As such with such normal clone you would have to parametrize by using storage for which you have to pay the initialisation storage cost and each storage read . With clones-with-immutable-args
you do not need to write to storage as you can inject immutable in the proxy and pay only calldata for read
Maybe we could word it differently to make this clearer ?
Yeah, it definitely helps if the comparison is more explicit.
I don't think the gas savings should compare with storage loads since immutable data are not loaded from storage in the first place, it's loaded from code, so it should compare with that of
codecopy
, which will be more or less the same in both cases.IMO the essential advantage this library provides is: it allows to parameterize the immutable data at the clone time instead of at deploy time of implementation contract in the case of
EIP-1167
.