mirror of
https://github.com/Instadapp/smart-contract.git
synced 2024-07-29 22:08:07 +00:00
withdraw DAI require statement
This commit is contained in:
parent
de36b39a89
commit
55ee422e7b
|
@ -96,6 +96,7 @@ contract Bridge is Helper {
|
||||||
}
|
}
|
||||||
|
|
||||||
function withdrawDAI(uint amt) public {
|
function withdrawDAI(uint amt) public {
|
||||||
|
require(deposited[msg.sender] != 0, "Nothing to Withdraw");
|
||||||
CTokenInterface cToken = CTokenInterface(cDaiAdd);
|
CTokenInterface cToken = CTokenInterface(cDaiAdd);
|
||||||
uint withdrawAmt = wdiv(amt, cToken.exchangeRateCurrent());
|
uint withdrawAmt = wdiv(amt, cToken.exchangeRateCurrent());
|
||||||
uint daiAmt = amt;
|
uint daiAmt = amt;
|
||||||
|
@ -115,7 +116,7 @@ contract Bridge is Helper {
|
||||||
}
|
}
|
||||||
|
|
||||||
function withdrawCDAI(uint amt) public {
|
function withdrawCDAI(uint amt) public {
|
||||||
require(deposited[msg.sender] != 0, "something went wrong");
|
require(deposited[msg.sender] != 0, "Nothing to Withdraw");
|
||||||
CTokenInterface cToken = CTokenInterface(cDaiAdd);
|
CTokenInterface cToken = CTokenInterface(cDaiAdd);
|
||||||
uint withdrawAmt = amt;
|
uint withdrawAmt = amt;
|
||||||
if (withdrawAmt > deposited[msg.sender]) {
|
if (withdrawAmt > deposited[msg.sender]) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user