docs/design/execution-layer.md section 10: what the execution-layer branch implements (D1 to D10, RPC, differential), the devnet rules fixed there, what is missing, the merge plan with the finality branch. docs/bench-log.md: the 3-node simnet run with numbers. tools/evm-smoke: viem 2.57 smoke test (fund, 50 transfers, duplicates in parallel blocks, contract deploy and call, state roots across nodes, export for igneum-exec-diff) and the solc build of DeveloperRegistry and the Counter test contract. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
28 lines
2 KiB
JavaScript
28 lines
2 KiB
JavaScript
// Compiles igneum/exec/contracts/DeveloperRegistry.sol and the smoke-test Counter contract with solc-js and writes
|
|
// the runtime bytecode next to the source (the execution crate embeds it with include_str!).
|
|
import solc from 'solc';
|
|
import { readFileSync, writeFileSync } from 'node:fs';
|
|
import { fileURLToPath } from 'node:url';
|
|
import path from 'node:path';
|
|
|
|
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
const registrySrc = path.resolve(here, '../../vendor/igneum-node-exec/igneum/exec/contracts/DeveloperRegistry.sol');
|
|
const sources = {
|
|
'DeveloperRegistry.sol': { content: readFileSync(registrySrc, 'utf8') },
|
|
'Counter.sol': { content: readFileSync(path.join(here, 'Counter.sol'), 'utf8') },
|
|
};
|
|
const input = {
|
|
language: 'Solidity',
|
|
sources,
|
|
settings: { optimizer: { enabled: true, runs: 200 }, evmVersion: 'cancun', outputSelection: { '*': { '*': ['abi', 'evm.bytecode.object', 'evm.deployedBytecode.object'] } } },
|
|
};
|
|
const out = JSON.parse(solc.compile(JSON.stringify(input)));
|
|
for (const e of out.errors ?? []) { console.error(e.formattedMessage); if (e.severity === 'error') process.exit(1); }
|
|
const reg = out.contracts['DeveloperRegistry.sol'].DeveloperRegistry;
|
|
const header = `// solc ${solc.version()} optimizer 200 runs evmVersion cancun; source DeveloperRegistry.sol\n`;
|
|
writeFileSync(path.join(path.dirname(registrySrc), 'DeveloperRegistry.bin-runtime'), reg.evm.deployedBytecode.object + '\n');
|
|
writeFileSync(path.join(path.dirname(registrySrc), 'DeveloperRegistry.abi.json'), JSON.stringify(reg.abi, null, 1) + '\n');
|
|
writeFileSync(path.join(path.dirname(registrySrc), 'DeveloperRegistry.compiler.txt'), header);
|
|
const counter = out.contracts['Counter.sol'].Counter;
|
|
writeFileSync(path.join(here, 'counter.json'), JSON.stringify({ abi: counter.abi, bytecode: '0x' + counter.evm.bytecode.object }, null, 1) + '\n');
|
|
console.log('solc', solc.version(), 'registry runtime bytes', reg.evm.deployedBytecode.object.length / 2, 'counter creation bytes', counter.evm.bytecode.object.length / 2);
|