snapshot-labs / snapshot-strategies

Snapshot voting strategies
https://docs.snapshot.org/strategies
MIT License
223 stars 773 forks source link

Snapshot strategies

Development

Install dependencies

yarn

Build package

yarn build

Test strategy with predefined tests (params from examples.json file)

Note: If you're writing a new strategy, make sure to add it to strategies/index.ts before testing*

# Test default strategy (erc20-balance-of)
yarn test
# Test strategy with name
yarn test --strategy=erc20-received
yarn test --strategy=eth-balance
# Test with more addresses from addresses.json
yarn test --strategy=eth-balance --more=200

Test validation with predefined tests (params from examples.json file)

yarn test:validation --validation=basic

Test strategy with different parameters

Change values inside test/scores.ts and run

ts-node test/scores.ts

Checklist for adding a new voting strategy or validation strategy

Here is a simple checklist to look at when reviewing a PR for a new strategy:

Overview

Code

Example

Test

Recommended

License

MIT.