CertiK reviewed Layerium (Layerium - Audit) on 4 Jul 2023: 19 findings, 0 critical; 6 acknowledged, 13 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 | 0 |
| High | 0 | 3 | 0 |
| Medium | 0 | 3 | 0 |
| Low | 13 | 0 | 0 |
The `Layerium` contract grants the `_owner` maintain the authority to include/exclude address into/from the blacklist via function: - `blacklist_Add_Wallets` - `blacklist_Remove_Wallets` Also enable or disable blacklist functionality via function: - `blacklist_Switch` The blacklist will affect the token transfer with the following valuations: ```solidity=808 if (noBlackList){ require(!_isBlacklisted[from] && !_isBlacklisted[to], "This address is blacklisted. Transaction reverted.");} ``` If the private key of the `_owner` is compromised, an attacker could potentially prevent recipients from transferring their tokens.
In the contract `Layerium` the role `_owner` has authority over the functions shown in the diagram and list below. * `set_New_Router_Address()` - Set a new router address * `includeInFee()` - Remove address from exclusion from fees * `Wallet_Update_Dev()` - Register a new wallet as the `Wallet_Dev` to receive fees * `set_New_Router_and_Make_Pair()` - Set a new router and create a new pair address * `blacklist_Switch()` - Enable/disable flag to restrict blacklisted users * `remove_Random_Tokens()` - Transfer tokens in wallet to a specified address * `blacklist_Add_Wallets()` - Add a list of addresses to the blacklist * `set_Max_Transaction_Percent()` - Set max transaction amount as a percentage of the total supply * `set_Swap_And_Liquify_Enabled()` - Enable/disable the flag to allow swapping of tokens in contract for BNB * `process_Tokens_Now()` - Specify a specific percentage of the token holdings to execute a swap for BNB outside of the normal routine running of `swapTokensForBNB()` * `set_Transfers_Without_Fees()` - Enable/Disable flag to allow for no-fee token transfers * `set_New_Pair_Address()` - Set a new pair address * `_set_Fees()` - Set sell and buy fees * `blacklist_Remove_Wallets()` - Remove a list of addresses from the blacklist * `excludeFromFee()` - Add address to exclusion from fees * `set_Number_Of_Transactions_Before_Liquify_Trigger()` - Set the number of transactions between each attempt to swap tokens for BNB * `set_Max_Wallet_Percent()` - Set maxing wallet holdings allowed as a percentage of the total supply Any compromise to the `_owner` account may allow the hacker to take advantage of this authority to set important contract parameters such as the blacklist and fees, and transfer funds out of the contract.  The contract `Layerium` is inherited from `Ownable`, and the following functions are from the extension of contract `Ownable`. Any compromise to the `_owner` account may allow the hacker to control contract ownership. * `renounceOwnership()` - Give up contract ownership and set owner to address(0) * `transferOwnership()` - Transfer the contract ownership to a new address 
All of the LYUM tokens are sent to the owner address. This is a centralization risk because the owner address can distribute tokens without obtaining the consensus of the community. Any compromise to this address may allow a hacker to steal and sell tokens on the market, resulting in severe damage to the project. The contract has been deployed to the mainnet and as of July 3, 2023, the largest holder is (> 10%) is: \ lyumcexreserved.bnb: 62,089,473 LYUM (20.70%) Reference: [https://bscscan.com/token/0x09cf7ca1b4ca6ab3855f23020e8e0e9e721cc03d#balances](https://bscscan.com/token/0x09cf7ca1b4ca6ab3855f23020e8e0e9e721cc03d#balances)
In the function `_set_Fees()`, the `_sellFee` and `_buyFee` are updated, but the `_TotalFee` is not updated accordingly.
In function `process_Tokens_Now()`, the equality symbol `==` is incorrectly used to set a variable to a value. This will cause the value of `percent_Of_Tokens_To_Process` to always be its default value of 0, causing the function to always process `swapAndLiquify` with 0 tokens. ```solidity=890 function process_Tokens_Now (uint256 percent_Of_Tokens_To_Process) public onlyOwner { // Do not trigger if already in swap require(!inSwapAndLiquify, "Currently processing, try later."); if (percent_Of_Tokens_To_Process > 100){percent_Of_Tokens_To_Process == 100;} uint256 tokensOnContract = balanceOf(address(this)); uint256 sendTokens = tokensOnContract*percent_Of_Tokens_To_Process/100; swapAndLiquify(sendTokens); } ```
The `_TotalFee` initially equals `_buyFee + _sellFee`. When a user tries to buy or sell tokens, it is assigned to either `_buyFee` or `_sellFee` in the `_transfer()` function depending on whether the buy or sell leg is the pair contract. And when `noFeeToTransfer == True`, transfer between non-fee-exempt user will be charged with `_TotalFee`. ```solidity=855 if(_isExcludedFromFee[from] || _isExcludedFromFee[to] || (noFeeToTransfer && from != uniswapV2Pair && to != uniswapV2Pair)){ takeFee = false; } else if (from == uniswapV2Pair){_TotalFee = _buyFee;} else if (to == uniswapV2Pair){_TotalFee = _sellFee;} // Changing of _Totalfee based on previous transaction _tokenTransfer(from,to,amount,takeFee); } ``` Within `_transfer()` the function `_tokenTransfer()` is executed which has an external call to function `_transferTokens()`. The function makes another call to `_getValues()` to get the fee value (`tDev`) and amount to transfer (`tTransferAmount`) as shown below. ```solidity=978 function _transferTokens(address sender, address recipient, uint256 tAmount) private { (uint256 tTransferAmount, uint256 tDev) = _getValues(tAmount); ``` In the execution of function `_getValues()` the value of `_TotalFee` is used to derive the `tDev` fee value used to pay fees. ```solidity=988 function _getValues(uint256 tAmount) private view returns (uint256, uint256) { uint256 tDev = tAmount*_TotalFee/100; uint256 tTransferAmount = tAmount.sub(tDev); return (tTransferAmount, tDev); } ``` The `_TotalFee` is not reset after the particular buy or sell transaction to the `uniswapV2Pair`, therefore the original value of `_TotalFee` will be overwritten. Since there is no method to manually set the `_TotalFee` to a new value, the value will change according to transactions with the `uniswapV2Pair` address, being either equal to the `_buyFee` or `_sellFee` at any point in time.
| Address | Chain | Source code |
|---|---|---|
| 0x09cf…c03d0x09cf7ca1b4ca6ab3855f23020e8e0e9e721cc03d | Chain: BNB Chain | Source code: Verified source |
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