This repository contains the core smart interfaces and ABIs for CoCreate.
npm install @usecocreate/contract-sdkThis repository contains the core smart interfaces and ABIs for CoCreate.
``npm
npm install @usecocreate/contract-sdk
Usage
There are two ways to interact with the contract interfaces
1. (Recommended): Use typechain to generate TypeScript bindings for the ABIs. Example:
`sh
Generates typescript bindings in the typechain-types directory
typechain --out-dir='typechain-types' --target=ethers-v5 './node_modules/@usecocreate/contract-sdk/abi/*/.json'
``js
// You can then import these bindings into your typescript code directly
import { CoCreateLaunch__factory } from "typechain-types";const coCreateLaunch = CoCreateLaunch__factory.connect(COCREATE_LAUNCH_GOERLI_ADDR, wallet);
`2. Use the json abis directly in javascript or typescript
`js
import * as CoCreateLaunchJsonAbi from "@usecocreate/contract-sdk/abi/contracts/cocreate/CoCreateLaunch.sol/CoCreateLaunch.json";
import { ethers } from "hardhat";const coCreateLaunch = new ethers.Contract(COCREATE_LAUNCH_GOERLI_ADDR, CoCreateLaunchJsonAbi, wallet);
``You can find plenty of examples on how to use this package to launch a project, create a token, mint and burn in the cocreatelabs/examples repo.