Skip to content

Commit

Permalink
Create RollupValidator.sol
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Oct 20, 2024
1 parent a524f65 commit 0bde292
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "./Rollup.sol";

contract RollupValidator {
Rollup public rollup;

event TransactionValidated(bytes32 indexed stateRoot, address indexed sender);

constructor(address _rollup) {
rollup = Rollup(_rollup);
}

function validateTransaction(bytes32 _stateRoot, address _sender) external {
require(rollup.getCurrentStateRoot() == _stateRoot, "Invalid state root");
emit TransactionValidated(_stateRoot, _sender);
}
}

0 comments on commit 0bde292

Please sign in to comment.