migrate the cicd enhancement to new branch

This commit is contained in:
Evis Chang
2023-12-20 00:56:47 +08:00
parent cb439a27d0
commit 762711d797
35 changed files with 877 additions and 95 deletions

View File

@@ -1,3 +0,0 @@
node_modules/
keys/
**/keys/

View File

@@ -1,6 +1,6 @@
# This is the custom image for running build-and-test.yml
FROM ubuntu:22.04
FROM node:18-buster
ENV DEBIAN_FRONTEND=noninteractive

156
.github/workflows/build-all.yml vendored Normal file
View File

@@ -0,0 +1,156 @@
name: CD-Build All
on:
workflow_call:
inputs:
build-services:
default: 'relay-frontend'
type: string
version:
default: '0.0.1'
type: string
env:
default: 'dev'
type: string
# get repo vars before running jobs
env:
WIF_PROVIDER: ${{ secrets.WIF_PROVIDER }}
WIF_SERVICE_ACCOUNT: ${{ secrets.WIF_SERVICE_ACCOUNT }}
GAR_LOCATION: ${{ vars.GAR_LOCATION }}
PROJECT_ID: ${{ vars.PROJECT_ID }}
REPOSITORY: ${{ vars.REPOSITORY }}
GH_PAT: ${{ secrets.GH_PAT }}
jobs:
build-all:
if: ${{ inputs.build-services == 'contract' }}
runs-on: ubuntu-22.04
environment: ${{ inputs.env }}
steps:
- name: Install node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Check out repository code
uses: actions/checkout@v3
- name: Setup circom, related lib
run: |
apt-get update && apt-get install -y build-essential curl
curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh -s -- -y && \
. "$HOME/.cargo/env" && \
cd /tmp && \
git clone https://github.com/iden3/circom.git && \
cd circom && \
cargo build --release && \
cargo install --path circom
echo "/root/.cargo/bin" >> $GITHUB_PATH
- name: Install and build packages
run: yarn && yarn build
- name: Deploy contracts
run: |
yarn contracts deploy:${{ inputs.env }}
env:
ETH_PROVIDER_URL: ${{ vars.ETH_PROVIDER_URL }}
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
- name: Export Config to GitHub Envs
run: gh variable set -f ./packages/relay/.env -e ${{ inputs.env }} --repo $GITHUB_REPOSITORY
env:
GITHUB_TOKEN: ${{ env.GH_PAT }}
- name: Authenticate to Google Cloud
id: auth
uses: 'google-github-actions/auth@v1'
with:
token_format: access_token
workload_identity_provider: '${{ env.WIF_PROVIDER }}'
service_account: '${{ env.WIF_SERVICE_ACCOUNT }}'
access_token_lifetime: 300s
- name: Login Registry
id: docker-auth
uses: docker/login-action@v1
with:
registry: ${{ env.GAR_LOCATION }}-docker.pkg.dev
username: oauth2accesstoken
password: ${{ steps.auth.outputs.access_token }}
- name: push relay image
run: |
docker build -t ${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPOSITORY }}/${{ vars.BACKEND_SERVICE }}:${{ inputs.version }} -f ./packages/relay/Dockerfile .
docker push ${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPOSITORY }}/${{ vars.BACKEND_SERVICE }}:${{ inputs.version }}
- name: push frontend image
run: |
docker build -t ${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPOSITORY }}/${{ vars.FRONTEND_SERVICE }}:${{ inputs.version }} -f ./packages/frontend/Dockerfile .
docker push ${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPOSITORY }}/${{ vars.FRONTEND_SERVICE }}:${{ inputs.version }}
# - name: add tag to record version
# run: |
# git tag v${{ inputs.version }}
# git push origin refs/tags/v${{ inputs.version }} -f
build-relay-frontend:
if: ${{ inputs.build-services == 'relay-frontend'}}
runs-on: ubuntu-22.04
environment: ${{ inputs.env }}
steps:
- name: Install node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Check out repository code
uses: actions/checkout@v3
- name: Setup circom, related lib
run: |
apt-get update && apt-get install -y build-essential curl
curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh -s -- -y && \
. "$HOME/.cargo/env" && \
cd /tmp && \
git clone https://github.com/iden3/circom.git && \
cd circom && \
cargo build --release && \
cargo install --path circom
echo "/root/.cargo/bin" >> $GITHUB_PATH
- name: Install and build packages
run: yarn && yarn build
- name: Authenticate to Google Cloud
id: auth
uses: 'google-github-actions/auth@v1'
with:
token_format: access_token
workload_identity_provider: '${{ env.WIF_PROVIDER }}'
service_account: '${{ env.WIF_SERVICE_ACCOUNT }}'
access_token_lifetime: 300s
- name: Login Registry
id: docker-auth
uses: docker/login-action@v1
with:
registry: ${{ env.GAR_LOCATION }}-docker.pkg.dev
username: oauth2accesstoken
password: ${{ steps.auth.outputs.access_token }}
- name: push relay image
run: |
docker build -t ${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPOSITORY }}/${{ vars.BACKEND_SERVICE }}:${{ inputs.version }} -f ./packages/relay/Dockerfile .
docker push ${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPOSITORY }}/${{ vars.BACKEND_SERVICE }}:${{ inputs.version }}
- name: push frontend image
run: |
docker build -t ${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPOSITORY }}/${{ vars.FRONTEND_SERVICE }}:${{ inputs.version }} -f ./packages/frontend/Dockerfile .
docker push ${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPOSITORY }}/${{ vars.FRONTEND_SERVICE }}:${{ inputs.version }}
# - name: add tag to record version
# run: |
# git tag v${{ inputs.version }}
# git push origin refs/tags/v${{ inputs.version }} -f

50
.github/workflows/deploy-contract.yml vendored Normal file
View File

@@ -0,0 +1,50 @@
name: Manual-Deploy Contract
on:
workflow_dispatch:
branches: ['dev', 'prod']
env:
type: string
required: true
workflow_call:
env:
type: string
required: true
# get repo vars before running jobs
env:
GH_PAT: ${{ secrets.GH_PAT }}
jobs:
contract:
runs-on: ubuntu-22.04
environment: ${{ inputs.env }}
steps:
- name: Install node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Check out repository code
uses: actions/checkout@v3
- name: Install and build packages
run: yarn && yarn contracts build
- name: Deploy contracts
run: |
yarn contracts deploy:${{ inputs.env }}
env:
ETH_PROVIDER_URL: ${{ vars.ETH_PROVIDER_URL }}
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
- name: Export Config to GitHub Envs
run: gh variable set -f ./packages/relay/.env -e ${{ inputs.env }} --repo $GITHUB_REPOSITORY
env:
GITHUB_TOKEN: ${{ env.GH_PAT }}
# - name: add tag to record version
# run: |
# git tag v${{ inputs.version }}
# git push origin refs/tags/v${{ inputs.version }} -f

79
.github/workflows/deploy-frontend.yml vendored Normal file
View File

@@ -0,0 +1,79 @@
name: Manual-Frontend-Deploy
on:
workflow_dispatch:
branches: ['dev', 'prod']
inputs:
version:
type: string
required: true
env:
type: string
required: true
workflow_call:
inputs:
version:
type: string
required: true
env:
type: string
required: true
# get repo vars before running jobs
env:
NODE_OPTIONS: ${{ vars.NODE_OPTIONS }}
REGION: ${{ vars.REGION }}
WIF_PROVIDER: ${{ secrets.WIF_PROVIDER }}
WIF_SERVICE_ACCOUNT: ${{ secrets.WIF_SERVICE_ACCOUNT }}
GAR_LOCATION: ${{ vars.GAR_LOCATION }}
PROJECT_ID: ${{ vars.PROJECT_ID }}
REPOSITORY: ${{ vars.REPOSITORY }}
jobs:
frontend:
permissions:
contents: 'read'
id-token: 'write'
runs-on: ubuntu-latest
environment: ${{ inputs.env }}
steps:
- name: Production Code
uses: 'actions/checkout@v3'
- name: Authenticate to Google Cloud
id: auth
uses: 'google-github-actions/auth@v1'
with:
token_format: access_token
workload_identity_provider: '${{ env.WIF_PROVIDER }}'
service_account: '${{ env.WIF_SERVICE_ACCOUNT }}'
access_token_lifetime: 900s
## artifact registry auth setup
- name: Login to Artifact Registry
id: docker-auth
uses: docker/login-action@v1
with:
registry: ${{ env.GAR_LOCATION }}-docker.pkg.dev
username: oauth2accesstoken
password: ${{ steps.auth.outputs.access_token }}
- name: Deploy to Cloud Run
id: deploy
uses: google-github-actions/deploy-cloudrun@v0
with:
service: ${{ vars.FRONTEND_SERVICE }}
region: ${{ env.REGION }}
image: ${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPOSITORY }}/${{ vars.FRONTEND_SERVICE }}:${{ inputs.version }}
## set --max-old-space-size=8192 for node.js to increase memory limit
env_vars: |
SERVER=${{ vars.SERVER }}
NODE_OPTIONS=${{ env.NODE_OPTIONS }}
- name: Allow public access
id: unauthenticated
run: gcloud run services add-iam-policy-binding ${{ vars.FRONTEND_SERVICE }} --region=${{ env.REGION }} --member="allUsers" --role="roles/run.invoker"
- name: Show Output
run: echo ${{ steps.deploy.outputs.url }}

87
.github/workflows/deploy-relay.yml vendored Normal file
View File

@@ -0,0 +1,87 @@
name: Manual-Relay-Deploy
on:
workflow_dispatch:
branches: ['dev', 'prod']
inputs:
version:
type: string
required: true
env:
type: string
required: true
workflow_call:
inputs:
version:
type: string
required: true
env:
type: string
required: true
# get repo vars before running jobs
env:
REGION: ${{ vars.REGION }}
WIF_PROVIDER: ${{ secrets.WIF_PROVIDER }}
WIF_SERVICE_ACCOUNT: ${{ secrets.WIF_SERVICE_ACCOUNT }}
GAR_LOCATION: ${{ vars.GAR_LOCATION }}
PROJECT_ID: ${{ vars.PROJECT_ID }}
REPOSITORY: ${{ vars.REPOSITORY }}
TWITTER_CLIENT_ID: ${{ secrets.TWITTER_CLIENT_ID }}
TWITTER_CLIENT_KEY: ${{ secrets.TWITTER_CLIENT_KEY }}
jobs:
relay:
permissions:
contents: 'read'
id-token: 'write'
runs-on: ubuntu-latest
environment: ${{ inputs.env }}
steps:
- name: Production Code
uses: 'actions/checkout@v3'
- name: Authenticate to Google Cloud
id: auth
uses: 'google-github-actions/auth@v1'
with:
token_format: access_token
workload_identity_provider: '${{ env.WIF_PROVIDER }}'
service_account: '${{ env.WIF_SERVICE_ACCOUNT }}'
access_token_lifetime: 300s
## artifact registry auth setup
- name: Login to Artifact Registry
id: docker-auth
uses: docker/login-action@v1
with:
registry: ${{ env.GAR_LOCATION }}-docker.pkg.dev
username: oauth2accesstoken
password: ${{ steps.auth.outputs.access_token }}
- name: Deploy to Cloud Run
id: deploy
uses: google-github-actions/deploy-cloudrun@v0
with:
service: ${{ vars.BACKEND_SERVICE }}
region: ${{ env.REGION }}
image: ${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPOSITORY }}/${{ vars.BACKEND_SERVICE }}:${{ inputs.version }}
# add ENV as below
env_vars: |
TWITTER_CLIENT_ID=${{ env.TWITTER_CLIENT_ID }}
TWITTER_CLIENT_KEY=${{ env.TWITTER_CLIENT_KEY }}
CLIENT_URL=${{ vars.CLIENT_URL }}
APP_ADDRESS=${{ vars.APP_ADDRESS }}
UNIREP_ADDRESS=${{ vars.UNIREP_ADDRESS }}
PRIVATE_KEY=${{ secrets.PRIVATE_KEY }}
GENESIS_BLOCK=${{ vars.GENESIS_BLOCK }}
ETH_PROVIDER_URL=${{ vars.ETH_PROVIDER_URL }}
DB_PATH=${{ secrets.DB_PATH }}
- name: Allow public access
id: unauthenticated
run: gcloud run services add-iam-policy-binding ${{ vars.BACKEND_SERVICE }} --region=${{ env.REGION }} --member="allUsers" --role="roles/run.invoker"
- name: Show Output
run: echo ${{ steps.deploy.outputs.url }}

57
.github/workflows/main-cd.yml vendored Normal file
View File

@@ -0,0 +1,57 @@
name: CD-Main
run-name: ${{ github.actor }} acitvates the actions 🚀
on:
workflow_dispatch:
branches: ['dev', 'prod']
inputs:
build-services:
description: 'build which services'
required: true
default: 'relay-frontend'
type: choice
options:
- relay-frontend
- contract
version:
description: 'current deploy version'
required: true
default: '0.0.1'
env:
description: 'deployment stage'
required: true
default: 'dev'
jobs:
build:
permissions:
contents: 'read'
id-token: 'write'
uses: ./.github/workflows/build-all.yml
with:
build-services: ${{ inputs.build-services }}
version: ${{ inputs.version }}
env: ${{ inputs.env }}
secrets: inherit
frontend:
needs: build
permissions:
contents: 'read'
id-token: 'write'
uses: ./.github/workflows/deploy-frontend.yml
with:
version: ${{ inputs.version }}
env: ${{ inputs.env }}
secrets: inherit
relay:
needs: frontend
permissions:
contents: 'read'
id-token: 'write'
uses: ./.github/workflows/deploy-relay.yml
with:
version: ${{ inputs.version }}
env: ${{ inputs.env }}
secrets: inherit

View File

@@ -1,18 +0,0 @@
FROM node:16-buster
COPY . /src
WORKDIR /src
RUN yarn && rm -rf packages/frontend
RUN sh scripts/loadKeys.sh
RUN rm -r packages/relay/keys/buildOrdered*
FROM node:16-buster
COPY --from=0 /src /src
WORKDIR /src/packages/relay
CMD ["npm", "start"]

