diff --git a/README.md b/README.md index c4e4bf97..21113495 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,9 @@ After deployment, governance must set the `cap` value using the `file` function. #### DssVestSuckable -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. +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. + +To choose between Dai and USDS, supply the relevant join (`MCD_JOIN_DAI` or `USDS_JOIN`) as the `address _join` constructor parameter. A `vat.live` check is introduced to disable `vest()` in the event of Emergency Shutdown (aka Global Settlement). diff --git a/src/DssVest.t.sol b/src/DssVest.t.sol index 26d8350b..3ff9eba4 100644 --- a/src/DssVest.t.sol +++ b/src/DssVest.t.sol @@ -30,8 +30,6 @@ interface ERC20Like is GemLike { function balanceOf(address) external returns (uint256); } -interface JoinLike {} - interface DSTokenLike { function balanceOf(address) external returns (uint256); } @@ -101,9 +99,9 @@ contract DssVestTest is DSTest { MkrAuthorityLike authority; VatLike vat; ERC20Like dai; - JoinLike daiJoin; + address daiJoin; ERC20Like usds; - JoinLike usdsJoin; + address usdsJoin; EndLike end; address VOW; @@ -116,17 +114,17 @@ contract DssVestTest is DSTest { authority = MkrAuthorityLike( chainlog.getAddress("GOV_GUARD")); vat = VatLike( chainlog.getAddress("MCD_VAT")); dai = ERC20Like( chainlog.getAddress("MCD_DAI")); - daiJoin = JoinLike( chainlog.getAddress("MCD_JOIN_DAI")); + daiJoin = chainlog.getAddress("MCD_JOIN_DAI"); usds = ERC20Like( chainlog.getAddress("USDS")); - usdsJoin = JoinLike( chainlog.getAddress("USDS_JOIN")); + usdsJoin = chainlog.getAddress("USDS_JOIN"); end = EndLike( chainlog.getAddress("MCD_END")); VOW = chainlog.getAddress("MCD_VOW"); mVest = new DssVestMintable(address(gem)); mVest.file("cap", (2000 * WAD) / (4 * 365 days)); - sVest = new DssVestSuckable(address(chainlog), address(daiJoin)); + sVest = new DssVestSuckable(address(chainlog), daiJoin); sVest.file("cap", (2000 * WAD) / (4 * 365 days)); - sVestUsds = new DssVestSuckable(address(chainlog), address(usdsJoin)); + sVestUsds = new DssVestSuckable(address(chainlog), usdsJoin); sVestUsds.file("cap", (2000 * WAD) / (4 * 365 days)); boss = new Manager(); tVest = new DssVestTransferrable(address(boss), address(dai));