Skip to content

Commit

Permalink
updated constants
Browse files Browse the repository at this point in the history
  • Loading branch information
Thunkar committed Mar 25, 2024
1 parent 79f6366 commit 81195fd
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 18 deletions.
2 changes: 1 addition & 1 deletion l1-contracts/src/core/libraries/ConstantsGen.sol
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ library Constants {
uint256 internal constant DEPLOYER_CONTRACT_INSTANCE_DEPLOYED_MAGIC_VALUE =
0x85864497636cf755ae7bde03f267ce01a520981c21c3682aaf82a631;
uint256 internal constant DEPLOYER_CONTRACT_ADDRESS =
0x127a8fd1a31888ccd00c88d84b93474449bb6683197083e1727dd02ab6803c6c;
0x1532d2b5589f8f573a4f2b393b385b9b917ee2fab2d1fc2db255e61358e3d49f;
uint256 internal constant L1_TO_L2_MESSAGE_ORACLE_CALL_LENGTH = 17;
uint256 internal constant MAX_NOTE_FIELDS_LENGTH = 20;
uint256 internal constant GET_NOTE_ORACLE_RETURN_LENGTH = 23;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ global REGISTERER_UNCONSTRAINED_FUNCTION_BROADCASTED_MAGIC_VALUE = 0xe7af8166354
// CONTRACT INSTANCE CONSTANTS
// sha224sum 'struct ContractInstanceDeployed'
global DEPLOYER_CONTRACT_INSTANCE_DEPLOYED_MAGIC_VALUE = 0x85864497636cf755ae7bde03f267ce01a520981c21c3682aaf82a631;
global DEPLOYER_CONTRACT_ADDRESS = 0x127a8fd1a31888ccd00c88d84b93474449bb6683197083e1727dd02ab6803c6c;
global DEPLOYER_CONTRACT_ADDRESS = 0x2d63ec07df1a46312723d15c0e98771b0d462baeea5b594f0030b44f61cf89d9;

// NOIR CONSTANTS - constants used only in yarn-packages/noir-contracts
// Some are defined here because Noir doesn't yet support globals referencing other globals yet.
Expand Down
14 changes: 1 addition & 13 deletions noir/noir-repo/compiler/noirc_frontend/src/hir/def_map/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,18 +217,6 @@ impl CrateDefMap {
})
.collect();

let events = module
.type_definitions()
.filter_map(|id| {
id.as_type().filter(|struct_id| {
interner
.struct_attributes(struct_id)
.iter()
.any(|attr| attr == &SecondaryAttribute::Event)
})
})
.collect();

let mut outputs =
ContractOutputs { structs: HashMap::new(), globals: HashMap::new() };

Expand Down Expand Up @@ -259,7 +247,7 @@ impl CrateDefMap {
});

let name = self.get_module_path(id, module.parent);
Some(Contract { name, location: module.location, functions, events, outputs })
Some(Contract { name, location: module.location, functions, outputs })
} else {
None
}
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/circuits.js/src/constants.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const REGISTERER_UNCONSTRAINED_FUNCTION_BROADCASTED_MAGIC_VALUE =
0xe7af816635466f128568edb04c9fa024f6c87fb9010fdbffa68b3d99n;
export const DEPLOYER_CONTRACT_INSTANCE_DEPLOYED_MAGIC_VALUE =
0x85864497636cf755ae7bde03f267ce01a520981c21c3682aaf82a631n;
export const DEPLOYER_CONTRACT_ADDRESS = 0x127a8fd1a31888ccd00c88d84b93474449bb6683197083e1727dd02ab6803c6cn;
export const DEPLOYER_CONTRACT_ADDRESS = 0x2d63ec07df1a46312723d15c0e98771b0d462baeea5b594f0030b44f61cf89d9n;
export const L1_TO_L2_MESSAGE_ORACLE_CALL_LENGTH = 17;
export const MAX_NOTE_FIELDS_LENGTH = 20;
export const GET_NOTE_ORACLE_RETURN_LENGTH = 23;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ describe('ArtifactHash', () => {
it('calculates the artifact hash', () => {
const artifact = getSampleContractArtifact();
expect(computeArtifactHash(artifact).toString()).toMatchInlineSnapshot(
`"0x1ed6e0f249e6571a4876b3b17e876de906c987b4075b435a964aac22b58945a8"`,
`"0x0c9c8f57b50a8eb121c0a0d0d382faecc9069ad1b46d40fbd7b67a67cfff67ed"`,
);
});
});
2 changes: 1 addition & 1 deletion yarn-project/circuits.js/src/contract/artifact_hash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export function computeArtifactHashPreimage(artifact: ContractArtifact) {
export function computeArtifactMetadataHash(artifact: ContractArtifact) {
// TODO(@spalladino): Should we use the sorted event selectors instead? They'd need to be unique for that.
const metadata = { name: artifact.name, outputs: artifact.outputs };
return sha256(Buffer.from(JSON.stringify(metadata), 'utf-8'));
return sha256Fr(Buffer.from(JSON.stringify(metadata), 'utf-8'));
}

export function computeArtifactFunctionTreeRoot(artifact: ContractArtifact, fnType: FunctionType) {
Expand Down

0 comments on commit 81195fd

Please sign in to comment.