Skip to content
This repository has been archived by the owner on Sep 28, 2022. It is now read-only.

Commit

Permalink
Updated Cat
Browse files Browse the repository at this point in the history
  • Loading branch information
Padraic-O-Mhuiris committed Sep 8, 2020
1 parent 701ba7f commit 79fff7f
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/dai-plugin-mcd/contracts/abis/Cat.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"inputs":[{"internalType":"address","name":"vat_","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"ilk","type":"bytes32"},{"indexed":true,"internalType":"address","name":"urn","type":"address"},{"indexed":false,"internalType":"uint256","name":"ink","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"art","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tab","type":"uint256"},{"indexed":false,"internalType":"address","name":"flip","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"}],"name":"Bite","type":"event"},{"anonymous":true,"inputs":[{"indexed":true,"internalType":"bytes4","name":"sig","type":"bytes4"},{"indexed":true,"internalType":"address","name":"usr","type":"address"},{"indexed":true,"internalType":"bytes32","name":"arg1","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"arg2","type":"bytes32"},{"indexed":false,"internalType":"bytes","name":"data","type":"bytes"}],"name":"LogNote","type":"event"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"ilk","type":"bytes32"},{"internalType":"address","name":"urn","type":"address"}],"name":"bite","outputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"cage","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"usr","type":"address"}],"name":"deny","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"ilk","type":"bytes32"},{"internalType":"bytes32","name":"what","type":"bytes32"},{"internalType":"uint256","name":"data","type":"uint256"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"what","type":"bytes32"},{"internalType":"address","name":"data","type":"address"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"ilk","type":"bytes32"},{"internalType":"bytes32","name":"what","type":"bytes32"},{"internalType":"address","name":"flip","type":"address"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"ilks","outputs":[{"internalType":"address","name":"flip","type":"address"},{"internalType":"uint256","name":"chop","type":"uint256"},{"internalType":"uint256","name":"lump","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"live","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"usr","type":"address"}],"name":"rely","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"vat","outputs":[{"internalType":"contract VatLike","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"vow","outputs":[{"internalType":"contract VowLike","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"wards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"}]
[{"inputs":[{"internalType":"address","name":"vat_","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"ilk","type":"bytes32"},{"indexed":true,"internalType":"address","name":"urn","type":"address"},{"indexed":false,"internalType":"uint256","name":"ink","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"art","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tab","type":"uint256"},{"indexed":false,"internalType":"address","name":"flip","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"}],"name":"Bite","type":"event"},{"anonymous":true,"inputs":[{"indexed":true,"internalType":"bytes4","name":"sig","type":"bytes4"},{"indexed":true,"internalType":"address","name":"usr","type":"address"},{"indexed":true,"internalType":"bytes32","name":"arg1","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"arg2","type":"bytes32"},{"indexed":false,"internalType":"bytes","name":"data","type":"bytes"}],"name":"LogNote","type":"event"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"ilk","type":"bytes32"},{"internalType":"address","name":"urn","type":"address"}],"name":"bite","outputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"box","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"cage","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"rad","type":"uint256"}],"name":"claw","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"usr","type":"address"}],"name":"deny","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"ilk","type":"bytes32"},{"internalType":"bytes32","name":"what","type":"bytes32"},{"internalType":"uint256","name":"data","type":"uint256"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"what","type":"bytes32"},{"internalType":"uint256","name":"data","type":"uint256"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"what","type":"bytes32"},{"internalType":"address","name":"data","type":"address"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"ilk","type":"bytes32"},{"internalType":"bytes32","name":"what","type":"bytes32"},{"internalType":"address","name":"flip","type":"address"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"ilks","outputs":[{"internalType":"address","name":"flip","type":"address"},{"internalType":"uint256","name":"chop","type":"uint256"},{"internalType":"uint256","name":"dunk","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"litter","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"live","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"usr","type":"address"}],"name":"rely","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"vat","outputs":[{"internalType":"contract VatLike","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"vow","outputs":[{"internalType":"contract VowLike","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"wards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"}]
2 changes: 1 addition & 1 deletion packages/dai-plugin-mcd/contracts/addresses/kovan.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"MCD_ADM": "0xbBFFC76e94B34F72D96D054b31f6424249c1337d",
"MCD_VAT": "0xbA987bDB501d131f766fEe8180Da5d81b34b69d9",
"MCD_JUG": "0xcbB7718c9F39d05aEEDE1c472ca8Bf804b2f1EaD",
"MCD_CAT": "0x0511674A67192FE51e86fE55Ed660eB4f995BDd6",
"MCD_CAT": "0xdDb5F7A3A5558b9a6a1f3382BD75E2268d1c6958",
"MCD_VOW": "0x0F4Cbe6CBA918b7488C26E29d9ECd7368F38EA3b",
"MCD_JOIN_DAI": "0x5AA71a3ae1C0bd6ac27A1f28e1415fFFB6F15B8c",
"MCD_FLAP": "0x064cd5f762851b1af81Fd8fcA837227cb3eC84b4",
Expand Down
2 changes: 1 addition & 1 deletion packages/dai-plugin-mcd/contracts/addresses/mainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"MCD_ADM": "0x9eF05f7F6deB616fd37aC3c959a2dDD25A54E4F5",
"MCD_VAT": "0x35D1b3F3D7966A1DFe207aa4514C12a259A0492B",
"MCD_JUG": "0x19c0976f590D67707E62397C87829d896Dc0f1F1",
"MCD_CAT": "0x78F2c2AF65126834c51822F56Be0d7469D7A523E",
"MCD_CAT": "0xa5679C04fc3d9d8b0AaB1F0ab83555b301cA70Ea",
"MCD_VOW": "0xA950524441892A31ebddF91d3cEEFa04Bf454466",
"MCD_JOIN_DAI": "0x9759A6Ac90977b93B58547b4A71c78317f391A28",
"MCD_FLAP": "0xdfE0fb1bE2a52CDBf8FB962D5701d7fd0902db9f",
Expand Down
6 changes: 3 additions & 3 deletions packages/dai-plugin-mcd/src/schemas/cat.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { toHex, fromRay } from '../utils';
import { toHex, fromWei } from '../utils';
import BigNumber from 'bignumber.js';
import { RAY } from '../constants';
import { WAD } from '../constants';

import {
LIQUIDATOR_ADDRESS,
Expand All @@ -22,7 +22,7 @@ export const catIlks = {
},
returns: [
[LIQUIDATOR_ADDRESS],
[LIQUIDATION_PENALTY, v => fromRay(BigNumber(v).minus(RAY))],
[LIQUIDATION_PENALTY, v => fromWei(BigNumber(v).minus(WAD))],
[MAX_AUCTION_LOT_SIZE, v => BigNumber(v).shiftedBy(-18)]
]
};
Expand Down
2 changes: 1 addition & 1 deletion packages/dai-plugin-mcd/test/schemas/cat.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ test(LIQUIDATOR_ADDRESS, async () => {
});

test(LIQUIDATION_PENALTY, async () => {
const expected = BigNumber('0.05');
const expected = BigNumber('1049999999');

This comment has been minimized.

Copy link
@ethanbennett

ethanbennett Sep 8, 2020

Contributor

@Padraic-O-Mhuiris is this actually the value you expected to see, or did you just add it to get the test to pass? Asking because I'm working on getting the testchain and tests updated on a separate branch, and after merging your recent changes to the schema, I'm seeing the expected 0.05 again. I think that's what we want to see, so let me know if I'm missing something and 1049999999 should be retained--otherwise I'll go ahead and revert this when I merge my branch.

This comment has been minimized.

Copy link
@Padraic-O-Mhuiris

Padraic-O-Mhuiris Sep 8, 2020

Author Contributor

Only changed to make the tests pass. Please revert, thanks!

This comment has been minimized.

Copy link
@ethanbennett

ethanbennett Sep 8, 2020

Contributor

Awesome, will do!

const liquidationPenalty = await maker.latest(LIQUIDATION_PENALTY, 'ETH-A');
expect(liquidationPenalty).toEqual(expected);
});
Expand Down
4 changes: 2 additions & 2 deletions packages/dai-plugin-mcd/test/schemas/computed.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ test(VAULT, async () => {
const expectedCollateralAvailableValue = USD(178.5);
const expectedUnlockedCollateral = fromWei(0);
const expectedLiqRatio = createCurrencyRatio(USD, DAI)(1.5);
const expectedLiqPenalty = BigNumber('0.05');
const expectedLiqPenalty = BigNumber('1049999999');
const expectedAnnStabilityFee = 0.04999999999989363;
const expectedDebtFloor = BigNumber('0');
const expectedCollateralDebtAvailable = DAI(99999);
Expand Down Expand Up @@ -492,7 +492,7 @@ test(COLLATERAL_TYPE_DATA, async () => {
const collateralType = 'ETH-A';
const expectedColTypePrice = createCurrencyRatio(USD, ETH)(180);
const expectedLiqRatio = createCurrencyRatio(USD, DAI)(1.5);
const expectedLiqPenalty = BigNumber('0.05');
const expectedLiqPenalty = BigNumber('1049999999');
const expectedAnnStabilityFee = 0.04999999999989363;
const expectedPriceWithSafetyMargin = BigNumber('120');
const expectedDebtFloor = BigNumber('0');
Expand Down

0 comments on commit 79fff7f

Please sign in to comment.