Skip to content

Conversation

@noa-starkware
Copy link
Collaborator

@noa-starkware noa-starkware commented Oct 22, 2025

This change is Reviewable

Copy link
Collaborator

@remollemo remollemo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@remollemo reviewed all commit messages.
Reviewable status: 0 of 3 files reviewed, 1 unresolved discussion (waiting on @noa-starkware)


packages/usdc_migration/src/usdc_migration.cairo line 92 at r1 (raw file):

        assert!(from_address == self.l1_recipient.read().into(), "{}", Error::VERIFY_L1_FAILED);
        // TODO: Emit event?
    }

this would be unhelpful.
definitely without an event/

unlike the problem with l2 owner address where we want to be sure the owner is valid before we get money etc,
here it's easier, as we are not forced into a state.

so - we can simply condition the operation - migration, send to l1 whatever, with the l1 address been validated.

dont revert.
when the address is correct - simply flag it as so.
and condition the actions on this flag.

Code quote:

    /// Verify the L1 recipient address is a reachable address.
    #[l1_handler]
    fn verify_l1_recipient(self: @ContractState, from_address: felt252) {
        assert!(from_address == self.l1_recipient.read().into(), "{}", Error::VERIFY_L1_FAILED);
        // TODO: Emit event?
    }

Copy link
Collaborator Author

@noa-starkware noa-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 3 files reviewed, 1 unresolved discussion (waiting on @noa-starkware and @remollemo)


packages/usdc_migration/src/usdc_migration.cairo line 92 at r1 (raw file):

Previously, remollemo wrote…

this would be unhelpful.
definitely without an event/

unlike the problem with l2 owner address where we want to be sure the owner is valid before we get money etc,
here it's easier, as we are not forced into a state.

so - we can simply condition the operation - migration, send to l1 whatever, with the l1 address been validated.

dont revert.
when the address is correct - simply flag it as so.
and condition the actions on this flag.

Done.

Copy link
Collaborator

@remollemo remollemo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@remollemo reviewed 3 of 3 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @noa-starkware)

Copy link
Collaborator

@remollemo remollemo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 2 of 3 files reviewed, 1 unresolved discussion (waiting on @noa-starkware)


packages/usdc_migration/src/usdc_migration.cairo line 34 at r3 (raw file):

        /// The threshold amount of legacy token balance, that triggers sending to L1.
        legacy_threshold: u256,
        /// Whether the L1 recipient address is verified.

Suggestion:

/// Indicates if L1 recipient address was verified.

@noa-starkware noa-starkware force-pushed the noa/verify_owner_l2_address branch 2 times, most recently from 0ee48ca to 107d8b5 Compare October 26, 2025 13:09
@noa-starkware noa-starkware changed the base branch from noa/verify_owner_l2_address to main October 26, 2025 13:11
Copy link
Collaborator

@remollemo remollemo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@remollemo reviewed all commit messages.
Reviewable status: 1 of 3 files reviewed, 1 unresolved discussion (waiting on @noa-starkware)


packages/usdc_migration/src/usdc_migration.cairo line 156 at r4 (raw file):

        self.l1_recipient_verified.write(true);
        // TODO: Emit event?
    }
  1. i don't think there is a reason to revert
  2. once we've successfully validated the l1 recipient reverting with failed to verify l1 recipient is really confusing.
  3. yeah, i'd event this.
  4. maybe smt like this:

Suggestion:

    fn verify_l1_recipient(ref self: ContractState, from_address: felt252) {
        if (! self.l1_recipient_verified.read() {
            l1_recipient: EthAddresss = self.l1_recipient.read();
            if (from_address == l1_recipient.into()) {
                self.l1_recipient_verified.write(true);
                self.emit(L1RecipientValidated { :l1_recipient });
            }
        }
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants