Closed code423n4 closed 2 years ago
Tomio
Expensive gas
https://github.com/code-423n4/2022-01-openleverage/blob/main/openleverage-contracts/contracts/XOLE.sol#L326 // gas cost 26049
Remix
Change to:
LockedBalance storage _locked = locked[msg.sender]; // gas cost 25954
and remove https://github.com/code-423n4/2022-01-openleverage/blob/main/openleverage-contracts/contracts/XOLE.sol#L333, not needed if use storage
Duplicate to #137
Handle
Tomio
Vulnerability details
Impact
Expensive gas
Proof of Concept
https://github.com/code-423n4/2022-01-openleverage/blob/main/openleverage-contracts/contracts/XOLE.sol#L326 // gas cost 26049
Tools Used
Remix
Recommended Mitigation Steps
Change to:
and remove https://github.com/code-423n4/2022-01-openleverage/blob/main/openleverage-contracts/contracts/XOLE.sol#L333, not needed if use storage