Skip to content
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
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/lib/vyper-compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<VyperCompileResult | VyperCompileError> {
const tmpDir = await mkdtemp(join(tmpdir(), 'vyper-'));
const srcPath = join(tmpDir, 'contract.vy');
Expand Down
10 changes: 5 additions & 5 deletions src/routes/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 } },
Expand Down Expand Up @@ -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)));
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions src/routes/etherscan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -599,8 +599,8 @@ async function handleVerifySourceCode(params: Record<string, string>): Promise<E
const optimizationUsed = params.optimizationUsed || params.optimizationused || '0';
const runs = parseInt(params.runs || '200', 10);
const constructorArgs = params.constructorArguements || params.constructorarguments || '';
// QFC does NOT support PUSH0 — always force paris
const evmVersion = 'paris';
// QFC EVM runs Cancun spec (PUSH0, MCOPY, TSTORE/TLOAD supported)
const evmVersion = 'cancun';

// Fetch deployed bytecode from chain
const deployedCode = await rpcCallSafe<string>('eth_getCode', [address, 'latest']);
Expand Down
Loading