-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathBorrowerOperationsScript.sol
More file actions
48 lines (35 loc) · 1.8 KB
/
BorrowerOperationsScript.sol
File metadata and controls
48 lines (35 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// SPDX-License-Identifier: MIT
pragma solidity 0.6.11;
import "../Dependencies/CheckContract.sol";
import "../Interfaces/IBorrowerOperations.sol";
contract BorrowerOperationsScript is CheckContract {
IBorrowerOperations immutable borrowerOperations;
constructor(IBorrowerOperations _borrowerOperations) public {
checkContract(address(_borrowerOperations));
borrowerOperations = _borrowerOperations;
}
function openTrove(uint _maxFee, uint _ZUSDAmount, address _upperHint, address _lowerHint) external payable {
borrowerOperations.openTrove{ value: msg.value }(_maxFee, _ZUSDAmount, _upperHint, _lowerHint);
}
function addColl(address _upperHint, address _lowerHint) external payable {
borrowerOperations.addColl{ value: msg.value }(_upperHint, _lowerHint);
}
function withdrawColl(uint _amount, address _upperHint, address _lowerHint) external {
borrowerOperations.withdrawColl(_amount, _upperHint, _lowerHint);
}
function withdrawZUSD(uint _maxFee, uint _amount, address _upperHint, address _lowerHint) external {
borrowerOperations.withdrawZUSD(_maxFee, _amount, _upperHint, _lowerHint);
}
function repayZUSD(uint _amount, address _upperHint, address _lowerHint) external {
borrowerOperations.repayZUSD(_amount, _upperHint, _lowerHint);
}
function closeTrove() external {
borrowerOperations.closeTrove();
}
function adjustTrove(uint _maxFee, uint _collWithdrawal, uint _debtChange, bool isDebtIncrease, address _upperHint, address _lowerHint) external payable {
borrowerOperations.adjustTrove{ value: msg.value }(_maxFee, _collWithdrawal, _debtChange, isDebtIncrease, _upperHint, _lowerHint);
}
function claimCollateral() external {
borrowerOperations.claimCollateral();
}
}