foundry-yul icon indicating copy to clipboard operation
foundry-yul copied to clipboard

Use Yul optimizer

Open pawurb opened this issue 1 year ago • 0 comments
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.

pawurb avatar Dec 27 '23 09:12 pawurb