-
Notifications
You must be signed in to change notification settings - Fork 8
Dummy contract #81
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
base: celestia-integration
Are you sure you want to change the base?
Dummy contract #81
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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) | ||
| }) |
| 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) | ||
| }) |
| 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' | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After deploying the dummy contract replace this
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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) | ||
| }) | ||
| 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 | ||
| } | ||
| } |
There was a problem hiding this comment.
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.