Skip to content

Commit

Permalink
readme added for multichain and delegation (snapshot-labs#78)
Browse files Browse the repository at this point in the history
* Create README.md

* Create README.md
  • Loading branch information
SingularSpace authored Sep 29, 2021
1 parent 9cee15f commit 1958ba7
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 0 deletions.
33 changes: 33 additions & 0 deletions src/strategies/delegation/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# delegation

If you want to delegate your voting power to another wallet address, you can do this using the “delegation strategy”. In delegation strategy, if A delegates to B and both of them vote, then the delegated voting power is not calculated. Only the vote of A will be calculated. The vote of B will be counted if A does not vote.

In delegation strategy, the sub strategies defined in params are used to delegate vote from one address to another.


Here is an example of parameters:

```json
{
"symbol": "YFI (delegated)",
"strategies": [
{
"name": "erc20-balance-of",
"params": {
"address": "0xBa37B002AbaFDd8E89a1995dA52740bbC013D992",
"symbol": "YFI",
"decimals": 18
}
},
{
"name": "yearn-vault",
"params": {
"address": "0xBA2E7Fed597fd0E3e70f5130BcDbbFE06bB94fe1",
"symbol": "YFI (yYFI)",
"decimals": 18
}
}
]
}

```
55 changes: 55 additions & 0 deletions src/strategies/multichain/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# multichain

If you want to calculate the balance from various chains like Ethereum, Binance smart chain, polygon etc. and use them for voting using various strategies, you can do it by using a strategy called “multichain strategy”. This allows cross chain voting in which multiple chains can be used together to calculate the voting power.

In multichain strategy, the params should define sub strategies which would use different networks mentioned in the field to combine the voting power.

Here is an example of parameters:

In the below example, the tokens on the three networks namely ethereum, polygon and bsc denotes combined voting power.


```json
{
"symbol": "MULTI",
"strategies": [
{
"name": "erc20-balance-of",
"network": "1",
"params": {
"address": "0x579cea1889991f68acc35ff5c3dd0621ff29b0c9",
"decimals": 18
}
},
{
"name": "erc20-balance-of",
"network": "137",
"params": {
"address": "0xB9638272aD6998708de56BBC0A290a1dE534a578",
"decimals": 18
}
},
{
"name": "erc20-balance-of",
"network": "56",
"params": {
"address": "0x0e37d70b51ffa2b98b4d34a5712c5291115464e3",
"decimals": 18
}
},
{
"name": "erc20-balance-of",
"network": 137,
"params": {
"address": "0xfC0fA725E8fB4D87c38EcE56e8852258219C64Ee",
"decimals": 18
}
}
],
"graphs": {
"56": "https://api.thegraph.com/subgraphs/name/apyvision/block-info",
"137": "https://api.thegraph.com/subgraphs/name/sameepsi/maticblocks"
}
}

```

0 comments on commit 1958ba7

Please sign in to comment.