-
Notifications
You must be signed in to change notification settings - Fork 268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: token partial notes refactor pt. 2 - bridging #9600
refactor: token partial notes refactor pt. 2 - bridging #9600
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
b5e9766
to
79870df
Compare
9344ac0
to
5baeda8
Compare
5baeda8
to
c1a8e42
Compare
581ee9e
to
ef1b833
Compare
ef1b833
to
e5b74cb
Compare
Changes to public function bytecode sizes
🧾 Summary (100% most significant diffs)
Full diff report 👇
|
e5b74cb
to
c7e984b
Compare
c7e984b
to
dcbcd38
Compare
@@ -22,11 +22,7 @@ contract TokenPortal { | |||
); | |||
|
|||
event DepositToAztecPrivate( | |||
bytes32 secretHashForRedeemingMintedNotes, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This ^ was the hash in the transparent note. It's no longer there (and neither is L2 address) meaning that only the message secret "owns" the bridged tokens.
@@ -27,15 +27,15 @@ contract TokenBridge { | |||
// Storage structure, containing all storage, and specifying what slots they use. | |||
#[storage] | |||
struct Storage<Context> { | |||
token: PublicMutable<AztecAddress, Context>, | |||
token: SharedImmutable<AztecAddress, Context>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We now need to read this in private as well so changed PublicMutable to Shared.
d1b498f
to
0752c7a
Compare
#[private] | ||
fn claim_private( | ||
secret_hash_for_redeeming_minted_notes: Field, // secret hash used to redeem minted notes at a later time. This enables anyone to call this function and mint tokens to a user on their behalf | ||
recipient: AztecAddress, // recipient of the bridged tokens |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are no longer redeeming "to" a TransparentNote and instead we just mint a real ValueNote to a recipient.
@@ -478,7 +478,7 @@ contract Token { | |||
let token = Token::at(context.this_address()); | |||
|
|||
// We prepare the transfer. | |||
let hiding_point_slot = _prepare_transfer_to_private(to, &mut context, storage); | |||
let hiding_point_slot = _prepare_transfer_to_private(from, to, &mut context, storage); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We now pass the from
param as it allows us to define the recipient of outgoing.
3f31918
to
90ecd6f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Continuation of the token partial notes refactor now focused on token bridging.