A Twitter bot that tweets all ERC-721 NFT sales for a given contract 🤖

Overview

NFT Sales Twitter Bot 🤖

This was made to succeed my Opensea Sales Twitter Bot repo; while relying on the OpenSea Events API is simpler, it doesn't include any NFT sales happening in other, newer marketplaces.

So, we need to monitor & process Ethereum event logs for ERC-721 token transactions directly, before posting any sales to Twitter.

Aims 🎯

The aim is to monitor all sales across Ethereum for a given contract. However, different marketplaces can send sale logs in different formats, so we need to process major market logs manually (see markets.js).

Right now Opensea and LooksRare marketplaces are integrated, but it should be easy to add others in the future.

Donations 💵

...are greatly appreciated 🙏

Eth Address: 0xDCA88f66CEc8972D23DE7d5e69c40E087C92132f

Setup 🔧

- abi.json

  • Retrieve the Contract ABI for the contract you're looking to monitor, from somewhere like EtherScan, in JSON format, and include it in abi.json.

- Alchemy (or another Web3 service provider e.g. Infura, Moralis)

  • Create an account at Alchemy.com & create a new application on Ethereum mainnet. Once you've created a project, you should be able to grab the API key for it

- OpenSea (or another service with an NFT metadata API, e.g. Moralis, Venly)

  • Request an OpenSea API key here

