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

D3M version 2.0 #46

Merged
merged 200 commits into from
Dec 2, 2022
Merged
Show file tree
Hide file tree
Changes from 75 commits
Commits
Show all changes
200 commits
Select commit Hold shift + click to select a range
91977d2
Modularize (#31)
iamchrissmith May 6, 2022
096b400
add space
iamchrissmith May 9, 2022
8f5dc0f
update spacing, visibility and location of RAY
iamchrissmith May 9, 2022
ec87b8d
add Natspec comments to base Pool, Plan and Hub contracts (#43)
iamchrissmith May 10, 2022
4e8cfee
Extract test_sets_dai_value from base tests.
talbaneth May 17, 2022
c1543bf
Remove redundant rely
talbaneth May 17, 2022
004d91d
Merge pull request #50 from makerdao/v2-minor-testing-changes
talbaneth May 17, 2022
9f7da86
grammar
iamchrissmith May 17, 2022
87b03ba
fix if condition for block number (#48)
iamchrissmith May 18, 2022
9e9e15f
remove space
iamchrissmith May 25, 2022
d7c617d
fix end address
iamchrissmith May 25, 2022
328d4e3
update end in aave tests
iamchrissmith May 25, 2022
682dfcc
improve skaave failure test
iamchrissmith May 26, 2022
c0fc144
update pragma to be more flexible
iamchrissmith May 26, 2022
60c6945
add hope/nope to the pool to be able to update the hub
iamchrissmith May 26, 2022
5945130
use interfaces in Hub
iamchrissmith May 26, 2022
c2cf3f9
add nope to hub
iamchrissmith May 26, 2022
602d69b
add comments for hub.nope()
iamchrissmith May 26, 2022
2b42ca4
fix storage ordering and move auth functions
iamchrissmith May 26, 2022
2441ec9
add tests for pool quit and unwind/wind upgrade paths
iamchrissmith May 31, 2022
b6f6c0d
add test for plan swap
iamchrissmith May 31, 2022
92c7a17
add hub upgrade tests
iamchrissmith May 31, 2022
22c50f5
reorder events
iamchrissmith Jun 1, 2022
2810c54
remove unneeded cage event
iamchrissmith Jun 1, 2022
d852ed7
add getter functions for d3m ilks
iamchrissmith Jun 1, 2022
920163c
add ink/art to cull event
iamchrissmith Jun 1, 2022
ae7f59a
add wad to uncull event
iamchrissmith Jun 1, 2022
50a7bc5
add bar == 0 sets not active
iamchrissmith Jun 1, 2022
8ce2fe3
add exec fail test for non-existant ilk
iamchrissmith Jun 1, 2022
9f7269d
add pre and post hooks for exec and reap
iamchrissmith Jun 1, 2022
780c30d
Forge ci (#49)
iamchrissmith Jun 1, 2022
4c50f54
fix ordering of internal functions in hub
iamchrissmith Jun 1, 2022
feb160d
remove unneeded calculateTargetSupply public function
iamchrissmith Jun 1, 2022
711fdec
move aave integration test out of pool folder
iamchrissmith Jun 1, 2022
0db15ac
fix comment typo
iamchrissmith Jun 1, 2022
5964163
fix integration test relative paths
iamchrissmith Jun 1, 2022
c413f1c
Merge branch 'v2' of github.com:makerdao/dss-direct-deposit into v2
iamchrissmith Jun 1, 2022
1690c02
fix file function consistency
iamchrissmith Jun 1, 2022
40f35c0
remove unneeded param from unwind
iamchrissmith Jun 1, 2022
3de376c
add rate == 1 require to exec
iamchrissmith Jun 1, 2022
3d5415e
fix spacing
iamchrissmith Jun 1, 2022
6a87cda
check active on pool/plan in reap
iamchrissmith Jun 1, 2022
bb67844
Merge branch 'v2' of github.com:makerdao/dss-direct-deposit into v2
iamchrissmith Jun 1, 2022
bb29c64
fix cull comment
iamchrissmith Jun 1, 2022
cef3311
store tic as timestamp + tau
iamchrissmith Jun 1, 2022
1f819f5
remove tau cage test fail
iamchrissmith Jun 1, 2022
9248e00
fix requires in reap
iamchrissmith Jun 1, 2022
a726e7b
add bool return to deposit and withdraw
iamchrissmith Jun 1, 2022
2d7b7d0
add withdraw require to reap
iamchrissmith Jun 1, 2022
862e431
remove unneeded approval for pool to aave pool for adai
iamchrissmith Jun 1, 2022
4e957bc
change from recoverTokens to recoverDai for Pools
iamchrissmith Jun 1, 2022
e6c7531
prevent dup caging of pool
iamchrissmith Jun 1, 2022
5dc6d4c
use wad in pool functions
iamchrissmith Jun 1, 2022
c2d7d56
pin solc in ci
iamchrissmith Jun 1, 2022
609576b
add test showing left over ink after cage if debt repaid
iamchrissmith Jun 1, 2022
046b6f9
Solc upgrade (#47)
iamchrissmith Jun 1, 2022
74d1971
add test for wind/unwind token with less than 18 decimals
iamchrissmith Jun 1, 2022
1213294
move unwind int overflow check to min from require
iamchrissmith Jun 1, 2022
d194054
move int overflow for wind to min checks
iamchrissmith Jun 1, 2022
e7a0190
refactor toWind to one assignment
iamchrissmith Jun 1, 2022
29bf32d
make unwind params easier to read
iamchrissmith Jun 1, 2022
09cc6c4
add reentrancy protection in hub
iamchrissmith Jun 1, 2022
2949283
add test that cull fails with no ilk
iamchrissmith Jun 1, 2022
e6ba624
update mom events
iamchrissmith Jun 1, 2022
88d3623
rename intrestStrategy to tack
iamchrissmith Jun 1, 2022
dcd51f9
remove require in file and limit target rate to max bar
iamchrissmith Jun 1, 2022
8fde0a8
set rate to max of base or target rate
iamchrissmith Jun 1, 2022
9acb2f3
unwind if bar is out of bounds
iamchrissmith Jun 1, 2022
a558f3d
remove make deploy
iamchrissmith Jun 1, 2022
bb4a8fa
don't check adai address in constructor
iamchrissmith Jun 1, 2022
4867b9e
emit gift for king
iamchrissmith Jun 1, 2022
4e98e84
fix spacing
iamchrissmith Jun 1, 2022
c74ae46
fix spacing
iamchrissmith Jun 1, 2022
d600bd4
reorder pool plan variables
iamchrissmith Jun 1, 2022
92b5aef
Merge branch 'v2' of github.com:makerdao/dss-direct-deposit into v2
iamchrissmith Jun 1, 2022
868ee0b
DssDirectDepositHub => D3MHub and D3MAaveDai => D3MAave (#61)
gbalabasquer Jun 6, 2022
685b204
`MAXINT256` (#57)
naszam Jun 6, 2022
e6749eb
Fix error message
gbalabasquer Jun 6, 2022
aa7bada
replace tack filing what
iamchrissmith Jun 6, 2022
7b3a4b3
add higher level unchecked for aave plan math
iamchrissmith Jun 6, 2022
ae57751
add what param for pre/post debt changes
iamchrissmith Jun 6, 2022
59824e4
reorder hub immutables
iamchrissmith Jun 6, 2022
e71b6c9
add comments with links to aave contracts
iamchrissmith Jun 6, 2022
43ce23f
get rewards claimer from adai
iamchrissmith Jun 6, 2022
f328965
remove recoverDai function
iamchrissmith Jun 6, 2022
6c1969b
add loss test by @hexonaut
iamchrissmith Jun 6, 2022
f5d7fca
remove hub.nope()
iamchrissmith Jun 6, 2022
77ba07f
Add FileCopyRightText (#62)
naszam Jun 6, 2022
9a97b36
Remove quit (#64)
gbalabasquer Jun 7, 2022
b98b78a
remove unused var
iamchrissmith Jun 7, 2022
5f8f7b0
update comment for transfer
iamchrissmith Jun 7, 2022
0f277c4
Merge branch 'v2' of github.com:makerdao/dss-direct-deposit into v2
iamchrissmith Jun 7, 2022
0c769b1
add redeemable function for pools
iamchrissmith Jun 7, 2022
dae96b6
clean up aave plan active
iamchrissmith Jun 7, 2022
c6a5f92
update comments in hub for multiple d3ms
iamchrissmith Jun 7, 2022
7847b05
RAY == 1
iamchrissmith Jun 8, 2022
c3b9db9
add require to prevent winding over MAXINT256
iamchrissmith Jun 8, 2022
4383bfe
replace divup with best practice version
iamchrissmith Jun 8, 2022
9e0b89d
remove return on deposit/withdraw
iamchrissmith Jun 8, 2022
7ac5a0e
add mode protection
iamchrissmith Jun 8, 2022
6477442
rename getter functions and clear shadow warnings (#65)
iamchrissmith Jun 8, 2022
01ba7f7
fix overflow wind check
iamchrissmith Jun 9, 2022
46dcb59
remove returns from transfers
iamchrissmith Jun 9, 2022
81f2f0d
remove Pool.active and clean up (#63)
iamchrissmith Jun 9, 2022
db165e2
Update README (#67)
hexonaut Jun 10, 2022
bbbdc53
fix imgur link to ipfs
iamchrissmith Jun 10, 2022
ab45852
fix spacing in aave plan
iamchrissmith Jun 10, 2022
31b2c46
Merge branch 'v2' of github.com:makerdao/dss-direct-deposit into v2
iamchrissmith Jun 10, 2022
f5931a2
No governance after cage (#60)
gbalabasquer Jun 10, 2022
4ed4d9e
Add D3MOracle (#59)
gbalabasquer Jun 10, 2022
0150197
Assert revert (#72)
gbalabasquer Jun 13, 2022
0b16ef0
rename asset to dai in aave pool
iamchrissmith Jun 13, 2022
fdb3b39
clean up items
iamchrissmith Jun 13, 2022
7354513
enforce spot == RAY
iamchrissmith Jun 13, 2022
04ea72a
add clarity comment for bar = 0
iamchrissmith Jun 13, 2022
2bcaa8d
Fix what filing
talbaneth Jun 14, 2022
872eb84
Merge pull request #73 from makerdao/fix-assert-revert
talbaneth Jun 14, 2022
82dccde
uint256 standard
iamchrissmith Jun 14, 2022
7f14342
change enum name
iamchrissmith Jun 14, 2022
5d92279
Merge branch 'v2' of github.com:makerdao/dss-direct-deposit into v2
iamchrissmith Jun 14, 2022
c57ce78
do not pass vat to hub
iamchrissmith Jun 14, 2022
0b42cfa
minor clean up items in hub
iamchrissmith Jun 14, 2022
11d1460
dapp upgrade dss-test
gbalabasquer Jun 15, 2022
bd48549
Introduce _fix function and add tests (#70)
iamchrissmith Jun 17, 2022
d97e779
Fix FileCopyRightText + Cleanups (#75)
naszam Jun 26, 2022
d7ad368
Align pool and plan code style to Compound
talbaneth Jun 27, 2022
33bef88
more alignemnts
talbaneth Jun 27, 2022
1c81933
Minor alignment changes and return comment
talbaneth Jun 28, 2022
e1d0652
Move && a bit
talbaneth Jun 28, 2022
3bfd5a9
return back from interface alignment
talbaneth Jun 28, 2022
99bb981
Merge pull request #76 from makerdao/v2-code-style-align
talbaneth Jun 28, 2022
885fced
Update src/pools/D3MAavePool.sol
talbaneth Jun 28, 2022
41f3993
Compound (#51)
talbaneth Jun 29, 2022
d7475d9
Handle minor suggestions (#78)
talbaneth Jul 4, 2022
d460f0f
Fix aave random failures (#77)
talbaneth Jul 4, 2022
d5a31c8
Add reentrancy warning commnets for getTargetAssets (#80)
talbaneth Jul 7, 2022
5f8ee93
remove unneeded check in getTargetAssets tests
iamchrissmith Jul 26, 2022
b219eb4
add withdraw DAI balance checks to Aave and Compound - CS Audit Quest…
iamchrissmith Aug 2, 2022
ce336f3
remove unneeded casting
iamchrissmith Aug 2, 2022
c20cb03
add check on ATOKEN_REVISION for active
iamchrissmith Aug 2, 2022
0735f32
Remove reap, simplify _unwind and rebalance
gbalabasquer Aug 3, 2022
c654eb1
Add missing frob in _fix
gbalabasquer Aug 3, 2022
b35003f
Fix README
gbalabasquer Aug 3, 2022
697dcc7
Fix Hub tests
gbalabasquer Aug 3, 2022
09ff8b0
Fix Aave integration tests
gbalabasquer Aug 3, 2022
d41c5d1
Fix compound tests and minor changes to aave ones
gbalabasquer Aug 4, 2022
18be5c1
No need of assetsBalance in unwind
gbalabasquer Aug 4, 2022
b3b731c
New structure for exec + removing _fix and creating new _normal function
gbalabasquer Aug 4, 2022
ad43f82
Limit amount of fixIlk
gbalabasquer Aug 5, 2022
f657bcf
No more modes
gbalabasquer Aug 5, 2022
d28774c
cmooney-20220805: Fixes for CS 5.4 Inconsistencies (#84)
godsflaw Aug 5, 2022
138013c
Call getTargetAssets once
gbalabasquer Aug 8, 2022
fb5adca
Remove comment
gbalabasquer Aug 8, 2022
7f6f59f
Remove param in preDebtChange and postDebtChange
gbalabasquer Aug 8, 2022
308ad4c
Change <= to < in one condition
gbalabasquer Aug 8, 2022
10ce118
only call getTargetAssets if plan is active
gbalabasquer Aug 8, 2022
4634ab1
Minor changes art/Art with extra check
gbalabasquer Aug 8, 2022
6136f39
Use overloaded unwind
gbalabasquer Aug 9, 2022
c0bd2f0
Move vat.slip
gbalabasquer Aug 9, 2022
39f8512
Remove comment
gbalabasquer Aug 9, 2022
d5b5b47
Fix tests
gbalabasquer Aug 9, 2022
b9bb3fd
Fix tests failing on block 15308334
talbaneth Aug 9, 2022
2730fc5
Fix 15308526
talbaneth Aug 9, 2022
674ea9c
Add comment for rounding that may affect twice
talbaneth Aug 9, 2022
dcb6467
Minor changes _normal structure
gbalabasquer Aug 9, 2022
e0a95d3
Improve readability and comments for fixInk
gbalabasquer Aug 9, 2022
10f7874
Use standard assertRevert for lock checks
gbalabasquer Aug 9, 2022
366a25b
Add Hub tests for checking art != Art
gbalabasquer Aug 9, 2022
194c3f1
Add fixInk tests
gbalabasquer Aug 9, 2022
f7e7f2f
Treat all the variables the same in normal path
gbalabasquer Aug 9, 2022
6be7aed
Fix comments
gbalabasquer Aug 10, 2022
ae8439d
Bit of restructure of normal function
gbalabasquer Aug 10, 2022
2631e93
Change order
gbalabasquer Aug 10, 2022
d3d586e
Better use maxWithdraw for checks in tests
gbalabasquer Aug 10, 2022
37a88af
Add test and minor renaming
gbalabasquer Aug 10, 2022
5db66ba
Add certora (#85)
gbalabasquer Aug 30, 2022
b23a9fa
Add unchecked
gbalabasquer Aug 30, 2022
5e6687e
Removing some internal functions are renaming other
gbalabasquer Aug 30, 2022
26e52c8
Move getters to the bottom
gbalabasquer Aug 30, 2022
be0922d
Some minor changes
gbalabasquer Aug 31, 2022
b849427
art = ink outside of unchecked
gbalabasquer Aug 31, 2022
091ca9c
Restrict all operation to maxint256 / RAY to avoid overflows
gbalabasquer Sep 1, 2022
1ea6364
Bit better structure for _exec
gbalabasquer Sep 2, 2022
a32bb81
Minor changes to _wipe and uncull
gbalabasquer Sep 2, 2022
4e8bfaf
Tidy up
gbalabasquer Sep 2, 2022
483e1af
Use NoOp event also in _wipe
gbalabasquer Sep 2, 2022
69120fe
Minor renaming
gbalabasquer Sep 2, 2022
06a9083
Fix exec_exec
gbalabasquer Sep 5, 2022
fa9b95d
Merge branch 'v2-fixes' into remove-reap-and-rebalance
gbalabasquer Sep 6, 2022
60126bd
Add comment explaining the system cage path of exec
gbalabasquer Sep 12, 2022
a1bab00
Fix D3MAavePool comment
gbalabasquer Sep 15, 2022
c44ad1f
More precise pool shares (#87)
gbalabasquer Sep 30, 2022
64dac3a
Merge pull request #89 from makerdao/remove-reap-and-rebalance
gbalabasquer Oct 3, 2022
242dfbd
Fix spacing in Makefile
gbalabasquer Oct 10, 2022
42c4620
Fix for new version of solc-select which puts artifacts inside indivi…
gbalabasquer Oct 13, 2022
4de0e6c
Add test_borrow_apy (#91)
rockyfour Nov 23, 2022
7c706e2
Certora: Use solc optimizations where corresponds
gbalabasquer Nov 29, 2022
f4478e8
Be explicit about optimization options in test script
gbalabasquer Nov 29, 2022
7033697
add final v2 audit
iamchrissmith Nov 30, 2022
a398c48
fix rounding expectation
iamchrissmith Dec 2, 2022
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
27 changes: 10 additions & 17 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,18 @@
on: [push, pull_request]
on: [push]

jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v2
with:
submodules: recursive
- uses: actions/checkout@v3

- name: Install nix 2.3.6
uses: cachix/install-nix-action@v13
with:
install_url: https://releases.nixos.org/nix/nix-2.3.6/install
nix_path: nixpkgs=channel:nixos-unstable
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Use maker and dapp cachix
uses: cachix/cachix-action@v10
with:
name: maker
extraPullNames: dapp
- name: Install Dependencies
run: forge install

- name: Run tests
run: nix-shell --pure --argstr url ${{ secrets.ETH_RPC_URL }} --run 'dapp test -v --rpc'
- name: Run tests
run: forge test -v --force --fork-url ${{ secrets.ETH_RPC_URL }} --use 0.8.14
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "lib/ds-test"]
path = lib/ds-test
url = https://github.com/dapphub/ds-test
[submodule "lib/ds-value"]
path = lib/ds-value
url = https://github.com/dapphub/ds-value
9 changes: 4 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
all :; DAPP_BUILD_OPTIMIZE=1 DAPP_BUILD_OPTIMIZE_RUNS=200 dapp --use solc:0.6.12 build
all :; DAPP_BUILD_OPTIMIZE=1 DAPP_BUILD_OPTIMIZE_RUNS=200 dapp --use solc:0.8.14 build
clean :; dapp clean
test :; ./test.sh match=$(match) optimizer=1
test-dev :; ./test.sh match=$(match) optimizer=0
test-forge :; ./test-forge.sh match=$(match) block=$(block)
deploy :; make && dapp create DssDirectDepositAaveDai 0xdA0Ab1e0017DEbCd72Be8599041a2aa3bA7e740F 0x4449524543542d4141564556322d444149000000000000000000000000000000 0x7d2768dE32b0b80b7a3454c06BdAc94A69DDc7A9 0xd784927Ff2f95ba542BfC824c8a8a98F3495f6b5
test :; ./test.sh match="$(match)" optimizer=1
test-dev :; ./test.sh match="$(match)" optimizer=0
test-forge :; ./test-forge.sh match="$(match)" block="$(block)" match-test="$(match-test)" match-contract="$(match-contract)"
1 change: 0 additions & 1 deletion lib/ds-value
Submodule ds-value deleted from 4049ec
21 changes: 0 additions & 21 deletions shell.nix

This file was deleted.

24 changes: 12 additions & 12 deletions src/DirectDepositMom.sol → src/D3MMom.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
naszam marked this conversation as resolved.
Show resolved Hide resolved
// Copyright (C) 2021 Dai Foundation
// Copyright (C) 2021-2022 Dai Foundation
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
Expand All @@ -14,23 +14,23 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

pragma solidity 0.6.12;
pragma solidity ^0.8.14;

interface FileLike {
function file(bytes32 what, uint256 data) external;
interface DisableLike {
function disable() external;
}

interface AuthorityLike {
function canCall(address src, address dst, bytes4 sig) external view returns (bool);
}

// Bypass governance delay to disable a direct deposit module
contract DirectDepositMom {
contract D3MMom {
address public owner;
address public authority;

iamchrissmith marked this conversation as resolved.
Show resolved Hide resolved
event SetOwner(address indexed oldOwner, address indexed newOwner);
event SetAuthority(address indexed oldAuthority, address indexed newAuthority);
event SetOwner(address indexed newOwner);
event SetAuthority(address indexed newAuthority);
event Disable(address indexed who);

modifier onlyOwner {
Expand All @@ -43,9 +43,9 @@ contract DirectDepositMom {
_;
}

constructor() public {
constructor() {
owner = msg.sender;
emit SetOwner(address(0), msg.sender);
emit SetOwner(msg.sender);
}

function isAuthorized(address src, bytes4 sig) internal view returns (bool) {
Expand All @@ -62,18 +62,18 @@ contract DirectDepositMom {

// Governance actions with delay
function setOwner(address owner_) external onlyOwner {
emit SetOwner(owner, owner_);
owner = owner_;
emit SetOwner(owner_);
}

function setAuthority(address authority_) external onlyOwner {
emit SetAuthority(authority, authority_);
authority = authority_;
emit SetAuthority(authority_);
}

// Governance action without delay
function disable(address who) external auth {
FileLike(who).file("bar", 0);
DisableLike(who).disable();
iamchrissmith marked this conversation as resolved.
Show resolved Hide resolved
emit Disable(who);
}
}
71 changes: 71 additions & 0 deletions src/D3MMom.t.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
// // SPDX-License-Identifier: AGPL-3.0-or-later
naszam marked this conversation as resolved.
Show resolved Hide resolved
// // Copyright (C) 2021-2022 Dai Foundation
naszam marked this conversation as resolved.
Show resolved Hide resolved
// //
// // This program is free software: you can redistribute it and/or modify
// // it under the terms of the GNU Affero General Public License as published by
// // the Free Software Foundation, either version 3 of the License, or
// // (at your option) any later version.
// //
// // This program is distributed in the hope that it will be useful,
// // but WITHOUT ANY WARRANTY; without even the implied warranty of
// // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// // GNU Affero General Public License for more details.
// //
// // You should have received a copy of the GNU Affero General Public License
// // along with this program. If not, see <https://www.gnu.org/licenses/>.
iamchrissmith marked this conversation as resolved.
Show resolved Hide resolved

pragma solidity ^0.8.14;

import "ds-test/test.sol";
import "./tests/interfaces/interfaces.sol";

import {D3MMom} from "./D3MMom.sol";

import {D3MTestPlan} from "./tests/stubs/D3MTestPlan.sol";
interface Hevm {
function warp(uint256) external;

function store(
address,
bytes32,
bytes32
) external;

function load(address, bytes32) external view returns (bytes32);
}

contract D3MMomTest is DSTest {
Hevm hevm;

D3MTestPlan d3mTestPlan;
D3MMom d3mMom;

function setUp() public {
hevm = Hevm(
address(bytes20(uint160(uint256(keccak256("hevm cheat code")))))
);

d3mTestPlan = new D3MTestPlan(address(123));

d3mTestPlan.file("maxBar_", type(uint256).max);
d3mTestPlan.file("bar", type(uint256).max);
d3mMom = new D3MMom();
d3mTestPlan.rely(address(d3mMom));
}

function test_can_disable_plan_owner() public {
assertEq(d3mTestPlan.bar(), type(uint256).max);

d3mMom.disable(address(d3mTestPlan));

assertEq(d3mTestPlan.bar(), 0);
}

function testFail_disable_no_auth() public {
d3mMom.setOwner(address(0));
assertEq(d3mMom.authority(), address(0));
assertEq(d3mMom.owner(), address(0));

d3mMom.disable(address(d3mTestPlan));
}
}
Loading