mirror of
https://github.com/datahaven-xyz/datahaven
synced 2026-05-24 09:50:01 +00:00
This PR improves the CLI to get from the deployments the
`RewardsRegistryAddress` (address of the RewardsRegistry contract
deployed), `RewardsAgentOrigin` (origin used for the agent in charge of
updating the rewards merkle root in the RewardsRegistry contract) and
`RewardsUpdateSelector` (function selector of the function that the
agent must execute to do the aforementioned update) and then set these
values in the `parameters` pallet of the runtime.
After these changes the rewards merkle root is being updated on the
Ethereum side. 🎉
67 lines
2 KiB
Solidity
67 lines
2 KiB
Solidity
// SPDX-License-Identifier: UNLICENSED
|
|
pragma solidity ^0.8.27;
|
|
|
|
import {console} from "forge-std/console.sol";
|
|
|
|
library Logging {
|
|
// Logging helper constants
|
|
string private constant HEADER1 = "============================================================";
|
|
string private constant HEADER2 = " ";
|
|
string private constant FOOTER = "============================================================";
|
|
string private constant SEPARATOR =
|
|
"------------------------------------------------------------";
|
|
|
|
function logHeader(
|
|
string memory title
|
|
) internal pure {
|
|
console.log("");
|
|
console.log(HEADER1);
|
|
console.log("| %s |", title);
|
|
console.log(SEPARATOR);
|
|
}
|
|
|
|
function logSection(
|
|
string memory title
|
|
) internal pure {
|
|
console.log("");
|
|
console.log("| %s:", title);
|
|
console.log(SEPARATOR);
|
|
}
|
|
|
|
function logContractDeployed(string memory name, address contractAddress) internal pure {
|
|
console.log("| [+] %s: %s", name, contractAddress);
|
|
}
|
|
|
|
function logAgentOrigin(string memory name, string memory agentOrigin) internal pure {
|
|
console.log("| [+] %s: %s", name, agentOrigin);
|
|
}
|
|
|
|
function logFunctionSelector(string memory name, string memory selector) internal pure {
|
|
console.log("| [+] %s: %s", name, selector);
|
|
}
|
|
|
|
function logStep(
|
|
string memory message
|
|
) internal pure {
|
|
console.log("| >>> %s", message);
|
|
}
|
|
|
|
function logInfo(
|
|
string memory message
|
|
) internal pure {
|
|
console.log("| [i] %s", message);
|
|
}
|
|
|
|
function logFooter() internal pure {
|
|
console.log(FOOTER);
|
|
console.log("");
|
|
}
|
|
|
|
function logProgress(uint16 step, uint16 totalSteps) internal pure {
|
|
console.log("");
|
|
console.log(
|
|
"Progress: Step %d/%d completed (%d%%)", step, totalSteps, (step * 100) / totalSteps
|
|
);
|
|
console.log("");
|
|
}
|
|
}
|