- Twitter

  • Request a Twitter Developer Account (with Elevated Access, then create a Twitter Developer App (make sure you change it to have both read/write permissions)

  • Make sure you are logged in to the Twitter account you want the bot to run on (as the next step will be authorizing the bot to post on your account)

  • Install Twurl and, using your Twitter Developer consumer key & secret, generate the access token & access secret

- Heroku

  • Create a new Heroku account + app (a $7 a month dyno instance should be enough but it'll depend on usage) & set the project as a remote branch of your git repo (see Heroku Remote)

In the Settings section of your Heroku app you'll see a Config Vars section. Add the following config vars:

  • CONSUMER_KEY - Your Twitter Developer App's Consumer Key
  • CONSUMER_SECRET - Your Twitter Developer App's Consumer Secret
  • ACCESS_TOKEN_KEY - The Access Token Key of the Twitter Account your bot is posting from
  • ACCESS_TOKEN_SECRET - The Access Token Secret of the Twitter Account your bot is posting from
  • CONTRACT_ADDRESS - The contract address you want to monitor sales for
  • ALCHEMY_API_KEY - Your unique Alchemy API key
  • X_API_KEY - Your unique OpenSea API key

Now you're ready to release - just push up the code via. git to the Heroku remote (see Heroku Remote if unsure how).

Make sure you are using worker dynos and not web dynos - you can set this in the CLI your project with:

heroku ps:scale web=0
heroku ps:scale worker=1

Modification 🛠

In app.js, you'll notice there's some commented out logic for only posting sales above a certain threshold that you can modify per-currency in currencies.js.

License 📃

This code is licensed under the ISC License.

Please include proper attribution to my original repo if you fork, modify or utilize this repo in any way. Thank you!

You might also like...

Create your own custom NFT minting page using thirdweb's NFT Drop contract

Customizable NFT Drop Minting Page In this example, you can create your own NFT Drop minting page just by customising the template with your branding,

Dec 24, 2022

Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

May 18, 2022

Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

May 3, 2022

Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

Jan 3, 2023

BookStore is a website that allows a given user to view a list of books, to add a new book and remove a given book.

BookStore is a website that allows a given user to view a list of books, to add a new book and remove a given book.

Project Name : BookStore CMS BookStore is a website that allows a given user to view a list of books, to add a new book and remove a given book. In or

Aug 22, 2022

🐲 Epic NFTs [UI] - Proyecto que te permitirá conectar tu billetera y acuñar un NFT, podrás revender el NFT en OpenSea. El NFT en sí se puede personalizar

🐲 Epic NFTs [UI] - Proyecto que te permitirá conectar tu billetera y acuñar un NFT, podrás revender el NFT en OpenSea. El NFT en sí se puede personalizar

🐲 Epic NFTs [UI] El proyecto se encuentra deployado en Vercel para que puedan verlo e interactuar con él, toda crítica o comentario se agradece, pued

Oct 22, 2022

Fullstack Dynamic NFT Mini Game built using 💎 Diamond Standard [EIP 2535] 🏃‍♀️Players can use Hero NFT to battle against Thanos ⚔ Heroes can be Healed by staking their NFT 🛡

Fullstack Dynamic NFT Mini Game built using 💎 Diamond Standard [EIP 2535]  🏃‍♀️Players can use Hero NFT to battle against Thanos ⚔ Heroes can be Healed by staking their NFT 🛡

💎 Fullstack Dynamic NFT Mini Game 🎮 💎 Using Diamond Standard Play On 💎 🎮 ⏩ http://diamond-dapp.vercel.app/ Project Description 📝 Fullstack Dynam

Dec 23, 2022

NFT Marketplace framework to build standalone NFT marketplace or inApp/inGame NFT marketplace

NFT Marketplace This project is a decentalized NFT Marketplace framework which is to be the baseline for you to build standalone NFT marketplace or in

Dec 19, 2022

Spiner bot to buy and sell tokens on ETH and ERC compatible chains as soon as liquidity is added and trade is enabled.

Spiner bot to buy and sell tokens on ETH and ERC compatible chains as soon as liquidity is added and trade is enabled.

An open-source defi sniper. open-sniper is free to download. Premium Services Now Available While open-sniper is free and open-source, if you want the

Apr 21, 2022
Comments
  • Add seaport

    Add seaport

    There is probably a much cleaner way to do this, but I was not able to get ethers to play nice with the log format. I had utilized this code for slightly different purposes, so I just ported my changes back here; this is not tested.

    This is what I used to calculate the hex offsets: https://github.com/ProjectOpenSea/seaport/blob/171f2cd7faf13b2bf0455851499f1981274977f7/contracts/lib/ConsiderationConstants.sol#L142

    opened by callikai 9
  • New Opensea Seaport Contract

    New Opensea Seaport Contract

    Opensea recently released their new marketplace smart contract, Seaport 1.1 This completely broke the tracking of Opensea sales.

    Documentation: https://docs.opensea.io/v2.0/reference/seaport-overview

    I'm trying to fix this on my end to submit a PR but it seems that they used a whole new structure and didn't include a "price" log in the new OrderFulfilled Event. Getting the full paid price might force us to run calculations not needed for other marketplaces such as Looksrare.

    Feel free to comment on this issue if you are also working on a fix

    bug help wanted 
    opened by Cilooth 6
  • [Feature Request] Watch Multiple collections parallelly

    [Feature Request] Watch Multiple collections parallelly

    What I was thinking is if it's possible to watch and tweet on multiple collections simultaneously?

    In the app.js on the last line when the function is called instead of just calling the function without args what if we did this?

        monitorContract(process.env.CONTRACT_ADDRESS1, abi1);
        monitorContract(process.env.CONTRACT_ADDRESS2, abi2);
    

    will have to make same changes for functions in utils too just need to add CONTRACT_ADDRESS as arguments.

    Have tried this and worked fine for me with collections that were currently minting, didn't get rate-limited which is the only thing that I was worried about

    would love to open a pull request if this makes sense or am I missing something?

    wontfix 
    opened by Deveshb15 1
  • Addition of blur.io marketplace

    Addition of blur.io marketplace

    Increasing numbers of transactions are taking place on the blur.io marketplace. Requesting addition of this exchange to the existing marketplaces within the code.

    opened by CoderMatthiasGSM 0
Owner
Daniel Griffin
Daniel Griffin
Scrape tweets from Twitter search results based on keywords and date range using Playwright. Save scraped tweets in a CSV file for easy analysis

Tweet Harvest (Twitter Crawler) Tweet Harvest is a command-line tool that uses Playwright to scrape tweets from Twitter search results based on specif

Helmi Satria 33 Aug 9, 2023
A Twitter bot that reads the tweets of a given username and analyzes the user's personality using AI.

Twitter Chatgpt Analysor Create a bot that reads the tweets of a given username and analyzes the user's personality using artificial intelligence.. In

Sabber Soltani 8 May 9, 2023
Script to fetch all NFT owners using moralis API. This script output is a data.txt file containing all owner addresses of a given NFT and their balances.

?? Moralis NFT Snapshot Moralis NFT API will only return 500 itens at a time when its is called. For that reason, a simple logic is needed to fetch al

Phill Menezes 6 Jun 23, 2022
Yet another library for generating NFT artwork, uploading NFT assets and metadata to IPFS, deploying NFT smart contracts, and minting NFT collections

eznft Yet another library for generating NFT artwork, uploading NFT assets and metadata to IPFS, deploying NFT smart contracts, and minting NFT collec

null 3 Sep 21, 2022
Twitter bot to find what song is playing in a given uploaded twitter video.

what-song-is-this Twitter bot to find what song is playing in a given uploaded twitter video. How to setup. yarn install How to run. via npm script ya

Akinwande Akinboluwarin 17 Dec 11, 2022
NFT sales monitoring bot for the Ethereum blockchain. (ERC721, ERC1155)

Ethereum-NFT-Sales-Bot NFT sales monitoring bot for the Ethereum blockchain. (erc721, erc1155) Table of Contents Click to expand Market Coverage GIF G

null 33 Dec 13, 2022
A simple multilateral escrow smart contract for ETH and ERC-20 tokens governed by Cobie.

Multilateral Escrow Smart Contract Governed by Cobie Test Deployments Cobie's address: 0x4Cbe68d825d21cB4978F56815613eeD06Cf30152 Rinkeby: 0xFfE420602

Pascal Marco Caversaccio 28 Dec 15, 2022
Hides all the @saveToNotion @memdotai @threadreaderapp tweets from your Twitter timeline

This is a Plasmo extension project bootstrapped with plasmo init. Getting Started First, run the development server: pnpm dev # or npm run dev Open yo

null 2 Oct 11, 2022
Fuck Twitter NFTs - Userscript to delete or block all occurances of NFT Users on Twitter

FuckTwitterNFTs Fuck Twitter NFTs - Userscript to delete or block all occurances of NFT Users on Twitter Userscript will by default, attempt to delete

Blumlaut 1 Jan 20, 2022
A time-locked vault that distributes erc-20 tokens to owners of an nft-collection at expiry

A time-locked vault that distributes erc-20 tokens to owners of an nft-collection at expiry

Decent 4 Apr 10, 2022