View File

@@ -159,6 +159,24 @@ Ensure that your code is formatted correctly:
yarn lint:check
```
## 5. Deploy
### 5.1 Deploy frontend locally
```shell
docker build -t test-frontend:0.1 -f packages/frontend/Dockerfile .
docker run --rm -p 3000:3000 --network="bridge" test-frontend:0.1
```
### 5.2 Deploy backend locally
```shell
docker build -t test-relay:0.1 -f packages/relay/Dockerfile .
docker run --network="host" --rm -p 8000:8000 test-relay:0.1
```
# Contributing
### Getting Started

40
docs/manual_deploy.md Normal file
View File

@@ -0,0 +1,40 @@
# Manual Deploy Guide
Currently, we deploy the services manually.
# Prerequisite
Make sure you install gh cli in your local environment.
Here's the gh cli link: https://cli.github.com/.
# Deploy All Services
- Below command will deploy contract to the given env (prod / env) and build images of frontend and relay. It will run the containers of frontend and relay on cloud run by using the images we just published to Artifact Registry.
```bash
$ gh workflow run main-cd.yml --ref feat_system_cicd_enhancment -f build-services=contract -f version=0.1.1 -f env={prod / dev} --repo social-tw/social-tw-website
```
# Deploy Contract
- Below command will deploy contract to the given env (prod / dev)
```bash
$ gh workflow run deploy-contract.yml --ref feat_system_cicd_enhancment -f env={prod / dev} --repo social-tw/social-tw-website
```
# Deploy Frontend
- Below command will deploy frontend service with the given version of image to the given env (prod / env)
```bash
gh workflow run deploy-frontend.yml --ref feat_system_cicd_enhancment -f version=0.1.1 -f env={prod / dev} --repo social-tw/social-tw-website
```
# Deploy Relay
- Below command will deploy relay service with the given version of image to the given env (prod / env)
```bash
gh workflow run deploy-relay.yml --ref feat_system_cicd_enhancment -f version=0.1.1 -f env={prod / dev} --repo social-tw/social-tw-website
```

View File

@@ -0,0 +1 @@
ETH_PROVIDER_URL=

View File

@@ -1,6 +1,16 @@
import '@typechain/hardhat'
import '@nomiclabs/hardhat-ethers'
import '@nomicfoundation/hardhat-chai-matchers'
import * as tdly from '@tenderly/hardhat-tenderly'
import * as dotenv from 'dotenv'
dotenv.config()
tdly.setup({ automaticVerifications: true })
const { TENDERLY_ACCESS_KEY, TENDERLY_PROJECT_SLUG } = process.env
const DEVNET_RPC_URL = process.env.DEVNET_RPC_URL ?? ''
const DEFAULT_PRIVATE_KEY =
'0x0f70e777f814334daa4456ac32b9a1fdca75ae07f70c2e6cef92679bad06c88b'
export default {
defaultNetwork: 'local',
@@ -11,16 +21,30 @@ export default {
local: {
url: 'http://127.0.0.1:8545',
blockGasLimit: 12000000,
accounts: [
'0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80',
],
accounts: [DEFAULT_PRIVATE_KEY],
},
dev: {
url: process.env.ETH_PROVIDER_URL ?? '',
accounts: [process.env.PRIVATE_KEY ?? DEFAULT_PRIVATE_KEY],
},
prod: {
url: process.env.ETH_PROVIDER_URL ?? '',
accounts: [process.env.PRIVATE_KEY ?? DEFAULT_PRIVATE_KEY],
},
arb: {
url: 'https://arbitrum.goerli.unirep.io',
accounts: [
'0x0f70e777f814334daa4456ac32b9a1fdca75ae07f70c2e6cef92679bad06c88b',
],
url: process.env.ETH_PROVIDER_URL ?? '',
accounts: [process.env.PRIVATE_KEY ?? DEFAULT_PRIVATE_KEY],
},
tenderly: {
url: DEVNET_RPC_URL,
chainId: 137,
accounts: [process.env.PRIVATE_KEY ?? DEFAULT_PRIVATE_KEY],
},
},
tenderly: {
project: TENDERLY_PROJECT_SLUG || 'devnet-example',
username: 'Tenderly',
accessKey: TENDERLY_ACCESS_KEY,
},
solidity: {
compilers: [

View File

@@ -13,7 +13,11 @@
"abi": "ts-node scripts/abi",
"hardhat": "hardhat",
"deploy": "hardhat run scripts/deploy.ts",
"test": "hardhat test --network hardhat"
"test": "hardhat test --network hardhat",
"spawn-devnet": "ts-node ./scripts/spawnDevNet.ts",
"deploy:devnet": "yarn run spawn-devnet && hardhat run scripts/deploy.ts --network tenderly",
"deploy:dev": "hardhat run scripts/deploy.ts --network dev",
"deploy:prod": "hardhat run scripts/deploy.ts --network prod"
},
"bugs": {
"url": "https://github.com/social-tw/social-tw-website/issues"
@@ -23,11 +27,13 @@
"@nomicfoundation/hardhat-chai-matchers": "1.0.6",
"@nomiclabs/hardhat-ethers": "^2.2.0",
"@openzeppelin/contracts": "^4.7.3",
"@tenderly/hardhat-tenderly": "^1.7.7",
"@typechain/ethers-v5": "^10.2.0",
"@typechain/hardhat": "^6.1.5",
"@types/node": "^18.15.11",
"@unirep-app/circuits": "1.0.0",
"@unirep/contracts": "2.0.0-beta-5",
"envfile": "^6.18.0",
"hardhat": "^2.17.1",
"ts-node": "^10.9.1",
"typechain": "^8.1.1",

View File

@@ -3,6 +3,7 @@ import * as fs from 'fs'
import * as path from 'path'
import { deployApp } from './utils'
import * as hardhat from 'hardhat'
import * as envfile from 'envfile'
const epochLength = 300
@@ -15,26 +16,34 @@ export async function main() {
const [signer] = await ethers.getSigners()
const { unirep, app } = await deployApp(signer, epochLength)
console.log(
`Unirep app with epoch length ${epochLength} is deployed to ${app.address}`
)
const configPath = path.join(__dirname, '../../relay/.env')
const config = `export default {
UNIREP_ADDRESS: '${unirep.address}',
APP_ADDRESS: '${app.address}',
ETH_PROVIDER_URL: '${hardhat.network.config.url ?? ''}',
${
Array.isArray(hardhat.network.config.accounts)
? `PRIVATE_KEY: '${hardhat.network.config.accounts[0]}',`
: `/**
This contract was deployed using a mnemonic. The PRIVATE_KEY variable needs to be set manually
**/`
// if file not exists, create it
if (!fs.existsSync(configPath)) {
fs.writeFileSync(configPath, '')
}
}
`
const configPath = path.join(__dirname, '../../../config.ts')
await fs.promises.writeFile(configPath, config)
fs.readFile(configPath, 'utf8', async (err, data) => {
if (err) {
console.error(err)
return
}
const config = envfile.parse(data)
config.UNIREP_ADDRESS = unirep.address
config.APP_ADDRESS = app.address
config.ETH_PROVIDER_URL = hardhat.network.config.url ?? ''
config.PRIVATE_KEY = Array.isArray(hardhat.network.config.accounts)
? `${hardhat.network.config.accounts[0]}`
: `/**
This contract was deployed using a mnemonic. The PRIVATE_KEY variable needs to be set manually
**/`
// get forked block number
const blockNum = await ethers.provider.getBlockNumber()
config.GENESIS_BLOCK = (blockNum - 999).toString()
await fs.promises.writeFile(configPath, envfile.stringify(config))
})
console.log(`Config written to ${configPath}`)
}

View File

@@ -0,0 +1,51 @@
import { ethers } from 'hardhat'
import * as util from 'util'
import * as fs from 'fs'
import * as dotenv from 'dotenv'
import { exec as execChildProcess } from 'child_process'
dotenv.config()
const exec = util.promisify(execChildProcess)
const {
TENDERLY_PROJECT_SLUG,
TENDERLY_ACCOUNT_ID,
TENDERLY_DEVNET_TEMPLATE,
TENDERLY_ACCESS_KEY,
} = process.env
let command = `tenderly devnet spawn-rpc --project ${TENDERLY_PROJECT_SLUG} --template ${TENDERLY_DEVNET_TEMPLATE} --account ${TENDERLY_ACCOUNT_ID} --access_key ${TENDERLY_ACCESS_KEY}`
const createDevNet = async () => {
try {
const { stderr } = await exec(command)
const devNetUrl = stderr.trim().toString()
console.log('DEVNET_RPC_URL=' + devNetUrl)
// if file not exists, create it
if (!fs.existsSync('.env')) {
fs.writeFileSync('.env', '')
}
const fileContent = fs.readFileSync('.env', 'utf8')
const newFileContent = fileContent.replace(/DEVNET_RPC_URL=.*/g, '')
fs.writeFileSync('.env', newFileContent)
fs.appendFileSync('.env', 'DEVNET_RPC_URL=' + devNetUrl)
// generate account by pk
const privateKey = process.env.PRIVATE_KEY!
const provider = new ethers.providers.JsonRpcProvider(devNetUrl)
const signer = new ethers.Wallet(privateKey, provider)
// send money to account
await provider.send('tenderly_setBalance', [
[signer.address],
ethers.utils.hexValue(ethers.utils.parseUnits('10', 'ether')),
])
} catch (error) {
console.error('Error executing command:', error)
}
}
createDevNet()

View File

@@ -2,6 +2,5 @@
.github
.DS_Store
.env
node_modules
playwright-report
test-result

View File

@@ -1,8 +1,24 @@
FROM node:20-alpine
FROM node:18-buster
RUN npm install -g serve
RUN apt-get install -y \
ca-certificates && \
update-ca-certificates
WORKDIR /app
COPY ./build /app
COPY ./node_modules/ /src/node_modules/
CMD ["serve"]
COPY ./tsconfig.json /src/tsconfig.json
COPY ./packages/frontend/ /src/packages/frontend/
COPY ./packages/circuits/dist/ /src/packages/circuits/dist/
COPY ./packages/circuits/tsconfig.json /src/packages/circuits/tsconfig.json
COPY ./packages/circuits/package.json /src/packages/circuits/package.json
WORKDIR /src/packages/frontend
ENV ENV=${ENV}
ENV STAGE_SERVER=${STAGE_SERVER}
ENV NODE_OPTIONS=${NODE_OPTIONS}
EXPOSE 3000
CMD ["npm", "start"]

View File

@@ -45,6 +45,7 @@
"react-lines-ellipsis": "^0.15.3",
"react-scripts": "^5.0.1",
"react-twitter-login": "^1.5.0",
"dotenv-webpack": "^8.0.1",
"socket.io-client": "^4.7.2"
},
"devDependencies": {

View File

@@ -1,4 +1,2 @@
export const SERVER = 'http://localhost:8000'
// export const SERVER = 'https://relay.demo.unirep.io'
export const KEY_SERVER = 'http://localhost:8000/build/'
// export const KEY_SERVER = 'https://keys.unirep.io/2-beta-1/'
export const SERVER = process.env.SERVER ?? 'http://localhost:8000'
export const KEY_SERVER = `${SERVER}/build/`

View File

@@ -4,6 +4,7 @@ const path = require('path')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
// const CssMinimizerPlugin = require('css-minimizer-webpack-plugin')
const webpack = require('webpack')
const Dotenv = require('dotenv-webpack')
module.exports = (env) => ({
entry: ['./src/index.tsx'],
@@ -11,6 +12,7 @@ module.exports = (env) => ({
devServer: {
port: 3000,
historyApiFallback: true,
allowedHosts: 'all',
},
optimization: {
splitChunks: {
@@ -115,8 +117,8 @@ module.exports = (env) => ({
}),
new MiniCssExtractPlugin(),
// new HtmlWebpackInlineSourcePlugin(),
new Dotenv({ path: './.env', systemvars: true }),
new webpack.DefinePlugin({
'process.env': {},
'process.argv': [],
'process.versions': {},
'process.versions.node': '"12"',

View File

@@ -0,0 +1,3 @@
**/cache/
**/build/
.env

View File

@@ -1,2 +1,7 @@
TWITTER_CLIENT_ID=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
TWITTER_CLIENT_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
TWITTER_CLIENT_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
CLIENT_URL=
UNIREP_ADDRESS=
APP_ADDRESS=
ETH_PROVIDER_URL=
PRIVATE_KEY=

17
packages/relay/Dockerfile Normal file
View File

@@ -0,0 +1,17 @@
FROM node:18-buster
RUN apt-get install -y \
ca-certificates && \
update-ca-certificates
COPY ./node_modules/ /src/node_modules/
COPY ./tsconfig.json /src/tsconfig.json
COPY ./packages/contracts/abi/ /src/packages/contracts/abi/
COPY ./packages/relay/ /src/packages/relay/
WORKDIR /src/packages/relay
EXPOSE 8000
CMD ["npm", "start"]

View File

@@ -12,12 +12,19 @@ Object.assign(process.env, {
APP_ADDRESS: '0x959922bE3CAee4b8Cd9a407cc3ac1C251C2007B1',
ETH_PROVIDER_URL: 'http://127.0.0.1:8545',
PRIVATE_KEY:
process.env.PRIVATE_KEY ??
'0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80',
GENESIS_BLOCK: process.env.GENESIS_BLOCK ?? '0',
...process.env,
})
export const { UNIREP_ADDRESS, APP_ADDRESS, ETH_PROVIDER_URL, PRIVATE_KEY } =
process.env as any
export const {
UNIREP_ADDRESS,
APP_ADDRESS,
ETH_PROVIDER_URL,
PRIVATE_KEY,
GENESIS_BLOCK,
} = process.env as any
export const APP_ABI = ABI
@@ -30,8 +37,9 @@ export const provider = ETH_PROVIDER_URL.startsWith('http')
: new ethers.providers.WebSocketProvider(ETH_PROVIDER_URL)
export const CLIENT_URL = process.env.CLIENT_URL ?? 'http://localhost:3000'
export const CALLBACK_URL =
process.env.CALLBACK_URL ?? 'http://localhost:8000/api/user'
export const CALLBACK_URL = process.env.SERVER
? `${process.env.SERVER}/api/user`
: 'http://localhost:8000/api/user'
// twitter related settings
export const TWITTER_ACCESS_TOKEN_URL =

View File

@@ -18,6 +18,7 @@ import {
DB_PATH,
APP_ADDRESS,
APP_ABI,
GENESIS_BLOCK,
IS_IN_TEST,
CLIENT_URL,
} from './config'
@@ -26,7 +27,7 @@ import { SocketManager } from './singletons/SocketManager'
import { postService } from './services/PostService'
main().catch((err) => {
console.log(`Uncaught error: ${err}`)
console.error(`Uncaught error: ${err}`)
process.exit(1)
})
@@ -45,6 +46,7 @@ async function main() {
prover: prover,
provider: provider,
unirepAddress: UNIREP_ADDRESS,
genesisBlock: parseInt(GENESIS_BLOCK),
},
new ethers.Contract(APP_ADDRESS, APP_ABI, provider)
)

View File

@@ -51,6 +51,7 @@ async function fetchActions(req, res, db: DB) {
res.json({ counter: counter })
} catch (error: any) {
console.error(error)
res.status(500).json({ error })
}
}

View File

@@ -54,6 +54,7 @@ export default (
)
res.json({ hash })
} catch (error: any) {
console.error(error)
res.status(500).json({ error })
}
})

View File

@@ -22,6 +22,7 @@ export default (
)
res.status(200).json({ status: 'success', hash: hash })
} catch (error) {
console.error(error)
if (
error instanceof Error &&
error.message.includes('The user has already signed up.')

View File

@@ -34,6 +34,7 @@ export default (
)
res.json({ hash })
} catch (error: any) {
console.error(error)
res.status(500).json({ error })
}
})

View File

@@ -35,7 +35,7 @@ export default (
res.redirect(redirectUrl)
} catch (error) {
console.log(error)
console.error(error)
res.redirect(`${CLIENT_URL}/?error=apiError`)
}
})

View File

@@ -27,6 +27,7 @@ export class UnirepSocialSynchronizer extends Synchronizer {
prover: Prover
provider: ethers.providers.Provider
unirepAddress: string
genesisBlock?: number
},
unirepSocialContract: ethers.Contract
) {
@@ -190,8 +191,13 @@ export class UnirepSocialSynchronizer extends Synchronizer {
}
// overwrite handleEpochEnded to delete all epochKeyAction when the epoch ended
async handleEpochEnded({ event, db, decodedData }: EventHandlerArgs) {
super.handleEpochEnded({ event, db, decodedData })
async handleEpochEnded({
event,
db,
decodedData,
}: EventHandlerArgs): Promise<true | undefined> {
const result = super.handleEpochEnded({ event, db, decodedData })
if (!result) return
const epoch = Number(decodedData.epoch)
const rows = await this.db.count('EpochKeyAction', {
@@ -199,13 +205,13 @@ export class UnirepSocialSynchronizer extends Synchronizer {
})
// if there's no data in EpochKeyAction then do nothing
if (rows == 0) return
if (rows == 0) return result
db.delete('EpochKeyAction', {
where: {
epoch: epoch,
},
})
return true
return result
}
}

View File

@@ -176,7 +176,7 @@ describe('LOGIN /login', function () {
.request(`${HTTP_SERVER}`)
.post('/api/signup')
.set('content-type', 'application/json')
.query({
.send({
publicSignals: publicSignals,
proof: signupProof._snarkProof,
hashUserId: user.hashUserId,

View File

@@ -8,7 +8,7 @@ import { deployContracts, startServer } from './environment'
import { Server } from 'http'
import { addActionCount } from '../src/utils/TransactionHelper'
describe.only('My Account Page', function () {
describe('My Account Page', function () {
let snapshot: any
let express: Server
let postEpochKey = 'post-epoch-key'

View File

@@ -19,19 +19,19 @@ import { PostService } from '../src/services/PostService'
import { io } from 'socket.io-client'
import { EventType, VoteMsg } from '../src/types/SocketTypes'
let socketClient: any
describe('POST /vote', function () {
var snapshot: any
var anondb: DB
var express: Server
var userStateFactory: UserStateFactory
var userState: UserState
var sync: UnirepSocialSynchronizer
var upvotePostId: string
var downvotePostId: string
var otherPostId: string
var pService: PostService
var chainId: number
let socketClient: any
let snapshot: any
let anondb: DB
let express: Server
let userStateFactory: UserStateFactory
let userState: UserState
let sync: UnirepSocialSynchronizer
let upvotePostId: string
let downvotePostId: string
let otherPostId: string
let pService: PostService
let chainId: number
before(async function () {
snapshot = await ethers.provider.send('evm_snapshot', [])

188
yarn.lock
View File

@@ -1311,6 +1311,11 @@
dependencies:
mime "^3.0.0"
"@colors/colors@1.5.0":
version "1.5.0"
resolved "https://registry.yarnpkg.com/@colors/colors/-/colors-1.5.0.tgz#bb504579c1cae923e6576a4f5da43d25f97bdbd9"
integrity sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==
"@cspotcode/source-map-support@^0.8.0":
version "0.8.1"
resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1"
@@ -1566,7 +1571,7 @@
dependencies:
"@ethersproject/bignumber" "^5.7.0"
"@ethersproject/contracts@5.7.0":
"@ethersproject/contracts@5.7.0", "@ethersproject/contracts@^5.7.0":
version "5.7.0"
resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.7.0.tgz#c305e775abd07e48aa590e1a877ed5c316f8bd1e"
integrity sha512-5GJbzEU3X+d33CdfPhcyS+z8MzsTrBGk/sc+G+59+tPa9yFkl6HQ9D6L0QMgNTA9q8dT0XKxxkyp883XsQvbbg==
@@ -1732,7 +1737,7 @@
elliptic "6.5.4"
hash.js "1.1.7"
"@ethersproject/solidity@5.7.0":
"@ethersproject/solidity@5.7.0", "@ethersproject/solidity@^5.7.0":
version "5.7.0"
resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.7.0.tgz#5e9c911d8a2acce2a5ebb48a5e2e0af20b631cb8"
integrity sha512-HmabMd2Dt/raavyaGukF4XxizWKhKQ24DoLtdNbBmNKUOPqwjsKQSdV9GQtj9CBEea9DlzETlVER1gYeXXBGaA==
@@ -1777,7 +1782,7 @@
"@ethersproject/constants" "^5.7.0"
"@ethersproject/logger" "^5.7.0"
"@ethersproject/wallet@5.7.0":
"@ethersproject/wallet@5.7.0", "@ethersproject/wallet@^5.7.0":
version "5.7.0"
resolved "https://registry.yarnpkg.com/@ethersproject/wallet/-/wallet-5.7.0.tgz#4e5d0790d96fe21d61d38fb40324e6c7ef350b2d"
integrity sha512-MhmXlJXEJFBFVKrDLB4ZdDzxcBxQ3rLyCkhNqVu3CDYvR97E+8r01UgrI+TI99Le+aYm/in/0vp86guJuM7FCA==
@@ -3493,7 +3498,7 @@
"@nomicfoundation/solidity-analyzer-win32-ia32-msvc" "0.1.1"
"@nomicfoundation/solidity-analyzer-win32-x64-msvc" "0.1.1"
"@nomiclabs/hardhat-ethers@^2.2.0":
"@nomiclabs/hardhat-ethers@^2.1.1", "@nomiclabs/hardhat-ethers@^2.2.0":
version "2.2.3"
resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-ethers/-/hardhat-ethers-2.2.3.tgz#b41053e360c31a32c2640c9a45ee981a7e603fe0"
integrity sha512-YhzPdzb612X591FOe68q+qXVXGG2ANZRvDo0RRUtimev85rCrAlv/TLMEZw5c+kq9AbzocLTVX/h2jVIFPL9Xg==
@@ -4440,6 +4445,21 @@
lodash.merge "^4.6.2"
postcss-selector-parser "6.0.10"
"@tenderly/hardhat-tenderly@^1.7.7":
version "1.8.0"
resolved "https://registry.yarnpkg.com/@tenderly/hardhat-tenderly/-/hardhat-tenderly-1.8.0.tgz#3c77f3a8bba4d801cd3d6a98dfec2abc9359fbc2"
integrity sha512-HzyYsFZEXVALz+vDn1XesvaqrSDr3vYqlMd/A+r6pi6er1dFRlbUPW5mdalPQsbPOsBIO+PXjOlrM7mGgBdYEQ==
dependencies:
"@ethersproject/bignumber" "^5.7.0"
"@nomiclabs/hardhat-ethers" "^2.1.1"
axios "^0.27.2"
ethers "^5.7.0"
fs-extra "^10.1.0"
hardhat-deploy "^0.11.14"
js-yaml "^4.1.0"
tenderly "^0.6.0"
tslog "^4.3.1"
"@testing-library/dom@^9.0.0", "@testing-library/dom@^9.3.1":
version "9.3.3"
resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-9.3.3.tgz#108c23a5b0ef51121c26ae92eb3179416b0434f5"
@@ -4879,7 +4899,7 @@
resolved "https://registry.yarnpkg.com/@types/q/-/q-1.5.8.tgz#95f6c6a08f2ad868ba230ead1d2d7f7be3db3837"
integrity sha512-hroOstUScF6zhIi+5+x0dzqrHA1EJi+Irri6b1fxolMTqqHIV/Cg77EtnQcZqZCu8hR3mX2BzIxN4/GzI68Kfw==
"@types/qs@*":
"@types/qs@*", "@types/qs@^6.9.7":
version "6.9.10"
resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.10.tgz#0af26845b5067e1c9a622658a51f60a3934d51e8"
integrity sha512-3Gnx08Ns1sEoCrWssEgTSJs/rsT2vhGP+Ja9cnnk9k4ALxinORlQneLXFeFKOTJMOeZUFD1s7w+w2AphTpvzZw==
@@ -6034,6 +6054,21 @@ axe-core@=4.7.0:
resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.7.0.tgz#34ba5a48a8b564f67e103f0aa5768d76e15bbbbf"
integrity sha512-M0JtH+hlOL5pLQwHOLNYZaXuhqmvS8oExsqB1SBYgA4Dk7u/xx+YdGHXaK5pyUfed5mYXdlYiphWq3G8cRi5JQ==
axios@^0.21.1:
version "0.21.4"
resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575"
integrity sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==
dependencies:
follow-redirects "^1.14.0"
axios@^0.27.2:
version "0.27.2"
resolved "https://registry.yarnpkg.com/axios/-/axios-0.27.2.tgz#207658cc8621606e586c85db4b41a750e756d972"
integrity sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==
dependencies:
follow-redirects "^1.14.9"
form-data "^4.0.0"
axios@^1.0.0:
version "1.6.2"
resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.2.tgz#de67d42c755b571d3e698df1b6504cde9b0ee9f2"
@@ -6880,7 +6915,7 @@ check-types@^11.2.3:
resolved "https://registry.yarnpkg.com/check-types/-/check-types-11.2.3.tgz#1ffdf68faae4e941fce252840b1787b8edc93b71"
integrity sha512-+67P1GkJRaxQD6PKK0Et9DhwQB+vGg3PM5+aavopCpZT1lj9jeqfvpgTLAWErNj8qApkkmXlu/Ug74kmhagkXg==
chokidar@3.5.3, chokidar@^3.4.0, chokidar@^3.4.2, chokidar@^3.5.3:
chokidar@3.5.3, chokidar@^3.4.0, chokidar@^3.4.2, chokidar@^3.5.2, chokidar@^3.5.3:
version "3.5.3"
resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd"
integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==
@@ -6980,6 +7015,15 @@ cli-spinners@^2.5.0:
resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.9.2.tgz#1773a8f4b9c4d6ac31563df53b3fc1d79462fe41"
integrity sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==
cli-table3@^0.6.2:
version "0.6.3"
resolved "https://registry.yarnpkg.com/cli-table3/-/cli-table3-0.6.3.tgz#61ab765aac156b52f222954ffc607a6f01dbeeb2"
integrity sha512-w5Jac5SykAeZJKntOxJCrm63Eg5/4dhMWIcuTbo9rpE+brgaSZo0RuNJZeOyMgsUdhDeojvgyQLmjI+K50ZGyg==
dependencies:
string-width "^4.2.0"
optionalDependencies:
"@colors/colors" "1.5.0"
cli-width@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-3.0.0.tgz#a2f48437a2caa9a22436e794bf071ec9e61cedf6"
@@ -7162,6 +7206,11 @@ commander@^8.1.0, commander@^8.3.0:
resolved "https://registry.yarnpkg.com/commander/-/commander-8.3.0.tgz#4837ea1b2da67b9c616a67afbb0fafee567bca66"
integrity sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==
commander@^9.4.0:
version "9.5.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-9.5.0.tgz#bc08d1eb5cedf7ccb797a96199d41c7bc3e60d30"
integrity sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==
common-ancestor-path@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/common-ancestor-path/-/common-ancestor-path-1.0.1.tgz#4f7d2d1394d91b7abdf51871c62f71eadb0182a7"
@@ -8350,11 +8399,25 @@ dot-prop@^5.1.0:
dependencies:
is-obj "^2.0.0"
dotenv-defaults@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/dotenv-defaults/-/dotenv-defaults-2.0.2.tgz#6b3ec2e4319aafb70940abda72d3856770ee77ac"
integrity sha512-iOIzovWfsUHU91L5i8bJce3NYK5JXeAwH50Jh6+ARUdLiiGlYWfGw6UkzsYqaXZH/hjE/eCd/PlfM/qqyK0AMg==
dependencies:
dotenv "^8.2.0"
dotenv-expand@^5.1.0:
version "5.1.0"
resolved "https://registry.yarnpkg.com/dotenv-expand/-/dotenv-expand-5.1.0.tgz#3fbaf020bfd794884072ea26b1e9791d45a629f0"
integrity sha512-YXQl1DSa4/PQyRfgrv6aoNjhasp/p4qs9FjJ4q4cQk+8m4r6k4ZSiEyytKG8f8W9gi8WsQtIObNmKd+tMzNTmA==
dotenv-webpack@^8.0.1:
version "8.0.1"
resolved "https://registry.yarnpkg.com/dotenv-webpack/-/dotenv-webpack-8.0.1.tgz#6656550460a8076fab20e5ac2eac867e72478645"
integrity sha512-CdrgfhZOnx4uB18SgaoP9XHRN2v48BbjuXQsZY5ixs5A8579NxQkmMxRtI7aTwSiSQcM2ao12Fdu+L3ZS3bG4w==
dependencies:
dotenv-defaults "^2.0.2"
dotenv@^10.0.0, dotenv@~10.0.0:
version "10.0.0"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-10.0.0.tgz#3d4227b8fb95f81096cdd2b66653fb2c7085ba81"
@@ -8365,6 +8428,11 @@ dotenv@^16.0.3:
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.3.1.tgz#369034de7d7e5b120972693352a3bf112172cc3e"
integrity sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==
dotenv@^8.2.0:
version "8.6.0"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.6.0.tgz#061af664d19f7f4d8fc6e4ff9b584ce237adcb8b"
integrity sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g==
duplexer@^0.1.1, duplexer@^0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.2.tgz#3abe43aef3835f8ae077d136ddce0f276b0400e6"
@@ -8442,6 +8510,11 @@ emojis-list@^3.0.0:
resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-3.0.0.tgz#5570662046ad29e2e916e71aae260abdff4f6a78"
integrity sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==
encode-utf8@^1.0.2:
version "1.0.3"
resolved "https://registry.yarnpkg.com/encode-utf8/-/encode-utf8-1.0.3.tgz#f30fdd31da07fb596f281beb2f6b027851994cda"
integrity sha512-ucAnuBEhUK4boH2HjVYG5Q2mQyPorvv0u/ocS+zhdw0S8AlHYY+GOFhP1Gio5z4icpP2ivFSvhtFjQi8+T9ppw==
encodeurl@~1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59"
@@ -8501,7 +8574,7 @@ enhanced-resolve@^5.0.0, enhanced-resolve@^5.15.0:
graceful-fs "^4.2.4"
tapable "^2.2.0"
enquirer@^2.3.0:
enquirer@^2.3.0, enquirer@^2.3.6:
version "2.4.1"
resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.4.1.tgz#93334b3fbd74fc7097b224ab4a8fb7e40bf4ae56"
integrity sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==
@@ -8531,6 +8604,11 @@ env-paths@^2.2.0:
resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-2.2.1.tgz#420399d416ce1fbe9bc0a07c62fa68d67fd0f8f2"
integrity sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==
envfile@^6.18.0:
version "6.22.0"
resolved "https://registry.yarnpkg.com/envfile/-/envfile-6.22.0.tgz#c6f3c789a2ec522ef377e44ed9136d1e069ccab3"
integrity sha512-G9vwmk9O+eJzHh6JEfva0aTmyKtbolqGx9l/KnEVslsR3hl5XZ+g+wgY/j8gTJoikgP5upt6wxXM+E19o36iUg==
envinfo@^7.7.3, envinfo@^7.7.4:
version "7.11.0"
resolved "https://registry.yarnpkg.com/envinfo/-/envinfo-7.11.0.tgz#c3793f44284a55ff8c82faf1ffd91bc6478ea01f"
@@ -9057,7 +9135,7 @@ ethereumjs-util@^6.0.0, ethereumjs-util@^6.2.1:
ethjs-util "0.1.6"
rlp "^2.2.3"
ethers@^5.7.1, ethers@^5.7.2:
ethers@^5.7.0, ethers@^5.7.1, ethers@^5.7.2:
version "5.7.2"
resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.7.2.tgz#3a7deeabbb8c030d4126b24f84e525466145872e"
integrity sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg==
@@ -9215,7 +9293,7 @@ exponential-backoff@^3.1.1:
resolved "https://registry.yarnpkg.com/exponential-backoff/-/exponential-backoff-3.1.1.tgz#64ac7526fe341ab18a39016cd22c787d01e00bf6"
integrity sha512-dX7e/LHVJ6W3DE1MHWi9S1EYzDESENfLrYohG2G++ovZrYOkm4Knwa0mc1cn84xJOR4KEU0WSchhLbd0UklbHw==
express@^4.17.3, express@^4.18.2:
express@^4.17.3, express@^4.18.1, express@^4.18.2:
version "4.18.2"
resolved "https://registry.yarnpkg.com/express/-/express-4.18.2.tgz#3fabe08296e930c796c19e3c516979386ba9fd59"
integrity sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==
@@ -9499,7 +9577,14 @@ flatted@^3.2.9:
resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.9.tgz#7eb4c67ca1ba34232ca9d2d93e9886e611ad7daf"
integrity sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==
follow-redirects@^1.0.0, follow-redirects@^1.12.1, follow-redirects@^1.15.0:
fmix@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/fmix/-/fmix-0.1.0.tgz#c7bbf124dec42c9d191cfb947d0a9778dd986c0c"
integrity sha512-Y6hyofImk9JdzU8k5INtTXX1cu8LDlePWDFU5sftm9H+zKCr5SGrVjdhkvsim646cw5zD0nADj8oHyXMZmCZ9w==
dependencies:
imul "^1.0.0"
follow-redirects@^1.0.0, follow-redirects@^1.12.1, follow-redirects@^1.14.0, follow-redirects@^1.14.9, follow-redirects@^1.15.0:
version "1.15.3"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.3.tgz#fe2f3ef2690afce7e82ed0b44db08165b207123a"
integrity sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==
@@ -9638,7 +9723,7 @@ fs-extra@^0.30.0:
path-is-absolute "^1.0.0"
rimraf "^2.2.8"
fs-extra@^10.0.0:
fs-extra@^10.0.0, fs-extra@^10.1.0:
version "10.1.0"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.1.0.tgz#02873cfbc4084dde127eaa5f9905eef2325d1abf"
integrity sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==
@@ -10121,6 +10206,36 @@ hard-rejection@^2.1.0:
resolved "https://registry.yarnpkg.com/hard-rejection/-/hard-rejection-2.1.0.tgz#1c6eda5c1685c63942766d79bb40ae773cecd883"
integrity sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==
hardhat-deploy@^0.11.14:
version "0.11.45"
resolved "https://registry.yarnpkg.com/hardhat-deploy/-/hardhat-deploy-0.11.45.tgz#bed86118175a38a03bb58aba2ce1ed5e80a20bc8"
integrity sha512-aC8UNaq3JcORnEUIwV945iJuvBwi65tjHVDU3v6mOcqik7WAzHVCJ7cwmkkipsHrWysrB5YvGF1q9S1vIph83w==
dependencies:
"@ethersproject/abi" "^5.7.0"
"@ethersproject/abstract-signer" "^5.7.0"
"@ethersproject/address" "^5.7.0"
"@ethersproject/bignumber" "^5.7.0"
"@ethersproject/bytes" "^5.7.0"
"@ethersproject/constants" "^5.7.0"
"@ethersproject/contracts" "^5.7.0"
"@ethersproject/providers" "^5.7.2"
"@ethersproject/solidity" "^5.7.0"
"@ethersproject/transactions" "^5.7.0"
"@ethersproject/wallet" "^5.7.0"
"@types/qs" "^6.9.7"
axios "^0.21.1"
chalk "^4.1.2"
chokidar "^3.5.2"
debug "^4.3.2"
enquirer "^2.3.6"
ethers "^5.7.0"
form-data "^4.0.0"
fs-extra "^10.0.0"
match-all "^1.2.6"
murmur-128 "^0.2.1"
qs "^6.9.4"
zksync-web3 "^0.14.3"
hardhat@^2.17.1:
version "2.19.2"
resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.19.2.tgz#815819e4efd234941d495decb718b358d572e2c8"
@@ -10514,6 +10629,11 @@ humanize-ms@^1.2.1:
dependencies:
ms "^2.0.0"
hyperlinker@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/hyperlinker/-/hyperlinker-1.0.0.tgz#23dc9e38a206b208ee49bc2d6c8ef47027df0c0e"
integrity sha512-Ty8UblRWFEcfSuIaajM34LdPXIhbs1ajEX/BBPv24J+enSVaEVY63xQ6lTO9VRYS5LAoghIG0IDJ+p+IPzKUQQ==
iconoir-react@^6.9.0:
version "6.11.0"
resolved "https://registry.yarnpkg.com/iconoir-react/-/iconoir-react-6.11.0.tgz#a88d896148c8389138ec931ce7367f3abc6a7144"
@@ -10605,6 +10725,11 @@ import-local@^3.0.2:
pkg-dir "^4.2.0"
resolve-cwd "^3.0.0"
imul@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/imul/-/imul-1.0.1.tgz#9d5867161e8b3de96c2c38d5dc7cb102f35e2ac9"
integrity sha512-WFAgfwPLAjU66EKt6vRdTlKj4nAgIDQzh29JonLa4Bqtl6D8JrIMvWjCnx7xEjVNmP3U0fM5o8ZObk7d0f62bA==
imurmurhash@^0.1.4:
version "0.1.4"
resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea"
@@ -13306,6 +13431,11 @@ map-obj@^4.0.0:
resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-4.3.0.tgz#9304f906e93faae70880da102a9f1df0ea8bb05a"
integrity sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==
match-all@^1.2.6:
version "1.2.6"
resolved "https://registry.yarnpkg.com/match-all/-/match-all-1.2.6.tgz#66d276ad6b49655551e63d3a6ee53e8be0566f8d"
integrity sha512-0EESkXiTkWzrQQntBu2uzKvLu6vVkUGz40nGPbSZuegcfE5UuSzNjLaIu76zJWuaT/2I3Z/8M06OlUOZLGwLlQ==
mcl-wasm@^0.7.1:
version "0.7.9"
resolved "https://registry.yarnpkg.com/mcl-wasm/-/mcl-wasm-0.7.9.tgz#c1588ce90042a8700c3b60e40efb339fc07ab87f"
@@ -13806,6 +13936,15 @@ multimatch@5.0.0:
arrify "^2.0.1"
minimatch "^3.0.4"
murmur-128@^0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/murmur-128/-/murmur-128-0.2.1.tgz#a9f6568781d2350ecb1bf80c14968cadbeaa4b4d"
integrity sha512-WseEgiRkI6aMFBbj8Cg9yBj/y+OdipwVC7zUo3W2W1JAJITwouUOtpqsmGSg67EQmwwSyod7hsVsWY5LsrfQVg==
dependencies:
encode-utf8 "^1.0.2"
fmix "^0.1.0"
imul "^1.0.0"
mute-stream@0.0.8, mute-stream@~0.0.4:
version "0.0.8"
resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d"
@@ -15988,7 +16127,7 @@ qs@6.11.0:
dependencies:
side-channel "^1.0.4"
qs@^6.11.0, qs@^6.11.2:
qs@^6.11.0, qs@^6.11.2, qs@^6.9.4:
version "6.11.2"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.2.tgz#64bea51f12c1f5da1bc01496f48ffcff7c69d7d9"
integrity sha512-tDNIz22aBzCDxLtVH++VnTfzxlfeK5CbqohpSqpJgj1Wg/cQbStNAz3NuqCs5vV+pjBsK4x4pN9HlVh7rcYRiA==
@@ -17930,6 +18069,21 @@ tempy@^0.6.0:
type-fest "^0.16.0"
unique-string "^2.0.0"
tenderly@^0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/tenderly/-/tenderly-0.6.0.tgz#fb74e672a3b6dcfe66c8fd44c79ab91a9233f3eb"
integrity sha512-uPnR5ujR1j0Aay4nuqymTY2nu3e0yDjl6dHBqkTTIYEDzyzaDLx2+PkVxjT5RWseAbWORsa6GYetletATf1zmQ==
dependencies:
axios "^0.27.2"
cli-table3 "^0.6.2"
commander "^9.4.0"
express "^4.18.1"
hyperlinker "^1.0.0"
js-yaml "^4.1.0"
open "^8.4.0"
prompts "^2.4.2"
tslog "^4.4.0"
terminal-link@^2.0.0:
version "2.1.1"
resolved "https://registry.yarnpkg.com/terminal-link/-/terminal-link-2.1.1.tgz#14a64a27ab3c0df933ea546fba55f2d078edc994"
@@ -18229,6 +18383,11 @@ tslib@^2.0.3, tslib@^2.1.0, tslib@^2.3.0, tslib@^2.4.0, tslib@^2.6.0, tslib@^2.6
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae"
integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==
tslog@^4.3.1, tslog@^4.4.0:
version "4.9.2"
resolved "https://registry.yarnpkg.com/tslog/-/tslog-4.9.2.tgz#35de3a073784dfe3849caeaa028010c7a62b7f4a"
integrity sha512-wBM+LRJoNl34Bdu8mYEFxpvmOUedpNUwMNQB/NcuPIZKwdDde6xLHUev3bBjXQU7gdurX++X/YE7gLH8eXYsiQ==
tsort@0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/tsort/-/tsort-0.0.1.tgz#e2280f5e817f8bf4275657fd0f9aebd44f5a2786"
@@ -19563,3 +19722,8 @@ yocto-queue@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"
integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==
zksync-web3@^0.14.3:
version "0.14.4"
resolved "https://registry.yarnpkg.com/zksync-web3/-/zksync-web3-0.14.4.tgz#0b70a7e1a9d45cc57c0971736079185746d46b1f"
integrity sha512-kYehMD/S6Uhe1g434UnaMN+sBr9nQm23Ywn0EUP5BfQCsbjcr3ORuS68PosZw8xUTu3pac7G6YMSnNHk+fwzvg==