JustCarbon

Smart Contract Audit Report

Audit Summary

JustCarbon Audit Report JustCarbon is developing a new token to use as a reward token within multiple vesting contracts.

For this audit, we reviewed the following contracts:

Audit Findings

Please ensure trust in the team prior to investing as they have substantial control in the ecosystem.
Date: April 1st, 2022.
Updated: April 5th, 2022 to reflect Ethereum Mainnet addresses.
Updated: April 11th, 2022 to reflect changes made by the team.

Contracts Overview

  • The contracts utilize ReentrancyGuard to prevent reentrancy attacks in applicable functions.
  • As the contracts are implemented with Solidity v0.8.X, they are protected from any underflow/overflow attacks.
JCR Contract:
  • The total supply of $JCR is currently 49.9 thousand [49,995].
  • At the time of writing this report, 49.66% of the token's supply is in Uniswap liquidity and 49.00% is held by the owner.
  • The next five holders own a cumulative 1.28% of the total supply.
  • The owner is granted the Default Admin role, Pauser role, Minter role, Issuer role, and Upgrader role on deployment.
  • A mint function is present in the contract and can be utilized by the Minter and Issuer roles to mint any amount of tokens, increasing the total supply at any time.
  • The time, amount, and memo note are saved to the issuance list when tokens are minted by the Issuer role.
  • Any user can burn their own $JCR tokens to reduce the total supply.
  • Additionally, users can burn $JCR tokens from other addresses up to the amount of allowance they've been granted, also reducing the total supply.
  • The Default Admin role can renounce their role at any time.
  • The Default Admin role can grant or revoke any role to any address at any time.
  • The Pauser role can pause all transferring, minting, and burning functionality at any time.
  • The Minter and Issuer roles can mint tokens at any time.
  • The Upgrader role can upgrade the contract at any time.
  • There are no fees associated with transferring tokens.
  • The contract complies with the ERC-20 standard.
ComplexVesting Contract:
  • This contract allows the designated beneficiary address to claim vested amounts of an owner-designated token.
  • The vesting start time is set on deployment and releases vested token amounts for each full vesting period that has elapsed; the vesting period duration is set upon deployment.
  • Vested token amounts are calculated based on the base token vesting amount per period, the decay periods elapsed, and the decay amount per decay period.
  • After the owner has deposited an amount of the specified token using the deposit() function, the beneficiary address can withdraw the base token amount for each vesting period elapsed, however, for each decay period that has elapsed, the base amount is reduced by the decay amount; the beneficiary address can withdraw vested funds unless the owner performs an emergency withdrawal.
  • The beneficiary address can withdraw the entire token balance once the end time has been reached.
  • The owner can transfer ownership at any time.
  • The owner can withdraw the entire token balance of the contract using the emergency withdrawal at any time.
MultipleVesting & MultipleVestingWithBonus Contracts:
  • These contracts enable designated beneficiary addresses to claim individual vesting amounts of an owner-designated token.
  • The MultipleVesting contract's beneficiary addresses have an initial vested amount and total unvested amount specified by the owner; the initial vested amount can be withdrawn as soon as the total owed token amount is deposited by the owner.
  • The MultipleVestingWithBonus contract's beneficiary addresses have an initial vested amount, secondary unvested amount, and total unvested amount specified by the owner.
  • Both contracts beneficiaries' can withdraw their initial vested amount as soon as the contract's total owed token amount is deposited by the owner.
  • Within the MultipleVestingWithBonus contract, the secondary unvested amount can be withdrawn once the secondary timestamp has been reached after the contract's total owed token amount is deposited by the owner.
  • The rest of the beneficiaries' tokens vest during the contracts' start and end times; the contracts' start and end times are set upon deployment.
  • The owner can add beneficiary addresses to the contract until the total owed token amount is deposited by the owner; the owner can only deposit funds one time and must be in an amount equal to the total tokens owed to the beneficiaries.
  • After the contracts' start time is reached, beneficiaries' can withdraw vested tokens for each full vesting period that has elapsed; the vesting period duration is set upon deployment.
  • The vesting amount per vesting period is calculated based on the beneficiary's total token amount and the percentage of elapsed vesting periods in relation to the total vesting duration.
  • The beneficiary addresses can withdraw funds unless the owner performs an emergency withdrawal on the reward funds.
  • The owner can transfer ownership at any time.
  • The owner can withdraw the entire token balance of the contract using the emergency withdrawal at any time.

