Skip to content

Commit

Permalink
chore: start major package bump, w/ signal service
Browse files Browse the repository at this point in the history
  • Loading branch information
d1onys1us committed Jun 4, 2023
1 parent f1104b4 commit 9469b5d
Show file tree
Hide file tree
Showing 27 changed files with 2,086 additions and 1,601 deletions.
3 changes: 1 addition & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
# bash, zsh and fish. For this reason, use this syntax:
# export VARNAME=value
# Generate a mnemonic from https://iancoleman.io/bip39/ to use for contract deployments
# PUT MNEMONIC IN THE QUOTES :D
export MNEMONIC=""
export MNEMONIC="test test test test test test test test test test test junk"
# RPCs
export BASE=https://goerli.base.org
export FOUNDRY=http://localhost:8545
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,5 @@ broadcast
# Docs
docs/

# env file
# Dotenv file
.env
.fishenv
7 changes: 6 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
{
"recommendations": ["svelte.svelte-vscode", "juanblanco.solidity"]
"recommendations": [
"esbenp.prettier-vscode",
"nomicfoundation.hardhat-solidity",
"svelte.svelte-vscode",
"tamasfe.even-better-toml"
]
}
27 changes: 8 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## What's included
## What's included

- SvelteKit app
- Auto-generated and fully-typed ABIs using wagmi-generate
Expand All @@ -8,14 +8,15 @@

## Create your dapp with one-click deploy button (recommended)

1. [![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fd1onys1us%2Fdapp-slaps&env=VITE_WEB3MODAL_PROJECT_ID&envDescription=Retrieve%20a%20Web3Modal%20project%20ID%20%E2%86%92&envLink=https%3A%2F%2Fcloud.walletconnect.com%2Fsign-in&root-directory=packages%2Fapp)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fd1onys1us%2Fdapp-slaps&env=VITE_WEB3MODAL_PROJECT_ID&envDescription=Retrieve%20a%20Web3Modal%20project%20ID%20%E2%86%92&envLink=https%3A%2F%2Fcloud.walletconnect.com%2Fsign-in&root-directory=packages%2Fapp)

