Tegro

Tegro Smart Contract Audit Report

Share
Share
ArbitrumArbitrumBaseBase
ERC 20 Token ContractECDSA SignatureFee Deduction+2
ArbitrumArbitrumBaseBase
ERC 20 Token ContractECDSA Signature+3

QuillAudits audited the Tegro smart contracts on Arbitrum and Base between Mar 18, 2024 and Mar 29, 2024. The audit found 9 issues: 1 medium, 3 low, 5 informational, of which 7 resolved and 2 acknowledged.

Project Description

The project contains two contracts in scope, TegroDex is the contract that facilitates the actual order settlements. The seller can create and sign the order to sell any ERC20 tokens. The buyer can create and sign the order to buy tokens using the created sell order. The contract allows partial order settlements. TegroDEXSettlement allows functionality for settling orders in the batch.

Timeline

S1
Mar 18, 2024
S2
Mar 29, 2024

Scope of Audit

The scope of this audit was to analyse the Tegro Dex Contract for quality, security, and correctness.

Methodology: the QuillAudits smart contract audit process.

speedometer
0
50%
60%
70%
90%
100%
99.2%
AUDIT SCORE
icon

High

Medium

Low

Informational

open0000
acknowledged0011
partially resolved0000
resolved0124

Medium Severity Issues

Incorrect totalPrice calculation

Resolved
arrow-right
Description

When baseTokenDecimals would be greater than quoteTokenDecimals the function is unable to calculate the correct totalPrice.
Let's say the price is 1e6 (i.e. using quoteTokenDecimals ) and the quantity is 2e18 (i.e. using baseTokenDecimals which is greater than the quoteTokenDecimals).
In _calculateTotalPrice() L261 would be executed where it will calculate the price with 1e6 * 10 ** (18 - 6) which would be 1000000000000000000
Now, on L265 it will set totalPrice = 1000000000000000000 * 2e18 = 2000000000000000000000000000000000000
Then if{} on L268 will execute where it will scale down the totalPrice to remove extra decimals: totalPrice = 2000000000000000000000000000000000000 / 10 ** ( 18 + 6) = 2000000000000 
So the calculated totalPrice would be 2000000000000 which is not equal to 2e6.
The calculated totalPrice should be 2e6 because if the buyer is buying two tokens with the price 1e6 then the buyer needs to pay only 2e6 for two tokens.

Contract

TegroDEX.sol

Recommendation

Consider multiplying the price with quantity and scaling down the answer so that the answer would be in the quoteTokenDecimals i.e. the decimals that the price is using. So the _calculateTotalPrice() will only contain the following calculation which will take care of scaling down the numerator.
E.g : (price  * quantity )/ (10 ** baseTokenDecimals) 
= (1e6 * 2e18)/(10** 18) 
= 2000000000000000000000000 / 1000000000000000000
= 2000000 (i.e 2e6)

Low Severity Issues

Informational Issues

Appendix

Disclaimer

Tegro

Tegro

Medium Severity Issues
Low Severity Issues
Informational Issues
Appendix
Disclaimer
View Report PDF

Get an Audit done today for your Smart Contract

Join 1500+ leaders who secured themselves from losing Billion Dollars

cta-banner
cta-banner-bgcta-banner-bg-mobile

Related audits

WE SECURE EVERYTHING YOU BUILD.

From day-zero risk mapping to exchange-ready audits, QuillAudits helps projects grow with confidence. Smart contracts, dApps, infrastructure, compliance: secured end to end.

QuillAudits Logo


ISO 27001Circle Alliance Program
Uniswap FoundationAethiropt-collectivePolygon SPNBNB Chain Kickstart

All Rights Reserved. © 2026. QuillAudits - LLC