0

With the new reduced fee for using SSTORE for 'dirty' storage slots, is it possible to re-enter a function from a send() or transfer() and have the contract call send() or transfer() again?

Or is it only possible to re-enter and write to storage a few times?

In other words, does send() or transfer() revert when < 2300 gas remains in the current transaction?

2

If I'm not mistaken, the plan is to release Constantinople without adjusting the SSTORE pricing precisely because it would be possible to re-enter (with a budget of 2,300 gas) and accomplish some of the lower-cost repriced storage operations. That would be bad for some contracts already on the chain.

.send and .transfer do indeed revert from running out gas if they are chained together.

Always use checks, effects, interactions patterns to make re-entrance safe functions to help ensure your deployed contracts are not among those that could be effected by future protocol changes.

Hope it helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.