PiggyBankFinance.swapBack() (#532-575) sends eth to arbitrary user
Dangerous calls:
- (tmpSuccess) = address(marketingFeeReceiver).call{gas: 30000,value: amountBNBMarketing}() (#558-559)
Ensure that an arbitrary user cannot withdraw unauthorized funds.
Additional information: link
Reentrancy in PiggyBankFinance._transferFrom(address,address,uint256) (#457-495):
External calls:
- swapBack() (#479)
- router.swapExactTokensForETHSupportingFeeOnTransferTokens(amountToSwap,0,path,address(this),block.timestamp) (#542-548)
- distributor.deposit{value: amountBNBReflection}() (#557)
- (tmpSuccess) = address(marketingFeeReceiver).call{gas: 30000,value: amountBNBMarketing}() (#558-559)
- router.addLiquidityETH{value: amountBNBLiquidity}(address(this),amountToLiquify,0,0,autoLiquidityReceiver,block.timestamp) (#564-571)
External calls sending eth:
- swapBack() (#479)
- distributor.deposit{value: amountBNBReflection}() (#557)
- (tmpSuccess) = address(marketingFeeReceiver).call{gas: 30000,value: amountBNBMarketing}() (#558-559)
- router.addLiquidityETH{value: amountBNBLiquidity}(address(this),amountToLiquify,0,0,autoLiquidityReceiver,block.timestamp) (#564-571)
State variables written after the call(s):
- _balances[sender] = _balances[sender].sub(amount,Insufficient Balance) (#481)
- _balances[recipient] = _balances[recipient].add(amountReceived) (#484)
- amountReceived = takeFee(sender,amount) (#482-483)
- _balances[address(this)] = _balances[address(this)].add(feeAmount) (#513)
Apply the check-effects-interactions pattern.
Additional information: link
DividendDistributor.distributeDividend(address) (#319-331) ignores return value by REWARDS.transfer(shareholder,amount) (#324)
Use SafeERC20, or ensure that the transfer/transferFrom return value is checked.
Additional information: link
Too many vulnerabilities (Unchecked transfer, Reentrancy vulnerability, etc.). High risk of a scam. DYOR & manual audit are advised.
Unable to find manual contract audit (e.g. Certik, PeckShield, Solidity...)
PiggyBankFinance.swapBack().tmpSuccess (#558) is written in both
(tmpSuccess) = address(marketingFeeReceiver).call{gas: 30000,value: amountBNBMarketing}() (#558-559)
tmpSuccess = false (#562)
Fix or remove the writes.
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.
Combination 2: Unchecked transfer + 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.
Combination 3: Reentrancy vulnerabilities + Unchecked transfer vulnerability. Usual for scams. May be justified by some complex mechanics (e.g. rebase, reflections). DYOR & manual audit are advised.
Contract ownership is not renounced (belongs to a wallet)
Reentrancy in DividendDistributor.distributeDividend(address) (#319-331):
External calls:
- REWARDS.transfer(shareholder,amount) (#324)
State variables written after the call(s):
- shares[shareholder].totalRealised = shares[shareholder].totalRealised.add(amount) (#326-327)
- shares[shareholder].totalExcluded = getCumulativeDividends(shares[shareholder].amount) (#328-329)
Reentrancy in DividendDistributor.process(uint256) (#295-313):
External calls:
- distributeDividend(shareholders[currentIndex]) (#306)
- REWARDS.transfer(shareholder,amount) (#324)
State variables written after the call(s):
- currentIndex ++ (#310)
Reentrancy in DividendDistributor.setShare(address,uint256) (#262-276):
External calls:
- distributeDividend(shareholder) (#265)
- REWARDS.transfer(shareholder,amount) (#324)
State variables written after the call(s):
- shares[shareholder].amount = amount (#273)
- shares[shareholder].totalExcluded = getCumulativeDividends(shares[shareholder].amount) (#274-275)
Apply the check-effects-interactions pattern.
Additional information: link
PiggyBankFinance.swapBack() (#532-575) ignores return value by router.addLiquidityETH{value: amountBNBLiquidity}(address(this),amountToLiquify,0,0,autoLiquidityReceiver,block.timestamp) (#564-571)
Ensure that all the return values of the function calls are used.
Additional information: link
DividendDistributor.setDistributionCriteria(uint256,uint256) (#257-261) should emit an event for:
- minPeriod = _minPeriod (#259)
- minDistribution = _minDistribution (#260)
PiggyBankFinance.setTxLimit(uint256) (#576-578) should emit an event for:
- _maxTxAmount = amount (#577)
PiggyBankFinance.setFees(uint256,uint256,uint256,uint256) (#600-608) should emit an event for:
- liquidityFee = _liquidityFee (#602)
- reflectionFee = _reflectionFee (#603)
- marketingFee = _marketingFee (#604)
- totalFee = _liquidityFee.add(_reflectionFee).add(_marketingFee) (#605)
- feeDenominator = _feeDenominator (#606)
PiggyBankFinance.setSwapBackSettings(bool,uint256) (#614-621) should emit an event for:
- swapThreshold = _amount (#620)
PiggyBankFinance.setTargetLiquidity(uint256,uint256) (#622-626) should emit an event for:
- targetLiquidity = _target (#624)
- targetLiquidityDenominator = _denominator (#625)
Emit an event for critical parameter changes.
Additional information: link
Auth.transferOwnership(address).adr (#158) lacks a zero-check on :
- owner = adr (#159)
PiggyBankFinance.setFeeReceivers(address,address)._autoLiquidityReceiver (#609) lacks a zero-check on :
- autoLiquidityReceiver = _autoLiquidityReceiver (#611)
PiggyBankFinance.setFeeReceivers(address,address)._marketingFeeReceiver (#609-610) lacks a zero-check on :
- marketingFeeReceiver = _marketingFeeReceiver (#612)
Check that the address is not zero.
Additional information: link
DividendDistributor.distributeDividend(address) (#319-331) has external calls inside a loop: REWARDS.transfer(shareholder,amount) (#324)
Favor pull over push strategy for external calls.
Additional information: link
Reentrancy in PiggyBankFinance.constructor() (#402-423):
External calls:
- pair = IDEXFactory(router.factory()).createPair(WBNB,address(this)) (#404)
State variables written after the call(s):
- _allowances[address(this)][address(router)] = _totalSupply (#405)
- approve(routerv2,_totalSupply) (#419)
- _allowances[msg.sender][spender] = amount (#435)
- approve(address(pair),_totalSupply) (#420)
- _allowances[msg.sender][spender] = amount (#435)
- _balances[msg.sender] = _totalSupply (#421)
- autoLiquidityReceiver = DEAD (#416)
- distributor = new DividendDistributor(address(router)) (#406)
- isDividendExempt[pair] = true (#413)
- isDividendExempt[address(this)] = true (#414)
- isDividendExempt[DEAD] = true (#415)
- isFeeExempt[msg.sender] = true (#407)
- isTimelockExempt[msg.sender] = true (#410)
- isTimelockExempt[DEAD] = true (#411)
- isTimelockExempt[address(this)] = true (#412)
- isTxLimitExempt[msg.sender] = true (#408)
- marketingFeeReceiver = _marketingAdr (#417)
Reentrancy in DividendDistributor.deposit() (#277-294):
External calls:
- router.swapExactETHForTokensSupportingFeeOnTransferTokens{value: msg.value}(0,path,address(this),block.timestamp) (#282-288)
State variables written after the call(s):
- dividendsPerShare = dividendsPerShare.add(dividendsPerShareAccuracyFactor.mul(amount).div(totalShares)) (#291-293)
- totalDividends = totalDividends.add(amount) (#290)
Reentrancy in DividendDistributor.distributeDividend(address) (#319-331):
External calls:
- REWARDS.transfer(shareholder,amount) (#324)
State variables written after the call(s):
- shareholderClaims[shareholder] = block.timestamp (#325)
Reentrancy in DividendDistributor.setShare(address,uint256) (#262-276):
External calls:
- distributeDividend(shareholder) (#265)
- REWARDS.transfer(shareholder,amount) (#324)
State variables written after the call(s):
- addShareholder(shareholder) (#268)
- shareholderIndexes[shareholder] = shareholders.length (#348)
- removeShareholder(shareholder) (#270)
- shareholderIndexes[shareholders[shareholders.length - 1]] = shareholderIndexes[shareholder] (#354-355)
- addShareholder(shareholder) (#268)
- shareholders.push(shareholder) (#349)
- removeShareholder(shareholder) (#270)
- shareholders[shareholderIndexes[shareholder]] = shareholders[shareholders.length - 1] (#352-353)
- shareholders.pop() (#356)
- totalShares = totalShares.sub(shares[shareholder].amount).add(amount) (#272)
Apply the check-effects-interactions pattern.
Additional information: link
Reentrancy in PiggyBankFinance._transferFrom(address,address,uint256) (#457-495):
External calls:
- swapBack() (#479)
- router.swapExactTokensForETHSupportingFeeOnTransferTokens(amountToSwap,0,path,address(this),block.timestamp) (#542-548)
- distributor.deposit{value: amountBNBReflection}() (#557)
- (tmpSuccess) = address(marketingFeeReceiver).call{gas: 30000,value: amountBNBMarketing}() (#558-559)
- router.addLiquidityETH{value: amountBNBLiquidity}(address(this),amountToLiquify,0,0,autoLiquidityReceiver,block.timestamp) (#564-571)
- distributor.setShare(sender,_balances[sender]) (#487)
- distributor.setShare(recipient,_balances[recipient]) (#490)
- distributor.process(distributorGas) (#492)
External calls sending eth:
- swapBack() (#479)
- distributor.deposit{value: amountBNBReflection}() (#557)
- (tmpSuccess) = address(marketingFeeReceiver).call{gas: 30000,value: amountBNBMarketing}() (#558-559)
- router.addLiquidityETH{value: amountBNBLiquidity}(address(this),amountToLiquify,0,0,autoLiquidityReceiver,block.timestamp) (#564-571)
Event emitted after the call(s):
- Transfer(sender,recipient,amountReceived) (#493)
Reentrancy in PiggyBankFinance._transferFrom(address,address,uint256) (#457-495):
External calls:
- swapBack() (#479)
- router.swapExactTokensForETHSupportingFeeOnTransferTokens(amountToSwap,0,path,address(this),block.timestamp) (#542-548)
- distributor.deposit{value: amountBNBReflection}() (#557)
- (tmpSuccess) = address(marketingFeeReceiver).call{gas: 30000,value: amountBNBMarketing}() (#558-559)
- router.addLiquidityETH{value: amountBNBLiquidity}(address(this),amountToLiquify,0,0,autoLiquidityReceiver,block.timestamp) (#564-571)
External calls sending eth:
- swapBack() (#479)
- distributor.deposit{value: amountBNBReflection}() (#557)
- (tmpSuccess) = address(marketingFeeReceiver).call{gas: 30000,value: amountBNBMarketing}() (#558-559)
- router.addLiquidityETH{value: amountBNBLiquidity}(address(this),amountToLiquify,0,0,autoLiquidityReceiver,block.timestamp) (#564-571)
Event emitted after the call(s):
- Transfer(sender,address(this),feeAmount) (#514)
- amountReceived = takeFee(sender,amount) (#482-483)
Reentrancy in PiggyBankFinance.constructor() (#402-423):
External calls:
- pair = IDEXFactory(router.factory()).createPair(WBNB,address(this)) (#404)
Event emitted after the call(s):
- Approval(msg.sender,spender,amount) (#436)
- approve(routerv2,_totalSupply) (#419)
- Approval(msg.sender,spender,amount) (#436)
- approve(address(pair),_totalSupply) (#420)
- Transfer(address(0),msg.sender,_totalSupply) (#422)
Reentrancy in PiggyBankFinance.swapBack() (#532-575):
External calls:
- router.swapExactTokensForETHSupportingFeeOnTransferTokens(amountToSwap,0,path,address(this),block.timestamp) (#542-548)
- distributor.deposit{value: amountBNBReflection}() (#557)
- (tmpSuccess) = address(marketingFeeReceiver).call{gas: 30000,value: amountBNBMarketing}() (#558-559)
- router.addLiquidityETH{value: amountBNBLiquidity}(address(this),amountToLiquify,0,0,autoLiquidityReceiver,block.timestamp) (#564-571)
External calls sending eth:
- distributor.deposit{value: amountBNBReflection}() (#557)
- (tmpSuccess) = address(marketingFeeReceiver).call{gas: 30000,value: amountBNBMarketing}() (#558-559)
- router.addLiquidityETH{value: amountBNBLiquidity}(address(this),amountToLiquify,0,0,autoLiquidityReceiver,block.timestamp) (#564-571)
Event emitted after the call(s):
- AutoLiquify(amountBNBLiquidity,amountToLiquify) (#573)
Apply the check-effects-interactions pattern.
Additional information: link
DividendDistributor.shouldDistribute(address) (#315-318) uses timestamp for comparisons
Dangerous comparisons:
- shareholderClaims[shareholder] + minPeriod < block.timestamp && getUnpaidEarnings(shareholder) > minDistribution (#316-317)
PiggyBankFinance._transferFrom(address,address,uint256) (#457-495) uses timestamp for comparisons
Dangerous comparisons:
- require(bool,string)(cooldownTimer[recipient] < block.timestamp,Please wait for cooldown between buys!) (#473)
Avoid relying on block.timestamp.
Additional information: link
DividendDistributor.process(uint256) (#295-313) has costly operations inside a loop:
- currentIndex = 0 (#303)
DividendDistributor.distributeDividend(address) (#319-331) has costly operations inside a loop:
- totalDistributed = totalDistributed.add(amount) (#323)
DividendDistributor.process(uint256) (#295-313) has costly operations inside a loop:
- currentIndex ++ (#310)
Use a local variable to hold the loop computation result.
Additional information: link
SafeMath.div(uint256,uint256,string) (#80-86) is never used and should be removed
SafeMath.mod(uint256,uint256) (#70-72) is never used and should be removed
SafeMath.mod(uint256,uint256,string) (#87-93) is never used and should be removed
SafeMath.tryAdd(uint256,uint256) (#22-28) is never used and should be removed
SafeMath.tryDiv(uint256,uint256) (#46-51) is never used and should be removed
SafeMath.tryMod(uint256,uint256) (#52-57) is never used and should be removed
SafeMath.tryMul(uint256,uint256) (#35-45) is never used and should be removed
SafeMath.trySub(uint256,uint256) (#29-34) is never used and should be removed
Remove unused functions.
Additional information: link
PiggyBankFinance._maxTxAmount (#371) is set pre-construction with a non-constant function or state variable:
- _totalSupply * 1 / 100
PiggyBankFinance._maxWalletToken (#373) is set pre-construction with a non-constant function or state variable:
- (_totalSupply * 2) / 100
PiggyBankFinance.swapThreshold (#399) is set pre-construction with a non-constant function or state variable:
- _totalSupply * 10 / 10000
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
Low level call in PiggyBankFinance.swapBack() (#532-575):
- (tmpSuccess) = address(marketingFeeReceiver).call{gas: 30000,value: amountBNBMarketing}() (#558-559)
Avoid low-level calls. Check the call success. If the call is meant for a contract, check for code existence
Additional information: link
Function IDEXRouter.WETH() (#170) is not in mixedCase
Parameter DividendDistributor.setDistributionCriteria(uint256,uint256)._minPeriod (#257) is not in mixedCase
Parameter DividendDistributor.setDistributionCriteria(uint256,uint256)._minDistribution (#257) is not in mixedCase
Variable DividendDistributor._token (#219) is not in mixedCase
Variable DividendDistributor.REWARDS (#225-226) is not in mixedCase
Variable DividendDistributor.WBNB (#227) is not in mixedCase
Parameter PiggyBankFinance.cooldownEnabled(bool,uint8)._status (#528) is not in mixedCase
Parameter PiggyBankFinance.cooldownEnabled(bool,uint8)._interval (#528) is not in mixedCase
Function PiggyBankFinance.FlushToken(uint256) (#594-596) is not in mixedCase
Parameter PiggyBankFinance.setFees(uint256,uint256,uint256,uint256)._liquidityFee (#600) is not in mixedCase
Parameter PiggyBankFinance.setFees(uint256,uint256,uint256,uint256)._reflectionFee (#600) is not in mixedCase
Parameter PiggyBankFinance.setFees(uint256,uint256,uint256,uint256)._marketingFee (#600-601) is not in mixedCase
Parameter PiggyBankFinance.setFees(uint256,uint256,uint256,uint256)._feeDenominator (#601) is not in mixedCase
Parameter PiggyBankFinance.setFeeReceivers(address,address)._autoLiquidityReceiver (#609) is not in mixedCase
Parameter PiggyBankFinance.setFeeReceivers(address,address)._marketingFeeReceiver (#609-610) is not in mixedCase
Parameter PiggyBankFinance.setSwapBackSettings(bool,uint256)._enabled (#614) is not in mixedCase
Parameter PiggyBankFinance.setSwapBackSettings(bool,uint256)._amount (#614) is not in mixedCase
Parameter PiggyBankFinance.setTargetLiquidity(uint256,uint256)._target (#622) is not in mixedCase
Parameter PiggyBankFinance.setTargetLiquidity(uint256,uint256)._denominator (#622) is not in mixedCase
Parameter PiggyBankFinance.setDistributionCriteria(uint256,uint256)._minPeriod (#627) is not in mixedCase
Parameter PiggyBankFinance.setDistributionCriteria(uint256,uint256)._minDistribution (#627) is not in mixedCase
Variable PiggyBankFinance.REWARDS (#361) is not in mixedCase
Variable PiggyBankFinance.WBNB (#362) is not in mixedCase
Variable PiggyBankFinance.DEAD (#363) is not in mixedCase
Variable PiggyBankFinance.ZERO (#364) is not in mixedCase
Variable PiggyBankFinance._marketingAdr (#365) is not in mixedCase
Constant PiggyBankFinance._name (#367) is not in UPPER_CASE_WITH_UNDERSCORES
Constant PiggyBankFinance._symbol (#368) is not in UPPER_CASE_WITH_UNDERSCORES
Constant PiggyBankFinance._decimals (#369) is not in UPPER_CASE_WITH_UNDERSCORES
Variable PiggyBankFinance._totalSupply (#370) is not in mixedCase
Variable PiggyBankFinance._maxTxAmount (#371) is not in mixedCase
Variable PiggyBankFinance._maxWalletToken (#373) is not in mixedCase
Variable PiggyBankFinance._balances (#374) is not in mixedCase
Variable PiggyBankFinance._allowances (#375) is not in mixedCase
Follow the Solidity naming convention.
Additional information: link
Variable IDEXRouter.addLiquidity(address,address,uint256,uint256,uint256,uint256,address,uint256).amountADesired (#174) is too similar to IDEXRouter.addLiquidity(address,address,uint256,uint256,uint256,uint256,address,uint256).amountBDesired (#175)
Prevent variables from having similar names.
Additional information: link
PiggyBankFinance.slitherConstructorVariables() (#359-647) uses literals with too many digits:
- DEAD = 0x000000000000000000000000000000000000dEaD (#363)
PiggyBankFinance.slitherConstructorVariables() (#359-647) uses literals with too many digits:
- ZERO = 0x0000000000000000000000000000000000000000 (#364)
PiggyBankFinance.slitherConstructorVariables() (#359-647) uses literals with too many digits:
- distributorGas = 500000 (#393)
Use: Ether suffix, Time suffix, or The scientific notation
Additional information: link
PiggyBankFinance.REWARDS (#361) is never used in PiggyBankFinance (#359-647)
Remove unused state variables.
Additional information: link
DividendDistributor.WBNB (#227) should be constant
DividendDistributor.dividendsPerShareAccuracyFactor (#237) should be constant
PiggyBankFinance.DEAD (#363) should be constant
PiggyBankFinance.REWARDS (#361) should be constant
PiggyBankFinance.WBNB (#362) should be constant
PiggyBankFinance.ZERO (#364) should be constant
PiggyBankFinance._marketingAdr (#365) should be constant
PiggyBankFinance._totalSupply (#370) should be constant
PiggyBankFinance.routerv2 (#366) should be constant
PiggyBankFinance.tradingOpen (#391) should be constant
Add the constant attributes to state variables that never change.
Additional information: link
authorize(address) should be declared external:
- Auth.authorize(address) (#139-141)
transferOwnership(address) should be declared external:
- Auth.transferOwnership(address) (#158-162)
cooldownEnabled(bool,uint8) should be declared external:
- PiggyBankFinance.cooldownEnabled(bool,uint8) (#528-531)
Use the external attribute for functions never called from the contract.
Additional information: link
Unable to find website, listings and other project-related information
Young tokens have high risks of scam / price dump / death
Token has no active CoinGecko listing / rank
Token has no active CoinMarketCap listing / rank
Unable to find Telegram and Twitter accounts