1. Click the **Deploy with Vercel** button above
2. Clone and cd the repo that was created by Vercel using `git clone <REPO_NAME> && cd <REPO_NAME>`
3. Install Foundry dependency because Vercel doesn't clone the submodules: `forge install foundry-rs/forge-std` (must have foundry installed, see here: https://book.getfoundry.sh/getting-started/installation)
4. Install packages and copy .env.example files:
`sh setup.sh`
5. Set mnemonic phrase in root `.env` for test accounts ([generate a bip39 mnemonic](https://iancoleman.io/bip39/))
6. Set web3modal project id in `.env` ([obtain a project id for web3modal](https://cloud.walletconnect.com/sign-in))
7. (optional) if using vscode check the vscode config section

## Create your dapp manually

Expand All @@ -33,7 +34,7 @@
> You will have three development windows, start them all and source all .env files with `source .env && source packages/app/.env`.
1. Start local chain: `anvil -m $MNEMONIC`
2. Deploy the Foo contract: `forge script Deploy --broadcast --rpc-url $FOUNDRY && pnpm -F app wagmi`
2. Deploy the Foo contract: `forge script Deploy --broadcast --rpc-url $FOUNDRY && pnpm -F app wagmi:generate`
3. Start app: `pnpm -F app dev`

## Faucet links
Expand Down Expand Up @@ -87,20 +88,7 @@ anvil -m $MNEMONIC
> Note: some L2s require a `--legacy` flag if EIP-1559 is not yet supported.
```sh
forge script Deploy --broadcast --rpc-url $FOUNDRY && pnpm -F app wagmi
```

## vscode config section
follow this: https://book.getfoundry.sh/config/vscode, but use this for the path (because of the monorepo setup):
```
"solidity.packageDefaultDependenciesContractsDirectory": "packages/contracts/src",
"solidity.packageDefaultDependenciesDirectory": "packages/contracts/lib",
"solidity.compileUsingRemoteVersion": "v0.8.19",
"editor.formatOnSave": true,
"[solidity]": {
"editor.defaultFormatter": "JuanBlanco.solidity"
},
"solidity.formatter": "forge",
forge script Deploy --broadcast --rpc-url $FOUNDRY && pnpm -F app wagmi:generate
```

## Troubleshooting
Expand All @@ -111,7 +99,8 @@ follow this: https://book.getfoundry.sh/config/vscode, but use this for the path
- Ensure all env vars are set

## Acknowledgements
- PaulRBerg in general: https://github.com/PaulRBerg

- PaulRBerg Foundry template: https://github.com/PaulRBerg/foundry-template
- Taiko monorepo: https://github.com/taikoxyz/taiko-mono
- Optimism Starter: https://github.com/ethereum-optimism/optimism-starter
- ScaffoldEth2: https://github.com/scaffold-eth/se-2
16 changes: 10 additions & 6 deletions foundry.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
# See more config options https://github.com/foundry-rs/foundry/tree/master/config

[profile.default]
src = 'packages/contracts/src'
test = 'packages/contracts/test'
out = 'packages/contracts/out'
script = 'packages/contracts/script'
auto_detect_solc = false
broadcast = 'packages/contracts/broadcast'
cache_path = 'packages/contracts/cache'
libs = ['packages/contracts/lib']
solc = "0.8.19"
out = 'packages/contracts/out'
script = 'packages/contracts/script'
src = 'packages/contracts/src'
test = 'packages/contracts/test'
solc_version = "0.8.19"

# See more config options https://github.com/foundry-rs/foundry/tree/master/config
[fmt]
line_length = 100
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"name": "dapp-slaps",
"version": "0.1.0"
"name": "dapp-slaps"
}
46 changes: 28 additions & 18 deletions packages/app/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'],
plugins: ['svelte3', '@typescript-eslint'],
ignorePatterns: ['*.cjs'],
overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }],
settings: {
'svelte3/typescript': () => require('typescript')
},
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020
},
env: {
browser: true,
es2017: true,
node: true
}
root: true,
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:svelte/recommended",
"prettier",
],
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint"],
parserOptions: {
sourceType: "module",
ecmaVersion: 2020,
extraFileExtensions: [".svelte"],
},
env: {
browser: true,
es2017: true,
node: true,
},
overrides: [
{
files: ["*.svelte"],
parser: "svelte-eslint-parser",
parserOptions: {
parser: "@typescript-eslint/parser",
},
},
],
};
1 change: 1 addition & 0 deletions packages/app/.npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
engine-strict=true
resolution-mode=highest
8 changes: 4 additions & 4 deletions packages/app/.prettierrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"printWidth": 100,
"plugins": ["prettier-plugin-svelte"],
"pluginSearchDirs": ["."],
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
"printWidth": 100,
"plugins": ["prettier-plugin-svelte"],
"pluginSearchDirs": ["."],
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
}
84 changes: 42 additions & 42 deletions packages/app/package.json
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
{
"name": "app",
"private": true,
"type": "module",
"engines": {
"node": ">=16.0.0"
},
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --plugin-search-dir . --check . && eslint .",
"format": "prettier --plugin-search-dir . --write .",
"wagmi": "pnpm exec wagmi generate"
},
"devDependencies": {
"@sveltejs/adapter-auto": "^2.0.0",
"@sveltejs/kit": "^1.15.4",
"@typescript-eslint/eslint-plugin": "^5.58.0",
"@typescript-eslint/parser": "^5.58.0",
"@wagmi/cli": "^0.1.15",
"abitype": "^0.6.8",
"eslint": "^8.38.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-svelte3": "^4.0.0",
"prettier": "^2.8.7",
"prettier-plugin-svelte": "^2.10.0",
"svelte": "^3.58.0",
"svelte-check": "^3.2.0",
"tslib": "^2.5.0",
"typescript": "^4.9.5",
"vite": "^4.2.1",
"vite-plugin-node-polyfills": "^0.7.0"
},
"dependencies": {
"@picocss/pico": "^1.5.9",
"@wagmi/core": "0.10.2",
"@web3modal/ethereum": "^2.2.2",
"@web3modal/html": "^2.2.2",
"ethers": "^5.7.2"
}
"name": "app",
"private": true,
"type": "module",
"engines": {
"node": ">=18.0.0"
},
"scripts": {
"dev": "vite dev",
"dev:foundry": "source ../../.env && vite dev && wagmi generate --watch && anvil -m $MNEMONIC",
"dev:wagmi": "vite dev && wagmi generate --watch",
"build": "vite build",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --plugin-search-dir . --check . && eslint .",
"format": "prettier --plugin-search-dir . --write .",
"wagmi:generate": "wagmi generate"
},
"devDependencies": {
"@picocss/pico": "^1.5.10",
"@sveltejs/adapter-auto": "^2.1.0",
"@sveltejs/kit": "^1.19.0",
"@typescript-eslint/eslint-plugin": "^5.59.7",
"@typescript-eslint/parser": "^5.59.7",
"@wagmi/cli": "^1.0.2",
"@wagmi/core": "^1.0.6",
"@web3modal/ethereum": "^2.4.1",
"@web3modal/html": "^2.4.1",
"abitype": "^0.8.4",
"eslint": "^8.41.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-svelte3": "^4.0.0",
"prettier": "^2.8.8",
"prettier-plugin-svelte": "^2.10.0",
"svelte": "^3.59.1",
"svelte-check": "^3.3.2",
"tslib": "^2.5.2",
"typescript": "^5.0.4",
"viem": "^0.3.37",
"vite": "^4.3.8",
"vite-plugin-node-polyfills": "^0.8.2"
}
}
53 changes: 0 additions & 53 deletions packages/app/src/abi/HeaderSync.ts

This file was deleted.

Loading

1 comment on commit 9469b5d

@vercel
Copy link

@vercel vercel bot commented on 9469b5d Jun 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

dapp-slaps – ./

dapp-slaps.vercel.app
dapp-slaps-git-main-d1onys1us.vercel.app
dapp-slaps-d1onys1us.vercel.app

Please sign in to comment.