diff --git a/system-contract-dapp-playground/__tests__/hedera/hts-interactions/token-create-custom/index.test.ts b/system-contract-dapp-playground/__tests__/hedera/hts-interactions/token-create-custom/index.test.ts index d3c01f90b..0ed0ce853 100644 --- a/system-contract-dapp-playground/__tests__/hedera/hts-interactions/token-create-custom/index.test.ts +++ b/system-contract-dapp-playground/__tests__/hedera/hts-interactions/token-create-custom/index.test.ts @@ -47,6 +47,7 @@ describe('createHederaFungibleToken test suite', () => { const initialSupply = 900000000; // 9 WHBAR const metadata = ['Zeus', 'Athena', 'Apollo']; const msgValue = '20000000000000000000'; // 20 hbar + const feeAmount = 1000; // 20 hbar const recipient = '0x34810E139b451e0a4c67d5743E956Ac8990842A8'; const contractId = '0xbdcdf69052c9fc01e38377d05cc83c28ee43f24a'; const feeTokenAddress = '0x00000000000000000000000000000000000006Ab'; @@ -161,7 +162,8 @@ describe('createHederaFungibleToken test suite', () => { contractId, inputKeys, msgValue, - feeTokenAddress + feeTokenAddress, + feeAmount ); expect(txRes.err).toBeNull; @@ -342,7 +344,8 @@ describe('createHederaFungibleToken test suite', () => { contractId, inputKeys, msgValue, - feeTokenAddress + feeTokenAddress, + feeAmount ); expect(txRes.err).toBeNull; diff --git a/system-contract-dapp-playground/src/api/hedera/hts-interactions/tokenCreateCustom-interactions/index.ts b/system-contract-dapp-playground/src/api/hedera/hts-interactions/tokenCreateCustom-interactions/index.ts index ca80a890e..90edc4681 100644 --- a/system-contract-dapp-playground/src/api/hedera/hts-interactions/tokenCreateCustom-interactions/index.ts +++ b/system-contract-dapp-playground/src/api/hedera/hts-interactions/tokenCreateCustom-interactions/index.ts @@ -56,6 +56,8 @@ import { TNetworkName } from '@/types/common'; * * @param feeTokenAddress?: string * + * @param feeTokenAmount?: number + * * @return Promise * * @see https://github.com/hashgraph/hedera-smart-contracts/blob/main/contracts/hts-precompile/IHederaTokenService.sol#L136 @@ -73,7 +75,8 @@ export const createHederaFungibleToken = async ( treasury: string, inputKeys: ICommonKeyObject[], msgValue: string, - feeTokenAddress?: string + feeTokenAddress?: string, + feeTokenAmount?: number ): Promise => { // sanitize params let sanitizeErr; @@ -114,6 +117,7 @@ export const createHederaFungibleToken = async ( initialTotalSupply, maxSupply, decimals, + feeTokenAmount, keyRes.hederaTokenKeys, { value: ethers.parseEther(msgValue), @@ -175,6 +179,8 @@ export const createHederaFungibleToken = async ( * * @param feeTokenAddress?: ethers.AddressLike * + * @param feeTokenAmount?: number + * * @return Promise * * @see https://github.com/hashgraph/hedera-smart-contracts/blob/main/contracts/hts-precompile/IHederaTokenService.sol#L136 @@ -189,7 +195,8 @@ export const createHederaNonFungibleToken = async ( treasury: ethers.AddressLike, inputKeys: ICommonKeyObject[], msgValue: string, - feeTokenAddress?: ethers.AddressLike + feeTokenAddress?: ethers.AddressLike, + feeTokenAmount?: number ): Promise => { // sanitize params let sanitizeErr; @@ -224,6 +231,7 @@ export const createHederaNonFungibleToken = async ( symbol, memo, maxSupply, + feeTokenAmount, keyRes.hederaTokenKeys, { value: ethers.parseEther(msgValue), diff --git a/test/hts-precompile/token-create/tokenCreateCustomContract.js b/test/hts-precompile/token-create/tokenCreateCustomContract.js index 369b33a3f..d457098e2 100644 --- a/test/hts-precompile/token-create/tokenCreateCustomContract.js +++ b/test/hts-precompile/token-create/tokenCreateCustomContract.js @@ -31,6 +31,7 @@ describe('TokenCreateCustomContract Test Suite', () => { const initialSupply = 900000000; // 9 WHBAR const maxSupply = 30000000000; // 300 WHBAR const decimals = 8; + const feeAmount = 1000n; const freezeDefaultStatus = false; let keys, signers, fixedFeeTokenAddress, tokenCreateCustomContract; @@ -133,6 +134,7 @@ describe('TokenCreateCustomContract Test Suite', () => { initialSupply, maxSupply, decimals, + feeAmount, keys, { value: '35000000000000000000', @@ -179,6 +181,7 @@ describe('TokenCreateCustomContract Test Suite', () => { tokenSymbol, tokenMemo, maxSupply, + feeAmount, keys, { value: '20000000000000000000',