@pooltogether/multi-token-listener
v1.1.0
Published
PoolTogether MultiTokenListener
Downloads
9
Readme
PoolTogether Multi Token Listener
About
MultiTokenListener is a contract which holds multiple TokenFaucets. 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
- TokenFaucets should be deployed and initialized individually. The owner of these TokenFaucets can be different to that of the MultiTokenListener.
- This contract should be deployed.
- The TokenFaucets should be added using
addTokenFaucets()
. - 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 <networkName>
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