Skip to content

Commit

Permalink
just added Vault.sol, about to install somate lib
Browse files Browse the repository at this point in the history
  • Loading branch information
adamocallaghan committed Sep 8, 2024
1 parent 2af87c9 commit 73a8576
Show file tree
Hide file tree
Showing 35 changed files with 19,163 additions and 1,839 deletions.
25 changes: 17 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,17 @@ set-optimism-peer:
cast send $(OPTIMISM_SEPOLIA_OAPP_ADDRESS) --rpc-url $(OPTIMISM_SEPOLIA_RPC) "setPeer(uint32, bytes32)" $(BASE_SEPOLIA_LZ_ENDPOINT_ID) $(BASE_SEPOLIA_OAPP_BYTES32) --account deployer

# SET STABLECOIN ADDRESS ON OPTIMISM OAPP
set-stablecoin-on-stableengine-optimism:
cast send $(OPTIMISM_SEPOLIA_OAPP_ADDRESS) --rpc-url $(OPTIMISM_SEPOLIA_RPC) "setStableCoin(address)" $(OPTIMISM_SEPOLIA_OFT_ADDRESS) --account deployer
# set-stablecoin-on-stableengine-optimism:
# cast send $(OPTIMISM_SEPOLIA_OAPP_ADDRESS) --rpc-url $(OPTIMISM_SEPOLIA_RPC) "setStableCoin(address)" $(OPTIMISM_SEPOLIA_OFT_ADDRESS) --account deployer
approve-nft-to-oapp:
cast send $(NFT_ADDRESS) --rpc-url $(BASE_SEPOLIA_RPC) "approve(address,uint)" $(OAPP_ADDRESS) 0 --value 0.001ether --account deployer

supply-nft-on-base:
cast send $(OAPP_ADDRESS) --rpc-url $(BASE_SEPOLIA_RPC) "supply(address,uint)" $(NFT_ADDRESS) 0 --value 0.01ether --account deployer

# Send both Uint & Address from Base => Optimism
send-useful-data-from-base:
cast send $(BASE_SEPOLIA_OAPP_ADDRESS) --rpc-url $(BASE_SEPOLIA_RPC) "sendToMinter(uint32, uint, address, bytes)" $(OPTIMISM_SEPOLIA_LZ_ENDPOINT_ID) 888000000000000000000 $(DEPLOYER_PUBLIC_ADDRESS) $(MESSAGE_OPTIONS_BYTES) --value 0.1ether --account deployer
cast send $(OAPP_ADDRESS) --rpc-url $(BASE_SEPOLIA_RPC) "sendToMinter(uint32, uint, address, uint8, bytes)" $(OPTIMISM_SEPOLIA_LZ_ENDPOINT_ID) 888000000000000000000 $(DEPLOYER_PUBLIC_ADDRESS) 1 $(MESSAGE_OPTIONS_BYTES) --value 0.1ether --account deployer

# READ MESSSAGE ON OP

Expand All @@ -40,17 +45,17 @@ read-balance-of-stables-on-optimism:
# === SCRIPT DEPLOYMENT ===
# =========================
deploy-contracts--to-base-and-set-addresses-for-collateral-and-stablecoin:
forge script script/DeployToBase.s.sol:DeployToBase --broadcast --verify --etherscan-api-key $(BASE_ETHERSCAN_API_KEY) --rpc-url $(BASE_SEPOLIA_RPC) --account deployer -vvvvv
forge script script/DeployToBase.s.sol:DeployToBase --broadcast --verify --etherscan-api-key $(BASE_ETHERSCAN_API_KEY) --rpc-url $(BASE_SEPOLIA_RPC) --account deployer -vvvvv --via-ir

deploy-contracts--to-optimism-and-set-addresses-for-collateral-and-stablecoin:
forge script script/DeployToOptimism.s.sol:DeployToOptimism --broadcast --verify --etherscan-api-key $(OPTIMISM_ETHERSCAN_API_KEY) --rpc-url $(OPTIMISM_SEPOLIA_RPC) --account deployer -vvvvv
forge script script/DeployToOptimism.s.sol:DeployToOptimism --broadcast --verify --etherscan-api-key $(OPTIMISM_ETHERSCAN_API_KEY) --rpc-url $(OPTIMISM_SEPOLIA_RPC) --account deployer -vvvvv --via-ir

