Dogita - audit

CertiK1 address on BNB Chain

CertiK reviewed Dogita (Dogita - audit) on 21 May 2024: 20 findings, 0 critical; 1 marked fixed, 4 acknowledged, 15 open.

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

Report hosted on skynet.certik.com.

Trustblock does not review code.

Findings20

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

SeverityOpenAcknowledgedFixed
Critical000
High011
Medium030
Low1500
LowAbstract Base Contract Must not use `initializer(Open

In abstract/base contracts, the modifier for initialize functions must not use the `initializer()`. Otherwise, when child contracts use multiple inheritance, it will lead to the initialization function potentially being called multiple times, causing state variables to be incorrectly initialized or the initialization logic to be skipped if the internal state indicates it has already been initialized.

LowConflicting Code LogicOpen

The `process()` function is publicly accessible, yet within its body, there exists a function call to `processAccount()`, which is intended to be invoked solely by the `owner`. Consequently, non-owner accounts encounter failure when attempting to call the `process()` function due to the conflicting code logic described above. ```solidity=2820 function process(uint256 gas) public returns ( uint256, uint256, uint256 ) { .... if (canAutoClaim(lastClaimTimes[account])) { if (processAccount(payable(account), true)) { claims++; } } .... } ``` ```solidity=2874 function processAccount(address payable account, bool automatic) public onlyOwner returns (bool) { ```

LowContract gains non-withdrawable ETH via the `swapOpen

The `swapAndLiquify` function converts half of the DOGITA (DOGA) tokens to ETH. The other half of DOGITA tokens and part of the converted ETH are deposited into the LP pool on Uniswap as liquidity. For every `swapAndLiquify` function call, a small amount of ETH leftover in the contract. This is because the price of DOGITA drops after swapping the first half of DOGITA tokens into ETHs, and the other half of DOGITA tokens require less than the converted ETH to be paired with it when adding liquidity. The contract doesn't appear to provide a way to withdraw those ETH, and they will be locked in the contract forever.

LowExclude Zero Address from DividendsOpen

When initializing the contract, ensure that the zero address is excluded from receiving dividends. Failing to do so may result in dividends being allocated to burned tokens, causing these dividends to remain unclaimed within the dividend tracker contract.

LowMissing Update `_isExcludedFromFees` State VariabOpen

By default, fees are exempted for the `owner` and `_marketingWalletAddress` addresses. However, there are issues in the current code: 1. When the values of the above two addresses are updated, the old values are not included in the fees. 2. When the values of the above two addresses are updated, the new values are not automatically exempted from fees by default. ```solidity=3035 _isExcludedFromFees[owner()] = true; _isExcludedFromFees[_marketingWalletAddress] = true; _isExcludedFromFees[address(this)] = true; ``` ```solidity=881 function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _setOwner(newOwner); } ``` ```solidity=3097 function setMarketingWallet(address payable wallet) external onlyOwner { require( wallet != address(0), "BABYTOKEN: The marketing wallet cannot be the value of zero" ); require(!wallet.isContract(), "Marketing wallet cannot be a contract"); _marketingWalletAddress = wallet; } ```

LowMissing Zero Address ValidationOpen

Addresses are not validated before assignment or external calls, potentially allowing the use of zero addresses and leading to unexpected behavior or vulnerabilities. For example, transferring tokens to a zero address can result in a permanent loss of those tokens. ```solidity=3064 payable(serviceFeeReceiver_).transfer(serviceFee_); ``` - `serviceFeeReceiver_` is not zero-checked before being used.

LowNo re-charge function after exclusion of user feeOpen

The following codes are designed for excluding a specific address from fee charge accounts collection. However, there is no code logic for including a specific address in fee charge accounts collection again after excluding. ```solidity=3052 // exclude from paying fees or having max transaction amount _isExcludedFromFees[owner()] = true; _isExcludedFromFees[_marketingWalletAddress] = true; _isExcludedFromFees[address(this)] = true; ``` ```solidity=3077 function excludeFromFees(address account) external onlyOwner { require( !_isExcludedFromFees[account], "BABYTOKEN: Account is already excluded" ); _isExcludedFromFees[account] = true; emit ExcludeFromFees(account); } function excludeMultipleAccountsFromFees( address[] calldata accounts ) external onlyOwner { for (uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFees[accounts[i]] = true; } emit ExcludeMultipleAccountsFromFees(accounts); } ```

LowNo Way to Recover From `excludedFromDividends`Open

In the contract `BABYTOKENDividendTracker`, the function `excludeFromDividends()` could only exclude users from dividends. If someone is falsely to be excluded from dividends, there is no way to recover.

LowPotential Sandwich AttacksOpen

A sandwich attack may happen when an attacker observes a transaction swapping tokens or adding liquidity without setting restrictions on slippage or minimum output amount. The attacker can manipulate the exchange rate by frontrunning (executing before the target) a transaction to purchase one of the assets and make profits by backrunning (executing after the target) a transaction to sell the asset. The cited functions are called without setting restrictions on slippage or minimum output amount, so transactions triggering these functions are vulnerable to sandwich attacks, especially when the input amount is large.

LowThird-Party Dependency UsageOpen

The contract is serving as the underlying entity to interact with one or more third party protocols, `Pancake`. The scope of the audit treats third party entities as black boxes and assumes their functional correctness. However, in the real world, third parties can be compromised and this may lead to lost or stolen assets. In addition, upgrades of third parties can possibly create severe impacts, such as increasing fees of third parties, migrating to new LP pools, etc. ```solidity=2944 IUniswapV2Router02 public uniswapV2Router; ``` - The contract `DOGITA (DOGA)` interacts with third party contract with `IUniswapV2Router02` interface via `uniswapV2Router`.

Show 5 more
LowUnsafe Integer CastOpen

Type casting refers to changing an variable of one data type into another. The code contains an unsafe cast between integer types, which may result in unexpected truncation or sign flipping of the value. ```solidity=2260 int256 b = int256(a); ``` Casted expression `a` has estimated range [0, 115792089237316195423570985008687907853269984665640564039457584007913129639935] but target type `int256` has range [-57896044618658097711785492504343953926634992332820282019728792003956564819968, 57896044618658097711785492504343953926634992332820282019728792003956564819967]. --- ```solidity=2292 return int256(map.indexOf[key]); ``` Casted expression `map.indexOf[key]` has estimated range [0, 115792089237316195423570985008687907853269984665640564039457584007913129639935] but target type `int256` has range [-57896044618658097711785492504343953926634992332820282019728792003956564819968, 57896044618658097711785492504343953926634992332820282019728792003956564819967]. --- ```solidity=2755 int256(processesUntilEndOfArray) ``` Casted expression `processesUntilEndOfArray` has estimated range [0, 115792089237316195423570985008687907853269984665640564039457584007913129639935] but target type `int256` has range [-57896044618658097711785492504343953926634992332820282019728792003956564819968, 57896044618658097711785492504343953926634992332820282019728792003956564819967].

LowUsage of `transfer`/`send` for Sending Native TokOpen

It is not recommended to use Solidity's `transfer()` and `send()` functions for transferring native tokens, since some contracts may not be able to receive the funds. Those functions forward only a fixed amount of gas (2300 specifically) and the receiving contracts may run out of gas before finishing the transfer. Also, EVM instructions' gas costs may increase in the future. Thus, some contracts that can receive now may stop working in the future due to the gas limitation. ```solidity=3064 payable(serviceFeeReceiver_).transfer(serviceFee_); ``` - `BABYTOKEN.constructor` uses `transfer()`.

LowUsage of service feesOpen

The following code is intended to charge service fee values in BNB. However, a current issue with the code is that if `msg.value` exceeds `serviceFee_`, the leftover service fee is not refunded to the contract deployer. ```solidity=29999 constructor( string memory name_, string memory symbol_, uint256 totalSupply_, address[4] memory addrs, // reward, router, marketing wallet, dividendTracker uint256[3] memory feeSettings, // rewards, liquidity, marketing uint256 minimumTokenBalanceForDividends_, address serviceFeeReceiver_, uint256 serviceFee_ ) payable ERC20(name_, symbol_) { .... payable(serviceFeeReceiver_).transfer(serviceFee_); } ```

LowVariables That Could Be Declared as ImmutableOpen

The linked variables assigned in the constructor can be declared as `immutable`. Immutable state variables can be assigned during contract creation but will remain constant throughout the lifetime of a deployed contract. A big advantage of immutable variables is that reading them is significantly cheaper than reading from regular state variables since they will not be stored in storage.

LowWrong Event to EmitOpen

If the `call` at Line 94 is failed and returns false, the if-clause at Line 96~99 will handle the failure situation. Although the `withdrawnDividends[user]` is updated again at Line 97, the `emit` at Line 93 can not be updated. ```solidity=89 function _withdrawDividendOfUser(address payable user) internal returns (uint256) { uint256 _withdrawableDividend = withdrawableDividendOf(user); if (_withdrawableDividend > 0) { withdrawnDividends[user] = withdrawnDividends[user].add(_withdrawableDividend); emit DividendWithdrawn(user, _withdrawableDividend); (bool success,) = user.call{value: _withdrawableDividend, gas: 3000}(""); if(!success) { withdrawnDividends[user] = withdrawnDividends[user].sub(_withdrawableDividend); return 0; } return _withdrawableDividend; } return 0; } ```

Contracts in scope1

AddressChainSource code
0x05311d9aa0e17d1071986146ced510c85c71b52fChain: BNB ChainSource code: Verified source

Part of Dogita’s security record

Dogita
Audits5 audits by 3 firmsLast audit Sep 2024, by Cyberscope.
Critical findingsNo open critical findingsAcross 5 reports.
Open Dogita’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