github.com/ethereum-optimism/optimism@v1.7.2/packages/sdk/test/contracts/MockSCC.sol (about) 1 pragma solidity ^0.8.9; 2 3 contract MockSCC { 4 event StateBatchAppended( 5 uint256 indexed _batchIndex, 6 bytes32 _batchRoot, 7 uint256 _batchSize, 8 uint256 _prevTotalElements, 9 bytes _extraData 10 ); 11 12 struct StateBatchAppendedArgs { 13 uint256 batchIndex; 14 bytes32 batchRoot; 15 uint256 batchSize; 16 uint256 prevTotalElements; 17 bytes extraData; 18 } 19 20 // Window in seconds, will resolve to 100 blocks. 21 uint256 public FRAUD_PROOF_WINDOW = 1500; 22 uint256 public batches = 0; 23 StateBatchAppendedArgs public sbaParams; 24 25 function getTotalBatches() public view returns (uint256) { 26 return batches; 27 } 28 29 function setSBAParams( 30 StateBatchAppendedArgs memory _args 31 ) public { 32 sbaParams = _args; 33 } 34 35 function appendStateBatch( 36 bytes32[] memory _roots, 37 uint256 _shouldStartAtIndex 38 ) public { 39 batches++; 40 emit StateBatchAppended( 41 sbaParams.batchIndex, 42 sbaParams.batchRoot, 43 sbaParams.batchSize, 44 sbaParams.prevTotalElements, 45 sbaParams.extraData 46 ); 47 } 48 }