An open API service indexing awesome lists of open source software.

https://github.com/pooltogether/multi-token-listener

Contract that contains multiple TokenFaucets
https://github.com/pooltogether/multi-token-listener

Last synced: 11 months ago
JSON representation

Contract that contains multiple TokenFaucets

Awesome Lists containing this project

README

          

# PoolTogether Multi Token Listener

[![Coverage Status](https://coveralls.io/repos/github/pooltogether/multi-token-listener/badge.svg?branch=master)](https://coveralls.io/github/pooltogether/multi-token-listener?branch=master)

![Tests](https://github.com/pooltogether/multi-token-listener/actions/workflows/main.yml/badge.svg)

# About
MultiTokenListener is a contract which holds multiple [TokenFaucets](https://github.com/pooltogether/pooltogether-pool-contracts/blob/master/contracts/token-faucet/TokenFaucet.sol). This contract allows the allocation/rewarding of multiple tokens vs. a measure token, such as the PoolTogether Ticket. The `beforeTokenMint` and `beforeTokenTransfer` token hooks are called for each associated TokenFaucet.

## Usage
1. TokenFaucets should be deployed and initialized individually. The owner of these TokenFaucets can be different to that of the MultiTokenListener.
1. This contract should be deployed.
1. The TokenFaucets should be added using `addTokenFaucets()`.
1. The appropriate `tokenListener` address should be set on the origin contract (PrizeStrategy)

# Installation
Install the repo and dependencies by running:
`yarn`

## Deployment
These contracts can be deployed to a network by running:
`yarn deploy `

# Testing
Run the unit tests locally with:
`yarn test`

## Fork Test
In one terminal window run:
`yarn start-fork`

This will start the fork and deploy the implementation contract and also an instance of the MultiTokenListener.

In another terminal window run:
`yarn run-fork`

This will create several TokenFaucets, attach them to the MultiTokenListener instance, and set this address as the `tokenListener` for three prize strategies. Finally a rewards eligible ticket holders address balance is checked over time.

## Coverage
Generate the test coverage report with:
`yarn coverage`