You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/simulator/index.ts
+7-4Lines changed: 7 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -90,7 +90,7 @@ export default class Simulator {
90
90
type: NATIVE,
91
91
from: call.from,
92
92
to: call.to,
93
-
amount: call.value,
93
+
amount: BigInt(call.value).toString(),
94
94
id: "",
95
95
});
96
96
}
@@ -103,6 +103,7 @@ export default class Simulator {
103
103
// keccak256(Transfer(address,address,uint256))
104
104
if(eventHash===ERC20_ERC721_TRANSFER_TOPIC){
105
105
// ERC20 Transfer event have a topics array of 3 elements (eventHash, and 2 indexed addresses)
106
+
// This one also covers cryptoPunks but as ERC20 token only, if we notice a high volume we can support `PunkBought` event
106
107
if(event.topics.length===3){
107
108
const[,_from,_to]=event.topics;
108
109
constfrom=addressFrom32bytesTo20bytes(_from);
@@ -115,9 +116,11 @@ export default class Simulator {
115
116
to,
116
117
amount,
117
118
});
118
-
}
119
-
// ERC721 Transfer event have a topics array of 4 elements (eventHash, and 2 indexed addresses and an indexed tokenId)
120
-
else{
119
+
}else{
120
+
/**
121
+
* @dev ERC721 Transfer event have a topics array of 4 elements (eventHash, and 2 indexed addresses and an indexed tokenId)
122
+
* the explicit `else` also cover CryptoKitties case where non of event arguments is indexed (event.topics.length ===1) @see https://etherscan.io/address/0x06012c8cf97bead5deae237070f9587f8e7a266d#code
0 commit comments