diff --git a/blockchain_integration/pi_network/pi-network-layer2-scaling/contracts/rollups/RollupValidator.sol b/blockchain_integration/pi_network/pi-network-layer2-scaling/contracts/rollups/RollupValidator.sol new file mode 100644 index 000000000..42ea79195 --- /dev/null +++ b/blockchain_integration/pi_network/pi-network-layer2-scaling/contracts/rollups/RollupValidator.sol @@ -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); + } +}