CertiK reviewed Glory Finance on 23 Feb 2023: 21 findings, 3 critical; 18 marked fixed, 1 acknowledged, 2 open.
Report hosted on skynet.certik.com.
Trustblock does not review code.
Statuses are the security firm’s own, from its report.
| Severity | Open | Acknowledged | Fixed |
|---|---|---|---|
| Critical | 0 | 0 | 3 |
| High | 0 | 1 | 1 |
| Medium | 0 | 0 | 0 |
| Low | 2 | 0 | 14 |
The function `grantRole()` can only be called successfully by the `DEFAULT_ADMIN_ROLE` which has not been set. In addition, the `OPERATOR_TEAM` role will not be able to be assigned.
The `totalSupply()` function should represent the amount of tokens in circulation, so it should increase by any amount that is minted and decreased by any amount that is burned. However, this is overridden to always return `MAX_SUPPLY`. This will make it impossible to call `mintPublic()` as the check that `totalSupply() + amount <= MAX_SUPPLY_PUBLIC` will always fail.
The functions `transfer()` and `transferFrom()` both call the internal `_transfer()` function which is overridden in the `GloryToken` contract. However, if the input `sender` and `receiver` are not stored in the `dexes` mapping the function calls `_transfer(sender, receiver, amount)`. This will cause a revert as this must call the `_transfer()` function from the inherited `ERC20PresetMinterPauser` contract, which must be done by using the `super` keyword as the function was overridden.
It is possible after the `TIME_MINT_TO_TEAM`, that the team will be unable to mint their allotted tokens.
The `TIME_MINT_TO_TEAM` is the UNIX timestamp when the team is allowed to mint themselves `10%` of the total supply.
The error messages when checking if the `_msg.Sender()` has the `OPERATOR_ROLE` or `OPERATOR_TEAM` role are the same. This can cause confusion as it is not clear what role the `_msgSender()` did not have to cause the revert.
It is possible that an address may accidentally be set as a DEX address using `addDexAddress()`, when the address is not a DEX causing fees to be taken when they should not be.
Multiple functions use the same check that the `_msgSender()` has the `OPERATOR_ROLE`. This check can be made a modifier to simplify the code. Similarly, the check that the `_msgSender()` is the `OPERATOR_TEAM` can be made a modifier for consistency.
The contract `GloryToken` inherits `ERC20PresetMinterPauser` which is marked as deprecated. Using deprecated contracts can cause issues in future versions as they may become incompatible with the rest of the codebase.
The naming of `_mintPublic()` does not conform to the [Solidity style guide](https://solidity.readthedocs.io/en/v0.7.3/style-guide.html#naming-conventions) with regards to its naming convention. Functions with names starting with `_` should be declared as `private` or `internal`.
Privileged functions that update state variables should emit relevant events as notifications.
The cited address input is missing a check that it is not `address(0)`. If `receiveFeeAddress` is set as `address(0)`, then users will not be able to complete transfers to or from `dex` addresses.
In order to call `mint()` the `_msgSender()` must have both the `OPERATOR_ROLE` and the `MINTER_ROLE`. The `OPERATOR_ROLE` is redundant as the `MINTER_ROLE` from the `ERC20PresetMinterPauserUpgradeable` contract already restricts access to the `mint()` function. --- In order to call `mintToTeam()` the `_msgSender()` must have the `OPERATOR_TEAM`, `OPERATOR_ROLE`, and the `MINTER_ROLE`. It is redundant to require three roles in order to call the function. --- Both the function `mintToTeam()` and `_mintPublic()` call the function `mint()`. The `mint()` function checks that the `_msgSender()` has the `OPERATOR_ROLE`, which is redundant considering `mintToTeam()` already checks they have the `OPERATOR_TEAM` role and that `_mintPublic()` checks they have the `OPERATOR_ROLE` as well.
The function `totalSupply()` is inherited and can be called directly without the `super` keyword. Similarly, the function `balanceOf()` is inherited and can be called directly without the `super` keyword.
Literals with many digits are difficult to read and review.
The contracts cited have an unlocked compiler version. An unlocked compiler version in the source code of the contract permits the user to compile it at or above a particular version. This, in turn, leads to differences in the generated bytecode between compilations due to differing compiler version numbers. This can lead to ambiguity when debugging, as compiler specific bugs may occur in the codebase that would be hard to identify over a span of multiple compiler versions rather than a specific one.
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.
When `mint()` is called, it is checked that the total supply plus the minted amount is strictly less than the `MAX_SUPPLY`. With the current value of `MAX_SUPPLY = 150_000_000 * 10 ** 18` this means that at most `149_999_999.999999999999999999` `GLR` can be minted. --- Similarly if `_mintPublic()` is called, it is checked that the total supply plus the minted amount is strictly less that the `MAX_SUPPLY_PUBLIC`. With the current value of `MAX_SUPPLY_PUBLIC = 135000000 * 10 ** 18` this means at most `134_999_999.999999999999999999` `GLR` can be minted.
The report names a repository or files. Open the report to see its scope.
Repository and files the report names (1)
1,044 projects reviewed · 1,375 reports · latest May 2025
See CertiK’s auditsSomething 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