Skip to content

Commit

Permalink
Merge pull request #334 from kleros/feat/support-sepolia
Browse files Browse the repository at this point in the history
feat: support for curate v1 in sepolia
  • Loading branch information
kemuru authored Jun 6, 2024
2 parents 9e0914c + 9600ca7 commit a48d49f
Show file tree
Hide file tree
Showing 10 changed files with 70 additions and 117 deletions.
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ REACT_APP_REJECT_ALL_POLICY_URI="/ipfs/QmZ7RVU7re1g8nXDbAFMHV99pyie3dn4cY7Ga2X4h
REACT_APP_WALLETCONNECT_BRIDGE_URL=https://bridge.walletconnect.org
REACT_APP_NOTIFICATIONS_API_URL=http://localhost:3001
# JSON string mapping networkID to JSON RPC url.
# Example: REACT_APP_RPC_URLS={"1":"https://mainnet.infura.io/v3/1337deadbeef...", "5":"https://goerli.infura.io/v3/1337deadbeef..."}
REACT_APP_RPC_URLS={"100":"https://rpc.gnosischain.com","1":"https://mainnet.infura.io/v3/","5":"https://goerli.infura.io/v3/"}
# Example: REACT_APP_RPC_URLS={"1":"https://mainnet.infura.io/v3/1337deadbeef...", "11155111":"https://sepolia.infura.io/v3/1337deadbeef..."}
REACT_APP_RPC_URLS={"100":"https://rpc.gnosischain.com","1":"https://mainnet.infura.io/v3/","11155111":"https://sepolia.infura.io/v3/"}

# JSON string mapping networkID to Fortmatic api key.
# Example: REACT_APP_FORMATIC_API_KEYS={"1":"pk_live_FCEE7548E5...", "42":"pk_live_0916382..."}
Expand Down
8 changes: 1 addition & 7 deletions src/config/connectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,7 @@ if (fortmaticApiKey)

if (window.ethereum)
connectors.Injected = new InjectedConnector({
supportedNetworks: [
NETWORKS.ethereum,
NETWORKS.kovan,
NETWORKS.gnosis,
NETWORKS.goerli,
NETWORKS['arbitrum-rinkeby']
]
supportedNetworks: [NETWORKS.ethereum, NETWORKS.gnosis, NETWORKS.sepolia]
})

export default connectors
77 changes: 17 additions & 60 deletions src/config/networks.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
export const NETWORKS = Object.freeze({
ethereum: 1,
gnosis: 100,
rinkeby: 4,
kovan: 42,
goerli: 5,
'arbitrum-rinkeby': 421611
sepolia: 11155111
})

export const DEFAULT_NETWORK = NETWORKS.ethereum
Expand Down Expand Up @@ -41,27 +38,6 @@ export const NETWORKS_INFO = Object.freeze({
],
infoURL: 'https://ethereum.org'
},
[NETWORKS.goerli]: {
name: 'Ethereum Goerli',
color: '#29b6af',
supported: true,
chainId: 5,
shortName: 'goerlieth',
chain: 'GoerliETH',
network: 'goerli',
networkId: 5,
nativeCurrency: { name: 'GoerliEther', symbol: 'GoerliETH', decimals: 18 },
rpc: [RPC_URLS[NETWORKS.goerli]],
faucets: [],
explorers: [
{
name: 'etherscan',
url: 'https://goerli.etherscan.io',
standard: 'EIP3091'
}
],
infoURL: 'https://ethereum.org'
},
[NETWORKS.gnosis]: {
name: 'Gnosis Chain',
color: '#48A9A6',
Expand Down Expand Up @@ -91,49 +67,30 @@ export const NETWORKS_INFO = Object.freeze({
],
infoURL: 'https://forum.poa.network/c/xdai-chain'
},
// [NETWORKS.ropsten]: {
// name: 'Ropsten',
// color: '#ff4a8d',
// },
[NETWORKS.rinkeby]: {
name: 'Rinkeby',
color: '#f6c343'
},
// [NETWORKS.goerli]: {
// name: 'Göerli',
// color: '#3099f2',
// },
[NETWORKS.kovan]: {
name: 'Kovan',
color: '#690496',
explorers: [
{
name: 'etherscan',
url: 'https://kovan.etherscan.io',
standard: 'EIP3091'
}
]
},
[NETWORKS['arbitrum-rinkeby']]: {
name: 'Arbitrum Rinkeby',
[NETWORKS.sepolia]: {
name: 'Ethereum Sepolia',
color: '#29b6af',
supported: true,
chainId: 421611,
shortName: 'arb-rinkeby',
chain: 'ArbitrumRinkeby',
network: 'arbitrum-rinkeby',
networkId: 421611,
nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 },
rpc: [RPC_URLS[NETWORKS['arbitrum-rinkeby']]],
chainId: 5,
shortName: 'sepoliaeth',
chain: 'SepoliaETH',
network: 'sepolia',
networkId: 5,
nativeCurrency: {
name: 'SepoliaEther',
symbol: 'SepoliaEther',
decimals: 18
},
rpc: [RPC_URLS[NETWORKS.sepolia]],
faucets: [],
explorers: [
{
name: 'arbiscan',
url: 'https://testnet.arbiscan.io',
name: 'etherscan',
url: 'https://sepolia.etherscan.io',
standard: 'EIP3091'
}
],
infoURL: 'https://bridge.arbitrum.io/'
infoURL: 'https://ethereum.org'
}
})

