mirror of
https://github.com/placeholder-soft/web.git
synced 2026-01-12 22:45:00 +08:00
enforce 32 bytes for toHex (#914)
This commit is contained in:
@@ -28,11 +28,11 @@ export default async function GET(request: Request) {
|
||||
return NextResponse.json({ error: '406: base domain name is missing' }, { status: 406 });
|
||||
|
||||
// Get labelhash from tokenId
|
||||
const labelHash = toHex(BigInt(tokenId));
|
||||
const labelhash = toHex(BigInt(tokenId), { size: 32 });
|
||||
|
||||
// Convert labelhash to namehash
|
||||
const namehashNode = keccak256(
|
||||
encodePacked(['bytes32', 'bytes32'], [namehash(baseDomainName), labelHash]),
|
||||
encodePacked(['bytes32', 'bytes32'], [namehash(baseDomainName), labelhash]),
|
||||
);
|
||||
|
||||
let basenameFormatted = undefined;
|
||||
|
||||
Reference in New Issue
Block a user