Skip to content

Commit c49b9b2

Browse files
authored
Merge pull request #91 from threshold-network/better-api
Added minimumAuthorization function to IApplication interface
2 parents 07e49aa + 1a477a2 commit c49b9b2

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

contracts/staking/IApplication.sol

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ pragma solidity 0.8.9;
2424
interface IApplication {
2525
/// @notice Used by T staking contract to inform the application that the
2626
/// authorized amount for the given staking provider increased.
27-
/// The application may do any necessary housekeeping.
27+
/// The application may do any necessary housekeeping. The
28+
/// application must revert the transaction in case the
29+
/// authorization is below the minimum required.
2830
function authorizationIncreased(
2931
address stakingProvider,
3032
uint96 fromAmount,
@@ -54,4 +56,8 @@ interface IApplication {
5456
uint96 fromAmount,
5557
uint96 toAmount
5658
) external;
59+
60+
/// @notice The minimum authorization amount required for the staking
61+
/// provider so that they can participate in the application.
62+
function minimumAuthorization() external view returns (uint96);
5763
}

contracts/test/TokenStakingTestSet.sol

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,10 @@ contract ApplicationMock is IApplication {
271271
}
272272
stakingProviderStruct.authorized = toAmount;
273273
}
274+
275+
function minimumAuthorization() external view returns (uint96) {
276+
return 0;
277+
}
274278
}
275279

276280
contract BrokenApplicationMock is ApplicationMock {

0 commit comments

Comments
 (0)