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

Migration to Arbitrum Sepolia #1333

Merged
merged 11 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions .github/workflows/deploy-subgraph.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,20 @@ on:
network:
description: The network to deploy the subgraph to
required: true
default: 'arbitrum-goerli'
default: 'arbitrum-sepolia'
type: choice
options:
- arbitrum-goerli-devnet
- arbitrum-goerli
- arbitrum-sepolia-devnet
- arbitrum-sepolia
- arbitrum
subgraph:
description: The name of the subgraph to deploy
required: true
default: 'core'
type: choice
options:
- core
- drt
update:
description: Whether to update the subgraph with the current artifacts for the selected network.
required: true
Expand Down Expand Up @@ -58,19 +66,19 @@ jobs:
if: ${{ inputs.update }}
run: |
export PATH=$PWD/../bin:$PATH
yarn update:${{ inputs.network }}
yarn update:${{ inputs.subgraph }}:${{ inputs.network }}
working-directory: subgraph

- name: Build the subgraph
run: |
yarn codegen
yarn build
yarn codegen:${{ inputs.subgraph }}
yarn build:${{ inputs.subgraph }}
working-directory: subgraph

- name: Authenticate with TheGraph
run: yarn graph auth "${{ secrets.SUBGRAPH_AUTH_TOKEN }}" --product hosted-service
working-directory: subgraph

- name: Deploy the subgraph
run: yarn deploy:${{ inputs.network }}
run: yarn deploy:${{ inputs.subgraph }}:${{ inputs.network }}
working-directory: subgraph
2 changes: 1 addition & 1 deletion bot-pinner/docker-compose-dappnode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ services:
volumes:
- "data:/var/lib/data/"
environment:
RPC: "https://rinkeby.arbitrum.io/rpc"
RPC: "https://sepolia-rollup.arbitrum.io/rpc"
IPFS: "http://ipfs-cluster.dappnode:9094"
INTERVAL: 60
RETRY: 2
Expand Down
5 changes: 5 additions & 0 deletions contracts/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -179,3 +179,8 @@ tags
# .pnp.*

# End of https://www.toptal.com/developers/gitignore/api/vim,node,visualstudiocode,yarn

.env*
.flaskenv*
!.env.project
!.env.vault
5 changes: 5 additions & 0 deletions contracts/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,8 @@
# Except this
/deployments/localhost/
**/.DS_Store

