Granddoge - Smart Contract Audit Report

Summary

Granddoge Audit Report Granddoge is a digital token that adjusts its supply daily via a rebase based on the market cap of Dogecoin.

We audited Granddoge at commit 9e74b7ff27157e6196f8ea453f57404d2f93c063 and later at commit f8b13069b33fc01955a49038b198ff6229fef6ec on GitHub.

    Notes on the Contracts:
  • Granddoge is a fork of BASE Protocol.
  • The token's inital supply will be 100,000,000. Tokens can only be minted via a rebase.
  • The token's supply will rebase based upon the market cap of Dogecoin.
  • If the market cap of Dogecoin increases since the last rebase in relation to the token's price, each user's balance will increase in propotion to the growth.
  • The rebase function properly calls sync() on the Pancakeswap pair contract, preventing theft-of-liquidity attacks which have occured with other rebase tokens.
  • The price to determine the rebase is delivered by the team. Users must trust the team to provide honest data to the ecosystem.
  • The owner has the ability to update the orchestrator and oracle addresses at any time; as well as variables used in calculating the rebase.
  • As the mainnet contracts are behind AdminUpgradeabilityProxies, investors must ensure trust in the project team. The team could swap out these contracts and change the contracts' logic at any time.
  • SafeMath is properly utilized to prevent overflow issues.


  • Audit Findings Summary:
  • No security issues from outside attackers were identified.
  • As with any presale, ensure trust in the team prior to investing.
  • Further, ensure trust in the project team as they have substantial power in the ecosystem and can upgrade the contracts at any time.
  • Date: April 21st, 2021
  • Update Date: April 22nd, 2021 - Implementation of recommendation to sync liquidity pool after each rebase.

External Threats - Audit Results

Vulnerability CategoryNotesResult
Arbitrary Storage WriteN/APASS
Arbitrary JumpN/APASS
Delegate Call to Untrusted ContractN/APASS
Dependence on Predictable VariablesN/AWarning
Deprecated OpcodesN/APASS
Ether ThiefN/APASS
ExceptionsN/APASS
External CallsN/APASS
Flash LoansPrices are fetched from secure external oracles and time-weighted average
price oracles which are cannot be maniuplated via flash loans.
PASS
Integer Over/UnderflowN/APASS
Multiple SendsN/APASS
OraclesPrice data is provided by the team. Ensure trust in the team
as they are responsible for providing honest data to the protocol.
WARNING
SuicideN/APASS
State Change External CallsN/APASS
Unchecked RetvalN/APASS
User Supplied AssertionN/APASS
Critical Solidity CompilerN/APASS
Overall Contract Safety PASS

Function Graph

Smart Contract Graph

Inheritence Chart

Smart Contract Inheritance

Functions Overview



 ($) = payable function
 # = non-constant function
 
 Int = Internal
 Ext = External
 Pub = Public

 +  Initializable 
    - [Prv] isConstructor

 +  ContextUpgradeSafe (Initializable)
    - [Int] __Context_init #
       - modifiers: initializer
    - [Int] __Context_init_unchained #
       - modifiers: initializer
    - [Int] _msgSender
    - [Int] _msgData

 +  OwnableUpgradeSafe (Initializable, ContextUpgradeSafe)
    - [Int] __Ownable_init #
       - modifiers: initializer
    - [Int] __Ownable_init_unchained #
       - modifiers: initializer
    - [Pub] owner
    - [Pub] renounceOwnership #
       - modifiers: onlyOwner
    - [Pub] transferOwnership #
       - modifiers: onlyOwner

 + [Lib] SafeMathInt 
    - [Int] mul
    - [Int] div
    - [Int] sub
    - [Int] add
    - [Int] abs

 + [Int] IERC20 
    - [Ext] totalSupply
    - [Ext] balanceOf
    - [Ext] transfer #
    - [Ext] allowance
    - [Ext] approve #
    - [Ext] transferFrom #

 + [Lib] SafeMath 
    - [Int] add
    - [Int] sub
    - [Int] sub
    - [Int] mul
    - [Int] div
    - [Int] div
    - [Int] mod
    - [Int] mod

 + [Lib] Address 
    - [Int] isContract
    - [Int] sendValue #

 +  ERC20UpgradeSafe (Initializable, ContextUpgradeSafe, IERC20)
    - [Int] __ERC20_init #
       - modifiers: initializer
    - [Int] __ERC20_init_unchained #
       - modifiers: initializer
    - [Pub] name
    - [Pub] symbol
    - [Pub] decimals
    - [Pub] totalSupply
    - [Pub] balanceOf
    - [Pub] transfer #
    - [Pub] allowance
    - [Pub] approve #
    - [Pub] transferFrom #
    - [Pub] increaseAllowance #
    - [Pub] decreaseAllowance #
    - [Int] _transfer #
    - [Int] _mint #
    - [Int] _burn #
    - [Int] _approve #
    - [Int] _setupDecimals #
    - [Int] _beforeTokenTransfer #

 +  ERC677 
    - [Pub] transfer #
    - [Pub] transferAndCall #

 +  ERC677Receiver 
    - [Pub] onTokenTransfer #

 +  ERC677Token (ERC677)
    - [Pub] transferAndCall #
    - [Prv] contractFallback #
    - [Prv] isContract

 + [Int] ISync 
    - [Ext] sync #

 + [Int] IGulp 
    - [Ext] gulp #

 +  DogeRebaseToken (ERC20UpgradeSafe, ERC677Token, OwnableUpgradeSafe)
    - [Pub] setRebasesPaused #
       - modifiers: onlyOwner
    - [Ext] setMonetaryPolicy #
       - modifiers: onlyOwner
    - [Ext] rebase #
    - [Pub] totalShares
    - [Pub] sharesOf
    - [Pub] initialize #
       - modifiers: initializer
    - [Pub] totalSupply
    - [Pub] balanceOf
    - [Pub] transfer #
       - modifiers: validRecipient
    - [Pub] allowance
    - [Pub] transferFrom #
       - modifiers: validRecipient
    - [Pub] approve #
    - [Pub] increaseAllowance #
    - [Pub] decreaseAllowance #
							

Function Graph

Smart Contract Graph

Inheritence Chart

Smart Contract Inheritance

