ATM III

CertiKFiles named in the report

CertiK reviewed ATM (ATM III) on 13 Apr 2022: 15 findings, 0 critical; 6 marked fixed, 9 open.

No open critical findings
Open the reportOpen ATM’s security record

Report hosted on skynet.certik.com.

Trustblock does not review code.

Findings15

Statuses are the security firm’s own, from its report.

SeverityOpenAcknowledgedFixed
Critical000
High202
Medium100
Low604
HighCentralization Related RisksOpen

In the contract **Crosschain**, the role **_owner** has authority over the following functions: - renounceOwnership() - transferOwnership(address newOwner) - updatePause(bool _sta) - updateChainCharge(string calldata _chain, bool _sta, address[] calldata _tokens, uint256[] calldata _fees) - withdrawChargeAmount(address[] calldata tokenAddrs) - addNodeAddr(address[] calldata _nodeAddrs) - deleteNodeAddr(address[] calldata _nodeAddrs) Any compromise to the **_owner** account may allow a hacker to take advantage of this authority and do the following: - Transfer the ownership of the contract to any address. - Change the status of the contract, if the contract is paused, users can't withdraw tokens with signatures. - Change the cross-chain fees of tokens. If fees are too high, users will suffer losses. - Withdraw all the cross-chain fees. - Add malicious node adresses to the `nodeAddrSta`. --- In the contract **PledgeV2**, the role **_owner** has authority over the following functions: - renounceOwnership() - transferOwnership(address newOwner) - updateExecutor(address _executor) - updateGuarder(address _guarder) Any compromise to the **_owner** account may allow a hacker to take advantage of this authority and do the following: - Transfer the ownership of the contract to any address. - Change the `executor` and `guarder` addresses. --- In the contract **PledgeV2**, the role **executor** has authority over the following functions: * addNodeAddr(address[] calldata _nodeAddrs) * deleteNodeAddr(address[] calldata _nodeAddrs) Any compromise to the **executor** account may allow a hacker to take advantage of this authority and do the following: - Add malicious node adresses to the `nodeAddrSta`. --- In the contract **PledgeV2**, the role **guarder** has authority over the following functions: - deleteChain(string calldata _chain) - upadeNodesStake(address[] calldata addrs, uint256[] calldata uints, uint256 expiredTime, string calldata chain) Any compromise to the **guarder** account may allow a hacker to take advantage of this authority and do the following: - Remove all the staking data of **LUCA** related to the chain and update the **WLUCA** staking data of nodes. It will influence the rank of nodes. - Update all the staking data of **LUCA** related to the chain and the **WLUCA** staking data of nodes. It will influence the rank of nodes. --- In the contract **PledgeV2**, the role **link** has authority over the following functions. - stakeWLuca(address _nodeAddr, uint256 _amount, address _sender) - cancleStakeWLuca(address _user) Any compromise to the **link** account may allow a hacker to take advantage of this authority and do the following: - Stake and unstake **WLUCA** tokens from the node, it will influence the rank of the node. --- In the contract **TraderV2**, the role **crossChain**/**link**/**factory** has authority over the following functions: - payment(address _token, address _from, address _to, uint256 _amount) - withdrawFor(address _to, uint256 _amount) - suck(address _to, uint256 _amount, uint256 _lockDay) - suck(address _to, uint256 _amount) Any compromise to the **crossChain**/**link**/**factory** accounts may allow a hacker to take advantage of this authority and do the following: - Transfer `WLUCA` tokens from the authorised account to the contract in exchange for `LUCA` tokens. - Mint `AGT` tokens to any address. --- In the contract **FileV2**, the role **_owner** has authority over the following functions: - setOwner(address addr) - fileToken(bytes32 item, address addr) - fileModule(bytes32 item, address addr) - fileLockDay(uint256 min, uint256 max) - setCollector(address addr) - setCrossChain(address addr) - shutdown() - restart() - addToken(address addr, uint256 min) - updateTokenConfig(string memory symbol, address addr, uint256 min) Any compromise to the **owner** account may allow a hacker to take advantage of this authority and do the following: - Transfer the ownership of the contract to any address. - Change the addresses of **LUCA**, **WLUCA**, **AGT** and **WETH** token contracts. - Change the addresses of **Factory**, **Trader**, **Pledge** and **Link** contracts, it may result in the user not being able to get back the pledged assets. - Change the locking time configuration, if the configuration is set too large it will result in the user not being able to retrieve the pledged assets, if it is too small it will affect the node ranking in the **Pledge** contract. - Change the `collector` address and take all the fees. - Change the crossChain` contract address. - Change the status of the **File** contract, if the status is unactive, users can't create the **Link** contract through the **Factory** contract. - Add tokens to the whitelist of the **Factory** contract and modify the configration of tokens.

