confio / tgrade-contracts

Smart Contracts for Tgrade - PoE, DSO, AMM, and more
Other
0 stars 1 forks source link

Kicking Out on Trusted Circle with 0% slashing leads to error #410

Closed ethanfrey closed 2 years ago

ethanfrey commented 2 years ago

From Abel:

{
    "BurnEscrow": {
        "member": "tgrade1<whatever>",
        "slashing_percentage": "0",
        "kick_out": true
    }
}

would be message index: 0: dispatch: submessages: transfer to module: 0utgd: invalid coins

abefernan commented 2 years ago

The use case would be allowing to kick out someone that we don't want slashed. A real world scenario may be to remove a member that was added by mistake.

I think slashing_percentage should be of type Option<Decimal>. And slashing_percentage = "0" should behave the same way as the None variant.

Referenced type: https://github.com/confio/tgrade-contracts/blob/main/contracts/tgrade-trusted-circle/src/state.rs#L199

ethanfrey commented 2 years ago

Also nice to update cw-plus multitest so bank send/burn/mint with 0 tokens return error

ethanfrey commented 2 years ago

Required: never send on 0. Handle it without calling bank

Nice to have, accept: Option<Decimal> vs Decimal