Skip to content

Commit

Permalink
Update specs.json
Browse files Browse the repository at this point in the history
This JSON configuration appears to define specifications for formal verification (FV) tasks, most likely for Certora Prover or a similar tool, used to verify smart contracts
  • Loading branch information
yuvashrikarunakaran authored Dec 18, 2024
1 parent bf4d40d commit ec32ab6
Showing 1 changed file with 46 additions and 110 deletions.
156 changes: 46 additions & 110 deletions certora/specs.json
Original file line number Diff line number Diff line change
@@ -1,110 +1,46 @@
[
{
"spec": "Pausable",
"contract": "PausableHarness",
"files": ["certora/harnesses/PausableHarness.sol"]
},
{
"spec": "AccessControl",
"contract": "AccessControlHarness",
"files": ["certora/harnesses/AccessControlHarness.sol"]
},
{
"spec": "AccessControlDefaultAdminRules",
"contract": "AccessControlDefaultAdminRulesHarness",
"files": ["certora/harnesses/AccessControlDefaultAdminRulesHarness.sol"]
},
{
"spec": "AccessManager",
"contract": "AccessManagerHarness",
"files": ["certora/harnesses/AccessManagerHarness.sol"],
"options": ["--optimistic_hashing", "--optimistic_loop"]
},
{
"spec": "AccessManaged",
"contract": "AccessManagedHarness",
"files": [
"certora/harnesses/AccessManagedHarness.sol",
"certora/harnesses/AccessManagerHarness.sol"
],
"options": [
"--optimistic_hashing",
"--optimistic_loop",
"--link AccessManagedHarness:_authority=AccessManagerHarness"
]
},
{
"spec": "DoubleEndedQueue",
"contract": "DoubleEndedQueueHarness",
"files": ["certora/harnesses/DoubleEndedQueueHarness.sol"]
},
{
"spec": "Ownable",
"contract": "OwnableHarness",
"files": ["certora/harnesses/OwnableHarness.sol"]
},
{
"spec": "Ownable2Step",
"contract": "Ownable2StepHarness",
"files": ["certora/harnesses/Ownable2StepHarness.sol"]
},
{
"spec": "ERC20",
"contract": "ERC20PermitHarness",
"files": ["certora/harnesses/ERC20PermitHarness.sol"],
"options": ["--optimistic_loop"]
},
{
"spec": "ERC20FlashMint",
"contract": "ERC20FlashMintHarness",
"files": [
"certora/harnesses/ERC20FlashMintHarness.sol",
"certora/harnesses/ERC3156FlashBorrowerHarness.sol"
],
"options": ["--optimistic_loop"]
},
{
"spec": "ERC20Wrapper",
"contract": "ERC20WrapperHarness",
"files": [
"certora/harnesses/ERC20PermitHarness.sol",
"certora/harnesses/ERC20WrapperHarness.sol"
],
"options": [
"--link ERC20WrapperHarness:_underlying=ERC20PermitHarness",
"--optimistic_loop"
]
},
{
"spec": "ERC721",
"contract": "ERC721Harness",
"files": ["certora/harnesses/ERC721Harness.sol", "certora/harnesses/ERC721ReceiverHarness.sol"],
"options": ["--optimistic_loop"]
},
{
"spec": "Initializable",
"contract": "InitializableHarness",
"files": ["certora/harnesses/InitializableHarness.sol"]
},
{
"spec": "EnumerableSet",
"contract": "EnumerableSetHarness",
"files": ["certora/harnesses/EnumerableSetHarness.sol"]
},
{
"spec": "EnumerableMap",
"contract": "EnumerableMapHarness",
"files": ["certora/harnesses/EnumerableMapHarness.sol"]
},
{
"spec": "TimelockController",
"contract": "TimelockControllerHarness",
"files": ["certora/harnesses/TimelockControllerHarness.sol"],
"options": ["--optimistic_hashing", "--optimistic_loop"]
},
{
"spec": "Nonces",
"contract": "NoncesHarness",
"files": ["certora/harnesses/NoncesHarness.sol"]
}
]
{
"spec": "Nonces",
"contract": "NoncesHarness",
"files": ["certora/harnesses/NoncesHarness.sol"]
}
#!/bin/bash

# Loop through the JSON entries
configs=$(cat <<EOF
[...paste JSON here...]
EOF
)

for row in $(echo "${configs}" | jq -c '.[]'); do
spec=$(echo $row | jq -r '.spec')
contract=$(echo $row | jq -r '.contract')
files=$(echo $row | jq -r '.files | join(" ")')
options=$(echo $row | jq -r '.options | join(" ")')

# Run the verification command
certoraRun $files \
--verify $contract:$spec \
$options \
--solc solc8.10 # Replace with the correct Solidity compiler version
done
name: Formal Verification

on:
push:
branches:
- master

jobs:
verify:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup dependencies
run: |
sudo apt-get update
sudo apt-get install -y jq solc

- name: Run Certora verification
run: bash ./run_verification.sh

0 comments on commit ec32ab6

Please sign in to comment.