As of 3 Nov 2026, E Money has 1 audit report on Trustblock, by CertiK, dated 13 Nov 2024. That report lists no open critical findings.
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 |
|---|---|---|---|---|---|
| E money network Chain (Audit 1) | Security firm: CertiK | Date: | Scope: Files named in the report | 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 | 1 | 0 | 1 |
| Medium | 1 | 0 | 2 |
| Low | 14 | 0 | 8 |
Repository: - `EmoneyChain` Commit hash: - [`b91404fefb81a9c653d1d508feeff13abcc66332`](https://github.com/EMoney-Network/EMoneyChain/tree/b91404fefb81a9c653d1d508feeff13abcc66332) Files: - `x/regulation/keeper/ante.go` - `x/regulation/keeper/keeper.go` The regulation module implements KYC (Know Your Customer) functionality by authorizing a designated group of members, namely the authorities within the regulation keeper. Only users designated as `Allowed Addresses` are permitted to perform transactions on the blockchain. And the user status can be updated by the authorities via: - AllowAddress - DisallowAddress Any unauthorized attempts will be rejected during the `anteHandler` by both the Cosmos and Ethereum stacks. See the code snippet on the `CosmosRegulationTxDecorator` as below: **`x/regulation/keeper/ante.go`** ```go=19 func (esc CosmosRegulationTxDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error) { for _, msg := range tx.GetMsgs() { addrs := msg.GetSigners() for _, addr := range addrs { if err = esc.keeper.AssertAllowed(ctx, addr); err != nil { return ctx, err } } } return next(ctx, tx, simulate) } ``` as well as the `EthermintRegulationTxDecorator` as below: **`x/regulation/keeper/ante.go`** ```go=40 func (e EthermintRegulationTxDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error) { for _, msg := range tx.GetMsgs() { msgEthTx, ok := msg.(*evmtypes.MsgEthereumTx) if !ok { return ctx, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "invalid message type %T, expected %T", msg, (*evmtypes.MsgEthereumTx)(nil)) } if err = e.keeper.AssertAllowed(ctx, msgEthTx.GetFrom()); err != nil { return ctx, err } } return next(ctx, tx, simulate) } ``` The regulatory authority is managed by a group of members in a centralized manner, originating from the genesis state on the mainnet launch. The following operations are performed for maintenance: - `TransferAuthority`: Transfers authority between users. - Adding or removing authorities through internal governance: - `ProposeAdd` - `ProposeBlock` - `Vote` This internal governance pattern, which is based on on-chain voting collections, introduces risks related to concurrent operations accessing the voting store within a single block duration. This could lead to race condition problems that are susceptible to indeterminacy, even during the consensus process. Furthermore this internal structure could introduce centralization risks. Any compromise of the authority account can enable a hacker to exploit this authority, either by allowing/disallowing address, transferring authority or proposing malicious voting actions. If a group of hackers accumulates enough authority to reach the designated threshold, they can remove and add any accounts at will, just the below code snippet shown: ```go=586 func (k Keeper) ApplyVote(ctx sdk.Context, kycAuthority sdk.AccAddress, id uint64, vote bool) error { ``` if voting.VotesForCounter >= threshold { if voting.Type == types.VotingType_BLOCK_VOTING { // Finalize voting for blocking authority k.FinalizeBlock(ctx, id) } else { k.FinalizeAdd(ctx, id) } } else if voting.VotesAgainstCounter >= threshold { k.DeleteVoting(ctx, id) } ``` It would potentially dominate the entire blockchain. Unfortunately, there is no effective way to reverse this situation. --- Updated with commit [`8c0cf7dd5ff999c31e75774eb84c00f807f0425f`](https://github.com/EMoney-Network/EMoneyChain/tree/8c0cf7dd5ff999c31e75774eb84c00f807f0425f), the KYB module also relies on the authorities in regulation modules to vote for staking related operations.
Open the reportRepository: - `EmoneyChain` Commit hash: - [`8c0cf7dd5ff999c31e75774eb84c00f807f0425f`](https://github.com/EMoney-Network/EMoneyChain/tree/8c0cf7dd5ff999c31e75774eb84c00f807f0425f) Files: - `x/lock/keeper/genesis.go` In Lock module, the `InitGenesis` function is introduced to import the existing locks states, however, the following concerns are raised based on the update: 1. In the updated version, the lock will not be removed when the delegator withdraws the lock tokens. Instead, the lock status will be set as `LockStatus_COINS_WITHDRAWN`. Since during the genesis, the delegator is asked to deposit again, if the lock is already set as `LockStatus_COINS_WITHDRAWN`, the delegator cannot withdraw the token since lock status validation failed: ```go if lock.Status != types.LockStatus_COINS_LOCKED { return sdkerrors.ErrInvalidRequest.Wrapf("coins for this lock have already been withdrawn") } ``` 2. The genesis requires the lock delegator to deposit the token again. However, such a balance may already be reflected in the module account of Lock, especially when the previous status already exists (like upgrade/reboot), which may cause duplicated deduction as well as the invariant broken issue that the total lock tokens mismatch with that of the deposits from the delegators after importing genesis states. ```go err = k.bankKeeper.SendCoinsFromAccountToModule( ctx, delegator, types.ModuleName, sdk.NewCoins(lock.Amount), ) ```
Open the reportRepository: - `EmoneyChain` Commit hash: - [`8c0cf7dd5ff999c31e75774eb84c00f807f0425f`](https://github.com/EMoney-Network/EMoneyChain/tree/8c0cf7dd5ff999c31e75774eb84c00f807f0425f) Files: - `x/kyb/keeper/keeper.go` - `x/lock/keeper/keeper.go` - `x/regulation/keeper/keeper.go` During normal message handling within the `Lock`, `Regulation`, and `KYB` modules, the `cdc.MustUnmarshal` method is utilized for data deserialization, such as below code snippet: ```go k.cdc.MustUnmarshal(bz, voting) ``` The `MustUnmarshal` calls Unmarshal and panics if error is returned, e.g. in amino codec shown as below **`codec/amino.go`** ```go func (cdc *LegacyAmino) MustUnmarshal(bz []byte, ptr interface{}) { err := cdc.Unmarshal(bz, ptr) if err != nil { panic(err) } } ``` While this approach is acceptable during node startup, where encountering a fatal error with the data, such as genesis data, necessitates halting the process. It poses risks during regular message handling in the keeper. Using `cdc.MustUnmarshal` can lead to service instability due to panic situations, even though middleware may allow for recovery. Therefore, it is recommended to employ the standard `cdc.Unmarshal` method alongside appropriate error handling in these scenarios.
Open the reportRepository: - `EMoneyChain` Commit hash: - [`b91404fefb81a9c653d1d508feeff13abcc66332`](https://github.com/EMoney-Network/EMoneyChain/tree/b91404fefb81a9c653d1d508feeff13abcc66332) Files: - `x/regulation/keeper/keeper.go` In regulation module, the KYC authority update may happen in two ways: 1. Transfer authority 2. Vote for block/add authority However, there are some potential inconsistency in the address status setup in current implementation: 1. While transferring authority - the original authority will be removed from authority list - the new authority will be added to the authority list, and if the new authority not `IsAllowed`, its address status will be added `AddressStatus_STATUS_ALLOWED`. 2. While voting for block/add authority - when block authority - the original authority will be removed from authority list and set status to `AddressStatus_STATUS_BLOCKED` - when add authority - the new authority will be added to the authority list but not set address status to `AddressStatus_STATUS_ALLOWED`
Open the reportRepository: - `EmoneyChain` Commit hash: - [`b91404fefb81a9c653d1d508feeff13abcc66332`](https://github.com/EMoney-Network/EMoneyChain/tree/b91404fefb81a9c653d1d508feeff13abcc66332) Files: - `cmd/config/config.go` The `DisplayDenom` is set to `emyc`, while the `BaseDenom` is set to `uemyc` in the configuration file during initialization. Literally, the `DisplayDenom` maintains a decimal of 6, corresponding to the representation of the `BaseDenom`, i.e. 1 `emyc` = $$1 \times 10^{6}$$ `uemyc`. **cmd/config/config.go** ```go=49 func RegisterDenoms() { if err := sdk.RegisterDenom(DisplayDenom, sdk.OneDec()); err != nil { panic(err) } if err := sdk.RegisterDenom(BaseDenom, sdk.NewDecWithPrec(1, ethermint.BaseDenomUnit)); err != nil { panic(err) } } ``` However, within the `RegisterDenoms`, the decimal is inherited from `Ethermint`, which has a precision of 18. That is actually 1 `emyc` = $$1 \times 10^{18}$$ `uemyc`. The auditing team seeks clarification regarding the decimal of the denominations conversion to eliminate any potential confusion.
Open the reportRepository: - `EmoneyChain` Commit hash: - [`8c0cf7dd5ff999c31e75774eb84c00f807f0425f`](https://github.com/EMoney-Network/EMoneyChain/tree/8c0cf7dd5ff999c31e75774eb84c00f807f0425f) Files: - `x/kyb/keeper/keeper.go` Based on commit [`8c0cf7dd5ff999c31e75774eb84c00f807f0425f`](https://github.com/EMoney-Network/EMoneyChain/tree/8c0cf7dd5ff999c31e75774eb84c00f807f0425f) is introduced to add additional validation on addresses with KYB. When removing the address from KYB certified, the corresponding delegator will be forced cashed out in the Lock module, which raises the corresponding concerns on the workflow: - The code currently doesn't check vesting status when updating KYB status. This could cause issues during removal since the `GetDelegatorByValidator` call may fail since the address is not vested and a potential DoS scenario is raised. For example, if the address X passed KYB but is **not** vested in Lock, and authorities want to remove it from KYB now, the transaction would fail since no vesting/delegator information is present. ```go // Get Account User which bound coins for Validator accAddr, err := k.lockKeeper.GetDelegatorByValidator(ctx, valAddr) //@note would return err if not vested if err != nil { return err } ``` - the current implementation in `FinalizeRemove()` directly calls `WithdrawAndReset()` on the lock keeper, which could bypass intended lock periods.
Open the reportRepository: - `EMoneyChain` Commit hash: - [`b91404fefb81a9c653d1d508feeff13abcc66332`](https://github.com/EMoney-Network/EMoneyChain/tree/b91404fefb81a9c653d1d508feeff13abcc66332) Files: - `x/lock/keeper/keeper.go` The current implementation of the x/lock module in the EMoneyChain codebase has an inconsistency in handling the vested validator status. When a user vests coins for a validator using the Vest function, the validator is marked as vested using the `SetVestedValidator` function. **`x/lock/keeper/keeper.go`** ```go=23 func (k Keeper) Vest(ctx sdk.Context, from sdk.AccAddress, to sdk.ValAddress) error { // ... k.SetLock(ctx, &types.Lock{ Address: from.String(), Amount: p.LockAmount, UnlockTime: ctx.BlockTime().Add(p.LockDuration), }) k.SetVestedValidator(ctx, to) // ... } ``` However, when the user withdraws their locked coins using the `Withdraw` function, the vested validator status is not updated or removed. **`x/lock/keeper/keeper.go`** ```go=52 func (k Keeper) Withdraw(ctx sdk.Context, vester sdk.AccAddress) error { // ... k.RemoveLock(ctx, vester) return nil } ``` Furthermore, the `SetVestedValidator` function only stores the validator address as a key **without** any associated value or expiration time. This lack of expiration time makes it difficult to determine when a validator's vested status should be considered invalid or expired. **`x/lock/keeper/keeper.go`** ```go=118 func (k Keeper) SetVestedValidator(ctx sdk.Context, val sdk.ValAddress) { prefix.NewStore(ctx.KVStore(k.storeKey), types.VestedValidatorsKey).Set(val, []byte{}) } ``` As a result, a validator will be valid forever as long as one vested performed. --- Updated with commit [`8c0cf7dd5ff999c31e75774eb84c00f807f0425f`](https://github.com/EMoney-Network/EMoneyChain/tree/8c0cf7dd5ff999c31e75774eb84c00f807f0425f), the new mapping `ValidatorToDelegatorMap` is introduced to present the relationship between validator and delegator, however the concerns about expiry time for validator after unvested still remain. Also, the updated code base introduces the reset functionality with `WithdrawAndReset`, which will be invoked by the KYB module solely, and for the Lock module, there is no way to reset the lock and vest status, which we want to check with the team if this is intended as well.
Open the reportRepository: - `EmoneyChain` Commit hash: - [`b91404fefb81a9c653d1d508feeff13abcc66332`](https://github.com/EMoney-Network/EMoneyChain/tree/b91404fefb81a9c653d1d508feeff13abcc66332) Files: - `app/sigverify.go` The `EmoneyChain` is a derivative of the Evmos project, integrating an EVM application over the Cosmos SDK. This results in the use of two types of signature algorithms: `secp256k1` and `ed25519`. The `SigVerificationGasConsumer` configures different gas consumption on signature verification parameters for these algorithms, as demonstrated in the code snippet below: **`app/sigverify.go`** ```go=33 func SigVerificationGasConsumer( meter sdk.GasMeter, sig signing.SignatureV2, params authtypes.Params, ) error { pubkey := sig.PubKey switch pubkey := pubkey.(type) { case *ethsecp256k1.PubKey: // Ethereum keys meter.ConsumeGas(secp256k1VerifyCost, "ante verify: eth_secp256k1") return nil case *ed25519.PubKey: // Validator keys meter.ConsumeGas(params.SigVerifyCostED25519, "ante verify: ed25519") return sdkerrors.Wrap(sdkerrors.ErrInvalidPubKey, "ED25519 public keys are unsupported") case multisig.PubKey: // Multisig keys multisignature, ok := sig.Data.(*signing.MultiSignatureData) if !ok { return fmt.Errorf("expected %T, got, %T", &signing.MultiSignatureData{}, sig.Data) } return ConsumeMultisignatureVerificationGas(meter, multisignature, pubkey, params, sig.Sequence) default: return sdkerrors.Wrapf(sdkerrors.ErrInvalidPubKey, "unrecognized/unsupported public key type: %T", pubkey) } } ``` However, the difference in gas consumption between them is significant, with approximately a 40-fold variation: - For `secp256k1`, the gas cost, denoted as `secp256k1VerifyCost`, is set at `21000`; - For `ed25519`, the default parameter is set at only `590`, as the auth params shown below ```shell emoneyd query auth params max_memo_characters: "256" sig_verify_cost_ed25519: "590" sig_verify_cost_secp256k1: "1000" tx_sig_limit: "7" tx_size_cost_per_byte: "10" ```
Open the reportRepository: - `EMoneyChain` Commit hash: - [`b91404fefb81a9c653d1d508feeff13abcc66332`](https://github.com/EMoney-Network/EMoneyChain/tree/b91404fefb81a9c653d1d508feeff13abcc66332) Files: - `x/regulation/keeper/keeper.go` The `ProcessVoting` is designed to finalize the vote when either `VotesForCounter` or `VotesAgainstCounter` reaches the threshold. However, the corresponding finalization logic exists in the `ApplyVote` function as well, which will be triggered during the Vote. Since the voting threshold may changed during the time, the `ProcessVoting` will be used to finalized, however, the function will always return an error. ```go // Return error by default, meaning that we couldn't manage to process the voting return sdkerrors.ErrInvalidRequest.Wrapf("Voting with %s id can't be processed at the moment", votingId) ``` --- Update on commit [`8c0cf7dd5ff999c31e75774eb84c00f807f0425f`](https://github.com/EMoney-Network/EMoneyChain/tree/8c0cf7dd5ff999c31e75774eb84c00f807f0425f), the similar concerns also raised from KYB module.
Open the reportRepository: - `EmoneyChain` Commit hash: - [`8c0cf7dd5ff999c31e75774eb84c00f807f0425f`](https://github.com/EMoney-Network/EMoneyChain/tree/8c0cf7dd5ff999c31e75774eb84c00f807f0425f) Files: - `x/kyb/keeper/ante.go` In the `KYBDecorator`, certain message types, particularly those related to the validator, are filtered in the `anteHandler` to verify whether they fall under the KYB authority. **`x/kyb/keeper/ante.go`** ```go=21 func (kd KYBDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error) { for _, msg := range tx.GetMsgs() { var valAddr sdk.ValAddress switch sdk.MsgTypeURL(msg) { case "/cosmos.staking.v1beta1.MsgCreateValidator": valMsg := msg.(*stakingtypes.MsgCreateValidator) valAddr = utils.MustValAddressFromBech32(valMsg.ValidatorAddress) case "/cosmos.staking.v1beta1.MsgEditValidator": valMsg := msg.(*stakingtypes.MsgEditValidator) valAddr = utils.MustValAddressFromBech32(valMsg.ValidatorAddress) case "/cosmos.staking.v1beta1.MsgDelegate": valMsg := msg.(*stakingtypes.MsgDelegate) valAddr = utils.MustValAddressFromBech32(valMsg.ValidatorAddress) case "/cosmos.staking.v1beta1.MsgBeginRedelegate": valMsg := msg.(*stakingtypes.MsgBeginRedelegate) valAddr = utils.MustValAddressFromBech32(valMsg.ValidatorDstAddress) case "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation": valMsg := msg.(*stakingtypes.MsgCancelUnbondingDelegation) valAddr = utils.MustValAddressFromBech32(valMsg.ValidatorAddress) case "/cosmos.slashing.v1beta1.MsgUnjail": valMsg := msg.(*slashingtypes.MsgUnjail) valAddr = utils.MustValAddressFromBech32(valMsg.ValidatorAddr) default: valAddr = nil } ``` Almost all message types pertaining to the validator are included, even the `MsgUnjail`. However, the `MsgUndelegate` in staking appears to be excluded.
Open the reportRepository: - `EMoneyChain` Commit hash: - [`b91404fefb81a9c653d1d508feeff13abcc66332`](https://github.com/EMoney-Network/EMoneyChain/tree/b91404fefb81a9c653d1d508feeff13abcc66332) Files: - `app/app.go` - `app/tps_counter.go` - `cmd/emoneyd/genregulator.go` - `cmd/emoneyd/genvesting.go` - `cmd/emoneyd/root.go` - `utils/utils.go` - `x/lock/keeper/genesis.go` - `x/lock/keeper/keeper.go` - `x/lock/types/msgs.go` - `x/regulation/keeper/grpc_query.go` - `x/regulation/keeper/keeper.go` - `x/regulation/types/msgs.go` The highlighted code blocks illustrate an inconsistent approach to error handling within the same scope. In some instances, the code panics directly, while in others, errors are left unhandled. e.g. the inconsistency exist in code snippet shown below: **x/regulation/keeper/keeper.go** ```go func (k Keeper) ProcessVoting(ctx sdk.Context, votingId uint64) error { voting, err := k.GetVotingById(ctx, votingId) if err != nil { return err } ... } func (k Keeper) DeleteVoting(ctx sdk.Context, id uint64) { // Get voting voting, _ := k.GetVotingById(ctx, id) ... } ``` Furthermore, unless the panic is intercepted and managed within the calling stack, it is generally advisable to avoid using panics, as they can lead to an abrupt program crash accompanied by a stack dump, which is often undesirable.
Open the reportRepository: - `EmoneyChain` Commit hash: - [`b91404fefb81a9c653d1d508feeff13abcc66332`](https://github.com/EMoney-Network/EMoneyChain/tree/b91404fefb81a9c653d1d508feeff13abcc66332) Files: - `go.mod` - `pkg/evmos-v12@12.1.6/go.mod` In the `go.mod` file ```go github.com/cosmos/ibc-go/v6 v6.1.1 ``` The `ibc-go` version in go module is lower than the latest release, potential contains the vulnerability according to [`GO-2024-2874`](https://pkg.go.dev/vuln/GO-2024-2874) as well as [`GO-2024-2694`](https://pkg.go.dev/vuln/GO-2024-2694). It is strongly recommended to update to the latest patched `ibc-go` version. There are also other publicly reported dependency vulnerabilities that need to be triaged in `pkg` package which is copy from the `evmos` with `v12.1.6`, including: - pkg:golang/google.golang.org/protobuf@v1.30.0 - [CVE-2024-24786] CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop') - pkg:golang/github.com/btcsuite/btcd/btcec/v2@v2.3.2 - [CVE-2024-34478] CWE-436: Interpretation Conflict - pkg:golang/github.com/dvsekhvalnov/jose2go@v1.5.0 - [CVE-2023-50658] CWE-834: Excessive Iteration - pkg:golang/github.com/hashicorp/go-getter@v1.7.0 - [CVE-2024-3817] CWE-88: Argument Injection or Modification - [CVE-2024-6257] CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection') - pkg:golang/github.com/evmos/evmos/v12@v12.1.6 - [CVE-2024-32644] CWE-662: Improper Synchronization - [CVE-2024-39696] CWE-863: Incorrect Authorization - [CVE-2024-37153] CWE-670: Always-Incorrect Control Flow Implementation - [CVE-2024-37154] CWE-285: Improper Authorization - [CVE-2024-32873] CWE-682: Incorrect Calculation - [CVE-2024-37158] CWE-691: Insufficient Control Flow Management - [CVE-2024-37159] CWE-285: Improper Authorization - pkg: [`Unauthorized accounts creation with vesting module`](https://github.com/evmos/evmos/security/advisories/GHSA-m99c-q26r-m7m7) - [`encoding/gob`](https://pkg.go.dev/encoding/gob) - https://pkg.go.dev/vuln/GO-2024-3106 - net - https://pkg.go.dev/vuln/GO-2024-2687
Open the reportRepository: - `EMoneyChain` Commit hash: - [`b91404fefb81a9c653d1d508feeff13abcc66332`](https://github.com/EMoney-Network/EMoneyChain/tree/b91404fefb81a9c653d1d508feeff13abcc66332) Files: - `x/regulation/keeper/keeper.go` The `TransferAuthority` function in the keeper package checks for a minimum balance requirement when transferring authority from one address to another. **`x/regulation/keeper/keeper.go`** ```go=151 minCoins := sdk.Coin{Amount: sdkmath.NewInt(MIN_AMOUNT), Denom: emoneyconfig.BaseDenom} if !k.bankKeeper.HasBalance(ctx, dstAuthority, minCoins) { return sdkerrors.ErrUnauthorized.Wrapf("%s should have at least %d", dstAuthority, MIN_AMOUNT) } ``` However, the validation is missing while: 1. adding new authorities 2. performing voting As a result, authorities may not always maintain a minimum balance as required.
Open the reportRepository: - `EMoneyChain` Commit hash: - [`b91404fefb81a9c653d1d508feeff13abcc66332`](https://github.com/EMoney-Network/EMoneyChain/tree/b91404fefb81a9c653d1d508feeff13abcc66332) Files: - `app/app.go` When iterating over a map, the order in which the elements are returned may not be deterministic. It means that it could not rely on the value returned which could introduce non-determinism which is a very critical issue if it is involved in the consensus process, resulting in consensus breaking. The codebase has been examined, and it appears that the files mentioned above utilize map iteration in a correct manner. However, it has been observed that the underlying function calls or methods do not directly affect the key process. As a result, the severity of any potential issues is considered informational, serving as a warning for awareness. Although the severity is low, it is still advisable to make some adjustments to these code sections if possible. This can help ensure code clarity, maintainability, and to avoid potential issues that may arise in the future.
Open the reportRepository: - `EmoneyChain` Commit hash: - [`b91404fefb81a9c653d1d508feeff13abcc66332`](https://github.com/EMoney-Network/EMoneyChain/tree/b91404fefb81a9c653d1d508feeff13abcc66332) Files: - `pkg/evmos-v12@12.1.6/app/app.go` - `pkg/evmos-v12@12.1.6/x/claims/keeper/abci.go` - `pkg/evmos-v12@12.1.6/x/claims/module.go` - `pkg/evmos-v12@12.1.6/x/evm/keeper/abci.go` - `pkg/evmos-v12@12.1.6/x/evm/module.go` A panic inside an `ABCI` methods including `BeginBlock` and `EndBlock` will halt the chain. There should be no unanticipated panics in these methods. Specifically, 1. The `BeginBlocker()` function in `app.go` calls `app.ScheduleForkUpgrade(ctx)`, which may panic due to the following logic: `ScheduleUpgrade()` may return an error if certain validations on the planed data fail. ```go if err := app.UpgradeKeeper.ScheduleUpgrade(ctx, upgradePlan); err != nil { panic( fmt.Errorf( "failed to schedule upgrade %s during BeginBlock at height %d: %w", upgradePlan.Name, ctx.BlockHeight(), err, ), ) } ``` 2. The `EndBlocker()` function calls the `EndAirdrop()` function, which may panic due to the following logic: `EndAirdrop()` may return an error if certain conditions are met. For example, if the implementation of `k.distrKeeper.FundCommunityPool()` is incorrect, it may return an error. ```go if err := k.EndAirdrop(ctx, params); err != nil { panic(err) } ``` 3. The `BeginBlock()` function calls the `WithChainID()` function, which may panic due to the following logic: If the chain ID parsed error due to malformed, or has already been set, `BeginBlock()` will panic. ```go chainID, err := evmostypes.ParseChainID(ctx.ChainID()) if err != nil { panic(err) } if k.eip155ChainID != nil && k.eip155ChainID.Cmp(chainID) != 0 { panic("chain id already set") } ``` Unlike `checkTx` and `deliverTx`, which employ middleware recovery to restore operations, there is no such mechanism in `BeginBlock` and `EndBlock`. Extreme caution must be taken to prevent a panic that could cause a chain halt, which can only be resolved through manual intervention. While the potential for panics may depend on the specific implementation logic as stated above, it is still highly recommended to thoroughly check for possible panic triggers to prevent such occurrences.
Open the reportRepository: - `EmoneyChain` Commit hash: - [`8c0cf7dd5ff999c31e75774eb84c00f807f0425f`](https://github.com/EMoney-Network/EMoneyChain/tree/8c0cf7dd5ff999c31e75774eb84c00f807f0425f) Files: - `x/regulation/types/keys.go` - `x/lock/types/keys.go` - `x/kyb/types/keys.go` - `x/kyb/keeper/keeper.go` - `app/app.go` The transient keys (`TStoreKey`) declared in `lock`, `regulation`, and `kyb` have not been registered while app creation in `NewEmoney`: **`app/app.go`** ```go=339 // Add the EVM transient store key tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey, evmtypes.TransientKey, feemarkettypes.TransientKey) memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey) ``` Additionally, there is also some functions declared but not invoked by any more. e.g. `AssertKYBPassed` in the `kyb/keeper`: **`x/kyb/keeper/keeper.go`** ```go=182 func (k Keeper) AssertKYBPassed(ctx sdk.Context, addr sdk.ValAddress) error { status := k.AddressStatus(ctx, addr) if status != types.KYBStatus_STATUS_PASSED { return sdkerrors.ErrUnauthorized.Wrapf("address %s has not passed KYB", addr) } return nil } ``` as well as `HasVoted` in the `kyb/keeper`: **`x/kyb/keeper/keeper.go`** ```go=247 func (k Keeper) HasVoted(ctx sdk.Context, kycAuthority sdk.AccAddress, id uint64) bool { votePrefix := prefix.NewStore(ctx.KVStore(k.storeKey), types.AuthorityVotePrefix) voteKey := types.AuthorityVoteKey(id, kycAuthority) return votePrefix.Has(voteKey) } ```
Open the reportThe reports name a repository or files. Open a report to see its scope.
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="e-money-network"></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