Skip to content

Commit

Permalink
Merge pull request #26 from ethstorage/deploy_params
Browse files Browse the repository at this point in the history
Public testnet params
  • Loading branch information
qzhodl authored Oct 17, 2023
2 parents 88a5df8 + 3f60f0e commit 56738ae
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions scripts/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,33 @@ const hre = require("hardhat");

async function main() {
let StorageContract = await hre.ethers.getContractFactory("TestEthStorageContractKZG");
const startTime = Math.floor(new Date().getTime() / 1000);

let storageContract = await StorageContract.deploy(
[
17, // maxKvSizeBits
17, // maxKvSizeBits, 131072
30, // shardSizeBits ~ 1G
2, // randomChecks
1000000, // minimumDiff
60, // cutoff
10000000, // minimumDiff 10000000 / 60 = 16,666 sample/s is enable to mine, and one AX101 can provide 1M/12 = 83,333 sample/s power
60, // cutoff, means 1 minute for testnet and may need to change longer later
1024, // diffAdjDivisor
100, // treasuryShare
100, // treasuryShare, means 1%
],
0, // startTime
0, // storageCost
0, // dcfFactor
1048576, // nonceLimit
startTime, // startTime
2000000000000, // storageCost - 2000Gwei forever per blob - https://ethresear.ch/t/ethstorage-scaling-ethereum-storage-via-l2-and-da/14223/6#incentivization-for-storing-m-physical-replicas-1
340282365167313208607671216367074279424n, // dcfFactor, it mean 0.85 for yearly discount
1048576, // nonceLimit 1024 * 1024 = 1M samples and finish sampling in 1.3s with IO rate 6144 MB/s: 4k * 2(random checks) / 6144 = 1.3s
"0x0000000000000000000000000000000000000000", // treasury
0, // prepaidAmount
8192000000000000, // prepaidAmount - ~ 50% discount, 4096 blob cost for 1G data
{ gasPrice: 30000000000 }
);
await storageContract.deployed();
console.log("storage contract address is ", storageContract.address);

// fund 10 eth into the storage contract to give reward for empty mining
const tx = await storageContract.sendValue({ value: ethers.utils.parseEther("10") });
await tx.wait();
console.log("balance of " + storageContract.address, await hre.ethers.provider.getBalance(storageContract.address));
}

// We recommend this pattern to be able to use async/await everywhere
Expand Down

0 comments on commit 56738ae

Please sign in to comment.