DebtProtocol - Smart Contract Audit Report
Summary
DebtProtocol created a platform where fees charged from transactions are shared among token holders. Fee sharing is instant, increasing the balance of all token holders with each transaction.We reviewed Debt Protocol's token contract using code provided to us by the team.
Notes on the contract:Audit Findings Summary:
- The total supply of the token is 100 billion.
- No mint or burn functions exist, though the circulating supply can be decreased by sending tokens to 0x...dead.
- The fee charged on token transfers is redistributed to existing token holders instantly and automatically at the time of each transaction.
- Redistribution of fees happens accross tiers and based upon when the user last made a transaction.
- When fees are taken, they are distributed among those users in the tier below the caller.
- A user's tier is based on the number of tokens they hold. The team can add tiers at any time.
- In addition to this transfer logic, once a day users in lower tiers will have a percentage of their stake distributed among those in the tier above them, up to a maximum of 10%.
- Users who never sell will recieve extra from this daily redistribution, and users who perform a buy will have the event delayed for them. Users in the top tier are also exempt.
- The owner can exclude any address from the fee mechanism.
- Some minor gas optimizations can be achieved through declaring functions external instead of public and some variables constant.
- Utilization of SafeMath to prevent overflows.
- No external threats were identified.
- Be aware of the way the protocol operates - Value will flow upward towards large holders in the top tiers.
- Date: May 20th, 2021
External Threat Results
Vulnerability Category | Notes | Result |
---|---|---|
Arbitrary Storage Write | N/A | PASS |
Arbitrary Jump | N/A | PASS |
Delegate Call to Untrusted Contract | N/A | PASS |
Dependence on Predictable Variables | N/A | PASS |
Deprecated Opcodes | N/A | PASS |
Ether Thief | N/A | PASS |
Exceptions | N/A | PASS |
External Calls | N/A | PASS |
Flash Loans | N/A | PASS |
Integer Over/Underflow | N/A | PASS |
Multiple Sends | N/A | PASS |
Oracles | N/A | PASS |
Suicide | N/A | PASS |
State Change External Calls | N/A | PASS |
Unchecked Retval | N/A | PASS |
User Supplied Assertion | N/A | PASS |
Critical Solidity Compiler | N/A | PASS |
Overall Contract Safety | PASS |
Function Graph
Inheritance Chart
Functions Overview
($) = payable function
# = non-constant function
Int = Internal
Ext = External
Pub = Public
+ Context
- [Int] _msgSender
- [Int] _msgData
+ Ownable (Context)
- [Int] #
- [Pub] owner
- [Pub] renounceOwnership #
- modifiers: onlyOwner
- [Pub] transferOwnership #
- modifiers: onlyOwner
+ [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 #
+ ERC20 (Context, IERC20)
- [Pub] #
- [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 #
+ [Int] IUniswapV2Router02
- [Ext] factory
- [Ext] WETH
+ [Int] IUniswapV2Factory
- [Ext] createPair #
+ TestUNC (ERC20, Ownable)
- [Pub] #
- modifiers: ERC20
- [Pub] addTier #
- modifiers: onlyOwner
- [Pub] changeFeesOfTier #
- modifiers: onlyOwner
- [Pub] changeThresholdOfTier #
- modifiers: onlyOwner
- [Pub] changeHodlBoost #
- modifiers: onlyOwner
- [Pub] changeDebtLag #
- modifiers: onlyOwner
- [Pub] changeMinAmountDebtLag #
- modifiers: onlyOwner
- [Pub] setRedistributionPaused #
- modifiers: onlyOwner
- [Pub] excludeAccount #
- modifiers: onlyOwner
- [Pub] includeAccount #
- modifiers: onlyOwner
- [Pub] totalSupply
- [Pub] balanceOf
- [Pub] approve #
- [Pub] increaseAllowance #
- [Pub] decreaseAllowance #
- [Pub] tierLength
- [Pub] getTierOfUser
- [Pub] getHodlingBoost
- [Pub] pendingDebt
- [Pub] pendingReward
- [Pub] isExcluded
- [Int] manageTier #
- [Int] manageDebt #
- [Int] manageFee #
- [Int] manageReward #
- [Pub] transfer #
- [Pub] transferFrom #
- [Int] _transfer #
- [Prv] _transferStandard #
- [Prv] _transferToExcluded #
- [Prv] _transferFromExcluded #
- [Prv] _transferBothExcluded #