ADD file via upload

This commit is contained in:
p30629751 2023-05-21 17:32:45 +08:00
parent 627f2a7b54
commit e20c0f3406
1 changed files with 16 additions and 0 deletions

16
RootVerifier.sol Normal file
View File

@ -0,0 +1,16 @@
pragma solidity ^0.8.0;
contract StateRootVerifier {
bytes32 private currentRoot;
function verifyAndUpdate(bytes32 oldRoot, bytes32 newRoot) external {
require(oldRoot == currentRoot, "Invalid old state root");
//
currentRoot = newRoot;
}
function getCurrentRoot() external view returns (bytes32) {
return currentRoot;
}
}