Skip to content

Commit

Permalink
feat: update account contracts to pay fees on init
Browse files Browse the repository at this point in the history
  • Loading branch information
alexghr committed Apr 4, 2024
1 parent 5b2e7e4 commit 4d98bc8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ contract EcdsaAccount {
let this = context.this_address();
let mut pub_key_note = EcdsaPublicKeyNote::new(signing_pub_key_x, signing_pub_key_y, this);
storage.public_key.initialize(&mut pub_key_note, true);

let actions = AccountActions::private(&mut context, ACCOUNT_ACTIONS_STORAGE_SLOT, is_valid_impl);
actions.initialize_account_contract();
}

// Note: If you globally change the entrypoint signature don't forget to update default_entrypoint.ts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ contract SchnorrHardcodedAccount {

global ACCOUNT_ACTIONS_STORAGE_SLOT = 1;

#[aztec(private)]
#[aztec(initializer)]
fn constructor() {
let actions = AccountActions::private(&mut context, ACCOUNT_ACTIONS_STORAGE_SLOT, is_valid_impl);
actions.initialize_account_contract();
}

// Note: If you globally change the entrypoint signature don't forget to update default_entrypoint.ts
#[aztec(private)]
fn entrypoint(app_payload: pub AppPayload, fee_payload: pub FeePayload) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ contract SchnorrSingleKeyAccount {

global ACCOUNT_ACTIONS_STORAGE_SLOT = 1;

#[aztec(private)]
#[aztec(initializer)]
fn constructor() {
let actions = AccountActions::private(&mut context, ACCOUNT_ACTIONS_STORAGE_SLOT, is_valid_impl);
actions.initialize_account_contract();
}

// Note: If you globally change the entrypoint signature don't forget to update default_entrypoint.ts
#[aztec(private)]
fn entrypoint(app_payload: pub AppPayload, fee_payload: pub FeePayload) {
Expand Down

0 comments on commit 4d98bc8

Please sign in to comment.