deploy-contracts--to-arbitrum-and-set-addresses-for-collateral-and-stablecoin:
forge script script/DeployToArbitrum.s.sol:DeployToArbitrum --broadcast --verify --etherscan-api-key $(ARBITRUM_ETHERSCAN_API_KEY) --rpc-url $(ARBITRUM_SEPOLIA_RPC) --account deployer -vvvvv
forge script script/DeployToArbitrum.s.sol:DeployToArbitrum --broadcast --verify --etherscan-api-key $(ARBITRUM_ETHERSCAN_API_KEY) --rpc-url $(ARBITRUM_SEPOLIA_RPC) --account deployer -vvvvv --via-ir

# ETHERSCAN API THROWING ERROR
deploy-contracts--to-linea-and-set-addresses-for-collateral-and-stablecoin:
forge script script/DeployToLinea.s.sol:DeployToLinea --broadcast --rpc-url $(LINEA_SEPOLIA_RPC) --account deployer -vvvvv
forge script script/DeployToLinea.s.sol:DeployToLinea --broadcast --rpc-url $(LINEA_SEPOLIA_RPC) --account deployer -vvvvv --via-ir

# GAS COSTS OFF THE WALL!
# deploy-contracts--to-ethereum-and-set-addresses-for-collateral-and-stablecoin:
Expand All @@ -65,4 +70,8 @@ set-peer-on-both-using-script:

# read max mintable
read-max-mintable-for-user:
cast call $(BASE_SEPOLIA_OAPP_ADDRESS) --rpc-url $(BASE_SEPOLIA_RPC) "getMaxMintableByUser(address)(uint)" $(DEPLOYER_PUBLIC_ADDRESS)
cast call $(OAPP_ADDRESS) --rpc-url $(BASE_SEPOLIA_RPC) "getMaxMintableByUser(address)(uint)" $(DEPLOYER_PUBLIC_ADDRESS)

# failing
send-a-b-a:
cast send $(OAPP_ADDRESS) --rpc-url $(BASE_SEPOLIA_RPC) "sendABA(uint32,uint16,uint256,address,uint8,bytes,bytes)" $(OPTIMISM_SEPOLIA_LZ_ENDPOINT_ID) 2 12345 $(DEPLOYER_PUBLIC_ADDRESS) 5 $(ABA_MESSAGE_OPTIONS_BYTES) $(ABO_MESSAGE_OPTIONS_BYTES) --value 0.2ether --account deployer
810 changes: 810 additions & 0 deletions broadcast/DeployToArbitrum.s.sol/421614/run-1725634030.json

Large diffs are not rendered by default.

810 changes: 810 additions & 0 deletions broadcast/DeployToArbitrum.s.sol/421614/run-1725634924.json

Large diffs are not rendered by default.

810 changes: 810 additions & 0 deletions broadcast/DeployToArbitrum.s.sol/421614/run-1725656593.json

Large diffs are not rendered by default.

810 changes: 810 additions & 0 deletions broadcast/DeployToArbitrum.s.sol/421614/run-1725791232.json

Large diffs are not rendered by default.

594 changes: 297 additions & 297 deletions broadcast/DeployToArbitrum.s.sol/421614/run-latest.json

Large diffs are not rendered by default.

870 changes: 870 additions & 0 deletions broadcast/DeployToBase.s.sol/84532/run-1725633862.json

Large diffs are not rendered by default.

870 changes: 870 additions & 0 deletions broadcast/DeployToBase.s.sol/84532/run-1725634768.json

Large diffs are not rendered by default.

870 changes: 870 additions & 0 deletions broadcast/DeployToBase.s.sol/84532/run-1725656353.json

Large diffs are not rendered by default.

870 changes: 870 additions & 0 deletions broadcast/DeployToBase.s.sol/84532/run-1725791028.json

Large diffs are not rendered by default.

668 changes: 334 additions & 334 deletions broadcast/DeployToBase.s.sol/84532/run-latest.json

Large diffs are not rendered by default.

