Basically I want to do a written tutorial on how to compile and deploy this CREATE2 proxy contract, written in pure Yul.


This is what Foundry uses by default to deploy contracts using CREATE2.

Ironically I can't figure out a way to compile and deploy this very contract from within Foundry.

2 Answers 2


there is no built-in method as far as I'm aware. you can see an example here: https://github.com/CodeForcer/foundry-yul


You can install this repo to foundry and use YulCompiler contract to test and deploy from your project. There is also example usage

  • 1
    Thank you bro. I'll look into this. The existing yul deployer implementations did not work for me, I don't know if I was wrong or they were wrong. I was trying to do a CREATE2 implementation in pure Yul, but just couldn't figure out how to make everything work with Foundry. I was trying to write an article for the foundry book. The article is merged now though, and I stuck to the original Solidity implementation. book.getfoundry.sh/tutorials/create2-tutorial Nov 14, 2023 at 12:01
  • Nice article, my contributions to foundry book are only fixing typos :D I improved and fixed YulDeployer in the repo - added vm.broadcast instruction (it wasn't there, so it was suitable for tests only) and changed solc argument for yul compiling - it changed over time there
    – crystalbit
    Nov 14, 2023 at 20:33
  • 1
    Haha, this was a lot of hard work. I managed to put in a bunch of assembly instead of pure yul. It was a privilege to contribute to the book with a full tutorial. Hopefully this also helps me land a job lol. Should look good on my CV. Nov 16, 2023 at 10:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.