JustCarbon
Smart Contract Audit Report
Audit Summary
JustCarbon is developing a new token to use as a reward token within multiple vesting contracts.
For this audit, we reviewed the following contracts:
- JCR contract at 0x39a27f314a93429adce67316840d44e320f6436d on the Ethereum Mainnet.
- ComplexVesting contract at 0xbe8808f7369147a9edd1d72b318f75159edfe216 on the Ethereum Mainnet.
- MultipleVesting contract at 0x9bcc6a1f2527bfa043c9a1ed020da9c0b13676d4 and 0x186f99a1d455f5589ba7a4ef64af4eaecd4d6f34 on the Ethereum Mainnet.
- MultipleVestingWithBonus contract at 0x6be52e35012b5515c032a87f75f91d00c5801c26 on the Ethereum Mainnet.
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
JCR Contract:
- 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.
ComplexVesting 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.
MultipleVesting & MultipleVestingWithBonus Contracts:
- 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.
- 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 Category | Notes | Result |
---|---|---|
Arbitrary Jump/Storage Write | N/A | PASS |
Centralization of Control |
| WARNING |
Compiler Issues | N/A | PASS |
Delegate Call to Untrusted Contract | N/A | PASS |
Dependence on Predictable Variables | N/A | PASS |
Ether/Token Theft | N/A | PASS |
Flash Loans | N/A | PASS |
Front Running | N/A | PASS |
Improper Events | N/A | PASS |
Improper Authorization Scheme | N/A | PASS |
Integer Over/Underflow | N/A | PASS |
Logical Issues | N/A | PASS |
Oracle Issues | N/A | PASS |
Outdated Compiler Version | N/A | PASS |
Race Conditions | N/A | PASS |
Reentrancy | N/A | PASS |
Signature Issues | N/A | PASS |
Unbounded Loops | N/A | PASS |
Unused Code | N/A | PASS |
Overall Contract Safety | PASS |
JCR Contract
($) = 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
($) = 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
($) = 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
($) = 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.