Migrate Thrilok check done

This commit is contained in:
Samyak Jain 2019-10-27 01:12:48 +05:30
parent f3d7c03f4c
commit 03a4949753

View File

@ -352,7 +352,9 @@ contract LiquidityResolver is MCDResolver {
contract MigrateResolver is LiquidityResolver {
event LogMigrate(uint scdCdp, uint toConvert, address payFeeWith, uint mcdCdp);
function migrate(
uint scdCDP,
// uint mcdCDP, for merge
@ -377,9 +379,9 @@ contract MigrateResolver is LiquidityResolver {
// Check if sai_join has enough sai to migrate.
if (saiBal < _wad) {
_wad = saiBal;
// Set new convert ratio according to sai_join balance.
maxConvert = sub(wdiv(saiBal, _wadTotal), 1000000000000000);
_wad = wmul(_wadTotal, maxConvert);
maxConvert = sub(wdiv(saiBal, _wadTotal), 10);
}
uint _ink = wmul(tub.ink(scdCup), maxConvert); // Taking collateral in PETH only