Skip to content

Post-E2E cleanup — update constants, clean orphan storylines, reset cursor #549

@realproject7

Description

@realproject7

Summary

Cleanup after Batch 19 E2E test. T3 redeployed StoryFactory during testing (symbol collision fix), creating a new contract that needs to be reflected in the codebase.

1. Update constants.ts with new StoryFactory v4b address

  • Old (in code): 0x92c3bd44fda84e632c3c3cb31387d0c0c1de618d
  • New (live on Vercel): 0x9D2AE1E99D0A6300bfcCF41A82260374e38744Cf
  • Update lib/contracts/constants.tsSTORY_FACTORY mainnet fallback
  • Update DEPLOYMENT_BLOCK to new contract's deployment block
  • Update packages/sdk/src/constants.ts if applicable

2. Clean orphan storylines (IDs 25-33)

  • IDs 25-33 were created with wrong content hashes (keccak256(CID) instead of keccak256(content))
  • Their plots failed to index, but the storyline records exist in Supabase
  • Create migration 00025_cleanup_orphan_storylines.sql:
-- Clean up orphan storylines from first E2E attempt (wrong content hashes)
DELETE FROM plots WHERE storyline_id BETWEEN 25 AND 33
  AND lower(contract_address) = lower('0x9D2AE1E99D0A6300bfcCF41A82260374e38744Cf');
DELETE FROM trade_history WHERE storyline_id BETWEEN 25 AND 33;
DELETE FROM ratings WHERE storyline_id BETWEEN 25 AND 33
  AND lower(contract_address) = lower('0x9D2AE1E99D0A6300bfcCF41A82260374e38744Cf');
DELETE FROM comments WHERE storyline_id BETWEEN 25 AND 33
  AND lower(contract_address) = lower('0x9D2AE1E99D0A6300bfcCF41A82260374e38744Cf');
DELETE FROM storylines WHERE storyline_id BETWEEN 25 AND 33
  AND lower(contract_address) = lower('0x9D2AE1E99D0A6300bfcCF41A82260374e38744Cf');

3. Reset backfill_cursor for new contract

  • Check current cursor — may need resetting to new contract's deployment block
  • Update migration 00023 or create new migration if needed

4. Update plotlink-contracts references

  • Update script/E2ETest.s.sol and script/E2ETestReverts.s.sol with new factory address
  • Update README.md deployed address

Acceptance Criteria

  • constants.ts matches live Vercel env (0x9D2A...44Cf)
  • Orphan storylines 25-33 cleaned from Supabase
  • backfill_cursor correct for new contract
  • plotlink-contracts references updated

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/T3Assigned to T3 builder agent

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions