Skip to content

Grants General Documentation

grants is built upon EIP 1337.

specifically, it is built upon this smart contract which was audit'ed by ZKLabs in Q4 2018.

How Grants works

When you create a new grant at /grants/new, you are deploying a new version of this contract.

When you fund a new grant at /grants/<pk>/<slug>/fund, you are approve()ing a batch of ERC20 tokens to be sent, and you are signing a message that will be used to create recurring transactions down the line.

How are those transactions created, you say? Well, it's via a sub-miner....

Sub Miner

The subminer takes the signed message you created in the frontend (see above), and runs executeSubscription every periodSeconds interval.

Here's what it does in psuedocode:

iterate through all subscriptions:
    ready = contract.methods.isSubscriptionReady(..)
    if ready:

In order to run it, this is what you want to do:

./ subminer <network> <optional_live_flag>


./ subminer rinkeby --live

When you run this code, it looks through all of the active grants on your local on <network>, and then runs executeSubscription() on them. if executeSubscription() succeeds, it will trigger some other actions (mostly emails, db mutations, etc)

Heres an example successful tx created by the subminer:

More information

For more information on the subminer for grants, checkout