HighCentralized Control of Contract UpgradeOpen

The `file_proxy.sol`, `pledge_proxy.sol` and `trader_proxy.sol` contracts inherit upgradeable contracts, indicating that it is part of an upgradeable system. Upgradeable contracts often pair with a proxy contract that is responsible for managing contract upgrades. The `privileged roles` of the proxy often have the authority to update the implementation contract, i.e., the `fileV2.sol`,`pledgeV2.sol` and `traderV2.sol` contracts. Any compromise of the privileged account could allow a hacker to exploit this authority, potentially altering the implementation contract pointed to by the proxy and thus executing malicious functionality within the implementation contract.

MediumInvalid Multi-Node VerificationOpen

In the contract `crosschain`, it provide functionality for signature verification and multi-node validation. According to the design, signatures are considered valid when the following criteria are met: 1. The user must provide signatures from at least 3 validating nodes. 2. The function verifies the signatures and recovers the node addresses from the signatures. The node addresses must in the `nodeAddrSta` which is managed be the `owner`. However, the contracts do not perform duplicate checks on the validated node addresses. This means that when a user provides 3 duplicate signatures, they can still pass the validation. The reason is that the contract verifies the same node address 3 times. When a node's private key is compromised, an attacker can provide multiple duplicate signatures from the compromised node to withdraw tokens. Additionally, The `ecrecover()` function is subject to signature malleability. The signature malleability is possible within the Elliptic Curve cryptographic system. An Elliptic Curve is symmetric on the `X`-axis, meaning two points can exist with the same `X` value. In the `r`, `s` and `v` representation this permits us to carefully adjust `s` to produce a second valid signature for the same `r`, thus breaking the assumption that a signature cannot be replayed in what is known as a replay-attack.

LowDiscussion For `transferToken`Open

The transaction will be executed after the node has verified its legitimacy. We have some questions: 1. Will the node verify the correctness of transaction data? For example, A calls `stakeToken()` to transfer 100 `luca` token to the contract, and then calls `transferToken()` on another chain. Will the node verify the value of the amount (check whether the amount is equal to `100-fee`)? 2. When the `luca` token balance in the contract is insufficient, calling `transferToken()` will fail. How to handle this situation when the balance is insufficient?

LowLack of Input ValidationOpen

The given input is missing the sanity check for non-zero address in the aforementioned line.

LowMissing Emit EventsOpen

There should always be events emitted in the sensitive functions that are controlled by centralization roles.

LowPotential Front-Running RiskOpen

In contract `FileV2` and `PledgeV2`, malicious hackers may observe the pending transaction which will execute the `initialize` function and launch a similar transaction but with the hacker's address of `owner` and gain the ownership of the contract. In contract `CrossChain`, malicious hackers may observe the pending transaction which will execute the `init` function and launch a similar transaction but with the hacker's address of `owner` and gain the ownership of the contract.

LowUnchecked Value Of ERC-20 `transfer()`/`transferFOpen

The linked `transfer()`/`transferFrom()` invocations do not check the return value of the function call which should yield a `true` result in case of a proper ERC-20 implementation.

LowUnlocked Compiler VersionOpen

The contract has unlocked compiler version. An unlocked compiler version in the source code of the contract permits the user to compile it at or above a particular version. This, in turn, leads to differences in the generated bytecode between compilations due to different compiler versions. This can lead to an ambiguity when debugging as compiler specific bugs may occur in the codebase that would be hard to identify over a span of multiple compiler versions rather than a specific one.

Contracts in scope

No deployed address is recorded for this audit.

The report names a repository or files. Open the report to see its scope.

Repository and files the report names (4)

  • contracts/pledgeV2.sol
  • contracts/traderV2.sol
  • contracts/crosschain.sol
  • contracts/fileV2.sol

Part of ATM’s security record

ATM
Audits1 audit by 1 firmLast audit Apr 2022, by CertiK.
Critical findingsNo open critical findingsIn 1 report.
Open ATM’s security record

Security firm

CertiK

1,045 projects reviewed · 1,376 reports · latest May 2025

See CertiK’s audits

Something wrong on this page? A missing report, a wrong date, a finding that was fixed since. Tell us and we check it against its source.

Tell us