2

I've noticed a pattern in deploying CREATE2 contracts and now I'm trying to find out the salt used. The reason is, for verifying contracts with CREATE2 on Sourcify salt and the deployerAddress are needed.

So there's this contract 0x4e59b44847b379578588920ca78fbf26c0b4956c deployed on many chains which seems to serve the purpose of CREATE2 deploying a contract. It takes some padding + salt (I guess) + creation bytecode and deploys. I'd appreciate some explanation on this contract's code either, because I couldn't find anything despite its popularity.

I was able to verify the ERC-4337 implementation (0x0576a17...) because coincidentally the salt was 0. Here are the first bytes of the tx.input that created 0x0576a17...:

0x000000000000000000000000000000000000000000000000000000000000000060a08060405234620000...

Now I'm trying to verify a Uniswap Contract (0x000000...) also deployed by 0x4e59b4. Here are the first of the tx.input that created 0x000000...:

0x0000000000000000000000000000000000000000d3af2663da51c1021500000060c0346100bb574660a0...

Could someone explain how can I find the salt used and maybe in general what's going on?

0

2 Answers 2

2

It was quite easy. The salt is the first 32 bytes of the tx.input. So for 0x000000... it was:

0x0000000000000000000000000000000000000000d3af2663da51c10215000000
1

0x4e59b44847b379578588920cA78FbF26c0B4956C is foundry Create2Deployer. It's more common to see it in forge script :)

And for tx.input: 32-byte salt + creationCode

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.