├── .gitignore ├── .gitmodules ├── package.json ├── README.md └── indexing.txt /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .old 3 | .next 4 | ciao-node -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "contracts"] 2 | path = contracts 3 | url = https://github.com/liamzebedee/ciaodao-contracts 4 | [submodule "frontend"] 5 | path = frontend 6 | url = https://github.com/liamzebedee/ciaodao-frontend 7 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "did-resolver": "^1.0.0", 4 | "ethereum-blockies-base64": "^1.0.2" 5 | }, 6 | "devDependencies": { 7 | "@babel/core": "^7.5.5", 8 | "@storybook/addon-actions": "^5.1.11", 9 | "@storybook/addon-links": "^5.1.11", 10 | "@storybook/addons": "^5.1.11", 11 | "@storybook/react": "^5.1.11", 12 | "babel-loader": "^8.0.6" 13 | }, 14 | "scripts": { 15 | "storybook": "start-storybook -p 6006", 16 | "build-storybook": "build-storybook" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ciaodao 2 | ======= 3 | 4 | ![](https://pbs.twimg.com/media/ECznUmhXoAA3Gua?format=jpg&name=large) 5 | 6 | [\[video on twitter\]](https://twitter.com/liamzebedee/status/1165559180469686272) 7 | 8 | Social spaces where only tokenholders can post. 9 | 10 | Built at #ETHBerlinZwei. 11 | 12 | #### Live deployment 13 | Currently live on the Goerli Ethereum testnet. 14 | 15 | [Faucet](https://faucet.goerli.mudit.blog) 16 | 17 | #### Setup 18 | 1. Run a local blockchain using Ganache: 19 | 20 | ```sh 21 | yarn global add ganache-cli 22 | ganache-cli -p 8545 23 | ``` 24 | 25 | 2. Deploy the contracts 26 | 27 | ```sh 28 | cd fundao/ 29 | yarn 30 | truffle migrate 31 | ``` 32 | 33 | 3. Copy the addresses to the frontend 34 | 35 | ```sh 36 | cd social/ 37 | yarn copy-contracts 38 | ``` 39 | 40 | 4. Run the frontend 41 | 42 | ```sh 43 | yarn dev 44 | ``` 45 | 46 | Make sure to connect Metamask to localhost:8545 (your local chain). 47 | 48 | #### Structure 49 | contracts - fundao/ 50 | dapp - frontend/ 51 | DAO data scraped from dapphub/aragon - datapop -------------------------------------------------------------------------------- /indexing.txt: -------------------------------------------------------------------------------- 1 | 0xBAc675C310721717Cd4A37F6cbeA1F081b1C2a07 2 | 3 | 4 | 5 | 6 | with token_balances as ( 7 | with double_entry_book as ( 8 | -- debits 9 | select token_address, to_address as address, safe_cast(value as FLOAT64) as value 10 | from `bigquery-public-data.ethereum_blockchain.token_transfers` 11 | where to_address is not null 12 | --and DATE(block_timestamp) = "2019-08-18" 13 | union all 14 | -- credits 15 | select token_address, from_address as address, -(safe_cast(value as FLOAT64)) as value 16 | from `bigquery-public-data.ethereum_blockchain.token_transfers` 17 | where to_address is not null 18 | --and DATE(block_timestamp) = "2019-08-18" 19 | ) 20 | select token_address, address, sum(value) as balance 21 | from double_entry_book 22 | group by token_address, address 23 | --order by balance desc 24 | --limit 10000 25 | ) 26 | 27 | select * from token_balances 28 | where address = LOWER('0xca65Fd88c2d0b4A012F38c6677f45bbc4186AcF5') 29 | 30 | 31 | 32 | 33 | 34 | user { 35 | daos, 36 | friends 37 | } 38 | 39 | 40 | 41 | 42 | https://sourcegraph.com/github.com/blockchain-etl/ethereum-etl/-/blob/README.md#L217:16 43 | 44 | friend = 45 | order by nDaos, balance desc 46 | 47 | 48 | const chatSpace = await box.openSpace('3chat'); 49 | const myDid = chatSpace.DID; 50 | 51 | 52 | chatSpace 53 | 54 | 55 | 56 | topicManager.getOwner(topic, (err, owner) => { 57 | topicManager.getMembers(topic, async (err, members) => { 58 | const thread = await chatSpace.joinThread(topic, { firstModerator: owner, members }); 59 | openTopics[topic] = thread; 60 | this.setState({ activeTopic: openTopics[topic] }); 61 | 62 | thread.onUpdate(() => this.updateThreadPosts()); 63 | thread.onNewCapabilities(() => this.updateThreadCapabilities()); 64 | 65 | this.updateThreadPosts(); 66 | this.updateThreadCapabilities(); 67 | }) 68 | }) 69 | 70 | 71 | 72 | let threadData = []; 73 | const posts = await activeTopic.getPosts(); --------------------------------------------------------------------------------