Expand Down
76 changes: 39 additions & 37 deletions src/config/tcr-addresses.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
export type validChains = '1' | '5' | '100' | 1 | 5 | 100
export type validChains = '1' | '100' | '11155111' | 1 | 100 | 11155111

export const defaultTcrAddresses = {
'1': '0xba0304273a54dfec1fc7f4bccbf4b15519aecf15',
'5': '0x445eceA26d5ec40E177e6Ca2734821D8430a9C1A',
'100': '0x2442D40B0aeCad0298C2724A97F2f1BbDF2C2615'
'100': '0x2442D40B0aeCad0298C2724A97F2f1BbDF2C2615',
'11155111': '0xD965Ce430afE0423Ff19A5eb08F7C5722EFabCaF'
} as const

export const defaultEvidenceDisplayUri = {
'1': '/ipfs/QmQjJio59WkrQDzPC5kSP3EiGaqrWxjGfkvhmD2mWwm41M/index.html',
'5': '/ipfs/QmQjJio59WkrQDzPC5kSP3EiGaqrWxjGfkvhmD2mWwm41M/index.html',
'100': '/ipfs/QmNhJXtMrxeJu4fpchPruGrL93bm2M4VmDZ8pj4x6FqnHJ/index.html'
'100': '/ipfs/QmNhJXtMrxeJu4fpchPruGrL93bm2M4VmDZ8pj4x6FqnHJ/index.html',
'11155111': '/ipfs/QmQjJio59WkrQDzPC5kSP3EiGaqrWxjGfkvhmD2mWwm41M/index.html'
} as const

