Skip to content

Commit 5374443

Browse files
authored
Merge pull request #13 from euler-xyz/events
Swap event
2 parents 5613775 + d14c30c commit 5374443

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/MaglevBase.sol

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,17 @@ abstract contract MaglevBase is IMaglevBase, EVCUtil {
4646
uint256 fee;
4747
}
4848

49+
event Swap(
50+
address indexed sender,
51+
uint256 amount0In,
52+
uint256 amount1In,
53+
uint256 amount0Out,
54+
uint256 amount1Out,
55+
uint112 reserve0,
56+
uint112 reserve1,
57+
address indexed to
58+
);
59+
4960
constructor(BaseParams memory params) EVCUtil(params.evc) {
5061
require(params.fee < 1e18, BadFee());
5162

@@ -118,6 +129,10 @@ abstract contract MaglevBase is IMaglevBase, EVCUtil {
118129

119130
reserve0 = uint112(newReserve0);
120131
reserve1 = uint112(newReserve1);
132+
133+
emit Swap(
134+
msg.sender, amount0In, amount1In, amount0Out, amount1Out, uint112(newReserve0), uint112(newReserve1), to
135+
);
121136
}
122137
}
123138

0 commit comments

Comments
 (0)