Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tmp #26

Closed
wants to merge 4 commits into from
Closed

Tmp #26

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: PR Comment

on:
workflow_run:
workflows: [Test]
types:
- completed

permissions:
actions: read
issues: write
checks: read
statuses: read
pull-requests: write

jobs:
comment:
uses: bgd-labs/github-workflows/.github/workflows/comment.yml@main
secrets:
READ_ONLY_PAT: ${{ secrets.READ_ONLY_PAT }}
12 changes: 0 additions & 12 deletions .github/workflows/main.yml

This file was deleted.

48 changes: 48 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Test

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
pull_request:
push:
branches:
- main

jobs:
test:
name: Foundry build n test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- uses: bgd-labs/action-rpc-env@main
with:
ALCHEMY_API_KEY: ${{ secrets.ALCHEMY_API_KEY }}

# we simply use foundry zk for all jobs in this repo
- name: Run Foundry setup
uses: bgd-labs/github-workflows/.github/actions/foundry-setup@main

- name: Run Forge tests
id: test
uses: bgd-labs/github-workflows/.github/actions/foundry-test@main

- name: Run Gas report
uses: bgd-labs/github-workflows/.github/actions/foundry-gas-report@main

- name: Run Lcov report
uses: bgd-labs/github-workflows/.github/actions/foundry-lcov-report@main

- name: Run Forge tests
uses: bgd-labs/github-workflows/.github/actions/comment-artifact@main

# we let failing tests pass so we can log them in the comment, still we want the ci to fail
- name: Post test
if: ${{ steps.test.outputs.testStatus != 0 }}
run: |
echo "tests failed"
exit 1
3 changes: 0 additions & 3 deletions security/certora/confs/verifyVotingStrategy_unittests.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
"aave-token-v2=lib/aave-token-v3/lib/aave-token-v2/contracts",
"aave-token-v3=lib/aave-token-v3/src",
"forge-std=lib/forge-std/src",
"hyperlane-monorepo=lib/aave-delivery-infrastructure/lib/hyperlane-monorepo/solidity",
"openzeppelin-contracts=lib/aave-delivery-infrastructure/lib/openzeppelin-contracts",
"solidity-examples=lib/aave-delivery-infrastructure/lib/solidity-examples/contracts",
"solidity-utils=lib/solidity-utils/src"
],
"verify": "VotingStrategy:security/certora/specs/VotingStrategy_unittests.spec",
Expand All @@ -24,4 +22,3 @@
"solc": "solc8.19",
"msg": "VotingStrategy tests"
}

