-
Notifications
You must be signed in to change notification settings - Fork 4
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
Audit revisions #8
Conversation
@@ -280,6 +286,9 @@ impl PriceOracleContract { | |||
admin.require_auth(); | |||
if e.is_initialized() { | |||
e.panic_with_error(Error::AlreadyInitialized); | |||
} | |||
if admin != config.admin { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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!
timestamp validation added on set price
has_asset replaced with get_asset_index
config.admin auth check
return None as last price, if price update delayed; prices fn refactoring
updates length validation added