Skip to content

[Bug] createStoryline reverts: token symbol collision on MCV2_Bond #246

@realproject7

Description

@realproject7

Problem

The new StoryFactory (0x6B8d...605d) starts at storylineCount = 0, so the first createStoryline tries to create a token with symbol PLOT-1. But the old StoryFactory (0x05C4...b474) already created PLOT-1, PLOT-2, PLOT-3 on MCV2_Bond. MCV2_Bond rejects duplicate symbols, causing the tx to revert.

Fix

Change the token symbol prefix from PLOT- to PLT- in StoryFactory.sol line 113:

// OLD:
symbol: string(abi.encodePacked("PLOT-", _uint2str(storylineId)))
// NEW:
symbol: string(abi.encodePacked("PLT-", _uint2str(storylineId)))

This is a testnet-only workaround. On mainnet (#41), the symbol should be PLOT- (no collision since it's a fresh deploy).

Steps

  1. Update plotlink-contracts/src/StoryFactory.sol line 113 — change "PLOT-" to "PLT-"
  2. Update tests if any assert on the symbol format
  3. forge test
  4. Deploy to Base Sepolia: forge script script/DeployBaseSepolia.s.sol --rpc-url base_sepolia --broadcast
  5. Update plotlink/lib/contracts/constants.ts — new STORY_FACTORY address
  6. Update plotlink/packages/sdk/src/constants.ts — new STORY_FACTORY_ADDRESS
  7. Verify on Basescan

Deployment info

  • Contract repo: /Users/cho/Projects/plotlink-contracts/
  • Deploy script: script/DeployBaseSepolia.s.sol
  • Deployer key: plotlink-contracts/.env (DEPLOYER_PRIVATE_KEY)
  • Current contract: 0x6B8d38af1773dd162Ebc6f4A8eb923F3c669605d
  • Chain: Base Sepolia (84532)

Important

  • Do NOT change the ABI — only the symbol prefix changes, no ABI impact
  • After deploy, operator will update env and run migration to re-tag data

Acceptance Criteria

  • Symbol prefix changed to PLT-
  • Tests pass
  • New contract deployed to Base Sepolia
  • Constants updated in both plotlink and SDK
  • createStoryline no longer reverts

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions