Skip to content
Open
Show file tree
Hide file tree
Changes from 5 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
1 change: 1 addition & 0 deletions contracts/.env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
PRIVATE_KEY='<0x encoded private key>'
ALCHEMY_API_KEY=''
INFURA_API_KEY='<key>'
ETHERSCAN_API_KEY='<key>'
GNOSISSCAN_API_KEY='<key>'
Expand Down
8 changes: 7 additions & 1 deletion contracts/deploy/foreign/optimism.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ const foreignParameters = {
foreignBridge: "0x448A37330A60494E666F6DD60aD48d930AEbA381",
variant: "Unichain",
},
baseSepolia: {
numberOfJurors: 1,
// https://docs.base.org/base-chain/network-information/base-contracts
foreignBridge: "0xC34855F4De64F1840e5686e64278da901e261f20",
variant: "Base",
},
optimismSepolia: {
numberOfJurors: 1,
// https://docs.optimism.io/chain/addresses
Expand All @@ -34,7 +40,7 @@ const foreignParameters = {
},
base: {
numberOfJurors: 15,
// https://docs.base.org/docs/base-contracts#l1-contract-addresses
// https://docs.base.org/base-chain/network-information/base-contracts
foreignBridge: "0x866E82a600A1414e583f7F13623F1aC5d58b0Afa",
variant: "Base",
},
Expand Down
6 changes: 5 additions & 1 deletion contracts/deploy/home/optimism.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { realityETHConfig } = require("@reality.eth/contracts");
const { homeChains, generateMetadata } = require("../shared");
const { unichain, optimism, redstone, unichainSepolia, optimismSepolia, base } = homeChains;
const { unichain, optimism, redstone, unichainSepolia, optimismSepolia, base, baseSepolia } = homeChains;

// CrossDomainMessenger precompile is identical for all OP L2s
// Redstone Messenger - https://redstone.xyz/docs/contract-addresses
Expand All @@ -13,6 +13,10 @@ const homeParameters = {
realitio: realityETHConfig(unichainSepolia.chainId, "ETH", "3.0").address,
variant: "Unichain",
},
[baseSepolia.chainId]: {
realitio: "0x86b653Dc9aa6d7311109276925927087573f91CB",
variant: "Base",
},
Comment on lines +16 to +19
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

# First, check if node_modules exists and examine the reality.eth config
if [ -f "node_modules/@reality.eth/contracts/config.json" ]; then
  echo "=== Reality.eth config found ==="
  cat node_modules/@reality.eth/contracts/config.json | jq '.' || cat node_modules/@reality.eth/contracts/config.json
else
  echo "Config file not found at expected location"
  # Try to find the package
  find . -name "@reality.eth" -type d 2>/dev/null | head -5
fi

Repository: kleros/cross-chain-realitio-proxy

Length of output: 119


🏁 Script executed:

# Examine the optimism.js file to understand the context and pattern
wc -l contracts/deploy/home/optimism.js
head -50 contracts/deploy/home/optimism.js

Repository: kleros/cross-chain-realitio-proxy

Length of output: 2021


🏁 Script executed:

# Search for realityETHConfig usage in the codebase
rg "realityETHConfig" -A 3 -B 1

Repository: kleros/cross-chain-realitio-proxy

Length of output: 7137


🏁 Script executed:

# Verify the baseSepolia chainId and search for any comments about why it's hardcoded
rg "baseSepolia" -A 2 -B 2

Repository: kleros/cross-chain-realitio-proxy

Length of output: 6398


🏁 Script executed:

# Check package.json for @reality.eth/contracts version and any related comments
cat contracts/package.json | jq '.dependencies | select(.["@reality.eth/contracts"])'

Repository: kleros/cross-chain-realitio-proxy

Length of output: 59


🏁 Script executed:

# Search for any comments or documentation about baseSepolia or the hardcoded address
rg "0x86b653Dc9aa6d7311109276925927087573f91CB" -B 5 -A 5

Repository: kleros/cross-chain-realitio-proxy

Length of output: 1856


🏁 Script executed:

# Look for any historical context or TODOs related to baseSepolia Realitio
rg "baseSepolia|Base.*Sepolia" contracts/deploy/home/ -A 3 -B 1

Repository: kleros/cross-chain-realitio-proxy

Length of output: 839


Add documentation for the hardcoded baseSepolia Realitio address.

baseSepolia is the only network in this file using a hardcoded Realitio address (0x86b653Dc9aa6d7311109276925927087573f91CB) instead of realityETHConfig(chainId, "ETH", "3.0").address like unichainSepolia, optimismSepolia, and other networks. The address is confirmed deployed and active, but lacks explanation for why hardcoding is necessary. Add a comment clarifying whether this is due to baseSepolia being unsupported by the @reality.eth/contracts library or if this is an intentional custom deployment.

🤖 Prompt for AI Agents
In contracts/deploy/home/optimism.js around lines 16–19, the baseSepolia entry
uses a hardcoded Realitio address without explanation; add a concise comment
above that object explaining why it's hardcoded (state whether baseSepolia is
unsupported by @reality.eth/contracts, or this is a deliberate custom
deployment), include provenance (transaction/verification link or reference to
how the address was confirmed) and note whether switching to
realityETHConfig(chainId, "ETH", "3.0").address was considered and why it was
not used; ensure the comment is one or two lines and clear for future
maintainers.

[optimismSepolia.chainId]: {
realitio: realityETHConfig(optimismSepolia.chainId, "ETH", "3.0").address,
variant: "Optimism",
Expand Down
1 change: 1 addition & 0 deletions contracts/deployments/baseSepolia/.chainId
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
84532
Loading
Loading