Skip to content

Commit d463077

Browse files
authored
Merge pull request #19 from MetaFactoryAI/ops-distro-2
SourceCred Ops Distro 2
2 parents 3eafc65 + adf967b commit d463077

12 files changed

Lines changed: 1992 additions & 39 deletions

File tree

.github/workflows/distribute-grain.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ name: Distribute Grain
22
on:
33
# A new Cred interval every Sunday. We'll distribute Grain 5 minutes
44
# after the new interval
5-
schedule:
6-
- cron: 5 0 * * 0 # 00:05 UTC, 16:05 PST
5+
# schedule:
6+
# - cron: 5 0 * * 0 # 00:05 UTC, 16:05 PST
77
push:
88
branches:
99
# allows us to test this workflow, or manually generate distributions

config/dependencies.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[
22
{
3-
"autoActivateOnIdentityCreation": false,
3+
"autoActivateOnIdentityCreation": true,
44
"autoInjectStartingPeriodWeight": 0.025,
55
"id": "wr8IQYoYvXtQT3N8l3lETg",
66
"name": "SourceCred",

config/grain.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"immediatePerWeek": 0,
3-
"balancedPerWeek": 2500,
4-
"maxSimultaneousDistributions": 4
3+
"balancedPerWeek": 3000,
4+
"maxSimultaneousDistributions": 5
55
}

config/plugins/sourcecred/ethereum/ethereumAddresses.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
"0xb46D0E74676886D00522692BD1d9EB5a56207659",
4949
"0xEf39EfD2f4D0A4cdEe2bA0a9242AcdaC54333082",
5050
"0x7C4706ff06c82dEf5Aa1238DE12DcDdbFcdcF29B",
51+
"0x9D2CaBfBaE45cadf22934933e8460425d9E15Ee5",
5152
"0xFaf878dCD715ae2eeffC33183B36a54D48061A16",
5253
"0x35764Fd659509f60C9531F27fDb5305F85A1398B",
5354
"0x52d81d4a8b18D6BA0b2c01dd2f9927eAf755dd0a",
@@ -94,6 +95,16 @@
9495
"0x33DebB5Ee65549FFA71116957Da6db17A9D8fe57",
9596
"0x9bcdc7db2f57b0f960a737ccc29373a9bc760134",
9697
"0x615b044b6ccb048532bcf99aadf619d7fdd2aa01",
97-
"0x1cB447C1B7c591537Fa4e8259A50DC75C1ec7140"
98+
"0x1cB447C1B7c591537Fa4e8259A50DC75C1ec7140",
99+
"0x59b917a9e10ece44fae8b651f8c351ef2647dcca",
100+
"0x00000000005dbcb0d0513fcda746382fe8a53468",
101+
"0x9FeCf056375A973308bB3D6fb6b1c230CfD21456",
102+
"0xF91569595BCDAF780c3f1662f204E157949af8b2",
103+
"0xe6c21d1bacadc972e2874ef5b6cd09f38051d83c",
104+
"0x8913b99d5efd9e391ade59168230f6425813d90a",
105+
"0x9bcb319bed50ff0ce2d6ffa95ab9293a175aed7d",
106+
"0x0eF9e2f7403C8a8aAFBaDcd83d5575d4B6fde501",
107+
"0x29602B0f283E0db6F315573d0dAcd6e578eE7534",
108+
"0xF0CAd7C8b383f79A879eB6Df644e336234EBDac8"
98109
]
99110
]

config/plugins/sourcecred/initiatives/initiatives/2021-02-fashion-production.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@
2727
"timestampIso": "2021-04-05T10:00:00.000Z",
2828
"weight": 13,
2929
"contributors": ["@Rickard"]
30+
},
31+
{
32+
"title": "Jush Partnership",
33+
"timestampIso": "2021-04-05T10:00:00.000Z",
34+
"weight": 13,
35+
"contributors": ["@Anando", "@Urna"]
3036
}
3137
]
3238
}

config/weights.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
"nodeWeights": {
1818
"N\u0000sourcecred\u0000discourse\u0000": 0.75,
1919
"N\u0000sourcecred\u0000discord\u0000": 0.5,
20-
"N\u0000sourcecred\u0000initiatives\u0000initiative\u0000": 20,
21-
"N\u0000sourcecred\u0000initiatives\u0000CONTRIBUTION\u0000": 12
20+
"N\u0000sourcecred\u0000initiatives\u0000initiative\u0000": 16,
21+
"N\u0000sourcecred\u0000initiatives\u0000CONTRIBUTION\u0000": 8
2222
}
2323
}
2424
]

data/ledger.json

Lines changed: 40 additions & 4 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
"license": "MIT",
88
"private": true,
99
"dependencies": {
10-
"sourcecred": "0.9.0"
10+
"sourcecred": "0.9.0",
11+
"web3": "1.3.0",
12+
"web3-utils": "1.3.0"
1113
},
1214
"scripts": {
1315
"clean": "rimraf cache site",

scripts/contributions.js

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
const fs = require("fs-extra")
2+
const _ = require('lodash');
3+
const { request } = require('graphql-request');
4+
5+
const query = `{
6+
contributions {
7+
weight
8+
votes {
9+
rating
10+
}
11+
title
12+
id
13+
date
14+
contributors {
15+
contribution_share
16+
user {
17+
eth_address
18+
name
19+
}
20+
}
21+
}
22+
}
23+
`;
24+
25+
const getRatingWeight = (rating) => {
26+
switch (rating) {
27+
case 'legendary':
28+
return 12;
29+
case 'epic':
30+
return 6;
31+
case 'rare':
32+
return 3;
33+
case 'common':
34+
return 1;
35+
}
36+
}
37+
38+
39+
(async function() {
40+
const { contributions } = await request('https://metafactory.hasura.app/v1/graphql', query)
41+
42+
const voted = _(contributions)
43+
.map(c => ({
44+
...c,
45+
voteWeight: c.votes.reduce((total, v) => total += getRatingWeight(v.rating), 0),
46+
}))
47+
.sortBy('voteWeight')
48+
.value();
49+
50+
console.log(data);
51+
52+
53+
})()

scripts/opsDistroDisperse.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[0xF91569595BCDAF780c3f1662f204E157949af8b2,0x9D2CaBfBaE45cadf22934933e8460425d9E15Ee5,0xfaCEf700458D4Fc9746F7f3e0d37B462711fF09e,0x33DebB5Ee65549FFA71116957Da6db17A9D8fe57,0x68d36DcBDD7Bbf206e27134F28103abE7cf972df,0x4cCa9821c246acd39a42F34e6ae4E520A8224565,0x30dB01087fEBd7b67DC486812b322b4867Cb8cA7,0x9583648c314CDF666F4F555299dB3B36f5d5b2f9,0x92b406851390541F445B7C697014133d4B5BfcE3,0x87e32D4631D728d6aD7EBcD133b11FeBC9DA9b93,0x8B257B97C0e07E527B073b6513ba8Ea659279b61,0x2B6247079ddD8e81B34093e911284253bd455EF6,0x66b1De0f14a0ce971F7f248415063D44CAF19398,0x54021E58aF1756dc70CE7034d7636De2D2f1fA74,0xA09e838Fe4E33f133e24D836DC61b9A111E41cf8,0xF0CAd7C8b383f79A879eB6Df644e336234EBDac8,0xE38d978e500242E5E6DF46BE5dc1Bd47cb06555f,0x9DF712718352d875aB2c294611bE974251604061,0x01b9369cf8624E1f9960864c18411B4b07Eb91AC,0x3Cc1A943B27c2AF7c6dcF3Be0137f66c2f22E712,0x9bcB319bED50ff0cE2D6FfA95AB9293A175aeD7d,0xce7298E5ef1aE8AF0573eDC2eBd03aB0F837E214,0xE04885c3f1419C6E8495C33bDCf5F8387cd88846,0xf8049C8425f9eAb4E2AE9E1D950f9D3F71481882,0x20b9973103b65D4EA8D0591634e5e757AaCD3030,0xd26a3F686D43f2A62BA9eaE2ff77e9f516d945B9,0x5B93FF82faaF241c15997ea3975419DDDd8362c5,0x1dF428833f2C9FB1eF098754e5D710432450d706,0xC8cBacC6450f9a4A6B925A54c7b70dde4D14D94f,0x8913b99d5efD9e391AdE59168230F6425813D90A,0x00000000005dbcB0d0513FcDa746382Fe8a53468,0xE6c21d1baCadc972e2874EF5b6cD09F38051d83C,0x7761CA398E836534bEd3B8798f96A3CF39D3bD2E,0x29602B0f283E0db6F315573d0dAcd6e578eE7534,0x9FeCf056375A973308bB3D6fb6b1c230CfD21456,0x670A6EB62f5146d4B3B40C7b58AA31d175E3d6Fb,0x6E383448a97289c446712979a974a52ef866B82E,0x6bEE4079849E1993bFDaB33Ee5392AD821798618,0x0eF9e2f7403C8a8aAFBaDcd83d5575d4B6fde501,0x9bcDc7db2f57B0f960A737ccC29373a9bc760134,0xE75304fE5bb590B6deA3CA13A8aBAb257c12E753,0xc222FACE875a344846Ccd489c57C401046790D98,0x59B917a9e10ECe44faE8b651F8C351ef2647dccA,0x4e102848CCCe5Fe1A56CDeE28Aa4449412589BF4,0xB10B5568d516a6121A848b86A0640115827430b1,0x615b044B6Ccb048532bcF99AAdf619d7fdD2Aa01,0x9b944a5f2F90BA9F8a8c375Be8b076b8361bfF15,0x77a78FE8C1a045a3DD148931D7FC40410302e32c,0xB6734B4E01D1cD9A626efD6c86F031cBbF9B4936,0x1cB447C1B7c591537Fa4e8259A50DC75C1ec7140]
2+
[33006667368000000000,3185201649684000000000,542022709742000000000,301257332164000000000,15704098250000000000,348898927418000000000,307856227982000000000,38258765413000000000,12450888370000000000,87299761484000000000,142847369205000000000,3522948000000000,169313934146000000000,23384121574000000000,47553169274000000000,61227721239000000000,192601935507000000000,23377902690000000000,32927294424000000000,636292413483000000000,16954989410000000000,686175399829000000000,66216042458000000000,2573669039905000000000,782109495223000000000,3225811705000000000,16852948039000000000,100410147018000000000,84591392954000000000,22755137944000000000,69508863978000000000,26946329592000000000,59520302460000000000,2318972248337000000000,33512310221000000000,242858440712000000000,120631589964000000000,1119250105000000000,178139006730000000000,61371523137000000000,51989233470000000000,5934986110000000000,16754773945000000000,13883000373000000000,123189097905000000000,143685211702000000000,52793488400000000000,128216957169000000000,127280550522000000000,127798174610000000000]

0 commit comments

Comments
 (0)