code-423n4 / 2022-01-yield-findings

1 stars 0 forks source link

Costly reentrance modifier #133

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Handle

throttle

Vulnerability details

Impact

Gas savings

Proof of Concept

Reentrancy modifier is costly. Setting state variables to uint 0/1 is cheaper https://github.com/code-423n4/2022-01-yield/blob/main/contracts/ConvexStakingWrapper.sol#L54-L55

Tools Used

Manual review

Recommended Mitigation Steps

Change to

uint256 private constant _NOT_ENTERED = 0;
uint256 private constant _ENTERED = 1;
devtooligan commented 2 years ago

interesting

alcueca commented 2 years ago

Duplicate of #96, that has a better solution