Functions Overview



 ($) = payable function
 # = non-constant function
 
 Int = Internal
 Ext = External
 Pub = Public

 +  Initializable 
    - [Prv] isConstructor

 +  ContextUpgradeSafe (Initializable)
    - [Int] __Context_init #
       - modifiers: initializer
    - [Int] __Context_init_unchained #
       - modifiers: initializer
    - [Int] _msgSender
    - [Int] _msgData

 +  OwnableUpgradeSafe (Initializable, ContextUpgradeSafe)
    - [Int] __Ownable_init #
       - modifiers: initializer
    - [Int] __Ownable_init_unchained #
       - modifiers: initializer
    - [Pub] owner
    - [Pub] renounceOwnership #
       - modifiers: onlyOwner
    - [Pub] transferOwnership #
       - modifiers: onlyOwner

 + [Lib] SafeMathInt 
    - [Int] mul
    - [Int] div
    - [Int] sub
    - [Int] add
    - [Int] abs

 + [Lib] UInt256Lib 
    - [Int] toInt256Safe

 + [Int] IERC20 
    - [Ext] totalSupply
    - [Ext] balanceOf
    - [Ext] transfer #
    - [Ext] allowance
    - [Ext] approve #
    - [Ext] transferFrom #

 + [Lib] SafeMath 
    - [Int] add
    - [Int] sub
    - [Int] sub
    - [Int] mul
    - [Int] div
    - [Int] div
    - [Int] mod
    - [Int] mod

 + [Lib] Address 
    - [Int] isContract
    - [Int] sendValue #

 +  ERC20UpgradeSafe (Initializable, ContextUpgradeSafe, IERC20)
    - [Int] __ERC20_init #
       - modifiers: initializer
    - [Int] __ERC20_init_unchained #
       - modifiers: initializer
    - [Pub] name
    - [Pub] symbol
    - [Pub] decimals
    - [Pub] totalSupply
    - [Pub] balanceOf
    - [Pub] transfer #
    - [Pub] allowance
    - [Pub] approve #
    - [Pub] transferFrom #
    - [Pub] increaseAllowance #
    - [Pub] decreaseAllowance #
    - [Int] _transfer #
    - [Int] _mint #
    - [Int] _burn #
    - [Int] _approve #
    - [Int] _setupDecimals #
    - [Int] _beforeTokenTransfer #

 +  ERC677 
    - [Pub] transfer #
    - [Pub] transferAndCall #

 +  ERC677Receiver 
    - [Pub] onTokenTransfer #

 +  ERC677Token (ERC677)
    - [Pub] transferAndCall #
    - [Prv] contractFallback #
    - [Prv] isContract

 + [Int] ISync 
    - [Ext] sync #

 + [Int] IGulp 
    - [Ext] gulp #

 +  DogeRebaseToken (ERC20UpgradeSafe, ERC677Token, OwnableUpgradeSafe)
    - [Pub] setRebasesPaused #
       - modifiers: onlyOwner
    - [Ext] setMonetaryPolicy #
       - modifiers: onlyOwner
    - [Ext] rebase #
    - [Pub] totalShares
    - [Pub] sharesOf
    - [Pub] initialize #
       - modifiers: initializer
    - [Pub] totalSupply
    - [Pub] balanceOf
    - [Pub] transfer #
       - modifiers: validRecipient
    - [Pub] allowance
    - [Pub] transferFrom #
       - modifiers: validRecipient
    - [Pub] approve #
    - [Pub] increaseAllowance #
    - [Pub] decreaseAllowance #

 + [Int] IOracle 
    - [Ext] getData

 +  DogeRebaseTokenMonetaryPolicy (OwnableUpgradeSafe)
    - [Pub] setBASEToken #
       - modifiers: onlyOwner
    - [Ext] rebase #
    - [Pub] getNextSupplyDelta
    - [Ext] setTargetPriceOracle #
       - modifiers: onlyOwner
    - [Ext] setTokenPriceOracle #
       - modifiers: onlyOwner
    - [Ext] setOrchestrator #
       - modifiers: onlyOwner
    - [Ext] setDeviationThreshold #
       - modifiers: onlyOwner
    - [Ext] setRebaseLag #
       - modifiers: onlyOwner
    - [Ext] setRebaseTimingParameters #
       - modifiers: onlyOwner
    - [Pub] initialize #
       - modifiers: initializer
    - [Pub] inRebaseWindow
    - [Pub] computeSupplyDelta
    - [Prv] withinDeviationThreshold
							

Function Graph

Smart Contract Graph

Inheritence Chart

Smart Contract Inheritance

