Closed code423n4 closed 1 year ago
unnecessary call to decreaseAllowance in BridgeEscrow.sol 's revokeAll function,
decreaseAllowance
BridgeEscrow.sol
revokeAll
since the allowance is set back to 0, the approve method can be used:
approve
function revokeAll(address _spender) external onlyGovernor { graphToken().approve(_spender, 0); // IGraphToken grt = graphToken(); // grt.decreaseAllowance(_spender, grt.allowance(address(this), _spender)); }
running yarn test:gas test/gateway/bridgeEscrow.test.ts in both cases returns a gas optimization of 1596 units
yarn test:gas test/gateway/bridgeEscrow.test.ts
unnecessary call to
decreaseAllowance
inBridgeEscrow.sol
'srevokeAll
function,since the allowance is set back to 0, the
approve
method can be used:running
yarn test:gas test/gateway/bridgeEscrow.test.ts
in both cases returns a gas optimization of 1596 units