2 changes: 0 additions & 2 deletions security/certora/confs/voting/verifyLegality.conf
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
"aave-token-v2=lib/aave-token-v3/lib/aave-token-v2/contracts",
"aave-token-v3=lib/aave-token-v3/src",
"forge-std=lib/forge-std/src",
"hyperlane-monorepo=lib/aave-delivery-infrastructure/lib/hyperlane-monorepo/solidity",
"openzeppelin-contracts=lib/openzeppelin-contracts",
"solidity-examples=lib/aave-delivery-infrastructure/lib/solidity-examples/contracts",
"solidity-utils=lib/solidity-utils/src"
],
"verify": "VotingMachineHarness:security/certora/specs/voting/legality.spec",
Expand Down
2 changes: 0 additions & 2 deletions security/certora/confs/voting/verifyMisc.conf
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
"aave-token-v2=lib/aave-token-v3/lib/aave-token-v2/contracts",
"aave-token-v3=lib/aave-token-v3/src",
"forge-std=lib/forge-std/src",
"hyperlane-monorepo=lib/aave-delivery-infrastructure/lib/hyperlane-monorepo/solidity",
"openzeppelin-contracts=lib/openzeppelin-contracts",
"solidity-examples=lib/aave-delivery-infrastructure/lib/solidity-examples/contracts",
"solidity-utils=lib/solidity-utils/src"
],
"verify": "VotingMachineHarnessTriple:security/certora/specs/voting/misc.spec",
Expand Down
2 changes: 0 additions & 2 deletions security/certora/confs/voting/verifyPower_summary.conf
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
"aave-token-v2=lib/aave-token-v3/lib/aave-token-v2/contracts",
"aave-token-v3=lib/aave-token-v3/src",
"forge-std=lib/forge-std/src",
"hyperlane-monorepo=lib/aave-delivery-infrastructure/lib/hyperlane-monorepo/solidity",
"openzeppelin-contracts=lib/openzeppelin-contracts",
"solidity-examples=lib/aave-delivery-infrastructure/lib/solidity-examples/contracts",
"solidity-utils=lib/solidity-utils/src"
],
"verify": "VotingMachineHarnessTriple:security/certora/specs/voting/power_summary.spec",
Expand Down
2 changes: 0 additions & 2 deletions security/certora/confs/voting/verifyProposal_config.conf
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
"aave-token-v2=lib/aave-token-v3/lib/aave-token-v2/contracts",
"aave-token-v3=lib/aave-token-v3/src",
"forge-std=lib/forge-std/src",
"hyperlane-monorepo=lib/aave-delivery-infrastructure/lib/hyperlane-monorepo/solidity",
"openzeppelin-contracts=lib/openzeppelin-contracts",
"solidity-examples=lib/aave-delivery-infrastructure/lib/solidity-examples/contracts",
"solidity-utils=lib/solidity-utils/src"
],
"verify": "VotingMachineHarness:security/certora/specs/voting/proposal_config.spec",
Expand Down
2 changes: 0 additions & 2 deletions security/certora/confs/voting/verifyProposal_states.conf
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
"aave-token-v2=lib/aave-token-v3/lib/aave-token-v2/contracts",
"aave-token-v3=lib/aave-token-v3/src",
"forge-std=lib/forge-std/src",
"hyperlane-monorepo=lib/aave-delivery-infrastructure/lib/hyperlane-monorepo/solidity",
"openzeppelin-contracts=lib/openzeppelin-contracts",
"solidity-examples=lib/aave-delivery-infrastructure/lib/solidity-examples/contracts",
"solidity-utils=lib/solidity-utils/src"
],
"verify": "VotingMachineHarness:security/certora/specs/voting/proposal_states.spec",
Expand Down
2 changes: 0 additions & 2 deletions security/certora/confs/voting/verifyVoting_and_tally.conf
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
"aave-token-v2=lib/aave-token-v3/lib/aave-token-v2/contracts",
"aave-token-v3=lib/aave-token-v3/src",
"forge-std=lib/forge-std/src",
"hyperlane-monorepo=lib/aave-delivery-infrastructure/lib/hyperlane-monorepo/solidity",
"openzeppelin-contracts=lib/openzeppelin-contracts",
"solidity-examples=lib/aave-delivery-infrastructure/lib/solidity-examples/contracts",
"solidity-utils=lib/solidity-utils/src"
],
"verify": "VotingMachineHarness:security/certora/specs/voting/voting_and_tally.spec",
Expand Down
7 changes: 5 additions & 2 deletions security/certora/specs/Governance.spec
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ definition state_changing_function(method f) returns bool =
definition initializeSig(method f) returns bool =
f.selector == sig:initialize(address,address,address, IGovernanceCore.SetVotingConfigInput[],address[],uint256,uint256).selector;

definition initializeWithRevisionSig(method f) returns bool =
f.selector == sig:initializeWithRevision(uint256).selector;

definition isTerminalState(IGovernanceCore.State state) returns bool =
state == IGovernanceCore.State.Executed || // 4
state == IGovernanceCore.State.Failed || // 5
Expand Down Expand Up @@ -459,7 +462,7 @@ rule single_state_transition_per_block_non_creator_witness
// A unauthorized user (not an owner) cannot change voting parameters
rule only_owner_can_set_voting_config(method f) filtered {
f -> !f.isView &&
!initializeSig(f) }
!initializeSig(f) && !initializeWithRevisionSig(f)}
{
env e;
calldataarg args;
Expand Down Expand Up @@ -535,7 +538,7 @@ rule guardian_can_cancel()
// Only a guardian, an owner can cancel any proposal, a creator can cancel his own proposal
rule only_guardian_can_cancel(method f)filtered
{ f -> !f.isView &&
!initializeSig(f)
!initializeSig(f) && !initializeWithRevisionSig(f)
}
{
env e1;
Expand Down
Loading