File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
packages/thirdweb/src/assets Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -46,9 +46,17 @@ export async function createToken(options: CreateTokenOptions) {
46
46
const entrypoint = await getOrDeployEntrypointERC20 ( options ) ;
47
47
48
48
let hookData : Hex = "0x" ;
49
-
49
+ let amount = toUnits (
50
+ params . maxSupply . toString ( ) || DEFAULT_MAX_SUPPLY_ERC20 . toString ( ) ,
51
+ 18 ,
52
+ ) ;
50
53
if ( launchConfig ?. kind === "pool" ) {
51
54
hookData = encodePoolConfig ( launchConfig . config ) ;
55
+ amount = toUnits (
56
+ launchConfig . config . amount . toString ( ) ||
57
+ DEFAULT_MAX_SUPPLY_ERC20 . toString ( ) ,
58
+ 18 ,
59
+ ) ;
52
60
} else if ( launchConfig ?. kind === "market" ) {
53
61
const currencyContract =
54
62
launchConfig . config . tokenOut &&
@@ -77,10 +85,7 @@ export async function createToken(options: CreateTokenOptions) {
77
85
contract : entrypoint ,
78
86
creator,
79
87
createParams : {
80
- amount : toUnits (
81
- params . maxSupply . toString ( ) || DEFAULT_MAX_SUPPLY_ERC20 . toString ( ) ,
82
- 18 ,
83
- ) ,
88
+ amount,
84
89
referrer : ZERO_ADDRESS ,
85
90
salt,
86
91
data : encodedInitData ,
You can’t perform that action at this time.
0 commit comments