From 6d82807ffe112f7e8d3d34e7d4e541be2d0780f8 Mon Sep 17 00:00:00 2001 From: Mohammed Sohail Date: Mon, 8 Apr 2024 12:33:34 +0800 Subject: [PATCH] feat: add Swap event --- solidity/SwapPool.sol | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/solidity/SwapPool.sol b/solidity/SwapPool.sol index 2ce21f4..e3750df 100644 --- a/solidity/SwapPool.sol +++ b/solidity/SwapPool.sol @@ -36,6 +36,16 @@ contract SwapPool { // EIP173 event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); // EIP173 + // Swap + event Swap( + address indexed initiator, + address indexed tokenIn, + address tokenOut, + uint256 amountIn, + uint256 amountOut, + uint256 fee + ); + constructor(string memory _name, string memory _symbol, uint8 _decimals, address _tokenRegistry, address _tokenLimiter) { name = _name; symbol = _symbol; @@ -164,6 +174,8 @@ contract SwapPool { if (feeAddress != address(0)) { fees[_outToken] += fee; } + + emit Swap(msg.sender, _inToken, _outToken, _value, outValue, fee); } // Withdraw token to fee address