Skip to content

x/leverage: Lack of token validation on setRegisteredToken ( RV #18 ) #869

@toteki

Description

@toteki

Runtime Verification Audit Item 18

Issue: line 52 in keeper/token.go, in function SetRegisteredToken(ctx, token), no validation was performed on the token. Furthermore, there is no validation in InitGenesis() and handleUpdateRegistryProposalHandler() where setRegisteredToken() are called.

Effect: some of the token parameters may not meet expectation, for example, BaseBorrowRate is non-negative and KinkUtilizationRate is positive and less than 1.0.

Recommendation: call Validate() function in types/token.go before writing the token into the registry.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions