Open fulldecent opened 5 years ago
@fulldecent Thanks for letting us know! ❤️ If I understand you correctly, this technique would shave off 3 gas per minted contract?
Yes, that is correct.
@fulldecent can you clarify what XX means?
XX
= 0x04
^ 0x13
= 0x17
.
This is chosen so that
0xb3f879cb30fe243b4dfee438691c04
is the beneficiary (msg.caller
)0xb3f879cb30fe243b4dfee438691c04
^ 0xb3f879cb30fe243b4dfee438691c17
= 0x13
JUMP 0x13
lands on the JUMPDEST
Just wanted to say this is a cute project. I have been studying and wanted to share my notes.
Current contract call costs 22 gas.
https://github.com/projectchicago/gastoken/blob/master/contract/GST2_ETH.sol#L106-L114
Proposed update requires 19 gas.
With this new technique, the comment on the homepage can be updated:
Don't worry about the 0x0 address. You want the 0xPC address. Then you can additionally save the
PUSH15
andXOR
operations.This proposed update also affects the efficiency ratio and other parts of the web page.