Skip to content

Commit

Permalink
Merge pull request #234 from paltalabs/feat/collect-fees-method
Browse files Browse the repository at this point in the history
collect fees method
  • Loading branch information
chopan123 authored Nov 25, 2024
2 parents 25f5523 + a82293c commit f1af417
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions apps/contracts/vault/src/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,9 @@ pub trait VaultTrait {
fn get_asset_amounts_for_dftokens(e: Env, df_token: i128) -> Map<Address, i128>;

fn get_fees(e: Env) -> (u32, u32);

/// Collects the fees from the vault and transfers them to the fee receiver addresses.
fn collect_fees(e: Env) -> Result<(), ContractError>;
}

pub trait AdminInterfaceTrait {
Expand Down
5 changes: 5 additions & 0 deletions apps/contracts/vault/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,11 @@ impl VaultTrait for DeFindexVault {
let vault_fee = get_vault_fee(&e);
(defindex_protocol_fee, vault_fee)
}

fn collect_fees(e: Env) -> Result<(), ContractError> {
extend_instance_ttl(&e);
collect_fees(&e)
}
}

#[contractimpl]
Expand Down

0 comments on commit f1af417

Please sign in to comment.