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

[Audit]: N-02 Inconsistent Error Types #336

Open
1 task done
bidzyyys opened this issue Oct 14, 2024 · 1 comment · May be fixed by #339
Open
1 task done

[Audit]: N-02 Inconsistent Error Types #336

bidzyyys opened this issue Oct 14, 2024 · 1 comment · May be fixed by #339
Assignees
Labels
effort: low Easy or tiny task that takes less than a day. priority: 2 We will resolve this in a short timeframe. type: ref A code update that doesn't meaningfully change functionality.

Comments

@bidzyyys
Copy link
Collaborator

What is the feature you would like to see?

Throughout the codebase, there are some extensions that use associated error types to allow
users the flexibility to assign a generic Vec as an error type and encode any error that is
needed (or not return an error at all), while others do not use this error style. For example, in
the IERC20 trait of the ERC20 implementation.
Consider using a consistent error style to avoid confusion and improve code clarity.

Contribution Guidelines

  • I agree to follow this project's Contribution Guidelines
@bidzyyys bidzyyys added priority: 2 We will resolve this in a short timeframe. effort: low Easy or tiny task that takes less than a day. type: ref A code update that doesn't meaningfully change functionality. labels Oct 14, 2024
@bidzyyys
Copy link
Collaborator Author

The solution is to have the trait and associated error type to enable implementers to define custom errors throughout. It may not be the cleanest approach but seems like the most flexible.

@bidzyyys bidzyyys self-assigned this Oct 15, 2024
@bidzyyys bidzyyys moved this from Todo to In Progress in Rust Contracts Stylus Oct 15, 2024
bidzyyys added a commit that referenced this issue Oct 15, 2024
@bidzyyys bidzyyys linked a pull request Oct 15, 2024 that will close this issue
@bidzyyys bidzyyys linked a pull request Oct 15, 2024 that will close this issue
bidzyyys added a commit that referenced this issue Oct 15, 2024
bidzyyys added a commit that referenced this issue Oct 15, 2024
bidzyyys added a commit that referenced this issue Oct 15, 2024
bidzyyys added a commit that referenced this issue Oct 15, 2024
bidzyyys added a commit that referenced this issue Oct 15, 2024
bidzyyys added a commit that referenced this issue Oct 15, 2024
bidzyyys added a commit that referenced this issue Oct 15, 2024
bidzyyys added a commit that referenced this issue Oct 15, 2024
bidzyyys added a commit that referenced this issue Oct 15, 2024
bidzyyys added a commit that referenced this issue Oct 15, 2024
bidzyyys added a commit that referenced this issue Oct 15, 2024
@bidzyyys bidzyyys added this to the Release v0.2.0 milestone Oct 24, 2024
@bidzyyys bidzyyys changed the title [Audit]: N-03 Inconsistent Error Types [Audit]: N-02 Inconsistent Error Types Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort: low Easy or tiny task that takes less than a day. priority: 2 We will resolve this in a short timeframe. type: ref A code update that doesn't meaningfully change functionality.
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

1 participant