Flexible Vesting

Vesting zkApp

This contract allows investors to use a vesting function. Each project will have its own vesting contract, which is created when using Create Project with Vesting at Project contract. This contract does not allow the private key holder to change the logic or the state of the contract, ensuring the safety of the contract.

The vesting mechanism works in 2 ways:

  • Flexible vesting: Allows the builder to create a vesting request at any time and can be claimed as long as the agreement of the investor is greater than a threshold.

  • Milestone-based vesting: The Builder can only have a specific milestone created when participating in the campaign (times of vesting, amount each time, timeline to receive the vesting). This way is more strict, forcing the builder to work as planned.

It stores information about:

  • Information of vesting request

  • The public key that is used for receiving the fund.

  • Amounts of funds that the project has vested success in each campaign.

This contract will have a helper contract which is a requester, that stores the following information.

  • The voting commitment, to prevent investors to voting 2 times for a vesting request.

  • Encrypted data about the voting, is used to calculate the total voted amount without revealing the information about the voter(investor)

The contract's primary functionalities include:

  • Vote: Investor using this function to vote yes/no on the request vesting.

  • Claim Milestone Fund: Builder using this function to claim the vesting amount if the request is a success

  • Refund: Investor using this function to claim back their investment if the project not meeting the requirement.

Commitment zkApp

This contract is only used to store the commitment for vesting. It stores information about the nullifier of users' commitment to avoid double-spending.

The contract's primary functionalities include:

  • Commit: Mark the commitment is used

Last updated