Skip to content

Commit 41728f0

Browse files
authored
Merge pull request #65 from makerdao/refactor/suckable
Refactor: make `DssVestSuckable.join` a constructor parameter
2 parents 19a9d66 + a65e44b commit 41728f0

18 files changed

+490
-366
lines changed

.github/workflows/certora.yml

+3
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ jobs:
3232
- name: Install solc-select
3333
run: pip3 install solc-select
3434

35+
- name: Solc Select 0.5.12
36+
run: solc-select install 0.5.12
37+
3538
- name: Solc Select 0.6.12
3639
run: solc-select install 0.6.12
3740

Makefile

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1+
PATH := ~/.solc-select/artifacts/solc-0.6.12:~/.solc-select/artifacts/solc-0.5.12:~/.solc-select/artifacts:$(PATH)
12
all :; DAPP_BUILD_OPTIMIZE=1 DAPP_BUILD_OPTIMIZE_RUNS=200 dapp --use solc:0.6.12 build
23
clean :; dapp clean && rm -rf crytic-export corpus
34
test :; ./test.sh match="$(match)" block="$(block)" match-test="$(match-test)" match-contract="$(match-contract)"
4-
solc-select :; pip3 install solc-select && solc-select install 0.6.12
5+
solc-select :; pip3 install solc-select && solc-select install 0.5.12 && solc-select install 0.6.12
56
echidna-mintable :; ./echidna/echidna.sh mintable
67
echidna-suckable :; ./echidna/echidna.sh suckable
78
echidna-transferrable :; ./echidna/echidna.sh transferrable
8-
certora-mintable :; $(if $(CERTORAKEY),, @echo "set certora key"; exit 1;) certoraRun --solc ~/.solc-select/artifacts/solc-0.6.12/solc-0.6.12 src/DssVest.sol:DssVestMintable certora/DSToken.sol certora/MockAuthority.sol --link DssVestMintable:gem=DSToken DSToken:authority=MockAuthority --verify DssVestMintable:certora/DssVestMintable.spec --solc_args "['--optimize','--optimize-runs','200']" --rule_sanity $(if $(rule),--rule $(rule),) --multi_assert_check --short_output
9-
certora-suckable :; $(if $(CERTORAKEY),, @echo "set certora key"; exit 1;) certoraRun --solc ~/.solc-select/artifacts/solc-0.6.12/solc-0.6.12 src/DssVest.sol:DssVestSuckable certora/ChainLog.sol certora/Vat.sol certora/DaiJoin.sol certora/Dai.sol --link DssVestSuckable:chainlog=ChainLog DssVestSuckable:vat=Vat DssVestSuckable:daiJoin=DaiJoin DaiJoin:vat=Vat DaiJoin:dai=Dai --verify DssVestSuckable:certora/DssVestSuckable.spec --solc_args "['--optimize','--optimize-runs','200']" --rule_sanity $(if $(rule),--rule $(rule),) --multi_assert_check --short_output
10-
certora-transferrable :; $(if $(CERTORAKEY),, @echo "set certora key"; exit 1;) certoraRun --solc ~/.solc-select/artifacts/solc-0.6.12/solc-0.6.12 src/DssVest.sol:DssVestTransferrable certora/Dai.sol --link DssVestTransferrable:gem=Dai --verify DssVestTransferrable:certora/DssVestTransferrable.spec --solc_args "['--optimize','--optimize-runs','200']" --rule_sanity $(if $(rule),--rule $(rule),) --multi_assert_check --short_output
9+
certora-mintable :; PATH=${PATH} certoraRun certora/DssVestMintable.conf $(if $(rule), --rule $(rule),)
10+
certora-suckable :; PATH=${PATH} certoraRun certora/DssVestSuckable.conf $(if $(rule), --rule $(rule),)
11+
certora-transferrable :; PATH=${PATH} certoraRun certora/DssVestTransferrable.conf $(if $(rule), --rule $(rule),)
1112
deploy-mintable :; make && dapp create DssVestMintable $(gem)
1213
deploy-suckable :; make && dapp create DssVestSuckable 0xdA0Ab1e0017DEbCd72Be8599041a2aa3bA7e740F
1314
deploy-transferrable :; make && dapp create DssVestTransferrable $(owner) $(gem)

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ After deployment, governance must set the `cap` value using the `file` function.
3232

3333
#### DssVestSuckable
3434

35-
Pass the MCD [chainlog](https://github.com/makerdao/dss-chain-log) address to the constructor to set up the contract for scheduled Dai `suck`s. Note: this contract must be given authority to `suck()` Dai from the `vat`'s surplus buffer.
35+
Pass the MCD [chainlog](https://github.com/makerdao/dss-chain-log) address to the constructor to set up the contract for scheduled Dai or USDS `suck`s. Note: this contract must be given authority to `suck()` Dai from the `vat`'s surplus buffer.
36+
37+
To choose between Dai and USDS, supply the relevant join (`MCD_JOIN_DAI` or `USDS_JOIN`) as the `address _join` constructor parameter.
3638

3739
A `vat.live` check is introduced to disable `vest()` in the event of Emergency Shutdown (aka Global Settlement).
3840

certora/DssVestMintable.conf

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"verify": "DssVestMintable:certora/DssVestMintable.spec",
3+
"parametric_contracts": [
4+
"DssVestMintable"
5+
],
6+
"files": [
7+
"src/DssVest.sol:DssVestMintable",
8+
"certora/harness/DSToken.sol",
9+
"certora/harness/MockAuthority.sol"
10+
],
11+
"solc": "solc-0.6.12",
12+
"solc_optimize_map": {
13+
"DssVestMintable": "200",
14+
"DSToken": "0",
15+
"MockAuthority": "0"
16+
},
17+
"link": [
18+
"DssVestMintable:gem=DSToken",
19+
"DSToken:authority=MockAuthority"
20+
],
21+
"build_cache": true,
22+
"rule_sanity": "basic",
23+
"multi_assert_check": true,
24+
"wait_for_results": "all"
25+
}

0 commit comments

Comments
 (0)