the LockCoins Msg don't validate non-negative properties which could lead a negative subtractCoins() process in charge process, this would been a risky problem which may lead some wrong balance update and even over-minting problem.
|
func (keeper Keeper) LockCoins(ctx sdk.Context, owner sdk.AccAddress, unlockTime time.Duration, amount sdk.Coins) sdk.Error { |
|
_, err := keeper.bankKeeper.SubtractCoins(ctx, owner, amount) |
|
if err != nil { |
|
return err |
|
} |
|
lock := keeper.GetLock(ctx, owner, unlockTime) |
|
lock.Amount = lock.Amount.Add(amount) |
|
keeper.setLock(ctx, lock) |
|
return nil |
|
} |
the
LockCoinsMsg don't validate non-negative properties which could lead a negative subtractCoins() process in charge process, this would been a risky problem which may lead some wrong balance update and even over-minting problem.sikkadao/x/tokenlock/keeper.go
Lines 110 to 119 in 8790121