[Development] Staking and Delegate Mechanism - Blockful

Hey Shutter Community, it’s my pleasure to bring one more update on our advances in the project:

tl;dr

At this point we have finished:

  • the staking contracts
  • most of the architecture for the delegate (non-keyper staking) contracts
  • the components for the mock front-end

This finishes the Milestone I, with a good part of Milestone II already completed also. We’d like to move forward with creating the proposal for compensation on Milestone I and should have it live in the next few days, after a window for comments here.

Time-line

The current timeline, as posted on previous updates, still stands, and we are almost done with the Delegate Smart Contract development. We have some doubts on architecture decisions, so please read ahead if you can help us define that!

Deliverables Detailing:

Staking Contracts:

The staking contracts - both the Reward Distribution and the Staking - have been tested and deployed on testnet, we’d appreciate all feedback if anyone wants to explore them. We’re still going to have a round of internal audits before the final MVP delivery, as well as an audit by cducrest, but we are open to any feedback before that. The current version is already an upgrade from an initial exploration for optimizations.

We have made some changes to the contracts to fit the 24kb limit enforced by EVM. None of that affects the core usability of the system, but can change the experience and cost of managing those contracts in the long term. We evaluate that is fine for the MVP and still delivering inside the scope, but are adding an upgrade suggestion below for following versions. The changes are as follow:

  • Ownable2Step replace for Ownable
    • Basically taking away an extra security layer we’d like to use, but is not necessary as long as the DAO manages the contracts with care.
  • Removed a function that could call Unstake and Claim at same time.
    • Both functions are still available as core part of the contract, but will need to be called separately.
    • We’ll work around it on the UX to simplify the user journey, but the transactions will need to be signed individually.
  • Removed a function that would “automatically unstake” a keypers mandatory 50k SHU upon removal from keypers list.
    • The forced unstake from the DAO side is still possible, but again, will need to be called separately as 2 transactions on the cases it is needed.
  • Remove the setKeypers function, now it is needed to call setKeyper individually to each keyper the DAO wants to add/remove
    • This will not affect the ability to add keypers and the transactions can be bundled with multicall, but the transaction costs will be bigger as they will be individual transactions.

A future upgrade of the project could fit some of those features back if the keypers list was removed from the contract and the system leveraged Hats Protocol to keep track of keypers and their permissions on the contract. This would essentially externalize the Keypers list to a Hats tree and free some contract space for the features. Considering the MVP scope of this project, we’ll be leaving that option as a recommendation for future upgrades.

You can check the contracts at:

Staking

Rewards

You can check the code on github at:

Staking

Rewards

Delegate Contracts:

The delegate contract architecture has been mostly finished, except for some questions we have that are pending confirmation. For an overview, you can check the architecture description on github. The questions we have standing are:

  • Should non-keypers also have a minimum lock time of 6 months?
    • We are assuming “yes”, but we would appreciate confirmation.
  • Should non-keypers also have a minimum lock amount of 50k SHU?
    • We are assuming “no”, but we would appreciate confirmation.

Delegate contract architecture:

https://github.com/blockful-io/shutter-staking/blob/main/docs/delegate-architecture.md

Front-End:

The necessary components for the MVP have all been created, and you can see their first mock application below and a bit of the usability in the video linked:

https://drive.google.com/file/d/15220CymFx_ALgKiJBRdlNBjoUoxwhEMG/view?usp=sharing

You can check the code at the separate front-end repo (shutter staking dapp): https://github.com/blockful-io/shutter-staking-dapp

The integration of the front-end to the contracts will happen on the end of the second milestone, and we are working in making this component library easy to work with, so any future development on top of this MVP can be easier to execute.

Feedback and Comments

For now that’s the updates we have, we’d love to have some feedback from you and confirm the answer for the questions on Delegate Contracts section.

4 Likes