Open
Conversation
650e63c to
5754cfa
Compare
…ted error handling
- Renamed `OWNER_CONFIG_SLOT_NAME` to `OWNERSHIP_SLOT_NAME` for clarity. - Updated storage layout documentation to reflect changes in ownership data structure. - Modified methods to retrieve owner and pending owner information from the new ownership slot. - Adjusted minting logic to accommodate the new ownership structure. - Removed outdated tests related to ownership transfer and added new tests for the updated ownership functionality. - Introduced a new `ownable` module to encapsulate ownership transfer logic and related tests.
7d2ac3e to
397aa5c
Compare
onurinanc
reviewed
Feb 23, 2026
crates/miden-standards/asm/account_components/faucets/network_fungible_faucet.masm
Outdated
Show resolved
Hide resolved
crates/miden-standards/asm/account_components/faucets/network_fungible_faucet.masm
Outdated
Show resolved
Hide resolved
Contributor
|
It might be something like this: Thanks for adding this! |
Contributor
|
@afa7789 Could you rename |
Contributor
|
Hi @PhilippGackstatter, @bobbinth, and @mmagician |
Contributor
|
Let's consider this comment by @PhilippGackstatter #2486 (comment) and add an ID validation using |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We want Ownable2Step to override Ownable, as the former is the more secure version.
The core issue with Ownable is that the transferOwnership function immediately sets the new owner in a single transaction. This creates a critical vulnerability:
If you make a typo or pass a wrong address, ownership is permanently lost. There's no recovery mechanism — the contract is effectively locked forever with no owner able to call privileged functions.
How Ownable2Step fixes this
Ownable2Step introduces a two-phase handoff:
Step 1 — Nominate: The current owner calls transferOwnership(newAddress), which only sets a pendingOwner. The current owner remains in control.
Step 2 — Accept: The pendingOwner must call acceptOwnership() from their own address to complete the transfer.
See here:
#2488
#2486