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

Withdraw reading from storage twice #24

Closed
code423n4 opened this issue Aug 8, 2021 · 1 comment
Closed

Withdraw reading from storage twice #24

code423n4 opened this issue Aug 8, 2021 · 1 comment
Labels
bug Something isn't working duplicate This issue or pull request already exists fixed-in-upstream-repo This task has been implemented in the upstream repo G (Gas Optimization) resolved sponsor confirmed

Comments

@code423n4
Copy link
Contributor

Handle

evertkors

Vulnerability details

Impact

On withdraw():948, marketIndexOfToken[token] is read from storage twice.

Recommended Mitigation Steps

Reorder like this.
uint32 marketIndex = marketIndexOfToken[token];
ILongShort(longShort).updateSystemState(marketIndex);

@code423n4 code423n4 added bug Something isn't working G (Gas Optimization) labels Aug 8, 2021
code423n4 added a commit that referenced this issue Aug 8, 2021
@JasoonS JasoonS added duplicate This issue or pull request already exists resolved sponsor confirmed labels Aug 11, 2021
@JasoonS
Copy link
Collaborator

JasoonS commented Aug 11, 2021

Duplicate of #18

@JasoonS JasoonS marked this as a duplicate of #18 Aug 11, 2021
@JasoonS JasoonS added the fixed-in-upstream-repo This task has been implemented in the upstream repo label Aug 13, 2021
@JasoonS JasoonS closed this as completed Aug 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists fixed-in-upstream-repo This task has been implemented in the upstream repo G (Gas Optimization) resolved sponsor confirmed
Projects
None yet
Development

No branches or pull requests

2 participants