Methods
Reads
| Method | Returns | Description |
|---|---|---|
identifierToCampaignInfo(identifierHash) | Address | Get CampaignInfo address by identifier hash |
isValidCampaignInfo(campaignInfo) | boolean | Check if an address is a valid CampaignInfo |
owner() | Address | Contract owner |
Writes
| Method | Returns | Description |
|---|---|---|
createCampaign(params) | Hex | Deploy a new CampaignInfo contract |
updateImplementation(newImplementation) | Hex | Update the CampaignInfo implementation address |
transferOwnership(newOwner) | Hex | Transfer contract ownership |
renounceOwnership() | Hex | Renounce contract ownership |
CreateCampaignParams
ThecreateCampaign method accepts a params object:
| Field | Type | Description |
|---|---|---|
creator | Address | Address of the campaign creator |
identifierHash | Hex | bytes32 unique campaign identifier hash |
selectedPlatformHash | Hex[] | Platform hashes selected for this campaign |
platformDataKey | Hex[] | Optional platform-specific data keys |
platformDataValue | Hex[] | Optional platform-specific data values |
campaignData | CreateCampaignData | On-chain campaign configuration |
nftName | string | ERC-721 collection name for pledge NFTs |
nftSymbol | string | ERC-721 collection symbol |
nftImageURI | string | IPFS or HTTPS URI for the NFT image |
contractURI | string | IPFS or HTTPS URI for ERC-721 contract metadata |
CampaignData
| Field | Type | Description |
|---|---|---|
launchTime | bigint | Unix timestamp (seconds) when the campaign launches |
deadline | bigint | Unix timestamp (seconds) when the campaign ends |
goalAmount | bigint | Minimum funding goal in currency units |
currency | Hex | bytes32 currency identifier |
Usage examples
Create a campaign
Discover the deployed CampaignInfo address
AftercreateCampaign, the factory emits a CampaignCreated event that carries the new CampaignInfo address. Two approaches are available — prefer the receipt-based one.
Approach 1 — Decode the CampaignCreated event from the receipt (recommended). Deterministic and works immediately regardless of RPC indexing lag.
identifierToCampaignInfo (convenience). Handy when you only have the identifier and did not keep the receipt. On some RPC providers the mapping may briefly return the zero address right after the transaction, so prefer Approach 1 when the receipt is available.
Verify a campaign address
Simulate before creating
Related
- CampaignInfo — interact with a deployed campaign
- TreasuryFactory — deploy treasuries for a campaign
- Utilities —
keccak256,toHex,getCurrentTimestamp,addDays