diff --git a/packages/dai-plugin-mcd/contracts/abis/Cat.json b/packages/dai-plugin-mcd/contracts/abis/Cat.json index b39a9f76e..b34a4a8db 100644 --- a/packages/dai-plugin-mcd/contracts/abis/Cat.json +++ b/packages/dai-plugin-mcd/contracts/abis/Cat.json @@ -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"}] diff --git a/packages/dai-plugin-mcd/contracts/addresses/kovan.json b/packages/dai-plugin-mcd/contracts/addresses/kovan.json index d2a2a7f8b..7ce1ba975 100644 --- a/packages/dai-plugin-mcd/contracts/addresses/kovan.json +++ b/packages/dai-plugin-mcd/contracts/addresses/kovan.json @@ -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", diff --git a/packages/dai-plugin-mcd/contracts/addresses/mainnet.json b/packages/dai-plugin-mcd/contracts/addresses/mainnet.json index 559aa8c68..95ac79f26 100644 --- a/packages/dai-plugin-mcd/contracts/addresses/mainnet.json +++ b/packages/dai-plugin-mcd/contracts/addresses/mainnet.json @@ -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", diff --git a/packages/dai-plugin-mcd/src/schemas/cat.js b/packages/dai-plugin-mcd/src/schemas/cat.js index dfb0b163e..9982614d6 100644 --- a/packages/dai-plugin-mcd/src/schemas/cat.js +++ b/packages/dai-plugin-mcd/src/schemas/cat.js @@ -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, @@ -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)] ] }; diff --git a/packages/dai-plugin-mcd/test/schemas/cat.spec.js b/packages/dai-plugin-mcd/test/schemas/cat.spec.js index 140906217..db1b7f7c2 100644 --- a/packages/dai-plugin-mcd/test/schemas/cat.spec.js +++ b/packages/dai-plugin-mcd/test/schemas/cat.spec.js @@ -38,7 +38,7 @@ test(LIQUIDATOR_ADDRESS, async () => { }); test(LIQUIDATION_PENALTY, async () => { - const expected = BigNumber('0.05'); + const expected = BigNumber('1049999999'); const liquidationPenalty = await maker.latest(LIQUIDATION_PENALTY, 'ETH-A'); expect(liquidationPenalty).toEqual(expected); }); diff --git a/packages/dai-plugin-mcd/test/schemas/computed.spec.js b/packages/dai-plugin-mcd/test/schemas/computed.spec.js index 0c27204dc..7e06f1dc3 100644 --- a/packages/dai-plugin-mcd/test/schemas/computed.spec.js +++ b/packages/dai-plugin-mcd/test/schemas/computed.spec.js @@ -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); @@ -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');