File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
packages/thirdweb/src/tokens Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,9 @@ import { bytesToHex, randomBytes } from "@noble/hashes/utils";
22import type { Hex } from "viem" ;
33import { parseEventLogs } from "../event/actions/parse-logs.js" ;
44import { createdEvent } from "../extensions/tokens/__generated__/ERC20Entrypoint/events/Created.js" ;
5- import { create } from "../extensions/tokens/__generated__/ERC20Entrypoint/write/create .js" ;
5+ import { createById } from "../extensions/tokens/__generated__/ERC20Entrypoint/write/createById .js" ;
66import { sendAndConfirmTransaction } from "../transaction/actions/send-and-confirm-transaction.js" ;
7+ import { padHex , toHex } from "../utils/encoding/hex.js" ;
78import { DEFAULT_DEVELOPER_ADDRESS } from "./constants.js" ;
89import { getDeployedEntrypointERC20 } from "./get-entrypoint-erc20.js" ;
910import {
@@ -28,13 +29,16 @@ export async function createToken(options: CreateTokenOptions) {
2829 const entrypoint = await getDeployedEntrypointERC20 ( options ) ;
2930
3031 let hookData : Hex = "0x" ;
32+ let contractId = padHex ( toHex ( "ERC20Asset" ) , { size : 32 } ) ;
3133 if ( launchConfig ?. kind === "pool" ) {
3234 hookData = encodePoolConfig ( launchConfig . config ) ;
35+ contractId = padHex ( toHex ( "ERC20Asset_Pool" ) , { size : 32 } ) ;
3336 }
3437
35- const transaction = create ( {
38+ const transaction = createById ( {
3639 contract : entrypoint ,
37- createParams : {
40+ contractId,
41+ params : {
3842 data : encodedInitData ,
3943 hookData,
4044 developer : options . developerAddress || DEFAULT_DEVELOPER_ADDRESS ,
You can’t perform that action at this time.
0 commit comments