
Grapes Vesting
Smart Contract Audit Report
Audit Summary
Grapes is building two new vesting platforms where users can claim tokens.
For this audit, we reviewed the project team's GrapesVesting and GrapePublicVesting contracts at commit 702f911b54df3d6536f42080f5aca42e1391c16e on the team's private GitHub repository.
We previously reviewed the project team's token contract here.
Audit Findings
No findings were identified.
Date: December 13th, 2023.
Updated: March 11th, 2024 to reflect updates made to the GrapesVesting contract from commit 0ee4d32f88c393f8484278f3d5231df04e9d15c9 to commit 702f911b54df3d6536f42080f5aca42e1391c16e.
Contracts Overview
GrapeVesting Contract:GrapePublicVesting Contract:
- The deployer will specify a list of addresses and corresponding allowance values that are allocated to each address.
- Any user that has been allocated an allowance can initiate a withdraw after the cliff end date of the contract has been reached.
- 5% of the total allowance can be claimed immediately on each user's first successful withdrawal.
- The remaining allowance is vested linearly over the time between the cliff end date and the vesting end date.
- The current withdrawable amount is transferred from the contract to the caller.
- Once the vesting end date is reached, each user can claim 100% of the total number of tokens allocated to their address.
- The owner can update the allowances allocated to any address at any time.
- The owner can set the cliff end date to any value at any time.
- The owner can set the vesting end date to any value at any time.
- The owner can withdraw all of the Grape tokens from the contract at any time.
- Any user can initiate a withdrawal after the TGE date has been reached by specifying their NFT purchase amount, referral purchase amount, and whether they want to apply bonuses.
- The user must also provide a valid signature and timestamp with their withdrawal request.
- The returned signer address for the transaction must be the Signer wallet set by the team.
- After the cliff end date has been reached, 25% of the total purchase amount can be claimed immediately.
- The remaining purchase amount is vested linearly over the time between the TGE date and the vesting end date.
- If the user opts for a bonus, a bonus amount is calculated as a percentage of the current withdrawable amount.
- The bonus is applied only to the portion of tokens purchased through NFTs.
- The current withdrawable amount and any bonus tokens are transferred from the contract to the caller.
- Once the vesting end date is reached, each user can claim 100% of the total number of tokens allocated to their address.
- The owner can set the TGE date to any value at any time.
- The owner can set the vesting end date to any value at any time.
- The owner can withdraw all of the Grape tokens from the contract at any time.
Audit Results
| Vulnerability Category | Notes | Result |
|---|---|---|
| Arbitrary Jump/Storage Write | N/A | PASS |
| Centralization of Control | The team must ensure the contracts have a sufficient token balance to support withdrawals for all users. | PASS |
| 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 |
| Sybil Attack | N/A | PASS |
| Unbounded Loops | N/A | PASS |
| Unused Code | N/A | PASS |
| Overall Contract Safety | PASS |
GrapeVesting Contract

($) = payable function
# = non-constant function
Int = Internal
Ext = External
Pub = Public
+ Context
- [Int] _msgSender
- [Int] _msgData
- [Int] _contextSuffixLength
+ Ownable (Context)
- [Pub] #
- [Pub] owner
- [Int] _checkOwner
- [Pub] renounceOwnership #
- modifiers: onlyOwner
- [Pub] transferOwnership #
- modifiers: onlyOwner
- [Int] _transferOwnership #
+ [Int] IERC20
- [Ext] totalSupply
- [Ext] balanceOf
- [Ext] transfer #
- [Ext] allowance
- [Ext] approve #
- [Ext] transferFrom #
+ GrapeVesting (Ownable)
- [Pub] #
- modifiers: Ownable
- [Pub] vestedAmount
- [Pub] withdrawableAmount
- [Ext] withdraw #
- [Ext] changeCliffEndDate #
- modifiers: onlyOwner
- [Ext] changeVestingEndDate #
- modifiers: onlyOwner
- [Ext] withdrawAllGrapeToken #
- modifiers: onlyOwner
GrapePublicVesting Contract


($) = payable function
# = non-constant function
Int = Internal
Ext = External
Pub = Public
+ Context
- [Int] _msgSender
- [Int] _msgData
- [Int] _contextSuffixLength
+ Ownable (Context)
- [Pub] #
- [Pub] owner
- [Int] _checkOwner
- [Pub] renounceOwnership #
- modifiers: onlyOwner
- [Pub] transferOwnership #
- modifiers: onlyOwner
- [Int] _transferOwnership #
+ [Int] IERC20
- [Ext] totalSupply
- [Ext] balanceOf
- [Ext] transfer #
- [Ext] allowance
- [Ext] approve #
- [Ext] transferFrom #
+ [Lib] Math
- [Int] tryAdd
- [Int] trySub
- [Int] tryMul
- [Int] tryDiv
- [Int] tryMod
- [Int] max
- [Int] min
- [Int] average
- [Int] ceilDiv
- [Int] mulDiv
- [Int] mulDiv
- [Int] sqrt
- [Int] sqrt
- [Int] log2
- [Int] log2
- [Int] log10
- [Int] log10
- [Int] log256
- [Int] log256
- [Int] unsignedRoundsUp
+ [Lib] SignedMath
- [Int] max
- [Int] min
- [Int] average
- [Int] abs
+ [Lib] Strings
- [Int] toString
- [Int] toStringSigned
- [Int] toHexString
- [Int] toHexString
- [Int] toHexString
- [Int] equal
+ [Lib] MessageHashUtils
- [Int] toEthSignedMessageHash
- [Int] toEthSignedMessageHash
- [Int] toDataWithIntendedValidatorHash
- [Int] toTypedDataHash
+ [Lib] ECDSA
- [Int] tryRecover
- [Int] recover
- [Int] tryRecover
- [Int] recover
- [Int] tryRecover
- [Int] recover
- [Prv] _throwError
+ [Int] IERC1271
- [Ext] isValidSignature
+ [Lib] SignatureChecker
- [Int] isValidSignatureNow
- [Int] isValidERC1271SignatureNow
+ GrapePublicVesting (Ownable)
- [Pub] #
- modifiers: Ownable
- [Pub] vestedAmount
- [Pub] withdrawableAmountWithoutBonus
- [Ext] withdraw #
- [Ext] changeTgeDate #
- modifiers: onlyOwner
- [Ext] changeVestingEndDate #
- modifiers: onlyOwner
- [Ext] withdrawAllGrapeToken #
- 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.