15,000 USDC
View results
Submission Details
Severity: gas

With assembly, .call (bool success)  transfer can be done gas-optimized

Summary

[G-15] With assembly, .call (bool success) transfer can be done gas-optimized

return data (bool success,) has to be stored due to EVM architecture, but in a usage like below, ‘out’ and ‘outsize’ values are given (0,0),
this storage disappears and gas optimization is provided.

file: /src/DSCEngine.sol
274 bool success = i_dsc.transferFrom(dscFrom, address(this), amountDscToBurn);

https://github.com/Cyfrin/2023-07-foundry-defi-stablecoin/blob/main/src/DSCEngine.sol#L274

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.