Skip to content
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

Add custom errors for common and ownership packages #73

Merged
merged 7 commits into from
Oct 22, 2024

Conversation

Mike-CZ
Copy link
Member

@Mike-CZ Mike-CZ commented Oct 10, 2024

No description provided.

@Mike-CZ Mike-CZ requested a review from jmpike October 10, 2024 09:38
/**
* @dev Given zero address.
*/
error ZeroAddress();
Copy link
Collaborator

@thaarok thaarok Oct 21, 2024

Choose a reason for hiding this comment

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

We may want to be compatible with OpenZeppelin's Ownable:

    /**
     * @dev The caller account is not authorized to perform an operation.
     */
    error OwnableUnauthorizedAccount(address account);

    /**
     * @dev The owner is not a valid owner account. (eg. `address(0)`)
     */
    error OwnableInvalidOwner(address owner);

(it is ok if an error/method name is long - only the hash is written into the contract code)
https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol#L23-L32

Base automatically changed from mike/remove_unused_variables to sonic_sfc October 22, 2024 09:54
@Mike-CZ Mike-CZ merged commit 78101a8 into sonic_sfc Oct 22, 2024
2 checks passed
@Mike-CZ Mike-CZ deleted the mike/common_errors branch October 22, 2024 16:45
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