Quantum Audit Logo
Ethereum · Smart Contract Security · Updated Jul 24, 2026

Is Gram (prev. Toncoin) Safe? GRAM

On-chain security analysis — is it a scam or legit?

Contract 0x582d…def1 DexScreener ↗
Volume 24h
$4.2K
Liquidity
$784.6K
Price
$1.5500
Token Age
4y
Top 10 Holders
29.4%

Security Checklist

Contract VerifiedPass
Ownership RenouncedUnknown
No Mint FunctionPass
Liquidity LockedFail
Not a ProxyPass

Audit History

Jul 2367

Every audit run adds a dated snapshot — history is append-only and cannot be edited.

Audit Summary

The TONBridge Bridge contract implements a multi-signature oracle system for minting wrapped TON tokens, updating the oracle set, and controlling burn functionality. The system relies on a 2/3 majority vote from a dynamic set of oracles. A critical vulnerability was identified in the quorum calculation, significantly lowering the required number of signatures for a vote to pass. High risks are associated with the inherent centralization of the oracle system and potential for vote execution failures. Several medium and low-severity issues were also found, including the use of an outdated Solidity compiler version and a potential for vote finalization before action execution.

Final Recommendation: It is strongly recommended to immediately address the critical quorum calculation vulnerability to ensure the integrity of the multi-signature scheme. All arithmetic operations involving sensitive thresholds should be thoroughly reviewed and tested. Consider upgrading to a newer Solidity compiler version (0.8.x) to benefit from automatic overflow/underflow checks and other security enhancements. Implement a more robust error handling mechanism for vote execution to prevent votes from being marked as finished if the subsequent action fails.

Category Ratings

TechnicalMedium
6/10

The contract demonstrates a clear architecture for a multi-signature bridge, leveraging inherited ERC20 and signature verification functionalities (7.1). However, a critical flaw exists in the quorum calculation within the `generalVote` function, requiring fewer signatures than intended for a 2/3 ma

GovernanceHigh
1/10

The economic model centers around the minting and burning of a wrapped token, controlled by a set of oracles. The primary economic risk stems from the centralization inherent in the oracle system; a compromise or collusion of 1/3 + 1 oracles could lead to arbitrary token minting or disabling of burn

UpgradesMedium
5/10

The contract is not designed as an upgradeable proxy, therefore, no upgrade-specific risks or safety issues are present (7.7).

LP Distribution

Top-1 Unlocked Holder60.4%
Top-3 Unlocked81.4%

What Raised This Score

Each factor is an on-chain fact recorded at the time of this analysis. The score is computed from them by a deterministic function, so the same contract returns the same score for anyone who runs the audit. How scores are computed

Security Findings

1 Critical 2 High 2 Medium 1 Low 1 Info
C-01CriticalUnresolved

Incorrect Quorum Calculation for 2/3 Majority

The `generalVote` function calculates the required number of signatures for a 2/3 majority using integer division: `signatures.length >= 2 * oraclesSet.length / 3`. This calculation incorrectly truncates the result, leading to a lower-than-intended quorum for many `oraclesSet.length` values. For example, with 2 oracles, it requires 1 signature instead of 2; with 4 oracles, it requires 2 signatures instead of 3. This significantly weakens the security of the multi-signature scheme, making it easier for a minority of oracles to pass votes.

Recommendation: Modify the quorum calculation to correctly implement ceiling division for 2/3 of the oracle set. The formula `(2 * oraclesSet.length + 2) / 3` should be used to ensure the correct number of signatures is required. Thoroughly test this change with various oracle set sizes.
H-01HighUnresolved

Centralization Risk and Oracle Compromise

The entire security and integrity of the Bridge contract, including token minting, oracle set updates, and burn status control, relies on the honesty and security of the oracle set. A compromise or collusion of 1/3 + 1 oracles (e.g., 2 out of 3, or 3 out of 4 with the current bug) can lead to unauthorized minting of tokens, disabling of the burn mechanism, or taking full control of the oracle set. This represents a significant centralization risk inherent to the design.

