Skip to content
Draft
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
13 changes: 13 additions & 0 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,12 @@ module.exports = {
? [process.env['DEVNET_PRIVKEY']]
: [],
},
moltenDevnet: {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, maybe we should add more of the networks we work against to this.

url: 'https://molten-test-3.rpc.dev.caldera.xyz',
accounts: process.env['DEVNET_PRIVKEY']
? [process.env['DEVNET_PRIVKEY']]
: [],
},
geth: {
url: 'http://localhost:8545',
},
Expand Down Expand Up @@ -237,6 +243,13 @@ module.exports = {
browserURL: 'https://sepolia.basescan.org/',
},
},
{
network: 'moltenDevnet',
chainId: 3603,
urls: {
apiURL: 'https://molten-test-3.rpc.dev.caldera.xyz/http',
},
},
],
},
mocha: {
Expand Down
22 changes: 22 additions & 0 deletions scripts/deployAndVerifySequencerInbox.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import '@nomiclabs/hardhat-ethers'
import { ethers } from 'hardhat'
import { deployContract } from './deploymentUtils'

async function main() {
const [deployer] = await ethers.getSigners()

const SequencerInbox = await deployContract(
'SequencerInbox',
deployer,
[process.env.MAX_DATA_SIZE, process.env.READER_ADDRESS, process.env.IS_USING_FEE_TOKEN],
true
)
console.log('SequencerInbox deployed at address:', SequencerInbox.address)
}

main()
.then(() => process.exit(0))
.catch((error: Error) => {
console.error(error)
process.exit(1)
})
17 changes: 17 additions & 0 deletions scripts/deployDummyContract.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import '@nomiclabs/hardhat-ethers'
import { ethers } from 'hardhat'
import { deployContract } from './deploymentUtils'

async function main() {
const [deployer] = await ethers.getSigners()

const DummyContract = await deployContract('DataLogger', deployer, [], true)
console.log('DummyContract deployed at address:', DummyContract.address)
}

main()
.then(() => process.exit(0))
.catch((error: Error) => {
console.error(error)
process.exit(1)
})
36 changes: 36 additions & 0 deletions scripts/sendData.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import '@nomiclabs/hardhat-ethers'
import { ethers } from 'hardhat'
import { BigNumber } from 'ethers'

async function main() {
const [signer] = await ethers.getSigners()

// Replace with your deployed contract address
const contractAddress = '0xbA6E2502B4Ef771582bD4517182440cC6D31c8e7'
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After deploying the dummy contract replace this

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't we just have a flag that optionally deploys the contract for you, and then use the address in the same script, We could just have it do that based on a env var or a cmd flag.


// Get contract interface from artifacts
const DataLogger = await ethers.getContractAt(
'DataLogger',
contractAddress,
signer
)

// Generate 100 KB of data (zero bytes or random)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment, and the one on the next line are wrong.

const dataSize = 50 * 1024 // 90 KB
const buffer = Buffer.alloc(dataSize, 0x42) // fill with 'B' = 0x42

console.log(`Sending ${dataSize / 1024} KB of calldata...`)

const tx = await DataLogger.postData(buffer, {
gasLimit: BigNumber.from(2_000_000),
})

console.log('Transaction sent! Hash:', tx.hash)
await tx.wait()
console.log('Transaction confirmed.')
}

main().catch(error => {
console.error(error)
process.exit(1)
})
8 changes: 8 additions & 0 deletions src/DummyContract.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.25;

contract DataLogger {
function postData(bytes calldata data) external {
// No-op; just accept data
}
}