Tigris Trade contest - csanuragjain'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: 63/84

Findings: 1

Award: $40.75

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

Labels

bug
3 (High Risk)
partial-25
upgraded by judge
duplicate-23

Awards

40.7491 USDC - $40.75

External Links

Lines of code

https://github.com/code-423n4/2022-12-tigris/blob/main/contracts/Lock.sol#L84

Vulnerability details

Impact

As confirmed from Product team, totalLocked variable is used in UI for showing stats to User. It seems that while extending the lock, this value is not updated. This means UI will show lower Locked amount than actual. All calculations of incentives based on locked amount would also be incorrect and this also impacts investors interest in locking their amount

Proof of Concept

  1. Observe the extendLock function
function extendLock( uint _id, uint _amount, uint _period ) public { address _asset = claim(_id); IERC20(_asset).transferFrom(msg.sender, address(this), _amount); bondNFT.extendLock(_id, _asset, _amount, _period, msg.sender); }
  1. As we can see in above code snippet the local variable totalLocked[_asset] is not updated even when lock is extended by _amount . This is also not updated in bondNFT.extendLock. This means totalLocked[_asset] will show lower value than actual

Revise the extendLock function as below:

function extendLock( uint _id, uint _amount, uint _period ) public { address _asset = claim(_id); totalLocked[_asset] += _amount; IERC20(_asset).transferFrom(msg.sender, address(this), _amount); bondNFT.extendLock(_id, _asset, _amount, _period, msg.sender); }

#0 - c4-judge

2022-12-22T01:59:02Z

GalloDaSballo marked the issue as duplicate of #264

#1 - c4-judge

2023-01-16T09:48:13Z

GalloDaSballo marked the issue as partial-25

#2 - c4-judge

2023-01-16T09:48:24Z

GalloDaSballo marked the issue as duplicate of #23

#3 - c4-judge

2023-01-23T09:21:25Z

GalloDaSballo changed the severity to 3 (High Risk)

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