Functions Overview



 ($) = payable function
 # = non-constant function
 
 Int = Internal
 Ext = External
 Pub = Public

 +  Initializable 
    - [Prv] isConstructor

 +  ContextUpgradeSafe (Initializable)
    - [Int] __Context_init #
       - modifiers: initializer
    - [Int] __Context_init_unchained #
       - modifiers: initializer
    - [Int] _msgSender
    - [Int] _msgData

 +  OwnableUpgradeSafe (Initializable, ContextUpgradeSafe)
    - [Int] __Ownable_init #
       - modifiers: initializer
    - [Int] __Ownable_init_unchained #
       - modifiers: initializer
    - [Pub] owner
    - [Pub] renounceOwnership #
       - modifiers: onlyOwner
    - [Pub] transferOwnership #
       - modifiers: onlyOwner

 + [Lib] SafeMathInt 
    - [Int] mul
    - [Int] div
    - [Int] sub
    - [Int] add
    - [Int] abs

 + [Lib] UInt256Lib 
    - [Int] toInt256Safe

 + [Int] IERC20 
    - [Ext] totalSupply
    - [Ext] balanceOf
    - [Ext] transfer #
    - [Ext] allowance
    - [Ext] approve #
    - [Ext] transferFrom #

 + [Lib] SafeMath 
    - [Int] add
    - [Int] sub
    - [Int] sub
    - [Int] mul
    - [Int] div
    - [Int] div
    - [Int] mod
    - [Int] mod

 + [Lib] Address 
    - [Int] isContract
    - [Int] sendValue #

 +  ERC20UpgradeSafe (Initializable, ContextUpgradeSafe, IERC20)
    - [Int] __ERC20_init #
       - modifiers: initializer
    - [Int] __ERC20_init_unchained #
       - modifiers: initializer
    - [Pub] name
    - [Pub] symbol
    - [Pub] decimals
    - [Pub] totalSupply
    - [Pub] balanceOf
    - [Pub] transfer #
    - [Pub] allowance
    - [Pub] approve #
    - [Pub] transferFrom #
    - [Pub] increaseAllowance #
    - [Pub] decreaseAllowance #
    - [Int] _transfer #
    - [Int] _mint #
    - [Int] _burn #
    - [Int] _approve #
    - [Int] _setupDecimals #
    - [Int] _beforeTokenTransfer #

 +  ERC677 
    - [Pub] transfer #
    - [Pub] transferAndCall #

 +  ERC677Receiver 
    - [Pub] onTokenTransfer #

 +  ERC677Token (ERC677)
    - [Pub] transferAndCall #
    - [Prv] contractFallback #
    - [Prv] isContract

 + [Int] ISync 
    - [Ext] sync #

 + [Int] IGulp 
    - [Ext] gulp #

 +  BaseToken (ERC20UpgradeSafe, ERC677Token, OwnableUpgradeSafe)
    - [Pub] setRebasesPaused #
       - modifiers: onlyOwner
    - [Ext] setMonetaryPolicy #
       - modifiers: onlyOwner
    - [Ext] rebase #
    - [Pub] totalShares
    - [Pub] sharesOf
    - [Pub] initialize #
       - modifiers: initializer
    - [Pub] totalSupply
    - [Pub] balanceOf
    - [Pub] transfer #
       - modifiers: validRecipient
    - [Pub] allowance
    - [Pub] transferFrom #
       - modifiers: validRecipient
    - [Pub] approve #
    - [Pub] increaseAllowance #
    - [Pub] decreaseAllowance #

 + [Int] IOracle 
    - [Ext] getData

 +  BaseTokenMonetaryPolicy (OwnableUpgradeSafe)
    - [Pub] setBASEToken #
       - modifiers: onlyOwner
    - [Ext] rebase #
    - [Pub] getNextSupplyDelta
    - [Ext] setMcapOracle #
       - modifiers: onlyOwner
    - [Ext] setTokenPriceOracle #
       - modifiers: onlyOwner
    - [Ext] setOrchestrator #
       - modifiers: onlyOwner
    - [Ext] setDeviationThreshold #
       - modifiers: onlyOwner
    - [Ext] setRebaseLag #
       - modifiers: onlyOwner
    - [Ext] setRebaseTimingParameters #
       - modifiers: onlyOwner
    - [Pub] initialize #
       - modifiers: initializer
    - [Pub] inRebaseWindow
    - [Pub] computeSupplyDelta
    - [Prv] withinDeviationThreshold

 +  BaseTokenOrchestrator (OwnableUpgradeSafe)
    - [Pub] setMonetaryPolicy #
       - modifiers: onlyOwner
    - [Pub] initialize #
       - modifiers: initializer
    - [Ext] rebase #
    - [Ext] addTransaction #
       - modifiers: onlyOwner
    - [Ext] removeTransaction #
       - modifiers: onlyOwner
    - [Ext] setTransactionEnabled #
       - modifiers: onlyOwner
    - [Ext] transactionsSize
    - [Int] externalCall #
							

Function Graph

Smart Contract Graph

Inheritence Chart

Smart Contract Inheritance

Functions Overview



 ($) = payable function
 # = non-constant function
 
 Int = Internal
 Ext = External
 Pub = Public

 +  Initializable 
    - [Prv] isConstructor

 +  ContextUpgradeSafe (Initializable)
    - [Int] __Context_init #
       - modifiers: initializer
    - [Int] __Context_init_unchained #
       - modifiers: initializer
    - [Int] _msgSender
    - [Int] _msgData

 +  OwnableUpgradeSafe (Initializable, ContextUpgradeSafe)
    - [Int] __Ownable_init #
       - modifiers: initializer
    - [Int] __Ownable_init_unchained #
       - modifiers: initializer
    - [Pub] owner
    - [Pub] renounceOwnership #
       - modifiers: onlyOwner
    - [Pub] transferOwnership #
       - modifiers: onlyOwner

 +  DogeOracle (OwnableUpgradeSafe)
    - [Pub]  #
    - [Ext] getData
    - [Pub] storeData #
       - modifiers: onlyOwner
    - [Pub] storeValidity #
       - modifiers: onlyOwner