Skip to content

Commit

Permalink
feat: Fly ERC20
Browse files Browse the repository at this point in the history
  • Loading branch information
veeso committed Jan 13, 2024
1 parent 83d74cb commit f64df9e
Show file tree
Hide file tree
Showing 43 changed files with 9,909 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ethereum/fly/.env.github
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ETHEREUM_API_URL=http://localhost/
GOERLI_API_URL=http://localhost/
PROD_PRIVATE_KEY="0000000000000000000000000000000000000000000000000000000000000000"
DEV_PRIVATE_KEY="0000000000000000000000000000000000000000000000000000000000000000"
LOCAL_PRIVATE_KEY="ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
OWNER_ADDRESS="0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
23 changes: 23 additions & 0 deletions ethereum/fly/.github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: build-test
on: [push, pull_request]

jobs:
tests:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Install packages
uses: actions/setup-node@v3
with:
node-version: "20.x"
- run: yarn --ignore-scripts
shell: bash
- name: Create local node and deploy
run: |
cp .env.github .env &&
yarn hardhat node &
sleep 2 &&
yarn deploy:localhost
- name: tests
run: yarn hardhat test
143 changes: 143 additions & 0 deletions ethereum/fly/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

node_modules
.env
coverage
coverage.json
typechain
typechain-types

#Hardhat files
cache
artifacts

.DS_Store
21 changes: 21 additions & 0 deletions ethereum/fly/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Veeso Web Design

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
3 changes: 3 additions & 0 deletions ethereum/fly/app/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/**/*.js

/src/js/declaration.d.ts
25 changes: 25 additions & 0 deletions ethereum/fly/app/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"env": {
"browser": false,
"es6": true,
"node": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "tsconfig.json",
"sourceType": "module",
"ecmaVersion": 2020
},
"plugins": [
"@typescript-eslint"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"rules": {
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-explicit-any": "off"
}
}
5 changes: 5 additions & 0 deletions ethereum/fly/app/.postcssrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"plugins": {
"tailwindcss": {}
}
}
12 changes: 12 additions & 0 deletions ethereum/fly/app/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"singleQuote": true,
"trailingComma": "all",
"overrides": [
{
"files": ["*.ts", "*.tsx"],
"options": {
"parser": "typescript"
}
}
]
}
7 changes: 7 additions & 0 deletions ethereum/fly/app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Setup

```sh
yarn
mkdir -p node_modules/web3/dist/
wget -O node_modules/web3/dist/web3.min.js "https://cdn.jsdelivr.net/npm/web3@latest/dist/web3.min.js"
```
51 changes: 51 additions & 0 deletions ethereum/fly/app/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"name": "app",
"version": "0.1.0",
"description": "web interface to deploy contract",
"author": "Christian Visintin <[email protected]>",
"license": "MIT",
"browserslist": {
"production": [
"> 5%",
"not dead",
"not op_mini all"
],
"development": [
"> 5%",
"not dead",
"not op_mini all"
]
},
"scripts": {
"build": "yarn clean && parcel build src/index.html --reporter @parcel/reporter-bundle-analyzer && cp sitemap.xml dist/sitemap.xml && cp robots.txt dist/robots.txt",
"clean": "rm -rf dist/* .parcel-cache/",
"dev": "parcel src/index.html",
"lint": "eslint . --ext .ts --ext .tsx --max-warnings=0",
"prettier": "prettier --config .prettierrc --write src/",
"prettier:check": "prettier --config .prettierrc --check src/"
},
"dependencies": {
"metamask-react": "^2.7.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-feather": "^2.0.10",
"react-helmet": "^6.1.0",
"web3": "^4.3.0"
},
"devDependencies": {
"@parcel/reporter-bundle-analyzer": "^2.11.0",
"@types/react": "^18.2.47",
"@types/react-dom": "^18.2.18",
"@types/react-helmet": "^6.1.11",
"@typescript-eslint/eslint-plugin": "^6.18.1",
"@typescript-eslint/parser": "^6.18.1",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"parcel": "^2.11.0",
"postcss": "^8.4.33",
"prettier": "^3.1.1",
"process": "^0.11.10",
"tailwindcss": "^3.4.1",
"typescript": "^5.3.3"
}
}
11 changes: 11 additions & 0 deletions ethereum/fly/app/src/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import * as React from 'react';
import { MetaMaskProvider } from 'metamask-react';
import AppLayout from './js/components/AppLayout';

const App = () => (
<MetaMaskProvider>
<AppLayout />
</MetaMaskProvider>
);

export default App;
Binary file added ethereum/fly/app/src/favicon.ico
Binary file not shown.
20 changes: 20 additions & 0 deletions ethereum/fly/app/src/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!doctype html>
<html lang="en">

<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="robots" content="index, follow" />
<meta property="og:type" content="website" />
<meta property="og:locale" content="en_US" />
<link href="./styles.css" rel="stylesheet" />
<title>ERC721 WebUI</title>
</head>

<body>
<div id="app"></div>
<script src="https://cdn.jsdelivr.net/npm/web3@latest/dist/web3.min.js"></script>
<script type="module" src="index.tsx"></script>
</body>

</html>
11 changes: 11 additions & 0 deletions ethereum/fly/app/src/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import * as React from 'react';
import * as ReactDOM from 'react-dom/client';

import App from './App';

const root = ReactDOM.createRoot(document.getElementById('app') as HTMLElement);
root.render(
<React.StrictMode>
<App />
</React.StrictMode>,
);
20 changes: 20 additions & 0 deletions ethereum/fly/app/src/js/components/AppLayout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import * as React from 'react';

import Container from './reusable/Container';
import Page from './reusable/Page';
import MetamaskConnect from './MetamaskConnect';
import Form from './Form/Form';

const AppLayout = () => (
<Page.BlankPage>
<Container.FlexRow className="justify-between items-center py-4 bg-brand px-4">
<span className="text-xl text-white">ERC20 WebUI</span>
<MetamaskConnect />
</Container.FlexRow>
<Container.PageContent className="py-8">
<Form />
</Container.PageContent>
</Page.BlankPage>
);

export default AppLayout;
Loading

0 comments on commit f64df9e

Please sign in to comment.