-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Francesco <[email protected]>
- Loading branch information
1 parent
2191986
commit 3115842
Showing
4 changed files
with
36 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.23; | ||
|
||
// Inheritances | ||
import {IOnChainOrders} from "./interfaces/IOnChainOrders.sol"; | ||
import {IFloodPlain} from "./interfaces/IFloodPlain.sol"; | ||
|
||
// Libraries | ||
import {OrderHash} from "./libraries/OrderHash.sol"; | ||
|
||
abstract contract OnChainOrders is IOnChainOrders { | ||
using OrderHash for IFloodPlain.Order; | ||
|
||
function etchOrder(IFloodPlain.SignedOrder calldata orderWithSignature) external { | ||
bytes32 orderHash = orderWithSignature.order.hash(); | ||
emit IOnChainOrders.OrderEtched(orderHash, orderWithSignature); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity >=0.8.0; | ||
|
||
import {IFloodPlain} from "./IFloodPlain.sol"; | ||
|
||
interface IOnChainOrders { | ||
event OrderEtched(bytes32 indexed orderHash, IFloodPlain.SignedOrder orderWithSignature); | ||
|
||
/** | ||
* @notice Record an order on-chain for ease of use by other contracts. | ||
* | ||
* @param orderWithSignature The order and its signature to record. | ||
*/ | ||
function etchOrder(IFloodPlain.SignedOrder calldata orderWithSignature) external; | ||
} |