Skip to content

Commit

Permalink
Improve scripts (#161)
Browse files Browse the repository at this point in the history
improve scripts
  • Loading branch information
julienbrg authored Dec 12, 2024
1 parent dcb4164 commit c87adcf
Show file tree
Hide file tree
Showing 33 changed files with 1,376 additions and 2,623 deletions.
15 changes: 11 additions & 4 deletions .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,23 @@ OP_ETHERSCAN_API_KEY="88888"
BASE_MAINNET_RPC_ENDPOINT_URL="https://mainnet.base.org"
BASE_ETHERSCAN_API_KEY="88888"

# Arbitrum One Mainnet
ARBITRUM_MAINNET_RPC_ENDPOINT_URL="88888"
ARBITRUM_ETHERSCAN_API_KEY="88888"

# Sepolia
SEPOLIA_RPC_ENDPOINT_URL="https://sepolia.infura.io/v3/88888"
SEPOLIA_RPC_ENDPOINT_URL="88888"
ETHERSCAN_API_KEY="88888"

# OP Sepolia
OP_SEPOLIA_RPC_ENDPOINT_URL="https://sepolia.optimism.io"
OP_SEPOLIA_RPC_ENDPOINT_URL="88888"

# Base Sepolia
BASE_SEPOLIA_RPC_ENDPOINT_URL="https://sepolia.base.org"

# Arbitrum Sepolia
ARBITRUM_SEPOLIA_RPC_ENDPOINT_URL="88888"

# Addresses used when running scripts for testing cross-chain scenarios
ALICE="88888" # Alice // 0xD8a394e7d7894bDF2C57139fF17e5CBAa29Dd977
JUNGLE="88888" # Jungle Fever // 0xBDC0E420aB9ba144213588A95fa1E5e63CEFf1bE
ALICE="88888"
JUNGLE="88888"
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ artifacts
.env*
!.env.template
NOTES.md
/deployments
deployments
data.json
66 changes: 24 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,51 +52,19 @@ Then you can add your DAO in [Tally](https://www.tally.xyz/) and/or spin up your

### Crosschain

Make sure that the deployer wallet address is funded on each notwork you want to deploy to:
Run the `scenario1.sh` bash script:

```
pnpm bal
./scenario1.sh
```

Then, you can go ahead and deploy:
It will:

```bash
pnpm crosschain:sepolia
pnpm crosschain:opSepolia
pnpm crosschain:baseSepolia
pnpm crosschain:arbitrumSepolia
```

Your DAO will be deployed on every networks at the same address (watch the [Asciinema video](https://asciinema.org/a/rc8bTqbBiW7e0xevewxCwCP7C)).

Then you can follow these steps to verify that proofs can be generated on home chain and claimed on foreign chain:

```bash

# Watch the [Asciinema video](https://asciinema.org/a/1iZZQVKU51U86hzYYLfjSVtw6)
npx hardhat run scripts/propose.ts --network sepolia
npx hardhat run scripts/verify-proof.ts --network sepolia
npx hardhat run scripts/claim-membership.ts --network opSepolia
npx hardhat run scripts/claim-membership.ts --network baseSepolia
npx hardhat run scripts/claim-membership.ts --network arbitrumSepolia

npx hardhat run scripts/gov-burn.ts --network sepolia
npx hardhat run scripts/verify-gov-burn-proof.ts --network sepolia
npx hardhat run scripts/claim-gov-burn.ts --network opSepolia

npx hardhat run scripts/verify-metadata-proof.ts --network sepolia
npx hardhat run scripts/claim-metadata-update.ts --network opSepolia

npx hardhat run scripts/verify-manifesto-proof.ts --network sepolia
npx hardhat run scripts/claim-manifesto-update.ts --network opSepolia

npx hardhat run scripts/gov-voting-delay.ts --network sepolia
npx hardhat run scripts/verify-voting-delay-proof.ts --network sepolia
npx hardhat run scripts/claim-voting-delay.ts --network opSepolia

npx hardhat run scripts/verify-delegation-proof.ts --network sepolia
npx hardhat run scripts/claim-delegation.ts --network opSepolia
```
- Deploy to OP Sepolia
- Deploy to Arbitrum Sepolia
- Submit a proposal and add a member
- Generate a membership proof on OP Sepolia
- Claim that proof on Arbitrum Sepolia

## Security

Expand All @@ -122,9 +90,23 @@ The following functions are `onlyOwner`, and since the NFT contract ownership is
|---------|----------|---------------|
| Optimism Mainnet | 10 | [Documentation](https://docs.optimism.io/chain/networks#op-mainnet) |
| Base Mainnet | 8453 | [Documentation](https://docs.base.org/docs/network-information#base-mainnet) |
| Arbitrum One | 42161 | [Documentation](https://docs.arbitrum.io/welcome/get-started) |
| Sepolia Testnet | 11155111 | [Documentation](https://ethereum.org/nb/developers/docs/networks/#sepolia) |
| OP Sepolia Testnet | 11155420 | [Documentation](https://docs.optimism.io/chain/networks#opSepolia) |
| OP Sepolia Testnet | 11155420 | [Documentation](https://docs.optimism.io/chain/networks#op-sepolia) |
| Base Sepolia Testnet | 84532 | [Documentation](https://docs.base.org/docs/network-information/#base-testnet-sepolia) |
| Arbitrum Sepolia | 421614 | [Documentation](https://docs.arbitrum.io/welcome/get-started) |

## Contract Verification

| Network | Explorer URL | API URL | API Key Variable |
|---------|--------------|---------|-----------------|
| Optimism | https://optimistic.etherscan.io | https://api-optimistic.etherscan.io/api | OP_ETHERSCAN_API_KEY |
| Base | https://basescan.org | https://api.basescan.org/api | BASE_ETHERSCAN_API_KEY |
| Arbitrum One | https://arbiscan.io | https://api.arbiscan.io/api | ARBITRUM_ETHERSCAN_API_KEY |
| Sepolia | https://sepolia.etherscan.io | https://api-sepolia.etherscan.io/api | ETHERSCAN_API_KEY |
| OP Sepolia | https://sepolia-optimism.etherscan.io | https://api-sepolia-optimistic.etherscan.io/api | OP_ETHERSCAN_API_KEY |
| Base Sepolia | https://sepolia.basescan.org | https://api-sepolia.basescan.org/api | BASE_ETHERSCAN_API_KEY |
| Arbitrum Sepolia | https://sepolia.arbiscan.io | https://api-sepolia.arbiscan.io/api | ARBITRUM_ETHERSCAN_API_KEY |

## Core Dependencies

Expand All @@ -136,4 +118,4 @@ The following functions are `onlyOwner`, and since the NFT contract ownership is

## Support

Feel free to reach out to [Julien](https://github.com/julienbrg): [Farcaster](https://warpcast.com/julien-), [Element](https://matrix.to/#/@julienbrg:matrix.org), [Status](https://status.app/u/iwSACggKBkp1bGllbgM=#zQ3shmh1sbvE6qrGotuyNQB22XU5jTrZ2HFC8bA56d5kTS2fy), [Telegram](https://t.me/julienbrg), [Twitter](https://twitter.com/julienbrg), [Discord](https://discordapp.com/users/julienbrg), or [LinkedIn](https://www.linkedin.com/in/julienberanger/).
Feel free to reach out to [Julien](https://github.com/julienbrg) on [Farcaster](https://warpcast.com/julien-), [Element](https://matrix.to/#/@julienbrg:matrix.org), [Status](https://status.app/u/iwSACggKBkp1bGllbgM=#zQ3shmh1sbvE6qrGotuyNQB22XU5jTrZ2HFC8bA56d5kTS2fy), [Telegram](https://t.me/julienbrg), [Twitter](https://twitter.com/julienbrg), [Discord](https://discordapp.com/users/julienbrg), or [LinkedIn](https://www.linkedin.com/in/julienberanger/).
Loading

0 comments on commit c87adcf

Please sign in to comment.