Skip to content

Commit 598ecc3

Browse files
committed
chore: update arbitrum sdk to 3.0-rc1
Signed-off-by: Tomás Migone <[email protected]>
1 parent caf5ab5 commit 598ecc3

File tree

4 files changed

+27
-197
lines changed

4 files changed

+27
-197
lines changed

cli/commands/bridge/to-l1.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,16 @@ export const startSendToL1 = async (cli: CLIEnvironment, cliArgs: CLIArgs): Prom
102102
const l2Receipt = new L2TransactionReceipt(receipt)
103103
const l2ToL1Message = (await l2Receipt.getL2ToL1Messages(cli.wallet))[0]
104104

105-
logger.info(`The transaction generated an L2 to L1 message in outbox with eth block number:`)
106-
logger.info(l2ToL1Message.event.ethBlockNum.toString())
107-
logger.info(
108-
`After the dispute period is finalized (in ~1 week), you can finalize this by calling`,
109-
)
105+
const ethBlockNum = l2ToL1Message.getFirstExecutableBlock(l2Provider)
106+
if (ethBlockNum === null) {
107+
logger.info(`L2 to L1 message can or already has been executed. If not finalized call`)
108+
} else {
109+
logger.info(`The transaction generated an L2 to L1 message in outbox with eth block number:`)
110+
logger.info(ethBlockNum.toString())
111+
logger.info(
112+
`After the dispute period is finalized (in ~1 week), you can finalize this by calling`,
113+
)
114+
}
110115
logger.info(`finish-send-to-l1 with the following txhash:`)
111116
logger.info(l2Receipt.transactionHash)
112117
}

cli/cross-chain.ts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { L1ToL2MessageGasEstimator } from '@arbitrum/sdk'
2+
import { L1ToL2MessageNoGasParams } from '@arbitrum/sdk/dist/lib/message/L1ToL2MessageCreator'
23
import { BigNumber, providers } from 'ethers'
34
import { parseEther } from 'ethers/lib/utils'
45

@@ -44,20 +45,24 @@ export const estimateRetryableTxGas = async (
4445
logger.info('Estimating retryable ticket gas:')
4546
const baseFee = (await l1Provider.getBlock('latest')).baseFeePerGas
4647
const gasEstimator = new L1ToL2MessageGasEstimator(l2Provider)
48+
const retryableEstimateData: L1ToL2MessageNoGasParams = {
49+
from: gatewayAddress,
50+
to: l2Dest,
51+
data: depositCalldata,
52+
l2CallValue: parseEther('0'),
53+
excessFeeRefundAddress: gatewayAddress,
54+
callValueRefundAddress: gatewayAddress,
55+
}
4756
const gasParams = await gasEstimator.estimateAll(
48-
gatewayAddress,
49-
l2Dest,
50-
depositCalldata,
51-
parseEther('0'),
57+
retryableEstimateData,
5258
baseFee as BigNumber,
53-
gatewayAddress,
54-
gatewayAddress,
5559
l1Provider,
5660
)
61+
5762
// override fixed values
5863
return {
5964
maxGas: opts.maxGas ?? gasParams.gasLimit,
6065
gasPriceBid: opts.gasPriceBid ?? gasParams.maxFeePerGas,
61-
maxSubmissionCost: opts.maxSubmissionCost ?? gasParams.maxSubmissionFee,
66+
maxSubmissionCost: opts.maxSubmissionCost ?? gasParams.maxSubmissionCost,
6267
}
6368
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"ethers": "^5.6.0"
1616
},
1717
"devDependencies": {
18-
"@arbitrum/sdk": "^3.0.0-beta.6",
18+
"@arbitrum/sdk": "3.0.0-rc.1",
1919
"@commitlint/cli": "^13.2.1",
2020
"@commitlint/config-conventional": "^13.2.0",
2121
"@defi-wonderland/smock": "^2.0.7",

0 commit comments

Comments
 (0)