Audit Results

Vulnerability CategoryNotesResult
Arbitrary Jump/Storage WriteN/APASS
Centralization of Control
  • The owner can withdraw the reward funds at any time.
  • The Minter and Issuer roles can mint $JCR tokens at any time.
  • The Upgrader role can upgrade the contract at any time.
  • The owner can grant and revoke all roles at any time.
WARNING
Compiler IssuesN/APASS
Delegate Call to Untrusted ContractN/APASS
Dependence on Predictable VariablesN/APASS
Ether/Token TheftN/APASS
Flash LoansN/APASS
Front RunningN/APASS
Improper EventsN/APASS
Improper Authorization SchemeN/APASS
Integer Over/UnderflowN/APASS
Logical IssuesN/APASS
Oracle IssuesN/APASS
Outdated Compiler VersionN/APASS
Race ConditionsN/APASS
ReentrancyN/APASS
Signature IssuesN/APASS
Unbounded LoopsN/APASS
Unused CodeN/APASS
Overall Contract Safety PASS

JCR Contract

Smart Contract Audit - Inheritance

Smart Contract Audit - Graph


 ($) = payable function
 # = non-constant function
 
 Int = Internal
 Ext = External
 Pub = Public
 
  + [Int] IERC20Upgradeable 
    - [Ext] totalSupply
    - [Ext] balanceOf
    - [Ext] transfer #
    - [Ext] allowance
    - [Ext] approve #
    - [Ext] transferFrom #

 + [Int] IERC20MetadataUpgradeable (IERC20Upgradeable)
    - [Ext] name
    - [Ext] symbol
    - [Ext] decimals

 + [Lib] AddressUpgradeable 
    - [Int] isContract
    - [Int] sendValue #
    - [Int] functionCall #
    - [Int] functionCall #
    - [Int] functionCallWithValue #
    - [Int] functionCallWithValue #
    - [Int] functionStaticCall
    - [Int] functionStaticCall
    - [Int] verifyCallResult

 +  Initializable 
    - [Prv] _isConstructor

 +  ContextUpgradeable (Initializable)
    - [Int] __Context_init #
       - modifiers: onlyInitializing
    - [Int] __Context_init_unchained #
       - modifiers: onlyInitializing
    - [Int] _msgSender
    - [Int] _msgData

 +  ERC20Upgradeable (Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable)
    - [Int] __ERC20_init #
       - modifiers: onlyInitializing
    - [Int] __ERC20_init_unchained #
       - modifiers: onlyInitializing
    - [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] _spendAllowance #
    - [Int] _beforeTokenTransfer #
    - [Int] _afterTokenTransfer #

 +  ERC20BurnableUpgradeable (Initializable, ContextUpgradeable, ERC20Upgradeable)
    - [Int] __ERC20Burnable_init #
       - modifiers: onlyInitializing
    - [Int] __ERC20Burnable_init_unchained #
       - modifiers: onlyInitializing
    - [Pub] burn #
    - [Pub] burnFrom #

 +  PausableUpgradeable (Initializable, ContextUpgradeable)
    - [Int] __Pausable_init #
       - modifiers: onlyInitializing
    - [Int] __Pausable_init_unchained #
       - modifiers: onlyInitializing
    - [Pub] paused
    - [Int] _pause #
       - modifiers: whenNotPaused
    - [Int] _unpause #
       - modifiers: whenPaused

 + [Int] IAccessControlUpgradeable 
    - [Ext] hasRole
    - [Ext] getRoleAdmin
    - [Ext] grantRole #
    - [Ext] revokeRole #
    - [Ext] renounceRole #

 + [Lib] StringsUpgradeable 
    - [Int] toString
    - [Int] toHexString
    - [Int] toHexString

 + [Int] IERC165Upgradeable 
    - [Ext] supportsInterface

 +  ERC165Upgradeable (Initializable, IERC165Upgradeable)
    - [Int] __ERC165_init #
       - modifiers: onlyInitializing
    - [Int] __ERC165_init_unchained #
       - modifiers: onlyInitializing
    - [Pub] supportsInterface

 +  AccessControlUpgradeable (Initializable, ContextUpgradeable, IAccessControlUpgradeable, ERC165Upgradeable)
    - [Int] __AccessControl_init #
       - modifiers: onlyInitializing
    - [Int] __AccessControl_init_unchained #
       - modifiers: onlyInitializing
    - [Pub] supportsInterface
    - [Pub] hasRole
    - [Int] _checkRole
    - [Pub] getRoleAdmin
    - [Pub] grantRole #
       - modifiers: onlyRole
    - [Pub] revokeRole #
       - modifiers: onlyRole
    - [Pub] renounceRole #
    - [Int] _setupRole #
    - [Int] _setRoleAdmin #
    - [Int] _grantRole #
    - [Int] _revokeRole #

 + [Int] IERC1822ProxiableUpgradeable 
    - [Ext] proxiableUUID

 + [Int] IBeaconUpgradeable 
    - [Ext] implementation

 + [Lib] StorageSlotUpgradeable 
    - [Int] getAddressSlot
    - [Int] getBooleanSlot
    - [Int] getBytes32Slot
    - [Int] getUint256Slot

 +  ERC1967UpgradeUpgradeable (Initializable)
    - [Int] __ERC1967Upgrade_init #
       - modifiers: onlyInitializing
    - [Int] __ERC1967Upgrade_init_unchained #
       - modifiers: onlyInitializing
    - [Int] _getImplementation
    - [Prv] _setImplementation #
    - [Int] _upgradeTo #
    - [Int] _upgradeToAndCall #
    - [Int] _upgradeToAndCallUUPS #
    - [Int] _getAdmin
    - [Prv] _setAdmin #
    - [Int] _changeAdmin #
    - [Int] _getBeacon
    - [Prv] _setBeacon #
    - [Int] _upgradeBeaconToAndCall #
    - [Prv] _functionDelegateCall #

 +  UUPSUpgradeable (Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable)
    - [Int] __UUPSUpgradeable_init #
       - modifiers: onlyInitializing
    - [Int] __UUPSUpgradeable_init_unchained #
       - modifiers: onlyInitializing
    - [Ext] proxiableUUID
       - modifiers: notDelegated
    - [Ext] upgradeTo #
       - modifiers: onlyProxy
    - [Ext] upgradeToAndCall ($)
       - modifiers: onlyProxy
    - [Int] _authorizeUpgrade #

 +  JCR (Initializable, ERC20Upgradeable, ERC20BurnableUpgradeable, PausableUpgradeable, AccessControlUpgradeable, UUPSUpgradeable)
    - [Pub]  #
       - modifiers: initializer
    - [Pub] initialize #
       - modifiers: initializer
    - [Pub] issue #
       - modifiers: onlyRole
    - [Pub] issuance
    - [Pub] pause #
       - modifiers: onlyRole
    - [Pub] unpause #
       - modifiers: onlyRole
    - [Pub] mint #
       - modifiers: onlyRole
    - [Int] _beforeTokenTransfer #
       - modifiers: whenNotPaused
    - [Int] _authorizeUpgrade #
       - modifiers: onlyRole

