diff --git a/CLAUDE.md b/CLAUDE.md index 661acf6..8a28154 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -143,7 +143,7 @@ Admin commands via `indexer_state` table: rescan from height, retry failed block Refreshes `daily_stats` table after each batch. ## QFC-Specific Notes -- **EVM version**: QFC does NOT support PUSH0. Always `evmVersion: "paris"`. +- **EVM version**: QFC runs Cancun spec. Default `evmVersion: "cancun"`. Supports PUSH0, MCOPY, TSTORE/TLOAD. - **eth_call quirk**: QFC testnet may return `0x` for view functions. Use `eth_getStorageAt` as workaround. - **Proxy detection**: Reads EIP-1967/1822/Beacon storage slots to identify proxy contracts. - **Custom RPC methods**: `qfc_getEpoch`, `qfc_getValidators`, `qfc_getNodeInfo`, `qfc_getInferenceStats`, `qfc_getSupportedModels`, etc. diff --git a/src/lib/vyper-compiler.ts b/src/lib/vyper-compiler.ts index 7b82e80..a9a49b1 100644 --- a/src/lib/vyper-compiler.ts +++ b/src/lib/vyper-compiler.ts @@ -33,7 +33,7 @@ function exec(cmd: string, args: string[], timeout = 60_000): Promise<{ stdout: export async function compileVyper( source: string, version: string, - evmVersion: string = 'paris', + evmVersion: string = 'cancun', ): Promise { const tmpDir = await mkdtemp(join(tmpdir(), 'vyper-')); const srcPath = join(tmpDir, 'contract.vy'); diff --git a/src/routes/contracts.ts b/src/routes/contracts.ts index 71031f9..6496cbe 100644 --- a/src/routes/contracts.ts +++ b/src/routes/contracts.ts @@ -400,7 +400,7 @@ export default async function contractsRoutes(app: FastifyInstance) { // Dynamic import solc (optional dependency) // eslint-disable-next-line @typescript-eslint/no-require-imports const solc = await import(/* webpackIgnore: true */ 'solc' as string) as { compile: (input: string) => string }; - const evmVersion = body.evmVersion || 'paris'; + const evmVersion = body.evmVersion || 'cancun'; const input = JSON.stringify({ language: 'Solidity', sources: { 'contract.sol': { content: body.sourceCode } }, @@ -506,8 +506,8 @@ export default async function contractsRoutes(app: FastifyInstance) { // Ensure output selection includes what we need if (!jsonInput.settings) jsonInput.settings = {}; jsonInput.settings.outputSelection = { '*': { '*': ['abi', 'evm.bytecode', 'evm.deployedBytecode'] } }; - // QFC: always paris - if (!jsonInput.settings.evmVersion) jsonInput.settings.evmVersion = 'paris'; + // QFC: default to cancun + if (!jsonInput.settings.evmVersion) jsonInput.settings.evmVersion = 'cancun'; const solc = await import(/* webpackIgnore: true */ 'solc' as string) as { compile: (input: string) => string }; const output = JSON.parse(solc.compile(JSON.stringify(jsonInput))); @@ -617,7 +617,7 @@ export default async function contractsRoutes(app: FastifyInstance) { try { const solc = await import(/* webpackIgnore: true */ 'solc' as string) as { compile: (input: string) => string }; - const evmVersion = body.evm_version || 'paris'; + const evmVersion = body.evm_version || 'cancun'; const optimizationRuns = body.optimization_runs ?? null; // Build Solidity Standard JSON Input from multi-file sources @@ -764,7 +764,7 @@ export default async function contractsRoutes(app: FastifyInstance) { } try { - const evmVersion = body.evm_version || 'paris'; + const evmVersion = body.evm_version || 'cancun'; const result = await compileVyper(body.source_code, body.compiler_version, evmVersion); if ('error' in result) { diff --git a/src/routes/etherscan.ts b/src/routes/etherscan.ts index 9784cb9..2b59dbd 100644 --- a/src/routes/etherscan.ts +++ b/src/routes/etherscan.ts @@ -599,8 +599,8 @@ async function handleVerifySourceCode(params: Record): Promise('eth_getCode', [address, 'latest']);