GainProtocol Token Logo

GAIN [GainProtocol] Token

About GAIN

Listings

Token 2 years
white paper

Gain Protocol is the next generation DeFi Token rewarding holders with unique and innovative contract protocols designed with the community in mind. A revolutionary approach to Decentralized Finance with Holder Rewards as the top priority.

Laser Scorebeta Last Audit: 30 November 2021

report
Token is either risky or in presale. For presale 30+ is a fine score.

GainProtocol._addLiquidity(uint256,uint256) (GainProtocol.sol#1366-1384) sends eth to arbitrary user
Dangerous calls:
- (amountToken,amountETH,None) = uniswapV2Router.addLiquidityETH{value: _bnbAmount}(address(this),_tokenAmount,0,0,address(this),block.timestamp) (GainProtocol.sol#1374-1383)
Ensure that an arbitrary user cannot withdraw unauthorized funds.

Additional information: link

Reentrancy in GainProtocol._transfer(address,address,uint256) (GainProtocol.sol#1138-1177):
External calls:
- _handleLiquify() (GainProtocol.sol#1169)
- (amountToken,amountETH,None) = uniswapV2Router.addLiquidityETH{value: _bnbAmount}(address(this),_tokenAmount,0,0,address(this),block.timestamp) (GainProtocol.sol#1374-1383)
- uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(_tokenAmount,0,path,address(this),block.timestamp) (GainProtocol.sol#1331-1337)
- uniswapV2Router.swapExactETHForTokensSupportingFeeOnTransferTokens{value: _bnbAmount}(0,path,address(1),block.timestamp) (GainProtocol.sol#1357-1359)
- uniswapV2Pair.approve(address(uniswapV2Router),liquidityNeeded) (GainProtocol.sol#1409)
- uniswapV2Router.removeLiquidityETH(address(this),liquidityNeeded,0,0,address(this),block.timestamp) (GainProtocol.sol#1410-1418)
- _tokenTransfer(_from,_to,_amount) (GainProtocol.sol#1176)
- sweepstake.onTransfer(_from,_to,_tAmount,_fees.liquidity,_fees.sweepstake,_fees.team,_fees.charity,_fees.reward,_fees.hodl,_fees.whaleProtection,_tTransferAmount,_sellerBalance) (GainProtocol.sol#1852-1865)
- governance.onTransfer(_from,_to,_tAmount,_fees.liquidity,_fees.sweepstake,_fees.team,_fees.charity,_fees.reward,_fees.hodl,_fees.whaleProtection,_tTransferAmount,_sellerBalance) (GainProtocol.sol#1869-1882)
External calls sending eth:
- _handleLiquify() (GainProtocol.sol#1169)
- (amountToken,amountETH,None) = uniswapV2Router.addLiquidityETH{value: _bnbAmount}(address(this),_tokenAmount,0,0,address(this),block.timestamp) (GainProtocol.sol#1374-1383)
- uniswapV2Router.swapExactETHForTokensSupportingFeeOnTransferTokens{value: _bnbAmount}(0,path,address(1),block.timestamp) (GainProtocol.sol#1357-1359)
State variables written after the call(s):
- _tokenTransfer(_from,_to,_amount) (GainProtocol.sol#1176)
- cachedRate = _getRate() (GainProtocol.sol#1946)
- _tokenTransfer(_from,_to,_amount) (GainProtocol.sol#1176)
- collectedRewardTotal = collectedRewardTotal.add(_tAmount) (GainProtocol.sol#1945)
- _tokenTransfer(_from,_to,_amount) (GainProtocol.sol#1176)
- hodlTotalSupply = hodlTotalSupply.add(newTokens) (GainProtocol.sol#1759)
- hodlTotalSupply = hodlTotalSupply.sub(hodlTokensToRemove) (GainProtocol.sol#1831)
- _tokenTransfer(_from,_to,_amount) (GainProtocol.sol#1176)
- owners[address(this)].balance = owners[address(this)].balance.add(_rAmount) (GainProtocol.sol#1924-1926)
- owners[address(this)].balance = owners[address(this)].balance.add(_rAmount) (GainProtocol.sol#1902-1904)
- owners[address(this)].balance = owners[address(this)].balance.add(_rAmount) (GainProtocol.sol#1935-1937)
- owners[_from].dailyTransferLastUpdatedDay = uint64(dayIndex) (GainProtocol.sol#1634)
- owners[teamWallet].balance = owners[teamWallet].balance.add(_rAmount) (GainProtocol.sol#1893)
- owners[_from].dailyTransfers = 0 (GainProtocol.sol#1635)
- owners[_from].excludedFromHodlReward = true (GainProtocol.sol#1746)
- owners[_from].dailyTransfers = uint96(uint256(owners[_from].dailyTransfers).add(_tAmount)) (GainProtocol.sol#1647-1649)
- owners[_to].hodlTokens = uint96(uint256(owners[_to].hodlTokens).add(newTokens)) (GainProtocol.sol#1761-1763)
- owners[_account].balance = owners[_account].balance.add(rLiquidateAmount) (GainProtocol.sol#1828-1830)
- owners[_from].balance = owners[_from].balance.sub(tSellerSold.mul(cachedRate),Not enough funds when taking seller fee) (GainProtocol.sol#1666-1669)
- owners[_account].hodlTokens = uint96(hodlTokens.sub(hodlTokensToRemove,Not enough funds)) (GainProtocol.sol#1832-1834)
- owners[_to].balance = owners[_to].balance.add(rTransferAmount) (GainProtocol.sol#1682)
- _tokenTransfer(_from,_to,_amount) (GainProtocol.sol#1176)
- rAvailableLiquidity = rAvailableLiquidity.add(_rAmount) (GainProtocol.sol#1923)
- _tokenTransfer(_from,_to,_amount) (GainProtocol.sol#1176)
- rHodlersRewardPool = rHodlersRewardPool.add(_rAmount) (GainProtocol.sol#1915)
- rHodlersRewardPool = rHodlersRewardPool.add(_tTransferAmount.mul(cachedRate)) (GainProtocol.sol#1765-1767)
- rHodlersRewardPool = rHodlersRewardPool.sub(rLiquidateAmount) (GainProtocol.sol#1837)
- _tokenTransfer(_from,_to,_amount) (GainProtocol.sol#1176)
- rewardTotal = rewardTotal.sub(_rAmount) (GainProtocol.sol#1944)
- _tokenTransfer(_from,_to,_amount) (GainProtocol.sol#1176)
- tokenOwned[teamWallet] = tokenOwned[teamWallet].add(_tAmount) (GainProtocol.sol#1891)
- tokenOwned[_from] = tokenOwned[_from].sub(tSellerSold) (GainProtocol.sol#1671)
- tokenOwned[_to] = tokenOwned[_to].add(tTransferAmount) (GainProtocol.sol#1680)
Apply the check-effects-interactions pattern.

Additional information: link

GainProtocol._transfer(address,address,uint256) (GainProtocol.sol#1138-1177) uses a dangerous strict equality:
- associateRequest[_to] == _from && _amount == 777771234 (GainProtocol.sol#1148)
Don't use strict equality to determine if an account has enough Ether or tokens.

Additional information: link


Combination 1: Reentrancy vulnerabilities + Functions that send Ether to arbitraty destination. Usual for scams. May be justified by some complex mechanics (e.g. rebase, reflections). DYOR & manual audit are advised.

GainProtocol._removeTokensFromHodl(address,uint256) (GainProtocol.sol#1802-1838) performs a multiplication on the result of a division:
-liquidateAmount = hodlTokensToRemove.mul(tHodlersRewardPool).div(hodlTotalSupply) (GainProtocol.sol#1821-1823)
-rLiquidateAmount = liquidateAmount.mul(cachedRate) (GainProtocol.sol#1826)
Consider ordering multiplication before division.

Additional information: link

Reentrancy in GainProtocol._tokenTransfer(address,address,uint256) (GainProtocol.sol#1623-1721):
External calls:
- _onTransfer(_from,_to,_tAmount,fees,tTransferAmount,balanceOf(_from)) (GainProtocol.sol#1651-1658)
- sweepstake.onTransfer(_from,_to,_tAmount,_fees.liquidity,_fees.sweepstake,_fees.team,_fees.charity,_fees.reward,_fees.hodl,_fees.whaleProtection,_tTransferAmount,_sellerBalance) (GainProtocol.sol#1852-1865)
- governance.onTransfer(_from,_to,_tAmount,_fees.liquidity,_fees.sweepstake,_fees.team,_fees.charity,_fees.reward,_fees.hodl,_fees.whaleProtection,_tTransferAmount,_sellerBalance) (GainProtocol.sol#1869-1882)
State variables written after the call(s):
- _reflectReward(fees.reward.add(fees.whaleProtection),fees.reward.add(fees.whaleProtection).mul(cachedRate)) (GainProtocol.sol#1692-1695)
- cachedRate = _getRate() (GainProtocol.sol#1946)
- balanceAddedAsHodl = _reflectHodlTokens(_from,_to,tSellerSold,tTransferAmount) (GainProtocol.sol#1660-1665)
- hodlTotalSupply = hodlTotalSupply.add(newTokens) (GainProtocol.sol#1759)
- hodlTotalSupply = hodlTotalSupply.sub(hodlTokensToRemove) (GainProtocol.sol#1831)
- balanceAddedAsHodl = _reflectHodlTokens(_from,_to,tSellerSold,tTransferAmount) (GainProtocol.sol#1660-1665)
- owners[_from].excludedFromHodlReward = true (GainProtocol.sol#1746)
- owners[_to].hodlTokens = uint96(uint256(owners[_to].hodlTokens).add(newTokens)) (GainProtocol.sol#1761-1763)
- owners[_account].balance = owners[_account].balance.add(rLiquidateAmount) (GainProtocol.sol#1828-1830)
- owners[_account].hodlTokens = uint96(hodlTokens.sub(hodlTokensToRemove,Not enough funds)) (GainProtocol.sol#1832-1834)
- owners[_from].balance = owners[_from].balance.sub(tSellerSold.mul(cachedRate),Not enough funds when taking seller fee) (GainProtocol.sol#1666-1669)
- owners[_to].balance = owners[_to].balance.add(rTransferAmount) (GainProtocol.sol#1682)
- _reflectLiquidity(fees.liquidity.mul(cachedRate)) (GainProtocol.sol#1685)
- owners[address(this)].balance = owners[address(this)].balance.add(_rAmount) (GainProtocol.sol#1924-1926)
- _reflectSweepstakeFee(fees.sweepstake.mul(cachedRate)) (GainProtocol.sol#1686)
- owners[address(this)].balance = owners[address(this)].balance.add(_rAmount) (GainProtocol.sol#1902-1904)
- _reflectTeamFee(fees.team,fees.team.mul(cachedRate)) (GainProtocol.sol#1688)
- owners[teamWallet].balance = owners[teamWallet].balance.add(_rAmount) (GainProtocol.sol#1893)
- _reflectCharityFee(fees.charity.mul(cachedRate)) (GainProtocol.sol#1689)
- owners[address(this)].balance = owners[address(this)].balance.add(_rAmount) (GainProtocol.sol#1935-1937)
- _reflectCharityFee(fees.charity.mul(cachedRate)) (GainProtocol.sol#1689)
- rDailyCharity = rDailyCharity.add(_rAmount) (GainProtocol.sol#1933)
- balanceAddedAsHodl = _reflectHodlTokens(_from,_to,tSellerSold,tTransferAmount) (GainProtocol.sol#1660-1665)
- rHodlersRewardPool = rHodlersRewardPool.add(_tTransferAmount.mul(cachedRate)) (GainProtocol.sol#1765-1767)
- rHodlersRewardPool = rHodlersRewardPool.sub(rLiquidateAmount) (GainProtocol.sol#1837)
- _reflectHodlFee(fees.hodl,fees.hodl.mul(cachedRate)) (GainProtocol.sol#1687)
- rHodlersRewardPool = rHodlersRewardPool.add(_rAmount) (GainProtocol.sol#1915)
- tokenOwned[_from] = tokenOwned[_from].sub(tSellerSold) (GainProtocol.sol#1671)
- tokenOwned[_to] = tokenOwned[_to].add(tTransferAmount) (GainProtocol.sol#1680)
- _reflectTeamFee(fees.team,fees.team.mul(cachedRate)) (GainProtocol.sol#1688)
- tokenOwned[teamWallet] = tokenOwned[teamWallet].add(_tAmount) (GainProtocol.sol#1891)
Apply the check-effects-interactions pattern.

Additional information: link

GainPriceFeed.usdBNBPrice().answer (GainPriceFeed.sol#68) is a local variable never initialized
Initialize all the variables. If a variable is meant to be initialized to zero, explicitly set it to zero to improve code readability.

Additional information: link

GainProtocol._removeLiquidity(uint256) (GainProtocol.sol#1390-1419) ignores return value by uniswapV2Pair.approve(address(uniswapV2Router),liquidityNeeded) (GainProtocol.sol#1409)
Ensure that all the return values of the function calls are used.

Additional information: link

GainProtocol._approve(address,address,uint256)._owner (GainProtocol.sol#1094) shadows:
- Ownable._owner (Ownable.sol#20) (state variable)
Rename the local variables that shadow another component.

Additional information: link

GainProtocol.setWhaleProtectionPercentFromLP(uint256) (GainProtocol.sol#650-655) should emit an event for:
- whaleProtectionPercentFromLP = _value (GainProtocol.sol#654)
Emit an event for critical parameter changes.

Additional information: link

GainProtocol.setTeamWallet(address)._account (GainProtocol.sol#552) lacks a zero-check on :
- teamWallet = _account (GainProtocol.sol#553)
Check that the address is not zero.

Additional information: link

Variable 'GainProtocol._calculateFees(address,address,uint256).diff (GainProtocol.sol#1582-1584)' in GainProtocol._calculateFees(address,address,uint256) (GainProtocol.sol#1513-1616) potentially used before declaration: (diff) = charityLimit.trySub(tDailyCharity) (GainProtocol.sol#1602)
Move all variable declarations prior to any usage of the variable, and ensure that reaching a variable declaration does not depend on some conditional if it is used unconditionally.

Additional information: link

Reentrancy in GainProtocol.withdrawCharity(address) (GainProtocol.sol#843-848):
External calls:
- _transfer(address(this),_to,charityInTokens) (GainProtocol.sol#846)
- (amountToken,amountETH,None) = uniswapV2Router.addLiquidityETH{value: _bnbAmount}(address(this),_tokenAmount,0,0,address(this),block.timestamp) (GainProtocol.sol#1374-1383)
- sweepstake.onTransfer(_from,_to,_tAmount,_fees.liquidity,_fees.sweepstake,_fees.team,_fees.charity,_fees.reward,_fees.hodl,_fees.whaleProtection,_tTransferAmount,_sellerBalance) (GainProtocol.sol#1852-1865)
- uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(_tokenAmount,0,path,address(this),block.timestamp) (GainProtocol.sol#1331-1337)
- uniswapV2Router.swapExactETHForTokensSupportingFeeOnTransferTokens{value: _bnbAmount}(0,path,address(1),block.timestamp) (GainProtocol.sol#1357-1359)
- governance.onTransfer(_from,_to,_tAmount,_fees.liquidity,_fees.sweepstake,_fees.team,_fees.charity,_fees.reward,_fees.hodl,_fees.whaleProtection,_tTransferAmount,_sellerBalance) (GainProtocol.sol#1869-1882)
- uniswapV2Pair.approve(address(uniswapV2Router),liquidityNeeded) (GainProtocol.sol#1409)
- uniswapV2Router.removeLiquidityETH(address(this),liquidityNeeded,0,0,address(this),block.timestamp) (GainProtocol.sol#1410-1418)
External calls sending eth:
- _transfer(address(this),_to,charityInTokens) (GainProtocol.sol#846)
- (amountToken,amountETH,None) = uniswapV2Router.addLiquidityETH{value: _bnbAmount}(address(this),_tokenAmount,0,0,address(this),block.timestamp) (GainProtocol.sol#1374-1383)
- uniswapV2Router.swapExactETHForTokensSupportingFeeOnTransferTokens{value: _bnbAmount}(0,path,address(1),block.timestamp) (GainProtocol.sol#1357-1359)
State variables written after the call(s):
- collectedCharityTotal = collectedCharityTotal.add(charityInTokens) (GainProtocol.sol#847)
Apply the check-effects-interactions pattern.

Additional information: link

Reentrancy in GainProtocol.transferFrom(address,address,uint256) (GainProtocol.sol#1071-1086):
External calls:
- _transfer(_sender,_recipient,_amount) (GainProtocol.sol#1076)
- (amountToken,amountETH,None) = uniswapV2Router.addLiquidityETH{value: _bnbAmount}(address(this),_tokenAmount,0,0,address(this),block.timestamp) (GainProtocol.sol#1374-1383)
- sweepstake.onTransfer(_from,_to,_tAmount,_fees.liquidity,_fees.sweepstake,_fees.team,_fees.charity,_fees.reward,_fees.hodl,_fees.whaleProtection,_tTransferAmount,_sellerBalance) (GainProtocol.sol#1852-1865)
- uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(_tokenAmount,0,path,address(this),block.timestamp) (GainProtocol.sol#1331-1337)
- uniswapV2Router.swapExactETHForTokensSupportingFeeOnTransferTokens{value: _bnbAmount}(0,path,address(1),block.timestamp) (GainProtocol.sol#1357-1359)
- governance.onTransfer(_from,_to,_tAmount,_fees.liquidity,_fees.sweepstake,_fees.team,_fees.charity,_fees.reward,_fees.hodl,_fees.whaleProtection,_tTransferAmount,_sellerBalance) (GainProtocol.sol#1869-1882)
- uniswapV2Pair.approve(address(uniswapV2Router),liquidityNeeded) (GainProtocol.sol#1409)
- uniswapV2Router.removeLiquidityETH(address(this),liquidityNeeded,0,0,address(this),block.timestamp) (GainProtocol.sol#1410-1418)
External calls sending eth:
- _transfer(_sender,_recipient,_amount) (GainProtocol.sol#1076)
- (amountToken,amountETH,None) = uniswapV2Router.addLiquidityETH{value: _bnbAmount}(address(this),_tokenAmount,0,0,address(this),block.timestamp) (GainProtocol.sol#1374-1383)
- uniswapV2Router.swapExactETHForTokensSupportingFeeOnTransferTokens{value: _bnbAmount}(0,path,address(1),block.timestamp) (GainProtocol.sol#1357-1359)
Event emitted after the call(s):
- Approval(_owner,_spender,_amount) (GainProtocol.sol#1102)
- _approve(_sender,_msgSender(),allowances[_sender][_msgSender()].sub(_amount,ERC20: transfer amount exceeds allowance)) (GainProtocol.sol#1077-1084)
Apply the check-effects-interactions pattern.

Additional information: link

GainProtocol._max(uint256,uint256) (GainProtocol.sol#1954-1956) uses timestamp for comparisons
Dangerous comparisons:
- _a > _b (GainProtocol.sol#1955)
Avoid relying on block.timestamp.

Additional information: link

Address._verifyCallResult(bool,bytes,string) (Address.sol#171-188) uses assembly
- INLINE ASM (Address.sol#180-183)
Do not use evm assembly.

Additional information: link

Different versions of Solidity is used:
- Version used: ['>=0.5.0', '>=0.6.0', '>=0.6.0<0.8.0', '>=0.6.2', '>=0.6.2<0.8.0', '^0.6.12']
- >=0.6.2<0.8.0 (Address.sol#3)
- >=0.6.0 (AggregatorV3Interface.sol#2)
- >=0.6.0<0.8.0 (Context.sol#3)
- ^0.6.12 (GainPriceFeed.sol#3)
- ^0.6.12 (GainProtocol.sol#3)
- >=0.6.0<0.8.0 (IERC20.sol#3)
- ^0.6.12 (IGainProtocol.sol#3)
- ^0.6.12 (IGainProtocolTransferListener.sol#3)
- ^0.6.12 (IGainSweepstakes.sol#3)
- >=0.5.0 (IUniswapV2Factory.sol#1)
- >=0.5.0 (IUniswapV2Pair.sol#1)
- >=0.6.2 (IUniswapV2Router01.sol#1)
- >=0.6.2 (IUniswapV2Router02.sol#1)
- >=0.6.0<0.8.0 (Ownable.sol#3)
- >=0.6.0<0.8.0 (SafeMath.sol#3)
Use one Solidity version.

Additional information: link

GainProtocol._includeInReward(address) (GainProtocol.sol#817-838) has costly operations inside a loop:
- rewardTotal = rewardTotal.sub(owners[_account].balance).add(newBalance) (GainProtocol.sol#824-826)
Use a local variable to hold the loop computation result.

Additional information: link

SafeMath.tryMul(uint256,uint256) (SafeMath.sol#45-53) is never used and should be removed
Remove unused functions.

Additional information: link

GainProtocol.cachedRate (GainProtocol.sol#155) is set pre-construction with a non-constant function or state variable:
- rewardTotal / TOKEN_TOTAL
Remove any initialization of state variables via non-constant state variables or function calls. If variables must be set upon contract deployment, locate initialization in the constructor instead.

Additional information: link

Pragma version>=0.6.0<0.8.0 (SafeMath.sol#3) is too complex
Deploy with any of the following Solidity versions: 0.5.16 - 0.5.17, 0.6.11 - 0.6.12, 0.7.5 - 0.7.6 Use a simple pragma version that allows any of these versions. Consider using the latest version of Solidity for testing.

Additional information: link

Low level call in Address.functionDelegateCall(address,bytes,string) (Address.sol#163-169):
- (success,returndata) = target.delegatecall(data) (Address.sol#167)
Avoid low-level calls. Check the call success. If the call is meant for a contract, check for code existence

Additional information: link

Function IUniswapV2Router01.WETH() (IUniswapV2Router01.sol#5) is not in mixedCase
Follow the Solidity naming convention.

Additional information: link

Redundant expression "this (Context.sol#21)" inContext (Context.sol#15-24)
Remove redundant statements if they congest code but offer no value.

Additional information: link

Variable IUniswapV2Router01.addLiquidity(address,address,uint256,uint256,uint256,uint256,address,uint256).amountADesired (IUniswapV2Router01.sol#10) is too similar to IUniswapV2Router01.addLiquidity(address,address,uint256,uint256,uint256,uint256,address,uint256).amountBDesired (IUniswapV2Router01.sol#11)
Prevent variables from having similar names.

Additional information: link

transferOwnership(address) should be declared external:
- Ownable.transferOwnership(address) (Ownable.sol#67-74)
Use the external attribute for functions never called from the contract.

Additional information: link

Holders:


Average 30d PancakeSwap volume is low.


Average PancakeSwap trading volume, liqudity, number of swaps are low. Token seems to be inactive.


Token is deployed only at one blockchain


Token has only one trading pair


Unable to find PancakeSwap trading pair to compute liquidity.


Unable to find PancakeSwap trading pair to compute number of swaps.


Telegram account link seems to be invalid


Twitter account link seems to be invalid


Unable to find Youtube account


BscScan page for the token does not contain additional info: website, socials, description, etc.

Additional information: link


Unable to verify token contract address on the website


Young tokens have high risks of scam / price dump / death


Young tokens have high risks of scam / price dump / death


Token has a considerable age, but social accounts / website are missing or have few users


Young tokens have high risks of price dump / death


Token has relatively low CoinGecko rank


Token has relatively low CoinMarketCap rank

Price for GAIN