started on orderlib

This commit is contained in:
Tim Olson
2023-09-18 17:39:05 -04:00
parent 44f17c14c1
commit 46501a7e6d
5 changed files with 140 additions and 6 deletions

View File

@@ -18,14 +18,23 @@ contract Vault {
owner = owner_;
}
function transfer(address payable recipient, uint256 amount) public {
require(msg.sender == owner);
recipient.transfer(amount);
event DexorderReceived(address, uint256);
receive() external payable {
emit DexorderReceived(msg.sender, msg.value);
}
function transfer(uint256 amount) public {
function withdraw(uint256 amount) public {
_withdrawNative(msg.sender, amount);
}
function withdraw(address payable recipient, uint256 amount) public {
_withdrawNative(recipient, amount);
}
function _withdrawNative(address payable reipient, uint256 amount) internal {
require(msg.sender == owner);
msg.sender.transfer(amount);
reipient.transfer(amount);
}
function withdraw(IERC20 token, uint256 amount) public {