Skip to content

Commit

Permalink
track the dead address too
Browse files Browse the repository at this point in the history
  • Loading branch information
ecioppettini committed Mar 25, 2024
1 parent c75d88d commit 07bb220
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/engine/paima-sm/src/cde-erc721-transfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default async function processErc721Datum(
const { to, tokenId } = cdeDatum.payload;
const toAddr = to.toLowerCase();

const isBurn = Boolean(toAddr.match(/^0x0+$/g));
const isBurn = Boolean(toAddr.toLocaleLowerCase().match(/^0x0+(dead)?$/g));

const updateList: SQLUpdate[] = [];
try {
Expand All @@ -30,6 +30,8 @@ export default async function processErc721Datum(
const newOwnerData = { cde_id: cdeId, token_id: tokenId, nft_owner: toAddr };
if (ownerRow.length > 0) {
if (isBurn) {
// we do this to keep track of the owner before the asset is sent to the
// burn address
updateList.push([
cdeErc721BurnInsert,
{ cde_id: cdeId, token_id: tokenId, nft_owner: ownerRow[0].nft_owner },
Expand Down

0 comments on commit 07bb220

Please sign in to comment.