-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathverify-code.sh
More file actions
executable file
·98 lines (83 loc) · 2.43 KB
/
verify-code.sh
File metadata and controls
executable file
·98 lines (83 loc) · 2.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#!/bin/bash
set -e
echo "EURxy Stablecoin Verification"
echo "============================="
# Check for Solidity files
SOLIDITY_FILES=$(find ./contracts -name "*.sol" | wc -l)
echo "Found $SOLIDITY_FILES Solidity files"
# Verify basic structure
echo -e "\nVerifying contract structure:"
# Check main contracts
for CONTRACT in StableCoin.sol Vault.sol
do
if [ -f "./contracts/$CONTRACT" ]; then
echo "✓ $CONTRACT exists"
else
echo "✗ $CONTRACT is missing"
fi
done
# Check interfaces
for INTERFACE in IVault.sol IPriceOracle.sol
do
if [ -f "./contracts/interfaces/$INTERFACE" ]; then
echo "✓ Interface $INTERFACE exists"
else
echo "✗ Interface $INTERFACE is missing"
fi
done
# Check mocks
if [ -f "./contracts/mocks/MockPriceOracle.sol" ]; then
echo "✓ MockPriceOracle exists"
else
echo "✗ MockPriceOracle is missing"
fi
# Verify Solidity version
WRONG_VERSION=$(grep -l "pragma solidity \^0.8.20" $(find ./contracts -name "*.sol") 2>/dev/null | wc -l)
if [ "$WRONG_VERSION" -eq "0" ]; then
echo "✓ All contracts use Solidity version 0.8.17"
else
echo "✗ Found $WRONG_VERSION contracts with incompatible Solidity version"
fi
# Check for key functionality
echo -e "\nVerifying core functionality:"
# EURxy token
if grep -q "contract EURxy" ./contracts/StableCoin.sol; then
echo "✓ EURxy token implementation found"
else
echo "✗ EURxy token implementation missing"
fi
# EUR price feed
if grep -q "eurPriceFeed" ./contracts/StableCoin.sol; then
echo "✓ EUR price feed integration found"
else
echo "✗ EUR price feed integration missing"
fi
# Collateral management
if grep -q "CollateralPosition" ./contracts/interfaces/IVault.sol; then
echo "✓ Collateral position structure found"
else
echo "✗ Collateral position structure missing"
fi
# Vault functionality
VAULT_FUNCTIONS=("deposit" "withdraw" "borrowEURxy" "repayEURxy" "liquidate")
for FUNC in "${VAULT_FUNCTIONS[@]}"
do
if grep -q "function $FUNC" ./contracts/interfaces/IVault.sol; then
echo "✓ Vault function '$FUNC' found"
else
echo "✗ Vault function '$FUNC' missing"
fi
done
# Check Docker setup
echo -e "\nVerifying Docker setup:"
if [ -f "./docker-compose.yml" ]; then
echo "✓ Docker Compose configuration exists"
else
echo "✗ Docker Compose configuration missing"
fi
if [ -f "./docker/Dockerfile" ]; then
echo "✓ Dockerfile exists"
else
echo "✗ Dockerfile missing"
fi
echo -e "\nVerification complete!"