fadeev/loan

Need Error Handling for SendCoins Function

slendermaan opened this issue · 0 comments

Credit to : HelloBloc

@fadeev

Description

In the following code content, the error handling of x.bankKeeper.SendCoins is missing, which will result in a malicious user being able to set the status without cost.

	k.bankKeeper.SendCoins(ctx, borrower, lender, amount)
	k.bankKeeper.SendCoins(ctx, borrower, lender, fee)
	k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, borrower, collateral)

	loan.State = "repayed"

Related-Code

Ignite - REF

Crytic - REF

You can use this to check your own code for this series of problems