Among all cases of ERC-20 token transactions, a popular one is when smart contracts approve token spending to other contracts. Often tokens are approved for only one transaction.
Following the ERC-20 standard, if a smart contract wants to approve the spending of tokens to another smart contract for only one transaction, this causes the allowance saved in storage to be updated and retrieved.
Token allowances utilising EIP-1153 transient storage are a cheaper alternative to the regular storage allowances.
Co-authored a proposal to add ERC-7674: Temporary Approval Extension for ERC-20.
ethereum-magicians.org/t/add-erc-7674-transient-approval-extension-for-erc-20/19521
Any thoughts on this?
Yesterday I became a contributor to the OpenZeppelin repository, it was openzeppelin-contracts (yes, that one).
This gives me mixed feelings.
Firstly, I’m happy to do my part to make the tools I use every day better.
Secondly, the thought that I can do something really useful brings tears to my eyes.
I'm still struggling with imposter syndrome, the effects of burnout a few years ago, and the rather sexist attitudes towards female programmers during my university years.
If I could address myself from the past now, I would say: “Believe in yourself, no matter what. There's nothing you can't learn. Screw those who think otherwise”.
Pretty corny, but we sometimes miss so much those who will say these words at the right time.
Hear me out. Driving, sewing, playing guitar, baking cakes, programming on Solidity? You can learn all of these things, and more, if you believe in yourself.
I watched the first episode of Netflix's 3 Body Problem yesterday. For my taste, the book is better.
Fun fact: starting with Dencun and Solidity 0.8.24 you can save gas on the nonReentrant modifier. My test showed that using transient storage reduced gas consumption by ~1800 per transaction.
It is now possible to save the flag status to a new transient storage location rather than to the regular storage. The difference with the storage is that any value written to the transient storage will only be retained there within a transaction, and will be cleared when it is finished. The case of the nonReentrant modifier flag fits well with this concept.
Note: the image represents a naive implementation of the modifier that writes and reads to slot 0. In production code, my personal recommendation is to make a more standardised solution that prevents possible collisions in slot usage. Or wait for the OpenZeppelin implementation github.com/OpenZeppelin/openzeppelin-contracts/issues/4888.