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
- Host: GitHub
- URL: https://github.com/pooltogether/multi-token-listener
- Owner: pooltogether
- Created: 2021-06-09T20:43:14.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-07-08T23:16:49.000Z (almost 5 years ago)
- Last Synced: 2025-07-01T11:03:53.647Z (11 months ago)
- Language: TypeScript
- Homepage:
- Size: 876 KB
- Stars: 2
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PoolTogether Multi Token Listener
[](https://coveralls.io/github/pooltogether/multi-token-listener?branch=master)

# 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`