We express our gratitude to the Zignaly team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.
Zignaly is a cryptocurrency investment platform that offers automated trading services, profit-sharing with professional traders, and copy trading features for both novice and experienced investors.
Document
Review Scope
The system users should acknowledge all the risks summed up in the risks section of the report
Functional requirements are detailed.
Technical description is detailed.
Run instructions are provided.
Technical specification is provided.
The NatSpec documentation is sufficient.
The code follows the Solidity style guide.
The development environment is configured.
Code coverage of the project is 100% (branch coverage).
Deployment and basic user interactions are covered with tests.
Negative cases coverage is present.
Interactions by several users are not tested thoroughly.
Zignaly is a staking protocol with the following contracts:
ZigStaking.sol — smart contract designed for staking ERC-20 ZigCoin tokens. Users can stake tokens, which are then held in the contract, and can later unstake and withdraw tokens based on certain conditions
The owner of the ZigStaking contract is able change the staking status of the contract between "released" and "locked" states. When staking is "released," users can withdraw their staked tokens without any penalties. When toggled to "locked," users must wait through the penalty period before withdrawing their tokens
The absence of restrictions on state variable modifications by the owner leads to arbitrary changes, affecting contract integrity and user trust, especially during critical operations like minting phases. The toggleStakeStatus
function can be called at any time, allowing the owner to enable or disable staking suddenly. This unrestricted control over critical functions like staking status exacerbates the risk of unpredictable contract behavior, further undermining user confidence.
The calculation of staking rewards distribution relies on off-chain processes, using events to log stake and unstake dates that are later read by a backend system. This approach introduces a risk related to data integrity and transparency. Since the reward calculation and distribution are handled outside the blockchain, there is potential for discrepancies or manipulation in the data processing, which could lead to inaccurate reward allocations.
Code ― | Title | Status | Severity | |
---|---|---|---|---|
F-2024-5411 | Mismatch Between Documentation and Implementation | Fixed | Low | |
F-2024-5409 | Lack of Two Step Ownership Transfer Mechanism | Fixed | Low | |
F-2024-5408 | Missing Input Validation in Staking Constructor | Fixed | Low | |
F-2024-5434 | Missing Events Emitting for toggleStakeStatus Function | Fixed | Observation | |
F-2024-5410 | Ambiguous BadIndex Error Naming in withdrawTokens Function | Fixed | Observation |
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
Severity
Description
Severity
Description
Severity
Description
The scope of the project includes the following smart contracts from the provided repository:
Scope Details
contracts/ZigStaking.sol