From da9581f6431f0ed8f2f6cecbf647141e66d7f0f7 Mon Sep 17 00:00:00 2001 From: Sowmayjain Date: Sat, 1 Dec 2018 16:40:51 +0530 Subject: [PATCH] Fixed a very vulnerable bug. --- contracts/protocols/InstaMaker.sol | 1 + 1 file changed, 1 insertion(+) diff --git a/contracts/protocols/InstaMaker.sol b/contracts/protocols/InstaMaker.sol index 6601f06..a8eb119 100644 --- a/contracts/protocols/InstaMaker.sol +++ b/contracts/protocols/InstaMaker.sol @@ -240,6 +240,7 @@ contract BorrowTasks is RepayLoan { bytes32 cdpBytes = bytes32(cdpNum); MakerCDP loanMaster = MakerCDP(cdpAddr); address cdpOwner = loanMaster.lad(cdpBytes); + require(cdps[cdpOwner] == blankCDP, "More than 1 CDP is not allowed."); cdps[cdpOwner] = cdpBytes; emit CDPClaimed(cdpBytes, msg.sender); }