ComplexVesting Contract

Smart Contract Audit - Inheritance

Smart Contract Audit - Graph


 ($) = payable function
 # = non-constant function
 
 Int = Internal
 Ext = External
 Pub = Public
 
 + [Int] IERC20 
    - [Ext] totalSupply
    - [Ext] balanceOf
    - [Ext] transfer #
    - [Ext] allowance
    - [Ext] approve #
    - [Ext] transferFrom #

 +  ReentrancyGuard 
    - [Pub]  #

 +  Context 
    - [Int] _msgSender
    - [Int] _msgData

 +  Ownable (Context)
    - [Pub]  #
    - [Pub] owner
    - [Pub] renounceOwnership #
       - modifiers: onlyOwner
    - [Pub] transferOwnership #
       - modifiers: onlyOwner
    - [Int] _transferOwnership #

 +  ComplexVesting (Ownable, ReentrancyGuard)
    - [Pub]  #
    - [Prv] _calculateVestingAmount
    - [Pub] calculateWithdrawal
    - [Pub] deposit #
       - modifiers: onlyOwner
    - [Pub] withdraw #
       - modifiers: notClosed,afterDeposit,nonReentrant
    - [Pub] emergencyWithdraw #
       - modifiers: onlyOwner

MultipleVesting Contract

Smart Contract Audit - Inheritance

