Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document the Finalized Initcode #918

Open
wjmelements opened this issue Nov 12, 2024 · 3 comments
Open

Document the Finalized Initcode #918

wjmelements opened this issue Nov 12, 2024 · 3 comments
Labels

Comments

@wjmelements
Copy link
Contributor

Component

No response

Describe the suggested feature and problem it solves.

The initcode hash is published but the initcode is not. If the initcode matching the initcode hash were to be lost, it could cause issues with the final deployment next year.

Describe the desired implementation.

Commit the finalized output files into version control. These include the initcode and the ABI.

Describe alternatives.

Commit separate files with the final initcode and ABI.

Additional context.

I am having trouble generating initcode that matches the published initcode hash.

I worry that the initcode hash in the contest contract may be incorrect because I cannot reproduce it. I calculate 0x44d2e366954aa5a7f0605ffd66ca57a5a71987845939d8d8c79c716d8dfbb3de instead. Here is how:

I checkout main and do forge update and forge build.

I do cat out/PoolManager.t.sol/PoolManagerTest.json | jq -r .bytecode.object > v4.out

In python3 I do:

from web3 import Web3
with open('v4.out', 'r') as f:
    v4 = f.read().rstrip()
print(Web3.keccak(hexstr=v4))

The result is 0x44d2e366954aa5a7f0605ffd66ca57a5a71987845939d8d8c79c716d8dfbb3de.

Copy link

linear bot commented Nov 12, 2024

@wjmelements
Copy link
Contributor Author

out/PoolManager.t.sol/PoolManagerTest.json

This is probably the problem I was having. It is still a good idea to commit the initcode.

@wjmelements
Copy link
Contributor Author

For cat out/PoolManager.sol/PoolManager.json | jq -r .bytecode.object | pbcopy I get 0x2aa0ab6866fc2e2b2a0a9128e66982a049eb04516c012690426ab110f92966f8 which is also not 0x94d114296a5af85c1fd2dc039cdaa32f1ed4b0fe0868f02d888bfc91feb645d9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant