MAGA VP audit reports

Base, BNB Chain, Ethereum, Solanamagavpcoin.com

MAGA VP has 1 public audit report from CertiK; dated 30 Apr 2024; no critical findings reported. It also holds 4 deployed contracts on 4 chains.

Critical and high findings
No open critical findings; 1 high open in the firms’ reports
Open the latest report
Your label, live
Get the label for your site

Last updated . It holds audits and findings, contracts and incidents up to Nov 2026. Trustblock does not review code.

Audits1

Newest first

ReportSecurity firmDateScopeCritical findingsFindingsSource
Maga VP - audit 1Security firm: CertiKDate: Scope: 1 address on EthereumNone openFindings: 3 high · 13 low
2 fixed · 14 open
Original removed

Findings16

16 findings in 1 report: 2 fixed, 14 open.

SeverityOpenFixed
Critical00
High12
Medium00
Low130

Not fixed (14)

HighOpenInitial Token DistributionMaga VP - audit 1 · CertiK · 30 Apr 2024

All of the MAGAVP tokens are sent to the contract deployer, which is an externally-owned account (EOA) address. This is a centralization risk because the deployer or the owner(s) of the EOAs can distribute tokens without obtaining the consensus of the community. Any compromise to these addresses may allow a hacker to steal and sell tokens on the market, resulting in severe damage to the project. ```sol=1057 uint256 totalTokenSupply = (50_000_000) * (10**18); _mint(owner(), totalTokenSupply); // only time internal mint function is ever called is to create supply ``` In addition, the comment says that the `_mint()` function is only called once in the constructor function. However, the `_setBalance()` function also calls the `_mint()` function, which allows the owner address to set the token balance of any user.

Report ↗
LowOpenCalculation of the `maxWallet` threshold includesMaga VP - audit 1 · CertiK · 30 Apr 2024

Fees are charged in the override `_transfer()` function of the `MAGAVP` contract. There is also a state variable `maxWallet` to make sure that each address does not exceed the maximum wallet token amount. ```sol=1059 maxWallet = totalTokenSupply / 50; // 2% ``` In the calculation of the `maxWallet`, our understanding is that the max holding of the receiver should be the sum of the holding tokens and the amount received from the transfer, i.e. `max holding >= already holding + newly received amount`. However, the current calculation of the max holding is calculating the fees as received amount, i.e. `max holding >= already holding + newly received amount + fees.` ```solidity=1355 require(contractBalanceRecipient + amount <= maxWallet,"Exceeds maximum wallet token amount." ); ``` - Max holding is checked. ```solidity=1376 amount = amount.sub(fees); ``` - Receiving amount is adjusted. ```solidity=326 _balances[recipient] = _balances[recipient].add(amount); ``` - Balance is increased by the adjusted amount.

Report ↗
LowOpenDiscussion on Calculations using `address(this).bMaga VP - audit 1 · CertiK · 30 Apr 2024

In the function `swapAndSendDividends()` from the contract `MAGAVP`, there are three places where the `address(this).balance` is directly used. In the contract `MAGAVP`, the `receive()` function does not contain any logic. That is to say, the native address balance (`address(this).balance`) could be directly increased when receiving transactions with `msg.value`. Related calculations could be unexpectedly changed, since the increased balance is from neither buy nor sell. ```sol=1466 if (buyRewardsFee > 0) { dividendsFromBuy = address(this) .balance .mul(buyAmount) .div(totalAmount) .mul(buyRewardsFee) .div(buyRewardsFee + buyMarketingFees + buyBuyBackFee); } if (sellRewardsFee > 0) { dividendsFromSell = address(this) .balance .mul(sellAmount) .div(totalAmount) .mul(sellRewardsFee) .div(sellRewardsFee + sellMarketingFees + sellBuyBackFee); } ``` ```sol=1492 if (_completeFees > 0) { feePortions = address(this).balance.div(_completeFees); } ```

Report ↗
LowOpenDiscussion on the `process()` functionMaga VP - audit 1 · CertiK · 30 Apr 2024

In the function call of `MAGAVP.processDividendTracker()` the function `dividendTracker.process()` will be called with a passed-in gas limit. However, in the execution of the `process()` function, if the input `gas` is not enough, the EVM may revert this call and return the out-of-gas exception. In addition, there is no access control on the `process()` function. Also, our understanding is that the users should claim their rewards themselves using the function `claim()`.

Report ↗
LowOpenEdge Case of `totalsupply` Being ZeroMaga VP - audit 1 · CertiK · 30 Apr 2024

The `distributeDividends()` function does not account for the scenario where `totalSupply()` is equal to 0. In the current implementation, the function attempts to perform a division operation with `totalSupply` as the divisor. This will result in a division by zero error, which is a critical issue that can cause the function to revert and potentially lead to unexpected behavior in the contract. ```sol=787 function distributeDividends() public payable override { require(totalSupply() > 0); if (msg.value > 0) { magnifiedDividendPerShare = magnifiedDividendPerShare.add( (msg.value).mul(magnitude) / totalSupply() ); emit DividendsDistributed(msg.sender, msg.value); totalDividendsDistributed = totalDividendsDistributed.add( msg.value ); } } ```

Report ↗
LowOpenInconsistency of calling `excludedFromDividends`Maga VP - audit 1 · CertiK · 30 Apr 2024

In the constructor function of contract `MAGAVP`, there are a few lines of codes calling the `excludeFromDividends()` function to exclude the input addresses from receiving dividends. However, we noticed that on line 1045, `dividendTracker.excludedFromDividends(address(0));` the `excludeFromDividends()` function is not called correctly. Instead, the native getter function of the state variable `excludedFromDividends` is called. ```sol=1042 dividendTracker.excludeFromDividends(address(dividendTracker)); dividendTracker.excludeFromDividends(address(this)); dividendTracker.excludeFromDividends(DEAD); dividendTracker.excludedFromDividends(address(0)); dividendTracker.excludeFromDividends(router); dividendTracker.excludeFromDividends(marketingWallet); dividendTracker.excludeFromDividends(owner()); ```

Report ↗
LowOpenMismatch of returning types for function `claim()Maga VP - audit 1 · CertiK · 30 Apr 2024

In the `MAGAVP` contract, the `claim()` function does not properly handle the return values of the external function call. ```sol=1270 function claim() external { dividendTracker.processAccount(payable(msg.sender), false); } ``` ```sol=1844 function processAccount(address payable account, bool automatic) public onlyOwner returns (bool) ``` The `MAGAVP.claim()` function does not return anything and calls `dividendTracker.processAccount()` directly, while the `dividendTracker.processAccount()` function returns a `bool` value.

Report ↗
LowOpenMissing Zero Amount Check on Input parameter of fMaga VP - audit 1 · CertiK · 30 Apr 2024

The function `swapTokensForEth()` doesn't check if the `tokenAmount` variable is above zero before executing. This could cause gas costs for each function call. ```sol=1394 function swapTokensForEth(uint256 tokenAmount) private { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, // accept any amount of ETH path, address(this), block.timestamp ); } ```

Report ↗
LowOpenPotential Sandwich AttacksMaga VP - audit 1 · CertiK · 30 Apr 2024

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 below functions call UniswapV2 interfaces without setting restrictions on slippage or minimum output amount, so transactions triggering the function are vulnerable to sandwich attacks, especially when the input amount is large. ```solidity=1399 uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, // accept any amount of ETH path, address(this), block.timestamp ); ``` Function `MAGAVP.swapTokensForEth` invokes `IUniswapV2Router02.swapExactTokensForETHSupportingFeeOnTransferTokens` without setting restrictions on slippage or minimum output amount, which may be triggered by anyone. --- ```sol=1912 uniswapV2Router .swapExactETHForTokensSupportingFeeOnTransferTokens{ value: _withdrawableDividend }( 0, // accept any amount of Tokens path, address(this), block.timestamp ) ``` Function `MAGAVP._reinvestDividendOfUser` invokes `IUniswapV2Router02.swapExactETHForTokensSupportingFeeOnTransferTokens` without setting restrictions on slippage or minimum output amount, which may be triggered by the owner address. --- ```sol=1972 uniswapV2Router .swapExactETHForTokensSupportingFeeOnTransferTokens{ value: _withdrawableDividend }( 0, // accept any amount of Tokens path, user, block.timestamp ) ``` Function `MAGAVP._withdrawDividendOfUser` invokes `IUniswapV2Router02.swapExactETHForTokensSupportingFeeOnTransferTokens` without setting restrictions on slippage or minimum output amount, which may be triggered by the owner address.

Report ↗
LowOpenState Variable Should Be Declared ConstantMaga VP - audit 1 · CertiK · 30 Apr 2024

State variables that never change should be declared as `constant` to save gas. ```solidity=923 address public DEAD = 0x000000000000000000000000000000000000dEaD; ``` - `DEAD` should be declared `constant`.

Report ↗
Show all 14
LowOpenThird-Party Dependency UsageMaga VP - audit 1 · CertiK · 30 Apr 2024

