function aku() public {
require(msg.sender == dev, "Dev only");
require(devFund != 0, "No fund to withdraw");
uint toSend = devFund;
devFund = 0;
}
//23706 gas
to :
function aku() public {
require(msg.sender == dev, "Dev only");
uint toSend = devFund;
require(toSend != 0, "No fund to withdraw");
devFund = 0;
}
//23606 gas
Handle
Fitraldys
Vulnerability details
Impact
in line https://github.com/code-423n4/2022-01-openleverage/blob/main/openleverage-contracts/contracts/XOLE.sol#L61 is cheaper to change require and move uint toSend to above line require.
Proof of Concept
https://github.com/code-423n4/2022-01-openleverage/blob/main/openleverage-contracts/contracts/XOLE.sol#L61
to :