├── .commitlintrc.yaml ├── .czrc ├── .editorconfig ├── .eslintignore ├── .eslintrc.yaml ├── .gitattributes ├── .github ├── CODE_OF_CONDUCT.md ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── bug-report.md │ ├── feature-request.md │ └── something-else.md └── workflows │ └── integration.yaml ├── .gitignore ├── .husky ├── .gitignore ├── commit-msg └── pre-commit ├── .jest ├── env.js └── setup.js ├── .lintstagedrc ├── .prettierignore ├── .prettierrc.yaml ├── .yarn ├── plugins │ └── @yarnpkg │ │ └── plugin-interactive-tools.cjs └── releases │ └── yarn-3.2.0.cjs ├── .yarnrc.yml ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE.md ├── README.md ├── handlebars ├── react │ ├── README.md.hbs │ ├── package.json.hbs │ └── packages │ │ ├── contracts │ │ ├── README.md.hbs │ │ ├── package.json.hbs │ │ └── src │ │ │ └── index.js.hbs │ │ └── react-app │ │ ├── README.md.hbs │ │ ├── package.json.hbs │ │ ├── public │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── logo192.png │ │ ├── logo512.png │ │ ├── manifest.json │ │ └── robots.txt │ │ └── src │ │ ├── App.js.hbs │ │ ├── App.test.js │ │ ├── components │ │ └── index.js │ │ ├── ethereumLogo.png │ │ ├── index.css │ │ ├── index.js.hbs │ │ └── setupTests.js └── vue │ ├── .eslintrc │ ├── README.md.hbs │ ├── package.json.hbs │ └── packages │ ├── contracts │ ├── README.md.hbs │ ├── package.json.hbs │ └── src │ │ └── index.js.hbs │ └── vue-app │ ├── README.md.hbs │ ├── babel.config.js │ ├── package.json.hbs │ ├── public │ ├── favicon.ico │ └── index.html │ ├── src │ ├── App.vue │ ├── assets │ │ └── ethereumLogo.png │ ├── components │ │ └── HelloWorld.vue.hbs │ └── main.js.hbs │ └── vue.config.js ├── jest.config.ts ├── package.json ├── screencast.gif ├── src ├── createEthApp.ts ├── gitignore ├── helpers │ ├── constants.ts │ ├── directories.ts │ ├── env.ts │ ├── errors.ts │ ├── frameworks.ts │ ├── git.ts │ ├── networking.ts │ ├── npm.ts │ ├── templates.ts │ ├── url.ts │ └── yarn.ts └── index.ts ├── templates ├── react │ ├── aave │ │ ├── README.md.ctx │ │ ├── package.json.ctx │ │ └── packages │ │ │ ├── contracts │ │ │ ├── README.md.ctx │ │ │ ├── package.json.ctx │ │ │ └── src │ │ │ │ ├── abis.js │ │ │ │ ├── abis │ │ │ │ ├── aToken.json │ │ │ │ ├── lendingPool.json │ │ │ │ ├── lendingPoolAddressesProvider.json │ │ │ │ └── lendingPoolCore.json │ │ │ │ ├── addresses.js │ │ │ │ └── index.js.ctx │ │ │ └── react-app │ │ │ ├── README.md.ctx │ │ │ ├── package.json.ctx │ │ │ └── src │ │ │ ├── App.js.ctx │ │ │ ├── graphql │ │ │ └── subgraph.js │ │ │ └── index.js.ctx │ ├── chainlink │ │ ├── README.md.ctx │ │ ├── package.json.ctx │ │ └── packages │ │ │ ├── contracts │ │ │ ├── README.md.ctx │ │ │ ├── package.json.ctx │ │ │ └── src │ │ │ │ ├── abis.js │ │ │ │ ├── abis │ │ │ │ └── .gitkeep │ │ │ │ ├── addresses.js │ │ │ │ └── index.js.ctx │ │ │ └── react-app │ │ │ ├── README.md.ctx │ │ │ ├── package.json.ctx │ │ │ └── src │ │ │ ├── App.js.ctx │ │ │ ├── graphql │ │ │ └── subgraph.js │ │ │ └── index.js.ctx │ ├── compound │ │ ├── README.md.ctx │ │ ├── package.json.ctx │ │ └── packages │ │ │ ├── contracts │ │ │ ├── README.md.ctx │ │ │ ├── package.json.ctx │ │ │ └── src │ │ │ │ ├── abis.js │ │ │ │ ├── abis │ │ │ │ ├── COMP.json │ │ │ │ ├── cBAT.json │ │ │ │ ├── cDAI.json │ │ │ │ ├── cETH.json │ │ │ │ ├── cREP.json │ │ │ │ ├── cSAI.json │ │ │ │ ├── cUSDC.json │ │ │ │ ├── cUSDT.json │ │ │ │ ├── cWBTC.json │ │ │ │ ├── cZRX.json │ │ │ │ ├── comptroller.json │ │ │ │ ├── governance.json │ │ │ │ ├── priceOracle.json │ │ │ │ └── timelock.json │ │ │ │ ├── addresses.js │ │ │ │ └── index.js.ctx │ │ │ └── react-app │ │ │ ├── README.md.ctx │ │ │ ├── package.json.ctx │ │ │ └── src │ │ │ ├── App.js.ctx │ │ │ ├── graphql │ │ │ └── subgraph.js │ │ │ └── index.js.ctx │ ├── default │ │ ├── .gitignore │ │ ├── README.md │ │ ├── README.md.ctx │ │ ├── package.json.ctx │ │ └── packages │ │ │ ├── contracts │ │ │ ├── README.md.ctx │ │ │ ├── package.json.ctx │ │ │ └── src │ │ │ │ ├── abis.js │ │ │ │ ├── abis │ │ │ │ ├── erc20.json │ │ │ │ └── ownable.json │ │ │ │ ├── addresses.js │ │ │ │ └── index.js.ctx │ │ │ ├── react-app │ │ │ ├── README.md.ctx │ │ │ ├── package.json.ctx │ │ │ └── src │ │ │ │ ├── App.js.ctx │ │ │ │ ├── graphql │ │ │ │ └── subgraph.js │ │ │ │ └── index.js.ctx │ │ │ └── subgraph │ │ │ ├── README.md │ │ │ ├── package.json │ │ │ ├── schema.graphql │ │ │ ├── src │ │ │ └── mappings │ │ │ │ ├── tokens.ts │ │ │ │ └── transfers.ts │ │ │ └── subgraph.yaml │ ├── kyber │ │ ├── README.md.ctx │ │ ├── package.json.ctx │ │ └── packages │ │ │ ├── contracts │ │ │ ├── README.md.ctx │ │ │ ├── package.json.ctx │ │ │ └── src │ │ │ │ ├── abis.js │ │ │ │ ├── abis │ │ │ │ ├── conversionRates.json │ │ │ │ ├── erc20.json │ │ │ │ ├── kyberFeeHandler.json │ │ │ │ ├── kyberHintHandler.json │ │ │ │ ├── kyberNetworkProxyV1.json │ │ │ │ ├── kyberNetworkProxyV2.json │ │ │ │ ├── kyberReserve.json │ │ │ │ ├── kyberStorage.json │ │ │ │ ├── liquidityConversionRates.json │ │ │ │ ├── sanityRates.json │ │ │ │ └── simpleKyberProxy.json │ │ │ │ ├── addresses.js │ │ │ │ └── index.js.ctx │ │ │ └── react-app │ │ │ ├── README.md.ctx │ │ │ ├── package.json.ctx │ │ │ └── src │ │ │ ├── App.js.ctx │ │ │ ├── graphql │ │ │ └── subgraph.js │ │ │ └── index.js.ctx │ ├── maker │ │ ├── README.md.ctx │ │ ├── package.json.ctx │ │ └── packages │ │ │ ├── contracts │ │ │ ├── README.md.ctx │ │ │ ├── package.json.ctx │ │ │ └── src │ │ │ │ ├── abis.js │ │ │ │ ├── abis │ │ │ │ ├── cat.json │ │ │ │ ├── dai.json │ │ │ │ ├── daiJoin.json │ │ │ │ ├── dsProxy.json │ │ │ │ ├── dssCdpManager.json │ │ │ │ ├── dssProxyActions.json │ │ │ │ ├── dssProxyActionsDsr.json │ │ │ │ ├── erc20.json │ │ │ │ ├── erc20Events.json │ │ │ │ ├── ethJoin.json │ │ │ │ ├── jug.json │ │ │ │ ├── pot.json │ │ │ │ ├── proxyActions.json │ │ │ │ ├── proxyRegistry.json │ │ │ │ ├── spotter.json │ │ │ │ └── vat.json │ │ │ │ ├── addresses.js │ │ │ │ └── index.js.ctx │ │ │ └── react-app │ │ │ ├── README.md.ctx │ │ │ ├── package.json.ctx │ │ │ └── src │ │ │ ├── App.js.ctx │ │ │ ├── graphql │ │ │ └── subgraph.js │ │ │ └── index.js.ctx │ ├── mstable │ │ ├── README.md.ctx │ │ ├── package.json.ctx │ │ └── packages │ │ │ ├── contracts │ │ │ ├── README.md.ctx │ │ │ ├── package.json.ctx │ │ │ └── src │ │ │ │ ├── abis.js │ │ │ │ ├── abis │ │ │ │ ├── mAsset.json │ │ │ │ ├── metaToken.json │ │ │ │ ├── nexus.json │ │ │ │ ├── savingsContract.json │ │ │ │ └── savingsManager.json │ │ │ │ ├── addresses.js │ │ │ │ └── index.js.ctx │ │ │ └── react-app │ │ │ ├── README.md.ctx │ │ │ ├── package.json.ctx │ │ │ └── src │ │ │ ├── App.js.ctx │ │ │ ├── graphql │ │ │ └── subgraph.js │ │ │ └── index.js.ctx │ ├── sablier-v1 │ │ ├── README.md.ctx │ │ ├── package.json.ctx │ │ └── packages │ │ │ ├── contracts │ │ │ ├── README.md.ctx │ │ │ ├── package.json.ctx │ │ │ └── src │ │ │ │ ├── abis.js │ │ │ │ ├── abis │ │ │ │ ├── erc20.json │ │ │ │ ├── payroll.json │ │ │ │ └── sablier.json │ │ │ │ ├── addresses.js │ │ │ │ └── index.js.ctx │ │ │ └── react-app │ │ │ ├── README.md.ctx │ │ │ ├── package.json.ctx │ │ │ └── src │ │ │ ├── App.js.ctx │ │ │ ├── graphql │ │ │ └── subgraph.js │ │ │ └── index.js.ctx │ ├── synthetix │ │ ├── README.md.ctx │ │ ├── package.json.ctx │ │ └── packages │ │ │ ├── contracts │ │ │ ├── README.md.ctx │ │ │ ├── package.json.ctx │ │ │ └── src │ │ │ │ ├── abis.js │ │ │ │ ├── abis │ │ │ │ ├── readProxy.json │ │ │ │ └── snx.json │ │ │ │ ├── addresses.js │ │ │ │ └── index.js.ctx │ │ │ └── react-app │ │ │ ├── README.md.ctx │ │ │ ├── package.json.ctx │ │ │ └── src │ │ │ ├── App.js.ctx │ │ │ ├── graphql │ │ │ └── subgraph.js │ │ │ └── index.js.ctx │ └── uniswap-v2 │ │ ├── README.md.ctx │ │ ├── package.json.ctx │ │ └── packages │ │ ├── contracts │ │ ├── README.md.ctx │ │ ├── package.json.ctx │ │ └── src │ │ │ ├── abis.js │ │ │ ├── abis │ │ │ ├── erc20.json │ │ │ ├── factory.json │ │ │ ├── pair.json │ │ │ ├── router01.json │ │ │ └── router02.json │ │ │ ├── addresses.js │ │ │ └── index.js.ctx │ │ └── react-app │ │ ├── README.md.ctx │ │ ├── package.json.ctx │ │ └── src │ │ ├── App.js.ctx │ │ ├── graphql │ │ └── subgraph.js │ │ └── index.js.ctx └── vue │ ├── aave │ ├── README.md.ctx │ ├── package.json.ctx │ └── packages │ │ ├── contracts │ │ ├── README.md.ctx │ │ ├── package.json.ctx │ │ └── src │ │ │ ├── abis.js │ │ │ ├── abis │ │ │ ├── aToken.json │ │ │ ├── lendingPool.json │ │ │ ├── lendingPoolAddressesProvider.json │ │ │ └── lendingPoolCore.json │ │ │ ├── addresses.js │ │ │ └── index.js.ctx │ │ └── vue-app │ │ ├── README.md.ctx │ │ ├── package.json.ctx │ │ └── src │ │ ├── components │ │ └── HelloWorld.vue.ctx │ │ ├── graphql │ │ └── subgraph.js │ │ └── main.js.ctx │ ├── chainlink │ ├── README.md.ctx │ ├── package.json.ctx │ └── packages │ │ ├── contracts │ │ ├── README.md.ctx │ │ ├── package.json.ctx │ │ └── src │ │ │ ├── abis.js │ │ │ ├── abis │ │ │ └── .gitkeep │ │ │ ├── addresses.js │ │ │ └── index.js.ctx │ │ └── vue-app │ │ ├── README.md.ctx │ │ ├── package.json.ctx │ │ └── src │ │ ├── components │ │ └── HelloWorld.vue.ctx │ │ ├── graphql │ │ └── subgraph.js │ │ └── main.js.ctx │ ├── compound │ ├── README.md.ctx │ ├── package.json.ctx │ └── packages │ │ ├── contracts │ │ ├── README.md.ctx │ │ ├── package.json.ctx │ │ └── src │ │ │ ├── abis.js │ │ │ ├── abis │ │ │ ├── COMP.json │ │ │ ├── cBAT.json │ │ │ ├── cDAI.json │ │ │ ├── cETH.json │ │ │ ├── cREP.json │ │ │ ├── cSAI.json │ │ │ ├── cUSDC.json │ │ │ ├── cUSDT.json │ │ │ ├── cWBTC.json │ │ │ ├── cZRX.json │ │ │ ├── comptroller.json │ │ │ ├── governance.json │ │ │ ├── priceOracle.json │ │ │ └── timelock.json │ │ │ ├── addresses.js │ │ │ └── index.js.ctx │ │ └── vue-app │ │ ├── README.md.ctx │ │ ├── package.json.ctx │ │ └── src │ │ ├── components │ │ └── HelloWorld.vue.ctx │ │ ├── graphql │ │ └── subgraph.js │ │ └── main.js.ctx │ ├── default │ ├── .gitignore │ ├── README.md │ ├── README.md.ctx │ ├── package.json.ctx │ └── packages │ │ ├── contracts │ │ ├── README.md.ctx │ │ ├── package.json.ctx │ │ └── src │ │ │ ├── abis.js │ │ │ ├── abis │ │ │ ├── erc20.json │ │ │ └── ownable.json │ │ │ ├── addresses.js │ │ │ └── index.js.ctx │ │ ├── subgraph │ │ ├── README.md │ │ ├── package.json │ │ ├── schema.graphql │ │ ├── src │ │ │ └── mappings │ │ │ │ ├── tokens.ts │ │ │ │ └── transfers.ts │ │ └── subgraph.yaml │ │ └── vue-app │ │ ├── README.md.ctx │ │ ├── package.json.ctx │ │ └── src │ │ ├── components │ │ └── HelloWorld.vue.ctx │ │ ├── graphql │ │ └── subgraph.js │ │ └── main.js.ctx │ ├── kyber │ ├── README.md.ctx │ ├── package.json.ctx │ └── packages │ │ ├── contracts │ │ ├── README.md.ctx │ │ ├── package.json.ctx │ │ └── src │ │ │ ├── abis.js │ │ │ ├── abis │ │ │ ├── conversionRates.json │ │ │ ├── erc20.json │ │ │ ├── kyberFeeHandler.json │ │ │ ├── kyberHintHandler.json │ │ │ ├── kyberNetworkProxyV1.json │ │ │ ├── kyberNetworkProxyV2.json │ │ │ ├── kyberReserve.json │ │ │ ├── kyberStorage.json │ │ │ ├── liquidityConversionRates.json │ │ │ ├── sanityRates.json │ │ │ └── simpleKyberProxy.json │ │ │ ├── addresses.js │ │ │ └── index.js.ctx │ │ └── vue-app │ │ ├── README.md.ctx │ │ ├── package.json.ctx │ │ └── src │ │ ├── components │ │ └── HelloWorld.vue.ctx │ │ ├── graphql │ │ └── subgraph.js │ │ └── main.js.ctx │ ├── maker │ ├── README.md.ctx │ ├── package.json.ctx │ └── packages │ │ ├── contracts │ │ ├── README.md.ctx │ │ ├── package.json.ctx │ │ └── src │ │ │ ├── abis.js │ │ │ ├── abis │ │ │ ├── cat.json │ │ │ ├── dai.json │ │ │ ├── daiJoin.json │ │ │ ├── dsProxy.json │ │ │ ├── dssCdpManager.json │ │ │ ├── dssProxyActions.json │ │ │ ├── dssProxyActionsDsr.json │ │ │ ├── erc20.json │ │ │ ├── erc20Events.json │ │ │ ├── ethJoin.json │ │ │ ├── jug.json │ │ │ ├── pot.json │ │ │ ├── proxyActions.json │ │ │ ├── proxyRegistry.json │ │ │ ├── spotter.json │ │ │ └── vat.json │ │ │ ├── addresses.js │ │ │ └── index.js.ctx │ │ └── vue-app │ │ ├── README.md.ctx │ │ ├── package.json.ctx │ │ └── src │ │ ├── components │ │ └── HelloWorld.vue.ctx │ │ ├── graphql │ │ └── subgraph.js │ │ └── main.js.ctx │ ├── mstable │ ├── README.md.ctx │ ├── package.json.ctx │ └── packages │ │ ├── contracts │ │ ├── README.md.ctx │ │ ├── package.json.ctx │ │ └── src │ │ │ ├── abis.js │ │ │ ├── abis │ │ │ ├── mAsset.json │ │ │ ├── metaToken.json │ │ │ ├── nexus.json │ │ │ ├── savingsContract.json │ │ │ └── savingsManager.json │ │ │ ├── addresses.js │ │ │ └── index.js.ctx │ │ └── vue-app │ │ ├── README.md.ctx │ │ ├── package.json.ctx │ │ └── src │ │ ├── components │ │ └── HelloWorld.vue.ctx │ │ ├── graphql │ │ └── subgraph.js │ │ └── main.js.ctx │ ├── sablier-v1 │ ├── README.md.ctx │ ├── package.json.ctx │ └── packages │ │ ├── contracts │ │ ├── README.md.ctx │ │ ├── package.json.ctx │ │ └── src │ │ │ ├── abis.js │ │ │ ├── abis │ │ │ ├── erc20.json │ │ │ ├── payroll.json │ │ │ └── sablier.json │ │ │ ├── addresses.js │ │ │ └── index.js.ctx │ │ └── vue-app │ │ ├── README.md.ctx │ │ ├── package.json.ctx │ │ └── src │ │ ├── components │ │ └── HelloWorld.vue.ctx │ │ ├── graphql │ │ └── subgraph.js │ │ └── main.js.ctx │ ├── synthetix │ ├── README.md.ctx │ ├── package.json.ctx │ └── packages │ │ ├── contracts │ │ ├── README.md.ctx │ │ ├── package.json.ctx │ │ └── src │ │ │ ├── abis.js │ │ │ ├── abis │ │ │ ├── readProxy.json │ │ │ └── snx.json │ │ │ ├── addresses.js │ │ │ └── index.js.ctx │ │ └── vue-app │ │ ├── README.md.ctx │ │ ├── package.json.ctx │ │ └── src │ │ ├── components │ │ └── HelloWorld.vue.ctx │ │ ├── graphql │ │ └── subgraph.js │ │ └── main.js.ctx │ └── uniswap-v2 │ ├── README.md.ctx │ ├── package.json.ctx │ └── packages │ ├── contracts │ ├── README.md.ctx │ ├── package.json.ctx │ └── src │ │ ├── abis.js │ │ ├── abis │ │ ├── erc20.json │ │ ├── factory.json │ │ ├── pair.json │ │ ├── router01.json │ │ └── router02.json │ │ ├── addresses.js │ │ └── index.js.ctx │ └── vue-app │ ├── README.md.ctx │ ├── package.json.ctx │ └── src │ ├── components │ └── HelloWorld.vue.ctx │ ├── graphql │ └── subgraph.js │ └── main.js.ctx ├── test ├── __mocks__ │ ├── url-exist.ts │ └── validate-npm-package-name.ts ├── integration │ ├── frameworks.test.ts │ └── templates.test.ts └── unit │ ├── directories.test.ts │ ├── env.test.ts │ ├── git.test.ts │ ├── networking.test.ts │ ├── npm.test.ts │ └── yarn.test.ts ├── tsconfig.json ├── types ├── promisepipe.d.ts └── validateNpmPackageName.d.ts └── yarn.lock /.commitlintrc.yaml: -------------------------------------------------------------------------------- 1 | extends: 2 | - "@commitlint/config-conventional" 3 | -------------------------------------------------------------------------------- /.czrc: -------------------------------------------------------------------------------- 1 | { 2 | "path": "cz-conventional-changelog" 3 | } 4 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig http://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root = true 5 | 6 | # All files 7 | [*] 8 | charset = utf-8 9 | end_of_line = lf 10 | indent_size = 2 11 | indent_style = space 12 | insert_final_newline = true 13 | trim_trailing_whitespace = true 14 | 15 | # Solidity 16 | [*.sol] 17 | indent_size=4 18 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | # folders 2 | .vscode/ 3 | dist/ 4 | handlebars/ 5 | templates/ 6 | 7 | # files 8 | jest.config.js 9 | 10 | -------------------------------------------------------------------------------- /.eslintrc.yaml: -------------------------------------------------------------------------------- 1 | extends: 2 | - "eslint:recommended" 3 | - "plugin:@typescript-eslint/eslint-recommended" 4 | - "plugin:@typescript-eslint/recommended" 5 | - "prettier" 6 | parser: "@typescript-eslint/parser" 7 | parserOptions: 8 | project: "tsconfig.json" 9 | plugins: 10 | - "@typescript-eslint" 11 | root: true 12 | rules: 13 | "@typescript-eslint/no-explicit-any": "off" 14 | "@typescript-eslint/no-floating-promises": 15 | - error 16 | - ignoreIIFE: true 17 | ignoreVoid: true 18 | "@typescript-eslint/no-inferrable-types": "off" 19 | "@typescript-eslint/no-unused-vars": 20 | - error 21 | - argsIgnorePattern: _ 22 | varsIgnorePattern: _ 23 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.sol diff linguist-language=Solidity 2 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | custom: "https://omo.so/prberg" 2 | github: "PaulRBerg" 3 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug-report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug Report 3 | about: Create a report to help us improve 4 | title: "" 5 | labels: bug 6 | assignees: "" 7 | --- 8 | 9 | **Bug Description** 10 | A clear and concise description of what the bug is. 11 | 12 | **Steps to Reproduce** 13 | 14 | 1. Go to ... 15 | 2. Click on ... 16 | 17 | **Expected Behavior** 18 | A clear and concise description of what you expected to happen. 19 | 20 | **Additional Context** 21 | Add any other context about the problem here (screenshots, whether the bug only occurs only in certain 22 | mobile/desktop/browser environments, etc.) 23 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature-request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature Request 3 | about: Suggest an idea for this project 4 | title: "" 5 | labels: "" 6 | assignees: "" 7 | --- 8 | 9 | **Is your feature request related to a problem? Please describe.** 10 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 11 | 12 | **Describe the solution you'd like** 13 | A clear and concise description of what you want to happen. 14 | 15 | **Describe alternatives you've considered** 16 | A clear and concise description of any alternative solutions or features you've considered. 17 | 18 | **Additional context** 19 | Add any other context or screenshots about the feature request here. 20 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/something-else.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Something Else 3 | about: Tell us something else 4 | title: "" 5 | labels: "" 6 | assignees: "" 7 | --- 8 | -------------------------------------------------------------------------------- /.github/workflows/integration.yaml: -------------------------------------------------------------------------------- 1 | name: "Continuous Integration" 2 | 3 | env: 4 | GH_OAUTH_TOKEN: ${{ secrets.GH_OAUTH_TOKEN }} 5 | 6 | on: 7 | push: 8 | branches: 9 | - "develop" 10 | - "staging" 11 | 12 | jobs: 13 | integration: 14 | runs-on: "ubuntu-latest" 15 | steps: 16 | - name: "Check out the repo" 17 | uses: "actions/checkout@v3" 18 | 19 | - name: "Install Node.js" 20 | uses: "actions/setup-node@v3" 21 | with: 22 | cache: "yarn" 23 | node-version: "16" 24 | 25 | - name: "Install dependencies" 26 | run: "yarn install --immutable" 27 | 28 | - name: "Lint code" 29 | run: "yarn lint" 30 | 31 | - name: "Run unit tests" 32 | run: "yarn test:unit" 33 | 34 | - name: "Run integration tests" 35 | run: "yarn test:integration" 36 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # generic folders 2 | .yarn/* 3 | !.yarn/releases 4 | !.yarn/plugins 5 | build/ 6 | coverage/ 7 | dist/ 8 | node_modules/ 9 | 10 | # generic files 11 | .DS_Store 12 | .env* 13 | .pnp* 14 | npm-debug.log* 15 | tsconfig.tsbuildinfo 16 | yarn.lock 17 | yarn-debug.log* 18 | yarn-error.log* 19 | *.log 20 | !/yarn.lock 21 | 22 | # templates 23 | templates/**/build/ 24 | templates/**/src/types/ 25 | -------------------------------------------------------------------------------- /.husky/.gitignore: -------------------------------------------------------------------------------- 1 | _ 2 | -------------------------------------------------------------------------------- /.husky/commit-msg: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | yarn dlx commitlint --edit $1 5 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | yarn dlx lint-staged 5 | -------------------------------------------------------------------------------- /.jest/env.js: -------------------------------------------------------------------------------- 1 | process.env.CEA_ENV = "development"; 2 | process.env.DEVELOPMENT_REF = "staging"; 3 | -------------------------------------------------------------------------------- /.jest/setup.js: -------------------------------------------------------------------------------- 1 | jest.setTimeout(180000); 2 | -------------------------------------------------------------------------------- /.lintstagedrc: -------------------------------------------------------------------------------- 1 | { 2 | "*.{js,json,md,sol,ts,tsx,yaml,yml}": [ 3 | "prettier --config ./.prettierrc.yaml --write" 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | # folders 2 | dist/ 3 | node_modules/ 4 | 5 | # files 6 | *.hbs 7 | -------------------------------------------------------------------------------- /.prettierrc.yaml: -------------------------------------------------------------------------------- 1 | arrowParens: avoid 2 | bracketSpacing: true 3 | endOfLine: auto 4 | importOrder: ["", "^[./]"] 5 | importOrderParserPlugins: ["jsx", "typescript"] 6 | importOrderSeparation: true 7 | importOrderSortSpecifiers: true 8 | printWidth: 120 9 | singleQuote: false 10 | tabWidth: 2 11 | trailingComma: all 12 | -------------------------------------------------------------------------------- /.yarnrc.yml: -------------------------------------------------------------------------------- 1 | nodeLinker: node-modules 2 | 3 | plugins: 4 | - path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs 5 | spec: "@yarnpkg/plugin-interactive-tools" 6 | 7 | yarnPath: .yarn/releases/yarn-3.2.0.cjs 8 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Feel free to dive in! [Open](https://github.com/PaulRBerg/create-eth-app/issues/new/choose) an issue, 4 | [start](https://github.com/PaulRBerg/create-eth-app/discussions/new/choose) a discussion or submit a PR. 5 | 6 | Contributions to `create-eth-app` are welcome by anyone interested in adding support for more frameworks or DeFi templates, writing more tests, improving readability, or improving the documentation. 7 | 8 | ## Pre Requisites 9 | 10 | You will need the following software on your machine: 11 | 12 | - [Git](https://git-scm.com/downloads) 13 | - [Node.Js](https://nodejs.org/en/download/) 14 | - [Yarn](https://yarnpkg.com/) 15 | 16 | ## Set Up 17 | 18 | 1. Fork this repository by visiting https://github.com/PaulRBerg/create-eth-app/fork 19 | 2. Once the fork is created, head to the forked repo. For example, [this](https://github.com/robin-thomas/create-eth-app) is a fork of the original repo. 20 | 3. Clone the forked repo to your local machine 21 | 4. Then, inside the project's directory, run this to install the Node.js dependencies: 22 | 23 | ```bash 24 | $ yarn install --frozen-lockfile 25 | ``` 26 | 27 | Now you can start making changes. 28 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2020-present Paul Razvan Berg 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /handlebars/react/README.md.hbs: -------------------------------------------------------------------------------- 1 | This project was bootstrapped with [Create Eth App](https://github.com/paulrberg/create-eth-app) and the 2 | [{{ templateName }}]({{ templateUrl }}) template. 3 | 4 | This template contains {{ packages.length }} packages: 5 | 6 | {{#each packages }} 7 | - {{{ this }}} 8 | {{/each}} 9 | 10 | The React app implements a basic example for how to connect and pull data from the 11 | [{{ subgraphName }}]({{ subgraphUrl }}) subgraph. 12 | 13 | ## What is {{ templateName }}? 14 | 15 | {{{ description }}} 16 | -------------------------------------------------------------------------------- /handlebars/react/package.json.hbs: -------------------------------------------------------------------------------- 1 | { 2 | "name": "{{ packageName }}", 3 | "version": "1.0.0", 4 | "keywords": [ 5 | {{#each keywords}} 6 | "{{ this }}", 7 | {{/each}} 8 | "ethereum", 9 | "react", 10 | "workspaces", 11 | "yarn" 12 | ], 13 | "private": true, 14 | "scripts": { 15 | {{#with scripts }} 16 | {{#each keys }} 17 | "{{ this }}": "{{{lookup ../values @index }}}", 18 | {{/each }} 19 | {{/with }} 20 | "react-app:build": "yarn workspace {{ orgName }}/react-app build", 21 | "react-app:eject": "yarn workspace {{ orgName }}/react-app eject", 22 | "react-app:ipfs": "yarn workspace {{ orgName }}/react-app ipfs", 23 | "react-app:start": "yarn workspace {{ orgName }}/react-app start", 24 | "react-app:test": "yarn workspace {{ orgName }}/react-app test" 25 | }, 26 | "workspaces": { 27 | {{#if nohoist.length}} 28 | "nohoist": [ 29 | {{#each nohoist}} 30 | "{{ this }}"{{#unless @last}},{{/unless}} 31 | {{/each}} 32 | ], 33 | {{/if}} 34 | "packages": [ 35 | "packages/*" 36 | ] 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /handlebars/react/packages/contracts/README.md.hbs: -------------------------------------------------------------------------------- 1 | ## {{ title }} 2 | 3 | A minimalist, opinionated structure for managing smart contract ABIs and addresses. 4 | 5 | [Read more about Application Binary Interfaces (ABIs) here](https://ethereum.stackexchange.com/questions/234/what-is-an-abi-and-why-is-it-needed-to-interact-with-contracts). 6 | -------------------------------------------------------------------------------- /handlebars/react/packages/contracts/package.json.hbs: -------------------------------------------------------------------------------- 1 | { 2 | "name": "{{ packageName }}", 3 | "version": "1.0.0", 4 | "main": "./src/index.js" 5 | } 6 | -------------------------------------------------------------------------------- /handlebars/react/packages/contracts/src/index.js.hbs: -------------------------------------------------------------------------------- 1 | export { default as abis } from "./abis"; 2 | export { default as addresses } from "./addresses"; 3 | 4 | export * from "./addresses"; 5 | -------------------------------------------------------------------------------- /handlebars/react/packages/react-app/package.json.hbs: -------------------------------------------------------------------------------- 1 | { 2 | "name": "{{ packageName }}", 3 | "version": "1.0.0", 4 | "homepage": "./", 5 | "browserslist": { 6 | "production": [ 7 | ">0.2%", 8 | "not dead", 9 | "not op_mini all" 10 | ], 11 | "development": [ 12 | "last 1 chrome version", 13 | "last 1 firefox version", 14 | "last 1 safari version" 15 | ] 16 | }, 17 | "dependencies": { 18 | {{#with dependencies}} 19 | {{#each keys }} 20 | "{{ this }}": "{{{lookup ../values @index }}}", 21 | {{/each }} 22 | {{/with }} 23 | "@apollo/client": "^3.5.10", 24 | "@ethersproject/contracts": "^5.6.0", 25 | "@ethersproject/providers": "^5.6.0", 26 | "@testing-library/dom": "^8.11.3", 27 | "@testing-library/jest-dom": "^5.16.2", 28 | "@testing-library/react": "^12.1.4", 29 | "@testing-library/user-event": "^13.5.0", 30 | "@types/react": "^17.0.40", 31 | "@usedapp/core": "^1.1.5", 32 | "ethers": "^5.7.0", 33 | "graphql": "^16.3.0", 34 | "ipfs-deploy": "^11.2.0", 35 | "react": "17.0.2", 36 | "react-dom": "17.0.2", 37 | "react-scripts": "5.0.1", 38 | "styled-components": "^5.3.3" 39 | }, 40 | "eslintConfig": { 41 | "extends": [ 42 | "react-app", 43 | "react-app/jest" 44 | ] 45 | }, 46 | "scripts": { 47 | "build": "react-scripts build", 48 | "eject": "react-scripts eject", 49 | "ipfs": "yarn build && ipfs-deploy build/", 50 | "start": "react-scripts start", 51 | "test": "react-scripts test" 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /handlebars/react/packages/react-app/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WalletConnect/create-eth-app/eb9bdfea6d372f34053c6106c7733cd43df6e0e4/handlebars/react/packages/react-app/public/favicon.ico -------------------------------------------------------------------------------- /handlebars/react/packages/react-app/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 17 | 18 | 27 | Ethereum App 28 | 29 | 30 | 31 |
32 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /handlebars/react/packages/react-app/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WalletConnect/create-eth-app/eb9bdfea6d372f34053c6106c7733cd43df6e0e4/handlebars/react/packages/react-app/public/logo192.png -------------------------------------------------------------------------------- /handlebars/react/packages/react-app/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WalletConnect/create-eth-app/eb9bdfea6d372f34053c6106c7733cd43df6e0e4/handlebars/react/packages/react-app/public/logo512.png -------------------------------------------------------------------------------- /handlebars/react/packages/react-app/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "Eth App", 3 | "name": "Create Eth App Sample", 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 | -------------------------------------------------------------------------------- /handlebars/react/packages/react-app/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | -------------------------------------------------------------------------------- /handlebars/react/packages/react-app/src/App.js.hbs: -------------------------------------------------------------------------------- 1 | import { useQuery } from "@apollo/client"; 2 | import { Contract } from "@ethersproject/contracts"; 3 | import { shortenAddress, useCall, useEthers, useLookupAddress } from "@usedapp/core"; 4 | import React, { useEffect, useState } from "react"; 5 | 6 | import { Body, Button, Container, Header, Image, Link } from "./components"; 7 | import logo from "./ethereumLogo.png"; 8 | 9 | {{#each imports}} 10 | {{{ this }}} 11 | {{/each}} 12 | 13 | function WalletButton() { 14 | const [rendered, setRendered] = useState(""); 15 | 16 | const { ens } = useLookupAddress(); 17 | const { account, activateBrowserWallet, deactivate, error } = useEthers(); 18 | 19 | useEffect(() => { 20 | if (ens) { 21 | setRendered(ens); 22 | } else if (account) { 23 | setRendered(shortenAddress(account)); 24 | } else { 25 | setRendered(""); 26 | } 27 | }, [account, ens, setRendered]); 28 | 29 | useEffect(() => { 30 | if (error) { 31 | console.error("Error while connecting wallet:", error.message); 32 | } 33 | }, [error]); 34 | 35 | return ( 36 | 48 | ); 49 | } 50 | 51 | function App() { 52 | {{#each contractCall }} 53 | {{{ this }}} 54 | {{/each}} 55 | 56 | const { loading, error: subgraphQueryError, data } = useQuery({{ subgraphQuery.name }}); 57 | 58 | useEffect(() => { 59 | if (subgraphQueryError) { 60 | console.error("Error while querying subgraph:", subgraphQueryError.message); 61 | return; 62 | } 63 | if (!loading && data && data.{{ subgraphQuery.key }}) { 64 | console.log({ {{ subgraphQuery.key }}: data.{{ subgraphQuery.key }} }); 65 | } 66 | }, [loading, subgraphQueryError, data]); 67 | 68 | return ( 69 | 70 |
71 | 72 |
73 | 74 | ethereum-logo 75 |

76 | Edit packages/react-app/src/App.js and save to reload. 77 |

78 | 79 | Learn React 80 | 81 | Learn useDapp 82 | Learn {{ learn.name }} 83 | 84 |
85 | ); 86 | } 87 | 88 | export default App; 89 | -------------------------------------------------------------------------------- /handlebars/react/packages/react-app/src/App.test.js: -------------------------------------------------------------------------------- 1 | import { render } from "@testing-library/react"; 2 | import React from "react"; 3 | 4 | import App from "./App"; 5 | 6 | test("renders learn react link", () => { 7 | const { getByText } = render(); 8 | const linkElement = getByText(/learn react/i); 9 | expect(linkElement).toBeInTheDocument(); 10 | }); 11 | -------------------------------------------------------------------------------- /handlebars/react/packages/react-app/src/components/index.js: -------------------------------------------------------------------------------- 1 | import styled from "styled-components"; 2 | 3 | export const Body = styled.div` 4 | align-items: center; 5 | color: white; 6 | display: flex; 7 | flex-direction: column; 8 | font-size: calc(10px + 2vmin); 9 | justify-content: center; 10 | margin-top: 40px; 11 | `; 12 | 13 | export const Button = styled.button` 14 | background-color: white; 15 | border: none; 16 | border-radius: 8px; 17 | color: #282c34; 18 | cursor: pointer; 19 | font-size: 16px; 20 | margin: 0px 20px; 21 | padding: 12px 24px; 22 | text-align: center; 23 | text-decoration: none; 24 | `; 25 | 26 | export const Container = styled.div` 27 | background-color: #282c34; 28 | display: flex; 29 | flex-direction: column; 30 | height: calc(100vh); 31 | `; 32 | 33 | export const Header = styled.header` 34 | align-items: center; 35 | background-color: #282c34; 36 | color: white; 37 | display: flex; 38 | flex-direction: row; 39 | justify-content: flex-end; 40 | min-height: 70px; 41 | `; 42 | 43 | export const Image = styled.img` 44 | height: 40vmin; 45 | margin-bottom: 16px; 46 | pointer-events: none; 47 | `; 48 | 49 | export const Link = styled.a.attrs({ 50 | target: "_blank", 51 | rel: "noopener noreferrer", 52 | })` 53 | color: #61dafb; 54 | margin-top: 8px; 55 | `; 56 | -------------------------------------------------------------------------------- /handlebars/react/packages/react-app/src/ethereumLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WalletConnect/create-eth-app/eb9bdfea6d372f34053c6106c7733cd43df6e0e4/handlebars/react/packages/react-app/src/ethereumLogo.png -------------------------------------------------------------------------------- /handlebars/react/packages/react-app/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", 4 | "Droid Sans", "Helvetica Neue", sans-serif; 5 | -webkit-font-smoothing: antialiased; 6 | -moz-osx-font-smoothing: grayscale; 7 | } 8 | 9 | code { 10 | font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace; 11 | } 12 | -------------------------------------------------------------------------------- /handlebars/react/packages/react-app/src/index.js.hbs: -------------------------------------------------------------------------------- 1 | import "./index.css"; 2 | 3 | import { ApolloClient, ApolloProvider, InMemoryCache } from "@apollo/client"; 4 | import { DAppProvider, Mainnet } from "@usedapp/core"; 5 | import React from "react"; 6 | import ReactDOM from "react-dom"; 7 | 8 | import App from "./App"; 9 | 10 | // IMPORTANT, PLEASE READ 11 | // To avoid disruptions in your app, change this to your own Infura project id. 12 | // https://infura.io/register 13 | const INFURA_PROJECT_ID = "529670718fd74cd2a041466303daecd7"; 14 | const config = { 15 | readOnlyChainId: Mainnet.chainId, 16 | readOnlyUrls: { 17 | [Mainnet.chainId]: "https://mainnet.infura.io/v3/" + INFURA_PROJECT_ID, 18 | }, 19 | } 20 | 21 | {{{ subgraph.comment }}} 22 | // See all subgraphs: https://thegraph.com/explorer/ 23 | const client = new ApolloClient({ 24 | cache: new InMemoryCache(), 25 | uri: "{{ subgraph.url }}", 26 | }); 27 | 28 | ReactDOM.render( 29 | 30 | 31 | 32 | 33 | 34 | 35 | , 36 | document.getElementById("root"), 37 | ); 38 | -------------------------------------------------------------------------------- /handlebars/react/packages/react-app/src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import "@testing-library/jest-dom/extend-expect"; 6 | -------------------------------------------------------------------------------- /handlebars/vue/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "env": { 4 | "node": true 5 | }, 6 | "extends": ["plugin:vue/essential", "eslint:recommended"], 7 | "parserOptions": { 8 | "parser": "babel-eslint" 9 | }, 10 | "rules": {} 11 | } 12 | -------------------------------------------------------------------------------- /handlebars/vue/README.md.hbs: -------------------------------------------------------------------------------- 1 | This project was bootstrapped with [Create Eth App](https://github.com/paulrberg/create-eth-app) and the 2 | [{{ templateName }}]({{ templateUrl }}) template. 3 | 4 | This template contains {{ packages.length }} packages: 5 | 6 | {{#each packages }} 7 | - {{{ this }}} 8 | {{/each}} 9 | 10 | The Vue app implements a basic example for how to connect and pull data from the 11 | [{{ subgraphName }}]({{ subgraphUrl }}) subgraph. 12 | 13 | ## What is {{ templateName }}? 14 | 15 | {{{ description }}} 16 | -------------------------------------------------------------------------------- /handlebars/vue/package.json.hbs: -------------------------------------------------------------------------------- 1 | { 2 | "name": "{{ packageName }}", 3 | "version": "1.0.0", 4 | "keywords": [ 5 | {{#each keywords}} 6 | "{{ this }}", 7 | {{/each}} 8 | "ethereum", 9 | "vue", 10 | "workspaces", 11 | "yarn" 12 | ], 13 | "private": true, 14 | "scripts": { 15 | {{#with scripts }} 16 | {{#each keys }} 17 | "{{ this }}": "{{{lookup ../values @index }}}", 18 | {{/each }} 19 | {{/with }} 20 | "vue-app:build": "yarn workspace {{ orgName }}/vue-app build", 21 | "vue-app:ipfs": "yarn workspace {{ orgName }}/vue-app ipfs", 22 | "vue-app:lint": "yarn workspace {{ orgName }}/vue-app lint", 23 | "vue-app:serve": "yarn workspace {{ orgName }}/vue-app serve" 24 | }, 25 | "workspaces": { 26 | {{#if nohoist.length}} 27 | "nohoist": [ 28 | {{#each nohoist}} 29 | "{{ this }}"{{#unless @last}},{{/unless}} 30 | {{/each}} 31 | ], 32 | {{/if}} 33 | "packages": [ 34 | "packages/*" 35 | ] 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /handlebars/vue/packages/contracts/README.md.hbs: -------------------------------------------------------------------------------- 1 | ## {{ title }} 2 | 3 | A minimalist, opinionated structure for managing smart contract ABIs and addresses. 4 | 5 | [Read more about Application Binary Interfaces (ABIs) here](https://ethereum.stackexchange.com/questions/234/what-is-an-abi-and-why-is-it-needed-to-interact-with-contracts). 6 | -------------------------------------------------------------------------------- /handlebars/vue/packages/contracts/package.json.hbs: -------------------------------------------------------------------------------- 1 | { 2 | "name": "{{ packageName }}", 3 | "version": "1.0.0", 4 | "main": "./src/index.js" 5 | } 6 | -------------------------------------------------------------------------------- /handlebars/vue/packages/contracts/src/index.js.hbs: -------------------------------------------------------------------------------- 1 | export { default as abis } from "./abis"; 2 | export { default as addresses } from "./addresses"; 3 | 4 | export * from "./addresses"; 5 | -------------------------------------------------------------------------------- /handlebars/vue/packages/vue-app/README.md.hbs: -------------------------------------------------------------------------------- 1 | # {{ title }} 2 | 3 | This package is a fork of the default app built by the [Vue CLI](https://cli.vuejs.org/). 4 | 5 | ## Project setup 6 | 7 | ```sh 8 | yarn install 9 | ``` 10 | 11 | ### Compiles and hot-reloads for development 12 | 13 | ```sh 14 | yarn serve 15 | ``` 16 | 17 | ### Compiles and minifies for production 18 | 19 | ```sh 20 | yarn build 21 | ``` 22 | 23 | ### Lints and fixes files 24 | 25 | ```sh 26 | yarn lint 27 | ``` 28 | 29 | ### Customize configuration 30 | 31 | See [Configuration Reference](https://cli.vuejs.org/config/). 32 | -------------------------------------------------------------------------------- /handlebars/vue/packages/vue-app/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ["@vue/cli-plugin-babel/preset"], 3 | }; 4 | -------------------------------------------------------------------------------- /handlebars/vue/packages/vue-app/package.json.hbs: -------------------------------------------------------------------------------- 1 | { 2 | "name": "{{ packageName }}", 3 | "version": "1.0.0", 4 | "browserslist": [ 5 | "> 1%", 6 | "last 2 versions", 7 | "not dead" 8 | ], 9 | "dependencies": { 10 | {{#with dependencies}} 11 | {{#each keys }} 12 | "{{ this }}": "{{{lookup ../values @index }}}", 13 | {{/each }} 14 | {{/with }} 15 | "@ethersproject/contracts": "^5.3.0", 16 | "@ethersproject/providers": "^5.3.1", 17 | "@vue/cli-plugin-babel": "~4.5.13", 18 | "@vue/cli-plugin-eslint": "~4.5.13", 19 | "@vue/cli-service": "~4.5.13", 20 | "apollo-cache-inmemory": "^1.6.6", 21 | "apollo-client": "^2.6.10", 22 | "apollo-link-http": "^1.5.17", 23 | "babel-eslint": "^10.1.0", 24 | "core-js": "^3.14.0", 25 | "eslint": "^6.8.0", 26 | "eslint-plugin-vue": "^6.2.2", 27 | "graphql": "^15.5.0", 28 | "graphql-tag": "^2.12.4", 29 | "ipfs-deploy": "^11.1.0", 30 | "vue": "^2.6.14", 31 | "vue-apollo": "^3.0.7", 32 | "vue-template-compiler": "^2.6.14" 33 | }, 34 | "eslintConfig": { 35 | "root": true, 36 | "env": { 37 | "node": true 38 | }, 39 | "extends": [ 40 | "plugin:vue/essential", 41 | "eslint:recommended" 42 | ], 43 | "parserOptions": { 44 | "parser": "babel-eslint" 45 | }, 46 | "rules": {} 47 | }, 48 | "private": true, 49 | "scripts": { 50 | "build": "vue-cli-service build", 51 | "ipfs": "yarn build && ipfs-deploy build/", 52 | "lint": "vue-cli-service lint", 53 | "serve": "vue-cli-service serve" 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /handlebars/vue/packages/vue-app/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WalletConnect/create-eth-app/eb9bdfea6d372f34053c6106c7733cd43df6e0e4/handlebars/vue/packages/vue-app/public/favicon.ico -------------------------------------------------------------------------------- /handlebars/vue/packages/vue-app/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 14 | Ethereum App 15 | 16 | 17 | 23 |
24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /handlebars/vue/packages/vue-app/src/App.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 18 | 19 | 29 | -------------------------------------------------------------------------------- /handlebars/vue/packages/vue-app/src/assets/ethereumLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WalletConnect/create-eth-app/eb9bdfea6d372f34053c6106c7733cd43df6e0e4/handlebars/vue/packages/vue-app/src/assets/ethereumLogo.png -------------------------------------------------------------------------------- /handlebars/vue/packages/vue-app/src/main.js.hbs: -------------------------------------------------------------------------------- 1 | import { InMemoryCache } from "apollo-cache-inmemory"; 2 | import { ApolloClient } from "apollo-client"; 3 | import { createHttpLink } from "apollo-link-http"; 4 | import Vue from "vue"; 5 | import VueApollo from "vue-apollo"; 6 | 7 | import App from "./App.vue"; 8 | 9 | Vue.config.productionTip = false; 10 | 11 | // Cache implementation 12 | const cache = new InMemoryCache(); 13 | 14 | // HTTP connection to the API 15 | const httpLink = createHttpLink({ 16 | // You should use an absolute URL here 17 | uri: "{{ subgraph.url }}", 18 | }); 19 | 20 | // Create the apollo client 21 | const apolloClient = new ApolloClient({ 22 | cache, 23 | link: httpLink, 24 | }); 25 | 26 | // Install the vue plugin 27 | // With the apollo client instance 28 | Vue.use(VueApollo, { 29 | apolloClient, 30 | }); 31 | 32 | const apolloProvider = new VueApollo({ 33 | defaultClient: apolloClient, 34 | }); 35 | 36 | new Vue({ 37 | apolloProvider, 38 | render: h => h(App), 39 | }).$mount("#app"); 40 | -------------------------------------------------------------------------------- /handlebars/vue/packages/vue-app/vue.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | publicPath: "./", 3 | outputDir: "build", 4 | }; 5 | -------------------------------------------------------------------------------- /jest.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from "jest"; 2 | 3 | const config: Config = { 4 | collectCoverageFrom: ["/src/**/*.ts", "!/src/**/*.d.ts"], 5 | coveragePathIgnorePatterns: ["node_modules"], 6 | coverageReporters: ["lcov", "html"], 7 | modulePathIgnorePatterns: ["/handlebars", "/templates"], 8 | preset: "ts-jest", 9 | setupFiles: ["./.jest/env.js"], 10 | setupFilesAfterEnv: ["./.jest/setup.js"], 11 | testEnvironment: "node", 12 | testMatch: ["**/test/**/*.test.ts"], 13 | }; 14 | 15 | export default config; 16 | -------------------------------------------------------------------------------- /screencast.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WalletConnect/create-eth-app/eb9bdfea6d372f34053c6106c7733cd43df6e0e4/screencast.gif -------------------------------------------------------------------------------- /src/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* 17 | 18 | # debug 19 | npm-debug.log* 20 | yarn-debug.log* 21 | yarn-error.log* 22 | -------------------------------------------------------------------------------- /src/helpers/directories.ts: -------------------------------------------------------------------------------- 1 | import chalk from "chalk"; 2 | import fs from "fs"; 3 | import path from "path"; 4 | 5 | export function isDirectoryEmpty(directoryPath: string, appName: string): boolean { 6 | const validFiles: string[] = [ 7 | ".DS_Store", 8 | ".git", 9 | ".gitattributes", 10 | ".gitignore", 11 | ".gitlab-ci.yml", 12 | ".hg", 13 | ".hgcheck", 14 | ".hgignore", 15 | ".idea", 16 | ".npmignore", 17 | ".travis.yml", 18 | ".yarn", 19 | ".yarnrc.yml", 20 | "LICENSE", 21 | "Thumbs.db", 22 | "docs", 23 | "mkdocs.yml", 24 | "npm-debug.log", 25 | "yarn-debug.log", 26 | "yarn-error.log", 27 | ]; 28 | 29 | const conflicts: string[] = fs 30 | .readdirSync(directoryPath) 31 | .filter(function (file: string) { 32 | return validFiles.includes(file) === false; 33 | }) 34 | // Support IntelliJ IDEA-based editors 35 | .filter(function (file: string) { 36 | return /\.iml$/.test(file) === false; 37 | }); 38 | 39 | if (conflicts.length > 0) { 40 | console.log("The directory " + chalk.green(appName) + " contains files that could conflict:"); 41 | console.log(); 42 | for (const file of conflicts) { 43 | try { 44 | const stats: fs.Stats = fs.lstatSync(path.join(directoryPath, file)); 45 | if (stats.isDirectory()) { 46 | console.log(` ${chalk.blue(file)}/`); 47 | } else { 48 | console.log(` ${file}`); 49 | } 50 | } catch { 51 | console.log(` ${file}`); 52 | } 53 | } 54 | console.log(); 55 | console.log("Either try using a new directory name, or remove the files listed above."); 56 | console.log(); 57 | return false; 58 | } 59 | 60 | return true; 61 | } 62 | 63 | export async function isDirectoryWriteable(directory: string): Promise { 64 | try { 65 | await fs.promises.access(directory, (fs.constants || fs).W_OK); 66 | return true; 67 | } catch (err) { 68 | return false; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/helpers/env.ts: -------------------------------------------------------------------------------- 1 | import packageJson from "../../package.json"; 2 | import { semanticVersionRegex } from "./constants"; 3 | 4 | const packageVersionRegex: RegExp = new RegExp("^v" + semanticVersionRegex.source + "$"); 5 | 6 | /** 7 | * If the program is run in CI, return the GitHub Actions env variables. 8 | * If it is run in development mode, return the development env variables. 9 | * Otherwise, assume it is production mode and use the package version. 10 | */ 11 | export function getRefs(): { ref: string; tarGzRef: string } { 12 | let ref: string = ""; 13 | let tarGzRef: string = ""; 14 | 15 | if (!process.env.CI) { 16 | if (process.env.CEA_ENV === "development") { 17 | if (!process.env.DEVELOPMENT_REF) { 18 | console.log("Please set a DEVELOPMENT_REF environment variable."); 19 | process.exit(1); 20 | } else { 21 | ref = process.env.DEVELOPMENT_REF; 22 | } 23 | 24 | if (packageVersionRegex.test(ref)) { 25 | tarGzRef = ref.slice(1); 26 | } else { 27 | tarGzRef = ref.replace(new RegExp(/\//g), "-"); 28 | } 29 | } else { 30 | ref = "v" + packageJson.version; 31 | tarGzRef = packageJson.version; 32 | } 33 | } else { 34 | if (!process.env.GITHUB_REF) { 35 | console.log("Please set a GITHUB_REF environment variable."); 36 | process.exit(1); 37 | } else { 38 | // TODO: handle "refs/", "refs/tags/", etc. 39 | ref = process.env.GITHUB_REF.replace("refs/heads/", ""); 40 | if (packageVersionRegex.test(ref)) { 41 | tarGzRef = ref.slice(1); 42 | } else { 43 | tarGzRef = ref.replace(new RegExp(/\//g), "-"); 44 | } 45 | } 46 | } 47 | 48 | return { ref, tarGzRef }; 49 | } 50 | 51 | /** 52 | * If the program is run in CI, source the GitHub Actions env variable. 53 | * Otherwise, assume it is production mode and use the package repository name. 54 | */ 55 | export function getRepository(): string { 56 | if (!process.env.CI) { 57 | return packageJson.repository.name; 58 | } else { 59 | if (!process.env.GITHUB_REPOSITORY) { 60 | console.log("Please set a GITHUB_REPOSITORY environment variable."); 61 | process.exit(1); 62 | } else { 63 | return process.env.GITHUB_REPOSITORY; 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/helpers/errors.ts: -------------------------------------------------------------------------------- 1 | import chalk from "chalk"; 2 | 3 | export function throwFrameworkNotFoundError(framework: string): void { 4 | console.error( 5 | `Could not locate a UI framework named ${chalk.red(`"${framework}"`)}. Please check your spelling and try again.`, 6 | ); 7 | process.exit(1); 8 | } 9 | 10 | export function throwTemplateNotFoundError(template: string): void { 11 | console.error( 12 | `Could not locate a template named ${chalk.red(`"${template}"`)}. Please check your spelling and try again.`, 13 | ); 14 | process.exit(1); 15 | } 16 | -------------------------------------------------------------------------------- /src/helpers/frameworks.ts: -------------------------------------------------------------------------------- 1 | import fsExtra from "fs-extra"; 2 | import got from "got"; 3 | import promisePipe from "promisepipe"; 4 | import tar from "tar"; 5 | 6 | import { codeloadBaseUrl, githubApiBaseUrl } from "./constants"; 7 | import { getRefs, getRepository } from "./env"; 8 | import { urlExists } from "./url"; 9 | 10 | export async function downloadAndExtractFrameworkHandlebars(root: string, framework: string): Promise { 11 | await fsExtra.ensureDir(root); 12 | const repository: string = getRepository(); 13 | const { ref, tarGzRef } = getRefs(); 14 | const downloadUrl: string = codeloadBaseUrl + "/" + repository + "/tar.gz/" + ref; 15 | return promisePipe( 16 | got.stream(downloadUrl), 17 | tar.extract({ cwd: root, strip: 3 }, [`create-eth-app-${tarGzRef}/handlebars/${framework}`]), 18 | ); 19 | } 20 | 21 | export function hasFramework(framework: string): Promise { 22 | const repository: string = getRepository(); 23 | const { ref } = getRefs(); 24 | const url: string = `${githubApiBaseUrl}/${repository}/contents/templates/${encodeURIComponent( 25 | framework, 26 | )}?ref=${ref}`; 27 | return urlExists(url); 28 | } 29 | 30 | export function hasFrameworkHandlebars(framework: string): Promise { 31 | const repository: string = getRepository(); 32 | const { ref } = getRefs(); 33 | const url: string = `${githubApiBaseUrl}/${repository}/contents/handlebars/${encodeURIComponent( 34 | framework, 35 | )}?ref=${ref}`; 36 | return urlExists(url); 37 | } 38 | -------------------------------------------------------------------------------- /src/helpers/git.ts: -------------------------------------------------------------------------------- 1 | import { execSync } from "child_process"; 2 | import fsExtra from "fs-extra"; 3 | import path from "path"; 4 | 5 | export function isInGitRepository(): boolean { 6 | try { 7 | execSync("git rev-parse --is-inside-work-tree", { stdio: "ignore" }); 8 | return true; 9 | } catch (_) { 10 | // Ignore error. 11 | } 12 | return false; 13 | } 14 | 15 | export function isInMercurialRepository(): boolean { 16 | try { 17 | execSync("hg --cwd . root", { stdio: "ignore" }); 18 | return true; 19 | } catch (_) { 20 | // Ignore error. 21 | } 22 | return false; 23 | } 24 | 25 | export function tryGitInit(root: string): boolean { 26 | let didInit: boolean = false; 27 | try { 28 | execSync("git --version", { stdio: "ignore" }); 29 | if (isInGitRepository() || isInMercurialRepository()) { 30 | return false; 31 | } 32 | 33 | execSync("git init", { stdio: "ignore" }); 34 | didInit = true; 35 | 36 | execSync("git add -A", { stdio: "ignore" }); 37 | execSync('git commit -m "Initial commit from Create Eth App"', { 38 | stdio: "ignore", 39 | }); 40 | return true; 41 | } catch (error) { 42 | if (didInit) { 43 | try { 44 | fsExtra.removeSync(path.join(root, ".git")); 45 | } catch (_) { 46 | // Ignore error. 47 | } 48 | } 49 | return false; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/helpers/networking.ts: -------------------------------------------------------------------------------- 1 | import { execSync } from "child_process"; 2 | import dns from "dns"; 3 | import url from "url"; 4 | 5 | export function getProxy(): string { 6 | if (process.env.https_proxy) { 7 | return process.env.https_proxy; 8 | } 9 | 10 | try { 11 | const httpsProxy = execSync("npm config get https-proxy").toString().trim(); 12 | if (httpsProxy !== "null") { 13 | return httpsProxy; 14 | } else { 15 | return ""; 16 | } 17 | } catch (e) { 18 | return ""; 19 | } 20 | } 21 | 22 | export function getOnline(): Promise { 23 | return new Promise(function (resolve) { 24 | dns.lookup("registry.yarnpkg.com", function (registryErr: NodeJS.ErrnoException | null) { 25 | if (!registryErr) { 26 | return resolve(true); 27 | } 28 | 29 | const proxy = getProxy(); 30 | if (!proxy) { 31 | return resolve(false); 32 | } 33 | 34 | const { hostname } = url.parse(proxy); 35 | if (!hostname) { 36 | return resolve(false); 37 | } 38 | 39 | dns.lookup(hostname, function (proxyErr: NodeJS.ErrnoException | null) { 40 | resolve(proxyErr == null); 41 | }); 42 | }); 43 | }); 44 | } 45 | -------------------------------------------------------------------------------- /src/helpers/npm.ts: -------------------------------------------------------------------------------- 1 | import validateNpmPackagetName from "validate-npm-package-name"; 2 | 3 | export function validatePkgName(name: string): { problems?: string[]; valid: boolean } { 4 | const nameValidation = validateNpmPackagetName(name); 5 | if (nameValidation.validForNewPackages) { 6 | return { valid: true }; 7 | } 8 | 9 | return { 10 | problems: [...(nameValidation.errors || []), ...(nameValidation.warnings || [])], 11 | valid: false, 12 | }; 13 | } 14 | -------------------------------------------------------------------------------- /src/helpers/templates.ts: -------------------------------------------------------------------------------- 1 | import fsExtra from "fs-extra"; 2 | import got from "got"; 3 | import Handlebars from "handlebars"; 4 | import path from "path"; 5 | import promisePipe from "promisepipe"; 6 | import tar from "tar"; 7 | 8 | import { 9 | FrameworkKey, 10 | HandlebarsFiles, 11 | HardcodedTemplateFiles, 12 | TemplateKey, 13 | codeloadBaseUrl, 14 | githubApiBaseUrl, 15 | } from "./constants"; 16 | import { getRefs, getRepository } from "./env"; 17 | import { urlExists } from "./url"; 18 | 19 | export async function downloadAndExtractTemplateContext( 20 | root: string, 21 | framework: FrameworkKey, 22 | template: TemplateKey, 23 | ): Promise { 24 | await fsExtra.ensureDir(root); 25 | const repository: string = getRepository(); 26 | const { ref, tarGzRef } = getRefs(); 27 | const downloadUrl: string = codeloadBaseUrl + "/" + repository + "/tar.gz/" + ref; 28 | return promisePipe( 29 | got.stream(downloadUrl), 30 | tar.extract({ cwd: root, strip: 4 }, [`create-eth-app-${tarGzRef}/templates/${framework}/${template}`]), 31 | ); 32 | } 33 | 34 | export async function parseTemplate( 35 | appPath: string, 36 | templateContextPath: string, 37 | framework: FrameworkKey, 38 | template: TemplateKey, 39 | ): Promise { 40 | for (const handlebarFile of HandlebarsFiles[framework]) { 41 | const contextFileName: string = handlebarFile + ".ctx"; 42 | const contextFilePath: string = path.join(templateContextPath, contextFileName); 43 | const contextFileContents: string = await fsExtra.readFile(contextFilePath, "utf-8"); 44 | const context: JSON = JSON.parse(contextFileContents); 45 | 46 | const hbsFileName: string = handlebarFile + ".hbs"; 47 | const hbsFilePath: string = path.join(appPath, hbsFileName); 48 | const hnsFileContents: string = await fsExtra.readFile(hbsFilePath, "utf-8"); 49 | 50 | const appFilePath: string = path.join(appPath, handlebarFile); 51 | const appFileContents: string = Handlebars.compile(hnsFileContents)(context); 52 | await fsExtra.writeFile(appFilePath, appFileContents); 53 | await fsExtra.remove(hbsFilePath); 54 | } 55 | 56 | for (const hardcodedTemplateFile of HardcodedTemplateFiles[framework][template]) { 57 | const contextFilePath: string = path.join(templateContextPath, hardcodedTemplateFile); 58 | const appFilePath: string = path.join(appPath, hardcodedTemplateFile); 59 | 60 | // Any standard file with the same name as a hardcoded file gets overridden. 61 | if (fsExtra.existsSync(appFilePath)) { 62 | await fsExtra.remove(appFilePath); 63 | } 64 | await fsExtra.move(contextFilePath, appFilePath); 65 | } 66 | 67 | // After all parsing is complete, prune the context of the current template. 68 | await fsExtra.remove(templateContextPath); 69 | } 70 | 71 | export function hasTemplate(framework: string, template: string): Promise { 72 | const repository: string = getRepository(); 73 | const { ref } = getRefs(); 74 | const url: string = `${githubApiBaseUrl}/${repository}/contents/templates/${framework}/${encodeURIComponent( 75 | template, 76 | )}?ref=${ref}`; 77 | return urlExists(url); 78 | } 79 | -------------------------------------------------------------------------------- /src/helpers/url.ts: -------------------------------------------------------------------------------- 1 | import https from "https"; 2 | 3 | export const urlExists = (url: string): Promise => 4 | new Promise(resolve => { 5 | https.get( 6 | url, 7 | { 8 | headers: { 9 | "User-Agent": "create-eth-app", 10 | }, 11 | }, 12 | res => resolve(res.statusCode === 200), 13 | ); 14 | }); 15 | -------------------------------------------------------------------------------- /src/helpers/yarn.ts: -------------------------------------------------------------------------------- 1 | import chalk from "chalk"; 2 | import { execSync } from "child_process"; 3 | import type { ChildProcess } from "child_process"; 4 | import spawn from "cross-spawn"; 5 | 6 | export function installDeps( 7 | root: string, 8 | dependencies: string[] | null, 9 | { isOnline }: { isOnline: boolean }, 10 | ): Promise { 11 | return new Promise(function (resolve, reject) { 12 | const command: string = "yarnpkg"; 13 | const args: string[] = dependencies ? ["add", "--exact"] : ["install"]; 14 | 15 | if (!isOnline) { 16 | args.push("--offline"); 17 | } 18 | if (dependencies) { 19 | args.push(...dependencies); 20 | } 21 | args.push("--cwd", root); 22 | 23 | if (!isOnline) { 24 | console.log(chalk.yellow("You appear to be offline.")); 25 | console.log(chalk.yellow("Falling back to the local Yarn cache.")); 26 | console.log(); 27 | } 28 | 29 | const child: ChildProcess = spawn(command, args, { 30 | env: { ...process.env, ADBLOCK: "1", DISABLE_OPENCOLLECTIVE: "1" }, 31 | stdio: "inherit", 32 | }); 33 | child.on("close", function (code: number) { 34 | if (code !== 0) { 35 | reject({ command: `${command} ${args.join(" ")}` }); 36 | return; 37 | } 38 | resolve(); 39 | }); 40 | }); 41 | } 42 | 43 | export function shouldUseYarn(): void { 44 | try { 45 | execSync("yarnpkg --version", { stdio: "ignore" }); 46 | } catch (error) { 47 | console.error("Yarn is necessary for Create Eth App. Install it by following the official documentation:"); 48 | console.log(); 49 | console.log(chalk.cyan(" https://classic.yarnpkg.com/en/docs/install")); 50 | process.exit(1); 51 | } 52 | } 53 | 54 | export function shouldUseYarnWorkspaces(): void { 55 | const yarnVersion: string = execSync("yarnpkg --version", { encoding: "utf8" }); 56 | if (yarnVersion.startsWith("0")) { 57 | const workspacesFlag: string = execSync("yarnpkg config get workspaces-experimental", { encoding: "utf8" }); 58 | if (!workspacesFlag.startsWith("true")) { 59 | console.error( 60 | "The Yarn Workspaces feature is necessary for Create Eth App. Please enable it by running this command:", 61 | ); 62 | console.log(); 63 | console.log(chalk.cyan(" yarn config set workspaces-experimental true")); 64 | process.exit(1); 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /templates/react/aave/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Aave is a decentralized non-custodial money market protocol where users can participate as depositors or borrowers. Read more about it in the [official documentation](https://developers.aave.com/).", 3 | "packages": [ 4 | "[contracts](/packages/contracts)", 5 | "[react-app](/packages/react-app)" 6 | ], 7 | "subgraphName": "Aave", 8 | "subgraphUrl": "https://thegraph.com/explorer/subgraph/aave/protocol", 9 | "templateName": "Aave", 10 | "templateUrl": "https://github.com/paulrberg/create-eth-app/tree/develop/templates/react/aave" 11 | } 12 | -------------------------------------------------------------------------------- /templates/react/aave/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "orgName": "@aave-app", 3 | "packageName": "@aave-app/monorepo", 4 | "keywords": [ 5 | "aave" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /templates/react/aave/packages/contracts/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "title": "@aave-app/contracts" 3 | } 4 | -------------------------------------------------------------------------------- /templates/react/aave/packages/contracts/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "packageName": "@aave-app/contracts" 3 | } 4 | -------------------------------------------------------------------------------- /templates/react/aave/packages/contracts/src/abis.js: -------------------------------------------------------------------------------- 1 | import aToken from "./abis/aToken.json"; 2 | import lendingPool from "./abis/lendingPool.json"; 3 | import lendingPoolAddressesProvider from "./abis/lendingPoolAddressesProvider.json"; 4 | import lendingPoolCore from "./abis/lendingPoolCore.json"; 5 | 6 | export default { 7 | aToken, 8 | lendingPool, 9 | lendingPoolAddressesProvider, 10 | lendingPoolCore, 11 | }; 12 | -------------------------------------------------------------------------------- /templates/react/aave/packages/contracts/src/index.js.ctx: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /templates/react/aave/packages/react-app/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "title": "@aave-app/react-app" 3 | } 4 | -------------------------------------------------------------------------------- /templates/react/aave/packages/react-app/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "packageName": "@aave-app/react-app", 3 | "dependencies": { 4 | "keys": [ 5 | "@aave-app/contracts" 6 | ], 7 | "values": [ 8 | "^1.0.0" 9 | ] 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /templates/react/aave/packages/react-app/src/App.js.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "contractCall": [ 3 | "// Read more about useDapp on https://usedapp.io/", 4 | "const { error: contractCallError, value: tokenBalance } =", 5 | " useCall({", 6 | " contract: new Contract(addresses[MAINNET_ID].tokens.aDAI, abis.aToken),", 7 | " method: \"balanceOf\",", 8 | " args: [\"0x3f8CB69d9c0ED01923F11c829BaE4D9a4CB6c82C\"],", 9 | " }) ?? {};" 10 | ], 11 | "imports": [ 12 | "import { MAINNET_ID, addresses, abis } from \"@aave-app/contracts\";", 13 | "import GET_LENDING_POOL_CONFIGURATION_HISTORY_ITEMS from \"./graphql/subgraph\";" 14 | ], 15 | "learn": { 16 | "name": "Aave", 17 | "url": "https://developers.aave.com/" 18 | }, 19 | "subgraphQuery": { 20 | "key": "lendingPoolConfigurationHistoryItems", 21 | "name": "GET_LENDING_POOL_CONFIGURATION_HISTORY_ITEMS" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /templates/react/aave/packages/react-app/src/graphql/subgraph.js: -------------------------------------------------------------------------------- 1 | import { gql } from "@apollo/client"; 2 | 3 | // See more example queries on https://thegraph.com/explorer/subgraph/aave/protocol 4 | const GET_LENDING_POOL_CONFIGURATION_HISTORY_ITEMS = gql` 5 | { 6 | lendingPoolConfigurationHistoryItems(first: 5) { 7 | id 8 | provider { 9 | id 10 | } 11 | lendingPool 12 | lendingPoolCore 13 | } 14 | } 15 | `; 16 | 17 | export default GET_LENDING_POOL_CONFIGURATION_HISTORY_ITEMS; 18 | -------------------------------------------------------------------------------- /templates/react/aave/packages/react-app/src/index.js.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "subgraph": { 3 | "comment": "// This is the official Aave subgraph. You can replace it with your own, if you need to.", 4 | "url": "https://api.thegraph.com/subgraphs/name/aave/protocol" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /templates/react/chainlink/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Chainlink is middleware to simplify communication with blockchains. Read more about it in the [official documentation](https://docs.chain.link/).", 3 | "packages": [ 4 | "[contracts](/packages/contracts)", 5 | "[react-app](/packages/react-app)" 6 | ], 7 | "subgraphName": "Chainlink", 8 | "subgraphUrl": "https://thegraph.com/legacy-explorer/subgraph/tomafrench/chainlink", 9 | "templateName": "Chainlink", 10 | "templateUrl": "https://github.com/paulrberg/create-eth-app/tree/develop/templates/react/chainlink" 11 | } 12 | -------------------------------------------------------------------------------- /templates/react/chainlink/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "orgName": "@chainlink-app", 3 | "packageName": "@chainlink-app/monorepo", 4 | "keywords": [ 5 | "chainlink" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /templates/react/chainlink/packages/contracts/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "title": "@chainlink-app/contracts" 3 | } 4 | -------------------------------------------------------------------------------- /templates/react/chainlink/packages/contracts/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "packageName": "@chainlink-app/contracts" 3 | } 4 | -------------------------------------------------------------------------------- /templates/react/chainlink/packages/contracts/src/abis.js: -------------------------------------------------------------------------------- 1 | export default {}; 2 | -------------------------------------------------------------------------------- /templates/react/chainlink/packages/contracts/src/abis/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WalletConnect/create-eth-app/eb9bdfea6d372f34053c6106c7733cd43df6e0e4/templates/react/chainlink/packages/contracts/src/abis/.gitkeep -------------------------------------------------------------------------------- /templates/react/chainlink/packages/contracts/src/index.js.ctx: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /templates/react/chainlink/packages/react-app/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "title": "@chainlink-app/react-app" 3 | } 4 | -------------------------------------------------------------------------------- /templates/react/chainlink/packages/react-app/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "packageName": "@chainlink-app/react-app", 3 | "dependencies": { 4 | "keys": [ 5 | "@chainlink-app/contracts", 6 | "@chainlink/contracts" 7 | ], 8 | "values": [ 9 | "^1.0.0", 10 | "0.2.1" 11 | ] 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /templates/react/chainlink/packages/react-app/src/App.js.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "contractCall": [ 3 | "// Read more about useDapp on https://usedapp.io/", 4 | "const { error: contractCallError, value: price } =", 5 | " useCall({", 6 | " contract: new Contract(addresses[MAINNET_ID].ETHUSD, AggregatorV3InterfaceABI),", 7 | " method: \"latestRoundData\",", 8 | " args: [],", 9 | " }) ?? {};" 10 | ], 11 | "imports": [ 12 | "import { MAINNET_ID, addresses } from \"@chainlink-app/contracts\";", 13 | "import AggregatorV3InterfaceABI from \"@chainlink/contracts/abi/v0.6/AggregatorV3Interface.json\";", 14 | "import GET_PRICES_FEEDS from \"./graphql/subgraph\";" 15 | ], 16 | "learn": { 17 | "name": "Chainlink", 18 | "url": "https://docs.chain.link/" 19 | }, 20 | "subgraphQuery": { 21 | "key": "priceFeeds", 22 | "name": "GET_PRICES_FEEDS" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /templates/react/chainlink/packages/react-app/src/graphql/subgraph.js: -------------------------------------------------------------------------------- 1 | import { gql } from "@apollo/client"; 2 | 3 | // See more example queries on https://thegraph.com/legacy-explorer/subgraph/tomafrench/chainlink 4 | const GET_PRICES_FEEDS = gql` 5 | { 6 | priceFeeds(first: 5) { 7 | id 8 | assetPair 9 | decimals 10 | latestPrice { 11 | id 12 | } 13 | } 14 | } 15 | `; 16 | 17 | export default GET_PRICES_FEEDS; 18 | -------------------------------------------------------------------------------- /templates/react/chainlink/packages/react-app/src/index.js.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "subgraph": { 3 | "comment": "// This is NOT the official Chainlink subgraph. You can replace it with your own, if you need to.", 4 | "url": "https://api.thegraph.com/subgraphs/name/tomafrench/chainlink" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /templates/react/compound/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Compound is an algorithmic, autonomous interest rate protocol built for developers, to unlock a universe of open financial applications. Read more about it in the [official documentation](https://compound.finance/developers).", 3 | "packages": [ 4 | "[contracts](/packages/contracts)", 5 | "[react-app](/packages/react-app)" 6 | ], 7 | "subgraphName": "Compound", 8 | "subgraphUrl": "https://thegraph.com/explorer/subgraph/graphprotocol/compound-v2", 9 | "templateName": "Compound", 10 | "templateUrl": "https://github.com/paulrberg/create-eth-app/tree/develop/templates/react/compound" 11 | } 12 | -------------------------------------------------------------------------------- /templates/react/compound/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "orgName": "@compound-app", 3 | "packageName": "@compound-app/monorepo", 4 | "keywords": [ 5 | "compound-finance" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /templates/react/compound/packages/contracts/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "title": "@compound-app/contracts" 3 | } 4 | -------------------------------------------------------------------------------- /templates/react/compound/packages/contracts/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "packageName": "@compound-app/contracts" 3 | } 4 | -------------------------------------------------------------------------------- /templates/react/compound/packages/contracts/src/abis.js: -------------------------------------------------------------------------------- 1 | import COMP from "./abis/COMP.json"; 2 | import cBAT from "./abis/cBAT.json"; 3 | import cDAI from "./abis/cDAI.json"; 4 | import cETH from "./abis/cETH.json"; 5 | import cREP from "./abis/cREP.json"; 6 | import cSAI from "./abis/cSAI.json"; 7 | import cUSDC from "./abis/cUSDC.json"; 8 | import cUSDT from "./abis/cUSDT.json"; 9 | import cWBTC from "./abis/cWBTC.json"; 10 | import cZRX from "./abis/cZRX.json"; 11 | import comptroller from "./abis/comptroller.json"; 12 | import governance from "./abis/governance.json"; 13 | import priceOracle from "./abis/priceOracle.json"; 14 | import timelock from "./abis/timelock.json"; 15 | 16 | export default { 17 | comptroller, 18 | governance, 19 | priceOracle, 20 | timelock, 21 | tokens: { 22 | COMP, 23 | cBAT, 24 | cDAI, 25 | cETH, 26 | cREP, 27 | cSAI, 28 | cUSDC, 29 | cUSDT, 30 | cWBTC, 31 | cZRX, 32 | }, 33 | }; 34 | -------------------------------------------------------------------------------- /templates/react/compound/packages/contracts/src/index.js.ctx: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /templates/react/compound/packages/react-app/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "title": "@compound-app/react-app" 3 | } 4 | -------------------------------------------------------------------------------- /templates/react/compound/packages/react-app/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "packageName": "@compound-app/react-app", 3 | "dependencies": { 4 | "keys": [ 5 | "@compound-app/contracts" 6 | ], 7 | "values": [ 8 | "^1.0.0" 9 | ] 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /templates/react/compound/packages/react-app/src/App.js.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "contractCall": [ 3 | "// Read more about useDapp on https://usedapp.io/", 4 | "const { error: contractCallError, value: tokenBalance } =", 5 | " useCall({", 6 | " contract: new Contract(addresses[MAINNET_ID].tokens.cDAI, abis.tokens.cDAI),", 7 | " method: \"balanceOf\",", 8 | " args: [\"0x3f8CB69d9c0ED01923F11c829BaE4D9a4CB6c82C\"],", 9 | " }) ?? {};" 10 | ], 11 | "imports": [ 12 | "import { MAINNET_ID, addresses, abis } from \"@compound-app/contracts\";", 13 | "import GET_MONEY_MARKETS from \"./graphql/subgraph\";" 14 | ], 15 | "learn": { 16 | "name": "Compound", 17 | "url": "https://compound.finance/developers" 18 | }, 19 | "subgraphQuery": { 20 | "key": "markets", 21 | "name": "GET_MONEY_MARKETS" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /templates/react/compound/packages/react-app/src/graphql/subgraph.js: -------------------------------------------------------------------------------- 1 | import { gql } from "@apollo/client"; 2 | 3 | // See more example queries on https://thegraph.com/explorer/subgraph/graphprotocol/compound-v2 4 | const GET_MONEY_MARKETS = gql` 5 | { 6 | markets(first: 7) { 7 | borrowRate 8 | cash 9 | collateralFactor 10 | exchangeRate 11 | interestRateModelAddress 12 | name 13 | reserves 14 | supplyRate 15 | symbol 16 | id 17 | totalBorrows 18 | totalSupply 19 | underlyingAddress 20 | underlyingName 21 | underlyingPrice 22 | underlyingSymbol 23 | reserveFactor 24 | underlyingPriceUSD 25 | } 26 | } 27 | `; 28 | 29 | export default GET_MONEY_MARKETS; 30 | -------------------------------------------------------------------------------- /templates/react/compound/packages/react-app/src/index.js.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "subgraph": { 3 | "comment": "// This is the official Compound subgraph. You can replace it with your own, if you need to.", 4 | "url": "https://api.thegraph.com/subgraphs/name/graphprotocol/compound-v2" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /templates/react/default/.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* 17 | 18 | # debug 19 | npm-debug.log* 20 | yarn-debug.log* 21 | yarn-error.log* 22 | 23 | # subgraph 24 | packages/subgraph/build/ 25 | packages/subgraph/src/types/ 26 | -------------------------------------------------------------------------------- /templates/react/default/README.md.ctx: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /templates/react/default/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "orgName": "@my-app", 3 | "packageName": "@my-app/monorepo", 4 | "scripts": { 5 | "keys": [ 6 | "subgraph:auth", 7 | "subgraph:codegen", 8 | "subgraph:build", 9 | "subgraph:deploy" 10 | ], 11 | "values": [ 12 | "yarn workspace @my-app/subgraph auth", 13 | "yarn workspace @my-app/subgraph codegen", 14 | "yarn workspace @my-app/subgraph build", 15 | "yarn workspace @my-app/subgraph deploy" 16 | ] 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /templates/react/default/packages/contracts/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "title": "@my-app/contracts" 3 | } 4 | -------------------------------------------------------------------------------- /templates/react/default/packages/contracts/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "packageName": "@my-app/contracts" 3 | } 4 | -------------------------------------------------------------------------------- /templates/react/default/packages/contracts/src/abis.js: -------------------------------------------------------------------------------- 1 | import erc20Abi from "./abis/erc20.json"; 2 | import ownableAbi from "./abis/ownable.json"; 3 | 4 | const abis = { 5 | erc20: erc20Abi, 6 | ownable: ownableAbi, 7 | }; 8 | 9 | export default abis; 10 | -------------------------------------------------------------------------------- /templates/react/default/packages/contracts/src/abis/ownable.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [], 4 | "payable": false, 5 | "stateMutability": "nonpayable", 6 | "type": "constructor" 7 | }, 8 | { 9 | "anonymous": false, 10 | "inputs": [ 11 | { 12 | "indexed": true, 13 | "internalType": "address", 14 | "name": "previousOwner", 15 | "type": "address" 16 | }, 17 | { 18 | "indexed": true, 19 | "internalType": "address", 20 | "name": "newOwner", 21 | "type": "address" 22 | } 23 | ], 24 | "name": "OwnershipTransferred", 25 | "type": "event" 26 | }, 27 | { 28 | "constant": true, 29 | "inputs": [], 30 | "name": "owner", 31 | "outputs": [ 32 | { 33 | "internalType": "address", 34 | "name": "", 35 | "type": "address" 36 | } 37 | ], 38 | "payable": false, 39 | "stateMutability": "view", 40 | "type": "function" 41 | }, 42 | { 43 | "constant": true, 44 | "inputs": [], 45 | "name": "isOwner", 46 | "outputs": [ 47 | { 48 | "internalType": "bool", 49 | "name": "", 50 | "type": "bool" 51 | } 52 | ], 53 | "payable": false, 54 | "stateMutability": "view", 55 | "type": "function" 56 | }, 57 | { 58 | "constant": false, 59 | "inputs": [], 60 | "name": "renounceOwnership", 61 | "outputs": [], 62 | "payable": false, 63 | "stateMutability": "nonpayable", 64 | "type": "function" 65 | }, 66 | { 67 | "constant": false, 68 | "inputs": [ 69 | { 70 | "internalType": "address", 71 | "name": "newOwner", 72 | "type": "address" 73 | } 74 | ], 75 | "name": "transferOwnership", 76 | "outputs": [], 77 | "payable": false, 78 | "stateMutability": "nonpayable", 79 | "type": "function" 80 | } 81 | ] 82 | -------------------------------------------------------------------------------- /templates/react/default/packages/contracts/src/addresses.js: -------------------------------------------------------------------------------- 1 | // This address points to a dummy ERC-20 contract. Replace it with your own smart contracts. 2 | const addresses = { 3 | ceaErc20: "0xa6dF0C88916f3e2831A329CE46566dDfBe9E74b7", 4 | }; 5 | export default addresses; 6 | -------------------------------------------------------------------------------- /templates/react/default/packages/contracts/src/index.js.ctx: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /templates/react/default/packages/react-app/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "title": "@my-app/react-app" 3 | } 4 | -------------------------------------------------------------------------------- /templates/react/default/packages/react-app/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "packageName": "@my-app/react-app", 3 | "dependencies": { 4 | "keys": [ 5 | "@my-app/contracts" 6 | ], 7 | "values": [ 8 | "^1.0.0" 9 | ] 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /templates/react/default/packages/react-app/src/App.js.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "contractCall": [ 3 | "// Read more about useDapp on https://usedapp.io/", 4 | "const { error: contractCallError, value: tokenBalance } =", 5 | " useCall({", 6 | " contract: new Contract(addresses.ceaErc20, abis.erc20),", 7 | " method: \"balanceOf\",", 8 | " args: [\"0x3f8CB69d9c0ED01923F11c829BaE4D9a4CB6c82C\"],", 9 | " }) ?? {};" 10 | ], 11 | "imports": [ 12 | "import { addresses, abis } from \"@my-app/contracts\";", 13 | "import GET_TRANSFERS from \"./graphql/subgraph\";" 14 | ], 15 | "learn": { 16 | "name": "The Graph", 17 | "url": "https://thegraph.com/docs/quick-start" 18 | }, 19 | "subgraphQuery": { 20 | "key": "transfers", 21 | "name": "GET_TRANSFERS" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /templates/react/default/packages/react-app/src/graphql/subgraph.js: -------------------------------------------------------------------------------- 1 | import { gql } from "@apollo/client"; 2 | 3 | // See more example queries on https://thegraph.com/explorer/subgraph/paulrberg/create-eth-app 4 | const GET_TRANSFERS = gql` 5 | { 6 | transfers(first: 10) { 7 | id 8 | from 9 | to 10 | value 11 | } 12 | } 13 | `; 14 | 15 | export default GET_TRANSFERS; 16 | -------------------------------------------------------------------------------- /templates/react/default/packages/react-app/src/index.js.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "subgraph": { 3 | "comment": "// You should replace this url with your own and put it into a .env file", 4 | "url": "https://api.thegraph.com/subgraphs/name/paulrberg/create-eth-app" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /templates/react/default/packages/subgraph/README.md: -------------------------------------------------------------------------------- 1 | ## @my-app/subgraph 2 | 3 | The Graph is a tool for for indexing events emitted on the Ethereum blockchain. It provides you with an easy-to-use GraphQL API. 4 | 5 | ## Available Scripts 6 | 7 | In the project directory, you can run: 8 | 9 | ### Subgraph 10 | 11 | #### `yarn codegen` 12 | 13 | Generates AssemblyScript types for smart contract ABIs and the subgraph schema. 14 | 15 | #### `yarn build` 16 | 17 | Compiles the subgraph to WebAssembly. 18 | 19 | #### `yarn auth` 20 | 21 | Before deploying your subgraph, you need to sign up on the 22 | [Graph Explorer](https://thegraph.com/explorer/). There, you will be given an access token. Drop it in the command 23 | below: 24 | 25 | ```sh 26 | GRAPH_ACCESS_TOKEN=your-access-token-here yarn subgraph:auth 27 | ``` 28 | 29 | #### `yarn deploy` 30 | 31 | Deploys the subgraph to the official Graph Node.
32 | 33 | Replace `paulrberg/create-eth-app` in the package.json script with your subgraph's name. 34 | 35 | You may also want to [read more about the hosted service](https://thegraph.com/docs/quick-start#hosted-service). 36 | 37 | ## Learn More 38 | 39 | To learn The Graph, check out the [The Graph documentation](https://thegraph.com/docs). 40 | 41 | --- 42 | 43 | 1. Generate types 44 | 2. Build distributable files 45 | 3. Deploy to the remote API 46 | 47 | ## Learn More 48 | 49 | You can learn more in the [The Graph documentation](https://thegraph.com/docs).
50 | 51 | Also consider joining [The Graph Discord server](https://discord.gg/vtvv7FP), where you can seek out help. 52 | 53 | ## Common Errors 54 | 55 | ### Failed to Compile 56 | 57 | > ✖ Failed to compile subgraph: Failed to compile data source mapping: Import file 'src/types/schema.ts' not found. 58 | > Error: Failed to compile data source mapping: Import file 'src/types/schema.ts' not found. 59 | 60 | Run the `yarn subgraph` and this error will go away. 61 | 62 | ### No Access Token 63 | 64 | > ✖ No access token provided 65 | 66 | Make sure that you followed the instructions listed above for [yarn auth](#yarn-auth). 67 | 68 | ### Failed to Deploy 69 | 70 | > ✖ Failed to deploy to Graph node https://api.thegraph.com/deploy/: Invalid account name or access token 71 | 72 | Make sure that you: 73 | 74 | 1. Signed up on the [Graph Explorer](https://thegraph.com/explorer) 75 | 2. Followed the instructions listed above for [yarn auth](#yarn-auth) 76 | 3. Replaced `paulrberg/create-eth-app` with your subgraph's name 77 | -------------------------------------------------------------------------------- /templates/react/default/packages/subgraph/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@my-app/subgraph", 3 | "version": "1.0.0", 4 | "dependencies": { 5 | "@graphprotocol/graph-cli": "0.53.0", 6 | "@graphprotocol/graph-ts": "0.31.0" 7 | }, 8 | "license": "MIT", 9 | "scripts": { 10 | "auth": "graph auth https://api.thegraph.com/ $GRAPH_ACCESS_TOKEN", 11 | "build": "graph build", 12 | "codegen": "graph codegen --output-dir src/types/", 13 | "deploy": "graph deploy paulrberg/create-eth-app --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /templates/react/default/packages/subgraph/schema.graphql: -------------------------------------------------------------------------------- 1 | type Token @entity { 2 | id: ID! 3 | decimals: Int 4 | name: String 5 | symbol: String 6 | } 7 | 8 | type Transfer @entity { 9 | id: ID! 10 | from: String! 11 | to: String! 12 | value: BigInt! 13 | } 14 | -------------------------------------------------------------------------------- /templates/react/default/packages/subgraph/src/mappings/tokens.ts: -------------------------------------------------------------------------------- 1 | import { Token } from "../types/schema"; 2 | 3 | export function addToken(address: string): void { 4 | let token: Token | null = Token.load(address); 5 | if (token != null) { 6 | return; 7 | } 8 | 9 | token = new Token(address); 10 | if (address == "0xa6dF0C88916f3e2831A329CE46566dDfBe9E74b7") { 11 | token.decimals = 18; 12 | token.name = "CeaErc20"; 13 | token.symbol = "CEAERC20"; 14 | } else { 15 | token.decimals = 0; 16 | token.name = null; 17 | token.symbol = null; 18 | } 19 | 20 | token.save(); 21 | } 22 | -------------------------------------------------------------------------------- /templates/react/default/packages/subgraph/src/mappings/transfers.ts: -------------------------------------------------------------------------------- 1 | import { Address } from "@graphprotocol/graph-ts"; 2 | 3 | import { Transfer as TransferEvent } from "../types/CeaErc20/erc20"; 4 | import { Transfer } from "../types/schema"; 5 | import { addToken } from "./tokens"; 6 | 7 | export function handleTransfer(event: TransferEvent): void { 8 | let transactionHash: string = event.transaction.hash.toHex(); 9 | let transfer = new Transfer(transactionHash); 10 | transfer.from = event.params.from.toHex(); 11 | transfer.to = event.params.to.toHex(); 12 | transfer.value = event.params.value; 13 | transfer.save(); 14 | 15 | let to: Address | null = event.transaction.to; 16 | if (to) { 17 | addToken(to.toHex()); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /templates/react/default/packages/subgraph/subgraph.yaml: -------------------------------------------------------------------------------- 1 | specVersion: 0.0.4 2 | description: Subgraph that indexes the blockchain data 3 | repository: https://github.com/sablier-labs/sablier-subgraph 4 | schema: 5 | file: ./schema.graphql 6 | dataSources: 7 | - kind: ethereum/contract 8 | name: CeaErc20 9 | network: mainnet 10 | source: 11 | abi: erc20 12 | address: "0xa6dF0C88916f3e2831A329CE46566dDfBe9E74b7" 13 | mapping: 14 | kind: ethereum/events 15 | apiVersion: 0.0.6 16 | abis: 17 | - name: erc20 18 | file: ../contracts/src/abis/erc20.json 19 | entities: 20 | - Token 21 | - Transfer 22 | eventHandlers: 23 | - event: Transfer(indexed address,indexed address,uint256) 24 | handler: handleTransfer 25 | file: ./src/mappings/transfers.ts 26 | language: wasm/assemblyscript 27 | -------------------------------------------------------------------------------- /templates/react/kyber/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Kyber is a blockchain-based liquidity protocol that aggregates liquidity from a wide range of reserves, powering instant and secure token exchange in any decentralized application. Read more about it in the [official documentation](https://developer.kyber.network/).", 3 | "packages": [ 4 | "[contracts](/packages/contracts)", 5 | "[react-app](/packages/react-app)" 6 | ], 7 | "subgraphName": "Kyber", 8 | "subgraphUrl": "https://thegraph.com/explorer/subgraph/protofire/kyber", 9 | "templateName": "Kyber", 10 | "templateUrl": "https://github.com/paulrberg/create-eth-app/tree/develop/templates/react/kyber" 11 | } 12 | -------------------------------------------------------------------------------- /templates/react/kyber/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "orgName": "@kyber-app", 3 | "packageName": "@kyber-app/monorepo", 4 | "keywords": [ 5 | "kyber" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /templates/react/kyber/packages/contracts/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "title": "@kyber-app/contracts" 3 | } 4 | -------------------------------------------------------------------------------- /templates/react/kyber/packages/contracts/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "packageName": "@kyber-app/contracts" 3 | } 4 | -------------------------------------------------------------------------------- /templates/react/kyber/packages/contracts/src/abis.js: -------------------------------------------------------------------------------- 1 | import conversionRates from "./abis/conversionRates.json"; 2 | import erc20 from "./abis/erc20.json"; 3 | import kyberFeeHandler from "./abis/kyberFeeHandler.json"; 4 | import kyberHintHandler from "./abis/kyberHintHandler.json"; 5 | import kyberNetworkProxyV1 from "./abis/kyberNetworkProxyV1.json"; 6 | import kyberNetworkProxyV2 from "./abis/kyberNetworkProxyV2.json"; 7 | import kyberReserve from "./abis/kyberReserve.json"; 8 | import kyberStorage from "./abis/kyberStorage.json"; 9 | import liquidityConversionRates from "./abis/liquidityConversionRates.json"; 10 | import sanityRates from "./abis/sanityRates.json"; 11 | import simpleKyberProxy from "./abis/simpleKyberProxy.json"; 12 | 13 | export default { 14 | conversionRates, 15 | erc20, 16 | kyberFeeHandler, 17 | kyberHintHandler, 18 | kyberNetworkProxyV1, 19 | kyberNetworkProxyV2, 20 | kyberReserve, 21 | kyberStorage, 22 | liquidityConversionRates, 23 | sanityRates, 24 | simpleKyberProxy, 25 | }; 26 | -------------------------------------------------------------------------------- /templates/react/kyber/packages/contracts/src/abis/erc20.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "anonymous": false, 4 | "inputs": [ 5 | { "indexed": true, "internalType": "address", "name": "_owner", "type": "address" }, 6 | { "indexed": true, "internalType": "address", "name": "_spender", "type": "address" }, 7 | { "indexed": false, "internalType": "uint256", "name": "_value", "type": "uint256" } 8 | ], 9 | "name": "Approval", 10 | "type": "event" 11 | }, 12 | { 13 | "inputs": [ 14 | { "internalType": "address", "name": "_owner", "type": "address" }, 15 | { "internalType": "address", "name": "_spender", "type": "address" } 16 | ], 17 | "name": "allowance", 18 | "outputs": [{ "internalType": "uint256", "name": "remaining", "type": "uint256" }], 19 | "stateMutability": "view", 20 | "type": "function" 21 | }, 22 | { 23 | "inputs": [ 24 | { "internalType": "address", "name": "_spender", "type": "address" }, 25 | { "internalType": "uint256", "name": "_value", "type": "uint256" } 26 | ], 27 | "name": "approve", 28 | "outputs": [{ "internalType": "bool", "name": "success", "type": "bool" }], 29 | "stateMutability": "nonpayable", 30 | "type": "function" 31 | }, 32 | { 33 | "inputs": [{ "internalType": "address", "name": "_owner", "type": "address" }], 34 | "name": "balanceOf", 35 | "outputs": [{ "internalType": "uint256", "name": "balance", "type": "uint256" }], 36 | "stateMutability": "view", 37 | "type": "function" 38 | }, 39 | { 40 | "inputs": [], 41 | "name": "decimals", 42 | "outputs": [{ "internalType": "uint8", "name": "digits", "type": "uint8" }], 43 | "stateMutability": "view", 44 | "type": "function" 45 | }, 46 | { 47 | "inputs": [], 48 | "name": "totalSupply", 49 | "outputs": [{ "internalType": "uint256", "name": "supply", "type": "uint256" }], 50 | "stateMutability": "view", 51 | "type": "function" 52 | }, 53 | { 54 | "inputs": [ 55 | { "internalType": "address", "name": "_to", "type": "address" }, 56 | { "internalType": "uint256", "name": "_value", "type": "uint256" } 57 | ], 58 | "name": "transfer", 59 | "outputs": [{ "internalType": "bool", "name": "success", "type": "bool" }], 60 | "stateMutability": "nonpayable", 61 | "type": "function" 62 | }, 63 | { 64 | "inputs": [ 65 | { "internalType": "address", "name": "_from", "type": "address" }, 66 | { "internalType": "address", "name": "_to", "type": "address" }, 67 | { "internalType": "uint256", "name": "_value", "type": "uint256" } 68 | ], 69 | "name": "transferFrom", 70 | "outputs": [{ "internalType": "bool", "name": "success", "type": "bool" }], 71 | "stateMutability": "nonpayable", 72 | "type": "function" 73 | } 74 | ] 75 | -------------------------------------------------------------------------------- /templates/react/kyber/packages/contracts/src/abis/simpleKyberProxy.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { "internalType": "contract IERC20", "name": "token", "type": "address" }, 5 | { "internalType": "uint256", "name": "minConversionRate", "type": "uint256" } 6 | ], 7 | "name": "swapEtherToToken", 8 | "outputs": [{ "internalType": "uint256", "name": "destAmount", "type": "uint256" }], 9 | "stateMutability": "payable", 10 | "type": "function" 11 | }, 12 | { 13 | "inputs": [ 14 | { "internalType": "contract IERC20", "name": "token", "type": "address" }, 15 | { "internalType": "uint256", "name": "srcAmount", "type": "uint256" }, 16 | { "internalType": "uint256", "name": "minConversionRate", "type": "uint256" } 17 | ], 18 | "name": "swapTokenToEther", 19 | "outputs": [{ "internalType": "uint256", "name": "destAmount", "type": "uint256" }], 20 | "stateMutability": "nonpayable", 21 | "type": "function" 22 | }, 23 | { 24 | "inputs": [ 25 | { "internalType": "contract IERC20", "name": "src", "type": "address" }, 26 | { "internalType": "uint256", "name": "srcAmount", "type": "uint256" }, 27 | { "internalType": "contract IERC20", "name": "dest", "type": "address" }, 28 | { "internalType": "uint256", "name": "minConversionRate", "type": "uint256" } 29 | ], 30 | "name": "swapTokenToToken", 31 | "outputs": [{ "internalType": "uint256", "name": "destAmount", "type": "uint256" }], 32 | "stateMutability": "nonpayable", 33 | "type": "function" 34 | } 35 | ] 36 | -------------------------------------------------------------------------------- /templates/react/kyber/packages/contracts/src/index.js.ctx: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /templates/react/kyber/packages/react-app/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "title": "@kyber-app/react-app" 3 | } 4 | -------------------------------------------------------------------------------- /templates/react/kyber/packages/react-app/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "packageName": "@kyber-app/react-app", 3 | "dependencies": { 4 | "keys": [ 5 | "@kyber-app/contracts" 6 | ], 7 | "values": [ 8 | "^1.0.0" 9 | ] 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /templates/react/kyber/packages/react-app/src/App.js.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "contractCall": [ 3 | "// Read more about useDapp on https://usedapp.io/", 4 | "const { error: contractCallError, value: exchangeRate } =", 5 | " useCall({", 6 | " contract: new Contract(addresses[MAINNET_ID].kyberNetworkProxyV2, abis.kyberNetworkProxyV2),", 7 | " method: \"getExpectedRate\",", 8 | " args: [", 9 | " \"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\",", 10 | " \"0x6B175474E89094C44Da98b954EedeAC495271d0F\",", 11 | " \"1000000000000000000\"", 12 | " ],", 13 | " }) ?? {};" 14 | ], 15 | "imports": [ 16 | "import { MAINNET_ID, addresses, abis } from \"@kyber-app/contracts\";", 17 | "import GET_FULL_TRADES from \"./graphql/subgraph\";" 18 | ], 19 | "learn": { 20 | "name": "Kyber", 21 | "url": "https://developer.kyber.network/" 22 | }, 23 | "subgraphQuery": { 24 | "key": "fullTrades", 25 | "name": "GET_FULL_TRADES" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /templates/react/kyber/packages/react-app/src/graphql/subgraph.js: -------------------------------------------------------------------------------- 1 | import { gql } from "@apollo/client"; 2 | 3 | // See more example queries on https://thegraph.com/explorer/subgraph/protofire/kyber 4 | const GET_FULL_TRADES = gql` 5 | { 6 | fullTrades(first: 5) { 7 | id 8 | trader { 9 | id 10 | } 11 | src { 12 | id 13 | } 14 | dest { 15 | id 16 | } 17 | } 18 | } 19 | `; 20 | 21 | export default GET_FULL_TRADES; 22 | -------------------------------------------------------------------------------- /templates/react/kyber/packages/react-app/src/index.js.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "subgraph": { 3 | "comment": "// This Kyber subgraph is developed by a third-party. You can replace it with your own, if you need to.", 4 | "url": "https://api.thegraph.com/subgraphs/name/protofire/kyber" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /templates/react/maker/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Maker is the creator of DAI, the world’s first unbiased currency. It be used by anyone, anywhere, anytime. Read more about it in the [official documentation](https://docs.makerdao.com/).", 3 | "packages": [ 4 | "[contracts](/packages/contracts)", 5 | "[react-app](/packages/react-app)" 6 | ], 7 | "subgraphName": "Multi Collateral Dai", 8 | "subgraphUrl": "https://thegraph.com/explorer/subgraph/protofire/maker-protocol", 9 | "templateName": "Maker", 10 | "templateUrl": "https://github.com/paulrberg/create-eth-app/tree/develop/templates/react/maker" 11 | } 12 | -------------------------------------------------------------------------------- /templates/react/maker/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "orgName": "@maker-app", 3 | "packageName": "@maker-app/monorepo", 4 | "keywords": [ 5 | "dai", 6 | "maker", 7 | "makerdao" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /templates/react/maker/packages/contracts/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "title": "@maker-app/contracts" 3 | } 4 | -------------------------------------------------------------------------------- /templates/react/maker/packages/contracts/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "packageName": "@maker-app/contracts" 3 | } 4 | -------------------------------------------------------------------------------- /templates/react/maker/packages/contracts/src/abis.js: -------------------------------------------------------------------------------- 1 | import cat from "./abis/cat.json"; 2 | import dai from "./abis/dai.json"; 3 | import daiJoin from "./abis/daiJoin.json"; 4 | import dsProxy from "./abis/dsProxy.json"; 5 | import dssCdpManager from "./abis/dssCdpManager.json"; 6 | import dssProxyActions from "./abis/dssProxyActions.json"; 7 | import dssProxyActionsDsr from "./abis/dssProxyActionsDsr.json"; 8 | import erc20 from "./abis/erc20.json"; 9 | import erc20Events from "./abis/erc20Events.json"; 10 | import ethJoin from "./abis/ethJoin.json"; 11 | import jug from "./abis/jug.json"; 12 | import pot from "./abis/pot.json"; 13 | import proxyActions from "./abis/proxyActions.json"; 14 | import proxyRegistry from "./abis/proxyRegistry.json"; 15 | import spotter from "./abis/spotter.json"; 16 | import vat from "./abis/vat.json"; 17 | 18 | export default { 19 | cat, 20 | dai, 21 | daiJoin, 22 | dsProxy, 23 | dssCdpManager, 24 | dssProxyActions, 25 | dssProxyActionsDsr, 26 | erc20, 27 | erc20Events, 28 | ethJoin, 29 | jug, 30 | pot, 31 | proxyActions, 32 | proxyRegistry, 33 | spotter, 34 | vat, 35 | }; 36 | -------------------------------------------------------------------------------- /templates/react/maker/packages/contracts/src/abis/dssProxyActionsDsr.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "constant": false, 4 | "inputs": [ 5 | { "internalType": "address", "name": "apt", "type": "address" }, 6 | { "internalType": "address", "name": "urn", "type": "address" }, 7 | { "internalType": "uint256", "name": "wad", "type": "uint256" } 8 | ], 9 | "name": "daiJoin_join", 10 | "outputs": [], 11 | "payable": false, 12 | "stateMutability": "nonpayable", 13 | "type": "function" 14 | }, 15 | { 16 | "constant": false, 17 | "inputs": [ 18 | { "internalType": "address", "name": "daiJoin", "type": "address" }, 19 | { "internalType": "address", "name": "pot", "type": "address" }, 20 | { "internalType": "uint256", "name": "wad", "type": "uint256" } 21 | ], 22 | "name": "exit", 23 | "outputs": [], 24 | "payable": false, 25 | "stateMutability": "nonpayable", 26 | "type": "function" 27 | }, 28 | { 29 | "constant": false, 30 | "inputs": [ 31 | { "internalType": "address", "name": "daiJoin", "type": "address" }, 32 | { "internalType": "address", "name": "pot", "type": "address" } 33 | ], 34 | "name": "exitAll", 35 | "outputs": [], 36 | "payable": false, 37 | "stateMutability": "nonpayable", 38 | "type": "function" 39 | }, 40 | { 41 | "constant": false, 42 | "inputs": [ 43 | { "internalType": "address", "name": "daiJoin", "type": "address" }, 44 | { "internalType": "address", "name": "pot", "type": "address" }, 45 | { "internalType": "uint256", "name": "wad", "type": "uint256" } 46 | ], 47 | "name": "join", 48 | "outputs": [], 49 | "payable": false, 50 | "stateMutability": "nonpayable", 51 | "type": "function" 52 | } 53 | ] 54 | -------------------------------------------------------------------------------- /templates/react/maker/packages/contracts/src/abis/erc20.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "anonymous": false, 4 | "inputs": [ 5 | { "indexed": true, "internalType": "address", "name": "src", "type": "address" }, 6 | { "indexed": true, "internalType": "address", "name": "guy", "type": "address" }, 7 | { "indexed": false, "internalType": "uint256", "name": "wad", "type": "uint256" } 8 | ], 9 | "name": "Approval", 10 | "type": "event" 11 | }, 12 | { 13 | "anonymous": false, 14 | "inputs": [ 15 | { "indexed": true, "internalType": "address", "name": "src", "type": "address" }, 16 | { "indexed": true, "internalType": "address", "name": "dst", "type": "address" }, 17 | { "indexed": false, "internalType": "uint256", "name": "wad", "type": "uint256" } 18 | ], 19 | "name": "Transfer", 20 | "type": "event" 21 | }, 22 | { 23 | "constant": true, 24 | "inputs": [ 25 | { "internalType": "address", "name": "src", "type": "address" }, 26 | { "internalType": "address", "name": "guy", "type": "address" } 27 | ], 28 | "name": "allowance", 29 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 30 | "payable": false, 31 | "stateMutability": "view", 32 | "type": "function" 33 | }, 34 | { 35 | "constant": false, 36 | "inputs": [ 37 | { "internalType": "address", "name": "guy", "type": "address" }, 38 | { "internalType": "uint256", "name": "wad", "type": "uint256" } 39 | ], 40 | "name": "approve", 41 | "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], 42 | "payable": false, 43 | "stateMutability": "nonpayable", 44 | "type": "function" 45 | }, 46 | { 47 | "constant": true, 48 | "inputs": [{ "internalType": "address", "name": "guy", "type": "address" }], 49 | "name": "balanceOf", 50 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 51 | "payable": false, 52 | "stateMutability": "view", 53 | "type": "function" 54 | }, 55 | { 56 | "constant": true, 57 | "inputs": [], 58 | "name": "totalSupply", 59 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 60 | "payable": false, 61 | "stateMutability": "view", 62 | "type": "function" 63 | }, 64 | { 65 | "constant": false, 66 | "inputs": [ 67 | { "internalType": "address", "name": "dst", "type": "address" }, 68 | { "internalType": "uint256", "name": "wad", "type": "uint256" } 69 | ], 70 | "name": "transfer", 71 | "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], 72 | "payable": false, 73 | "stateMutability": "nonpayable", 74 | "type": "function" 75 | }, 76 | { 77 | "constant": false, 78 | "inputs": [ 79 | { "internalType": "address", "name": "src", "type": "address" }, 80 | { "internalType": "address", "name": "dst", "type": "address" }, 81 | { "internalType": "uint256", "name": "wad", "type": "uint256" } 82 | ], 83 | "name": "transferFrom", 84 | "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], 85 | "payable": false, 86 | "stateMutability": "nonpayable", 87 | "type": "function" 88 | } 89 | ] 90 | -------------------------------------------------------------------------------- /templates/react/maker/packages/contracts/src/abis/erc20Events.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "anonymous": false, 4 | "inputs": [ 5 | { "indexed": true, "internalType": "address", "name": "src", "type": "address" }, 6 | { "indexed": true, "internalType": "address", "name": "guy", "type": "address" }, 7 | { "indexed": false, "internalType": "uint256", "name": "wad", "type": "uint256" } 8 | ], 9 | "name": "Approval", 10 | "type": "event" 11 | }, 12 | { 13 | "anonymous": false, 14 | "inputs": [ 15 | { "indexed": true, "internalType": "address", "name": "src", "type": "address" }, 16 | { "indexed": true, "internalType": "address", "name": "dst", "type": "address" }, 17 | { "indexed": false, "internalType": "uint256", "name": "wad", "type": "uint256" } 18 | ], 19 | "name": "Transfer", 20 | "type": "event" 21 | } 22 | ] 23 | -------------------------------------------------------------------------------- /templates/react/maker/packages/contracts/src/abis/proxyRegistry.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [{ "internalType": "address", "name": "factory_", "type": "address" }], 4 | "payable": false, 5 | "stateMutability": "nonpayable", 6 | "type": "constructor" 7 | }, 8 | { 9 | "constant": false, 10 | "inputs": [], 11 | "name": "build", 12 | "outputs": [{ "internalType": "address payable", "name": "proxy", "type": "address" }], 13 | "payable": false, 14 | "stateMutability": "nonpayable", 15 | "type": "function" 16 | }, 17 | { 18 | "constant": false, 19 | "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }], 20 | "name": "build", 21 | "outputs": [{ "internalType": "address payable", "name": "proxy", "type": "address" }], 22 | "payable": false, 23 | "stateMutability": "nonpayable", 24 | "type": "function" 25 | }, 26 | { 27 | "constant": true, 28 | "inputs": [{ "internalType": "address", "name": "", "type": "address" }], 29 | "name": "proxies", 30 | "outputs": [{ "internalType": "contract DSProxy", "name": "", "type": "address" }], 31 | "payable": false, 32 | "stateMutability": "view", 33 | "type": "function" 34 | } 35 | ] 36 | -------------------------------------------------------------------------------- /templates/react/maker/packages/contracts/src/addresses.js: -------------------------------------------------------------------------------- 1 | /** 2 | * See all ids below 3 | * https://ethereum.stackexchange.com/questions/17051/how-to-select-a-network-id-or-is-there-a-list-of-network-ids 4 | */ 5 | export const KOVAN_ID = 42; 6 | export const MAINNET_ID = 1; 7 | 8 | /** 9 | * Please note that these are the contract addresses for v1.0.8, which may not be the most up-to-date. 10 | * https://changelog.makerdao.com/ 11 | */ 12 | export default { 13 | [KOVAN_ID]: { 14 | cat: "0x0511674A67192FE51e86fE55Ed660eB4f995BDd6", 15 | cdpManager: "0x1476483dD8C35F25e568113C5f70249D3976ba21", 16 | dsrManager: "0x7f5d60432DE4840a3E7AE7218f7D6b7A2412683a", 17 | getCdps: "0x592301a23d37c591C5856f28726AF820AF8e7014", 18 | joinDai: "0x5AA71a3ae1C0bd6ac27A1f28e1415fFFB6F15B8c", 19 | jug: "0xcbB7718c9F39d05aEEDE1c472ca8Bf804b2f1EaD", 20 | pot: "0xEA190DBDC7adF265260ec4dA6e9675Fd4f5A78bb", 21 | proxyActions: "0xd1D24637b9109B7f61459176EdcfF9Be56283a7B", 22 | proxyActionsDsr: "0xc5CC1Dfb64A62B9C7Bb6Cbf53C2A579E2856bf92", 23 | proxyFactory: "0xe11E3b391F7E8bC47247866aF32AF67Dd58Dc800", 24 | proxyRegistry: "0x64A436ae831C1672AE81F674CAb8B6775df3475C", 25 | spot: "0x3a042de6413eDB15F2784f2f97cC68C7E9750b2D", 26 | tokens: { 27 | BAT: "0x9f8cFB61D3B2aF62864408DD703F9C3BEB55dff7", 28 | DAI: "0x4F96Fe3b7A6Cf9725f59d353F723c1bDb64CA6Aa", 29 | TUSD: "0x0000000000085d4780B73119b644AE5ecd22b376", 30 | USDC: "0xBD84be3C303f6821ab297b840a99Bd0d4c4da6b5", 31 | WBTC: "0x7419f744bBF35956020C1687fF68911cD777f865", 32 | WETH: "0xd0A1E359811322d97991E03f863a0C30C2cF029C", 33 | }, 34 | vat: "0xbA987bDB501d131f766fEe8180Da5d81b34b69d9", 35 | vow: "0x0F4Cbe6CBA918b7488C26E29d9ECd7368F38EA3b", 36 | }, 37 | [MAINNET_ID]: { 38 | cat: "0x78F2c2AF65126834c51822F56Be0d7469D7A523E", 39 | cdpManager: "0x5ef30b9986345249bc32d8928B7ee64DE9435E39", 40 | dsrManager: "0x373238337Bfe1146fb49989fc222523f83081dDb", 41 | getCdps: "0x36a724Bd100c39f0Ea4D3A20F7097eE01A8Ff573", 42 | joinDai: "0x9759A6Ac90977b93B58547b4A71c78317f391A28", 43 | jug: "0x19c0976f590D67707E62397C87829d896Dc0f1F1", 44 | pot: "0x197E90f9FAD81970bA7976f33CbD77088E5D7cf7", 45 | proxyActions: "0x82ecD135Dce65Fbc6DbdD0e4237E0AF93FFD5038", 46 | proxyActionDsr: "0x07ee93aEEa0a36FfF2A9B95dd22Bd6049EE54f26", 47 | proxyFactory: "0xA26e15C895EFc0616177B7c1e7270A4C7D51C997", 48 | proxyRegistry: "0x4678f0a6958e4D2Bc4F1BAF7Bc52E8F3564f3fE4", 49 | spot: "0x65C79fcB50Ca1594B025960e539eD7A9a6D434A3", 50 | tokens: { 51 | BAT: "0x0D8775F648430679A709E98d2b0Cb6250d2887EF", 52 | DAI: "0x6B175474E89094C44Da98b954EedeAC495271d0F", 53 | TUSD: "0xD6CE59F06Ff2070Dd5DcAd0866A7D8cd9270041a", 54 | USDC: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", 55 | WBTC: "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599", 56 | WETH: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", 57 | }, 58 | vat: "0x35D1b3F3D7966A1DFe207aa4514C12a259A0492B", 59 | vow: "0xA950524441892A31ebddF91d3cEEFa04Bf454466", 60 | }, 61 | }; 62 | -------------------------------------------------------------------------------- /templates/react/maker/packages/contracts/src/index.js.ctx: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /templates/react/maker/packages/react-app/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "title": "@maker-app/react-app" 3 | } 4 | -------------------------------------------------------------------------------- /templates/react/maker/packages/react-app/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "packageName": "@maker-app/react-app", 3 | "dependencies": { 4 | "keys": [ 5 | "@makerdao/dai", 6 | "@makerdao/dai-plugin-mcd", 7 | "@maker-app/contracts", 8 | "babel-jest", 9 | "babel-loader" 10 | ], 11 | "values": [ 12 | "^0.31.7", 13 | "^1.5.13-rc.1", 14 | "^1.0.0", 15 | "26.6.0", 16 | "8.1.0" 17 | ] 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /templates/react/maker/packages/react-app/src/App.js.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "contractCall": [ 3 | "// Read more about useDapp on https://usedapp.io/", 4 | "// ilk = collateral in Maker jargon. The code below pulls data for the ETH collateral.", 5 | "const { error: contractCallError, value: ilk } =", 6 | " useCall({", 7 | " contract: new Contract(addresses[MAINNET_ID].vat, abis.vat),", 8 | " method: \"ilks\",", 9 | " args: [\"0x4554482d41000000000000000000000000000000000000000000000000000000\"],", 10 | " }) ?? {};" 11 | ], 12 | "imports": [ 13 | "import { MAINNET_ID, addresses, abis } from \"@maker-app/contracts\";", 14 | "import GET_COLLATERAL_TYPES from \"./graphql/subgraph\";" 15 | ], 16 | "learn": { 17 | "name": "Maker", 18 | "url": "https://docs.makerdao.com/" 19 | }, 20 | "subgraphQuery": { 21 | "key": "collateralTypes", 22 | "name": "GET_COLLATERAL_TYPES" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /templates/react/maker/packages/react-app/src/graphql/subgraph.js: -------------------------------------------------------------------------------- 1 | import { gql } from "@apollo/client"; 2 | 3 | // See more example queries on https://thegraph.com/explorer/subgraph/protofire/maker-protocol 4 | const GET_COLLATERAL_TYPES = gql` 5 | { 6 | collateralTypes(orderBy: addedAt) { 7 | name: id 8 | price { 9 | block 10 | value 11 | } 12 | debtCeiling 13 | totalDebt 14 | liquidationLotSize 15 | liquidationPenalty 16 | liquidationRatio 17 | stabilityFee 18 | auctionCount 19 | vaultCount 20 | } 21 | } 22 | `; 23 | 24 | export default GET_COLLATERAL_TYPES; 25 | -------------------------------------------------------------------------------- /templates/react/maker/packages/react-app/src/index.js.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "subgraph": { 3 | "comment": "// This Maker subgraph is developed by a third-party. You can replace it with your own, if you need to.", 4 | "url": "https://api.thegraph.com/subgraphs/name/protofire/maker-protocol" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /templates/react/mstable/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "description": "mStable provides autonomous and non-custodial stablecoin infrastructure. Read more about it in the [official documentation](https://docs.mstable.org/", 3 | "packages": [ 4 | "[contracts](/packages/contracts)", 5 | "[react-app](/packages/react-app)" 6 | ], 7 | "subgraphName": "mstable-protocol", 8 | "subgraphUrl": "https://thegraph.com/explorer/subgraph/mstable/mstable-protocol", 9 | "templateName": "mStable", 10 | "templateUrl": "https://github.com/paulrberg/create-eth-app/tree/develop/templates/react/mstable" 11 | } 12 | -------------------------------------------------------------------------------- /templates/react/mstable/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "orgName": "@mstable-app", 3 | "packageName": "@mstable-app/monorepo", 4 | "keywords": [ 5 | "mstable" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /templates/react/mstable/packages/contracts/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "title": "@mstable-app/contracts" 3 | } 4 | -------------------------------------------------------------------------------- /templates/react/mstable/packages/contracts/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "packageName": "@mstable-app/contracts" 3 | } 4 | -------------------------------------------------------------------------------- /templates/react/mstable/packages/contracts/src/abis.js: -------------------------------------------------------------------------------- 1 | import mAsset from "./abis/mAsset.json"; 2 | import metaToken from "./abis/metaToken.json"; 3 | import nexus from "./abis/nexus.json"; 4 | import savingsContract from "./abis/savingsContract.json"; 5 | import savingsManager from "./abis/savingsManager.json"; 6 | 7 | export default { 8 | mAsset, 9 | metaToken, 10 | nexus, 11 | savingsContract, 12 | savingsManager, 13 | }; 14 | -------------------------------------------------------------------------------- /templates/react/mstable/packages/contracts/src/addresses.js: -------------------------------------------------------------------------------- 1 | /** 2 | * See all ids below 3 | * https://ethereum.stackexchange.com/questions/17051/how-to-select-a-network-id-or-is-there-a-list-of-network-ids 4 | */ 5 | export const MAINNET_ID = 1; 6 | 7 | /** 8 | * Refer to https://docs.mstable.org/ for the most up-to-date addresses. 9 | */ 10 | export default { 11 | [MAINNET_ID]: { 12 | nexus: "0xAFcE80b19A8cE13DEc0739a1aaB7A028d6845Eb3", 13 | savingsContract: "0xcf3F73290803Fc04425BEE135a4Caeb2BaB2C2A1", 14 | savingsManager: "0x7046b0BfC4C5EEB90559C0805DD9c1A6f4815370", 15 | tokens: { 16 | MTA: "0xa3BeD4E1c75D00fa6f4E5E6922DB7261B5E9AcD2", 17 | mUSD: "0xe2f2a5C287993345a840Db3B0845fbC70f5935a5", 18 | }, 19 | }, 20 | }; 21 | -------------------------------------------------------------------------------- /templates/react/mstable/packages/contracts/src/index.js.ctx: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /templates/react/mstable/packages/react-app/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "title": "@mstable-app/react-app" 3 | } 4 | -------------------------------------------------------------------------------- /templates/react/mstable/packages/react-app/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "packageName": "@mstable-app/react-app", 3 | "dependencies": { 4 | "keys": [ 5 | "@mstable/protocol", 6 | "@mstable/mstable-js" 7 | ], 8 | "values": [ 9 | "^1.3.0", 10 | "^0.1.0-alpha" 11 | ] 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /templates/react/mstable/packages/react-app/src/App.js.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "contractCall": [ 3 | "// Read more about useDapp on https://usedapp.io/", 4 | "const { error: contractCallError, value: mUsdTotalSupply } =", 5 | " useCall({", 6 | " contract:new Contract(addresses[MAINNET_ID].tokens.mUSD, abis.mAsset),", 7 | " method: \"totalSupply\",", 8 | " args: [],", 9 | " }) ?? {};" 10 | ], 11 | "imports": [ 12 | "import { MAINNET_ID, addresses, abis } from \"@mstable-app/contracts\";", 13 | "import GET_MASSETS from \"./graphql/subgraph\";" 14 | ], 15 | "learn": { 16 | "name": "mStable", 17 | "url": "https://docs.mstable.org/" 18 | }, 19 | "subgraphQuery": { 20 | "key": "massets", 21 | "name": "GET_MASSETS" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /templates/react/mstable/packages/react-app/src/graphql/subgraph.js: -------------------------------------------------------------------------------- 1 | import { gql } from "@apollo/client"; 2 | 3 | // See more example queries on https://thegraph.com/explorer/subgraph/mstable/mstable-protocol 4 | const GET_MASSETS = gql` 5 | { 6 | massets(first: 5) { 7 | id 8 | feeRate 9 | token { 10 | id 11 | decimals 12 | name 13 | symbol 14 | totalSupply { 15 | exact 16 | } 17 | } 18 | } 19 | } 20 | `; 21 | 22 | export default GET_MASSETS; 23 | -------------------------------------------------------------------------------- /templates/react/mstable/packages/react-app/src/index.js.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "subgraph": { 3 | "comment": "// This is the official mStable subgraph. You can replace it with your own, if you need to.", 4 | "url": "https://api.thegraph.com/subgraphs/name/mstable/mstable-protocol" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /templates/react/sablier-v1/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Sablier is the protocol for real-time finance on the Ethereum blockchain. Just like you can stream movies on Netflix or music on Spotify, so you can stream money on Sablier. Read more about it in the [official documentation](https://docs.sablier.com/).", 3 | "packages": [ 4 | "[contracts](/packages/contracts)", 5 | "[react-app](/packages/react-app)" 6 | ], 7 | "subgraphName": "Sablier v1", 8 | "subgraphUrl": "https://thegraph.com/explorer/subgraph/sablier-labs/sablier", 9 | "templateName": "Sablier v1", 10 | "templateUrl": "https://github.com/paulrberg/create-eth-app/tree/develop/templates/react/sablier-v1" 11 | } 12 | -------------------------------------------------------------------------------- /templates/react/sablier-v1/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "orgName": "@sablier-v1-app", 3 | "packageName": "@sablier-v1-app/monorepo", 4 | "keywords": [ 5 | "sablier" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /templates/react/sablier-v1/packages/contracts/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "title": "@sablier-v1-app/contracts" 3 | } 4 | -------------------------------------------------------------------------------- /templates/react/sablier-v1/packages/contracts/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "packageName": "@sablier-v1-app/contracts" 3 | } 4 | -------------------------------------------------------------------------------- /templates/react/sablier-v1/packages/contracts/src/abis.js: -------------------------------------------------------------------------------- 1 | import erc20 from "./abis/erc20.json"; 2 | import payroll from "./abis/payroll.json"; 3 | import sablier from "./abis/sablier.json"; 4 | 5 | export default { 6 | erc20, 7 | payroll, 8 | sablier, 9 | }; 10 | -------------------------------------------------------------------------------- /templates/react/sablier-v1/packages/contracts/src/addresses.js: -------------------------------------------------------------------------------- 1 | /** 2 | * See all ids below 3 | * https://ethereum.stackexchange.com/questions/17051/how-to-select-a-network-id-or-is-there-a-list-of-network-ids 4 | */ 5 | export const GOERLI_ID = 5; 6 | export const KOVAN_ID = 42; 7 | export const MAINNET_ID = 1; 8 | export const RINKEBY_ID = 4; 9 | export const ROPSTEN_ID = 3; 10 | 11 | const commonContracts = { 12 | payroll: "0x7ee114C3628Ca90119fC699f03665bF9dB8f5faF", 13 | sablier: "0xc04Ad234E01327b24a831e3718DBFcbE245904CC", 14 | }; 15 | 16 | export default { 17 | [GOERLI_ID]: commonContracts, 18 | [KOVAN_ID]: commonContracts, 19 | [MAINNET_ID]: { 20 | payroll: "0xbd6a40Bb904aEa5a49c59050B5395f7484A4203d", 21 | sablier: "0xA4fc358455Febe425536fd1878bE67FfDBDEC59a", 22 | }, 23 | [RINKEBY_ID]: commonContracts, 24 | [ROPSTEN_ID]: commonContracts, 25 | }; 26 | -------------------------------------------------------------------------------- /templates/react/sablier-v1/packages/contracts/src/index.js.ctx: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /templates/react/sablier-v1/packages/react-app/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "title": "@sablier-v1-app/react-app" 3 | } 4 | -------------------------------------------------------------------------------- /templates/react/sablier-v1/packages/react-app/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "packageName": "@sablier-v1-app/react-app", 3 | "dependencies": { 4 | "keys": [ 5 | "@sablier-v1-app/contracts" 6 | ], 7 | "values": [ 8 | "^1.0.0" 9 | ] 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /templates/react/sablier-v1/packages/react-app/src/App.js.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "contractCall": [ 3 | "// Read more about useDapp on https://usedapp.io/", 4 | "const { error: contractCallError, value: nextStreamId } =", 5 | " useCall({", 6 | " contract: new Contract(addresses[MAINNET_ID].sablier, abis.sablier),", 7 | " method: \"nextStreamId\",", 8 | " args: [],", 9 | " }) ?? {};" 10 | ], 11 | "imports": [ 12 | "import { MAINNET_ID, addresses, abis } from \"@sablier-v1-app/contracts\";", 13 | "import GET_STREAMS from \"./graphql/subgraph\";" 14 | ], 15 | "learn": { 16 | "name": "Sablier v1", 17 | "url": "https://docs.sablier.com/" 18 | }, 19 | "subgraphQuery": { 20 | "key": "streams", 21 | "name": "GET_STREAMS" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /templates/react/sablier-v1/packages/react-app/src/graphql/subgraph.js: -------------------------------------------------------------------------------- 1 | import { gql } from "@apollo/client"; 2 | 3 | // See more example queries on https://thegraph.com/explorer/subgraph/sablier-labs/sablier 4 | const GET_STREAMS = gql` 5 | { 6 | streams(first: 10, orderBy: timestamp, orderDirection: desc) { 7 | id 8 | cancellation { 9 | recipientBalance 10 | timestamp 11 | txhash 12 | } 13 | deposit 14 | ratePerSecond 15 | recipient 16 | sender 17 | startTime 18 | stopTime 19 | timestamp 20 | token { 21 | id 22 | decimals 23 | name 24 | symbol 25 | } 26 | txs { 27 | id 28 | block 29 | event 30 | from 31 | timestamp 32 | to 33 | } 34 | withdrawals { 35 | id 36 | amount 37 | } 38 | } 39 | } 40 | `; 41 | 42 | export default GET_STREAMS; 43 | -------------------------------------------------------------------------------- /templates/react/sablier-v1/packages/react-app/src/index.js.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "subgraph": { 3 | "comment": "// This is the official Sablier v1 subgraph. You can replace it with your own, if you need to.", 4 | "url": "https://api.thegraph.com/subgraphs/name/sablier-labs/sablier" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /templates/react/synthetix/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Synthetix is a protocol for trading synthetic assets on Ethereum. It gives traders on -chain exposure to any asset. Read more about it in the [official documentation](https://docs.synthetix.io/).", 3 | "packages": [ 4 | "[contracts](/packages/contracts)", 5 | "[react-app](/packages/react-app)" 6 | ], 7 | "subgraphName": "Synthetix", 8 | "subgraphUrl": "https://thegraph.com/explorer/subgraph/synthetixio-team/synthetix", 9 | "templateName": "Synthetix", 10 | "templateUrl": "https://github.com/paulrberg/create-eth-app/tree/develop/templates/react/synthetix" 11 | } 12 | -------------------------------------------------------------------------------- /templates/react/synthetix/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "orgName": "@synthetix-app", 3 | "packageName": "@synthetix-app/monorepo", 4 | "keywords": [ 5 | "snx", 6 | "synthetix" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /templates/react/synthetix/packages/contracts/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "title": "@synthetix-app/contracts" 3 | } 4 | -------------------------------------------------------------------------------- /templates/react/synthetix/packages/contracts/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "packageName": "@synthetix-app/contracts" 3 | } 4 | -------------------------------------------------------------------------------- /templates/react/synthetix/packages/contracts/src/abis.js: -------------------------------------------------------------------------------- 1 | import readProxy from "./abis/readProxy.json"; 2 | import SNX from "./abis/snx.json"; 3 | 4 | export default { 5 | readProxy, 6 | tokens: { 7 | SNX, 8 | }, 9 | }; 10 | -------------------------------------------------------------------------------- /templates/react/synthetix/packages/contracts/src/addresses.js: -------------------------------------------------------------------------------- 1 | /** 2 | * See all ids below 3 | * https://ethereum.stackexchange.com/questions/17051/how-to-select-a-network-id-or-is-there-a-list-of-network-ids 4 | */ 5 | export const KOVAN_ID = 42; 6 | export const MAINNET_ID = 1; 7 | 8 | /** 9 | * Please note that these may not be the most up-to-date addresses for the Synthetix contracts. 10 | * https://docs.synthetix.io/addresses/ 11 | */ 12 | export default { 13 | [KOVAN_ID]: { 14 | addressResolver: "0x242a3DF52c375bEe81b1c668741D7c63aF68FDD2", 15 | systemStatus: "0x5b01D9f87080CABcA881A0Cf4e45C0E2ccB7Edde", 16 | tokens: { 17 | SNX: "0x22f1ba6dB6ca0A065e1b7EAe6FC22b7E675310EF", 18 | }, 19 | tokenStates: { 20 | SNX: "0x46824bFAaFd049fB0Af9a45159A88e595Bbbb9f7", 21 | }, 22 | }, 23 | [MAINNET_ID]: { 24 | readProxyAddressResolver: "0x4E3b31eB0E5CB73641EE1E65E7dCEFe520bA3ef2", 25 | tokens: { 26 | SNX: "0xC011a73ee8576Fb46F5E1c5751cA3B9Fe0af2a6F", 27 | }, 28 | tokenStates: { 29 | SNX: "0x5b1b5fEa1b99D83aD479dF0C222F0492385381dD", 30 | }, 31 | }, 32 | }; 33 | -------------------------------------------------------------------------------- /templates/react/synthetix/packages/contracts/src/index.js.ctx: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /templates/react/synthetix/packages/react-app/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "title": "@synthetix-app/react-app" 3 | } 4 | -------------------------------------------------------------------------------- /templates/react/synthetix/packages/react-app/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "packageName": "@synthetix-app/react-app", 3 | "dependencies": { 4 | "keys": [ 5 | "@synthetix-app/contracts", 6 | "synthetix-data", 7 | "synthetix-js" 8 | ], 9 | "values": [ 10 | "^1.0.0", 11 | "^2.1.19", 12 | "^2.25.0-alpha" 13 | ] 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /templates/react/synthetix/packages/react-app/src/App.js.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "contractCall": [ 3 | "// Read more about useDapp on https://usedapp.io/", 4 | "const { error: contractCallError, value: tokenBalance } =", 5 | " useCall({", 6 | " contract: new Contract(addresses[MAINNET_ID].tokens.SNX, abis.tokens.SNX),", 7 | " method: \"balanceOf\",", 8 | " args: [\"0x49BE88F0fcC3A8393a59d3688480d7D253C37D2A\"],", 9 | " }) ?? {};" 10 | ], 11 | "imports": [ 12 | "import { MAINNET_ID, addresses, abis } from \"@synthetix-app/contracts\";", 13 | "import { SynthetixJs } from \"synthetix-js\";", 14 | "import GET_SYNTH_HOLDERS from \"./graphql/subgraph\";" 15 | ], 16 | "learn": { 17 | "name": "Synthetix", 18 | "url": "https://docs.synthetix.io/" 19 | }, 20 | "subgraphQuery": { 21 | "key": "synthHolders", 22 | "name": "GET_SYNTH_HOLDERS" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /templates/react/synthetix/packages/react-app/src/graphql/subgraph.js: -------------------------------------------------------------------------------- 1 | import { gql } from "@apollo/client"; 2 | 3 | // See more example queries on https://thegraph.com/explorer/subgraph/synthetixio-team/synthetix 4 | const GET_SYNTH_HOLDERS = gql` 5 | { 6 | synthHolders(first: 10) { 7 | id 8 | balanceOf 9 | synth 10 | } 11 | } 12 | `; 13 | 14 | export default GET_SYNTH_HOLDERS; 15 | -------------------------------------------------------------------------------- /templates/react/synthetix/packages/react-app/src/index.js.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "subgraph": { 3 | "comment": "// This is the official Synthetix subgraph. You can replace it with your own, if you need to.", 4 | "url": "https://api.thegraph.com/subgraphs/name/synthetixio-team/synthetix" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /templates/react/uniswap-v2/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Uniswap V2 is the second iteration of the Uniswap, a protocol for automated token exchange on Ethereum. Read more about it in the [official documentation](https://uniswap.org/docs/v2/).", 3 | "packages": [ 4 | "[contracts](/packages/contracts)", 5 | "[react-app](/packages/react-app)" 6 | ], 7 | "subgraphName": "Uniswap v2", 8 | "subgraphUrl": "https://thegraph.com/explorer/subgraph/uniswap/uniswap-v2", 9 | "templateName": "Uniswap v2", 10 | "templateUrl": "https://github.com/paulrberg/create-eth-app/tree/develop/templates/react/uniswap-v2" 11 | } 12 | -------------------------------------------------------------------------------- /templates/react/uniswap-v2/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "orgName": "@uniswap-v2-app", 3 | "packageName": "@uniswap-v2-app/monorepo", 4 | "keywords": [ 5 | "uniswap" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /templates/react/uniswap-v2/packages/contracts/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "title": "@uniswap-v2-app/contracts" 3 | } 4 | -------------------------------------------------------------------------------- /templates/react/uniswap-v2/packages/contracts/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "packageName": "@uniswap-v2-app/contracts" 3 | } 4 | -------------------------------------------------------------------------------- /templates/react/uniswap-v2/packages/contracts/src/abis.js: -------------------------------------------------------------------------------- 1 | import erc20 from "./abis/erc20.json"; 2 | import factory from "./abis/factory.json"; 3 | import pair from "./abis/pair.json"; 4 | import router01 from "./abis/router01.json"; 5 | import router02 from "./abis/router02.json"; 6 | 7 | export default { 8 | erc20, 9 | factory, 10 | pair, 11 | router01, 12 | router02, 13 | }; 14 | -------------------------------------------------------------------------------- /templates/react/uniswap-v2/packages/contracts/src/index.js.ctx: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /templates/react/uniswap-v2/packages/react-app/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "title": "@uniswap-v2-app/react-app" 3 | } 4 | -------------------------------------------------------------------------------- /templates/react/uniswap-v2/packages/react-app/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "packageName": "@uniswap-v2-app/react-app", 3 | "dependencies": { 4 | "keys": [ 5 | "@uniswap/sdk", 6 | "@uniswap/v2-core", 7 | "@uniswap/v2-periphery", 8 | "@uniswap-v2-app/contracts" 9 | ], 10 | "values": [ 11 | "^3.0.2", 12 | "^1.0.1", 13 | "^1.1.0-beta.0", 14 | "^1.0.0" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /templates/react/uniswap-v2/packages/react-app/src/App.js.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "contractCall": [ 3 | "// Read more about useDapp on https://usedapp.io/", 4 | "const { error: contractCallError, value: reserves } =", 5 | " useCall({", 6 | " contract: new Contract(addresses[MAINNET_ID].pairs[\"DAI-WETH\"], abis.pair),", 7 | " method: \"getReserves\",", 8 | " args: [],", 9 | " }) ?? {};" 10 | ], 11 | "imports": [ 12 | "import { MAINNET_ID, addresses, abis } from \"@uniswap-v2-app/contracts\";", 13 | "import GET_AGGREGATED_UNISWAP_DATA from \"./graphql/subgraph\";" 14 | ], 15 | "learn": { 16 | "name": "Uniswap v2", 17 | "url": "https://uniswap.org/docs/v2/" 18 | }, 19 | "subgraphQuery": { 20 | "key": "uniswapFactories", 21 | "name": "GET_AGGREGATED_UNISWAP_DATA" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /templates/react/uniswap-v2/packages/react-app/src/graphql/subgraph.js: -------------------------------------------------------------------------------- 1 | import { gql } from "@apollo/client"; 2 | 3 | // See more example queries on https://thegraph.com/explorer/subgraph/uniswap/uniswap-v2 4 | const GET_AGGREGATED_UNISWAP_DATA = gql` 5 | { 6 | uniswapFactories(first: 1) { 7 | pairCount 8 | totalVolumeUSD 9 | totalLiquidityUSD 10 | } 11 | } 12 | `; 13 | 14 | export default GET_AGGREGATED_UNISWAP_DATA; 15 | -------------------------------------------------------------------------------- /templates/react/uniswap-v2/packages/react-app/src/index.js.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "subgraph": { 3 | "comment": "// This is the official Uniswap v2 subgraph. You can replace it with your own, if you need to.", 4 | "url": "https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v2" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /templates/vue/aave/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Aave is a decentralized non-custodial money market protocol where users can participate as depositors or borrowers. Read more about it in the [official documentation](https://developers.aave.com/).", 3 | "packages": [ 4 | "[contracts](/packages/contracts)", 5 | "[vue-app](/packages/vue-app)" 6 | ], 7 | "subgraphName": "Aave", 8 | "subgraphUrl": "https://thegraph.com/explorer/subgraph/aave/protocol", 9 | "templateName": "Aave", 10 | "templateUrl": "https://github.com/paulrberg/create-eth-app/tree/develop/templates/vue/aave" 11 | } 12 | -------------------------------------------------------------------------------- /templates/vue/aave/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "orgName": "@aave-app", 3 | "packageName": "@aave-app/monorepo", 4 | "keywords": [ 5 | "aave" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /templates/vue/aave/packages/contracts/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "title": "@aave-app/contracts" 3 | } 4 | -------------------------------------------------------------------------------- /templates/vue/aave/packages/contracts/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "packageName": "@aave-app/contracts" 3 | } 4 | -------------------------------------------------------------------------------- /templates/vue/aave/packages/contracts/src/abis.js: -------------------------------------------------------------------------------- 1 | import aToken from "./abis/aToken.json"; 2 | import lendingPool from "./abis/lendingPool.json"; 3 | import lendingPoolAddressesProvider from "./abis/lendingPoolAddressesProvider.json"; 4 | import lendingPoolCore from "./abis/lendingPoolCore.json"; 5 | 6 | export default { 7 | aToken, 8 | lendingPool, 9 | lendingPoolAddressesProvider, 10 | lendingPoolCore, 11 | }; 12 | -------------------------------------------------------------------------------- /templates/vue/aave/packages/contracts/src/index.js.ctx: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /templates/vue/aave/packages/vue-app/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "title": "@aave-app/vue-app" 3 | } 4 | -------------------------------------------------------------------------------- /templates/vue/aave/packages/vue-app/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "packageName": "@aave-app/vue-app", 3 | "dependencies": { 4 | "keys": [ 5 | "@aave-app/contracts" 6 | ], 7 | "values": [ 8 | "^1.0.0" 9 | ] 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /templates/vue/aave/packages/vue-app/src/components/HelloWorld.vue.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "callToAction": "Read On-Chain Balance", 3 | "contractCall": [ 4 | "// Should replace with the end-user wallet, e.g. Metamask", 5 | "const defaultProvider = getDefaultProvider();", 6 | "// Create an instance of an ethers.js Contract", 7 | "// Read more about ethers.js on https://docs.ethers.io/v5/api/contract/contract/", 8 | "const aDAIContract = new Contract(addresses[MAINNET_ID].tokens.aDAI, abis.aToken, defaultProvider);", 9 | "// A pre-defined address that owns some aDAI tokens", 10 | "const aDAIBalance = await aDAIContract.balanceOf(\"0x3f8CB69d9c0ED01923F11c829BaE4D9a4CB6c82C\");", 11 | "console.log({ aDAIBalance: aDAIBalance.toString() });" 12 | ], 13 | "imports": [ 14 | "import { MAINNET_ID, addresses, abis } from \"@aave-app/contracts\";", 15 | "import GET_LENDING_POOL_CONFIGURATION_HISTORY_ITEMS from \"../graphql/subgraph\";" 16 | ], 17 | "learn": { 18 | "name": "Aave", 19 | "items": [ 20 | { 21 | "label": "Core Docs", 22 | "url": "https://docs.aave.com/developers/" 23 | }, 24 | { 25 | "label": "Community Chat", 26 | "url": "https://t.me/Aavesome/" 27 | }, 28 | { 29 | "label": "Twitter", 30 | "url": "https://twitter.com/aaveaave/" 31 | } 32 | ] 33 | }, 34 | "subgraphQuery": { 35 | "key": "lendingPoolConfigurationHistoryItems", 36 | "name": "GET_LENDING_POOL_CONFIGURATION_HISTORY_ITEMS" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /templates/vue/aave/packages/vue-app/src/graphql/subgraph.js: -------------------------------------------------------------------------------- 1 | import gql from "graphql-tag"; 2 | 3 | // See more example queries on https://thegraph.com/explorer/subgraph/graphprotocol/compound-v2 4 | const GET_MONEY_MARKETS = gql` 5 | { 6 | markets(first: 7) { 7 | borrowRate 8 | cash 9 | collateralFactor 10 | exchangeRate 11 | interestRateModelAddress 12 | name 13 | reserves 14 | supplyRate 15 | symbol 16 | id 17 | totalBorrows 18 | totalSupply 19 | underlyingAddress 20 | underlyingName 21 | underlyingPrice 22 | underlyingSymbol 23 | reserveFactor 24 | underlyingPriceUSD 25 | } 26 | } 27 | `; 28 | 29 | export default GET_MONEY_MARKETS; 30 | -------------------------------------------------------------------------------- /templates/vue/aave/packages/vue-app/src/main.js.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "subgraph": { 3 | "url": "https://api.thegraph.com/subgraphs/name/aave/protocol" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /templates/vue/chainlink/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Chainlink is middleware to simplify communication with blockchains. Read more about it in the [official documentation](https://docs.chain.link/).", 3 | "packages": [ 4 | "[contracts](/packages/contracts)", 5 | "[vue-app](/packages/vue-app)" 6 | ], 7 | "subgraphName": "Chainlink", 8 | "subgraphUrl": "https://thegraph.com/legacy-explorer/subgraph/tomafrench/chainlink", 9 | "templateName": "Chainlink", 10 | "templateUrl": "https://github.com/paulrberg/create-eth-app/tree/develop/templates/react/chainlink" 11 | } 12 | -------------------------------------------------------------------------------- /templates/vue/chainlink/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "orgName": "@chainlink-app", 3 | "packageName": "@chainlink-app/monorepo", 4 | "keywords": [ 5 | "chainlink" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /templates/vue/chainlink/packages/contracts/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "title": "@chainlink-app/contracts" 3 | } 4 | -------------------------------------------------------------------------------- /templates/vue/chainlink/packages/contracts/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "packageName": "@chainlink-app/contracts" 3 | } 4 | -------------------------------------------------------------------------------- /templates/vue/chainlink/packages/contracts/src/abis.js: -------------------------------------------------------------------------------- 1 | export default {}; 2 | -------------------------------------------------------------------------------- /templates/vue/chainlink/packages/contracts/src/abis/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WalletConnect/create-eth-app/eb9bdfea6d372f34053c6106c7733cd43df6e0e4/templates/vue/chainlink/packages/contracts/src/abis/.gitkeep -------------------------------------------------------------------------------- /templates/vue/chainlink/packages/contracts/src/index.js.ctx: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /templates/vue/chainlink/packages/vue-app/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "title": "@chainlink-app/vue-app" 3 | } 4 | -------------------------------------------------------------------------------- /templates/vue/chainlink/packages/vue-app/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "packageName": "@chainlink-app/vue-app", 3 | "dependencies": { 4 | "keys": [ 5 | "@chainlink-app/contracts", 6 | "@chainlink/contracts" 7 | ], 8 | "values": [ 9 | "^1.0.0", 10 | "0.2.1" 11 | ] 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /templates/vue/chainlink/packages/vue-app/src/components/HelloWorld.vue.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "callToAction": "Read Price Feed", 3 | "contractCall": [ 4 | "// Should replace with the end-user wallet, e.g. Metamask", 5 | "const defaultProvider = getDefaultProvider();", 6 | "// Create an instance of an ethers.js Contract", 7 | "// Read more about ethers.js on https://docs.ethers.io/v5/api/contract/contract/", 8 | "const priceFeedContract = new Contract(addresses[MAINNET_ID].ETHUSD, AggregatorV3InterfaceABI, defaultProvider);", 9 | "const price = await priceFeedContract.latestRoundData();", 10 | "// latestRoundData returns the price at the second argument (roundId, answer, startedAt, updatedAt, answeredInRound)", 11 | "const [, priceFeedData] = price.toString().split(\",\");", 12 | "console.log({ priceFeedData: priceFeedData });" 13 | ], 14 | "imports": [ 15 | "import { MAINNET_ID, addresses } from \"@chainlink-app/contracts\";", 16 | "import AggregatorV3InterfaceABI from \"@chainlink/contracts/abi/v0.6/AggregatorV3Interface.json\";", 17 | "import GET_PRICES_FEEDS from \"../graphql/subgraph\";" 18 | ], 19 | "learn": { 20 | "items": [ 21 | { 22 | "label": "Core Docs", 23 | "url": "https://docs.chain.link/" 24 | }, 25 | { 26 | "label": "Twitter", 27 | "url": "https://twitter.com/chainlink" 28 | } 29 | ], 30 | "name": "Chainlink" 31 | }, 32 | "subgraphQuery": { 33 | "key": "priceFeeds", 34 | "name": "GET_PRICES_FEEDS" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /templates/vue/chainlink/packages/vue-app/src/graphql/subgraph.js: -------------------------------------------------------------------------------- 1 | import gql from "graphql-tag"; 2 | 3 | // See more example queries on https://thegraph.com/legacy-explorer/subgraph/tomafrench/chainlink 4 | const GET_PRICES_FEEDS = gql` 5 | { 6 | priceFeeds(first: 5) { 7 | id 8 | assetPair 9 | decimals 10 | latestPrice { 11 | id 12 | } 13 | } 14 | } 15 | `; 16 | 17 | export default GET_PRICES_FEEDS; 18 | -------------------------------------------------------------------------------- /templates/vue/chainlink/packages/vue-app/src/main.js.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "subgraph": { 3 | "url": "https://api.thegraph.com/subgraphs/name/tomafrench/chainlink" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /templates/vue/compound/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Compound is an algorithmic, autonomous interest rate protocol built for developers, to unlock a universe of open financial applications. Read more about it in the [official documentation](https://compound.finance/developers).", 3 | "packages": [ 4 | "[contracts](/packages/contracts)", 5 | "[vue-app](/packages/vue-app)" 6 | ], 7 | "subgraphName": "Compound", 8 | "subgraphUrl": "https://thegraph.com/explorer/subgraph/graphprotocol/compound-v2", 9 | "templateName": "Compound", 10 | "templateUrl": "https://github.com/paulrberg/create-eth-app/tree/develop/templates/vue/compound" 11 | } 12 | -------------------------------------------------------------------------------- /templates/vue/compound/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "orgName": "@compound-app", 3 | "packageName": "@compound-app/monorepo", 4 | "keywords": [ 5 | "aave" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /templates/vue/compound/packages/contracts/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "title": "@compound-app/contracts" 3 | } 4 | -------------------------------------------------------------------------------- /templates/vue/compound/packages/contracts/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "packageName": "@compound-app/contracts" 3 | } 4 | -------------------------------------------------------------------------------- /templates/vue/compound/packages/contracts/src/abis.js: -------------------------------------------------------------------------------- 1 | import COMP from "./abis/COMP.json"; 2 | import cBAT from "./abis/cBAT.json"; 3 | import cDAI from "./abis/cDAI.json"; 4 | import cETH from "./abis/cETH.json"; 5 | import cREP from "./abis/cREP.json"; 6 | import cSAI from "./abis/cSAI.json"; 7 | import cUSDC from "./abis/cUSDC.json"; 8 | import cUSDT from "./abis/cUSDT.json"; 9 | import cWBTC from "./abis/cWBTC.json"; 10 | import cZRX from "./abis/cZRX.json"; 11 | import comptroller from "./abis/comptroller.json"; 12 | import governance from "./abis/governance.json"; 13 | import priceOracle from "./abis/priceOracle.json"; 14 | import timelock from "./abis/timelock.json"; 15 | 16 | export default { 17 | comptroller, 18 | governance, 19 | priceOracle, 20 | timelock, 21 | tokens: { 22 | COMP, 23 | cBAT, 24 | cDAI, 25 | cETH, 26 | cREP, 27 | cSAI, 28 | cUSDC, 29 | cUSDT, 30 | cWBTC, 31 | cZRX, 32 | }, 33 | }; 34 | -------------------------------------------------------------------------------- /templates/vue/compound/packages/contracts/src/index.js.ctx: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /templates/vue/compound/packages/vue-app/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "title": "@compound-app/vue-app" 3 | } 4 | -------------------------------------------------------------------------------- /templates/vue/compound/packages/vue-app/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "packageName": "@compound-app/vue-app", 3 | "dependencies": { 4 | "keys": [ 5 | "@compound-app/contracts" 6 | ], 7 | "values": [ 8 | "^1.0.0" 9 | ] 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /templates/vue/compound/packages/vue-app/src/components/HelloWorld.vue.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "callToAction": "Read On-Chain Balance", 3 | "contractCall": [ 4 | "// Should replace with the end-user wallet, e.g. Metamask", 5 | "const defaultProvider = getDefaultProvider();", 6 | "// Create an instance of an ethers.js Contract", 7 | "// Read more about ethers.js on https://docs.ethers.io/v5/api/contract/contract/", 8 | "const cDAIContract = new Contract(addresses[MAINNET_ID].tokens.cDAI, abis.tokens.cDAI, defaultProvider);", 9 | "// A pre-defined address that owns some cDAI tokens", 10 | "const cDAIBalance = await cDAIContract.balanceOf(\"0x3f8CB69d9c0ED01923F11c829BaE4D9a4CB6c82C\");", 11 | "console.log({ cDAIBalance: cDAIBalance.toString() });" 12 | ], 13 | "imports": [ 14 | "import { MAINNET_ID, addresses, abis } from \"@compound-app/contracts\";", 15 | "import GET_MONEY_MARKETS from \"../graphql/subgraph\";" 16 | ], 17 | "learn": { 18 | "items": [ 19 | { 20 | "label": "Core Docs", 21 | "url": "https://compound.finance/docs" 22 | }, 23 | { 24 | "label": "Governance", 25 | "url": "https://compound.finance/governance" 26 | }, 27 | { 28 | "label": "Community Chat", 29 | "url": "https://compound.finance/discord" 30 | }, 31 | { 32 | "label": "Twitter", 33 | "url": "https://twitter.com/compoundfinance" 34 | } 35 | ], 36 | "name": "Compound" 37 | }, 38 | "subgraphQuery": { 39 | "key": "markets", 40 | "name": "GET_MONEY_MARKETS" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /templates/vue/compound/packages/vue-app/src/graphql/subgraph.js: -------------------------------------------------------------------------------- 1 | import gql from "graphql-tag"; 2 | 3 | // See more example queries on https://thegraph.com/explorer/subgraph/aave/protocol 4 | const GET_LENDING_POOL_CONFIGURATION_HISTORY_ITEMS = gql` 5 | { 6 | lendingPoolConfigurationHistoryItems(first: 5) { 7 | id 8 | provider { 9 | id 10 | } 11 | lendingPool 12 | lendingPoolCore 13 | } 14 | } 15 | `; 16 | 17 | export default GET_LENDING_POOL_CONFIGURATION_HISTORY_ITEMS; 18 | -------------------------------------------------------------------------------- /templates/vue/compound/packages/vue-app/src/main.js.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "subgraph": { 3 | "url": "https://api.thegraph.com/subgraphs/name/graphprotocol/compound-v2" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /templates/vue/default/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | # local env files 6 | .env.local 7 | .env.*.local 8 | 9 | # log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | 14 | # editor directories and files 15 | .idea 16 | .vscode 17 | *.suo 18 | *.ntvs* 19 | *.njsproj 20 | *.sln 21 | *.sw? 22 | 23 | # subgraph 24 | packages/subgraph/build/ 25 | packages/subgraph/src/types/ 26 | -------------------------------------------------------------------------------- /templates/vue/default/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WalletConnect/create-eth-app/eb9bdfea6d372f34053c6106c7733cd43df6e0e4/templates/vue/default/README.md -------------------------------------------------------------------------------- /templates/vue/default/README.md.ctx: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /templates/vue/default/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "orgName": "@my-app", 3 | "packageName": "@my-app/monorepo", 4 | "scripts": { 5 | "keys": [ 6 | "subgraph:auth", 7 | "subgraph:codegen", 8 | "subgraph:build", 9 | "subgraph:deploy" 10 | ], 11 | "values": [ 12 | "yarn workspace @my-app/subgraph auth", 13 | "yarn workspace @my-app/subgraph codegen", 14 | "yarn workspace @my-app/subgraph build", 15 | "yarn workspace @my-app/subgraph deploy" 16 | ] 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /templates/vue/default/packages/contracts/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "title": "@my-app/contracts" 3 | } 4 | -------------------------------------------------------------------------------- /templates/vue/default/packages/contracts/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "packageName": "@my-app/contracts" 3 | } 4 | -------------------------------------------------------------------------------- /templates/vue/default/packages/contracts/src/abis.js: -------------------------------------------------------------------------------- 1 | import erc20Abi from "./abis/erc20.json"; 2 | import ownableAbi from "./abis/ownable.json"; 3 | 4 | const abis = { 5 | erc20: erc20Abi, 6 | ownable: ownableAbi, 7 | }; 8 | 9 | export default abis; 10 | -------------------------------------------------------------------------------- /templates/vue/default/packages/contracts/src/abis/ownable.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [], 4 | "payable": false, 5 | "stateMutability": "nonpayable", 6 | "type": "constructor" 7 | }, 8 | { 9 | "anonymous": false, 10 | "inputs": [ 11 | { 12 | "indexed": true, 13 | "internalType": "address", 14 | "name": "previousOwner", 15 | "type": "address" 16 | }, 17 | { 18 | "indexed": true, 19 | "internalType": "address", 20 | "name": "newOwner", 21 | "type": "address" 22 | } 23 | ], 24 | "name": "OwnershipTransferred", 25 | "type": "event" 26 | }, 27 | { 28 | "constant": true, 29 | "inputs": [], 30 | "name": "owner", 31 | "outputs": [ 32 | { 33 | "internalType": "address", 34 | "name": "", 35 | "type": "address" 36 | } 37 | ], 38 | "payable": false, 39 | "stateMutability": "view", 40 | "type": "function" 41 | }, 42 | { 43 | "constant": true, 44 | "inputs": [], 45 | "name": "isOwner", 46 | "outputs": [ 47 | { 48 | "internalType": "bool", 49 | "name": "", 50 | "type": "bool" 51 | } 52 | ], 53 | "payable": false, 54 | "stateMutability": "view", 55 | "type": "function" 56 | }, 57 | { 58 | "constant": false, 59 | "inputs": [], 60 | "name": "renounceOwnership", 61 | "outputs": [], 62 | "payable": false, 63 | "stateMutability": "nonpayable", 64 | "type": "function" 65 | }, 66 | { 67 | "constant": false, 68 | "inputs": [ 69 | { 70 | "internalType": "address", 71 | "name": "newOwner", 72 | "type": "address" 73 | } 74 | ], 75 | "name": "transferOwnership", 76 | "outputs": [], 77 | "payable": false, 78 | "stateMutability": "nonpayable", 79 | "type": "function" 80 | } 81 | ] 82 | -------------------------------------------------------------------------------- /templates/vue/default/packages/contracts/src/addresses.js: -------------------------------------------------------------------------------- 1 | // This address points to a dummy ERC20 contract deployed on Ethereum Mainnet, 2 | // Goerli, Kovan, Rinkeby and Ropsten. Replace it with your smart contracts. 3 | const addresses = { 4 | ceaErc20: "0xa6dF0C88916f3e2831A329CE46566dDfBe9E74b7", 5 | }; 6 | 7 | export default addresses; 8 | -------------------------------------------------------------------------------- /templates/vue/default/packages/contracts/src/index.js.ctx: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /templates/vue/default/packages/subgraph/README.md: -------------------------------------------------------------------------------- 1 | ## @my-app/subgraph 2 | 3 | The Graph is a tool for for indexing events emitted on the Ethereum blockchain. It provides you with an easy-to-use GraphQL API. 4 | 5 | ## Available Scripts 6 | 7 | In the project directory, you can run: 8 | 9 | ### Subgraph 10 | 11 | #### `yarn codegen` 12 | 13 | Generates AssemblyScript types for smart contract ABIs and the subgraph schema. 14 | 15 | #### `yarn build` 16 | 17 | Compiles the subgraph to WebAssembly. 18 | 19 | #### `yarn auth` 20 | 21 | Before deploying your subgraph, you need to sign up on the 22 | [Graph Explorer](https://thegraph.com/explorer/). There, you will be given an access token. Drop it in the command 23 | below: 24 | 25 | ```sh 26 | GRAPH_ACCESS_TOKEN=your-access-token-here yarn subgraph:auth 27 | ``` 28 | 29 | #### `yarn deploy` 30 | 31 | Deploys the subgraph to the official Graph Node.
32 | 33 | Replace `paulrberg/create-eth-app` in the package.json script with your subgraph's name. 34 | 35 | You may also want to [read more about the hosted service](https://thegraph.com/docs/quick-start#hosted-service). 36 | 37 | ## Learn More 38 | 39 | To learn The Graph, check out the [The Graph documentation](https://thegraph.com/docs). 40 | 41 | --- 42 | 43 | 1. Generate types 44 | 2. Build distributable files 45 | 3. Deploy to the remote API 46 | 47 | ## Learn More 48 | 49 | You can learn more in the [The Graph documentation](https://thegraph.com/docs).
50 | 51 | Also consider joining [The Graph Discord server](https://discord.gg/vtvv7FP), where you can seek out help. 52 | 53 | ## Common Errors 54 | 55 | ### Failed to Compile 56 | 57 | > ✖ Failed to compile subgraph: Failed to compile data source mapping: Import file 'src/types/schema.ts' not found. 58 | > Error: Failed to compile data source mapping: Import file 'src/types/schema.ts' not found. 59 | 60 | Run the `yarn subgraph` and this error will go away. 61 | 62 | ### No Access Token 63 | 64 | > ✖ No access token provided 65 | 66 | Make sure that you followed the instructions listed above for [yarn auth](#yarn-auth). 67 | 68 | ### Failed to Deploy 69 | 70 | > ✖ Failed to deploy to Graph node https://api.thegraph.com/deploy/: Invalid account name or access token 71 | 72 | Make sure that you: 73 | 74 | 1. Signed up on the [Graph Explorer](https://thegraph.com/explorer) 75 | 2. Followed the instructions listed above for [yarn auth](#yarn-auth) 76 | 3. Replaced `paulrberg/create-eth-app` with your subgraph's name 77 | -------------------------------------------------------------------------------- /templates/vue/default/packages/subgraph/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@my-app/subgraph", 3 | "version": "1.0.0", 4 | "dependencies": { 5 | "@graphprotocol/graph-cli": "0.53.0", 6 | "@graphprotocol/graph-ts": "0.31.0" 7 | }, 8 | "license": "MIT", 9 | "scripts": { 10 | "auth": "graph auth https://api.thegraph.com/ $GRAPH_ACCESS_TOKEN", 11 | "build": "graph build", 12 | "codegen": "graph codegen --output-dir src/types/", 13 | "deploy": "graph deploy paulrberg/create-eth-app --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /templates/vue/default/packages/subgraph/schema.graphql: -------------------------------------------------------------------------------- 1 | type Token @entity { 2 | id: ID! 3 | decimals: Int 4 | name: String 5 | symbol: String 6 | } 7 | 8 | type Transfer @entity { 9 | id: ID! 10 | from: String! 11 | to: String! 12 | value: BigInt! 13 | } 14 | -------------------------------------------------------------------------------- /templates/vue/default/packages/subgraph/src/mappings/tokens.ts: -------------------------------------------------------------------------------- 1 | import { Token } from "../types/schema"; 2 | 3 | export function addToken(address: string): void { 4 | let token: Token | null = Token.load(address); 5 | if (token != null) { 6 | return; 7 | } 8 | 9 | token = new Token(address); 10 | if (address == "0xa6dF0C88916f3e2831A329CE46566dDfBe9E74b7") { 11 | token.decimals = 18; 12 | token.name = "CeaErc20"; 13 | token.symbol = "CEAERC20"; 14 | } else { 15 | token.decimals = 0; 16 | token.name = null; 17 | token.symbol = null; 18 | } 19 | 20 | token.save(); 21 | } 22 | -------------------------------------------------------------------------------- /templates/vue/default/packages/subgraph/src/mappings/transfers.ts: -------------------------------------------------------------------------------- 1 | import { Address } from "@graphprotocol/graph-ts"; 2 | 3 | import { Transfer as TransferEvent } from "../types/CeaErc20/erc20"; 4 | import { Transfer } from "../types/schema"; 5 | import { addToken } from "./tokens"; 6 | 7 | export function handleTransfer(event: TransferEvent): void { 8 | let transactionHash: string = event.transaction.hash.toHex(); 9 | let transfer = new Transfer(transactionHash); 10 | transfer.from = event.params.from.toHex(); 11 | transfer.to = event.params.to.toHex(); 12 | transfer.value = event.params.value; 13 | transfer.save(); 14 | 15 | let to: Address | null = event.transaction.to; 16 | if (to) { 17 | addToken(to.toHex()); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /templates/vue/default/packages/subgraph/subgraph.yaml: -------------------------------------------------------------------------------- 1 | specVersion: 0.0.4 2 | description: Subgraph that indexes the blockchain data 3 | repository: https://github.com/sablier-labs/sablier-subgraph 4 | schema: 5 | file: ./schema.graphql 6 | dataSources: 7 | - kind: ethereum/contract 8 | name: CeaErc20 9 | network: mainnet 10 | source: 11 | abi: erc20 12 | address: "0xa6dF0C88916f3e2831A329CE46566dDfBe9E74b7" 13 | mapping: 14 | kind: ethereum/events 15 | apiVersion: 0.0.6 16 | abis: 17 | - name: erc20 18 | file: ../contracts/src/abis/erc20.json 19 | entities: 20 | - Token 21 | - Transfer 22 | eventHandlers: 23 | - event: Transfer(indexed address,indexed address,uint256) 24 | handler: handleTransfer 25 | file: ./src/mappings/transfers.ts 26 | language: wasm/assemblyscript 27 | -------------------------------------------------------------------------------- /templates/vue/default/packages/vue-app/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "title": "@my-app/vue-app" 3 | } 4 | -------------------------------------------------------------------------------- /templates/vue/default/packages/vue-app/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "packageName": "@my-app/vue-app", 3 | "dependencies": { 4 | "keys": [ 5 | "@my-app/contracts" 6 | ], 7 | "values": [ 8 | "^1.0.0" 9 | ] 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /templates/vue/default/packages/vue-app/src/components/HelloWorld.vue.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "callToAction": "Read On-Chain Balance", 3 | "contractCall": [ 4 | "// Should replace with the end-user wallet, e.g. Metamask", 5 | "const defaultProvider = getDefaultProvider();", 6 | "// Create an instance of an ethers.js Contract", 7 | "// Read more about ethers.js on https://docs.ethers.io/v5/api/contract/contract/", 8 | "const ceaErc20 = new Contract(addresses.ceaErc20, abis.erc20, defaultProvider);", 9 | "// A pre-defined address that owns some CEAERC20 tokens", 10 | "const tokenBalance = await ceaErc20.balanceOf(\"0x3f8CB69d9c0ED01923F11c829BaE4D9a4CB6c82C\");", 11 | "console.log({ tokenBalance: tokenBalance.toString() });" 12 | ], 13 | "imports": [ 14 | "import { addresses, abis } from \"@my-app/contracts\";", 15 | "import GET_TRANSFERS from \"../graphql/subgraph\";" 16 | ], 17 | "learn": { 18 | "items": [ 19 | { 20 | "label": "Core Docs", 21 | "url": "https://thegraph.com/docs/quick-start" 22 | }, 23 | { 24 | "label": "Community Chat", 25 | "url": "https://discord.gg/vtvv7FP" 26 | }, 27 | { 28 | "label": "Twitter", 29 | "url": "https://twitter.com/graphprotocol" 30 | } 31 | ], 32 | "name": "The Graph" 33 | }, 34 | "subgraphQuery": { 35 | "key": "transfers", 36 | "name": "GET_TRANSFERS" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /templates/vue/default/packages/vue-app/src/graphql/subgraph.js: -------------------------------------------------------------------------------- 1 | import gql from "graphql-tag"; 2 | 3 | // See more example queries on https://thegraph.com/explorer/subgraph/paulrberg/create-eth-app 4 | const GET_TRANSFERS = gql` 5 | { 6 | transfers(first: 10) { 7 | id 8 | from 9 | to 10 | value 11 | } 12 | } 13 | `; 14 | 15 | export default GET_TRANSFERS; 16 | -------------------------------------------------------------------------------- /templates/vue/default/packages/vue-app/src/main.js.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "subgraph": { 3 | "url": "https://api.thegraph.com/subgraphs/name/paulrberg/create-eth-app" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /templates/vue/kyber/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Kyber is a blockchain-based liquidity protocol that aggregates liquidity from a wide range of reserves, powering instant and secure token exchange in any decentralized application. Read more about it in the [official documentation](https://developer.kyber.network/).", 3 | "packages": [ 4 | "[contracts](/packages/contracts)", 5 | "[vue-app](/packages/vue-app)" 6 | ], 7 | "subgraphName": "Kyber", 8 | "subgraphUrl": "https://thegraph.com/explorer/subgraph/protofire/kyber", 9 | "templateName": "Kyber", 10 | "templateUrl": "https://github.com/paulrberg/create-eth-app/tree/develop/templates/vue/kyber" 11 | } 12 | -------------------------------------------------------------------------------- /templates/vue/kyber/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "orgName": "@kyber-app", 3 | "packageName": "@kyber-app/monorepo", 4 | "keywords": [ 5 | "kyber" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /templates/vue/kyber/packages/contracts/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "title": "@kyber-app/contracts" 3 | } 4 | -------------------------------------------------------------------------------- /templates/vue/kyber/packages/contracts/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "packageName": "@kyber-app/contracts" 3 | } 4 | -------------------------------------------------------------------------------- /templates/vue/kyber/packages/contracts/src/abis.js: -------------------------------------------------------------------------------- 1 | import conversionRates from "./abis/conversionRates.json"; 2 | import erc20 from "./abis/erc20.json"; 3 | import kyberFeeHandler from "./abis/kyberFeeHandler.json"; 4 | import kyberHintHandler from "./abis/kyberHintHandler.json"; 5 | import kyberNetworkProxyV1 from "./abis/kyberNetworkProxyV1.json"; 6 | import kyberNetworkProxyV2 from "./abis/kyberNetworkProxyV2.json"; 7 | import kyberReserve from "./abis/kyberReserve.json"; 8 | import kyberStorage from "./abis/kyberStorage.json"; 9 | import liquidityConversionRates from "./abis/liquidityConversionRates.json"; 10 | import sanityRates from "./abis/sanityRates.json"; 11 | import simpleKyberProxy from "./abis/simpleKyberProxy.json"; 12 | 13 | export default { 14 | conversionRates, 15 | erc20, 16 | kyberFeeHandler, 17 | kyberHintHandler, 18 | kyberNetworkProxyV1, 19 | kyberNetworkProxyV2, 20 | kyberReserve, 21 | kyberStorage, 22 | liquidityConversionRates, 23 | sanityRates, 24 | simpleKyberProxy, 25 | }; 26 | -------------------------------------------------------------------------------- /templates/vue/kyber/packages/contracts/src/abis/erc20.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "anonymous": false, 4 | "inputs": [ 5 | { "indexed": true, "internalType": "address", "name": "_owner", "type": "address" }, 6 | { "indexed": true, "internalType": "address", "name": "_spender", "type": "address" }, 7 | { "indexed": false, "internalType": "uint256", "name": "_value", "type": "uint256" } 8 | ], 9 | "name": "Approval", 10 | "type": "event" 11 | }, 12 | { 13 | "inputs": [ 14 | { "internalType": "address", "name": "_owner", "type": "address" }, 15 | { "internalType": "address", "name": "_spender", "type": "address" } 16 | ], 17 | "name": "allowance", 18 | "outputs": [{ "internalType": "uint256", "name": "remaining", "type": "uint256" }], 19 | "stateMutability": "view", 20 | "type": "function" 21 | }, 22 | { 23 | "inputs": [ 24 | { "internalType": "address", "name": "_spender", "type": "address" }, 25 | { "internalType": "uint256", "name": "_value", "type": "uint256" } 26 | ], 27 | "name": "approve", 28 | "outputs": [{ "internalType": "bool", "name": "success", "type": "bool" }], 29 | "stateMutability": "nonpayable", 30 | "type": "function" 31 | }, 32 | { 33 | "inputs": [{ "internalType": "address", "name": "_owner", "type": "address" }], 34 | "name": "balanceOf", 35 | "outputs": [{ "internalType": "uint256", "name": "balance", "type": "uint256" }], 36 | "stateMutability": "view", 37 | "type": "function" 38 | }, 39 | { 40 | "inputs": [], 41 | "name": "decimals", 42 | "outputs": [{ "internalType": "uint8", "name": "digits", "type": "uint8" }], 43 | "stateMutability": "view", 44 | "type": "function" 45 | }, 46 | { 47 | "inputs": [], 48 | "name": "totalSupply", 49 | "outputs": [{ "internalType": "uint256", "name": "supply", "type": "uint256" }], 50 | "stateMutability": "view", 51 | "type": "function" 52 | }, 53 | { 54 | "inputs": [ 55 | { "internalType": "address", "name": "_to", "type": "address" }, 56 | { "internalType": "uint256", "name": "_value", "type": "uint256" } 57 | ], 58 | "name": "transfer", 59 | "outputs": [{ "internalType": "bool", "name": "success", "type": "bool" }], 60 | "stateMutability": "nonpayable", 61 | "type": "function" 62 | }, 63 | { 64 | "inputs": [ 65 | { "internalType": "address", "name": "_from", "type": "address" }, 66 | { "internalType": "address", "name": "_to", "type": "address" }, 67 | { "internalType": "uint256", "name": "_value", "type": "uint256" } 68 | ], 69 | "name": "transferFrom", 70 | "outputs": [{ "internalType": "bool", "name": "success", "type": "bool" }], 71 | "stateMutability": "nonpayable", 72 | "type": "function" 73 | } 74 | ] 75 | -------------------------------------------------------------------------------- /templates/vue/kyber/packages/contracts/src/abis/simpleKyberProxy.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { "internalType": "contract IERC20", "name": "token", "type": "address" }, 5 | { "internalType": "uint256", "name": "minConversionRate", "type": "uint256" } 6 | ], 7 | "name": "swapEtherToToken", 8 | "outputs": [{ "internalType": "uint256", "name": "destAmount", "type": "uint256" }], 9 | "stateMutability": "payable", 10 | "type": "function" 11 | }, 12 | { 13 | "inputs": [ 14 | { "internalType": "contract IERC20", "name": "token", "type": "address" }, 15 | { "internalType": "uint256", "name": "srcAmount", "type": "uint256" }, 16 | { "internalType": "uint256", "name": "minConversionRate", "type": "uint256" } 17 | ], 18 | "name": "swapTokenToEther", 19 | "outputs": [{ "internalType": "uint256", "name": "destAmount", "type": "uint256" }], 20 | "stateMutability": "nonpayable", 21 | "type": "function" 22 | }, 23 | { 24 | "inputs": [ 25 | { "internalType": "contract IERC20", "name": "src", "type": "address" }, 26 | { "internalType": "uint256", "name": "srcAmount", "type": "uint256" }, 27 | { "internalType": "contract IERC20", "name": "dest", "type": "address" }, 28 | { "internalType": "uint256", "name": "minConversionRate", "type": "uint256" } 29 | ], 30 | "name": "swapTokenToToken", 31 | "outputs": [{ "internalType": "uint256", "name": "destAmount", "type": "uint256" }], 32 | "stateMutability": "nonpayable", 33 | "type": "function" 34 | } 35 | ] 36 | -------------------------------------------------------------------------------- /templates/vue/kyber/packages/contracts/src/index.js.ctx: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /templates/vue/kyber/packages/vue-app/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "title": "@kyber-app/react-app" 3 | } 4 | -------------------------------------------------------------------------------- /templates/vue/kyber/packages/vue-app/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "packageName": "@kyber-app/vue-app", 3 | "dependencies": { 4 | "keys": [ 5 | "@kyber-app/contracts" 6 | ], 7 | "values": [ 8 | "^1.0.0" 9 | ] 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /templates/vue/kyber/packages/vue-app/src/components/HelloWorld.vue.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "callToAction": "Read On-Chain Exchange Rate", 3 | "contractCall": [ 4 | "// Should replace with the end-user wallet, e.g. Metamask", 5 | "const defaultProvider = getDefaultProvider();", 6 | "// Create an instance of an ethers.js Contract", 7 | "// Read more about ethers.js on https://docs.ethers.io/v5/api/contract/contract/", 8 | "const kyberNetworkProxy = new Contract(", 9 | " addresses[MAINNET_ID].kyberNetworkProxyV2,", 10 | " abis.kyberNetworkProxyV2,", 11 | " defaultProvider,", 12 | ");", 13 | "// Price of 1 ETH in DAI", 14 | "const exchangeRate = await kyberNetworkProxy.getExpectedRate(", 15 | " \"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\",", 16 | " \"0x6B175474E89094C44Da98b954EedeAC495271d0F\",", 17 | " \"1000000000000000000\",", 18 | ");", 19 | "console.log({ exchangeRate });" 20 | ], 21 | "imports": [ 22 | "import { MAINNET_ID, addresses, abis } from \"@kyber-app/contracts\";", 23 | "import GET_FULL_TRADES from \"../graphql/subgraph\";" 24 | ], 25 | "learn": { 26 | "items": [ 27 | { 28 | "label": "Core Docs", 29 | "url": "https://developer.kyber.network/" 30 | }, 31 | { 32 | "label": "Community Chat", 33 | "url": "https://discord.gg/NfFMVz6" 34 | }, 35 | { 36 | "label": "Reddit Community", 37 | "url": "https://reddit.com/r/kybernetwork/" 38 | }, 39 | { 40 | "label": "Twitter", 41 | "url": "https://twitter.com/kybernetwork" 42 | } 43 | ], 44 | "name": "Kyber" 45 | }, 46 | "subgraphQuery": { 47 | "key": "fullTrades", 48 | "name": "GET_FULL_TRADES" 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /templates/vue/kyber/packages/vue-app/src/graphql/subgraph.js: -------------------------------------------------------------------------------- 1 | import gql from "graphql-tag"; 2 | 3 | // See more example queries on https://thegraph.com/explorer/subgraph/protofire/kyber 4 | const GET_FULL_TRADES = gql` 5 | { 6 | fullTrades(first: 5) { 7 | id 8 | trader { 9 | id 10 | } 11 | src { 12 | id 13 | } 14 | dest { 15 | id 16 | } 17 | } 18 | } 19 | `; 20 | 21 | export default GET_FULL_TRADES; 22 | -------------------------------------------------------------------------------- /templates/vue/kyber/packages/vue-app/src/main.js.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "subgraph": { 3 | "url": "https://api.thegraph.com/explorer/subgraph/protofire/kyber" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /templates/vue/maker/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Maker is the creator of DAI, the world’s first unbiased currency. It be used by anyone, anywhere, anytime. Read more about it in the [official documentation](https://docs.makerdao.com/).", 3 | "packages": [ 4 | "[contracts](/packages/contracts)", 5 | "[vue-app](/packages/vue-app)" 6 | ], 7 | "subgraphName": "Maker Protocol", 8 | "subgraphUrl": "https://thegraph.com/explorer/subgraph/protofire/maker-protocol", 9 | "templateName": "Maker", 10 | "templateUrl": "https://github.com/paulrberg/create-eth-app/tree/develop/templates/vue/maker" 11 | } 12 | -------------------------------------------------------------------------------- /templates/vue/maker/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "orgName": "@maker-app", 3 | "packageName": "@maker-app/monorepo", 4 | "keywords": [ 5 | "dai", 6 | "maker", 7 | "makerdao" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /templates/vue/maker/packages/contracts/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "title": "@maker-app/contracts" 3 | } 4 | -------------------------------------------------------------------------------- /templates/vue/maker/packages/contracts/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "packageName": "@maker-app/contracts" 3 | } 4 | -------------------------------------------------------------------------------- /templates/vue/maker/packages/contracts/src/abis.js: -------------------------------------------------------------------------------- 1 | import cat from "./abis/cat.json"; 2 | import dai from "./abis/dai.json"; 3 | import daiJoin from "./abis/daiJoin.json"; 4 | import dsProxy from "./abis/dsProxy.json"; 5 | import dssCdpManager from "./abis/dssCdpManager.json"; 6 | import dssProxyActions from "./abis/dssProxyActions.json"; 7 | import dssProxyActionsDsr from "./abis/dssProxyActionsDsr.json"; 8 | import erc20 from "./abis/erc20.json"; 9 | import erc20Events from "./abis/erc20Events.json"; 10 | import ethJoin from "./abis/ethJoin.json"; 11 | import jug from "./abis/jug.json"; 12 | import pot from "./abis/pot.json"; 13 | import proxyActions from "./abis/proxyActions.json"; 14 | import proxyRegistry from "./abis/proxyRegistry.json"; 15 | import spotter from "./abis/spotter.json"; 16 | import vat from "./abis/vat.json"; 17 | 18 | export default { 19 | cat, 20 | dai, 21 | daiJoin, 22 | dsProxy, 23 | dssCdpManager, 24 | dssProxyActions, 25 | dssProxyActionsDsr, 26 | erc20, 27 | erc20Events, 28 | ethJoin, 29 | jug, 30 | pot, 31 | proxyActions, 32 | proxyRegistry, 33 | spotter, 34 | vat, 35 | }; 36 | -------------------------------------------------------------------------------- /templates/vue/maker/packages/contracts/src/abis/dssProxyActionsDsr.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "constant": false, 4 | "inputs": [ 5 | { "internalType": "address", "name": "apt", "type": "address" }, 6 | { "internalType": "address", "name": "urn", "type": "address" }, 7 | { "internalType": "uint256", "name": "wad", "type": "uint256" } 8 | ], 9 | "name": "daiJoin_join", 10 | "outputs": [], 11 | "payable": false, 12 | "stateMutability": "nonpayable", 13 | "type": "function" 14 | }, 15 | { 16 | "constant": false, 17 | "inputs": [ 18 | { "internalType": "address", "name": "daiJoin", "type": "address" }, 19 | { "internalType": "address", "name": "pot", "type": "address" }, 20 | { "internalType": "uint256", "name": "wad", "type": "uint256" } 21 | ], 22 | "name": "exit", 23 | "outputs": [], 24 | "payable": false, 25 | "stateMutability": "nonpayable", 26 | "type": "function" 27 | }, 28 | { 29 | "constant": false, 30 | "inputs": [ 31 | { "internalType": "address", "name": "daiJoin", "type": "address" }, 32 | { "internalType": "address", "name": "pot", "type": "address" } 33 | ], 34 | "name": "exitAll", 35 | "outputs": [], 36 | "payable": false, 37 | "stateMutability": "nonpayable", 38 | "type": "function" 39 | }, 40 | { 41 | "constant": false, 42 | "inputs": [ 43 | { "internalType": "address", "name": "daiJoin", "type": "address" }, 44 | { "internalType": "address", "name": "pot", "type": "address" }, 45 | { "internalType": "uint256", "name": "wad", "type": "uint256" } 46 | ], 47 | "name": "join", 48 | "outputs": [], 49 | "payable": false, 50 | "stateMutability": "nonpayable", 51 | "type": "function" 52 | } 53 | ] 54 | -------------------------------------------------------------------------------- /templates/vue/maker/packages/contracts/src/abis/erc20.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "anonymous": false, 4 | "inputs": [ 5 | { "indexed": true, "internalType": "address", "name": "src", "type": "address" }, 6 | { "indexed": true, "internalType": "address", "name": "guy", "type": "address" }, 7 | { "indexed": false, "internalType": "uint256", "name": "wad", "type": "uint256" } 8 | ], 9 | "name": "Approval", 10 | "type": "event" 11 | }, 12 | { 13 | "anonymous": false, 14 | "inputs": [ 15 | { "indexed": true, "internalType": "address", "name": "src", "type": "address" }, 16 | { "indexed": true, "internalType": "address", "name": "dst", "type": "address" }, 17 | { "indexed": false, "internalType": "uint256", "name": "wad", "type": "uint256" } 18 | ], 19 | "name": "Transfer", 20 | "type": "event" 21 | }, 22 | { 23 | "constant": true, 24 | "inputs": [ 25 | { "internalType": "address", "name": "src", "type": "address" }, 26 | { "internalType": "address", "name": "guy", "type": "address" } 27 | ], 28 | "name": "allowance", 29 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 30 | "payable": false, 31 | "stateMutability": "view", 32 | "type": "function" 33 | }, 34 | { 35 | "constant": false, 36 | "inputs": [ 37 | { "internalType": "address", "name": "guy", "type": "address" }, 38 | { "internalType": "uint256", "name": "wad", "type": "uint256" } 39 | ], 40 | "name": "approve", 41 | "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], 42 | "payable": false, 43 | "stateMutability": "nonpayable", 44 | "type": "function" 45 | }, 46 | { 47 | "constant": true, 48 | "inputs": [{ "internalType": "address", "name": "guy", "type": "address" }], 49 | "name": "balanceOf", 50 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 51 | "payable": false, 52 | "stateMutability": "view", 53 | "type": "function" 54 | }, 55 | { 56 | "constant": true, 57 | "inputs": [], 58 | "name": "totalSupply", 59 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 60 | "payable": false, 61 | "stateMutability": "view", 62 | "type": "function" 63 | }, 64 | { 65 | "constant": false, 66 | "inputs": [ 67 | { "internalType": "address", "name": "dst", "type": "address" }, 68 | { "internalType": "uint256", "name": "wad", "type": "uint256" } 69 | ], 70 | "name": "transfer", 71 | "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], 72 | "payable": false, 73 | "stateMutability": "nonpayable", 74 | "type": "function" 75 | }, 76 | { 77 | "constant": false, 78 | "inputs": [ 79 | { "internalType": "address", "name": "src", "type": "address" }, 80 | { "internalType": "address", "name": "dst", "type": "address" }, 81 | { "internalType": "uint256", "name": "wad", "type": "uint256" } 82 | ], 83 | "name": "transferFrom", 84 | "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], 85 | "payable": false, 86 | "stateMutability": "nonpayable", 87 | "type": "function" 88 | } 89 | ] 90 | -------------------------------------------------------------------------------- /templates/vue/maker/packages/contracts/src/abis/erc20Events.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "anonymous": false, 4 | "inputs": [ 5 | { "indexed": true, "internalType": "address", "name": "src", "type": "address" }, 6 | { "indexed": true, "internalType": "address", "name": "guy", "type": "address" }, 7 | { "indexed": false, "internalType": "uint256", "name": "wad", "type": "uint256" } 8 | ], 9 | "name": "Approval", 10 | "type": "event" 11 | }, 12 | { 13 | "anonymous": false, 14 | "inputs": [ 15 | { "indexed": true, "internalType": "address", "name": "src", "type": "address" }, 16 | { "indexed": true, "internalType": "address", "name": "dst", "type": "address" }, 17 | { "indexed": false, "internalType": "uint256", "name": "wad", "type": "uint256" } 18 | ], 19 | "name": "Transfer", 20 | "type": "event" 21 | } 22 | ] 23 | -------------------------------------------------------------------------------- /templates/vue/maker/packages/contracts/src/abis/proxyRegistry.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [{ "internalType": "address", "name": "factory_", "type": "address" }], 4 | "payable": false, 5 | "stateMutability": "nonpayable", 6 | "type": "constructor" 7 | }, 8 | { 9 | "constant": false, 10 | "inputs": [], 11 | "name": "build", 12 | "outputs": [{ "internalType": "address payable", "name": "proxy", "type": "address" }], 13 | "payable": false, 14 | "stateMutability": "nonpayable", 15 | "type": "function" 16 | }, 17 | { 18 | "constant": false, 19 | "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }], 20 | "name": "build", 21 | "outputs": [{ "internalType": "address payable", "name": "proxy", "type": "address" }], 22 | "payable": false, 23 | "stateMutability": "nonpayable", 24 | "type": "function" 25 | }, 26 | { 27 | "constant": true, 28 | "inputs": [{ "internalType": "address", "name": "", "type": "address" }], 29 | "name": "proxies", 30 | "outputs": [{ "internalType": "contract DSProxy", "name": "", "type": "address" }], 31 | "payable": false, 32 | "stateMutability": "view", 33 | "type": "function" 34 | } 35 | ] 36 | -------------------------------------------------------------------------------- /templates/vue/maker/packages/contracts/src/addresses.js: -------------------------------------------------------------------------------- 1 | /** 2 | * See all ids below 3 | * https://ethereum.stackexchange.com/questions/17051/how-to-select-a-network-id-or-is-there-a-list-of-network-ids 4 | */ 5 | export const KOVAN_ID = 42; 6 | export const MAINNET_ID = 1; 7 | 8 | /** 9 | * Please note that these are the contract addresses for v1.0.8, which may not be the most up-to-date. 10 | * https://changelog.makerdao.com/ 11 | */ 12 | export default { 13 | [KOVAN_ID]: { 14 | cat: "0x0511674A67192FE51e86fE55Ed660eB4f995BDd6", 15 | cdpManager: "0x1476483dD8C35F25e568113C5f70249D3976ba21", 16 | dsrManager: "0x7f5d60432DE4840a3E7AE7218f7D6b7A2412683a", 17 | getCdps: "0x592301a23d37c591C5856f28726AF820AF8e7014", 18 | joinDai: "0x5AA71a3ae1C0bd6ac27A1f28e1415fFFB6F15B8c", 19 | jug: "0xcbB7718c9F39d05aEEDE1c472ca8Bf804b2f1EaD", 20 | pot: "0xEA190DBDC7adF265260ec4dA6e9675Fd4f5A78bb", 21 | proxyActions: "0xd1D24637b9109B7f61459176EdcfF9Be56283a7B", 22 | proxyActionsDsr: "0xc5CC1Dfb64A62B9C7Bb6Cbf53C2A579E2856bf92", 23 | proxyFactory: "0xe11E3b391F7E8bC47247866aF32AF67Dd58Dc800", 24 | proxyRegistry: "0x64A436ae831C1672AE81F674CAb8B6775df3475C", 25 | spot: "0x3a042de6413eDB15F2784f2f97cC68C7E9750b2D", 26 | tokens: { 27 | BAT: "0x9f8cFB61D3B2aF62864408DD703F9C3BEB55dff7", 28 | DAI: "0x4F96Fe3b7A6Cf9725f59d353F723c1bDb64CA6Aa", 29 | TUSD: "0x0000000000085d4780B73119b644AE5ecd22b376", 30 | USDC: "0xBD84be3C303f6821ab297b840a99Bd0d4c4da6b5", 31 | WBTC: "0x7419f744bBF35956020C1687fF68911cD777f865", 32 | WETH: "0xd0A1E359811322d97991E03f863a0C30C2cF029C", 33 | }, 34 | vat: "0xbA987bDB501d131f766fEe8180Da5d81b34b69d9", 35 | vow: "0x0F4Cbe6CBA918b7488C26E29d9ECd7368F38EA3b", 36 | }, 37 | [MAINNET_ID]: { 38 | cat: "0x78F2c2AF65126834c51822F56Be0d7469D7A523E", 39 | cdpManager: "0x5ef30b9986345249bc32d8928B7ee64DE9435E39", 40 | dsrManager: "0x373238337Bfe1146fb49989fc222523f83081dDb", 41 | getCdps: "0x36a724Bd100c39f0Ea4D3A20F7097eE01A8Ff573", 42 | joinDai: "0x9759A6Ac90977b93B58547b4A71c78317f391A28", 43 | jug: "0x19c0976f590D67707E62397C87829d896Dc0f1F1", 44 | pot: "0x197E90f9FAD81970bA7976f33CbD77088E5D7cf7", 45 | proxyActions: "0x82ecD135Dce65Fbc6DbdD0e4237E0AF93FFD5038", 46 | proxyActionDsr: "0x07ee93aEEa0a36FfF2A9B95dd22Bd6049EE54f26", 47 | proxyFactory: "0xA26e15C895EFc0616177B7c1e7270A4C7D51C997", 48 | proxyRegistry: "0x4678f0a6958e4D2Bc4F1BAF7Bc52E8F3564f3fE4", 49 | spot: "0x65C79fcB50Ca1594B025960e539eD7A9a6D434A3", 50 | tokens: { 51 | BAT: "0x0D8775F648430679A709E98d2b0Cb6250d2887EF", 52 | DAI: "0x6B175474E89094C44Da98b954EedeAC495271d0F", 53 | TUSD: "0xD6CE59F06Ff2070Dd5DcAd0866A7D8cd9270041a", 54 | USDC: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", 55 | WBTC: "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599", 56 | WETH: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", 57 | }, 58 | vat: "0x35D1b3F3D7966A1DFe207aa4514C12a259A0492B", 59 | vow: "0xA950524441892A31ebddF91d3cEEFa04Bf454466", 60 | }, 61 | }; 62 | -------------------------------------------------------------------------------- /templates/vue/maker/packages/contracts/src/index.js.ctx: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /templates/vue/maker/packages/vue-app/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "title": "@maker-app/vue-app" 3 | } 4 | -------------------------------------------------------------------------------- /templates/vue/maker/packages/vue-app/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "packageName": "@maker-app/vue-app", 3 | "dependencies": { 4 | "keys": [ 5 | "@makerdao/dai", 6 | "@makerdao/dai-plugin-mcd", 7 | "@maker-app/contracts" 8 | ], 9 | "values": [ 10 | "^0.31.7", 11 | "^1.5.13-rc.1", 12 | "^1.0.0" 13 | ] 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /templates/vue/maker/packages/vue-app/src/components/HelloWorld.vue.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "callToAction": "Read On-Chain Collateral Information", 3 | "contractCall": [ 4 | "// Should replace with the end-user wallet, e.g. Metamask", 5 | "const defaultProvider = getDefaultProvider();", 6 | "// Create an instance of an ethers.js Contract", 7 | "// Read more about ethers.js on https://docs.ethers.io/v5/api/contract/contract/", 8 | "const vatContract = new Contract(addresses[MAINNET_ID].vat, abis.vat, defaultProvider);", 9 | "// Ilk = Collateral in Maker jargon. The code below pulls data for the ETH collateral.", 10 | "// Refer to the glossary for more information: https://docs.makerdao.com/other-documentation/system-glossary", 11 | "const ilk = await vatContract.ilks(\"0x4554482d41000000000000000000000000000000000000000000000000000000\")", 12 | "console.log({ ilk });" 13 | ], 14 | "imports": [ 15 | "import { MAINNET_ID, addresses, abis } from \"@maker-app/contracts\";", 16 | "import GET_COLLATERAL_TYPES from \"../graphql/subgraph\";" 17 | ], 18 | "learn": { 19 | "items": [ 20 | { 21 | "label": "Core Docs", 22 | "url": "https://docs.makerdao.com/" 23 | }, 24 | { 25 | "label": "Community Chat", 26 | "url": "https://chat.makerdao.com/" 27 | }, 28 | { 29 | "label": "Reddit Community", 30 | "url": "https://reddit.com/r/makerdao/" 31 | }, 32 | { 33 | "label": "Twitter", 34 | "url": "https://twitter.com/makerdao/" 35 | } 36 | ], 37 | "name": "Maker" 38 | }, 39 | "subgraphQuery": { 40 | "key": "collateralTypes", 41 | "name": "GET_COLLATERAL_TYPES" 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /templates/vue/maker/packages/vue-app/src/graphql/subgraph.js: -------------------------------------------------------------------------------- 1 | import gql from "graphql-tag"; 2 | 3 | // See more example queries on https://thegraph.com/explorer/subgraph/protofire/maker-protocol 4 | const GET_COLLATERAL_TYPES = gql` 5 | { 6 | collateralTypes(orderBy: addedAt) { 7 | name: id 8 | price { 9 | block 10 | value 11 | } 12 | debtCeiling 13 | totalDebt 14 | liquidationLotSize 15 | liquidationPenalty 16 | liquidationRatio 17 | stabilityFee 18 | auctionCount 19 | vaultCount 20 | } 21 | } 22 | `; 23 | 24 | export default GET_COLLATERAL_TYPES; 25 | -------------------------------------------------------------------------------- /templates/vue/maker/packages/vue-app/src/main.js.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "subgraph": { 3 | "url": "https://api.thegraph.com/subgraphs/name/protofire/maker-protocol" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /templates/vue/mstable/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "description": "mStable provides autonomous and non-custodial stablecoin infrastructure. Read more about it in the [official documentation](https://docs.mstable.org/", 3 | "packages": [ 4 | "[contracts](/packages/contracts)", 5 | "[vue-app](/packages/vue-app)" 6 | ], 7 | "subgraphName": "mstable-protocol", 8 | "subgraphUrl": "https://thegraph.com/explorer/subgraph/mstable/mstable-protocol", 9 | "templateName": "mStable", 10 | "templateUrl": "https://github.com/paulrberg/create-eth-app/tree/develop/templates/vue/mstable" 11 | } 12 | -------------------------------------------------------------------------------- /templates/vue/mstable/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "orgName": "@mstable-app", 3 | "packageName": "@mstable-app/monorepo", 4 | "keywords": [ 5 | "mstable" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /templates/vue/mstable/packages/contracts/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "title": "@mstable-app/contracts" 3 | } 4 | -------------------------------------------------------------------------------- /templates/vue/mstable/packages/contracts/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "packageName": "@mstable-app/contracts" 3 | } 4 | -------------------------------------------------------------------------------- /templates/vue/mstable/packages/contracts/src/abis.js: -------------------------------------------------------------------------------- 1 | import mAsset from "./abis/mAsset.json"; 2 | import metaToken from "./abis/metaToken.json"; 3 | import nexus from "./abis/nexus.json"; 4 | import savingsContract from "./abis/savingsContract.json"; 5 | import savingsManager from "./abis/savingsManager.json"; 6 | 7 | export default { 8 | mAsset, 9 | metaToken, 10 | nexus, 11 | savingsContract, 12 | savingsManager, 13 | }; 14 | -------------------------------------------------------------------------------- /templates/vue/mstable/packages/contracts/src/addresses.js: -------------------------------------------------------------------------------- 1 | /** 2 | * See all ids below 3 | * https://ethereum.stackexchange.com/questions/17051/how-to-select-a-network-id-or-is-there-a-list-of-network-ids 4 | */ 5 | export const MAINNET_ID = 1; 6 | 7 | /** 8 | * Refer to https://docs.mstable.org/ for the most up-to-date addresses. 9 | */ 10 | export default { 11 | [MAINNET_ID]: { 12 | nexus: "0xAFcE80b19A8cE13DEc0739a1aaB7A028d6845Eb3", 13 | savingsContract: "0xcf3F73290803Fc04425BEE135a4Caeb2BaB2C2A1", 14 | savingsManager: "0x7046b0BfC4C5EEB90559C0805DD9c1A6f4815370", 15 | tokens: { 16 | MTA: "0xa3BeD4E1c75D00fa6f4E5E6922DB7261B5E9AcD2", 17 | mUSD: "0xe2f2a5C287993345a840Db3B0845fbC70f5935a5", 18 | }, 19 | }, 20 | }; 21 | -------------------------------------------------------------------------------- /templates/vue/mstable/packages/contracts/src/index.js.ctx: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /templates/vue/mstable/packages/vue-app/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "title": "@mstable-app/vue-app" 3 | } 4 | -------------------------------------------------------------------------------- /templates/vue/mstable/packages/vue-app/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "packageName": "@mstable-app/vue-app", 3 | "dependencies": { 4 | "keys": [ 5 | "@mstable/protocol", 6 | "@mstable/mstable-js" 7 | ], 8 | "values": [ 9 | "^1.3.0", 10 | "^0.1.0-alpha" 11 | ] 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /templates/vue/mstable/packages/vue-app/src/components/HelloWorld.vue.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "callToAction": "Read On-Chain mAssets", 3 | "contractCall": [ 4 | "// Should replace with the end-user wallet, e.g. Metamask", 5 | "const defaultProvider = getDefaultProvider();", 6 | "// Create an instance of an ethers.js Contract", 7 | "// Read more about ethers.js on https://docs.ethers.io/v5/api/contract/contract/", 8 | "const mUsdContract = new Contract(addresses[MAINNET_ID].tokens.mUSD, abis.mAsset, defaultProvider);", 9 | "// Total supply of mUSD", 10 | "const mUsdTotalSupply = await mUsdContract.totalSupply();", 11 | "console.log({ mUsdTotalSupply });" 12 | ], 13 | "imports": [ 14 | "import { MAINNET_ID, addresses, abis } from \"@mstable-app/contracts\";", 15 | "import GET_MASSETS from \"../graphql/subgraph\";" 16 | ], 17 | "learn": { 18 | "items": [ 19 | { 20 | "label": "Core Docs", 21 | "url": "https://docs.mstable.org/" 22 | }, 23 | { 24 | "label": "Community Chat", 25 | "url": "https://discord.gg/pgCVG7e/" 26 | }, 27 | { 28 | "label": "Twitter", 29 | "url": "https://twitter.com/mstable_" 30 | } 31 | ], 32 | "name": "mStable" 33 | }, 34 | "subgraphQuery": { 35 | "key": "massets", 36 | "name": "GET_MASSETS" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /templates/vue/mstable/packages/vue-app/src/graphql/subgraph.js: -------------------------------------------------------------------------------- 1 | import gql from "graphql-tag"; 2 | 3 | // See more example queries on https://thegraph.com/explorer/subgraph/mstable/mstable-protocol 4 | const GET_MASSETS = gql` 5 | { 6 | massets(first: 5) { 7 | id 8 | feeRate 9 | token { 10 | id 11 | decimals 12 | name 13 | symbol 14 | totalSupply { 15 | exact 16 | } 17 | } 18 | } 19 | } 20 | `; 21 | 22 | export default GET_MASSETS; 23 | -------------------------------------------------------------------------------- /templates/vue/mstable/packages/vue-app/src/main.js.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "subgraph": { 3 | "url": "https://api.thegraph.com/subgraphs/name/mstable/mstable-protocol" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /templates/vue/sablier-v1/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Sablier is the protocol for real-time finance on the Ethereum blockchain. Just like you can stream movies on Netflix or music on Spotify, so you can stream money on Sablier. Read more about it in the [official documentation](https://docs.sablier.com/).", 3 | "packages": [ 4 | "[contracts](/packages/contracts)", 5 | "[vue-app](/packages/vue-app)" 6 | ], 7 | "subgraphName": "Sablier v1", 8 | "subgraphUrl": "https://thegraph.com/explorer/subgraph/sablier-labs/sablier", 9 | "templateName": "Sablier v1", 10 | "templateUrl": "https://github.com/paulrberg/create-eth-app/tree/develop/templates/vue/sablier-v1" 11 | } 12 | -------------------------------------------------------------------------------- /templates/vue/sablier-v1/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "orgName": "@sablier-v1-app", 3 | "packageName": "@sablier-v1-app/monorepo", 4 | "keywords": [ 5 | "sablier" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /templates/vue/sablier-v1/packages/contracts/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "title": "@sablier-v1-app/contracts" 3 | } 4 | -------------------------------------------------------------------------------- /templates/vue/sablier-v1/packages/contracts/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "packageName": "@sablier-v1-app/contracts" 3 | } 4 | -------------------------------------------------------------------------------- /templates/vue/sablier-v1/packages/contracts/src/abis.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WalletConnect/create-eth-app/eb9bdfea6d372f34053c6106c7733cd43df6e0e4/templates/vue/sablier-v1/packages/contracts/src/abis.js -------------------------------------------------------------------------------- /templates/vue/sablier-v1/packages/contracts/src/addresses.js: -------------------------------------------------------------------------------- 1 | /** 2 | * See all ids below 3 | * https://ethereum.stackexchange.com/questions/17051/how-to-select-a-network-id-or-is-there-a-list-of-network-ids 4 | */ 5 | export const GOERLI_ID = 5; 6 | export const KOVAN_ID = 42; 7 | export const MAINNET_ID = 1; 8 | export const RINKEBY_ID = 4; 9 | export const ROPSTEN_ID = 3; 10 | 11 | const commonContracts = { 12 | payroll: "0x7ee114C3628Ca90119fC699f03665bF9dB8f5faF", 13 | sablier: "0xc04Ad234E01327b24a831e3718DBFcbE245904CC", 14 | }; 15 | 16 | export default { 17 | [GOERLI_ID]: commonContracts, 18 | [KOVAN_ID]: commonContracts, 19 | [MAINNET_ID]: { 20 | payroll: "0xbd6a40Bb904aEa5a49c59050B5395f7484A4203d", 21 | sablier: "0xA4fc358455Febe425536fd1878bE67FfDBDEC59a", 22 | }, 23 | [RINKEBY_ID]: commonContracts, 24 | [ROPSTEN_ID]: commonContracts, 25 | }; 26 | -------------------------------------------------------------------------------- /templates/vue/sablier-v1/packages/contracts/src/index.js.ctx: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /templates/vue/sablier-v1/packages/vue-app/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "title": "@sablier-v1-app/vue-app" 3 | } 4 | -------------------------------------------------------------------------------- /templates/vue/sablier-v1/packages/vue-app/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "packageName": "@sablier-v1-app/vue-app", 3 | "dependencies": { 4 | "keys": [ 5 | "@sablier-v1-app/contracts" 6 | ], 7 | "values": [ 8 | "^1.0.0" 9 | ] 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /templates/vue/sablier-v1/packages/vue-app/src/components/HelloWorld.vue.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "callToAction": "Read On-Chain Data", 3 | "contractCall": [ 4 | "// Should replace with the end-user wallet, e.g. Metamask", 5 | "const defaultProvider = getDefaultProvider();", 6 | "// Create an instance of an ethers.js Contract", 7 | "// Read more about ethers.js on https://docs.ethers.io/v5/api/contract/contract/", 8 | "const sablierContract = new Contract(addresses[MAINNET_ID].sablier, abis.sablier, defaultProvider);", 9 | "const nextStreamId = await sablierContract.nextStreamId();", 10 | "console.log({ nextStreamId: nextStreamId.toString() });" 11 | ], 12 | "imports": [ 13 | "import { MAINNET_ID, addresses, abis } from \"@sablier-v1-app/contracts\";", 14 | "import GET_STREAMS from \"../graphql/subgraph\";" 15 | ], 16 | "learn": { 17 | "items": [ 18 | { 19 | "label": "Core Docs", 20 | "url": "https://docs.sablier.com/" 21 | }, 22 | { 23 | "label": "Community Chat", 24 | "url": "https://discord.gg/KXajCXC/" 25 | }, 26 | { 27 | "label": "Twitter", 28 | "url": "https://twitter.com/sablier-labs/" 29 | } 30 | ], 31 | "name": "Sablier v1" 32 | }, 33 | "subgraphQuery": { 34 | "key": "streams", 35 | "name": "GET_STREAMS" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /templates/vue/sablier-v1/packages/vue-app/src/graphql/subgraph.js: -------------------------------------------------------------------------------- 1 | import gql from "graphql-tag"; 2 | 3 | // See more example queries on https://thegraph.com/explorer/subgraph/sablier-labs/sablier 4 | const GET_STREAMS = gql` 5 | { 6 | streams(first: 10, orderBy: timestamp, orderDirection: desc) { 7 | id 8 | cancellation { 9 | recipientBalance 10 | timestamp 11 | txhash 12 | } 13 | deposit 14 | ratePerSecond 15 | recipient 16 | sender 17 | startTime 18 | stopTime 19 | timestamp 20 | token { 21 | id 22 | decimals 23 | name 24 | symbol 25 | } 26 | txs { 27 | id 28 | block 29 | event 30 | from 31 | timestamp 32 | to 33 | } 34 | withdrawals { 35 | id 36 | amount 37 | } 38 | } 39 | } 40 | `; 41 | 42 | export default GET_STREAMS; 43 | -------------------------------------------------------------------------------- /templates/vue/sablier-v1/packages/vue-app/src/main.js.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "subgraph": { 3 | "url": "https://api.thegraph.com/subgraphs/name/sablier-labs/sablier" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /templates/vue/synthetix/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Synthetix is a protocol for trading synthetic assets on Ethereum. It gives traders on -chain exposure to any asset. Read more about it in the [official documentation](https://docs.synthetix.io/).", 3 | "packages": [ 4 | "[contracts](/packages/contracts)", 5 | "[vue-app](/packages/vue-app)" 6 | ], 7 | "subgraphName": "Synthetix", 8 | "subgraphUrl": "https://thegraph.com/explorer/subgraph/synthetixio-team/synthetix", 9 | "templateName": "Synthetix", 10 | "templateUrl": "https://github.com/paulrberg/create-eth-app/tree/develop/templates/vue/synthetix" 11 | } 12 | -------------------------------------------------------------------------------- /templates/vue/synthetix/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "orgName": "@synthetix-app", 3 | "packageName": "@synthetix-app/monorepo", 4 | "keywords": [ 5 | "snx", 6 | "synthetix" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /templates/vue/synthetix/packages/contracts/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "title": "@synthetix-app/contracts" 3 | } 4 | -------------------------------------------------------------------------------- /templates/vue/synthetix/packages/contracts/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "packageName": "@synthetix-app/contracts" 3 | } 4 | -------------------------------------------------------------------------------- /templates/vue/synthetix/packages/contracts/src/abis.js: -------------------------------------------------------------------------------- 1 | import readProxy from "./abis/readProxy.json"; 2 | import SNX from "./abis/snx.json"; 3 | 4 | export default { 5 | readProxy, 6 | tokens: { 7 | SNX, 8 | }, 9 | }; 10 | -------------------------------------------------------------------------------- /templates/vue/synthetix/packages/contracts/src/addresses.js: -------------------------------------------------------------------------------- 1 | /** 2 | * See all ids below 3 | * https://ethereum.stackexchange.com/questions/17051/how-to-select-a-network-id-or-is-there-a-list-of-network-ids 4 | */ 5 | export const KOVAN_ID = 42; 6 | export const MAINNET_ID = 1; 7 | 8 | /** 9 | * Please note that these may not be the most up-to-date addresses for the Synthetix contracts. 10 | * https://docs.synthetix.io/addresses/ 11 | */ 12 | export default { 13 | [KOVAN_ID]: { 14 | addressResolver: "0x242a3DF52c375bEe81b1c668741D7c63aF68FDD2", 15 | systemStatus: "0x5b01D9f87080CABcA881A0Cf4e45C0E2ccB7Edde", 16 | tokens: { 17 | SNX: "0x22f1ba6dB6ca0A065e1b7EAe6FC22b7E675310EF", 18 | }, 19 | tokenStates: { 20 | SNX: "0x46824bFAaFd049fB0Af9a45159A88e595Bbbb9f7", 21 | }, 22 | }, 23 | [MAINNET_ID]: { 24 | readProxyAddressResolver: "0x4E3b31eB0E5CB73641EE1E65E7dCEFe520bA3ef2", 25 | tokens: { 26 | SNX: "0xC011a73ee8576Fb46F5E1c5751cA3B9Fe0af2a6F", 27 | }, 28 | tokenStates: { 29 | SNX: "0x5b1b5fEa1b99D83aD479dF0C222F0492385381dD", 30 | }, 31 | }, 32 | }; 33 | -------------------------------------------------------------------------------- /templates/vue/synthetix/packages/contracts/src/index.js.ctx: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /templates/vue/synthetix/packages/vue-app/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "title": "@synthetix-app/vue-app" 3 | } 4 | -------------------------------------------------------------------------------- /templates/vue/synthetix/packages/vue-app/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "packageName": "@synthetix-app/vue-app", 3 | "dependencies": { 4 | "keys": [ 5 | "@synthetix-app/contracts", 6 | "synthetix-data", 7 | "synthetix-js" 8 | ], 9 | "values": [ 10 | "^1.0.0", 11 | "^2.1.19", 12 | "^2.25.0-alpha" 13 | ] 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /templates/vue/synthetix/packages/vue-app/src/components/HelloWorld.vue.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "callToAction": "Read On-Chain Balance", 3 | "contractCall": [ 4 | "/*** 1st method: get snx price with synthetix-js ***/", 5 | "", 6 | "// NOTE a lot of the calls need to be formatted. You can reference the many formatting examples in the dashboard repo", 7 | "// https://github.com/Synthetixio/synthetix-dashboard", 8 | "const snxjs = new SynthetixJs();", 9 | "const toUtf8Bytes = SynthetixJs.utils.formatBytes32String;", 10 | "", 11 | "// NOTE you can access any Synthetix contract via snxjs[contract][method]", 12 | "const unformattedSnxPrice = await snxjs.ExchangeRates.rateForCurrency(toUtf8Bytes(\"SNX\"));", 13 | "const snxPrice = Number(snxjs.utils.formatEther(unformattedSnxPrice));", 14 | "console.log({ snxPrice });", 15 | "", 16 | "/*** 2nd method: get snx balance with ethers.js ***/", 17 | "// Should replace with the end-user wallet, e.g. Metamask", 18 | "const defaultProvider = getDefaultProvider();", 19 | "// Create an instance of an ethers.js Contract", 20 | "// Read more about ethers.js on https://docs.ethers.io/v5/api/contract/contract/", 21 | "const snxContract = new Contract(addresses[MAINNET_ID].tokens.SNX, abis.tokens.SNX, defaultProvider);", 22 | "// A pre-defined address that owns some SNX tokens", 23 | "const snxBalance = await snxContract.balanceOf(\"0x49BE88F0fcC3A8393a59d3688480d7D253C37D2A\");", 24 | "console.log({ snxBalance: snxBalance.toString() });" 25 | ], 26 | "imports": [ 27 | "import { MAINNET_ID, addresses, abis } from \"@synthetix-app/contracts\";", 28 | "import { SynthetixJs } from \"synthetix-js\";", 29 | "import GET_SYNTH_HOLDERS from \"../graphql/subgraph\";" 30 | ], 31 | "learn": { 32 | "items": [ 33 | { 34 | "label": "Core Docs", 35 | "url": "https://docs.synthetix.io/" 36 | }, 37 | { 38 | "label": "Community Chat", 39 | "url": "https://discordapp.com/invite/AEdUHzt" 40 | }, 41 | { 42 | "label": "Reddit Community", 43 | "url": "https://reddit.com/r/synthetix_io" 44 | }, 45 | { 46 | "label": "Twitter", 47 | "url": "https://twitter.com/synthetix_io" 48 | } 49 | ], 50 | "name": "Synthetix" 51 | }, 52 | "subgraphQuery": { 53 | "key": "synthHolders", 54 | "name": "GET_SYNTH_HOLDERS" 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /templates/vue/synthetix/packages/vue-app/src/graphql/subgraph.js: -------------------------------------------------------------------------------- 1 | import gql from "graphql-tag"; 2 | 3 | // See more example queries on https://thegraph.com/explorer/subgraph/synthetixio-team/synthetix 4 | const GET_SYNTH_HOLDERS = gql` 5 | { 6 | synthHolders(first: 10) { 7 | id 8 | balanceOf 9 | synth 10 | } 11 | } 12 | `; 13 | 14 | export default GET_SYNTH_HOLDERS; 15 | -------------------------------------------------------------------------------- /templates/vue/synthetix/packages/vue-app/src/main.js.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "subgraph": { 3 | "url": "https://api.thegraph.com/subgraphs/name/synthetixio-team/synthetix" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /templates/vue/uniswap-v2/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Uniswap V2 is the second iteration of the Uniswap, a protocol for automated token exchange on Ethereum. Read more about it in the [official documentation](https://uniswap.org/docs/v2/).", 3 | "packages": [ 4 | "[contracts](/packages/contracts)", 5 | "[vue-app](/packages/vue-app)" 6 | ], 7 | "subgraphName": "Uniswap v2", 8 | "subgraphUrl": "https://thegraph.com/explorer/subgraph/uniswap/uniswap-v2", 9 | "templateName": "Uniswap v2", 10 | "templateUrl": "https://github.com/paulrberg/create-eth-app/tree/develop/templates/vue/uniswap-v2" 11 | } 12 | -------------------------------------------------------------------------------- /templates/vue/uniswap-v2/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "orgName": "@uniswap-v2-app", 3 | "packageName": "@uniswap-v2-app/monorepo", 4 | "keywords": [ 5 | "uniswap" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /templates/vue/uniswap-v2/packages/contracts/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "title": "@uniswap-v2-app/contracts" 3 | } 4 | -------------------------------------------------------------------------------- /templates/vue/uniswap-v2/packages/contracts/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "packageName": "@uniswap-v2-app/contracts" 3 | } 4 | -------------------------------------------------------------------------------- /templates/vue/uniswap-v2/packages/contracts/src/abis.js: -------------------------------------------------------------------------------- 1 | import erc20 from "./abis/erc20.json"; 2 | import factory from "./abis/factory.json"; 3 | import pair from "./abis/pair.json"; 4 | import router01 from "./abis/router01.json"; 5 | import router02 from "./abis/router02.json"; 6 | 7 | export default { 8 | erc20, 9 | factory, 10 | pair, 11 | router01, 12 | router02, 13 | }; 14 | -------------------------------------------------------------------------------- /templates/vue/uniswap-v2/packages/contracts/src/index.js.ctx: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /templates/vue/uniswap-v2/packages/vue-app/README.md.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "title": "@uniswap-v2-app/vue-app" 3 | } 4 | -------------------------------------------------------------------------------- /templates/vue/uniswap-v2/packages/vue-app/package.json.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "packageName": "@uniswap-v2-app/vue-app", 3 | "dependencies": { 4 | "keys": [ 5 | "@uniswap/sdk", 6 | "@uniswap/v2-core", 7 | "@uniswap/v2-periphery", 8 | "@uniswap-v2-app/contracts" 9 | ], 10 | "values": [ 11 | "^3.0.2", 12 | "^1.0.1", 13 | "^1.1.0-beta.0", 14 | "^1.0.0" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /templates/vue/uniswap-v2/packages/vue-app/src/components/HelloWorld.vue.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "callToAction": "Read On-Chain Reserves", 3 | "contractCall": [ 4 | "// Should replace with the end-user wallet, e.g. Metamask", 5 | "const defaultProvider = getDefaultProvider();", 6 | "// Create an instance of an ethers.js Contract", 7 | "// Read more about ethers.js on https://docs.ethers.io/v5/api/contract/contract/", 8 | "const daiWethExchangeContract = new Contract(addresses[MAINNET_ID].pairs[\"DAI-WETH\"], abis.pair, defaultProvider);", 9 | "// Reserves held in the DAI-WETH pair contract", 10 | "const reserves = await daiWethExchangeContract.getReserves();", 11 | "console.log({ reserves });" 12 | ], 13 | "imports": [ 14 | "import { MAINNET_ID, addresses, abis } from \"@uniswap-v2-app/contracts\";", 15 | "import GET_AGGREGATED_UNISWAP_DATA from \"../graphql/subgraph\";" 16 | ], 17 | "learn": { 18 | "items": [ 19 | { 20 | "label": "Core Docs", 21 | "url": "https://uniswap.org/docs/v2/" 22 | }, 23 | { 24 | "label": "Community Chat", 25 | "url": "https://discord.gg/EwFs3Pp" 26 | }, 27 | { 28 | "label": "Twitter", 29 | "url": "https://twitter.com/uniswap" 30 | } 31 | ], 32 | "name": "Uniswap v2" 33 | }, 34 | "subgraphQuery": { 35 | "key": "uniswapFactories", 36 | "name": "GET_AGGREGATED_UNISWAP_DATA" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /templates/vue/uniswap-v2/packages/vue-app/src/graphql/subgraph.js: -------------------------------------------------------------------------------- 1 | import gql from "graphql-tag"; 2 | 3 | // See more example queries on https://thegraph.com/explorer/subgraph/uniswap/uniswap-v2 4 | const GET_AGGREGATED_UNISWAP_DATA = gql` 5 | { 6 | uniswapFactories(first: 1) { 7 | pairCount 8 | totalVolumeUSD 9 | totalLiquidityUSD 10 | } 11 | } 12 | `; 13 | 14 | export default GET_AGGREGATED_UNISWAP_DATA; 15 | -------------------------------------------------------------------------------- /templates/vue/uniswap-v2/packages/vue-app/src/main.js.ctx: -------------------------------------------------------------------------------- 1 | { 2 | "subgraph": { 3 | "url": "https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v2" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /test/__mocks__/url-exist.ts: -------------------------------------------------------------------------------- 1 | import { request } from "@octokit/request"; 2 | 3 | // Set this env variable when you hit the API rate limit while testing. 4 | const githubOAuthToken: string = process.env.GH_OAUTH_TOKEN || ""; 5 | if (!githubOAuthToken) { 6 | throw new Error("Please set GH_OAUTH_TOKEN as an environment variable"); 7 | } 8 | 9 | async function stubbedUrlExist(urlToCheck: string): Promise { 10 | try { 11 | const result = await request({ 12 | headers: { 13 | authorization: "token " + githubOAuthToken, 14 | }, 15 | method: "HEAD", 16 | url: urlToCheck, 17 | }); 18 | return result.status === 200; 19 | } catch (error) { 20 | return false; 21 | } 22 | } 23 | 24 | export default stubbedUrlExist; 25 | -------------------------------------------------------------------------------- /test/__mocks__/validate-npm-package-name.ts: -------------------------------------------------------------------------------- 1 | function validateNpmPackageName(projectName: string): { 2 | errors?: string[] | null; 3 | validForNewPackages: boolean; 4 | warnings?: string[] | null; 5 | } { 6 | if (projectName === "my-eth-app") { 7 | return { 8 | errors: [], 9 | validForNewPackages: true, 10 | warnings: [], 11 | }; 12 | } else if (projectName === "error-triggering-name") { 13 | return { 14 | errors: ["Error"], 15 | validForNewPackages: false, 16 | warnings: [], 17 | }; 18 | } else if (projectName === "warning-triggering-name") { 19 | return { 20 | errors: [], 21 | validForNewPackages: false, 22 | warnings: ["Warning"], 23 | }; 24 | } else { 25 | return { 26 | errors: [], 27 | validForNewPackages: false, 28 | warnings: [], 29 | }; 30 | } 31 | } 32 | 33 | export default validateNpmPackageName; 34 | -------------------------------------------------------------------------------- /test/unit/npm.test.ts: -------------------------------------------------------------------------------- 1 | import { validatePkgName } from "../../src/helpers/npm"; 2 | 3 | describe("npm", function () { 4 | describe("when the package name is valid", function () { 5 | test("it works", function () { 6 | const validation: { problems?: string[]; valid: boolean } = validatePkgName("my-eth-app"); 7 | expect(validation.problems).toEqual(undefined); 8 | expect(validation.valid).toBe(true); 9 | }); 10 | }); 11 | 12 | describe("when the package name is not valid", function () { 13 | describe("when there is an error", function () { 14 | test("it returns a problems arrays", function () { 15 | const validation: { problems?: string[]; valid: boolean } = validatePkgName("error-triggering-name"); 16 | expect(validation.problems).toEqual(["Error"]); 17 | expect(validation.valid).toBe(false); 18 | }); 19 | }); 20 | 21 | describe("when there is a warning", function () { 22 | test("it returns a problems arrays", function () { 23 | const validation: { problems?: string[]; valid: boolean } = validatePkgName("warning-triggering-name"); 24 | expect(validation.problems).toEqual(["Warning"]); 25 | expect(validation.valid).toBe(false); 26 | }); 27 | }); 28 | }); 29 | }); 30 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "esModuleInterop": true, 4 | "forceConsistentCasingInFileNames": true, 5 | "lib": ["es6"], 6 | "module": "commonjs", 7 | "moduleResolution": "node", 8 | "noImplicitAny": true, 9 | "outDir": "dist", 10 | "removeComments": true, 11 | "resolveJsonModule": true, 12 | "skipLibCheck": false, 13 | "sourceMap": true, 14 | "strict": true, 15 | "target": "es6" 16 | }, 17 | "exclude": ["dist", "lib", "node_modules", "templates"], 18 | "ts-node": { 19 | "files": true 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /types/promisepipe.d.ts: -------------------------------------------------------------------------------- 1 | declare module "promisepipe"; 2 | -------------------------------------------------------------------------------- /types/validateNpmPackageName.d.ts: -------------------------------------------------------------------------------- 1 | declare module "validate-npm-package-name" { 2 | function validateNpmPackageName(projectName: string): { 3 | errors?: string[] | null; 4 | validForNewPackages: boolean; 5 | validForOldPackages: boolean; 6 | warnings?: string[] | null; 7 | }; 8 | 9 | export default validateNpmPackageName; 10 | } 11 | --------------------------------------------------------------------------------