-
Notifications
You must be signed in to change notification settings - Fork 18
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
Added minimumAuthorization function to IApplication interface #91
Conversation
contracts/staking/IApplication.sol
Outdated
@@ -24,7 +24,9 @@ pragma solidity 0.8.9; | |||
interface IApplication { | |||
/// @notice Used by T staking contract to inform the application that the | |||
/// authorized amount for the given staking provider increased. | |||
/// The application may do any necessary housekeeping. | |||
/// The application may do any necessary housekeeping. The | |||
/// application may revert the transaction in case the authorization |
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.
/// application may revert the transaction in case the authorization | |
/// application must revert the transaction in case the authorization |
Otherwise, it doesn't make much sense to define it as a "minimum authorization"
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.
Makes sense! Updated in the last commit.
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.
Code format is complaining but I'll fix it once #87 is merged when rebasing over main
. Ignoring for now.
There is an implicit contract in TokenStaking that IApplication may revert in case the minimum authorization requirement is not met. The problem is that IApplication does not clearly define what is the minimum authorization. This change improves it. First, the contract about `increaseAuthorization` reverting if the minimum requirement is not met is now explicit. Second, `IApplication` exposes `minimumAuthorization` information.
Application *must* revert increaseAuthorization in case the minimum required authorization is not satisfied.
#87 got merged so I am rebasing this PR over |
System tests are failing because of a Hardhat problem described here #87 (comment). |
Refs #88
Refs keep-network/keep-core#2935
Depends on #87 (keeping as a draft until #87 is merged)There is an implicit contract in
TokenStaking
thatIApplication
mayrevert in case the minimum authorization requirement is not met. The
problem is that
IApplication
does not clearly define what is the minimumauthorization.
This change improves it. First, the contract about
increaseAuthorization
reverting if the minimum requirement is not metis now explicit. Second,
IApplication
exposesminimumAuthorization
information.