Skip to content

Add supply goal logic to the AssetAuthVault contract #127

Description

@Hrom131

Describe the feature

Describe the feature

Description

In the current implementation of the AssetAuthVault contract, a supplier can call final_supply at any time, which may complicate the overall flow of the Lending protocol.

It is necessary to add supply goal logic to the AssetAuthVault contract. This logic requires the SUPPLY_GOAL compilation parameter and the already_supplied value in the Taproot storage of the AssetAuthVault contract itself. It is also necessary to add the is_finalized value to the Taproot storage.

This logic will also simplify the Lending contract, as it will no longer be necessary to pass LENDER_VAULT_COV_HASH and FINALIZED_LENDER_VAULT_COV_HASH (the same applies to the protocol fee parameters). Instead of these parameters, LENDER_VAULT_TAPLEAF_HASH and PROTOCOL_FEE_VAULT_TAPLEAF_HASH will be used, and the script hashes themselves will be calculated within the Lending contract.

Acceptance Criteria:

  • The SUPPLY_GOAL parameter in the AssetAuthVault contract
  • The already_supplied and is_finalized storage in the AssetAuthVault contract
  • final_supply flow on the AssetAuthVault contract only when SUPPLY_GOAL is reached
  • Updated Lending contract
  • Tests for the new logic have been added

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

Status
Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions