Diamante Net

CertiKFiles named in the report

CertiK reviewed Diamante (Diamante Net) on 3 Apr 2024: 4 findings, 0 critical; none marked fixed.

No open critical findings
Open the reportOpen Diamante’s security record

Report hosted on skynet.certik.com.

Trustblock does not review code.

Findings4

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

SeverityOpenAcknowledgedFixed
Critical000
High000
Medium000
Low400
LowInsufficient Use of EIP712 and ECDSA in `mint()`Open

The `mint()` function in the `Diam` contract does not fully utilize the EIP712 standard and the ECDSA library already imported through the `ERC20Permit` inheritance, leading to potential signature malleability issues and a lack of distinction between signatures provided for the `mint()` and `permit()` functions. The `mint()` function should construct a structhash for the `mint()` function and use `ECDSA.recover()` for signature verification, similar to the methods used in `permit()` within `ERC20Permit`. An attacker could exploit the lack of signature malleability checks to forge signatures and mint tokens without authorization. The current implementation of the `mint()` function uses a manual construction of the message digest and `ecrecover` for signature verification. This approach lacks the security checks provided by `ECDSA.recover()` and does not fully employ methods recommended in [EIP-712](https://eips.ethereum.org/EIPS/eip-712).

LowRecover Address Signer Can Be ZeroOpen

The function `ecrecover()` can return zero, and this can lead to a vulnerability as the address of the signer is not checked properly. By default, this issue is impossible to happen because of the below validation, and the `owner()` will not be `address(0)` in the known blockchains. ```solidity=60 require(signer == owner(), "DW02"); ``` This finding is to remind that the team should check if `address(0)` account of the blockchain, on which the `Diam` contract will be deployed, is held by any user on that blockchain. If ownership is ever renounced however, minting is immediately vulnerable to anyone minting any value. This is not ideal because the likely intention behind renouncing ownership would be to make it impossible to mint more tokens.

LowUnnecessary Use of SafeMathOpen

The `SafeMath` library is used unnecessarily. With Solidity compiler versions 0.8.0 or newer, arithmetic operations will automatically revert in case of integer overflow or underflow. ```solidity=9 using SafeMath for uint256; ``` - `SafeMath` library is used for `uint256` type in `Diam` contract.

LowUse of `abi.encodePacked`Open

As a general practice, use of `abi.encodePacked` is discouraged, since it is susceptible to hash collisions in some instances where dynamically-sized inputs are used consecutively.

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

  • contracts/Main.sol

Part of Diamante’s security record

Diamante
Audits1 audit by 1 firmLast audit Apr 2024, by CertiK.
Critical findingsNo open critical findingsIn 1 report.
Open Diamante’s security record

Security firm

CertiK

1,044 projects reviewed · 1,375 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