decentraland / vesting-dashboard

📈 Decentraland's vesting dashboard
https://vesting.decentraland.org
2 stars 8 forks source link

Improving support for Paused and Revoked vesting contracts #93

Closed ginocingolani closed 1 year ago

ginocingolani commented 1 year ago

Intro

After the latest upgrades (See https://github.com/decentraland/vestings-builder/pull/50 and https://github.com/decentraland/vestings-builder/pull/41) for the Vesting Contracts logic, the Vesting Dashboard lacks complete support for the Paused and Revoked status with periodic vesting schedules.

This issue is about tackling multiple use cases regarding the previously mentioned use cases

Revoked Contracts

Currently, when a Vesting contract is revoked, there is an error when calculating the total vesting amount. See for example this Grant asking for 30k and it's vesting which got revoked at the 25k mark. In this case, the Total Vesting amount displays $25,084 when the value should be $30,000. In addition to this, the percentage of vested and released funds displays as 100% when the actual percentage should be 80.5%.

Also, the projected vesting line keeps its upward trajectory when it should drop to 0 at the same timestamp that the Grant was revoked See:

Screenshot 2023-08-29 at 13 34 57 (This screenshot is from a linear instead of a periodic vesting but the concept is the same)

It should be:

Screenshot 2023-08-29 at 13 45 23

Paused Contracts

Currently, when a Vesting gets paused, the projected vesting line keeps its upward trajectory when it should remain flat until the grant is either unpaused or revoked. See: Screenshot 2023-08-29 at 13 52 03

It should be: Screenshot 2023-08-29 at 13 59 11 The Paused marker should use a yellow color instead of red

Paused and then Revoked Contracts

When a Vesting gets paused, the behavior regarding the projected vesting line should be the same, and when the Vesting is revoked after the pause, the vesting line should drop to 0.

Screenshot 2023-08-29 at 14 23 47

Paused and then Unpaused Contracts

When a Vesting gets paused, the behavior regarding the projected vesting line should be the same, and when the Vesting is unpaused, the vesting lines (Projected and actual) should continue behaving the same as they were before the pause.

Screenshot 2023-08-29 at 14 08 20

Periodic Vesting Contracts

Vesting is real-time and the beneficiary is able to release funds as they are vested. The beneficiary has released from said funds 0% of what is currently vested.

to:

Vesting is periodic every 30 days and the beneficiary is able to release funds as they are vested. The beneficiary has released from said funds X% of what is currently vested.