Smart Contract Audit - Graph


 ($) = payable function
 # = non-constant function
 
 Int = Internal
 Ext = External
 Pub = Public
 
  + [Int] IERC20 
    - [Ext] totalSupply
    - [Ext] balanceOf
    - [Ext] transfer #
    - [Ext] allowance
    - [Ext] approve #
    - [Ext] transferFrom #

 +  ReentrancyGuard 
    - [Pub]  #

 +  Context 
    - [Int] _msgSender
    - [Int] _msgData

 +  Ownable (Context)
    - [Pub]  #
    - [Pub] owner
    - [Pub] renounceOwnership #
       - modifiers: onlyOwner
    - [Pub] transferOwnership #
       - modifiers: onlyOwner
    - [Int] _transferOwnership #

 +  MultipleVesting (Ownable, ReentrancyGuard)
    - [Pub]  #
    - [Pub] calculateAvailable
    - [Prv] _calculateAvailable
       - modifiers: notClosed
    - [Pub] addBeneficiary #
       - modifiers: onlyOwner,beforeDeposit
    - [Pub] addBeneficiaries #
       - modifiers: onlyOwner,beforeDeposit
    - [Pub] deposit #
       - modifiers: onlyOwner,beforeDeposit
    - [Pub] withdraw #
       - modifiers: afterDeposit,notClosed,nonReentrant
    - [Pub] emergencyWithdraw #
       - modifiers: onlyOwner

MultipleVestingWithBonus Contract

Smart Contract Audit - Inheritance

Smart Contract Audit - Graph


 ($) = payable function
 # = non-constant function
 
 Int = Internal
 Ext = External
 Pub = Public
 
    + [Int] IERC20 
    - [Ext] totalSupply
    - [Ext] balanceOf
    - [Ext] transfer #
    - [Ext] allowance
    - [Ext] approve #
    - [Ext] transferFrom #

 +  ReentrancyGuard 
    - [Pub]  #

 +  Context 
    - [Int] _msgSender
    - [Int] _msgData

 +  Ownable (Context)
    - [Pub]  #
    - [Pub] owner
    - [Pub] renounceOwnership #
       - modifiers: onlyOwner
    - [Pub] transferOwnership #
       - modifiers: onlyOwner
    - [Int] _transferOwnership #

 +  MultipleVestingWithBonus (Ownable, ReentrancyGuard)
    - [Pub]  #
    - [Pub] calculateAvailable
    - [Prv] _calculateAvailable
       - modifiers: notClosed
    - [Pub] addBeneficiary #
       - modifiers: onlyOwner,beforeDeposit
    - [Pub] deposit #
       - modifiers: onlyOwner,beforeDeposit
    - [Pub] withdraw #
       - modifiers: afterDeposit,notClosed,nonReentrant
    - [Pub] emergencyWithdraw #
       - modifiers: onlyOwner

About SourceHat

SourceHat has quickly grown to have one of the most experienced and well-equipped smart contract auditing teams in the industry. Our team has conducted 1800+ solidity smart contract audits covering all major project types and protocols, securing a total of over $50 billion U.S. dollars in on-chain value!
Our firm is well-reputed in the community and is trusted as a top smart contract auditing company for the review of solidity code, no matter how complex. Our team of experienced solidity smart contract auditors performs audits for tokens, NFTs, crowdsales, marketplaces, gambling games, financial protocols, and more!

Contact us today to get a free quote for a smart contract audit of your project!

What is a SourceHat Audit?

Typically, a smart contract audit is a comprehensive review process designed to discover logical errors, security vulnerabilities, and optimization opportunities within code. A SourceHat Audit takes this a step further by verifying economic logic to ensure the stability of smart contracts and highlighting privileged functionality to create a report that is easy to understand for developers and community members alike.

How Do I Interpret the Findings?

Each of our Findings will be labeled with a Severity level. We always recommend the team resolve High, Medium, and Low severity findings prior to deploying the code to the mainnet. Here is a breakdown on what each Severity level means for the project:

  • High severity indicates that the issue puts a large number of users' funds at risk and has a high probability of exploitation, or the smart contract contains serious logical issues which can prevent the code from operating as intended.
  • Medium severity issues are those which place at least some users' funds at risk and has a medium to high probability of exploitation.
  • Low severity issues have a relatively minor risk association; these issues have a low probability of occurring or may have a minimal impact.
  • Informational issues pose no immediate risk, but inform the project team of opportunities for gas optimizations and following smart contract security best practices.