trn-seed icon indicating copy to clipboard operation
trn-seed copied to clipboard

Emit an event to know withdraw source for EBD

Open KarishmaBothara opened this issue 1 year ago • 2 comments

Bridging from TRN->ETH side, when it is a futureverse (proxyExtrinsic). EBD stores the sender (EOA) as the from address. There is a requirement to use fpass address in these case. The PR will address this.

Also for XBD, we can track the event (xrplBridge.WithdrawRequestRequest)

Screenshot 2024-03-01 at 2 14 59 PM which can give the sender(fpass address) associated with the extrinsic

KarishmaBothara avatar Mar 01 '24 10:03 KarishmaBothara

Erc20Withdraw

Cause we have different function to process delayed withdrawal and normal withdrawal, which would mean we need to make update two events

Self::deposit_event(Event::<T>::Erc20Withdraw(
			asset_id,
			withdrawal_message.amount.saturated_into(),
			withdrawal_message.beneficiary,
		)); 

and

if Self::process_withdrawal(withdrawal_message.clone(), asset_id).is_err() {
							Self::deposit_event(Event::<T>::DelayedErc20WithdrawalFailed(
								asset_id,
								withdrawal_message.beneficiary.into(),
							));
						}

and in process_delayed_payment, we don't know the source...

KarishmaBothara avatar Mar 05 '24 03:03 KarishmaBothara

Erc20Withdraw

Cause we have different function to process delayed withdrawal and normal withdrawal, which would mean we need to make update two events

Self::deposit_event(Event::<T>::Erc20Withdraw(
			asset_id,
			withdrawal_message.amount.saturated_into(),
			withdrawal_message.beneficiary,
		)); 

and

if Self::process_withdrawal(withdrawal_message.clone(), asset_id).is_err() {
							Self::deposit_event(Event::<T>::DelayedErc20WithdrawalFailed(
								asset_id,
								withdrawal_message.beneficiary.into(),
							));
						}

and in process_delayed_payment, we don't know the source...

I see, that makes it tricky. We could potentially change the storage of a delayed withdrawal to include the sender address. Not entirely sure whether it's worth the hassle though. Easiest approach might be best (The separate events)

JasonTulp avatar Mar 19 '24 00:03 JasonTulp