diff --git a/internal/engine/worker/decentralized/contract/uniswap/worker.go b/internal/engine/worker/decentralized/contract/uniswap/worker.go index ab8fc7ab1..cacdfc793 100644 --- a/internal/engine/worker/decentralized/contract/uniswap/worker.go +++ b/internal/engine/worker/decentralized/contract/uniswap/worker.go @@ -147,7 +147,8 @@ func (w *worker) matchSwapTransaction(task *source.Task, transaction *ethereum.T uniswap.AddressV3SwapRouter02Celo, uniswap.AddressV3SwapRouter02BinanceSmartChain, uniswap.AddressV3SwapRouter02Linea, - uniswap.AddressUniversalRouter: + uniswap.AddressUniversalRouter01, + uniswap.AddressUniversalRouter02: return true case // Uniswap V2 uniswap.AddressV2SwapRouter01, diff --git a/internal/engine/worker/decentralized/contract/uniswap/worker_test.go b/internal/engine/worker/decentralized/contract/uniswap/worker_test.go index eec81cb81..5bdcc7dc8 100644 --- a/internal/engine/worker/decentralized/contract/uniswap/worker_test.go +++ b/internal/engine/worker/decentralized/contract/uniswap/worker_test.go @@ -132,7 +132,7 @@ func TestWorker_Ethereum(t *testing.T) { Network: network.Ethereum, Index: 4, From: "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045", - To: uniswap.AddressUniversalRouter.String(), + To: uniswap.AddressUniversalRouter02.String(), Type: typex.ExchangeSwap, Calldata: &activityx.Calldata{ FunctionHash: "0x3593564c", @@ -346,7 +346,7 @@ func TestWorker_Ethereum(t *testing.T) { Network: network.Ethereum, Index: 113, From: "0xB5A7c3f565f0DFDb4EE63d0ca4b4d59fa69c391C", - To: uniswap.AddressUniversalRouter.String(), + To: uniswap.AddressUniversalRouter02.String(), Type: typex.ExchangeSwap, Calldata: &activityx.Calldata{ FunctionHash: "0x24856bc3", @@ -361,7 +361,7 @@ func TestWorker_Ethereum(t *testing.T) { Type: typex.ExchangeSwap, Platform: workerx.PlatformUniswap.String(), From: "0xB5A7c3f565f0DFDb4EE63d0ca4b4d59fa69c391C", - To: uniswap.AddressUniversalRouter.String(), + To: uniswap.AddressUniversalRouter02.String(), Metadata: metadata.ExchangeSwap{ From: metadata.Token{ Address: lo.ToPtr("0x5f98805A4E8be255a32880FDeC7F6728C6568bA0"), @@ -384,8 +384,8 @@ func TestWorker_Ethereum(t *testing.T) { { Type: typex.ExchangeSwap, Platform: workerx.PlatformUniswap.String(), - From: uniswap.AddressUniversalRouter.String(), - To: uniswap.AddressUniversalRouter.String(), + From: uniswap.AddressUniversalRouter02.String(), + To: uniswap.AddressUniversalRouter02.String(), Metadata: metadata.ExchangeSwap{ From: metadata.Token{ Address: lo.ToPtr("0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"), @@ -408,7 +408,7 @@ func TestWorker_Ethereum(t *testing.T) { { Type: typex.ExchangeSwap, Platform: workerx.PlatformUniswap.String(), - From: uniswap.AddressUniversalRouter.String(), + From: uniswap.AddressUniversalRouter02.String(), To: "0xB5A7c3f565f0DFDb4EE63d0ca4b4d59fa69c391C", Metadata: metadata.ExchangeSwap{ From: metadata.Token{ diff --git a/provider/ethereum/contract/uniswap/contract.go b/provider/ethereum/contract/uniswap/contract.go index 557078994..dac41c1b9 100644 --- a/provider/ethereum/contract/uniswap/contract.go +++ b/provider/ethereum/contract/uniswap/contract.go @@ -21,6 +21,7 @@ import ( //go:generate go run --mod=mod github.com/ethereum/go-ethereum/cmd/abigen --abi ./abi/NonfungiblePositionManager.abi --pkg uniswap --type NonfungiblePositionManager --out contract_nonfungible_position_manager.go // https://docs.uniswap.org/ +// https://github.com/Uniswap/universal-router/blob/main/deploy-addresses/mainnet.json var ( AddressV1Factory = common.HexToAddress("0xc0a47dFe034B400B47bDaD5FecDa2621de6c4d95") AddressV2Migrator = common.HexToAddress("0x16D4F26C15f3658ec65B1126ff27DD3dF2a2996b") @@ -40,7 +41,8 @@ var ( AddressV3FactoryLinea = common.HexToAddress("0x31FAfd4889FA1269F7a13A66eE0fB458f27D72A9") AddressV3FactoryCelo = common.HexToAddress("0xAfE208a311B21f13EF87E33A90049fC17A7acDEc") AddressV3FactoryBinanceSmartChain = common.HexToAddress("0xdB1d10011AD0Ff90774D0C6Bb92e5C5c8b4461F7") - AddressUniversalRouter = common.HexToAddress("0xEf1c6E67703c7BD7107eed8303Fbe6EC2554BF6B") + AddressUniversalRouter01 = common.HexToAddress("0x3fC91A3afd70395Cd496C647d5a6CC9D4B2b7FAD") + AddressUniversalRouter02 = common.HexToAddress("0xEf1c6E67703c7BD7107eed8303Fbe6EC2554BF6B") AddressNonfungiblePositionManager = common.HexToAddress("0xC36442b4a4522E871399CD717aBDD847Ab11FE88") AddressNonfungiblePositionManagerLinea = common.HexToAddress("0x4615C383F85D0a2BbED973d83ccecf5CB7121463") AddressV2SwapRouterSAVM = common.HexToAddress("0xC7c934E224e8567df50058A907904b451bD1c57D")