Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ export async function erc1155SignatureGenerate(fastify: FastifyInstance) {
pricePerToken,
pricePerTokenWei,
currency,
validityStartTimestamp,
validityEndTimestamp,
tokenId,
uid,
Expand Down Expand Up @@ -188,7 +187,6 @@ export async function erc1155SignatureGenerate(fastify: FastifyInstance) {
tokenId: maybeBigInt(tokenId),
pricePerTokenWei: maybeBigInt(pricePerTokenWei),
currency,
validityStartTimestamp: new Date(validityStartTimestamp * 1000),
validityEndTimestamp: validityEndTimestamp
? new Date(validityEndTimestamp * 1000)
: undefined,
Expand Down Expand Up @@ -254,7 +252,14 @@ export async function erc1155SignatureGenerate(fastify: FastifyInstance) {
tokenId,
});

const signedPayload = await contract.erc1155.signature.generate(payload);
const signedPayload = tokenId
? await contract.erc1155.signature.generateFromTokenId(
{ ...payload, tokenId: BigInt(tokenId) },
)
: await contract.erc1155.signature.generate(payload);

console.log("signedPayload", signedPayload);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Remove debug console.log statement before production.

This debug statement should be removed as it can:

  • Clutter production logs
  • Potentially expose sensitive signature data
  • Impact performance in high-throughput scenarios
-      console.log("signedPayload", signedPayload);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
console.log("signedPayload", signedPayload);
🤖 Prompt for AI Agents
In src/server/routes/contract/extensions/erc1155/read/signature-generate.ts at
line 261, remove the debug console.log statement that outputs the signedPayload
to prevent cluttering production logs, avoid exposing sensitive signature data,
and improve performance in high-throughput scenarios.


reply.status(StatusCodes.OK).send({
result: {
...signedPayload,
Expand Down
Loading