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);
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 sincetakeFrom
andgiveTo
are so simpe and only used withinngmi
function. UnlikeisEnabled
andisExpired
which may have external use,takeFrom
andgiveTo
can be removed to also save ~20k gas on deployment.L79-80