Skip to content

Commit

Permalink
feat: add support for sepolia
Browse files Browse the repository at this point in the history
  • Loading branch information
amarinkovic committed Apr 12, 2023
1 parent 23fcaae commit a5e6255
Show file tree
Hide file tree
Showing 9 changed files with 3,712 additions and 17 deletions.
3 changes: 1 addition & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
export LOCAL_RPC_URL=
export ETH_MAINNET_RPC_URL=
export ETH_GOERLI_RPC_URL=
export ETH_MAINNET_API_KEY=
export ETH_GOERLI_API_KEY=
export ETH_SEPOLIA_RPC_URL=
export ETHERSCAN_API_KEY=
export NAYMS_SALT=
export OWNER_ACCOUNT_KEY=
47 changes: 36 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ schedule-upgrade-goerli: ## schedule upgrade to goerli diamond, then upgrade
--verify --delay 30 --retries 10 \
; node cli-tools/postproc-broadcasts.js

deploy: ## smart deploy to goerli
deploy-goerli: ## smart deploy to goerli
@forge script SmartDeploy \
-s "smartDeploy(bool, bool, uint8, string[] memory, bytes32)" ${newDiamond} ${initNewDiamond} ${facetAction} ${facetsToCutIn} ${deploymentSalt} \
-f ${ETH_GOERLI_RPC_URL} \
Expand All @@ -192,11 +192,21 @@ deploy: ## smart deploy to goerli
--verify --delay 30 --retries 10 \
; node cli-tools/postproc-broadcasts.js

deploy-mainnet: ## smart deploy to mainnet
deploy-goerli-sim: ## simulate smart deploy to goerli
forge script SmartDeploy \
-s "smartDeploy(bool, bool, uint8, string[] memory, bytes32)" ${newDiamond} ${initNewDiamond} ${facetAction} ${facetsToCutIn} ${deploymentSalt} \
-f ${ETH_GOERLI_RPC_URL} \
--chain-id 5 \
--etherscan-api-key ${ETHERSCAN_API_KEY} \
--sender ${senderAddress} \
-vv \
--ffi

deploy-sepolia: ## smart deploy to sepolia
@forge script SmartDeploy \
-s "smartDeploy(bool, bool, uint8, string[] memory, bytes32)" ${newDiamond} ${initNewDiamond} ${facetAction} ${facetsToCutIn} ${deploymentSalt} \
-f ${ETH_MAINNET_RPC_URL} \
--chain-id 1 \
-f ${ETH_SEPOLIA_RPC_URL} \
--chain-id 11155111 \
--etherscan-api-key ${ETHERSCAN_API_KEY} \
--sender ${senderAddress} \
--mnemonic-paths ./nayms_mnemonic.txt \
Expand All @@ -207,25 +217,40 @@ deploy-mainnet: ## smart deploy to mainnet
--verify --delay 30 --retries 10 \
; node cli-tools/postproc-broadcasts.js

deploy-mainnet-sim: ## simulate deploy to mainnet
deploy-sepolia-sim: ## simulate smart deploy to sepolia
forge script SmartDeploy \
-s "smartDeploy(bool, bool, uint8, string[] memory, bytes32)" ${newDiamond} ${initNewDiamond} ${facetAction} ${facetsToCutIn} ${deploymentSalt} \
-f ${ETH_SEPOLIA_RPC_URL} \
--chain-id 11155111 \
--etherscan-api-key ${ETHERSCAN_API_KEY} \
--sender ${senderAddress} \
-vv \
--ffi

deploy-mainnet: ## smart deploy to mainnet
@forge script SmartDeploy \
-s "smartDeploy(bool, bool, uint8, string[] memory, bytes32)" ${newDiamond} ${initNewDiamond} ${facetAction} ${facetsToCutIn} ${deploymentSalt} \
-f ${ETH_MAINNET_RPC_URL} \
--chain-id 1 \
--etherscan-api-key ${ETHERSCAN_API_KEY} \
--sender ${senderAddress} \
--mnemonic-paths ./nayms_mnemonic.txt \
--mnemonic-indexes 19 \
-vv \
--ffi
--ffi \
--broadcast \
--verify --delay 30 --retries 10 \
; node cli-tools/postproc-broadcasts.js

deploy-sim: ## simulate smart deploy to goerli
forge script SmartDeploy \
deploy-mainnet-sim: ## simulate deploy to mainnet
@forge script SmartDeploy \
-s "smartDeploy(bool, bool, uint8, string[] memory, bytes32)" ${newDiamond} ${initNewDiamond} ${facetAction} ${facetsToCutIn} ${deploymentSalt} \
-f ${ETH_GOERLI_RPC_URL} \
--chain-id 5 \
-f ${ETH_MAINNET_RPC_URL} \
--chain-id 1 \
--etherscan-api-key ${ETHERSCAN_API_KEY} \
--sender ${senderAddress} \
-vv \
--ffi
--ffi

anvil: ## run anvil with shared wallet
anvil --host 0.0.0.0 --chain-id 31337 --accounts 20 -m ./nayms_mnemonic.txt --state anvil.json
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,19 +132,19 @@ Below are several examples on how you would use the smart deploy scripts.
For a __fresh new deployment__ of the entire project, execute this command:

```zsh
make deploy-sim newDiamond=true initNewDiamond=true facetAction=0
make deploy-sepolia-sim newDiamond=true initNewDiamond=true facetAction=0
```

To __upgrade the facets that have been changed__ since the last deployment, run the following:

```zsh
make deploy-sim newDiamond=false initNewDiamond=false facetAction=1
make deploy-sepolia-sim newDiamond=false initNewDiamond=false facetAction=1
```

To __upgrade specific set of facets__, run command like this one:

```zsh
make deploy-sim newDiamond=false initNewDiamond=false facetAction=2 facetsToCutIn="["Market","Entity"]"
make deploy-sepolia-sim newDiamond=false initNewDiamond=false facetAction=2 facetsToCutIn="["Market","Entity"]"
```

Include a bytes32 salt to deploy the diamond with a deterministic address. Including a salt will first deploy a contract that is used to predetermine the diamond deployment address. If a salt is not included, then the script will deploy the diamond non-deterministically. Currently, there is a default deployment salt given in the make file.
Expand Down
400 changes: 400 additions & 0 deletions broadcast/SmartDeploy.s.sol/11155111/smartDeploy-1681311380.json

Large diffs are not rendered by default.

1,090 changes: 1,090 additions & 0 deletions broadcast/SmartDeploy.s.sol/11155111/smartDeploy-1681311387.json

Large diffs are not rendered by default.

1,090 changes: 1,090 additions & 0 deletions broadcast/SmartDeploy.s.sol/11155111/smartDeploy-1681311839.json

Large diffs are not rendered by default.

1,090 changes: 1,090 additions & 0 deletions broadcast/SmartDeploy.s.sol/11155111/smartDeploy-latest.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions deployedAddresses.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"1": "0x03f2a869915984b9BEd52C53eE492668a326BC18",
"31337": "0x7E5462DA297440D2a27fE27d1F291Cf67202302B",
"11155111": "0x7E5462DA297440D2a27fE27d1F291Cf67202302B",
"5": "0x428c9347a76943E4c625C11813A303Ca12B8675f"
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nayms/contracts",
"version": "3.4.8",
"version": "3.4.10",
"main": "index.js",
"repository": "https://github.com/nayms/contracts-v3.git",
"author": "Kevin Park <[email protected]>",
Expand Down

0 comments on commit a5e6255

Please sign in to comment.