Using the PasswordStore::isOwner
modifier, created in the previous submission, we can save gas on the function calls.
Replacing the if
inside the PasswordStore::getPassword
function with the modifier isOwner
we can save gas in the function call.
If we use the modifier also in the PasswordStore::getPassword
function, as well as in the PasswordStore::setPassword
function, the average gas consumption of a PasswordStore::getPassword
call goes from 2990 to 1842, the maximum consumption goes from 3320 to 2343.
It also reduces the amount of duplicate code inside the smart contract.
manual review
foundry
As shown previously, we have to create an internal function _checkOwner
with the if
to check if the caller user is the owner, create the modifier isOwner
that uses the function created, and remove the if from the PasswordStore::getPassword
function and add the modifier isOwner
in the definition of the PasswordStore::getPassword
function.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.