Closed Vectorized closed 1 year ago
@Vectorized does this changed the deployed bytecode of the account contract? Or just the constructor logic?
@jaydenwindle only the constructor logic.
@Vectorized I'm hesitant about including this one (although it's very clever!)
There are a lot of existing accounts deployed with the previous registry/initcode. This PR would introduce a breaking change in the way an account address is computed given a registry address. Existing tooling would have to be updated to support both computation methods and some way of determining which one the registry they are interacting with supports. That seems like a lot of effort and potential confusion at the client level, not sure if that is worth saving 2 gas units per deployment.
Thoughts?
I see! Backwards compatibility is more important!
Just OCD.
Saves 2 gas. The initcode is still of the same length.
Could use
CALLVALUE
(i.e.msg.value
) instead ofPUSH1 00
, butPUSH1 00
gives the same length.Not sure if you want to make
createAccount
payable and pass in themsg.value
into the newly created account (might be convenient for cases where people want to make accounts with some ETH). Payable methods cost less gas, since they don't have the check for zeromsg.value
. But then we have to handle the case where the account has been already created, possibly sending themsg.value
into the account.Before:
After: