Canto Application Specific Dollars and Bonding Curves for 1155s - jnforja's results

Tokenizable bonding curves using a Stablecoin-as-a-Service token

General Information

Platform: Code4rena

Start Date: 13/11/2023

Pot Size: $24,500 USDC

Total HM: 3

Participants: 120

Period: 4 days

Judge: 0xTheC0der

Id: 306

League: ETH

Canto

Findings Distribution

Researcher Performance

Rank: 96/120

Findings: 1

Award: $1.37

🌟 Selected for report: 0

🚀 Solo Findings: 0

Lines of code

https://github.com/code-423n4/2023-11-canto/blob/main/1155tech-contracts/src/Market.sol#L150 https://github.com/code-423n4/2023-11-canto/blob/main/1155tech-contracts/src/Market.sol#L174 https://github.com/code-423n4/2023-11-canto/blob/main/1155tech-contracts/src/Market.sol#L194

Vulnerability details

Impact

Market::buy, Market::sell and "Market::mintNFT" lack slippage controls.

For the canto Blockchain, the lack of slippage controls will lead to sporadic situations where users will either pay more than expected for shares/mint an NFT or receive less than expected when selling shares. That's because there's no guarantee that between the time users get a price and the time the action is performed, the price hasn't changed.

According to the project's sponsor 1155tech may be deployed in blockchains other than Canto. For blockchains that allow miners to re-order transactions, the lack of slippage controls also leaves users vulnerable to sandwich attacks.

Tools Used

Manual review

For Market::buy add a parameter _maxTokensOut that indicates the maximum amount of tokens users are willing to pay for the amount of shares they want to buy. Do the same for "Market::mintNFT" so users can choose the maximum fee they want to pay for the amount of NFTs they want to mint.

For Market::sell add a parameter _minTokensIn that indicates the minimum amount of tokens users are willing to receive for the amount of shares they sell.

Assessed type

MEV

#0 - c4-pre-sort

2023-11-18T10:05:38Z

minhquanym marked the issue as duplicate of #12

#1 - c4-judge

2023-11-28T23:31:52Z

MarioPoneder marked the issue as satisfactory

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