Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/sbom-export.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: SBOM Export & Centralize

on:
push:
branches: [ "main" ]
branches: ['main']
schedule:
- cron: '36 8 * * 1'

Expand Down
38 changes: 37 additions & 1 deletion audit-ci.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,43 @@
// elliptic has no patched release yet (affected: <=6.6.1)
// transitive via ethereumjs-util -> ethereum-cryptography -> secp256k1 -> elliptic
// from: @safe-global/protocol-kit>ethereumjs-util>ethereum-cryptography>secp256k1>elliptic
"GHSA-848j-6mx2-7j84"
"GHSA-848j-6mx2-7j84",

// flatted
////////////
// https://github.com/advisories/GHSA-25h7-pfq9-p65f
// flatted ReDoS - transitive dev dep via eslint>file-entry-cache>flat-cache>flatted
// not a runtime dependency
"GHSA-25h7-pfq9-p65f",
// https://github.com/advisories/GHSA-rf6f-7fwh-wjgh
// flatted DoS - transitive dev dep via eslint>file-entry-cache>flat-cache>flatted
// not a runtime dependency
"GHSA-rf6f-7fwh-wjgh",

// picomatch
////////////
// https://github.com/advisories/GHSA-3v7f-55p6-f55p
// picomatch method injection - transitive dev dep via @wagmi/cli>chokidar and typescript-eslint
// not a runtime dependency
"GHSA-3v7f-55p6-f55p",
// https://github.com/advisories/GHSA-c2c7-rcm5-vvqj
// picomatch ReDoS - transitive dev dep via @wagmi/cli>chokidar and typescript-eslint
// not a runtime dependency
"GHSA-c2c7-rcm5-vvqj",

// brace-expansion
////////////
// https://github.com/advisories/GHSA-f886-m6hf-6m8v
// brace-expansion infinite loop - transitive dev dep via eslint>minimatch, ts-morph, typescript-eslint
// not a runtime dependency
"GHSA-f886-m6hf-6m8v",

// yaml
////////////
// https://github.com/advisories/GHSA-48c2-rrv3-qjmp
// yaml stack overflow via deeply nested collections
// transitive dev dep via patch-package>yaml and @arbitrum/nitro-contracts>patch-package>yaml
// not a runtime dependency
"GHSA-48c2-rrv3-qjmp"
]
}
6 changes: 3 additions & 3 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { defineConfig } from 'eslint/config'
import tseslint from 'typescript-eslint'
import { defineConfig } from 'eslint/config';
import tseslint from 'typescript-eslint';

export default defineConfig(
{
ignores: ['node_modules/**', 'src/dist/**', 'coverage/**'],
},
...tseslint.configs.recommended,
)
);
4 changes: 2 additions & 2 deletions src/contracts/UpgradeExecutor.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { parseAbi } from 'viem';

export const upgradeExecutorABI = parseAbi([
'function execute(address upgrade, bytes upgradeCallData)',
'function executeCall(address target, bytes targetCallData)',
'function execute(address upgrade, bytes upgradeCallData) payable',
'function executeCall(address target, bytes targetCallData) payable',
'function hasRole(bytes32 role, address account) public view returns (bool)',
'function grantRole(bytes32 role, address account)',
'function revokeRole(bytes32 role, address account)',
Expand Down
16 changes: 5 additions & 11 deletions src/createTokenBridge-ethers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,12 @@ export async function createTokenBridgeGetInputs<
const {
maxSubmissionCost: maxSubmissionCostForFactoryEstimation,
maxGas: maxGasForFactoryEstimation,
} = await getEstimateForDeployingFactory(
l1TokenBridgeCreatorAddress,
l1Provider,
l2Provider,
);
} = await getEstimateForDeployingFactory(l1TokenBridgeCreatorAddress, l1Provider, l2Provider);

const {
maxSubmissionCost: maxSubmissionCostForContractsEstimation,
maxGas: maxGasForContractsEstimation,
} = await getEstimateForDeployingContracts(
l1TokenBridgeCreatorAddress,
l1Provider,
l2Provider,
);
} = await getEstimateForDeployingContracts(l1TokenBridgeCreatorAddress, l1Provider, l2Provider);

//// apply gas overrides
const maxSubmissionCostForFactory =
Expand Down Expand Up @@ -161,7 +153,9 @@ export async function getContractsDeploymentData(
wethGateway: await l1Provider.getCode(await l1TokenBridgeCreator.l2WethGatewayTemplate()),
aeWeth: await l1Provider.getCode(await l1TokenBridgeCreator.l2WethTemplate()),
upgradeExecutor: await l1Provider.getCode(
(await l1TokenBridgeCreator.l1Templates()).upgradeExecutor,
(
await l1TokenBridgeCreator.l1Templates()
).upgradeExecutor,
),
multicall: await l1Provider.getCode(await l1TokenBridgeCreator.l2MulticallTemplate()),
};
Expand Down
11 changes: 6 additions & 5 deletions src/enqueueTokenBridgePrepareTransactionRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ import { TransactionRequestGasOverrides, applyPercentIncrease } from './utils/ga
import { Prettify } from './types/utils';
import { WithTokenBridgeCreatorAddressOverride } from './types/createTokenBridgeTypes';
import { getTokenBridgeCreatorAddress } from './utils/getTokenBridgeCreatorAddress';
import {
enqueueDefaultMaxGasPrice,
enqueueDefaultMaxGasForContracts,
} from './constants';
import { enqueueDefaultMaxGasPrice, enqueueDefaultMaxGasForContracts } from './constants';
import {
getFactoryDeploymentDataSize,
getContractsDeploymentData,
Expand Down Expand Up @@ -91,7 +88,11 @@ export async function enqueueTokenBridgePrepareTransactionRequest<
);

const [maxSubmissionCostForFactory, maxSubmissionCostForContracts] = await Promise.all([
calculateRetryableSubmissionFee(parentChainPublicClient, inbox, BigInt(getFactoryDeploymentDataSize())),
calculateRetryableSubmissionFee(
parentChainPublicClient,
inbox,
BigInt(getFactoryDeploymentDataSize()),
),
calculateRetryableSubmissionFee(parentChainPublicClient, inbox, BigInt(contractsDataSize)),
]);

Expand Down
2 changes: 0 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ import {
createTokenBridgeDefaultRetryablesFees,
enqueueDefaultMaxGasPrice,
enqueueDefaultMaxGasForContracts,

enqueueDefaultGasLimitForWethGateway,
} from './constants';
import {
Expand Down Expand Up @@ -362,7 +361,6 @@ export {
//
enqueueDefaultMaxGasPrice,
enqueueDefaultMaxGasForContracts,

enqueueDefaultGasLimitForWethGateway,
enqueueTokenBridgePrepareTransactionRequest,
EnqueueTokenBridgePrepareTransactionRequestParams,
Expand Down
3 changes: 3 additions & 0 deletions src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
"repository": "git+https://github.com/OffchainLabs/arbitrum-chain-sdk.git",
"author": "Offchain Labs, Inc.",
"license": "Apache-2.0",
"scripts": {
"prepare": "cd .. && npm run build"
},
"engines": {
"node": ">=18"
},
Expand Down
Loading