Skip to content

Commit

Permalink
fix: correct contract name
Browse files Browse the repository at this point in the history
  • Loading branch information
alexghr committed Aug 13, 2024
1 parent 88f9d34 commit 8aef043
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
16 changes: 8 additions & 8 deletions yarn-project/cli/src/cmds/l1/deploy_l1_verifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import solc from 'solc';
import { getContract } from 'viem';
import { mnemonicToAccount, privateKeyToAccount } from 'viem/accounts';

export async function deployUltraVerifier(
export async function deployUltraHonkVerifier(
ethRpcUrl: string,
privateKey: string,
mnemonic: string,
Expand All @@ -26,13 +26,13 @@ export async function deployUltraVerifier(
const { BBCircuitVerifier } = await import('@aztec/bb-prover');

const circuitVerifier = await BBCircuitVerifier.new({ bbBinaryPath, bbWorkingDirectory });
const contractSrc = await circuitVerifier.generateSolidityContract('RootRollupArtifact', 'UltraVerifier.sol');
log('Generated UltraVerifier contract');
const contractSrc = await circuitVerifier.generateSolidityContract('RootRollupArtifact', 'UltraHonkVerifier.sol');
log('Generated UltraHonkVerifier contract');

const input = {
language: 'Solidity',
sources: {
'UltraVerifier.sol': {
'UltraHonkVerifier.sol': {
content: contractSrc,
},
},
Expand All @@ -52,18 +52,18 @@ export async function deployUltraVerifier(
};

const output = JSON.parse(solc.compile(JSON.stringify(input)));
log('Compiled UltraVerifier');
log('Compiled UltraHonkVerifier');

const abi = output.contracts['UltraVerifier.sol']['UltraVerifier'].abi;
const bytecode: string = output.contracts['UltraVerifier.sol']['UltraVerifier'].evm.bytecode.object;
const abi = output.contracts['UltraHonkVerifier.sol']['UltraHonkVerifier'].abi;
const bytecode: string = output.contracts['UltraHonkVerifier.sol']['HonkVerifier'].evm.bytecode.object;

const account = !privateKey
? mnemonicToAccount(mnemonic!)
: privateKeyToAccount(`${privateKey.startsWith('0x') ? '' : '0x'}${privateKey}` as `0x${string}`);
const { publicClient, walletClient } = createL1Clients(ethRpcUrl, account);

const verifierAddress = await deployL1Contract(walletClient, publicClient, abi, `0x${bytecode}`);
log(`Deployed UltraVerifier at ${verifierAddress.toString()}`);
log(`Deployed HonkVerifier at ${verifierAddress.toString()}`);

const pxe = await createCompatibleClient(pxeRpcUrl, debugLogger);
const { l1ContractAddresses } = await pxe.getNodeInfo();
Expand Down
4 changes: 2 additions & 2 deletions yarn-project/cli/src/cmds/l1/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: DebugL
.option('--bb <path>', 'Path to bb binary')
.option('--bb-working-dir <path>', 'Path to bb working directory')
.action(async options => {
const { deployMockVerifier, deployUltraVerifier } = await import('./deploy_l1_verifier.js');
const { deployMockVerifier, deployUltraHonkVerifier } = await import('./deploy_l1_verifier.js');
if (options.verifier === 'mock') {
await deployMockVerifier(
options.ethRpcUrl,
Expand All @@ -72,7 +72,7 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: DebugL
debugLogger,
);
} else {
await deployUltraVerifier(
await deployUltraHonkVerifier(
options.ethRpcUrl,
options.privateKey,
options.mnemonic,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ describe('proof_verification', () => {
const input = {
language: 'Solidity',
sources: {
'UltraVerifier.sol': {
content: await circuitVerifier.generateSolidityContract('RootRollupArtifact', 'UltraVerifier.sol'),
'UltraHonkVerifier.sol': {
content: await circuitVerifier.generateSolidityContract('RootRollupArtifact', 'UltraHonkVerifier.sol'),
},
},
settings: {
Expand All @@ -95,8 +95,8 @@ describe('proof_verification', () => {

const output = JSON.parse(solc.compile(JSON.stringify(input)));

const abi = output.contracts['UltraVerifier.sol']['UltraVerifier'].abi;
const bytecode: string = output.contracts['UltraVerifier.sol']['UltraVerifier'].evm.bytecode.object;
const abi = output.contracts['UltraHonkVerifier.sol']['HonkVerifier'].abi;
const bytecode: string = output.contracts['UltraHonkVerifier.sol']['HonkVerifier'].evm.bytecode.object;

const verifierAddress = await deployL1Contract(walletClient, publicClient, abi, `0x${bytecode}`);
verifierContract = getContract({
Expand Down Expand Up @@ -132,7 +132,7 @@ describe('proof_verification', () => {
});
});

describe('UltraVerifier', () => {
describe('HonkVerifier', () => {
it('verifies full proof', async () => {
const reader = BufferReader.asReader(proof.buffer);
// +2 fields for archive
Expand Down
4 changes: 2 additions & 2 deletions yarn-project/end-to-end/src/e2e_prover/e2e_prover_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,8 @@ export class FullProverTest {

const output = JSON.parse(solc.compile(JSON.stringify(input)));

const abi = output.contracts['UltraVerifier.sol']['UltraVerifier'].abi;
const bytecode: string = output.contracts['UltraVerifier.sol']['UltraVerifier'].evm.bytecode.object;
const abi = output.contracts['UltraHonkVerifier.sol']['HonkVerifier'].abi;
const bytecode: string = output.contracts['UltraHonkVerifier.sol']['HonkVerifier'].evm.bytecode.object;

const verifierAddress = await deployL1Contract(walletClient, publicClient, abi, `0x${bytecode}`);

Expand Down

0 comments on commit 8aef043

Please sign in to comment.