Cointime

Download App
iOS & Android

Is token trading still secure? Centralization Risks in OnchainTrade Smart Contract

Validated Project

This security report outlines Project Onchain Trade's potential vulnerabilities and centralization risks on token staking, rewarding and trading, which could pose significant threats to the integrity and security of the platform.

Contract Centralized Risk

This smart contract encompasses several functions related to the management of a token staking and reward platform. Here's a centralized report outlining the core functions:

1. addRevenueToken(): This function is responsible for adding a new token as a revenue token. The token details are then added to the 'RevenueInfo' map and the 'revenueInfoList'.

2. addRevenue(): This function allows the contract owner to add revenue tokens, their amounts, and also updates the 'boost point'. It also ensures the stake token and reward balances are kept updated.

3. updateScore(): This function is for updating the score of a user. The score is computed based on the amount of reward the user has earned per unit time.

4. addToken(): This function allows the contract owner to add a new token to the pool of tokens for mining. The details of the token, including the reward per second and the start time, are added to 'PoolInfo'.

5. setPoolInfo(): This function allows the contract owner to set and update the pool info for a particular LP token, including the reward per second and the end time.

6. addMintPool(), updateMintPool(): These functions let the contract owner add a new mint pool or update an existing one, with details like the reward token, reward per second, start time, and end time.

7. setUpdater(), setFastPriceEvents(), setPriceDuration(), setMinBlockInterval(), setMaxTimeDeviation(), setLastUpdatedAt(), setMaxDeviationBasisPoints(), setTokens(), setPrice(), setPrices(), setCompactedPrices(): These functions allow the contract owner to set various parameters related to price events, timing, tokens, and token prices.

8. setOracle(), setRouter(): These functions enable the contract owner to specify the Oracle and Router addresses.

9. setMinExecFee(), setSystemRouter(): These functions let the contract owner set the minimum execution fee and designate a system router.

10. listPair(), setMaxTotalSize(), setPairStatus(), setTradingFeeRate(), setMaxLeverage(), setMarginRatio(): These functions let the contract owner manage the pairing of tokens, maximum size, pair status, trading fee rate, maximum leverage, and margin ratio.

11. setPriceFeed(), setFutureUtil(), setProtocolFeeTo(): These functions enable the contract owner to set the price feed address, future utility address, and protocol fee recipient address.

12. realizePairProtocoFee(), decreaseInsuranceFund(): These functions let the contract owner or protocol fee recipient realize the pair protocol fee and decrease the insurance fund.

Conclusion

The contract encompasses several functions related to the management of a token staking and reward platform. The contract owner has extensive control over platform parameters, token pools, reward rates, price feeds, and more. We have analyzed the contract code and identified potential vulnerabilities and risks that could affect the security and functionality of the platform. Practices should be taken to mitigate these issues and improve the quality and robustness of the contract.

Follow Us

Twitter: @MetaTrustLabs

Website: metatrust.io

Comments

All Comments

Recommended for you

  • Hong Kong virtual asset spot ETF debuts today

    Today, six virtual asset spot ETFs were launched online in Hong Kong. The six virtual asset spot ETFs issued this time are from Huaxia (Hong Kong), Boshi International, and Jiashi International. The three institutions have certain differences in product fees, trading, issuance, and virtual asset platforms.

  • The total open interest of Bitcoin contracts on the entire network reached US$30.62 billion

    According to Coinglass data, the total open position of Bitcoin futures contracts on the entire network is 480,870 BTC (approximately $30.62 billion).

  • Over $734 million worth of PYTH is staked

    According to Dune data, there are currently 1,253,845,543 PYTH coins in a pledged state, with a total pledge value of $734,478,896. The number of PYTH pledgers has reached 159,165.

  • ConsenSys proposes four key reasons to support Ethereum's non-security status

    The US SEC's re-examination of whether Ethereum belongs to the securities category has caused controversy. ConsenSys has put forward four reasons to support Ethereum's non-securities status:

  • This week, Memecoin will unlock over $140 million worth of MEME at one time

    According to TokenUnlocks data, Memecoin will have a one-time large-scale token unlock this week, including:

  • Australian Stock Exchange Expects to Approve Spot Bitcoin ETF by the End of 2024

    According to a source who wishes to remain anonymous, Australia will follow in the footsteps of the United States and Hong Kong by launching a Bitcoin ETF. ASX Ltd., which handles about 80% of the country's stock trading, is expected to approve the first batch of spot Bitcoin ETFs on the main board by the end of 2024. A spokesperson for BetaShares, headquartered in Sydney, said in an interview that they are working to launch a product on the Australian Securities Exchange. Another local company, DigitalX Ltd., stated in its half-year results in February that it has applied. Justin Arzadon, the head of BetaShares' digital assets, said that the inflow of funds from the United States proves that digital assets will continue to exist. Arzadon added that the company has reserved ASX stock codes for spot Bitcoin and spot Ethereum ETFs.

  • SlowMist: Beware of watering hole attacks launched by malicious attackers using WordPress plugin vulnerabilities

    SlowMist Security has issued a warning that attackers have recently been exploiting vulnerabilities in WordPress plugins to inject malicious JS code into normal websites and launch watering hole attacks. These attacks involve popping up malicious windows when users visit the site, deceiving them into executing malicious code or performing Web3 wallet signatures, thereby stealing their assets. It is recommended that sites using WordPress plugins check for vulnerabilities, update plugins in a timely manner, and avoid being attacked. When visiting any website, users should carefully identify the downloaded programs and Web3 signature content to avoid downloading malicious programs or having their assets stolen due to malicious signatures.

  • Unverified Ember Sword NFT auction contract vulnerability has caused nearly $200,000 in losses

    Certik has discovered a vulnerability in the unverified Ember Sword NFT auction contract, which has earned 60 WETH (approximately $195,000) from 159 victims who approved the contract. Certik reminds users to revoke their approval of the relevant contract on Polygon.

  • zkSync ecological lending platform xBank Finance suspected of RUG

    xBank Finance, a zkSync ecosystem lending platform, was suspected of being a RUG, and the protocol's TVL was close to zero. The project's official Twitter account has been frozen.

  • Market Dynamics and Risks of Liquid Staking Derivatives

    Exploring the pricing, liquidity and collateral dynamics of liquid staking tokens (LST's)