-
Notifications
You must be signed in to change notification settings - Fork 284
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
53 additions
and
43 deletions.
There are no files selected for viewing
15 changes: 0 additions & 15 deletions
15
noir-projects/noir-contracts/contracts/private_fpc_contract/src/lib.nr
This file was deleted.
Oops, something went wrong.
28 changes: 16 additions & 12 deletions
28
noir-projects/noir-contracts/contracts/private_fpc_contract/src/main.nr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
noir-projects/noir-contracts/contracts/private_fpc_contract/src/settings.nr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use dep::aztec::protocol_types::{address::AztecAddress, traits::{Serialize, Deserialize}}; | ||
|
||
global SETTINGS_LENGTH = 2; | ||
|
||
struct Settings { | ||
other_asset: AztecAddress, | ||
admin: AztecAddress, | ||
} | ||
|
||
impl Serialize<SETTINGS_LENGTH> for Settings { | ||
fn serialize(self: Self) -> [Field; SETTINGS_LENGTH] { | ||
[self.other_asset.to_field(), self.admin.to_field()] | ||
} | ||
} | ||
|
||
impl Deserialize<SETTINGS_LENGTH> for Settings { | ||
fn deserialize(fields: [Field; SETTINGS_LENGTH]) -> Self { | ||
Settings { | ||
other_asset: AztecAddress::from_field(fields[0]), | ||
admin: AztecAddress::from_field(fields[1]), | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters