Introduction
We express our gratitude to the FEG (Feed Every Gorilla) team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.
The bonding curve referenced in this audit is one of the presale models of SmartDeFi™, the token launchpad created by FEG. SmartDeFi™ enables the seamless creation and launch of new ERC-20 tokens with built-in security frameworks.
This presale model uses a bonding curve to manage token distribution and liquidity generation. It incorporates a lock mechanism for claiming purchased tokens and automatically creates liquidity on external DEX protocols once the targeted liquidity amount is reached, allowing the token to launch and begin open-market trading in a structured and secure manner.
Document | |
|---|---|
| Name | Smart Contract Code Review and Security Analysis Report for FEG (Feed Every Gorilla) |
| Audited By | David Camps Novi, Franco Bregante |
| Approved By | Ivan Bondar |
| Website | https://feg.io→ |
| Changelog | 22/10/2025 - Preliminary Report |
| 05/11/2025 - Final Report | |
| Platform | BSC |
| Language | Solidity |
| Tags | Token Sales, ERC-20, Claims, Launchpad. |
| Methodology | https://hackenio.cc/sc_methodology→ |
Document
- Name
- Smart Contract Code Review and Security Analysis Report for FEG (Feed Every Gorilla)
- Audited By
- David Camps Novi, Franco Bregante
- Approved By
- Ivan Bondar
- Website
- https://feg.io→
- Changelog
- 22/10/2025 - Preliminary Report
- 05/11/2025 - Final Report
- Platform
- BSC
- Language
- Solidity
- Tags
- Token Sales, ERC-20, Claims, Launchpad.
- Methodology
- https://hackenio.cc/sc_methodology→
Review Scope | |
|---|---|
| Repository | https://github.com/fegtokendev/Bonding→ |
| Commit | fa830ffc |
| Final Commit | 349d4f7 |
Review Scope
- Repository
- https://github.com/fegtokendev/Bonding→
- Commit
- fa830ffc
- Final Commit
- 349d4f7
Audit Summary
The system users should acknowledge all the risks summed up in the risks section of the report
{Finding_Table?columns=title,severity,status&setting.filter.type=Vulnerability}
Documentation quality
Functional requirements are provided at a high level, but are missing depth.
Fee collection system is not described with enough detail.
Technical description is provided.
No NatSpec is provided, reducing the comprehension of the code.
Code quality
The code duplicates commonly known contracts instead of reusing them.
Redundant or unused code is present (see findings section).
The development environment is configured.
Test coverage
Code coverage of the project is 0% (branch coverage).
No tests were provided with the codebase.
System Overview
FEG protocol is a platform that facilitates the creation and liquidity trapping of new ERC-20 through the creation of a bonding curve. It includes a lock mechanism to claim the traded tokens, and a liquidity pool creation in external protocols to launch the token for anyone to trade after the desired liquidity is reached.
The system consists of the following contracts:
SmartBondingCurve - contract through which a user can create a new token and start the bonding curve trading. Users can engage with any bonding curve, trading native tokens for each specific ERC-20 token curve, and vice-versa. Once the desired liquidity is reached, the system will launch liquidity pools in external DeFi protocols.
VestingContract - holds the locked ERC-20 tokens bought by traders using native tokens, in a vesting process. Once the vesting is over, the users can sell the ERC-20 back to native tokens. When the desired liquidity is reached, traders can claim and withdraw the ERC-20 tokens bought during the active process of the bonding curve.
Privileged roles
Owner - can set the
bossaddress in both SmartBondingCurve and VestingContract.Boss - can modify the fee parameters in the bonding curve, and setup a few contract addresses required for the system to work.
Potential Risks
The SmartBondingCurve contract relies on the external SDDeployerContract(0x00716ee91E94853B1306F6B3331a56207D175CEe) to facilitate ERC20 token creation. Since this external contract is out of the audit’s scope, any vulnerabilities or malicious behavior could directly impact the integrity and security of the audited system.
The ERC20 token contracts deployed through the SmartBondingCurve mechanism are outside the scope of this audit. Any vulnerabilities or non-standard implementations within those tokens could introduce security risks or unexpected behaviors that may affect the overall reliability and trustworthiness of the audited system.
The system interacts with multiple external addresses, including DEADADDRESS, WETHADDRESS, ROUTER, SDDEPLOYERADDRESS, PANCAKE_POSITION_MANAGER, and LP_LOCKER. Since these contracts are outside the scope of the system, any vulnerabilities, misconfigurations, or malicious behavior in these external contracts could directly affect the security, functionality, or integrity of the system.
The swapFee, referralFee, and toOwnerFee parameters can be changed at any time by the boss address. Users interacting with the bonding curve via swapInETH() and swapToETH() may therefore experience different fees between buy and sell operations, potentially leading to unfair or unpredictable outcomes.
The registerReferral() function allows users to assign a referrer, but doing so reduces their effective returns in swaps since referral fees are deducted from the input amount. As users gain no tangible benefit from registering a referrer, the referral mechanism might see limited use, reducing its practical impact within the system.
In both swapInETH() and swapToETH(), users can specify a minimum acceptable output amount (amountOutMin) to protect against unfavorable price movements. However, since this parameter can be set to zero, users who omit or misuse it may receive significantly fewer tokens than expected. Proper use of amountOutMin is essential to avoid unexpected trading outcomes.
The VestingContract inherits from the Ownable abstract contract, which includes the renounceOwnership() function. If called, this function sets the contract owner to the zero address, permanently removing all administrative privileges. While this may be intended to achieve decentralization, it also eliminates the ability to perform future updates, parameter changes, or emergency interventions, reducing flexibility and recovery options.
The functions getFinishAmount(), getAmountIn(), and getAmountOut() provide estimated values based on the current swapFees and toReferr parameters. Since these fees can be changed at any time by the boss address, the values returned by these functions may not match the actual amounts.
The contract includes several hardcoded addresses (e.g., WETHADDRESS, ROUTER, SDDEPLOYERADDRESS, PANCAKE_POSITION_MANAGER, LP_LOCKER) and chain-specific logic in functions such as addLiquidityV3(), which checks for chainId 56 (Binance Smart Chain). As a result, the contract is tightly coupled to BSC and will not function correctly on other chains without redeployment and reconfiguration of these addresses and chain-dependent logic.
When a trading stage is finalized via finalizeTrade(), the contract deploys collected tokens and WETH into liquidity pools using addLiquidityV2() and addLiquidityV3(). In V2, liquidity tokens are sent to the DEADADDRESS, and in V3, positions are locked in LP_LOCKER for up to 10 years. While this mechanism secures user funds and prevents token creators from performing rug pulls, it also permanently restricts control over the liquidity. The contract or its owner cannot recover or adjust these tokens in case of unexpected issues, bugs, or changes in the ecosystem, limiting flexibility and contingency options even after trade completion.
Token creators receive a share of trading fees through the toOwnerToken parameter, which is calculated based on the global swapFees setting. Both parameters can be modified at any time by the boss address, meaning that the rewards distributed to token creators are not fixed and may fluctuate. This flexibility introduces uncertainty regarding the consistency of creator incentives and expected returns over time.
Findings
Code ― | Title | Status | Severity | |
|---|---|---|---|---|
| F-2025-1366 | Lack of Reliable Mechanism to Withdraw Native Tokens from the System | fixed | Medium | |
| F-2025-1367 | Token Creator Swap Fees Can Be Revoked | fixed | Low | |
| F-2025-1355 | Misleading Data Returned for Finished Locks | fixed | Low | |
| F-2025-1366 | Redundant receive() Function | fixed | Low | |
| F-2025-1366 | New Trades Extend Vesting of Previously Locked Tokens | accepted | Low | |
| F-2025-1355 | Manual Dependency Management | accepted | Observation | |
| F-2025-1355 | Use Ownable2Step instead of Ownable | accepted | Observation | |
| F-2025-1342 | Floating Pragma | fixed | Observation | |
| F-2025-1366 | Duplicated Error Messages | fixed | Observation | |
| F-2025-1366 | MAXBUY Constant Set Too Low for Production | fixed | Observation |
Appendix 1. Definitions
Severities
When auditing smart contracts, Hacken is using a risk-based approach that considers Likelihood, Impact, Exploitability and Complexity metrics to evaluate findings and score severities.
Reference on how risk scoring is done is available through the repository in our Github organization:
Severity | Description |
|---|---|
Critical | Critical vulnerabilities are usually straightforward to exploit and can lead to the loss of user funds or contract state manipulation. |
High | High vulnerabilities are usually harder to exploit, requiring specific conditions, or have a more limited scope, but can still lead to the loss of user funds or contract state manipulation. |
Medium | Medium vulnerabilities are usually limited to state manipulations and, in most cases, cannot lead to asset loss. Contradictions and requirements violations. Major deviations from best practices are also in this category. |
Low | Major deviations from best practices or major Gas inefficiency. These issues will not have a significant impact on code execution. |
Severity
- Critical
Description
- Critical vulnerabilities are usually straightforward to exploit and can lead to the loss of user funds or contract state manipulation.
Severity
- High
Description
- High vulnerabilities are usually harder to exploit, requiring specific conditions, or have a more limited scope, but can still lead to the loss of user funds or contract state manipulation.
Severity
- Medium
Description
- Medium vulnerabilities are usually limited to state manipulations and, in most cases, cannot lead to asset loss. Contradictions and requirements violations. Major deviations from best practices are also in this category.
Severity
- Low
Description
- Major deviations from best practices or major Gas inefficiency. These issues will not have a significant impact on code execution.
Potential Risks
The "Potential Risks" section identifies issues that are not direct security vulnerabilities but could still affect the project’s performance, reliability, or user trust. These risks arise from design choices, architectural decisions, or operational practices that, while not immediately exploitable, may lead to problems under certain conditions. Additionally, potential risks can impact the quality of the audit itself, as they may involve external factors or components beyond the scope of the audit, leading to incomplete assessments or oversight of key areas. This section aims to provide a broader perspective on factors that could affect the project's long-term security, functionality, and the comprehensiveness of the audit findings.
Appendix 2. Scope
The scope of the project includes the following smart contracts from the provided repository:
Scope Details | |
|---|---|
| Repository | https://github.com/fegtokendev/Bonding→ |
| Commit | fa830ffc |
| Final Commit | 349d4f7 |
| Whitepaper | N/A |
| Requirements | https://docs.feg.io→ |
| Technical Requirements | ./README.md |
Scope Details
- Repository
- https://github.com/fegtokendev/Bonding→
- Commit
- fa830ffc
- Final Commit
- 349d4f7
- Whitepaper
- N/A
- Requirements
- https://docs.feg.io→
- Technical Requirements
- ./README.md
Assets in Scope
Appendix 3. Additional Valuables
Verification of System Invariants
During the audit of FEG, Hacken followed its methodology by performing fuzz-testing on the project's main functions. Foundry →, a tool used for testing, was employed to check how the protocol behaves under various inputs. Due to the complex and dynamic interactions within the protocol, unexpected edge cases might arise. Therefore, it was important to use fuzz-testing to ensure that several system invariants hold true in all situations.
Fuzz-testing allows the input of many random data points into the system, helping to identify issues that regular testing might miss. A specific Foundry test suite was prepared for this task, and throughout the assessment, several invariants were tested over 1,000,000 runs. This thorough testing ensured that the system works correctly even with unexpected or unusual inputs.
Invariant | Test Result | Run Count |
|---|---|---|
Bonding Curve Invariant Kept after openTrade() | Passed | 1M+ |
Bonding Curve Invariant Kept after swapInEth() | Passed | 1M+ |
Locked position must decrease accordingly on sellTokensFor() | Passed | 1M+ |
Bonding Curve parameters and Contracts Balances are correctly updated in branches of openTrade() | Passed | 1M |
Bonding Curve parameters and Contracts Balances are correctly updated in branches of swapInEth() | Passed | 1M |
Invariant
- Bonding Curve Invariant Kept after
openTrade() Test Result
- Passed
Run Count
- 1M+
Invariant
- Bonding Curve Invariant Kept after
swapInEth() Test Result
- Passed
Run Count
- 1M+
Invariant
- Locked position must decrease accordingly on
sellTokensFor() Test Result
- Passed
Run Count
- 1M+
Invariant
- Bonding Curve parameters and Contracts Balances are correctly updated in branches of
openTrade() Test Result
- Passed
Run Count
- 1M
Invariant
- Bonding Curve parameters and Contracts Balances are correctly updated in branches of
swapInEth() Test Result
- Passed
Run Count
- 1M
Additional Recommendations
The smart contracts in the scope of this audit could benefit from the introduction of automatic emergency actions for critical activities, such as unauthorized operations like ownership changes or proxy upgrades, as well as unexpected fund manipulations, including large withdrawals or minting events. Adding such mechanisms would enable the protocol to react automatically to unusual activity, ensuring that the contract remains secure and functions as intended.
To improve functionality, these emergency actions could be designed to trigger under specific conditions, such as:
Detecting changes to ownership or critical permissions.
Monitoring large or unexpected transactions and minting events.
Pausing operations when irregularities are identified.
These enhancements would provide an added layer of security, making the contract more robust and better equipped to handle unexpected situations while maintaining smooth operations.
Additional Considerations
This security assessment was conducted in accordance with the NIST SP 800-115 – Technical Guide to Information Security Testing and Assessment →. This guideline provides a structured foundation for planning, executing, and documenting technical evaluations such as testing, vulnerability assessments, and code reviews. Hacken’s internal methodology and security assessment framework extend these principles to blockchain environments to ensure consistency, repeatability, and verifiable outcomes.