diff --git a/src/utils/oneCountry.ts b/src/utils/oneCountry.ts index ae1b412..9ffa82b 100644 --- a/src/utils/oneCountry.ts +++ b/src/utils/oneCountry.ts @@ -17,10 +17,11 @@ export const getAddressByName = async (name: string) => { } export const convertErc721TokenId = (erc721TokenId: string) => { - const labelHashReverse = '0x' + BigInt(erc721TokenId).toString(16) + let labelHash = Web3.utils.toBN(erc721TokenId).toString('hex', 64) + labelHash = '0x' + labelHash const encodePacked = Web3.utils.encodePacked( {value: OneCountryTLDNode, type: 'bytes32'}, - {value: labelHashReverse, type: 'bytes32'}, + {value: labelHash, type: 'bytes32'}, ) || ''; - return BigInt(keccak256(encodePacked)).toString() + return Web3.utils.toBN(keccak256(encodePacked)).toString() }