Skip to content

direct-ads/direct-ads

Repository files navigation

direct ads

This dapp allows publishers and advertisers to transact directly, without a middleman (e.g. Google AdSense).

  • Publishers add their unique inventory (e.g. a pre-roll ad space in a video) by minting an NFT.
  • Advertisers make bids on the inventory they are interested in.
  • Publishers accept offers, display ads, and get paid directly by advertisers.
  • The whole process is managed by a few smart contracts on the Ethereum blockchain.

Video: https://ipfs.infura.io/ipfs/QmfHQiYUMmXSevfJYgkcD4riGPZQKyrWdftEt1aSNRxZNa

Demo: https://direct-ads.pages.dev/

FAQ

  • Q: Why use NFTs?

    A: Publishers often monetize their content (inventory) with ads. Since the content is unique and belongs to someone, NFTs can be used to represent it. For example, a blog, a news website, or a video channel can be represented with an NFT, and the ownership can be verified.

  • Q: How would you deal with unscrupulous advertisers who don't pay?

    A: A publisher can receive bids from several advertisers, and some of the bids might be bogus, which means that the publisher needs to be careful and select ads that maximize the profit. We can think of each advertiser as a Bernoulli bandit, i.e. it generates ad revenue with some probability. There is a simple and efficient algorithm to solve this problem - Thompson sampling. Please see https://web.stanford.edu/~bvr/pubs/TS_Tutorial.pdf

Bounties

  • Tally Wallet

    We've integrated Tally Wallet into our app using the Blocknative Onboard library.

    image

Our tech stack

apeworx Contract development framework
bnc-onboard Wallet selection
bootstrap 5 CSS framework
chainlink Domain name ownership verification
ethers.js Library for interacting with the Ethereum Blockchain
maticvigil API gateway for the matic network
openzepellin Reusable solidity contracts
polygon EVM enabled sidechain
solidity Our contracts are written in solidity
stimulus Frontend JS framework
tally wallet Our dapp supports tally wallet via bnc-onboard

Development

  1. Install foreman
    gem install foreman
  2. Install apeworx
    pip install eth-ape
  3. Install dependencies
    npm install
  4. Start webpack dev server and hardhat node
    npm start
  5. Run tests
    ape test
  6. Deploy the contracts
    ape run deploy --network hardhat
  7. Open http://localhost:8080