Skip to content

Commit

Permalink
Initial
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Carpenter authored and Adam Carpenter committed Dec 30, 2021
0 parents commit 5d9e72e
Show file tree
Hide file tree
Showing 3,751 changed files with 114,621 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This example uses [Blocknative's SDK](https://github.com/blocknative/sdk) to watch the Ethereum mempool looking for the transaction activating the Dotdotdots(NFT) Smart Contract minting.
`npm install` then `node index.js`
This plays on the article from Pawel Urbanek - [Hunting for Rare NFTs in the Ethereum Dark Forest](https://pawelurbanek.com/ethereum-mempool-monitoring)
Please checkout all the awesome products from [Blocknative](https://www.blocknative.com)
[Blocknative Docs](https://docs.blocknative.com/)
1 change: 1 addition & 0 deletions abi.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 46 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import BlocknativeSdk from 'bnc-sdk';
import WebSocket from 'ws';
import { dotDotDotAbi } from './abi.js';

const DOT_CONTRACT_ADDRESS = "0x67Ed645EC1994c60d7e3664CA2bEd0A56B48595F";
const DOT_CONTRACT_ABI = dotDotDotAbi;
const DOT_ADMIN_ADDRESS = "0xd29dcbd273d73714eb6bea7bd4f8d99d0fbc3398"

const options = {
dappId: '25b387fb-bf21-42ec-a093-9d37e4267a7a',
networkId: 1,
system: 'ethereum',
ws: WebSocket,
transactionHandlers: [async (event) => await mint(event.transaction)],
onerror: (error) => {console.error('error!!! ', error)}
}

const main = async () => {
const sdk = new BlocknativeSdk(options)
console.log('listening until error msg is seen...')
await sdk.configuration({
scope: DOT_CONTRACT_ADDRESS,
abi: DOT_CONTRACT_ABI,
filters: [
{ from: DOT_ADMIN_ADDRESS },
{ "contractCall.methodName": "flipSaleState" },
{ status: "pending" }
],
watchAddress: true
})
}

const mint = async (txData) => {
await signer.sendTransaction({
to: DOT_CONTRACT_ADDRESS,
data: mintOne,
type: 2,
value: ETHER.div(100).mul(5),
maxFeePerGas: BigNumber.from(txData.maxFeePerGas).sub(1),
maxPriorityFeePerGas: txData.maxPriorityFeePerGas,
gasLimit: 200000,
chainId: 1
})
}

await main()
1 change: 1 addition & 0 deletions node_modules/.bin/node-gyp-build

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/node-gyp-build-optional

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/node-gyp-build-test

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

112 changes: 112 additions & 0 deletions node_modules/.package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions node_modules/bnc-sdk/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5d9e72e

Please sign in to comment.