From f0caf0c5441f52f7af29a7b28c1d7c54d3053958 Mon Sep 17 00:00:00 2001 From: Jamie Pickett Date: Sat, 30 Mar 2024 21:47:35 -0400 Subject: [PATCH] added setter for IOO vault and included into borrow check --- contracts/test/TestnetTokenManager.sol | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/contracts/test/TestnetTokenManager.sol b/contracts/test/TestnetTokenManager.sol index f580ec8a..29d1f2e9 100644 --- a/contracts/test/TestnetTokenManager.sol +++ b/contracts/test/TestnetTokenManager.sol @@ -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; @@ -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; } } @@ -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 (