Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 38 additions & 1 deletion lib/contracts/abi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const donationEvent = {
export const createStorylineFunction = {
type: "function",
name: "createStoryline",
stateMutability: "nonpayable",
stateMutability: "payable",
inputs: [
{ name: "title", type: "string" },
{ name: "openingCID", type: "string" },
Expand Down Expand Up @@ -152,11 +152,48 @@ export const tokenBondFunction = {
// Combined ABI (for viem contract instances)
// ---------------------------------------------------------------------------

export const curveUpdatedEvent = {
type: "event",
name: "CurveUpdated",
inputs: [{ name: "newStepCount", type: "uint256", indexed: false }],
} as const;

export const hasSunsetFunction = {
type: "function",
name: "hasSunset",
stateMutability: "view",
inputs: [{ name: "storylineId", type: "uint256" }],
outputs: [{ name: "", type: "bool" }],
} as const;

export const updateCurveFunction = {
type: "function",
name: "updateCurve",
stateMutability: "nonpayable",
inputs: [
{ name: "newRanges", type: "uint128[]" },
{ name: "newPrices", type: "uint128[]" },
],
outputs: [],
} as const;

export const ownerFunction = {
type: "function",
name: "owner",
stateMutability: "view",
inputs: [],
outputs: [{ name: "", type: "address" }],
} as const;

export const storyFactoryAbi = [
plotChainedEvent,
storylineCreatedEvent,
donationEvent,
curveUpdatedEvent,
createStorylineFunction,
chainPlotFunction,
donateFunction,
hasSunsetFunction,
updateCurveFunction,
ownerFunction,
] as const;
5 changes: 4 additions & 1 deletion lib/contracts/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,14 @@ export const EXPLORER_URL = IS_TESTNET
// PlotLink contracts
// ---------------------------------------------------------------------------

/** Deployment block for the v2 StoryFactory on Base mainnet */
export const DEPLOYMENT_BLOCK = BigInt(43_606_398);

/** StoryFactory — storyline + plot management */
export const STORY_FACTORY = (process.env.NEXT_PUBLIC_CONTRACT_ADDRESS ??
(IS_TESTNET
? "0xfa5489b6710Ba2f8406b37fA8f8c3018e51FA229"
: "0xc278F4099298118efA8dF30DF0F4876632571948")) as `0x${string}`;
: "0x27B4FCf333f29a3865b3B76ea00C955D7b64BD0F")) as `0x${string}`;

/** ZapPlotLinkMCV2 — one-click buy (ETH/USDC/HUNT -> storyline token) */
export const ZAP_PLOTLINK = "0x0000000000000000000000000000000000000000" as const;
Expand Down
31 changes: 30 additions & 1 deletion packages/sdk/src/abi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,16 @@ export const storyFactoryAbi = [
{ name: "amount", type: "uint256", indexed: false },
],
},
{
type: "event",
name: "CurveUpdated",
inputs: [{ name: "newStepCount", type: "uint256", indexed: false }],
},
// Functions
{
type: "function",
name: "createStoryline",
stateMutability: "nonpayable",
stateMutability: "payable",
inputs: [
{ name: "title", type: "string" },
{ name: "openingCID", type: "string" },
Expand Down Expand Up @@ -80,6 +85,30 @@ export const storyFactoryAbi = [
],
outputs: [],
},
{
type: "function",
name: "hasSunset",
stateMutability: "view",
inputs: [{ name: "storylineId", type: "uint256" }],
outputs: [{ name: "", type: "bool" }],
},
{
type: "function",
name: "updateCurve",
stateMutability: "nonpayable",
inputs: [
{ name: "newRanges", type: "uint128[]" },
{ name: "newPrices", type: "uint128[]" },
],
outputs: [],
},
{
type: "function",
name: "owner",
stateMutability: "view",
inputs: [],
outputs: [{ name: "", type: "address" }],
},
] as const;

// ---------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions packages/sdk/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const DEPLOYMENT_BLOCK = BigInt(20_000_000);
* Deployment block for PlotLink contracts on Base mainnet.
* Used as the default fromBlock for mainnet event log queries.
*/
export const DEPLOYMENT_BLOCK_MAINNET = BigInt(43_561_137);
export const DEPLOYMENT_BLOCK_MAINNET = BigInt(43_606_398);

/** Supported chain IDs for the PlotLink SDK. */
export const SUPPORTED_CHAIN_IDS = new Set([BASE_SEPOLIA_CHAIN_ID, BASE_MAINNET_CHAIN_ID]);
Expand All @@ -41,7 +41,7 @@ export const STORY_FACTORY_ADDRESS =

/** StoryFactory — storyline + plot management (Base mainnet). */
export const STORY_FACTORY_MAINNET_ADDRESS =
"0xc278F4099298118efA8dF30DF0F4876632571948" as const;
"0x27B4FCf333f29a3865b3B76ea00C955D7b64BD0F" as const;

/** MCV2_Bond — bonding curve trading (Base Sepolia). */
export const MCV2_BOND_ADDRESS =
Expand Down
Loading