Skip to content

Commit 31a25a4

Browse files
committed
Fix: Update contract and tests to use consistent custom errors
1 parent 647d180 commit 31a25a4

13 files changed

Lines changed: 162 additions & 207 deletions

CONTRIBUTING.md

Lines changed: 0 additions & 62 deletions
This file was deleted.

cache/test-failures

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
testDeposit_EventEmission|testEdgeCase_MaxUint256Deposit|testIntegration_EventSequence|testMultiUserFixture|testPause_AlreadyPaused_Reverts|testWithdraw_EventEmission
1+
testDeposit_PausedContract_Reverts|testDeposit_Validation_MaxUint256|testDeposit_Validation_PausedContract|testEdgeCase_MaxUint256Deposit|testIntegration_FullDepositWithdrawFlow|testOwnership_NonOwnerTransfer_Reverts|testOwnership_TransferToZeroAddress_Reverts|testOwnership_Validation_NonOwner|testOwnership_Validation_ZeroAddress|testPause_AlreadyPaused_Reverts|testPause_NonOwner_Reverts|testPause_Validation_AlreadyPaused|testPause_Validation_NonOwner|testReentrancy_ExternalCallProtection|testTimeLock_JustBeforeUnlock|testUnpause_NonOwner_Reverts|testUnpause_NotPaused_Reverts|testUnpause_Validation_NonOwner|testUnpause_Validation_NotPaused|testWithdraw_BeforeUnlock_Reverts|testWithdraw_NotOwner_Reverts|testWithdraw_PausedContract_Reverts|testWithdraw_Validation_OnlyOwner|testWithdraw_Validation_PausedContract|testWithdraw_Validation_TimeLock|testAccessControls|testAllIntegrationFeatures|testAllSecurityFeatures|testContractPausing|testCustomErrors|testDepositLimits|testDirectETHTransfers|testEmergencyMode|testEventEmissions|testFullDepositWithdrawCycle|testMultipleDepositsSameUser|testReentrancyProtection|testStatisticsTracking

frontend/index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Ajo PiggyBank</title>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
<script type="module" src="/src/main.tsx"></script>
12+
</body>
13+
</html>

frontend/package.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"name": "ajo-piggybank-frontend",
3+
"private": true,
4+
"version": "0.1.0",
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite",
8+
"build": "tsc && vite build",
9+
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
10+
"preview": "vite preview",
11+
"test": "vitest",
12+
"test:ui": "vitest --ui",
13+
"test:coverage": "vitest --coverage"
14+
},
15+
"dependencies": {
16+
"@reown/appkit": "^1.0.0",
17+
"@reown/appkit-adapter-wagmi": "^1.0.0",
18+
"@tanstack/react-query": "^5.45.0",
19+
"react": "^19.0.0",
20+
"react-dom": "^19.0.0",
21+
"viem": "^2.17.3",
22+
"wagmi": "^2.12.0"
23+
},
24+
"devDependencies": {
25+
"@testing-library/jest-dom": "^6.4.6",
26+
"@testing-library/react": "^16.0.0",
27+
"@types/react": "^19.0.0",
28+
"@types/react-dom": "^19.0.0",
29+
"@typescript-eslint/eslint-plugin": "^8.0.0",
30+
"@typescript-eslint/parser": "^8.0.0",
31+
"@vitejs/plugin-react": "^4.3.1",
32+
"@vitest/coverage-v8": "^2.0.5",
33+
"@vitest/ui": "^2.0.5",
34+
"autoprefixer": "^10.4.19",
35+
"eslint": "^9.8.0",
36+
"eslint-plugin-react-hooks": "^5.1.0",
37+
"eslint-plugin-react-refresh": "^0.4.11",
38+
"jsdom": "^25.0.0",
39+
"postcss": "^8.4.38",
40+
"tailwindcss": "^3.4.4",
41+
"typescript": "^5.5.3",
42+
"vite": "^7.0.0",
43+
"vitest": "^2.0.5"
44+
}
45+
}

frontend/playwright.config.ts

Lines changed: 0 additions & 38 deletions
This file was deleted.

frontend/postcss.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
export default {
22
plugins: {
3-
'@tailwindcss/postcss': {},
3+
tailwindcss: {},
4+
autoprefixer: {},
45
},
56
}

frontend/scripts/switch-env.ps1

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
param(
2+
[Parameter(Mandatory=$true)]
3+
[ValidateSet("local", "sepolia", "mainnet")]
4+
[string]$Environment
5+
)
6+
7+
if ($Environment -eq "local") {
8+
Write-Host "Switching to local development environment (Anvil)"
9+
@"
10+
VITE_REOWN_PROJECT_ID=your_reown_project_id_here
11+
VITE_PIGGYBANK_ADDRESS=0x5FbDB2315678afecb367f032d93F642f64180aa3
12+
"@ | Out-File -FilePath .env -Encoding UTF8
13+
} elseif ($Environment -eq "sepolia") {
14+
Write-Host "Switching to Base Sepolia testnet"
15+
@"
16+
VITE_REOWN_PROJECT_ID=your_reown_project_id_here
17+
VITE_PIGGYBANK_ADDRESS=deployed_sepolia_address
18+
"@ | Out-File -FilePath .env -Encoding UTF8
19+
} elseif ($Environment -eq "mainnet") {
20+
Write-Host "Switching to Base mainnet"
21+
@"
22+
VITE_REOWN_PROJECT_ID=your_reown_project_id_here
23+
VITE_PIGGYBANK_ADDRESS=deployed_mainnet_address
24+
"@ | Out-File -FilePath .env -Encoding UTF8
25+
}
26+
27+
Write-Host "Environment switched to $Environment"

frontend/scripts/switch-env.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
3+
ENV=$1
4+
5+
if [ "$ENV" = "local" ]; then
6+
echo "Switching to local development environment (Anvil)"
7+
cat > .env << EOF
8+
VITE_REOWN_PROJECT_ID=your_reown_project_id_here
9+
VITE_PIGGYBANK_ADDRESS=0x5FbDB2315678afecb367f032d93F642f64180aa3
10+
EOF
11+
elif [ "$ENV" = "sepolia" ]; then
12+
echo "Switching to Base Sepolia testnet"
13+
cat > .env << EOF
14+
VITE_REOWN_PROJECT_ID=your_reown_project_id_here
15+
VITE_PIGGYBANK_ADDRESS=deployed_sepolia_address
16+
EOF
17+
elif [ "$ENV" = "mainnet" ]; then
18+
echo "Switching to Base mainnet"
19+
cat > .env << EOF
20+
VITE_REOWN_PROJECT_ID=your_reown_project_id_here
21+
VITE_PIGGYBANK_ADDRESS=deployed_mainnet_address
22+
EOF
23+
else
24+
echo "Usage: $0 {local|sepolia|mainnet}"
25+
exit 1
26+
fi
27+
28+
echo "Environment switched to $ENV"

frontend/tailwind.config.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/** @type {import('tailwindcss').Config} */
2+
export default {
3+
content: [
4+
"./index.html",
5+
"./src/**/*.{js,ts,jsx,tsx}",
6+
],
7+
theme: {
8+
extend: {},
9+
},
10+
plugins: [],
11+
}

frontend/tsconfig.app.json

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)