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

Added minimumAuthorization function to IApplication interface #91

Merged
merged 2 commits into from
Apr 22, 2022

Conversation

pdyraga
Copy link
Member

@pdyraga pdyraga commented Apr 21, 2022

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 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.

cygnusv
cygnusv previously approved these changes Apr 21, 2022
@@ -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
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
/// 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"

Copy link
Member Author

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.

Copy link
Member Author

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.

vzotova
vzotova previously approved these changes Apr 22, 2022
Base automatically changed from reduce-all to main April 22, 2022 07:30
@cygnusv cygnusv dismissed stale reviews from vzotova and themself via ee07c82 April 22, 2022 07:30
@cygnusv cygnusv marked this pull request as ready for review April 22, 2022 07:31
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.
@pdyraga
Copy link
Member Author

pdyraga commented Apr 22, 2022

#87 got merged so I am rebasing this PR over main and undrafting!

@pdyraga
Copy link
Member Author

pdyraga commented Apr 22, 2022

System tests are failing because of a Hardhat problem described here #87 (comment).

@cygnusv cygnusv merged commit c49b9b2 into main Apr 22, 2022
@cygnusv cygnusv deleted the better-api branch April 22, 2022 07:44
@pdyraga pdyraga added this to the v1.2.0 milestone Sep 29, 2022
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