Skip to content

fix: e2e test and format #326

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

Merged
merged 7 commits into from
Apr 10, 2025
Merged
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
6 changes: 3 additions & 3 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ module.exports = {
: [],
},
custom: {
url: process.env['CUSTOM_RPC_URL'] || 'N/A'
url: process.env['CUSTOM_RPC_URL'] || 'N/A',
},
geth: {
url: 'http://localhost:8545',
Expand Down Expand Up @@ -245,8 +245,8 @@ module.exports = {
urls: {
apiURL: process.env['CUSTOM_ETHERSCAN_API_URL'],
browserURL: process.env['CUSTOM_ETHERSCAN_BROWSER_URL'],
}
}
},
},
],
},
mocha: {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@arbitrum/nitro-contracts",
"version": "3.0.1-beta.0",
"version": "3.0.1",
"description": "Layer 2 precompiles and rollup for Arbitrum Nitro",
"author": "Offchain Labs, Inc.",
"license": "BUSL-1.1",
Expand Down Expand Up @@ -65,7 +65,7 @@
},
"private": false,
"devDependencies": {
"@arbitrum/sdk": "^3.7.2",
"@arbitrum/sdk": "^3.7.3",
"@ethersproject/providers": "^5.8.0",
"@nomicfoundation/hardhat-chai-matchers": "^1.0.6",
"@nomicfoundation/hardhat-verify": "^2.0.13",
Expand Down
17 changes: 12 additions & 5 deletions scripts/boldUpgradeFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ export const deployDependencies = async (
isUsingFeeToken ? 'ERC20Bridge' : 'Bridge',
bridge.address,
[],
isUsingFeeToken ? 'src/bridge/ERC20Bridge.sol:ERC20Bridge' : 'src/bridge/Bridge.sol:Bridge'
isUsingFeeToken
? 'src/bridge/ERC20Bridge.sol:ERC20Bridge'
: 'src/bridge/Bridge.sol:Bridge'
)
}

Expand All @@ -59,7 +61,7 @@ export const deployDependencies = async (
signer
)

let reader4844Addr = ethers.constants.AddressZero;
let reader4844Addr = ethers.constants.AddressZero
if (isUsing4844Reader) {
const reader4844 = await contractFactory.deploy()
await reader4844.deployed()
Expand Down Expand Up @@ -100,7 +102,7 @@ export const deployDependencies = async (
await verifyContract('RollupEventInbox', rei.address, [])
}

const outboxFac = isUsingFeeToken
const outboxFac = isUsingFeeToken
? new ERC20Outbox__factory(signer)
: new Outbox__factory(signer)
const outbox = await outboxFac.deploy()
Expand All @@ -110,7 +112,11 @@ export const deployDependencies = async (
}
if (verify) {
await outbox.deployTransaction.wait(5)
await verifyContract(isUsingFeeToken ? 'ERC20Outbox' : 'Outbox', outbox.address, [])
await verifyContract(
isUsingFeeToken ? 'ERC20Outbox' : 'Outbox',
outbox.address,
[]
)
}

const inboxFac = isUsingFeeToken
Expand Down Expand Up @@ -252,7 +258,8 @@ export const deployBoldUpgrade = async (
wallet
)
const isUsingFeeToken = await sequencerInbox.isUsingFeeToken()
const has4844Reader = await sequencerInbox.reader4844() != ethers.constants.AddressZero
const has4844Reader =
(await sequencerInbox.reader4844()) != ethers.constants.AddressZero
const deployed = await deployDependencies(
wallet,
config.settings.maxDataSize,
Expand Down
30 changes: 17 additions & 13 deletions scripts/executeBoldUpgrade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,7 @@ async function getPreUpgradeState(l1Rpc: JsonRpcProvider, config: Config) {
l1Rpc
)

const bridge = IERC20Bridge__factory.connect(
config.contracts.bridge,
l1Rpc
)
const bridge = IERC20Bridge__factory.connect(config.contracts.bridge, l1Rpc)

const stakerCount = await oldRollupContract.stakerCount()

Expand All @@ -85,13 +82,15 @@ async function getPreUpgradeState(l1Rpc: JsonRpcProvider, config: Config) {

const wasmModuleRoot = await oldRollupContract.wasmModuleRoot()

const feeToken = await seqInbox.isUsingFeeToken() ? await bridge.nativeToken() : null
const feeToken = (await seqInbox.isUsingFeeToken())
? await bridge.nativeToken()
: null

return {
stakers,
wasmModuleRoot,
...boxes,
feeToken
feeToken,
}
}

Expand Down Expand Up @@ -138,7 +137,10 @@ async function perform(
boldActionPerformData,
])

const signerCanExecute = await upExec.hasRole('0xd8aa0f3194971a2a116679f7c2090f6939c8d4e01a2a8d7e41d55e5351469e63', await timelockSigner.getAddress())
const signerCanExecute = await upExec.hasRole(
'0xd8aa0f3194971a2a116679f7c2090f6939c8d4e01a2a8d7e41d55e5351469e63',
await timelockSigner.getAddress()
)

console.log('upgrade executor:', config.contracts.upgradeExecutor)
console.log('execute(...) call to upgrade executor:', performCallData)
Expand Down Expand Up @@ -280,7 +282,8 @@ async function checkSequencerInbox(

// make sure fee token-ness is correct
if (
await seqInboxContract.isUsingFeeToken() !== (preUpgradeState.feeToken !== null)
(await seqInboxContract.isUsingFeeToken()) !==
(preUpgradeState.feeToken !== null)
) {
throw new Error('SequencerInbox isUsingFeeToken does not match')
}
Expand Down Expand Up @@ -327,7 +330,10 @@ async function checkInbox(params: VerificationParams) {
config.contracts.inbox,
l1Rpc
)
const submissionFee = await inboxContract.calculateRetryableSubmissionFee(100, 100)
const submissionFee = await inboxContract.calculateRetryableSubmissionFee(
100,
100
)
if (preUpgradeState.feeToken && !submissionFee.eq(0)) {
throw new Error('Inbox is not an ERC20Inbox')
}
Expand Down Expand Up @@ -387,8 +393,7 @@ async function checkOutbox(
// will revert if not an ERC20Outbox
const withdrawalAmt = await erc20Outbox.l2ToL1WithdrawalAmount()
feeTokenValid = preUpgradeState.feeToken !== null
}
catch (e: any) {
} catch (e: any) {
if (e.code !== 'CALL_EXCEPTION') throw e
feeTokenValid = preUpgradeState.feeToken === null
}
Expand Down Expand Up @@ -429,8 +434,7 @@ async function checkBridge(
if (feeToken !== preUpgradeState.feeToken) {
feeTokenValid = false
}
}
catch (e: any) {
} catch (e: any) {
if (e.code !== 'CALL_EXCEPTION') throw e
feeTokenValid = preUpgradeState.feeToken === null
}
Expand Down
4 changes: 3 additions & 1 deletion scripts/local-deployment/deployCreatorAndCreateRollup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ async function main() {
let stakeToken = process.env.STAKE_TOKEN_ADDRESS as string
if (!stakeToken) {
console.log('Deploying WETH')
const wethFactory = (await ethers.getContractFactory('TestWETH9')).connect(deployerWallet)
const wethFactory = (await ethers.getContractFactory('TestWETH9')).connect(
deployerWallet
)
const weth = await wethFactory.deploy('Wrapped Ether', 'WETH')
await weth.deployTransaction.wait()
await weth.deployed()
Expand Down
18 changes: 9 additions & 9 deletions scripts/rollupCreation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ import { ERC20, ERC20__factory, IERC20__factory } from '../build/types'
import { sleep } from './testSetup'
import { promises as fs } from 'fs'
import { _isRunningOnArbitrum, verifyContract } from './deploymentUtils'
import { AssertionStateStruct, ConfigStruct, RollupCreator } from '../build/types/src/rollup/RollupCreator'
import {
AssertionStateStruct,
ConfigStruct,
RollupCreator,
} from '../build/types/src/rollup/RollupCreator'

// 1 gwei
const MAX_FER_PER_GAS = BigNumber.from('1000000000')
Expand Down Expand Up @@ -306,23 +310,19 @@ async function _getDevRollupConfig(
}

const config: ConfigStruct = {
confirmPeriodBlocks: ethers.BigNumber.from('20'),
confirmPeriodBlocks: ethers.BigNumber.from('1'), // was 20
stakeToken: stakeToken,
baseStake: 8,
wasmModuleRoot: wasmModuleRoot,
owner: ownerAddress,
loserStakeEscrow: ownerAddress,
chainId: JSON.parse(chainConfig)['chainId'],
chainConfig: chainConfig,
minimumAssertionPeriod: 5,
minimumAssertionPeriod: 1, // was 5
validatorAfkBlocks: 201600,
genesisAssertionState: genesisAssertionState,
genesisInboxCount: 0,
miniStakeValues: [
4,
2,
1,
],
miniStakeValues: [4, 2, 1],
layerZeroBlockEdgeHeight: 2 ** 26,
layerZeroBigStepEdgeHeight: 2 ** 19,
layerZeroSmallStepEdgeHeight: 2 ** 23,
Expand All @@ -335,7 +335,7 @@ async function _getDevRollupConfig(
delaySeconds: ethers.BigNumber.from('86400'),
futureSeconds: ethers.BigNumber.from('3600'),
},
anyTrustFastConfirmer: ethers.constants.AddressZero
anyTrustFastConfirmer: ethers.constants.AddressZero,
}

return {
Expand Down
164 changes: 0 additions & 164 deletions src/stylus/StylusDeployer.sol

This file was deleted.

Loading
Loading