As of 3 Nov 2026, Rangers Protocol has 3 audit reports by 1 security firm on Trustblock; the latest is by CertiK, dated 18 Dec 2024. Those reports list no open critical findings. It also holds 1 deployed contract on 1 chain.
Record last updated . It holds audits, findings and contracts up to Nov 2026, and incidents up to Oct 2026. Trustblock does not review code.
Newest first
| Audit | Security firm | Date | Scope | Critical findings | Report |
|---|---|---|---|---|---|
| Rangersprotocol-CrossContract | Security firm: CertiK | Date: | Scope: Files named in the report | No open critical findings | Open · skynet.certik.com |
| Rangers Protocol | Security firm: CertiK | Date: | Scope: Files named in the report | No open critical findings | Open · skynet.certik.com |
| Rangers Protocol III | Security firm: CertiK | Date: | Scope: 1 address on Ethereum | No open critical findings | Open · skynet.certik.com |
Statuses are the security firm’s own, from each report.
| Severity | Open | Acknowledged | Fixed |
|---|---|---|---|
| Critical | 0 | 0 | 0 |
| High | 0 | 4 | 2 |
| Medium | 2 | 2 | 7 |
| Low | 10 | 4 | 34 |
The code mistakenly uses a comparison operator instead of the intended assignment operator. Potentially allowing a signature to be used multiple times. Example line of code: ```solidity=1634 g_Workedmap[nonce] == true; ```
Open the reportCommit: - [`0248879b845ff1a9e790580655cf7daf784536d1`](https://github.com/rangersprotocolcode/go-rangers/tree/0248879b845ff1a9e790580655cf7daf784536d1) Files: - src/common/sign.go - src/core/sync_msg.go - src/core/sync_processor.go The `SignInfo.Id` property is generally used as peer identifier in order to detect bad nodes and to send back responses after answers. However, the codebase lacks proper checks that `SignInfo.Id` represents a legitimate peer identity. Moreover, the `SignData.ValidateSign` function, fetches the public key of the signed payload from the message itself, instead of matching it with a whitelist or blacklist of already known peers. This means that any peer could include an arbitrary `Id` and impersonate any other peer. A malicious node could leverage such situation and, based on the involved functionality, bring the target node in an inconsistent state or circumvent any identity based protection mechanism. The issue involves the following functionalities. - The `chainInfoNotifyHandler` adds to the internal `candidatePool` map the potential updates of the chain. When doing such operation, the `chainInfo.SignInfo.Id` property provides information on the sender peer. If such peer was flagged as "evil" in the `PeerManager` then such message is not considered. Since any peer could present an arbitrary `Id`, a malicious node could leverage such situation and bring a target node in an inconsistent state, letting it accept as global state some chain incorrect chain information. - The `blockChainPieceReqHandler` method is supposed to handle the incoming request of a blockchain piece. Since the `Id` can be arbitrarily set by the sender, an attacker could exploit the whole network to flood with responses a target node which, instead, did not perform any request. Such vulnerability enables and attacker to use the whole network as amplification system for a DDoS attack. - The `blockChainPieceHandler` handle manages incoming chain information filtering out messages coming from peers other than the expected candidate. Any malicious node can arbitrarily set the `chainPieceInfo.SignInfo.Id` property and circumvent such check on the sender. - The `blockResponseMsgHandler` and `groupResponseMsgHandler` handlers respectively check the received block or group response comes from the expected candidate peer by checking its Id. Any malicious node can impersonate the expected candidate peer and provide wrong information on the synchronized block.
Open the report`WithdrawErc20_CM` accepts `_tocontract` as an address, while `WithdrawErc20_CM2` accepts `_tocontract` as bytes. However, during the signature encoding process, an address is converted to bytes. This conversion allows the parameters of WithdrawErc20_CM2 to pass validation in WithdrawErc20_CM. The function `WithdrawErc20_CM2` has the restrictions on the `fromchainid`, but the `WithdrawErc20_CM` does not have. The parameters for the function `WithdrawErc20_CM2` can be called successfully in the `WithdrawErc20_CM`.
Open the reportThe `WithdrawErc721_CM` function relies on the `ownerOf` method of the ERC721 contract to determine the owner of a given tokenId. ```solidity /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); ``` However, this approach introduces a vulnerability and may block minting operations due to the following issues: If the `tokenId` does not exist or the `owner` is not the `address(this)`, both scenarios result in `ok` being `false`. However, the minting logic should differentiate between these two cases to ensure proper handling: - If the tokenId does not exist: The contract should mint the token. - If the tokenId exists but the owner is not address(this): The contract is unable to mint the token. ```solidity bool ok; try g_CrossEx.TryownerOf(_fromcontract,_nftid,address(this)) returns(bool v) { ok = v; }catch{ ok = false; } if(ok == true){ IERC721(_fromcontract).transferFrom(address(this),_addr,_nftid); g_Workedmap[nonce] == true; emit event_withdrawErc721_CM(_fromcontract,_fromchainId,_tocontract,_addr,_nftid); return; }else{ IERC721(_fromcontract).mint(_addr,_nftid); g_Workedmap[nonce] == true; emit event_withdrawErc721_CM(_fromcontract,_fromchainId,_tocontract,_addr,_nftid); return; } ```
Open the reportCommit: - [`0248879b845ff1a9e790580655cf7daf784536d1`](https://github.com/rangersprotocolcode/go-rangers/tree/0248879b845ff1a9e790580655cf7daf784536d1) Files - src/core/sync_msg.go The function `verifyBlockChainPiece()` does not verify the `topHeader` is legitimate via `consensusHelper.VerifyBlockHeader`. Per the comment of `VerifyBlockHeader`. ```go //verify the blockheader: mainly verify the group signature VerifyBlockHeader(bh *BlockHeader) (bool, error) ``` A malicious node can send a chain piece of info with a malformed group signature to parse the verification process of `verifyBlockChainPiece()`, which may bring unexpected errors.
Open the reportCommit: - [`0248879b845ff1a9e790580655cf7daf784536d1`](https://github.com/rangersprotocolcode/go-rangers/tree/0248879b845ff1a9e790580655cf7daf784536d1) Files: - src/storage/trie/database.go The function `Commit()` iterates over all the children of a particular node, and writes them out to disk. Before writing nodes to disk, The function `Commit()` places a read-only locker by `db.lock.RLock()`, However, when failing to write in batch mode, The function `Commit()` forgets to unlock the read-only locker, which may cause a potential deadlock. ```go func (db *NodeDatabase) Commit(node common.Hash, report bool) error { // Create a database batch to flush persistent data out. It is important that // outside code doesn't see an inconsistent state (referenced data removed from // memory cache during commit but not yet in persistent storage). This is ensured // by only uncaching existing data when the database write finalizes. db.lock.RLock() for hash, preimage := range db.preimages { if err := batch.Put(db.secureKey(hash[:]), preimage); err != nil { db.lock.RUnlock() return err } if batch.ValueSize() > xdb.IdealBatchSize { if err := batch.Write(); err != nil { return err //@audit here } batch.Reset() } } ``` Since the file is out of scope, we mark this finding as medium.
Open the reportCommit: - [`0248879b845ff1a9e790580655cf7daf784536d1`](https://github.com/rangersprotocolcode/go-rangers/tree/0248879b845ff1a9e790580655cf7daf784536d1) Files: - src/core/groupchain.go When a user tries to stop a node with ctrlc, the `handleExit()` will be called. **src/gx/cli/gx.go** ```go func (gx *GX) handleExit(ctrlC <-chan bool, quit chan<- bool) { <-ctrlC fmt.Println("exiting...") consensus.StopMiner() if core.GetBlockChain() != nil { core.GetBlockChain().Close() } service.Close() middleware.Close() log.Close() if gx.init { quit <- true } else { os.Exit(0) } } ``` However, the `Close()` function from file src/core/groupchain.go which will close a leveldb `groups` won't be called. ```go func (chain *groupChain) Close() { chain.groups.Close() } ``` If you forget to close a LevelDB database properly and attempt to open it again, you may encounter an error indicating that the database is locked or in use. LevelDB uses file locking to prevent multiple processes from writing to the database simultaneously, which can cause data corruption. In addition, the `Close()` function does not close the derived leveldb `joinedGroups`.
Open the reportCommit: - [`0248879b845ff1a9e790580655cf7daf784536d1`](https://github.com/rangersprotocolcode/go-rangers/tree/0248879b845ff1a9e790580655cf7daf784536d1) Files: - src/core/blockchain_add.go - src/core/sync_processor.go - src/core/sync_msg.go The `syncProcessor` struct fires periodic go-routines based on 4 internal timers that get reset each time they expire through the `Reset` call. Such method, as documented in the Go Standard Library, can be called on stopped and expired `Timer` instances once the firing channel is drained, too. In case a single handler is called upon `Timer` expiration, such guarantee is ensured by design. In case the `Timer` may be `Reset` by a different and/or concurrent handler, then a call to `Stop` should ensure the `Timer` is in a state that can be safely reset. However, in the following case such guarantee is not respected: - The `trySync` function is called not only upon the expiration of the `syncTimer`, but also in the `addCandidate` function, which is not involved in the periodic `loop` on the `syncTimer`. The consequence is that a `trySync` invocation may try to `Reset` the timer while it is still active. - The `broadcastTimer` timer is reset in `broadcastChainInfo`, but such method may be called as a go-routine in the `successOnChainCallBack` function, which is not related to the firing of the `broadcastTimer`, which can cause an inconsistent `Reset` of the timer. - In `syncProcessor.syncGroup` the `Reset` method is called on `groupReqTimer` but there is no guarantee the timer is already stopped or expired. - The `blockReqTimer` timer can be reset in the function `requestBlockChainPiece`, which will be called by the function `trySync()`. However, `trySync()` can be triggered by the timer `syncTimer`, which does not guarantee that `blockReqTimer` is stopped or expired with a drained channel. The same issue exists in the function `syncBlock`.
Open the reportThe function `transfer()` in the contract `RPG.sol` added limit for the sender account and receipt account. However, the function `transferFrom()` has no similar limit.
Open the reportThe `WithdrawErc721_CM` function should call the commented `VerifyCrossErc721Sign` function rather than the `VerifyCrossErc20Sign`. Although the functionality of these two functions are same, the naming convention is bad.
Open the reportThe **require** can be used to check for conditions and throw an exception if the condition is not met. It is better to provide a string message containing details about the error that will be passed back to the caller.
Open the reportThe functions of `DoCross1155_CM` exist in both `CrossContract` and `CrossContractEx`: # Function Name Shadowing: Both `CrossContract` and `CrossContractEx` define a function with the same name (DoCross1155_CM), leading to potential confusion and reduced readability. The sanem shadowing issue applies to the `WithdrawErc1155_CM` function. Name shadowing could result in developers or auditors misinterpreting the flow or function call source, increasing the likelihood of errors. ```solidity contract CrossContract{ CrossContractEx public g_CrossEx; function DoCross1155_CM(address _fromcontract,address _tocontract,uint256 _toChainId,address _fromaddr,address _toaddr,uint256[] memory _ids,uint256[] memory _values) payable external{ {... } } contract CrossContractEx is Ownable{ function DoCross1155_CM(address sender,address _fromcontract,address _fromaddr,uint256[] memory _ids,uint256[] memory _values) payable external returns(bool){ ... } } ```
Open the reportThe `CrossContractEx` has at least one payable function that does not utilize the forwarded ETH. Additionally, these contracts lack a mechanism to withdraw ETH. As a result, any ETH sent to these contracts may become permanently trapped.
Open the reportCommit: - [`0248879b845ff1a9e790580655cf7daf784536d1`](https://github.com/rangersprotocolcode/go-rangers/tree/0248879b845ff1a9e790580655cf7daf784536d1) Files: - src/core/blockchain.go `block` is a pointer returned from `types.UnMarshalBlock()`. However, `&block` that gets an address of a pointer(even nil value) won't be nil, thus the condition `&block == nil` won't be satisfied forever. ```go=434 var block *types.Block block, err = types.UnMarshalBlock(result) if err != nil || &block == nil { return nil } return block ```
Open the reportCommit: - [`0248879b845ff1a9e790580655cf7daf784536d1`](https://github.com/rangersprotocolcode/go-rangers/tree/0248879b845ff1a9e790580655cf7daf784536d1) Files: - src/core/game_executor.go The `gameExecutor.runTransaction` function checks the `txRaw.Source` not to be an empty string. The audit team would like clarification on the cases such condition is possible.
Open the reportCommit: - [`0248879b845ff1a9e790580655cf7daf784536d1`](https://github.com/rangersprotocolcode/go-rangers/tree/0248879b845ff1a9e790580655cf7daf784536d1) Files: - src/core/msg_handler.go The `ChainHandler` struct has a methods called `Handle` which has an empty implementation that returns `nil` only. The methods is called by the network module on the arrival of a new message.
Open the reportCommit: - [`0248879b845ff1a9e790580655cf7daf784536d1`](https://github.com/rangersprotocolcode/go-rangers/tree/0248879b845ff1a9e790580655cf7daf784536d1) Files: - src/core/rpc_types.go The `ConvertBlockByHeader` function returns the provided block information in an `RPCBlock` struct suitable for being sent as RPC response. However, the response includes a `TransactionRoot` field which is constantly set as the empty trie root, independently from the effective list of transactions include in a block. Such practice can introduce unexpected outcomes in interaction with external components. In fact, they would obtain inconsistent information about the requested block: an empty transaction trie but a non-empty transaction list.
Open the reportCommit: - [`0248879b845ff1a9e790580655cf7daf784536d1`](https://github.com/rangersprotocolcode/go-rangers/tree/0248879b845ff1a9e790580655cf7daf784536d1) Files: - go.mod The declared Golang version is `1.13`, but the `core` module contains a call to `time.Milli` which is only available starting from version `1.17`.
Open the reportCommit: - [`0248879b845ff1a9e790580655cf7daf784536d1`](https://github.com/rangersprotocolcode/go-rangers/tree/0248879b845ff1a9e790580655cf7daf784536d1) Files: - src/core/bad_peers.go The `loop` method of the `peerManager` struct is in charge to periodically check if a peer, previously marked as bad, can have its status restored by being removed from the blacklist. The periodic iterations are fired by the `cleaner` `Ticker`. Since the `loop` function only awaits for the ticker to fire, there is no need to use a generic `for` loop followed by a `select` construct.
Open the reportCommit: - [`0248879b845ff1a9e790580655cf7daf784536d1`](https://github.com/rangersprotocolcode/go-rangers/tree/0248879b845ff1a9e790580655cf7daf784536d1) Files: - src/core/groupchain.go The `logger` variable at the pointed location is checked to be not `nil` before being used. If it is `nil`, then the message is not sent to the logger to avoid a `nil` dereference and execution continues. However, in some lines after, the `logger` variable is directly used without further checks. If `logger` can be `nil`, then the following usages will make the code panic since they will be using a `nil` reference.
Open the reportCommit: - [`0248879b845ff1a9e790580655cf7daf784536d1`](https://github.com/rangersprotocolcode/go-rangers/tree/0248879b845ff1a9e790580655cf7daf784536d1) Files: - src/core/fork_group.go - src/core/fork_block.go The `finishCurrentSync` function is responsible for handling the termination of block forks or group forks within the Golang blockchain codebase. However, it has been identified that the function does not properly close database connections when destroying these forks. The relevant code snippet is as follows: ```go if p.blockFork != nil { p.blockFork.destroy() p.blockFork = nil } if p.groupFork != nil { p.groupFork.destroy() p.groupFork = nil } ``` The `destroy` method is called on both `blockFork` and `groupFork` objects, but it lacks the necessary logic to close database connections. This oversight can lead to database connection leaks, which may result in unexpected errors and could potentially exhaust database resources, leading to a denial of service.
Open the reportCommit: - [`0248879b845ff1a9e790580655cf7daf784536d1`](https://github.com/rangersprotocolcode/go-rangers/tree/0248879b845ff1a9e790580655cf7daf784536d1) Files: - src/core/game_executor.go The `read` method of the `GameExecutor` struct handles messages published on the `ClientTransactionRead` channel. Such messages represent requests about the chain data from external clients. Based on the `Transaction.Type`, messages are unmarshaled and served. The transaction type highlighted by the pointed locations unmarshals the input parameters in a generic `map[string]string` which leaves freedom to set fields with any name. For such reason, the accessed values at predefined keys, e.g. `height`, `hash, `address`, `txHash`, may or may not be set. The existence of such entries should be verified before accessing them, to avoid trying to read `map` keys that are not set.
Open the reportCommit: - [`0248879b845ff1a9e790580655cf7daf784536d1`](https://github.com/rangersprotocolcode/go-rangers/tree/0248879b845ff1a9e790580655cf7daf784536d1) Files: - src/core/blockchain.go The `queryTxsByBlockHash()` function is designed to retrieve transactions (`txs`) based on their block hash. However, the implementation does not account for potential nil values within the `txHashList`. When the function attempts to dereference `verifiedTx`, it may result in a runtime panic, which could cause a denial of service or other unintended behavior. ```go for _, verifiedTx := range verifiedTxs { if verifiedTx.Hash == hash[0] { tx = verifiedTx break } } ```
Open the reportCommit: - [`0248879b845ff1a9e790580655cf7daf784536d1`](https://github.com/rangersprotocolcode/go-rangers/tree/0248879b845ff1a9e790580655cf7daf784536d1) Files: - src/core/blockchain.go When removing a block, the function `remove()` will try to remove block info from db(hashDB/heightDB/verifyHashDB), `topBlocks`, and `verifiedBlocks`. However, the function does not remove block info from verifiedBodyCache, which will be used in `queryTxsByBlockHash()`. ```go=430 func (chain *blockChain) queryTxsByBlockHash(blockHash common.Hash, txHashList []common.Hashes) ([]*types.Transaction, []common.Hashes, error) { if nil == txHashList || 0 == len(txHashList) { return nil, nil, service.ErrNil } verifiedBody, _ := chain.verifiedBodyCache.Get(blockHash) var verifiedTxs []*types.Transaction if nil != verifiedBody { verifiedTxs = verifiedBody.([]*types.Transaction) } //... } ``` A user still can query TXs from `verifiedBodyCache` by blockHash as verified TXs even if the block is removed, which may bring some unexpected errors.
Open the reportCommit: - [`0248879b845ff1a9e790580655cf7daf784536d1`](https://github.com/rangersprotocolcode/go-rangers/tree/0248879b845ff1a9e790580655cf7daf784536d1) Files: - src/core/game_executor.go The `read` handler sends a successful response after the incoming message is processed. However, in the case of an error occurring during the message execution, e.g. for the marshaling and unmarshaling of the parameter or for errors on the input data, a success response is always returned with an empty result and the error is ignored. In such a way the wrong feedback is provided to the calling client.
Open the reportCommit: - [`0248879b845ff1a9e790580655cf7daf784536d1`](https://github.com/rangersprotocolcode/go-rangers/tree/0248879b845ff1a9e790580655cf7daf784536d1) Files: - src/core/blockchain_add.go The `insertBlock` method adds a new block on top of the current chain and updates the node state. Such a task involves several operations like saving the new state root, removing transactions from the mempool and updating the current top block. It is important to keep the consistency of the information of the chain that all such operations either succeed or fail at the same time in an atomic manner. The `updateLastBlock` call at the pointed lines admits a `false` outcome that lets `insertBlock` return with an error code. However, if the function returns with an error code at this point, there is not any revert of the previous updates and, despite the early return, the node state is partially updated, leaving it in an inconsistent state. Specifically, the following functions were called and not reverted upon error: - `saveBlockState` - `updateVerifyHash` - `updateTxPool` - `topBlocks.Add` At the same manner, in the `saveBlockState` function, invoked inside `insertBlock`, both calls to `Commit` on `state` and `trieDB` may fail, but there is not any revert mechanism for `state` in case the `Commit` on `trieDB` returns an error.
Open the reportCommit: - [`0248879b845ff1a9e790580655cf7daf784536d1`](https://github.com/rangersprotocolcode/go-rangers/tree/0248879b845ff1a9e790580655cf7daf784536d1) Files: - src/core/blockchain.go An off-by-one error is a logic error involving the discrete equivalent of a boundary condition. The function `buildCache` is intended to add `size` blocks to cache `chain.topBlocks` when the latest block height is greater than or equal to `size`, however only `size-1` blocks will be added. ```go func (chain *blockChain) buildCache(size uint64) { var start uint64 if chain.latestBlock.Height < size { start = 0 } else { start = chain.latestBlock.Height - (size - 1) } for i := start; i < chain.latestBlock.Height; i++ { chain.topBlocks.Add(i, chain.QueryBlockHeaderByHeight(i, false)) } } ```
Open the reportCommit: - [`0248879b845ff1a9e790580655cf7daf784536d1`](https://github.com/rangersprotocolcode/go-rangers/tree/0248879b845ff1a9e790580655cf7daf784536d1) Files: - src/core/blockchain.go The `RequestIds` property in the `BlockHeader` struct is computed starting from the transactions set in `Block.Transaction` as input from `CastBlock`. However, such list of transactions is subsequently modified when the transaction are effectively executed by the EVM. As a result, since the list of transactions may have changed, the already computed `RequestIds` could be invalid but anyway included in the `Block.Header`.
Open the reportCommit: - [`0248879b845ff1a9e790580655cf7daf784536d1`](https://github.com/rangersprotocolcode/go-rangers/tree/0248879b845ff1a9e790580655cf7daf784536d1) Files: - src/core/blockchain.go The function `queryTxsByBlockHash()` is intended to query all the verified txs in `txHashList`. When finding all the available txs in `txHashList`, a nil tx may be added to the return array `txs`. ```go=468 for _, hash := range txHashList { var tx *types.Transaction if verifiedTxs != nil { for _, verifiedTx := range verifiedTxs { if verifiedTx.Hash == hash[0] { tx = verifiedTx break } } } if tx == nil { tx, err = chain.transactionPool.GetTransaction(hash[0]) } if tx == nil { need = append(need, hash) } txs = append(txs, tx)//tx may be nil } ``` Dereferencing a nil transaction in `txs` may cause a panic error.
Open the reportCommit: - [`0248879b845ff1a9e790580655cf7daf784536d1`](https://github.com/rangersprotocolcode/go-rangers/tree/0248879b845ff1a9e790580655cf7daf784536d1) Files: - src/core/blockchain_verify.go The `hashList` variable is a slice with an upper bound of $100$ elements enforced by the subsequent logic. Since the following code accounts for such limit and the number of transactions in a block can easily be a multiple of $100$, the Go runtime needs to allocate new segments of contiguous memory each time the default capacity of the array is exceeded. Given the described constraint on the slice length, such overhead can be saved with a unique array allocation.
Open the reportCommit: - [`0248879b845ff1a9e790580655cf7daf784536d1`](https://github.com/rangersprotocolcode/go-rangers/tree/0248879b845ff1a9e790580655cf7daf784536d1) Files: - src/core/game_executor.go The Go language will automatically provide a break statement at the end of each case block. So the break statement that is needed in switch cases in many other languages is not needed in go.
Open the reportCommit: - [`0248879b845ff1a9e790580655cf7daf784536d1`](https://github.com/rangersprotocolcode/go-rangers/tree/0248879b845ff1a9e790580655cf7daf784536d1) Files: - src/core/blockchain_add.go - src/core/fork_group.go - src/core/fork_block.go The function call `len(nil)` returns 0, thus it is unnecessary to check if the key is `nil`. **src/core/blockchain_add.go** ```go func dumpTxs(txs []*types.Transaction, blockHeight uint64) { if txs == nil || len(txs) == 0 { return } ``` **src/core/fork_group.go**\ **src/core/fork_block.go** ```go if bytes == nil || len(bytes) == 0 { return nil } ```
Open the reportCommit: - [`0248879b845ff1a9e790580655cf7daf784536d1`](https://github.com/rangersprotocolcode/go-rangers/tree/0248879b845ff1a9e790580655cf7daf784536d1) Files: - src/core/blockchain_sync.go The pointed snippet of code explicitly returns the condition in the `if` statement. ```go=76 if hashBigCompareValue > 0 { return true } return false ```
Open the reportCommit: - [`0248879b845ff1a9e790580655cf7daf784536d1`](https://github.com/rangersprotocolcode/go-rangers/tree/0248879b845ff1a9e790580655cf7daf784536d1) Files: - src/core/blockchain_consistency.go - src/core/groupchain.go The code at the pointed locations calls the underlying database to perform the requested modifications. However, errors that may arise from such calls are not handled and execution proceeds independently from the operation success. Such behavior can introduce inconsistent states inside the expected logic.
Open the reportCommit: - [`0248879b845ff1a9e790580655cf7daf784536d1`](https://github.com/rangersprotocolcode/go-rangers/tree/0248879b845ff1a9e790580655cf7daf784536d1) Files: - src/core/fork_block.go The `addBlockOnFork` function verifies and commits a new block on a chain fork. After all the checks are performed the state and the chain are updated with the `fork.saveState` and `fork.insertBlock` calls. Such methods may fail and return an error, but such a condition is not managed by the calling logic that, instead, ignores any outcome. If any error is raised, then the execution continues and: - in case there are new blocks to add, the next blocks fail to verify due to the inconsistent state; - in case there are no new blocks to add, the fork is left in an inconsistent state.
Open the reportCommit: - [`0248879b845ff1a9e790580655cf7daf784536d1`](https://github.com/rangersprotocolcode/go-rangers/tree/0248879b845ff1a9e790580655cf7daf784536d1) Files: - src/core/blockchain.go The `StateTree` property of the `BlockHeader` struct is set on struct create but it is replaced with the correct value at the end of the `CastBlock` function where the correct hash is computed. The first initialization can be saved.
Open the reportCommit: - [`0248879b845ff1a9e790580655cf7daf784536d1`](https://github.com/rangersprotocolcode/go-rangers/tree/0248879b845ff1a9e790580655cf7daf784536d1) Files: - src/core/blockchain.go The `init` field in the `blockChain` struct is set at the end of the `initBlockChain` function but it is never read.
Open the reportCommit: - [`0248879b845ff1a9e790580655cf7daf784536d1`](https://github.com/rangersprotocolcode/go-rangers/tree/0248879b845ff1a9e790580655cf7daf784536d1) Files: - src/core/blockchain_add.go The pointed code snippets are unused.
Open the reportCommit: - [`0248879b845ff1a9e790580655cf7daf784536d1`](https://github.com/rangersprotocolcode/go-rangers/tree/0248879b845ff1a9e790580655cf7daf784536d1) Files: - src/core/fork_group.go The following variables contain errors which are defined but never used: - `verifyGroupErr`
Open the reportCommit: - [`0248879b845ff1a9e790580655cf7daf784536d1`](https://github.com/rangersprotocolcode/go-rangers/tree/0248879b845ff1a9e790580655cf7daf784536d1) Files: - src/core/blockchain_add.go A `panic` in Golang means that the exceptions are raised at runtime when an error is encountered typically. Mostly it is used to fail fast on errors that shouldn’t occur during normal operations, or those that are not prepared to handle gracefully. In the current codebase, `panic` is used during blockchain runtime, which may stop the current node.
Open the reportCommit: - [`0248879b845ff1a9e790580655cf7daf784536d1`](https://github.com/rangersprotocolcode/go-rangers/tree/0248879b845ff1a9e790580655cf7daf784536d1) Files: - src/core/blockchain.go - src/core/blockchain_add.go - src/core/blockchain_verify.go - src/core/game_executor.go - src/core/genesis_sub.go The pointed code locations make use of magic numbers. Such practice is error prone across development iterations and lows code readability.
Open the reportThe return address of the `counterToken` function in the `UsingLiquidityProtectionService` contract is the address of the `WETH` contract in Ethereum. Although the sub-contract has rewritten the function to return the BUSD contract address, but if the sub-contract does not rewrite the `counterToken` function, the `counterToken` function may have unexpected errors.
Open the reportThe compiler version utilized throughout the project uses the `^` prefix specifier, denoting that a compiler version that is greater than the version will be used to compile the contracts. It is recommend the compiler version should be consistent throughout the codebase.
Open the report| Address | Chain | Source code |
|---|---|---|
| 0x1f16…c1030x1f16d41f9b3db03b462bdd6c92245ee708d1c103 | Chain: Ethereum | Source code: Verified source |
Is this your project? Show this record on your own website. The label states what the record holds, links to this page and updates by itself. It is free and needs no sign-in.
Automatic: the three strongest facts of this project’s own record (its last audit and two more), highlighted. They update with the record. Picking a fact turns Automatic off.
<head><script src="https://widget.trustblock.run/project-widget.min.js" defer></script></head><body><divdata-tb-project-widgetdata-tb-project-slug="rangers-protocol"></div></body>
Paste the code where the label should appear. It uses no API credit and updates by itself.
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