Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
bokkypoobah committed Dec 16, 2023
1 parent 6473f7c commit a748a4f
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2141,12 +2141,10 @@ <h4>Something Something</h4> -->
},

async checkApprovalEvents(provider, latestBlockNumber) {
console.log("Hi hi!");
const accountAs32Bytes = '0x000000000000000000000000' + this.coinbase.substring(2, 42).toLowerCase();
console.log("accountAs32Bytes: " + accountAs32Bytes);
// const fromBlock = 18770065;
const fromBlock = 0;
const toBlock = 18770065;
const toBlock = latestBlockNumber;

// ERC-20 Approval (index_topic_1 address owner, index_topic_2 address spender, uint256 value)
// 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925
Expand All @@ -2160,18 +2158,20 @@ <h4>Something Something</h4> -->
// ERC-1155 ApprovalForAll (index_topic_1 address account, index_topic_2 address operator, bool approved)
// 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31

// const topics = [ '0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925', accountAs32Bytes, null ];
// const logs = await provider.getLogs({ address: null, fromBlock, toBlock, topics });

// const topics = [ '0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925', accountAs32Bytes, null ];
const logs = await provider.getLogs({
const approvalLogs = await provider.getLogs({
address: null,
fromBlock,
toBlock,
topics: [ '0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925', accountAs32Bytes, null ],
});
console.log("approvalLogs: " + JSON.stringify(approvalLogs, null, 2));
const approvalForAllLogs = await provider.getLogs({
address: null,
fromBlock,
toBlock,
// topics: [ '0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925', accountAs32Bytes, null ],
topics: [ '0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31', accountAs32Bytes, null ],
});
console.log("logs: " + JSON.stringify(logs, null, 2));
console.log("approvalForAllLogs: " + JSON.stringify(approvalForAllLogs, null, 2));
},

async syncEvents(db, provider, latestBlockNumber) {
Expand Down

0 comments on commit a748a4f

Please sign in to comment.