[Proposal: 6] [Status: Idea] Audit for Staking Rewards Insurance Cover Contract
Abstract
We (StakeBaby) have developed a smart contract + oracle solution that enables collators to offer staking rewards insurance to their delegators. In other words, delegators can claim missed rewards due to their collator being down, or out of the active set. StakeBaby would like to seek funding from the treasury to pay for a contract audit.
Motivation
StakeBaby has spent 3 months developing the cover contract and associated oracle software. We do not think that an audit makes sense from a business perspective, and we could not afford a full-fledged audit by a popular firm anyways. However, we do think the contract will add value to the Moonbeam and Moonriver ecosystems, and thus, an audit might make sense from the Treasury’s perspective.
Project Overview and Team Experience
Collators deposit MOVR on the contract. The funds are locked and serve as a security deposit, should that collator miss a round or more. If the collator misses a round, their deposit is reduced, and the accounts of their delegators are credited accordingly. Delegators must execute a transaction to claim the cover rewards. They can do so from their account’s cover dashboard at stakemovr.com.
Since there is no on-chain method to check collator performance or get delegator information, the data must be fed into the contract through an oracle quorum. Only collators will be able to run oracles (one each).
You can find the collator-how-to draft article that explains the contract’s features and risks here:
StakeBaby has created stakemovr.com and stakeglmr.com. Both websites run on AWS, with dozens of microservices, real-time chain indexing, and 100GB-scale DB tables. In regard to Solidity, most of our experience has been in developing GitHub - ioannist/crowdrecords: A Decentralized Music Collaboration Platform
Rationale
Rewards cover will contribute towards the diversification and performance of the collator active set
- Delegators tend to avoid collators in the bottom 15% by total backing because they fear that they will exit the active set. The rewards cover could subside some of that fear, help the weakest collators, level out the playing field, and keep the set diversified.
- The cover contract allows for more efficient allocation of rewards risk. Currently, only delegators can assume this risk. With the cover contract, capable collators will be able to assume the risk at will.
- The cover contract should foster healthy competition between collators and more responsibility in keeping their nodes online.
- Finally, the cover contract will give community or delegator-backed collators, an opportunity to shine through. Anonymous, whale-backed, wallet-type collators, have no reason to provide cover, so this will be an opportunity for delegator-serving collator to differentiate.
Overall Cost
$10K to pay a Solidity security expert to audit the contract.
If the treasury board members believe we should get a full audit by a professional auditing firm, the cost would be higher. The main advantage would be higher adoption by collators.
Use of Treasury Funds
At $250 per hour, $10K would buy 40 manhours. Therefore, we would only have one milestone, that is the delivery of the audit.
Specifications
Solidity contracts + Truffle for testing
Oracle is built in Golang to provide a binary executable.
You can find the contract to be audited at
Line breakdown
Language | files | code | comment | blank | total |
---|---|---|---|---|---|
JavaScript | 6 | 2,334 | 182 | 354 | 2,870 |
Solidity | 20 | 1,834 | 991 | 356 | 3,181 |
The associated oracle software is here
Steps to Implement
1 Solidity security expert, auditing on the contract for 1 week