Skip to content

When losing a locked vault attack, check if there is anything to lose before doing brush transfers #65

@0xSamWitch

Description

@0xSamWitch

In LockedBankVaults.sol check if totalWon != 0 before trying all this.

    uint brushBurnt;
    if (!didAttackersWin) {
      // Lost so take a percentage from the loser's vaults
      uint amountToTreasure = totalWon / 2;
      uint amountToDao = totalWon / 4;
      brushBurnt = totalWon - (amountToTreasure + amountToDao);

      // Send to the treasure
      brush.transfer(pool, amountToTreasure);
      brush.transfer(dev, amountToDao);
      brush.burn(brushBurnt);
    }
    ```
Otherwise it can do 0 brush transfer which are not necessary, example:  https://ftmscan.com/tx/0xcdff939e3cac54bc7426ca8e62ea8398f03906fce09d62c56d80164d6b63b9bf

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions