Skip to content

EVM parity uplift: subgraph mappings + slither CI + Foundry invariant tests #157

Description

@truthixify

Tier: L (5-7 days) | Type: feature + test

Context. The EVM side sits well behind Stellar. contracts/evm/subgraph/horizen-testnet/ only ships an instant-config for ERC5564Announcer + ERC6538Registry, so WraithNames.sol, WraithSender.sol, and WraithWithdrawer.sol (all under evm/contracts/) are unindexed. contracts/evm/test/ has only .test.ts files with no fuzz, no invariant tests, no gas snapshots. There is no slither or mythril integration in .github/workflows/ci.yml's evm job. This is the biggest cross-chain gap now that Stellar has shipped its full production stack.

Scope.

  • Add mapping handlers (AssemblyScript) for WraithNames, WraithSender, WraithWithdrawer under evm/subgraph/mappings/, upgrading from instant-config to a proper subgraph.yaml with dataSources per contract.
  • Add Foundry (not Hardhat) invariant test suite under evm/foundry/test/invariant/ covering: sender balance conservation, withdrawer atomicity, name-registration monotonic expiry.
  • Wire slither step into the evm CI job, continue-on-error: false after the first clean run.
  • Add gas-snapshot step (forge snapshot) with commit + diff gate on PRs.

Acceptance.

  • graph codegen && graph build succeeds locally against a real ABI set
  • forge test --match-path 'test/invariant/*' runs with at least 3 invariants and 256 runs per invariant in CI
  • slither evm/contracts/ --config-file evm/slither.config.json returns zero High / Medium in CI
  • Gas snapshot committed under evm/.gas-snapshot; PR that increases gas by more than 5% fails CI
  • contracts/evm/README.md updated with the four new local commands

Files. evm/subgraph/subgraph.yaml (new), evm/subgraph/mappings/ (new), evm/foundry/foundry.toml (new), evm/foundry/test/invariant/ (new), evm/slither.config.json (new), evm/.gas-snapshot (new), .github/workflows/ci.yml, evm/README.md (new).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar WaveIssues in the Stellar wave programdripsFunded via Drips NetworkevmAuto-created for Wave 8help wantedExtra attention is neededparityAuto-created for Wave 8securitySecurity-sensitive workstellarTouches Stellar / Soroban codestellar-waveAuto-created for Wave 8wave-8Auto-created for Wave 8

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions