Platform: Code4rena
Start Date: 20/06/2023
Pot Size: $36,500 USDC
Total HM: 2
Participants: 23
Period: 3 days
Judge: 0xean
Id: 252
League: ETH
Rank: 22/23
Findings: 1
Award: $19.36
🌟 Selected for report: 0
🚀 Solo Findings: 0
19.3584 USDC - $19.36
If the err
is no tnil, then coins
is returned which is uninitialized, and will use the default value.
All the other error handling return a nil
instead of uninitialized variables. This instance can be updated to follow the same pattern to avoid any confusion and incorrect usage by the caller methods.
// GetPoolBalances return the liquidity pool by the specified anotherCoinDenom func (k Keeper) GetPoolBalances(ctx sdk.Context, escrowAddress string) (coins sdk.Coins, err error) { address, err := sdk.AccAddressFromBech32(escrowAddress) if err != nil { return coins, err } ...
Code Link: https://github.com/code-423n4/2023-06-canto/blob/main/Canto/x/coinswap/keeper/pool.go#L73
In the loop, if the if
condition matches, the loop can be broken from earlier by using the break
statement right after with found = true
.
... // check source channel is in the whitelist channels var found bool for _, s := range params.WhitelistedChannels { if s == packet.DestinationChannel { found = true } } ...
Code Link: https://github.com/code-423n4/2023-06-canto/blob/main/Canto/x/onboarding/keeper/ibc_callbacks.go#L48
#0 - c4-pre-sort
2023-06-24T19:48:12Z
JeffCX marked the issue as low quality report
#1 - c4-judge
2023-07-02T01:29:22Z
0xean marked the issue as grade-b