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
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export async function makeProtocolContract(
const salt = ProtocolContractSalt[name];
// TODO(@spalladino): This computes the contract class from the artifact twice.
const contractClass = await getContractClassFromArtifact(artifact);
const instance = await getContractInstanceFromInstantiationParams(artifact, { salt });
const instance = await getContractInstanceFromInstantiationParams(artifact, { salt, deployer: address });
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will be the low address, not the instance derived address

return {
instance: { ...instance, address },
contractClass,
Expand Down
6 changes: 3 additions & 3 deletions yarn-project/protocol-contracts/src/scripts/generate_data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ async function copyArtifact(srcName: string, destName: string) {
return artifact;
}

async function computeAddress(artifact: NoirCompiledContract) {
const instance = await getContractInstanceFromInstantiationParams(loadContractArtifact(artifact), { salt });
async function computeAddress(artifact: NoirCompiledContract, deployer: AztecAddress) {
const instance = await getContractInstanceFromInstantiationParams(loadContractArtifact(artifact), { salt, deployer });
return instance.address;
}

Expand Down Expand Up @@ -179,7 +179,7 @@ async function main() {
const destName = destNames[i];
const artifact = await copyArtifact(srcName, destName);
await generateDeclarationFile(destName);
derivedAddresses.push(await computeAddress(artifact));
derivedAddresses.push(await computeAddress(artifact, AztecAddress.fromBigInt(contractAddressMapping[destName])));
}

await generateOutputFile(destNames, derivedAddresses);
Expand Down
Loading