-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
162 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.28; | ||
|
||
// Contributors interface | ||
interface IContributors { | ||
/// @dev Sets service info for the social id. | ||
/// @param socialId Social id. | ||
/// @param serviceId Service Id. | ||
/// @param multisig Service multisig address. | ||
/// @param stakingInstance Staking instance address. | ||
/// @param serviceOwner Service owner. | ||
function setServiceInfoForId( | ||
uint256 socialId, | ||
uint256 serviceId, | ||
address multisig, | ||
address stakingInstance, | ||
address serviceOwner | ||
) external; | ||
|
||
/// @dev Gets service info corresponding to a specified social Id. | ||
/// @param socialId Social Id. | ||
/// @return serviceId Corresponding service Id. | ||
/// @return multisig Corresponding service multisig. | ||
/// @return stakingInstance Staking instance address. | ||
/// @return serviceOwner Service owner. | ||
function mapSocialIdServiceInfo(uint256 socialId) external view | ||
returns (uint256 serviceId, address multisig, address stakingInstance, address serviceOwner); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.28; | ||
|
||
// Staking interface | ||
interface IStaking { | ||
/// @dev Gets service staking token. | ||
/// @return Service staking token address. | ||
function stakingToken() external view returns (address); | ||
|
||
/// @dev Gets minimum service staking deposit value required for staking. | ||
/// @return Minimum service staking deposit. | ||
function minStakingDeposit() external view returns (uint256); | ||
|
||
/// @dev Gets number of required agent instances in the service. | ||
/// @return Number of agent instances. | ||
function numAgentInstances() external view returns (uint256); | ||
|
||
/// @dev Gets the service threshold. | ||
/// @return Threshold. | ||
function threshold() external view returns (uint256); | ||
|
||
/// @dev Stakes the service. | ||
/// @param serviceId Service Id. | ||
function stake(uint256 serviceId) external; | ||
|
||
/// @dev Unstakes the service with collected reward, if available. | ||
/// @param serviceId Service Id. | ||
/// @return reward Staking reward. | ||
function unstake(uint256 serviceId) external returns (uint256); | ||
|
||
/// @dev Claims rewards for the service without an additional checkpoint call. | ||
/// @param serviceId Service Id. | ||
/// @return Staking reward. | ||
function claim(uint256 serviceId) external returns (uint256); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.28; | ||
|
||
// Token interface | ||
interface IToken { | ||
/// @dev Transfers the token amount. | ||
/// @param to Address to transfer to. | ||
/// @param amount The amount to transfer. | ||
/// @return True if the function execution is successful. | ||
function transfer(address to, uint256 amount) external returns (bool); | ||
|
||
/// @dev Transfers the token amount that was previously approved up until the maximum allowance. | ||
/// @param from Account address to transfer from. | ||
/// @param to Account address to transfer to. | ||
/// @param amount Amount to transfer to. | ||
/// @return True if the function execution is successful. | ||
function transferFrom(address from, address to, uint256 amount) external returns (bool); | ||
|
||
/// @dev Sets `amount` as the allowance of `spender` over the caller's tokens. | ||
/// @param spender Account address that will be able to transfer tokens on behalf of the caller. | ||
/// @param amount Token amount. | ||
/// @return True if the function execution is successful. | ||
function approve(address spender, uint256 amount) external returns (bool); | ||
} |