Lossless Governance
This contract is in charge of implementing the logic regarding the voting, solving and claiming rewards over the reports.
LSS_TEAM_INDEX
TOKEN_OWNER_INDEX
COMMITEE_INDEX
COMMITTEE_ROLE
HUNDRED
committeeMembersCount
walletDisputePeriod
compensationPercentage
losslessReporting
losslessStaking
losslessController
reportVotes
Vote
proposedWalletOnReport
ProposedWallet
MemberVotesOnProposal
compensation
Compensation
It refers to the index corresponding to the Lossless Team.
It refers to the index corresponding to the Token Owner.
It refers to the index corresponding to the Committee Members.
It refers to the bytes32 role utilized by OpenZeppelin’s Access Control.
Used in order to calculate percentages. Constant value of 100.
It refers to amount of members in the committee.
It refers to amount of time in seconds that a proposed wallet can be disputed.
It refers to the percentage dedicated for compensation when a report is solved negatively.
The ILssReporting type refers to the Lossless Reporting Interface, the variable itself contains the Smart Contract address of the Lossless Reporting to allow interaction.
The ILssStaking type refers to the Lossless Staking Interface, the variable itself contains the Smart Contract address of the Lossless Staking to allow interaction.
The ILssController type refers to the Lossless Controller Interface, the variable itself contains the Smart Contract address of the Lossless Controller to allow interaction.
It contains all the voting information associated with a report Id via the Vote structure.
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
It contains the information associated with a funds retrieve wallet proposal associated with a report Id via the ProposedWallet structure.
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
It contains the indicator if a certain committee member has voted on a proposal.
It contains the indicator and amount if an address has claimed and the amount to claim using the Compensation structure
It contains a Uint256 indicating the amount to be compensated with and a bool indicating if it has already been claimed.
onlyLosslessAdmin()
onlyPauseAdmin()
This modifiers ensures that the wrapped method can only be executed by the
Lossless Admin
This modifiers ensures that the wrapped method can only be executed by the
Pause Admin
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);
addCommitteeMembers()
isCommitteeMember()
getIsVoted()
getVote()
isReportSolved()
reportResolution()
retrieveCompensation()
losslessVote()
tokenOwnersVote()
committeeMemberVote()
resolveReport()
proposeWallet()
rejectWallet()
losslessClaim()
claimCommitteeReward()
retrieveFunds()
pause()
unpause()
getVersion()
setCompensationAmount()
setDisputePeriod()
removeCommitteeMembers()
isReportActive()
getAmountReported()
function addCommitteeMembers(address[] memory _members) override public onlyLosslessAdmin whenNotPaused
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 |
---|---|---|
_members | address | Array of addresses to add to the committee. |
function isCommitteeMember(address _account) override public view returns(bool)
Determines if an address belongs to the Committee.
Name | Type | Description |
---|---|---|
_account | address | Address to check if is member. |
function getIsVoted(uint256 _reportId, uint256 _voterIndex) override public view returns(bool)
Returns if a report has been voted by one of the three pillars.
Name | Type | Description |
---|---|---|
_reportId | Uint256 | Report ID to check voting. |
_voterIndex | Uint256 | Voter index. |
function getVote(uint256 _reportId, uint256 _voterIndex) override public view returns(bool)
Returns the resolution on a report by a team.
Name | Type | Description |
---|---|---|
_reportId | Uint256 | Report ID to vote. |
_voterIndex | Uint256 | Voter index. |
function isReportSolved(uint256 _reportId) override public view returns(bool)
Returns if report has been resolved.
Name | Type | Description |
---|---|---|
_reportId | Uint256 | Report ID to check if it's solved. |
function reportResolution(uint256 _reportId) override public view returns(bool)
Runction returns report resolution.
Name | Type | Description |
---|---|---|
_reportId | Uint256 | Report ID to it's resolution. |
function retrieveCompensation() override public whenNotPaused
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
function losslessVote(uint256 _reportId, bool _vote) override public onlyLosslessAdmin whenNotPaused
Lossless Team has a voting power of 1/3.
Called by
Lossless Admin
Name | Type | Description |
---|---|---|
_reportId | Uint256 | Report ID to vote. |
_vote | bool | Resolution. |
function tokenOwnersVote(uint256 _reportId, bool _vote) override public onlyLosslessAdmin whenNotPaused
Token Owners have a voting power of 1/3.
Called by
Token Owner
Name | Type | Description |
---|---|---|
_reportId | Uint256 | Report ID to vote. |
_vote | bool | Resolution. |
function committeeMemberVote(uint256 _reportId, bool _vote) override public whenNotPaused
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 |
---|---|---|
_reportId | Uint256 | Report ID to vote. |
_vote | bool | Resolution. |
function resolveReport(uint256 _reportId) override public whenNotPaused
This feature can be triggered by anyone.
It should mark reported as resolved.
- Resolve positivelyMeaning 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 negativelyRemove reported address from the blacklist.Enable refund payout for incorrectly blacklisted addresses.
Name | Type | Description |
---|---|---|
_reportId | Uint256 | Report ID to resolve. |
function proposeWallet(uint256 _reportId, address _wallet) override public whenNotPaused
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 |
---|---|---|
_reportId | Uint256 | Report ID to generate proposal. |
_wallet | address | Proposed wallet. |
function rejectWallet(uint256 _reportId) override public whenNotPaused
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 |
---|---|---|
_reportId | Uint256 | Report ID to reject proposal. |
function losslessClaim(uint256 _reportId) override public whenNotPaused onlyLosslessAdmin
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 |
---|---|---|
_reportId | Uint256 | Report ID to claim rewards. |
function claimCommitteeReward(uint256 _reportId) override public whenNotPaused
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 |
---|---|---|
_reportId | Uint256 | Report ID to claim rewards. |
function retrieveFunds(uint256 _reportId) override public whenNotPaused
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 |
---|---|---|
_reportId | Uint256 | Report ID to retrieve funds. |
function pause() external onlyPauseAdmin
Sets the pause flag to true which in turn pauses some of the contracts functionality. Can be called only by the
pauseAdmin
.function unpause() external onlyPauseAdmin
Sets the pause flag to false which in turn unpauses some of the contracts functionality. Can be called only by the
pauseAdmin
.function getVersion() external pure returns (uint256)
This method returns the version of the smart contract.
function setCompensationAmount(uint256 _amount) override public onlyLosslessAdmin
Provided value is used to set compensation amount (CA).
Called by
Lossless Admin
Name | Type | Description |
---|---|---|
_amount | Uint256 | New Compensation percentage. |
function setDisputePeriod(uint256 _timeFrame) override public onlyLosslessAdmin whenNotPaused
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 |
---|---|---|
_timeFrame | Uint256 | New dispute timeframe. |
function removeCommitteeMembers(address[] memory _members) override public onlyLosslessAdmin whenNotPaused
Provided list of addresses will be revoked the role of Committee members.
Called by
Lossless Admin
Name | Type | Description |
---|---|---|
_members | address | Array of addresses to remove from committee. |
function isReportActive(uint256 _reportId) public view returns(bool)
It returns if a report is still active
Name | Type | Description |
---|---|---|
_reportId | uint256 | Report Id to check if it's active. |
function getAmountReported(uint256 _reportId) override external view returns(uint256)
Returns the total balance of a reported account at the moment the report was solved.
Name | Type | Description |
---|---|---|
_reportId | uint256 | Report Id to verify. |
Last modified 1yr ago