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 revisions #8

Merged

Conversation

@hawthorne-abendsen hawthorne-abendsen merged commit 0c65c4f into reflector-network:master Feb 6, 2024
@@ -280,6 +286,9 @@ impl PriceOracleContract {
admin.require_auth();
if e.is_initialized() {
e.panic_with_error(Error::AlreadyInitialized);
}
if admin != config.admin {
Copy link

@dmkozh dmkozh Feb 7, 2024

Choose a reason for hiding this comment

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

Passing-by comment/recommendation from a Soroban dev: in order to avoid such errors and make a contract a tiny bit cheaper you could just remove admin from the function arguments and call config.admin.require_auth() instead. The same applies to all the similar functions that use admin - instead of passing it externally you could just retrieve admin from storage and call require_auth for it directly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! We've incorporated these changes in pull request #9. Appreciate your advice!

@hawthorne-abendsen hawthorne-abendsen deleted the audit-revisions branch March 25, 2024 17:05
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.

3 participants