├── .env.example ├── .gitignore ├── .nvmrc ├── LICENSE ├── README.md ├── config-overrides.js ├── package-lock.json ├── package.json ├── public ├── apple-touch-icon.png ├── favicon-16x16.png ├── favicon-32x32.png ├── favicon.ico ├── index.html ├── logo192.png ├── logo512.png ├── manifest.json └── robots.txt ├── scripts ├── 1-initialize-sdk.js ├── 10-create-vote-proposals.js ├── 11-revoke-roles.js ├── 12-executing-proposals.js ├── 2-deploy-drop.js ├── 3-config-nft.js ├── 4-set-claim-condition.js ├── 5-deploy-token.js ├── 6-print-money.js ├── 7-airdrop-token.js ├── 8-deploy-vote.js ├── 9-setup-vote.js ├── assets │ └── .gitkeep └── package.json └── src ├── App.jsx ├── index.css └── index.js /.env.example: -------------------------------------------------------------------------------- 1 | PRIVATE_KEY=YOUR_PRIVATE_KEY_HERE 2 | WALLET_ADDRESS=YOUR_WALLET_ADDRESS 3 | QUICKNODE_API_URL=YOUR_QUICKNODE_API_URL -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | 25 | .vercel 26 | 27 | node_modules 28 | .env -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | 16 -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 buildspace 4 | Copyright (c) 2022 WEB3DEV 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # WEB3DEV x thirdweb - construa sua própria DAO com apenas Javascript 2 | 3 | ### **Bem vind@s 👋** 4 | Para iniciar com esse projeto, clone o repo e siga esses comandos: 5 | 6 | 1. Rode `npm install` no diretório raiz 7 | 2. Rode `npm start` para iniciar o projeto 8 | 3. Comece a codar! 9 | 10 | ### **Perguntas?** 11 | Faça link da sua conta do Discord na [página no bootcamp](https://bootcamp.web3dev.com.br/courses/JS_DAO) para ter acesso aos canais de ajuda e monitores no servidor da WEB3DEV 12 | -------------------------------------------------------------------------------- /config-overrides.js: -------------------------------------------------------------------------------- 1 | 2 | const webpack = require('webpack'); 3 | module.exports = function override(config) { 4 | const fallback = config.resolve.fallback || {}; 5 | Object.assign(fallback, { 6 | "crypto": require.resolve("crypto-browserify"), 7 | "stream": require.resolve("stream-browserify"), 8 | "assert": require.resolve("assert"), 9 | "http": require.resolve("stream-http"), 10 | "https": require.resolve("https-browserify"), 11 | "os": require.resolve("os-browserify"), 12 | "url": require.resolve("url"), 13 | "zlib": require.resolve("browserify-zlib") 14 | }) 15 | config.resolve.fallback = fallback; 16 | config.plugins = (config.plugins || []).concat([ 17 | new webpack.ProvidePlugin({ 18 | process: 'process/browser.js', 19 | Buffer: ['buffer', 'Buffer'] 20 | }) 21 | ]) 22 | return config; } 23 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mydao", 3 | "version": "1.0.0", 4 | "private": true, 5 | "dependencies": { 6 | "@thirdweb-dev/react": "^3.5.1", 7 | "@thirdweb-dev/sdk": "^3.5.1", 8 | "browserify-zlib": "^0.2.0", 9 | "ethers": "^5.6.6", 10 | "magic-sdk": "^19.3.0", 11 | "react": "^18.0.2", 12 | "react-dom": "^18.0.2", 13 | "react-scripts": "5.0.0" 14 | }, 15 | "scripts": { 16 | "start": "react-app-rewired start", 17 | "build": "react-app-rewired build", 18 | "test": "react-app-rewired test", 19 | "eject": "react-scripts eject" 20 | }, 21 | "eslintConfig": { 22 | "extends": [ 23 | "react-app" 24 | ] 25 | }, 26 | "browserslist": { 27 | "production": [ 28 | ">0.2%", 29 | "not dead", 30 | "not op_mini all" 31 | ], 32 | "development": [ 33 | "last 1 chrome version", 34 | "last 1 firefox version", 35 | "last 1 safari version" 36 | ] 37 | }, 38 | "devDependencies": { 39 | "@babel/plugin-proposal-private-property-in-object": "^7.21.11", 40 | "assert": "^2.0.0", 41 | "buffer": "^6.0.3", 42 | "crypto-browserify": "^3.12.0", 43 | "https-browserify": "^1.0.0", 44 | "os-browserify": "^0.3.0", 45 | "process": "^0.11.10", 46 | "react-app-rewired": "^2.2.1", 47 | "stream-browserify": "^3.0.0", 48 | "stream-http": "^3.2.0", 49 | "url": "^0.11.1", 50 | "webpack": "^5.88.2", 51 | "webpack-cli": "^4.10.0" 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /public/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w3b3d3v/dao-app-web3dev/8e46df2838211aee16381cd4d798722dea0feeca/public/apple-touch-icon.png -------------------------------------------------------------------------------- /public/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w3b3d3v/dao-app-web3dev/8e46df2838211aee16381cd4d798722dea0feeca/public/favicon-16x16.png -------------------------------------------------------------------------------- /public/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w3b3d3v/dao-app-web3dev/8e46df2838211aee16381cd4d798722dea0feeca/public/favicon-32x32.png -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w3b3d3v/dao-app-web3dev/8e46df2838211aee16381cd4d798722dea0feeca/public/favicon.ico -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 16 | 17 | 18 | My DAO 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 35 | 36 | 37 | 38 | 39 |
40 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w3b3d3v/dao-app-web3dev/8e46df2838211aee16381cd4d798722dea0feeca/public/logo192.png -------------------------------------------------------------------------------- /public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w3b3d3v/dao-app-web3dev/8e46df2838211aee16381cd4d798722dea0feeca/public/logo512.png -------------------------------------------------------------------------------- /public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "Buildspace x thirdweb - DAO with JavaScript", 3 | "name": "Build your own DAO with just Javascript in a weekend", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /scripts/1-initialize-sdk.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w3b3d3v/dao-app-web3dev/8e46df2838211aee16381cd4d798722dea0feeca/scripts/1-initialize-sdk.js -------------------------------------------------------------------------------- /scripts/10-create-vote-proposals.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w3b3d3v/dao-app-web3dev/8e46df2838211aee16381cd4d798722dea0feeca/scripts/10-create-vote-proposals.js -------------------------------------------------------------------------------- /scripts/11-revoke-roles.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w3b3d3v/dao-app-web3dev/8e46df2838211aee16381cd4d798722dea0feeca/scripts/11-revoke-roles.js -------------------------------------------------------------------------------- /scripts/12-executing-proposals.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w3b3d3v/dao-app-web3dev/8e46df2838211aee16381cd4d798722dea0feeca/scripts/12-executing-proposals.js -------------------------------------------------------------------------------- /scripts/2-deploy-drop.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w3b3d3v/dao-app-web3dev/8e46df2838211aee16381cd4d798722dea0feeca/scripts/2-deploy-drop.js -------------------------------------------------------------------------------- /scripts/3-config-nft.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w3b3d3v/dao-app-web3dev/8e46df2838211aee16381cd4d798722dea0feeca/scripts/3-config-nft.js -------------------------------------------------------------------------------- /scripts/4-set-claim-condition.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w3b3d3v/dao-app-web3dev/8e46df2838211aee16381cd4d798722dea0feeca/scripts/4-set-claim-condition.js -------------------------------------------------------------------------------- /scripts/5-deploy-token.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w3b3d3v/dao-app-web3dev/8e46df2838211aee16381cd4d798722dea0feeca/scripts/5-deploy-token.js -------------------------------------------------------------------------------- /scripts/6-print-money.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w3b3d3v/dao-app-web3dev/8e46df2838211aee16381cd4d798722dea0feeca/scripts/6-print-money.js -------------------------------------------------------------------------------- /scripts/7-airdrop-token.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w3b3d3v/dao-app-web3dev/8e46df2838211aee16381cd4d798722dea0feeca/scripts/7-airdrop-token.js -------------------------------------------------------------------------------- /scripts/8-deploy-vote.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w3b3d3v/dao-app-web3dev/8e46df2838211aee16381cd4d798722dea0feeca/scripts/8-deploy-vote.js -------------------------------------------------------------------------------- /scripts/9-setup-vote.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w3b3d3v/dao-app-web3dev/8e46df2838211aee16381cd4d798722dea0feeca/scripts/9-setup-vote.js -------------------------------------------------------------------------------- /scripts/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w3b3d3v/dao-app-web3dev/8e46df2838211aee16381cd4d798722dea0feeca/scripts/assets/.gitkeep -------------------------------------------------------------------------------- /scripts/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mydao-scripts", 3 | "type": "module" 4 | } 5 | -------------------------------------------------------------------------------- /src/App.jsx: -------------------------------------------------------------------------------- 1 | const App = () => { 2 | return ( 3 |
4 |