.env*
.flaskenv*
!.env.project
!.env.vault
108 changes: 46 additions & 62 deletions contracts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ Refresh the list of deployed contracts by running `./scripts/generateDeployments

### Official Testnet

#### Arbitrum Sepolia

- [PinakionV2](https://sepolia.arbiscan.io/address/0x34B944D42cAcfC8266955D07A80181D2054aa225)

#### Sepolia

- [PinakionV2](https://sepolia.etherscan.io/address/0x593e89704D285B0c3fbF157c7CF2537456CE64b5)

#### Chiado

- [ArbitrableExample](https://gnosis-chiado.blockscout.com/address/0x438ca5337AE771dF926B7f4fDE1A21D72a315bDC)
Expand All @@ -22,32 +30,31 @@ Refresh the list of deployed contracts by running `./scripts/generateDeployments
- [WrappedPinakionV2](https://gnosis-chiado.blockscout.com/address/0xD75E27A56AaF9eE7F8d9A472a8C2EF2f65a764dd)
- [xKlerosLiquidV2](https://gnosis-chiado.blockscout.com/address/0x34E520dc1d2Db660113b64724e14CEdCD01Ee879)

#### Goerli

- [PinakionV2](https://goerli.etherscan.io/address/0x8EAA3Bc72CD250b9A97B255991e8E58933EFB9ee)

#### Arbitrum Goerli

- [PNK](https://goerli.arbiscan.io/token/0x3483FA1b87792cd5BE4100822C4eCEC8D3E531ee)
- [ArbitrableExample](https://goerli.arbiscan.io/address/0x983Ac51c7aDa934651dd1ee58176111FccfBFA5B)
- [BlockHashRNG](https://goerli.arbiscan.io/address/0x68eE49dfD9d76f3386257a3D0e0A85c0A5519bBD)
- [DAI](https://goerli.arbiscan.io/address/0x70A704Dce4cCC00568Cc142C86D07Ec71C944a39)
- [DAIFaucet](https://goerli.arbiscan.io/address/0xB7C693623437cC46a8E50DF234d90Ab9F57DdE63)
- [DisputeKitClassic: proxy](https://goerli.arbiscan.io/address/0x448F5B93b054BD33A765168d3447cA96D5aD4818), [implementation](https://goerli.arbiscan.io/address/0xACCeDd7cF1dAc4d0E4d149E3395F6Fe83cE7af31)
- [DisputeResolver](https://goerli.arbiscan.io/address/0xCf1da8f2b4BC9d35146433c7F69f4204Cf6b7655)
- [DisputeTemplateRegistry: proxy](https://goerli.arbiscan.io/address/0x9c0b277C0B14c80bC5c560Cd56941816B6Fe7703), [implementation](https://goerli.arbiscan.io/address/0x32D001F8Cf32086ba8937f920b2f3A2820Ba69F2)
- [EvidenceModule: proxy](https://goerli.arbiscan.io/address/0x36e1e5C2644Ec9ba0C3d85B89182f8EDD5696248), [implementation](https://goerli.arbiscan.io/address/0xa94d95084c7Cb165C565CBF4FD024Bc5e6E9DDb8)
- [KlerosCore: proxy](https://goerli.arbiscan.io/address/0x7d6b24d4DC36a6BC3F0E3B40B9383782Bcd0aDd7), [implementation](https://goerli.arbiscan.io/address/0x821af5f921E392Ce623c706CADc37d5b84ccE3C3)
- [PNKFaucet](https://goerli.arbiscan.io/address/0x28638dD9515fB1a74909C81e1c9A7cdf698Ff962)
- [PinakionV2](https://goerli.arbiscan.io/address/0x3483FA1b87792cd5BE4100822C4eCEC8D3E531ee)
- [PolicyRegistry: proxy](https://goerli.arbiscan.io/address/0x9c5dD8bBe4342dFC53f47Bd5ba0808e0B4d825e8), [implementation](https://goerli.arbiscan.io/address/0xE92BEd1c2704217b446C4a065bbAEE23D406699D)
- [RandomizerRNG: proxy](https://goerli.arbiscan.io/address/0x5BF61114fc88F405A523A410b6371Ea223785870), [implementation](https://goerli.arbiscan.io/address/0x32F0db14e66eAC97f202679cEB1DF74EA1b887D9)
- [SortitionModule: proxy](https://goerli.arbiscan.io/address/0xe2536798227fdd68fD8cf74d87D050D667eCaC0F), [implementation](https://goerli.arbiscan.io/address/0xf91915e0f20Ab032D856DC52825a281571053CDD)
- [WETH](https://goerli.arbiscan.io/address/0xddE1b84E43505432Fdf5F810ebB9373dD37e9230)
- [WETHFaucet](https://goerli.arbiscan.io/address/0x16FD9d82ccA652EE7d85443f82062013aC0A4Ab8)

### Devnet

#### Arbitrum Sepolia

- [ArbitrableExample](https://sepolia.arbiscan.io/address/0x96a29c421007Ab6d523B1743FA3f177a15063D07)
- [DAI](https://sepolia.arbiscan.io/address/0x593e89704D285B0c3fbF157c7CF2537456CE64b5)
- [DAIFaucet](https://sepolia.arbiscan.io/address/0xB5b39A1bcD2D7097A8824B3cC18Ebd2dFb0D9B5E)
- [DisputeKitClassic: proxy](https://sepolia.arbiscan.io/address/0x86Ac67e5550F837a650B4B0Cd4778D4293a2bDe3), [implementation](https://sepolia.arbiscan.io/address/0xC3dB344755b15c8Edfd834db79af4f8860029FB4)
- [DisputeResolver](https://sepolia.arbiscan.io/address/0x3E22eBE8c86a58b0BfEd5383aa9DEFB87De85034)
- [DisputeTemplateRegistry: proxy](https://sepolia.arbiscan.io/address/0xc60e862273c1eAa1F9afBC69b39cee30270A2419), [implementation](https://sepolia.arbiscan.io/address/0xeA44D4710bc804573E7d8653b88A60CaC51E3738)
- [Escrow](https://sepolia.arbiscan.io/address/0x224E52523354BEdCaFF3e98de463E829f3388f84)
- [EvidenceModule: proxy](https://sepolia.arbiscan.io/address/0x827411b3e98bAe8c441efBf26842A1670f8f378F), [implementation](https://sepolia.arbiscan.io/address/0x26c1980120F1C82cF611D666CE81D2b54d018547)
- [KlerosCore: proxy](https://sepolia.arbiscan.io/address/0x4DD8B69958eF1D7d5dA9347E9d9F57ADFC3dc284), [implementation](https://sepolia.arbiscan.io/address/0x614498118850184c62f82d08261109334bFB050f)
- [PNKFaucet](https://sepolia.arbiscan.io/address/0x7EFE468003Ad6A858b5350CDE0A67bBED58739dD)
- [PinakionV2](https://sepolia.arbiscan.io/address/0x34B944D42cAcfC8266955D07A80181D2054aa225)
- [PolicyRegistry: proxy](https://sepolia.arbiscan.io/address/0x2AC2EdFD336732bc6963f1AD03ED98B22dB949da), [implementation](https://sepolia.arbiscan.io/address/0xAA637C9E2831614158d7eB193D03af4a7223C56E)
- [RandomizerRNG: proxy](https://sepolia.arbiscan.io/address/0xA995C172d286f8F4eE137CC662e2844E59Cf4836), [implementation](https://sepolia.arbiscan.io/address/0xe62B776498F48061ef9425fCEf30F3d1370DB005)
- [SortitionModule: proxy](https://sepolia.arbiscan.io/address/0xf327200420F21BAafce8F1C03B1EEdF926074B95), [implementation](https://sepolia.arbiscan.io/address/0xb7c292cD9Fd3d20De84a71AE1caF054eEB6374A9)
- [WETH](https://sepolia.arbiscan.io/address/0x3829A2486d53ee984a0ca2D76552715726b77138)
- [WETHFaucet](https://sepolia.arbiscan.io/address/0x6F8C10E0030aDf5B8030a5E282F026ADdB6525fd)

#### Sepolia

- [PinakionV2](https://sepolia.etherscan.io/address/0x593e89704D285B0c3fbF157c7CF2537456CE64b5)

#### Chiado

- [ArbitrableExample](https://gnosis-chiado.blockscout.com/address/0xB56A23b396E0eae85414Ce5815da448ba529Cb4A)
Expand All @@ -59,30 +66,6 @@ Refresh the list of deployed contracts by running `./scripts/generateDeployments
- [WPNKFaucet](https://gnosis-chiado.blockscout.com/address/0x5898aeE045A25B276369914c3448B72a41758B2c)
- [WrappedPinakionV2](https://gnosis-chiado.blockscout.com/address/0xD75E27A56AaF9eE7F8d9A472a8C2EF2f65a764dd)

#### Goerli

- [PinakionV2](https://goerli.etherscan.io/address/0x8EAA3Bc72CD250b9A97B255991e8E58933EFB9ee)

#### Arbitrum Goerli

- [PNK](https://goerli.arbiscan.io/token/0x3483FA1b87792cd5BE4100822C4eCEC8D3E531ee)
- [ArbitrableExample](https://goerli.arbiscan.io/address/0x2f3e9594cD762d270b4546dfc62ab98dB595DA59)
- [BlockHashRNG](https://goerli.arbiscan.io/address/0xCea37c9A838831F6B4eE3BffbDC21b945113AD0C)
- [DAI](https://goerli.arbiscan.io/address/0xB755843e26F2cD1c6A46659cEBb67CcFAE0f2EeE)
- [DAIFaucet](https://goerli.arbiscan.io/address/0xCEBF1e0A5921767dd97b999ed14801A3770afAfd)
- [DisputeKitClassic: proxy](https://goerli.arbiscan.io/address/0x67f3b472F345119692d575E59190400E371946f6), [implementation](https://goerli.arbiscan.io/address/0x5a41ebCD0b78eD6C42E0AD23A7b7a8001c45bEC9)
- [DisputeResolver](https://goerli.arbiscan.io/address/0x881319f439F65e4926c08F38303FE676488914Bd)
- [DisputeTemplateRegistry: proxy](https://goerli.arbiscan.io/address/0x8d17Ed667512412D9c194d178699f68159f250A2), [implementation](https://goerli.arbiscan.io/address/0x2F4c6c23C516A9247a413186cDcA693E1C078A1D)
- [EvidenceModule: proxy](https://goerli.arbiscan.io/address/0xF679E4a92AE843fd5cD0717A7417C3A773Dfd55F), [implementation](https://goerli.arbiscan.io/address/0x5d5488ed34dC07EE547A39f6631d6f8595a7f618)
- [KlerosCore: proxy](https://goerli.arbiscan.io/address/0xB88643fd1e4351dAF9eA7292db126207FDE42e45), [implementation](https://goerli.arbiscan.io/address/0x5A8f51e70b77cCa3c309f7AC0f55f3b630D46B6c)
- [PNKFaucet](https://goerli.arbiscan.io/address/0x05648Ee14941630a649082e0dA5cb80D29cC9002)
- [PinakionV2](https://goerli.arbiscan.io/address/0x3483FA1b87792cd5BE4100822C4eCEC8D3E531ee)
- [PolicyRegistry: proxy](https://goerli.arbiscan.io/address/0x37FFaF5506BB16327B4a32191Bb39d739fCE55a3), [implementation](https://goerli.arbiscan.io/address/0x3ab4C2906E3Cbc44C3e282affDb66272BCae6482)
- [RandomizerRNG: proxy](https://goerli.arbiscan.io/address/0x105C019c2724F08BFA41Ff0D0bD77030E1DEA177), [implementation](https://goerli.arbiscan.io/address/0xc90d73C64997699d835a1122D47d4A231965740C)
- [SortitionModule: proxy](https://goerli.arbiscan.io/address/0x45480bFF7AE062205AB16f4e014ecee942640779), [implementation](https://goerli.arbiscan.io/address/0x7FebBE9de959f83D67A89ee9e4E31Cf11bC2B258)
- [WETH](https://goerli.arbiscan.io/address/0xbB5839497dE7e6d4ddaFde093F69abA9be782E07)
- [WETHFaucet](https://goerli.arbiscan.io/address/0xD2d862B060986b25996aaeDB54813002AB791013)

## Getting Started

### Install the Dependencies
Expand Down Expand Up @@ -162,18 +145,18 @@ yarn deploy --network localhost --tags <Arbitration|VeaMock|ForeignGatewayOnEthe
#### 3. Deploy to Public Testnets

```bash
# ArbitrumGoerli to Chiado
yarn deploy --network arbitrumGoerli --tags Arbitration
yarn deploy --network arbitrumGoerli --tags HomeArbitrable
# ArbitrumSepolia to Chiado
yarn deploy --network arbitrumSepolia --tags Arbitration
yarn deploy --network arbitrumSepolia --tags HomeArbitrable
yarn deploy --network chiado --tags ForeignGatewayOnGnosis
yarn deploy --network chiado --tags KlerosLiquidOnGnosis
yarn deploy --network chiado --tags ForeignArbitrable
yarn deploy --network arbitrumGoerli --tags HomeGatewayToGnosis
yarn deploy --network arbitrumSepolia --tags HomeGatewayToGnosis

# Goerli
yarn deploy --network goerli --tags ForeignGatewayOnEthereum
yarn deploy --network goerli --tags ForeignArbitrable
yarn deploy --network arbitrumGoerli --tags HomeGatewayToEthereum
# Sepolia
yarn deploy --network sepolia --tags ForeignGatewayOnEthereum
yarn deploy --network sepolia --tags ForeignArbitrable
yarn deploy --network arbitrumSepolia --tags HomeGatewayToEthereum
```

The deployed addresses should be displayed to the screen after the deployment is complete. If you missed them, you can always go to the `deployments/<network>` directory and look for the respective file.
Expand Down Expand Up @@ -202,10 +185,11 @@ This must be done for each network separately.

```bash
# explorer
yarn etherscan-verify --network <arbitrumGoerli|arbitrum|chiado|gnosischain|goerli|mainnet>
yarn etherscan-verify --network <arbitrumSepolia|arbitrum|chiado|gnosischain|sepolia|mainnet>
yarn etherscan-verify-proxies

# sourcify
yarn sourcify --network <arbitrumGoerli|arbitrum|chiado|gnosischain|goerli|mainnet>
yarn sourcify --network <arbitrumSepolia|arbitrum|chiado|gnosischain|sepolia|mainnet>

```

Expand Down Expand Up @@ -245,8 +229,8 @@ yarn hardhat run scripts/populatePolicyRegistry.ts --network localhost
#### 3/ Import the data to V2 - Public Testnet

```bash
yarn hardhat run scripts/populateCourts.ts --network arbitrumGoerli
yarn hardhat run scripts/populatePolicyRegistry.ts --network arbitrumGoerli
yarn hardhat run scripts/populateCourts.ts --network arbitrumSepolia
yarn hardhat run scripts/populatePolicyRegistry.ts --network arbitrumSepolia
```

### Generate deployment artifacts for existing contracts
Expand All @@ -268,6 +252,6 @@ scripts/generateDeploymentArtifact.sh gnosischain 0xf8d1677c8a0c961938bf2f9adc3f
Ensure that your `$TENDERLY_PROJECT` and `$TENDERLY_USERNAME` is set correctly in `.env`.

```bash
yarn tenderly-verify --network goerli
yarn tenderly-verify --network arbitrumGoerli
yarn tenderly-verify --network sepolia
yarn tenderly-verify --network arbitrumSepolia
```
9 changes: 4 additions & 5 deletions contracts/deploy/00-ethereum-pnk.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";
import disputeTemplate from "../test/fixtures/DisputeTemplate.simple.json";
import { isSkipped } from "./utils";
import { ForeignChains, HardhatChain, isSkipped } from "./utils";

enum Chains {
GOERLI = 5,
HARDHAT = 31337,
SEPOLIA = ForeignChains.ETHEREUM_SEPOLIA,
HARDHAT = HardhatChain.HARDHAT,
}

const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
Expand All @@ -15,7 +14,7 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment)
// fallback to hardhat node signers on local network
const deployer = (await getNamedAccounts()).deployer ?? (await hre.ethers.getSigners())[0].address;
const chainId = Number(await getChainId());
console.log("Deploying to %s with deployer %s", Chains[chainId], deployer);
console.log("deploying to %s with deployer %s", Chains[chainId], deployer);

await deploy("PinakionV2", {
from: deployer,
Expand Down
15 changes: 14 additions & 1 deletion contracts/deploy/00-home-chain-arbitrable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment)
// fallback to hardhat node signers on local network
const deployer = (await getNamedAccounts()).deployer ?? (await hre.ethers.getSigners())[0].address;
const chainId = Number(await getChainId());
console.log("Deploying to %s with deployer %s", HomeChains[chainId], deployer);
console.log("deploying to %s with deployer %s", HomeChains[chainId], deployer);

const klerosCore = await deployments.get("KlerosCore");
const extraData =
Expand Down Expand Up @@ -42,6 +42,19 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment)
args: [klerosCore.address, disputeTemplateRegistry.address],
log: true,
});

await deploy("Escrow", {
from: deployer,
args: [
klerosCore.address,
extraData,
disputeTemplate, // TODO: use an Escrow-specific dispute template
"disputeTemplateMapping: TODO",
disputeTemplateRegistry.address,
600, // feeTimeout: 10 minutes
],
log: true,
});
};

deployArbitration.tags = ["HomeArbitrable"];
Expand Down
Loading