Mintlayer (Audit #2)

CertiKFiles named in the report

CertiK reviewed Mintlayer (Mintlayer (Audit #2)) on 8 Mar 2023: 3 findings, 1 critical; 2 marked fixed, 1 open.

1 critical finding, fixed
Open the reportOpen Mintlayer’s security record

Report hosted on skynet.certik.com.

Trustblock does not review code.

Findings3

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

SeverityOpenAcknowledgedFixed
Critical001
High000
Medium000
Low101
CriticalInsufficient Check in Function `addRoot()`Fixed

The `addRoot()` permits a holder of the `MLTToken` to create a new vesting, and it checks if the caller holds enough tokens (in L125) when calling the function. However, this check is insufficient since there is no guarantee to ensure the caller will pay for the vesting tokens. For instance, an attacker can repeatedly create the vesting with his balance or dramatically inflate his balance instantly by flashloan and creating a huge investing schedule. ```solidity=113 function addRoot( bytes32 _root, uint256 _amount, uint256 _startTimestamp, bytes32[] calldata _proofBalance ) external { bytes32 _leaf = keccak256(abi.encodePacked(_amount)); require( MerkleProof.verify(_proofBalance, _root, _leaf), 'The supply sent does not match that of the merketree' ); require(_amount <= balanceOf(msg.sender), 'Amount exceeds balance'); require(!rootWhitelist[_root], 'Root hash already exists'); rootWhitelist[_root] = true; balanceByRootHash[_root] = _amount; startTimestampByRootHash[_root] = _startTimestamp; } ``` As the function relies only on the `balanceOf(msg.sender)`, an attacker can create multiple vestings by abusing the function `addRoot()`. This can lead to disastrous consequences as the attacker will set a vesting period extremely small, then withdraw tokens earlier than the previous vesting created by legitimate users of the project. The *scenarios* and a *proof of concept* to illustrate the attack are shown below,

LowFeatures from `Ownable` not usedFixed

The contracts `MLTTokenV1` and `MLTToken` inherit of `Ownable` library from OpenZeppelin but doesn't use features from it.

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 (2)

  • contracts/MLTTokenV1.sol
  • contracts/MLTToken.sol

Part of Mintlayer’s security record

Mintlayer
Audits1 audit by 1 firmLast audit Mar 2023, by CertiK.
Critical findingsNo open critical findingsIn that report, 1 critical finding was reported. It is marked fixed by the firm that reported it.
Open Mintlayer’s security record

Security firm

CertiK

1,045 projects reviewed · 1,376 reports · latest May 2025

See CertiK’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