code-423n4 / 2021-11-fei-findings

0 stars 0 forks source link

Gas Optimization: Inline transfer in TRIBERagequit.sol #123

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Handle

gzeon

Vulnerability details

Impact

Inline transfer in TRIBERagequit.sol L79-80 can save ~120 gas per ngmi. This change does not sacrifice code clarity since takeFrom and giveTo are so simpe and only used within ngmi function. Unlike isEnabled and isExpired which may have external use, takeFrom and giveTo can be removed to also save ~20k gas on deployment.

L79-80

require(token0.transferFrom(msg.sender, party1Core, token0TakenTotal), "erc20 transfer failed");
token1.mint(msg.sender, token1GivenTotal);
elee1766 commented 2 years ago

120

effectively duplicate

pauliax commented 2 years ago

Similar to #143. Marking this issue as invalid, because a similar issue was already submitted by the same warden: #120