Skip to content

Commit d14c30c

Browse files
init events
1 parent cc0bfcf commit d14c30c

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
@@ -45,6 +45,17 @@ abstract contract MaglevBase is IMaglevBase, EVCUtil {
4545
uint256 fee;
4646
}
4747

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

@@ -113,6 +124,10 @@ abstract contract MaglevBase is IMaglevBase, EVCUtil {
113124

114125
reserve0 = uint112(newReserve0);
115126
reserve1 = uint112(newReserve1);
127+
128+
emit Swap(
129+
msg.sender, amount0In, amount1In, amount0Out, amount1Out, uint112(newReserve0), uint112(newReserve1), to
130+
);
116131
}
117132
}
118133

0 commit comments

Comments
 (0)