The contract is serving as the underlying entity to interact with one or more third party protocols. 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=920 IUniswapV2Router02 public uniswapV2Router; ``` - The contract `MAGAVP` interacts with third party contract with `IUniswapV2Router02` interface via `uniswapV2Router`. --- ```solidity=1546 IUniswapV2Router02 public uniswapV2Router; ``` - The contract `MAGAVPDividendTracker` interacts with third party contract with `IUniswapV2Router02` interface via `uniswapV2Router`.

Report ↗
LowOpenUnnecessary Use of SafeMathMaga VP - audit 1 · CertiK · 30 Apr 2024

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=194 using SafeMath for uint256; ``` - `SafeMath` library is used for `uint256` type in `ERC20` contract. ```solidity=272 _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); ``` - `SafeMath.sub` is called in `transferFrom` function of `ERC20` contract. *Note: Only a sample of 2 `SafeMath` library usage in this contract (out of 13) is shown above.* --- ```solidity=401 library SafeMath { ``` - An implementation of `SafeMath` library is found. --- ```solidity=194 using SafeMath for uint256; ``` - `SafeMath` library is used for `uint256` type in `ERC20` contract. ```solidity=791 magnifiedDividendPerShare = magnifiedDividendPerShare.add( (msg.value).mul(magnitude) / totalSupply() ); ``` - `SafeMath.mul` is called in `distributeDividends` function of `DividendPayingToken` contract. *Note: Only a sample of 2 `SafeMath` library usage in this contract (out of 16) is shown above.* --- ```solidity=194 using SafeMath for uint256; ``` - `SafeMath` library is used for `uint256` type in `ERC20` contract. ```solidity=1017 totalBuyFees = buyRewardsFee .add(buyMarketingFees) .add(buyBuyBackFee); ``` - `SafeMath.add` is called in `constructor` function of `MAGAVP` contract. *Note: Only a sample of 2 `SafeMath` library usage in this contract (out of 40) is shown above.* --- ```solidity=194 using SafeMath for uint256; ``` - `SafeMath` library is used for `uint256` type in `ERC20` contract. ```solidity=1721 uint256 processesUntilEndOfArray = tokenHoldersMap.keys.length > lastProcessedIndex ? tokenHoldersMap.keys.length.sub(lastProcessedIndex) : 0; ``` - `SafeMath.sub` is called in `getAccount` function of `MAGAVPDividendTracker` contract. *Note: Only a sample of 2 `SafeMath` library usage in this contract (out of 12) is shown above.*

Report ↗
LowOpenUnsafe Integer CastMaga VP - audit 1 · CertiK · 30 Apr 2024

Type casting refers to changing a 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=1727 int256(processesUntilEndOfArray) ``` Casted expression `processesUntilEndOfArray` has an estimated range [0, 115792089237316195423570985008687907853269984665640564039457584007913129639935] but target type `int256` has range [-57896044618658097711785492504343953926634992332820282019728792003956564819968, 57896044618658097711785492504343953926634992332820282019728792003956564819967]. --- ```solidity=2023 return int256(map.indexOf[key]); ``` Casted expression `map.indexOf[key]` has an estimated range [0, 115792089237316195423570985008687907853269984665640564039457584007913129639935] but target type `int256` has range [-57896044618658097711785492504343953926634992332820282019728792003956564819968, 57896044618658097711785492504343953926634992332820282019728792003956564819967].

Report ↗
LowOpenUnused state variable `gasForProcessing`Maga VP - audit 1 · CertiK · 30 Apr 2024

In the contract `MAGAVP`, the state variable `gasForProcessing` is initialized and could be modified in the function `updateGasForProcessing()`. The comment says that this variable is used as the gas amount for processing auto-claim dividends. However, the variable is never used. ```sol=948 // gas for processing auto claim dividends uint256 public gasForProcessing = 300000; ```

Report ↗

Contracts4

AddressChainSource code
55qMv1HtV8fqRjnFwDb9yDi9tBCeV8xwfgrPKgiJk5DNChain: Solana
0x58cd93c4a91c3940109fa27d700f5013b18b5dc2Chain: BaseSource code: Verified source
0xa4e8e73c8be170528385bbce78172c891f1febd7Chain: BNB ChainSource code: Verified source
0x766d2fcece1e3eef32aae8711ab886ee95fd5b2aChain: EthereumSource code: Verified source

MAGA VP: questions

Is MAGA VP audited?

Trustblock holds 1 public audit report for MAGA VP, dated 30 Apr 2024. The latest is by CertiK (“Maga VP - audit 1”).

Who audited MAGA VP?

CertiK wrote the report Trustblock holds for MAGA VP.

Are there open findings in MAGA VP’s audits?

14 findings are still open or acknowledged in the firms’ reports: 1 high, 13 low (all open). No critical finding is reported. Statuses are the security firms’ own.

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