Tensorplex Labs

QuantstampFiles named in the report

Quantstamp reviewed Tensorplex Labs on 21 May 2024: 10 findings, 0 critical; 6 marked fixed, 4 acknowledged.

No open critical findings
Open the reportOpen Tensorplex Labs’s security record

Report hosted on certificate.quantstamp.com.

Statuses are the security firm’s own, from this report. Trustblock does not review code.

Findings10

Statuses are the security firm’s own, from its report.

SeverityOpenAcknowledgedFixed
Critical000
High000
Medium000
Low046
Low`lastBatchNonce` Does Not Have Upper Bound Sanity CheckFixed

If `lastBatchNonce` is accidentally or maliciously set to the max `uint256` value, `submitBatch()` cannot be called anymore for the respective `_tokenWrapperAddress`. Such a sanity check is performed in `updateValset()` for the `valsetNonce`, but is missing for `lastBatchNonce`.

Low`RateLimiter` Does Not Refill After 60 SecondsFixed

`RaterLimiter.refill()` contains the condition `if (timeElapsed > 60 seconds)` to ensure that tokens will be refilled to the RateLimit only if at least one period worth of time has passed. However, if `60 seconds` have passed, there will be no refilling that takes place, as the `timeElapsed` has to be strictly greater than `60 seconds`.

LowIncorrect Revert Condition in `submitBatch()`Fixed

A revert condition in `submitBatch()` is concatenated with `&&` instead of `||`. As a result, there are edge cases where the function will not revert or revert without the correct error message. Two examples: 1. `_amounts.length > _destinations.length` but `_destinations.length == _transactionIds.length`: The function will not revert at all and the elements in the `_amounts` array after `_destinations.length - 1` index will not be considered. 2. `_amounts.length < _destinations.length` but `_destinations.length == _transactionIds.length`: The function will revert at a later point because of an array out of bounds error, but not at the intended sanity checkpoint.

LowLoss of Funds if Unsupported Chain ID SpecifiedFixed

When an unsupported chain ID is provided when calling `sendToChain()`, the burnt tokens will be lost. While a UI can protect from such a mistake, some users prefer to directly interact with smart contracts.

LowMissing Input ValidationFixed

It is crucial to validate inputs, even if the inputs come from trusted addresses, to avoid human error. A lack of robust input validation can only increase the likelihood and impact in the event of mistakes. Following is the list of places that can potentially benefit from stricter input validation: <br> - `BridgeWrapper.constructor()`: - qs-badge-acknowledged Validate that `maxBurnCapacity`, `burnRefillRate`, `maxMintCapacity`, and `mintRefillRate` are within some reasonable bound defined in the contract. - qs-badge-fixed Validate that `_maximumAmount` is larger or equal to `_minimumAmount` and `_baseFee`. - qs-badge-mitigated Validate that when assigning `baseFee`, `serviceFee`, `minimumAmount`, and `maximumAmount` in the ensure that they are within some appropriate bounds defined for this contract. - qs-badge-fixed Validate that `_minimumAmount` is greater than zero. - `BridgeWrapper.setMinimumAmount()` - qs-badge-fixed Validate that `_minimumAmount` is less or equal to `maximumAmount`. - qs-badge-fixed Validate that `_minimumAmount` is larger or equal to `baseFee`. - qs-badge-fixed Validate that `_minimumAmount` is greater than zero. - `BridgeWrapper.setMaximumAmount()` - qs-badge-fixed Validate that `_maximumAmount` is larger or equal to `minimumAmount`. - `BridgeWrapper.sendToChain()` - qs-badge-fixed Validate that `_dstChainId` is a known chain ID. This can prevent users from sending tokens to an unsupported chain and, therefore, possibly losing their funds. - qs-badge-acknowledged `_dstTokenAddress` can also be validated if the supported tokens are known. - `BridgeWrapper.receiveFromChain()` - qs-badge-fixed Validate that `_srcChainId` is a known chain ID.

LowSource Chain ID in a Submitted Batch Can Be ModifiedFixed

The `submitBatch()` function of `ConsensusBridge` takes a parameter, `_sourceChainId`, the ID of the source chain from which tokens are bridged. According to the code comments, the Tensorplex relayers use this value for record keeping. Note that `_sourceChainId` is not included in the signed data. Therefore, anyone may front-run a `submitBatch()` transaction and modify the `_sourceChainId` to an arbitrary value, while the signature validation would still succeed. This may cause inconsistent record-keeping results, especially if multiple source chains are used.

Contracts in scope

No deployed address is recorded for this audit.

The report names a repository or files. Open the report to see its scope.

Repository and files the report names (4)

  • src/RateLimiter.sol
  • src/BridgeWrapper.sol
  • src/ConsensusBridge.sol
  • src/ERC20BurnMint.sol

Part of Tensorplex Labs’s security record

Tensorplex Labs
Audits1 audit by 1 firmLast audit May 2024, by Quantstamp.
Critical findingsNo open critical findingsIn 1 report.
Open Tensorplex Labs’s security record

Security firm

Quantstamp

236 projects reviewed · 333 reports · latest Oct 2026

See Quantstamp’s audits

Something wrong on this page? A missing report, a wrong date, a finding that was fixed since. Tell us and we check it against its source.

Tell us