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";
2
2
import type { Hex } from "viem" ;
3
3
import { parseEventLogs } from "../event/actions/parse-logs.js" ;
4
4
import { 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" ;
6
6
import { sendAndConfirmTransaction } from "../transaction/actions/send-and-confirm-transaction.js" ;
7
+ import { padHex , toHex } from "../utils/encoding/hex.js" ;
7
8
import { DEFAULT_DEVELOPER_ADDRESS } from "./constants.js" ;
8
9
import { getDeployedEntrypointERC20 } from "./get-entrypoint-erc20.js" ;
9
10
import {
@@ -28,13 +29,16 @@ export async function createToken(options: CreateTokenOptions) {
28
29
const entrypoint = await getDeployedEntrypointERC20 ( options ) ;
29
30
30
31
let hookData : Hex = "0x" ;
32
+ let contractId = padHex ( toHex ( "ERC20Asset" ) , { size : 32 } ) ;
31
33
if ( launchConfig ?. kind === "pool" ) {
32
34
hookData = encodePoolConfig ( launchConfig . config ) ;
35
+ contractId = padHex ( toHex ( "ERC20Asset_Pool" ) , { size : 32 } ) ;
33
36
}
34
37
35
- const transaction = create ( {
38
+ const transaction = createById ( {
36
39
contract : entrypoint ,
37
- createParams : {
40
+ contractId,
41
+ params : {
38
42
data : encodedInitData ,
39
43
hookData,
40
44
developer : options . developerAddress || DEFAULT_DEVELOPER_ADDRESS ,
You can’t perform that action at this time.
0 commit comments