Glory Finance

CertiKFiles named in the report

CertiK reviewed Glory Finance on 23 Feb 2023: 21 findings, 3 critical; 18 marked fixed, 1 acknowledged, 2 open.

3 critical findings, fixed
Open the reportOpen Glory Finance’s security record

Report hosted on skynet.certik.com.

Trustblock does not review code.

Findings21

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

SeverityOpenAcknowledgedFixed
Critical003
High011
Medium000
Low2014
CriticalNo Roles Can Be GrantedFixed

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.

CriticalOverridden `totalSupply()` Makes It Impossible ToFixed

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.

CriticalUsers Cannot Transfer TokensFixed

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.

HighPossible For Team To Be Unable To MintFixed

It is possible after the `TIME_MINT_TO_TEAM`, that the team will be unable to mint their allotted tokens.

Low`TIME_MINT_TEAM` CommentFixed

The `TIME_MINT_TO_TEAM` is the UNIX timestamp when the team is allowed to mint themselves `10%` of the total supply.

LowAmbiguous Error MessagesFixed

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.

LowCannot Unset A Dex AddressFixed

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.

LowCheck Can Be Made A ModifierFixed

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.

LowDeprecated ContractFixed

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.

LowImproper Naming ConventionFixed

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`.

Show 8 more
LowMissing Emit EventsFixed

Privileged functions that update state variables should emit relevant events as notifications.

LowMissing Zero Address ValidationFixed

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.

LowRedundant Roles And Redundant ChecksFixed

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.

LowThe Keyword `super` Is UnnecessaryFixed

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.

LowToo Many DigitsFixed

Literals with many digits are difficult to read and review.

LowUnlocked Compiler VersionFixed

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.

LowUnnecessary Use of SafeMathFixed

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.

LowWrong InequalityFixed

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.

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/GloryToken.sol

Part of Glory Finance’s security record

Glory Finance
Audits1 audit by 1 firmLast audit Feb 2023, by CertiK.
Critical findingsNo open critical findingsIn that report, 3 critical findings were reported. Each is marked fixed by the firm that reported it.
Open Glory Finance’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