Skip to content

Commit

Permalink
added setter for IOO vault and included into borrow check
Browse files Browse the repository at this point in the history
  • Loading branch information
jpick713 committed Mar 31, 2024
1 parent 6e3044d commit f0caf0c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions contracts/test/TestnetTokenManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ contract TestnetTokenManager is ERC20, Ownable2Step, IMysoTokenManager {
uint256 public totalMysoLoanAmount;
address public mysoIOOVault;

// Token Manager TODO; maybe allow for any vault owner to track loan token amount for vault and any token
// TODO: mapping oracleAddr -> vaultAddr -> tokenAddr -> loanAmount + flag for being turned tracked
// This will allow for other IOOs to use a custom oracle with auto-updating price for loan amount if desired

constructor() ERC20("TYSO", "TYSO") {
_decimals = 18;
Expand All @@ -45,7 +46,7 @@ contract TestnetTokenManager is ERC20, Ownable2Step, IMysoTokenManager {
_mint(loan.borrower, _borrowerReward);
_mint(lenderVault, _lenderReward);
}
if (loan.loanToken == MYSO_TOKEN) {
if (loan.loanToken == MYSO_TOKEN && lenderVault == mysoIOOVault) {
totalMysoLoanAmount += loan.initLoanAmount;
}
}
Expand Down Expand Up @@ -124,6 +125,11 @@ contract TestnetTokenManager is ERC20, Ownable2Step, IMysoTokenManager {
_vaultCreationReward = vaultCreationReward;
}

function setIOOVault(address _mysoIOOVault) external {
_checkOwner();
mysoIOOVault = _mysoIOOVault;
}

function transferOwnership(address _newOwnerProposal) public override {
_checkOwner();
if (
Expand Down

0 comments on commit f0caf0c

Please sign in to comment.