Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chainstacklabs/deterministic-contract-deployment-remix
Tutorial on deterministically deploying EVM smart contracts
https://github.com/chainstacklabs/deterministic-contract-deployment-remix
create2 create2-contract-deployment deterministic ethereum evm
Last synced: 12 days ago
JSON representation
Tutorial on deterministically deploying EVM smart contracts
- Host: GitHub
- URL: https://github.com/chainstacklabs/deterministic-contract-deployment-remix
- Owner: chainstacklabs
- Created: 2022-07-12T04:30:33.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-04-11T20:56:15.000Z (over 1 year ago)
- Last Synced: 2023-07-24T08:32:59.453Z (over 1 year ago)
- Topics: create2, create2-contract-deployment, deterministic, ethereum, evm
- Language: JavaScript
- Homepage: https://chainstack.com/deploying-a-deterministic-contract-on-ethereum/
- Size: 13.7 KB
- Stars: 3
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Chainstack is the leading suite of services connecting developers with Web3 infrastructure
• Homepage •
Supported protocols •
Chainstack blog •
Chainstack docs •
Blockchain API reference •
• Start for free •# Deploying a deterministic smart contract on Ethereum
This project shows how you how to use a method called deterministic deployment that allows for precomputing contract addresses before deployment.
Read the full guide on the Chainstack Blog
* [Deploying a deterministic smart contract on Ethereum](https://chainstack.com/deploying-a-deterministic-contract-on-ethereum/)## Project details
For this example, we built a simple contract factory for a `SimpleWallet` contract. The factory allows you to deploy the `SimpleWallet` at a predefined address. The `index.js` file holds a script in interact with the smart contract.
## Quickstart
Clone the repository:
```sh
git clone https://github.com/chainstacklabs/deterministic-contract-deployment-remix.git
```Deploy an instance of the `SimpleWallet` contract with [Remix](https://remix.ethereum.org/).
Edit the `index.js` file to include the contract address, private key, and RPC endpoint.
```js
const PRIVATE_KEY = "";const simpleWalletAddress = "";
const provider = ethers.getDefaultProvider("");
```Install dependencies:
```sh
npm ci
```> Use `npm ci` to launch a `clean install` of the dependencies, this will install the same version as in the `package.json` file.
Run the script to interact:
```sh
node index
```## Prerequisites
* Node.js: ^16.17.0— [install Node](https://nodejs.org/en/download/)
* A node RPC endpoint.Deploy a node with Chainstack:
1. [Sign up with Chainstack](https://console.chainstack.com/user/account/create).
1. [Deploy a node](https://docs.chainstack.com/platform/join-a-public-network).
1. [View node access and credentials](https://docs.chainstack.com/platform/view-node-access-and-credentials).