We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The aforementioned function:
function renew( uint256 id, uint256 duration ) external override live onlyController returns (uint256) { require(expiries[id] + GRACE_PERIOD >= block.timestamp); // Name must be registered here or in grace period require( expiries[id] + duration + GRACE_PERIOD > duration + GRACE_PERIOD ); // Prevent future overflow expiries[id] += duration; emit NameRenewed(id, expiries[id]); return expiries[id]; }
Performs 5 storage-read operations of expiries[id]:
expiries[id]
require(expiries[id] ...)
expiries[id] = expiries[id] + duration
emit NameRenewed(id, expiries[id])
return expiries[id]
Each storage-read operation currently costs around 2100 gas units (evm paris, solc 0.8.28).
You can reduce the code in this function to perform a single storage-read operation of expiries[id]:
function renew( uint256 id, uint256 duration ) external override live onlyController returns (uint256) { uint256 expiries_id = expiries[id]; require(expiries_id + GRACE_PERIOD >= block.timestamp); // Name must be registered here or in grace period require( expiries_id + duration + GRACE_PERIOD > duration + GRACE_PERIOD ); // Prevent future overflow expiries_id += duration; expiries[id] = expiries_id; emit NameRenewed(id, expiries_id); return expiries_id; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The aforementioned function:
Performs 5 storage-read operations of
expiries[id]
:require(expiries[id] ...)
require(expiries[id] ...)
expiries[id] = expiries[id] + duration
emit NameRenewed(id, expiries[id])
return expiries[id]
Each storage-read operation currently costs around 2100 gas units (evm paris, solc 0.8.28).
You can reduce the code in this function to perform a single storage-read operation of
expiries[id]
:The text was updated successfully, but these errors were encountered: