This commit is contained in:
Samyak Jain 2020-08-30 22:50:39 +10:00
commit 3a9287ebb4
2 changed files with 3 additions and 3 deletions

View File

@ -158,13 +158,13 @@ contract PoolToken is ReentrancyGuard, DSMath, ERC20Pausable {
emit LogWithdraw(tknAmt, _burnAmt, _feeAmt); emit LogWithdraw(tknAmt, _burnAmt, _feeAmt);
} }
function addInsurance(uint tknAmt) external payable { function addInsurance(uint tknAmt) external {
baseToken.safeTransferFrom(msg.sender, address(this), tknAmt); baseToken.safeTransferFrom(msg.sender, address(this), tknAmt);
insuranceAmt = add(insuranceAmt, tknAmt); insuranceAmt = add(insuranceAmt, tknAmt);
emit LogAddInsurance(tknAmt); emit LogAddInsurance(tknAmt);
} }
function withdrawInsurance(uint tknAmt) external payable { function withdrawInsurance(uint tknAmt) external {
require(msg.sender == instaIndex.master(), "not-master"); require(msg.sender == instaIndex.master(), "not-master");
require(tknAmt <= insuranceAmt || tknAmt == uint(-1), "not-enough-insurance"); require(tknAmt <= insuranceAmt || tknAmt == uint(-1), "not-enough-insurance");
if (tknAmt == uint(-1)) { if (tknAmt == uint(-1)) {

View File

@ -157,7 +157,7 @@ contract PoolToken is ReentrancyGuard, ERC20Pausable, DSMath {
emit LogAddInsurance(tknAmt); emit LogAddInsurance(tknAmt);
} }
function withdrawInsurance(uint tknAmt) external payable { function withdrawInsurance(uint tknAmt) external {
require(msg.sender == instaIndex.master(), "not-master"); require(msg.sender == instaIndex.master(), "not-master");
require(tknAmt <= insuranceAmt || tknAmt == uint(-1), "not-enough-insurance"); require(tknAmt <= insuranceAmt || tknAmt == uint(-1), "not-enough-insurance");
if (tknAmt == uint(-1)) { if (tknAmt == uint(-1)) {