code-423n4 / 2021-10-slingshot-findings

0 stars 0 forks source link

Small gas improvement #90

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

Handle

onewayfunction

Vulnerability details

All external functions in Executioner.sol can be made payable to improve gas efficiency. No ETH is ever sent to these functions, but making them payable prevents the Solidity compiler from adding a require(msg.value == 0) statement to the beginning of the code body, which saves a little gas during every execution of the function.

This is most beneficial for the executeTrades function since it is in the "hot path" during every user trade. This small gas improvement is safe since all these functions have the only onlyOwner modifier, and so there is no risk of users mistakenly sending ETH to these functions.