Bem-vind@s à minha DAO

5 |
6 | ) 7 | } 8 | 9 | export default App 10 | -------------------------------------------------------------------------------- /src/index.css: -------------------------------------------------------------------------------- 1 | html, 2 | body { 3 | margin: 0; 4 | font-family: Inter, sans-serif; 5 | -webkit-font-smoothing: antialiased; 6 | -moz-osx-font-smoothing: grayscale; 7 | background-color: #7700ee; 8 | color: #fff; 9 | overflow-x: hidden; 10 | } 11 | #root { 12 | min-height: 100vh; 13 | display: flex; 14 | } 15 | 16 | h1 { 17 | font-size: 5rem; 18 | } 19 | @media screen and (max-width: 768px) { 20 | h1 { 21 | font-size: 3rem; 22 | } 23 | } 24 | 25 | .unsupported-network { 26 | width: 340px; 27 | max-width: 100%; 28 | padding-left: 0.5rem; 29 | padding-right: 0.5rem; 30 | margin: auto; 31 | padding: 1rem; 32 | } 33 | 34 | .error { 35 | width: 340px; 36 | max-width: 100%; 37 | padding-left: 0.5rem; 38 | padding-right: 0.5rem; 39 | margin: auto; 40 | padding: 1rem; 41 | border-radius: 1rem; 42 | background-color: #f00; 43 | } 44 | 45 | .landing, 46 | .connect-wallet, 47 | .mint-nft, 48 | .member-page { 49 | flex-direction: column; 50 | width: 960px; 51 | max-width: calc(100% - 1rem); 52 | padding-left: 0.5rem; 53 | padding-right: 0.5rem; 54 | margin: auto; 55 | align-content: center; 56 | display: flex; 57 | text-align: center; 58 | } 59 | 60 | .member-page > div { 61 | display: flex; 62 | flex-direction: row; 63 | width: 100%; 64 | text-align: left; 65 | gap: 2rem; 66 | } 67 | .member-page > div > div { 68 | display: flex; 69 | flex-direction: column; 70 | width: 50%; 71 | gap: 1rem; 72 | } 73 | @media screen and (max-width: 768px) { 74 | .member-page > div { 75 | flex-direction: column; 76 | } 77 | .member-page > div > div { 78 | width: 100%; 79 | } 80 | } 81 | 82 | .member-page form { 83 | display: flex; 84 | flex-direction: column; 85 | gap: 1rem; 86 | } 87 | 88 | .member-page form > div { 89 | display: flex; 90 | flex-direction: column; 91 | gap: 1rem; 92 | } 93 | 94 | .member-page form h5 { 95 | margin-top: 0; 96 | color: #7700ee; 97 | } 98 | 99 | .member-page form .card > div { 100 | display: flex; 101 | gap: 1rem; 102 | justify-content: space-between; 103 | } 104 | 105 | .member-page form small { 106 | text-align: center; 107 | } 108 | 109 | .card { 110 | background-color: #fff; 111 | padding: 1rem; 112 | border-radius: 1rem; 113 | color: #000; 114 | box-shadow: 3.1px 6.2px 6.2px hsl(0deg 0% 0% / 0.4); 115 | } 116 | 117 | .btn-hero { 118 | margin: auto; 119 | width: 250px; 120 | } 121 | 122 | button { 123 | cursor: pointer; 124 | background-color: #000; 125 | color: #fff; 126 | border: none; 127 | font-weight: bold; 128 | font-family: inherit; 129 | padding: 1.2rem 2rem; 130 | text-transform: uppercase; 131 | border-radius: 3rem; 132 | font-size: 1.2rem; 133 | } 134 | 135 | button:hover { 136 | background-color: #121212; 137 | } 138 | 139 | button:focus { 140 | background-color: #222; 141 | } 142 | 143 | button:disabled { 144 | opacity: 0.8; 145 | pointer-events: none; 146 | } -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { createRoot } from 'react-dom/client'; 3 | import './index.css'; 4 | import App from './App'; 5 | 6 | // Import thirdweb provider and Goerli ChainId 7 | import { ThirdwebProvider } from "@thirdweb-dev/react" 8 | 9 | // Wrap your app with the thirdweb provider 10 | const container = document.getElementById('root'); 11 | const root = createRoot(container); 12 | root.render( 13 | 14 | 15 | 16 | 17 | 18 | ) --------------------------------------------------------------------------------