ADD file via upload
This commit is contained in:
parent
627f2a7b54
commit
e20c0f3406
|
@ -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;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue