diff --git a/src/chains/actions.ts b/src/chains/actions.ts index 5fb6ca2..b20ecbf 100644 --- a/src/chains/actions.ts +++ b/src/chains/actions.ts @@ -1,16 +1,161 @@ -import {GenLayerClient, GenLayerChain} from "@/types"; +import {encodeFunctionData, decodeFunctionResult} from "viem"; +import {GenLayerClient, GenLayerChain, Address} from "@/types"; +import {localnet} from "./localnet"; +import {studionet} from "./studionet"; +import {testnetAsimov} from "./testnetAsimov"; -export function chainActions(_client: GenLayerClient) { +const ADDRESS_MANAGER_ABI = [ + { + inputs: [{internalType: "string", name: "name", type: "string"}], + name: "getAddress", + outputs: [{internalType: "address", name: "", type: "address"}], + stateMutability: "view", + type: "function", + }, +] as const; + +async function resolveFromAddressManager( + rpcUrl: string, + addressManagerAddress: Address, + name: string, +): Promise
{ + const data = encodeFunctionData({ + abi: ADDRESS_MANAGER_ABI, + functionName: "getAddress", + args: [name], + }); + + const response = await fetch(rpcUrl, { + method: "POST", + headers: {"Content-Type": "application/json"}, + body: JSON.stringify({ + jsonrpc: "2.0", + id: Date.now(), + method: "eth_call", + params: [{to: addressManagerAddress, data}, "latest"], + }), + }); + + const json = (await response.json()) as {result?: string; error?: {message: string}}; + if (json.error) { + throw new Error(`AddressManager.getAddress("${name}") failed: ${json.error.message}`); + } + + if (!json.result || json.result === "0x" || json.result === "0x0") { + throw new Error( + `AddressManager at ${addressManagerAddress} returned empty data for "${name}". ` + + `The AddressManager contract may not be deployed at this address.`, + ); + } + + const result = decodeFunctionResult({ + abi: ADDRESS_MANAGER_ABI, + functionName: "getAddress", + data: json.result as `0x${string}`, + }); + + const ZERO_ADDRESS = "0x0000000000000000000000000000000000000000"; + if (result === ZERO_ADDRESS) { + throw new Error( + `AddressManager at ${addressManagerAddress} returned zero address for "${name}". ` + + `The contract name may not be registered.`, + ); + } + + return result as Address; +} + +export function chainActions(client: GenLayerClient) { return { - /** - * @deprecated This method is deprecated and will be removed in a future release. - * The consensus contract is now resolved from the static chain definition. - */ - initializeConsensusSmartContract: async (_forceReset: boolean = false): Promise => { - console.warn( - "[genlayer-js] initializeConsensusSmartContract() is deprecated and will be removed in a future release. " + - "The consensus contract is now resolved from the static chain definition.", - ); + initializeConsensusSmartContract: async (forceReset: boolean = false): Promise => { + // Resolve addresses from AddressManager if configured + if (client.chain.addressManagerAddress) { + const rpcUrl = client.chain.rpcUrls.default.http[0]; + + if (client.chain.consensusMainContract) { + const mainAddress = await resolveFromAddressManager( + rpcUrl, + client.chain.addressManagerAddress, + "ConsensusMain", + ); + client.chain.consensusMainContract = { + ...client.chain.consensusMainContract, + address: mainAddress, + }; + } + + if (client.chain.consensusDataContract) { + const dataAddress = await resolveFromAddressManager( + rpcUrl, + client.chain.addressManagerAddress, + "ConsensusData", + ); + client.chain.consensusDataContract = { + ...client.chain.consensusDataContract, + address: dataAddress, + }; + } + + return; + } + + if (client.chain?.id === testnetAsimov.id) { + return; + } + + const hasStaticConsensusContract = + !!client.chain.consensusMainContract?.address && + !!client.chain.consensusMainContract?.abi; + const isLocalOrStudioChain = + client.chain?.id === localnet.id || client.chain?.id === studionet.id; + + if ( + !forceReset && + hasStaticConsensusContract && + !isLocalOrStudioChain + ) { + return; + } + + try { + const contractsResponse = await fetch(client.chain.rpcUrls.default.http[0], { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify({ + jsonrpc: "2.0", + id: Date.now(), + method: "sim_getConsensusContract", + params: ["ConsensusMain"], + }), + }); + + if (!contractsResponse.ok) { + throw new Error("Failed to fetch ConsensusMain contract"); + } + + const consensusMainContract = await contractsResponse.json(); + + if ( + consensusMainContract?.error || + !consensusMainContract?.result?.address || + !consensusMainContract?.result?.abi + ) { + throw new Error("ConsensusMain response did not include a valid contract"); + } + + client.chain.consensusMainContract = consensusMainContract.result; + (client.chain as any).__consensusAbiFetchedFromRpc = true; + } catch (error) { + // Some local simulators don't expose sim_getConsensusContract. + // If we already have a chain-baked consensus ABI, keep using it. + if (hasStaticConsensusContract) { + (client.chain as any).__consensusAbiFetchedFromRpc = false; + return; + } + throw error; + } }, }; } diff --git a/src/chains/localnet.ts b/src/chains/localnet.ts index cec581a..e86ccce 100644 --- a/src/chains/localnet.ts +++ b/src/chains/localnet.ts @@ -6,1431 +6,1350 @@ const SIMULATOR_JSON_RPC_URL = "http://127.0.0.1:4000/api"; const CONSENSUS_MAIN_CONTRACT = { address: "0xb7278A61aa25c888815aFC32Ad3cC52fF24fE575" as Address, abi: [ - { - inputs: [], - name: "AccessControlBadConfirmation", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "account", - type: "address", - }, - { - internalType: "bytes32", - name: "neededRole", - type: "bytes32", - }, - ], - name: "AccessControlUnauthorizedAccount", - type: "error", - }, - { - inputs: [], - name: "CallerNotMessages", - type: "error", - }, - { - inputs: [], - name: "CanNotAppeal", - type: "error", - }, - { - inputs: [], - name: "EmptyTransaction", - type: "error", - }, - { - inputs: [], - name: "FinalizationNotAllowed", - type: "error", - }, - { - inputs: [], - name: "InvalidAddress", - type: "error", - }, - { - inputs: [], - name: "InvalidGhostContract", - type: "error", - }, - { - inputs: [], - name: "InvalidInitialization", - type: "error", - }, - { - inputs: [], - name: "InvalidVote", - type: "error", - }, - { - inputs: [], - name: "MaxNumOfIterationsInPendingQueueReached", - type: "error", - }, - { - inputs: [ - { - internalType: "uint256", - name: "numOfMessages", - type: "uint256", - }, - { - internalType: "uint256", - name: "maxAllocatedMessages", - type: "uint256", - }, - ], - name: "MaxNumOfMessagesExceeded", - type: "error", - }, - { - inputs: [], - name: "NonGenVMContract", - type: "error", - }, - { - inputs: [], - name: "NotInitializing", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "owner", - type: "address", - }, - ], - name: "OwnableInvalidOwner", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "account", - type: "address", - }, - ], - name: "OwnableUnauthorizedAccount", - type: "error", - }, - { - inputs: [], - name: "ReentrancyGuardReentrantCall", - type: "error", - }, - { - inputs: [], - name: "TransactionNotAtPendingQueueHead", - type: "error", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "txId", - type: "bytes32", - }, - { - indexed: true, - internalType: "address", - name: "appealer", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "appealBond", - type: "uint256", - }, - { - indexed: false, - internalType: "address[]", - name: "appealValidators", - type: "address[]", - }, - ], - name: "AppealStarted", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "txId", - type: "bytes32", - }, - { - indexed: true, - internalType: "address", - name: "recipient", - type: "address", - }, - { - indexed: false, - internalType: "bytes", - name: "data", - type: "bytes", - }, - ], - name: "ErrorMessage", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "address", - name: "ghostFactory", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "genManager", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "genTransactions", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "genQueue", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "genStaking", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "genMessages", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "idleness", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "tribunalAppeal", - type: "address", - }, - ], - name: "ExternalContractsSet", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint64", - name: "version", - type: "uint64", - }, - ], - name: "Initialized", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "txId", - type: "bytes32", - }, - { - indexed: true, - internalType: "address", - name: "recipient", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "activator", - type: "address", - }, - ], - name: "InternalMessageProcessed", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "txId", - type: "bytes32", - }, - { - indexed: true, - internalType: "address", - name: "recipient", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "activator", - type: "address", - }, - ], - name: "NewTransaction", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "previousOwner", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "newOwner", - type: "address", - }, - ], - name: "OwnershipTransferStarted", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "previousOwner", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "newOwner", - type: "address", - }, - ], - name: "OwnershipTransferred", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "role", - type: "bytes32", - }, - { - indexed: true, - internalType: "bytes32", - name: "previousAdminRole", - type: "bytes32", - }, - { - indexed: true, - internalType: "bytes32", - name: "newAdminRole", - type: "bytes32", - }, - ], - name: "RoleAdminChanged", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "role", - type: "bytes32", - }, - { - indexed: true, - internalType: "address", - name: "account", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "sender", - type: "address", - }, - ], - name: "RoleGranted", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "role", - type: "bytes32", - }, - { - indexed: true, - internalType: "address", - name: "account", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "sender", - type: "address", - }, - ], - name: "RoleRevoked", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "txId", - type: "bytes32", - }, - { - indexed: true, - internalType: "address", - name: "sender", - type: "address", - }, - ], - name: "SlashAppealSubmitted", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "tx_id", - type: "bytes32", - }, - ], - name: "TransactionAccepted", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "txId", - type: "bytes32", - }, - { - indexed: true, - internalType: "address", - name: "leader", - type: "address", - }, - ], - name: "TransactionActivated", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "uint256", - name: "batchId", - type: "uint256", - }, - { - indexed: false, - internalType: "address[]", - name: "validators", - type: "address[]", - }, - ], - name: "TransactionActivatedValidators", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "txId", - type: "bytes32", - }, - { - indexed: true, - internalType: "address", - name: "sender", - type: "address", - }, - ], - name: "TransactionCancelled", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "tx_id", - type: "bytes32", - }, - ], - name: "TransactionFinalized", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "txId", - type: "bytes32", - }, - { - indexed: true, - internalType: "address", - name: "oldValidator", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "newValidator", - type: "address", - }, - ], - name: "TransactionIdleValidatorReplaced", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "txId", - type: "bytes32", - }, - { - indexed: true, - internalType: "uint256", - name: "validatorIndex", - type: "uint256", - }, - ], - name: "TransactionIdleValidatorReplacementFailed", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "txId", - type: "bytes32", - }, - { - indexed: true, - internalType: "address", - name: "newLeader", - type: "address", - }, - ], - name: "TransactionLeaderRotated", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "tx_id", - type: "bytes32", - }, - ], - name: "TransactionLeaderTimeout", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "bytes32[]", - name: "tx_ids", - type: "bytes32[]", - }, - ], - name: "TransactionNeedsRecomputation", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "tx_id", - type: "bytes32", - }, - { - indexed: false, - internalType: "address[]", - name: "validators", - type: "address[]", - }, - ], - name: "TransactionReceiptProposed", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "tx_id", - type: "bytes32", - }, - ], - name: "TransactionUndetermined", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "txId", - type: "bytes32", - }, - { - indexed: true, - internalType: "address", - name: "validator", - type: "address", - }, - { - indexed: false, - internalType: "bool", - name: "isLastVote", - type: "bool", - }, - ], - name: "TribunalAppealVoteCommitted", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "txId", - type: "bytes32", - }, - { - indexed: true, - internalType: "address", - name: "validator", - type: "address", - }, - { - indexed: false, - internalType: "bool", - name: "isLastVote", - type: "bool", - }, - ], - name: "TribunalAppealVoteRevealed", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "txId", - type: "bytes32", - }, - { - indexed: true, - internalType: "address", - name: "validator", - type: "address", - }, - { - indexed: false, - internalType: "bool", - name: "isLastVote", - type: "bool", - }, - ], - name: "VoteCommitted", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "txId", - type: "bytes32", - }, - { - indexed: true, - internalType: "address", - name: "validator", - type: "address", - }, - { - indexed: false, - internalType: "enum ITransactions.VoteType", - name: "voteType", - type: "uint8", - }, - { - indexed: false, - internalType: "bool", - name: "isLastVote", - type: "bool", - }, - { - indexed: false, - internalType: "enum ITransactions.ResultType", - name: "result", - type: "uint8", - }, - ], - name: "VoteRevealed", - type: "event", - }, - { - inputs: [], - name: "DEFAULT_ADMIN_ROLE", - outputs: [ - { - internalType: "bytes32", - name: "", - type: "bytes32", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "EVENTS_BATCH_SIZE", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "acceptOwnership", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "_txId", - type: "bytes32", - }, - { - internalType: "bytes", - name: "_vrfProof", - type: "bytes", - }, - ], - name: "activateTransaction", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "_sender", - type: "address", - }, - { - internalType: "address", - name: "_recipient", - type: "address", - }, - { - internalType: "uint256", - name: "_numOfInitialValidators", - type: "uint256", - }, - { - internalType: "uint256", - name: "_maxRotations", - type: "uint256", - }, - { - internalType: "bytes", - name: "_txData", - type: "bytes", - }, - ], - name: "addTransaction", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "_txId", - type: "bytes32", - }, - ], - name: "cancelTransaction", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "_txId", - type: "bytes32", - }, - { - internalType: "bytes32", - name: "_commitHash", - type: "bytes32", - }, - ], - name: "commitTribunalAppealVote", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "_txId", - type: "bytes32", - }, - { - internalType: "bytes32", - name: "_commitHash", - type: "bytes32", - }, - { - internalType: "uint256", - name: "_validatorIndex", - type: "uint256", - }, - ], - name: "commitVote", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "contracts", - outputs: [ - { - internalType: "contract IGenManager", - name: "genManager", - type: "address", - }, - { - internalType: "contract ITransactions", - name: "genTransactions", - type: "address", - }, - { - internalType: "contract IQueues", - name: "genQueue", - type: "address", - }, - { - internalType: "contract IGhostFactory", - name: "ghostFactory", - type: "address", - }, - { - internalType: "contract IGenStaking", - name: "genStaking", - type: "address", - }, - { - internalType: "contract IMessages", - name: "genMessages", - type: "address", - }, - { - internalType: "contract IIdleness", - name: "idleness", - type: "address", - }, - { - internalType: "contract ITribunalAppeal", - name: "tribunalAppeal", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "_recipient", - type: "address", - }, - { - internalType: "uint256", - name: "_value", - type: "uint256", - }, - { - internalType: "bytes", - name: "_data", - type: "bytes", - }, - ], - name: "executeMessage", - outputs: [ - { - internalType: "bool", - name: "success", - type: "bool", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "_txId", - type: "bytes32", - }, - ], - name: "finalizeTransaction", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "getContracts", - outputs: [ - { - components: [ - { - internalType: "contract IGenManager", - name: "genManager", - type: "address", - }, - { - internalType: "contract ITransactions", - name: "genTransactions", - type: "address", - }, - { - internalType: "contract IQueues", - name: "genQueue", - type: "address", - }, - { - internalType: "contract IGhostFactory", - name: "ghostFactory", - type: "address", - }, - { - internalType: "contract IGenStaking", - name: "genStaking", - type: "address", - }, - { - internalType: "contract IMessages", - name: "genMessages", - type: "address", - }, - { - internalType: "contract IIdleness", - name: "idleness", - type: "address", - }, - { - internalType: "contract ITribunalAppeal", - name: "tribunalAppeal", - type: "address", - }, - ], - internalType: "struct IConsensusMain.ExternalContracts", - name: "", - type: "tuple", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "role", - type: "bytes32", - }, - ], - name: "getRoleAdmin", - outputs: [ - { - internalType: "bytes32", - name: "", - type: "bytes32", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "addr", - type: "address", - }, - ], - name: "ghostContracts", - outputs: [ - { - internalType: "bool", - name: "isGhost", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "role", - type: "bytes32", - }, - { - internalType: "address", - name: "account", - type: "address", - }, - ], - name: "grantRole", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "role", - type: "bytes32", - }, - { - internalType: "address", - name: "account", - type: "address", - }, - ], - name: "hasRole", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "initialize", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "owner", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "pendingOwner", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - ], - name: "proceedPendingQueueProcessing", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "_txId", - type: "bytes32", - }, - { - internalType: "bytes", - name: "_txReceipt", - type: "bytes", - }, - { - internalType: "uint256", - name: "_processingBlock", - type: "uint256", - }, - { - components: [ - { - internalType: "enum IMessages.MessageType", - name: "messageType", - type: "uint8", - }, - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "value", - type: "uint256", - }, - { - internalType: "bytes", - name: "data", - type: "bytes", - }, - { - internalType: "bool", - name: "onAcceptance", - type: "bool", - }, - ], - internalType: "struct IMessages.SubmittedMessage[]", - name: "_messages", - type: "tuple[]", - }, - { - internalType: "bytes", - name: "_vrfProof", - type: "bytes", - }, - ], - name: "proposeReceipt", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "renounceOwnership", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "role", - type: "bytes32", - }, - { - internalType: "address", - name: "callerConfirmation", - type: "address", - }, - ], - name: "renounceRole", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "_txId", - type: "bytes32", - }, - { - internalType: "bytes32", - name: "_voteHash", - type: "bytes32", - }, - { - internalType: "enum ITribunalAppeal.TribunalVoteType", - name: "_voteType", - type: "uint8", - }, - { - internalType: "uint256", - name: "_nonce", - type: "uint256", - }, - ], - name: "revealTribunalAppealVote", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "_txId", - type: "bytes32", - }, - { - internalType: "bytes32", - name: "_voteHash", - type: "bytes32", - }, - { - internalType: "enum ITransactions.VoteType", - name: "_voteType", - type: "uint8", - }, - { - internalType: "uint256", - name: "_nonce", - type: "uint256", - }, - { - internalType: "uint256", - name: "_validatorIndex", - type: "uint256", - }, - ], - name: "revealVote", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "role", - type: "bytes32", - }, - { - internalType: "address", - name: "account", - type: "address", - }, - ], - name: "revokeRole", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "_ghostFactory", - type: "address", - }, - { - internalType: "address", - name: "_genManager", - type: "address", - }, - { - internalType: "address", - name: "_genTransactions", - type: "address", - }, - { - internalType: "address", - name: "_genQueue", - type: "address", - }, - { - internalType: "address", - name: "_genStaking", - type: "address", - }, - { - internalType: "address", - name: "_genMessages", - type: "address", - }, - { - internalType: "address", - name: "_idleness", - type: "address", - }, - { - internalType: "address", - name: "_tribunalAppeal", - type: "address", - }, - ], - name: "setExternalContracts", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "_txId", - type: "bytes32", - }, - ], - name: "submitAppeal", - outputs: [], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "_txId", - type: "bytes32", - }, - ], - name: "submitSlashAppeal", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes4", - name: "interfaceId", - type: "bytes4", - }, - ], - name: "supportsInterface", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "newOwner", - type: "address", - }, - ], - name: "transferOwnership", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "CallerNotMessages", + "type": "error" + }, + { + "inputs": [], + "name": "CanNotAppeal", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidDeploymentWithSalt", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidGhostContract", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidRevealLeaderData", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidVote", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnableInvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "OwnableUnauthorizedAccount", + "type": "error" + }, + { + "inputs": [], + "name": "ReentrancyGuardReentrantCall", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "oldActivator", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newActivator", + "type": "address" + } + ], + "name": "ActivatorReplaced", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "addressManager", + "type": "address" + } + ], + "name": "AddressManagerSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "enum ITransactions.TransactionStatus", + "name": "newStatus", + "type": "uint8" + } + ], + "name": "AllVotesCommitted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "appellant", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "bond", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "validators", + "type": "address[]" + } + ], + "name": "AppealStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "attempted", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "succeeded", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "failed", + "type": "uint256" + } + ], + "name": "BatchFinalizationCompleted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "txSlot", + "type": "uint256" + } + ], + "name": "CreatedTransaction", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "activator", + "type": "address" + } + ], + "name": "InternalMessageProcessed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "oldLeader", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newLeader", + "type": "address" + } + ], + "name": "LeaderIdlenessProcessed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "activator", + "type": "address" + } + ], + "name": "NewTransaction", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + } + ], + "name": "ProcessIdlenessAccepted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + } + ], + "name": "TransactionAccepted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "leader", + "type": "address" + } + ], + "name": "TransactionActivated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "cancelledBy", + "type": "address" + } + ], + "name": "TransactionCancelled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + } + ], + "name": "TransactionFinalizationFailed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + } + ], + "name": "TransactionFinalized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + } + ], + "name": "TransactionLeaderRevealed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "newLeader", + "type": "address" + } + ], + "name": "TransactionLeaderRotated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + } + ], + "name": "TransactionLeaderTimeout", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32[]", + "name": "txIds", + "type": "bytes32[]" + } + ], + "name": "TransactionNeedsRecomputation", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "validators", + "type": "address[]" + } + ], + "name": "TransactionReceiptProposed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + } + ], + "name": "TransactionUndetermined", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tribunalIndex", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "validator", + "type": "address" + } + ], + "name": "TribunalAppealVoteCommitted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tribunalIndex", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "validator", + "type": "address" + }, + { + "indexed": false, + "internalType": "enum ITransactions.VoteType", + "name": "voteType", + "type": "uint8" + } + ], + "name": "TribunalAppealVoteRevealed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "oldValidator", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newValidator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "validatorIndex", + "type": "uint256" + } + ], + "name": "ValidatorReplaced", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "ValueWithdrawalFailed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "validator", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isLastVote", + "type": "bool" + } + ], + "name": "VoteCommitted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "validator", + "type": "address" + }, + { + "indexed": false, + "internalType": "enum ITransactions.VoteType", + "name": "voteType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isLastVote", + "type": "bool" + }, + { + "indexed": false, + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + } + ], + "name": "VoteRevealed", + "type": "event" + }, + { + "inputs": [], + "name": "EVENTS_BATCH_SIZE", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "VERSION", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "_operator", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_vrfProof", + "type": "bytes" + } + ], + "name": "activateTransaction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_sender", + "type": "address" + }, + { + "internalType": "address", + "name": "_recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_numOfInitialValidators", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_maxRotations", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_calldata", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "_validUntil", + "type": "uint256" + } + ], + "name": "addTransaction", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "addressManager", + "outputs": [ + { + "internalType": "contract IAddressManager", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } + ], + "name": "cancelTransaction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_tribunalIndex", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "_commitHash", + "type": "bytes32" + } + ], + "name": "commitTribunalAppealVote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_commitHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_validatorIndex", + "type": "uint256" + } + ], + "name": "commitVote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_sender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_numOfInitialValidators", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_maxRotations", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_calldata", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_validUntil", + "type": "uint256" + } + ], + "name": "deploySalted", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "executeMessage", + "outputs": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32[]", + "name": "_txIds", + "type": "bytes32[]" + } + ], + "name": "finalizeIdlenessTxs", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } + ], + "name": "finalizeTransaction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } + ], + "name": "flushExternalMessages", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getAddressManager", + "outputs": [ + { + "internalType": "contract IAddressManager", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + } + ], + "name": "getPendingTransactionValue", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_addressManager", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "isGhostContract", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } + ], + "name": "leaderIdleness", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "saltAsAValidator", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "txExecutionHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "messagesAndOtherFieldsHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "otherExecutionFieldsHash", + "type": "bytes32" + }, + { + "internalType": "enum ITransactions.VoteType", + "name": "resultValue", + "type": "uint8" + }, + { + "components": [ + { + "internalType": "enum IMessages.MessageType", + "name": "messageType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bool", + "name": "onAcceptance", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + } + ], + "internalType": "struct IMessages.SubmittedMessage[]", + "name": "messages", + "type": "tuple[]" + } + ], + "internalType": "struct IConsensusMain.LeaderRevealVoteParams", + "name": "leaderRevealVoteParams", + "type": "tuple" + } + ], + "name": "leaderRevealVote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } + ], + "name": "processIdleness", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_txExecutionHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_processingBlock", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_operator", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_eqBlocksOutputs", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "_vrfProof", + "type": "bytes" + } + ], + "name": "proposeReceipt", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32[]", + "name": "_txIds", + "type": "bytes32[]" + } + ], + "name": "redButtonFinalize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "ghost", + "type": "address" + } + ], + "name": "registerGhostContract", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_tribunalIndex", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "_voteHash", + "type": "bytes32" + }, + { + "internalType": "enum ITransactions.VoteType", + "name": "_voteType", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "_otherExecutionFieldsHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_nonce", + "type": "uint256" + } + ], + "name": "revealTribunalAppealVote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_voteHash", + "type": "bytes32" + }, + { + "internalType": "enum ITransactions.VoteType", + "name": "_voteType", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "_otherExecutionFieldsHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_validatorIndex", + "type": "uint256" + } + ], + "name": "revealVote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_addressManager", + "type": "address" + } + ], + "name": "setAddressManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } + ], + "name": "submitAppeal", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } ], bytecode: "", }; @@ -1438,2551 +1357,1966 @@ const CONSENSUS_MAIN_CONTRACT = { const CONSENSUS_DATA_CONTRACT = { address: "0x88B0F18613Db92Bf970FfE264E02496e20a74D16" as Address, abi: [ - { - inputs: [], - name: "AccessControlBadConfirmation", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "account", - type: "address", - }, - { - internalType: "bytes32", - name: "neededRole", - type: "bytes32", - }, - ], - name: "AccessControlUnauthorizedAccount", - type: "error", - }, - { - inputs: [], - name: "InvalidInitialization", - type: "error", - }, - { - inputs: [], - name: "NotInitializing", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "owner", - type: "address", - }, - ], - name: "OwnableInvalidOwner", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "account", - type: "address", - }, - ], - name: "OwnableUnauthorizedAccount", - type: "error", - }, - { - inputs: [], - name: "ReentrancyGuardReentrantCall", - type: "error", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint64", - name: "version", - type: "uint64", - }, - ], - name: "Initialized", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "previousOwner", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "newOwner", - type: "address", - }, - ], - name: "OwnershipTransferStarted", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "previousOwner", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "newOwner", - type: "address", - }, - ], - name: "OwnershipTransferred", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "role", - type: "bytes32", - }, - { - indexed: true, - internalType: "bytes32", - name: "previousAdminRole", - type: "bytes32", - }, - { - indexed: true, - internalType: "bytes32", - name: "newAdminRole", - type: "bytes32", - }, - ], - name: "RoleAdminChanged", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "role", - type: "bytes32", - }, - { - indexed: true, - internalType: "address", - name: "account", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "sender", - type: "address", - }, - ], - name: "RoleGranted", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "role", - type: "bytes32", - }, - { - indexed: true, - internalType: "address", - name: "account", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "sender", - type: "address", - }, - ], - name: "RoleRevoked", - type: "event", - }, - { - inputs: [], - name: "DEFAULT_ADMIN_ROLE", - outputs: [ - { - internalType: "bytes32", - name: "", - type: "bytes32", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "acceptOwnership", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "_txId", - type: "bytes32", - }, - { - internalType: "uint256", - name: "_currentTimestamp", - type: "uint256", - }, - ], - name: "canFinalize", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - { - internalType: "uint256", - name: "", - type: "uint256", - }, - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "consensusMain", - outputs: [ - { - internalType: "contract IConsensusMain", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "_tx_id", - type: "bytes32", - }, - ], - name: "getLastAppealResult", - outputs: [ - { - internalType: "enum ITransactions.ResultType", - name: "", - type: "uint8", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - ], - name: "getLatestAcceptedTransaction", - outputs: [ - { - components: [ - { - internalType: "uint256", - name: "currentTimestamp", - type: "uint256", - }, - { - internalType: "address", - name: "sender", - type: "address", - }, - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "numOfInitialValidators", - type: "uint256", - }, - { - internalType: "uint256", - name: "txSlot", - type: "uint256", - }, - { - internalType: "uint256", - name: "createdTimestamp", - type: "uint256", - }, - { - internalType: "uint256", - name: "lastVoteTimestamp", - type: "uint256", - }, - { - internalType: "bytes32", - name: "randomSeed", - type: "bytes32", - }, - { - internalType: "enum ITransactions.ResultType", - name: "result", - type: "uint8", - }, - { - internalType: "bytes", - name: "txData", - type: "bytes", - }, - { - internalType: "bytes", - name: "txReceipt", - type: "bytes", - }, - { - components: [ - { - internalType: "enum IMessages.MessageType", - name: "messageType", - type: "uint8", - }, - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "value", - type: "uint256", - }, - { - internalType: "bytes", - name: "data", - type: "bytes", - }, - { - internalType: "bool", - name: "onAcceptance", - type: "bool", - }, - ], - internalType: "struct IMessages.SubmittedMessage[]", - name: "messages", - type: "tuple[]", - }, - { - internalType: "enum IQueues.QueueType", - name: "queueType", - type: "uint8", - }, - { - internalType: "uint256", - name: "queuePosition", - type: "uint256", - }, - { - internalType: "address", - name: "activator", - type: "address", - }, - { - internalType: "address", - name: "lastLeader", - type: "address", - }, - { - internalType: "enum ITransactions.TransactionStatus", - name: "status", - type: "uint8", - }, - { - internalType: "bytes32", - name: "txId", - type: "bytes32", - }, - { - components: [ - { - internalType: "uint256", - name: "activationBlock", - type: "uint256", - }, - { - internalType: "uint256", - name: "processingBlock", - type: "uint256", - }, - { - internalType: "uint256", - name: "proposalBlock", - type: "uint256", - }, - ], - internalType: "struct ITransactions.ReadStateBlockRange", - name: "readStateBlockRange", - type: "tuple", - }, - { - internalType: "uint256", - name: "numOfRounds", - type: "uint256", - }, - { - components: [ - { - internalType: "uint256", - name: "round", - type: "uint256", - }, - { - internalType: "uint256", - name: "leaderIndex", - type: "uint256", - }, - { - internalType: "uint256", - name: "votesCommitted", - type: "uint256", - }, - { - internalType: "uint256", - name: "votesRevealed", - type: "uint256", - }, - { - internalType: "uint256", - name: "appealBond", - type: "uint256", - }, - { - internalType: "uint256", - name: "rotationsLeft", - type: "uint256", - }, - { - internalType: "enum ITransactions.ResultType", - name: "result", - type: "uint8", - }, - { - internalType: "address[]", - name: "roundValidators", - type: "address[]", - }, - { - internalType: "bytes32[]", - name: "validatorVotesHash", - type: "bytes32[]", - }, - { - internalType: "enum ITransactions.VoteType[]", - name: "validatorVotes", - type: "uint8[]", - }, - ], - internalType: "struct ITransactions.RoundData", - name: "lastRound", - type: "tuple", - }, - ], - internalType: "struct ConsensusData.TransactionData", - name: "txData", - type: "tuple", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "startIndex", - type: "uint256", - }, - { - internalType: "uint256", - name: "pageSize", - type: "uint256", - }, - ], - name: "getLatestAcceptedTransactions", - outputs: [ - { - components: [ - { - internalType: "uint256", - name: "currentTimestamp", - type: "uint256", - }, - { - internalType: "address", - name: "sender", - type: "address", - }, - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "numOfInitialValidators", - type: "uint256", - }, - { - internalType: "uint256", - name: "txSlot", - type: "uint256", - }, - { - internalType: "uint256", - name: "createdTimestamp", - type: "uint256", - }, - { - internalType: "uint256", - name: "lastVoteTimestamp", - type: "uint256", - }, - { - internalType: "bytes32", - name: "randomSeed", - type: "bytes32", - }, - { - internalType: "enum ITransactions.ResultType", - name: "result", - type: "uint8", - }, - { - internalType: "bytes", - name: "txData", - type: "bytes", - }, - { - internalType: "bytes", - name: "txReceipt", - type: "bytes", - }, - { - components: [ - { - internalType: "enum IMessages.MessageType", - name: "messageType", - type: "uint8", - }, - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "value", - type: "uint256", - }, - { - internalType: "bytes", - name: "data", - type: "bytes", - }, - { - internalType: "bool", - name: "onAcceptance", - type: "bool", - }, - ], - internalType: "struct IMessages.SubmittedMessage[]", - name: "messages", - type: "tuple[]", - }, - { - internalType: "enum IQueues.QueueType", - name: "queueType", - type: "uint8", - }, - { - internalType: "uint256", - name: "queuePosition", - type: "uint256", - }, - { - internalType: "address", - name: "activator", - type: "address", - }, - { - internalType: "address", - name: "lastLeader", - type: "address", - }, - { - internalType: "enum ITransactions.TransactionStatus", - name: "status", - type: "uint8", - }, - { - internalType: "bytes32", - name: "txId", - type: "bytes32", - }, - { - components: [ - { - internalType: "uint256", - name: "activationBlock", - type: "uint256", - }, - { - internalType: "uint256", - name: "processingBlock", - type: "uint256", - }, - { - internalType: "uint256", - name: "proposalBlock", - type: "uint256", - }, - ], - internalType: "struct ITransactions.ReadStateBlockRange", - name: "readStateBlockRange", - type: "tuple", - }, - { - internalType: "uint256", - name: "numOfRounds", - type: "uint256", - }, - { - components: [ - { - internalType: "uint256", - name: "round", - type: "uint256", - }, - { - internalType: "uint256", - name: "leaderIndex", - type: "uint256", - }, - { - internalType: "uint256", - name: "votesCommitted", - type: "uint256", - }, - { - internalType: "uint256", - name: "votesRevealed", - type: "uint256", - }, - { - internalType: "uint256", - name: "appealBond", - type: "uint256", - }, - { - internalType: "uint256", - name: "rotationsLeft", - type: "uint256", - }, - { - internalType: "enum ITransactions.ResultType", - name: "result", - type: "uint8", - }, - { - internalType: "address[]", - name: "roundValidators", - type: "address[]", - }, - { - internalType: "bytes32[]", - name: "validatorVotesHash", - type: "bytes32[]", - }, - { - internalType: "enum ITransactions.VoteType[]", - name: "validatorVotes", - type: "uint8[]", - }, - ], - internalType: "struct ITransactions.RoundData", - name: "lastRound", - type: "tuple", - }, - ], - internalType: "struct ConsensusData.TransactionData[]", - name: "", - type: "tuple[]", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - ], - name: "getLatestAcceptedTxCount", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - ], - name: "getLatestFinalizedTransaction", - outputs: [ - { - components: [ - { - internalType: "uint256", - name: "currentTimestamp", - type: "uint256", - }, - { - internalType: "address", - name: "sender", - type: "address", - }, - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "numOfInitialValidators", - type: "uint256", - }, - { - internalType: "uint256", - name: "txSlot", - type: "uint256", - }, - { - internalType: "uint256", - name: "createdTimestamp", - type: "uint256", - }, - { - internalType: "uint256", - name: "lastVoteTimestamp", - type: "uint256", - }, - { - internalType: "bytes32", - name: "randomSeed", - type: "bytes32", - }, - { - internalType: "enum ITransactions.ResultType", - name: "result", - type: "uint8", - }, - { - internalType: "bytes", - name: "txData", - type: "bytes", - }, - { - internalType: "bytes", - name: "txReceipt", - type: "bytes", - }, - { - components: [ - { - internalType: "enum IMessages.MessageType", - name: "messageType", - type: "uint8", - }, - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "value", - type: "uint256", - }, - { - internalType: "bytes", - name: "data", - type: "bytes", - }, - { - internalType: "bool", - name: "onAcceptance", - type: "bool", - }, - ], - internalType: "struct IMessages.SubmittedMessage[]", - name: "messages", - type: "tuple[]", - }, - { - internalType: "enum IQueues.QueueType", - name: "queueType", - type: "uint8", - }, - { - internalType: "uint256", - name: "queuePosition", - type: "uint256", - }, - { - internalType: "address", - name: "activator", - type: "address", - }, - { - internalType: "address", - name: "lastLeader", - type: "address", - }, - { - internalType: "enum ITransactions.TransactionStatus", - name: "status", - type: "uint8", - }, - { - internalType: "bytes32", - name: "txId", - type: "bytes32", - }, - { - components: [ - { - internalType: "uint256", - name: "activationBlock", - type: "uint256", - }, - { - internalType: "uint256", - name: "processingBlock", - type: "uint256", - }, - { - internalType: "uint256", - name: "proposalBlock", - type: "uint256", - }, - ], - internalType: "struct ITransactions.ReadStateBlockRange", - name: "readStateBlockRange", - type: "tuple", - }, - { - internalType: "uint256", - name: "numOfRounds", - type: "uint256", - }, - { - components: [ - { - internalType: "uint256", - name: "round", - type: "uint256", - }, - { - internalType: "uint256", - name: "leaderIndex", - type: "uint256", - }, - { - internalType: "uint256", - name: "votesCommitted", - type: "uint256", - }, - { - internalType: "uint256", - name: "votesRevealed", - type: "uint256", - }, - { - internalType: "uint256", - name: "appealBond", - type: "uint256", - }, - { - internalType: "uint256", - name: "rotationsLeft", - type: "uint256", - }, - { - internalType: "enum ITransactions.ResultType", - name: "result", - type: "uint8", - }, - { - internalType: "address[]", - name: "roundValidators", - type: "address[]", - }, - { - internalType: "bytes32[]", - name: "validatorVotesHash", - type: "bytes32[]", - }, - { - internalType: "enum ITransactions.VoteType[]", - name: "validatorVotes", - type: "uint8[]", - }, - ], - internalType: "struct ITransactions.RoundData", - name: "lastRound", - type: "tuple", - }, - ], - internalType: "struct ConsensusData.TransactionData", - name: "txData", - type: "tuple", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "startIndex", - type: "uint256", - }, - { - internalType: "uint256", - name: "pageSize", - type: "uint256", - }, - ], - name: "getLatestFinalizedTransactions", - outputs: [ - { - components: [ - { - internalType: "uint256", - name: "currentTimestamp", - type: "uint256", - }, - { - internalType: "address", - name: "sender", - type: "address", - }, - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "numOfInitialValidators", - type: "uint256", - }, - { - internalType: "uint256", - name: "txSlot", - type: "uint256", - }, - { - internalType: "uint256", - name: "createdTimestamp", - type: "uint256", - }, - { - internalType: "uint256", - name: "lastVoteTimestamp", - type: "uint256", - }, - { - internalType: "bytes32", - name: "randomSeed", - type: "bytes32", - }, - { - internalType: "enum ITransactions.ResultType", - name: "result", - type: "uint8", - }, - { - internalType: "bytes", - name: "txData", - type: "bytes", - }, - { - internalType: "bytes", - name: "txReceipt", - type: "bytes", - }, - { - components: [ - { - internalType: "enum IMessages.MessageType", - name: "messageType", - type: "uint8", - }, - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "value", - type: "uint256", - }, - { - internalType: "bytes", - name: "data", - type: "bytes", - }, - { - internalType: "bool", - name: "onAcceptance", - type: "bool", - }, - ], - internalType: "struct IMessages.SubmittedMessage[]", - name: "messages", - type: "tuple[]", - }, - { - internalType: "enum IQueues.QueueType", - name: "queueType", - type: "uint8", - }, - { - internalType: "uint256", - name: "queuePosition", - type: "uint256", - }, - { - internalType: "address", - name: "activator", - type: "address", - }, - { - internalType: "address", - name: "lastLeader", - type: "address", - }, - { - internalType: "enum ITransactions.TransactionStatus", - name: "status", - type: "uint8", - }, - { - internalType: "bytes32", - name: "txId", - type: "bytes32", - }, - { - components: [ - { - internalType: "uint256", - name: "activationBlock", - type: "uint256", - }, - { - internalType: "uint256", - name: "processingBlock", - type: "uint256", - }, - { - internalType: "uint256", - name: "proposalBlock", - type: "uint256", - }, - ], - internalType: "struct ITransactions.ReadStateBlockRange", - name: "readStateBlockRange", - type: "tuple", - }, - { - internalType: "uint256", - name: "numOfRounds", - type: "uint256", - }, - { - components: [ - { - internalType: "uint256", - name: "round", - type: "uint256", - }, - { - internalType: "uint256", - name: "leaderIndex", - type: "uint256", - }, - { - internalType: "uint256", - name: "votesCommitted", - type: "uint256", - }, - { - internalType: "uint256", - name: "votesRevealed", - type: "uint256", - }, - { - internalType: "uint256", - name: "appealBond", - type: "uint256", - }, - { - internalType: "uint256", - name: "rotationsLeft", - type: "uint256", - }, - { - internalType: "enum ITransactions.ResultType", - name: "result", - type: "uint8", - }, - { - internalType: "address[]", - name: "roundValidators", - type: "address[]", - }, - { - internalType: "bytes32[]", - name: "validatorVotesHash", - type: "bytes32[]", - }, - { - internalType: "enum ITransactions.VoteType[]", - name: "validatorVotes", - type: "uint8[]", - }, - ], - internalType: "struct ITransactions.RoundData", - name: "lastRound", - type: "tuple", - }, - ], - internalType: "struct ConsensusData.TransactionData[]", - name: "", - type: "tuple[]", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - ], - name: "getLatestFinalizedTxCount", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - ], - name: "getLatestPendingTxCount", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "slot", - type: "uint256", - }, - ], - name: "getLatestPendingTxId", - outputs: [ - { - internalType: "bytes32", - name: "", - type: "bytes32", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - ], - name: "getLatestUndeterminedTransaction", - outputs: [ - { - components: [ - { - internalType: "uint256", - name: "currentTimestamp", - type: "uint256", - }, - { - internalType: "address", - name: "sender", - type: "address", - }, - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "numOfInitialValidators", - type: "uint256", - }, - { - internalType: "uint256", - name: "txSlot", - type: "uint256", - }, - { - internalType: "uint256", - name: "createdTimestamp", - type: "uint256", - }, - { - internalType: "uint256", - name: "lastVoteTimestamp", - type: "uint256", - }, - { - internalType: "bytes32", - name: "randomSeed", - type: "bytes32", - }, - { - internalType: "enum ITransactions.ResultType", - name: "result", - type: "uint8", - }, - { - internalType: "bytes", - name: "txData", - type: "bytes", - }, - { - internalType: "bytes", - name: "txReceipt", - type: "bytes", - }, - { - components: [ - { - internalType: "enum IMessages.MessageType", - name: "messageType", - type: "uint8", - }, - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "value", - type: "uint256", - }, - { - internalType: "bytes", - name: "data", - type: "bytes", - }, - { - internalType: "bool", - name: "onAcceptance", - type: "bool", - }, - ], - internalType: "struct IMessages.SubmittedMessage[]", - name: "messages", - type: "tuple[]", - }, - { - internalType: "enum IQueues.QueueType", - name: "queueType", - type: "uint8", - }, - { - internalType: "uint256", - name: "queuePosition", - type: "uint256", - }, - { - internalType: "address", - name: "activator", - type: "address", - }, - { - internalType: "address", - name: "lastLeader", - type: "address", - }, - { - internalType: "enum ITransactions.TransactionStatus", - name: "status", - type: "uint8", - }, - { - internalType: "bytes32", - name: "txId", - type: "bytes32", - }, - { - components: [ - { - internalType: "uint256", - name: "activationBlock", - type: "uint256", - }, - { - internalType: "uint256", - name: "processingBlock", - type: "uint256", - }, - { - internalType: "uint256", - name: "proposalBlock", - type: "uint256", - }, - ], - internalType: "struct ITransactions.ReadStateBlockRange", - name: "readStateBlockRange", - type: "tuple", - }, - { - internalType: "uint256", - name: "numOfRounds", - type: "uint256", - }, - { - components: [ - { - internalType: "uint256", - name: "round", - type: "uint256", - }, - { - internalType: "uint256", - name: "leaderIndex", - type: "uint256", - }, - { - internalType: "uint256", - name: "votesCommitted", - type: "uint256", - }, - { - internalType: "uint256", - name: "votesRevealed", - type: "uint256", - }, - { - internalType: "uint256", - name: "appealBond", - type: "uint256", - }, - { - internalType: "uint256", - name: "rotationsLeft", - type: "uint256", - }, - { - internalType: "enum ITransactions.ResultType", - name: "result", - type: "uint8", - }, - { - internalType: "address[]", - name: "roundValidators", - type: "address[]", - }, - { - internalType: "bytes32[]", - name: "validatorVotesHash", - type: "bytes32[]", - }, - { - internalType: "enum ITransactions.VoteType[]", - name: "validatorVotes", - type: "uint8[]", - }, - ], - internalType: "struct ITransactions.RoundData", - name: "lastRound", - type: "tuple", - }, - ], - internalType: "struct ConsensusData.TransactionData", - name: "txData", - type: "tuple", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - ], - name: "getLatestUndeterminedTxCount", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "_tx_id", - type: "bytes32", - }, - ], - name: "getMessagesForTransaction", - outputs: [ - { - components: [ - { - internalType: "enum IMessages.MessageType", - name: "messageType", - type: "uint8", - }, - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "value", - type: "uint256", - }, - { - internalType: "bytes", - name: "data", - type: "bytes", - }, - { - internalType: "bool", - name: "onAcceptance", - type: "bool", - }, - ], - internalType: "struct IMessages.SubmittedMessage[]", - name: "", - type: "tuple[]", - }, - { - internalType: "address", - name: "ghostAddress", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "_tx_id", - type: "bytes32", - }, - ], - name: "getReadStateBlockRangeForTransaction", - outputs: [ - { - internalType: "uint256", - name: "activationBlock", - type: "uint256", - }, - { - internalType: "uint256", - name: "processingBlock", - type: "uint256", - }, - { - internalType: "uint256", - name: "proposalBlock", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "startIndex", - type: "uint256", - }, - { - internalType: "uint256", - name: "endIndex", - type: "uint256", - }, - ], - name: "getRecipientQueues", - outputs: [ - { - components: [ - { - components: [ - { - internalType: "uint256", - name: "head", - type: "uint256", - }, - { - internalType: "uint256", - name: "tail", - type: "uint256", - }, - { - internalType: "bytes32[]", - name: "txIds", - type: "bytes32[]", - }, - ], - internalType: "struct IQueues.QueueInfoView", - name: "pending", - type: "tuple", - }, - { - components: [ - { - internalType: "uint256", - name: "head", - type: "uint256", - }, - { - internalType: "uint256", - name: "tail", - type: "uint256", - }, - { - internalType: "bytes32[]", - name: "txIds", - type: "bytes32[]", - }, - ], - internalType: "struct IQueues.QueueInfoView", - name: "accepted", - type: "tuple", - }, - { - components: [ - { - internalType: "uint256", - name: "head", - type: "uint256", - }, - { - internalType: "uint256", - name: "tail", - type: "uint256", - }, - { - internalType: "bytes32[]", - name: "txIds", - type: "bytes32[]", - }, - ], - internalType: "struct IQueues.QueueInfoView", - name: "undetermined", - type: "tuple", - }, - { - internalType: "uint256", - name: "finalizedCount", - type: "uint256", - }, - { - internalType: "uint256", - name: "issuedTxCount", - type: "uint256", - }, - ], - internalType: "struct IQueues.RecipientQueuesView", - name: "", - type: "tuple", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "role", - type: "bytes32", - }, - ], - name: "getRoleAdmin", - outputs: [ - { - internalType: "bytes32", - name: "", - type: "bytes32", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getTotalNumOfTransactions", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "_tx_id", - type: "bytes32", - }, - ], - name: "getTransactionAllData", - outputs: [ - { - components: [ - { - internalType: "bytes32", - name: "id", - type: "bytes32", - }, - { - internalType: "address", - name: "sender", - type: "address", - }, - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "numOfInitialValidators", - type: "uint256", - }, - { - internalType: "uint256", - name: "txSlot", - type: "uint256", - }, - { - internalType: "address", - name: "activator", - type: "address", - }, - { - internalType: "enum ITransactions.TransactionStatus", - name: "status", - type: "uint8", - }, - { - internalType: "enum ITransactions.TransactionStatus", - name: "previousStatus", - type: "uint8", - }, - { - components: [ - { - internalType: "uint256", - name: "created", - type: "uint256", - }, - { - internalType: "uint256", - name: "pending", - type: "uint256", - }, - { - internalType: "uint256", - name: "activated", - type: "uint256", - }, - { - internalType: "uint256", - name: "proposed", - type: "uint256", - }, - { - internalType: "uint256", - name: "committed", - type: "uint256", - }, - { - internalType: "uint256", - name: "lastVote", - type: "uint256", - }, - { - internalType: "uint256", - name: "appealSubmitted", - type: "uint256", - }, - ], - internalType: "struct ITransactions.Timestamps", - name: "timestamps", - type: "tuple", - }, - { - internalType: "bytes32", - name: "randomSeed", - type: "bytes32", - }, - { - internalType: "bool", - name: "onAcceptanceMessages", - type: "bool", - }, - { - internalType: "enum ITransactions.ResultType", - name: "result", - type: "uint8", - }, - { - components: [ - { - internalType: "uint256", - name: "activationBlock", - type: "uint256", - }, - { - internalType: "uint256", - name: "processingBlock", - type: "uint256", - }, - { - internalType: "uint256", - name: "proposalBlock", - type: "uint256", - }, - ], - internalType: "struct ITransactions.ReadStateBlockRange", - name: "readStateBlockRange", - type: "tuple", - }, - { - internalType: "bytes", - name: "txData", - type: "bytes", - }, - { - internalType: "bytes", - name: "txReceipt", - type: "bytes", - }, - { - components: [ - { - internalType: "enum IMessages.MessageType", - name: "messageType", - type: "uint8", - }, - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "value", - type: "uint256", - }, - { - internalType: "bytes", - name: "data", - type: "bytes", - }, - { - internalType: "bool", - name: "onAcceptance", - type: "bool", - }, - ], - internalType: "struct IMessages.SubmittedMessage[]", - name: "messages", - type: "tuple[]", - }, - { - internalType: "address[]", - name: "consumedValidators", - type: "address[]", - }, - { - components: [ - { - internalType: "uint256", - name: "round", - type: "uint256", - }, - { - internalType: "uint256", - name: "leaderIndex", - type: "uint256", - }, - { - internalType: "uint256", - name: "votesCommitted", - type: "uint256", - }, - { - internalType: "uint256", - name: "votesRevealed", - type: "uint256", - }, - { - internalType: "uint256", - name: "appealBond", - type: "uint256", - }, - { - internalType: "uint256", - name: "rotationsLeft", - type: "uint256", - }, - { - internalType: "enum ITransactions.ResultType", - name: "result", - type: "uint8", - }, - { - internalType: "address[]", - name: "roundValidators", - type: "address[]", - }, - { - internalType: "bytes32[]", - name: "validatorVotesHash", - type: "bytes32[]", - }, - { - internalType: "enum ITransactions.VoteType[]", - name: "validatorVotes", - type: "uint8[]", - }, - ], - internalType: "struct ITransactions.RoundData[]", - name: "roundData", - type: "tuple[]", - }, - ], - internalType: "struct ITransactions.Transaction", - name: "transaction", - type: "tuple", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "_tx_id", - type: "bytes32", - }, - { - internalType: "uint256", - name: "_timestamp", - type: "uint256", - }, - ], - name: "getTransactionData", - outputs: [ - { - components: [ - { - internalType: "uint256", - name: "currentTimestamp", - type: "uint256", - }, - { - internalType: "address", - name: "sender", - type: "address", - }, - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "numOfInitialValidators", - type: "uint256", - }, - { - internalType: "uint256", - name: "txSlot", - type: "uint256", - }, - { - internalType: "uint256", - name: "createdTimestamp", - type: "uint256", - }, - { - internalType: "uint256", - name: "lastVoteTimestamp", - type: "uint256", - }, - { - internalType: "bytes32", - name: "randomSeed", - type: "bytes32", - }, - { - internalType: "enum ITransactions.ResultType", - name: "result", - type: "uint8", - }, - { - internalType: "bytes", - name: "txData", - type: "bytes", - }, - { - internalType: "bytes", - name: "txReceipt", - type: "bytes", - }, - { - components: [ - { - internalType: "enum IMessages.MessageType", - name: "messageType", - type: "uint8", - }, - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "value", - type: "uint256", - }, - { - internalType: "bytes", - name: "data", - type: "bytes", - }, - { - internalType: "bool", - name: "onAcceptance", - type: "bool", - }, - ], - internalType: "struct IMessages.SubmittedMessage[]", - name: "messages", - type: "tuple[]", - }, - { - internalType: "enum IQueues.QueueType", - name: "queueType", - type: "uint8", - }, - { - internalType: "uint256", - name: "queuePosition", - type: "uint256", - }, - { - internalType: "address", - name: "activator", - type: "address", - }, - { - internalType: "address", - name: "lastLeader", - type: "address", - }, - { - internalType: "enum ITransactions.TransactionStatus", - name: "status", - type: "uint8", - }, - { - internalType: "bytes32", - name: "txId", - type: "bytes32", - }, - { - components: [ - { - internalType: "uint256", - name: "activationBlock", - type: "uint256", - }, - { - internalType: "uint256", - name: "processingBlock", - type: "uint256", - }, - { - internalType: "uint256", - name: "proposalBlock", - type: "uint256", - }, - ], - internalType: "struct ITransactions.ReadStateBlockRange", - name: "readStateBlockRange", - type: "tuple", - }, - { - internalType: "uint256", - name: "numOfRounds", - type: "uint256", - }, - { - components: [ - { - internalType: "uint256", - name: "round", - type: "uint256", - }, - { - internalType: "uint256", - name: "leaderIndex", - type: "uint256", - }, - { - internalType: "uint256", - name: "votesCommitted", - type: "uint256", - }, - { - internalType: "uint256", - name: "votesRevealed", - type: "uint256", - }, - { - internalType: "uint256", - name: "appealBond", - type: "uint256", - }, - { - internalType: "uint256", - name: "rotationsLeft", - type: "uint256", - }, - { - internalType: "enum ITransactions.ResultType", - name: "result", - type: "uint8", - }, - { - internalType: "address[]", - name: "roundValidators", - type: "address[]", - }, - { - internalType: "bytes32[]", - name: "validatorVotesHash", - type: "bytes32[]", - }, - { - internalType: "enum ITransactions.VoteType[]", - name: "validatorVotes", - type: "uint8[]", - }, - ], - internalType: "struct ITransactions.RoundData", - name: "lastRound", - type: "tuple", - }, - ], - internalType: "struct ConsensusData.TransactionData", - name: "", - type: "tuple", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "startIndex", - type: "uint256", - }, - { - internalType: "uint256", - name: "endIndex", - type: "uint256", - }, - ], - name: "getTransactionIndexToTxId", - outputs: [ - { - internalType: "bytes32[]", - name: "", - type: "bytes32[]", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "_tx_id", - type: "bytes32", - }, - { - internalType: "uint256", - name: "_timestamp", - type: "uint256", - }, - ], - name: "getTransactionStatus", - outputs: [ - { - internalType: "enum ITransactions.TransactionStatus", - name: "", - type: "uint8", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "_tx_id", - type: "bytes32", - }, - ], - name: "getValidatorsForLastAppeal", - outputs: [ - { - internalType: "address[]", - name: "", - type: "address[]", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "_tx_id", - type: "bytes32", - }, - ], - name: "getValidatorsForLastRound", - outputs: [ - { - internalType: "address[]", - name: "", - type: "address[]", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "role", - type: "bytes32", - }, - { - internalType: "address", - name: "account", - type: "address", - }, - ], - name: "grantRole", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "role", - type: "bytes32", - }, - { - internalType: "address", - name: "account", - type: "address", - }, - ], - name: "hasRole", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "_tx_id", - type: "bytes32", - }, - ], - name: "hasTransactionOnAcceptanceMessages", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "_tx_id", - type: "bytes32", - }, - ], - name: "hasTransactionOnFinalizationMessages", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "_consensusMain", - type: "address", - }, - { - internalType: "address", - name: "_transactions", - type: "address", - }, - { - internalType: "address", - name: "_queues", - type: "address", - }, - ], - name: "initialize", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "owner", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "pendingOwner", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "queues", - outputs: [ - { - internalType: "contract IQueues", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "renounceOwnership", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "role", - type: "bytes32", - }, - { - internalType: "address", - name: "callerConfirmation", - type: "address", - }, - ], - name: "renounceRole", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "role", - type: "bytes32", - }, - { - internalType: "address", - name: "account", - type: "address", - }, - ], - name: "revokeRole", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "_consensusMain", - type: "address", - }, - ], - name: "setConsensusMain", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "_queues", - type: "address", - }, - ], - name: "setQueues", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "_transactions", - type: "address", - }, - ], - name: "setTransactions", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes4", - name: "interfaceId", - type: "bytes4", - }, - ], - name: "supportsInterface", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "transactions", - outputs: [ - { - internalType: "contract ITransactions", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "newOwner", - type: "address", - }, - ], - name: "transferOwnership", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, + { + "inputs": [], + "name": "AccessControlBadConfirmation", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "neededRole", + "type": "bytes32" + } + ], + "name": "AccessControlUnauthorizedAccount", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnableInvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "OwnableUnauthorizedAccount", + "type": "error" + }, + { + "inputs": [], + "name": "ReentrancyGuardReentrantCall", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "previousAdminRole", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "newAdminRole", + "type": "bytes32" + } + ], + "name": "RoleAdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleRevoked", + "type": "event" + }, + { + "inputs": [], + "name": "DEFAULT_ADMIN_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "addressManager", + "outputs": [ + { + "internalType": "contract IAddressManager", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_currentTimestamp", + "type": "uint256" + } + ], + "name": "canFinalize", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "getLatestAcceptedTransaction", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "currentTimestamp", + "type": "uint256" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "initialRotations", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "txSlot", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "createdTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastVoteTimestamp", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "randomSeed", + "type": "bytes32" + }, + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "txExecutionHash", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "txCalldata", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "eqBlocksOutputs", + "type": "bytes" + }, + { + "components": [ + { + "internalType": "enum IMessages.MessageType", + "name": "messageType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bool", + "name": "onAcceptance", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + } + ], + "internalType": "struct IMessages.SubmittedMessage[]", + "name": "messages", + "type": "tuple[]" + }, + { + "internalType": "enum IQueues.QueueType", + "name": "queueType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "queuePosition", + "type": "uint256" + }, + { + "internalType": "address", + "name": "activator", + "type": "address" + }, + { + "internalType": "address", + "name": "lastLeader", + "type": "address" + }, + { + "internalType": "enum ITransactions.TransactionStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "activationBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "processingBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "proposalBlock", + "type": "uint256" + } + ], + "internalType": "struct ITransactions.ReadStateBlockRange", + "name": "readStateBlockRange", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "numOfRounds", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "round", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "leaderIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votesCommitted", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votesRevealed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "appealBond", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rotationsLeft", + "type": "uint256" + }, + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "address[]", + "name": "roundValidators", + "type": "address[]" + }, + { + "internalType": "enum ITransactions.VoteType[]", + "name": "validatorVotes", + "type": "uint8[]" + }, + { + "internalType": "bytes32[]", + "name": "validatorVotesHash", + "type": "bytes32[]" + }, + { + "internalType": "bytes32[]", + "name": "validatorResultHash", + "type": "bytes32[]" + } + ], + "internalType": "struct ITransactions.RoundData", + "name": "lastRound", + "type": "tuple" + }, + { + "internalType": "address[]", + "name": "consumedValidators", + "type": "address[]" + } + ], + "internalType": "struct ConsensusData.TransactionData", + "name": "inputData", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "startIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pageSize", + "type": "uint256" + } + ], + "name": "getLatestAcceptedTransactions", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "currentTimestamp", + "type": "uint256" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "initialRotations", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "txSlot", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "createdTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastVoteTimestamp", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "randomSeed", + "type": "bytes32" + }, + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "txExecutionHash", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "txCalldata", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "eqBlocksOutputs", + "type": "bytes" + }, + { + "components": [ + { + "internalType": "enum IMessages.MessageType", + "name": "messageType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bool", + "name": "onAcceptance", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + } + ], + "internalType": "struct IMessages.SubmittedMessage[]", + "name": "messages", + "type": "tuple[]" + }, + { + "internalType": "enum IQueues.QueueType", + "name": "queueType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "queuePosition", + "type": "uint256" + }, + { + "internalType": "address", + "name": "activator", + "type": "address" + }, + { + "internalType": "address", + "name": "lastLeader", + "type": "address" + }, + { + "internalType": "enum ITransactions.TransactionStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "activationBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "processingBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "proposalBlock", + "type": "uint256" + } + ], + "internalType": "struct ITransactions.ReadStateBlockRange", + "name": "readStateBlockRange", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "numOfRounds", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "round", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "leaderIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votesCommitted", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votesRevealed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "appealBond", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rotationsLeft", + "type": "uint256" + }, + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "address[]", + "name": "roundValidators", + "type": "address[]" + }, + { + "internalType": "enum ITransactions.VoteType[]", + "name": "validatorVotes", + "type": "uint8[]" + }, + { + "internalType": "bytes32[]", + "name": "validatorVotesHash", + "type": "bytes32[]" + }, + { + "internalType": "bytes32[]", + "name": "validatorResultHash", + "type": "bytes32[]" + } + ], + "internalType": "struct ITransactions.RoundData", + "name": "lastRound", + "type": "tuple" + }, + { + "internalType": "address[]", + "name": "consumedValidators", + "type": "address[]" + } + ], + "internalType": "struct ConsensusData.TransactionData[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "getLatestAcceptedTxCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "getLatestFinalizedTransaction", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "currentTimestamp", + "type": "uint256" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "initialRotations", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "txSlot", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "createdTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastVoteTimestamp", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "randomSeed", + "type": "bytes32" + }, + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "txExecutionHash", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "txCalldata", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "eqBlocksOutputs", + "type": "bytes" + }, + { + "components": [ + { + "internalType": "enum IMessages.MessageType", + "name": "messageType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bool", + "name": "onAcceptance", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + } + ], + "internalType": "struct IMessages.SubmittedMessage[]", + "name": "messages", + "type": "tuple[]" + }, + { + "internalType": "enum IQueues.QueueType", + "name": "queueType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "queuePosition", + "type": "uint256" + }, + { + "internalType": "address", + "name": "activator", + "type": "address" + }, + { + "internalType": "address", + "name": "lastLeader", + "type": "address" + }, + { + "internalType": "enum ITransactions.TransactionStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "activationBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "processingBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "proposalBlock", + "type": "uint256" + } + ], + "internalType": "struct ITransactions.ReadStateBlockRange", + "name": "readStateBlockRange", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "numOfRounds", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "round", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "leaderIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votesCommitted", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votesRevealed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "appealBond", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rotationsLeft", + "type": "uint256" + }, + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "address[]", + "name": "roundValidators", + "type": "address[]" + }, + { + "internalType": "enum ITransactions.VoteType[]", + "name": "validatorVotes", + "type": "uint8[]" + }, + { + "internalType": "bytes32[]", + "name": "validatorVotesHash", + "type": "bytes32[]" + }, + { + "internalType": "bytes32[]", + "name": "validatorResultHash", + "type": "bytes32[]" + } + ], + "internalType": "struct ITransactions.RoundData", + "name": "lastRound", + "type": "tuple" + }, + { + "internalType": "address[]", + "name": "consumedValidators", + "type": "address[]" + } + ], + "internalType": "struct ConsensusData.TransactionData", + "name": "inputData", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "startIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pageSize", + "type": "uint256" + } + ], + "name": "getLatestFinalizedTransactions", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "currentTimestamp", + "type": "uint256" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "initialRotations", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "txSlot", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "createdTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastVoteTimestamp", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "randomSeed", + "type": "bytes32" + }, + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "txExecutionHash", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "txCalldata", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "eqBlocksOutputs", + "type": "bytes" + }, + { + "components": [ + { + "internalType": "enum IMessages.MessageType", + "name": "messageType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bool", + "name": "onAcceptance", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + } + ], + "internalType": "struct IMessages.SubmittedMessage[]", + "name": "messages", + "type": "tuple[]" + }, + { + "internalType": "enum IQueues.QueueType", + "name": "queueType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "queuePosition", + "type": "uint256" + }, + { + "internalType": "address", + "name": "activator", + "type": "address" + }, + { + "internalType": "address", + "name": "lastLeader", + "type": "address" + }, + { + "internalType": "enum ITransactions.TransactionStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "activationBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "processingBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "proposalBlock", + "type": "uint256" + } + ], + "internalType": "struct ITransactions.ReadStateBlockRange", + "name": "readStateBlockRange", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "numOfRounds", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "round", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "leaderIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votesCommitted", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votesRevealed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "appealBond", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rotationsLeft", + "type": "uint256" + }, + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "address[]", + "name": "roundValidators", + "type": "address[]" + }, + { + "internalType": "enum ITransactions.VoteType[]", + "name": "validatorVotes", + "type": "uint8[]" + }, + { + "internalType": "bytes32[]", + "name": "validatorVotesHash", + "type": "bytes32[]" + }, + { + "internalType": "bytes32[]", + "name": "validatorResultHash", + "type": "bytes32[]" + } + ], + "internalType": "struct ITransactions.RoundData", + "name": "lastRound", + "type": "tuple" + }, + { + "internalType": "address[]", + "name": "consumedValidators", + "type": "address[]" + } + ], + "internalType": "struct ConsensusData.TransactionData[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "getLatestFinalizedTxCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleAdmin", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } + ], + "name": "getTransactionAllData", + "outputs": [ + { + "components": [ + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "enum ITransactions.VoteType", + "name": "txExecutionResult", + "type": "uint8" + }, + { + "internalType": "enum ITransactions.TransactionStatus", + "name": "previousStatus", + "type": "uint8" + }, + { + "internalType": "enum ITransactions.TransactionStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "address", + "name": "txOrigin", + "type": "address" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "address", + "name": "activator", + "type": "address" + }, + { + "internalType": "uint256", + "name": "txSlot", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "initialRotations", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "numOfInitialValidators", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "epoch", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "randomSeed", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "txExecutionHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "resultHash", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "txCalldata", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "eqBlocksOutputs", + "type": "bytes" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "activationBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "processingBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "proposalBlock", + "type": "uint256" + } + ], + "internalType": "struct ITransactions.ReadStateBlockRange[]", + "name": "readStateBlockRanges", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "validUntil", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "internalType": "struct ITransactions.Transaction", + "name": "transaction", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "round", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "leaderIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votesCommitted", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votesRevealed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "appealBond", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rotationsLeft", + "type": "uint256" + }, + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "address[]", + "name": "roundValidators", + "type": "address[]" + }, + { + "internalType": "enum ITransactions.VoteType[]", + "name": "validatorVotes", + "type": "uint8[]" + }, + { + "internalType": "bytes32[]", + "name": "validatorVotesHash", + "type": "bytes32[]" + }, + { + "internalType": "bytes32[]", + "name": "validatorResultHash", + "type": "bytes32[]" + } + ], + "internalType": "struct ITransactions.RoundData[]", + "name": "roundsData", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_timestamp", + "type": "uint256" + } + ], + "name": "getTransactionData", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "currentTimestamp", + "type": "uint256" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "initialRotations", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "txSlot", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "createdTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastVoteTimestamp", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "randomSeed", + "type": "bytes32" + }, + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "txExecutionHash", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "txCalldata", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "eqBlocksOutputs", + "type": "bytes" + }, + { + "components": [ + { + "internalType": "enum IMessages.MessageType", + "name": "messageType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bool", + "name": "onAcceptance", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + } + ], + "internalType": "struct IMessages.SubmittedMessage[]", + "name": "messages", + "type": "tuple[]" + }, + { + "internalType": "enum IQueues.QueueType", + "name": "queueType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "queuePosition", + "type": "uint256" + }, + { + "internalType": "address", + "name": "activator", + "type": "address" + }, + { + "internalType": "address", + "name": "lastLeader", + "type": "address" + }, + { + "internalType": "enum ITransactions.TransactionStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "activationBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "processingBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "proposalBlock", + "type": "uint256" + } + ], + "internalType": "struct ITransactions.ReadStateBlockRange", + "name": "readStateBlockRange", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "numOfRounds", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "round", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "leaderIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votesCommitted", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votesRevealed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "appealBond", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rotationsLeft", + "type": "uint256" + }, + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "address[]", + "name": "roundValidators", + "type": "address[]" + }, + { + "internalType": "enum ITransactions.VoteType[]", + "name": "validatorVotes", + "type": "uint8[]" + }, + { + "internalType": "bytes32[]", + "name": "validatorVotesHash", + "type": "bytes32[]" + }, + { + "internalType": "bytes32[]", + "name": "validatorResultHash", + "type": "bytes32[]" + } + ], + "internalType": "struct ITransactions.RoundData", + "name": "lastRound", + "type": "tuple" + }, + { + "internalType": "address[]", + "name": "consumedValidators", + "type": "address[]" + } + ], + "internalType": "struct ConsensusData.TransactionData", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_timestamp", + "type": "uint256" + } + ], + "name": "getTransactionStatus", + "outputs": [ + { + "internalType": "enum ITransactions.TransactionStatus", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } + ], + "name": "getValidatorsForLastRound", + "outputs": [ + { + "internalType": "address[]", + "name": "validators", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "grantRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "hasRole", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_addressManager", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "callerConfirmation", + "type": "address" + } + ], + "name": "renounceRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "revokeRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_addressManager", + "type": "address" + } + ], + "name": "setAddressManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } ], bytecode: "", }; diff --git a/src/chains/studionet.ts b/src/chains/studionet.ts index f7476e8..059af24 100644 --- a/src/chains/studionet.ts +++ b/src/chains/studionet.ts @@ -8,1430 +8,1349 @@ const CONSENSUS_MAIN_CONTRACT = { address: "0xb7278A61aa25c888815aFC32Ad3cC52fF24fE575" as Address, abi: [ { - inputs: [], - name: "AccessControlBadConfirmation", - type: "error", + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" }, { - inputs: [ - { - internalType: "address", - name: "account", - type: "address", - }, - { - internalType: "bytes32", - name: "neededRole", - type: "bytes32", - }, - ], - name: "AccessControlUnauthorizedAccount", - type: "error", + "inputs": [], + "name": "CallerNotMessages", + "type": "error" + }, + { + "inputs": [], + "name": "CanNotAppeal", + "type": "error" }, { - inputs: [], - name: "CallerNotMessages", - type: "error", + "inputs": [], + "name": "InvalidDeploymentWithSalt", + "type": "error" }, { - inputs: [], - name: "CanNotAppeal", - type: "error", + "inputs": [], + "name": "InvalidGhostContract", + "type": "error" }, { - inputs: [], - name: "EmptyTransaction", - type: "error", + "inputs": [], + "name": "InvalidInitialization", + "type": "error" }, { - inputs: [], - name: "FinalizationNotAllowed", - type: "error", + "inputs": [], + "name": "InvalidRevealLeaderData", + "type": "error" }, { - inputs: [], - name: "InvalidAddress", - type: "error", + "inputs": [], + "name": "InvalidVote", + "type": "error" }, { - inputs: [], - name: "InvalidGhostContract", - type: "error", + "inputs": [], + "name": "NotInitializing", + "type": "error" }, { - inputs: [], - name: "InvalidInitialization", - type: "error", + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnableInvalidOwner", + "type": "error" }, { - inputs: [], - name: "InvalidVote", - type: "error", + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "OwnableUnauthorizedAccount", + "type": "error" }, { - inputs: [], - name: "MaxNumOfIterationsInPendingQueueReached", - type: "error", + "inputs": [], + "name": "ReentrancyGuardReentrantCall", + "type": "error" }, { - inputs: [ + "anonymous": false, + "inputs": [ { - internalType: "uint256", - name: "numOfMessages", - type: "uint256", + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" }, { - internalType: "uint256", - name: "maxAllocatedMessages", - type: "uint256", + "indexed": true, + "internalType": "address", + "name": "oldActivator", + "type": "address" }, + { + "indexed": true, + "internalType": "address", + "name": "newActivator", + "type": "address" + } ], - name: "MaxNumOfMessagesExceeded", - type: "error", - }, - { - inputs: [], - name: "NonGenVMContract", - type: "error", - }, - { - inputs: [], - name: "NotInitializing", - type: "error", + "name": "ActivatorReplaced", + "type": "event" }, { - inputs: [ + "anonymous": false, + "inputs": [ { - internalType: "address", - name: "owner", - type: "address", - }, + "indexed": true, + "internalType": "address", + "name": "addressManager", + "type": "address" + } ], - name: "OwnableInvalidOwner", - type: "error", + "name": "AddressManagerSet", + "type": "event" }, { - inputs: [ + "anonymous": false, + "inputs": [ { - internalType: "address", - name: "account", - type: "address", + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" }, + { + "indexed": false, + "internalType": "enum ITransactions.TransactionStatus", + "name": "newStatus", + "type": "uint8" + } ], - name: "OwnableUnauthorizedAccount", - type: "error", - }, - { - inputs: [], - name: "ReentrancyGuardReentrantCall", - type: "error", + "name": "AllVotesCommitted", + "type": "event" }, { - inputs: [], - name: "TransactionNotAtPendingQueueHead", - type: "error", - }, - { - anonymous: false, - inputs: [ + "anonymous": false, + "inputs": [ { - indexed: true, - internalType: "bytes32", - name: "txId", - type: "bytes32", + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" }, { - indexed: true, - internalType: "address", - name: "appealer", - type: "address", + "indexed": true, + "internalType": "address", + "name": "appellant", + "type": "address" }, { - indexed: false, - internalType: "uint256", - name: "appealBond", - type: "uint256", + "indexed": false, + "internalType": "uint256", + "name": "bond", + "type": "uint256" }, { - indexed: false, - internalType: "address[]", - name: "appealValidators", - type: "address[]", - }, + "indexed": false, + "internalType": "address[]", + "name": "validators", + "type": "address[]" + } ], - name: "AppealStarted", - type: "event", + "name": "AppealStarted", + "type": "event" }, { - anonymous: false, - inputs: [ + "anonymous": false, + "inputs": [ { - indexed: true, - internalType: "bytes32", - name: "txId", - type: "bytes32", + "indexed": false, + "internalType": "uint256", + "name": "attempted", + "type": "uint256" }, { - indexed: true, - internalType: "address", - name: "recipient", - type: "address", + "indexed": false, + "internalType": "uint256", + "name": "succeeded", + "type": "uint256" }, { - indexed: false, - internalType: "bytes", - name: "data", - type: "bytes", - }, + "indexed": false, + "internalType": "uint256", + "name": "failed", + "type": "uint256" + } ], - name: "ErrorMessage", - type: "event", + "name": "BatchFinalizationCompleted", + "type": "event" }, { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "address", - name: "ghostFactory", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "genManager", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "genTransactions", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "genQueue", - type: "address", - }, + "anonymous": false, + "inputs": [ { - indexed: false, - internalType: "address", - name: "genStaking", - type: "address", + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" }, { - indexed: false, - internalType: "address", - name: "genMessages", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "idleness", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "tribunalAppeal", - type: "address", - }, + "indexed": false, + "internalType": "uint256", + "name": "txSlot", + "type": "uint256" + } ], - name: "ExternalContractsSet", - type: "event", + "name": "CreatedTransaction", + "type": "event" }, { - anonymous: false, - inputs: [ + "anonymous": false, + "inputs": [ { - indexed: false, - internalType: "uint64", - name: "version", - type: "uint64", - }, + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } ], - name: "Initialized", - type: "event", + "name": "Initialized", + "type": "event" }, { - anonymous: false, - inputs: [ + "anonymous": false, + "inputs": [ { - indexed: true, - internalType: "bytes32", - name: "txId", - type: "bytes32", + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" }, { - indexed: true, - internalType: "address", - name: "recipient", - type: "address", + "indexed": true, + "internalType": "address", + "name": "recipient", + "type": "address" }, { - indexed: true, - internalType: "address", - name: "activator", - type: "address", - }, + "indexed": true, + "internalType": "address", + "name": "activator", + "type": "address" + } ], - name: "InternalMessageProcessed", - type: "event", + "name": "InternalMessageProcessed", + "type": "event" }, { - anonymous: false, - inputs: [ + "anonymous": false, + "inputs": [ { - indexed: true, - internalType: "bytes32", - name: "txId", - type: "bytes32", + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" }, { - indexed: true, - internalType: "address", - name: "recipient", - type: "address", + "indexed": true, + "internalType": "address", + "name": "oldLeader", + "type": "address" }, { - indexed: true, - internalType: "address", - name: "activator", - type: "address", - }, + "indexed": true, + "internalType": "address", + "name": "newLeader", + "type": "address" + } ], - name: "NewTransaction", - type: "event", + "name": "LeaderIdlenessProcessed", + "type": "event" }, { - anonymous: false, - inputs: [ + "anonymous": false, + "inputs": [ { - indexed: true, - internalType: "address", - name: "previousOwner", - type: "address", + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" }, { - indexed: true, - internalType: "address", - name: "newOwner", - type: "address", + "indexed": true, + "internalType": "address", + "name": "recipient", + "type": "address" }, + { + "indexed": true, + "internalType": "address", + "name": "activator", + "type": "address" + } ], - name: "OwnershipTransferStarted", - type: "event", + "name": "NewTransaction", + "type": "event" }, { - anonymous: false, - inputs: [ + "anonymous": false, + "inputs": [ { - indexed: true, - internalType: "address", - name: "previousOwner", - type: "address", + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" }, { - indexed: true, - internalType: "address", - name: "newOwner", - type: "address", - }, + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } ], - name: "OwnershipTransferred", - type: "event", + "name": "OwnershipTransferStarted", + "type": "event" }, { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "role", - type: "bytes32", - }, + "anonymous": false, + "inputs": [ { - indexed: true, - internalType: "bytes32", - name: "previousAdminRole", - type: "bytes32", + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" }, { - indexed: true, - internalType: "bytes32", - name: "newAdminRole", - type: "bytes32", - }, + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } ], - name: "RoleAdminChanged", - type: "event", + "name": "OwnershipTransferred", + "type": "event" }, { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "role", - type: "bytes32", - }, - { - indexed: true, - internalType: "address", - name: "account", - type: "address", - }, + "anonymous": false, + "inputs": [ { - indexed: true, - internalType: "address", - name: "sender", - type: "address", - }, + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + } ], - name: "RoleGranted", - type: "event", + "name": "ProcessIdlenessAccepted", + "type": "event" }, { - anonymous: false, - inputs: [ + "anonymous": false, + "inputs": [ { - indexed: true, - internalType: "bytes32", - name: "role", - type: "bytes32", - }, + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + } + ], + "name": "TransactionAccepted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ { - indexed: true, - internalType: "address", - name: "account", - type: "address", + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" }, { - indexed: true, - internalType: "address", - name: "sender", - type: "address", - }, + "indexed": true, + "internalType": "address", + "name": "leader", + "type": "address" + } ], - name: "RoleRevoked", - type: "event", + "name": "TransactionActivated", + "type": "event" }, { - anonymous: false, - inputs: [ + "anonymous": false, + "inputs": [ { - indexed: true, - internalType: "bytes32", - name: "txId", - type: "bytes32", + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" }, { - indexed: true, - internalType: "address", - name: "sender", - type: "address", - }, + "indexed": true, + "internalType": "address", + "name": "cancelledBy", + "type": "address" + } ], - name: "SlashAppealSubmitted", - type: "event", + "name": "TransactionCancelled", + "type": "event" }, { - anonymous: false, - inputs: [ + "anonymous": false, + "inputs": [ { - indexed: true, - internalType: "bytes32", - name: "tx_id", - type: "bytes32", - }, + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + } ], - name: "TransactionAccepted", - type: "event", + "name": "TransactionFinalizationFailed", + "type": "event" }, { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "txId", - type: "bytes32", - }, + "anonymous": false, + "inputs": [ { - indexed: true, - internalType: "address", - name: "leader", - type: "address", - }, + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + } ], - name: "TransactionActivated", - type: "event", + "name": "TransactionFinalized", + "type": "event" }, { - anonymous: false, - inputs: [ + "anonymous": false, + "inputs": [ { - indexed: true, - internalType: "uint256", - name: "batchId", - type: "uint256", - }, - { - indexed: false, - internalType: "address[]", - name: "validators", - type: "address[]", - }, + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + } ], - name: "TransactionActivatedValidators", - type: "event", + "name": "TransactionLeaderRevealed", + "type": "event" }, { - anonymous: false, - inputs: [ + "anonymous": false, + "inputs": [ { - indexed: true, - internalType: "bytes32", - name: "txId", - type: "bytes32", + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" }, { - indexed: true, - internalType: "address", - name: "sender", - type: "address", - }, + "indexed": true, + "internalType": "address", + "name": "newLeader", + "type": "address" + } ], - name: "TransactionCancelled", - type: "event", + "name": "TransactionLeaderRotated", + "type": "event" }, { - anonymous: false, - inputs: [ + "anonymous": false, + "inputs": [ { - indexed: true, - internalType: "bytes32", - name: "tx_id", - type: "bytes32", - }, + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + } ], - name: "TransactionFinalized", - type: "event", + "name": "TransactionLeaderTimeout", + "type": "event" }, { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "txId", - type: "bytes32", - }, - { - indexed: true, - internalType: "address", - name: "oldValidator", - type: "address", - }, + "anonymous": false, + "inputs": [ { - indexed: true, - internalType: "address", - name: "newValidator", - type: "address", - }, + "indexed": false, + "internalType": "bytes32[]", + "name": "txIds", + "type": "bytes32[]" + } ], - name: "TransactionIdleValidatorReplaced", - type: "event", + "name": "TransactionNeedsRecomputation", + "type": "event" }, { - anonymous: false, - inputs: [ + "anonymous": false, + "inputs": [ { - indexed: true, - internalType: "bytes32", - name: "txId", - type: "bytes32", + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" }, { - indexed: true, - internalType: "uint256", - name: "validatorIndex", - type: "uint256", - }, + "indexed": false, + "internalType": "address[]", + "name": "validators", + "type": "address[]" + } ], - name: "TransactionIdleValidatorReplacementFailed", - type: "event", + "name": "TransactionReceiptProposed", + "type": "event" }, { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "txId", - type: "bytes32", - }, + "anonymous": false, + "inputs": [ { - indexed: true, - internalType: "address", - name: "newLeader", - type: "address", - }, + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + } ], - name: "TransactionLeaderRotated", - type: "event", + "name": "TransactionUndetermined", + "type": "event" }, { - anonymous: false, - inputs: [ + "anonymous": false, + "inputs": [ { - indexed: true, - internalType: "bytes32", - name: "tx_id", - type: "bytes32", + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" }, - ], - name: "TransactionLeaderTimeout", - type: "event", - }, - { - anonymous: false, - inputs: [ { - indexed: false, - internalType: "bytes32[]", - name: "tx_ids", - type: "bytes32[]", + "indexed": false, + "internalType": "uint256", + "name": "tribunalIndex", + "type": "uint256" }, + { + "indexed": true, + "internalType": "address", + "name": "validator", + "type": "address" + } ], - name: "TransactionNeedsRecomputation", - type: "event", + "name": "TribunalAppealVoteCommitted", + "type": "event" }, { - anonymous: false, - inputs: [ + "anonymous": false, + "inputs": [ { - indexed: true, - internalType: "bytes32", - name: "tx_id", - type: "bytes32", + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" }, { - indexed: false, - internalType: "address[]", - name: "validators", - type: "address[]", + "indexed": false, + "internalType": "uint256", + "name": "tribunalIndex", + "type": "uint256" }, - ], - name: "TransactionReceiptProposed", - type: "event", - }, - { - anonymous: false, - inputs: [ { - indexed: true, - internalType: "bytes32", - name: "tx_id", - type: "bytes32", + "indexed": true, + "internalType": "address", + "name": "validator", + "type": "address" }, + { + "indexed": false, + "internalType": "enum ITransactions.VoteType", + "name": "voteType", + "type": "uint8" + } ], - name: "TransactionUndetermined", - type: "event", + "name": "TribunalAppealVoteRevealed", + "type": "event" }, { - anonymous: false, - inputs: [ + "anonymous": false, + "inputs": [ { - indexed: true, - internalType: "bytes32", - name: "txId", - type: "bytes32", + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" }, { - indexed: true, - internalType: "address", - name: "validator", - type: "address", + "indexed": true, + "internalType": "address", + "name": "oldValidator", + "type": "address" }, { - indexed: false, - internalType: "bool", - name: "isLastVote", - type: "bool", + "indexed": true, + "internalType": "address", + "name": "newValidator", + "type": "address" }, + { + "indexed": false, + "internalType": "uint256", + "name": "validatorIndex", + "type": "uint256" + } ], - name: "TribunalAppealVoteCommitted", - type: "event", + "name": "ValidatorReplaced", + "type": "event" }, { - anonymous: false, - inputs: [ + "anonymous": false, + "inputs": [ { - indexed: true, - internalType: "bytes32", - name: "txId", - type: "bytes32", + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" }, { - indexed: true, - internalType: "address", - name: "validator", - type: "address", + "indexed": true, + "internalType": "address", + "name": "recipient", + "type": "address" }, { - indexed: false, - internalType: "bool", - name: "isLastVote", - type: "bool", - }, + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } ], - name: "TribunalAppealVoteRevealed", - type: "event", + "name": "ValueWithdrawalFailed", + "type": "event" }, { - anonymous: false, - inputs: [ + "anonymous": false, + "inputs": [ { - indexed: true, - internalType: "bytes32", - name: "txId", - type: "bytes32", + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" }, { - indexed: true, - internalType: "address", - name: "validator", - type: "address", + "indexed": true, + "internalType": "address", + "name": "validator", + "type": "address" }, { - indexed: false, - internalType: "bool", - name: "isLastVote", - type: "bool", - }, + "indexed": false, + "internalType": "bool", + "name": "isLastVote", + "type": "bool" + } ], - name: "VoteCommitted", - type: "event", + "name": "VoteCommitted", + "type": "event" }, { - anonymous: false, - inputs: [ + "anonymous": false, + "inputs": [ { - indexed: true, - internalType: "bytes32", - name: "txId", - type: "bytes32", + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" }, { - indexed: true, - internalType: "address", - name: "validator", - type: "address", + "indexed": true, + "internalType": "address", + "name": "validator", + "type": "address" }, { - indexed: false, - internalType: "enum ITransactions.VoteType", - name: "voteType", - type: "uint8", + "indexed": false, + "internalType": "enum ITransactions.VoteType", + "name": "voteType", + "type": "uint8" }, { - indexed: false, - internalType: "bool", - name: "isLastVote", - type: "bool", + "indexed": false, + "internalType": "bool", + "name": "isLastVote", + "type": "bool" }, { - indexed: false, - internalType: "enum ITransactions.ResultType", - name: "result", - type: "uint8", - }, + "indexed": false, + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + } ], - name: "VoteRevealed", - type: "event", + "name": "VoteRevealed", + "type": "event" }, { - inputs: [], - name: "DEFAULT_ADMIN_ROLE", - outputs: [ + "inputs": [], + "name": "EVENTS_BATCH_SIZE", + "outputs": [ { - internalType: "bytes32", - name: "", - type: "bytes32", - }, + "internalType": "uint256", + "name": "", + "type": "uint256" + } ], - stateMutability: "view", - type: "function", + "stateMutability": "view", + "type": "function" }, { - inputs: [], - name: "EVENTS_BATCH_SIZE", - outputs: [ + "inputs": [], + "name": "VERSION", + "outputs": [ { - internalType: "uint256", - name: "", - type: "uint256", - }, + "internalType": "string", + "name": "", + "type": "string" + } ], - stateMutability: "view", - type: "function", + "stateMutability": "view", + "type": "function" }, { - inputs: [], - name: "acceptOwnership", - outputs: [], - stateMutability: "nonpayable", - type: "function", + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" }, { - inputs: [ + "inputs": [ { - internalType: "bytes32", - name: "_txId", - type: "bytes32", + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" }, { - internalType: "bytes", - name: "_vrfProof", - type: "bytes", + "internalType": "address", + "name": "_operator", + "type": "address" }, + { + "internalType": "bytes", + "name": "_vrfProof", + "type": "bytes" + } ], - name: "activateTransaction", - outputs: [], - stateMutability: "nonpayable", - type: "function", + "name": "activateTransaction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" }, { - inputs: [ + "inputs": [ { - internalType: "address", - name: "_sender", - type: "address", + "internalType": "address", + "name": "_sender", + "type": "address" }, { - internalType: "address", - name: "_recipient", - type: "address", + "internalType": "address", + "name": "_recipient", + "type": "address" }, { - internalType: "uint256", - name: "_numOfInitialValidators", - type: "uint256", + "internalType": "uint256", + "name": "_numOfInitialValidators", + "type": "uint256" }, { - internalType: "uint256", - name: "_maxRotations", - type: "uint256", + "internalType": "uint256", + "name": "_maxRotations", + "type": "uint256" }, { - internalType: "bytes", - name: "_txData", - type: "bytes", + "internalType": "bytes", + "name": "_calldata", + "type": "bytes" }, + { + "internalType": "uint256", + "name": "_validUntil", + "type": "uint256" + } ], - name: "addTransaction", - outputs: [], - stateMutability: "nonpayable", - type: "function", + "name": "addTransaction", + "outputs": [], + "stateMutability": "payable", + "type": "function" }, { - inputs: [ + "inputs": [], + "name": "addressManager", + "outputs": [ { - internalType: "bytes32", - name: "_txId", - type: "bytes32", - }, + "internalType": "contract IAddressManager", + "name": "", + "type": "address" + } ], - name: "cancelTransaction", - outputs: [], - stateMutability: "nonpayable", - type: "function", + "stateMutability": "view", + "type": "function" }, { - inputs: [ - { - internalType: "bytes32", - name: "_txId", - type: "bytes32", - }, + "inputs": [ { - internalType: "bytes32", - name: "_commitHash", - type: "bytes32", - }, + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } ], - name: "commitTribunalAppealVote", - outputs: [], - stateMutability: "nonpayable", - type: "function", + "name": "cancelTransaction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" }, { - inputs: [ + "inputs": [ { - internalType: "bytes32", - name: "_txId", - type: "bytes32", + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" }, { - internalType: "bytes32", - name: "_commitHash", - type: "bytes32", + "internalType": "uint256", + "name": "_tribunalIndex", + "type": "uint256" }, { - internalType: "uint256", - name: "_validatorIndex", - type: "uint256", - }, + "internalType": "bytes32", + "name": "_commitHash", + "type": "bytes32" + } ], - name: "commitVote", - outputs: [], - stateMutability: "nonpayable", - type: "function", + "name": "commitTribunalAppealVote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" }, { - inputs: [], - name: "contracts", - outputs: [ + "inputs": [ { - internalType: "contract IGenManager", - name: "genManager", - type: "address", + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" }, { - internalType: "contract ITransactions", - name: "genTransactions", - type: "address", + "internalType": "bytes32", + "name": "_commitHash", + "type": "bytes32" }, { - internalType: "contract IQueues", - name: "genQueue", - type: "address", - }, + "internalType": "uint256", + "name": "_validatorIndex", + "type": "uint256" + } + ], + "name": "commitVote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ { - internalType: "contract IGhostFactory", - name: "ghostFactory", - type: "address", + "internalType": "address", + "name": "_sender", + "type": "address" }, { - internalType: "contract IGenStaking", - name: "genStaking", - type: "address", + "internalType": "uint256", + "name": "_numOfInitialValidators", + "type": "uint256" }, { - internalType: "contract IMessages", - name: "genMessages", - type: "address", + "internalType": "uint256", + "name": "_maxRotations", + "type": "uint256" }, { - internalType: "contract IIdleness", - name: "idleness", - type: "address", + "internalType": "bytes", + "name": "_calldata", + "type": "bytes" }, { - internalType: "contract ITribunalAppeal", - name: "tribunalAppeal", - type: "address", + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" }, + { + "internalType": "uint256", + "name": "_validUntil", + "type": "uint256" + } ], - stateMutability: "view", - type: "function", + "name": "deploySalted", + "outputs": [], + "stateMutability": "payable", + "type": "function" }, { - inputs: [ + "inputs": [ { - internalType: "address", - name: "_recipient", - type: "address", + "internalType": "address", + "name": "_recipient", + "type": "address" }, { - internalType: "uint256", - name: "_value", - type: "uint256", + "internalType": "uint256", + "name": "_value", + "type": "uint256" }, { - internalType: "bytes", - name: "_data", - type: "bytes", - }, + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } ], - name: "executeMessage", - outputs: [ + "name": "executeMessage", + "outputs": [ { - internalType: "bool", - name: "success", - type: "bool", - }, + "internalType": "bool", + "name": "success", + "type": "bool" + } ], - stateMutability: "nonpayable", - type: "function", + "stateMutability": "nonpayable", + "type": "function" }, { - inputs: [ + "inputs": [ { - internalType: "bytes32", - name: "_txId", - type: "bytes32", - }, + "internalType": "bytes32[]", + "name": "_txIds", + "type": "bytes32[]" + } ], - name: "finalizeTransaction", - outputs: [], - stateMutability: "nonpayable", - type: "function", + "name": "finalizeIdlenessTxs", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" }, { - inputs: [], - name: "getContracts", - outputs: [ + "inputs": [ { - components: [ - { - internalType: "contract IGenManager", - name: "genManager", - type: "address", - }, - { - internalType: "contract ITransactions", - name: "genTransactions", - type: "address", - }, - { - internalType: "contract IQueues", - name: "genQueue", - type: "address", - }, - { - internalType: "contract IGhostFactory", - name: "ghostFactory", - type: "address", - }, - { - internalType: "contract IGenStaking", - name: "genStaking", - type: "address", - }, - { - internalType: "contract IMessages", - name: "genMessages", - type: "address", - }, - { - internalType: "contract IIdleness", - name: "idleness", - type: "address", - }, - { - internalType: "contract ITribunalAppeal", - name: "tribunalAppeal", - type: "address", - }, - ], - internalType: "struct IConsensusMain.ExternalContracts", - name: "", - type: "tuple", - }, + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } ], - stateMutability: "view", - type: "function", + "name": "finalizeTransaction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" }, { - inputs: [ - { - internalType: "bytes32", - name: "role", - type: "bytes32", - }, - ], - name: "getRoleAdmin", - outputs: [ + "inputs": [ { - internalType: "bytes32", - name: "", - type: "bytes32", - }, + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } ], - stateMutability: "view", - type: "function", + "name": "flushExternalMessages", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" }, { - inputs: [ - { - internalType: "address", - name: "addr", - type: "address", - }, - ], - name: "ghostContracts", - outputs: [ + "inputs": [], + "name": "getAddressManager", + "outputs": [ { - internalType: "bool", - name: "isGhost", - type: "bool", - }, + "internalType": "contract IAddressManager", + "name": "", + "type": "address" + } ], - stateMutability: "view", - type: "function", + "stateMutability": "view", + "type": "function" }, { - inputs: [ + "inputs": [ { - internalType: "bytes32", - name: "role", - type: "bytes32", - }, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + } + ], + "name": "getPendingTransactionValue", + "outputs": [ { - internalType: "address", - name: "account", - type: "address", - }, + "internalType": "uint256", + "name": "", + "type": "uint256" + } ], - name: "grantRole", - outputs: [], - stateMutability: "nonpayable", - type: "function", + "stateMutability": "view", + "type": "function" }, { - inputs: [ - { - internalType: "bytes32", - name: "role", - type: "bytes32", - }, - { - internalType: "address", - name: "account", - type: "address", - }, - ], - name: "hasRole", - outputs: [ + "inputs": [ { - internalType: "bool", - name: "", - type: "bool", - }, + "internalType": "address", + "name": "_addressManager", + "type": "address" + } ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "initialize", - outputs: [], - stateMutability: "nonpayable", - type: "function", + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" }, { - inputs: [], - name: "owner", - outputs: [ + "inputs": [ { - internalType: "address", - name: "", - type: "address", - }, + "internalType": "address", + "name": "addr", + "type": "address" + } ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "pendingOwner", - outputs: [ + "name": "isGhostContract", + "outputs": [ { - internalType: "address", - name: "", - type: "address", - }, + "internalType": "bool", + "name": "", + "type": "bool" + } ], - stateMutability: "view", - type: "function", + "stateMutability": "view", + "type": "function" }, { - inputs: [ + "inputs": [ { - internalType: "address", - name: "recipient", - type: "address", - }, + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } ], - name: "proceedPendingQueueProcessing", - outputs: [], - stateMutability: "nonpayable", - type: "function", + "name": "leaderIdleness", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" }, { - inputs: [ - { - internalType: "bytes32", - name: "_txId", - type: "bytes32", - }, - { - internalType: "bytes", - name: "_txReceipt", - type: "bytes", - }, - { - internalType: "uint256", - name: "_processingBlock", - type: "uint256", - }, + "inputs": [ { - components: [ + "components": [ + { + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, { - internalType: "enum IMessages.MessageType", - name: "messageType", - type: "uint8", + "internalType": "uint256", + "name": "saltAsAValidator", + "type": "uint256" }, { - internalType: "address", - name: "recipient", - type: "address", + "internalType": "bytes32", + "name": "txExecutionHash", + "type": "bytes32" }, { - internalType: "uint256", - name: "value", - type: "uint256", + "internalType": "bytes32", + "name": "messagesAndOtherFieldsHash", + "type": "bytes32" }, { - internalType: "bytes", - name: "data", - type: "bytes", + "internalType": "bytes32", + "name": "otherExecutionFieldsHash", + "type": "bytes32" }, { - internalType: "bool", - name: "onAcceptance", - type: "bool", + "internalType": "enum ITransactions.VoteType", + "name": "resultValue", + "type": "uint8" }, + { + "components": [ + { + "internalType": "enum IMessages.MessageType", + "name": "messageType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bool", + "name": "onAcceptance", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + } + ], + "internalType": "struct IMessages.SubmittedMessage[]", + "name": "messages", + "type": "tuple[]" + } ], - internalType: "struct IMessages.SubmittedMessage[]", - name: "_messages", - type: "tuple[]", - }, - { - internalType: "bytes", - name: "_vrfProof", - type: "bytes", - }, + "internalType": "struct IConsensusMain.LeaderRevealVoteParams", + "name": "leaderRevealVoteParams", + "type": "tuple" + } ], - name: "proposeReceipt", - outputs: [], - stateMutability: "nonpayable", - type: "function", + "name": "leaderRevealVote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" }, { - inputs: [], - name: "renounceOwnership", - outputs: [], - stateMutability: "nonpayable", - type: "function", + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" }, { - inputs: [ - { - internalType: "bytes32", - name: "role", - type: "bytes32", - }, + "inputs": [], + "name": "pendingOwner", + "outputs": [ { - internalType: "address", - name: "callerConfirmation", - type: "address", - }, + "internalType": "address", + "name": "", + "type": "address" + } ], - name: "renounceRole", - outputs: [], - stateMutability: "nonpayable", - type: "function", + "stateMutability": "view", + "type": "function" }, { - inputs: [ - { - internalType: "bytes32", - name: "_txId", - type: "bytes32", - }, + "inputs": [ { - internalType: "bytes32", - name: "_voteHash", - type: "bytes32", - }, - { - internalType: "enum ITribunalAppeal.TribunalVoteType", - name: "_voteType", - type: "uint8", - }, - { - internalType: "uint256", - name: "_nonce", - type: "uint256", - }, + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } ], - name: "revealTribunalAppealVote", - outputs: [], - stateMutability: "nonpayable", - type: "function", + "name": "processIdleness", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" }, { - inputs: [ + "inputs": [ { - internalType: "bytes32", - name: "_txId", - type: "bytes32", + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" }, { - internalType: "bytes32", - name: "_voteHash", - type: "bytes32", + "internalType": "bytes32", + "name": "_txExecutionHash", + "type": "bytes32" }, { - internalType: "enum ITransactions.VoteType", - name: "_voteType", - type: "uint8", + "internalType": "uint256", + "name": "_processingBlock", + "type": "uint256" }, { - internalType: "uint256", - name: "_nonce", - type: "uint256", + "internalType": "address", + "name": "_operator", + "type": "address" }, { - internalType: "uint256", - name: "_validatorIndex", - type: "uint256", + "internalType": "bytes", + "name": "_eqBlocksOutputs", + "type": "bytes" }, + { + "internalType": "bytes", + "name": "_vrfProof", + "type": "bytes" + } ], - name: "revealVote", - outputs: [], - stateMutability: "nonpayable", - type: "function", + "name": "proposeReceipt", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" }, { - inputs: [ + "inputs": [ { - internalType: "bytes32", - name: "role", - type: "bytes32", - }, + "internalType": "bytes32[]", + "name": "_txIds", + "type": "bytes32[]" + } + ], + "name": "redButtonFinalize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ { - internalType: "address", - name: "account", - type: "address", - }, + "internalType": "address", + "name": "ghost", + "type": "address" + } ], - name: "revokeRole", - outputs: [], - stateMutability: "nonpayable", - type: "function", + "name": "registerGhostContract", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" }, { - inputs: [ + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, { - internalType: "address", - name: "_ghostFactory", - type: "address", + "internalType": "uint256", + "name": "_tribunalIndex", + "type": "uint256" }, { - internalType: "address", - name: "_genManager", - type: "address", + "internalType": "bytes32", + "name": "_voteHash", + "type": "bytes32" }, { - internalType: "address", - name: "_genTransactions", - type: "address", + "internalType": "enum ITransactions.VoteType", + "name": "_voteType", + "type": "uint8" }, { - internalType: "address", - name: "_genQueue", - type: "address", + "internalType": "bytes32", + "name": "_otherExecutionFieldsHash", + "type": "bytes32" }, { - internalType: "address", - name: "_genStaking", - type: "address", + "internalType": "uint256", + "name": "_nonce", + "type": "uint256" + } + ], + "name": "revealTribunalAppealVote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" }, { - internalType: "address", - name: "_genMessages", - type: "address", + "internalType": "bytes32", + "name": "_voteHash", + "type": "bytes32" }, { - internalType: "address", - name: "_idleness", - type: "address", + "internalType": "enum ITransactions.VoteType", + "name": "_voteType", + "type": "uint8" }, { - internalType: "address", - name: "_tribunalAppeal", - type: "address", + "internalType": "bytes32", + "name": "_otherExecutionFieldsHash", + "type": "bytes32" }, - ], - name: "setExternalContracts", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ { - internalType: "bytes32", - name: "_txId", - type: "bytes32", + "internalType": "uint256", + "name": "_nonce", + "type": "uint256" }, + { + "internalType": "uint256", + "name": "_validatorIndex", + "type": "uint256" + } ], - name: "submitAppeal", - outputs: [], - stateMutability: "payable", - type: "function", + "name": "revealVote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" }, { - inputs: [ + "inputs": [ { - internalType: "bytes32", - name: "_txId", - type: "bytes32", - }, + "internalType": "address", + "name": "_addressManager", + "type": "address" + } ], - name: "submitSlashAppeal", - outputs: [], - stateMutability: "nonpayable", - type: "function", + "name": "setAddressManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" }, { - inputs: [ + "inputs": [ { - internalType: "bytes4", - name: "interfaceId", - type: "bytes4", - }, - ], - name: "supportsInterface", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } ], - stateMutability: "view", - type: "function", + "name": "submitAppeal", + "outputs": [], + "stateMutability": "payable", + "type": "function" }, { - inputs: [ + "inputs": [ { - internalType: "address", - name: "newOwner", - type: "address", - }, + "internalType": "address", + "name": "newOwner", + "type": "address" + } ], - name: "transferOwnership", - outputs: [], - stateMutability: "nonpayable", - type: "function", + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" }, + { + "stateMutability": "payable", + "type": "receive" + } ], bytecode: "", }; @@ -1440,2550 +1359,1965 @@ const CONSENSUS_DATA_CONTRACT = { address: "0x88B0F18613Db92Bf970FfE264E02496e20a74D16" as Address, abi: [ { - inputs: [], - name: "AccessControlBadConfirmation", - type: "error", + "inputs": [], + "name": "AccessControlBadConfirmation", + "type": "error" }, { - inputs: [ + "inputs": [ { - internalType: "address", - name: "account", - type: "address", + "internalType": "address", + "name": "account", + "type": "address" }, { - internalType: "bytes32", - name: "neededRole", - type: "bytes32", - }, + "internalType": "bytes32", + "name": "neededRole", + "type": "bytes32" + } ], - name: "AccessControlUnauthorizedAccount", - type: "error", + "name": "AccessControlUnauthorizedAccount", + "type": "error" }, { - inputs: [], - name: "InvalidInitialization", - type: "error", + "inputs": [], + "name": "InvalidInitialization", + "type": "error" }, { - inputs: [], - name: "NotInitializing", - type: "error", + "inputs": [], + "name": "NotInitializing", + "type": "error" }, { - inputs: [ + "inputs": [ { - internalType: "address", - name: "owner", - type: "address", - }, + "internalType": "address", + "name": "owner", + "type": "address" + } ], - name: "OwnableInvalidOwner", - type: "error", + "name": "OwnableInvalidOwner", + "type": "error" }, { - inputs: [ + "inputs": [ { - internalType: "address", - name: "account", - type: "address", - }, + "internalType": "address", + "name": "account", + "type": "address" + } ], - name: "OwnableUnauthorizedAccount", - type: "error", + "name": "OwnableUnauthorizedAccount", + "type": "error" }, { - inputs: [], - name: "ReentrancyGuardReentrantCall", - type: "error", + "inputs": [], + "name": "ReentrancyGuardReentrantCall", + "type": "error" }, { - anonymous: false, - inputs: [ + "anonymous": false, + "inputs": [ { - indexed: false, - internalType: "uint64", - name: "version", - type: "uint64", - }, + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } ], - name: "Initialized", - type: "event", + "name": "Initialized", + "type": "event" }, { - anonymous: false, - inputs: [ + "anonymous": false, + "inputs": [ { - indexed: true, - internalType: "address", - name: "previousOwner", - type: "address", + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" }, { - indexed: true, - internalType: "address", - name: "newOwner", - type: "address", - }, + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } ], - name: "OwnershipTransferStarted", - type: "event", + "name": "OwnershipTransferStarted", + "type": "event" }, { - anonymous: false, - inputs: [ + "anonymous": false, + "inputs": [ { - indexed: true, - internalType: "address", - name: "previousOwner", - type: "address", + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" }, { - indexed: true, - internalType: "address", - name: "newOwner", - type: "address", - }, + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } ], - name: "OwnershipTransferred", - type: "event", + "name": "OwnershipTransferred", + "type": "event" }, { - anonymous: false, - inputs: [ + "anonymous": false, + "inputs": [ { - indexed: true, - internalType: "bytes32", - name: "role", - type: "bytes32", + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" }, { - indexed: true, - internalType: "bytes32", - name: "previousAdminRole", - type: "bytes32", + "indexed": true, + "internalType": "bytes32", + "name": "previousAdminRole", + "type": "bytes32" }, { - indexed: true, - internalType: "bytes32", - name: "newAdminRole", - type: "bytes32", - }, + "indexed": true, + "internalType": "bytes32", + "name": "newAdminRole", + "type": "bytes32" + } ], - name: "RoleAdminChanged", - type: "event", + "name": "RoleAdminChanged", + "type": "event" }, { - anonymous: false, - inputs: [ + "anonymous": false, + "inputs": [ { - indexed: true, - internalType: "bytes32", - name: "role", - type: "bytes32", + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" }, { - indexed: true, - internalType: "address", - name: "account", - type: "address", + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" }, { - indexed: true, - internalType: "address", - name: "sender", - type: "address", - }, + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } ], - name: "RoleGranted", - type: "event", + "name": "RoleGranted", + "type": "event" }, { - anonymous: false, - inputs: [ + "anonymous": false, + "inputs": [ { - indexed: true, - internalType: "bytes32", - name: "role", - type: "bytes32", + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" }, { - indexed: true, - internalType: "address", - name: "account", - type: "address", + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" }, { - indexed: true, - internalType: "address", - name: "sender", - type: "address", - }, + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } ], - name: "RoleRevoked", - type: "event", + "name": "RoleRevoked", + "type": "event" }, { - inputs: [], - name: "DEFAULT_ADMIN_ROLE", - outputs: [ + "inputs": [], + "name": "DEFAULT_ADMIN_ROLE", + "outputs": [ { - internalType: "bytes32", - name: "", - type: "bytes32", - }, + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } ], - stateMutability: "view", - type: "function", + "stateMutability": "view", + "type": "function" }, { - inputs: [], - name: "acceptOwnership", - outputs: [], - stateMutability: "nonpayable", - type: "function", + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" }, { - inputs: [ - { - internalType: "bytes32", - name: "_txId", - type: "bytes32", - }, - { - internalType: "uint256", - name: "_currentTimestamp", - type: "uint256", - }, - ], - name: "canFinalize", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - { - internalType: "uint256", - name: "", - type: "uint256", - }, + "inputs": [], + "name": "addressManager", + "outputs": [ { - internalType: "uint256", - name: "", - type: "uint256", - }, + "internalType": "contract IAddressManager", + "name": "", + "type": "address" + } ], - stateMutability: "view", - type: "function", + "stateMutability": "view", + "type": "function" }, { - inputs: [], - name: "consensusMain", - outputs: [ + "inputs": [ { - internalType: "contract IConsensusMain", - name: "", - type: "address", + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" }, + { + "internalType": "uint256", + "name": "_currentTimestamp", + "type": "uint256" + } ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ + "name": "canFinalize", + "outputs": [ { - internalType: "bytes32", - name: "_tx_id", - type: "bytes32", + "internalType": "bool", + "name": "", + "type": "bool" }, - ], - name: "getLastAppealResult", - outputs: [ { - internalType: "enum ITransactions.ResultType", - name: "", - type: "uint8", + "internalType": "uint256", + "name": "", + "type": "uint256" }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } ], - stateMutability: "view", - type: "function", + "stateMutability": "view", + "type": "function" }, { - inputs: [ + "inputs": [ { - internalType: "address", - name: "recipient", - type: "address", - }, + "internalType": "address", + "name": "recipient", + "type": "address" + } ], - name: "getLatestAcceptedTransaction", - outputs: [ + "name": "getLatestAcceptedTransaction", + "outputs": [ { - components: [ + "components": [ { - internalType: "uint256", - name: "currentTimestamp", - type: "uint256", + "internalType": "uint256", + "name": "currentTimestamp", + "type": "uint256" }, { - internalType: "address", - name: "sender", - type: "address", + "internalType": "address", + "name": "sender", + "type": "address" }, { - internalType: "address", - name: "recipient", - type: "address", + "internalType": "address", + "name": "recipient", + "type": "address" }, { - internalType: "uint256", - name: "numOfInitialValidators", - type: "uint256", + "internalType": "uint256", + "name": "initialRotations", + "type": "uint256" }, { - internalType: "uint256", - name: "txSlot", - type: "uint256", + "internalType": "uint256", + "name": "txSlot", + "type": "uint256" }, { - internalType: "uint256", - name: "createdTimestamp", - type: "uint256", + "internalType": "uint256", + "name": "createdTimestamp", + "type": "uint256" }, { - internalType: "uint256", - name: "lastVoteTimestamp", - type: "uint256", + "internalType": "uint256", + "name": "lastVoteTimestamp", + "type": "uint256" }, { - internalType: "bytes32", - name: "randomSeed", - type: "bytes32", + "internalType": "bytes32", + "name": "randomSeed", + "type": "bytes32" }, { - internalType: "enum ITransactions.ResultType", - name: "result", - type: "uint8", + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" }, { - internalType: "bytes", - name: "txData", - type: "bytes", + "internalType": "bytes32", + "name": "txExecutionHash", + "type": "bytes32" }, { - internalType: "bytes", - name: "txReceipt", - type: "bytes", + "internalType": "bytes", + "name": "txCalldata", + "type": "bytes" }, { - components: [ + "internalType": "bytes", + "name": "eqBlocksOutputs", + "type": "bytes" + }, + { + "components": [ { - internalType: "enum IMessages.MessageType", - name: "messageType", - type: "uint8", + "internalType": "enum IMessages.MessageType", + "name": "messageType", + "type": "uint8" }, { - internalType: "address", - name: "recipient", - type: "address", + "internalType": "address", + "name": "recipient", + "type": "address" }, { - internalType: "uint256", - name: "value", - type: "uint256", + "internalType": "uint256", + "name": "value", + "type": "uint256" }, { - internalType: "bytes", - name: "data", - type: "bytes", + "internalType": "bytes", + "name": "data", + "type": "bytes" }, { - internalType: "bool", - name: "onAcceptance", - type: "bool", + "internalType": "bool", + "name": "onAcceptance", + "type": "bool" }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + } ], - internalType: "struct IMessages.SubmittedMessage[]", - name: "messages", - type: "tuple[]", + "internalType": "struct IMessages.SubmittedMessage[]", + "name": "messages", + "type": "tuple[]" }, { - internalType: "enum IQueues.QueueType", - name: "queueType", - type: "uint8", + "internalType": "enum IQueues.QueueType", + "name": "queueType", + "type": "uint8" }, { - internalType: "uint256", - name: "queuePosition", - type: "uint256", + "internalType": "uint256", + "name": "queuePosition", + "type": "uint256" }, { - internalType: "address", - name: "activator", - type: "address", + "internalType": "address", + "name": "activator", + "type": "address" }, { - internalType: "address", - name: "lastLeader", - type: "address", + "internalType": "address", + "name": "lastLeader", + "type": "address" }, { - internalType: "enum ITransactions.TransactionStatus", - name: "status", - type: "uint8", + "internalType": "enum ITransactions.TransactionStatus", + "name": "status", + "type": "uint8" }, { - internalType: "bytes32", - name: "txId", - type: "bytes32", + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" }, { - components: [ + "components": [ { - internalType: "uint256", - name: "activationBlock", - type: "uint256", + "internalType": "uint256", + "name": "activationBlock", + "type": "uint256" }, { - internalType: "uint256", - name: "processingBlock", - type: "uint256", + "internalType": "uint256", + "name": "processingBlock", + "type": "uint256" }, { - internalType: "uint256", - name: "proposalBlock", - type: "uint256", - }, + "internalType": "uint256", + "name": "proposalBlock", + "type": "uint256" + } ], - internalType: "struct ITransactions.ReadStateBlockRange", - name: "readStateBlockRange", - type: "tuple", + "internalType": "struct ITransactions.ReadStateBlockRange", + "name": "readStateBlockRange", + "type": "tuple" }, { - internalType: "uint256", - name: "numOfRounds", - type: "uint256", + "internalType": "uint256", + "name": "numOfRounds", + "type": "uint256" }, { - components: [ + "components": [ { - internalType: "uint256", - name: "round", - type: "uint256", + "internalType": "uint256", + "name": "round", + "type": "uint256" }, { - internalType: "uint256", - name: "leaderIndex", - type: "uint256", + "internalType": "uint256", + "name": "leaderIndex", + "type": "uint256" }, { - internalType: "uint256", - name: "votesCommitted", - type: "uint256", + "internalType": "uint256", + "name": "votesCommitted", + "type": "uint256" }, { - internalType: "uint256", - name: "votesRevealed", - type: "uint256", + "internalType": "uint256", + "name": "votesRevealed", + "type": "uint256" }, { - internalType: "uint256", - name: "appealBond", - type: "uint256", + "internalType": "uint256", + "name": "appealBond", + "type": "uint256" }, { - internalType: "uint256", - name: "rotationsLeft", - type: "uint256", + "internalType": "uint256", + "name": "rotationsLeft", + "type": "uint256" }, { - internalType: "enum ITransactions.ResultType", - name: "result", - type: "uint8", + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" }, { - internalType: "address[]", - name: "roundValidators", - type: "address[]", + "internalType": "address[]", + "name": "roundValidators", + "type": "address[]" }, { - internalType: "bytes32[]", - name: "validatorVotesHash", - type: "bytes32[]", + "internalType": "enum ITransactions.VoteType[]", + "name": "validatorVotes", + "type": "uint8[]" }, { - internalType: "enum ITransactions.VoteType[]", - name: "validatorVotes", - type: "uint8[]", + "internalType": "bytes32[]", + "name": "validatorVotesHash", + "type": "bytes32[]" }, + { + "internalType": "bytes32[]", + "name": "validatorResultHash", + "type": "bytes32[]" + } ], - internalType: "struct ITransactions.RoundData", - name: "lastRound", - type: "tuple", + "internalType": "struct ITransactions.RoundData", + "name": "lastRound", + "type": "tuple" }, + { + "internalType": "address[]", + "name": "consumedValidators", + "type": "address[]" + } ], - internalType: "struct ConsensusData.TransactionData", - name: "txData", - type: "tuple", - }, + "internalType": "struct ConsensusData.TransactionData", + "name": "inputData", + "type": "tuple" + } ], - stateMutability: "view", - type: "function", + "stateMutability": "view", + "type": "function" }, { - inputs: [ + "inputs": [ { - internalType: "address", - name: "recipient", - type: "address", + "internalType": "address", + "name": "recipient", + "type": "address" }, { - internalType: "uint256", - name: "startIndex", - type: "uint256", + "internalType": "uint256", + "name": "startIndex", + "type": "uint256" }, { - internalType: "uint256", - name: "pageSize", - type: "uint256", - }, + "internalType": "uint256", + "name": "pageSize", + "type": "uint256" + } ], - name: "getLatestAcceptedTransactions", - outputs: [ + "name": "getLatestAcceptedTransactions", + "outputs": [ { - components: [ + "components": [ { - internalType: "uint256", - name: "currentTimestamp", - type: "uint256", + "internalType": "uint256", + "name": "currentTimestamp", + "type": "uint256" }, { - internalType: "address", - name: "sender", - type: "address", + "internalType": "address", + "name": "sender", + "type": "address" }, { - internalType: "address", - name: "recipient", - type: "address", + "internalType": "address", + "name": "recipient", + "type": "address" }, { - internalType: "uint256", - name: "numOfInitialValidators", - type: "uint256", + "internalType": "uint256", + "name": "initialRotations", + "type": "uint256" }, { - internalType: "uint256", - name: "txSlot", - type: "uint256", + "internalType": "uint256", + "name": "txSlot", + "type": "uint256" }, { - internalType: "uint256", - name: "createdTimestamp", - type: "uint256", + "internalType": "uint256", + "name": "createdTimestamp", + "type": "uint256" }, { - internalType: "uint256", - name: "lastVoteTimestamp", - type: "uint256", + "internalType": "uint256", + "name": "lastVoteTimestamp", + "type": "uint256" }, { - internalType: "bytes32", - name: "randomSeed", - type: "bytes32", + "internalType": "bytes32", + "name": "randomSeed", + "type": "bytes32" }, { - internalType: "enum ITransactions.ResultType", - name: "result", - type: "uint8", + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" }, { - internalType: "bytes", - name: "txData", - type: "bytes", + "internalType": "bytes32", + "name": "txExecutionHash", + "type": "bytes32" }, { - internalType: "bytes", - name: "txReceipt", - type: "bytes", + "internalType": "bytes", + "name": "txCalldata", + "type": "bytes" }, { - components: [ + "internalType": "bytes", + "name": "eqBlocksOutputs", + "type": "bytes" + }, + { + "components": [ { - internalType: "enum IMessages.MessageType", - name: "messageType", - type: "uint8", + "internalType": "enum IMessages.MessageType", + "name": "messageType", + "type": "uint8" }, { - internalType: "address", - name: "recipient", - type: "address", + "internalType": "address", + "name": "recipient", + "type": "address" }, { - internalType: "uint256", - name: "value", - type: "uint256", + "internalType": "uint256", + "name": "value", + "type": "uint256" }, { - internalType: "bytes", - name: "data", - type: "bytes", + "internalType": "bytes", + "name": "data", + "type": "bytes" }, { - internalType: "bool", - name: "onAcceptance", - type: "bool", + "internalType": "bool", + "name": "onAcceptance", + "type": "bool" }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + } ], - internalType: "struct IMessages.SubmittedMessage[]", - name: "messages", - type: "tuple[]", + "internalType": "struct IMessages.SubmittedMessage[]", + "name": "messages", + "type": "tuple[]" }, { - internalType: "enum IQueues.QueueType", - name: "queueType", - type: "uint8", + "internalType": "enum IQueues.QueueType", + "name": "queueType", + "type": "uint8" }, { - internalType: "uint256", - name: "queuePosition", - type: "uint256", + "internalType": "uint256", + "name": "queuePosition", + "type": "uint256" }, { - internalType: "address", - name: "activator", - type: "address", + "internalType": "address", + "name": "activator", + "type": "address" }, { - internalType: "address", - name: "lastLeader", - type: "address", + "internalType": "address", + "name": "lastLeader", + "type": "address" }, { - internalType: "enum ITransactions.TransactionStatus", - name: "status", - type: "uint8", + "internalType": "enum ITransactions.TransactionStatus", + "name": "status", + "type": "uint8" }, { - internalType: "bytes32", - name: "txId", - type: "bytes32", + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" }, { - components: [ + "components": [ { - internalType: "uint256", - name: "activationBlock", - type: "uint256", + "internalType": "uint256", + "name": "activationBlock", + "type": "uint256" }, { - internalType: "uint256", - name: "processingBlock", - type: "uint256", + "internalType": "uint256", + "name": "processingBlock", + "type": "uint256" }, { - internalType: "uint256", - name: "proposalBlock", - type: "uint256", - }, + "internalType": "uint256", + "name": "proposalBlock", + "type": "uint256" + } ], - internalType: "struct ITransactions.ReadStateBlockRange", - name: "readStateBlockRange", - type: "tuple", + "internalType": "struct ITransactions.ReadStateBlockRange", + "name": "readStateBlockRange", + "type": "tuple" }, { - internalType: "uint256", - name: "numOfRounds", - type: "uint256", + "internalType": "uint256", + "name": "numOfRounds", + "type": "uint256" }, { - components: [ + "components": [ { - internalType: "uint256", - name: "round", - type: "uint256", + "internalType": "uint256", + "name": "round", + "type": "uint256" }, { - internalType: "uint256", - name: "leaderIndex", - type: "uint256", + "internalType": "uint256", + "name": "leaderIndex", + "type": "uint256" }, { - internalType: "uint256", - name: "votesCommitted", - type: "uint256", + "internalType": "uint256", + "name": "votesCommitted", + "type": "uint256" }, { - internalType: "uint256", - name: "votesRevealed", - type: "uint256", + "internalType": "uint256", + "name": "votesRevealed", + "type": "uint256" }, { - internalType: "uint256", - name: "appealBond", - type: "uint256", + "internalType": "uint256", + "name": "appealBond", + "type": "uint256" }, { - internalType: "uint256", - name: "rotationsLeft", - type: "uint256", + "internalType": "uint256", + "name": "rotationsLeft", + "type": "uint256" }, { - internalType: "enum ITransactions.ResultType", - name: "result", - type: "uint8", + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" }, { - internalType: "address[]", - name: "roundValidators", - type: "address[]", + "internalType": "address[]", + "name": "roundValidators", + "type": "address[]" }, { - internalType: "bytes32[]", - name: "validatorVotesHash", - type: "bytes32[]", + "internalType": "enum ITransactions.VoteType[]", + "name": "validatorVotes", + "type": "uint8[]" }, { - internalType: "enum ITransactions.VoteType[]", - name: "validatorVotes", - type: "uint8[]", + "internalType": "bytes32[]", + "name": "validatorVotesHash", + "type": "bytes32[]" }, + { + "internalType": "bytes32[]", + "name": "validatorResultHash", + "type": "bytes32[]" + } ], - internalType: "struct ITransactions.RoundData", - name: "lastRound", - type: "tuple", + "internalType": "struct ITransactions.RoundData", + "name": "lastRound", + "type": "tuple" }, + { + "internalType": "address[]", + "name": "consumedValidators", + "type": "address[]" + } ], - internalType: "struct ConsensusData.TransactionData[]", - name: "", - type: "tuple[]", - }, + "internalType": "struct ConsensusData.TransactionData[]", + "name": "", + "type": "tuple[]" + } ], - stateMutability: "view", - type: "function", + "stateMutability": "view", + "type": "function" }, { - inputs: [ + "inputs": [ { - internalType: "address", - name: "recipient", - type: "address", - }, + "internalType": "address", + "name": "recipient", + "type": "address" + } ], - name: "getLatestAcceptedTxCount", - outputs: [ + "name": "getLatestAcceptedTxCount", + "outputs": [ { - internalType: "uint256", - name: "", - type: "uint256", - }, + "internalType": "uint256", + "name": "", + "type": "uint256" + } ], - stateMutability: "view", - type: "function", + "stateMutability": "view", + "type": "function" }, { - inputs: [ + "inputs": [ { - internalType: "address", - name: "recipient", - type: "address", - }, + "internalType": "address", + "name": "recipient", + "type": "address" + } ], - name: "getLatestFinalizedTransaction", - outputs: [ + "name": "getLatestFinalizedTransaction", + "outputs": [ { - components: [ + "components": [ + { + "internalType": "uint256", + "name": "currentTimestamp", + "type": "uint256" + }, { - internalType: "uint256", - name: "currentTimestamp", - type: "uint256", + "internalType": "address", + "name": "sender", + "type": "address" }, { - internalType: "address", - name: "sender", - type: "address", + "internalType": "address", + "name": "recipient", + "type": "address" }, { - internalType: "address", - name: "recipient", - type: "address", + "internalType": "uint256", + "name": "initialRotations", + "type": "uint256" }, { - internalType: "uint256", - name: "numOfInitialValidators", - type: "uint256", + "internalType": "uint256", + "name": "txSlot", + "type": "uint256" }, { - internalType: "uint256", - name: "txSlot", - type: "uint256", + "internalType": "uint256", + "name": "createdTimestamp", + "type": "uint256" }, { - internalType: "uint256", - name: "createdTimestamp", - type: "uint256", + "internalType": "uint256", + "name": "lastVoteTimestamp", + "type": "uint256" }, { - internalType: "uint256", - name: "lastVoteTimestamp", - type: "uint256", + "internalType": "bytes32", + "name": "randomSeed", + "type": "bytes32" }, { - internalType: "bytes32", - name: "randomSeed", - type: "bytes32", + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" }, { - internalType: "enum ITransactions.ResultType", - name: "result", - type: "uint8", + "internalType": "bytes32", + "name": "txExecutionHash", + "type": "bytes32" }, { - internalType: "bytes", - name: "txData", - type: "bytes", + "internalType": "bytes", + "name": "txCalldata", + "type": "bytes" }, { - internalType: "bytes", - name: "txReceipt", - type: "bytes", + "internalType": "bytes", + "name": "eqBlocksOutputs", + "type": "bytes" }, { - components: [ + "components": [ { - internalType: "enum IMessages.MessageType", - name: "messageType", - type: "uint8", + "internalType": "enum IMessages.MessageType", + "name": "messageType", + "type": "uint8" }, { - internalType: "address", - name: "recipient", - type: "address", + "internalType": "address", + "name": "recipient", + "type": "address" }, { - internalType: "uint256", - name: "value", - type: "uint256", + "internalType": "uint256", + "name": "value", + "type": "uint256" }, { - internalType: "bytes", - name: "data", - type: "bytes", + "internalType": "bytes", + "name": "data", + "type": "bytes" }, { - internalType: "bool", - name: "onAcceptance", - type: "bool", + "internalType": "bool", + "name": "onAcceptance", + "type": "bool" }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + } ], - internalType: "struct IMessages.SubmittedMessage[]", - name: "messages", - type: "tuple[]", + "internalType": "struct IMessages.SubmittedMessage[]", + "name": "messages", + "type": "tuple[]" }, { - internalType: "enum IQueues.QueueType", - name: "queueType", - type: "uint8", + "internalType": "enum IQueues.QueueType", + "name": "queueType", + "type": "uint8" }, { - internalType: "uint256", - name: "queuePosition", - type: "uint256", + "internalType": "uint256", + "name": "queuePosition", + "type": "uint256" }, { - internalType: "address", - name: "activator", - type: "address", + "internalType": "address", + "name": "activator", + "type": "address" }, { - internalType: "address", - name: "lastLeader", - type: "address", + "internalType": "address", + "name": "lastLeader", + "type": "address" }, { - internalType: "enum ITransactions.TransactionStatus", - name: "status", - type: "uint8", + "internalType": "enum ITransactions.TransactionStatus", + "name": "status", + "type": "uint8" }, { - internalType: "bytes32", - name: "txId", - type: "bytes32", + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" }, { - components: [ + "components": [ { - internalType: "uint256", - name: "activationBlock", - type: "uint256", + "internalType": "uint256", + "name": "activationBlock", + "type": "uint256" }, { - internalType: "uint256", - name: "processingBlock", - type: "uint256", + "internalType": "uint256", + "name": "processingBlock", + "type": "uint256" }, { - internalType: "uint256", - name: "proposalBlock", - type: "uint256", - }, + "internalType": "uint256", + "name": "proposalBlock", + "type": "uint256" + } ], - internalType: "struct ITransactions.ReadStateBlockRange", - name: "readStateBlockRange", - type: "tuple", + "internalType": "struct ITransactions.ReadStateBlockRange", + "name": "readStateBlockRange", + "type": "tuple" }, { - internalType: "uint256", - name: "numOfRounds", - type: "uint256", + "internalType": "uint256", + "name": "numOfRounds", + "type": "uint256" }, { - components: [ + "components": [ { - internalType: "uint256", - name: "round", - type: "uint256", + "internalType": "uint256", + "name": "round", + "type": "uint256" }, { - internalType: "uint256", - name: "leaderIndex", - type: "uint256", + "internalType": "uint256", + "name": "leaderIndex", + "type": "uint256" }, { - internalType: "uint256", - name: "votesCommitted", - type: "uint256", + "internalType": "uint256", + "name": "votesCommitted", + "type": "uint256" }, { - internalType: "uint256", - name: "votesRevealed", - type: "uint256", + "internalType": "uint256", + "name": "votesRevealed", + "type": "uint256" }, { - internalType: "uint256", - name: "appealBond", - type: "uint256", + "internalType": "uint256", + "name": "appealBond", + "type": "uint256" }, { - internalType: "uint256", - name: "rotationsLeft", - type: "uint256", + "internalType": "uint256", + "name": "rotationsLeft", + "type": "uint256" }, { - internalType: "enum ITransactions.ResultType", - name: "result", - type: "uint8", + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" }, { - internalType: "address[]", - name: "roundValidators", - type: "address[]", + "internalType": "address[]", + "name": "roundValidators", + "type": "address[]" }, { - internalType: "bytes32[]", - name: "validatorVotesHash", - type: "bytes32[]", + "internalType": "enum ITransactions.VoteType[]", + "name": "validatorVotes", + "type": "uint8[]" }, { - internalType: "enum ITransactions.VoteType[]", - name: "validatorVotes", - type: "uint8[]", + "internalType": "bytes32[]", + "name": "validatorVotesHash", + "type": "bytes32[]" }, + { + "internalType": "bytes32[]", + "name": "validatorResultHash", + "type": "bytes32[]" + } ], - internalType: "struct ITransactions.RoundData", - name: "lastRound", - type: "tuple", + "internalType": "struct ITransactions.RoundData", + "name": "lastRound", + "type": "tuple" }, + { + "internalType": "address[]", + "name": "consumedValidators", + "type": "address[]" + } ], - internalType: "struct ConsensusData.TransactionData", - name: "txData", - type: "tuple", - }, + "internalType": "struct ConsensusData.TransactionData", + "name": "inputData", + "type": "tuple" + } ], - stateMutability: "view", - type: "function", + "stateMutability": "view", + "type": "function" }, { - inputs: [ + "inputs": [ { - internalType: "address", - name: "recipient", - type: "address", + "internalType": "address", + "name": "recipient", + "type": "address" }, { - internalType: "uint256", - name: "startIndex", - type: "uint256", + "internalType": "uint256", + "name": "startIndex", + "type": "uint256" }, { - internalType: "uint256", - name: "pageSize", - type: "uint256", - }, + "internalType": "uint256", + "name": "pageSize", + "type": "uint256" + } ], - name: "getLatestFinalizedTransactions", - outputs: [ + "name": "getLatestFinalizedTransactions", + "outputs": [ { - components: [ + "components": [ { - internalType: "uint256", - name: "currentTimestamp", - type: "uint256", + "internalType": "uint256", + "name": "currentTimestamp", + "type": "uint256" }, { - internalType: "address", - name: "sender", - type: "address", + "internalType": "address", + "name": "sender", + "type": "address" }, { - internalType: "address", - name: "recipient", - type: "address", + "internalType": "address", + "name": "recipient", + "type": "address" }, { - internalType: "uint256", - name: "numOfInitialValidators", - type: "uint256", + "internalType": "uint256", + "name": "initialRotations", + "type": "uint256" }, { - internalType: "uint256", - name: "txSlot", - type: "uint256", + "internalType": "uint256", + "name": "txSlot", + "type": "uint256" }, { - internalType: "uint256", - name: "createdTimestamp", - type: "uint256", + "internalType": "uint256", + "name": "createdTimestamp", + "type": "uint256" }, { - internalType: "uint256", - name: "lastVoteTimestamp", - type: "uint256", + "internalType": "uint256", + "name": "lastVoteTimestamp", + "type": "uint256" }, { - internalType: "bytes32", - name: "randomSeed", - type: "bytes32", + "internalType": "bytes32", + "name": "randomSeed", + "type": "bytes32" }, { - internalType: "enum ITransactions.ResultType", - name: "result", - type: "uint8", + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" }, { - internalType: "bytes", - name: "txData", - type: "bytes", + "internalType": "bytes32", + "name": "txExecutionHash", + "type": "bytes32" }, { - internalType: "bytes", - name: "txReceipt", - type: "bytes", + "internalType": "bytes", + "name": "txCalldata", + "type": "bytes" }, { - components: [ + "internalType": "bytes", + "name": "eqBlocksOutputs", + "type": "bytes" + }, + { + "components": [ { - internalType: "enum IMessages.MessageType", - name: "messageType", - type: "uint8", + "internalType": "enum IMessages.MessageType", + "name": "messageType", + "type": "uint8" }, { - internalType: "address", - name: "recipient", - type: "address", + "internalType": "address", + "name": "recipient", + "type": "address" }, { - internalType: "uint256", - name: "value", - type: "uint256", + "internalType": "uint256", + "name": "value", + "type": "uint256" }, { - internalType: "bytes", - name: "data", - type: "bytes", + "internalType": "bytes", + "name": "data", + "type": "bytes" }, { - internalType: "bool", - name: "onAcceptance", - type: "bool", + "internalType": "bool", + "name": "onAcceptance", + "type": "bool" }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + } ], - internalType: "struct IMessages.SubmittedMessage[]", - name: "messages", - type: "tuple[]", + "internalType": "struct IMessages.SubmittedMessage[]", + "name": "messages", + "type": "tuple[]" }, { - internalType: "enum IQueues.QueueType", - name: "queueType", - type: "uint8", + "internalType": "enum IQueues.QueueType", + "name": "queueType", + "type": "uint8" }, { - internalType: "uint256", - name: "queuePosition", - type: "uint256", + "internalType": "uint256", + "name": "queuePosition", + "type": "uint256" }, { - internalType: "address", - name: "activator", - type: "address", + "internalType": "address", + "name": "activator", + "type": "address" }, { - internalType: "address", - name: "lastLeader", - type: "address", + "internalType": "address", + "name": "lastLeader", + "type": "address" }, { - internalType: "enum ITransactions.TransactionStatus", - name: "status", - type: "uint8", + "internalType": "enum ITransactions.TransactionStatus", + "name": "status", + "type": "uint8" }, { - internalType: "bytes32", - name: "txId", - type: "bytes32", + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" }, { - components: [ + "components": [ { - internalType: "uint256", - name: "activationBlock", - type: "uint256", + "internalType": "uint256", + "name": "activationBlock", + "type": "uint256" }, { - internalType: "uint256", - name: "processingBlock", - type: "uint256", + "internalType": "uint256", + "name": "processingBlock", + "type": "uint256" }, { - internalType: "uint256", - name: "proposalBlock", - type: "uint256", - }, + "internalType": "uint256", + "name": "proposalBlock", + "type": "uint256" + } ], - internalType: "struct ITransactions.ReadStateBlockRange", - name: "readStateBlockRange", - type: "tuple", + "internalType": "struct ITransactions.ReadStateBlockRange", + "name": "readStateBlockRange", + "type": "tuple" }, { - internalType: "uint256", - name: "numOfRounds", - type: "uint256", + "internalType": "uint256", + "name": "numOfRounds", + "type": "uint256" }, { - components: [ + "components": [ { - internalType: "uint256", - name: "round", - type: "uint256", + "internalType": "uint256", + "name": "round", + "type": "uint256" }, { - internalType: "uint256", - name: "leaderIndex", - type: "uint256", + "internalType": "uint256", + "name": "leaderIndex", + "type": "uint256" }, { - internalType: "uint256", - name: "votesCommitted", - type: "uint256", + "internalType": "uint256", + "name": "votesCommitted", + "type": "uint256" }, { - internalType: "uint256", - name: "votesRevealed", - type: "uint256", + "internalType": "uint256", + "name": "votesRevealed", + "type": "uint256" }, { - internalType: "uint256", - name: "appealBond", - type: "uint256", + "internalType": "uint256", + "name": "appealBond", + "type": "uint256" }, { - internalType: "uint256", - name: "rotationsLeft", - type: "uint256", + "internalType": "uint256", + "name": "rotationsLeft", + "type": "uint256" }, { - internalType: "enum ITransactions.ResultType", - name: "result", - type: "uint8", + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" }, { - internalType: "address[]", - name: "roundValidators", - type: "address[]", + "internalType": "address[]", + "name": "roundValidators", + "type": "address[]" }, { - internalType: "bytes32[]", - name: "validatorVotesHash", - type: "bytes32[]", + "internalType": "enum ITransactions.VoteType[]", + "name": "validatorVotes", + "type": "uint8[]" }, { - internalType: "enum ITransactions.VoteType[]", - name: "validatorVotes", - type: "uint8[]", + "internalType": "bytes32[]", + "name": "validatorVotesHash", + "type": "bytes32[]" }, + { + "internalType": "bytes32[]", + "name": "validatorResultHash", + "type": "bytes32[]" + } ], - internalType: "struct ITransactions.RoundData", - name: "lastRound", - type: "tuple", + "internalType": "struct ITransactions.RoundData", + "name": "lastRound", + "type": "tuple" }, + { + "internalType": "address[]", + "name": "consumedValidators", + "type": "address[]" + } ], - internalType: "struct ConsensusData.TransactionData[]", - name: "", - type: "tuple[]", - }, + "internalType": "struct ConsensusData.TransactionData[]", + "name": "", + "type": "tuple[]" + } ], - stateMutability: "view", - type: "function", + "stateMutability": "view", + "type": "function" }, { - inputs: [ + "inputs": [ { - internalType: "address", - name: "recipient", - type: "address", - }, + "internalType": "address", + "name": "recipient", + "type": "address" + } ], - name: "getLatestFinalizedTxCount", - outputs: [ + "name": "getLatestFinalizedTxCount", + "outputs": [ { - internalType: "uint256", - name: "", - type: "uint256", - }, + "internalType": "uint256", + "name": "", + "type": "uint256" + } ], - stateMutability: "view", - type: "function", + "stateMutability": "view", + "type": "function" }, { - inputs: [ + "inputs": [ { - internalType: "address", - name: "recipient", - type: "address", - }, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } ], - name: "getLatestPendingTxCount", - outputs: [ + "name": "getRoleAdmin", + "outputs": [ { - internalType: "uint256", - name: "", - type: "uint256", - }, + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } ], - stateMutability: "view", - type: "function", + "stateMutability": "view", + "type": "function" }, { - inputs: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, + "inputs": [ { - internalType: "uint256", - name: "slot", - type: "uint256", - }, + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } ], - name: "getLatestPendingTxId", - outputs: [ + "name": "getTransactionAllData", + "outputs": [ { - internalType: "bytes32", - name: "", - type: "bytes32", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - ], - name: "getLatestUndeterminedTransaction", - outputs: [ - { - components: [ + "components": [ { - internalType: "uint256", - name: "currentTimestamp", - type: "uint256", + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" }, { - internalType: "address", - name: "sender", - type: "address", + "internalType": "enum ITransactions.VoteType", + "name": "txExecutionResult", + "type": "uint8" }, { - internalType: "address", - name: "recipient", - type: "address", + "internalType": "enum ITransactions.TransactionStatus", + "name": "previousStatus", + "type": "uint8" }, { - internalType: "uint256", - name: "numOfInitialValidators", - type: "uint256", + "internalType": "enum ITransactions.TransactionStatus", + "name": "status", + "type": "uint8" }, { - internalType: "uint256", - name: "txSlot", - type: "uint256", + "internalType": "address", + "name": "txOrigin", + "type": "address" }, { - internalType: "uint256", - name: "createdTimestamp", - type: "uint256", + "internalType": "address", + "name": "sender", + "type": "address" }, { - internalType: "uint256", - name: "lastVoteTimestamp", - type: "uint256", + "internalType": "address", + "name": "recipient", + "type": "address" }, { - internalType: "bytes32", - name: "randomSeed", - type: "bytes32", + "internalType": "address", + "name": "activator", + "type": "address" }, { - internalType: "enum ITransactions.ResultType", - name: "result", - type: "uint8", + "internalType": "uint256", + "name": "txSlot", + "type": "uint256" }, { - internalType: "bytes", - name: "txData", - type: "bytes", + "internalType": "uint256", + "name": "initialRotations", + "type": "uint256" }, { - internalType: "bytes", - name: "txReceipt", - type: "bytes", + "internalType": "uint256", + "name": "numOfInitialValidators", + "type": "uint256" }, { - components: [ - { - internalType: "enum IMessages.MessageType", - name: "messageType", - type: "uint8", - }, - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "value", - type: "uint256", - }, - { - internalType: "bytes", - name: "data", - type: "bytes", - }, - { - internalType: "bool", - name: "onAcceptance", - type: "bool", - }, - ], - internalType: "struct IMessages.SubmittedMessage[]", - name: "messages", - type: "tuple[]", + "internalType": "uint256", + "name": "epoch", + "type": "uint256" }, { - internalType: "enum IQueues.QueueType", - name: "queueType", - type: "uint8", + "internalType": "bytes32", + "name": "id", + "type": "bytes32" }, { - internalType: "uint256", - name: "queuePosition", - type: "uint256", + "internalType": "bytes32", + "name": "randomSeed", + "type": "bytes32" }, { - internalType: "address", - name: "activator", - type: "address", + "internalType": "bytes32", + "name": "txExecutionHash", + "type": "bytes32" }, { - internalType: "address", - name: "lastLeader", - type: "address", + "internalType": "bytes32", + "name": "resultHash", + "type": "bytes32" }, { - internalType: "enum ITransactions.TransactionStatus", - name: "status", - type: "uint8", + "internalType": "bytes", + "name": "txCalldata", + "type": "bytes" }, { - internalType: "bytes32", - name: "txId", - type: "bytes32", + "internalType": "bytes", + "name": "eqBlocksOutputs", + "type": "bytes" }, { - components: [ + "components": [ { - internalType: "uint256", - name: "activationBlock", - type: "uint256", + "internalType": "uint256", + "name": "activationBlock", + "type": "uint256" }, { - internalType: "uint256", - name: "processingBlock", - type: "uint256", + "internalType": "uint256", + "name": "processingBlock", + "type": "uint256" }, { - internalType: "uint256", - name: "proposalBlock", - type: "uint256", - }, + "internalType": "uint256", + "name": "proposalBlock", + "type": "uint256" + } ], - internalType: "struct ITransactions.ReadStateBlockRange", - name: "readStateBlockRange", - type: "tuple", + "internalType": "struct ITransactions.ReadStateBlockRange[]", + "name": "readStateBlockRanges", + "type": "tuple[]" }, { - internalType: "uint256", - name: "numOfRounds", - type: "uint256", + "internalType": "uint256", + "name": "validUntil", + "type": "uint256" }, { - components: [ - { - internalType: "uint256", - name: "round", - type: "uint256", - }, - { - internalType: "uint256", - name: "leaderIndex", - type: "uint256", - }, - { - internalType: "uint256", - name: "votesCommitted", - type: "uint256", - }, - { - internalType: "uint256", - name: "votesRevealed", - type: "uint256", - }, - { - internalType: "uint256", - name: "appealBond", - type: "uint256", - }, - { - internalType: "uint256", - name: "rotationsLeft", - type: "uint256", - }, - { - internalType: "enum ITransactions.ResultType", - name: "result", - type: "uint8", - }, - { - internalType: "address[]", - name: "roundValidators", - type: "address[]", - }, - { - internalType: "bytes32[]", - name: "validatorVotesHash", - type: "bytes32[]", - }, - { - internalType: "enum ITransactions.VoteType[]", - name: "validatorVotes", - type: "uint8[]", - }, - ], - internalType: "struct ITransactions.RoundData", - name: "lastRound", - type: "tuple", - }, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } ], - internalType: "struct ConsensusData.TransactionData", - name: "txData", - type: "tuple", + "internalType": "struct ITransactions.Transaction", + "name": "transaction", + "type": "tuple" }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - ], - name: "getLatestUndeterminedTxCount", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ { - internalType: "bytes32", - name: "_tx_id", - type: "bytes32", - }, - ], - name: "getMessagesForTransaction", - outputs: [ - { - components: [ + "components": [ { - internalType: "enum IMessages.MessageType", - name: "messageType", - type: "uint8", + "internalType": "uint256", + "name": "round", + "type": "uint256" }, { - internalType: "address", - name: "recipient", - type: "address", + "internalType": "uint256", + "name": "leaderIndex", + "type": "uint256" }, { - internalType: "uint256", - name: "value", - type: "uint256", + "internalType": "uint256", + "name": "votesCommitted", + "type": "uint256" }, { - internalType: "bytes", - name: "data", - type: "bytes", + "internalType": "uint256", + "name": "votesRevealed", + "type": "uint256" }, { - internalType: "bool", - name: "onAcceptance", - type: "bool", + "internalType": "uint256", + "name": "appealBond", + "type": "uint256" }, - ], - internalType: "struct IMessages.SubmittedMessage[]", - name: "", - type: "tuple[]", - }, - { - internalType: "address", - name: "ghostAddress", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "_tx_id", - type: "bytes32", - }, - ], - name: "getReadStateBlockRangeForTransaction", - outputs: [ - { - internalType: "uint256", - name: "activationBlock", - type: "uint256", - }, - { - internalType: "uint256", - name: "processingBlock", - type: "uint256", - }, - { - internalType: "uint256", - name: "proposalBlock", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "startIndex", - type: "uint256", - }, - { - internalType: "uint256", - name: "endIndex", - type: "uint256", - }, - ], - name: "getRecipientQueues", - outputs: [ - { - components: [ { - components: [ - { - internalType: "uint256", - name: "head", - type: "uint256", - }, - { - internalType: "uint256", - name: "tail", - type: "uint256", - }, - { - internalType: "bytes32[]", - name: "txIds", - type: "bytes32[]", - }, - ], - internalType: "struct IQueues.QueueInfoView", - name: "pending", - type: "tuple", + "internalType": "uint256", + "name": "rotationsLeft", + "type": "uint256" }, { - components: [ - { - internalType: "uint256", - name: "head", - type: "uint256", - }, - { - internalType: "uint256", - name: "tail", - type: "uint256", - }, - { - internalType: "bytes32[]", - name: "txIds", - type: "bytes32[]", - }, - ], - internalType: "struct IQueues.QueueInfoView", - name: "accepted", - type: "tuple", + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" }, { - components: [ - { - internalType: "uint256", - name: "head", - type: "uint256", - }, - { - internalType: "uint256", - name: "tail", - type: "uint256", - }, - { - internalType: "bytes32[]", - name: "txIds", - type: "bytes32[]", - }, - ], - internalType: "struct IQueues.QueueInfoView", - name: "undetermined", - type: "tuple", + "internalType": "address[]", + "name": "roundValidators", + "type": "address[]" }, { - internalType: "uint256", - name: "finalizedCount", - type: "uint256", + "internalType": "enum ITransactions.VoteType[]", + "name": "validatorVotes", + "type": "uint8[]" }, { - internalType: "uint256", - name: "issuedTxCount", - type: "uint256", + "internalType": "bytes32[]", + "name": "validatorVotesHash", + "type": "bytes32[]" }, + { + "internalType": "bytes32[]", + "name": "validatorResultHash", + "type": "bytes32[]" + } ], - internalType: "struct IQueues.RecipientQueuesView", - name: "", - type: "tuple", - }, + "internalType": "struct ITransactions.RoundData[]", + "name": "roundsData", + "type": "tuple[]" + } ], - stateMutability: "view", - type: "function", + "stateMutability": "view", + "type": "function" }, { - inputs: [ + "inputs": [ { - internalType: "bytes32", - name: "role", - type: "bytes32", + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" }, - ], - name: "getRoleAdmin", - outputs: [ { - internalType: "bytes32", - name: "", - type: "bytes32", - }, + "internalType": "uint256", + "name": "_timestamp", + "type": "uint256" + } ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getTotalNumOfTransactions", - outputs: [ + "name": "getTransactionData", + "outputs": [ { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "_tx_id", - type: "bytes32", - }, - ], - name: "getTransactionAllData", - outputs: [ - { - components: [ + "components": [ { - internalType: "bytes32", - name: "id", - type: "bytes32", + "internalType": "uint256", + "name": "currentTimestamp", + "type": "uint256" }, { - internalType: "address", - name: "sender", - type: "address", + "internalType": "address", + "name": "sender", + "type": "address" }, { - internalType: "address", - name: "recipient", - type: "address", + "internalType": "address", + "name": "recipient", + "type": "address" }, { - internalType: "uint256", - name: "numOfInitialValidators", - type: "uint256", + "internalType": "uint256", + "name": "initialRotations", + "type": "uint256" }, { - internalType: "uint256", - name: "txSlot", - type: "uint256", + "internalType": "uint256", + "name": "txSlot", + "type": "uint256" }, { - internalType: "address", - name: "activator", - type: "address", + "internalType": "uint256", + "name": "createdTimestamp", + "type": "uint256" }, { - internalType: "enum ITransactions.TransactionStatus", - name: "status", - type: "uint8", + "internalType": "uint256", + "name": "lastVoteTimestamp", + "type": "uint256" }, { - internalType: "enum ITransactions.TransactionStatus", - name: "previousStatus", - type: "uint8", + "internalType": "bytes32", + "name": "randomSeed", + "type": "bytes32" }, { - components: [ - { - internalType: "uint256", - name: "created", - type: "uint256", - }, - { - internalType: "uint256", - name: "pending", - type: "uint256", - }, - { - internalType: "uint256", - name: "activated", - type: "uint256", - }, - { - internalType: "uint256", - name: "proposed", - type: "uint256", - }, - { - internalType: "uint256", - name: "committed", - type: "uint256", - }, - { - internalType: "uint256", - name: "lastVote", - type: "uint256", - }, - { - internalType: "uint256", - name: "appealSubmitted", - type: "uint256", - }, - ], - internalType: "struct ITransactions.Timestamps", - name: "timestamps", - type: "tuple", + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" }, { - internalType: "bytes32", - name: "randomSeed", - type: "bytes32", + "internalType": "bytes32", + "name": "txExecutionHash", + "type": "bytes32" }, { - internalType: "bool", - name: "onAcceptanceMessages", - type: "bool", + "internalType": "bytes", + "name": "txCalldata", + "type": "bytes" }, { - internalType: "enum ITransactions.ResultType", - name: "result", - type: "uint8", + "internalType": "bytes", + "name": "eqBlocksOutputs", + "type": "bytes" }, { - components: [ + "components": [ { - internalType: "uint256", - name: "activationBlock", - type: "uint256", + "internalType": "enum IMessages.MessageType", + "name": "messageType", + "type": "uint8" }, { - internalType: "uint256", - name: "processingBlock", - type: "uint256", + "internalType": "address", + "name": "recipient", + "type": "address" }, { - internalType: "uint256", - name: "proposalBlock", - type: "uint256", - }, - ], - internalType: "struct ITransactions.ReadStateBlockRange", - name: "readStateBlockRange", - type: "tuple", - }, - { - internalType: "bytes", - name: "txData", - type: "bytes", - }, - { - internalType: "bytes", - name: "txReceipt", - type: "bytes", - }, - { - components: [ - { - internalType: "enum IMessages.MessageType", - name: "messageType", - type: "uint8", - }, - { - internalType: "address", - name: "recipient", - type: "address", + "internalType": "uint256", + "name": "value", + "type": "uint256" }, { - internalType: "uint256", - name: "value", - type: "uint256", + "internalType": "bytes", + "name": "data", + "type": "bytes" }, { - internalType: "bytes", - name: "data", - type: "bytes", + "internalType": "bool", + "name": "onAcceptance", + "type": "bool" }, { - internalType: "bool", - name: "onAcceptance", - type: "bool", - }, + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + } ], - internalType: "struct IMessages.SubmittedMessage[]", - name: "messages", - type: "tuple[]", + "internalType": "struct IMessages.SubmittedMessage[]", + "name": "messages", + "type": "tuple[]" }, { - internalType: "address[]", - name: "consumedValidators", - type: "address[]", + "internalType": "enum IQueues.QueueType", + "name": "queueType", + "type": "uint8" }, { - components: [ - { - internalType: "uint256", - name: "round", - type: "uint256", - }, - { - internalType: "uint256", - name: "leaderIndex", - type: "uint256", - }, - { - internalType: "uint256", - name: "votesCommitted", - type: "uint256", - }, - { - internalType: "uint256", - name: "votesRevealed", - type: "uint256", - }, - { - internalType: "uint256", - name: "appealBond", - type: "uint256", - }, - { - internalType: "uint256", - name: "rotationsLeft", - type: "uint256", - }, - { - internalType: "enum ITransactions.ResultType", - name: "result", - type: "uint8", - }, - { - internalType: "address[]", - name: "roundValidators", - type: "address[]", - }, - { - internalType: "bytes32[]", - name: "validatorVotesHash", - type: "bytes32[]", - }, - { - internalType: "enum ITransactions.VoteType[]", - name: "validatorVotes", - type: "uint8[]", - }, - ], - internalType: "struct ITransactions.RoundData[]", - name: "roundData", - type: "tuple[]", + "internalType": "uint256", + "name": "queuePosition", + "type": "uint256" }, - ], - internalType: "struct ITransactions.Transaction", - name: "transaction", - type: "tuple", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "_tx_id", - type: "bytes32", - }, - { - internalType: "uint256", - name: "_timestamp", - type: "uint256", - }, - ], - name: "getTransactionData", - outputs: [ - { - components: [ { - internalType: "uint256", - name: "currentTimestamp", - type: "uint256", + "internalType": "address", + "name": "activator", + "type": "address" }, { - internalType: "address", - name: "sender", - type: "address", + "internalType": "address", + "name": "lastLeader", + "type": "address" }, { - internalType: "address", - name: "recipient", - type: "address", + "internalType": "enum ITransactions.TransactionStatus", + "name": "status", + "type": "uint8" }, { - internalType: "uint256", - name: "numOfInitialValidators", - type: "uint256", + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" }, { - internalType: "uint256", - name: "txSlot", - type: "uint256", - }, - { - internalType: "uint256", - name: "createdTimestamp", - type: "uint256", - }, - { - internalType: "uint256", - name: "lastVoteTimestamp", - type: "uint256", - }, - { - internalType: "bytes32", - name: "randomSeed", - type: "bytes32", - }, - { - internalType: "enum ITransactions.ResultType", - name: "result", - type: "uint8", - }, - { - internalType: "bytes", - name: "txData", - type: "bytes", - }, - { - internalType: "bytes", - name: "txReceipt", - type: "bytes", - }, - { - components: [ - { - internalType: "enum IMessages.MessageType", - name: "messageType", - type: "uint8", - }, + "components": [ { - internalType: "address", - name: "recipient", - type: "address", + "internalType": "uint256", + "name": "activationBlock", + "type": "uint256" }, { - internalType: "uint256", - name: "value", - type: "uint256", + "internalType": "uint256", + "name": "processingBlock", + "type": "uint256" }, { - internalType: "bytes", - name: "data", - type: "bytes", - }, - { - internalType: "bool", - name: "onAcceptance", - type: "bool", - }, + "internalType": "uint256", + "name": "proposalBlock", + "type": "uint256" + } ], - internalType: "struct IMessages.SubmittedMessage[]", - name: "messages", - type: "tuple[]", - }, - { - internalType: "enum IQueues.QueueType", - name: "queueType", - type: "uint8", - }, - { - internalType: "uint256", - name: "queuePosition", - type: "uint256", - }, - { - internalType: "address", - name: "activator", - type: "address", + "internalType": "struct ITransactions.ReadStateBlockRange", + "name": "readStateBlockRange", + "type": "tuple" }, { - internalType: "address", - name: "lastLeader", - type: "address", + "internalType": "uint256", + "name": "numOfRounds", + "type": "uint256" }, { - internalType: "enum ITransactions.TransactionStatus", - name: "status", - type: "uint8", - }, - { - internalType: "bytes32", - name: "txId", - type: "bytes32", - }, - { - components: [ + "components": [ { - internalType: "uint256", - name: "activationBlock", - type: "uint256", + "internalType": "uint256", + "name": "round", + "type": "uint256" }, { - internalType: "uint256", - name: "processingBlock", - type: "uint256", + "internalType": "uint256", + "name": "leaderIndex", + "type": "uint256" }, { - internalType: "uint256", - name: "proposalBlock", - type: "uint256", + "internalType": "uint256", + "name": "votesCommitted", + "type": "uint256" }, - ], - internalType: "struct ITransactions.ReadStateBlockRange", - name: "readStateBlockRange", - type: "tuple", - }, - { - internalType: "uint256", - name: "numOfRounds", - type: "uint256", - }, - { - components: [ { - internalType: "uint256", - name: "round", - type: "uint256", + "internalType": "uint256", + "name": "votesRevealed", + "type": "uint256" }, { - internalType: "uint256", - name: "leaderIndex", - type: "uint256", + "internalType": "uint256", + "name": "appealBond", + "type": "uint256" }, { - internalType: "uint256", - name: "votesCommitted", - type: "uint256", + "internalType": "uint256", + "name": "rotationsLeft", + "type": "uint256" }, { - internalType: "uint256", - name: "votesRevealed", - type: "uint256", + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" }, { - internalType: "uint256", - name: "appealBond", - type: "uint256", + "internalType": "address[]", + "name": "roundValidators", + "type": "address[]" }, { - internalType: "uint256", - name: "rotationsLeft", - type: "uint256", + "internalType": "enum ITransactions.VoteType[]", + "name": "validatorVotes", + "type": "uint8[]" }, { - internalType: "enum ITransactions.ResultType", - name: "result", - type: "uint8", + "internalType": "bytes32[]", + "name": "validatorVotesHash", + "type": "bytes32[]" }, { - internalType: "address[]", - name: "roundValidators", - type: "address[]", - }, - { - internalType: "bytes32[]", - name: "validatorVotesHash", - type: "bytes32[]", - }, - { - internalType: "enum ITransactions.VoteType[]", - name: "validatorVotes", - type: "uint8[]", - }, + "internalType": "bytes32[]", + "name": "validatorResultHash", + "type": "bytes32[]" + } ], - internalType: "struct ITransactions.RoundData", - name: "lastRound", - type: "tuple", + "internalType": "struct ITransactions.RoundData", + "name": "lastRound", + "type": "tuple" }, + { + "internalType": "address[]", + "name": "consumedValidators", + "type": "address[]" + } ], - internalType: "struct ConsensusData.TransactionData", - name: "", - type: "tuple", - }, + "internalType": "struct ConsensusData.TransactionData", + "name": "", + "type": "tuple" + } ], - stateMutability: "view", - type: "function", + "stateMutability": "view", + "type": "function" }, { - inputs: [ + "inputs": [ { - internalType: "uint256", - name: "startIndex", - type: "uint256", + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" }, { - internalType: "uint256", - name: "endIndex", - type: "uint256", - }, + "internalType": "uint256", + "name": "_timestamp", + "type": "uint256" + } ], - name: "getTransactionIndexToTxId", - outputs: [ + "name": "getTransactionStatus", + "outputs": [ { - internalType: "bytes32[]", - name: "", - type: "bytes32[]", - }, + "internalType": "enum ITransactions.TransactionStatus", + "name": "", + "type": "uint8" + } ], - stateMutability: "view", - type: "function", + "stateMutability": "view", + "type": "function" }, { - inputs: [ - { - internalType: "bytes32", - name: "_tx_id", - type: "bytes32", - }, + "inputs": [ { - internalType: "uint256", - name: "_timestamp", - type: "uint256", - }, + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } ], - name: "getTransactionStatus", - outputs: [ + "name": "getValidatorsForLastRound", + "outputs": [ { - internalType: "enum ITransactions.TransactionStatus", - name: "", - type: "uint8", - }, + "internalType": "address[]", + "name": "validators", + "type": "address[]" + } ], - stateMutability: "view", - type: "function", + "stateMutability": "view", + "type": "function" }, { - inputs: [ + "inputs": [ { - internalType: "bytes32", - name: "_tx_id", - type: "bytes32", + "internalType": "bytes32", + "name": "role", + "type": "bytes32" }, - ], - name: "getValidatorsForLastAppeal", - outputs: [ { - internalType: "address[]", - name: "", - type: "address[]", - }, + "internalType": "address", + "name": "account", + "type": "address" + } ], - stateMutability: "view", - type: "function", + "name": "grantRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" }, { - inputs: [ + "inputs": [ { - internalType: "bytes32", - name: "_tx_id", - type: "bytes32", + "internalType": "bytes32", + "name": "role", + "type": "bytes32" }, - ], - name: "getValidatorsForLastRound", - outputs: [ { - internalType: "address[]", - name: "", - type: "address[]", - }, + "internalType": "address", + "name": "account", + "type": "address" + } ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "role", - type: "bytes32", - }, + "name": "hasRole", + "outputs": [ { - internalType: "address", - name: "account", - type: "address", - }, + "internalType": "bool", + "name": "", + "type": "bool" + } ], - name: "grantRole", - outputs: [], - stateMutability: "nonpayable", - type: "function", + "stateMutability": "view", + "type": "function" }, { - inputs: [ + "inputs": [ { - internalType: "bytes32", - name: "role", - type: "bytes32", - }, - { - internalType: "address", - name: "account", - type: "address", - }, + "internalType": "address", + "name": "_addressManager", + "type": "address" + } ], - name: "hasRole", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" }, { - inputs: [ - { - internalType: "bytes32", - name: "_tx_id", - type: "bytes32", - }, - ], - name: "hasTransactionOnAcceptanceMessages", - outputs: [ + "inputs": [], + "name": "owner", + "outputs": [ { - internalType: "bool", - name: "", - type: "bool", - }, + "internalType": "address", + "name": "", + "type": "address" + } ], - stateMutability: "view", - type: "function", + "stateMutability": "view", + "type": "function" }, { - inputs: [ + "inputs": [], + "name": "pendingOwner", + "outputs": [ { - internalType: "bytes32", - name: "_tx_id", - type: "bytes32", - }, + "internalType": "address", + "name": "", + "type": "address" + } ], - name: "hasTransactionOnFinalizationMessages", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", + "stateMutability": "view", + "type": "function" }, { - inputs: [ - { - internalType: "address", - name: "_consensusMain", - type: "address", - }, - { - internalType: "address", - name: "_transactions", - type: "address", - }, - { - internalType: "address", - name: "_queues", - type: "address", - }, - ], - name: "initialize", - outputs: [], - stateMutability: "nonpayable", - type: "function", + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" }, { - inputs: [], - name: "owner", - outputs: [ + "inputs": [ { - internalType: "address", - name: "", - type: "address", + "internalType": "bytes32", + "name": "role", + "type": "bytes32" }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "pendingOwner", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "queues", - outputs: [ - { - internalType: "contract IQueues", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "renounceOwnership", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "role", - type: "bytes32", - }, - { - internalType: "address", - name: "callerConfirmation", - type: "address", - }, - ], - name: "renounceRole", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ { - internalType: "bytes32", - name: "role", - type: "bytes32", - }, - { - internalType: "address", - name: "account", - type: "address", - }, + "internalType": "address", + "name": "callerConfirmation", + "type": "address" + } ], - name: "revokeRole", - outputs: [], - stateMutability: "nonpayable", - type: "function", + "name": "renounceRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" }, { - inputs: [ + "inputs": [ { - internalType: "address", - name: "_consensusMain", - type: "address", + "internalType": "bytes32", + "name": "role", + "type": "bytes32" }, - ], - name: "setConsensusMain", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ { - internalType: "address", - name: "_queues", - type: "address", - }, + "internalType": "address", + "name": "account", + "type": "address" + } ], - name: "setQueues", - outputs: [], - stateMutability: "nonpayable", - type: "function", + "name": "revokeRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" }, { - inputs: [ + "inputs": [ { - internalType: "address", - name: "_transactions", - type: "address", - }, + "internalType": "address", + "name": "_addressManager", + "type": "address" + } ], - name: "setTransactions", - outputs: [], - stateMutability: "nonpayable", - type: "function", + "name": "setAddressManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" }, { - inputs: [ + "inputs": [ { - internalType: "bytes4", - name: "interfaceId", - type: "bytes4", - }, + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } ], - name: "supportsInterface", - outputs: [ + "name": "supportsInterface", + "outputs": [ { - internalType: "bool", - name: "", - type: "bool", - }, + "internalType": "bool", + "name": "", + "type": "bool" + } ], - stateMutability: "view", - type: "function", + "stateMutability": "view", + "type": "function" }, { - inputs: [], - name: "transactions", - outputs: [ + "inputs": [ { - internalType: "contract ITransactions", - name: "", - type: "address", - }, + "internalType": "address", + "name": "newOwner", + "type": "address" + } ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "newOwner", - type: "address", - }, - ], - name: "transferOwnership", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } ], bytecode: "", }; diff --git a/src/chains/testnetAsimov.ts b/src/chains/testnetAsimov.ts index 2b1f683..8c2a930 100644 --- a/src/chains/testnetAsimov.ts +++ b/src/chains/testnetAsimov.ts @@ -14,1389 +14,1350 @@ const EXPLORER_URL = "https://explorer-asimov.genlayer.com/"; const CONSENSUS_MAIN_CONTRACT = { address: "0x6CAFF6769d70824745AD895663409DC70aB5B28E" as Address, abi: [ - { - inputs: [], - name: "AccessControlBadConfirmation", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "account", - type: "address", - }, - { - internalType: "bytes32", - name: "neededRole", - type: "bytes32", - }, - ], - name: "AccessControlUnauthorizedAccount", - type: "error", - }, - { - inputs: [], - name: "CallerNotMessages", - type: "error", - }, - { - inputs: [], - name: "CanNotAppeal", - type: "error", - }, - { - inputs: [], - name: "EmptyTransaction", - type: "error", - }, - { - inputs: [], - name: "FinalizationNotAllowed", - type: "error", - }, - { - inputs: [], - name: "InvalidAddress", - type: "error", - }, - { - inputs: [], - name: "InvalidGhostContract", - type: "error", - }, - { - inputs: [], - name: "InvalidInitialization", - type: "error", - }, - { - inputs: [], - name: "InvalidVote", - type: "error", - }, - { - inputs: [], - name: "MaxNumOfIterationsInPendingQueueReached", - type: "error", - }, - { - inputs: [ - { - internalType: "uint256", - name: "numOfMessages", - type: "uint256", - }, - { - internalType: "uint256", - name: "maxAllocatedMessages", - type: "uint256", - }, - ], - name: "MaxNumOfMessagesExceeded", - type: "error", - }, - { - inputs: [], - name: "NonGenVMContract", - type: "error", - }, - { - inputs: [], - name: "NotInitializing", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "owner", - type: "address", - }, - ], - name: "OwnableInvalidOwner", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "account", - type: "address", - }, - ], - name: "OwnableUnauthorizedAccount", - type: "error", - }, - { - inputs: [], - name: "ReentrancyGuardReentrantCall", - type: "error", - }, - { - inputs: [], - name: "TransactionNotAtPendingQueueHead", - type: "error", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "txId", - type: "bytes32", - }, - { - indexed: true, - internalType: "address", - name: "appealer", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "appealBond", - type: "uint256", - }, - { - indexed: false, - internalType: "address[]", - name: "appealValidators", - type: "address[]", - }, - ], - name: "AppealStarted", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "txId", - type: "bytes32", - }, - { - indexed: true, - internalType: "address", - name: "recipient", - type: "address", - }, - { - indexed: false, - internalType: "bytes", - name: "data", - type: "bytes", - }, - ], - name: "ErrorMessage", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "address", - name: "ghostFactory", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "genManager", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "genTransactions", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "genQueue", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "genStaking", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "genMessages", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "idleness", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "tribunalAppeal", - type: "address", - }, - ], - name: "ExternalContractsSet", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint64", - name: "version", - type: "uint64", - }, - ], - name: "Initialized", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "txId", - type: "bytes32", - }, - { - indexed: true, - internalType: "address", - name: "recipient", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "activator", - type: "address", - }, - ], - name: "InternalMessageProcessed", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "txId", - type: "bytes32", - }, - { - indexed: true, - internalType: "address", - name: "recipient", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "activator", - type: "address", - }, - ], - name: "NewTransaction", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "previousOwner", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "newOwner", - type: "address", - }, - ], - name: "OwnershipTransferStarted", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "previousOwner", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "newOwner", - type: "address", - }, - ], - name: "OwnershipTransferred", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "role", - type: "bytes32", - }, - { - indexed: true, - internalType: "bytes32", - name: "previousAdminRole", - type: "bytes32", - }, - { - indexed: true, - internalType: "bytes32", - name: "newAdminRole", - type: "bytes32", - }, - ], - name: "RoleAdminChanged", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "role", - type: "bytes32", - }, - { - indexed: true, - internalType: "address", - name: "account", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "sender", - type: "address", - }, - ], - name: "RoleGranted", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "role", - type: "bytes32", - }, - { - indexed: true, - internalType: "address", - name: "account", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "sender", - type: "address", - }, - ], - name: "RoleRevoked", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "txId", - type: "bytes32", - }, - { - indexed: true, - internalType: "address", - name: "sender", - type: "address", - }, - ], - name: "SlashAppealSubmitted", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "tx_id", - type: "bytes32", - }, - ], - name: "TransactionAccepted", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "txId", - type: "bytes32", - }, - { - indexed: true, - internalType: "address", - name: "leader", - type: "address", - }, - ], - name: "TransactionActivated", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "txId", - type: "bytes32", - }, - { - indexed: true, - internalType: "address", - name: "sender", - type: "address", - }, - ], - name: "TransactionCancelled", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "tx_id", - type: "bytes32", - }, - ], - name: "TransactionFinalized", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "txId", - type: "bytes32", - }, - { - indexed: true, - internalType: "address", - name: "oldValidator", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "newValidator", - type: "address", - }, - ], - name: "TransactionIdleValidatorReplaced", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "txId", - type: "bytes32", - }, - { - indexed: true, - internalType: "uint256", - name: "validatorIndex", - type: "uint256", - }, - ], - name: "TransactionIdleValidatorReplacementFailed", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "txId", - type: "bytes32", - }, - { - indexed: true, - internalType: "address", - name: "newLeader", - type: "address", - }, - ], - name: "TransactionLeaderRotated", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "tx_id", - type: "bytes32", - }, - ], - name: "TransactionLeaderTimeout", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "bytes32[]", - name: "tx_ids", - type: "bytes32[]", - }, - ], - name: "TransactionNeedsRecomputation", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "tx_id", - type: "bytes32", - }, - { - indexed: false, - internalType: "address[]", - name: "validators", - type: "address[]", - }, - ], - name: "TransactionReceiptProposed", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "tx_id", - type: "bytes32", - }, - ], - name: "TransactionUndetermined", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "txId", - type: "bytes32", - }, - { - indexed: true, - internalType: "address", - name: "validator", - type: "address", - }, - { - indexed: false, - internalType: "bool", - name: "isLastVote", - type: "bool", - }, - ], - name: "TribunalAppealVoteCommitted", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "txId", - type: "bytes32", - }, - { - indexed: true, - internalType: "address", - name: "validator", - type: "address", - }, - { - indexed: false, - internalType: "bool", - name: "isLastVote", - type: "bool", - }, - ], - name: "TribunalAppealVoteRevealed", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "txId", - type: "bytes32", - }, - { - indexed: true, - internalType: "address", - name: "validator", - type: "address", - }, - { - indexed: false, - internalType: "bool", - name: "isLastVote", - type: "bool", - }, - ], - name: "VoteCommitted", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "txId", - type: "bytes32", - }, - { - indexed: true, - internalType: "address", - name: "validator", - type: "address", - }, - { - indexed: false, - internalType: "enum ITransactions.VoteType", - name: "voteType", - type: "uint8", - }, - { - indexed: false, - internalType: "bool", - name: "isLastVote", - type: "bool", - }, - { - indexed: false, - internalType: "enum ITransactions.ResultType", - name: "result", - type: "uint8", - }, - ], - name: "VoteRevealed", - type: "event", - }, - { - inputs: [], - name: "DEFAULT_ADMIN_ROLE", - outputs: [ - { - internalType: "bytes32", - name: "", - type: "bytes32", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "acceptOwnership", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "_txId", - type: "bytes32", - }, - { - internalType: "bytes", - name: "_vrfProof", - type: "bytes", - }, - ], - name: "activateTransaction", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "_sender", - type: "address", - }, - { - internalType: "address", - name: "_recipient", - type: "address", - }, - { - internalType: "uint256", - name: "_numOfInitialValidators", - type: "uint256", - }, - { - internalType: "uint256", - name: "_maxRotations", - type: "uint256", - }, - { - internalType: "bytes", - name: "_txData", - type: "bytes", - }, - ], - name: "addTransaction", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "_txId", - type: "bytes32", - }, - ], - name: "cancelTransaction", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "_txId", - type: "bytes32", - }, - { - internalType: "bytes32", - name: "_commitHash", - type: "bytes32", - }, - ], - name: "commitTribunalAppealVote", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "_txId", - type: "bytes32", - }, - { - internalType: "bytes32", - name: "_commitHash", - type: "bytes32", - }, - ], - name: "commitVote", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "contracts", - outputs: [ - { - internalType: "contract IGenManager", - name: "genManager", - type: "address", - }, - { - internalType: "contract ITransactions", - name: "genTransactions", - type: "address", - }, - { - internalType: "contract IQueues", - name: "genQueue", - type: "address", - }, - { - internalType: "contract IGhostFactory", - name: "ghostFactory", - type: "address", - }, - { - internalType: "contract IGenStaking", - name: "genStaking", - type: "address", - }, - { - internalType: "contract IMessages", - name: "genMessages", - type: "address", - }, - { - internalType: "contract IIdleness", - name: "idleness", - type: "address", - }, - { - internalType: "contract ITribunalAppeal", - name: "tribunalAppeal", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "_recipient", - type: "address", - }, - { - internalType: "uint256", - name: "_value", - type: "uint256", - }, - { - internalType: "bytes", - name: "_data", - type: "bytes", - }, - ], - name: "executeMessage", - outputs: [ - { - internalType: "bool", - name: "success", - type: "bool", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "_txId", - type: "bytes32", - }, - ], - name: "finalizeTransaction", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "getContracts", - outputs: [ - { - components: [ - { - internalType: "contract IGenManager", - name: "genManager", - type: "address", - }, - { - internalType: "contract ITransactions", - name: "genTransactions", - type: "address", - }, - { - internalType: "contract IQueues", - name: "genQueue", - type: "address", - }, - { - internalType: "contract IGhostFactory", - name: "ghostFactory", - type: "address", - }, - { - internalType: "contract IGenStaking", - name: "genStaking", - type: "address", - }, - { - internalType: "contract IMessages", - name: "genMessages", - type: "address", - }, - { - internalType: "contract IIdleness", - name: "idleness", - type: "address", - }, - { - internalType: "contract ITribunalAppeal", - name: "tribunalAppeal", - type: "address", - }, - ], - internalType: "struct IConsensusMain.ExternalContracts", - name: "", - type: "tuple", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "role", - type: "bytes32", - }, - ], - name: "getRoleAdmin", - outputs: [ - { - internalType: "bytes32", - name: "", - type: "bytes32", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "addr", - type: "address", - }, - ], - name: "ghostContracts", - outputs: [ - { - internalType: "bool", - name: "isGhost", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "role", - type: "bytes32", - }, - { - internalType: "address", - name: "account", - type: "address", - }, - ], - name: "grantRole", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "role", - type: "bytes32", - }, - { - internalType: "address", - name: "account", - type: "address", - }, - ], - name: "hasRole", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "initialize", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "owner", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "pendingOwner", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - ], - name: "proceedPendingQueueProcessing", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "_txId", - type: "bytes32", - }, - { - internalType: "bytes", - name: "_txReceipt", - type: "bytes", - }, - { - internalType: "uint256", - name: "_processingBlock", - type: "uint256", - }, - { - components: [ - { - internalType: "enum IMessages.MessageType", - name: "messageType", - type: "uint8", - }, - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "value", - type: "uint256", - }, - { - internalType: "bytes", - name: "data", - type: "bytes", - }, - { - internalType: "bool", - name: "onAcceptance", - type: "bool", - }, - ], - internalType: "struct IMessages.SubmittedMessage[]", - name: "_messages", - type: "tuple[]", - }, - { - internalType: "bytes", - name: "_vrfProof", - type: "bytes", - }, - ], - name: "proposeReceipt", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "renounceOwnership", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "role", - type: "bytes32", - }, - { - internalType: "address", - name: "callerConfirmation", - type: "address", - }, - ], - name: "renounceRole", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "_txId", - type: "bytes32", - }, - { - internalType: "bytes32", - name: "_voteHash", - type: "bytes32", - }, - { - internalType: "enum ITribunalAppeal.TribunalVoteType", - name: "_voteType", - type: "uint8", - }, - { - internalType: "uint256", - name: "_nonce", - type: "uint256", - }, - ], - name: "revealTribunalAppealVote", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "_txId", - type: "bytes32", - }, - { - internalType: "bytes32", - name: "_voteHash", - type: "bytes32", - }, - { - internalType: "enum ITransactions.VoteType", - name: "_voteType", - type: "uint8", - }, - { - internalType: "uint256", - name: "_nonce", - type: "uint256", - }, - ], - name: "revealVote", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "role", - type: "bytes32", - }, - { - internalType: "address", - name: "account", - type: "address", - }, - ], - name: "revokeRole", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "_ghostFactory", - type: "address", - }, - { - internalType: "address", - name: "_genManager", - type: "address", - }, - { - internalType: "address", - name: "_genTransactions", - type: "address", - }, - { - internalType: "address", - name: "_genQueue", - type: "address", - }, - { - internalType: "address", - name: "_genStaking", - type: "address", - }, - { - internalType: "address", - name: "_genMessages", - type: "address", - }, - { - internalType: "address", - name: "_idleness", - type: "address", - }, - { - internalType: "address", - name: "_tribunalAppeal", - type: "address", - }, - ], - name: "setExternalContracts", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "_txId", - type: "bytes32", - }, - ], - name: "submitAppeal", - outputs: [], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "_txId", - type: "bytes32", - }, - ], - name: "submitSlashAppeal", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes4", - name: "interfaceId", - type: "bytes4", - }, - ], - name: "supportsInterface", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "newOwner", - type: "address", - }, - ], - name: "transferOwnership", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "CallerNotMessages", + "type": "error" + }, + { + "inputs": [], + "name": "CanNotAppeal", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidDeploymentWithSalt", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidGhostContract", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidRevealLeaderData", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidVote", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnableInvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "OwnableUnauthorizedAccount", + "type": "error" + }, + { + "inputs": [], + "name": "ReentrancyGuardReentrantCall", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "oldActivator", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newActivator", + "type": "address" + } + ], + "name": "ActivatorReplaced", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "addressManager", + "type": "address" + } + ], + "name": "AddressManagerSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "enum ITransactions.TransactionStatus", + "name": "newStatus", + "type": "uint8" + } + ], + "name": "AllVotesCommitted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "appellant", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "bond", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "validators", + "type": "address[]" + } + ], + "name": "AppealStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "attempted", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "succeeded", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "failed", + "type": "uint256" + } + ], + "name": "BatchFinalizationCompleted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "txSlot", + "type": "uint256" + } + ], + "name": "CreatedTransaction", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "activator", + "type": "address" + } + ], + "name": "InternalMessageProcessed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "oldLeader", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newLeader", + "type": "address" + } + ], + "name": "LeaderIdlenessProcessed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "activator", + "type": "address" + } + ], + "name": "NewTransaction", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + } + ], + "name": "ProcessIdlenessAccepted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + } + ], + "name": "TransactionAccepted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "leader", + "type": "address" + } + ], + "name": "TransactionActivated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "cancelledBy", + "type": "address" + } + ], + "name": "TransactionCancelled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + } + ], + "name": "TransactionFinalizationFailed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + } + ], + "name": "TransactionFinalized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + } + ], + "name": "TransactionLeaderRevealed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "newLeader", + "type": "address" + } + ], + "name": "TransactionLeaderRotated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + } + ], + "name": "TransactionLeaderTimeout", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32[]", + "name": "txIds", + "type": "bytes32[]" + } + ], + "name": "TransactionNeedsRecomputation", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "validators", + "type": "address[]" + } + ], + "name": "TransactionReceiptProposed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + } + ], + "name": "TransactionUndetermined", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tribunalIndex", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "validator", + "type": "address" + } + ], + "name": "TribunalAppealVoteCommitted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tribunalIndex", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "validator", + "type": "address" + }, + { + "indexed": false, + "internalType": "enum ITransactions.VoteType", + "name": "voteType", + "type": "uint8" + } + ], + "name": "TribunalAppealVoteRevealed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "oldValidator", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newValidator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "validatorIndex", + "type": "uint256" + } + ], + "name": "ValidatorReplaced", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "ValueWithdrawalFailed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "validator", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isLastVote", + "type": "bool" + } + ], + "name": "VoteCommitted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "validator", + "type": "address" + }, + { + "indexed": false, + "internalType": "enum ITransactions.VoteType", + "name": "voteType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isLastVote", + "type": "bool" + }, + { + "indexed": false, + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + } + ], + "name": "VoteRevealed", + "type": "event" + }, + { + "inputs": [], + "name": "EVENTS_BATCH_SIZE", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "VERSION", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "_operator", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_vrfProof", + "type": "bytes" + } + ], + "name": "activateTransaction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_sender", + "type": "address" + }, + { + "internalType": "address", + "name": "_recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_numOfInitialValidators", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_maxRotations", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_calldata", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "_validUntil", + "type": "uint256" + } + ], + "name": "addTransaction", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "addressManager", + "outputs": [ + { + "internalType": "contract IAddressManager", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } + ], + "name": "cancelTransaction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_tribunalIndex", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "_commitHash", + "type": "bytes32" + } + ], + "name": "commitTribunalAppealVote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_commitHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_validatorIndex", + "type": "uint256" + } + ], + "name": "commitVote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_sender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_numOfInitialValidators", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_maxRotations", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_calldata", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_validUntil", + "type": "uint256" + } + ], + "name": "deploySalted", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "executeMessage", + "outputs": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32[]", + "name": "_txIds", + "type": "bytes32[]" + } + ], + "name": "finalizeIdlenessTxs", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } + ], + "name": "finalizeTransaction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } + ], + "name": "flushExternalMessages", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getAddressManager", + "outputs": [ + { + "internalType": "contract IAddressManager", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + } + ], + "name": "getPendingTransactionValue", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_addressManager", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "isGhostContract", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } + ], + "name": "leaderIdleness", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "saltAsAValidator", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "txExecutionHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "messagesAndOtherFieldsHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "otherExecutionFieldsHash", + "type": "bytes32" + }, + { + "internalType": "enum ITransactions.VoteType", + "name": "resultValue", + "type": "uint8" + }, + { + "components": [ + { + "internalType": "enum IMessages.MessageType", + "name": "messageType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bool", + "name": "onAcceptance", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + } + ], + "internalType": "struct IMessages.SubmittedMessage[]", + "name": "messages", + "type": "tuple[]" + } + ], + "internalType": "struct IConsensusMain.LeaderRevealVoteParams", + "name": "leaderRevealVoteParams", + "type": "tuple" + } + ], + "name": "leaderRevealVote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } + ], + "name": "processIdleness", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_txExecutionHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_processingBlock", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_operator", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_eqBlocksOutputs", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "_vrfProof", + "type": "bytes" + } + ], + "name": "proposeReceipt", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32[]", + "name": "_txIds", + "type": "bytes32[]" + } + ], + "name": "redButtonFinalize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "ghost", + "type": "address" + } + ], + "name": "registerGhostContract", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_tribunalIndex", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "_voteHash", + "type": "bytes32" + }, + { + "internalType": "enum ITransactions.VoteType", + "name": "_voteType", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "_otherExecutionFieldsHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_nonce", + "type": "uint256" + } + ], + "name": "revealTribunalAppealVote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_voteHash", + "type": "bytes32" + }, + { + "internalType": "enum ITransactions.VoteType", + "name": "_voteType", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "_otherExecutionFieldsHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_validatorIndex", + "type": "uint256" + } + ], + "name": "revealVote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_addressManager", + "type": "address" + } + ], + "name": "setAddressManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } + ], + "name": "submitAppeal", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } ], bytecode: "", }; @@ -1404,2581 +1365,1966 @@ const CONSENSUS_MAIN_CONTRACT = { const CONSENSUS_DATA_CONTRACT = { address: "0x0D9d1d74d72Fa5eB94bcf746C8FCcb312a722c9B" as Address, abi: [ - { - inputs: [], - name: "AccessControlBadConfirmation", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "account", - type: "address", - }, - { - internalType: "bytes32", - name: "neededRole", - type: "bytes32", - }, - ], - name: "AccessControlUnauthorizedAccount", - type: "error", - }, - { - inputs: [], - name: "InvalidInitialization", - type: "error", - }, - { - inputs: [], - name: "NotInitializing", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "owner", - type: "address", - }, - ], - name: "OwnableInvalidOwner", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "account", - type: "address", - }, - ], - name: "OwnableUnauthorizedAccount", - type: "error", - }, - { - inputs: [], - name: "ReentrancyGuardReentrantCall", - type: "error", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint64", - name: "version", - type: "uint64", - }, - ], - name: "Initialized", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "previousOwner", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "newOwner", - type: "address", - }, - ], - name: "OwnershipTransferStarted", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "previousOwner", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "newOwner", - type: "address", - }, - ], - name: "OwnershipTransferred", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "role", - type: "bytes32", - }, - { - indexed: true, - internalType: "bytes32", - name: "previousAdminRole", - type: "bytes32", - }, - { - indexed: true, - internalType: "bytes32", - name: "newAdminRole", - type: "bytes32", - }, - ], - name: "RoleAdminChanged", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "role", - type: "bytes32", - }, - { - indexed: true, - internalType: "address", - name: "account", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "sender", - type: "address", - }, - ], - name: "RoleGranted", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "role", - type: "bytes32", - }, - { - indexed: true, - internalType: "address", - name: "account", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "sender", - type: "address", - }, - ], - name: "RoleRevoked", - type: "event", - }, - { - inputs: [], - name: "DEFAULT_ADMIN_ROLE", - outputs: [ - { - internalType: "bytes32", - name: "", - type: "bytes32", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "acceptOwnership", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "_txId", - type: "bytes32", - }, - { - internalType: "uint256", - name: "_currentTimestamp", - type: "uint256", - }, - ], - name: "canFinalize", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - { - internalType: "uint256", - name: "", - type: "uint256", - }, - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "consensusMain", - outputs: [ - { - internalType: "contract IConsensusMain", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "_tx_id", - type: "bytes32", - }, - ], - name: "getLastAppealResult", - outputs: [ - { - internalType: "enum ITransactions.ResultType", - name: "", - type: "uint8", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - ], - name: "getLatestAcceptedTransaction", - outputs: [ - { - components: [ - { - internalType: "uint256", - name: "currentTimestamp", - type: "uint256", - }, - { - internalType: "address", - name: "sender", - type: "address", - }, - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "numOfInitialValidators", - type: "uint256", - }, - { - internalType: "uint256", - name: "txSlot", - type: "uint256", - }, - { - internalType: "uint256", - name: "createdTimestamp", - type: "uint256", - }, - { - internalType: "uint256", - name: "lastVoteTimestamp", - type: "uint256", - }, - { - internalType: "bytes32", - name: "randomSeed", - type: "bytes32", - }, - { - internalType: "enum ITransactions.ResultType", - name: "result", - type: "uint8", - }, - { - internalType: "bytes", - name: "txData", - type: "bytes", - }, - { - internalType: "bytes", - name: "txReceipt", - type: "bytes", - }, - { - components: [ - { - internalType: "enum IMessages.MessageType", - name: "messageType", - type: "uint8", - }, - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "value", - type: "uint256", - }, - { - internalType: "bytes", - name: "data", - type: "bytes", - }, - { - internalType: "bool", - name: "onAcceptance", - type: "bool", - }, - ], - internalType: "struct IMessages.SubmittedMessage[]", - name: "messages", - type: "tuple[]", - }, - { - internalType: "enum IQueues.QueueType", - name: "queueType", - type: "uint8", - }, - { - internalType: "uint256", - name: "queuePosition", - type: "uint256", - }, - { - internalType: "address", - name: "activator", - type: "address", - }, - { - internalType: "address", - name: "lastLeader", - type: "address", - }, - { - internalType: "enum ITransactions.TransactionStatus", - name: "status", - type: "uint8", - }, - { - internalType: "bytes32", - name: "txId", - type: "bytes32", - }, - { - components: [ - { - internalType: "uint256", - name: "activationBlock", - type: "uint256", - }, - { - internalType: "uint256", - name: "processingBlock", - type: "uint256", - }, - { - internalType: "uint256", - name: "proposalBlock", - type: "uint256", - }, - ], - internalType: "struct ITransactions.ReadStateBlockRange", - name: "readStateBlockRange", - type: "tuple", - }, - { - internalType: "uint256", - name: "numOfRounds", - type: "uint256", - }, - { - components: [ - { - internalType: "uint256", - name: "round", - type: "uint256", - }, - { - internalType: "uint256", - name: "leaderIndex", - type: "uint256", - }, - { - internalType: "uint256", - name: "votesCommitted", - type: "uint256", - }, - { - internalType: "uint256", - name: "votesRevealed", - type: "uint256", - }, - { - internalType: "uint256", - name: "appealBond", - type: "uint256", - }, - { - internalType: "uint256", - name: "rotationsLeft", - type: "uint256", - }, - { - internalType: "enum ITransactions.ResultType", - name: "result", - type: "uint8", - }, - { - internalType: "address[]", - name: "roundValidators", - type: "address[]", - }, - { - internalType: "bytes32[]", - name: "validatorVotesHash", - type: "bytes32[]", - }, - { - internalType: "enum ITransactions.VoteType[]", - name: "validatorVotes", - type: "uint8[]", - }, - ], - internalType: "struct ITransactions.RoundData", - name: "lastRound", - type: "tuple", - }, - ], - internalType: "struct ConsensusData.TransactionData", - name: "txData", - type: "tuple", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "startIndex", - type: "uint256", - }, - { - internalType: "uint256", - name: "pageSize", - type: "uint256", - }, - ], - name: "getLatestAcceptedTransactions", - outputs: [ - { - components: [ - { - internalType: "uint256", - name: "currentTimestamp", - type: "uint256", - }, - { - internalType: "address", - name: "sender", - type: "address", - }, - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "numOfInitialValidators", - type: "uint256", - }, - { - internalType: "uint256", - name: "txSlot", - type: "uint256", - }, - { - internalType: "uint256", - name: "createdTimestamp", - type: "uint256", - }, - { - internalType: "uint256", - name: "lastVoteTimestamp", - type: "uint256", - }, - { - internalType: "bytes32", - name: "randomSeed", - type: "bytes32", - }, - { - internalType: "enum ITransactions.ResultType", - name: "result", - type: "uint8", - }, - { - internalType: "bytes", - name: "txData", - type: "bytes", - }, - { - internalType: "bytes", - name: "txReceipt", - type: "bytes", - }, - { - components: [ - { - internalType: "enum IMessages.MessageType", - name: "messageType", - type: "uint8", - }, - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "value", - type: "uint256", - }, - { - internalType: "bytes", - name: "data", - type: "bytes", - }, - { - internalType: "bool", - name: "onAcceptance", - type: "bool", - }, - ], - internalType: "struct IMessages.SubmittedMessage[]", - name: "messages", - type: "tuple[]", - }, - { - internalType: "enum IQueues.QueueType", - name: "queueType", - type: "uint8", - }, - { - internalType: "uint256", - name: "queuePosition", - type: "uint256", - }, - { - internalType: "address", - name: "activator", - type: "address", - }, - { - internalType: "address", - name: "lastLeader", - type: "address", - }, - { - internalType: "enum ITransactions.TransactionStatus", - name: "status", - type: "uint8", - }, - { - internalType: "bytes32", - name: "txId", - type: "bytes32", - }, - { - components: [ - { - internalType: "uint256", - name: "activationBlock", - type: "uint256", - }, - { - internalType: "uint256", - name: "processingBlock", - type: "uint256", - }, - { - internalType: "uint256", - name: "proposalBlock", - type: "uint256", - }, - ], - internalType: "struct ITransactions.ReadStateBlockRange", - name: "readStateBlockRange", - type: "tuple", - }, - { - internalType: "uint256", - name: "numOfRounds", - type: "uint256", - }, - { - components: [ - { - internalType: "uint256", - name: "round", - type: "uint256", - }, - { - internalType: "uint256", - name: "leaderIndex", - type: "uint256", - }, - { - internalType: "uint256", - name: "votesCommitted", - type: "uint256", - }, - { - internalType: "uint256", - name: "votesRevealed", - type: "uint256", - }, - { - internalType: "uint256", - name: "appealBond", - type: "uint256", - }, - { - internalType: "uint256", - name: "rotationsLeft", - type: "uint256", - }, - { - internalType: "enum ITransactions.ResultType", - name: "result", - type: "uint8", - }, - { - internalType: "address[]", - name: "roundValidators", - type: "address[]", - }, - { - internalType: "bytes32[]", - name: "validatorVotesHash", - type: "bytes32[]", - }, - { - internalType: "enum ITransactions.VoteType[]", - name: "validatorVotes", - type: "uint8[]", - }, - ], - internalType: "struct ITransactions.RoundData", - name: "lastRound", - type: "tuple", - }, - ], - internalType: "struct ConsensusData.TransactionData[]", - name: "", - type: "tuple[]", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - ], - name: "getLatestAcceptedTxCount", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - ], - name: "getLatestFinalizedTransaction", - outputs: [ - { - components: [ - { - internalType: "uint256", - name: "currentTimestamp", - type: "uint256", - }, - { - internalType: "address", - name: "sender", - type: "address", - }, - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "numOfInitialValidators", - type: "uint256", - }, - { - internalType: "uint256", - name: "txSlot", - type: "uint256", - }, - { - internalType: "uint256", - name: "createdTimestamp", - type: "uint256", - }, - { - internalType: "uint256", - name: "lastVoteTimestamp", - type: "uint256", - }, - { - internalType: "bytes32", - name: "randomSeed", - type: "bytes32", - }, - { - internalType: "enum ITransactions.ResultType", - name: "result", - type: "uint8", - }, - { - internalType: "bytes", - name: "txData", - type: "bytes", - }, - { - internalType: "bytes", - name: "txReceipt", - type: "bytes", - }, - { - components: [ - { - internalType: "enum IMessages.MessageType", - name: "messageType", - type: "uint8", - }, - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "value", - type: "uint256", - }, - { - internalType: "bytes", - name: "data", - type: "bytes", - }, - { - internalType: "bool", - name: "onAcceptance", - type: "bool", - }, - ], - internalType: "struct IMessages.SubmittedMessage[]", - name: "messages", - type: "tuple[]", - }, - { - internalType: "enum IQueues.QueueType", - name: "queueType", - type: "uint8", - }, - { - internalType: "uint256", - name: "queuePosition", - type: "uint256", - }, - { - internalType: "address", - name: "activator", - type: "address", - }, - { - internalType: "address", - name: "lastLeader", - type: "address", - }, - { - internalType: "enum ITransactions.TransactionStatus", - name: "status", - type: "uint8", - }, - { - internalType: "bytes32", - name: "txId", - type: "bytes32", - }, - { - components: [ - { - internalType: "uint256", - name: "activationBlock", - type: "uint256", - }, - { - internalType: "uint256", - name: "processingBlock", - type: "uint256", - }, - { - internalType: "uint256", - name: "proposalBlock", - type: "uint256", - }, - ], - internalType: "struct ITransactions.ReadStateBlockRange", - name: "readStateBlockRange", - type: "tuple", - }, - { - internalType: "uint256", - name: "numOfRounds", - type: "uint256", - }, - { - components: [ - { - internalType: "uint256", - name: "round", - type: "uint256", - }, - { - internalType: "uint256", - name: "leaderIndex", - type: "uint256", - }, - { - internalType: "uint256", - name: "votesCommitted", - type: "uint256", - }, - { - internalType: "uint256", - name: "votesRevealed", - type: "uint256", - }, - { - internalType: "uint256", - name: "appealBond", - type: "uint256", - }, - { - internalType: "uint256", - name: "rotationsLeft", - type: "uint256", - }, - { - internalType: "enum ITransactions.ResultType", - name: "result", - type: "uint8", - }, - { - internalType: "address[]", - name: "roundValidators", - type: "address[]", - }, - { - internalType: "bytes32[]", - name: "validatorVotesHash", - type: "bytes32[]", - }, - { - internalType: "enum ITransactions.VoteType[]", - name: "validatorVotes", - type: "uint8[]", - }, - ], - internalType: "struct ITransactions.RoundData", - name: "lastRound", - type: "tuple", - }, - ], - internalType: "struct ConsensusData.TransactionData", - name: "txData", - type: "tuple", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "startIndex", - type: "uint256", - }, - { - internalType: "uint256", - name: "pageSize", - type: "uint256", - }, - ], - name: "getLatestFinalizedTransactions", - outputs: [ - { - components: [ - { - internalType: "uint256", - name: "currentTimestamp", - type: "uint256", - }, - { - internalType: "address", - name: "sender", - type: "address", - }, - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "numOfInitialValidators", - type: "uint256", - }, - { - internalType: "uint256", - name: "txSlot", - type: "uint256", - }, - { - internalType: "uint256", - name: "createdTimestamp", - type: "uint256", - }, - { - internalType: "uint256", - name: "lastVoteTimestamp", - type: "uint256", - }, - { - internalType: "bytes32", - name: "randomSeed", - type: "bytes32", - }, - { - internalType: "enum ITransactions.ResultType", - name: "result", - type: "uint8", - }, - { - internalType: "bytes", - name: "txData", - type: "bytes", - }, - { - internalType: "bytes", - name: "txReceipt", - type: "bytes", - }, - { - components: [ - { - internalType: "enum IMessages.MessageType", - name: "messageType", - type: "uint8", - }, - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "value", - type: "uint256", - }, - { - internalType: "bytes", - name: "data", - type: "bytes", - }, - { - internalType: "bool", - name: "onAcceptance", - type: "bool", - }, - ], - internalType: "struct IMessages.SubmittedMessage[]", - name: "messages", - type: "tuple[]", - }, - { - internalType: "enum IQueues.QueueType", - name: "queueType", - type: "uint8", - }, - { - internalType: "uint256", - name: "queuePosition", - type: "uint256", - }, - { - internalType: "address", - name: "activator", - type: "address", - }, - { - internalType: "address", - name: "lastLeader", - type: "address", - }, - { - internalType: "enum ITransactions.TransactionStatus", - name: "status", - type: "uint8", - }, - { - internalType: "bytes32", - name: "txId", - type: "bytes32", - }, - { - components: [ - { - internalType: "uint256", - name: "activationBlock", - type: "uint256", - }, - { - internalType: "uint256", - name: "processingBlock", - type: "uint256", - }, - { - internalType: "uint256", - name: "proposalBlock", - type: "uint256", - }, - ], - internalType: "struct ITransactions.ReadStateBlockRange", - name: "readStateBlockRange", - type: "tuple", - }, - { - internalType: "uint256", - name: "numOfRounds", - type: "uint256", - }, - { - components: [ - { - internalType: "uint256", - name: "round", - type: "uint256", - }, - { - internalType: "uint256", - name: "leaderIndex", - type: "uint256", - }, - { - internalType: "uint256", - name: "votesCommitted", - type: "uint256", - }, - { - internalType: "uint256", - name: "votesRevealed", - type: "uint256", - }, - { - internalType: "uint256", - name: "appealBond", - type: "uint256", - }, - { - internalType: "uint256", - name: "rotationsLeft", - type: "uint256", - }, - { - internalType: "enum ITransactions.ResultType", - name: "result", - type: "uint8", - }, - { - internalType: "address[]", - name: "roundValidators", - type: "address[]", - }, - { - internalType: "bytes32[]", - name: "validatorVotesHash", - type: "bytes32[]", - }, - { - internalType: "enum ITransactions.VoteType[]", - name: "validatorVotes", - type: "uint8[]", - }, - ], - internalType: "struct ITransactions.RoundData", - name: "lastRound", - type: "tuple", - }, - ], - internalType: "struct ConsensusData.TransactionData[]", - name: "", - type: "tuple[]", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - ], - name: "getLatestFinalizedTxCount", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - ], - name: "getLatestPendingTxCount", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "slot", - type: "uint256", - }, - ], - name: "getLatestPendingTxId", - outputs: [ - { - internalType: "bytes32", - name: "", - type: "bytes32", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - ], - name: "getLatestUndeterminedTransaction", - outputs: [ - { - components: [ - { - internalType: "uint256", - name: "currentTimestamp", - type: "uint256", - }, - { - internalType: "address", - name: "sender", - type: "address", - }, - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "numOfInitialValidators", - type: "uint256", - }, - { - internalType: "uint256", - name: "txSlot", - type: "uint256", - }, - { - internalType: "uint256", - name: "createdTimestamp", - type: "uint256", - }, - { - internalType: "uint256", - name: "lastVoteTimestamp", - type: "uint256", - }, - { - internalType: "bytes32", - name: "randomSeed", - type: "bytes32", - }, - { - internalType: "enum ITransactions.ResultType", - name: "result", - type: "uint8", - }, - { - internalType: "bytes", - name: "txData", - type: "bytes", - }, - { - internalType: "bytes", - name: "txReceipt", - type: "bytes", - }, - { - components: [ - { - internalType: "enum IMessages.MessageType", - name: "messageType", - type: "uint8", - }, - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "value", - type: "uint256", - }, - { - internalType: "bytes", - name: "data", - type: "bytes", - }, - { - internalType: "bool", - name: "onAcceptance", - type: "bool", - }, - ], - internalType: "struct IMessages.SubmittedMessage[]", - name: "messages", - type: "tuple[]", - }, - { - internalType: "enum IQueues.QueueType", - name: "queueType", - type: "uint8", - }, - { - internalType: "uint256", - name: "queuePosition", - type: "uint256", - }, - { - internalType: "address", - name: "activator", - type: "address", - }, - { - internalType: "address", - name: "lastLeader", - type: "address", - }, - { - internalType: "enum ITransactions.TransactionStatus", - name: "status", - type: "uint8", - }, - { - internalType: "bytes32", - name: "txId", - type: "bytes32", - }, - { - components: [ - { - internalType: "uint256", - name: "activationBlock", - type: "uint256", - }, - { - internalType: "uint256", - name: "processingBlock", - type: "uint256", - }, - { - internalType: "uint256", - name: "proposalBlock", - type: "uint256", - }, - ], - internalType: "struct ITransactions.ReadStateBlockRange", - name: "readStateBlockRange", - type: "tuple", - }, - { - internalType: "uint256", - name: "numOfRounds", - type: "uint256", - }, - { - components: [ - { - internalType: "uint256", - name: "round", - type: "uint256", - }, - { - internalType: "uint256", - name: "leaderIndex", - type: "uint256", - }, - { - internalType: "uint256", - name: "votesCommitted", - type: "uint256", - }, - { - internalType: "uint256", - name: "votesRevealed", - type: "uint256", - }, - { - internalType: "uint256", - name: "appealBond", - type: "uint256", - }, - { - internalType: "uint256", - name: "rotationsLeft", - type: "uint256", - }, - { - internalType: "enum ITransactions.ResultType", - name: "result", - type: "uint8", - }, - { - internalType: "address[]", - name: "roundValidators", - type: "address[]", - }, - { - internalType: "bytes32[]", - name: "validatorVotesHash", - type: "bytes32[]", - }, - { - internalType: "enum ITransactions.VoteType[]", - name: "validatorVotes", - type: "uint8[]", - }, - ], - internalType: "struct ITransactions.RoundData", - name: "lastRound", - type: "tuple", - }, - ], - internalType: "struct ConsensusData.TransactionData", - name: "txData", - type: "tuple", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - ], - name: "getLatestUndeterminedTxCount", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "_tx_id", - type: "bytes32", - }, - ], - name: "getMessagesForTransaction", - outputs: [ - { - components: [ - { - internalType: "enum IMessages.MessageType", - name: "messageType", - type: "uint8", - }, - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "value", - type: "uint256", - }, - { - internalType: "bytes", - name: "data", - type: "bytes", - }, - { - internalType: "bool", - name: "onAcceptance", - type: "bool", - }, - ], - internalType: "struct IMessages.SubmittedMessage[]", - name: "", - type: "tuple[]", - }, - { - internalType: "address", - name: "ghostAddress", - type: "address", - }, - { - internalType: "uint256", - name: "numOfMessagesIssuedOnAcceptance", - type: "uint256", - }, - { - internalType: "uint256", - name: "numOfMessagesIssuedOnFinalization", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "_tx_id", - type: "bytes32", - }, - ], - name: "getReadStateBlockRangeForTransaction", - outputs: [ - { - internalType: "uint256", - name: "activationBlock", - type: "uint256", - }, - { - internalType: "uint256", - name: "processingBlock", - type: "uint256", - }, - { - internalType: "uint256", - name: "proposalBlock", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "startIndex", - type: "uint256", - }, - { - internalType: "uint256", - name: "endIndex", - type: "uint256", - }, - ], - name: "getRecipientQueues", - outputs: [ - { - components: [ - { - components: [ - { - internalType: "uint256", - name: "head", - type: "uint256", - }, - { - internalType: "uint256", - name: "tail", - type: "uint256", - }, - { - internalType: "bytes32[]", - name: "txIds", - type: "bytes32[]", - }, - ], - internalType: "struct IQueues.QueueInfoView", - name: "pending", - type: "tuple", - }, - { - components: [ - { - internalType: "uint256", - name: "head", - type: "uint256", - }, - { - internalType: "uint256", - name: "tail", - type: "uint256", - }, - { - internalType: "bytes32[]", - name: "txIds", - type: "bytes32[]", - }, - ], - internalType: "struct IQueues.QueueInfoView", - name: "accepted", - type: "tuple", - }, - { - components: [ - { - internalType: "uint256", - name: "head", - type: "uint256", - }, - { - internalType: "uint256", - name: "tail", - type: "uint256", - }, - { - internalType: "bytes32[]", - name: "txIds", - type: "bytes32[]", - }, - ], - internalType: "struct IQueues.QueueInfoView", - name: "undetermined", - type: "tuple", - }, - { - internalType: "uint256", - name: "finalizedCount", - type: "uint256", - }, - { - internalType: "uint256", - name: "issuedTxCount", - type: "uint256", - }, - ], - internalType: "struct IQueues.RecipientQueuesView", - name: "", - type: "tuple", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "role", - type: "bytes32", - }, - ], - name: "getRoleAdmin", - outputs: [ - { - internalType: "bytes32", - name: "", - type: "bytes32", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getTotalNumOfTransactions", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "_tx_id", - type: "bytes32", - }, - ], - name: "getTransactionAllData", - outputs: [ - { - components: [ - { - internalType: "bytes32", - name: "id", - type: "bytes32", - }, - { - internalType: "address", - name: "sender", - type: "address", - }, - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "numOfInitialValidators", - type: "uint256", - }, - { - internalType: "uint256", - name: "txSlot", - type: "uint256", - }, - { - internalType: "address", - name: "activator", - type: "address", - }, - { - internalType: "enum ITransactions.TransactionStatus", - name: "status", - type: "uint8", - }, - { - internalType: "enum ITransactions.TransactionStatus", - name: "previousStatus", - type: "uint8", - }, - { - components: [ - { - internalType: "uint256", - name: "created", - type: "uint256", - }, - { - internalType: "uint256", - name: "pending", - type: "uint256", - }, - { - internalType: "uint256", - name: "activated", - type: "uint256", - }, - { - internalType: "uint256", - name: "proposed", - type: "uint256", - }, - { - internalType: "uint256", - name: "committed", - type: "uint256", - }, - { - internalType: "uint256", - name: "lastVote", - type: "uint256", - }, - { - internalType: "uint256", - name: "appealSubmitted", - type: "uint256", - }, - ], - internalType: "struct ITransactions.Timestamps", - name: "timestamps", - type: "tuple", - }, - { - internalType: "bytes32", - name: "randomSeed", - type: "bytes32", - }, - { - internalType: "bool", - name: "onAcceptanceMessages", - type: "bool", - }, - { - internalType: "enum ITransactions.ResultType", - name: "result", - type: "uint8", - }, - { - components: [ - { - internalType: "uint256", - name: "activationBlock", - type: "uint256", - }, - { - internalType: "uint256", - name: "processingBlock", - type: "uint256", - }, - { - internalType: "uint256", - name: "proposalBlock", - type: "uint256", - }, - ], - internalType: "struct ITransactions.ReadStateBlockRange", - name: "readStateBlockRange", - type: "tuple", - }, - { - internalType: "bytes", - name: "txData", - type: "bytes", - }, - { - internalType: "bytes", - name: "txReceipt", - type: "bytes", - }, - { - components: [ - { - internalType: "enum IMessages.MessageType", - name: "messageType", - type: "uint8", - }, - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "value", - type: "uint256", - }, - { - internalType: "bytes", - name: "data", - type: "bytes", - }, - { - internalType: "bool", - name: "onAcceptance", - type: "bool", - }, - ], - internalType: "struct IMessages.SubmittedMessage[]", - name: "messages", - type: "tuple[]", - }, - { - internalType: "address[]", - name: "consumedValidators", - type: "address[]", - }, - { - components: [ - { - internalType: "uint256", - name: "round", - type: "uint256", - }, - { - internalType: "uint256", - name: "leaderIndex", - type: "uint256", - }, - { - internalType: "uint256", - name: "votesCommitted", - type: "uint256", - }, - { - internalType: "uint256", - name: "votesRevealed", - type: "uint256", - }, - { - internalType: "uint256", - name: "appealBond", - type: "uint256", - }, - { - internalType: "uint256", - name: "rotationsLeft", - type: "uint256", - }, - { - internalType: "enum ITransactions.ResultType", - name: "result", - type: "uint8", - }, - { - internalType: "address[]", - name: "roundValidators", - type: "address[]", - }, - { - internalType: "bytes32[]", - name: "validatorVotesHash", - type: "bytes32[]", - }, - { - internalType: "enum ITransactions.VoteType[]", - name: "validatorVotes", - type: "uint8[]", - }, - ], - internalType: "struct ITransactions.RoundData[]", - name: "roundData", - type: "tuple[]", - }, - { - internalType: "uint256", - name: "numOfMessagesIssuedOnAcceptance", - type: "uint256", - }, - { - internalType: "uint256", - name: "numOfMessagesIssuedOnFinalization", - type: "uint256", - }, - { - internalType: "address", - name: "txOrigin", - type: "address", - }, - { - internalType: "uint256", - name: "initialRotations", - type: "uint256", - }, - ], - internalType: "struct ITransactions.Transaction", - name: "transaction", - type: "tuple", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "_tx_id", - type: "bytes32", - }, - { - internalType: "uint256", - name: "_timestamp", - type: "uint256", - }, - ], - name: "getTransactionData", - outputs: [ - { - components: [ - { - internalType: "uint256", - name: "currentTimestamp", - type: "uint256", - }, - { - internalType: "address", - name: "sender", - type: "address", - }, - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "numOfInitialValidators", - type: "uint256", - }, - { - internalType: "uint256", - name: "txSlot", - type: "uint256", - }, - { - internalType: "uint256", - name: "createdTimestamp", - type: "uint256", - }, - { - internalType: "uint256", - name: "lastVoteTimestamp", - type: "uint256", - }, - { - internalType: "bytes32", - name: "randomSeed", - type: "bytes32", - }, - { - internalType: "enum ITransactions.ResultType", - name: "result", - type: "uint8", - }, - { - internalType: "bytes", - name: "txData", - type: "bytes", - }, - { - internalType: "bytes", - name: "txReceipt", - type: "bytes", - }, - { - components: [ - { - internalType: "enum IMessages.MessageType", - name: "messageType", - type: "uint8", - }, - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "value", - type: "uint256", - }, - { - internalType: "bytes", - name: "data", - type: "bytes", - }, - { - internalType: "bool", - name: "onAcceptance", - type: "bool", - }, - ], - internalType: "struct IMessages.SubmittedMessage[]", - name: "messages", - type: "tuple[]", - }, - { - internalType: "enum IQueues.QueueType", - name: "queueType", - type: "uint8", - }, - { - internalType: "uint256", - name: "queuePosition", - type: "uint256", - }, - { - internalType: "address", - name: "activator", - type: "address", - }, - { - internalType: "address", - name: "lastLeader", - type: "address", - }, - { - internalType: "enum ITransactions.TransactionStatus", - name: "status", - type: "uint8", - }, - { - internalType: "bytes32", - name: "txId", - type: "bytes32", - }, - { - components: [ - { - internalType: "uint256", - name: "activationBlock", - type: "uint256", - }, - { - internalType: "uint256", - name: "processingBlock", - type: "uint256", - }, - { - internalType: "uint256", - name: "proposalBlock", - type: "uint256", - }, - ], - internalType: "struct ITransactions.ReadStateBlockRange", - name: "readStateBlockRange", - type: "tuple", - }, - { - internalType: "uint256", - name: "numOfRounds", - type: "uint256", - }, - { - components: [ - { - internalType: "uint256", - name: "round", - type: "uint256", - }, - { - internalType: "uint256", - name: "leaderIndex", - type: "uint256", - }, - { - internalType: "uint256", - name: "votesCommitted", - type: "uint256", - }, - { - internalType: "uint256", - name: "votesRevealed", - type: "uint256", - }, - { - internalType: "uint256", - name: "appealBond", - type: "uint256", - }, - { - internalType: "uint256", - name: "rotationsLeft", - type: "uint256", - }, - { - internalType: "enum ITransactions.ResultType", - name: "result", - type: "uint8", - }, - { - internalType: "address[]", - name: "roundValidators", - type: "address[]", - }, - { - internalType: "bytes32[]", - name: "validatorVotesHash", - type: "bytes32[]", - }, - { - internalType: "enum ITransactions.VoteType[]", - name: "validatorVotes", - type: "uint8[]", - }, - ], - internalType: "struct ITransactions.RoundData", - name: "lastRound", - type: "tuple", - }, - ], - internalType: "struct ConsensusData.TransactionData", - name: "", - type: "tuple", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "startIndex", - type: "uint256", - }, - { - internalType: "uint256", - name: "endIndex", - type: "uint256", - }, - ], - name: "getTransactionIndexToTxId", - outputs: [ - { - internalType: "bytes32[]", - name: "", - type: "bytes32[]", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "_tx_id", - type: "bytes32", - }, - { - internalType: "uint256", - name: "_timestamp", - type: "uint256", - }, - ], - name: "getTransactionStatus", - outputs: [ - { - internalType: "enum ITransactions.TransactionStatus", - name: "", - type: "uint8", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "_tx_id", - type: "bytes32", - }, - ], - name: "getValidatorsForLastAppeal", - outputs: [ - { - internalType: "address[]", - name: "", - type: "address[]", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "_tx_id", - type: "bytes32", - }, - ], - name: "getValidatorsForLastRound", - outputs: [ - { - internalType: "address[]", - name: "", - type: "address[]", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "role", - type: "bytes32", - }, - { - internalType: "address", - name: "account", - type: "address", - }, - ], - name: "grantRole", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "role", - type: "bytes32", - }, - { - internalType: "address", - name: "account", - type: "address", - }, - ], - name: "hasRole", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "_tx_id", - type: "bytes32", - }, - ], - name: "hasTransactionOnAcceptanceMessages", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "_tx_id", - type: "bytes32", - }, - ], - name: "hasTransactionOnFinalizationMessages", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "_consensusMain", - type: "address", - }, - { - internalType: "address", - name: "_transactions", - type: "address", - }, - { - internalType: "address", - name: "_queues", - type: "address", - }, - ], - name: "initialize", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "owner", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "pendingOwner", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "queues", - outputs: [ - { - internalType: "contract IQueues", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "renounceOwnership", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "role", - type: "bytes32", - }, - { - internalType: "address", - name: "callerConfirmation", - type: "address", - }, - ], - name: "renounceRole", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "role", - type: "bytes32", - }, - { - internalType: "address", - name: "account", - type: "address", - }, - ], - name: "revokeRole", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "_consensusMain", - type: "address", - }, - ], - name: "setConsensusMain", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "_queues", - type: "address", - }, - ], - name: "setQueues", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "_transactions", - type: "address", - }, - ], - name: "setTransactions", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes4", - name: "interfaceId", - type: "bytes4", - }, - ], - name: "supportsInterface", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "transactions", - outputs: [ - { - internalType: "contract ITransactions", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "newOwner", - type: "address", - }, - ], - name: "transferOwnership", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, + { + "inputs": [], + "name": "AccessControlBadConfirmation", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "neededRole", + "type": "bytes32" + } + ], + "name": "AccessControlUnauthorizedAccount", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnableInvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "OwnableUnauthorizedAccount", + "type": "error" + }, + { + "inputs": [], + "name": "ReentrancyGuardReentrantCall", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "previousAdminRole", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "newAdminRole", + "type": "bytes32" + } + ], + "name": "RoleAdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleRevoked", + "type": "event" + }, + { + "inputs": [], + "name": "DEFAULT_ADMIN_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "addressManager", + "outputs": [ + { + "internalType": "contract IAddressManager", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_currentTimestamp", + "type": "uint256" + } + ], + "name": "canFinalize", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "getLatestAcceptedTransaction", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "currentTimestamp", + "type": "uint256" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "initialRotations", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "txSlot", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "createdTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastVoteTimestamp", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "randomSeed", + "type": "bytes32" + }, + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "txExecutionHash", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "txCalldata", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "eqBlocksOutputs", + "type": "bytes" + }, + { + "components": [ + { + "internalType": "enum IMessages.MessageType", + "name": "messageType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bool", + "name": "onAcceptance", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + } + ], + "internalType": "struct IMessages.SubmittedMessage[]", + "name": "messages", + "type": "tuple[]" + }, + { + "internalType": "enum IQueues.QueueType", + "name": "queueType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "queuePosition", + "type": "uint256" + }, + { + "internalType": "address", + "name": "activator", + "type": "address" + }, + { + "internalType": "address", + "name": "lastLeader", + "type": "address" + }, + { + "internalType": "enum ITransactions.TransactionStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "activationBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "processingBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "proposalBlock", + "type": "uint256" + } + ], + "internalType": "struct ITransactions.ReadStateBlockRange", + "name": "readStateBlockRange", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "numOfRounds", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "round", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "leaderIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votesCommitted", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votesRevealed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "appealBond", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rotationsLeft", + "type": "uint256" + }, + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "address[]", + "name": "roundValidators", + "type": "address[]" + }, + { + "internalType": "enum ITransactions.VoteType[]", + "name": "validatorVotes", + "type": "uint8[]" + }, + { + "internalType": "bytes32[]", + "name": "validatorVotesHash", + "type": "bytes32[]" + }, + { + "internalType": "bytes32[]", + "name": "validatorResultHash", + "type": "bytes32[]" + } + ], + "internalType": "struct ITransactions.RoundData", + "name": "lastRound", + "type": "tuple" + }, + { + "internalType": "address[]", + "name": "consumedValidators", + "type": "address[]" + } + ], + "internalType": "struct ConsensusData.TransactionData", + "name": "inputData", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "startIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pageSize", + "type": "uint256" + } + ], + "name": "getLatestAcceptedTransactions", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "currentTimestamp", + "type": "uint256" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "initialRotations", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "txSlot", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "createdTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastVoteTimestamp", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "randomSeed", + "type": "bytes32" + }, + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "txExecutionHash", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "txCalldata", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "eqBlocksOutputs", + "type": "bytes" + }, + { + "components": [ + { + "internalType": "enum IMessages.MessageType", + "name": "messageType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bool", + "name": "onAcceptance", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + } + ], + "internalType": "struct IMessages.SubmittedMessage[]", + "name": "messages", + "type": "tuple[]" + }, + { + "internalType": "enum IQueues.QueueType", + "name": "queueType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "queuePosition", + "type": "uint256" + }, + { + "internalType": "address", + "name": "activator", + "type": "address" + }, + { + "internalType": "address", + "name": "lastLeader", + "type": "address" + }, + { + "internalType": "enum ITransactions.TransactionStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "activationBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "processingBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "proposalBlock", + "type": "uint256" + } + ], + "internalType": "struct ITransactions.ReadStateBlockRange", + "name": "readStateBlockRange", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "numOfRounds", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "round", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "leaderIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votesCommitted", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votesRevealed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "appealBond", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rotationsLeft", + "type": "uint256" + }, + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "address[]", + "name": "roundValidators", + "type": "address[]" + }, + { + "internalType": "enum ITransactions.VoteType[]", + "name": "validatorVotes", + "type": "uint8[]" + }, + { + "internalType": "bytes32[]", + "name": "validatorVotesHash", + "type": "bytes32[]" + }, + { + "internalType": "bytes32[]", + "name": "validatorResultHash", + "type": "bytes32[]" + } + ], + "internalType": "struct ITransactions.RoundData", + "name": "lastRound", + "type": "tuple" + }, + { + "internalType": "address[]", + "name": "consumedValidators", + "type": "address[]" + } + ], + "internalType": "struct ConsensusData.TransactionData[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "getLatestAcceptedTxCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "getLatestFinalizedTransaction", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "currentTimestamp", + "type": "uint256" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "initialRotations", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "txSlot", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "createdTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastVoteTimestamp", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "randomSeed", + "type": "bytes32" + }, + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "txExecutionHash", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "txCalldata", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "eqBlocksOutputs", + "type": "bytes" + }, + { + "components": [ + { + "internalType": "enum IMessages.MessageType", + "name": "messageType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bool", + "name": "onAcceptance", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + } + ], + "internalType": "struct IMessages.SubmittedMessage[]", + "name": "messages", + "type": "tuple[]" + }, + { + "internalType": "enum IQueues.QueueType", + "name": "queueType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "queuePosition", + "type": "uint256" + }, + { + "internalType": "address", + "name": "activator", + "type": "address" + }, + { + "internalType": "address", + "name": "lastLeader", + "type": "address" + }, + { + "internalType": "enum ITransactions.TransactionStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "activationBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "processingBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "proposalBlock", + "type": "uint256" + } + ], + "internalType": "struct ITransactions.ReadStateBlockRange", + "name": "readStateBlockRange", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "numOfRounds", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "round", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "leaderIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votesCommitted", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votesRevealed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "appealBond", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rotationsLeft", + "type": "uint256" + }, + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "address[]", + "name": "roundValidators", + "type": "address[]" + }, + { + "internalType": "enum ITransactions.VoteType[]", + "name": "validatorVotes", + "type": "uint8[]" + }, + { + "internalType": "bytes32[]", + "name": "validatorVotesHash", + "type": "bytes32[]" + }, + { + "internalType": "bytes32[]", + "name": "validatorResultHash", + "type": "bytes32[]" + } + ], + "internalType": "struct ITransactions.RoundData", + "name": "lastRound", + "type": "tuple" + }, + { + "internalType": "address[]", + "name": "consumedValidators", + "type": "address[]" + } + ], + "internalType": "struct ConsensusData.TransactionData", + "name": "inputData", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "startIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pageSize", + "type": "uint256" + } + ], + "name": "getLatestFinalizedTransactions", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "currentTimestamp", + "type": "uint256" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "initialRotations", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "txSlot", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "createdTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastVoteTimestamp", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "randomSeed", + "type": "bytes32" + }, + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "txExecutionHash", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "txCalldata", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "eqBlocksOutputs", + "type": "bytes" + }, + { + "components": [ + { + "internalType": "enum IMessages.MessageType", + "name": "messageType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bool", + "name": "onAcceptance", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + } + ], + "internalType": "struct IMessages.SubmittedMessage[]", + "name": "messages", + "type": "tuple[]" + }, + { + "internalType": "enum IQueues.QueueType", + "name": "queueType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "queuePosition", + "type": "uint256" + }, + { + "internalType": "address", + "name": "activator", + "type": "address" + }, + { + "internalType": "address", + "name": "lastLeader", + "type": "address" + }, + { + "internalType": "enum ITransactions.TransactionStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "activationBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "processingBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "proposalBlock", + "type": "uint256" + } + ], + "internalType": "struct ITransactions.ReadStateBlockRange", + "name": "readStateBlockRange", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "numOfRounds", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "round", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "leaderIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votesCommitted", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votesRevealed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "appealBond", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rotationsLeft", + "type": "uint256" + }, + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "address[]", + "name": "roundValidators", + "type": "address[]" + }, + { + "internalType": "enum ITransactions.VoteType[]", + "name": "validatorVotes", + "type": "uint8[]" + }, + { + "internalType": "bytes32[]", + "name": "validatorVotesHash", + "type": "bytes32[]" + }, + { + "internalType": "bytes32[]", + "name": "validatorResultHash", + "type": "bytes32[]" + } + ], + "internalType": "struct ITransactions.RoundData", + "name": "lastRound", + "type": "tuple" + }, + { + "internalType": "address[]", + "name": "consumedValidators", + "type": "address[]" + } + ], + "internalType": "struct ConsensusData.TransactionData[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "getLatestFinalizedTxCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleAdmin", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } + ], + "name": "getTransactionAllData", + "outputs": [ + { + "components": [ + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "enum ITransactions.VoteType", + "name": "txExecutionResult", + "type": "uint8" + }, + { + "internalType": "enum ITransactions.TransactionStatus", + "name": "previousStatus", + "type": "uint8" + }, + { + "internalType": "enum ITransactions.TransactionStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "address", + "name": "txOrigin", + "type": "address" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "address", + "name": "activator", + "type": "address" + }, + { + "internalType": "uint256", + "name": "txSlot", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "initialRotations", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "numOfInitialValidators", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "epoch", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "randomSeed", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "txExecutionHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "resultHash", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "txCalldata", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "eqBlocksOutputs", + "type": "bytes" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "activationBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "processingBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "proposalBlock", + "type": "uint256" + } + ], + "internalType": "struct ITransactions.ReadStateBlockRange[]", + "name": "readStateBlockRanges", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "validUntil", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "internalType": "struct ITransactions.Transaction", + "name": "transaction", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "round", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "leaderIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votesCommitted", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votesRevealed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "appealBond", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rotationsLeft", + "type": "uint256" + }, + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "address[]", + "name": "roundValidators", + "type": "address[]" + }, + { + "internalType": "enum ITransactions.VoteType[]", + "name": "validatorVotes", + "type": "uint8[]" + }, + { + "internalType": "bytes32[]", + "name": "validatorVotesHash", + "type": "bytes32[]" + }, + { + "internalType": "bytes32[]", + "name": "validatorResultHash", + "type": "bytes32[]" + } + ], + "internalType": "struct ITransactions.RoundData[]", + "name": "roundsData", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_timestamp", + "type": "uint256" + } + ], + "name": "getTransactionData", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "currentTimestamp", + "type": "uint256" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "initialRotations", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "txSlot", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "createdTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastVoteTimestamp", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "randomSeed", + "type": "bytes32" + }, + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "txExecutionHash", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "txCalldata", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "eqBlocksOutputs", + "type": "bytes" + }, + { + "components": [ + { + "internalType": "enum IMessages.MessageType", + "name": "messageType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bool", + "name": "onAcceptance", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + } + ], + "internalType": "struct IMessages.SubmittedMessage[]", + "name": "messages", + "type": "tuple[]" + }, + { + "internalType": "enum IQueues.QueueType", + "name": "queueType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "queuePosition", + "type": "uint256" + }, + { + "internalType": "address", + "name": "activator", + "type": "address" + }, + { + "internalType": "address", + "name": "lastLeader", + "type": "address" + }, + { + "internalType": "enum ITransactions.TransactionStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "activationBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "processingBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "proposalBlock", + "type": "uint256" + } + ], + "internalType": "struct ITransactions.ReadStateBlockRange", + "name": "readStateBlockRange", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "numOfRounds", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "round", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "leaderIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votesCommitted", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votesRevealed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "appealBond", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rotationsLeft", + "type": "uint256" + }, + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "address[]", + "name": "roundValidators", + "type": "address[]" + }, + { + "internalType": "enum ITransactions.VoteType[]", + "name": "validatorVotes", + "type": "uint8[]" + }, + { + "internalType": "bytes32[]", + "name": "validatorVotesHash", + "type": "bytes32[]" + }, + { + "internalType": "bytes32[]", + "name": "validatorResultHash", + "type": "bytes32[]" + } + ], + "internalType": "struct ITransactions.RoundData", + "name": "lastRound", + "type": "tuple" + }, + { + "internalType": "address[]", + "name": "consumedValidators", + "type": "address[]" + } + ], + "internalType": "struct ConsensusData.TransactionData", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_timestamp", + "type": "uint256" + } + ], + "name": "getTransactionStatus", + "outputs": [ + { + "internalType": "enum ITransactions.TransactionStatus", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } + ], + "name": "getValidatorsForLastRound", + "outputs": [ + { + "internalType": "address[]", + "name": "validators", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "grantRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "hasRole", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_addressManager", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "callerConfirmation", + "type": "address" + } + ], + "name": "renounceRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "revokeRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_addressManager", + "type": "address" + } + ], + "name": "setAddressManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } ], bytecode: "", }; diff --git a/src/client/client.ts b/src/client/client.ts index 6afb3df..4259ff3 100644 --- a/src/client/client.ts +++ b/src/client/client.ts @@ -15,6 +15,7 @@ import {contractActions} from "../contracts/actions"; import {receiptActions, transactionActions} from "../transactions/actions"; import {walletActions as genlayerWalletActions} from "../wallet/actions"; import {stakingActions} from "../staking/actions"; +import {subscriptionActions} from "@/subscriptions/actions"; import {GenLayerClient, GenLayerChain} from "@/types"; import {chainActions} from "@/chains/actions"; import {localnet} from "@/chains"; @@ -24,11 +25,12 @@ interface ClientConfig { chain?: { id: number; name: string; - rpcUrls: {default: {http: readonly string[]}}; + rpcUrls: {default: {http: readonly string[]; webSocket?: readonly string[]}}; nativeCurrency: {name: string; symbol: string; decimals: number}; blockExplorers?: {default: {name: string; url: string}}; }; - endpoint?: string; // Custom RPC endpoint + endpoint?: string; // Custom HTTP RPC endpoint + webSocketEndpoint?: string; // Custom WebSocket RPC endpoint for event subscriptions account?: Account | Address; provider?: EthereumProvider; // Custom provider for wallet framework integration } @@ -82,10 +84,19 @@ const getCustomTransportConfig = (config: ClientConfig, chainConfig: GenLayerCha }; export const createClient = (config: ClientConfig = {chain: localnet}): GenLayerClient => { - const chainConfig = config.chain || localnet; - if (config.endpoint) { - chainConfig.rpcUrls.default.http = [config.endpoint]; - } + const baseChain = config.chain || localnet; + // Clone to avoid mutating the shared chain config singleton + const chainConfig = { + ...baseChain, + rpcUrls: { + ...baseChain.rpcUrls, + default: { + ...baseChain.rpcUrls.default, + ...(config.endpoint ? {http: [config.endpoint]} : {}), + ...(config.webSocketEndpoint ? {webSocket: [config.webSocketEndpoint]} : {}), + }, + }, + }; const customTransport = custom(getCustomTransportConfig(config, chainConfig as GenLayerChain), {retryCount: 0, retryDelay: 0}); const publicClient = createPublicClient(chainConfig as GenLayerChain, customTransport).extend( @@ -120,11 +131,16 @@ export const createClient = (config: ClientConfig = {chain: localnet}): GenLayer ...receiptActions(clientWithAllActions as unknown as GenLayerClient, publicClient), } as unknown as GenLayerClient; - const finalClient = { + const clientWithStakingActions = { ...clientWithReceiptActions, ...stakingActions(clientWithReceiptActions as unknown as GenLayerClient, publicClient), } as unknown as GenLayerClient; + const finalClient = { + ...clientWithStakingActions, + ...subscriptionActions(clientWithStakingActions), + } as unknown as GenLayerClient; + return finalClient; }; diff --git a/src/contracts/actions.ts b/src/contracts/actions.ts index c504d79..2d48be4 100644 --- a/src/contracts/actions.ts +++ b/src/contracts/actions.ts @@ -9,8 +9,10 @@ import { CalldataEncodable, Address, TransactionHashVariant, + GenCallResult, + GenCallStatusCode, } from "@/types"; -import {fromHex, toHex, zeroAddress, encodeFunctionData, PublicClient, parseEventLogs} from "viem"; +import {fromHex, toHex, zeroAddress, encodeFunctionData, PublicClient, parseEventLogs, TransactionReceipt} from "viem"; import {toJsonSafeDeep, b64ToArray} from "@/utils/jsonifier"; export const contractActions = (client: GenLayerClient, publicClient: PublicClient) => { @@ -172,7 +174,7 @@ export const contractActions = (client: GenLayerClient, publicCli data: serializedData, consensusMaxRotations, }); - return _sendTransaction({ + const result = await _sendTransaction({ client, publicClient, encodedData: primaryEncodedData, @@ -180,6 +182,22 @@ export const contractActions = (client: GenLayerClient, publicCli senderAccount, value, }); + + if ("hash" in result) { + return result.hash; + } + + const newTxEvents = parseEventLogs({ + abi: client.chain.consensusMainContract?.abi as any, + eventName: "NewTransaction", + logs: result.receipt.logs, + }) as unknown as {args: {txId: `0x${string}`}}[]; + + if (newTxEvents.length === 0) { + throw new Error("Transaction not processed by consensus"); + } + + return newTxEvents[0].args["txId"]; }, deployContract: async (args: { account?: Account; @@ -212,13 +230,29 @@ export const contractActions = (client: GenLayerClient, publicCli data: serializedData, consensusMaxRotations, }); - return _sendTransaction({ + const result = await _sendTransaction({ client, publicClient, encodedData: primaryEncodedData, fallbackEncodedData, senderAccount, }); + + if ("hash" in result) { + return result.hash; + } + + const newTxEvents = parseEventLogs({ + abi: client.chain.consensusMainContract?.abi as any, + eventName: "NewTransaction", + logs: result.receipt.logs, + }) as unknown as {args: {txId: `0x${string}`}}[]; + + if (newTxEvents.length === 0) { + throw new Error("Transaction not processed by consensus"); + } + + return newTxEvents[0].args["txId"]; }, appealTransaction: async (args: { account?: Account; @@ -227,12 +261,137 @@ export const contractActions = (client: GenLayerClient, publicCli const {account, txId} = args; const senderAccount = account || client.account; const encodedData = _encodeSubmitAppealData({client, txId}); - return _sendTransaction({ + const result = await _sendTransaction({ client, publicClient, encodedData, senderAccount, }); + + if ("hash" in result) { + return result.hash; + } + + return result.receipt.transactionHash; + }, + + /** + * Low-level gen_call RPC method for transaction simulation. + * + * Use this for direct control over simulation parameters, including: + * - Transaction type (read, write, deploy) + * - Leader/validator mode via leader_results parameter + * - Raw transaction data (already RLP-encoded) + * + * For higher-level contract interactions, use readContract, writeContract, + * or simulateWriteContract instead. + * + * @param args.type - Transaction type: "read", "write", or "deploy" + * @param args.to - Target contract address + * @param args.from - Sender address (optional, uses client account if not provided) + * @param args.data - RLP-encoded transaction data + * @param args.leaderResults - Array of hex-encoded eq_outputs from leader for validator simulation. + * Each entry is a hex string (e.g. "00d102"). If provided, simulates as validator; + * if null/undefined, simulates as leader. + * @param args.value - Value to send with the transaction (optional) + * @param args.gas - Gas limit for the transaction (optional) + * @param args.blockNumber - Block number to simulate at (optional, defaults to latest) + * @param args.status - State status: "accepted" or "finalized" (optional, defaults to "accepted") + * @returns GenCallResult with execution data, status, stdout, stderr, logs, events, and messages + */ + genCall: async (args: { + type: "read" | "write" | "deploy"; + to: Address; + from?: Address; + data: `0x${string}`; + leaderResults?: string[] | null; + value?: bigint; + gas?: bigint; + blockNumber?: string; + status?: "accepted" | "finalized"; + }): Promise => { + const { + type, + to, + from, + data, + leaderResults, + value, + gas, + blockNumber, + status, + } = args; + + const senderAddress = from ?? client.account?.address ?? zeroAddress; + + const requestParams: Record = { + type, + to, + from: senderAddress, + data, + }; + + // Optional parameters + if (blockNumber !== undefined) { + requestParams.blockNumber = blockNumber; + } + if (status !== undefined) { + requestParams.status = status; + } + if (value !== undefined) { + requestParams.value = `0x${value.toString(16)}`; + } + if (gas !== undefined) { + requestParams.gas = `0x${gas.toString(16)}`; + } + + // If leaderResults provided, pass as leader_results for validator simulation (snake_case) + if (leaderResults !== undefined && leaderResults !== null) { + requestParams.leader_results = leaderResults; + } + + const response = await client.request({ + method: "gen_call", + params: [requestParams], + }); + + // Response format: { data, eqOutputs, status: { code, message }, stdout, stderr, logs, events, messages } + const resp = response as { + data?: string; + eqOutputs?: string[]; + status?: {code: number; message: string}; + stdout?: string; + stderr?: string; + logs?: unknown[]; + events?: Array<{topics: string[]; data: string}>; + messages?: Array<{ + messageType: number; + recipient: string; + value: string; + data: string; + onAcceptance: boolean; + saltNonce: string; + }>; + }; + + // Add 0x prefix to data if not present + const dataStr = resp.data ?? ""; + const prefixedData = dataStr.startsWith("0x") ? dataStr as `0x${string}` : `0x${dataStr}` as `0x${string}`; + + if (!resp.status) { + console.warn("[genlayer-js] genCall response missing status field, defaulting to INTERNAL_ERROR"); + } + + return { + data: prefixedData, + eqOutputs: resp.eqOutputs ?? [], + status: resp.status ?? {code: GenCallStatusCode.INTERNAL_ERROR, message: "missing status from RPC response"}, + stdout: resp.stdout ?? "", + stderr: resp.stderr ?? "", + logs: resp.logs ?? [], + events: resp.events ?? [], + messages: resp.messages ?? [], + }; }, }; }; @@ -246,78 +405,31 @@ const validateAccount = (Account?: Account): Account => { return Account; }; -const ADD_TRANSACTION_ABI_V5 = [ - { - type: "function", - name: "addTransaction", - stateMutability: "nonpayable", - inputs: [ - {name: "_sender", type: "address"}, - {name: "_recipient", type: "address"}, - {name: "_numOfInitialValidators", type: "uint256"}, - {name: "_maxRotations", type: "uint256"}, - {name: "_txData", type: "bytes"}, - ], - outputs: [], - }, -] as const; - -const ADD_TRANSACTION_ABI_V6 = [ - { - type: "function", - name: "addTransaction", - stateMutability: "nonpayable", - inputs: [ - {name: "_sender", type: "address"}, - {name: "_recipient", type: "address"}, - {name: "_numOfInitialValidators", type: "uint256"}, - {name: "_maxRotations", type: "uint256"}, - {name: "_txData", type: "bytes"}, - {name: "_validUntil", type: "uint256"}, - ], - outputs: [], - }, -] as const; - -const getAddTransactionInputCount = (abi: readonly unknown[] | undefined): number => { - if (!abi || !Array.isArray(abi)) { - return 0; - } - - const addTransactionFunction = abi.find(item => { - if (!item || typeof item !== "object") { - return false; - } - - const candidate = item as {type?: string; name?: string}; - return candidate.type === "function" && candidate.name === "addTransaction"; - }) as {inputs?: readonly unknown[]} | undefined; - - return Array.isArray(addTransactionFunction?.inputs) ? addTransactionFunction.inputs.length : 0; -}; - const _encodeAddTransactionData = ({ client, senderAccount, recipient, data, consensusMaxRotations = client.chain.defaultConsensusMaxRotations, + validUntil = 0n, // 0 means no expiration }: { client: GenLayerClient; senderAccount?: Account; recipient?: `0x${string}`; data?: `0x${string}`; consensusMaxRotations?: number; + validUntil?: bigint; }): {primaryEncodedData: `0x${string}`; fallbackEncodedData: `0x${string}`} => { const validatedSenderAccount = validateAccount(senderAccount); - const addTransactionArgs: [ - Address, - `0x${string}` | undefined, - number, - number | undefined, - `0x${string}` | undefined, - ] = [ + // Detect if ABI has the WithFees variant (7 params including FeesDistribution tuple) + const abi = client.chain.consensusMainContract?.abi as any[]; + const addTxEntry = abi?.find( + (e: any) => e.type === "function" && e.name === "addTransaction", + ); + const hasFees = addTxEntry?.inputs?.length === 7; + + const args: unknown[] = [ validatedSenderAccount.address, recipient, client.chain.defaultNumberOfInitialValidators, @@ -325,28 +437,30 @@ const _encodeAddTransactionData = ({ data, ]; - const encodedDataV5 = encodeFunctionData({ - abi: ADD_TRANSACTION_ABI_V5 as any, - functionName: "addTransaction", - args: addTransactionArgs, - }); + if (hasFees) { + // Insert default FeesDistribution struct with zero values + args.push({ + leaderTimeoutFee: 0n, + validatorsTimeoutFee: 0n, + appealRounds: 0n, + rollupStorageFee: 0n, + rollupGenVMFee: 0n, + totalMessageFees: 0n, + rotations: [], + }); + } + + args.push(validUntil); - const encodedDataV6 = encodeFunctionData({ - abi: ADD_TRANSACTION_ABI_V6 as any, + const encoded = encodeFunctionData({ + abi: client.chain.consensusMainContract?.abi as any, functionName: "addTransaction", - args: [...addTransactionArgs, 0n], + args, }); - if (getAddTransactionInputCount(client.chain.consensusMainContract?.abi) >= 6) { - return { - primaryEncodedData: encodedDataV6, - fallbackEncodedData: encodedDataV5, - }; - } - return { - primaryEncodedData: encodedDataV5, - fallbackEncodedData: encodedDataV6, + primaryEncodedData: encoded, + fallbackEncodedData: encoded, }; }; @@ -418,7 +532,7 @@ const _sendTransaction = async ({ fallbackEncodedData?: `0x${string}`; senderAccount?: Account; value?: bigint; -}) => { +}): Promise<{receipt: TransactionReceipt} | {hash: `0x${string}`}> => { if (!client.chain.consensusMainContract?.address) { throw new Error("Consensus main contract not initialized. Please ensure client is properly initialized."); } @@ -439,6 +553,8 @@ const _sendTransaction = async ({ console.error("Gas estimation failed, using default 200_000:", err); estimatedGas = 200_000n; } + // Add 50% buffer to gas estimate to account for estimation inaccuracies + estimatedGas = (estimatedGas * 150n) / 100n; // For local accounts, build transaction request directly to avoid viem's // prepareTransactionRequest which calls eth_fillTransaction (unsupported by GenLayer RPC) @@ -471,17 +587,7 @@ const _sendTransaction = async ({ throw new Error("Transaction reverted"); } - const newTxEvents = parseEventLogs({ - abi: client.chain.consensusMainContract?.abi as any, - eventName: "NewTransaction", - logs: receipt.logs, - }) as unknown as {args: {txId: `0x${string}`}}[]; - - if (newTxEvents.length === 0) { - throw new Error("Transaction not processed by consensus"); - } - - return newTxEvents[0].args["txId"]; + return {receipt}; } // For injected/external wallets (e.g. MetaMask), avoid viem's @@ -518,10 +624,12 @@ const _sendTransaction = async ({ ...(gasPriceHex ? {gasPrice: gasPriceHex} : {}), }; - return await client.request({ - method: "eth_sendTransaction", - params: [formattedRequest as any], - }); + return { + hash: (await client.request({ + method: "eth_sendTransaction", + params: [formattedRequest as any], + })) as `0x${string}`, + }; }; try { @@ -533,3 +641,4 @@ const _sendTransaction = async ({ return await sendWithEncodedData(fallbackEncodedData); } }; + diff --git a/src/subscriptions/actions.ts b/src/subscriptions/actions.ts new file mode 100644 index 0000000..3b437bc --- /dev/null +++ b/src/subscriptions/actions.ts @@ -0,0 +1,248 @@ +import { + createPublicClient, + webSocket, + Log, + decodeEventLog, + Abi, + Address as ViemAddress, + PublicClient, + WebSocketTransport, +} from "viem"; +import { + GenLayerClient, + GenLayerChain, + ConsensusEventStream, + ConsensusEventMap, + NewTransactionEvent, + TransactionAcceptedEvent, + TransactionActivatedEvent, + TransactionUndeterminedEvent, + TransactionLeaderTimeoutEvent, + TransactionFinalizedEvent, + AppealStartedEvent, + TransactionHash, + Address, +} from "@/types"; + +const MAX_EVENT_QUEUE_SIZE = 1000; + +export class WebSocketNotConfiguredError extends Error { + constructor() { + super( + "WebSocket URL not configured for this chain. Add a webSocket URL to rpcUrls.default.webSocket in the chain configuration, or pass webSocketEndpoint when creating the client.", + ); + this.name = "WebSocketNotConfiguredError"; + } +} + +export class ConsensusContractNotInitializedError extends Error { + constructor() { + super( + "Consensus main contract not initialized. Ensure the client is properly initialized before subscribing to events.", + ); + this.name = "ConsensusContractNotInitializedError"; + } +} + +// WeakMap to store shared WebSocket clients per GenLayerClient +const wsClientCache = new WeakMap, PublicClient>(); + +function getOrCreateWsClient(client: GenLayerClient): PublicClient { + let wsClient = wsClientCache.get(client); + if (wsClient) { + return wsClient; + } + + const wsUrl = client.chain.rpcUrls.default.webSocket?.[0]; + if (!wsUrl) { + throw new WebSocketNotConfiguredError(); + } + + wsClient = createPublicClient({ + chain: client.chain, + transport: webSocket(wsUrl), + }) as PublicClient; + + wsClientCache.set(client, wsClient); + return wsClient; +} + +function createEventStream( + client: GenLayerClient, + eventName: keyof ConsensusEventMap, + mapEvent: (log: Log) => T, +): ConsensusEventStream { + if (!client.chain.consensusMainContract?.address || !client.chain.consensusMainContract?.abi) { + throw new ConsensusContractNotInitializedError(); + } + + const wsClient = getOrCreateWsClient(client); + + const eventQueue: T[] = []; + let resolveNext: ((value: IteratorResult) => void) | null = null; + let rejectNext: ((error: Error) => void) | null = null; + let isUnsubscribed = false; + let unwatch: (() => void) | null = null; + let lastError: Error | null = null; + + const processLog = (logs: Log[]) => { + for (const log of logs) { + try { + const event = mapEvent(log); + if (resolveNext) { + resolveNext({value: event, done: false}); + resolveNext = null; + rejectNext = null; + } else { + // Prevent unbounded queue growth + if (eventQueue.length >= MAX_EVENT_QUEUE_SIZE) { + console.warn(`[genlayer-js] ${eventName} event queue full (${MAX_EVENT_QUEUE_SIZE}), dropping oldest event`); + eventQueue.shift(); // Drop oldest event + } + eventQueue.push(event); + } + } catch (err) { + console.debug(`[genlayer-js] Failed to decode ${eventName} event:`, err); + } + } + }; + + const handleError = (error: Error) => { + console.error(`[genlayer-js] WebSocket error for ${eventName}:`, error); + lastError = error; + if (rejectNext) { + rejectNext(error); + resolveNext = null; + rejectNext = null; + } + // Evict the dead WebSocket client so the next subscription creates a fresh one + wsClientCache.delete(client); + // Auto-terminate stream on WebSocket failure so subsequent next() calls + // return {done: true} instead of hanging indefinitely + isUnsubscribed = true; + if (unwatch) { + unwatch(); + unwatch = null; + } + }; + + unwatch = wsClient.watchContractEvent({ + address: client.chain.consensusMainContract.address as ViemAddress, + abi: client.chain.consensusMainContract.abi as Abi, + eventName, + onLogs: processLog, + onError: handleError, + }); + + const stream: ConsensusEventStream = { + [Symbol.asyncIterator]() { + return { + next(): Promise> { + if (isUnsubscribed) { + return Promise.resolve({value: undefined as unknown as T, done: true}); + } + + if (lastError) { + const error = lastError; + lastError = null; + return Promise.reject(error); + } + + if (eventQueue.length > 0) { + return Promise.resolve({value: eventQueue.shift()!, done: false}); + } + + return new Promise>((resolve, reject) => { + resolveNext = resolve; + rejectNext = reject; + }); + }, + return(): Promise> { + stream.unsubscribe(); + return Promise.resolve({value: undefined as unknown as T, done: true}); + }, + }; + }, + unsubscribe() { + isUnsubscribed = true; + if (unwatch) { + unwatch(); + unwatch = null; + } + if (resolveNext) { + resolveNext({value: undefined as unknown as T, done: true}); + resolveNext = null; + rejectNext = null; + } + }, + }; + + return stream; +} + +export function subscriptionActions(client: GenLayerClient) { + const decodeLog = (log: Log, eventName: keyof ConsensusEventMap): T => { + const decoded = decodeEventLog({ + abi: client.chain.consensusMainContract!.abi as Abi, + data: log.data, + topics: log.topics, + eventName, + }); + return decoded.args as T; + }; + + return { + subscribeToNewTransaction: (): ConsensusEventStream => { + return createEventStream(client, "NewTransaction", log => + decodeLog(log, "NewTransaction"), + ); + }, + + subscribeToTransactionAccepted: (): ConsensusEventStream => { + return createEventStream(client, "TransactionAccepted", log => + decodeLog(log, "TransactionAccepted"), + ); + }, + + subscribeToTransactionActivated: (): ConsensusEventStream => { + return createEventStream(client, "TransactionActivated", log => + decodeLog(log, "TransactionActivated"), + ); + }, + + subscribeToTransactionUndetermined: (): ConsensusEventStream => { + return createEventStream(client, "TransactionUndetermined", log => + decodeLog(log, "TransactionUndetermined"), + ); + }, + + subscribeToTransactionLeaderTimeout: (): ConsensusEventStream => { + return createEventStream(client, "TransactionLeaderTimeout", log => + decodeLog(log, "TransactionLeaderTimeout"), + ); + }, + + subscribeToTransactionFinalized: (): ConsensusEventStream => { + return createEventStream(client, "TransactionFinalized", log => + decodeLog(log, "TransactionFinalized"), + ); + }, + + subscribeToAppealStarted: (): ConsensusEventStream => { + return createEventStream(client, "AppealStarted", log => { + const decoded = decodeLog<{ + txId: `0x${string}`; + appellant: `0x${string}`; + bond: bigint; + validators: `0x${string}`[]; + }>(log, "AppealStarted"); + return { + txId: decoded.txId as TransactionHash, + appellant: decoded.appellant as Address, + bond: decoded.bond, + validators: decoded.validators as Address[], + }; + }); + }, + }; +} diff --git a/src/subscriptions/index.ts b/src/subscriptions/index.ts new file mode 100644 index 0000000..be27963 --- /dev/null +++ b/src/subscriptions/index.ts @@ -0,0 +1,5 @@ +export { + subscriptionActions, + WebSocketNotConfiguredError, + ConsensusContractNotInitializedError, +} from "./actions"; diff --git a/src/transactions/actions.ts b/src/transactions/actions.ts index 0a2c69e..59ac37e 100644 --- a/src/transactions/actions.ts +++ b/src/transactions/actions.ts @@ -83,7 +83,7 @@ export const transactionActions = (client: GenLayerClient, public functionName: "getTransactionData", args: [ hash, - Math.round(new Date().getTime() / 1000), // unix seconds + 0n, // Pass 0 to use block.timestamp on-chain ], })) as unknown as GenLayerRawTransaction; return decodeTransaction(transaction); diff --git a/src/transactions/decoders.ts b/src/transactions/decoders.ts index 0ef920f..2d78e57 100644 --- a/src/transactions/decoders.ts +++ b/src/transactions/decoders.ts @@ -74,15 +74,18 @@ export const decodeInputData = ( }; export const decodeTransaction = (tx: GenLayerRawTransaction): GenLayerTransaction => { - const txDataDecoded = decodeInputData(tx.txData, tx.recipient); + const txDataDecoded = decodeInputData(tx.txCalldata, tx.recipient); const decodedTx = { ...tx, - txData: tx.txData, + // Map new field names to old names for backward compatibility + txData: tx.txCalldata, + txReceipt: tx.eqBlocksOutputs, txDataDecoded: txDataDecoded, + numOfInitialValidators: tx.initialRotations.toString(), currentTimestamp: tx.currentTimestamp.toString(), - numOfInitialValidators: tx.numOfInitialValidators.toString(), + initialRotations: tx.initialRotations.toString(), txSlot: tx.txSlot.toString(), createdTimestamp: tx.createdTimestamp.toString(), lastVoteTimestamp: tx.lastVoteTimestamp.toString(), diff --git a/src/types/chains.ts b/src/types/chains.ts index 71579a8..5e59fa4 100644 --- a/src/types/chains.ts +++ b/src/types/chains.ts @@ -3,6 +3,7 @@ import {Address} from "./accounts"; export type GenLayerChain = Chain & { isStudio: boolean; + addressManagerAddress?: Address; consensusMainContract: { address: Address; abi: readonly unknown[]; diff --git a/src/types/clients.ts b/src/types/clients.ts index 75013a8..b838703 100644 --- a/src/types/clients.ts +++ b/src/types/clients.ts @@ -8,6 +8,80 @@ import {Network} from "./network"; import {SnapSource} from "@/types/snapSource"; import {MetaMaskClientResult} from "@/types/metamaskClientResult"; import {StakingActions} from "./staking"; +import { + ConsensusEventStream, + NewTransactionEvent, + TransactionAcceptedEvent, + TransactionActivatedEvent, + TransactionUndeterminedEvent, + TransactionLeaderTimeoutEvent, + TransactionFinalizedEvent, + AppealStartedEvent, +} from "@/types/subscriptions"; + +/** + * Status codes from genCall execution + */ +export enum GenCallStatusCode { + SUCCESS = 0, + USER_ERROR = 1, + VM_ERROR = 2, + INTERNAL_ERROR = 3, +} + +/** + * Status from genCall execution + */ +export interface GenCallStatus { + /** Status code indicating execution result */ + code: GenCallStatusCode; + /** Human-readable status message */ + message: string; +} + +/** + * Event emitted during contract execution + */ +export interface GenCallEvent { + /** Event topics as hex strings */ + topics: string[]; + /** Event data as hex string */ + data: string; +} + +/** + * Message submitted during contract execution + */ +export interface GenCallMessage { + messageType: number; + recipient: string; + value: string; + data: string; + onAcceptance: boolean; + saltNonce: string; +} + +/** + * Result from genCall method + */ +export interface GenCallResult { + /** Execution result as hex string (without 0x prefix from RPC, prefixed by client) */ + data: `0x${string}`; + /** Execution status */ + status: GenCallStatus; + /** Equivalence outputs from non-deterministic operations (hex strings) */ + eqOutputs: string[]; + /** Standard output from contract execution */ + stdout: string; + /** Standard error from contract execution */ + stderr: string; + /** Logs from GenVM execution */ + logs: unknown[]; + /** Events emitted during execution */ + events: GenCallEvent[]; + /** Messages submitted during execution */ + messages: GenCallMessage[]; +} export type GenLayerMethod = | {method: "sim_fundAccount"; params: [address: Address, amount: number]} @@ -106,4 +180,22 @@ export type GenLayerClient = Omit< account?: Account; txId: `0x${string}`; }) => Promise; + genCall: (args: { + type: "read" | "write" | "deploy"; + to: Address; + from?: Address; + data: `0x${string}`; + leaderResults?: string[] | null; + value?: bigint; + gas?: bigint; + blockNumber?: string; + status?: "accepted" | "finalized"; + }) => Promise; + subscribeToNewTransaction: () => ConsensusEventStream; + subscribeToTransactionAccepted: () => ConsensusEventStream; + subscribeToTransactionActivated: () => ConsensusEventStream; + subscribeToTransactionUndetermined: () => ConsensusEventStream; + subscribeToTransactionLeaderTimeout: () => ConsensusEventStream; + subscribeToTransactionFinalized: () => ConsensusEventStream; + subscribeToAppealStarted: () => ConsensusEventStream; } & StakingActions; diff --git a/src/types/index.ts b/src/types/index.ts index 0f878a0..b6d1aa3 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -7,3 +7,4 @@ export * from "./transactions"; export * from "./network"; export * from "./snapSource"; export * from "./staking"; +export * from "./subscriptions"; diff --git a/src/types/subscriptions.ts b/src/types/subscriptions.ts new file mode 100644 index 0000000..afc42ab --- /dev/null +++ b/src/types/subscriptions.ts @@ -0,0 +1,60 @@ +import {Address} from "@/types/accounts"; +import {TransactionHash} from "@/types/transactions"; + +export type NewTransactionEvent = { + txId: TransactionHash; + recipient: Address; + activator: Address; +}; + +export type TransactionAcceptedEvent = { + txId: TransactionHash; +}; + +export type TransactionActivatedEvent = { + txId: TransactionHash; + leader: Address; +}; + +export type TransactionUndeterminedEvent = { + txId: TransactionHash; +}; + +export type TransactionLeaderTimeoutEvent = { + txId: TransactionHash; +}; + +export type TransactionFinalizedEvent = { + txId: TransactionHash; +}; + +export type AppealStartedEvent = { + txId: TransactionHash; + appellant: Address; + bond: bigint; + validators: Address[]; +}; + +export type ConsensusEventName = + | "NewTransaction" + | "TransactionAccepted" + | "TransactionActivated" + | "TransactionUndetermined" + | "TransactionLeaderTimeout" + | "TransactionFinalized" + | "AppealStarted"; + +export type ConsensusEventMap = { + NewTransaction: NewTransactionEvent; + TransactionAccepted: TransactionAcceptedEvent; + TransactionActivated: TransactionActivatedEvent; + TransactionUndetermined: TransactionUndeterminedEvent; + TransactionLeaderTimeout: TransactionLeaderTimeoutEvent; + TransactionFinalized: TransactionFinalizedEvent; + AppealStarted: AppealStartedEvent; +}; + +export type ConsensusEventStream = { + [Symbol.asyncIterator](): AsyncIterator; + unsubscribe: () => void; +}; diff --git a/src/types/transactions.ts b/src/types/transactions.ts index 5748437..53fff27 100644 --- a/src/types/transactions.ts +++ b/src/types/transactions.ts @@ -276,14 +276,15 @@ export type GenLayerRawTransaction = { currentTimestamp: bigint; sender: Address; recipient: Address; - numOfInitialValidators: bigint; + initialRotations: bigint; txSlot: bigint; createdTimestamp: bigint; lastVoteTimestamp: bigint; randomSeed: Hash; result: number; - txData: Hex | undefined | null; - txReceipt: Hash; + txExecutionHash: Hash; + txCalldata: Hex | undefined | null; + eqBlocksOutputs: Hex | undefined | null; messages: unknown[]; queueType: number; queuePosition: bigint; @@ -306,7 +307,9 @@ export type GenLayerRawTransaction = { rotationsLeft: bigint; result: number; roundValidators: Address[]; - validatorVotesHash: Hash[]; validatorVotes: number[]; + validatorVotesHash: Hash[]; + validatorResultHash: Hash[]; }; + consumedValidators: Address[]; }; diff --git a/tests/chains-actions.test.ts b/tests/chains-actions.test.ts index 2ba4399..c0e35e8 100644 --- a/tests/chains-actions.test.ts +++ b/tests/chains-actions.test.ts @@ -1,7 +1,7 @@ import {describe, expect, it, vi} from "vitest"; import {chainActions} from "../src/chains/actions"; -const makeClient = (chainId: number) => +const makeClient = (chainId: number, overrides: Record = {}) => ({ chain: { id: chainId, @@ -15,12 +15,12 @@ const makeClient = (chainId: number) => abi: [{type: "function", name: "addTransaction", inputs: [], outputs: []}], bytecode: "0x", }, + ...overrides, }, }) as any; describe("chainActions.initializeConsensusSmartContract", () => { - it("emits a deprecation warning and makes no network calls", async () => { - const warnSpy = vi.spyOn(console, "warn").mockImplementation(() => {}); + it("returns early without network calls when chain has static consensus contract", async () => { const fetchSpy = vi.spyOn(globalThis, "fetch"); const client = makeClient(1); @@ -28,12 +28,8 @@ describe("chainActions.initializeConsensusSmartContract", () => { await actions.initializeConsensusSmartContract(); - expect(warnSpy).toHaveBeenCalledWith( - expect.stringContaining("deprecated"), - ); expect(fetchSpy).not.toHaveBeenCalled(); - warnSpy.mockRestore(); fetchSpy.mockRestore(); }); }); diff --git a/tests/client.test.ts b/tests/client.test.ts index c050038..2ec913f 100644 --- a/tests/client.test.ts +++ b/tests/client.test.ts @@ -18,7 +18,7 @@ describe("Client Creation", () => { it("should create a client for the localnet", () => { const client = createClient({chain: localnet}); expect(client).toBeDefined(); - expect(client.chain).toBe(localnet); + expect(client.chain).toStrictEqual(localnet); }); }); diff --git a/tests/contracts-actions.test.ts b/tests/contracts-actions.test.ts index c421269..a6f0eaa 100644 --- a/tests/contracts-actions.test.ts +++ b/tests/contracts-actions.test.ts @@ -6,7 +6,7 @@ const MAIN_CONTRACT_ADDRESS = "0x0000000000000000000000000000000000000001"; const SENDER_ADDRESS = "0x0000000000000000000000000000000000000002"; const RECIPIENT_ADDRESS = "0x0000000000000000000000000000000000000003"; -const ADD_TRANSACTION_ABI_V5 = [ +const ADD_TRANSACTION_ABI_V6 = [ { type: "function", name: "addTransaction", @@ -17,12 +17,13 @@ const ADD_TRANSACTION_ABI_V5 = [ {name: "_numOfInitialValidators", type: "uint256"}, {name: "_maxRotations", type: "uint256"}, {name: "_txData", type: "bytes"}, + {name: "_validUntil", type: "uint256"}, ], outputs: [], }, ] as const; -const ADD_TRANSACTION_ABI_V6 = [ +const ADD_TRANSACTION_ABI_V7 = [ { type: "function", name: "addTransaction", @@ -33,24 +34,53 @@ const ADD_TRANSACTION_ABI_V6 = [ {name: "_numOfInitialValidators", type: "uint256"}, {name: "_maxRotations", type: "uint256"}, {name: "_txData", type: "bytes"}, + { + name: "_feesDistribution", + type: "tuple", + components: [ + {name: "leaderTimeoutFee", type: "uint256"}, + {name: "validatorsTimeoutFee", type: "uint256"}, + {name: "appealRounds", type: "uint256"}, + {name: "rollupStorageFee", type: "uint256"}, + {name: "rollupGenVMFee", type: "uint256"}, + {name: "totalMessageFees", type: "uint256"}, + {name: "rotations", type: "uint256[]"}, + ], + }, {name: "_validUntil", type: "uint256"}, ], outputs: [], }, ] as const; -const selectorForV5 = encodeFunctionData({ - abi: ADD_TRANSACTION_ABI_V5 as any, - functionName: "addTransaction", - args: [SENDER_ADDRESS, RECIPIENT_ADDRESS, 5, 3, "0x"], -}).slice(0, 10); - const selectorForV6 = encodeFunctionData({ abi: ADD_TRANSACTION_ABI_V6 as any, functionName: "addTransaction", args: [SENDER_ADDRESS, RECIPIENT_ADDRESS, 5, 3, "0x", 0n], }).slice(0, 10); +const selectorForV7 = encodeFunctionData({ + abi: ADD_TRANSACTION_ABI_V7 as any, + functionName: "addTransaction", + args: [ + SENDER_ADDRESS, + RECIPIENT_ADDRESS, + 5, + 3, + "0x", + { + leaderTimeoutFee: 0n, + validatorsTimeoutFee: 0n, + appealRounds: 0n, + rollupStorageFee: 0n, + rollupGenVMFee: 0n, + totalMessageFees: 0n, + rotations: [], + }, + 0n, + ], +}).slice(0, 10); + const setupWriteContractHarness = ({ initialAbi, signTransactionMock, @@ -94,23 +124,6 @@ const setupWriteContractHarness = ({ }; describe("contractActions addTransaction ABI compatibility", () => { - it("encodes addTransaction with 5 args when ABI has 5 inputs", async () => { - const {actions, estimateTransactionGas} = setupWriteContractHarness({ - initialAbi: ADD_TRANSACTION_ABI_V5, - }); - - await expect( - actions.writeContract({ - address: RECIPIENT_ADDRESS, - functionName: "ping", - value: 0n, - }), - ).rejects.toThrow("stop_after_encoding"); - - const encodedData = estimateTransactionGas.mock.calls[0][0].data as `0x${string}`; - expect(encodedData.slice(0, 10)).toBe(selectorForV5); - }); - it("encodes addTransaction with 6 args when ABI has 6 inputs", async () => { const {actions, estimateTransactionGas} = setupWriteContractHarness({ initialAbi: ADD_TRANSACTION_ABI_V6, @@ -128,14 +141,9 @@ describe("contractActions addTransaction ABI compatibility", () => { expect(encodedData.slice(0, 10)).toBe(selectorForV6); }); - it("retries with v6 signature when v5 signature fails with ABI mismatch", async () => { - const signTransaction = vi - .fn() - .mockRejectedValueOnce(new Error("Invalid pointer in tuple at location 128 in payload")) - .mockRejectedValueOnce(new Error("stop_after_retry")); + it("encodes addTransaction with 7 args when ABI has WithFees variant", async () => { const {actions, estimateTransactionGas} = setupWriteContractHarness({ - initialAbi: ADD_TRANSACTION_ABI_V5, - signTransactionMock: signTransaction, + initialAbi: ADD_TRANSACTION_ABI_V7, }); await expect( @@ -144,68 +152,30 @@ describe("contractActions addTransaction ABI compatibility", () => { functionName: "ping", value: 0n, }), - ).rejects.toThrow("stop_after_retry"); - - expect(signTransaction).toHaveBeenCalledTimes(2); - const firstEncodedData = signTransaction.mock.calls[0][0].data as `0x${string}`; - const secondEncodedData = signTransaction.mock.calls[1][0].data as `0x${string}`; - expect(firstEncodedData.slice(0, 10)).toBe(selectorForV5); - expect(secondEncodedData.slice(0, 10)).toBe(selectorForV6); - expect(estimateTransactionGas).toHaveBeenCalledTimes(2); - }); - - it("retries when ABI mismatch details are on error.details (viem InternalRpcError shape)", async () => { - const signTransaction = vi - .fn() - .mockRejectedValueOnce({ - shortMessage: "An internal error was received.", - details: "Invalid pointer in tuple at location 128 in payload", - }) - .mockRejectedValueOnce(new Error("stop_after_retry")); - const {actions} = setupWriteContractHarness({ - initialAbi: ADD_TRANSACTION_ABI_V5, - signTransactionMock: signTransaction as any, - }); - - await expect( - actions.writeContract({ - address: RECIPIENT_ADDRESS, - functionName: "ping", - value: 0n, - }), - ).rejects.toThrow("stop_after_retry"); + ).rejects.toThrow("stop_after_encoding"); - expect(signTransaction).toHaveBeenCalledTimes(2); - const firstEncodedData = signTransaction.mock.calls[0][0].data as `0x${string}`; - const secondEncodedData = signTransaction.mock.calls[1][0].data as `0x${string}`; - expect(firstEncodedData.slice(0, 10)).toBe(selectorForV5); - expect(secondEncodedData.slice(0, 10)).toBe(selectorForV6); + const encodedData = estimateTransactionGas.mock.calls[0][0].data as `0x${string}`; + expect(encodedData.slice(0, 10)).toBe(selectorForV7); }); - it("retries with v5 signature when v6 signature fails with ABI mismatch", async () => { - const signTransaction = vi - .fn() - .mockRejectedValueOnce(new Error("Invalid pointer in tuple at location 128 in payload")) - .mockRejectedValueOnce(new Error("stop_after_retry")); - const {actions, estimateTransactionGas} = setupWriteContractHarness({ + it("uses current ABI at call time for encoding", async () => { + const {actions, estimateTransactionGas, client} = setupWriteContractHarness({ initialAbi: ADD_TRANSACTION_ABI_V6, - signTransactionMock: signTransaction, }); + // Mutate the ABI on the client before calling writeContract + client.chain.consensusMainContract.abi = [...ADD_TRANSACTION_ABI_V7]; + await expect( actions.writeContract({ address: RECIPIENT_ADDRESS, functionName: "ping", value: 0n, }), - ).rejects.toThrow("stop_after_retry"); + ).rejects.toThrow("stop_after_encoding"); - expect(signTransaction).toHaveBeenCalledTimes(2); - const firstEncodedData = signTransaction.mock.calls[0][0].data as `0x${string}`; - const secondEncodedData = signTransaction.mock.calls[1][0].data as `0x${string}`; - expect(firstEncodedData.slice(0, 10)).toBe(selectorForV6); - expect(secondEncodedData.slice(0, 10)).toBe(selectorForV5); - expect(estimateTransactionGas).toHaveBeenCalledTimes(2); + const encodedData = estimateTransactionGas.mock.calls[0][0].data as `0x${string}`; + expect(encodedData.slice(0, 10)).toBe(selectorForV7); }); it("uses direct eth_sendTransaction for non-local accounts without prepareTransactionRequest", async () => { @@ -257,11 +227,12 @@ describe("contractActions addTransaction ABI compatibility", () => { expect(sendTxCall).toBeDefined(); const sendTxParams = sendTxCall?.[0]?.params?.[0]; + // Gas is 21000 * 1.5 (50% buffer) = 31500 = 0x7b0c expect(sendTxParams).toMatchObject({ from: SENDER_ADDRESS, to: MAIN_CONTRACT_ADDRESS, value: "0x0", - gas: "0x5208", + gas: "0x7b0c", nonce: "0x0", type: "0x0", chainId: "0xeec7", @@ -269,66 +240,24 @@ describe("contractActions addTransaction ABI compatibility", () => { }); }); - it("retries alternate ABI for injected-wallet errors with nested invalid pointer details", async () => { - const sentPayloads: `0x${string}`[] = []; - const request = vi.fn().mockImplementation(async ({method, params}: {method: string; params?: any[]}) => { - if (method === "eth_gasPrice") { - return "0x1"; - } - - if (method === "eth_sendTransaction") { - const payload = params?.[0]; - sentPayloads.push(payload?.data); - - if (sentPayloads.length === 1) { - throw { - code: -32603, - message: "Internal JSON-RPC error.", - data: { - originalError: { - message: "Invalid pointer in tuple at location 128 in payload", - }, - }, - }; - } - - return "0x1234"; - } - - throw new Error(`Unexpected RPC method: ${method}`); + it("applies 50% gas buffer to estimated gas", async () => { + const signTransaction = vi.fn().mockRejectedValue(new Error("stop_after_gas")); + const {actions, estimateTransactionGas} = setupWriteContractHarness({ + initialAbi: ADD_TRANSACTION_ABI_V6, + signTransactionMock: signTransaction, }); - const client = { - chain: { - id: 61_127, - defaultNumberOfInitialValidators: 5, - defaultConsensusMaxRotations: 3, - consensusMainContract: { - address: MAIN_CONTRACT_ADDRESS, - abi: [...ADD_TRANSACTION_ABI_V5], - bytecode: "0x", - }, - }, - account: { - address: SENDER_ADDRESS, - type: "json-rpc", - }, - initializeConsensusSmartContract: vi.fn().mockResolvedValue(undefined), - getCurrentNonce: vi.fn().mockResolvedValue(0n), - estimateTransactionGas: vi.fn().mockResolvedValue(21_000n), - request, - }; - - const actions = contractActions(client as any, {} as any); - const txHash = await actions.writeContract({ - address: RECIPIENT_ADDRESS, - functionName: "ping", - value: 0n, - }); + await expect( + actions.writeContract({ + address: RECIPIENT_ADDRESS, + functionName: "ping", + value: 0n, + }), + ).rejects.toThrow("stop_after_gas"); - expect(txHash).toBe("0x1234"); - expect(sentPayloads).toHaveLength(2); - expect(sentPayloads[0].slice(0, 10)).toBe(selectorForV5); - expect(sentPayloads[1].slice(0, 10)).toBe(selectorForV6); + expect(estimateTransactionGas).toHaveBeenCalledTimes(1); + // The gas value passed to signTransaction should be 21000 * 1.5 = 31500 + const txRequest = signTransaction.mock.calls[0][0]; + expect(txRequest.gas).toBe(31_500n); }); }); diff --git a/tests/genCall.test.ts b/tests/genCall.test.ts new file mode 100644 index 0000000..cdb9333 --- /dev/null +++ b/tests/genCall.test.ts @@ -0,0 +1,272 @@ +// tests/genCall.test.ts +import {describe, it, expect, vi, beforeEach, afterEach, afterAll} from "vitest"; +import {createClient} from "@/client/client"; +import {localnet} from "@/chains/localnet"; +import {Address} from "@/types/accounts"; +import {createAccount, generatePrivateKey} from "@/accounts/account"; +import {GenCallStatusCode} from "@/types/clients"; +import {zeroAddress} from "viem"; + +// Setup fetch mock +const mockFetch = vi.fn(); +vi.stubGlobal("fetch", mockFetch); + +// Store for gen_call parameters received by mockFetch +let lastGenCallParams: any = null; +let mockGenCallResponse: any = null; + +describe("genCall", () => { + beforeEach(() => { + mockFetch.mockReset(); + lastGenCallParams = null; + mockGenCallResponse = { + data: "abcd1234", + status: {code: GenCallStatusCode.SUCCESS, message: "success"}, + stdout: "test stdout", + stderr: "", + logs: [], + events: [{topics: ["0x123"], data: "0x456"}], + messages: [], + }; + + mockFetch.mockImplementation(async (_url, options) => { + const bodyString = typeof options?.body === "string" ? options.body : null; + if (!bodyString) { + return {ok: false, status: 400, json: async () => ({error: "No body"})}; + } + + const body = JSON.parse(bodyString); + const method = body.method; + + if (method === "sim_getConsensusContract") { + return { + ok: true, + json: async () => ({ + result: { + address: "0x0000000000000000000000000000000000000001", + abi: [], + }, + }), + }; + } else if (method === "gen_call") { + lastGenCallParams = body.params; + return { + ok: true, + json: async () => ({result: mockGenCallResponse}), + }; + } + + return {ok: false, status: 404, json: async () => ({error: "Unknown method"})}; + }); + }); + + afterEach(() => { + vi.restoreAllMocks(); + }); + + afterAll(() => { + vi.unstubAllGlobals(); + }); + + it("should send basic genCall request with required parameters", async () => { + const client = createClient({chain: localnet}); + const contractAddress = "0x1234567890123456789012345678901234567890" as Address; + + const result = await client.genCall({ + type: "read", + to: contractAddress, + data: "0xabcdef", + }); + + expect(lastGenCallParams).toEqual([ + { + type: "read", + to: contractAddress, + from: zeroAddress, + data: "0xabcdef", + }, + ]); + + expect(result.data).toBe("0xabcd1234"); + expect(result.status.code).toBe(GenCallStatusCode.SUCCESS); + expect(result.stdout).toBe("test stdout"); + expect(result.events).toHaveLength(1); + }); + + it("should use client account as sender when available", async () => { + const account = createAccount(generatePrivateKey()); + const client = createClient({chain: localnet, account}); + const contractAddress = "0x1234567890123456789012345678901234567890" as Address; + + await client.genCall({ + type: "write", + to: contractAddress, + data: "0x1234", + }); + + expect(lastGenCallParams[0].from).toBe(account.address); + }); + + it("should use explicit from address over client account", async () => { + const account = createAccount(generatePrivateKey()); + const client = createClient({chain: localnet, account}); + const contractAddress = "0x1234567890123456789012345678901234567890" as Address; + const explicitFrom = "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" as Address; + + await client.genCall({ + type: "read", + to: contractAddress, + from: explicitFrom, + data: "0x1234", + }); + + expect(lastGenCallParams[0].from).toBe(explicitFrom); + }); + + it("should include optional parameters when provided", async () => { + const client = createClient({chain: localnet}); + const contractAddress = "0x1234567890123456789012345678901234567890" as Address; + + await client.genCall({ + type: "write", + to: contractAddress, + data: "0x1234", + value: 1000n, + gas: 50000n, + blockNumber: "0x100", + status: "finalized", + }); + + expect(lastGenCallParams[0]).toEqual({ + type: "write", + to: contractAddress, + from: zeroAddress, + data: "0x1234", + value: "0x3e8", // 1000 in hex + gas: "0xc350", // 50000 in hex + blockNumber: "0x100", + status: "finalized", + }); + }); + + it("should pass leaderResults as leader_results for validator simulation", async () => { + const client = createClient({chain: localnet}); + const contractAddress = "0x1234567890123456789012345678901234567890" as Address; + + const leaderResults = ["0010", "00d102"]; + + await client.genCall({ + type: "write", + to: contractAddress, + data: "0x1234", + leaderResults, + }); + + expect(lastGenCallParams[0].leader_results).toEqual(leaderResults); + }); + + it("should not include leader_results when leaderResults is null", async () => { + const client = createClient({chain: localnet}); + const contractAddress = "0x1234567890123456789012345678901234567890" as Address; + + await client.genCall({ + type: "read", + to: contractAddress, + data: "0x1234", + leaderResults: null, + }); + + expect(lastGenCallParams[0]).not.toHaveProperty("leader_results"); + }); + + it("should handle response with 0x prefix in data", async () => { + mockGenCallResponse = { + data: "0xdeadbeef", + status: {code: GenCallStatusCode.SUCCESS, message: "ok"}, + }; + + const client = createClient({chain: localnet}); + const result = await client.genCall({ + type: "read", + to: "0x1234567890123456789012345678901234567890" as Address, + data: "0x00", + }); + + expect(result.data).toBe("0xdeadbeef"); + }); + + it("should add 0x prefix to data when missing", async () => { + mockGenCallResponse = { + data: "deadbeef", + status: {code: GenCallStatusCode.SUCCESS, message: "ok"}, + }; + + const client = createClient({chain: localnet}); + const result = await client.genCall({ + type: "read", + to: "0x1234567890123456789012345678901234567890" as Address, + data: "0x00", + }); + + expect(result.data).toBe("0xdeadbeef"); + }); + + it("should provide default values for missing response fields", async () => { + mockGenCallResponse = {}; // Empty response + + const client = createClient({chain: localnet}); + const result = await client.genCall({ + type: "read", + to: "0x1234567890123456789012345678901234567890" as Address, + data: "0x00", + }); + + expect(result.data).toBe("0x"); + expect(result.status).toEqual({code: GenCallStatusCode.INTERNAL_ERROR, message: "missing status from RPC response"}); + expect(result.stdout).toBe(""); + expect(result.stderr).toBe(""); + expect(result.logs).toEqual([]); + expect(result.events).toEqual([]); + expect(result.messages).toEqual([]); + }); + + it("should handle error status codes", async () => { + mockGenCallResponse = { + data: "", + status: {code: GenCallStatusCode.USER_ERROR, message: "Contract reverted"}, + stderr: "Error: revert", + }; + + const client = createClient({chain: localnet}); + const result = await client.genCall({ + type: "write", + to: "0x1234567890123456789012345678901234567890" as Address, + data: "0x00", + }); + + expect(result.status.code).toBe(GenCallStatusCode.USER_ERROR); + expect(result.status.message).toBe("Contract reverted"); + expect(result.stderr).toBe("Error: revert"); + }); + + it("should handle deploy type", async () => { + const client = createClient({chain: localnet}); + + await client.genCall({ + type: "deploy", + to: zeroAddress as Address, + data: "0x608060405234801561001057600080fd5b50", + }); + + expect(lastGenCallParams[0].type).toBe("deploy"); + }); +}); + +describe("GenCallStatusCode enum", () => { + it("should have correct values", () => { + expect(GenCallStatusCode.SUCCESS).toBe(0); + expect(GenCallStatusCode.USER_ERROR).toBe(1); + expect(GenCallStatusCode.VM_ERROR).toBe(2); + expect(GenCallStatusCode.INTERNAL_ERROR).toBe(3); + }); +}); diff --git a/tests/subscriptions.test.ts b/tests/subscriptions.test.ts new file mode 100644 index 0000000..8c6e5c9 --- /dev/null +++ b/tests/subscriptions.test.ts @@ -0,0 +1,258 @@ +// tests/subscriptions.test.ts +import {describe, it, expect, vi, afterEach} from "vitest"; +import { + WebSocketNotConfiguredError, + ConsensusContractNotInitializedError, + subscriptionActions, +} from "@/subscriptions/actions"; +import {GenLayerClient, GenLayerChain} from "@/types"; + +// Track createPublicClient calls and captured onError handlers +const {createPublicClientSpy, getCapturedOnError, setCapturedOnError} = vi.hoisted(() => { + let capturedOnError: ((error: Error) => void) | null = null; + return { + createPublicClientSpy: vi.fn(() => ({ + watchContractEvent: vi.fn((opts: {onError?: (error: Error) => void}) => { + capturedOnError = opts.onError ?? null; + return vi.fn(); // unwatch function + }), + })), + getCapturedOnError: () => capturedOnError, + setCapturedOnError: (v: ((error: Error) => void) | null) => { + capturedOnError = v; + }, + }; +}); + +// Mock viem module for WebSocket-related tests +vi.mock("viem", async importOriginal => { + const actual = (await importOriginal()) as object; + return { + ...actual, + createPublicClient: createPublicClientSpy, + webSocket: vi.fn(() => ({ + request: vi.fn(), + type: "webSocket" as const, + })), + }; +}); + +// Helper to create a minimal mock client +function createMockClient(options: { + webSocketUrl?: string; + consensusContract?: {address: string; abi: unknown[]} | null; +}): GenLayerClient { + const defaultContract = { + address: "0x0000000000000000000000000000000000000001", + abi: [ + { + name: "NewTransaction", + type: "event", + inputs: [ + {indexed: true, name: "txId", type: "bytes32"}, + {indexed: true, name: "recipient", type: "address"}, + {indexed: true, name: "activator", type: "address"}, + ], + }, + { + name: "TransactionAccepted", + type: "event", + inputs: [{indexed: true, name: "tx_id", type: "bytes32"}], + }, + { + name: "TransactionActivated", + type: "event", + inputs: [ + {indexed: true, name: "txId", type: "bytes32"}, + {indexed: true, name: "leader", type: "address"}, + ], + }, + { + name: "TransactionUndetermined", + type: "event", + inputs: [{indexed: true, name: "tx_id", type: "bytes32"}], + }, + { + name: "TransactionLeaderTimeout", + type: "event", + inputs: [{indexed: true, name: "tx_id", type: "bytes32"}], + }, + { + name: "TransactionFinalized", + type: "event", + inputs: [{indexed: true, name: "txId", type: "bytes32"}], + }, + { + name: "AppealStarted", + type: "event", + inputs: [ + {indexed: true, name: "txId", type: "bytes32"}, + {indexed: true, name: "appellant", type: "address"}, + {indexed: false, name: "bond", type: "uint256"}, + {indexed: false, name: "validators", type: "address[]"}, + ], + }, + ], + bytecode: "", + }; + + // Use explicit check to allow null to be passed through + const consensusContract = + "consensusContract" in options ? options.consensusContract : defaultContract; + + return { + chain: { + id: 1, + name: "Test Chain", + rpcUrls: { + default: { + http: ["http://localhost:8545"], + webSocket: options.webSocketUrl ? [options.webSocketUrl] : undefined, + }, + }, + nativeCurrency: {name: "ETH", symbol: "ETH", decimals: 18}, + consensusMainContract: consensusContract, + consensusDataContract: null, + stakingContract: null, + isStudio: false, + defaultNumberOfInitialValidators: 3, + defaultConsensusMaxRotations: 5, + }, + } as unknown as GenLayerClient; +} + +describe("Subscription Actions", () => { + afterEach(() => { + vi.restoreAllMocks(); + }); + + describe("WebSocket Configuration", () => { + it("should throw WebSocketNotConfiguredError when no webSocket URL is configured", () => { + const client = createMockClient({webSocketUrl: undefined}); + const actions = subscriptionActions(client); + + expect(() => actions.subscribeToNewTransaction()).toThrow(WebSocketNotConfiguredError); + expect(() => actions.subscribeToNewTransaction()).toThrow( + /WebSocket URL not configured/, + ); + }); + + it("should throw WebSocketNotConfiguredError for all subscription methods", () => { + const client = createMockClient({webSocketUrl: undefined}); + const actions = subscriptionActions(client); + + expect(() => actions.subscribeToNewTransaction()).toThrow(WebSocketNotConfiguredError); + expect(() => actions.subscribeToTransactionAccepted()).toThrow(WebSocketNotConfiguredError); + expect(() => actions.subscribeToTransactionActivated()).toThrow(WebSocketNotConfiguredError); + expect(() => actions.subscribeToTransactionUndetermined()).toThrow(WebSocketNotConfiguredError); + expect(() => actions.subscribeToTransactionLeaderTimeout()).toThrow(WebSocketNotConfiguredError); + expect(() => actions.subscribeToTransactionFinalized()).toThrow(WebSocketNotConfiguredError); + expect(() => actions.subscribeToAppealStarted()).toThrow(WebSocketNotConfiguredError); + }); + + it("should not throw WebSocketNotConfiguredError when webSocket URL is provided", () => { + const client = createMockClient({webSocketUrl: "wss://example.com/ws"}); + const actions = subscriptionActions(client); + + // Should not throw WebSocketNotConfiguredError + // (may throw other errors due to mocking, but not this specific one) + expect(() => actions.subscribeToNewTransaction()).not.toThrow(WebSocketNotConfiguredError); + }); + }); + + describe("Consensus Contract Initialization", () => { + it("should throw ConsensusContractNotInitializedError when contract is null", () => { + // WebSocket URL is not needed for this test since consensus check comes first + const client = createMockClient({ + webSocketUrl: undefined, + consensusContract: null, + }); + const actions = subscriptionActions(client); + + // Consensus contract check happens first in the code + expect(() => actions.subscribeToNewTransaction()).toThrow( + ConsensusContractNotInitializedError, + ); + }); + + it("should throw ConsensusContractNotInitializedError when contract has no address", () => { + const client = createMockClient({ + webSocketUrl: undefined, + consensusContract: {address: "", abi: []}, + }); + + // Manually set to simulate missing address + (client.chain.consensusMainContract as any).address = undefined; + + const actions = subscriptionActions(client); + + expect(() => actions.subscribeToNewTransaction()).toThrow( + ConsensusContractNotInitializedError, + ); + }); + }); +}); + +describe("Error Classes", () => { + it("WebSocketNotConfiguredError should have correct name and message", () => { + const error = new WebSocketNotConfiguredError(); + expect(error.name).toBe("WebSocketNotConfiguredError"); + expect(error.message).toContain("WebSocket URL not configured"); + expect(error).toBeInstanceOf(Error); + }); + + it("ConsensusContractNotInitializedError should have correct name and message", () => { + const error = new ConsensusContractNotInitializedError(); + expect(error.name).toBe("ConsensusContractNotInitializedError"); + expect(error.message).toContain("Consensus main contract not initialized"); + expect(error).toBeInstanceOf(Error); + }); +}); + +describe("ConsensusEventStream interface", () => { + it("should have asyncIterator and unsubscribe methods defined in type", () => { + // This is a compile-time type check + // The actual runtime behavior depends on WebSocket connection + const client = createMockClient({webSocketUrl: "wss://example.com/ws"}); + const actions = subscriptionActions(client); + + // Verify the methods exist on the actions object + expect(typeof actions.subscribeToNewTransaction).toBe("function"); + expect(typeof actions.subscribeToTransactionAccepted).toBe("function"); + expect(typeof actions.subscribeToTransactionActivated).toBe("function"); + expect(typeof actions.subscribeToTransactionUndetermined).toBe("function"); + expect(typeof actions.subscribeToTransactionLeaderTimeout).toBe("function"); + expect(typeof actions.subscribeToTransactionFinalized).toBe("function"); + expect(typeof actions.subscribeToAppealStarted).toBe("function"); + }); +}); + +describe("WebSocket client cache eviction on error", () => { + afterEach(() => { + setCapturedOnError(null); + vi.restoreAllMocks(); + }); + + it("should evict cached wsClient on WebSocket error so next subscription creates a fresh client", () => { + createPublicClientSpy.mockClear(); + const client = createMockClient({webSocketUrl: "wss://example.com/ws"}); + const actions = subscriptionActions(client); + + // First subscription creates the wsClient + actions.subscribeToNewTransaction(); + expect(createPublicClientSpy).toHaveBeenCalledTimes(1); + + // Second subscription reuses the cached wsClient + actions.subscribeToNewTransaction(); + expect(createPublicClientSpy).toHaveBeenCalledTimes(1); + + // Simulate a WebSocket error + const onError = getCapturedOnError(); + expect(onError).not.toBeNull(); + onError!(new Error("WebSocket connection closed")); + + // Third subscription should create a new wsClient because the cache was evicted + actions.subscribeToNewTransaction(); + expect(createPublicClientSpy).toHaveBeenCalledTimes(2); + }); +});