Canto - solsaver's results

A layer-1 EVM powered by free public infrastructure.

General Information

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

Canto

Findings Distribution

Researcher Performance

Rank: 22/23

Findings: 1

Award: $19.36

QA:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: squeaky_cactus

Also found by: 3docSec, DevABDee, Rolezn, Shogoki, kaveyjoe, nadin, solsaver, vuquang23

Labels

bug
grade-b
low quality report
QA (Quality Assurance)
Q-01

Awards

19.3584 USDC - $19.36

External Links

Return nil to be consistent

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

Break early from loop

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

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter