-
Notifications
You must be signed in to change notification settings - Fork 298
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
deterministic proxy deployment docs: draft #2309
base: main
Are you sure you want to change the base?
Conversation
@longfeiWan9 for review, because for some reason I can't mark you as a reviewer. @trruckerfling for merge when done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls see comments and i can re-review after edits/replies
|
||
## Creating a deterministic deployment | ||
|
||
Contract address can be precomputed, before the contract is deployed, using a create opcode. This is one of the options for deterministic deployment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Contract address can be precomputed, before the contract is deployed, using a create opcode. This is one of the options for deterministic deployment. | |
A contract address can be precomputed, before the contract is deployed, using a create opcode. This is one of the options for deterministic deployment. |
## **Deploying a factory contract to Filecoin** | ||
|
||
Other people may have already deployed the factory contract onto Filecoin, in which case you won't need to redeploy it. You can just use the factory to deploy your contracts. So first check the expected address on a blockchain explorer to see if a factory contract already exists there. | ||
|
||
If there isn't one yet then you'll need to deploy the factory contract via a **reusable signed raw deployment transaction**. The factory contract will then have the same address as on other blockchains (as long as the transaction bytecode stays the same). See the steps below to deploy the factory. | ||
|
||
1. **Prepare the deployment transaction:** | ||
- Write the smart contract code for the factory contract. | ||
- Compile the contract to get the bytecode. | ||
- Create a deployment transaction with the bytecode. | ||
|
||
2. **Sign the deployment transaction:** | ||
- Use a private key to sign the deployment transaction. | ||
- Ensure the private key is securely stored and not exposed. | ||
|
||
3. **Broadcast the signed transaction:** | ||
- Send the signed transaction to the desired blockchain network. | ||
- Wait for the transaction to be mined and confirmed. | ||
|
||
4. **Verify the deployment:** | ||
- Check the [blockchain explorer](https://docs.filecoin.io/networks/mainnet/explorers) to verify that the factory contract has been deployed to the expected address. | ||
- Ensure the contract code matches the expected bytecode. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not make use of one of the factory contracts listed at the bottom of the document and make this an actual deployment example/tutorial, instead of just a list of steps. I don't think there is much benefit in stating Write the smart contract code for the factory contract
in a document that, as far as I can tell, is aimed at people who don't necessarily know what deterministic deployments are at the start of the document.
No description provided.