Create a validation strategy

Create a validation strategy and use it in your own space

To add your own voting validation strategy on Snapshot you need to fork the snapshot-strategies repository and create a pull request.

1. Navigate to the src\validations.

└── src
    └── validations
        └── basic

2. Create a copy of the basic strategy folder and rename it to the name of your voting validation.

3. Customize the logic of your voting validation.

If you are not sure about the Validation class, have a look at its definition:

The validation name has to be included in the index.ts in the validationClasses variable.

4. Test your validation

To make sure your validation passes all tests, run:

npm run test --validation=<VALIDATION NAME> // replace <VALIDATION NAME>

4. Make sure you pass the checklist

Have a look here on the requirements for adding a new validation strategy and make sure you full fill the points in the checklist:

5. Create a pull request

The team will then review your PR and after it's approved and merged it will be available to chose in your space settings.

Last updated