Recommendation: While this is a fundamental design choice, it is crucial to acknowledge and mitigate the risks associated with oracle centralization. Implement robust off-chain security practices for oracle key management, multi-factor authentication, and continuous monitoring. Consider mechanisms for emergency pauses or community-driven overrides if a supermajority of oracles is compromised, though this would require significant architectural changes.
H-02HighUnresolved

Vote Finalization Before Action Execution

In the `generalVote` function, the `finishedVotings[digest] = true` flag is set *before* the actual action (e.g., `executeMinting`, `updateOracleSet`, `allowBurn = newBurnStatus`) is performed. If the subsequent action reverts due to an unexpected condition (e.g., an internal error in `mint`, or a `require` statement failure in `updateOracleSet`), the vote will still be marked as finished. This prevents any retry for that specific digest, potentially leaving a valid vote in a 'stuck' state where the action was intended but never completed.

Recommendation: Refactor the `generalVote` function to set `finishedVotings[digest] = true` *after* the successful execution of the associated action. This ensures that a vote is only marked as complete if its intended effect has been successfully applied to the contract state. Alternatively, implement a mechanism to allow a failed vote to be retried or explicitly cancelled by a supermajority.
M-01MediumUnresolved

Outdated Solidity Compiler Version

The contract uses Solidity `^0.7.0` and `^0.7.4`. These versions do not include automatic overflow and underflow checks for unsigned integers, which are standard in Solidity 0.8.0 and later. While no direct overflow/underflow vulnerabilities were identified in critical arithmetic beyond the quorum calculation, relying on older compiler versions increases the risk of subtle arithmetic bugs and misses out on other security improvements and optimizations present in newer versions.

Recommendation: Consider upgrading the contract to Solidity 0.8.x. This would provide automatic overflow/underflow checks, reducing the need for manual `SafeMath` implementations or extensive manual checks. A thorough review and testing process would be required to ensure compatibility and address any breaking changes introduced by the newer compiler version.
M-02MediumUnresolved

`oracleSetHash` Parameter Unused in `updateOracleSet`

The `voteForNewOracleSet` function takes an `int oracleSetHash` parameter, which is used to generate the digest for the vote. However, the `updateOracleSet` function, which is called after a successful vote, receives this `oracleSetHash` but does not use it to verify the `newSet` array. While the `newSet` itself is part of the digest and directly applied, the `oracleSetHash` parameter could be misleading if it implies a verification that does not occur within the `updateOracleSet` function.

Recommendation: Clarify the purpose of `oracleSetHash`. If it's purely an identifier for the vote, consider renaming it to avoid confusion. If it's intended to be a hash of the `newSet` for verification, implement the corresponding check within `updateOracleSet`. Ensure documentation clearly explains its role.
L-01LowUnresolved

Initial Oracle Set Not Subject to Vote

The `constructor` of the Bridge contract directly calls `updateOracleSet` with the `initialSet` provided during deployment. This means the initial set of oracles is established without any multi-signature vote. While this is a standard practice for contract initialization, it places full trust in the deployer to correctly and securely configure the initial oracle set.

Recommendation: Ensure that the deployment process is highly secure and that the `initialSet` of oracles is carefully chosen and verified. Document this trust assumption clearly for users and stakeholders. This is generally acceptable for bootstrapping a system.
I-01InformationalUnresolved

`experimental ABIEncoderV2` Pragma Used

The contract uses `pragma experimental ABIEncoderV2;`. While ABIEncoderV2 has been widely adopted and is considered stable in practice, it was an experimental feature in Solidity 0.7.x. In Solidity 0.8.0 and later, it is enabled by default and the pragma is no longer necessary.

Recommendation: This is an informational note. If upgrading to Solidity 0.8.x, this pragma can be removed. No immediate action is required for functionality or security in 0.7.x, but it's a reminder of the compiler version's experimental features.

Would You Like a More Detailed Audit of Gram (prev. Toncoin)?

Our AI-powered scanner gives you a deeper, real-time smart contract analysis — free, no signup required.

Get Detailed Audit
Run Free Audit →