├── .gitbook └── assets │ ├── access-to-your-space-settings.png │ ├── add-a-strategy.png │ ├── add-admins-addresses.png │ ├── add-members-addresses.png │ ├── capture-de-cran-2020-12-30-a-09.33.58.png │ ├── capture-de-cran-2020-12-30-a-09.34.49.png │ ├── edit-a-strategy.png │ ├── image (2).png │ ├── image (6) (1).png │ ├── image.png │ ├── profile-settings.png │ ├── screenshot-179-.png │ ├── select-a-network.png │ ├── select-a-skin.png │ ├── set-your-ipns-link.png │ └── snapshot (1).gif ├── README.md ├── SUMMARY.md ├── archived ├── README.md ├── block-number.md └── create-a-space-github.md ├── contribute.md ├── details ├── README.md └── block-number.md ├── faq ├── README.md ├── contribution.md ├── delegation.md ├── graphql-api.md ├── integration.md ├── networks.md ├── plugins.md ├── proposals.md ├── snapshot.js.md ├── spaces.md ├── strategies.md ├── votes.md └── webhooks.md ├── graphql-api.md ├── graphql-api ├── README.md ├── get-a-single-proposal.md ├── get-proposals.md ├── get-single-vote.md └── get-votes.md ├── guides ├── add-a-custom-domain.md ├── add-a-skin.md ├── add-avatars.md ├── archived │ ├── README.md │ ├── add-avatar.md │ ├── block-number.md │ ├── create-a-space-github.md │ ├── error-messages.md │ └── hub-api.md ├── contribute │ ├── README.md │ └── support.md ├── create-a-proposal.md ├── create-a-space-github.md ├── create-a-space.md ├── custom-domain.md ├── delegation.md ├── details │ ├── README.md │ └── block-number.md ├── migrate-your-space-to-ens.md └── vote-for-a-proposal.md ├── networks.md ├── plugins ├── README.md ├── aragon.md ├── create.md ├── poap.md └── safesnap.md ├── proposals.md ├── proposals ├── README.md ├── create.md ├── vote.md └── voting-types.md ├── snapshot.js.md ├── spaces.md ├── spaces ├── README.md ├── add-avatar.md ├── add-custom-domain.md ├── add-skin.md ├── alternative-way-to-create-a-space.md ├── before-creating-your-space.md ├── create-a-space.md ├── create.md ├── migrate.md └── space-roles.md ├── strategies.md ├── strategies ├── README.md ├── create.md └── what-is-a-strategy.md └── webhooks.md /.gitbook/assets/access-to-your-space-settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metrox-eth/snapshot-docs/07c03c726f5ab3da39a441346fbfa9ce93007f7b/.gitbook/assets/access-to-your-space-settings.png -------------------------------------------------------------------------------- /.gitbook/assets/add-a-strategy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metrox-eth/snapshot-docs/07c03c726f5ab3da39a441346fbfa9ce93007f7b/.gitbook/assets/add-a-strategy.png -------------------------------------------------------------------------------- /.gitbook/assets/add-admins-addresses.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metrox-eth/snapshot-docs/07c03c726f5ab3da39a441346fbfa9ce93007f7b/.gitbook/assets/add-admins-addresses.png -------------------------------------------------------------------------------- /.gitbook/assets/add-members-addresses.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metrox-eth/snapshot-docs/07c03c726f5ab3da39a441346fbfa9ce93007f7b/.gitbook/assets/add-members-addresses.png -------------------------------------------------------------------------------- /.gitbook/assets/capture-de-cran-2020-12-30-a-09.33.58.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metrox-eth/snapshot-docs/07c03c726f5ab3da39a441346fbfa9ce93007f7b/.gitbook/assets/capture-de-cran-2020-12-30-a-09.33.58.png -------------------------------------------------------------------------------- /.gitbook/assets/capture-de-cran-2020-12-30-a-09.34.49.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metrox-eth/snapshot-docs/07c03c726f5ab3da39a441346fbfa9ce93007f7b/.gitbook/assets/capture-de-cran-2020-12-30-a-09.34.49.png -------------------------------------------------------------------------------- /.gitbook/assets/edit-a-strategy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metrox-eth/snapshot-docs/07c03c726f5ab3da39a441346fbfa9ce93007f7b/.gitbook/assets/edit-a-strategy.png -------------------------------------------------------------------------------- /.gitbook/assets/image (2).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metrox-eth/snapshot-docs/07c03c726f5ab3da39a441346fbfa9ce93007f7b/.gitbook/assets/image (2).png -------------------------------------------------------------------------------- /.gitbook/assets/image (6) (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metrox-eth/snapshot-docs/07c03c726f5ab3da39a441346fbfa9ce93007f7b/.gitbook/assets/image (6) (1).png -------------------------------------------------------------------------------- /.gitbook/assets/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metrox-eth/snapshot-docs/07c03c726f5ab3da39a441346fbfa9ce93007f7b/.gitbook/assets/image.png -------------------------------------------------------------------------------- /.gitbook/assets/profile-settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metrox-eth/snapshot-docs/07c03c726f5ab3da39a441346fbfa9ce93007f7b/.gitbook/assets/profile-settings.png -------------------------------------------------------------------------------- /.gitbook/assets/screenshot-179-.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metrox-eth/snapshot-docs/07c03c726f5ab3da39a441346fbfa9ce93007f7b/.gitbook/assets/screenshot-179-.png -------------------------------------------------------------------------------- /.gitbook/assets/select-a-network.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metrox-eth/snapshot-docs/07c03c726f5ab3da39a441346fbfa9ce93007f7b/.gitbook/assets/select-a-network.png -------------------------------------------------------------------------------- /.gitbook/assets/select-a-skin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metrox-eth/snapshot-docs/07c03c726f5ab3da39a441346fbfa9ce93007f7b/.gitbook/assets/select-a-skin.png -------------------------------------------------------------------------------- /.gitbook/assets/set-your-ipns-link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metrox-eth/snapshot-docs/07c03c726f5ab3da39a441346fbfa9ce93007f7b/.gitbook/assets/set-your-ipns-link.png -------------------------------------------------------------------------------- /.gitbook/assets/snapshot (1).gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metrox-eth/snapshot-docs/07c03c726f5ab3da39a441346fbfa9ce93007f7b/.gitbook/assets/snapshot (1).gif -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Home 2 | 3 | ## **Welcome to** Snapshot**!** 4 | 5 | This page is intended to give you a brief explanation of what Snapshot is and how it works. It also provides you with all the necessary information to get started. 6 | 7 | ### **Introduction** 8 | 9 | Snapshot is a decentralized voting system. It provides flexibility on how voting power is calculated for vote. Snapshot supports various voting types to cater to the needs of organizations. Creating proposals and voting on Snapshot is user friendly and does not cost any gas as the process is performed off-chain. In short, Snapshot is an off-chain gasless multi-governance client with easy to verify and hard to contest results. _\*\*_ 10 | 11 | ### **Key features** 12 | 13 | * **Creating a proposal and voting is free** 14 | * **Votes are signed message easily verifiable online** 15 | * **Flexible voting strategies, vote with ERC20s, NFTs, or any contract** 16 | * **Multiple voting system, single choice, approval voting, quadratic voting and more** 17 | * **Spaces can have their custom skin and domain name** 18 | * **Fully open source with MIT license** 19 | 20 | {% page-ref page="spaces/" %} 21 | 22 | {% page-ref page="proposals/" %} 23 | 24 | {% page-ref page="guides/contribute/" %} 25 | 26 | ### **What’s next?** 27 | 28 | Our next guide will take you through the steps of creating a space on Snapshot. It will also take you through the process of registering an ENS domain if you do not have one already. Before you start creating a space, you might want to look into some spaces already created on Snapshot. 29 | 30 | > _We have limited resources so feel free to contribute with code, code review, design, bug reports, advices, documentation, or anything else you are good at._ 31 | 32 | -------------------------------------------------------------------------------- /SUMMARY.md: -------------------------------------------------------------------------------- 1 | # Table of contents 2 | 3 | * [Home](README.md) 4 | * [Spaces](spaces/README.md) 5 | * [Before creating your space](spaces/before-creating-your-space.md) 6 | * [Create a space](spaces/create.md) 7 | * [Alternative way to create a space](spaces/alternative-way-to-create-a-space.md) 8 | * [Migrate your space to ENS](spaces/migrate.md) 9 | * [Add a skin](spaces/add-skin.md) 10 | * [Add a custom domain](spaces/add-custom-domain.md) 11 | * [Space roles](spaces/space-roles.md) 12 | * [Proposals](proposals/README.md) 13 | * [Create a proposal](proposals/create.md) 14 | * [Vote on a proposal](proposals/vote.md) 15 | * [Voting types](proposals/voting-types.md) 16 | * [Strategies](strategies/README.md) 17 | * [What is a strategy?](strategies/what-is-a-strategy.md) 18 | * [Create a new strategy](strategies/create.md) 19 | * [Plugins](plugins/README.md) 20 | * [Create a plugin](plugins/create.md) 21 | * [SafeSnap](plugins/safesnap.md) 22 | * [POAP](plugins/poap.md) 23 | * [Aragon Agreements](plugins/aragon.md) 24 | * [Networks](networks.md) 25 | * [GraphQL API](graphql-api.md) 26 | * [Webhooks](webhooks.md) 27 | * [Snapshot.js](snapshot.js.md) 28 | * [FAQs](faq/README.md) 29 | * [Spaces](faq/spaces.md) 30 | * [Proposals](faq/proposals.md) 31 | * [Votes](faq/votes.md) 32 | * [Strategies](faq/strategies.md) 33 | * [Delegation](faq/delegation.md) 34 | * [Plugins](faq/plugins.md) 35 | * [Networks](faq/networks.md) 36 | * [Contribution](faq/contribution.md) 37 | * [Integration](faq/integration.md) 38 | * [GraphQL API](faq/graphql-api.md) 39 | * [Webhooks](faq/webhooks.md) 40 | * [Snapshot.js](faq/snapshot.js.md) 41 | 42 | ## Guides 43 | 44 | * [Contribute](guides/contribute/README.md) 45 | * [🙋‍♂️ Support](guides/contribute/support.md) 46 | * [Delegation](guides/delegation.md) 47 | * [Archived](guides/archived/README.md) 48 | * [Rest API](guides/archived/hub-api.md) 49 | * [Snapshot block number](guides/archived/block-number.md) 50 | * [Add an avatar](guides/archived/add-avatar.md) 51 | * [Create a space \(on GitHub\)](guides/archived/create-a-space-github.md) 52 | * [Error messages](guides/archived/error-messages.md) 53 | 54 | -------------------------------------------------------------------------------- /archived/README.md: -------------------------------------------------------------------------------- 1 | # Archived 2 | 3 | -------------------------------------------------------------------------------- /archived/block-number.md: -------------------------------------------------------------------------------- 1 | # Snapshot block number 2 | 3 | Block number is important, to lock the state of community members who are able to vote. Meaning that if you attempt to vote on a proposal and block number is in the past, and you weren't holding required token yet, your vote will not be counted. 4 | 5 | Explained in depth: 6 | 7 | `H = h + ((t1 — t0) / a)` 8 | 9 | Where: 10 | 11 | * `H` = target block height 12 | * `h` = current block height 13 | * `t0` = current timestamp \(in seconds\) 14 | * `t1` = target timestamp \(in seconds\) 15 | * `a` = average time to solve a block \(in seconds\) 16 | 17 | Or... 18 | 19 | `last_block_number + ((future_time - time_now) / block_time)` 20 | 21 | So, for example, using a [current epoch time](https://www.epochconverter.com) of 1481214124, the epoch time of 1482537600 for midnight Christmas Eve, and the last block of 2771338: 22 | 23 | `2771338 + ((1482537600 - 1481214124) / 14) = 2865872` 24 | 25 | -------------------------------------------------------------------------------- /archived/create-a-space-github.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Create your own space on Snapshot! 3 | --- 4 | 5 | # Create a space \(on GitHub\) 6 | 7 | ### **1: Fork Snapshot spaces repository here** 8 | 9 | {% embed url="https://github.com/bonustrack/snapshot-spaces" caption="" %} 10 | 11 | {% hint style="info" %} 12 | **Update your fork with the original repo using Git** 13 | 14 | If you have already forked a space, you must update your repo before submitting changes. 15 | 16 | Use the 4 commands below to sync your forked repository with the original repository. 17 | {% endhint %} 18 | 19 | ```text 20 | git remote add master https://github.com/snapshot-labs/snapshot-spaces.git 21 | git fetch master 22 | git checkout master 23 | git merge master/master 24 | ``` 25 | 26 | ### **2: Copy the space "example" folder** 27 | 28 | {% embed url="https://github.com/bonustrack/snapshot-spaces/tree/master/spaces/example" caption="" %} 29 | 30 | ```text 31 | |-- spaces 32 | |-- example 33 | |-- index.json 34 | |-- logo.png 35 | |-- space.png 36 | |-- skins (optional) 37 | |-- example.scss (optional) 38 | ``` 39 | 40 | ### **3: Space metadata** 41 | 42 | Note that your path folder name will be the name that will show on the snapshot link: 43 | 44 | * https://snapshot.page/\#/**your-space** 45 | 46 | Example: `index.json` 47 | 48 | ```javascript 49 | { 50 | "name": "Your Space", // Name of your space (max 20 chars) 51 | "network": "1", // What network you are on? (if on Ethereum it is "1", for other check: https://docs.snapshot.page/networks) 52 | "symbol": "SYMBOL", // Your main token symbol 53 | "skin": "your-space", // Copy skin filename "example.scss" located at "/skins" folder and renaming it to "your-space.scss" 54 | "domain": "vote.yourdomain.com", // Add your voting/governance subdomain if you have one 55 | "strategies": [ // Strategies 56 | { 57 | "name": "erc20-balance-of", // Strategy name 58 | "params": { // Strategy parameters 59 | "address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", // Address of the base token 60 | "symbol": "SYMBOL", // Symbol of the base token 61 | "decimals": 18 // Decimals of the base token 62 | } 63 | } 64 | ], 65 | "members": [ // List of official addresses that can post in "Core" tab of the space 66 | "0xeF8305E140ac520225DAf050e2f71d5fBcC543e7" // Core member address 67 | ], 68 | "filters": { // Filters 69 | "defaultTab": "all", // The default tab for the space 70 | "minScore": 123, // Minimum balance from the base token that a user should have to show his proposal in the space (unless the address is a core address) 71 | "onlyMembers": true // Shows only core tab and core proposals 72 | "invalids": [ // List of proposals IDs (use this to remove a proposal from your space) 73 | "QmXAZP8tYwX2zZz5EzfxLZUYJt6TM9EmxY1L4qodhZ5zcZ", 74 | "QmXAZV8tYwX2zZz5EzfxLZUYJt6TM9EmxY1L4qodhZ5lbL" 75 | ] 76 | } 77 | } 78 | ``` 79 | 80 | #### **R**equired **fields:** `token, name, network, symbol, strategies` 81 | 82 | ### **4: Add a logo and space images** 83 | 84 | 1. You must add both `logo.png` and `space.png` images for your space with a size of 256 x 256 pixels. 85 | 2. The file size should not exceed `50KB`. 86 | 87 | ### **5: Create a skin \(optional\)** 88 | 89 | 1. To create your own skin go to the `/skins` folder. 90 | 2. Copy `example.scss` change the name to what you like \(prefferably your space name\). 91 | 3. Change the colors, then make sure both the `scss` file and its class name are the same. 92 | 4. Exampe: your file is `your-space.scss` class name should be `.your-space` 93 | 5. Include your skin name in the `index.json` file as: `"skin": "your-space"` 94 | 6. Save it in `/skins` folder. 95 | 96 | Example: `your-space.scss` 97 | 98 | ```css 99 | .your-space { 100 | --primary-color: #384aff; 101 | --bg-color: white; 102 | --text-color: #586069; 103 | --link-color: #111111; 104 | --heading-color: #111111; 105 | --border-color: #d1d5da; 106 | --header-bg: white; 107 | --block-bg: transparent; 108 | } 109 | ``` 110 | 111 | ### **6: Make sure everything is ready** 112 | 113 | Your files should something like this: 114 | 115 | ```text 116 | |-- spaces 117 | |-- your-space 118 | |-- index.json 119 | |-- logo.png 120 | |-- space.png 121 | |-- skins (optional) 122 | |-- your-space.scss (optional) 123 | ``` 124 | 125 | ### **7: Make a pull request** 126 | 127 | * Please name your PR title on the model `Add SYMBOL space` 128 | * It may take 1 or 2 days to get your PR reviewed, merged and appear on Snapshot. 129 | 130 | -------------------------------------------------------------------------------- /contribute.md: -------------------------------------------------------------------------------- 1 | # Contribute 2 | 3 | ### Roadmap 4 | 5 | {% embed url="https://github.com/balancer-labs/snapshot/projects/1?fullscreen=true" %} 6 | 7 | ### Bug reports 8 | 9 | {% embed url="https://github.com/balancer-labs/snapshot/issues/new" %} 10 | 11 | ### Feature request 12 | 13 | {% embed url="https://github.com/balancer-labs/snapshot/issues/new" %} 14 | 15 | ### Snapshot client 16 | 17 | {% embed url="https://github.com/balancer-labs/snapshot" caption="" %} 18 | 19 | ### Tech stack 20 | 21 | {% embed url="https://snapshot.page/report.html" %} 22 | 23 | ### Snapshot hub 24 | 25 | {% embed url="https://github.com/balancer-labs/snapshot-hub" caption="" %} 26 | 27 | ### Snapshot docs 28 | 29 | {% embed url="https://github.com/bonustrack/snapshot-docs" caption="" %} 30 | 31 | ### Lock.js 32 | 33 | {% embed url="https://github.com/bonustrack/lock" caption="" %} 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /details/README.md: -------------------------------------------------------------------------------- 1 | # Details 2 | 3 | Detailed information usually will 4 | 5 | -------------------------------------------------------------------------------- /details/block-number.md: -------------------------------------------------------------------------------- 1 | # Block Number 2 | 3 | Block number is important, to lock the state of community members who are able to vote. Meaning that if you attempt to vote on a proposal and block number is in the past, and you weren't holding required token yet, your vote will not be counted. 4 | 5 | Explained in depth: 6 | 7 | `H = h + ((t1 — t0) / a)` 8 | 9 | Where: 10 | 11 | * `H` = target block height 12 | * `h` = current block height 13 | * `t0` = current timestamp \(in seconds\) 14 | * `t1` = target timestamp \(in seconds\) 15 | * `a` = average time to solve a block \(in seconds\) 16 | 17 | Or... 18 | 19 | `last_block_number + ((future_time - time_now) / block_time)` 20 | 21 | So, for example, using a [current epoch time](https://www.epochconverter.com) of 1481214124, the epoch time of 1482537600 for midnight Christmas Eve, and the last block of 2771338: 22 | 23 | `2771338 + ((1482537600 - 1481214124) / 14) = 2865872` 24 | 25 | -------------------------------------------------------------------------------- /faq/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Use the categories on the right sidebar or search through the entire FAQ. 3 | --- 4 | 5 | # FAQs 6 | 7 | ## Spaces 8 | 9 | ### How can I access my space or the demo space on snapshot? 10 | 11 | Snapshot live: `http://snapshot.org/#/` 12 | Snapshot demo: `http://demo.snapshot.org/#/` 13 | 14 | 15 | 16 | ### How can I get my space showing on the Snapshot homepage? 17 | 18 | If you already have a space with GitHub see how to Migrate your space to ENS. 19 | 20 | {% page-ref page="../spaces/migrate.md" %} 21 | 22 | If you want to create a new space with ENS 23 | 24 | {% page-ref page="../spaces/create.md" %} 25 | 26 | 27 | 28 | ### **What's the difference between admin and authors** 29 | 30 | * `Admins` can edit `space settings` 31 | * `Authors` can post `proposals` 32 | 33 | 34 | 35 | ## Proposals 36 | 37 | ### Can I edit a proposal once I posted it ? 38 | 39 | Nope, you can delete it and make a new one. You can also duplicate it, that will prefill all the fields. 40 | 41 | 42 | 43 | ### Why I can't save my proposal ? 44 | 45 | * Make sure you filled "Question" and "What is you proposal" placeholders. 46 | * Make sure you've added at least two choices. 47 | * Make sure you've selected a set of actions for voting system, start and end date. 48 | * Make sure to enter a "snapshot block number" 49 | 50 | If you still cant's save your proposal contact us on [Discord](http://discord.snapshot.org) or [Telegram](https://t.me/snapshotlabs) 51 | 52 | 53 | 54 | ### Can I create different types of proposals like "core" and "community"? 55 | 56 | If a proposal is created by an `Author` \(added in `space settings`\) it will be shown as `core` proposal. 57 | All other proposal are community proposals. 58 | 59 | 60 | 61 | ## Votes 62 | 63 | ### **Why I can't vote?** 64 | 65 | To be able to vote you need voting power, your voting power is calculated at the "snapshot" of the proposal. The snapshot is the block number where we read the voting power from. If you didn't have the tokens at this block number, you will not have any voting power and won't be able to vote. 66 | 67 | 68 | 69 | ### **I am getting an error "wrong timestamp", what is the problem?** 70 | 71 | Most likely the issue is that your computer time is not synchronized with the internet time. This is how to fix this: 72 | 73 | **On MacOS** 74 | On your Mac, choose Apple menu > System Preferences, then click Date & Time. 75 | Click Date & Time, then set the date and time automatically. 76 | 77 | [![MacOS](https://user-images.githubusercontent.com/55286013/135220574-a1c1ff59-e12a-4ba1-b234-6ebed9140f69.png)](https://user-images.githubusercontent.com/55286013/135220574-a1c1ff59-e12a-4ba1-b234-6ebed9140f69.png) 78 | 79 | **On Windows** 80 | Go to Start > Settings > Time & language > Date & time. 81 | Then set time automatically 82 | 83 | [![Windows](https://user-images.githubusercontent.com/55286013/135220660-b6384c2d-a247-44af-ad06-b5429633a74e.png)](https://user-images.githubusercontent.com/55286013/135220660-b6384c2d-a247-44af-ad06-b5429633a74e.png) 84 | 85 | 86 | 87 | ## Strategies 88 | 89 | ### What strategy should I use for my proposal 90 | 91 | It widely depends on your use case, if you want coin-voting \(1 token= 1 vote\) you can use "erc20-balance-of", however you may want: 92 | 93 | * Delegate voting power using a delegation strategy 94 | * Weighting voting power using a quadratic strategy 95 | * NFT voting with an ERC-721 based strategy 96 | * Only allow certain members to vote using whitelist strategy 97 | * Calculate voting power from multiple chains with multichain strategy 98 | 99 | You can combine up to 5 strategies on a single proposal \(combination work as OR not AND opperator\) 100 | 101 | At the time of writing snapshot has over 150 voting strategies. 102 | Explore them here [https://snapshot.org/\#/strategies](https://snapshot.org/#/strategies) 103 | You can even preview actions using the playground button. 104 | 105 | 106 | 107 | ### I have updated my strategy, when the changes will take effect ? 108 | 109 | Your changes will only affect future proposals, already existing proposals can not be edited. 110 | 111 | 112 | 113 | ### May I use multiple chains / networks strategies in my proposals ? 114 | 115 | Yes you can use multi-chain strategy in your space, which can calculate voting power from multiple networks. Check this out: [https://snapshot.org/\#/strategy/multichain](https://snapshot.org/#/strategy/multichain) 116 | 117 | 118 | 119 | ### What is the decimal parameter ? 120 | 121 | * When you create a token you have to define the number of decimal that you want 122 | * Most of the token use 18 decimals 123 | * To find out how many decimals your token has you can search the contract address on etherscan.io 124 | 125 | 126 | 127 | ### What is the address parameter ? 128 | 129 | In order to setup a coin-voting strategy i.e. `erc20-balance-of` you need to change the placeholder address to your own token contract address. 130 | 131 | ## Delegation 132 | 133 | ## Networks 134 | 135 | ## Contribution 136 | 137 | ## API 138 | 139 | 140 | 141 | 142 | 143 | {% page-ref page="spaces.md" %} 144 | 145 | -------------------------------------------------------------------------------- /faq/contribution.md: -------------------------------------------------------------------------------- 1 | # Contribution 2 | 3 | ## **I pushed my PR, when do you check it and what time it will be live?** 4 | 5 | Usually snapshot checks and follows through PRs every 24 to 48h, if you submitted yours and snapshot did not get back to you within this time limit, please chat with us on [**Discord**](https://discord.gg/dDbNGZe) or [**Telegram**](https://t.me/snapshotlabs)**.** 6 | 7 | ## 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /faq/delegation.md: -------------------------------------------------------------------------------- 1 | # Delegation 2 | 3 | ## **When I added delegation, it appears to not allow anyone to vote.** 4 | 5 | Delegation strategy syntax example: 6 | 7 | ```text 8 | { 9 | "symbol": "Shark", 10 | "strategies": [ 11 | { 12 | "name": "erc20-balance-of", 13 | "params": { 14 | "address": "0x232a...", 15 | "symbol": "Shark", 16 | "decimals": 18 17 | } 18 | } 19 | ] 20 | } 21 | ``` 22 | 23 | if you pass something like this, it will calculate balance of this token 0x232a... that delegated to an address 24 | 25 | ## 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /faq/graphql-api.md: -------------------------------------------------------------------------------- 1 | # GraphQL API 2 | 3 | ## I want to get all the voters from a space Is there any easy way to do this? 4 | 5 | There is an API endpoint to get the list of all voters per space\(s\) and period see the last one, "List voters" [https://docs.snapshot.page/hub-api\#get-a-proposal](https://docs.snapshot.page/hub-api#get-a-proposal) 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /faq/integration.md: -------------------------------------------------------------------------------- 1 | # Integration 2 | 3 | -------------------------------------------------------------------------------- /faq/networks.md: -------------------------------------------------------------------------------- 1 | # Networks 2 | 3 | ## Can I use ENS domain on testnet ? 4 | 5 | The ENS domain must be on mainnet, then on Snapshot settings page you can use any network for your space 6 | 7 | ## Can I use snapshot on non-EVM chains like Solana ? 8 | 9 | Currently, Snapshot only support EVM chains, if you are looking to use it with Solana look at Neon cross-chain EVM. 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /faq/plugins.md: -------------------------------------------------------------------------------- 1 | # Plugins 2 | 3 | ## Can I become who I want to be? 4 | 5 | That's a tough question but thankfully, our team is on it. Please bear with us while we're investigating. 6 | 7 | ## Have you had a chance to answer the previous question? 8 | 9 | Yes, after a few months we finally found the answer. Sadly, Mike is on vacations right now so I'm afraid we are not able to provide the answer at this point. 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /faq/proposals.md: -------------------------------------------------------------------------------- 1 | # Proposals 2 | 3 | ## Can I edit a proposal once I posted it ? 4 | 5 | No, you can only delete it and make a new one. 6 | 7 | ## Why I can't save my proposal ? 8 | 9 | * Make sure you filled "Question" and "What is you proposal" placeholders. 10 | * Make sure you've added at least two choices. 11 | * Make sure you've selected a set of actions for voting system, start and end date. 12 | 13 | If you still cant's save your proposal contact us on Discord or Telegram 14 | 15 | ## Can I create different types of proposals like "core" and "community"? 16 | 17 | If the proposal is created by a member \(added from settings\) it will be shown as `core` all other are community. 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /faq/snapshot.js.md: -------------------------------------------------------------------------------- 1 | # Snapshot.js 2 | 3 | -------------------------------------------------------------------------------- /faq/spaces.md: -------------------------------------------------------------------------------- 1 | # Spaces 2 | 3 | ## **How can I access my space or the demo space on snapshot?** 4 | 5 | * Snapshot live: `http://snapshot.page/#/` 6 | * Snapshot demo: `http://demo.snapshot.page/#/` 7 | 8 | ## **How can I get my space showing on the Snapshot homepage?** 9 | 10 | {% page-ref page="../spaces/create.md" %} 11 | 12 | ## **I went to** `https://snapshot.page/#/` **but I see a blank page?** 13 | 14 | * Make sure you are connected with Metamask on the ETH mainnet. 15 | * Try with Chrome or Firefox browser. 16 | 17 | ## **I can't save my space settings** 18 | 19 | * Make sure you have filled all the required fields. 20 | * If "Terms" field is required make sure the format is `http://` or `https://` 21 | 22 | 23 | 24 | ## **What's the difference between admin and authors** 25 | 26 | Admin can edit space settings, authors can post proposals. 27 | 28 | -------------------------------------------------------------------------------- /faq/strategies.md: -------------------------------------------------------------------------------- 1 | # Strategies 2 | 3 | ## What strategy should I use for my proposal 4 | 5 | It widely depends on your use case, if you want coin-voting \(1 token= 1 vote\) you can use "erc20-balance-of", however you may want: 6 | 7 | * Delegate voting power using a delegation strategy 8 | * Weighting voting power using a quadratic strategy 9 | * NFT voting with an ERC-721 based strategy 10 | * Only allow certain members to vote using whitelist strategy 11 | * Calculate voting power from multiple chains with multichain strategy 12 | 13 | You can combine up to 5 strategies on a single proposal 14 | 15 | At the time of writing snapshot has over 150 voting strategies. Explore them here [https://snapshot.org/\#/strategies](https://snapshot.org/#/strategies) 16 | You can even preview actions using the playground button. 17 | 18 | ## I have updated my strategy, when the changes will take effect ? 19 | 20 | Once a proposal is created, if you change strategies, it will take effect from next proposal - It will not affect previous proposal. 21 | 22 | ## May I use multiple chains / networks in my space ? 23 | 24 | Yes you can use multi-chain strategy in your space, which can calculate voting power from multiple networks. 25 | 26 | ## What is the decimal parameter ? 27 | 28 | * When you create a token you have to define the number of decimal that you want 29 | * Most of the token use 18 decimals 30 | 31 | ## What is the address parameter ? 32 | 33 | In order to setup a coin-voting strategy i.e. "erc20-balance-of" you need to change the placeholder address to your own token ERC-20 address. 34 | 35 | ## Can I deploy my own token on Snapshot 36 | 37 | Not yet, you need to create your token on another platform. 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /faq/votes.md: -------------------------------------------------------------------------------- 1 | # Votes 2 | 3 | ## **Why I can't vote?** 4 | 5 | To be able to vote you need voting power, your voting power is calculated at the "snapshot" of the proposal. The snapshot is the block number where the voting power matter, if you don't have any token at this block number you will not have any voting power and won't be able to vote. 6 | 7 | ## **I am getting an error "wrong timestamp", what is the problem?** 8 | 9 | Most likely the issue is that your computer time is not synchronized with the internet time. This is how to fix this: 10 | 11 | ### On MacOS 12 | 13 | 1. On your Mac, choose Apple menu > System Preferences, then click Date & Time. 14 | 2. Click Date & Time, then set the date and time automatically. 15 | 16 | ![](../.gitbook/assets/image%20%286%29%20%281%29.png) 17 | 18 | ### On Windows 19 | 20 | 1. Go to Start > Settings > Time & language > Date & time. 21 | 2. Then set time automatically. 22 | 23 | ![](../.gitbook/assets/image%20%282%29.png) 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /faq/webhooks.md: -------------------------------------------------------------------------------- 1 | # Webhooks 2 | 3 | -------------------------------------------------------------------------------- /graphql-api.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: >- 3 | You can use the GraphQL API to create flexible queries for the data you need 4 | to integrate with Snapshot. 5 | --- 6 | 7 | # GraphQL API 8 | 9 | ## Explorer 10 | 11 | You can run queries on real Snapshot data using the GraphQL Explorer, an integrated development environment in your browser that includes docs, syntax highlighting, and validation errors. Try here: 12 | 13 | {% embed url="https://hub.snapshot.org/graphql" caption="" %} 14 | 15 | ![](.gitbook/assets/image.png) 16 | 17 | ## Endpoints 18 | 19 | Production hub 20 | 21 | ```text 22 | https://hub.snapshot.org/graphql 23 | ``` 24 | 25 | Demo hub 26 | 27 | ```text 28 | https://testnet.snapshot.org/graphql 29 | ``` 30 | 31 | ## Queries 32 | 33 | ### Get a single space 34 | 35 | #### Arguments 36 | 37 | id `string` 38 | 39 | #### Example 40 | 41 | {% tabs %} 42 | {% tab title="Request" %} 43 | ```graphql 44 | query { 45 | space(id: "yam.eth") { 46 | id 47 | name 48 | about 49 | network 50 | symbol 51 | members 52 | } 53 | } 54 | ``` 55 | {% endtab %} 56 | 57 | {% tab title="Response" %} 58 | ```javascript 59 | { 60 | "data": { 61 | "space": { 62 | "id": "yam.eth", 63 | "name": "Yam Finance", 64 | "about": "", 65 | "network": "1", 66 | "symbol": "YAM", 67 | "members": [ 68 | "0x683A78bA1f6b25E29fbBC9Cd1BFA29A51520De84", 69 | "0x9Ebc8AD4011C7f559743Eb25705CCF5A9B58D0bc", 70 | "0xC3edCBe0F93a6258c3933e86fFaA3bcF12F8D695", 71 | "0xbdac5657eDd13F47C3DD924eAa36Cf1Ec49672cc", 72 | "0xEC3281124d4c2FCA8A88e3076C1E7749CfEcb7F2" 73 | ] 74 | } 75 | } 76 | } 77 | ``` 78 | {% endtab %} 79 | {% endtabs %} 80 | 81 | Try on [GraphiQL](https://hub.snapshot.org/graphql?query=query%20%7B%0A%20%20space%28id%3A%20%22yam.eth%22%29%20%7B%0A%20%20%20%20id%0A%20%20%20%20name%0A%20%20%20%20about%0A%20%20%20%20network%0A%20%20%20%20symbol%0A%20%20%20%20members%0A%20%20%7D%0A%7D) 82 | 83 | ### Get multiple spaces 84 | 85 | #### Arguments 86 | 87 | first `number` 88 | skip `number` 89 | where: 90 | 91 | * id`string` 92 | * id\_in`array` 93 | 94 | orderBy `string` 95 | 96 | orderDirection `asc` or `desc` 97 | 98 | #### Example 99 | 100 | {% tabs %} 101 | {% tab title="Request" %} 102 | ```graphql 103 | query { 104 | spaces( 105 | first: 20, 106 | skip: 0, 107 | orderBy: "created", 108 | orderDirection: asc 109 | ) { 110 | id 111 | name 112 | about 113 | network 114 | symbol 115 | strategies { 116 | name 117 | params 118 | } 119 | admins 120 | members 121 | filters { 122 | minScore 123 | onlyMembers 124 | } 125 | plugins 126 | } 127 | } 128 | ``` 129 | {% endtab %} 130 | 131 | {% tab title="Response" %} 132 | ```javascript 133 | { 134 | "data": { 135 | "spaces": [ 136 | { 137 | "id": "bonustrack.eth", 138 | "name": "Fabien", 139 | "about": "", 140 | "network": "1", 141 | "symbol": "TICKET", 142 | "strategies": [ 143 | { 144 | "name": "erc20-balance-of", 145 | "params": { 146 | "symbol": "DAI", 147 | "address": "0x6B175474E89094C44Da98b954EedeAC495271d0F", 148 | "decimals": 18 149 | } 150 | } 151 | ], 152 | "admins": [], 153 | "members": [ 154 | "0x24A12Fa313F57aF541d447c594072A992c605DCf" 155 | ], 156 | "filters": { 157 | "minScore": 0, 158 | "onlyMembers": false 159 | }, 160 | "plugins": { 161 | "quorum": { 162 | "total": 500, 163 | "strategy": "static" 164 | } 165 | } 166 | } 167 | ] 168 | } 169 | } 170 | ``` 171 | {% endtab %} 172 | {% endtabs %} 173 | 174 | Try on [GraphiQL](https://hub.snapshot.org/graphql?query=%0Aquery%20Spaces%20%7B%0A%20%20spaces%28%0A%20%20%20%20first%3A%2020%2C%0A%20%20%20%20skip%3A%200%2C%0A%20%20%20%20orderBy%3A%20%22created%22%2C%0A%20%20%20%20orderDirection%3A%20asc%0A%20%20%29%20%7B%0A%20%20%20%20id%0A%20%20%20%20name%0A%20%20%20%20about%0A%20%20%20%20network%0A%20%20%20%20symbol%0A%20%20%20%20strategies%20%7B%0A%20%20%20%20%20%20name%0A%20%20%20%20%20%20params%0A%20%20%20%20%7D%0A%20%20%20%20admins%0A%20%20%20%20members%0A%20%20%20%20filters%20%7B%0A%20%20%20%20%20%20minScore%0A%20%20%20%20%20%20onlyMembers%0A%20%20%20%20%7D%0A%20%20%20%20plugins%0A%20%20%7D%0A%7D) 175 | 176 | ### Get a single proposal 177 | 178 | #### Arguments 179 | 180 | id `string`‌ 181 | 182 | #### Example 183 | 184 | {% tabs %} 185 | {% tab title="Request" %} 186 | ```graphql 187 | query { 188 | proposal(id:"QmWbpCtwdLzxuLKnMW4Vv4MPFd2pdPX71YBKPasfZxqLUS") { 189 | id 190 | title 191 | body 192 | choices 193 | start 194 | end 195 | snapshot 196 | state 197 | author 198 | created 199 | plugins 200 | network 201 | strategies { 202 | name 203 | params 204 | } 205 | space { 206 | id 207 | name 208 | } 209 | } 210 | } 211 | ``` 212 | {% endtab %} 213 | 214 | {% tab title="Response" %} 215 | ```javascript 216 | { 217 | "data": { 218 | "proposal": { 219 | "id": "QmWbpCtwdLzxuLKnMW4Vv4MPFd2pdPX71YBKPasfZxqLUS", 220 | "title": "Select Initial Umbrella Metapool", 221 | "body": "Eventually, we hope that anyone will be able to create a metapool and fund a protection market for their project, but right now we want to start small and pick one pool that we will debut as a beta launch for Umbrella that will help us gather information and insight into the state of the market. In the future we can have all of these and more. Here are the choices:\n### Option 1: BlueChips MetaPool\n\nYou might consider this the safest of the pools. It contains a collection of different “blue-chip projects” across multiple verticals that have proven track records and are considered industry leaders. These include:\n\n* (3) Bluechip protocols: MakerDAO, Compound, and Uniswap. These are commonly seen as the most battletested and trusted DeFi projects on Ethereum.\n* (2) Centralized exchanges: Coinbase and Binance. These are the most popular and generally considered to be most reputable exchanges around. *note: Payout occurs only if Safu funds or the exchange’s insurance do not cover losses.\n* (2) Hardware Wallet companies, Ledger and Trezor, including the Ledger Nano S and X, and the Trezor Model T and One. This would cover large scale exploits in their hardware or firmware and would not cover individual loss due to phishing or poor security.\n\n### Option 2: Hot New Projects MetaPool\n\nThis pool targets newer projects on Ethereum that are considered reputable and have high TVL but are less battle tested and therefore may be more risky. While they may be more risky, this may mean that there is more demand for coverage for them in the market. This list is preliminary but internal discussions considered including:\n\n * Alchemix\n* OHM\n* Liquity\n* FEI\n* Integral\n* Reflexer\n\n### Option 3: Integrated DegenV2 MetaPool\n\nThis last option focuses more closely on YAM products, specifically DegenV2 and the constituent protocols that it uses. This option would let us insure our own users and potentially test out our products in a more limited environment. The covered protocols would be:\n\n * UMA\n * Sushiswap/Uniswap depending on where our pools live\n * Any YAM contracts that are used\n * Any future contracts included in future versions of Degen.\n\n### Choose wisely!\n", 222 | "choices": [ 223 | "Option 1: BlueChips MetaPool", 224 | "Option 2: Hot New Projects MetaP", 225 | "Option 3: Integrated DegenV2 Met" 226 | ], 227 | "start": 1620676800, 228 | "end": 1620806400, 229 | "snapshot": "12408670", 230 | "state": "closed", 231 | "author": "0xEC3281124d4c2FCA8A88e3076C1E7749CfEcb7F2", 232 | "space": { 233 | "id": "yam.eth", 234 | "name": "Yam Finance" 235 | } 236 | } 237 | } 238 | } 239 | ``` 240 | {% endtab %} 241 | {% endtabs %} 242 | 243 | Try on [GraphiQL](https://hub.snapshot.org/graphql?operationName=Proposal&query=query%20Proposal%20%7B%0A%20%20proposal%28id%3A%22QmWbpCtwdLzxuLKnMW4Vv4MPFd2pdPX71YBKPasfZxqLUS%22%29%20%7B%0A%20%20%20%20id%0A%20%20%20%20title%0A%20%20%20%20body%0A%20%20%20%20choices%0A%20%20%20%20start%0A%20%20%20%20end%0A%20%20%20%20snapshot%0A%20%20%20%20state%0A%20%20%20%20author%0A%20%20%20%20space%20%7B%0A%20%20%20%20%20%20id%0A%20%20%20%20%20%20name%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D) 244 | 245 | ### Get proposals 246 | 247 | #### Arguments 248 | 249 | first `number` 250 | skip `number` 251 | where: 252 | 253 | * id`string` 254 | * id\_in`array` 255 | * space:`string` 256 | * space\_in:`array` 257 | * author:`string` 258 | * author\_in:`array` 259 | * network: `string` 260 | * network\_in: `array` 261 | * state: `array` 262 | 263 | orderBy `string` 264 | 265 | orderDirection `asc` or `desc` 266 | 267 | #### Example 268 | 269 | {% tabs %} 270 | {% tab title="Request" %} 271 | ```graphql 272 | query { 273 | proposals ( 274 | first: 20, 275 | skip: 0, 276 | where: { 277 | space_in: ["yam.eth"], 278 | state: "closed" 279 | }, 280 | orderBy: "created", 281 | orderDirection: desc 282 | ) { 283 | id 284 | title 285 | body 286 | choices 287 | start 288 | end 289 | snapshot 290 | state 291 | author 292 | space { 293 | id 294 | name 295 | } 296 | } 297 | } 298 | ``` 299 | {% endtab %} 300 | 301 | {% tab title="Response" %} 302 | ```javascript 303 | { 304 | "data": { 305 | "proposals": [ 306 | { 307 | "id": "QmWbpCtwdLzxuLKnMW4Vv4MPFd2pdPX71YBKPasfZxqLUS", 308 | "title": "Select Initial Umbrella Metapool", 309 | "body": "Eventually, we hope that anyone will be able to create a metapool and fund a protection market for their project, but right now we want to start small and pick one pool that we will debut as a beta launch for Umbrella that will help us gather information and insight into the state of the market. In the future we can have all of these and more. Here are the choices:\n### Option 1: BlueChips MetaPool\n\nYou might consider this the safest of the pools. It contains a collection of different “blue-chip projects” across multiple verticals that have proven track records and are considered industry leaders. These include:\n\n* (3) Bluechip protocols: MakerDAO, Compound, and Uniswap. These are commonly seen as the most battletested and trusted DeFi projects on Ethereum.\n* (2) Centralized exchanges: Coinbase and Binance. These are the most popular and generally considered to be most reputable exchanges around. *note: Payout occurs only if Safu funds or the exchange’s insurance do not cover losses.\n* (2) Hardware Wallet companies, Ledger and Trezor, including the Ledger Nano S and X, and the Trezor Model T and One. This would cover large scale exploits in their hardware or firmware and would not cover individual loss due to phishing or poor security.\n\n### Option 2: Hot New Projects MetaPool\n\nThis pool targets newer projects on Ethereum that are considered reputable and have high TVL but are less battle tested and therefore may be more risky. While they may be more risky, this may mean that there is more demand for coverage for them in the market. This list is preliminary but internal discussions considered including:\n\n * Alchemix\n* OHM\n* Liquity\n* FEI\n* Integral\n* Reflexer\n\n### Option 3: Integrated DegenV2 MetaPool\n\nThis last option focuses more closely on YAM products, specifically DegenV2 and the constituent protocols that it uses. This option would let us insure our own users and potentially test out our products in a more limited environment. The covered protocols would be:\n\n * UMA\n * Sushiswap/Uniswap depending on where our pools live\n * Any YAM contracts that are used\n * Any future contracts included in future versions of Degen.\n\n### Choose wisely!\n", 310 | "choices": [ 311 | "Option 1: BlueChips MetaPool", 312 | "Option 2: Hot New Projects MetaP", 313 | "Option 3: Integrated DegenV2 Met" 314 | ], 315 | "start": 1620676800, 316 | "end": 1620806400, 317 | "snapshot": "12408670", 318 | "state": "closed", 319 | "author": "0xEC3281124d4c2FCA8A88e3076C1E7749CfEcb7F2", 320 | "space": { 321 | "id": "yam.eth", 322 | "name": "Yam Finance" 323 | } 324 | }, 325 | ... 326 | ] 327 | } 328 | } 329 | ``` 330 | {% endtab %} 331 | {% endtabs %} 332 | 333 | Try on [GraphiQL](https://hub.snapshot.org/graphql?operationName=Proposals&query=query%20Proposals%20%7B%0A%20%20proposals%20%28%0A%20%20%20%20first%3A%2020%2C%0A%20%20%20%20skip%3A%200%2C%0A%20%20%20%20where%3A%20%7B%0A%20%20%20%20%20%20space_in%3A%20%5B%22yam.eth%22%5D%2C%0A%20%20%20%20%20%20state%3A%20%22closed%22%0A%20%20%20%20%7D%2C%0A%20%20%20%20orderBy%3A%20%22created%22%2C%0A%20%20%20%20orderDirection%3A%20desc%0A%20%20%29%20%7B%0A%20%20%20%20id%0A%20%20%20%20title%0A%20%20%20%20body%0A%20%20%20%20choices%0A%20%20%20%20start%0A%20%20%20%20end%0A%20%20%20%20snapshot%0A%20%20%20%20state%0A%20%20%20%20author%0A%20%20%20%20space%20%7B%0A%20%20%20%20%20%20id%0A%20%20%20%20%20%20name%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D) 334 | 335 | ### Get a single vote 336 | 337 | #### Arguments 338 | 339 | id `string`‌ 340 | 341 | #### Example 342 | 343 | {% tabs %} 344 | {% tab title="Request" %} 345 | ```graphql 346 | query { 347 | vote ( 348 | id: "QmeU7ct9Y4KLrh6F6mbT1eJNMkeQKMSnSujEfMCfbRLCMp" 349 | ) { 350 | id 351 | voter 352 | created 353 | proposal 354 | choice 355 | space { 356 | id 357 | } 358 | } 359 | } 360 | ``` 361 | {% endtab %} 362 | 363 | {% tab title="Response" %} 364 | ```javascript 365 | { 366 | "data": { 367 | "vote": { 368 | "id": "QmeU7ct9Y4KLrh6F6mbT1eJNMkeQKMSnSujEfMCfbRLCMp", 369 | "voter": "0x96176C25803Ce4cF046aa74895646D8514Ea1611", 370 | "created": 1621183227, 371 | "proposal": "QmPvbwguLfcVryzBRrbY4Pb9bCtxURagdv1XjhtFLf3wHj", 372 | "choice": 1, 373 | "space": { 374 | "id": "spookyswap.eth" 375 | } 376 | } 377 | } 378 | } 379 | ``` 380 | {% endtab %} 381 | {% endtabs %} 382 | 383 | Try on [GraphiQL](https://hub.snapshot.org/graphql?operationName=Vote&query=query%20Vote%20%7B%0A%20%20vote%20%28%0A%20%20%20%20id%3A%20%22QmeU7ct9Y4KLrh6F6mbT1eJNMkeQKMSnSujEfMCfbRLCMp%22%0A%20%20%29%20%7B%0A%20%20%20%20id%0A%20%20%20%20voter%0A%20%20%20%20created%0A%20%20%20%20proposal%0A%20%20%20%20choice%0A%20%20%20%20space%20%7B%0A%20%20%20%20%20%20id%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D) 384 | 385 | ### Get votes 386 | 387 | #### Arguments 388 | 389 | first `number` 390 | skip `number` 391 | where: 392 | 393 | * id`string` 394 | * id\_in`array` 395 | * space:`string` 396 | * space\_in:`array` 397 | * voter:`string` 398 | * voter\_in:`array` 399 | * proposal: `string` 400 | * proposal\_in: `array` 401 | 402 | orderBy `string` 403 | 404 | orderDirection `asc` or `desc` 405 | 406 | #### Example 407 | 408 | {% tabs %} 409 | {% tab title="Request" %} 410 | ```graphql 411 | query { 412 | votes ( 413 | first: 1000 414 | skip: 0 415 | where: { 416 | proposal: "QmPvbwguLfcVryzBRrbY4Pb9bCtxURagdv1XjhtFLf3wHj" 417 | } 418 | orderBy: "created", 419 | orderDirection: desc 420 | ) { 421 | id 422 | voter 423 | created 424 | proposal 425 | choice 426 | space { 427 | id 428 | } 429 | } 430 | } 431 | ``` 432 | {% endtab %} 433 | 434 | {% tab title="Response" %} 435 | ```javascript 436 | { 437 | "data": { 438 | "votes": [ 439 | { 440 | "id": "QmeU7ct9Y4KLrh6F6mbT1eJNMkeQKMSnSujEfMCfbRLCMp", 441 | "voter": "0x96176C25803Ce4cF046aa74895646D8514Ea1611", 442 | "created": 1621183227, 443 | "proposal": "QmPvbwguLfcVryzBRrbY4Pb9bCtxURagdv1XjhtFLf3wHj", 444 | "choice": 1, 445 | "space": { 446 | "id": "spookyswap.eth" 447 | } 448 | }, 449 | { 450 | "id": "QmZ2CV86QH6Q6z7L6g7yJWS3HfgD9aQ3uTYYMXkMa5trHf", 451 | "voter": "0x2686EaD94C5042e56a41eDde6533711a4303CC52", 452 | "created": 1621181827, 453 | "proposal": "QmPvbwguLfcVryzBRrbY4Pb9bCtxURagdv1XjhtFLf3wHj", 454 | "choice": 1, 455 | "space": { 456 | "id": "spookyswap.eth" 457 | } 458 | }, 459 | ... 460 | ] 461 | } 462 | } 463 | ``` 464 | {% endtab %} 465 | {% endtabs %} 466 | 467 | Try on [GraphiQL](https://hub.snapshot.org/graphql?operationName=Votes&query=query%20Votes%20%7B%0A%20%20votes%20%28%0A%20%20%20%20first%3A%201000%0A%20%20%20%20skip%3A%200%0A%20%20%20%20where%3A%20%7B%0A%20%20%20%20%20%20proposal%3A%20%22QmPvbwguLfcVryzBRrbY4Pb9bCtxURagdv1XjhtFLf3wHj%22%0A%20%20%20%20%7D%0A%20%20%20%20orderBy%3A%20%22created%22%2C%0A%20%20%20%20orderDirection%3A%20desc%0A%20%20%29%20%7B%0A%20%20%20%20id%0A%20%20%20%20voter%0A%20%20%20%20created%0A%20%20%20%20proposal%0A%20%20%20%20choice%0A%20%20%20%20space%20%7B%0A%20%20%20%20%20%20id%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D%0A) 468 | 469 | ### Get follows 470 | 471 | #### Arguments 472 | 473 | first `number` 474 | skip `number` 475 | where: 476 | 477 | * id`string` 478 | * id\_in`array` 479 | * space:`string` 480 | * space\_in:`array` 481 | * follower:`string` 482 | * follower\_in:`array` 483 | 484 | orderBy `string` 485 | 486 | orderDirection `asc` or `desc` 487 | 488 | #### Example 489 | 490 | {% tabs %} 491 | {% tab title="Request" %} 492 | ```graphql 493 | query { 494 | follows( 495 | first: 10, 496 | where: { 497 | follower: "0xeF8305E140ac520225DAf050e2f71d5fBcC543e7" 498 | } 499 | ) { 500 | follower 501 | space { 502 | id 503 | } 504 | created 505 | } 506 | } 507 | ``` 508 | {% endtab %} 509 | 510 | {% tab title="Response" %} 511 | ```javascript 512 | { 513 | "data": { 514 | "follows": [ 515 | { 516 | "follower": "0xeF8305E140ac520225DAf050e2f71d5fBcC543e7", 517 | "space": { 518 | "id": "gnosis.eth" 519 | }, 520 | "created": 1629732280 521 | }, 522 | { 523 | "follower": "0xeF8305E140ac520225DAf050e2f71d5fBcC543e7", 524 | "space": { 525 | "id": "aavegotchi.eth" 526 | }, 527 | "created": 1629725098 528 | }, 529 | { 530 | "follower": "0xeF8305E140ac520225DAf050e2f71d5fBcC543e7", 531 | "space": { 532 | "id": "yam.eth" 533 | }, 534 | "created": 1629723970 535 | }, 536 | { 537 | "follower": "0xeF8305E140ac520225DAf050e2f71d5fBcC543e7", 538 | "space": { 539 | "id": "balancer.eth" 540 | }, 541 | "created": 1629723960 542 | } 543 | ] 544 | } 545 | } 546 | ``` 547 | {% endtab %} 548 | {% endtabs %} 549 | 550 | Try on [GraphiQL](https://hub.snapshot.org/graphql?query=query%20%7B%0A%20%20follows%28%0A%20%20%20%20first%3A%2010%2C%0A%20%20%20%20where%3A%20%7B%0A%20%20%20%20%20%20follower%3A%20%220xeF8305E140ac520225DAf050e2f71d5fBcC543e7%22%0A%20%20%20%20%7D%0A%20%20%29%20%7B%0A%20%20%20%20follower%0A%20%20%20%20space%20%7B%0A%20%20%20%20%20%20id%0A%20%20%20%20%7D%0A%20%20%20%20created%0A%20%20%7D%0A%7D) 551 | 552 | -------------------------------------------------------------------------------- /graphql-api/README.md: -------------------------------------------------------------------------------- 1 | # GraphQL API 2 | 3 | Try the GraphQL API here: 4 | 5 | {% embed url="https://hub.snapshot.page/graphql" %} 6 | 7 | ![](../.gitbook/assets/image.png) 8 | 9 | ### Get a single space 10 | 11 | #### Arguments 12 | 13 | id `string` 14 | 15 | #### Example 16 | 17 | {% tabs %} 18 | {% tab title="Request" %} 19 | ```graphql 20 | query { 21 | space(id: "yam.eth") { 22 | id 23 | name 24 | about 25 | network 26 | symbol 27 | members 28 | } 29 | } 30 | ``` 31 | {% endtab %} 32 | 33 | {% tab title="Response" %} 34 | ```javascript 35 | { 36 | "data": { 37 | "space": { 38 | "id": "yam.eth", 39 | "name": "Yam Finance", 40 | "about": "", 41 | "network": "1", 42 | "symbol": "YAM", 43 | "members": [ 44 | "0x683A78bA1f6b25E29fbBC9Cd1BFA29A51520De84", 45 | "0x9Ebc8AD4011C7f559743Eb25705CCF5A9B58D0bc", 46 | "0xC3edCBe0F93a6258c3933e86fFaA3bcF12F8D695", 47 | "0xbdac5657eDd13F47C3DD924eAa36Cf1Ec49672cc", 48 | "0xEC3281124d4c2FCA8A88e3076C1E7749CfEcb7F2" 49 | ] 50 | } 51 | } 52 | } 53 | ``` 54 | {% endtab %} 55 | {% endtabs %} 56 | 57 | Try on [GraphiQL](https://hub.snapshot.page/graphql?query=query%20%7B%0A%20%20space%28id%3A%20%22yam.eth%22%29%20%7B%0A%20%20%20%20id%0A%20%20%20%20name%0A%20%20%20%20about%0A%20%20%20%20network%0A%20%20%20%20symbol%0A%20%20%20%20members%0A%20%20%7D%0A%7D) 58 | 59 | ### Get multiple spaces 60 | 61 | #### Arguments 62 | 63 | first `number` 64 | skip `number` 65 | orderBy `string` 66 | orderDirection `asc` or `desc` 67 | 68 | #### Example 69 | 70 | {% tabs %} 71 | {% tab title="Request" %} 72 | ```graphql 73 | query { 74 | spaces( 75 | first: 20, 76 | skip: 0, 77 | orderBy: "created", 78 | orderDirection: asc 79 | ) { 80 | id 81 | name 82 | about 83 | network 84 | symbol 85 | strategies { 86 | name 87 | params 88 | } 89 | admins 90 | members 91 | filters { 92 | minScore 93 | onlyMembers 94 | } 95 | plugins 96 | } 97 | } 98 | ``` 99 | {% endtab %} 100 | 101 | {% tab title="Response" %} 102 | ```javascript 103 | { 104 | "data": { 105 | "spaces": [ 106 | { 107 | "id": "bonustrack.eth", 108 | "name": "Fabien", 109 | "about": "", 110 | "network": "1", 111 | "symbol": "TICKET", 112 | "strategies": [ 113 | { 114 | "name": "erc20-balance-of", 115 | "params": { 116 | "symbol": "DAI", 117 | "address": "0x6B175474E89094C44Da98b954EedeAC495271d0F", 118 | "decimals": 18 119 | } 120 | } 121 | ], 122 | "admins": [], 123 | "members": [ 124 | "0x24A12Fa313F57aF541d447c594072A992c605DCf" 125 | ], 126 | "filters": { 127 | "minScore": 0, 128 | "onlyMembers": false 129 | }, 130 | "plugins": { 131 | "quorum": { 132 | "total": 500, 133 | "strategy": "static" 134 | } 135 | } 136 | } 137 | ] 138 | } 139 | } 140 | ``` 141 | {% endtab %} 142 | {% endtabs %} 143 | 144 | Try on [GraphiQL](https://hub.snapshot.page/graphql?query=%0Aquery%20Spaces%20%7B%0A%20%20spaces%28%0A%20%20%20%20first%3A%2020%2C%0A%20%20%20%20skip%3A%200%2C%0A%20%20%20%20orderBy%3A%20%22created%22%2C%0A%20%20%20%20orderDirection%3A%20asc%0A%20%20%29%20%7B%0A%20%20%20%20id%0A%20%20%20%20name%0A%20%20%20%20about%0A%20%20%20%20network%0A%20%20%20%20symbol%0A%20%20%20%20strategies%20%7B%0A%20%20%20%20%20%20name%0A%20%20%20%20%20%20params%0A%20%20%20%20%7D%0A%20%20%20%20admins%0A%20%20%20%20members%0A%20%20%20%20filters%20%7B%0A%20%20%20%20%20%20minScore%0A%20%20%20%20%20%20onlyMembers%0A%20%20%20%20%7D%0A%20%20%20%20plugins%0A%20%20%7D%0A%7D) 145 | 146 | 147 | 148 | {% page-ref page="get-proposals.md" %} 149 | 150 | {% page-ref page="get-a-single-proposal.md" %} 151 | 152 | {% page-ref page="get-votes.md" %} 153 | 154 | {% page-ref page="get-single-vote.md" %} 155 | 156 | 157 | 158 | -------------------------------------------------------------------------------- /graphql-api/get-a-single-proposal.md: -------------------------------------------------------------------------------- 1 | # Get a single proposal 2 | 3 | #### Input Arguments: 4 | 5 | **`id: String`** 6 | 7 | {% hint style="info" %} 8 | #### [Example GraphQL query](https://hub.snapshot.page/graphql?operationName=Proposal&query=query%20Proposal%20%7B%0A%20%20proposal%28id%3A%22QmZ21uS8tVucpaNq2LZCbZUmHhYYXunC1ZS2gPDNWwPWD9%22%29%20%7B%0A%20%20%20%20id%0A%20%20%20%20title%0A%20%20%20%20body%0A%20%20%20%20choices%0A%20%20%20%20start%0A%20%20%20%20end%0A%20%20%20%20snapshot%0A%20%20%20%20state%0A%20%20%20%20author%0A%20%20%20%20space%20%7B%0A%20%20%20%20%20%20id%0A%20%20%20%20%20%20name%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D) 9 | {% endhint %} 10 | 11 | {% tabs %} 12 | {% tab title="Request" %} 13 | ```graphql 14 | query { 15 | proposal(id:"QmZ21uS8tVucpaNq2LZCbZUmHhYYXunC1ZS2gPDNWwPWD9") { 16 | id 17 | title 18 | body 19 | choices 20 | start 21 | end 22 | snapshot 23 | state 24 | author 25 | space { 26 | id 27 | name 28 | } 29 | } 30 | } 31 | ``` 32 | {% endtab %} 33 | 34 | {% tab title="Response" %} 35 | ```javascript 36 | { 37 | "data": { 38 | "proposal": { 39 | "id": "QmZ21uS8tVucpaNq2LZCbZUmHhYYXunC1ZS2gPDNWwPWD9", 40 | "title": "Example Title", 41 | "body": "Example Body" 42 | "choices": [ 43 | "Approve", 44 | "Reject" 45 | ], 46 | "start": 1620946800, 47 | "end": 1621206000, 48 | "snapshot": "12428834", 49 | "state": "closed", 50 | "author": "0xcc6A949DB9b26a7173648d50Cf7C55e800E6585B", 51 | "space": { 52 | "id": "balancer", 53 | "name": "Balancer" 54 | } 55 | } 56 | } 57 | } 58 | ``` 59 | {% endtab %} 60 | {% endtabs %} 61 | 62 | -------------------------------------------------------------------------------- /graphql-api/get-proposals.md: -------------------------------------------------------------------------------- 1 | # Get proposals 2 | 3 | #### Input Arguments: 4 | 5 | **`first: Int 6 | skip: Int 7 | orderBy: String 8 | orderDirection: OrderDirection 9 | where: ProposalWhere 10 | 11 | 12 | Type OrderDirection: 13 | asc or desc 14 | 15 | 16 | Type ProposalWhere: 17 | id: String 18 | id_in: [String] 19 | space: String 20 | space_in: [String] 21 | author: String 22 | author_in: [String] 23 | network: String 24 | network_in: [String] 25 | state: [String]`** 26 | 27 | {% hint style="info" %} 28 | #### [Example GraphQL query](https://hub.snapshot.page/graphql?operationName=Proposals&query=query%20Proposals%20%7B%0A%20%20proposals%28%0A%20%20%20%20first%3A%2020%2C%0A%20%20%20%20skip%3A%200%2C%0A%20%20%20%20where%3A%20%7B%0A%20%20%20%20%20%20space_in%3A%20%5B%22balancer%22%2C%20%22yam.eth%22%5D%2C%0A%20%20%20%20%20%20state%3A%20%22closed%22%0A%20%20%20%20%7D%2C%0A%20%20%20%20orderBy%3A%20%22created%22%2C%0A%20%20%20%20orderDirection%3A%20desc%0A%20%20%29%20%7B%0A%20%20%20%20id%0A%20%20%20%20title%0A%20%20%20%20body%0A%20%20%20%20choices%0A%20%20%20%20start%0A%20%20%20%20end%0A%20%20%20%20snapshot%0A%20%20%20%20state%0A%20%20%20%20author%0A%20%20%20%20space%20%7B%0A%20%20%20%20%20%20id%0A%20%20%20%20%20%20name%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D) 29 | {% endhint %} 30 | 31 | {% tabs %} 32 | {% tab title="Request" %} 33 | ```graphql 34 | query { 35 | proposals( 36 | first: 20, 37 | skip: 0, 38 | where: { 39 | space_in: ["balancer", "yam.eth"], 40 | state: "closed" 41 | }, 42 | orderBy: "created", 43 | orderDirection: desc 44 | ) { 45 | id 46 | title 47 | body 48 | choices 49 | start 50 | end 51 | snapshot 52 | state 53 | author 54 | space { 55 | id 56 | name 57 | } 58 | } 59 | } 60 | ``` 61 | {% endtab %} 62 | 63 | {% tab title="Response" %} 64 | ```javascript 65 | { 66 | "data": { 67 | "proposals": [ 68 | { 69 | "id": "QmZ21uS8tVucpaNq2LZCbZUmHhYYXunC1ZS2gPDNWwPWD9", 70 | "title": "Example Title", 71 | "body": "Example Body", 72 | "choices": [ 73 | "Approve", 74 | "Reject" 75 | ], 76 | "start": 1620946800, 77 | "end": 1621206000, 78 | "snapshot": "12428834", 79 | "state": "closed", 80 | "author": "0xcc6A949DB9b26a7173648d50Cf7C55e800E6585B", 81 | "space": { 82 | "id": "balancer", 83 | "name": "Balancer" 84 | } 85 | }, 86 | { 87 | "id": "QmUfV627SNpKTNqFc5bEdCXTLnHDF6KvgtbLcdmFmdqP3f", 88 | "title": "Example Title 2", 89 | "body": "Example Body 2", 90 | "choices": [ 91 | "Approve", 92 | "Reject" 93 | ], 94 | "start": 1614985200, 95 | "end": 1615158000, 96 | "snapshot": "11980950", 97 | "state": "closed", 98 | "author": "0xcc6A949DB9b26a7173648d50Cf7C55e800E6585B", 99 | "space": { 100 | "id": "balancer", 101 | "name": "Balancer" 102 | } 103 | } 104 | ] 105 | } 106 | } 107 | ``` 108 | {% endtab %} 109 | {% endtabs %} 110 | 111 | -------------------------------------------------------------------------------- /graphql-api/get-single-vote.md: -------------------------------------------------------------------------------- 1 | # Get single vote 2 | 3 | #### Input Arguments: 4 | 5 | **`id: String`** 6 | 7 | {% hint style="info" %} 8 | #### [Example GraphQL query](https://hub.snapshot.page/graphql?operationName=Proposal&query=query%20Proposal%20%7B%0A%20%20proposal%28id%3A%22QmZ21uS8tVucpaNq2LZCbZUmHhYYXunC1ZS2gPDNWwPWD9%22%29%20%7B%0A%20%20%20%20id%0A%20%20%20%20title%0A%20%20%20%20body%0A%20%20%20%20choices%0A%20%20%20%20start%0A%20%20%20%20end%0A%20%20%20%20snapshot%0A%20%20%20%20state%0A%20%20%20%20author%0A%20%20%20%20space%20%7B%0A%20%20%20%20%20%20id%0A%20%20%20%20%20%20name%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D) 9 | {% endhint %} 10 | 11 | {% tabs %} 12 | {% tab title="Request" %} 13 | ```graphql 14 | query { 15 | vote ( 16 | id: "QmeU7ct9Y4KLrh6F6mbT1eJNMkeQKMSnSujEfMCfbRLCMp" 17 | ) { 18 | id 19 | voter 20 | created 21 | proposal 22 | choice 23 | space { 24 | id 25 | } 26 | } 27 | } 28 | 29 | ``` 30 | {% endtab %} 31 | 32 | {% tab title="Response" %} 33 | ```javascript 34 | { 35 | "data": { 36 | "vote": { 37 | "id": "QmeU7ct9Y4KLrh6F6mbT1eJNMkeQKMSnSujEfMCfbRLCMp", 38 | "voter": "0x96176C25803Ce4cF046aa74895646D8514Ea1611", 39 | "created": 1621183227, 40 | "proposal": "QmPvbwguLfcVryzBRrbY4Pb9bCtxURagdv1XjhtFLf3wHj", 41 | "choice": 1, 42 | "space": { 43 | "id": "spookyswap.eth" 44 | } 45 | } 46 | } 47 | } 48 | ``` 49 | {% endtab %} 50 | {% endtabs %} 51 | 52 | -------------------------------------------------------------------------------- /graphql-api/get-votes.md: -------------------------------------------------------------------------------- 1 | # Get votes 2 | 3 | #### Input Arguments: 4 | 5 | **`first: Int 6 | skip: Int 7 | orderBy: String 8 | orderDirection: OrderDirection 9 | where: VoteWhere 10 | 11 | 12 | Type OrderDirection: 13 | asc or desc 14 | 15 | 16 | Type VoteWhere: 17 | id: String 18 | id_in: [String] 19 | space: String 20 | space_in: [String] 21 | author: String 22 | author_in: [String] 23 | network: String 24 | network_in: [String] 25 | state: [String]`** 26 | 27 | {% hint style="info" %} 28 | #### [Example GraphQL query](https://hub.snapshot.page/graphql?operationName=Votes&query=query%20Votes%20%7B%0A%20%20votes%20%28%0A%20%20%20%20first%3A%201000%0A%20%20%20%20skip%3A%200%0A%20%20%20%20where%3A%20%7B%0A%20%20%20%20%20%20proposal%3A%20%22QmPvbwguLfcVryzBRrbY4Pb9bCtxURagdv1XjhtFLf3wHj%22%0A%20%20%20%20%7D%0A%20%20%20%20orderBy%3A%20%22created%22%2C%0A%20%20%20%20orderDirection%3A%20desc%0A%20%20%29%20%7B%0A%20%20%20%20id%0A%20%20%20%20voter%0A%20%20%20%20created%0A%20%20%20%20proposal%0A%20%20%20%20choice%0A%20%20%20%20space%20%7B%0A%20%20%20%20%20%20id%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D%0A) 29 | {% endhint %} 30 | 31 | {% tabs %} 32 | {% tab title="Request" %} 33 | ```graphql 34 | query { 35 | votes ( 36 | first: 1000 37 | skip: 0 38 | where: { 39 | proposal: "QmPvbwguLfcVryzBRrbY4Pb9bCtxURagdv1XjhtFLf3wHj" 40 | } 41 | orderBy: "created", 42 | orderDirection: desc 43 | ) { 44 | id 45 | voter 46 | created 47 | proposal 48 | choice 49 | space { 50 | id 51 | } 52 | } 53 | } 54 | 55 | ``` 56 | {% endtab %} 57 | 58 | {% tab title="Response" %} 59 | ```javascript 60 | { 61 | "data": { 62 | "votes": [ 63 | { 64 | "id": "QmeU7ct9Y4KLrh6F6mbT1eJNMkeQKMSnSujEfMCfbRLCMp", 65 | "voter": "0x96176C25803Ce4cF046aa74895646D8514Ea1611", 66 | "created": 1621183227, 67 | "proposal": "QmPvbwguLfcVryzBRrbY4Pb9bCtxURagdv1XjhtFLf3wHj", 68 | "choice": 1, 69 | "space": { 70 | "id": "spookyswap.eth" 71 | } 72 | }, 73 | { 74 | "id": "QmZ2CV86QH6Q6z7L6g7yJWS3HfgD9aQ3uTYYMXkMa5trHf", 75 | "voter": "0x2686EaD94C5042e56a41eDde6533711a4303CC52", 76 | "created": 1621181827, 77 | "proposal": "QmPvbwguLfcVryzBRrbY4Pb9bCtxURagdv1XjhtFLf3wHj", 78 | "choice": 1, 79 | "space": { 80 | "id": "spookyswap.eth" 81 | } 82 | }, 83 | { 84 | "id": "QmYpUghFNYiS5y2vqNzJfczJmhXCMbzq17PJ1jjaP3BYib", 85 | "voter": "0xF6F7a399405ca3A6434b390d0221353748cf1884", 86 | "created": 1621175990, 87 | "proposal": "QmPvbwguLfcVryzBRrbY4Pb9bCtxURagdv1XjhtFLf3wHj", 88 | "choice": 1, 89 | "space": { 90 | "id": "spookyswap.eth" 91 | } 92 | } 93 | ] 94 | } 95 | } 96 | ``` 97 | {% endtab %} 98 | {% endtabs %} 99 | 100 | -------------------------------------------------------------------------------- /guides/add-a-custom-domain.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Custom domain is optional. 3 | --- 4 | 5 | # Add a custom domain 6 | 7 | To add a custom domain you need to do a pull request on this repository: 8 | 9 | {% embed url="https://github.com/snapshot-labs/snapshot-spaces" %} 10 | 11 | #### Follow the Snapshot spaces directory tree 12 | 13 | ```bash 14 | └── spaces 15 | └── domains.json 16 | ``` 17 | 18 | ### Add a custom domain 19 | 20 | #### Set it in the Domain name field 21 | 22 | To add a custom domain, fill in the Domain name field in your settings. 23 | 24 | ![Domain name field in Snapshot settings.](../.gitbook/assets/capture-de-cran-2020-12-30-a-09.34.49.png) 25 | 26 | #### Insert it in the domains list 27 | 28 | You must then add your domain in the [domains.json file](https://github.com/snapshot-labs/snapshot-spaces/blob/master/spaces/domains.json) by following this example. 29 | 30 | ```javascript 31 | { 32 | "my.custom.url": "my-space.eth" 33 | } 34 | ``` 35 | 36 | #### Configure your DNS 37 | 38 | You will need to add this as CNAME in your domain DNS `snapshotpage.b-cdn.net` 39 | 40 | {% hint style="info" %} 41 | After committing your PR, you will have to wait for the merge and the deployment of your PR to be able to get your domain live. This process can take a few hours. 42 | {% endhint %} 43 | 44 | -------------------------------------------------------------------------------- /guides/add-a-skin.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Skins are optional. 3 | --- 4 | 5 | # Add a skin 6 | 7 | To create your own skin you need to do a pull request on this repository: 8 | 9 | {% embed url="https://github.com/snapshot-labs/snapshot-spaces" %} 10 | 11 | #### Follow the Snapshot skins directory tree 12 | 13 | ```bash 14 | └── skins 15 | └── my-space.scss 16 | ``` 17 | 18 | ### Add your skin 19 | 20 | To add your skin you will need to create a "my-space.scss" file in the "skins" directory. 21 | 22 | ```css 23 | .my-space { 24 | --primary-color: #384aff; 25 | --bg-color: white; 26 | --text-color: #586069; 27 | --link-color: #111111; 28 | --heading-color: #111111; 29 | --border-color: #d1d5da; 30 | --header-bg: white; 31 | --block-bg: transparent; 32 | } 33 | ``` 34 | 35 | {% hint style="danger" %} 36 | Change the file name **my-space.scss** and css selector **.my-space** with your space name. 37 | {% endhint %} 38 | 39 | Select then your skin in the Skin field in your space settings. 40 | 41 | ![Snapshot skin selector.](../.gitbook/assets/capture-de-cran-2020-12-30-a-09.33.58.png) 42 | 43 | {% hint style="info" %} 44 | After committing your PR, you will have to wait for the merge and the deployment of your PR to be able to select your skin available. This process can take a few hours. 45 | {% endhint %} 46 | 47 | -------------------------------------------------------------------------------- /guides/add-avatars.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Avatars are optional. 3 | --- 4 | 5 | # Add avatars 6 | 7 | To get a logo for your space, images you need to do a pull request on this repository: 8 | 9 | {% embed url="https://github.com/snapshot-labs/snapshot-spaces" %} 10 | 11 | #### Follow the Snapshot spaces directory tree 12 | 13 | ```bash 14 | └── spaces 15 | └── my-space.eth 16 | ├── logo.png 17 | └── space.png 18 | ``` 19 | 20 | ### **Add your space logo and strategy image\(s\)** 21 | 22 | You will need to create a folder with the id of your space \(example: "my-space.eth"\). In this folder you need a file "space.png" and "logo.png" \(for the first strategy\) and "logo1.png" if you have a second strategy. 23 | 24 | {% hint style="danger" %} 25 | All the images must be squared and less than 50kb. 26 | {% endhint %} 27 | 28 | {% hint style="info" %} 29 | After committing your PR, you will have to wait for the merge of your PR to be able to see your images live. This process can take a few hours. 30 | {% endhint %} 31 | 32 | -------------------------------------------------------------------------------- /guides/archived/README.md: -------------------------------------------------------------------------------- 1 | # Archived 2 | 3 | -------------------------------------------------------------------------------- /guides/archived/add-avatar.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Avatars are optional. 3 | --- 4 | 5 | # Add an avatar 6 | 7 | To get a logo for your space, images you need to do a pull request on this repository: 8 | 9 | {% embed url="https://github.com/snapshot-labs/snapshot-spaces" caption="" %} 10 | 11 | ### Follow the Snapshot spaces directory tree 12 | 13 | ```bash 14 | └── spaces 15 | └── my-space.eth 16 | ├── logo.png 17 | └── space.png 18 | ``` 19 | 20 | ## **Add your space logo and strategy image\(s\)** 21 | 22 | You will need to create a folder with the id of your space \(example: "my-space.eth"\). In this folder you need a file "space.png" and "logo.png" \(for the first strategy\) and "logo1.png" if you have a second strategy. 23 | 24 | {% hint style="danger" %} 25 | All the images must be squared and less than 50kb. 26 | {% endhint %} 27 | 28 | {% hint style="info" %} 29 | After committing your PR, you will have to wait for the merge of your PR to be able to see your images live. This process can take a few hours. 30 | {% endhint %} 31 | 32 | -------------------------------------------------------------------------------- /guides/archived/block-number.md: -------------------------------------------------------------------------------- 1 | # Snapshot block number 2 | 3 | Block number is important, to lock the state of community members who are able to vote. Meaning that if you attempt to vote on a proposal and block number is in the past, and you weren't holding required token yet, your vote will not be counted. 4 | 5 | Explained in depth: 6 | 7 | `H = h + ((t1 — t0) / a)` 8 | 9 | Where: 10 | 11 | * `H` = target block height 12 | * `h` = current block height 13 | * `t0` = current timestamp \(in seconds\) 14 | * `t1` = target timestamp \(in seconds\) 15 | * `a` = average time to solve a block \(in seconds\) 16 | 17 | Or... 18 | 19 | `last_block_number + ((future_time - time_now) / block_time)` 20 | 21 | So, for example, using a [current epoch time](https://www.epochconverter.com) of 1481214124, the epoch time of 1482537600 for midnight Christmas Eve, and the last block of 2771338: 22 | 23 | `2771338 + ((1482537600 - 1481214124) / 14) = 2865872` 24 | 25 | -------------------------------------------------------------------------------- /guides/archived/create-a-space-github.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Create your own space on Snapshot! 3 | --- 4 | 5 | # Create a space \(on GitHub\) 6 | 7 | ## **1: Fork Snapshot spaces repository here** 8 | 9 | {% embed url="https://github.com/bonustrack/snapshot-spaces" caption="" %} 10 | 11 | {% hint style="info" %} 12 | **Update your fork with the original repo using Git** 13 | 14 | If you have already forked a space, you must update your repo before submitting changes. 15 | 16 | Use the 4 commands below to sync your forked repository with the original repository. 17 | {% endhint %} 18 | 19 | ```text 20 | git remote add master https://github.com/snapshot-labs/snapshot-spaces.git 21 | git fetch master 22 | git checkout master 23 | git merge master/master 24 | ``` 25 | 26 | ## **2: Copy the space "example" folder** 27 | 28 | {% embed url="https://github.com/bonustrack/snapshot-spaces/tree/master/spaces/example" caption="" %} 29 | 30 | ```text 31 | |-- spaces 32 | |-- example 33 | |-- index.json 34 | |-- logo.png 35 | |-- space.png 36 | |-- skins (optional) 37 | |-- example.scss (optional) 38 | ``` 39 | 40 | ## **3: Space metadata** 41 | 42 | Note that your path folder name will be the name that will show on the snapshot link: 43 | 44 | * [https://snapshot.page/\#/\*\*your-space\*\*](https://snapshot.page/#/**your-space**) 45 | 46 | Example: `index.json` 47 | 48 | ```javascript 49 | { 50 | "name": "Your Space", // Name of your space (max 20 chars) 51 | "network": "1", // What network you are on? (if on Ethereum it is "1", for other check: https://docs.snapshot.page/networks) 52 | "symbol": "SYMBOL", // Your main token symbol 53 | "skin": "your-space", // Copy skin filename "example.scss" located at "/skins" folder and renaming it to "your-space.scss" 54 | "domain": "vote.yourdomain.com", // Add your voting/governance subdomain if you have one 55 | "strategies": [ // Strategies 56 | { 57 | "name": "erc20-balance-of", // Strategy name 58 | "params": { // Strategy parameters 59 | "address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", // Address of the base token 60 | "symbol": "SYMBOL", // Symbol of the base token 61 | "decimals": 18 // Decimals of the base token 62 | } 63 | } 64 | ], 65 | "members": [ // List of official addresses that can post in "Core" tab of the space 66 | "0xeF8305E140ac520225DAf050e2f71d5fBcC543e7" // Core member address 67 | ], 68 | "filters": { // Filters 69 | "defaultTab": "all", // The default tab for the space 70 | "minScore": 123, // Minimum balance from the base token that a user should have to show his proposal in the space (unless the address is a core address) 71 | "onlyMembers": true // Shows only core tab and core proposals 72 | "invalids": [ // List of proposals IDs (use this to remove a proposal from your space) 73 | "QmXAZP8tYwX2zZz5EzfxLZUYJt6TM9EmxY1L4qodhZ5zcZ", 74 | "QmXAZV8tYwX2zZz5EzfxLZUYJt6TM9EmxY1L4qodhZ5lbL" 75 | ] 76 | } 77 | } 78 | ``` 79 | 80 | ### **R**equired **fields:** `token, name, network, symbol, strategies` 81 | 82 | ## **4: Add a logo and space images** 83 | 84 | 1. You must add both `logo.png` and `space.png` images for your space with a size of 256 x 256 pixels. 85 | 2. The file size should not exceed `50KB`. 86 | 87 | ## **5: Create a skin \(optional\)** 88 | 89 | 1. To create your own skin go to the `/skins` folder. 90 | 2. Copy `example.scss` change the name to what you like \(prefferably your space name\). 91 | 3. Change the colors, then make sure both the `scss` file and its class name are the same. 92 | 4. Exampe: your file is `your-space.scss` class name should be `.your-space` 93 | 5. Include your skin name in the `index.json` file as: `"skin": "your-space"` 94 | 6. Save it in `/skins` folder. 95 | 96 | Example: `your-space.scss` 97 | 98 | ```css 99 | .your-space { 100 | --primary-color: #384aff; 101 | --bg-color: white; 102 | --text-color: #586069; 103 | --link-color: #111111; 104 | --heading-color: #111111; 105 | --border-color: #d1d5da; 106 | --header-bg: white; 107 | --block-bg: transparent; 108 | } 109 | ``` 110 | 111 | ## **6: Make sure everything is ready** 112 | 113 | Your files should something like this: 114 | 115 | ```text 116 | |-- spaces 117 | |-- your-space 118 | |-- index.json 119 | |-- logo.png 120 | |-- space.png 121 | |-- skins (optional) 122 | |-- your-space.scss (optional) 123 | ``` 124 | 125 | ## **7: Make a pull request** 126 | 127 | * Please name your PR title on the model `Add SYMBOL space` 128 | * It may take 1 or 2 days to get your PR reviewed, merged and appear on Snapshot. 129 | 130 | -------------------------------------------------------------------------------- /guides/archived/error-messages.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Information about specific errors that can appear. 3 | --- 4 | 5 | # Error messages 6 | 7 | | **Error code** | **Error information** | 8 | | :--- | :--- | 9 | | **`wrong message body`** | Message did not pass because body was empty or did not contain address or did not contain sig. | 10 | | **`wrong signed message`** | Message did dont have his local clock sync. | 11 | | **`wrong timestamp`** | User doesn't have local clock synced. | 12 | | **`wrong version`** | Hub version doesn't exist or is wrong. | 13 | | **`wrong message type`** | Message does not include a type. | 14 | | **`wrong signature`** | Body sig doesn't exist or is wrong. | 15 | | **`wrong proposal format`** | Proposal must include a title, a description, 2 choices, a block time, start and end dates. | 16 | | **`wrong proposal size`** | Proposal size is bigger or smaller than how it should minimum/maximum be. | 17 | | **`wrong proposal metadata`** | Proposal metadata is wrong. | 18 | | **`wrong proposal period`** | Proposal start date is greater than the end date. | 19 | | **`wrong vote format`** | Vote is wrong, must vote on a proposal that contains metadata and you must includea choice. | 20 | | **`wrong vote metadata`** | Vote metadata doesn't exist or is wrong. | 21 | | **`unknown proposal`** | Proposal is not found. | 22 | | **`not in voting window`** | You can't vote, time didn't start yet. | 23 | 24 | -------------------------------------------------------------------------------- /guides/archived/hub-api.md: -------------------------------------------------------------------------------- 1 | # Rest API 2 | 3 | ## Get all spaces 4 | 5 | {% embed url="https://hub.snapshot.page/api/spaces" caption="" %} 6 | 7 | ## Get a single space 8 | 9 | {% embed url="https://hub.snapshot.page/api/spaces/yam" caption="" %} 10 | 11 | ## Get all proposals of a space 12 | 13 | {% embed url="https://hub.snapshot.page/api/balancer/proposals" caption="" %} 14 | 15 | ## Get all votes of a proposal 16 | 17 | {% embed url="https://hub.snapshot.page/api/balancer/proposal/QmQpKL29E6ydTvC6p9NoEbTda9ddDkVtWe2YWpWK3NFYqq" caption="" %} 18 | 19 | ## Get a proposal 20 | 21 | You can get a proposal content from IPFS directly using the proposal id:[ https://ipfs.io/ipfs/QmQpKL29E6ydTvC6p9NoEbTda9ddDkVtWe2YWpWK3NFYqq](https://ipfs.io/ipfs/QmQpKL29E6ydTvC6p9NoEbTda9ddDkVtWe2YWpWK3NFYqq) 22 | 23 | {% api-method method="get" host="https://hub.snapshot.page/api/voters?from=1608500000&to=1609500000&spaces=balancer,yam.eth" path="" %} 24 | {% api-method-summary %} 25 | List of voters 26 | {% endapi-method-summary %} 27 | 28 | {% api-method-description %} 29 | Get a list of all voters from specific spaces for a specific period. 30 | {% endapi-method-description %} 31 | 32 | {% api-method-spec %} 33 | {% api-method-request %} 34 | {% api-method-query-parameters %} 35 | {% api-method-parameter name="from" type="number" required=false %} 36 | Timestamp from 37 | {% endapi-method-parameter %} 38 | 39 | {% api-method-parameter name="to" type="number" required=false %} 40 | Timestamp to 41 | {% endapi-method-parameter %} 42 | 43 | {% api-method-parameter name="spaces" type="string" required=false %} 44 | Spaces ids separated with commas 45 | {% endapi-method-parameter %} 46 | {% endapi-method-query-parameters %} 47 | {% endapi-method-request %} 48 | 49 | {% api-method-response %} 50 | {% api-method-response-example httpCode=200 %} 51 | {% api-method-response-example-description %} 52 | 53 | {% endapi-method-response-example-description %} 54 | 55 | ```text 56 | [ 57 | { 58 | "address": "0xaaAb28818F71C96E13518025Cc063A1CA6F4Fd58", 59 | "timestamp": 1609109064, 60 | "space": "yam.eth" 61 | }, 62 | { 63 | "address": "0xFdbE95Ec43ca5C77929a1c30E9Ee588c28c5C9B4", 64 | "timestamp": 1609102537, 65 | "space": "yam.eth" 66 | }, 67 | ... 68 | ] 69 | ``` 70 | {% endapi-method-response-example %} 71 | {% endapi-method-response %} 72 | {% endapi-method-spec %} 73 | {% endapi-method %} 74 | 75 | ## Testnet hub 76 | 77 | To see content from [https://demo.snapshot.page](https://demo.snapshot.page/#/) you need to query the testnet hub at this url: [https://testnet.snapshot.page](https://testnet.snapshot.page/) 78 | 79 | -------------------------------------------------------------------------------- /guides/contribute/README.md: -------------------------------------------------------------------------------- 1 | # Contribute 2 | 3 | **Do you want to contribute to Snapshot? There is many ways you can help, and you don't need to be a developer for that.** 4 | 5 | **Support** 6 | You have a good understanding on how Snapshot works and want to help others? Get this role and try to answer questions from others or create a GitHub issue when someone find a bug. _Rewards: 1,000 USDC / month_ 7 | 8 | **Tester** 9 | Want to test latest feature before everyone? This happen on [https://next.snapshot.org/](https://next.snapshot.org/). Get this role and we will tell you when new features are ready to test so you can help us spot issue before release to production. 10 | 11 | **Translator** 12 | Help translate Snapshot app in your native language. Have a look here [https://translate.snapshot.org/](https://translate.snapshot.org/) and if you don't see your language or it's not fully translated you can help! _Rewards: 100 USDC for complete translation_ 13 | 14 | **Strategist** 15 | You want to create Snapshot voting strategies for bounties? There is often projects creating bounties on Gitcoin to create custom voting strategies. With this role you will be notified when there is a new request. _Rewards: depend on bounties_ 16 | 17 | **Contributor** 18 | Are you a skilled Vue.js developer? Get this role and find work here: [https://github.com/snapshot-labs/snapshot/issues](https://github.com/snapshot-labs/snapshot/issues) anything with "help wanted" label, make your first pull request, you will get rewarded once it's merged. _Rewards: depend on bounties_ 19 | 20 | -------------------------------------------------------------------------------- /guides/contribute/support.md: -------------------------------------------------------------------------------- 1 | # 🙋‍♂️ Support 2 | 3 | You have a good understanding on how Snapshot works and want to help others? Get this role and try to answer questions from others or create a GitHub issue when someone find a bug. _Rewards: 1,000 USDC / month_ 4 | 5 | ## Get started 6 | 7 | * When someone ask a question on Discord or Telegram, if you know the answer, feel free to answer. If you don't know the answer you can: 8 | * Search on Discord or Telegram if the question was asked already. 9 | * Try to figure out by yourself, Snapshot documentation may help. 10 | * When someone report an issue, the first thing you can do is to try by yourself. If you can reproduce the issue and it's something that is obviously not working you can create an issue on GitHub here: [https://github.com/snapshot-labs/snapshot/issues/new?template=bug\_report.md](https://github.com/snapshot-labs/snapshot/issues/new?template=bug_report.md) 11 | * If someone spam or promote a project for no reason, please contact an admin. 12 | * The more you know about Snapshot the easier it will be for you to help others, if you have questions feel free to ask in the \#support channel, an admin will answer. 13 | 14 | ## Get paid 15 | 16 | We reward support contributors for a total of $1,000 per month. The amount is spread between the different contributors, based on how much they been contributing. The payment is done once a month at the very beginning of each months. 17 | 18 | -------------------------------------------------------------------------------- /guides/create-a-proposal.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Learn how to create a proposal. 3 | --- 4 | 5 | # Create a proposal 6 | 7 | ## How to create a proposal? 8 | 9 | 1. Go to a project space. 10 | 2. Click on “**Connect wallet**” button in top right corner. 11 | 3. Connect with wallet provider where you hold relevant token. 12 | 4. Click on “**New proposal**” button at the project homepage. 13 | 5. Fill out the Title in accordance with project naming standard. 14 | 6. Fill out the large text field with your community proposal. 15 | 7. Select the desired voting options. 16 | 8. Now go to the “**Actions**” box. 17 | 9. Select the start date. 18 | 10. Select the end date \(Allow enough time for voting\). 19 | 11. Fill out the Snapshot block number \(See below: **Add a snapshot block number**\). 20 | 12. Click on “**Publish**” to create the proposal. 21 | 13. Sign the message via your wallet and you are done. 22 | 23 | ### **Add a Snapshot block number** 24 | 25 | This number is important, to lock the state of community members who are able to vote. Meaning that if you attempt to vote on a proposal and block number is in the past, and you weren't holding required token yet, your vote will not be counted. 26 | 27 | * You can click the "?" top right the snapshot website, and get the blocknumber from there. 28 | * Or just look at [etherscan.io/blocks](https://etherscan.io/blocks) and use the last block number. 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /guides/create-a-space-github.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Create your own space on Snapshot! 3 | --- 4 | 5 | # Create a space \(on GitHub\) 6 | 7 | ### **1: Fork Snapshot spaces repository here** 8 | 9 | {% embed url="https://github.com/bonustrack/snapshot-spaces" caption="" %} 10 | 11 | {% hint style="info" %} 12 | **Update your fork with the original repo using Git** 13 | 14 | If you have already forked a space, you must update your repo before submitting changes. 15 | 16 | Use the 4 commands below to sync your forked repository with the original repository. 17 | {% endhint %} 18 | 19 | ```text 20 | git remote add master https://github.com/snapshot-labs/snapshot-spaces.git 21 | git fetch master 22 | git checkout master 23 | git merge master/master 24 | ``` 25 | 26 | ### **2: Copy the space "example" folder** 27 | 28 | {% embed url="https://github.com/bonustrack/snapshot-spaces/tree/master/spaces/example" caption="" %} 29 | 30 | ```text 31 | |-- spaces 32 | |-- example 33 | |-- index.json 34 | |-- logo.png 35 | |-- space.png 36 | |-- skins (optional) 37 | |-- example.scss (optional) 38 | ``` 39 | 40 | ### **3: Space metadata** 41 | 42 | Note that your path folder name will be the name that will show on the snapshot link: 43 | 44 | * https://snapshot.page/\#/**your-space** 45 | 46 | Example: `index.json` 47 | 48 | ```javascript 49 | { 50 | "name": "Your Space", // Name of your space (max 20 chars) 51 | "network": "1", // What network you are on? (if on Ethereum it is "1", for other check: https://docs.snapshot.page/networks) 52 | "symbol": "SYMBOL", // Your main token symbol 53 | "skin": "your-space", // Copy skin filename "example.scss" located at "/skins" folder and renaming it to "your-space.scss" 54 | "domain": "vote.yourdomain.com", // Add your voting/governance subdomain if you have one 55 | "strategies": [ // Strategies 56 | { 57 | "name": "erc20-balance-of", // Strategy name 58 | "params": { // Strategy parameters 59 | "address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", // Address of the base token 60 | "symbol": "SYMBOL", // Symbol of the base token 61 | "decimals": 18 // Decimals of the base token 62 | } 63 | } 64 | ], 65 | "members": [ // List of official addresses that can post in "Core" tab of the space 66 | "0xeF8305E140ac520225DAf050e2f71d5fBcC543e7" // Core member address 67 | ], 68 | "filters": { // Filters 69 | "defaultTab": "all", // The default tab for the space 70 | "minScore": 123, // Minimum balance from the base token that a user should have to show his proposal in the space (unless the address is a core address) 71 | "onlyMembers": true // Shows only core tab and core proposals 72 | "invalids": [ // List of proposals IDs (use this to remove a proposal from your space) 73 | "QmXAZP8tYwX2zZz5EzfxLZUYJt6TM9EmxY1L4qodhZ5zcZ", 74 | "QmXAZV8tYwX2zZz5EzfxLZUYJt6TM9EmxY1L4qodhZ5lbL" 75 | ] 76 | } 77 | } 78 | ``` 79 | 80 | #### **R**equired **fields:** `token, name, network, symbol, strategies` 81 | 82 | ### **4: Add a logo and space images** 83 | 84 | 1. You must add both `logo.png` and `space.png` images for your space with a size of 256 x 256 pixels. 85 | 2. The file size should not exceed `50KB`. 86 | 87 | ### **5: Create a skin \(optional\)** 88 | 89 | 1. To create your own skin go to the `/skins` folder. 90 | 2. Copy `example.scss` change the name to what you like \(prefferably your space name\). 91 | 3. Change the colors, then make sure both the `scss` file and its class name are the same. 92 | 4. Exampe: your file is `your-space.scss` class name should be `.your-space` 93 | 5. Include your skin name in the `index.json` file as: `"skin": "your-space"` 94 | 6. Save it in `/skins` folder. 95 | 96 | Example: `your-space.scss` 97 | 98 | ```css 99 | .your-space { 100 | --primary-color: #384aff; 101 | --bg-color: white; 102 | --text-color: #586069; 103 | --link-color: #111111; 104 | --heading-color: #111111; 105 | --border-color: #d1d5da; 106 | --header-bg: white; 107 | --block-bg: transparent; 108 | } 109 | ``` 110 | 111 | ### **6: Make sure everything is ready** 112 | 113 | Your files should something like this: 114 | 115 | ```text 116 | |-- spaces 117 | |-- your-space 118 | |-- index.json 119 | |-- logo.png 120 | |-- space.png 121 | |-- skins (optional) 122 | |-- your-space.scss (optional) 123 | ``` 124 | 125 | ### **7: Make a pull request** 126 | 127 | * Please name your PR title on the model `Add SYMBOL space` 128 | * It may take 1 or 2 days to get your PR reviewed, merged and appear on Snapshot. 129 | 130 | -------------------------------------------------------------------------------- /guides/create-a-space.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: 'To create a space in Snapshot it''s easy, just follow these steps.' 3 | --- 4 | 5 | # Create a space with ENS 6 | 7 | {% hint style="warning" %} 8 | **If you already have a space see how to** [**Migrate your space to ENS**](migrate-your-space-to-ens.md)**.** 9 | {% endhint %} 10 | 11 | ## 1. Get an ENS domain for your space 12 | 13 | If you don't have an ENS domain yet for your space you will need to register one. If you need help follow the registrar guide. 14 | 15 | **Register ENS domain** 16 | [https://app.ens.domains](https://app.ens.domains/) 17 | 18 | **DNS registrar guide** 19 | [https://docs.ens.domains/dns-registrar-guide](https://docs.ens.domains/dns-registrar-guide) 20 | 21 | ## 2. Link your ENS domain to Snapshot with "contenthash" 22 | 23 | Once you have created your domain ENS, go on this url using your domain for space name. [https://snapshot.page/\#/**my-space.eth**/settings](https://snapshot.page/#/my-space.eth/settings) 24 | 25 | {% hint style="info" %} 26 | Change **my-space.eth** with your ENS domain and **login** with the wallet owner of the domain name. 27 | 28 | **<your-address>** will automatically be replaced by your address when you log in. 29 | {% endhint %} 30 | 31 | ![Set your Snapshot IPNS link.](../.gitbook/assets/capture-de-cran-2020-12-20-a-11.09.23.png) 32 | 33 | If you are on your domain space and connected with your wallet copy the "IPNS link" in the "ENS" field and click on the button **Set record on ENS**, you will get redirected to ENS app. 34 | 35 | On the ENS app click on **ADD/EDIT RECORD** and paste the "IPNS link" in the "CONTENT" field. 36 | 37 | ![Add your Snapshot IPNS link.](../.gitbook/assets/image%20%283%29.png) 38 | 39 | Click **Confirm** and submit the change. 40 | 41 | ![Confirm to link your ENS domain to Snapshot.](../.gitbook/assets/image%20%285%29.png) 42 | 43 | ## **3. Setup your space settings** 44 | 45 | Refresh the Snapshot settings page [https://snapshot.page/\#/my-space.eth/settings](https://snapshot.page/#/my-space.eth/settings). Now you can edit your space settings. 46 | 47 | ### Profile 48 | 49 | * **Change avatar** to have your [logo and strategy images in your space](add-avatars.md#add-your-space-logo-and-strategy-image-s). 50 | * **Name** is the name that will be displayed in the snapshot application. 51 | * **Network** must be the network relative to your token. 52 | * **Symbol** is the main token symbol that will be displayed in your space. 53 | * **Skin** can be left as a default, used as an existing one or you can [create your own skin](add-a-skin.md#add-your-skin). 54 | * **Domain name** is optional but you can [add a custom domain](add-a-custom-domain.md#add-a-custom-domain). 55 | 56 | ![Snapshot profile settings](../.gitbook/assets/capture-de-cran-2020-12-20-a-11.47.31.png) 57 | 58 | ### **Strategies** 59 | 60 | You need to add a voting strategy for your proposals. You can choose one by default and edit it by clicking on it to configure your own token in it or keep the default token. For more information on strategies, please refer to the [Strategies](../strategies.md) section. 61 | 62 | {% hint style="info" %} 63 | You can add up to 3 strategies in your space. 64 | {% endhint %} 65 | 66 | ![Edit strategies on Snapshot.](../.gitbook/assets/capture-de-cran-2020-12-20-a-12.19.09.png) 67 | 68 | ### Members and Filters 69 | 70 | * **Members** are those who can create official proposals that will be displayed in the "Core" tab. You can add as many addresses as you need, one per line. 71 | * **Default tab** is the one that will be displayed as the default for your space. For example `all` `core` or `community` 72 | * **Minimum score** is the minimum number of tokens required to create a proposal. 73 | * **Only members proposals** is used to allow only members to post proposals and can be set to `true` or `false` 74 | * **Invalids** are the proposals you want to hide from your space. You can add as many proposal ids as you need, one per line. 75 | 76 | ![Configure the organisation and permissions of the proposals.](../.gitbook/assets/capture-de-cran-2020-12-20-a-12.25.49.png) 77 | 78 | Click **Save** and **sign settings message** on your wallet. 79 | 80 | ![Save your Snapshot space settings.](../.gitbook/assets/capture-de-cran-2020-12-20-a-12.43.25.png) 81 | 82 | Now you are set! You can go on [https://snapshot.page/\#/my-space.eth](https://snapshot.page/#/my-space.eth) to see your space. 83 | 84 | {% hint style="info" %} 85 | When you create or edit a space, it take about 3min to see the changes live. 86 | {% endhint %} 87 | 88 | ## What you should do now**?** 89 | 90 | {% page-ref page="add-avatars.md" %} 91 | 92 | {% page-ref page="add-a-skin.md" %} 93 | 94 | {% page-ref page="add-a-custom-domain.md" %} 95 | 96 | -------------------------------------------------------------------------------- /guides/custom-domain.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Please ask the team for validating a custom domain 3 | --- 4 | 5 | # Custom domain 6 | 7 | ## **1: Add the domain here** 8 | 9 | [https://github.com/bonustrack/snapshot-spaces/blob/master/spaces/domains.json](https://github.com/bonustrack/snapshot-spaces/blob/master/spaces/domains.json) 10 | 11 | `domains.json` 12 | 13 | ```javascript 14 | { 15 | "my.custom.url": "my-space-key" 16 | } 17 | ``` 18 | 19 | {% hint style="info" %} 20 | Check that you have the `domain` field in the `index.json` file of your space following the documentation to create a space in the paragraph[ **Space metadata**](../archived/create-a-space-github.md#3-space-metadata). 21 | {% endhint %} 22 | 23 | ## **2: Configure the DNS** 24 | 25 | You will need to add this as CNAME in your domain DNS `snapshotpage.b-cdn.net` 26 | 27 | -------------------------------------------------------------------------------- /guides/delegation.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Snapshot delegation. 3 | --- 4 | 5 | # Delegation 6 | 7 | ## Delegation contract 8 | 9 | Snapshot use the Gnosis "Delegate Registry" contract here: 10 | [https://github.com/gnosis/delegate-registry](https://github.com/gnosis/delegate-registry) 11 | 12 | The contract is deployed on this address: [0x469788fE6E9E9681C6ebF3bF78e7Fd26Fc015446](https://etherscan.io/address/0x469788fE6E9E9681C6ebF3bF78e7Fd26Fc015446#code) 13 | \(Also available on Rinkeby and Kovan at the same address\) 14 | 15 | Delegations are stored on this subgraph: 16 | [https://thegraph.com/explorer/subgraph/snapshot-labs/snapshot](https://thegraph.com/explorer/subgraph/snapshot-labs/snapshot) 17 | 18 | A delegation voting strategy must be added to the Snapshot space before delegated votes will be counted. 19 | 20 | ## Delegate voting power 21 | 22 | ### From Snapshot interface 23 | 24 | 1. Go to [https://snapshot.page/\#/delegate](https://snapshot.page/#/delegate). 25 | 2. Type in which address you want to delegate to. 26 | 3. Type in the space key you want your delegation to take effect on. _\(If no space selected, effect will take place on all spaces\)_ 27 | 4. Click confirm to save your delegation. 28 | 29 | ### With a smart contract 30 | 31 | You need to call the method "**setDelegate**" with the space id as first argument, and the address of the delegate as second argument. Here is an example of integration in a Solidity contract [https://github.com/convex-eth/platform/blob/d3061c19b5e01a4e562c8121b08c44f1b42f0b85/contracts/contracts/BasicCvxHolder.sol\#L49-L53](https://github.com/convex-eth/platform/blob/d3061c19b5e01a4e562c8121b08c44f1b42f0b85/contracts/contracts/BasicCvxHolder.sol#L49-L53) 32 | 33 | -------------------------------------------------------------------------------- /guides/details/README.md: -------------------------------------------------------------------------------- 1 | # Details 2 | 3 | -------------------------------------------------------------------------------- /guides/details/block-number.md: -------------------------------------------------------------------------------- 1 | # Snapshot block number 2 | 3 | Block number is important, to lock the state of community members who are able to vote. Meaning that if you attempt to vote on a proposal and block number is in the past, and you weren't holding required token yet, your vote will not be counted. 4 | 5 | Explained in depth: 6 | 7 | `H = h + ((t1 — t0) / a)` 8 | 9 | Where: 10 | 11 | * `H` = target block height 12 | * `h` = current block height 13 | * `t0` = current timestamp \(in seconds\) 14 | * `t1` = target timestamp \(in seconds\) 15 | * `a` = average time to solve a block \(in seconds\) 16 | 17 | Or... 18 | 19 | `last_block_number + ((future_time - time_now) / block_time)` 20 | 21 | So, for example, using a [current epoch time](https://www.epochconverter.com) of 1481214124, the epoch time of 1482537600 for midnight Christmas Eve, and the last block of 2771338: 22 | 23 | `2771338 + ((1482537600 - 1481214124) / 14) = 2865872` 24 | 25 | -------------------------------------------------------------------------------- /guides/migrate-your-space-to-ens.md: -------------------------------------------------------------------------------- 1 | # Migrate your space to ENS 2 | 3 | ### 1. Create a space with ENS 4 | 5 | To migrate your space you will need first to create the space with ENS. 6 | 7 | You can use this url to get your previous space settings populated in the form: https://snapshot.page/\#/**<ens\_space\_id>**/settings/**<previous\_space\_id>** 8 | Example: https://snapshot.page/\#/**yam.eth**/settings/**yam** 9 | 10 | {% page-ref page="create-a-space.md" %} 11 | 12 | ### 2. Declare your new space alias 13 | 14 | To add your new space alias you need to do a pull request on this repository: 15 | 16 | {% embed url="https://github.com/snapshot-labs/snapshot-spaces" %} 17 | 18 | #### Follow the Snapshot spaces directory tree 19 | 20 | ```bash 21 | └── spaces 22 | └── aliases.json 23 | ``` 24 | 25 | You must add your new alias in the [aliases.json file](https://github.com/snapshot-labs/snapshot-spaces/blob/master/spaces/aliases.json) by following this example. 26 | 27 | ```javascript 28 | { 29 | "my-space": "my-space.eth" 30 | } 31 | ``` 32 | 33 | ### 3. Migrate proposals, votes and urls 34 | 35 | The migration of the proposals, votes and urls is done manually, once your space with ENS is ready please contact an admin on [Discord](https://discord.snapshot.page) to do the changes. 36 | 37 | -------------------------------------------------------------------------------- /guides/vote-for-a-proposal.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Submit your vote on a proposal. 3 | --- 4 | 5 | # Vote on a proposal 6 | 7 | 1. Go to your project's snapshot.page 8 | 2. Click on “Connect wallet” button in top right corner 9 | 3. Connect with wallet provider where you hold relevant token 10 | 4. Click on the option you want to vote for 11 | 5. Sign the message via your wallet and done 12 | 13 | -------------------------------------------------------------------------------- /networks.md: -------------------------------------------------------------------------------- 1 | # Networks 2 | 3 | Snapshot support EVM based networks. All the networks currently supported are visible here: [https://snapshot.page/\#/networks](https://snapshot.page/#/networks) 4 | 5 | ## Add a new network 6 | 7 | * Make a pull request on this file: [https://github.com/snapshot-labs/snapshot.js/blob/master/src/networks.json](https://github.com/snapshot-labs/snapshot.js/blob/master/src/networks.json) Make sure the RPC node is an archive node, this is mandatory. Snapshot use archive nodes to calculate voting power at a specific block time. You will also need to add a multicall contract address. 8 | * And add an image of the network on this folder: [https://github.com/snapshot-labs/snapshot.js/tree/master/src/networks](https://github.com/snapshot-labs/snapshot.js/tree/master/src/networks) 9 | 10 | -------------------------------------------------------------------------------- /plugins/README.md: -------------------------------------------------------------------------------- 1 | # Plugins 2 | 3 | -------------------------------------------------------------------------------- /plugins/aragon.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: On-chain settlement using Aragon Agreements 3 | --- 4 | 5 | # Aragon Agreements 6 | 7 | {% hint style="info" %} 8 | This plugin is still under development and not yet available. 9 | {% endhint %} 10 | 11 | {% embed url="https://aragon.org/blog/snapshot" caption="" %} 12 | 13 | -------------------------------------------------------------------------------- /plugins/create.md: -------------------------------------------------------------------------------- 1 | # Create a plugin 2 | 3 | Plugin is a way to add a feature for a proposal. Most of the time a plugin creates a new block in the proposal page with extra information or action buttons. 4 | 5 | The block “Quorum” on the right side of Yam is an example of plugin [https://snapshot.org/\#/yam.eth/proposal/QmRLiSZdXJLNaejrgpAL5bqzYefMxc4JJJ1GZSg9GtiCSW](https://snapshot.org/#/yam.eth/proposal/QmRLiSZdXJLNaejrgpAL5bqzYefMxc4JJJ1GZSg9GtiCSW) _\*\*_ 6 | 7 | Another example of plugin is a block "Gnosis Impact" [on Gnosis https://snapshot.org/\#/gnosis.eth/proposal/QmdjWuBnBnPUafW9jBNNsJJvaeQAVExGcFZ7zB38VtNuu4](https://snapshot.org/#/gnosis.eth/proposal/QmdjWuBnBnPUafW9jBNNsJJvaeQAVExGcFZ7zB38VtNuu4) 8 | 9 | You can find examples of plugins here: 10 | [https://github.com/snapshot-labs/snapshot-plugins/tree/master/src/plugins](https://github.com/snapshot-labs/snapshot-plugins/tree/master/src/plugins) 11 | [https://github.com/snapshot-labs/snapshot/tree/develop/src/components/Plugin](https://github.com/snapshot-labs/snapshot/tree/develop/src/components/Plugin) 12 | 13 | -------------------------------------------------------------------------------- /plugins/poap.md: -------------------------------------------------------------------------------- 1 | # POAP 2 | 3 | POAP are badges which are non fungible tokens \(NFT\). Each time you participate in an event, POAP collectors get a unique badge that is supported by a cryptographic record. _\*\*_With the POAP plugin you can reward voters on your space with a unique POAP for each of your Proposals on Snapshot. 4 | 5 | ## **Getting started** 6 | 7 | Here is a tutorial to setup POAP plugin on your Snapshot space: 8 | 9 | * Go to your settings page on Snapshot [https://snapshot.org/\#/domain.eth/setting](https://snapshot.org/#/domain.eth/settings) and click on the add plugin. 10 | 11 | ![](https://lh4.googleusercontent.com/zT0wtgjrvCywo_uHOKv7SESCPbhg0omPhj13TyrDVeSPQapMplSG-BNGzDTJ-QzuP9NgD71BWUy19njeJTFsJw0obYFK2-wgSln7TTTOUqIbu2tXyvZRPDIvwItd4g=s0) 12 | 13 | * Search for the POAP module and click on it. You do not need to add anything inside it. Just leave it as it is and press on “add”. 14 | 15 | ![](https://lh6.googleusercontent.com/Rx2KPaG5rx_jfwWmjherO2YJTMjJtdkU35biQEJlPUZXEfaaB6SG_qdw2G8BMZYywrfEaHtjxDamAYbReEJ214Zo4XodgGoYwTbLXo9-rpf1_edPSl2xitCPAHY2YA=s0) 16 | 17 | * Now save the setting from the top right corner and sign the transactions to save your settings. A POAP plugin has now been successfully added. A POAP plugin will automatically be added to all the new proposals you create. You do not need to add it manually. 18 | * _\*\*_Whenever you create a new proposal, you must save your Snapshot proposal ID from the url of the proposal. 19 | 20 | ![](https://lh3.googleusercontent.com/X1BF1pwn6cyPu0g7j0UJpq9Ys44PlleccP9Pf-U4PNHU1cVVstF6ldQunrTLY97o88_8Vi_RbnDiLSmHCelGSm3-iZP05G8Mr2Qy1r5bjfJypPIpkdO2PnfdycNcyQ=s0) 21 | 22 | * Create a POAP event by going to the link [https://app.poap.xyz/admin/events](https://app.poap.xyz/admin/events). Click on ‘Create new POAP’. Make sure you comply with all the image requirements. After creating the POAP event, you will receive a confirmation email which will indicate that you reply with the amount of codes you need for the attendees of your event. This is not necessary for the plugin to work. _\*\*_ 23 | 24 | ![](https://lh6.googleusercontent.com/jcfVETtJQps-PoHVJNJw3gyz6A7_0b6wKY6aJnK4YsXJWza9-IC2oXY736ZFptTgu8IWPLjEqdHQZXuKNQwahNe2jt9jMAdJb92oj2I0ioH35iJyiU0IrR-8Jp4lRw=s0) 25 | 26 | * Link your POAP event ID to Snapshot proposal ID by contacting the POAP team via discord or telegram. 27 | * Once the event and Proposal is linked, each voter will be able to claim their special POAP. _\*\*_ 28 | 29 | You can also check out a tutorial guide to set up POAP plugin for your Snapshot space [https://tomso11.medium.com/how-to-set-up-poap-snapshot-plugin-f8006eb5ab88](https://tomso11.medium.com/how-to-set-up-poap-snapshot-plugin-f8006eb5ab88) 30 | 31 | ## Support 32 | 33 | Join POAP Discord: [http://poap.xyz/discord](http://poap.xyz/discord) 34 | Join Snapshot Discord: [https://discord.snapshot.org](https://discord.snapshot.org/) 35 | 36 | -------------------------------------------------------------------------------- /plugins/safesnap.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Combine the Gnosis Safe with Snapshot 3 | --- 4 | 5 | # SafeSnap 6 | 7 | With help of SafeSnap and Gnosis Safe, you can have a trustless on-chain execution of off-chain votes. 8 | 9 | {% embed url="https://blog.gnosis.pm/introducing-safesnap-the-first-in-a-decentralized-governance-tool-suite-for-the-gnosis-safe-ea67eb95c34f" caption="" %} 10 | 11 | ## Setup 12 | 13 | Here is the official guide on how to setup a SafeSnap for your project: 14 | 15 | {% embed url="https://github.com/gnosis/dao-module/blob/main/docs/setup\_guide.md" caption="" %} 16 | 17 | Learn more about SafeSnap in this video: 18 | 19 | {% embed url="https://www.youtube.com/watch?v=ncDeEuJfVkg" caption="" %} 20 | 21 | -------------------------------------------------------------------------------- /proposals.md: -------------------------------------------------------------------------------- 1 | # Proposals 2 | 3 | ### Create a proposal 4 | 5 | {% page-ref page="guides/create-a-proposal.md" %} 6 | 7 | ### Vote on a proposal 8 | 9 | {% page-ref page="guides/vote-for-a-proposal.md" %} 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /proposals/README.md: -------------------------------------------------------------------------------- 1 | # Proposals 2 | 3 | ## Create a proposal 4 | 5 | {% page-ref page="create.md" %} 6 | 7 | ## Vote on a proposal 8 | 9 | {% page-ref page="vote.md" %} 10 | 11 | -------------------------------------------------------------------------------- /proposals/create.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Learn how to create a proposal. 3 | --- 4 | 5 | # Create a proposal 6 | 7 | ## How to create a proposal? 8 | 9 | * Go to a project space and click on connect wallet in top right corner 10 | * Connect with wallet provider where you hold relevant tokens and click on “New Proposal” 11 | * Fill out the Title and summary of your proposal. 12 | * Go to the “Actions” box and select the Voting type options, start date and end date of your proposal. Make sure you allow enough time for voting. 13 | * Use the default Snapshot block number or you can change it according to your needs. The block number is the snapshot where the balance of voters will be counted. 14 | * Click on “Publish” and your proposal is created! 15 | 16 | ## **Add a Snapshot block number** 17 | 18 | This number is important to lock the state of community members who are able to vote. Note that only the community members who hold relevant amounts of tokens at the time of creation of **Snapshot block number** would be able to vote on the proposal. _\*\*_ 19 | 20 | When you create a proposal, by default the "snapshot block number" will be populated with the latest block sync from our node. You can use this default number while creating a proposal. 21 | 22 | * You can click the "?" top right the snapshot website, and get the blocknumber from there. 23 | * Or just look at [etherscan.io/blocks](https://etherscan.io/blocks) and use the last block number. 24 | 25 | Depending on the settings of the space, either everyone holding a sufficient amount of tokens can vote or only members holding a sufficient amount of tokens can submit a proposal. 26 | 27 | -------------------------------------------------------------------------------- /proposals/vote.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Submit your vote on a proposal. 3 | --- 4 | 5 | # Vote on a proposal 6 | 7 | In order to vote on the given proposal, you need to have a sufficient amount of tokens at the time when the block was created. This means that if you attempt to vote on a proposal and block number is in the past, and you were not holding the required token yet, your vote will not be counted. 8 | 9 | 1. Go to your project's snapshot.page 10 | 2. Click on “Connect wallet” button in top right corner 11 | 3. Connect with wallet provider where you hold relevant token 12 | 4. Click on the option you want to vote for 13 | 5. Sign the message via your wallet and done 14 | 15 | -------------------------------------------------------------------------------- /proposals/voting-types.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Learn more about the different ways you can vote on Snapshot 3 | --- 4 | 5 | # Voting types 6 | 7 | {% hint style="info" %} 8 | Snapshot supports a number of different voting types and we plan to support many more in the future. If you would like to request a new voting type, please open a feature request here [https://features.snapshot.org/feature-requests](https://features.snapshot.org/feature-requests) 9 | {% endhint %} 10 | 11 | ## Single choice voting 12 | 13 | Each voter may select a single choice to give his total voting power to. 14 | 15 | ## Approval voting 16 | 17 | Each voter may select \("approve"\) any number of choices, each selected choice will receive the full voting power. 18 | 19 | ## Quadratic voting 20 | 21 | Each voter may spread voting power across any number of choices. The results are calculated quadratically, you can test out these calculations here [https://wtfisqf.com/](https://wtfisqf.com/) 22 | 23 | ## Ranked choice voting \(IRV\) 24 | 25 | Each voter may rank any number of choices. Votes are initially counted for each voter's top choice. If a candidate has more than half of the vote based on first-choices, that choice wins. If not, then the choice with the fewest votes is eliminated. The voters who selected the defeated choice as a first choice then have their votes added to the totals of their next choice. This process continues until a choice has more than half of the votes. When the field is reduced to two, it has become an "instant runoff" that allows a comparison of the top two choice head-to-head. 26 | 27 | ## Weighted voting 28 | 29 | Each voter may spread voting power across any number of choices. This voting method was first introduced by Float Protocol with [https://scattershot.page](https://scattershot.page/) \(a fork of Snapshot\). 30 | 31 | -------------------------------------------------------------------------------- /snapshot.js.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: The official JavaScript client for build Snapshot apps. 3 | --- 4 | 5 | # Snapshot.js 6 | 7 | {% embed url="https://github.com/snapshot-labs/snapshot.js" caption="" %} 8 | 9 | ## **Utils** 10 | 11 | ## **getProvider** 12 | 13 | Return a Ethers.js JsonRPCProvider connected to an archive node. 14 | 15 | ```javascript 16 | import snapshot from '@snapshot-labs/snapshot.js'; 17 | 18 | const network = '1'; 19 | const provider = snapshot.utils.getProvider(network); 20 | ``` 21 | 22 | ## **getScores** 23 | 24 | Calculate voting power for a list of voters. 25 | 26 | ```javascript 27 | import snapshot from '@snapshot-labs/snapshot.js'; 28 | 29 | const space = 'yam.eth'; 30 | const strategies = [ 31 | { 32 | name: 'erc20-balance-of', 33 | params: { 34 | address: '0x6B175474E89094C44Da98b954EedeAC495271d0F', 35 | symbol: 'DAI', 36 | decimals: 18 37 | } 38 | } 39 | ]; 40 | const network = '1'; 41 | const provider = snapshot.utils.getProvider(network); 42 | const voters = [ 43 | '0xa478c2975ab1ea89e8196811f51a7b7ade33eb11', 44 | '0xeF8305E140ac520225DAf050e2f71d5fBcC543e7', 45 | '0x1E1A51E25f2816335cA436D65e9Af7694BE232ad' 46 | ]; 47 | const blockNumber = 11437846; 48 | 49 | snapshot.utils.getScores( 50 | space, 51 | strategies, 52 | network, 53 | provider, 54 | voters, 55 | blockNumber 56 | ).then(scores => { 57 | console.log('Scores', scores); 58 | }); 59 | ``` 60 | 61 | -------------------------------------------------------------------------------- /spaces.md: -------------------------------------------------------------------------------- 1 | # Spaces 2 | 3 | ### Create a space 4 | 5 | {% page-ref page="guides/create-a-space.md" %} 6 | 7 | ### Migrate a space 8 | 9 | {% page-ref page="guides/migrate-your-space-to-ens.md" %} 10 | 11 | ### Avatars 12 | 13 | {% page-ref page="guides/add-avatars.md" %} 14 | 15 | ### Skins 16 | 17 | {% page-ref page="guides/add-a-skin.md" %} 18 | 19 | ### Custom domain 20 | 21 | {% page-ref page="guides/add-a-custom-domain.md" %} 22 | 23 | -------------------------------------------------------------------------------- /spaces/README.md: -------------------------------------------------------------------------------- 1 | # Spaces 2 | 3 | ## Create a space 4 | 5 | {% page-ref page="create.md" %} 6 | 7 | ## Migrate a space 8 | 9 | {% page-ref page="migrate.md" %} 10 | 11 | ## Avatars 12 | 13 | {% page-ref page="../guides/archived/add-avatar.md" %} 14 | 15 | ## Skins 16 | 17 | {% page-ref page="add-skin.md" %} 18 | 19 | ## Custom domain 20 | 21 | {% page-ref page="add-custom-domain.md" %} 22 | 23 | -------------------------------------------------------------------------------- /spaces/add-avatar.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Avatars are optional. 3 | --- 4 | 5 | # Add an avatar 6 | 7 | To get a logo for your space, images you need to do a pull request on this repository: 8 | 9 | {% embed url="https://github.com/snapshot-labs/snapshot-spaces" %} 10 | 11 | #### Follow the Snapshot spaces directory tree 12 | 13 | ```bash 14 | └── spaces 15 | └── my-space.eth 16 | ├── logo.png 17 | └── space.png 18 | ``` 19 | 20 | ### **Add your space logo and strategy image\(s\)** 21 | 22 | You will need to create a folder with the id of your space \(example: "my-space.eth"\). In this folder you need a file "space.png" and "logo.png" \(for the first strategy\) and "logo1.png" if you have a second strategy. 23 | 24 | {% hint style="danger" %} 25 | All the images must be squared and less than 50kb. 26 | {% endhint %} 27 | 28 | {% hint style="info" %} 29 | After committing your PR, you will have to wait for the merge of your PR to be able to see your images live. This process can take a few hours. 30 | {% endhint %} 31 | 32 | -------------------------------------------------------------------------------- /spaces/add-custom-domain.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Custom domain is optional. 3 | --- 4 | 5 | # Add a custom domain 6 | 7 | As you already have a domain with ENS, adding a custom domain is optional. Custom domain allows you to get the interface for a specific space on a custom domain. E.g., _\*\*_ [https://vote.balancer.fi/\#/](https://vote.balancer.fi/#/) 8 | 9 | To add a custom domain you need to do a pull request on this repository: 10 | 11 | {% embed url="https://github.com/snapshot-labs/snapshot-spaces" caption="" %} 12 | 13 | ### Follow the Snapshot spaces directory tree 14 | 15 | ```bash 16 | └── spaces 17 | └── domains.json 18 | ``` 19 | 20 | ## Add a custom domain 21 | 22 | ### Set it in the Domain name field 23 | 24 | To add a custom domain, fill in the Domain name field in your settings. 25 | 26 | ![Domain name field in Snapshot settings.](../.gitbook/assets/capture-de-cran-2020-12-30-a-09.34.49.png) 27 | 28 | ### Insert it in the domains**.json file** list 29 | 30 | To add your subdomain to Snapshot, you need to **edit the** **domains.json** file below. 31 | 32 | {% embed url="https://github.com/snapshot-labs/snapshot-spaces/blob/master/spaces/domains.json" caption="Add you custom domain in the domains.json file" %} 33 | 34 | {% hint style="warning" %} 35 | To prevent conflicts, it is recommended to add your subdomain between two existing domains rather than at the end or beginning of the list, as in the example below. 36 | {% endhint %} 37 | 38 | ```javascript 39 | { 40 | ... 41 | "other.domain.com": "ens.eth", 42 | "my.custom.url": "my-space.eth", 43 | "other.domain.com": "ens.eth", 44 | ... 45 | } 46 | ``` 47 | 48 | ### Configure your DNS 49 | 50 | You will need to add this as CNAME in your domain DNS `snapshotpage.b-cdn.net` 51 | 52 | {% hint style="info" %} 53 | After committing your PR, you will have to wait for the merge and the deployment of your PR to be able to get your domain live. This process can take a few hours. 54 | {% endhint %} 55 | 56 | -------------------------------------------------------------------------------- /spaces/add-skin.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Skins are optional. 3 | --- 4 | 5 | # Add a skin 6 | 7 | To create your own skin you need to do a pull request on this repository: 8 | 9 | {% embed url="https://github.com/snapshot-labs/snapshot-spaces" caption="" %} 10 | 11 | ### Follow the Snapshot skins directory tree 12 | 13 | ```bash 14 | └── skins 15 | └── my-space.scss 16 | ``` 17 | 18 | ## Add your skin 19 | 20 | To add your skin you will need to create a "my-space.scss" file in the "skins" directory. 21 | 22 | ```css 23 | .my-space { 24 | --primary-color: #384aff; 25 | --bg-color: white; 26 | --text-color: #586069; 27 | --link-color: #111111; 28 | --heading-color: #111111; 29 | --border-color: #d1d5da; 30 | --header-bg: white; 31 | --block-bg: transparent; 32 | } 33 | ``` 34 | 35 | {% hint style="danger" %} 36 | Change the file name **my-space.scss** and css selector **.my-space** with your space name. 37 | {% endhint %} 38 | 39 | Then you will also need to list your skin on this file: [https://github.com/snapshot-labs/snapshot-spaces/blob/master/skins/index.js](https://github.com/snapshot-labs/snapshot-spaces/blob/master/skins/index.js) 40 | 41 | Select then your skin in the Skin field in your space settings. 42 | 43 | ![Snapshot skin selector.](../.gitbook/assets/capture-de-cran-2020-12-30-a-09.33.58.png) 44 | 45 | {% hint style="info" %} 46 | After committing your PR, you will have to wait for the merge and the deployment of your PR to be able to select your skin available. This process can take a few hours. 47 | {% endhint %} 48 | 49 | -------------------------------------------------------------------------------- /spaces/alternative-way-to-create-a-space.md: -------------------------------------------------------------------------------- 1 | # Alternative way to create a space 2 | 3 | If you do not want to have the wallet control your settings, you can follow the steps below to create a space on Snapshot. 4 | 5 | ## **Drawbacks** 6 | 7 | * You will not be able to change settings from the UI 8 | * Every time you want to change the settings, you will need to broadcast a new transaction 9 | 10 | ## **How to Create Space** 11 | 12 | * Create a json file for your settings on Snapshot. The format of json file could be as follows: _\*\*_[https://github.com/snapshot-labs/snapshot.js/blob/master/test/examples/space.json](https://github.com/snapshot-labs/snapshot.js/blob/master/test/examples/space.json) 13 | * Store the json file on IPFS 14 | * Use the IPFS link on the ENS text record. This will make the ENS owner the only controller of the settings. _\*\*_ 15 | 16 | ![](https://lh6.googleusercontent.com/qfA-Pj7o2Fvld76V2gZIJm9U1V0uRBgNdedfxU4iKjGDfE3cHH7KLMx26eawZPD0Zl8j3H7AAfFsToDdl9ViQ5Y7WyI8FACqVlkc5JG9zwcyZg877KmnH6cf2vleHnn-icWLGTg=s0) 17 | 18 | * You can check if your space is in valid format from the github link below [https://github.com/snapshot-labs/snapshot.js/blob/a0adc547aa0922aa6abd35708a4a292048bca6a2/test/schema.ts\#L4](https://github.com/snapshot-labs/snapshot.js/blob/a0adc547aa0922aa6abd35708a4a292048bca6a2/test/schema.ts#L4) 19 | 20 | -------------------------------------------------------------------------------- /spaces/before-creating-your-space.md: -------------------------------------------------------------------------------- 1 | # Before creating your space 2 | 3 | To create your space on Snapshot, you will need to have an ENS domain. This page will take you through the steps to create an ENS domain. You need an ENS domain on Ethereum mainnet even if you want to use Ethereum testnet or any other networks \(Binance Smart Chain, xDAI... etc\). 4 | 5 | If you already have an ENS domain, feel free to skip this and follow the guide below. [https://docs.snapshot.org/spaces/create](https://docs.snapshot.org/spaces/create) 6 | 7 | If you have never registered an ENS before or need help then checkout this guide: [https://docs.ens.domains/dns-registrar-guide](https://docs.ens.domains/dns-registrar-guide)​ or follow the following steps below. 8 | 9 | ## **Creating an ENS Domain** 10 | 11 | **1.** Search for the availability of your name on ENS by going to the following link [https://app.ens.domains/](https://app.ens.domains/) 12 | 13 | **2.** If the name is available, you would be able to see the 3 steps and fee for registration. Please note that the names with 3 or 4 characters cost considerably more than the names with 5+ characters. 14 | 15 | ![](https://lh6.googleusercontent.com/iE8w0jmuNrDV7jtpFPUYxB0rgSF6SKpU8OTNdVlvMaYaem1MzHglWQ9S99h2Ub-PWVJTDvOBbxGKA_7OuNHe6-YIt003oEdvudCZG37xAuUXSmJP5PXl-1By7s8betevYzuID3c=s0) 16 | 17 | **3.** Connect to the wallet of your choice by pressing on the connect key on the top left corner of your screen. Make sure your wallet has enough balance to make the transaction successful. 18 | 19 | **4.** Confirm all the transactions for the three steps from your chosen wallet. 20 | 21 | ![](https://lh5.googleusercontent.com/d11GatKZ1P25f-uE1RphuiPEEf1V5ni-zX4hF4CKJYWaZUKWojmdbDw5wxxudYRVJMzoGxmP9MNhsh-lYVJEWdFu5zurWD1DXOkoYr6gMznyIRf0roFCuBXaimPdbmiqx_QNnqY=s0) 22 | 23 | **5.** You have now successfully registered on ENS! Additionally, you can also make your Ethereum address point to an ENS name by clicking on ‘Set Reverse Record’ or by going to ‘My Account’ and then selecting ‘Reverse record’ and completing the transaction. 24 | 25 | **Congratulations! Now you have created your domain on ENS. You are now ready to start creating your space on Snapshot.** 26 | 27 | -------------------------------------------------------------------------------- /spaces/create-a-space.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Create your own space on Snapshot! 3 | --- 4 | 5 | # Create a space 6 | 7 | ## **1: Fork Snapshot spaces repository here** 8 | 9 | {% embed url="https://github.com/bonustrack/snapshot-spaces" caption="" %} 10 | 11 | ## **2: Copy the space example folder** 12 | 13 | {% embed url="https://github.com/bonustrack/snapshot-spaces/tree/master/spaces/example" caption="" %} 14 | 15 | ```text 16 | |-- spaces 17 | |-- example 18 | |-- index.json 19 | |-- logo.png 20 | |-- skin.scss 21 | |-- space.png 22 | ``` 23 | 24 | ## **3: Change your space metadata** 25 | 26 | * The name of the folder must be the key of your space. 27 | * This key also corresponds to the slug url and must not be composed with uppercase characters. `"key": "example"` to `"key": "my-space"` 28 | 29 | `index.json` 30 | 31 | ```javascript 32 | { 33 | "key": "example", // This will be the url of your space 34 | "name": "Example", // Name of the space (max 12 chars) 35 | "chainId": 1, // ID of the blockchain network 36 | "decimals": 18, // Number of decimals in the token 37 | "symbol": "EXAMPLE", // Symbol of the base token 38 | "defaultView": "core", // The default tab to see in your space 39 | "address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", // The address of the base token 40 | "token": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", // The same address of the base token 41 | "core": [ // List of official addresses that can post in "Core" tab of your space 42 | "0xeF8305E140ac520225DAf050e2f71d5fBcC543e7" 43 | ], 44 | "min": 123, // Minimum balance to have from the base token to have your proposal visible in the space (unless the address is a core address) 45 | "invalid": [ 46 | "QmXAZP8tYwX2zZz5EzfxLZUYJt6TM9EmxY1L4qodhZ5zcZ" 47 | ] // List of proposal ids, use this to remove a proposal from your space 48 | } 49 | ``` 50 | 51 | ## **4: Add a logo and space images** 52 | 53 | * You must add both `logo.png` and `space.png` images for your space with a size of 256 x 256 pixels. 54 | * The file size should not exceed `50KB`. 55 | 56 | ## **5: Create a skin \(optional\)** 57 | 58 | * If you want the default skin you can delete the file `skin.scss`. 59 | * If you want a skin you can change colors in the file `skin.scss` and change the `.name` to the id of your space. `.name` to `.my-space` 60 | 61 | `skin.scss` 62 | 63 | ```css 64 | .name { 65 | --primary-color: #384aff; 66 | --bg-color: white; 67 | --text-color: #586069; 68 | --link-color: #111111; 69 | --heading-color: #111111; 70 | --border-color: #d1d5da; 71 | --header-bg: white; 72 | --block-bg: transparent; 73 | } 74 | ``` 75 | 76 | ## **6: Make a pull request** 77 | 78 | * Please name your PR title on the model `Add SYMBOL space` 79 | * It may take 1 or 2 days to get your PR reviewed , merged and appear on Snapshot. 80 | 81 | -------------------------------------------------------------------------------- /spaces/create.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: To create a space in Snapshot follow these steps. 3 | --- 4 | 5 | # Create a space 6 | 7 | {% hint style="info" %} 8 | If you already have a space with GitHub see how to [Migrate your space to ENS](https://docs.snapshot.page/spaces/migrate). 9 | {% endhint %} 10 | 11 | ## 1. Get an ENS domain for your space 12 | 13 | You will need an ENS domain for creating your space, register one here: 14 | [https://app.ens.domains](https://app.ens.domains/) 15 | 16 | _You need an ENS domain on **Ethereum mainnet** even if you want to use Ethereum testnets or others networks \(Binance Smart Chain, xDAI... etc\)._ 17 | 18 | If you have never registered an ENS before or need help then checkout this guide:[ https://docs.ens.domains/dns-registrar-guide](https://docs.ens.domains/dns-registrar-guide) 19 | 20 | ## 2. Link your ENS domain to Snapshot 21 | 22 | Once you have created your ENS domain, Go to this url and modify the tag with your ENS domain. `https://snapshot.org/#/`**``**`/settings` and login with the wallet that owns the ENS domain. 23 | 24 | ![Access your space settings](../.gitbook/assets/access-to-your-space-settings.png) 25 | 26 | Once connected, the **<your-address>** tag will be replaced with your wallet address. 27 | 28 | {% hint style="info" %} 29 | You will need a wallet that can sign message like MetaMask, Fortmatic, Portis, Argent. Don't use a Gnosis Safe has they are currently not supported. 30 | {% endhint %} 31 | 32 | ![Set your Snapshot IPNS link](../.gitbook/assets/set-your-ipns-link.png) 33 | 34 | If you are on your domain space and connected with your wallet you will see the correct **IPNS link** in the **ENS field**. Click on the button **Set record on ENS**, and you will get redirected to ENS page. 35 | 36 | * On the ENS page, click on **ADD/EDIT RECORD**. 37 | * Select **TEXT** and type the key **"snapshot"** in lowercase. 38 | * Paste the **IPNS link** in the field. 39 | * Click **Save**. 40 | * Scroll down and click **Confirm**. 41 | * Sign the transaction with your wallet. 42 | 43 | ![](../.gitbook/assets/snapshot%20%281%29.gif) 44 | 45 | ## **3. Setup your space settings** 46 | 47 | Refresh the Snapshot settings page `https://snapshot.org/#/`**``**`/settings` to see the space setting. 48 | 49 | ### Profile 50 | 51 | ![](../.gitbook/assets/profile-settings.png) 52 | 53 | * **Name** is the name that will be displayed in your space. 54 | * **About** is the description of your governance purposes. 55 | * **Avatar** is your project logo. 56 | * **Network** must be the network relative to your token. 57 | 58 | ![Select a network](../.gitbook/assets/select-a-network.png) 59 | 60 | * **Symbol** is the main token symbol that will be displayed in your space. 61 | * **Skin** can be left as a default, used as an existing one or you can [create your own skin](add-skin.md). 62 | 63 | ![Select a skin](../.gitbook/assets/select-a-skin.png) 64 | 65 | * **Twitter** and **Github** just add a username to link to your different accounts. 66 | * **Domain name** is optional but you can [add a custom domain](add-custom-domain.md). 67 | * **Terms** links to your website's terms and conditions. 68 | * **Hide space from homepage** if you want to keep your space "private". 69 | 70 | ### **Strategies** 71 | 72 | A strategy is a JavaScript function which defines how the voting power is calculated. You need to add a voting strategy for your proposals. erc20-balance-of is the most used strategy. You can have multiple strategies and can have your custom strategies as well. 73 | 74 | You need to add a voting strategy for your proposals. `erc20-balance-of` is the most used strategy. 75 | 76 | ![Add a strategy](../.gitbook/assets/add-a-strategy.png) 77 | 78 | {% hint style="info" %} 79 | You can add up to 5 strategies in your space. 80 | {% endhint %} 81 | 82 | Once selected, you can edit the strategy by clicking on it if you want to add your own token. 83 | 84 | ![](../.gitbook/assets/edit-a-strategy.png) 85 | 86 | More information here: 87 | 88 | {% page-ref page="../strategies/" %} 89 | 90 | ### Admins 91 | 92 | The admins will be able to edit the space settings and moderate proposals. You must add one address per line. 93 | 94 | ![Add admins' addresses](../.gitbook/assets/add-admins-addresses.png) 95 | 96 | ### Members 97 | 98 | Members will be able to create proposals without being constrained by filters. You must add one address per line. 99 | 100 | ![Add members' addresses](../.gitbook/assets/add-members-addresses.png) 101 | 102 | ### Filters 103 | 104 | * **Proposal threshold** is the minimum number of tokens required to create a proposal. 105 | * **Proposal validation** is a custom function to validate if someone can post a proposal or not. You can use the basic validation by default which takes your voting power with space strategies and checks if you pass a defined threshold. 106 | * **Allow only members to submit a proposal** makes sure that only members specified in members field are allowed to submit a proposal. 107 | 108 | ![](../.gitbook/assets/screenshot-179-.png) 109 | 110 | ### Plugins 111 | 112 | Plugins give extra features for your space. More information here: 113 | 114 | {% page-ref page="../plugins/" %} 115 | 116 | ## 4. Save your settings 117 | 118 | Click "**Save**" then confirm the action in your wallet. 119 | 120 | You are all set! You can go on `https://snapshot.org/#/` to see your space. 121 | 122 | ## What you can do now**?** 123 | 124 | {% page-ref page="add-skin.md" %} 125 | 126 | {% page-ref page="add-custom-domain.md" %} 127 | 128 | -------------------------------------------------------------------------------- /spaces/migrate.md: -------------------------------------------------------------------------------- 1 | # Migrate your space to ENS 2 | 3 | If you already have a space in Snapshot which does not have an ENS name, you need to migrate your space to ENS. The following guide takes through the procedures of how to successfully migrate your space to ENS. 4 | 5 | ## 1. Create a space with ENS 6 | 7 | To migrate your space you will need first to create the space with ENS. 8 | 9 | You can use this url to get your previous space settings populated in the form: [https://snapshot.page/\#/\*\*<ens\_space\_id>\*\*/settings/\*\*<previous\_space\_id>\*\*](https://snapshot.page/#/****/settings/****) 10 | Example: [https://snapshot.page/\#/\*\*yam.eth\*\*/settings/\*\*yam\*\*](https://snapshot.page/#/**yam.eth**/settings/**yam**) 11 | 12 | {% page-ref page="create.md" %} 13 | 14 | ## 2. Declare your new space alias 15 | 16 | To add your new space alias you need to do a pull request on this repository: 17 | 18 | {% embed url="https://github.com/snapshot-labs/snapshot-spaces" caption="" %} 19 | 20 | ### Follow the Snapshot spaces directory tree 21 | 22 | ```bash 23 | └── spaces 24 | └── aliases.json 25 | ``` 26 | 27 | You must add your new alias in the [aliases.json file](https://github.com/snapshot-labs/snapshot-spaces/blob/master/spaces/aliases.json) by following this example. 28 | 29 | ```javascript 30 | { 31 | "my-space": "my-space.eth" 32 | } 33 | ``` 34 | 35 | ## 3. Migrate proposals, votes and urls 36 | 37 | The migration of the proposals, votes and urls is done manually, once your space with ENS is ready please contact an admin on [Discord](https://discord.snapshot.page) to do the changes. 38 | 39 | You have now successfully migrated your space to ENS! The next guide will take you through steps for adding an avatar and skin for your space. 40 | 41 | -------------------------------------------------------------------------------- /spaces/space-roles.md: -------------------------------------------------------------------------------- 1 | # Space roles 2 | 3 | On a space there can be 3 different roles: 4 | 5 | **Controller** 6 | The controller of a space can edit the space settings including admins. 7 | 8 | **Admins** 9 | The admins can edit a space settings \(but not change the admins list\) and archive proposals. 10 | 11 | **Members** 12 | Members can post proposals regardless of their voting power. 13 | 14 | -------------------------------------------------------------------------------- /strategies.md: -------------------------------------------------------------------------------- 1 | # Strategies 2 | 3 | A strategy is a JavaScript function that returns a score for a set of addresses. Strategies are being used on Snapshot to calculate the result for a proposal. A proposal can have multiple strategies. The default strategy is to calculate the balance of an ERC20 for each voter. A strategy can send a call to a node or subgraph. 4 | 5 | **All the strategies are visible here:** [https://snapshot.page/\#/strategies](https://snapshot.page/#/strategies) 6 | 7 | ## 1: This is the default strategy used `erc20-balance-of`: 8 | 9 | {% embed url="https://github.com/bonustrack/snapshot.js/blob/master/src/strategies/erc20-balance-of/index.ts" caption="" %} 10 | 11 | ```javascript 12 | import { formatUnits } from '@ethersproject/units'; 13 | import { multicall } from '../../utils'; 14 | import { abi } from './TestToken.json'; 15 | 16 | export async function strategy(provider, addresses, options, snapshot) { 17 | const blockTag = typeof snapshot === 'number' ? snapshot : 'latest'; 18 | const response = await multicall( 19 | provider, 20 | abi, 21 | addresses.map((address: any) => [options.address, 'balanceOf', [address]]), 22 | { blockTag } 23 | ); 24 | return Object.fromEntries( 25 | response.map((value, i) => [ 26 | addresses[i], 27 | parseFloat(formatUnits(value.toString(), options.decimals)) 28 | ]) 29 | ); 30 | } 31 | ``` 32 | 33 | Strategies are defined in the space `index.json` file level. This is how to add strategies to calculate the balance of voters in BAL and balance of BAL in Balancer pools where they provide liquidity. 34 | 35 | {% embed url="https://github.com/bonustrack/snapshot-spaces/blob/master/spaces/balancer/index.json\#L20-L30" caption="" %} 36 | 37 | ```javascript 38 | { 39 | ... 40 | "strategies": [ 41 | [ 42 | "erc20-balance-of", 43 | { 44 | "address": "0xba100000625a3754423978a60c9317c58a424e3D", 45 | "symbol": "BAL", 46 | "decimals": 18 47 | } 48 | ], 49 | [ 50 | "balancer", 51 | { 52 | "address": "0xba100000625a3754423978a60c9317c58a424e3D", 53 | "symbol": "BAL BPT" 54 | } 55 | ] 56 | ] 57 | } 58 | ``` 59 | 60 | Strategies can be used to create a score from on-chain data, the data does not necessary need to be monetary, we can imagine a strategy that calculate how many POAP you own or use any other data available on-chain to issue a score. 61 | 62 | ## More strategies are on Snapshot.js here: 63 | 64 | {% embed url="https://github.com/bonustrack/snapshot.js/tree/master/src/strategies" caption="" %} 65 | 66 | -------------------------------------------------------------------------------- /strategies/README.md: -------------------------------------------------------------------------------- 1 | # Strategies 2 | 3 | ## What is a strategy 4 | 5 | {% page-ref page="what-is-a-strategy.md" %} 6 | 7 | ## Create a new strategy 8 | 9 | {% page-ref page="create.md" %} 10 | 11 | -------------------------------------------------------------------------------- /strategies/create.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Create a strategy and use it on your own space 3 | --- 4 | 5 | # Create a new strategy 6 | 7 | To add your own strategy on Snapshot you need to fork the **snapshot-strategies** repository and create pull request. 8 | 9 | {% embed url="https://github.com/snapshot-labs/snapshot-strategies" caption="" %} 10 | 11 | ## 1. Navigate to the **`src\strategies`** 12 | 13 | ```bash 14 | └── src 15 | └── strategies 16 | └── erc20-balance-of 17 | ``` 18 | 19 | ## 2. Create a copy of the **`erc20-balance-of`** strategy folder and rename it to the name of your strategy 20 | 21 | ## 3. Write the logic of your strategy, include it in\*\*`src\strategies\index.ts` and test it with: 22 | 23 | ```javascript 24 | npm run test --strategy= // replace 25 | ``` 26 | 27 | ## 4. Make sure you pass the checklist 28 | 29 | Have a look here on the requirements for adding a new strategy and make sure you full fill the points in the checklist: [https://github.com/snapshot-labs/snapshot.js/issues/212](https://github.com/snapshot-labs/snapshot.js/issues/212) 30 | 31 | ## 5. Create a pull request 32 | 33 | The team will then review your PR and after it's approved and merged it will be available in your space settings. 34 | 35 | -------------------------------------------------------------------------------- /strategies/what-is-a-strategy.md: -------------------------------------------------------------------------------- 1 | # What is a strategy? 2 | 3 | A strategy is a JavaScript function that returns a score for a set of addresses. Strategies are being used on Snapshot to calculate the result for a proposal. A proposal can have multiple strategies. The default strategy is to calculate the balance of an ERC20 for each voter. A strategy can send a call to a node or subgraph. 4 | 5 | ## Example strategy 6 | 7 | Here is an example with the most common strategy called `erc20-balance-of`. 8 | 9 | {% embed url="https://github.com/snapshot-labs/snapshot-strategies/blob/master/src/strategies/erc20-balance-of/index.ts" caption="" %} 10 | 11 | ```javascript 12 | import { formatUnits } from "@ethersproject/units"; 13 | import { multicall } from "../../utils"; 14 | import { abi } from "./TestToken.json"; 15 | 16 | export async function strategy( 17 | space, 18 | network, 19 | provider, 20 | addresses, 21 | options, 22 | snapshot 23 | ) { 24 | const blockTag = typeof snapshot === "number" ? snapshot : "latest"; 25 | const response = await multicall( 26 | network, 27 | provider, 28 | abi, 29 | addresses.map((address: any) => [options.address, "balanceOf", [address]]), 30 | { blockTag } 31 | ); 32 | return Object.fromEntries( 33 | response.map((value, i) => [ 34 | addresses[i], 35 | parseFloat(formatUnits(value.toString(), options.decimals)), 36 | ]) 37 | ); 38 | } 39 | ``` 40 | 41 | Strategies are defined in your space settings at `https://snapshot.page/#//settings`. This is an example how to add a strategy to calculate the voting power in BAL and BAL that is in Balancer pools, where they are providing liquidity. 42 | 43 | The `erc20-balance-of` strategy setting: 44 | 45 | ```javascript 46 | { 47 | "address": "0xba100000625a3754423978a60c9317c58a424e3D", 48 | "symbol": "BAL", 49 | "decimals": 18 50 | } 51 | ``` 52 | 53 | The `balancer` strategy setting: 54 | 55 | ```javascript 56 | { 57 | "address": "0xba100000625a3754423978a60c9317c58a424e3D", 58 | "symbol": "BAL BPT" 59 | } 60 | ``` 61 | 62 | Strategies can be used to create a score from on-chain data, the data does not necessary need to be monetary, you can imagine a strategy that calculate how many POAP you own or use any other data available on-chain to issue a score. 63 | 64 | ### **Other Common strategies** 65 | 66 | * **erc20-with-balance** is an example of strategy that checks whether the participant has a minimum amount of token required to vote and assigns all the votes to 1. You need to add the parameter “minBalance” and set it equal to the minimum balance required to vote on a proposal. This value is set to 0 by default. 67 | * **erc20-balance-of-delegate** is used if you want to use a delegation contract along with erc20-balance-of. 68 | 69 | ### Find more strategies here: 70 | 71 | {% embed url="https://github.com/snapshot-labs/snapshot-strategies/blob/master/src/strategies" caption="" %} 72 | 73 | -------------------------------------------------------------------------------- /webhooks.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Receive event notifications with webhooks 3 | --- 4 | 5 | # Webhooks 6 | 7 | Snapshot uses webhooks to notify your application when an event happens. Webhooks are particularly useful for asynchronous events like when a proposal is created, when it start or when it end. 8 | 9 | The webhook server send requests for any new event, the request are sent to custom url with `POST` method and the event object as body. 10 | 11 | **Here is an example of event object:** 12 | 13 | ```javascript 14 | { 15 | id: 'proposal/QmZ21uS8tVucpaNq2LZCbZUmHhYYXunC1ZS2gPDNWwPWD9', 16 | event: 'proposal/created', 17 | space: 'yam.eth', 18 | expire: 1620947058 19 | } 20 | ``` 21 | 22 | **Here are the possible events:** 23 | 24 | `proposal/created` 25 | When a new proposal is created 26 | 27 | `proposal/start` 28 | When the voting period for a proposal start. 29 | 30 | `proposal/end` 31 | When the voting period for a proposal end. 32 | 33 | `proposal/deleted` 34 | When a proposal is deleted by the author or an admin of the space. 35 | 36 | ## Subscribe to events 37 | 38 | If you want to subscribe to webhooks please contact us on Discord or Telegram. You will need to provide an URL to receive the webhooks requests. 39 | 40 | --------------------------------------------------------------------------------