Canto Application Specific Dollars and Bonding Curves for 1155s - OMEN'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: 91/120

Findings: 1

Award: $4.08

QA:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

4.0797 USDC - $4.08

Labels

bug
downgraded by judge
grade-b
QA (Quality Assurance)
duplicate-124
Q-03

External Links

Lines of code

https://github.com/code-423n4/2023-11-canto/blob/335930cd53cf9a137504a57f1215be52c6d67cb3/1155tech-contracts/src/Market.sol#L114-L127

Vulnerability details

Impact

there will be front running in create Share

Proof of Concept

malicious user front run and take over that user trying to create share with specific string . attacker will create share with that string name , user transaction will be reverted.

function createNewShare( string memory _shareName, address _bondingCurve, string memory _metadataURI ) external onlyShareCreator returns (uint256 id) { require(whitelistedBondingCurves[_bondingCurve], "Bonding curve not whitelisted"); require(shareIDs[_shareName] == 0, "Share already exists");//*@audit can it be front run? id = ++shareCount; shareIDs[_shareName] = id; shareData[id].bondingCurve = _bondingCurve; shareData[id].creator = msg.sender; shareData[id].metadataURI = _metadataURI; emit ShareCreated(id, _shareName, _bondingCurve, msg.sender); }

Tools Used

manual view

mapping(string => uint256) public shareIDs; instead of string to uint256 , use hashing system and make bytes 32 to uint256 , hash the string and msg.sender , user as bytes 32

Assessed type

MEV

#0 - c4-pre-sort

2023-11-18T16:38:41Z

minhquanym marked the issue as duplicate of #124

#1 - c4-judge

2023-11-29T00:41:47Z

MarioPoneder changed the severity to QA (Quality Assurance)

#2 - c4-judge

2023-11-29T22:42:35Z

MarioPoneder 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