@@ -49,16 +49,29 @@ func (mdl *Poolv3) OnLog(txLog types.Log) {
4949 mdl .Repo .GetAdapter (cm .Hex ()).SetUnderlyingState (total )
5050 // while processing deposit event, sub from user and add to receiver
5151 case core .Topic ("Deposit(address,address,uint256,uint256)" ):
52+ // v300 Zapper is used in which the sign name is Zapper and owner is also Zapper. So using the Zapper config that we have, we will change it and substitute with the correct address.
53+ // https://etherscan.io/tx/0x72fda88a3ff310c64af1f70a662c4a9d0e541d3e046f77c1262c477986576c4b#eventlog
54+ // v310 zappers are not used but for eth deposit to weth , weth deposit zapper is used.
55+ // // https://etherscan.io/address/0xfdBB83182078767dB0D41Aa7C5b06bA118495fC8#code
56+ // https://etherscan.io/tx/0xcc5f4bd5fc802131169ecc5a0841c0b4a9f34d096df340d67fc9587d547e23d6#eventlog
57+ // v300 non weth deposit https://etherscan.io/tx/0xa3efe9590243e628e53c6723b4ca7862a57d4ee0ae9dd207c1cb5fb7ec76aa9c#eventlog
58+ // In this case, the sender and the owner in the transaction are the same.
59+ // v300 v310
60+ // noneth if zapper, both same sender=owner=real_user as no zapper
61+ // eth. if zapper, both same sender = deposit zapper , owner is real user
62+ // In case of v300, the user is replaced, and since both are the same for Zapper, we can keep owner as user,
63+ // and the owner will be Zapper in this case. This will be replaced by the actual user in all other cases. Will be real user.
5264 deposit , err := mdl .contract .ParseDeposit (txLog )
5365 log .CheckFatal (err )
66+
5467 event := & schemas.PoolLedger {
5568 LogId : txLog .Index ,
5669 BlockNumber : blockNum ,
5770 TxHash : txLog .TxHash .Hex (),
5871 Pool : mdl .Address ,
5972 Event : "AddLiquidity" ,
6073 Executor : deposit .Sender .Hex (),
61- User : deposit .Sender .Hex (),
74+ User : deposit .Owner .Hex (),
6275 Receiver : deposit .Owner .Hex (),
6376 SharesBI : (* core .BigInt )(deposit .Shares ),
6477 Shares : utils .GetFloat64Decimal (deposit .Shares , mdl .getDecimals ()),
0 commit comments