Integrate modular core contracts + mintableERCxxx extensions (#3413)

Co-authored-by: Krishang <[email protected]>
Co-authored-by: Yash <[email protected]>
Co-authored-by: Yash <[email protected]>
This commit is contained in:
Joaquim Verges
2024-09-06 07:25:06 +12:00
committed by GitHub
co-authored by Krishang Yash Yash
parent bf61c4bf2a
commit 87d6b6a5b5
851 changed files with 13136 additions and 15575 deletions
+56
View File
@@ -0,0 +1,56 @@
---
"thirdweb": minor
---
Support for modular contracts
# Deploy and Interact with modular contracts programmatically
### Deploy a modular contract
```ts
import {
ClaimableERC721,
BatchMetadataERC721,
deployModularContract,
} from "thirdweb/modules";
const deployed = deployModularContract({
client,
chain,
account,
core: "ERC721",
params: {
name: "My Modular NFT Contract",
},
modules: [
ClaimableERC721.module({
primarySaleRecipient: ...,
}),
BatchMetadataERC721.module(),
],
});
```
### Interact with a modular contract
```ts
import { ClaimableERC721 } from "thirdweb/modules";
const contract = getContract({
client,
chain,
address,
});
const transaction = ClaimableERC721.mint({
contract,
to: account.address,
quantity: 1,
});
await sendTransaction({
transaction,
account,
});
```