Skip to content

Commit 1ef5b12

Browse files
sktbrdclaude
andcommitted
fix(stake): require ETHERSCAN_API_KEY (BASESCAN key is Base-only, spams NOTOK)
Prod diagnostic showed esk=n bsk=Y — only the Base-only BASESCAN key is set, so the mainnet Etherscan call gets NOTOK and keeps tripping 'too many invalid api key attempts'. Only read ETHERSCAN_API_KEY (a real etherscan.io mainnet key); set it in Vercel to light up the MOR streams. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent fb47e01 commit 1ef5b12

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/services/stake-graph.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,10 @@ async function getEthUsd(): Promise<number> {
139139
// which the free RPCs block for eth_getLogs (that silently emptied this scan in
140140
// prod). One unified key covers every chain (chainid=1 here).
141141
const sleep = (ms: number) => new Promise((r) => setTimeout(r, ms));
142-
const ETHERSCAN_KEY = process.env.ETHERSCAN_API_KEY || process.env.BASESCAN_API_KEY;
142+
// Must be a MAINNET-capable key from etherscan.io. The repo's BASESCAN_API_KEY
143+
// is Basescan-only → chainid=1 returns "NOTOK / invalid api key", so it's NOT a
144+
// usable fallback here; set ETHERSCAN_API_KEY explicitly in the env.
145+
const ETHERSCAN_KEY = process.env.ETHERSCAN_API_KEY;
143146
const USER_REFERRED_SIG = keccak256(toHex("UserReferred(uint256,address,address,uint256)"));
144147
const pad32 = (a: Address) => `0x000000000000000000000000${a.slice(2).toLowerCase()}`;
145148

0 commit comments

Comments
 (0)