-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from makerdao/v2
Implement v2 for Lockstake
- Loading branch information
Showing
29 changed files
with
1,114 additions
and
746 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Certora | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
certora: | ||
name: Certora | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
vote-delegate: | ||
- vote-delegate | ||
- vote-delegate-factory | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- uses: actions/setup-java@v2 | ||
with: | ||
distribution: 'zulu' | ||
java-version: '11' | ||
java-package: jre | ||
|
||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Install solc-select | ||
run: pip3 install solc-select | ||
|
||
- name: Solc Select 0.8.21 | ||
run: solc-select install 0.8.21 | ||
|
||
- name: Install Certora | ||
run: pip3 install certora-cli-beta | ||
|
||
- name: Verify ${{ matrix.vote-delegate }} | ||
run: make certora-${{ matrix.vote-delegate }} results=1 | ||
env: | ||
CERTORAKEY: ${{ secrets.CERTORAKEY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: test | ||
|
||
on: [push, pull_request] | ||
|
||
env: | ||
FOUNDRY_PROFILE: ci | ||
|
||
jobs: | ||
check: | ||
strategy: | ||
fail-fast: true | ||
|
||
name: Foundry project | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
with: | ||
version: nightly | ||
|
||
- name: Run Forge build | ||
run: | | ||
forge --version | ||
forge build --sizes | ||
id: build | ||
|
||
- name: Run Forge tests | ||
run: | | ||
forge test -vvv | ||
id: test | ||
env: | ||
ETH_RPC_URL: ${{ secrets.ETH_RPC_URL }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
/out | ||
/cache | ||
|
||
# Certora | ||
.certora_internal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[submodule "lib/ds-test"] | ||
path = lib/ds-test | ||
url = https://github.com/dapphub/ds-test | ||
[submodule "lib/dss-test"] | ||
path = lib/dss-test | ||
url = https://github.com/makerdao/dss-test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
all :; DAPP_BUILD_OPTIMIZE=1 DAPP_BUILD_OPTIMIZE_RUNS=200 dapp --use solc:0.6.12 build | ||
clean :; dapp clean | ||
test :; ./test.sh $(match) $(runs) | ||
deploy-mainnet :; make && dapp create VoteDelegateFactory 0x0a3f6849f78076aefaDf113F5BED87720274dDC0 0xD3A9FE267852281a1e6307a1C37CDfD76d39b133 | ||
deploy-kovan :; make && dapp create VoteDelegateFactory 0x27E0c9567729Ea6e3241DE74B3dE499b7ddd3fe6 0xD931E7c869618dB6FD30cfE4e89248CAA091Ea5f | ||
flatten :; hevm flatten --source-file src/VoteDelegateFactory.sol > out/VoteDelegateFactory-flattened.sol | ||
PATH := ~/.solc-select/artifacts/solc-0.8.21:$(PATH) | ||
certora-vote-delegate :; PATH=${PATH} certoraRun certora/VoteDelegate.conf$(if $(rule), --rule $(rule),)$(if $(results), --wait_for_results all,) | ||
certora-vote-delegate-factory :; PATH=${PATH} certoraRun certora/VoteDelegateFactory.conf$(if $(rule), --rule $(rule),)$(if $(results), --wait_for_results all,) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1 @@ | ||
VoteDelegate based on https://github.com/makerdao/vote-proxy | ||
|
||
Kovan Deploy: [0x1740F3bD55b1900C816A0071F8972C201566e3a3](https://kovan.etherscan.io/address/0x1740F3bD55b1900C816A0071F8972C201566e3a3#code) | ||
Mainnet Deploy: [0xD897F108670903D1d6070fcf818f9db3615AF272](https://etherscan.io/address/0xD897F108670903D1d6070fcf818f9db3615AF272#code) |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"files": [ | ||
"src/VoteDelegate.sol", | ||
"certora/harness/GovMock.sol", | ||
"certora/harness/IouMock.sol", | ||
"certora/harness/ChiefMock.sol", | ||
"certora/harness/PollingMock.sol" | ||
], | ||
"solc": "solc-0.8.21", | ||
"solc_optimize_map": { | ||
"VoteDelegate": "200", | ||
"GovMock": "0", | ||
"IouMock": "0", | ||
"ChiefMock": "0", | ||
"PollingMock": "0" | ||
}, | ||
"link": [ | ||
"VoteDelegate:gov=GovMock", | ||
"VoteDelegate:chief=ChiefMock", | ||
"VoteDelegate:polling=PollingMock", | ||
"ChiefMock:GOV=GovMock", | ||
"ChiefMock:IOU=IouMock" | ||
], | ||
"verify": "VoteDelegate:certora/VoteDelegate.spec", | ||
"rule_sanity": "basic", | ||
"optimistic_loop": true, | ||
"multi_assert_check": true, | ||
"parametric_contracts": ["VoteDelegate"], | ||
"build_cache": true, | ||
"msg": "VoteDelegate" | ||
} |
Oops, something went wrong.