export const defaultEvidenceDisplayUriClassic = {
Expand All @@ -18,52 +18,53 @@ export const defaultEvidenceDisplayUriClassic = {

export const gtcrViewAddresses = {
'1': '0xe75a12f40da77d285c08a44f499e597bc5085658',
'5': '0xc0DEc3faBaEC835aC77F1dE683Ce978677fd2217',
'100': '0x27BC296DC0b8a6c3cD39326aE9EC14604e96f7BF'
'100': '0x27BC296DC0b8a6c3cD39326aE9EC14604e96f7BF',
'11155111': '0x20E1D44c64Ec03ECe12133743bEc7019f3aAe373'
} as const

export const lightGtcrViewAddresses = {
'1': '0xe82a69e939e1aB6Dc1868262cfe444F70098cCC8',
'5': '0x9738E402fEb8B306cE7C707Ec4ad6D66595A5EF6',
'100': '0xB32e38B08FcC7b7610490f764b0F9bFd754dCE53'
'100': '0xB32e38B08FcC7b7610490f764b0F9bFd754dCE53',
'11155111': '0x87f58F0dCF3c99BA2F3eB0604e5c335893e2EAf9'
} as const

export const batchWithdrawAddresses = {
'1': '0x38aa214dc986d0bab53e5861071f3d5a56066b4d',
'5': '0x2d4d822CE88947F8C2b250ADcd684ea52dAFEaa7'
'11155111': '0xb01C9DE0e9dE0a6cAb6df586484707b7078De684'
} as const

export const lightBatchWithdrawAddresses = {
'1': '0x5C6363cFA9462Ae11e22d2A5A0eb15dbB8719E4A',
'5': '0xBA4F30b3ae9d923fC5f82AE7d965c619F92DFffA',
'100': '0x36B00c87553330E4351ED0CB287ed3917c12a197'
'100': '0x36B00c87553330E4351ED0CB287ed3917c12a197',
'11155111': '0x43458fa7b40Fd7Bb32cC3a2b95186F91A95Ef0c8'
} as const

export const factoryAddresses = {
'1': '0xe9dd523600b74b8ef0af164687079a6c437f9cd5',
'5': '0x9AaD77bAb5F18165F9Ca81dA9c3D392D9E382c23',
'100': '0x794Cee5a6e1501b633eC13b8c1e327d9860FE039'
'100': '0x794Cee5a6e1501b633eC13b8c1e327d9860FE039',
'11155111': '0xcB4B48d2A7a44247A00048963F169d2b4Ab045a6'
} as const

export const lgtcrFactoryAddresses = {
'1': '0xb9dDC813AcAF3fD7aBC4C16735A09Bc1C0EE0054',
'5': '0x55A3d9Bd99F286F1817CAFAAB124ddDDFCb0F314',
'100': '0x08e58Bc26CFB0d346bABD253A1799866F269805a'
'100': '0x08e58Bc26CFB0d346bABD253A1799866F269805a',
'11155111': '0x3FB8314C628E9afE7677946D3E23443Ce748Ac17'
} as const

export const defaultGovernor = {
'1': {
address: '0x3a7edc1eb16cb454e4964ec51642f7d7b35b5292',
label: 'Kleros Governor'
},
'5': {
address: '0xd74AB183e2B793A68cB3e647D8f4Df60936B59cA',
label: 'Goerli Kleros Governor'
},
'100': {
label:
'This is an EOA governor (you probably want to use your own address)',
address: '0xdC8C1a8CB38F27C188a43CE0eBBC8e42e393D0d3'
},
'11155111': {
label:
'This is an EOA governor (you probably want to use your own address)',
address: '0xdC8C1a8CB38F27C188a43CE0eBBC8e42e393D0d3'
}
} as const

Expand All @@ -72,13 +73,13 @@ export const defaultArbitrator = {
label: 'Kleros',
address: '0x988b3A538b618C7A603e1c11Ab82Cd16dbE28069'
},
'5': {
label: 'Kleros',
address: '0x1128eD55ab2d796fa92D2F8E1f336d745354a77A'
},
'100': {
label: 'Kleros',
address: '0x9C1dA9A04925bDfDedf0f6421bC7EEa8305F9002'
},
'11155111': {
label: 'Kleros',
address: '0x90992fb4e15ce0c59aeffb376460fda4ee19c879'
}
} as const

Expand All @@ -89,17 +90,17 @@ export const defaultArbitratorExtraData = {
data:
'0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003'
},
'5': {
'100': {
label:
'This defines to which court and how many jurors to use for the initial dispute.',
data:
'0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001'
'0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000003'
},
'100': {
'11155111': {
label:
'This defines to which court and how many jurors to use for the initial dispute.',
data:
'0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000003'
'0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001'
}
} as const

Expand All @@ -109,28 +110,29 @@ export const klerosAddresses = {
policy: '0xCf1f07713d5193FaE5c1653C9f61953D048BECe4',
uiURL: 'https://court.kleros.io/cases/:disputeID'
},
'5': {
arbitrator: '0x1128eD55ab2d796fa92D2F8E1f336d745354a77A',
policy: '0x2692c903e6bfcc1420b7396ad2841bc199a3bd9f',
uiURL: 'https://court.kleros.io/cases/:disputeID'
},
'100': {
arbitrator: '0x9C1dA9A04925bDfDedf0f6421bC7EEa8305F9002',
policy: '0x9d494768936b6bDaabc46733b8D53A937A6c6D7e',
uiURL: 'https://court.kleros.io/cases/:disputeID'
},
'11155111': {
arbitrator: '0x90992fb4e15ce0c59aeffb376460fda4ee19c879',
policy: '0x88Fb25D399310c07d35cB9091b8346d8b1893aa5',
uiURL: 'https://court.kleros.io/cases/:disputeID'
}
} as const

export const txBatcherAddresses = {
'1': '0x82458d1c812d7c930bb3229c9e159cbabd9aa8cb',
'5': '0x394E870A068E9C623aC6Bc51d53cc4a040420e8e',
'100': '0xD7572AD1523F3f116258b8d9dDeBA1d5e76235ac'
'100': '0xD7572AD1523F3f116258b8d9dDeBA1d5e76235ac',
'11155111': '0xb5418fc9b536c52c635b4c3a2978de7165b67318'
} as const

export const subgraphUrl = {
'1':
'https://api.studio.thegraph.com/query/61738/legacy-curate-mainnet/version/latest',
'5': 'https://api.thegraph.com/subgraphs/name/kleros/curate-goerli',
'100':
'https://api.studio.thegraph.com/query/61738/legacy-curate-gnosis/version/latest'
'https://api.studio.thegraph.com/query/61738/legacy-curate-gnosis/version/latest',
'11155111':
'https://api.studio.thegraph.com/query/61738/legacy-curate-sepolia/version/latest'
} as const
12 changes: 6 additions & 6 deletions src/hooks/light-tcr-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ import { parseIpfs } from 'utils/ipfs-parse'
export const fetchMetaEvidence = async (tcr, networkId) => {
const query = {
query: `{
lregistry(id: "${tcr.toLowerCase()}") {
registrationMetaEvidence {
URI
lregistry(id: "${tcr.toLowerCase()}") {
registrationMetaEvidence {
URI
}
connectedTCR
}
connectedTCR
}
}`
}`
}

const response = await fetch(subgraphUrl[networkId], {
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/notifications-web3.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ const useNotificationWeb3 = () => {
notification.error({
message: 'Authorization failed',
description:
'Please ensure your wallet is set to either Mainnet, Gnosis Chain, or Goerli and authorize the request.',
'Please ensure your wallet is set to either Mainnet, Gnosis Chain, or Sepolia and authorize the request.',
duration: 15,
key: NOTIFICATION_KEY
})
Expand Down
2 changes: 1 addition & 1 deletion src/pages/factory-classic/rel-tcr-params.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ const RelTCRParams = ({
<br />
Click{' '}
<a
href="https://ipfs.kleros.io/ipfs/QmUPsjDcKxNv6z6ktnmxkSb4LpqmQ7DT12yG5B73z9uLEy/curated-lists-primary-document.pdf"
href="https://cdn.kleros.link/ipfs/QmUPsjDcKxNv6z6ktnmxkSb4LpqmQ7DT12yG5B73z9uLEy/curated-lists-primary-document.pdf"
target="_blank"
rel="noopener noreferrer"
>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/factory-classic/tcr-params.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ const TCRParams = ({
<br />
Click{' '}
<a
href="https://ipfs.kleros.io/ipfs/QmUPsjDcKxNv6z6ktnmxkSb4LpqmQ7DT12yG5B73z9uLEy/curated-lists-primary-document.pdf"
href="https://cdn.kleros.link/ipfs/QmUPsjDcKxNv6z6ktnmxkSb4LpqmQ7DT12yG5B73z9uLEy/curated-lists-primary-document.pdf"
target="_blank"
rel="noopener noreferrer"
>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/factory/rel-tcr-params.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ const RelTCRParams = ({
<br />
Click{' '}
<a
href="https://ipfs.kleros.io/ipfs/QmUPsjDcKxNv6z6ktnmxkSb4LpqmQ7DT12yG5B73z9uLEy/curated-lists-primary-document.pdf"
href="https://cdn.kleros.link/ipfs/QmUPsjDcKxNv6z6ktnmxkSb4LpqmQ7DT12yG5B73z9uLEy/curated-lists-primary-document.pdf"
target="_blank"
rel="noopener noreferrer"
>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/factory/tcr-params.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ const TCRParams = ({
<br />
Click{' '}
<a
href="https://ipfs.kleros.io/ipfs/QmUPsjDcKxNv6z6ktnmxkSb4LpqmQ7DT12yG5B73z9uLEy/curated-lists-primary-document.pdf"
href="https://cdn.kleros.link/ipfs/QmUPsjDcKxNv6z6ktnmxkSb4LpqmQ7DT12yG5B73z9uLEy/curated-lists-primary-document.pdf"
target="_blank"
rel="noopener noreferrer"
>
Expand Down

0 comments on commit a48d49f

Please sign in to comment.