1+ // GENERATED FILE - DO NOT EDIT
2+ //
3+ // Written by `yarn-project/standard-contracts/src/scripts/generate_interfaces.ts` from the compiled
4+ // `PublicChecks` artifact. Regenerate with
5+ // `yarn workspace @aztec/standard-contracts run regen:standard-interfaces`.
6+ //
7+ // The selectors below are derived via `comptime { FunctionSelector::from_signature(...) }` at
8+ // Noir compile time, with the signature string emitted from the artifact's parameter list. This
9+ // keeps the wrapper in lockstep with whatever the `#[aztec]` macro generates for the real
10+ // contract; any drift between the contract's external signatures and this file fails the
11+ // `generate_interfaces.test.ts` freshness gate.
12+
113use crate::context::calls::PublicStaticCall ;
2- use crate::protocol::abis::function_selector::FunctionSelector ;
3- use crate::protocol::address::AztecAddress ;
14+ use crate::protocol:: {abis::function_selector::FunctionSelector , address::AztecAddress };
415
5- /// Hand-written interface stub for the `PublicChecks` standard contract.
6- ///
7- /// The `PublicChecks` contract exposes two view functions that can be enqueued
8- /// from private context via `enqueue_view_incognito` to assert timestamp or
9- /// block-number constraints without revealing the calling contract address.
10- ///
11- /// The selectors are derived with `comptime { FunctionSelector::from_signature(...) }`,
12- /// which matches exactly what the `#[aztec]` macro generates for the real contract.
1316pub struct PublicChecksInterface {
1417 pub target_contract : AztecAddress ,
1518}
@@ -19,22 +22,22 @@ impl PublicChecksInterface {
1922 Self { target_contract }
2023 }
2124
22- pub fn check_timestamp (self , operation : u8 , value : u64 ) -> PublicStaticCall <15 , 2 , ()> {
23- let selector = comptime { FunctionSelector ::from_signature ("check_timestamp (u8,u64 )" ) };
25+ pub fn check_block_number (self , operation : u8 , value : u32 ) -> PublicStaticCall <18 , 2 , ()> {
26+ let selector = comptime { FunctionSelector ::from_signature ("check_block_number (u8,u32 )" ) };
2427 PublicStaticCall ::new (
2528 self .target_contract ,
2629 selector ,
27- "check_timestamp " ,
30+ "check_block_number " ,
2831 [operation as Field , value as Field ],
2932 )
3033 }
3134
32- pub fn check_block_number (self , operation : u8 , value : u32 ) -> PublicStaticCall <18 , 2 , ()> {
33- let selector = comptime { FunctionSelector ::from_signature ("check_block_number (u8,u32 )" ) };
35+ pub fn check_timestamp (self , operation : u8 , value : u64 ) -> PublicStaticCall <15 , 2 , ()> {
36+ let selector = comptime { FunctionSelector ::from_signature ("check_timestamp (u8,u64 )" ) };
3437 PublicStaticCall ::new (
3538 self .target_contract ,
3639 selector ,
37- "check_block_number " ,
40+ "check_timestamp " ,
3841 [operation as Field , value as Field ],
3942 )
4043 }
0 commit comments