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

deterministic proxy deployment docs: draft #2309

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

xBalbinus
Copy link
Contributor

No description provided.

@xBalbinus
Copy link
Contributor Author

@longfeiWan9 for review, because for some reason I can't mark you as a reviewer.

@trruckerfling for merge when done

@longfeiWan9 longfeiWan9 marked this pull request as draft September 10, 2024 07:09
Copy link
Collaborator

@trruckerfling trruckerfling left a 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

smart-contracts/advanced/deterministic-deployment.md Outdated Show resolved Hide resolved
smart-contracts/advanced/deterministic-deployment.md Outdated Show resolved Hide resolved
smart-contracts/advanced/deterministic-deployment.md Outdated Show resolved Hide resolved
smart-contracts/advanced/deterministic-deployment.md Outdated Show resolved Hide resolved
smart-contracts/advanced/deterministic-deployment.md Outdated Show resolved Hide resolved
smart-contracts/advanced/deterministic-deployment.md Outdated Show resolved Hide resolved
smart-contracts/advanced/deterministic-deployment.md Outdated Show resolved Hide resolved
smart-contracts/advanced/deterministic-deployment.md Outdated Show resolved Hide resolved
smart-contracts/advanced/deterministic-deployment.md Outdated Show resolved Hide resolved
@xBalbinus xBalbinus marked this pull request as ready for review September 11, 2024 16:46

## 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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Comment on lines 31 to 53
## **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.

Copy link
Collaborator

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.

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

Successfully merging this pull request may close these issues.

3 participants