Tim's hardhat + Juan's solidity 0.8

This commit is contained in:
7400
2023-10-26 15:07:38 -07:00
10 changed files with 119 additions and 67 deletions

View File

@@ -17,7 +17,7 @@ contract Vault {
uint8 public immutable version;
address public immutable owner;
OrderLib.OrdersInfo public orderList;
OrderLib.OrdersInfo public ordersInfo;
constructor()
{
@@ -55,23 +55,26 @@ contract Vault {
token.transfer(recipient, amount);
}
function numSwapOrders() external view returns (uint64 num) {
return uint64(ordersInfo.orders.length);
}
function placeOrder(OrderLib.SwapOrder memory order) public onlyOwner {
console2.log('Vault.placeOrder()');
orderList._placeOrder(order);
ordersInfo._placeOrder(order);
}
function placeOrders(OrderLib.SwapOrder[] memory orders, OrderLib.OcoMode ocoMode) public onlyOwner {
orderList._placeOrders(orders, ocoMode);
ordersInfo._placeOrders(orders, ocoMode);
}
function swapOrderStatus(uint64 orderIndex) public view returns (OrderLib.SwapOrderStatus memory status) {
return orderList.orders[orderIndex];
function swapOrderStatus(uint64 orderIndex) external view returns (OrderLib.SwapOrderStatus memory status) {
return ordersInfo.orders[orderIndex];
}
function execute(uint64 orderIndex, uint8 tranche_index, OrderLib.PriceProof memory proof) public
{
orderList.execute(owner, orderIndex, tranche_index, proof);
ordersInfo.execute(owner, orderIndex, tranche_index, proof);
}
modifier onlyOwner() {