Skip to content

Commit 400274f

Browse files
authored
Merge pull request #23 from trustwallet/feat/seaport-v1.5
Feat/seaport v1.5
2 parents 328383c + 1b4dc22 commit 400274f

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/simulator/index.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export default class Simulator {
9090
type: NATIVE,
9191
from: call.from,
9292
to: call.to,
93-
amount: call.value,
93+
amount: BigInt(call.value).toString(),
9494
id: "",
9595
});
9696
}
@@ -103,6 +103,7 @@ export default class Simulator {
103103
// keccak256(Transfer(address,address,uint256))
104104
if (eventHash === ERC20_ERC721_TRANSFER_TOPIC) {
105105
// 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
106107
if (event.topics.length === 3) {
107108
const [, _from, _to] = event.topics;
108109
const from = addressFrom32bytesTo20bytes(_from);
@@ -115,9 +116,11 @@ export default class Simulator {
115116
to,
116117
amount,
117118
});
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
123+
*/
121124
const [, _from, _to, _tokenId] = event.topics;
122125
const from = addressFrom32bytesTo20bytes(_from);
123126
const to = addressFrom32bytesTo20bytes(_to);

src/visualizer/seaport/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,10 @@ const supportedChains = [
177177
* and there's a note regarding some limitation so we decided to not support them
178178
* @see https://github.com/ProjectOpenSea/seaport#deployments-by-evm-chain
179179
* @see https://github.com/ProjectOpenSea/seaport-js/blob/main/src/constants.ts#L5
180+
* @see https://docs.opensea.io/changelog/seaport-1-5-release
180181
*/
181182
const addressesBook = [
183+
"0x00000000000000adc04c56bf30ac9d3c0aaf14dc", //v1.5 https://docs.opensea.io/changelog/seaport-1-5-release
182184
"0x00000000000001ad428e4906aE43D8F9852d0dD6", //v1.4
183185
"0x00000000006c3852cbEf3e08E8dF289169EdE581", //v1.1
184186
].map((e) => e.toLocaleLowerCase());

0 commit comments

Comments
 (0)