Skip to content
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
17 changes: 13 additions & 4 deletions deploy/InboxStubCreator.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
module.exports = async hre => {
const { deployments, getNamedAccounts, ethers } = hre
const { deploy } = deployments
const { deployer } = await getNamedAccounts()

const inboxDeployResult = await deploy('InboxStub', {
const inboxDeployResult = await deployments.deploy('InboxStub', {
from: deployer,
args: [],
})

const bridge = await ethers.getContract('BridgeStub')
const inbox = await ethers.getContract('InboxStub')
const bridge = await ethers.getContractAt(
'BridgeStub',
(
await deployments.get('BridgeStub')
).address
)
const inbox = await ethers.getContractAt(
'InboxStub',
(
await deployments.get('InboxStub')
).address
)

if (inboxDeployResult.newlyDeployed) {
await bridge.setDelayedInbox(inbox.address, true)
Expand Down
14 changes: 12 additions & 2 deletions deploy/SequencerInbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,18 @@ module.exports = async hre => {
const { deploy } = deployments
const { deployer } = await getNamedAccounts()

const blobBasefeeReader = await ethers.getContract('BlobBasefeeReader')
const dataHashReader = await ethers.getContract('DataHashReader')
const blobBasefeeReader = await ethers.getContractAt(
'BlobBasefeeReader',
(
await deployments.get('BlobBasefeeReader')
).address
)
const dataHashReader = await ethers.getContractAt(
'DataHashReader',
(
await deployments.get('DataHashReader')
).address
)

await deploy('SequencerInbox', { from: deployer, args: [117964] })
}
Expand Down
8 changes: 4 additions & 4 deletions deploy/SequencerInboxStubCreator.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { Toolkit4844 } from '../test/contract/toolkit4844'

module.exports = async hre => {
const { deployments, getSigners, getNamedAccounts, ethers } = hre
const { deploy } = deployments
const { deployments, getNamedAccounts, ethers } = hre
const { deployer } = await getNamedAccounts()

const bridge = await ethers.getContract('BridgeStub')
const bridge = await deployments.get('BridgeStub')
const reader4844 = await Toolkit4844.deployReader4844(
await ethers.getSigner(deployer)
)
Expand All @@ -15,7 +14,7 @@ module.exports = async hre => {
delaySeconds: 10000,
futureSeconds: 10000,
}
await deploy('SequencerInboxStub', {
await deployments.deploy('SequencerInboxStub', {
from: deployer,
args: [
bridge.address,
Expand All @@ -24,6 +23,7 @@ module.exports = async hre => {
117964,
reader4844.address,
false,
true,
],
})
}
Expand Down
12 changes: 11 additions & 1 deletion test/foundry/AbsOutbox.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,17 @@ abstract contract AbsOutboxTest is Test {
function test_executeTransactionSimulation(
address from
) public {
vm.assume(from != address(0) && from != address(this));
address outboxProxyAdmin = address(
uint160(
uint256(
vm.load(
address(outbox),
0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103
)
)
)
);
vm.assume(from != address(0) && from != address(this) && from != outboxProxyAdmin);
vm.prank(from);
vm.expectRevert(SimulationOnlyEntrypoint.selector);
outbox.executeTransactionSimulation(
Expand Down
16 changes: 13 additions & 3 deletions test/prover/hash-proofs.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import { assert } from 'chai'
import { ethers, run } from 'hardhat'
import { ethers, run, deployments } from 'hardhat'

describe('HashProofHelper', function () {
it('Should produce valid proofs from full preimages', async function () {
await run('deploy', { tags: 'HashProofHelper' })

const hashProofHelper = await ethers.getContract('HashProofHelper')
const hashProofHelper = await ethers.getContractAt(
'HashProofHelper',
(
await deployments.get('HashProofHelper')
).address
)

for (let i = 0; i < 16; i += 1) {
const len = Math.floor(Math.random() * 256)
Expand Down Expand Up @@ -33,7 +38,12 @@ describe('HashProofHelper', function () {
it('Should produce valid proofs from split preimages', async function () {
await run('deploy', { tags: 'HashProofHelper' })

const hashProofHelper = await ethers.getContract('HashProofHelper')
const hashProofHelper = await ethers.getContractAt(
'HashProofHelper',
(
await deployments.get('HashProofHelper')
).address
)

for (let i = 0; i < 16; i += 1) {
const len = Math.floor(Math.random() * 1024)
Expand Down
31 changes: 25 additions & 6 deletions test/prover/one-step-proof.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
import { ethers, run, getNamedAccounts } from 'hardhat'
import { ethers, run, getNamedAccounts, deployments } from 'hardhat'

Check warning on line 1 in test/prover/one-step-proof.ts

View workflow job for this annotation

GitHub Actions / Contract tests

'getNamedAccounts' is defined but never used. Allowed unused vars must match /^_/u
import fs from 'fs'
import assert from 'assert'
import readline from 'readline'

const PARALLEL = 128

async function sendTestMessages() {
const { deployer } = await getNamedAccounts()
const inbox = await ethers.getContract('InboxStub', deployer)
const seqInbox = await ethers.getContract('SequencerInboxStub', deployer)
const inbox = await ethers.getContractAt(
'InboxStub',
(
await deployments.get('InboxStub')
).address
)
const seqInbox = await ethers.getContractAt(
'SequencerInboxStub',
(
await deployments.get('SequencerInboxStub')
).address
)
const msgRoot = '../arbitrator/prover/test-cases/rust/data/'
const gasOpts = {
gasLimit: ethers.utils.hexlify(250000),
Expand Down Expand Up @@ -59,8 +68,18 @@
for (const [path, file] of proofs) {
it('Should pass ' + file + ' proofs', async function () {
const proofs = JSON.parse(fs.readFileSync(path).toString('utf8'))
const osp = await ethers.getContract('OneStepProofEntry')
const bridge = await ethers.getContract('BridgeStub')
const osp = await ethers.getContractAt(
'OneStepProofEntry',
(
await deployments.get('OneStepProofEntry')
).address
)
const bridge = await ethers.getContractAt(
'BridgeStub',
(
await deployments.get('BridgeStub')
).address
)

const promises = []
const isdone = []
Expand Down
9 changes: 7 additions & 2 deletions test/prover/value-arrays.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import { ethers, run } from 'hardhat'
import { ethers, run, deployments } from 'hardhat'

describe('ValueArray', function () {
it('Should pass ValueArrayTester', async function () {
await run('deploy', { tags: 'ValueArrayTester' })

const valueArrayTester = await ethers.getContract('ValueArrayTester')
const valueArrayTester = await ethers.getContractAt(
'ValueArrayTester',
(
await deployments.get('ValueArrayTester')
).address
)

await valueArrayTester.test()
})
Expand Down