Problem
Current chainPlot function signature:
function chainPlot(uint256 storylineId, string contentCID, bytes32 contentHash)
No title parameter — plots have no chapter title support.
Also, chainPlot still enforces 72 hours deadline but the frontend and all docs now use 168h (7 days).
Required changes
1. Add title to chainPlot + event
function chainPlot(uint256 storylineId, string calldata title, string calldata contentCID, bytes32 contentHash)
Update PlotChained event:
event PlotChained(uint256 indexed storylineId, uint256 plotIndex, address writer, string title, string contentCID, bytes32 contentHash)
2. Fix deadline: 72 hours → 168 hours
In chainPlot, line 158:
// OLD:
require(block.timestamp <= s.lastPlotTime + 72 hours, "Deadline passed");
// NEW:
require(block.timestamp <= s.lastPlotTime + 168 hours, "Deadline passed");
3. Update genesis PlotChained emit
In createStoryline, the genesis PlotChained emit also needs title:
emit PlotChained(storylineId, 0, msg.sender, title, openingCID, openingHash);
Steps
- Update
plotlink-contracts/src/StoryFactory.sol:
- Add
title string param to chainPlot function
- Add
title to PlotChained event
- Update genesis emit in
createStoryline to include title
- Change
72 hours → 168 hours in deadline check
- Update tests in
test/StoryFactory.t.sol — all chainPlot calls need title arg, deadline test uses 168h
- Run tests:
forge test
- Deploy to Base Sepolia:
forge script script/DeployBaseSepolia.s.sol --rpc-url base_sepolia --broadcast
- Copy new contract address from broadcast output
- Update
plotlink/lib/contracts/constants.ts — new STORY_FACTORY address
- Update
plotlink/lib/contracts/abi.ts — add title to chainPlotFunction inputs and plotChainedEvent
- Verify on Basescan:
forge verify-contract
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:
0x05C4d59529807316D6fA09cdaA509adDfe85b474
- Chain: Base Sepolia (84532)
Considerations
- Existing plots have no title — frontend must handle
title = "" (show "Chapter {N}" fallback)
- Title max length: suggest 100 chars validation in frontend
- Gas impact: additional string storage, acceptable tradeoff
- This is a fresh redeploy on testnet — old contract data is abandoned
Part of: Phase 9 Epic (#183)
Problem
Current
chainPlotfunction signature:No
titleparameter — plots have no chapter title support.Also,
chainPlotstill enforces72 hoursdeadline but the frontend and all docs now use 168h (7 days).Required changes
1. Add
titletochainPlot+ eventUpdate
PlotChainedevent:2. Fix deadline: 72 hours → 168 hours
In
chainPlot, line 158:3. Update genesis PlotChained emit
In
createStoryline, the genesisPlotChainedemit also needstitle:Steps
plotlink-contracts/src/StoryFactory.sol:titlestring param tochainPlotfunctiontitletoPlotChainedeventcreateStorylineto includetitle72 hours→168 hoursin deadline checktest/StoryFactory.t.sol— allchainPlotcalls need title arg, deadline test uses 168hforge testforge script script/DeployBaseSepolia.s.sol --rpc-url base_sepolia --broadcastplotlink/lib/contracts/constants.ts— new STORY_FACTORY addressplotlink/lib/contracts/abi.ts— addtitleto chainPlotFunction inputs and plotChainedEventforge verify-contractDeployment info
/Users/cho/Projects/plotlink-contracts/script/DeployBaseSepolia.s.solplotlink-contracts/.env(DEPLOYER_PRIVATE_KEY)0x05C4d59529807316D6fA09cdaA509adDfe85b474Considerations
title = ""(show "Chapter {N}" fallback)Blocks: #185, #186, #187, #189, #190
Part of: Phase 9 Epic (#183)