Skip to content

Fix AxelarReporter unsupported-chain validation #505

Description

@coderabbitai

Summary

AxelarReporter._dispatch does not correctly reject an unsupported target chain when chainNames[targetChainId] has not been configured.

Required change

In veashi-contracts/src/adapters/axelar/AxelarReporter.sol, update the target-chain support check to detect the default empty string from the chainNames mapping using a raw empty-string check (for example, bytes(targetChainName).length == 0), while preserving the existing ChainIdNotSupported(targetChainId) revert.

Rationale

abi.encode(targetChainName) includes ABI offset and length metadata. Consequently, hashing abi.encode("") is different from keccak256(""), so the existing check does not recognize a missing mapping entry and can proceed with an empty Axelar destination chain name.

Affected area

  • veashi-contracts/src/adapters/axelar/AxelarReporter.sol
  • AxelarReporter._dispatch

Acceptance criteria

  • An unconfigured chainNames[targetChainId] entry reverts with ChainIdNotSupported(targetChainId).
  • Configured, non-empty Axelar chain names continue to dispatch normally.
  • Tests cover both the unconfigured-chain revert and a configured-chain path.

Backlinks

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions