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

Liq 2.0 #228

Merged
merged 142 commits into from Apr 2, 2021
Merged
Show file tree
Hide file tree
Changes from 140 commits
Commits
Show all changes
142 commits
Select commit Hold shift + click to select a range
b060b9b
Initial commit
kmbarry1 May 21, 2020
91bdae8
dapp init DutchOven
kmbarry1 May 21, 2020
6f0317c
dapp install ds-test
kmbarry1 May 21, 2020
ee049fd
paste in code from gist
kmbarry1 May 21, 2020
39b21c4
make it build
kmbarry1 May 21, 2020
7ec2e3a
tweak README
kmbarry1 May 21, 2020
58d5663
add license blurb
kmbarry1 May 22, 2020
48129d5
First draft for flash loan + removing loaf if lot is 0 + minor change…
gbalabasquer Jun 16, 2020
edd2e39
cmooney-20200725: various bug fixes
godsflaw Jul 25, 2020
82b8d3a
done TODO checks and fixed trailing whitespace
godsflaw Jul 28, 2020
1c5da38
ONE to RAY, removed slices, bakes public
godsflaw Jul 28, 2020
7a6942c
chore: add TODO for max/min/pay variables
Aug 7, 2020
22f6c7a
Merge pull request #6 from makerdao/cmooney-20200725
Aug 7, 2020
c189111
SC-4072: limit amount of Dai out for liquidation (#5)
godsflaw Sep 2, 2020
1e8c4c4
fix dust check
kmbarry1 Sep 3, 2020
796f13f
Merge pull request #10 from makerdao/fix-dust-check
Sep 3, 2020
051685c
feat: Add Auction Reset Functionality (SC-4635) (#7)
Sep 3, 2020
0ca5023
Price decrease function interface and sample implementations (#8)
kmbarry1 Sep 3, 2020
dd3a833
rely on oven in Dog.file (#11)
kmbarry1 Sep 4, 2020
92f8a42
rename files (#13)
kmbarry1 Sep 5, 2020
10374eb
Add on-chain tracking of live auctions (#3)
brianmcmichael Sep 10, 2020
18cf73e
feat: Add Unit Testing (SC-4636) (#9)
Sep 14, 2020
ab614d5
re-meme and minor cleanup (#15)
kmbarry1 Sep 15, 2020
c606cb3
dapp uninstall ds-test
gbalabasquer Sep 16, 2020
53efde0
dapp uninstall ds-value
gbalabasquer Sep 16, 2020
6e4f380
dapp uninstall dss
gbalabasquer Sep 16, 2020
568bfc4
Remove stuff that will not be transferred
gbalabasquer Sep 16, 2020
c450637
Merge branch 'clean' of github.com:makerdao/dutch-oven into liq-2.0
gbalabasquer Sep 16, 2020
3e5491b
Minor changes to make clipper tests to work
gbalabasquer Sep 16, 2020
f0bf624
Preliminary Circuit Breaker
andy8052 Sep 30, 2020
03c538a
use current price, not bidder maximum
kmbarry1 Oct 1, 2020
6b99f3b
Merge pull request #143 from makerdao/use-current-price
kmbarry1 Oct 1, 2020
4ac11f5
Merge branch 'master' into liq-2.0
gbalabasquer Oct 2, 2020
d567177
hole per ilk (#141)
gbalabasquer Oct 5, 2020
3e87ce3
Clipper cleanup (#146)
kmbarry1 Oct 5, 2020
d5888aa
feat: Add Auction Reset Tests (SC-6413) (#148)
Oct 8, 2020
018f966
Merge branch 'master' into liq-2.0
gbalabasquer Oct 8, 2020
12d3254
Add license identifier to clip.sol
gbalabasquer Oct 8, 2020
cfab65d
change to levels
andy8052 Oct 9, 2020
1906a89
Merge branch 'SC-4636' into liq-2.0
andy8052 Oct 9, 2020
d4cbab9
Merge pull request #149 from makerdao/liq-2.0
andy8052 Oct 9, 2020
eaa259f
Revert "Merge branch 'SC-4636' into liq-2.0"
andy8052 Oct 9, 2020
03753a7
Add license identifier to dog.sol
gbalabasquer Oct 9, 2020
69c5c46
Add tests
andy8052 Oct 9, 2020
23f91e5
No breaker for yank
andy8052 Oct 12, 2020
fbdc8dd
remove yank breaker tests
andy8052 Oct 12, 2020
f79002f
Add tests
andy8052 Oct 9, 2020
0226701
No breaker for yank
andy8052 Oct 12, 2020
a3f5cc7
remove yank breaker tests
andy8052 Oct 12, 2020
8fdeb90
fixing rebase issues
andy8052 Oct 13, 2020
7a920a0
Merge branch 'SC-4636' of https://github.com/makerdao/dss into SC-4636
andy8052 Oct 13, 2020
fc6db14
remove `which`
andy8052 Oct 13, 2020
ed1eb8f
Merge pull request #150 from makerdao/SC-4636
andy8052 Oct 14, 2020
0212ad3
fix: read dust from vat (#151)
Oct 16, 2020
fc3e08f
feat: add chop getter API
Oct 20, 2020
0593f19
Merge pull request #155 from makerdao/sc-6625-add-chop-getter
kmbarry1 Oct 20, 2020
5702635
feat: Add Dusty `bite` Check (SC-6351) (#154)
Oct 22, 2020
a4c2270
feat: Add LibNote events to dog.sol, clip.sol (SC-4645) (#156)
Oct 27, 2020
4f71d74
minor gas optimizations in Clipper (#152)
kmbarry1 Oct 27, 2020
af99bab
Merge branch 'master' into liq-2.0
gbalabasquer Nov 2, 2020
ae8308a
feat: Use custom events (#157)
Nov 4, 2020
6a5c9d9
feat: Add Keeper Liquidation Incentive (SC-6597) (#153)
Nov 5, 2020
c50663c
feat: add custom events for rely/deny in abaci.sol (#163)
Nov 9, 2020
ba7821f
change price API to accept seconds elapsed since auction start (#162)
kmbarry1 Nov 9, 2020
3038ffd
fix: add Rely event to abaci constructors
Nov 9, 2020
9067fd6
fix: update liq incentive to use due (#164)
Nov 10, 2020
15a203e
feat: Upgrade dog, clip to 0.6.7, Update CI (SC-7268) (#165)
Nov 12, 2020
6f54663
fix: update chip comment (#166)
Nov 13, 2020
9b76e45
feat: End Integration and `yank()` (SC-6352 + SC-6353) (#161)
Nov 16, 2020
0cd974e
separate price decrease function tests into their own file (#168)
kmbarry1 Nov 18, 2020
a3e02e3
feat: Add `needsRedo` Function (SC-7445) (#169)
Nov 25, 2020
24159c9
feat: minor gas optimization for dink calculation (#167)
Nov 26, 2020
abb37d7
fix: Input and state validation (#170)
kmbarry1 Dec 2, 2020
82adf6f
Slither findings (#172)
kmbarry1 Dec 10, 2020
2dd017b
gas optimization and test for Clipper.yank (#175)
kmbarry1 Jan 4, 2021
f23dd2f
Merge branch 'master' into liq-2.0
gbalabasquer Jan 6, 2021
4a155f4
Compile with solc 0.6.11
gbalabasquer Jan 6, 2021
c9e4ec4
Make LinearDecrease.tau public
gbalabasquer Jan 11, 2021
aa1f370
fix: whitespace and BIL (#178)
godsflaw Jan 13, 2021
6a3b4e6
LIQ-2.0 20210114 updates (#181)
godsflaw Jan 19, 2021
f14bb40
Add extra function to pay rewards to external address (#180)
brianmcmichael Jan 19, 2021
42b26c9
Add remaining art to dart to prevent unliquidatable vaults (#179)
brianmcmichael Jan 19, 2021
e0dd913
Liq 2.0 gas improvements (#184)
gbalabasquer Jan 19, 2021
5f7e649
Use id as in other functions
gbalabasquer Jan 20, 2021
cc9245d
Fix shadow variable warning
gbalabasquer Jan 20, 2021
157f8c3
Merge branch 'master' into liq-2.0
gbalabasquer Jan 20, 2021
f64fae1
Add missing SPDX License Identifier for some files
gbalabasquer Jan 20, 2021
ffddd45
Liq 2.0: add tests for external calls (#185)
e18r Jan 21, 2021
aaffe10
Prevent take impersonation. (#189)
brianmcmichael Jan 21, 2021
da27c76
Instead of ending auction if tab < dust, recalculate amounts (#190)
gbalabasquer Jan 21, 2021
b45f390
fix: move incentive to kick() in redo() (SC-8390) (#188)
godsflaw Jan 22, 2021
8e19c39
LIQ-2.0: dusty test cases around dog.bark() (#186)
e18r Jan 22, 2021
e0168e2
Add lock modifier to redo just as extra safety measure (#192)
gbalabasquer Jan 22, 2021
aa57fe8
Change needsRedo function to getStatus which also includes the price …
gbalabasquer Jan 22, 2021
8de02fe
Clean up warnings (#195)
brianmcmichael Jan 22, 2021
2622d58
Make dog immutable and spotter manageable + check dog is not used as …
gbalabasquer Jan 22, 2021
0fe0d02
Not paying incentive in redo if the auction is dusty
gbalabasquer Jan 22, 2021
c8a1344
Make chip and tip public + more tests (#196)
gbalabasquer Jan 25, 2021
3a049a8
Fix spacing
gbalabasquer Feb 2, 2021
6e8cfa4
Avoid extra SLOAD when using chip and tip (#2)
gbalabasquer Feb 8, 2021
28e041e
In case Hole < Dirt or milk.hole < milk.dirt also show revert message
gbalabasquer Feb 8, 2021
94de8d6
Save SLOAD in kick
gbalabasquer Feb 8, 2021
52c9c89
Clearer parameter name
brianmcmichael Feb 8, 2021
abbbf42
Yank param uint256
brianmcmichael Feb 8, 2021
487e226
Tweak breaker docs
brianmcmichael Feb 8, 2021
0ea810b
Custom events + int/uint with 256 + now -> block.timestamp
gbalabasquer Feb 8, 2021
d844c50
Rename all File events to just plain File name
gbalabasquer Feb 8, 2021
04dbc50
getPrice function
e18r Feb 8, 2021
f3c6aed
Fix comment take param
gbalabasquer Feb 8, 2021
fc0a705
Add snip to End code documentation
gbalabasquer Feb 8, 2021
27849f1
Liq 2.0 formulas
gbalabasquer Feb 8, 2021
e3e67af
Optimize deletion: don't shift if element is last
brianmcmichael Mar 1, 2021
c88d964
dig entire tab when full lot is purchased
kmbarry1 Mar 1, 2021
60187da
Address PwC finding 6.6
kmbarry1 Mar 1, 2021
68e9a15
Add lock modifier to every auth function + make SetBreaker part of th…
gbalabasquer Mar 1, 2021
e756870
Make dog can be changed on the clipper
gbalabasquer Mar 3, 2021
ef9c7da
Save extra SLOAD calling kicks
gbalabasquer Mar 3, 2021
3092673
Addp kpr to Kick and Redo events
gbalabasquer Mar 3, 2021
20c5541
Use one storage slot for chip and tip
gbalabasquer Mar 3, 2021
bbc54b8
Remove LibNote in order to be able to compile with solc 0.6 optimized
gbalabasquer Mar 3, 2021
8fee4c5
Merge branch 'master' into liq-2.0
gbalabasquer Mar 3, 2021
4eb5e7a
Require top > 0 for kicking and resetting (#205)
gbalabasquer Mar 3, 2021
7d2b1ef
Don't set unstable default values in stairstep constructor (#204)
brianmcmichael Mar 3, 2021
1865e6e
Update to 0.6.12 (#206)
brianmcmichael Mar 3, 2021
82bfbc1
changing wards uint to uint256
godsflaw Mar 3, 2021
a4759e9
Remove list(), use active() (#207)
brianmcmichael Mar 3, 2021
7c38928
validation for chop (#209)
kmbarry1 Mar 8, 2021
10c408e
Fix state mutability warning in one test contract (#210)
gbalabasquer Mar 8, 2021
29a5e01
Add list(), remove getId() (#212)
brianmcmichael Mar 10, 2021
ca67195
add continuous exponential decrease (#211)
kmbarry1 Mar 13, 2021
0057e94
Gas Optimization: Cache the dust value and allow public modification.…
brianmcmichael Mar 15, 2021
628d6f9
More efficient lock in case tx reverts or if in future there are not …
gbalabasquer Mar 15, 2021
0b61846
validate Clipper ilk when filing in Dog (#216)
kmbarry1 Mar 15, 2021
0e8934e
Revert "More efficient lock in case tx reverts or if in future there …
brianmcmichael Mar 16, 2021
8ac41f0
Return lot size with getStatus (#215)
brianmcmichael Mar 16, 2021
7274ce6
Add a breaker level that prevents kick and redo but not take (#220)
kmbarry1 Mar 25, 2021
62010b8
Dog and Clipper comment updates (#221)
kmbarry1 Mar 30, 2021
2c264f8
rename getPrice() to getFeedPrice() and price to feedPrice (#224)
e18r Mar 31, 2021
092b459
gas tests and don't use optimizations (#226)
kmbarry1 Mar 31, 2021
4cc80e9
properly account for chop in dust checks in the Clipper (#222)
kmbarry1 Mar 31, 2021
75e0c49
Rename abaci file event (#229)
gbalabasquer Apr 2, 2021
d532636
remove extra newline
kmbarry1 Apr 2, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 7 additions & 3 deletions Makefile
@@ -1,3 +1,7 @@
build :; dapp --use solc:0.5.12 build
clean :; dapp clean
test :; dapp --use solc:0.5.12 test -v ${TEST_FLAGS}
.PHONY: build clean test test-gas

build :; DAPP_BUILD_OPTIMIZE=0 DAPP_BUILD_OPTIMIZE_RUNS=0 dapp --use solc:0.6.12 build
clean :; dapp clean
test :; DAPP_BUILD_OPTIMIZE=0 DAPP_BUILD_OPTIMIZE_RUNS=0 dapp --use solc:0.6.12 test -v ${TEST_FLAGS}
test-gas : build
LANG=C.UTF-8 hevm dapp-test --rpc="${ETH_RPC_URL}" --json-file=out/dapp.sol.json --dapp-root=. --verbose 2 --match "test_gas"
5 changes: 3 additions & 2 deletions shell.nix
Expand Up @@ -4,8 +4,9 @@
}: with dappPkgs;

mkShell {
DAPP_SOLC = solc-static-versions.solc_0_5_12 + "/bin/solc-0.5.12";
# SOLC_FLAGS = "--optimize --optimize-runs=200";
DAPP_SOLC = solc-static-versions.solc_0_6_12 + "/bin/solc-0.6.12";
# No optimizations
SOLC_FLAGS = "";
buildInputs = [
dapp
];
Expand Down
260 changes: 260 additions & 0 deletions src/abaci.sol
@@ -0,0 +1,260 @@
// SPDX-License-Identifier: AGPL-3.0-or-later

// Copyright (C) 2020 Maker Ecosystem Growth Holdings, INC.
//
// 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/>.

pragma solidity >=0.6.12;

interface Abacus {
// 1st arg: initial price [ray]
// 2nd arg: seconds since auction start [seconds]
// returns: current auction price [ray]
function price(uint256, uint256) external view returns (uint256);
}

contract LinearDecrease is Abacus {

// --- Auth ---
mapping (address => uint256) public wards;
function rely(address usr) external auth { wards[usr] = 1; emit Rely(usr); }
function deny(address usr) external auth { wards[usr] = 0; emit Deny(usr); }
modifier auth {
require(wards[msg.sender] == 1, "LinearDecrease/not-authorized");
_;
}

// --- Data ---
uint256 public tau; // Seconds after auction start when the price reaches zero [seconds]

// --- Events ---
event Rely(address indexed usr);
event Deny(address indexed usr);

event FileUint256(bytes32 indexed what, uint256 data);
godsflaw marked this conversation as resolved.
Show resolved Hide resolved

// --- Init ---
constructor() public {
godsflaw marked this conversation as resolved.
Show resolved Hide resolved
wards[msg.sender] = 1;
emit Rely(msg.sender);
}

// --- Administration ---
function file(bytes32 what, uint256 data) external auth {
if (what == "tau") tau = data;
else revert("LinearDecrease/file-unrecognized-param");
emit FileUint256(what, data);
}

// --- Math ---
uint256 constant RAY = 10 ** 27;
function add(uint256 x, uint256 y) internal pure returns (uint256 z) {
require((z = x + y) >= x);
}
function mul(uint256 x, uint256 y) internal pure returns (uint256 z) {
require(y == 0 || (z = x * y) / y == x);
}
function rmul(uint256 x, uint256 y) internal pure returns (uint256 z) {
z = x * y;
require(y == 0 || z / y == x);
z = z / RAY;
}

// Price calculation when price is decreased linearly in proportion to time:
// tau: The number of seconds after the start of the auction where the price will hit 0
// top: Initial price
// dur: current seconds since the start of the auction
//
// Returns y = top * ((tau - dur) / tau)
//
// Note the internal call to mul multiples by RAY, thereby ensuring that the rmul calculation
// which utilizes top and tau (RAY values) is also a RAY value.
function price(uint256 top, uint256 dur) override external view returns (uint256) {
if (dur >= tau) return 0;
return rmul(top, mul(tau - dur, RAY) / tau);
}
}

contract StairstepExponentialDecrease is Abacus {

// --- Auth ---
mapping (address => uint256) public wards;
function rely(address usr) external auth { wards[usr] = 1; emit Rely(usr); }
function deny(address usr) external auth { wards[usr] = 0; emit Deny(usr); }
modifier auth {
require(wards[msg.sender] == 1, "StairstepExponentialDecrease/not-authorized");
_;
}

// --- Data ---
uint256 public step; // Length of time between price drops [seconds]
uint256 public cut; // Per-step multiplicative factor [ray]

// --- Events ---
event Rely(address indexed usr);
event Deny(address indexed usr);

event FileUint256(bytes32 indexed what, uint256 data);
godsflaw marked this conversation as resolved.
Show resolved Hide resolved

// --- Init ---
// @notice: `cut` and `step` values must be correctly set for
// this contract to return a valid price
constructor() public {
godsflaw marked this conversation as resolved.
Show resolved Hide resolved
wards[msg.sender] = 1;
emit Rely(msg.sender);
}

// --- Administration ---
function file(bytes32 what, uint256 data) external auth {
if (what == "cut") require((cut = data) <= RAY, "StairstepExponentialDecrease/cut-gt-RAY");
else if (what == "step") step = data;
else revert("StairstepExponentialDecrease/file-unrecognized-param");
emit FileUint256(what, data);
}

// --- Math ---
uint256 constant RAY = 10 ** 27;
function rmul(uint256 x, uint256 y) internal pure returns (uint256 z) {
z = x * y;
require(y == 0 || z / y == x);
z = z / RAY;
}
// optimized version from dss PR #78
function rpow(uint256 x, uint256 n, uint256 b) internal pure returns (uint256 z) {
assembly {
switch n case 0 { z := b }
default {
switch x case 0 { z := 0 }
default {
switch mod(n, 2) case 0 { z := b } default { z := x }
let half := div(b, 2) // for rounding.
for { n := div(n, 2) } n { n := div(n,2) } {
let xx := mul(x, x)
if shr(128, x) { revert(0,0) }
let xxRound := add(xx, half)
if lt(xxRound, xx) { revert(0,0) }
x := div(xxRound, b)
if mod(n,2) {
let zx := mul(z, x)
if and(iszero(iszero(x)), iszero(eq(div(zx, x), z))) { revert(0,0) }
let zxRound := add(zx, half)
if lt(zxRound, zx) { revert(0,0) }
z := div(zxRound, b)
}
}
}
}
}
}

// top: initial price
// dur: seconds since the auction has started
// step: seconds between a price drop
// cut: cut encodes the percentage to decrease per step.
// For efficiency, the values is set as (1 - (% value / 100)) * RAY
// So, for a 1% decrease per step, cut would be (1 - 0.01) * RAY
//
// returns: top * (cut ^ dur)
//
//
function price(uint256 top, uint256 dur) override external view returns (uint256) {
return rmul(top, rpow(cut, dur / step, RAY));
}
}

// While an equivalent function can be obtained by setting step = 1 in StairstepExponentialDecrease,
// this continous (i.e. per-second) exponential decrease has be implemented as it is more gas-efficient
// than using the stairstep version with step = 1 (primarily due to 1 fewer SLOAD per price calculation).
contract ExponentialDecrease is Abacus {

// --- Auth ---
mapping (address => uint256) public wards;
function rely(address usr) external auth { wards[usr] = 1; emit Rely(usr); }
function deny(address usr) external auth { wards[usr] = 0; emit Deny(usr); }
modifier auth {
require(wards[msg.sender] == 1, "ExponentialDecrease/not-authorized");
_;
}

// --- Data ---
uint256 public cut; // Per-second multiplicative factor [ray]

// --- Events ---
event Rely(address indexed usr);
event Deny(address indexed usr);

event FileUint256(bytes32 indexed what, uint256 data);
godsflaw marked this conversation as resolved.
Show resolved Hide resolved

// --- Init ---
// @notice: `cut` value must be correctly set for
// this contract to return a valid price
constructor() public {
godsflaw marked this conversation as resolved.
Show resolved Hide resolved
wards[msg.sender] = 1;
emit Rely(msg.sender);
}

// --- Administration ---
function file(bytes32 what, uint256 data) external auth {
if (what == "cut") require((cut = data) <= RAY, "ExponentialDecrease/cut-gt-RAY");
else revert("ExponentialDecrease/file-unrecognized-param");
emit FileUint256(what, data);
}

// --- Math ---
uint256 constant RAY = 10 ** 27;
function rmul(uint256 x, uint256 y) internal pure returns (uint256 z) {
z = x * y;
require(y == 0 || z / y == x);
z = z / RAY;
}
// optimized version from dss PR #78
function rpow(uint256 x, uint256 n, uint256 b) internal pure returns (uint256 z) {
assembly {
switch n case 0 { z := b }
default {
switch x case 0 { z := 0 }
default {
switch mod(n, 2) case 0 { z := b } default { z := x }
let half := div(b, 2) // for rounding.
for { n := div(n, 2) } n { n := div(n,2) } {
let xx := mul(x, x)
if shr(128, x) { revert(0,0) }
let xxRound := add(xx, half)
if lt(xxRound, xx) { revert(0,0) }
x := div(xxRound, b)
if mod(n,2) {
let zx := mul(z, x)
if and(iszero(iszero(x)), iszero(eq(div(zx, x), z))) { revert(0,0) }
let zxRound := add(zx, half)
if lt(zxRound, zx) { revert(0,0) }
z := div(zxRound, b)
}
}
}
}
}
}

// top: initial price
// dur: seconds since the auction has started
// cut: cut encodes the percentage to decrease per second.
// For efficiency, the values is set as (1 - (% value / 100)) * RAY
// So, for a 1% decrease per second, cut would be (1 - 0.01) * RAY
//
// returns: top * (cut ^ dur)
//
function price(uint256 top, uint256 dur) override external view returns (uint256) {
return rmul(top, rpow(cut, dur, RAY));
}
}
22 changes: 12 additions & 10 deletions src/cat.sol
Expand Up @@ -19,7 +19,9 @@

pragma solidity >=0.5.12;

import "./lib.sol";
// FIXME: This contract was altered compared to the production version.
// It doesn't use LibNote anymore.
// New deployments of this contract will need to include custom events (TO DO).

interface Kicker {
function kick(address urn, address gal, uint256 tab, uint256 lot, uint256 bid)
Expand Down Expand Up @@ -47,11 +49,11 @@ interface VowLike {
function fess(uint256) external;
}

contract Cat is LibNote {
contract Cat {
// --- Auth ---
mapping (address => uint256) public wards;
function rely(address usr) external note auth { wards[usr] = 1; }
function deny(address usr) external note auth { wards[usr] = 0; }
function rely(address usr) external auth { wards[usr] = 1; }
function deny(address usr) external auth { wards[usr] = 0; }
modifier auth {
require(wards[msg.sender] == 1, "Cat/not-authorized");
_;
Expand Down Expand Up @@ -107,20 +109,20 @@ contract Cat is LibNote {
}

// --- Administration ---
function file(bytes32 what, address data) external note auth {
function file(bytes32 what, address data) external auth {
if (what == "vow") vow = VowLike(data);
else revert("Cat/file-unrecognized-param");
}
function file(bytes32 what, uint256 data) external note auth {
function file(bytes32 what, uint256 data) external auth {
if (what == "box") box = data;
else revert("Cat/file-unrecognized-param");
}
function file(bytes32 ilk, bytes32 what, uint256 data) external note auth {
function file(bytes32 ilk, bytes32 what, uint256 data) external auth {
if (what == "chop") ilks[ilk].chop = data;
else if (what == "dunk") ilks[ilk].dunk = data;
else revert("Cat/file-unrecognized-param");
}
function file(bytes32 ilk, bytes32 what, address flip) external note auth {
function file(bytes32 ilk, bytes32 what, address flip) external auth {
if (what == "flip") {
vat.nope(ilks[ilk].flip);
ilks[ilk].flip = flip;
Expand Down Expand Up @@ -177,11 +179,11 @@ contract Cat is LibNote {
emit Bite(ilk, urn, dink, dart, mul(dart, rate), milk.flip, id);
}

function claw(uint256 rad) external note auth {
function claw(uint256 rad) external auth {
litter = sub(litter, rad);
}

function cage() external note auth {
function cage() external auth {
live = 0;
}
}