diff --git a/yarn-project/protocol-contracts/src/make_protocol_contract.ts b/yarn-project/protocol-contracts/src/make_protocol_contract.ts index ab18dcaf1b1d..14c3e0be7dbf 100644 --- a/yarn-project/protocol-contracts/src/make_protocol_contract.ts +++ b/yarn-project/protocol-contracts/src/make_protocol_contract.ts @@ -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 }); return { instance: { ...instance, address }, contractClass, diff --git a/yarn-project/protocol-contracts/src/scripts/generate_data.ts b/yarn-project/protocol-contracts/src/scripts/generate_data.ts index 3e27ba86f4b5..e07a1f967cf8 100644 --- a/yarn-project/protocol-contracts/src/scripts/generate_data.ts +++ b/yarn-project/protocol-contracts/src/scripts/generate_data.ts @@ -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; } @@ -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);