-
Notifications
You must be signed in to change notification settings - Fork 203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: transaction history for batch transfers #1851
Conversation
…e into batch-erc20-eth-1
…token-bridge into batch-erc20-eth-2
…token-bridge into batch-erc20-eth-4
…e into batch-erc20-eth-2
…token-bridge into batch-erc20-eth-3
…token-bridge into batch-erc20-eth-4
…e into batch-erc20-eth-6
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
}: { | ||
l1ToL2Msg: ParentToChildMessageReader | ||
}) => { | ||
const childReceipt = await l1ToL2Msg.getAutoRedeemAttempt() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if this will work if the retryable was manually redeemed
…token-bridge into batch-erc20-eth-6
…token-bridge into batch-erc20-eth-6
// we deduct gas cost from max submission fee, which leaves us with amount2 (extra ETH sent with ERC-20) | ||
if (depositStatus === 'success') { | ||
// if success, we use the actual gas cost | ||
const gasCost = await getRetryableFeeOnChildChain({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OnChildChain
is redundant
const gasCost = await getRetryableFeeOnChildChain({ | |
const retryableFee = await getRetryableFee({ |
const excessGas = maxSubmissionFeeNumber - estimatedGasNumber | ||
|
||
// based on averages and min/max values from previous hundreds of txs | ||
if (excessGas < 0.001) { | ||
return false | ||
} | ||
|
||
const estimatedGasUsedPercentage = | ||
(estimatedGasNumber / maxSubmissionFeeNumber) * 100 | ||
|
||
if (estimatedGasUsedPercentage > 10) { | ||
return false | ||
} | ||
|
||
return true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
condense this so it's quicker to get what's going on
const excessGas = maxSubmissionFeeNumber - estimatedGasNumber | |
// based on averages and min/max values from previous hundreds of txs | |
if (excessGas < 0.001) { | |
return false | |
} | |
const estimatedGasUsedPercentage = | |
(estimatedGasNumber / maxSubmissionFeeNumber) * 100 | |
if (estimatedGasUsedPercentage > 10) { | |
return false | |
} | |
return true | |
const excessGasFee = maxSubmissionFeeNumber - estimatedGasNumber | |
const percentageGasUsed = (estimatedGasNumber / maxSubmissionFeeNumber) * 100 | |
// heuristic for determining if it's a batch transfer (based on maxSubmissionFee) | |
return excessGas >= 0.001 && percentageGasUsed < 10 |
PR-6 from https://www.notion.so/arbitrum/Batched-ERC20-ETH-transfers-0df3704c9aef464cb443c0b97d852465
Enable the feature with query param
experiments=batch
Things to note:
retryable.maxSubmissionCost
before transfer, users may receive a bit more ETH thanamount2
(amount2
+ unused refunded gas). Transaction history may show more ETH than it was actually sent. We show a disclaimer for this.amount2
in local storage. If not found in local storage, we fallback to fetching this on chain. Edit: even then it's not accurate and the final gas cost will make it a little bit different. We show the tooltip (on amount2 hover in transaction history) explaining that amount2 is just an estimate. This tooltip is shown at all times, even for the final result (for less complexity, I don't think it matters much).