I have two contracts: Vaults and Pool
The Vaults contract allows people locking funds and issue debt, this same contract allows random users to liquidate Vaults that are below the min collateral required and this function starts like this:
fn liquidate(
env: Env,
liquidator: Address,
denomination: Symbol,
total_vaults_to_liquidate: u32,
) -> Vec<Vault> {
bump_instance(&env);
liquidator.require_auth();
Now, there is also the contract Pool where hundreds of people can pool their funds and the contract takes care of liquidating vaults in Vault's contract and then distribute profits to depositors once they remove their positions... Now, since contracts can't trigger themselves someone needs to do it and so this Pool contract has a function to trigger this liquidation process, this function looks like this:
fn liquidate(env: Env, liquidator: Address) {
bump_instance(&env);
liquidator.require_auth();
Now here is the issue, with the latest preview I get the error in the title once someone tries to call the liquidate function in Pool's contract