Lossless Governance
This contract is in charge of implementing the logic regarding the voting, solving and claiming rewards over the reports.
Variables
LSS_TEAM_INDEX
TOKEN_OWNER_INDEX
COMMITEE_INDEX
COMMITTEE_ROLE
HUNDRED
committeeMembersCount
walletDisputePeriod
compensationPercentage
losslessReporting
losslessStaking
losslessController
reportVotes
Vote
proposedWalletOnReport
ProposedWallet
MemberVotesOnProposal
compensation
Compensation
LSS_TEAM_INDEX
It refers to the index corresponding to the Lossless Team.
TOKEN_OWNER_INDEX
It refers to the index corresponding to the Token Owner.
COMMITEE_INDEX
It refers to the index corresponding to the Committee Members.
COMMITTEE_ROLE
It refers to the bytes32 role utilized by OpenZeppelin’s Access Control.
HUNDRED
Used in order to calculate percentages. Constant value of 100.
committeeMembersCount
It refers to amount of members in the committee.
walletDisputePeriod
It refers to amount of time in seconds that a proposed wallet can be disputed.
compensationPercentage
It refers to the percentage dedicated for compensation when a report is solved negatively.
losslessReporting
The ILssReporting type refers to the Lossless Reporting Interface, the variable itself contains the Smart Contract address of the Lossless Reporting to allow interaction.
losslessStaking
The ILssStaking type refers to the Lossless Staking Interface, the variable itself contains the Smart Contract address of the Lossless Staking to allow interaction.
losslessController
The ILssController type refers to the Lossless Controller Interface, the variable itself contains the Smart Contract address of the Lossless Controller to allow interaction.
reportVotes
It contains all the voting information associated with a report Id via the Vote structure.
VoteIt contains all the voting information associated with a report Id in the following items
mapping(address => bool) committeeMemberVoted
- Mapping that indicates if a committee member has votedmapping(address => bool) committeeMemberClaimed
- Mapping that indicates if a committee member has claim their rewardsbool[] committeeVotes
- Votes done by the committeebool[3] votes
- Array of three votes, one per part, indicating their decisionbool[3] voted
- Array of three votes, one per part, indicating if they voted.bool resolved
- Indicates if the report has been solvedbool resolution
- Indicates the report resolutionbool losslessPayed
- Indicates if the lossless team claimed their rewardsuint256 amountReported
- Indicates the amount reported
proposedWalletOnReport
It contains the information associated with a funds retrieve wallet proposal associated with a report Id via the ProposedWallet structure.
ProposedWallet
It contains the information associated with a funds retrieve wallet proposal associated with a report Id in the following variables.
uint16 proposal
- Number of proposaluint256 retrievalAmount
- Amount to be retrieveduint256 timestamp
- Timestamp of the proposaluint16 committeeDisagree
- Amount of committee members that disagreeaddress wallet
- Wallet proposedbool status
- Indicator if the funds were claimedbool losslessVote
- Vote casted by the Lossless Teambool losslessVoted
- Indicator if the Lossless Team has votedbool tokenOwnersVote
- Vote casted by the Token Ownersbool tokenOwnersVoted
- Indicator if the Token Owners have votedbool walletAccepted
- Indicator of the proposal statemapping (uint16 => MemberVotesOnProposal) memberVotesOnProposal
- Mapping indicating if a member has voted on a proposal via theMemberVotesOnProposal
structure
MemberVotesOnProposal
It contains the indicator if a certain committee member has voted on a proposal.
compensation
It contains the indicator and amount if an address has claimed and the amount to claim using the Compensation structure
Compensation
It contains a Uint256 indicating the amount to be compensated with and a bool indicating if it has already been claimed.
Modifiers
onlyLosslessAdmin()
onlyPauseAdmin()
onlyLosslessAdmin()
This modifiers ensures that the wrapped method can only be executed by the Lossless Admin
onlyPauseAdmin()
This modifiers ensures that the wrapped method can only be executed by the Pause Admin
Events
NewCommitteeMembers(address[] _members);
CommitteeMembersRemoval(address[] _members);
LosslessTeamPositiveVote(uint256 indexed _reportId);
LosslessTeamNegativeVote(uint256 indexed _reportId);
TokenOwnersPositiveVote(uint256 indexed _reportId);
TokenOwnersNegativeVote(uint256 indexed _reportId);
CommitteeMemberPositiveVote(uint256 indexed _reportId, address indexed _member);
CommitteeMemberNegativeVote(uint256 indexed _reportId, address indexed _member);
ReportResolve(uint256 indexed _reportId, bool indexed _resolution);
WalletProposal(uint256 indexed _reportId, address indexed _wallet);
CommitteeMemberClaim(uint256 indexed _reportId, address indexed _member, uint256 indexed _amount);
CommitteeMajorityReach(uint256 indexed _reportId, bool indexed _result);
NewDisputePeriod(uint256 indexed _newPeriod);
WalletRejection(uint256 indexed _reportId);
FundsRetrieval(uint256 indexed _reportId, uint256 indexed _amount);
CompensationRetrieval(address indexed _wallet, uint256 indexed _amount);
LosslessClaim(ILERC20 indexed _token, uint256 indexed _reportID, uint256 indexed _amount);
ExtraordinaryProposalAccept(ILERC20 indexed _token);
Functions
addCommitteeMembers()
isCommitteeMember()
getIsVoted()
getVote()
isReportSolved()
reportResolution()
retrieveCompensation()
losslessVote()
tokenOwnersVote()
committeeMemberVote()
resolveReport()
proposeWallet()
rejectWallet()
losslessClaim()
claimCommitteeReward()
retrieveFunds()
pause()
unpause()
getVersion()
setCompensationAmount()
setDisputePeriod()
removeCommitteeMembers()
isReportActive()
getAmountReported()
addCommitteeMembers()
Provided list of addresses will be given the role of Committee members.
No duplicate members can ever exist in the committee. Meaning one address cannot be included in the committee twice.
Called by Lossless Admin
Name | Type | Description |
---|---|---|
| address | Array of addresses to add to the committee. |
isCommitteeMember()
Determines if an address belongs to the Committee.
Name | Type | Description |
---|---|---|
| address | Address to check if is member. |
getIsVoted()
Returns if a report has been voted by one of the three pillars.
Name | Type | Description |
---|---|---|
| Uint256 | Report ID to check voting. |
| Uint256 | Voter index. |
getVote()
Returns the resolution on a report by a team.
Name | Type | Description |
---|---|---|
| Uint256 | Report ID to vote. |
| Uint256 | Voter index. |
isReportSolved()
Returns if report has been resolved.
Name | Type | Description |
---|---|---|
| Uint256 | Report ID to check if it's solved. |
reportResolution()
Runction returns report resolution.
Name | Type | Description |
---|---|---|
| Uint256 | Report ID to it's resolution. |
retrieveCompensation()
Once report is resolved negatively or report lifetime is over reporter address become entitled to the compensation.
This feature sends compensation amount to reporter addresses wallet.
Compensation amount (CA) is equal to report stake amount (RSA) multiplied by compensation percentage (CP).
CA = CP * RSA
Compensation is payed out in stake tokens
.
Called by Staker
losslessVote()
Lossless Team has a voting power of 1/3.
Called by Lossless Admin
Name | Type | Description |
---|---|---|
| Uint256 | Report ID to vote. |
| bool | Resolution. |
tokenOwnersVote()
Token Owners have a voting power of 1/3.
Called by Token Owner
Name | Type | Description |
---|---|---|
| Uint256 | Report ID to vote. |
| bool | Resolution. |
committeeMemberVote()
All committee members have combined voting power of 1/3.
Committee vote is a result of more than 1/2 of all committee members voting one way or another.
Called by Committee members
Name | Type | Description |
---|---|---|
| Uint256 | Report ID to vote. |
| bool | Resolution. |
resolveReport()
This feature can be triggered by anyone.
It should mark reported as resolved.
Resolve positively
Meaning that report was indeed a valid report.
It should move all reported token type tokens from reported address to lossless protocol. This should be done for all reported addresses (reported both in first and second reports).
Resolve negatively
Remove reported address from the blacklist.
Enable refund payout for incorrectly blacklisted addresses.
Name | Type | Description |
---|---|---|
| Uint256 | Report ID to resolve. |
proposeWallet()
Once wallet is proposed dispute period is started.
Dispute period is set by Lossless Team
and it starts once the wallet is proposed.
Proposed wallet is set to become refund wallet after dispute period is over without any disputes.
Called by Lossless Admin
or Token Owner
Name | Type | Description |
---|---|---|
| Uint256 | Report ID to generate proposal. |
| address | Proposed wallet. |
rejectWallet()
Once 2/3 of all decision making body entities dispute a proposed wallet becomes rejected.
Once the proposed wallet is rejected dispute period is over and new wallet can be proposed.
For committee to dispute the wallet more than 1/2 of all committee members have to dispute it.
Called by Lossless Admin
, Token Owner
or Committee members
Name | Type | Description |
---|---|---|
| Uint256 | Report ID to reject proposal. |
losslessClaim()
Both Lossless Team take part of the retrieved tokens as a reward.
For Lossless Team reward (LTR) is equal to retrieved funds (RF) multiplied by lossless reward (LF)
LTR = LF * RF
Called by Lossless Admin
Name | Type | Description |
---|---|---|
| Uint256 | Report ID to claim rewards. |
claimCommitteeReward()
Committee Member take part of the retrieved tokens as a reward.
For Committee Member reward (CMR) is equal to retrieved funds (RF) multiplied by committee reward (CF) and divided by number of committee member that voted on this particular report (CM).
CMR = RF * CF / votesCountOnReport(report id)
Called by Committee members
Name | Type | Description |
---|---|---|
| Uint256 | Report ID to claim rewards. |
retrieveFunds()
Refund amount (RA) is sent to the refund wallet.
Refund amount (RA) is part of retrieved funds (RF). RA is equal to retrieved funds (RF) minus all the other rewards that other parties take.
RA = RF - (RF * CF) - LTR - SW - RW
Report is marked so that no further actions could be taken on it.
Called by Refund Wallet
Name | Type | Description |
---|---|---|
| Uint256 | Report ID to retrieve funds. |
pause
Sets the pause flag to true which in turn pauses some of the contracts functionality. Can be called only by the pauseAdmin
.
unpause
Sets the pause flag to false which in turn unpauses some of the contracts functionality. Can be called only by the pauseAdmin
.
getVersion()
This method returns the version of the smart contract.
setCompensationAmount()
Provided value is used to set compensation amount (CA).
Called by Lossless Admin
Name | Type | Description |
---|---|---|
| Uint256 | New Compensation percentage. |
setDisputePeriod()
Provided value is used for the setting new dispute period.
Dispute period is the time period in which the decision making body entities can dispute the proposed refund wallet.
Called by Lossless Admin
Name | Type | Description |
---|---|---|
| Uint256 | New dispute timeframe. |
removeCommitteeMembers()
Provided list of addresses will be revoked the role of Committee members.
Called by Lossless Admin
Name | Type | Description |
---|---|---|
| address | Array of addresses to remove from committee. |
isReportActive()
It returns if a report is still active
Name | Type | Description |
---|---|---|
| uint256 | Report Id to check if it's active. |
getAmountReported()
Returns the total balance of a reported account at the moment the report was solved.
Name | Type | Description |
---|---|---|
| uint256 | Report Id to verify. |
Last updated