Rangers Protocol has 3 public audit reports from CertiK; the latest is CertiK, 18 Dec 2024; no critical findings reported. It also holds 2 deployed contracts on 2 chains.
Last updated . It holds audits and findings, contracts and incidents up to Nov 2026. Trustblock does not review code.
Newest first
| Report | Security firm | Date | Scope | Critical findings | Findings | Source |
|---|---|---|---|---|---|---|
| Rangersprotocol-CrossContract | Security firm: CertiK | Date: | Scope: Files listed | None open | Findings: 4 high · 4 medium · 8 low 7 fixed · 5 acknowledged · 4 open | skynet.certik.com ↗ |
| Rangers Protocol | Security firm: CertiK | Date: | Scope: Files listed | None open | Findings: 1 high · 6 medium · 34 low 33 fixed · 8 open | skynet.certik.com ↗ |
| Rangers Protocol III | Security firm: CertiK | Date: | Scope: 1 address on Ethereum | None open | Findings: 1 high · 1 medium · 6 low 3 fixed · 5 acknowledged | skynet.certik.com ↗ |
65 findings in 3 reports: 43 fixed, 10 acknowledged (the team chose not to change the code), 12 open.
| Severity | Open | Acknowledged | Fixed |
|---|---|---|---|
| Critical | 0 | 0 | 0 |
| High | 0 | 4 | 2 |
| Medium | 2 | 2 | 7 |
| Low | 10 | 4 | 34 |
In the contract `CrossContractEx` the role `_owner` has authority over the function shown in the diagram below. Any compromise to the `_owner` account may allow the hacker to take advantage of this authority and: - `ChangeMutisign_CM`, to set the `g_MutiSignContract_CM`  In the contract `CrossContractEx` the role `g_Parent` has authority over the functions shown in the diagram below. Any compromise to the `g_Parent` account may allow the hacker to take advantage of this authority and: - `TryownerOf`, to check whether the owner of `_nftid` is the parameter `owneraddr`. - `FormatDecimal`, to convert the amount to the target decimal. - `VerifyCrossErc20Sign`, to verify the sign. - `VerifyCrossErc20Sign2`, to verify the sign. - `VerifyCrossErc721Sign_batch`, to batch verify the sign. - `VerifyCrossErc1155Sign`, to verify the sign. - `DoCross1155_CM`, to check whether the `_fromaddr` approve the `g_Parent` contract for the ERC1155 tokens. - `WithdrawErc1155_CM`, to verify the sign.  In the contract `CrossContract` the role `g_Setter` has authority over the functions shown in the diagram below. Any compromise to the `g_Setter` account may allow the hacker to take advantage of this authority and: - `init`, to set the values of sensitive state variables initially. - `AddPoolFts`, to add an address to the `g_pool_fts` array. - `DelPoolFts`, to set an existing address to zero address in the `g_pool_fts` array. - `SetEventCfg`, to set the `g_EventConfigContract`. - `SetCrossEx`, to set the `g_CrossEx`.  In the contract `EventConfig` the role `_owner` has authority over the functions shown in the diagram below. Any compromise to the `_owner` account may allow the hacker to take advantage of this authority and: - `AddCfg`, to add a new cfg to the `g_Events` array. - `DelCfg`, to set one cfg in the `g_Events` array to empty.  In the contract `MutiSign_CM` the role `_owner` has authority over the functions shown in the diagram below. Any compromise to the `_owner` account may allow the hacker to take advantage of this authority and: - `DelCheckGroup`, to remove an existing address from the `g_CheckAddrs` array. - `SetGroupId`, to add or modify a groupId in the `g_CheckAddrs` array. The role `g_CheckAddrs[0]` has authority over the function `AddCheckGroup` to add other addresses to the `g_CheckAddrs` array.  In the contract `MutiSign` the role `_owner` has authority over the function shown in the diagram below. Any compromise to the `_owner` account may allow the hacker to take advantage of this authority and: - `updateCheckAddr`, to update the `g_CheckAddr` address.  In the contract `Ownable` the role `_owner` has authority over the functions shown in the diagram below. Any compromise to the `_owner` account may allow the hacker to take advantage of this authority and: - `transferOwnership`, to transfer ownership to newOwner. - `renounceOwnership`, to renounce the ownership. 
Report ↗The `MutiSign_CM`, `EventConfig`, and `CrossContractEx` are upgradable contracts, therefore centralized roles have the authority to update the implementation contracts of their proxy contracts. Any compromise to those centralized roles account may allow a hacker to take advantage of this authority and change the implementation contracts and therefore execute potential malicious functionality.
Report ↗The function on the specified line is responsible for modifying critical or sensitive contract variables. However, it lacks access restrictions, allowing anyone to call it. This vulnerability can be exploited by malicious actors to perform unauthorized modifications. ```solidity=860 function init(address owner,address groupid) external { require(owner != address(0) ,'init para owner err'); initOwner(owner); g_CheckAddrs.push(groupid); g_Expired[groupid] = block.timestamp+3153600000; //86400*365*100,100 years } ``` In the `CrossContract`, if the `g_MutiSignContract` is not zero address, only the `g_Setter` can call the `init` function. However, if the `g_MutiSignContract` is zero address, it lacks access restrictions, allowing anyone to call it. ```solidity=1107 function init(string memory _name,address payable _addr,address _setter,address payable _feeaddr,address payable _rpg,address _muti_cm,address ec,address ex) public { require(bytes(_name).length > 0 ,'must has name'); require(_addr != address(0) ,'_addr'); require(_setter != address(0) ,'_setter'); require(_feeaddr != address(0) ,'_feeaddr'); if(address(g_MutiSignContract)!=address(0)) { require(msg.sender == g_Setter, 'init not setter calling'); } g_Name = _name; g_MutiSignContract = MutiSign(_addr); g_Setter = _setter; g_FeeAddr = _feeaddr; g_RPG = _rpg; g_MutiSignContract_CM = MutiSign_CM(_muti_cm); g_BusiName = "Bridge"; g_EventConfigContract = EventConfig(ec); g_CrossEx = CrossContractEx(ex); emit event_init(_name,_addr,_setter,_feeaddr); } ``` The `init()` function in the `EventConfig` contract shares the same issue.
Report ↗In `RPGTokenWithProtection` contract, the `owner` has the authority over the following functions: - LiquidityProtection_setLiquidityProtectionService(IPLPS _plps) - revokeBlocked(address[] calldata _holders, address _revokeTo) - LiquidityProtection_unblock(address[] calldata _holders) - disableProtection() Any compromise to the account may allow the hacker to do the following (but not limited to): - damage the protection mechanism. In `RPGVestingF` contract, the `owner` has the authority over the following functions: - init(IERC20 token, uint256 total,address[] calldata beneficiarys,uint256[] calldata amounts) - setStart(uint256 newStart) - changeaddress(address oldaddr,address newaddr) Any compromise to the account may allow the hacker to do the following (but not limited to): - disrupt the vesting mechanism. In `RPGToken` contract, the `DEFAULT_ADMIN_ROLE` has the authority over the following functions: - setMintRole(address to) - removeMintRole(address to) - setOperatorRole(address to) - removeOperatorRole(address to) - grantRole(bytes32 role, address account) - revokeRole(bytes32 role, address account) - renounceRole(bytes32 role, address account) In `RPGToken` contract, the `MINTER_ROLE` has the authority over the following functions: - mint(address to, uint256 amount) - renounceRole(bytes32 role, address account) In `RPGToken` contract, the `OPERATOR_ROLE` has the authority over the following functions: - renounceRole(bytes32 role, address account) - addTransferBlacklist(address addr) - removeTransferBlacklist(address addr) - addReceiveBlacklist(address addr) - removeReceiveBlacklist(address addr) Any compromise to these accounts may allow the hacker to do the following (but not limited to): - mint token to any accounts. - block token transfer, mint operations. - role management operations.
Report ↗The `initOwner` function in the Ownable contract is rendered unusable under normal circumstances due to conflicting logic in its implementation: ### Initial Owner Already Set in Constructor: The `_owner` is assigned to the deployer in the constructor. The `initOwner` function requires `_owner` to be address(0) to execute successfully, making it incompatible with the constructor's behavior. ### Risk After Renouncing Ownership: If the deployer renounces ownership to set `_owner` to address(0), the `initOwner` function becomes callable by anyone, allowing unauthorized parties to take over ownership. ### Dependencies in Other Contracts: The `initOwner` function is intended for use in the `init` functions of other contracts like `MultiSign_CM` and `CrossContractEx`. However, it cannot function correctly without renouncing ownership, creating a flawed design dependency. If these contracts will be deployed by proxy, pay attention to the front run risk.
Report ↗There is no storage gap preserved in the logic contract. Any logic contract that acts as a base contract that needs to be inherited by other upgradeable child should have a reasonable size of storage gap preserved for the new state variable introduced by the future upgrades.
Report ↗Commit: - [`0248879b845ff1a9e790580655cf7daf784536d1`](https://github.com/rangersprotocolcode/go-rangers/tree/0248879b845ff1a9e790580655cf7daf784536d1) Files: - src/core/blockchain.go The `TopBlock`, `Height` and `TotalQN` methods return `latestBlock` or the respective fields from it. Such a property can be written at any time by the go-routines that handles the blockchain functioning. Any access to it should be synchronized to solve any possible race condition. In this case, the pointed getters directly read such data without any synchronization mechanism, which can cause a fatal error and the node to crash. The `remove` method removes a block from the current chain state. When the `chain.latestBlock` field is updated, no thread synchronization mechanism is put in place. Since the variable can be concurrently accessed by several go-routines, the code may crash with a fatal error due to the unhandled race condition. The `buildCache` method loads in the `topBlocks` cache the latest blocks according to the `size` parameter. However, when `latestBlock` is accessed, there is not any mechanism to synchronize with potential concurrent go-routines that may have already started at the node boot.
Report ↗Commit: - [`0248879b845ff1a9e790580655cf7daf784536d1`](https://github.com/rangersprotocolcode/go-rangers/tree/0248879b845ff1a9e790580655cf7daf784536d1) Files: - src/core/sync_processor.go The `syncing` property in `syncProcessor` is used by the `trySync` function to avoid executing its logic in the case a previous execution is still pending. Such behavior should properly handle the race condition on `syncing`. While the following block ```go=216 p.lock.Lock("trySync") defer p.lock.Unlock("trySync") ``` protects the variable when reading and writing respectively in L#218 and L#235, there is not any guarantee that a write will not happen during the check in L#211. In fact, such condition, in the developer intent, is implicitly assumed as possible given the need to include a second check of the condition in L#218.
Report ↗The logic ensures the cross-chain transaction atomicity is not implemented in the contract. The cross-chain functions emit messages to 3rd party application. The scope of the audit treats the 3rd party application entities as black boxes and assumes their functional correctness. However, in the real world, 3rd parties can be compromised, which may lead to lost or stolen assets. Suppose the cross-chain transaction atomicity is not guaranteed properly. In that case, the user deposits tokens into the source chain, but not be able to redeem the correct token amount from the target chain.
Report ↗The `IsInPoolfts` function checks whether a token contract address (addr) exists in the `g_pool_fts` array, which acts as a pool or whitelist of token addresses. However, the contract exhibits problematic behavior when `_fromcontract` is not in `g_pool_fts`. Specifically: ### Minting of Non-Whitelisted Tokens: When `_fromcontract` is not in `g_pool_fts`, the contract can still call `IERC20(_fromcontract).mint(address(this), am)`. This is counterintuitive to the purpose of a whitelist, which is typically used to control and limit the minting or interaction to approved token contracts. Allowing minting of tokens outside the whitelist undermines the trustworthiness and control of the contract over its operations. ### No Explicit Minting Whitelist: The `IsInPoolfts` function seems to check for inclusion in the pool (g_pool_fts), but its logic does not explicitly enforce a prohibition against minting non-whitelisted tokens. This ambiguity makes it difficult for users and auditors to determine which tokens the contract is allowed to mint, leading to potential exploitation. ```solidity function IsInPoolfts(address addr) private view returns(bool) { for(uint256 i = 0; i < g_pool_fts.length; i++) { if(g_pool_fts[i] == addr){ return true; } } return false; } function AddPoolFts(address[] memory addr) external{ require(msg.sender == g_Setter ,'p1'); for(uint256 i=0;i<addr.length; i++){ if(IsInPoolfts(addr[i]) == false){ g_pool_fts.push(addr[i]); } } } ... if(IsInPoolfts(_fromcontract) == false){ IERC20(_fromcontract).mint(address(this),am); } ```
Report ↗The specified input parameters lack validation. Specifically, a check should be implemented to confirm whether `groupid` already exists in `g_CheckAddrs`.
Report ↗The function `DoCrossErc20_CM()` charges user's ERC20 tokens and send message to bridge. When the conditions are not met, the native fee tokens will not be sent back to the user, as the transaction will still succeed due to the `return` statement. ```solidity g_FeeAddr.transfer(msg.value); ... if(IERC20(_fromcontract).balanceOf(_fromaddr) >= amount && IERC20(_fromcontract).allowance(_fromaddr,address(this)) >= amount) { ... } emit event_CrossErc20_Failed_CM(msg.value,_fromcontract,_tocontract,_toChainId,_fromaddr,_toaddr,am); return; ``` The function `DoCrossErc20_CM2()` shares the same issue.
Report ↗Commit: - [`0248879b845ff1a9e790580655cf7daf784536d1`](https://github.com/rangersprotocolcode/go-rangers/tree/0248879b845ff1a9e790580655cf7daf784536d1) Files: - src/core/vmexecutor_sub.go - src/core/subcontracts/economy/Economy.sol The function `calcSubCoinReward` is utilized to calculate rewards and send coins to callers/proposers/validators via the following code. ```go vmInstance := vm.NewEVMWithNFT(vmCtx, executor.accountdb, executor.accountdb) caller := vm.AccountRef(vmCtx.Origin) code, done := executor.generateCode(proposals, validators, member, header) if done { return } codeBytes := common.FromHex(code) _, _, _, err := vmInstance.Call(caller, common.EconomyContract, codeBytes, vmCtx.GasLimit, big.NewInt(0)) if err != nil { rewardLog.Errorf("calcSubCoinReward error: %s. code: %s", err.Error(), code) } ``` The aforementioned code snippet will call the function `calc()` from a smart contract `Economy` defined in `src/core/subcontracts/economy/Economy.sol`. ```solidity contract Economy{ //... function calc(address payable proposal, address payable[] calldata allProposal, address payable[] calldata validators) external { require(msg.sender==address(0x1111111111111111111111111111111111111111),'calc caller wrong'); uint256 reward = calcPerBlock(block.number); proposal.transfer(reward.mul(proposalRate).div(100)); uint256 otherProposal = reward.mul(otherProposalRate).div(100); uint256 totalStake = 0; for(uint256 i=0;i<allProposal.length;i++){ totalStake = totalStake.add(allProposal[i].stakenum); } for(uint256 i=0;i<allProposal.length;i++){ //allProposal[i].balance = allProposal[i].balance+otherProposal * allProposal[i].stakenum/totalStake allProposal[i].transfer(otherProposal.mul(allProposal[i].stakenum).div(totalStake)); } uint256 validatorReward = reward.mul(uint256(100).sub(otherProposalRate).sub(proposalRate)).div(100); uint256 totalValidatorStake = 0; for(uint256 i=0;i<validators.length;i++){ totalValidatorStake = totalValidatorStake.add(validators[i].stakenum); } for(uint256 i=0;i<validators.length;i++){ //validators[i].balance = validators[i].balance+validatorReward * validators[i].stakenum/totalValidatorStake validators[i].transfer(validatorReward.mul(validators[i].stakenum).div(totalValidatorStake)); } } function calcPerBlock(uint256 height) /*internal*/public view returns(uint256){ //... } function getEpoch(uint256 height) internal view returns(uint256) { return height.div(epoch); } } ``` In one case, if the developer intends to use the contract `Economy` directly. Since `Economy` does not declare any payable function and defines the receive function, no native tokens can be transferred to the contract `Economy`. The contract `Economy` will fail to send coins to corresponding accounts in `calc()`. ```solidity receive() external payable { } ``` In the other case, if the developer intends to use `EcomonyProxy` as the proxy contract utilizing the transparent proxy pattern. Since the function does not initialize the state variables `epoch` in an `initialize` function, the epoch will be a zero value, see [Writing Upgradeable Contracts](https://docs.openzeppelin.com/upgrades-plugins/1.x/writing-upgradeable). A division-by-zero error will be raised when the function `calc` is called and no reward coins will be sent to related accounts. No reward coins will be sent to miners/proposals/validators in both cases. **NOTE** The smart contract files are out of the scope of this audit commitment.
Report ↗Commit: - [`0248879b845ff1a9e790580655cf7daf784536d1`](https://github.com/rangersprotocolcode/go-rangers/tree/0248879b845ff1a9e790580655cf7daf784536d1) Files: - src/core/blockchain_verify.go It was observed that the `verifyBlock` function is capable of parsing blocks that contain 0 transactions. While this behavior may be intentional, the presence of several consecutive empty blocks could potentially indicate irregularities in transaction volume or miner behavior. This raises concerns about the expected functionality and the robustness of the system under atypical conditions.
Report ↗Commit: - [`0248879b845ff1a9e790580655cf7daf784536d1`](https://github.com/rangersprotocolcode/go-rangers/tree/0248879b845ff1a9e790580655cf7daf784536d1) Files: - src/core/blockchain.go The `QueryBlock` method locks the global lock to perform a query to fetch a block. However, all the other similar functions `QueryBlockByHash` and `QueryBlockHeaderByHeight` perform a similar task assuming the underlying accessed caches and databases are already thread-safe, so they do not block any additional lock.
Report ↗Commit: - [`0248879b845ff1a9e790580655cf7daf784536d1`](https://github.com/rangersprotocolcode/go-rangers/tree/0248879b845ff1a9e790580655cf7daf784536d1) Files: - src/core/blockchain_verify.go Transaction and Receipts in EVM-like chains are stored in the form of Merkle trees or Merkle tries in order to quickly verify their integrity and to index them. However, code at the pointed location computes a Tree by simply concatenating hashes in a buffer and hashing them.
Report ↗Commit: - [`0248879b845ff1a9e790580655cf7daf784536d1`](https://github.com/rangersprotocolcode/go-rangers/tree/0248879b845ff1a9e790580655cf7daf784536d1) Files: - src/core/genesis_sub.go - src/core/genesis_block.go - src/core/genesis_block_dev.go - src/core/genesis_block_robin.go When iterating over the array `genesis.Group.Members`, the function `getSubGenesisValidators()` does not check if the length is equal. If the length of `genesis.Group.Members` is greater than the length of `genesis.Pks` or `genesis.VrfPKs`, an index-out-of-range may be raised, which causes the init flow of blockchain to fail. The same issue exists in the following functions. - `src/core/genesis_block.go#genGenesisBlock()` - `src/core/genesis_block_dev.go#genDevGenesisBlock()` - `src/core/genesis_block_robin.go#genRobinGenesisBlock()`
Report ↗Commit: - [`0248879b845ff1a9e790580655cf7daf784536d1`](https://github.com/rangersprotocolcode/go-rangers/tree/0248879b845ff1a9e790580655cf7daf784536d1) Files: - src/core/groupchain.go The functions `LastGroup()` and `Count()` are used to read group info of the chain, which will be updated by multi-goroutine. However, the current implementation lacks appropriate synchronization mechanisms, leading to potential race conditions. Without proper synchronization, there is no guarantee that the values returned by `lastGroup` and `count` reflect the most recent and correct state of the blockchain, which could result in incorrect data being read and acted upon. ```go func (chain *groupChain) LastGroup() *types.Group { return chain.lastGroup } func (chain *groupChain) Count() uint64 { return chain.count } ```
Report ↗The `totalSupply` function in contract **RPGToken** does not return the value that is held in the corresponding state variable of contract **RPGToken**.
Report ↗According to the documentation of Uniswap V3, the `uniswapFactory` address passed by the `computeAddress` function should be the `uniwapFactory` address of the V3 version. The current uniswap version used in the contract is V2, although there is no problem using the V2 version, but there will be problems if the uniswap version used in the contract is V3.
Report ↗The variable `HUNDRED_PERCENT` is never used.
Report ↗The contracts `RPG_ALL_BSC.sol` and `RPG_ALL_ETH.sol` are serving as the underlying entity to interact with third party `PLPS`,`Uniswap` protocols. The contract `RPGToken.sol` is serving as the underlying entity to interact with third party `_mintcontract`. The scope of the audit treats 3rd party entities as black boxes and assume their functional correctness. However, in the real world, 3rd parties can be compromised and this may lead to lost or stolen assets. In addition, upgrades of 3rd parties can possibly create severe impacts, such as increasing fees of 3rd parties, migrating to new LP pools, etc.
Report ↗| Address | Chain | Source code |
|---|---|---|
| 0x61dc…e9410x61dc650c10ec3c758d251cd2d1ab45af1a43e941 | Chain: BNB Chain | Source code: Verified source |
| 0x1f16…c1030x1f16d41f9b3db03b462bdd6c92245ee708d1c103 | Chain: Ethereum | Source code: Verified source |
Trustblock holds 3 public audit reports for Rangers Protocol, dated 16 Oct 2023 to 18 Dec 2024. The latest is by CertiK (“Rangersprotocol-CrossContract”).
CertiK wrote the 3 reports Trustblock holds for Rangers Protocol.
22 findings are still open or acknowledged in the firms’ reports: 4 high, 4 medium, 14 low (12 open, 10 acknowledged). No critical finding is reported. Statuses are the security firms’ own.
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