Skip to content

Commit d113e36

Browse files
committed
chore: sparate interfaces for clarity
1 parent 051f140 commit d113e36

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/DssBlow2.sol

+9-6
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,28 @@ interface ERC20Like {
2020
function approve(address usr, uint256 wad) external returns (bool);
2121
}
2222

23-
interface JoinLike {
23+
interface DaiJoinLike {
2424
function dai() external view returns (address);
2525
function join(address, uint256) external;
2626
}
27+
interface UsdsJoinLike is DaiJoinLike {
28+
function usds() external view returns (address);
29+
}
2730

2831
contract DssBlow2 {
2932
address public immutable vow;
3033
ERC20Like public immutable dai;
3134
ERC20Like public immutable usds;
32-
JoinLike public immutable daiJoin;
33-
JoinLike public immutable usdsJoin;
35+
DaiJoinLike public immutable daiJoin;
36+
UsdsJoinLike public immutable usdsJoin;
3437

3538
event Blow(address indexed token, uint256 amount);
3639

3740
constructor(address daiJoin_, address usdsJoin_, address vow_) {
38-
daiJoin = JoinLike(daiJoin_);
41+
daiJoin = DaiJoinLike(daiJoin_);
3942
dai = ERC20Like(daiJoin.dai());
40-
usdsJoin = JoinLike(usdsJoin_);
41-
usds = ERC20Like(usdsJoin.dai());
43+
usdsJoin = UsdsJoinLike(usdsJoin_);
44+
usds = ERC20Like(usdsJoin.usds());
4245
vow = vow_;
4346
dai.approve(daiJoin_, type(uint256).max);
4447
usds.approve(usdsJoin_, type(uint256).max);

0 commit comments

Comments
 (0)