Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
xqft committed Oct 14, 2024
1 parent d1ae31a commit dee690b
Showing 1 changed file with 7 additions and 28 deletions.
35 changes: 7 additions & 28 deletions contract/src/MinaStateSettlement.sol
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@ contract MinaStateSettlement {
/// @notice Reference to the AlignedLayerServiceManager contract.
AlignedLayerServiceManager aligned;

constructor(
address payable _alignedServiceAddr,
bytes32 _tipStateHash,
bool _devnetFlag
constructor(address payable _alignedServiceAddr, bytes32 _tipStateHash, bool _devnetFlag
) {
aligned = AlignedLayerServiceManager(_alignedServiceAddr);
chainStateHashes[BRIDGE_TRANSITION_FRONTIER_LEN - 1] = _tipStateHash;
Expand All @@ -52,19 +49,13 @@ contract MinaStateSettlement {
}

/// @notice Returns the latest verified chain state hashes.
function getChainStateHashes()
external
view
returns (bytes32[BRIDGE_TRANSITION_FRONTIER_LEN] memory)
function getChainStateHashes() external view returns (bytes32[BRIDGE_TRANSITION_FRONTIER_LEN] memory)
{
return chainStateHashes;
}

/// @notice Returns the latest verified chain ledger hashes.
function getChainLedgerHashes()
external
view
returns (bytes32[BRIDGE_TRANSITION_FRONTIER_LEN] memory)
function getChainLedgerHashes() external view returns (bytes32[BRIDGE_TRANSITION_FRONTIER_LEN] memory)
{
return chainLedgerHashes;
}
Expand Down Expand Up @@ -93,9 +84,7 @@ contract MinaStateSettlement {
address batcherPaymentService
) external {
if (provingSystemAuxDataCommitment != PROVING_SYSTEM_ID_COMM) {
revert MinaProvingSystemIdIsNotValid(
provingSystemAuxDataCommitment
);
revert MinaProvingSystemIdIsNotValid(provingSystemAuxDataCommitment);
}

bool pubInputDevnetFlag;
Expand All @@ -112,14 +101,8 @@ contract MinaStateSettlement {
pubInputBridgeTipStateHash := mload(add(pubInput, 0x21))
}

if (
pubInputBridgeTipStateHash !=
chainStateHashes[BRIDGE_TRANSITION_FRONTIER_LEN - 1]
) {
revert TipStateIsWrong(
pubInputBridgeTipStateHash,
chainStateHashes[BRIDGE_TRANSITION_FRONTIER_LEN - 1]
);
if (pubInputBridgeTipStateHash != chainStateHashes[BRIDGE_TRANSITION_FRONTIER_LEN - 1]) {
revert TipStateIsWrong(pubInputBridgeTipStateHash, chainStateHashes[BRIDGE_TRANSITION_FRONTIER_LEN - 1]);
}

bytes32 pubInputCommitment = keccak256(pubInput);
Expand Down Expand Up @@ -152,11 +135,7 @@ contract MinaStateSettlement {
mul(32, BRIDGE_TRANSITION_FRONTIER_LEN)
)

for {
let i := 0
} lt(i, BRIDGE_TRANSITION_FRONTIER_LEN) {
i := add(i, 1)
} {
for { let i := 0 } lt(i, BRIDGE_TRANSITION_FRONTIER_LEN) { i := add(i, 1) } {
sstore(slot_states, mload(addr_states))
addr_states := add(addr_states, 32)
slot_states := add(slot_states, 1)
Expand Down

0 comments on commit dee690b

Please sign in to comment.