311 changes: 311 additions & 0 deletions broadcast/DeployToLinea.s.sol/59141/run-1725634050.json

Large diffs are not rendered by default.

315 changes: 315 additions & 0 deletions broadcast/DeployToLinea.s.sol/59141/run-1725634460.json

Large diffs are not rendered by default.

780 changes: 780 additions & 0 deletions broadcast/DeployToLinea.s.sol/59141/run-1725634946.json

Large diffs are not rendered by default.

780 changes: 780 additions & 0 deletions broadcast/DeployToLinea.s.sol/59141/run-1725656670.json

Large diffs are not rendered by default.

780 changes: 780 additions & 0 deletions broadcast/DeployToLinea.s.sol/59141/run-1725791280.json

Large diffs are not rendered by default.

582 changes: 291 additions & 291 deletions broadcast/DeployToLinea.s.sol/59141/run-latest.json

Large diffs are not rendered by default.

870 changes: 870 additions & 0 deletions broadcast/DeployToOptimism.s.sol/11155420/run-1725633944.json

Large diffs are not rendered by default.

870 changes: 870 additions & 0 deletions broadcast/DeployToOptimism.s.sol/11155420/run-1725634838.json

Large diffs are not rendered by default.

870 changes: 870 additions & 0 deletions broadcast/DeployToOptimism.s.sol/11155420/run-1725656472.json

Large diffs are not rendered by default.

870 changes: 870 additions & 0 deletions broadcast/DeployToOptimism.s.sol/11155420/run-1725791129.json

Large diffs are not rendered by default.

692 changes: 346 additions & 346 deletions broadcast/DeployToOptimism.s.sol/11155420/run-latest.json

Large diffs are not rendered by default.

1,325 changes: 1,325 additions & 0 deletions broadcast/multi/SetPeers.s.sol-1725635109/run.json

Large diffs are not rendered by default.

1,325 changes: 1,325 additions & 0 deletions broadcast/multi/SetPeers.s.sol-1725656892/run.json

Large diffs are not rendered by default.

1,325 changes: 1,325 additions & 0 deletions broadcast/multi/SetPeers.s.sol-1725791446/run.json

Large diffs are not rendered by default.

1,070 changes: 535 additions & 535 deletions broadcast/multi/SetPeers.s.sol-latest/run.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions script/DeployToArbitrum.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ contract DeployToArbitrum is Script {

// deploy StableEngine OAPP contract
StableEngine arbOapp =
new StableEngine{salt: "pop"}(vm.envAddress(ARBITRUM_LZ_ENDPOINT), vm.envAddress(DEPLOYER_PUBLIC_ADDRESS));
new StableEngine{salt: "red"}(vm.envAddress(ARBITRUM_LZ_ENDPOINT), vm.envAddress(DEPLOYER_PUBLIC_ADDRESS));
console2.log("StableEngine Address: ", address(arbOapp));

// deploy StableCoin OFT contract
StableCoin arbOft = new StableCoin{salt: "pop"}(
StableCoin arbOft = new StableCoin{salt: "red"}(
"Membrane USD",
"memUSD",
vm.envAddress(ARBITRUM_LZ_ENDPOINT),
Expand All @@ -51,7 +51,7 @@ contract DeployToArbitrum is Script {
console2.log("OFT Address: ", address(arbOft));

// deploy NFTMock
NFTMock arbNft = new NFTMock{salt: "pop"}();
NFTMock arbNft = new NFTMock{salt: "red"}();
console2.log("NFT Address: ", address(arbNft));

// whitelist the NFT on StableEngine
Expand Down
6 changes: 3 additions & 3 deletions script/DeployToBase.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ contract DeployToBase is Script {

// deploy StableEngine OAPP contract
StableEngine baseOapp =
new StableEngine{salt: "pop"}(vm.envAddress(BASE_LZ_ENDPOINT), vm.envAddress(DEPLOYER_PUBLIC_ADDRESS));
new StableEngine{salt: "red"}(vm.envAddress(BASE_LZ_ENDPOINT), vm.envAddress(DEPLOYER_PUBLIC_ADDRESS));
console2.log("StableEngine Address: ", address(baseOapp));

// deploy StableCoin OFT contract
StableCoin baseOft = new StableCoin{salt: "pop"}(
StableCoin baseOft = new StableCoin{salt: "red"}(
"Membrane USD",
"memUSD",
vm.envAddress(BASE_LZ_ENDPOINT),
Expand All @@ -51,7 +51,7 @@ contract DeployToBase is Script {
console2.log("OFT Address: ", address(baseOft));

// deploy NFTMock
NFTMock baseNft = new NFTMock{salt: "pop"}();
NFTMock baseNft = new NFTMock{salt: "red"}();
console2.log("NFT Address: ", address(baseNft));

// whitelist the NFT on StableEngine
Expand Down
6 changes: 3 additions & 3 deletions script/DeployToEthereum.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ contract DeployToEthereum is Script {

// deploy StableEngine OAPP contract
StableEngine ethOapp =
new StableEngine{salt: "pop"}(vm.envAddress(ETHEREUM_LZ_ENDPOINT), vm.envAddress(DEPLOYER_PUBLIC_ADDRESS));
new StableEngine{salt: "red"}(vm.envAddress(ETHEREUM_LZ_ENDPOINT), vm.envAddress(DEPLOYER_PUBLIC_ADDRESS));
console2.log("StableEngine Address: ", address(ethOapp));

// deploy StableCoin OFT contract
StableCoin ethOft = new StableCoin{salt: "pop"}(
StableCoin ethOft = new StableCoin{salt: "red"}(
"Membrane USD",
"memUSD",
vm.envAddress(ETHEREUM_LZ_ENDPOINT),
Expand All @@ -51,7 +51,7 @@ contract DeployToEthereum is Script {
console2.log("OFT Address: ", address(ethOft));

// deploy NFTMock
NFTMock ethNft = new NFTMock{salt: "pop"}();
NFTMock ethNft = new NFTMock{salt: "red"}();
console2.log("NFT Address: ", address(ethNft));

// whitelist the NFT on StableEngine
Expand Down
6 changes: 3 additions & 3 deletions script/DeployToLinea.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ contract DeployToLinea is Script {

// deploy StableEngine OAPP contract
StableEngine lineaOapp =
new StableEngine{salt: "pop"}(vm.envAddress(LINEA_LZ_ENDPOINT), vm.envAddress(DEPLOYER_PUBLIC_ADDRESS));
new StableEngine{salt: "red"}(vm.envAddress(LINEA_LZ_ENDPOINT), vm.envAddress(DEPLOYER_PUBLIC_ADDRESS));
console2.log("StableEngine Address: ", address(lineaOapp));

// deploy StableCoin OFT contract
StableCoin lineaOft = new StableCoin{salt: "pop"}(
StableCoin lineaOft = new StableCoin{salt: "red"}(
"Membrane USD",
"memUSD",
vm.envAddress(LINEA_LZ_ENDPOINT),
Expand All @@ -51,7 +51,7 @@ contract DeployToLinea is Script {
console2.log("OFT Address: ", address(lineaOft));

// deploy NFTMock
NFTMock lineaNft = new NFTMock{salt: "pop"}();
NFTMock lineaNft = new NFTMock{salt: "red"}();
console2.log("NFT Address: ", address(lineaNft));

// whitelist the NFT on StableEngine
Expand Down
6 changes: 3 additions & 3 deletions script/DeployToOptimism.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ contract DeployToOptimism is Script {

// deploy StableEngine OAPP contract
StableEngine optimismOapp =
new StableEngine{salt: "pop"}(vm.envAddress(OPTIMISM_LZ_ENDPOINT), vm.envAddress(DEPLOYER_PUBLIC_ADDRESS));
new StableEngine{salt: "red"}(vm.envAddress(OPTIMISM_LZ_ENDPOINT), vm.envAddress(DEPLOYER_PUBLIC_ADDRESS));
console2.log("StableEngine Address: ", address(optimismOapp));

// deploy StableCoin OFT contract
StableCoin optimismOft = new StableCoin{salt: "pop"}(
StableCoin optimismOft = new StableCoin{salt: "red"}(
"Membrane USD",
"memUSD",
vm.envAddress(OPTIMISM_LZ_ENDPOINT),
Expand All @@ -51,7 +51,7 @@ contract DeployToOptimism is Script {
console2.log("OFT Address: ", address(optimismOft));

// deploy NFTMock
NFTMock optimismNft = new NFTMock{salt: "pop"}();
NFTMock optimismNft = new NFTMock{salt: "red"}();
console2.log("NFT Address: ", address(optimismNft));

// whitelist the NFT on StableEngine
Expand Down
2 changes: 1 addition & 1 deletion script/SetPeers.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ contract SetPeers is Script {

uint256 deployerPrivateKey = vm.envUint("DEPLOYER_PRIVATE_KEY");
// Oapp Bytes32 format Address (Same address all chains)
bytes32 OAPP_BYTES32 = 0x000000000000000000000000AD9Fc4039BeC75d97cfd385a7ECdDd4BCe4B7854;
bytes32 OAPP_BYTES32 = 0x0000000000000000000000002875c0971817eBF19d2E1e0e35bB6A928Ac958DA;
// Oapp Address (aame address all chains)
address OAPP_ADDRESS = vm.envAddress("OAPP_ADDRESS");

Expand Down
125 changes: 125 additions & 0 deletions src/StableEngine.sol
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ contract StableEngine is OApp, OAppOptionsType3, IERC721Receiver {
mapping(address user => mapping(address nftCollection => uint256[] tokenIds)) public
userAddressToNftCollectionTokenIds;

mapping(address liquidatableUser => uint256 liquidationAmount) public liquidatableUsersToLiquidationAmounts;

// CR and Health Factor vars
uint256 public COLLATERALISATION_RATIO = 5e17; // aka 50%
uint256 public MIN_HEALTH_FACTOR = 1e18; // aka 1.0
Expand Down Expand Up @@ -88,6 +90,10 @@ contract StableEngine is OApp, OAppOptionsType3, IERC721Receiver {
event AttemptedLzSendFromCheckBorrowerStatus();
event LiquidationStatusReceivedOnSourceChain(uint256 amount, uint8 choice);

event MessageSent(uint32 dstEid);
event ReturnMessageSent(uint32 dstEid);
event MessageReceived(string message, uint32 senderEid, bytes32 sender);

constructor(address _endpoint, address _owner) OApp(_endpoint, _owner) Ownable(_owner) {}

// ================================
Expand Down Expand Up @@ -240,6 +246,49 @@ contract StableEngine is OApp, OAppOptionsType3, IERC721Receiver {
emit LiquidationStatusReceivedOnSourceChain(amount, choice);
} else if (choice == 4) {
userAddressToNumberOfStablecoinsMinted[recipient] -= amount;
} else if (choice == 5) {
(
uint256 amount,
address recipient,
uint8 choice,
uint16 _msgType,
uint256 extraOptionsStart,
uint256 extraOptionsLength
) = decodeMessage(payload);
user = recipient;
number = amount;

if (_msgType == SEND_ABA) {
// string memory _newMessage = "Chain B says goodbye!";

uint256 queriedUserOutstandingBalance = 1234;

// uint256 borrowerHealthFactor = _getBorrowerHealthFactor(recipient);
// // using high health factor so we can liquidate a user in demo
// if (borrowerHealthFactor < 3000000000000000000) {
// queriedUserOutstandingBalance = userAddressToNumberOfStablecoinsMinted[recipient];
// }

bytes memory _options = combineOptions(
_origin.srcEid, SEND, payload[extraOptionsStart:extraOptionsStart + extraOptionsLength]
);

_lzSend(
_origin.srcEid,
abi.encode(queriedUserOutstandingBalance, recipient, 6, SEND),
_options,
MessagingFee(msg.value, 0),
payable(address(this))
);

emit ReturnMessageSent(_origin.srcEid);
}

emit MessageReceived(data, _origin.srcEid, _origin.sender);
} else if (choice == 6) {
liquidatableUsersToLiquidationAmounts[recipient] = amount;
} else if (choice == 7) {
// _releaseNftToLiquidator();
}
}

Expand Down Expand Up @@ -327,6 +376,8 @@ contract StableEngine is OApp, OAppOptionsType3, IERC721Receiver {
}
}

function _releaseNftToLiquidator() internal {}

// =========================
// === SETTERS & GETTERS ===
// =========================
Expand Down Expand Up @@ -368,4 +419,78 @@ contract StableEngine is OApp, OAppOptionsType3, IERC721Receiver {
function onERC721Received(address, address, uint256, bytes memory) public virtual override returns (bytes4) {
return this.onERC721Received.selector;
}

// ====================================
// === lZ ENCODE & DECODE FOR A-B-A ===
// ====================================

function encodeMessage(
uint256 _amount,
address _recipient,
uint8 _choice,
uint16 _msgType,
bytes memory _extraReturnOptions
) public pure returns (bytes memory) {
// Get the length of _extraReturnOptions
uint256 extraOptionsLength = _extraReturnOptions.length;

// Encode the entire message, prepend and append the length of extraReturnOptions
return abi.encode(
_amount, _recipient, _choice, _msgType, extraOptionsLength, _extraReturnOptions, extraOptionsLength
);
}

function decodeMessage(bytes calldata encodedMessage)
public
pure
returns (
uint256 _amount,
address _recipient,
uint8 _choice,
uint16 msgType,
uint256 extraOptionsStart,
uint256 extraOptionsLength
)
{
extraOptionsStart = 256; // Starting offset after _message, _msgType, and extraOptionsLength
// string memory _message;
uint16 _msgType;

// Decode the first part of the message
(_amount, _recipient, _choice, _msgType, extraOptionsLength) =
abi.decode(encodedMessage, (uint256, address, uint8, uint16, uint256));

return (_amount, _recipient, _choice, _msgType, extraOptionsStart, extraOptionsLength);
}

function sendABA(
uint32 _dstEid,
uint16 _msgType,
uint256 _amount,
address _recipient,
uint8 _choice,
bytes calldata _extraSendOptions, // gas settings for A -> B
bytes calldata _extraReturnOptions // gas settings for B -> A
) external payable {
// Encodes the message before invoking _lzSend.
// require(bytes(_message).length <= 32, "String exceeds 32 bytes");

if (_msgType != SEND && _msgType != SEND_ABA) {
revert InvalidMsgType();
}

bytes memory options = combineOptions(_dstEid, _msgType, _extraSendOptions);

_lzSend(
_dstEid,
encodeMessage(_amount, _recipient, _choice, _msgType, _extraReturnOptions),
options,
// Fee in native gas and ZRO token.
MessagingFee(msg.value, 0),
// Refund address in case of failed source message.
payable(msg.sender)
);

emit MessageSent(_dstEid);
}
}
46 changes: 46 additions & 0 deletions src/Vault.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

import {ERC4626} from "lib/solmate/src/tokens/ERC4626.sol";
import {ERC20} from "lib/solmate/src/tokens/ERC20.sol";
import {Ownable} from "lib/openzeppelin-contracts/contracts/access/Ownable.sol";

interface Strategy {
function deposit(uint256 _assets) external;
function withdraw(uint256 _assets) external;
}

interface TroveManager {
function getTroveColl(address _borrower, address _collateral) external view returns (uint256);
}

contract Vault is ERC4626, Ownable {
// Storage vars
address strategy;
ERC20 icETH = ERC20(0xd2b93816A671A7952DFd2E347519846DD8bF5af2);
TroveManager TROVE_MANAGER = TroveManager(0xB8E7f7a8763F12f1a4Cfeb87efF1e1886A68152a);

constructor(ERC20 _asset, string memory _name, string memory _symbol)
ERC4626(_asset, _name, _symbol)
Ownable(msg.sender)
{}

function beforeWithdraw(uint256 assets, uint256 shares) internal override {
// get assets from strategy contract
Strategy(strategy).withdraw(assets);
}

function afterDeposit(uint256 assets, uint256 shares) internal override {
// call deposit on strategy contract
Strategy(strategy).deposit(assets);
}

function totalAssets() public view override returns (uint256) {
uint256 troveCollateral = TROVE_MANAGER.getTroveColl(address(strategy), address(icETH)); // borrower & collateral
return troveCollateral;
}

function setStrategy(address _strategy) public onlyOwner {
strategy = _strategy;
}
}
Loading

0 comments on commit 73a8576

Please sign in to comment.