Skip to content
New issue

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

considered changing it to storage #210

Open
code423n4 opened this issue Feb 2, 2022 · 2 comments
Open

considered changing it to storage #210

code423n4 opened this issue Feb 2, 2022 · 2 comments
Labels
bug Something isn't working G (Gas Optimization) sponsor disputed Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue

Comments

@code423n4
Copy link
Contributor

Handle

Tomio

Vulnerability details

Impact

Expensive gas

Proof of Concept

https://github.com/code-423n4/2022-01-notional/blob/main/contracts/sNOTE.sol#L305
// gas cost 24474

Tools Used

Remix

Recommended Mitigation Steps

Change to:

AccountCoolDown storage coolDown = accountCoolDown[account];
// gas cost 24185
@code423n4 code423n4 added bug Something isn't working G (Gas Optimization) labels Feb 2, 2022
code423n4 added a commit that referenced this issue Feb 2, 2022
@jeffywu jeffywu added the sponsor disputed Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue label Feb 6, 2022
@jeffywu
Copy link
Collaborator

jeffywu commented Feb 6, 2022

Report is unclear, proposed behavior is not what matches the existing code.

@pauliax
Copy link
Collaborator

pauliax commented Feb 15, 2022

I think the warden suggested to change from this:

        AccountCoolDown memory coolDown = accountCoolDown[account];

to this:

        AccountCoolDown storage coolDown = accountCoolDown[account];

and from my understanding. this might slightly reduce gas costs because accountCoolDown is a storage variable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working G (Gas Optimization) sponsor disputed Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue
Projects
None yet
Development

No branches or pull requests

3 participants