Tigris Trade contest - izhelyazkov's results

A multi-chain decentralized leveraged exchange featuring instant settlement and guaranteed price execution on 30+ pairs.

General Information

Platform: Code4rena

Start Date: 09/12/2022

Pot Size: $90,500 USDC

Total HM: 35

Participants: 84

Period: 7 days

Judge: GalloDaSballo

Total Solo HM: 12

Id: 192

League: ETH

Tigris Trade

Findings Distribution

Researcher Performance

Rank: 70/84

Findings: 1

Award: $13.76

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

13.7578 USDC - $13.76

Labels

bug
2 (Med Risk)
satisfactory
duplicate-533

External Links

Lines of code

https://github.com/code-423n4/2022-12-tigris/blob/588c84b7bb354d20cbca6034544c4faa46e6a80e/contracts/StableVault.sol#L49

Vulnerability details

Impact

The StableVault has a deposit function, which allows a user to deposit a whitelisted token in exchange for tigAsset. If the whitelisted token has above 18 decimals, the deposit and depositWithPermit functions will revert, thus rendering any asset with > 18 decimals incompatible with the protocol.

Proof of Concept

  1. Deploy a MockERC20 with 19 decimals in the deploy/00.Mocks.js script.
  2. Add the following test in test/06.StableVault.js:
it("Listing and depositing a token with > 18 decimals", async function () { await stablevault.connect(owner).listToken(MockBigDecimal.address); await mockBD.connect(owner).approve(StableVault.address, 5000000); await (stablevault.connect(owner).deposit(MockBigDecimal.address, 100000)); })
  1. Result:
Error: VM Exception while processing transaction: reverted with panic code 0x11 (Arithmetic operation underflowed or overflowed outside of an unchecked block)

Tools Used

VS Code Plugins, Hardhat

Explicitly add a check or a comment if the StableVault is not meant to support tokens with > 18 decimals.

#0 - c4-judge

2022-12-20T15:43:27Z

GalloDaSballo marked the issue as duplicate of #533

#1 - c4-judge

2023-01-22T17:45:06Z

GalloDaSballo 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