foundry-yul
foundry-yul copied to clipboard
Use Yul optimizer
trafficstars
This PR enables optimizer for Yul and also fixes issue from https://github.com/CodeForcer/foundry-yul/pull/2 .
I'm seeing ~40% bytecode size reduction with optimization enabled on my test project https://github.com/pawurb/yul721
solc --strict-assembly src/Yul721.yul --bin | tail -1 | wc // 4697
solc --strict-assembly src/Yul721.yul --bin --optimize | tail -1 | wc // 2941
and also ~0.5% smaller gas usage.