Commit 992770e9 authored by 贾浩@五瓣科技's avatar 贾浩@五瓣科技

update

parent df627af6
......@@ -28,7 +28,7 @@ contract Validator is IValidator, Ownable {
// 记录每天的 merkle sum root
mapping(uint256 => bytes32) public dailyMerkleSumRootMap;
uint256 public dailyDistribution;
uint256 public dailyDistribution = 10000 ether;
constructor() Ownable(msg.sender) {
validatorSet.add(msg.sender); // for test
......@@ -50,6 +50,9 @@ contract Validator is IValidator, Ownable {
}
function getWorkloadDistribution(uint256 dailyWorkload) view public returns (uint256) {
if (dailyWorkload == 0) {
return 0;
}
return dailyDistribution / dailyWorkload;
}
......
// We require the Hardhat Runtime Environment explicitly here. This is optional
// but useful for running the script in a standalone fashion through `node <script>`.
//
// You can also run a script with `npx hardhat run <script>`. If you do that, Hardhat
// will compile your contracts, add the Hardhat Runtime Environment's members to the
// global scope, and execute the script.
const hre = require("hardhat");
async function main() {
const Storage = await hre.ethers.getContractFactory("AddressStorage");
const storage = Storage.attach("0x7Cd36Bc2a477f60A14f08442179B2f626bE026Ea")
const ret = await storage.setContainerAddress("0x7Cd36Bc2a477f60A14f08442179B2f626bE026Ea", true);
console.log(ret.hash);
}
// We recommend this pattern to be able to use async/await everywhere
// and properly handle errors.
main().catch((error) => {
console.error(error);
process.exitCode = 1;
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment