-
Notifications
You must be signed in to change notification settings - Fork 0
TMP: Reward polls #8
Copy link
Copy link
Open
Description
TMP-8: Reward polls
tmp: 8
title: Reward polls
author: Evert Kors (@Evert0x)
discussions-to: #8
status: Draft
type: Module
created: 2021/02/04
requires (*optional):
replaces (*optional):
Simple Summary
Interface to create rewards
Abstract
This module can be used to create recurring rewards in the asset pool
Motivation
...
Specification
Interface
interface IReward{
event RewardPollCreated(
uint256 id,
address indexed member,
uint256 withdrawID,
uint256 proposal
);
function setRewardPollDuration(uint256 _duration) external;
function getRewardPollDuration() external view returns (uint256);
function addReward(uint256 _withdrawAmount, uint256 _withdrawDuration)
external;
function getReward(uint256 _id)
external
view
returns (LibRewardPollStorage.Reward memory);
function updateReward(
uint256 _id,
uint256 _withdrawAmount,
uint256 _withdrawDuration
) external;
function claimRewardFor(uint256 _id, address _beneficiary) external;
function claimReward(uint256 _id) external;
}
interface IRewardPoll {
event RewardPollDisabled(uint256 id);
event RewardPollEnabled(uint256 id);
event RewardPollUpdated(uint256 id, uint256 amount, uint256 duration);
event RewardPollVoted(uint256 id, address indexed member, bool vote);
event RewardPollFinalized(uint256 id, bool approved);
event RewardPollRevokedVote(uint256 id, address indexed member);
function getWithdrawAmount(uint256 _id) external view returns (uint256);
function getWithdrawDuration(uint256 _id) external view returns (uint256);
function getRewardIndex(uint256 _id) external view returns (uint256);
function _rewardPollVote(bool _agree) external;
function _rewardPollRevokeVote() external;
function _rewardPollFinalize() external;
function _rewardPollApprovalState() external view returns (bool);
}
interface IWithdrawPollProxy {
function rewardPollVote(uint256 _id, bool _agree) external;
function rewardPollRevokeVote(uint256 _id) external;
function rewardPollFinalize(uint256 _id) external;
function rewardPollApprovalState(uint256 _id) external view returns (bool);
}
Storage
struct RewardStorage {
uint256 rewardPollDuration;
Reward[] rewards;
}
enum RewardState { Disabled, Enabled }
struct Reward {
uint256 id;
uint256 withdrawAmount;
uint256 withdrawDuration;
uint256 pollId;
RewardState state;
}
struct RewardPollStorage {
uint256 rewardIndex;
uint256 withdrawAmount;
uint256 withdrawDuration;
}
Rationale
Backwards Compatibility
Reference Implementation
Security Considerations
Copyright
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels