Some checks failed
CI/CD Pipeline / Solidity Contracts (push) Failing after 1m3s
CI/CD Pipeline / Security Scanning (push) Successful in 2m18s
CI/CD Pipeline / Lint and Format (push) Failing after 34s
CI/CD Pipeline / Terraform Validation (push) Failing after 20s
CI/CD Pipeline / Kubernetes Validation (push) Successful in 22s
Deploy ChainID 138 / Deploy ChainID 138 (push) Failing after 40s
HYBX OMNL TypeScript & anchor / token-aggregation build + reconcile artifact (push) Failing after 49s
OMNL reconcile anchor / Run omnl:reconcile and upload artifacts (push) Failing after 21s
Validation / validate-genesis (push) Successful in 25s
Validation / validate-terraform (push) Failing after 21s
Validation / validate-kubernetes (push) Failing after 8s
Validation / validate-smart-contracts (push) Failing after 8s
Validation / validate-security (push) Failing after 1m11s
Validation / validate-documentation (push) Failing after 14s
Verify Deployment / Verify Deployment (push) Failing after 45s
Ship AddressActivityRegistry V1/V2, ISO20022IntakeGateway, Chain138ParticipantSurface, checkpoint hub contracts, checkpoint-core package, aggregator/indexer/sdk services, relay profile guards, M00 diamond bridge facet, and OMNL compliance contracts. Co-authored-by: Cursor <cursoragent@cursor.com>
53 lines
2.2 KiB
Solidity
53 lines
2.2 KiB
Solidity
// SPDX-License-Identifier: MIT
|
|
pragma solidity ^0.8.20;
|
|
|
|
import {CheckpointExtensionBase} from "./CheckpointExtensionBase.sol";
|
|
import {CheckpointStorage} from "../storage/CheckpointStorage.sol";
|
|
import {CheckpointFlags} from "../libraries/CheckpointFlags.sol";
|
|
|
|
/// @notice Queues non-emergency checkpoints until delay elapses (governance timelock-lite).
|
|
contract TimelockSubmitExtension is CheckpointExtensionBase {
|
|
uint256 public delaySeconds = 48 hours;
|
|
mapping(bytes32 => uint256) public readyAt;
|
|
|
|
event CheckpointQueued(uint64 indexed batchId, bytes32 queueId, uint256 readyAt);
|
|
|
|
function HOOK_BEFORE_SUBMIT() external pure override returns (uint32) {
|
|
return 1 << 0;
|
|
}
|
|
|
|
function HOOK_AFTER_SUBMIT() external pure override returns (uint32) {
|
|
return 0;
|
|
}
|
|
|
|
function HOOK_ON_CCIP() external pure override returns (uint32) {
|
|
return 0;
|
|
}
|
|
|
|
function setDelay(uint256 seconds_) external {
|
|
delaySeconds = seconds_;
|
|
}
|
|
|
|
function queueCheckpoint(CheckpointStorage.CheckpointHeader calldata header) external returns (bytes32 queueId) {
|
|
require(!CheckpointFlags.has(header.flags, CheckpointFlags.EMERGENCY), "emergency");
|
|
queueId = keccak256(abi.encode(header.batchId, header.paymentsRoot, header.checkpointBlock));
|
|
readyAt[queueId] = block.timestamp + delaySeconds;
|
|
emit CheckpointQueued(header.batchId, queueId, readyAt[queueId]);
|
|
}
|
|
|
|
function beforeSubmit(CheckpointStorage.CheckpointHeader calldata header, bytes calldata) external view {
|
|
if (CheckpointFlags.has(header.flags, CheckpointFlags.EMERGENCY)) return;
|
|
bytes32 queueId = keccak256(abi.encode(header.batchId, header.paymentsRoot, header.checkpointBlock));
|
|
uint256 ready = readyAt[queueId];
|
|
if (ready == 0) return;
|
|
require(block.timestamp >= ready, "timelock");
|
|
}
|
|
|
|
function afterSubmit(CheckpointStorage.CheckpointHeader calldata header, bytes calldata) external {
|
|
bytes32 queueId = keccak256(abi.encode(header.batchId, header.paymentsRoot, header.checkpointBlock));
|
|
delete readyAt[queueId];
|
|
}
|
|
|
|
function onCCIPReceive(bytes calldata) external pure override {}
|
|
}
|