build: pin demo toolchains
This commit is contained in:
@@ -0,0 +1 @@
|
||||
# Copy this file to .env for local-only configuration.
|
||||
+16
@@ -1,2 +1,18 @@
|
||||
.superpowers/
|
||||
.worktrees/
|
||||
.env
|
||||
.env.local
|
||||
.demo/
|
||||
cache/
|
||||
out/
|
||||
broadcast/
|
||||
deployments/*.json
|
||||
deployments/**/*.json
|
||||
!deployments/*.example.json
|
||||
node_modules/
|
||||
web/node_modules/
|
||||
web/dist/
|
||||
web/coverage/
|
||||
web/public/deployment.json
|
||||
web/src/generated/*.ts
|
||||
!.gitkeep
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
[submodule "lib/forge-std"]
|
||||
path = lib/forge-std
|
||||
url = https://github.com/foundry-rs/forge-std
|
||||
[submodule "lib/openzeppelin-foundry-upgrades"]
|
||||
path = lib/openzeppelin-foundry-upgrades
|
||||
url = https://github.com/OpenZeppelin/openzeppelin-foundry-upgrades
|
||||
[submodule "lib/openzeppelin-contracts-upgradeable"]
|
||||
path = lib/openzeppelin-contracts-upgradeable
|
||||
url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable
|
||||
@@ -0,0 +1,19 @@
|
||||
SHELL := /bin/bash
|
||||
.SHELLFLAGS := -euo pipefail -c
|
||||
|
||||
.PHONY: doctor setup verify
|
||||
doctor:
|
||||
@./tools/doctor.sh
|
||||
setup:
|
||||
@git submodule update --init --recursive
|
||||
@npm ci
|
||||
@npm --prefix web ci
|
||||
verify:
|
||||
@forge fmt --check
|
||||
@forge clean
|
||||
@npm_config_offline=true forge build --force
|
||||
@npm_config_offline=true forge test --force
|
||||
@npm --prefix web run lint
|
||||
@npm --prefix web run typecheck
|
||||
@npm --prefix web test
|
||||
@npm --prefix web run build
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"lib/forge-std": {
|
||||
"tag": {
|
||||
"name": "v1.16.1",
|
||||
"rev": "620536fa5277db4e3fd46772d5cbc1ea0696fb43"
|
||||
}
|
||||
},
|
||||
"lib/openzeppelin-contracts-upgradeable": {
|
||||
"tag": {
|
||||
"name": "v5.6.1",
|
||||
"rev": "7bf4727aacdbfaa0f36cbd664654d0c9e1dc52bf"
|
||||
}
|
||||
},
|
||||
"lib/openzeppelin-foundry-upgrades": {
|
||||
"tag": {
|
||||
"name": "v0.4.1",
|
||||
"rev": "258e12e727bfe7f0ec30c51995d01ec88b82efc1"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
[profile.default]
|
||||
src = "src"
|
||||
test = "test"
|
||||
script = "script"
|
||||
out = "out"
|
||||
libs = ["lib"]
|
||||
solc_version = "0.8.35"
|
||||
evm_version = "cancun"
|
||||
optimizer = true
|
||||
optimizer_runs = 200
|
||||
ffi = true
|
||||
ast = true
|
||||
build_info = true
|
||||
extra_output = ["storageLayout"]
|
||||
fs_permissions = [
|
||||
{ access = "read", path = "out" },
|
||||
{ access = "read-write", path = "deployments" }
|
||||
]
|
||||
|
||||
[fuzz]
|
||||
runs = 512
|
||||
seed = "0x5555505342414e4b"
|
||||
|
||||
[invariant]
|
||||
runs = 128
|
||||
depth = 64
|
||||
fail_on_revert = true
|
||||
Submodule
+1
Submodule lib/forge-std added at 620536fa52
Submodule
+1
Submodule lib/openzeppelin-contracts-upgradeable added at 7bf4727aac
Submodule
+1
Submodule lib/openzeppelin-foundry-upgrades added at 258e12e727
Generated
+1258
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "uups-bank-demo",
|
||||
"private": true,
|
||||
"version": "0.1.0",
|
||||
"type": "module",
|
||||
"packageManager": "npm@11.17.0",
|
||||
"engines": {
|
||||
"node": ">=24.18.0 <25",
|
||||
"npm": ">=11.17.0 <12"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@openzeppelin/upgrades-core": "1.46.0"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
forge-std/=lib/forge-std/src/
|
||||
openzeppelin-foundry-upgrades/=lib/openzeppelin-foundry-upgrades/src/
|
||||
@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/
|
||||
@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/
|
||||
@@ -0,0 +1,28 @@
|
||||
import { readFile } from "node:fs/promises";
|
||||
import { createRequire } from "node:module";
|
||||
|
||||
const require = createRequire(import.meta.url);
|
||||
const expectedVersion = "1.46.0";
|
||||
const pluginSource = await readFile(
|
||||
new URL("../lib/openzeppelin-foundry-upgrades/src/internal/Versions.sol", import.meta.url),
|
||||
"utf8"
|
||||
);
|
||||
const lockfile = JSON.parse(
|
||||
await readFile(new URL("../package-lock.json", import.meta.url), "utf8")
|
||||
);
|
||||
const lockedVersion = lockfile.packages?.["node_modules/@openzeppelin/upgrades-core"]?.version;
|
||||
const installedVersion = require("@openzeppelin/upgrades-core/package.json").version;
|
||||
|
||||
if (!pluginSource.includes('UPGRADES_CORE = "^1.45.0"')) {
|
||||
throw new Error('Expected the vendored plugin to declare UPGRADES_CORE = "^1.45.0".');
|
||||
}
|
||||
|
||||
if (lockedVersion !== expectedVersion) {
|
||||
throw new Error(`Expected package-lock.json to resolve @openzeppelin/upgrades-core to ${expectedVersion}, found ${lockedVersion}.`);
|
||||
}
|
||||
|
||||
if (installedVersion !== expectedVersion) {
|
||||
throw new Error(`Expected installed @openzeppelin/upgrades-core to report ${expectedVersion}, found ${installedVersion}.`);
|
||||
}
|
||||
|
||||
console.log(`@openzeppelin/upgrades-core ${expectedVersion} is pinned and installed.`);
|
||||
Executable
+13
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
printf '%s\n' 'Expected: Foundry 1.7.1, Node 24.18.0, npm 11.17.0'
|
||||
|
||||
for tool in forge anvil node npm make; do
|
||||
if command -v "$tool" >/dev/null 2>&1; then
|
||||
printf '%s: ' "$tool"
|
||||
"$tool" --version | sed -n '1p'
|
||||
else
|
||||
printf '%s\n' "missing: $tool"
|
||||
fi
|
||||
done
|
||||
@@ -0,0 +1,24 @@
|
||||
import js from "@eslint/js";
|
||||
import globals from "globals";
|
||||
import reactHooks from "eslint-plugin-react-hooks";
|
||||
import reactRefresh from "eslint-plugin-react-refresh";
|
||||
|
||||
export default [
|
||||
{ ignores: ["dist", "coverage"] },
|
||||
js.configs.recommended,
|
||||
{
|
||||
files: ["**/*.{ts,tsx}"],
|
||||
languageOptions: {
|
||||
ecmaVersion: 2022,
|
||||
globals: { ...globals.browser, ...globals.node }
|
||||
},
|
||||
plugins: {
|
||||
"react-hooks": reactHooks,
|
||||
"react-refresh": reactRefresh
|
||||
},
|
||||
rules: {
|
||||
...reactHooks.configs.recommended.rules,
|
||||
"react-refresh/only-export-components": ["warn", { allowConstantExport: true }]
|
||||
}
|
||||
}
|
||||
];
|
||||
@@ -0,0 +1,11 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>UUPS Bank Operations Console</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
</body>
|
||||
</html>
|
||||
Generated
+4500
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,40 @@
|
||||
{
|
||||
"name": "uups-bank-operations-console",
|
||||
"private": true,
|
||||
"version": "0.1.0",
|
||||
"type": "module",
|
||||
"packageManager": "npm@11.17.0",
|
||||
"engines": { "node": ">=24.18.0 <25", "npm": ">=11.17.0 <12" },
|
||||
"scripts": {
|
||||
"dev": "vite --host 127.0.0.1",
|
||||
"lint": "eslint . --max-warnings 0",
|
||||
"typecheck": "tsc -b --pretty false",
|
||||
"test": "vitest run",
|
||||
"build": "tsc -b && vite build"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tanstack/react-query": "5.101.4",
|
||||
"react": "19.2.8",
|
||||
"react-dom": "19.2.8",
|
||||
"viem": "2.55.8",
|
||||
"wagmi": "3.7.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "10.0.1",
|
||||
"@testing-library/dom": "10.4.1",
|
||||
"@testing-library/react": "16.3.2",
|
||||
"@types/node": "24.10.0",
|
||||
"@types/react": "19.2.14",
|
||||
"@types/react-dom": "19.2.4",
|
||||
"@vitejs/plugin-react": "6.0.4",
|
||||
"eslint": "10.0.1",
|
||||
"eslint-plugin-react-hooks": "7.1.1",
|
||||
"eslint-plugin-react-refresh": "0.5.3",
|
||||
"globals": "17.7.0",
|
||||
"jsdom": "30.0.1",
|
||||
"typescript": "7.0.2",
|
||||
"typescript-eslint": "8.65.0",
|
||||
"vite": "8.2.0",
|
||||
"vitest": "4.1.10"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
export const toolchainLabels = {
|
||||
foundry: "Foundry 1.7.1",
|
||||
solidity: "Solidity 0.8.35",
|
||||
openZeppelin: "OpenZeppelin 5.6.1",
|
||||
proxy: "UUPS"
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
export {};
|
||||
@@ -0,0 +1,13 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { toolchainLabels } from "../config/toolchain";
|
||||
|
||||
describe("toolchain labels", () => {
|
||||
it("exposes the versions shown by the operations console", () => {
|
||||
expect(toolchainLabels).toEqual({
|
||||
foundry: "Foundry 1.7.1",
|
||||
solidity: "Solidity 0.8.35",
|
||||
openZeppelin: "OpenZeppelin 5.6.1",
|
||||
proxy: "UUPS"
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
||||
"target": "ES2022",
|
||||
"useDefineForClassFields": true,
|
||||
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
||||
"allowJs": false,
|
||||
"skipLibCheck": true,
|
||||
"esModuleInterop": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"strict": true,
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"noEmit": true,
|
||||
"jsx": "react-jsx"
|
||||
},
|
||||
"include": ["src"]
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"files": [],
|
||||
"references": [
|
||||
{ "path": "./tsconfig.app.json" },
|
||||
{ "path": "./tsconfig.node.json" }
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
||||
"target": "ES2023",
|
||||
"lib": ["ES2023"],
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"allowImportingTsExtensions": true,
|
||||
"verbatimModuleSyntax": true,
|
||||
"moduleDetection": "force",
|
||||
"noEmit": true,
|
||||
"skipLibCheck": true,
|
||||
"strict": true
|
||||
},
|
||||
"include": ["vite.config.ts"]
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
import react from "@vitejs/plugin-react";
|
||||
import { defineConfig } from "vitest/config";
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
test: {
|
||||
environment: "jsdom",
|
||||
globals: true,
|
||||
setupFiles: ["./src/test/setup.ts"]
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user