Closed code423n4 closed 1 year ago
Recommended severity level: QA
JeffCX marked the issue as low quality report
if the AutoSwapThreshold is set to 0, what the warden describes is the expected behavior, no swap happens
0xean marked the issue as unsatisfactory: Invalid
Lines of code
https://github.com/code-423n4/2023-06-canto/blob/a4ff2fd2e67e77e36528fad99f9d88149a5e8532/Canto/x/onboarding/types/params.go#L81-L83
Vulnerability details
Impact
If the field
AutoSwapThreshold
is set to zero value, the logic that comparesstandardCoinBalance
to theautoSwapThreshold
always evaluates tofalse
so there isn't any swap operation from bridged asset to Canto token for users. Therefore, the purpose of theonboarding
module, which aims to help users outside of Canto onboard seamlessly, has failed.Proof of Concept
When boostraping Canto Network nodes,
onboarding
module genesis state has been initialized and fieldAutoSwapThreshold
is set to zero.After that, Bob uses Gravity Bridge for transferring whitelisted assets to Canto Network, his Canto token balance will not be increased so he still has no fund to pay gas for transactions on Canto Network.
Recommended Mitigation Steps
Change conditional expression in function
validateAutoSwapThreshold
at line 81 in fileCanto/x/onboarding/types/params.go
fromto
Assessed type
Invalid Validation