Skip to content

Commit

Permalink
fix bug missing 0x in address of erc20 and erc721
Browse files Browse the repository at this point in the history
  • Loading branch information
cauta committed Apr 22, 2024
1 parent d28607a commit 73e8aaa
Showing 1 changed file with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,12 @@ export class EventHistory {
name: null,
symbol: null,
};
instance.fromAddress = log.topics[1].substring(26);
instance.toAddress = log.topics[2].substring(26);
instance.fromAddress = ethers
.getAddress(`0x${log.topics[1].substring(26)}`)
.toLowerCase();
instance.toAddress = ethers
.getAddress(`0x${log.topics[2].substring(26)}`)
.toLowerCase();
// instance.tokenId = '0';
instance.tokenValue = tokenValue;
// instance.nativeAmount = '0';
Expand Down Expand Up @@ -173,8 +177,12 @@ export class EventHistory {
name: null,
symbol: null,
};
instance.fromAddress = log.topics[1].substring(26);
instance.toAddress = log.topics[2].substring(26);
instance.fromAddress = ethers
.getAddress(`0x${log.topics[1].substring(26)}`)
.toLowerCase();
instance.toAddress = ethers
.getAddress(`0x${log.topics[2].substring(26)}`)
.toLowerCase();
instance.tokenId = tokenId;
// instance.tokenValue = '0';
// instance.nativeAmount = '0';
Expand Down

0 comments on commit 73e8aaa

Please sign in to comment.