@pooltogether/multi-token-listener

1.1.0 • Public • Published

PoolTogether Multi Token Listener

Coverage Status

Tests

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

  1. TokenFaucets should be deployed and initialized individually. The owner of these TokenFaucets can be different to that of the MultiTokenListener.
  2. This contract should be deployed.
  3. The TokenFaucets should be added using addTokenFaucets().
  4. 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

Readme

Keywords

none

Package Sidebar

Install

npm i @pooltogether/multi-token-listener

Weekly Downloads

0

Version

1.1.0

License

MIT

Unpacked Size

18 MB

Total Files

308

Last publish

Collaborators

  • asselstine