PoolTogether 3.0
HomeAppBuilder
v3.0.1
v3.0.1
  • ✨Introduction
  • 📡Networks
  • 💱Migrating from V2 to V3
  • 🚰Resources
  • Protocol
    • 🌐Overview
    • 🏆Prize Pools
      • ⚖️ Fairness
      • Compound Prize Pool
      • yVault Prize Pool
      • Token Listener
    • 💸Prize Strategies
      • 🤑Single Random Winner
        • 🎟️ Ticket
        • 🎁Sponsorship
    • 🧞Random Number Generator
      • Blockhash
      • Chainlink VRF
  • Tutorials
    • Getting Started
    • Deposit into a Prize Pool
    • Withdraw from a Prize Pool
    • Create a Prize Pool
    • Create a Prize Strategy
  • Governance
    • 🏛️ Overview
    • 💰Comptroller
  • Security
    • Risks
    • Audits & Testing
    • Bounties
Powered by GitBook
On this page

Was this helpful?

  1. Protocol
  2. Prize Pools

Token Listener

The Prize Pool Token Listener interface allows contracts to "listen" to the complete token lifecycle of mint, transfer and burn. There are two functions that must be implemented: beforeTokenMint and beforeTokenTransfer

The beforeTokenMint function must be called whenever a token is minted.

function beforeTokenMint(
    address to,
    uint256 amount,
    address controlledToken,
    address referrer
) external;

Paramater Name

Parameter Description

to

The address that is receiving the newly minted tokens

amount

The amount of new tokens

controlledToken

The token being minted

referrer

The address that referred the user (for rewards)

The beforeTokenTransfer function must be called whenever a token is transferred or burned.

function beforeTokenTransfer(
    address from,
    address to,
    uint256 amount,
    address controlledToken
) external;

Paramater Name

Parameter Description

from

The address that is sending the tokens

to

The address that is receiving tokens. May be the zero address if burning.

amount

The amount of tokens

controlledToken

The token being transferred

PreviousyVault Prize PoolNextPrize Strategies

Last updated 4 years ago

Was this helpful?

🏆