UNPKG

@ensdomains/unruggable-gateways

Version:

Trustless Ethereum Multichain CCIP-Read Gateway

49 lines (48 loc) 1.87 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DIAMOND_ABI = void 0; exports.encodeProof = encodeProof; const abi_1 = require("ethers/abi"); const utils_js_1 = require("../utils.cjs"); // https://github.com/matter-labs/era-contracts/blob/main/l1-contracts/contracts/state-transition/chain-interfaces/IGetters.sol // https://github.com/matter-labs/era-contracts/blob/main/l1-contracts/contracts/state-transition/chain-interfaces/IExecutor.sol exports.DIAMOND_ABI = new abi_1.Interface([ `function storedBatchHash(uint256 batchNumber) view returns (bytes32)`, `function l2LogsRootHash(uint256 batchNumber) external view returns (bytes32)`, //`function getTotalBatchesCommitted() view returns (uint256)`, //`function getTotalBatchesVerified() view returns (uint256)`, `function getTotalBatchesExecuted() view returns (uint256)`, `function commitBatchesSharedBridge( uint256 chainId, ( uint64 batchNumber, bytes32 batchHash, uint64 indexRepeatedStorageChanges, uint256 numberOfLayer1Txs, bytes32 priorityOperationsHash, bytes32 l2LogsTreeRoot, uint256 timestamp, bytes32 commitment, ) lastCommittedBatchData, ( uint64 batchNumber, uint64 timestamp, uint64 indexRepeatedStorageChanges, bytes32 newStateRoot, uint256 numberOfLayer1Txs, bytes32 priorityOperationsHash, bytes32 bootloaderHeapInitialContentsHash, bytes32 eventsQueueStateHash, bytes systemLogs, bytes pubdataCommitments )[] newBatchesData )`, `event BlockCommit( uint256 indexed batchNumber, bytes32 indexed batchHash, bytes32 indexed commitment )`, ]); function encodeProof(proof) { return utils_js_1.ABI_CODER.encode(['bytes32', 'uint64', 'bytes32[]'], [proof.value, proof.index, proof.proof]); }