Skip to content

Commit c022df9

Browse files
committed
add randomness
1 parent 9c01c8f commit c022df9

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

packages/contracts/noir/lob_router/src/lib.nr

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,7 @@ mod LobRouter {
5050
pub struct Order {
5151
pub sell_amount: common::TokenAmount,
5252
pub buy_amount: common::TokenAmount,
53+
/// Hide order contents from other parties and outside world
54+
// TODO(perf): not sure if this is needed because orders are secret shared in an MPC network
55+
pub randomness: Field,
5356
}

packages/contracts/sdk/LobService.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,12 @@ export class LobService {
5959
const seller_order = {
6060
sell_amount: await params.sellerAmount.toNoir(),
6161
buy_amount: await params.buyerAmount.toNoir(),
62+
randomness: sellerRandomness,
6263
};
6364
const buyer_order = {
6465
sell_amount: await params.buyerAmount.toNoir(),
6566
buy_amount: await params.sellerAmount.toNoir(),
67+
randomness: buyerRandomness,
6668
};
6769

6870
const input = {

0 commit comments

Comments
 (0)