From 4b344def226c7b96c07ce60e25b1cb3f67e2cb44 Mon Sep 17 00:00:00 2001 From: Mikhail Wall Date: Thu, 23 May 2024 00:22:52 +0200 Subject: [PATCH] chore: deleting state after usage --- contracts-abi/abi/PreConfCommitmentStore.abi | 157 +-------- .../PreConfCommitmentStore.go | 314 ++++-------------- contracts/contracts/BidderRegistry.sol | 14 +- .../contracts/PreConfCommitmentStore.sol | 132 +++----- contracts/contracts/ProviderRegistry.sol | 20 +- .../interfaces/IPreConfCommitmentStore.sol | 1 - contracts/test/OracleTest.sol | 1 - contracts/test/PreConfirmationConfTest.sol | 233 +++++++++---- 8 files changed, 293 insertions(+), 579 deletions(-) diff --git a/contracts-abi/abi/PreConfCommitmentStore.abi b/contracts-abi/abi/PreConfCommitmentStore.abi index 925b92b4c..e5c05a6ec 100644 --- a/contracts-abi/abi/PreConfCommitmentStore.abi +++ b/contracts-abi/abi/PreConfCommitmentStore.abi @@ -96,30 +96,6 @@ ], "stateMutability": "view" }, - { - "type": "function", - "name": "blockCommitments", - "inputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "stateMutability": "view" - }, { "type": "function", "name": "blockTracker", @@ -135,20 +111,7 @@ }, { "type": "function", - "name": "commitmentCount", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "commitment_dispatch_window", + "name": "commitmentDispatchWindow", "inputs": [], "outputs": [ { @@ -170,11 +133,6 @@ } ], "outputs": [ - { - "name": "commitmentUsed", - "type": "bool", - "internalType": "bool" - }, { "name": "bidder", "type": "address", @@ -273,11 +231,6 @@ } ], "outputs": [ - { - "name": "commitmentUsed", - "type": "bool", - "internalType": "bool" - }, { "name": "commiter", "type": "address", @@ -356,11 +309,6 @@ "type": "tuple", "internalType": "struct PreConfCommitmentStore.PreConfCommitment", "components": [ - { - "name": "commitmentUsed", - "type": "bool", - "internalType": "bool" - }, { "name": "bidder", "type": "address", @@ -440,11 +388,6 @@ "type": "tuple", "internalType": "struct PreConfCommitmentStore.PreConfCommitment", "components": [ - { - "name": "commitmentUsed", - "type": "bool", - "internalType": "bool" - }, { "name": "bidder", "type": "address", @@ -522,44 +465,6 @@ ], "stateMutability": "pure" }, - { - "type": "function", - "name": "getCommitmentsByBlockNumber", - "inputs": [ - { - "name": "blockNumber", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [ - { - "name": "", - "type": "bytes32[]", - "internalType": "bytes32[]" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getCommitmentsByCommitter", - "inputs": [ - { - "name": "commiter", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "", - "type": "bytes32[]", - "internalType": "bytes32[]" - } - ], - "stateMutability": "view" - }, { "type": "function", "name": "getEncryptedCommitment", @@ -576,11 +481,6 @@ "type": "tuple", "internalType": "struct PreConfCommitmentStore.EncrPreConfCommitment", "components": [ - { - "name": "commitmentUsed", - "type": "bool", - "internalType": "bool" - }, { "name": "commiter", "type": "address", @@ -615,11 +515,6 @@ "type": "tuple", "internalType": "struct PreConfCommitmentStore.EncrPreConfCommitment", "components": [ - { - "name": "commitmentUsed", - "type": "bool", - "internalType": "bool" - }, { "name": "commiter", "type": "address", @@ -755,7 +650,7 @@ "internalType": "address" }, { - "name": "_commitment_dispatch_window", + "name": "_commitmentDispatchWindow", "type": "uint64", "internalType": "uint64" } @@ -897,54 +792,6 @@ ], "stateMutability": "view" }, - { - "type": "function", - "name": "providerCommitments", - "inputs": [ - { - "name": "", - "type": "address", - "internalType": "address" - }, - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "providerEncryptedCommitments", - "inputs": [ - { - "name": "", - "type": "address", - "internalType": "address" - }, - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "stateMutability": "view" - }, { "type": "function", "name": "providerRegistry", diff --git a/contracts-abi/clients/PreConfCommitmentStore/PreConfCommitmentStore.go b/contracts-abi/clients/PreConfCommitmentStore/PreConfCommitmentStore.go index 6f86d4b78..e7aee78a7 100644 --- a/contracts-abi/clients/PreConfCommitmentStore/PreConfCommitmentStore.go +++ b/contracts-abi/clients/PreConfCommitmentStore/PreConfCommitmentStore.go @@ -31,7 +31,6 @@ var ( // PreConfCommitmentStoreEncrPreConfCommitment is an auto generated low-level Go binding around an user-defined struct. type PreConfCommitmentStoreEncrPreConfCommitment struct { - CommitmentUsed bool Commiter common.Address CommitmentDigest [32]byte CommitmentSignature []byte @@ -40,7 +39,6 @@ type PreConfCommitmentStoreEncrPreConfCommitment struct { // PreConfCommitmentStorePreConfCommitment is an auto generated low-level Go binding around an user-defined struct. type PreConfCommitmentStorePreConfCommitment struct { - CommitmentUsed bool Bidder common.Address Commiter common.Address Bid uint64 @@ -58,7 +56,7 @@ type PreConfCommitmentStorePreConfCommitment struct { // PreconfcommitmentstoreMetaData contains all meta data concerning the Preconfcommitmentstore contract. var PreconfcommitmentstoreMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"fallback\",\"stateMutability\":\"payable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"DOMAIN_SEPARATOR_BID\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"DOMAIN_SEPARATOR_PRECONF\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"EIP712_BID_TYPEHASH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"EIP712_COMMITMENT_TYPEHASH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"_bytesToHexString\",\"inputs\":[{\"name\":\"_bytes\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"bidderRegistry\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIBidderRegistry\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blockCommitments\",\"inputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blockTracker\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIBlockTracker\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"commitmentCount\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"commitment_dispatch_window\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"commitments\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"commitmentUsed\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"commiter\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"bid\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"bidHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"commitmentHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"bidSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"dispatchTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"sharedSecretKey\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"commitmentsCount\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"encryptedCommitments\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"commitmentUsed\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"commiter\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"dispatchTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getBidHash\",\"inputs\":[{\"name\":\"_txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"_bid\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getCommitment\",\"inputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structPreConfCommitmentStore.PreConfCommitment\",\"components\":[{\"name\":\"commitmentUsed\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"commiter\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"bid\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"bidHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"commitmentHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"bidSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"dispatchTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"sharedSecretKey\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getCommitmentIndex\",\"inputs\":[{\"name\":\"commitment\",\"type\":\"tuple\",\"internalType\":\"structPreConfCommitmentStore.PreConfCommitment\",\"components\":[{\"name\":\"commitmentUsed\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"commiter\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"bid\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"bidHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"commitmentHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"bidSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"dispatchTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"sharedSecretKey\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"getCommitmentsByBlockNumber\",\"inputs\":[{\"name\":\"blockNumber\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getCommitmentsByCommitter\",\"inputs\":[{\"name\":\"commiter\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getEncryptedCommitment\",\"inputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structPreConfCommitmentStore.EncrPreConfCommitment\",\"components\":[{\"name\":\"commitmentUsed\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"commiter\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"dispatchTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getEncryptedCommitmentIndex\",\"inputs\":[{\"name\":\"commitment\",\"type\":\"tuple\",\"internalType\":\"structPreConfCommitmentStore.EncrPreConfCommitment\",\"components\":[{\"name\":\"commitmentUsed\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"commiter\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"dispatchTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"getPreConfHash\",\"inputs\":[{\"name\":\"_txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"_bid\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_bidHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"_bidSignature\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"_sharedSecretKey\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getTxnHashFromCommitment\",\"inputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_providerRegistry\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_bidderRegistry\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_oracle\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_blockTracker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_commitment_dispatch_window\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initiateReward\",\"inputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"residualBidPercentAfterDecay\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initiateSlash\",\"inputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"residualBidPercentAfterDecay\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"lastProcessedBlock\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"openCommitment\",\"inputs\":[{\"name\":\"encryptedCommitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"bid\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"bidSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"sharedSecretKey\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"oracle\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"providerCommitments\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"providerEncryptedCommitments\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"providerRegistry\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIProviderRegistry\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"storeEncryptedCommitment\",\"inputs\":[{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"dispatchTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"updateBidderRegistry\",\"inputs\":[{\"name\":\"newBidderRegistry\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"updateCommitmentDispatchWindow\",\"inputs\":[{\"name\":\"newDispatchWindow\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"updateOracle\",\"inputs\":[{\"name\":\"newOracle\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"updateProviderRegistry\",\"inputs\":[{\"name\":\"newProviderRegistry\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"verifyBid\",\"inputs\":[{\"name\":\"bid\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"bidSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"messageDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"recoveredAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"verifyPreConfCommitment\",\"inputs\":[{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"bid\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"bidHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"bidSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"sharedSecretKey\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"preConfHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"commiterAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"CommitmentStored\",\"inputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"bidder\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"commiter\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"bid\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"bidHash\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"decayStartTimeStamp\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"decayEndTimeStamp\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"txnHash\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"},{\"name\":\"commitmentHash\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"bidSignature\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"},{\"name\":\"dispatchTimestamp\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"sharedSecretKey\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"EncryptedCommitmentStored\",\"inputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"commiter\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"},{\"name\":\"dispatchTimestamp\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"SignatureVerified\",\"inputs\":[{\"name\":\"signer\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"txnHash\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"},{\"name\":\"bid\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"InvalidInitialization\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotInitializing\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OwnableInvalidOwner\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"OwnableUnauthorizedAccount\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"}]}]", + ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"fallback\",\"stateMutability\":\"payable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"DOMAIN_SEPARATOR_BID\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"DOMAIN_SEPARATOR_PRECONF\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"EIP712_BID_TYPEHASH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"EIP712_COMMITMENT_TYPEHASH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"_bytesToHexString\",\"inputs\":[{\"name\":\"_bytes\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"bidderRegistry\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIBidderRegistry\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blockTracker\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIBlockTracker\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"commitmentDispatchWindow\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"commitments\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"commiter\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"bid\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"bidHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"commitmentHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"bidSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"dispatchTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"sharedSecretKey\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"commitmentsCount\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"encryptedCommitments\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"commiter\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"dispatchTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getBidHash\",\"inputs\":[{\"name\":\"_txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"_bid\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getCommitment\",\"inputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structPreConfCommitmentStore.PreConfCommitment\",\"components\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"commiter\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"bid\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"bidHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"commitmentHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"bidSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"dispatchTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"sharedSecretKey\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getCommitmentIndex\",\"inputs\":[{\"name\":\"commitment\",\"type\":\"tuple\",\"internalType\":\"structPreConfCommitmentStore.PreConfCommitment\",\"components\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"commiter\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"bid\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"bidHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"commitmentHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"bidSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"dispatchTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"sharedSecretKey\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"getEncryptedCommitment\",\"inputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structPreConfCommitmentStore.EncrPreConfCommitment\",\"components\":[{\"name\":\"commiter\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"dispatchTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getEncryptedCommitmentIndex\",\"inputs\":[{\"name\":\"commitment\",\"type\":\"tuple\",\"internalType\":\"structPreConfCommitmentStore.EncrPreConfCommitment\",\"components\":[{\"name\":\"commiter\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"dispatchTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"getPreConfHash\",\"inputs\":[{\"name\":\"_txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"_bid\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_bidHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"_bidSignature\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"_sharedSecretKey\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getTxnHashFromCommitment\",\"inputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_providerRegistry\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_bidderRegistry\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_oracle\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_blockTracker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_commitmentDispatchWindow\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initiateReward\",\"inputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"residualBidPercentAfterDecay\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initiateSlash\",\"inputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"residualBidPercentAfterDecay\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"lastProcessedBlock\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"openCommitment\",\"inputs\":[{\"name\":\"encryptedCommitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"bid\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"bidSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"sharedSecretKey\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"oracle\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"providerRegistry\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIProviderRegistry\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"storeEncryptedCommitment\",\"inputs\":[{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"dispatchTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"updateBidderRegistry\",\"inputs\":[{\"name\":\"newBidderRegistry\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"updateCommitmentDispatchWindow\",\"inputs\":[{\"name\":\"newDispatchWindow\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"updateOracle\",\"inputs\":[{\"name\":\"newOracle\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"updateProviderRegistry\",\"inputs\":[{\"name\":\"newProviderRegistry\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"verifyBid\",\"inputs\":[{\"name\":\"bid\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"bidSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"messageDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"recoveredAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"verifyPreConfCommitment\",\"inputs\":[{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"bid\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"bidHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"bidSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"sharedSecretKey\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"preConfHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"commiterAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"CommitmentStored\",\"inputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"bidder\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"commiter\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"bid\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"bidHash\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"decayStartTimeStamp\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"decayEndTimeStamp\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"txnHash\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"},{\"name\":\"commitmentHash\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"bidSignature\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"},{\"name\":\"dispatchTimestamp\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"sharedSecretKey\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"EncryptedCommitmentStored\",\"inputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"commiter\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"},{\"name\":\"dispatchTimestamp\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"SignatureVerified\",\"inputs\":[{\"name\":\"signer\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"txnHash\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"},{\"name\":\"bid\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"InvalidInitialization\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotInitializing\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OwnableInvalidOwner\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"OwnableUnauthorizedAccount\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"}]}]", } // PreconfcommitmentstoreABI is the input ABI used to generate the binding from. @@ -393,37 +391,6 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreCallerSession) BidderRegist return _Preconfcommitmentstore.Contract.BidderRegistry(&_Preconfcommitmentstore.CallOpts) } -// BlockCommitments is a free data retrieval call binding the contract method 0x159efb47. -// -// Solidity: function blockCommitments(uint256 , uint256 ) view returns(bytes32) -func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) BlockCommitments(opts *bind.CallOpts, arg0 *big.Int, arg1 *big.Int) ([32]byte, error) { - var out []interface{} - err := _Preconfcommitmentstore.contract.Call(opts, &out, "blockCommitments", arg0, arg1) - - if err != nil { - return *new([32]byte), err - } - - out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) - - return out0, err - -} - -// BlockCommitments is a free data retrieval call binding the contract method 0x159efb47. -// -// Solidity: function blockCommitments(uint256 , uint256 ) view returns(bytes32) -func (_Preconfcommitmentstore *PreconfcommitmentstoreSession) BlockCommitments(arg0 *big.Int, arg1 *big.Int) ([32]byte, error) { - return _Preconfcommitmentstore.Contract.BlockCommitments(&_Preconfcommitmentstore.CallOpts, arg0, arg1) -} - -// BlockCommitments is a free data retrieval call binding the contract method 0x159efb47. -// -// Solidity: function blockCommitments(uint256 , uint256 ) view returns(bytes32) -func (_Preconfcommitmentstore *PreconfcommitmentstoreCallerSession) BlockCommitments(arg0 *big.Int, arg1 *big.Int) ([32]byte, error) { - return _Preconfcommitmentstore.Contract.BlockCommitments(&_Preconfcommitmentstore.CallOpts, arg0, arg1) -} - // BlockTracker is a free data retrieval call binding the contract method 0x381c1d6c. // // Solidity: function blockTracker() view returns(address) @@ -455,43 +422,12 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreCallerSession) BlockTracker return _Preconfcommitmentstore.Contract.BlockTracker(&_Preconfcommitmentstore.CallOpts) } -// CommitmentCount is a free data retrieval call binding the contract method 0xc44956d1. -// -// Solidity: function commitmentCount() view returns(uint256) -func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) CommitmentCount(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _Preconfcommitmentstore.contract.Call(opts, &out, "commitmentCount") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// CommitmentCount is a free data retrieval call binding the contract method 0xc44956d1. -// -// Solidity: function commitmentCount() view returns(uint256) -func (_Preconfcommitmentstore *PreconfcommitmentstoreSession) CommitmentCount() (*big.Int, error) { - return _Preconfcommitmentstore.Contract.CommitmentCount(&_Preconfcommitmentstore.CallOpts) -} - -// CommitmentCount is a free data retrieval call binding the contract method 0xc44956d1. +// CommitmentDispatchWindow is a free data retrieval call binding the contract method 0xf2357c03. // -// Solidity: function commitmentCount() view returns(uint256) -func (_Preconfcommitmentstore *PreconfcommitmentstoreCallerSession) CommitmentCount() (*big.Int, error) { - return _Preconfcommitmentstore.Contract.CommitmentCount(&_Preconfcommitmentstore.CallOpts) -} - -// CommitmentDispatchWindow is a free data retrieval call binding the contract method 0x39b41321. -// -// Solidity: function commitment_dispatch_window() view returns(uint64) +// Solidity: function commitmentDispatchWindow() view returns(uint64) func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) CommitmentDispatchWindow(opts *bind.CallOpts) (uint64, error) { var out []interface{} - err := _Preconfcommitmentstore.contract.Call(opts, &out, "commitment_dispatch_window") + err := _Preconfcommitmentstore.contract.Call(opts, &out, "commitmentDispatchWindow") if err != nil { return *new(uint64), err @@ -503,25 +439,24 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) CommitmentDispatchW } -// CommitmentDispatchWindow is a free data retrieval call binding the contract method 0x39b41321. +// CommitmentDispatchWindow is a free data retrieval call binding the contract method 0xf2357c03. // -// Solidity: function commitment_dispatch_window() view returns(uint64) +// Solidity: function commitmentDispatchWindow() view returns(uint64) func (_Preconfcommitmentstore *PreconfcommitmentstoreSession) CommitmentDispatchWindow() (uint64, error) { return _Preconfcommitmentstore.Contract.CommitmentDispatchWindow(&_Preconfcommitmentstore.CallOpts) } -// CommitmentDispatchWindow is a free data retrieval call binding the contract method 0x39b41321. +// CommitmentDispatchWindow is a free data retrieval call binding the contract method 0xf2357c03. // -// Solidity: function commitment_dispatch_window() view returns(uint64) +// Solidity: function commitmentDispatchWindow() view returns(uint64) func (_Preconfcommitmentstore *PreconfcommitmentstoreCallerSession) CommitmentDispatchWindow() (uint64, error) { return _Preconfcommitmentstore.Contract.CommitmentDispatchWindow(&_Preconfcommitmentstore.CallOpts) } // Commitments is a free data retrieval call binding the contract method 0x839df945. // -// Solidity: function commitments(bytes32 ) view returns(bool commitmentUsed, address bidder, address commiter, uint64 bid, uint64 blockNumber, bytes32 bidHash, uint64 decayStartTimeStamp, uint64 decayEndTimeStamp, string txnHash, bytes32 commitmentHash, bytes bidSignature, bytes commitmentSignature, uint64 dispatchTimestamp, bytes sharedSecretKey) +// Solidity: function commitments(bytes32 ) view returns(address bidder, address commiter, uint64 bid, uint64 blockNumber, bytes32 bidHash, uint64 decayStartTimeStamp, uint64 decayEndTimeStamp, string txnHash, bytes32 commitmentHash, bytes bidSignature, bytes commitmentSignature, uint64 dispatchTimestamp, bytes sharedSecretKey) func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) Commitments(opts *bind.CallOpts, arg0 [32]byte) (struct { - CommitmentUsed bool Bidder common.Address Commiter common.Address Bid uint64 @@ -540,7 +475,6 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) Commitments(opts *b err := _Preconfcommitmentstore.contract.Call(opts, &out, "commitments", arg0) outstruct := new(struct { - CommitmentUsed bool Bidder common.Address Commiter common.Address Bid uint64 @@ -559,20 +493,19 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) Commitments(opts *b return *outstruct, err } - outstruct.CommitmentUsed = *abi.ConvertType(out[0], new(bool)).(*bool) - outstruct.Bidder = *abi.ConvertType(out[1], new(common.Address)).(*common.Address) - outstruct.Commiter = *abi.ConvertType(out[2], new(common.Address)).(*common.Address) - outstruct.Bid = *abi.ConvertType(out[3], new(uint64)).(*uint64) - outstruct.BlockNumber = *abi.ConvertType(out[4], new(uint64)).(*uint64) - outstruct.BidHash = *abi.ConvertType(out[5], new([32]byte)).(*[32]byte) - outstruct.DecayStartTimeStamp = *abi.ConvertType(out[6], new(uint64)).(*uint64) - outstruct.DecayEndTimeStamp = *abi.ConvertType(out[7], new(uint64)).(*uint64) - outstruct.TxnHash = *abi.ConvertType(out[8], new(string)).(*string) - outstruct.CommitmentHash = *abi.ConvertType(out[9], new([32]byte)).(*[32]byte) - outstruct.BidSignature = *abi.ConvertType(out[10], new([]byte)).(*[]byte) - outstruct.CommitmentSignature = *abi.ConvertType(out[11], new([]byte)).(*[]byte) - outstruct.DispatchTimestamp = *abi.ConvertType(out[12], new(uint64)).(*uint64) - outstruct.SharedSecretKey = *abi.ConvertType(out[13], new([]byte)).(*[]byte) + outstruct.Bidder = *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + outstruct.Commiter = *abi.ConvertType(out[1], new(common.Address)).(*common.Address) + outstruct.Bid = *abi.ConvertType(out[2], new(uint64)).(*uint64) + outstruct.BlockNumber = *abi.ConvertType(out[3], new(uint64)).(*uint64) + outstruct.BidHash = *abi.ConvertType(out[4], new([32]byte)).(*[32]byte) + outstruct.DecayStartTimeStamp = *abi.ConvertType(out[5], new(uint64)).(*uint64) + outstruct.DecayEndTimeStamp = *abi.ConvertType(out[6], new(uint64)).(*uint64) + outstruct.TxnHash = *abi.ConvertType(out[7], new(string)).(*string) + outstruct.CommitmentHash = *abi.ConvertType(out[8], new([32]byte)).(*[32]byte) + outstruct.BidSignature = *abi.ConvertType(out[9], new([]byte)).(*[]byte) + outstruct.CommitmentSignature = *abi.ConvertType(out[10], new([]byte)).(*[]byte) + outstruct.DispatchTimestamp = *abi.ConvertType(out[11], new(uint64)).(*uint64) + outstruct.SharedSecretKey = *abi.ConvertType(out[12], new([]byte)).(*[]byte) return *outstruct, err @@ -580,9 +513,8 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) Commitments(opts *b // Commitments is a free data retrieval call binding the contract method 0x839df945. // -// Solidity: function commitments(bytes32 ) view returns(bool commitmentUsed, address bidder, address commiter, uint64 bid, uint64 blockNumber, bytes32 bidHash, uint64 decayStartTimeStamp, uint64 decayEndTimeStamp, string txnHash, bytes32 commitmentHash, bytes bidSignature, bytes commitmentSignature, uint64 dispatchTimestamp, bytes sharedSecretKey) +// Solidity: function commitments(bytes32 ) view returns(address bidder, address commiter, uint64 bid, uint64 blockNumber, bytes32 bidHash, uint64 decayStartTimeStamp, uint64 decayEndTimeStamp, string txnHash, bytes32 commitmentHash, bytes bidSignature, bytes commitmentSignature, uint64 dispatchTimestamp, bytes sharedSecretKey) func (_Preconfcommitmentstore *PreconfcommitmentstoreSession) Commitments(arg0 [32]byte) (struct { - CommitmentUsed bool Bidder common.Address Commiter common.Address Bid uint64 @@ -602,9 +534,8 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreSession) Commitments(arg0 [ // Commitments is a free data retrieval call binding the contract method 0x839df945. // -// Solidity: function commitments(bytes32 ) view returns(bool commitmentUsed, address bidder, address commiter, uint64 bid, uint64 blockNumber, bytes32 bidHash, uint64 decayStartTimeStamp, uint64 decayEndTimeStamp, string txnHash, bytes32 commitmentHash, bytes bidSignature, bytes commitmentSignature, uint64 dispatchTimestamp, bytes sharedSecretKey) +// Solidity: function commitments(bytes32 ) view returns(address bidder, address commiter, uint64 bid, uint64 blockNumber, bytes32 bidHash, uint64 decayStartTimeStamp, uint64 decayEndTimeStamp, string txnHash, bytes32 commitmentHash, bytes bidSignature, bytes commitmentSignature, uint64 dispatchTimestamp, bytes sharedSecretKey) func (_Preconfcommitmentstore *PreconfcommitmentstoreCallerSession) Commitments(arg0 [32]byte) (struct { - CommitmentUsed bool Bidder common.Address Commiter common.Address Bid uint64 @@ -655,9 +586,8 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreCallerSession) CommitmentsC // EncryptedCommitments is a free data retrieval call binding the contract method 0x566f998c. // -// Solidity: function encryptedCommitments(bytes32 ) view returns(bool commitmentUsed, address commiter, bytes32 commitmentDigest, bytes commitmentSignature, uint64 dispatchTimestamp) +// Solidity: function encryptedCommitments(bytes32 ) view returns(address commiter, bytes32 commitmentDigest, bytes commitmentSignature, uint64 dispatchTimestamp) func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) EncryptedCommitments(opts *bind.CallOpts, arg0 [32]byte) (struct { - CommitmentUsed bool Commiter common.Address CommitmentDigest [32]byte CommitmentSignature []byte @@ -667,7 +597,6 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) EncryptedCommitment err := _Preconfcommitmentstore.contract.Call(opts, &out, "encryptedCommitments", arg0) outstruct := new(struct { - CommitmentUsed bool Commiter common.Address CommitmentDigest [32]byte CommitmentSignature []byte @@ -677,11 +606,10 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) EncryptedCommitment return *outstruct, err } - outstruct.CommitmentUsed = *abi.ConvertType(out[0], new(bool)).(*bool) - outstruct.Commiter = *abi.ConvertType(out[1], new(common.Address)).(*common.Address) - outstruct.CommitmentDigest = *abi.ConvertType(out[2], new([32]byte)).(*[32]byte) - outstruct.CommitmentSignature = *abi.ConvertType(out[3], new([]byte)).(*[]byte) - outstruct.DispatchTimestamp = *abi.ConvertType(out[4], new(uint64)).(*uint64) + outstruct.Commiter = *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + outstruct.CommitmentDigest = *abi.ConvertType(out[1], new([32]byte)).(*[32]byte) + outstruct.CommitmentSignature = *abi.ConvertType(out[2], new([]byte)).(*[]byte) + outstruct.DispatchTimestamp = *abi.ConvertType(out[3], new(uint64)).(*uint64) return *outstruct, err @@ -689,9 +617,8 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) EncryptedCommitment // EncryptedCommitments is a free data retrieval call binding the contract method 0x566f998c. // -// Solidity: function encryptedCommitments(bytes32 ) view returns(bool commitmentUsed, address commiter, bytes32 commitmentDigest, bytes commitmentSignature, uint64 dispatchTimestamp) +// Solidity: function encryptedCommitments(bytes32 ) view returns(address commiter, bytes32 commitmentDigest, bytes commitmentSignature, uint64 dispatchTimestamp) func (_Preconfcommitmentstore *PreconfcommitmentstoreSession) EncryptedCommitments(arg0 [32]byte) (struct { - CommitmentUsed bool Commiter common.Address CommitmentDigest [32]byte CommitmentSignature []byte @@ -702,9 +629,8 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreSession) EncryptedCommitmen // EncryptedCommitments is a free data retrieval call binding the contract method 0x566f998c. // -// Solidity: function encryptedCommitments(bytes32 ) view returns(bool commitmentUsed, address commiter, bytes32 commitmentDigest, bytes commitmentSignature, uint64 dispatchTimestamp) +// Solidity: function encryptedCommitments(bytes32 ) view returns(address commiter, bytes32 commitmentDigest, bytes commitmentSignature, uint64 dispatchTimestamp) func (_Preconfcommitmentstore *PreconfcommitmentstoreCallerSession) EncryptedCommitments(arg0 [32]byte) (struct { - CommitmentUsed bool Commiter common.Address CommitmentDigest [32]byte CommitmentSignature []byte @@ -746,7 +672,7 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreCallerSession) GetBidHash(_ // GetCommitment is a free data retrieval call binding the contract method 0x7795820c. // -// Solidity: function getCommitment(bytes32 commitmentIndex) view returns((bool,address,address,uint64,uint64,bytes32,uint64,uint64,string,bytes32,bytes,bytes,uint64,bytes)) +// Solidity: function getCommitment(bytes32 commitmentIndex) view returns((address,address,uint64,uint64,bytes32,uint64,uint64,string,bytes32,bytes,bytes,uint64,bytes)) func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) GetCommitment(opts *bind.CallOpts, commitmentIndex [32]byte) (PreConfCommitmentStorePreConfCommitment, error) { var out []interface{} err := _Preconfcommitmentstore.contract.Call(opts, &out, "getCommitment", commitmentIndex) @@ -763,21 +689,21 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) GetCommitment(opts // GetCommitment is a free data retrieval call binding the contract method 0x7795820c. // -// Solidity: function getCommitment(bytes32 commitmentIndex) view returns((bool,address,address,uint64,uint64,bytes32,uint64,uint64,string,bytes32,bytes,bytes,uint64,bytes)) +// Solidity: function getCommitment(bytes32 commitmentIndex) view returns((address,address,uint64,uint64,bytes32,uint64,uint64,string,bytes32,bytes,bytes,uint64,bytes)) func (_Preconfcommitmentstore *PreconfcommitmentstoreSession) GetCommitment(commitmentIndex [32]byte) (PreConfCommitmentStorePreConfCommitment, error) { return _Preconfcommitmentstore.Contract.GetCommitment(&_Preconfcommitmentstore.CallOpts, commitmentIndex) } // GetCommitment is a free data retrieval call binding the contract method 0x7795820c. // -// Solidity: function getCommitment(bytes32 commitmentIndex) view returns((bool,address,address,uint64,uint64,bytes32,uint64,uint64,string,bytes32,bytes,bytes,uint64,bytes)) +// Solidity: function getCommitment(bytes32 commitmentIndex) view returns((address,address,uint64,uint64,bytes32,uint64,uint64,string,bytes32,bytes,bytes,uint64,bytes)) func (_Preconfcommitmentstore *PreconfcommitmentstoreCallerSession) GetCommitment(commitmentIndex [32]byte) (PreConfCommitmentStorePreConfCommitment, error) { return _Preconfcommitmentstore.Contract.GetCommitment(&_Preconfcommitmentstore.CallOpts, commitmentIndex) } -// GetCommitmentIndex is a free data retrieval call binding the contract method 0xc6687724. +// GetCommitmentIndex is a free data retrieval call binding the contract method 0x76a3ef34. // -// Solidity: function getCommitmentIndex((bool,address,address,uint64,uint64,bytes32,uint64,uint64,string,bytes32,bytes,bytes,uint64,bytes) commitment) pure returns(bytes32) +// Solidity: function getCommitmentIndex((address,address,uint64,uint64,bytes32,uint64,uint64,string,bytes32,bytes,bytes,uint64,bytes) commitment) pure returns(bytes32) func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) GetCommitmentIndex(opts *bind.CallOpts, commitment PreConfCommitmentStorePreConfCommitment) ([32]byte, error) { var out []interface{} err := _Preconfcommitmentstore.contract.Call(opts, &out, "getCommitmentIndex", commitment) @@ -792,85 +718,23 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) GetCommitmentIndex( } -// GetCommitmentIndex is a free data retrieval call binding the contract method 0xc6687724. +// GetCommitmentIndex is a free data retrieval call binding the contract method 0x76a3ef34. // -// Solidity: function getCommitmentIndex((bool,address,address,uint64,uint64,bytes32,uint64,uint64,string,bytes32,bytes,bytes,uint64,bytes) commitment) pure returns(bytes32) +// Solidity: function getCommitmentIndex((address,address,uint64,uint64,bytes32,uint64,uint64,string,bytes32,bytes,bytes,uint64,bytes) commitment) pure returns(bytes32) func (_Preconfcommitmentstore *PreconfcommitmentstoreSession) GetCommitmentIndex(commitment PreConfCommitmentStorePreConfCommitment) ([32]byte, error) { return _Preconfcommitmentstore.Contract.GetCommitmentIndex(&_Preconfcommitmentstore.CallOpts, commitment) } -// GetCommitmentIndex is a free data retrieval call binding the contract method 0xc6687724. +// GetCommitmentIndex is a free data retrieval call binding the contract method 0x76a3ef34. // -// Solidity: function getCommitmentIndex((bool,address,address,uint64,uint64,bytes32,uint64,uint64,string,bytes32,bytes,bytes,uint64,bytes) commitment) pure returns(bytes32) +// Solidity: function getCommitmentIndex((address,address,uint64,uint64,bytes32,uint64,uint64,string,bytes32,bytes,bytes,uint64,bytes) commitment) pure returns(bytes32) func (_Preconfcommitmentstore *PreconfcommitmentstoreCallerSession) GetCommitmentIndex(commitment PreConfCommitmentStorePreConfCommitment) ([32]byte, error) { return _Preconfcommitmentstore.Contract.GetCommitmentIndex(&_Preconfcommitmentstore.CallOpts, commitment) } -// GetCommitmentsByBlockNumber is a free data retrieval call binding the contract method 0x82da12de. -// -// Solidity: function getCommitmentsByBlockNumber(uint256 blockNumber) view returns(bytes32[]) -func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) GetCommitmentsByBlockNumber(opts *bind.CallOpts, blockNumber *big.Int) ([][32]byte, error) { - var out []interface{} - err := _Preconfcommitmentstore.contract.Call(opts, &out, "getCommitmentsByBlockNumber", blockNumber) - - if err != nil { - return *new([][32]byte), err - } - - out0 := *abi.ConvertType(out[0], new([][32]byte)).(*[][32]byte) - - return out0, err - -} - -// GetCommitmentsByBlockNumber is a free data retrieval call binding the contract method 0x82da12de. -// -// Solidity: function getCommitmentsByBlockNumber(uint256 blockNumber) view returns(bytes32[]) -func (_Preconfcommitmentstore *PreconfcommitmentstoreSession) GetCommitmentsByBlockNumber(blockNumber *big.Int) ([][32]byte, error) { - return _Preconfcommitmentstore.Contract.GetCommitmentsByBlockNumber(&_Preconfcommitmentstore.CallOpts, blockNumber) -} - -// GetCommitmentsByBlockNumber is a free data retrieval call binding the contract method 0x82da12de. -// -// Solidity: function getCommitmentsByBlockNumber(uint256 blockNumber) view returns(bytes32[]) -func (_Preconfcommitmentstore *PreconfcommitmentstoreCallerSession) GetCommitmentsByBlockNumber(blockNumber *big.Int) ([][32]byte, error) { - return _Preconfcommitmentstore.Contract.GetCommitmentsByBlockNumber(&_Preconfcommitmentstore.CallOpts, blockNumber) -} - -// GetCommitmentsByCommitter is a free data retrieval call binding the contract method 0xac8c8a0e. -// -// Solidity: function getCommitmentsByCommitter(address commiter) view returns(bytes32[]) -func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) GetCommitmentsByCommitter(opts *bind.CallOpts, commiter common.Address) ([][32]byte, error) { - var out []interface{} - err := _Preconfcommitmentstore.contract.Call(opts, &out, "getCommitmentsByCommitter", commiter) - - if err != nil { - return *new([][32]byte), err - } - - out0 := *abi.ConvertType(out[0], new([][32]byte)).(*[][32]byte) - - return out0, err - -} - -// GetCommitmentsByCommitter is a free data retrieval call binding the contract method 0xac8c8a0e. -// -// Solidity: function getCommitmentsByCommitter(address commiter) view returns(bytes32[]) -func (_Preconfcommitmentstore *PreconfcommitmentstoreSession) GetCommitmentsByCommitter(commiter common.Address) ([][32]byte, error) { - return _Preconfcommitmentstore.Contract.GetCommitmentsByCommitter(&_Preconfcommitmentstore.CallOpts, commiter) -} - -// GetCommitmentsByCommitter is a free data retrieval call binding the contract method 0xac8c8a0e. -// -// Solidity: function getCommitmentsByCommitter(address commiter) view returns(bytes32[]) -func (_Preconfcommitmentstore *PreconfcommitmentstoreCallerSession) GetCommitmentsByCommitter(commiter common.Address) ([][32]byte, error) { - return _Preconfcommitmentstore.Contract.GetCommitmentsByCommitter(&_Preconfcommitmentstore.CallOpts, commiter) -} - // GetEncryptedCommitment is a free data retrieval call binding the contract method 0x1725b4a7. // -// Solidity: function getEncryptedCommitment(bytes32 commitmentIndex) view returns((bool,address,bytes32,bytes,uint64)) +// Solidity: function getEncryptedCommitment(bytes32 commitmentIndex) view returns((address,bytes32,bytes,uint64)) func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) GetEncryptedCommitment(opts *bind.CallOpts, commitmentIndex [32]byte) (PreConfCommitmentStoreEncrPreConfCommitment, error) { var out []interface{} err := _Preconfcommitmentstore.contract.Call(opts, &out, "getEncryptedCommitment", commitmentIndex) @@ -887,21 +751,21 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) GetEncryptedCommitm // GetEncryptedCommitment is a free data retrieval call binding the contract method 0x1725b4a7. // -// Solidity: function getEncryptedCommitment(bytes32 commitmentIndex) view returns((bool,address,bytes32,bytes,uint64)) +// Solidity: function getEncryptedCommitment(bytes32 commitmentIndex) view returns((address,bytes32,bytes,uint64)) func (_Preconfcommitmentstore *PreconfcommitmentstoreSession) GetEncryptedCommitment(commitmentIndex [32]byte) (PreConfCommitmentStoreEncrPreConfCommitment, error) { return _Preconfcommitmentstore.Contract.GetEncryptedCommitment(&_Preconfcommitmentstore.CallOpts, commitmentIndex) } // GetEncryptedCommitment is a free data retrieval call binding the contract method 0x1725b4a7. // -// Solidity: function getEncryptedCommitment(bytes32 commitmentIndex) view returns((bool,address,bytes32,bytes,uint64)) +// Solidity: function getEncryptedCommitment(bytes32 commitmentIndex) view returns((address,bytes32,bytes,uint64)) func (_Preconfcommitmentstore *PreconfcommitmentstoreCallerSession) GetEncryptedCommitment(commitmentIndex [32]byte) (PreConfCommitmentStoreEncrPreConfCommitment, error) { return _Preconfcommitmentstore.Contract.GetEncryptedCommitment(&_Preconfcommitmentstore.CallOpts, commitmentIndex) } -// GetEncryptedCommitmentIndex is a free data retrieval call binding the contract method 0x039d6050. +// GetEncryptedCommitmentIndex is a free data retrieval call binding the contract method 0x7e903d97. // -// Solidity: function getEncryptedCommitmentIndex((bool,address,bytes32,bytes,uint64) commitment) pure returns(bytes32) +// Solidity: function getEncryptedCommitmentIndex((address,bytes32,bytes,uint64) commitment) pure returns(bytes32) func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) GetEncryptedCommitmentIndex(opts *bind.CallOpts, commitment PreConfCommitmentStoreEncrPreConfCommitment) ([32]byte, error) { var out []interface{} err := _Preconfcommitmentstore.contract.Call(opts, &out, "getEncryptedCommitmentIndex", commitment) @@ -916,16 +780,16 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) GetEncryptedCommitm } -// GetEncryptedCommitmentIndex is a free data retrieval call binding the contract method 0x039d6050. +// GetEncryptedCommitmentIndex is a free data retrieval call binding the contract method 0x7e903d97. // -// Solidity: function getEncryptedCommitmentIndex((bool,address,bytes32,bytes,uint64) commitment) pure returns(bytes32) +// Solidity: function getEncryptedCommitmentIndex((address,bytes32,bytes,uint64) commitment) pure returns(bytes32) func (_Preconfcommitmentstore *PreconfcommitmentstoreSession) GetEncryptedCommitmentIndex(commitment PreConfCommitmentStoreEncrPreConfCommitment) ([32]byte, error) { return _Preconfcommitmentstore.Contract.GetEncryptedCommitmentIndex(&_Preconfcommitmentstore.CallOpts, commitment) } -// GetEncryptedCommitmentIndex is a free data retrieval call binding the contract method 0x039d6050. +// GetEncryptedCommitmentIndex is a free data retrieval call binding the contract method 0x7e903d97. // -// Solidity: function getEncryptedCommitmentIndex((bool,address,bytes32,bytes,uint64) commitment) pure returns(bytes32) +// Solidity: function getEncryptedCommitmentIndex((address,bytes32,bytes,uint64) commitment) pure returns(bytes32) func (_Preconfcommitmentstore *PreconfcommitmentstoreCallerSession) GetEncryptedCommitmentIndex(commitment PreConfCommitmentStoreEncrPreConfCommitment) ([32]byte, error) { return _Preconfcommitmentstore.Contract.GetEncryptedCommitmentIndex(&_Preconfcommitmentstore.CallOpts, commitment) } @@ -1085,68 +949,6 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreCallerSession) Owner() (com return _Preconfcommitmentstore.Contract.Owner(&_Preconfcommitmentstore.CallOpts) } -// ProviderCommitments is a free data retrieval call binding the contract method 0x91b51cda. -// -// Solidity: function providerCommitments(address , uint256 ) view returns(bytes32) -func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) ProviderCommitments(opts *bind.CallOpts, arg0 common.Address, arg1 *big.Int) ([32]byte, error) { - var out []interface{} - err := _Preconfcommitmentstore.contract.Call(opts, &out, "providerCommitments", arg0, arg1) - - if err != nil { - return *new([32]byte), err - } - - out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) - - return out0, err - -} - -// ProviderCommitments is a free data retrieval call binding the contract method 0x91b51cda. -// -// Solidity: function providerCommitments(address , uint256 ) view returns(bytes32) -func (_Preconfcommitmentstore *PreconfcommitmentstoreSession) ProviderCommitments(arg0 common.Address, arg1 *big.Int) ([32]byte, error) { - return _Preconfcommitmentstore.Contract.ProviderCommitments(&_Preconfcommitmentstore.CallOpts, arg0, arg1) -} - -// ProviderCommitments is a free data retrieval call binding the contract method 0x91b51cda. -// -// Solidity: function providerCommitments(address , uint256 ) view returns(bytes32) -func (_Preconfcommitmentstore *PreconfcommitmentstoreCallerSession) ProviderCommitments(arg0 common.Address, arg1 *big.Int) ([32]byte, error) { - return _Preconfcommitmentstore.Contract.ProviderCommitments(&_Preconfcommitmentstore.CallOpts, arg0, arg1) -} - -// ProviderEncryptedCommitments is a free data retrieval call binding the contract method 0x76cad3d5. -// -// Solidity: function providerEncryptedCommitments(address , uint256 ) view returns(bytes32) -func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) ProviderEncryptedCommitments(opts *bind.CallOpts, arg0 common.Address, arg1 *big.Int) ([32]byte, error) { - var out []interface{} - err := _Preconfcommitmentstore.contract.Call(opts, &out, "providerEncryptedCommitments", arg0, arg1) - - if err != nil { - return *new([32]byte), err - } - - out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) - - return out0, err - -} - -// ProviderEncryptedCommitments is a free data retrieval call binding the contract method 0x76cad3d5. -// -// Solidity: function providerEncryptedCommitments(address , uint256 ) view returns(bytes32) -func (_Preconfcommitmentstore *PreconfcommitmentstoreSession) ProviderEncryptedCommitments(arg0 common.Address, arg1 *big.Int) ([32]byte, error) { - return _Preconfcommitmentstore.Contract.ProviderEncryptedCommitments(&_Preconfcommitmentstore.CallOpts, arg0, arg1) -} - -// ProviderEncryptedCommitments is a free data retrieval call binding the contract method 0x76cad3d5. -// -// Solidity: function providerEncryptedCommitments(address , uint256 ) view returns(bytes32) -func (_Preconfcommitmentstore *PreconfcommitmentstoreCallerSession) ProviderEncryptedCommitments(arg0 common.Address, arg1 *big.Int) ([32]byte, error) { - return _Preconfcommitmentstore.Contract.ProviderEncryptedCommitments(&_Preconfcommitmentstore.CallOpts, arg0, arg1) -} - // ProviderRegistry is a free data retrieval call binding the contract method 0x545921d9. // // Solidity: function providerRegistry() view returns(address) @@ -1270,23 +1072,23 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreCallerSession) VerifyPreCon // Initialize is a paid mutator transaction binding the contract method 0x5a606b41. // -// Solidity: function initialize(address _providerRegistry, address _bidderRegistry, address _oracle, address _owner, address _blockTracker, uint64 _commitment_dispatch_window) returns() -func (_Preconfcommitmentstore *PreconfcommitmentstoreTransactor) Initialize(opts *bind.TransactOpts, _providerRegistry common.Address, _bidderRegistry common.Address, _oracle common.Address, _owner common.Address, _blockTracker common.Address, _commitment_dispatch_window uint64) (*types.Transaction, error) { - return _Preconfcommitmentstore.contract.Transact(opts, "initialize", _providerRegistry, _bidderRegistry, _oracle, _owner, _blockTracker, _commitment_dispatch_window) +// Solidity: function initialize(address _providerRegistry, address _bidderRegistry, address _oracle, address _owner, address _blockTracker, uint64 _commitmentDispatchWindow) returns() +func (_Preconfcommitmentstore *PreconfcommitmentstoreTransactor) Initialize(opts *bind.TransactOpts, _providerRegistry common.Address, _bidderRegistry common.Address, _oracle common.Address, _owner common.Address, _blockTracker common.Address, _commitmentDispatchWindow uint64) (*types.Transaction, error) { + return _Preconfcommitmentstore.contract.Transact(opts, "initialize", _providerRegistry, _bidderRegistry, _oracle, _owner, _blockTracker, _commitmentDispatchWindow) } // Initialize is a paid mutator transaction binding the contract method 0x5a606b41. // -// Solidity: function initialize(address _providerRegistry, address _bidderRegistry, address _oracle, address _owner, address _blockTracker, uint64 _commitment_dispatch_window) returns() -func (_Preconfcommitmentstore *PreconfcommitmentstoreSession) Initialize(_providerRegistry common.Address, _bidderRegistry common.Address, _oracle common.Address, _owner common.Address, _blockTracker common.Address, _commitment_dispatch_window uint64) (*types.Transaction, error) { - return _Preconfcommitmentstore.Contract.Initialize(&_Preconfcommitmentstore.TransactOpts, _providerRegistry, _bidderRegistry, _oracle, _owner, _blockTracker, _commitment_dispatch_window) +// Solidity: function initialize(address _providerRegistry, address _bidderRegistry, address _oracle, address _owner, address _blockTracker, uint64 _commitmentDispatchWindow) returns() +func (_Preconfcommitmentstore *PreconfcommitmentstoreSession) Initialize(_providerRegistry common.Address, _bidderRegistry common.Address, _oracle common.Address, _owner common.Address, _blockTracker common.Address, _commitmentDispatchWindow uint64) (*types.Transaction, error) { + return _Preconfcommitmentstore.Contract.Initialize(&_Preconfcommitmentstore.TransactOpts, _providerRegistry, _bidderRegistry, _oracle, _owner, _blockTracker, _commitmentDispatchWindow) } // Initialize is a paid mutator transaction binding the contract method 0x5a606b41. // -// Solidity: function initialize(address _providerRegistry, address _bidderRegistry, address _oracle, address _owner, address _blockTracker, uint64 _commitment_dispatch_window) returns() -func (_Preconfcommitmentstore *PreconfcommitmentstoreTransactorSession) Initialize(_providerRegistry common.Address, _bidderRegistry common.Address, _oracle common.Address, _owner common.Address, _blockTracker common.Address, _commitment_dispatch_window uint64) (*types.Transaction, error) { - return _Preconfcommitmentstore.Contract.Initialize(&_Preconfcommitmentstore.TransactOpts, _providerRegistry, _bidderRegistry, _oracle, _owner, _blockTracker, _commitment_dispatch_window) +// Solidity: function initialize(address _providerRegistry, address _bidderRegistry, address _oracle, address _owner, address _blockTracker, uint64 _commitmentDispatchWindow) returns() +func (_Preconfcommitmentstore *PreconfcommitmentstoreTransactorSession) Initialize(_providerRegistry common.Address, _bidderRegistry common.Address, _oracle common.Address, _owner common.Address, _blockTracker common.Address, _commitmentDispatchWindow uint64) (*types.Transaction, error) { + return _Preconfcommitmentstore.Contract.Initialize(&_Preconfcommitmentstore.TransactOpts, _providerRegistry, _bidderRegistry, _oracle, _owner, _blockTracker, _commitmentDispatchWindow) } // InitiateReward is a paid mutator transaction binding the contract method 0x03faf979. diff --git a/contracts/contracts/BidderRegistry.sol b/contracts/contracts/BidderRegistry.sol index 28f237a50..529ccfc65 100644 --- a/contracts/contracts/BidderRegistry.sol +++ b/contracts/contracts/BidderRegistry.sol @@ -202,7 +202,7 @@ contract BidderRegistry is IBidderRegistry, OwnableUpgradeable, ReentrancyGuardU BidState memory bidState = BidPayment[commitmentDigest]; require( bidState.state == State.PreConfirmed, - "The bid was not preconfirmed" + "The bid was not preconfirmed or already processed" ); uint256 decayedAmt = (bidState.bidAmt * residualBidPercentAfterDecay * @@ -225,8 +225,8 @@ contract BidderRegistry is IBidderRegistry, OwnableUpgradeable, ReentrancyGuardU bidState.bidAmt - decayedAmt; - BidPayment[commitmentDigest].state = State.Withdrawn; - BidPayment[commitmentDigest].bidAmt = 0; + // after rewarding the funds, no point to keep bid payment in the mapping + delete BidPayment[commitmentDigest]; emit FundsRewarded( commitmentDigest, @@ -244,12 +244,12 @@ contract BidderRegistry is IBidderRegistry, OwnableUpgradeable, ReentrancyGuardU */ function unlockFunds(uint256 window, bytes32 bidID) external nonReentrant onlyPreConfirmationEngine() { BidState memory bidState = BidPayment[bidID]; - require(bidState.state == State.PreConfirmed, "The bid was not preconfirmed"); + require(bidState.state == State.PreConfirmed, "The bid was not preconfirmed or already processed"); uint256 amt = bidState.bidAmt; lockedFunds[bidState.bidder][window] += amt; - BidPayment[bidID].state = State.Withdrawn; - BidPayment[bidID].bidAmt = 0; + // after unlocking the funds, no point to keep bid payment in the mapping + delete BidPayment[bidID]; emit FundsRetrieved(bidID, bidState.bidder, window, amt); } @@ -348,7 +348,7 @@ contract BidderRegistry is IBidderRegistry, OwnableUpgradeable, ReentrancyGuardU "funds can only be withdrawn after the window is settled" ); uint256 amount = lockedFunds[bidder][window]; - lockedFunds[bidder][window] = 0; + delete lockedFunds[bidder][window]; require(amount > 0, "bidder Amount is zero"); (bool success, ) = bidder.call{value: amount}(""); diff --git a/contracts/contracts/PreConfCommitmentStore.sol b/contracts/contracts/PreConfCommitmentStore.sol index d8387b0af..57dd74573 100644 --- a/contracts/contracts/PreConfCommitmentStore.sol +++ b/contracts/contracts/PreConfCommitmentStore.sol @@ -30,10 +30,7 @@ contract PreConfCommitmentStore is OwnableUpgradeable { ); // Represents the dispatch window in milliseconds - uint64 public commitment_dispatch_window; - - /// @dev commitment counter - uint256 public commitmentCount; + uint64 public commitmentDispatchWindow; /// @dev Address of the oracle address public oracle; @@ -59,14 +56,6 @@ contract PreConfCommitmentStore is OwnableUpgradeable { /// @dev Mapping from provider to commitments count mapping(address => uint256) public commitmentsCount; - /// @dev Mapping from address to commitments list - mapping(address => bytes32[]) public providerCommitments; - - mapping(address => bytes32[]) public providerEncryptedCommitments; - - /// @dev Mapping for blocknumber to list of hash of commitments - mapping(uint256 => bytes32[]) public blockCommitments; - /// @dev Commitment Hash -> Commitemnt /// @dev Only stores valid commitments mapping(bytes32 => PreConfCommitment) public commitments; @@ -75,7 +64,6 @@ contract PreConfCommitmentStore is OwnableUpgradeable { /// @dev Struct for all the information around preconfirmations commitment struct PreConfCommitment { - bool commitmentUsed; address bidder; address commiter; uint64 bid; @@ -111,7 +99,6 @@ contract PreConfCommitmentStore is OwnableUpgradeable { /// @dev Struct for all the information around encrypted preconfirmations commitment struct EncrPreConfCommitment { - bool commitmentUsed; address commiter; bytes32 commitmentDigest; bytes commitmentSignature; @@ -168,10 +155,10 @@ contract PreConfCommitmentStore is OwnableUpgradeable { function initialize( address _providerRegistry, address _bidderRegistry, - address _oracle, + address _oracle, address _owner, address _blockTracker, - uint64 _commitment_dispatch_window + uint64 _commitmentDispatchWindow ) external initializer { oracle = _oracle; blockTracker = IBlockTracker(_blockTracker); @@ -195,15 +182,17 @@ contract PreConfCommitmentStore is OwnableUpgradeable { keccak256("1") ) ); - commitment_dispatch_window = _commitment_dispatch_window; + commitmentDispatchWindow = _commitmentDispatchWindow; } /** * @dev Updates the commitment dispatch window to a new value. This function can only be called by the contract owner. * @param newDispatchWindow The new dispatch window value to be set. */ - function updateCommitmentDispatchWindow(uint64 newDispatchWindow) external onlyOwner { - commitment_dispatch_window = newDispatchWindow; + function updateCommitmentDispatchWindow( + uint64 newDispatchWindow + ) external onlyOwner { + commitmentDispatchWindow = newDispatchWindow; } /// @dev See https://docs.openzeppelin.com/upgrades-plugins/1.x/writing-upgradeable#initializing_the_implementation_contract @@ -297,11 +286,7 @@ contract PreConfCommitmentStore is OwnableUpgradeable { uint64 decayEndTimeStamp, string memory txnHash, bytes calldata bidSignature - ) - public - view - returns (bytes32 messageDigest, address recoveredAddress) - { + ) public view returns (bytes32 messageDigest, address recoveredAddress) { messageDigest = getBidHash( txnHash, bid, @@ -414,7 +399,7 @@ contract PreConfCommitmentStore is OwnableUpgradeable { txnHash, bidSignature ); - + // This helps in avoiding stack too deep { bytes32 commitmentDigest = getPreConfHash( @@ -427,13 +412,19 @@ contract PreConfCommitmentStore is OwnableUpgradeable { _bytesToHexString(bidSignature), _bytesToHexString(sharedSecretKey) ); - EncrPreConfCommitment memory encryptedCommitment = encryptedCommitments[encryptedCommitmentIndex]; + EncrPreConfCommitment + memory encryptedCommitment = encryptedCommitments[ + encryptedCommitmentIndex + ]; + require( + encryptedCommitment.dispatchTimestamp != 0, + "Commitment is already opened or not found" + ); + require( - !encryptedCommitment.commitmentUsed, - "Commitment already used" + encryptedCommitment.commitmentDigest == commitmentDigest, + "Invalid commitment digest" ); - - require(encryptedCommitment.commitmentDigest == commitmentDigest, "Invalid commitment digest"); address commiterAddress = commitmentDigest.recover( commitmentSignature @@ -443,12 +434,14 @@ contract PreConfCommitmentStore is OwnableUpgradeable { decayStartTimeStamp < decayEndTimeStamp, "Invalid decay time" ); - + address winner = blockTracker.getBlockWinner(blockNumber); - require(msg.sender == winner || msg.sender == bidderAddress, "Caller is not a winner provider or bidder"); + require( + msg.sender == winner || msg.sender == bidderAddress, + "Caller is not a winner provider or bidder" + ); PreConfCommitment memory newCommitment = PreConfCommitment( - false, bidderAddress, commiterAddress, bid, @@ -469,14 +462,14 @@ contract PreConfCommitmentStore is OwnableUpgradeable { // Store commitment commitments[commitmentIndex] = newCommitment; - // Mark the encrypted commitment as used - encryptedCommitments[encryptedCommitmentIndex].commitmentUsed = true; + delete encryptedCommitments[encryptedCommitmentIndex]; - // Push pointers to other mappings - providerCommitments[commiterAddress].push(commitmentIndex); - blockCommitments[blockNumber].push(commitmentIndex); - - bidderRegistry.OpenBid(commitmentDigest, bid, bidderAddress, blockNumber); + bidderRegistry.OpenBid( + commitmentDigest, + bid, + bidderAddress, + blockNumber + ); emit CommitmentStored( commitmentIndex, @@ -510,14 +503,15 @@ contract PreConfCommitmentStore is OwnableUpgradeable { bytes memory commitmentSignature, uint64 dispatchTimestamp ) public returns (bytes32 commitmentIndex) { - require(dispatchTimestamp >= block.timestamp || block.timestamp - dispatchTimestamp < commitment_dispatch_window, "Invalid dispatch timestamp, block.timestamp - dispatchTimestamp < commitment_dispatch_window"); - - address commiterAddress = commitmentDigest.recover( - commitmentSignature + require( + dispatchTimestamp >= block.timestamp || + block.timestamp - dispatchTimestamp < commitmentDispatchWindow, + "Invalid dispatch timestamp, block.timestamp - dispatchTimestamp < commitmentDispatchWindow" ); + address commiterAddress = commitmentDigest.recover(commitmentSignature); + EncrPreConfCommitment memory newCommitment = EncrPreConfCommitment( - false, commiterAddress, commitmentDigest, commitmentSignature, @@ -529,10 +523,6 @@ contract PreConfCommitmentStore is OwnableUpgradeable { // Store commitment encryptedCommitments[commitmentIndex] = newCommitment; - // Push pointers to other mappings - providerEncryptedCommitments[commiterAddress].push(commitmentIndex); - - commitmentCount++; commitmentsCount[commiterAddress] += 1; emit EncryptedCommitmentStored( @@ -546,28 +536,6 @@ contract PreConfCommitmentStore is OwnableUpgradeable { return commitmentIndex; } - /** - * @dev Retrieves the list of commitments for a given committer. - * @param commiter The address of the committer. - * @return A list of PreConfCommitment structures for the specified committer. - */ - function getCommitmentsByCommitter( - address commiter - ) public view returns (bytes32[] memory) { - return providerCommitments[commiter]; - } - - /** - * @dev Retrieves the list of commitments for a given block number. - * @param blockNumber The block number. - * @return A list of indexes referencing preconfimration structures for the specified block number. - */ - function getCommitmentsByBlockNumber( - uint256 blockNumber - ) public view returns (bytes32[] memory) { - return blockCommitments[blockNumber]; - } - /** * @dev Get a commitments' enclosed transaction by its commitmentIndex. * @param commitmentIndex The index of the commitment. @@ -611,14 +579,14 @@ contract PreConfCommitmentStore is OwnableUpgradeable { ) public onlyOracle { PreConfCommitment memory commitment = commitments[commitmentIndex]; require( - !commitments[commitmentIndex].commitmentUsed, - "Commitment already used" + commitment.dispatchTimestamp != 0, + "Commitment not found or already used" ); - uint256 windowToSettle = blockTracker.getWindowFromBlockNumber(commitment.blockNumber); + uint256 windowToSettle = blockTracker.getWindowFromBlockNumber( + commitment.blockNumber + ); - // Mark this commitment as used to prevent replays - commitments[commitmentIndex].commitmentUsed = true; commitmentsCount[commitment.commiter] -= 1; providerRegistry.slash( @@ -629,6 +597,7 @@ contract PreConfCommitmentStore is OwnableUpgradeable { ); bidderRegistry.unlockFunds(windowToSettle, commitment.commitmentHash); + delete commitments[commitmentIndex]; } /** @@ -641,14 +610,16 @@ contract PreConfCommitmentStore is OwnableUpgradeable { ) public onlyOracle { PreConfCommitment memory commitment = commitments[commitmentIndex]; require( - !commitments[commitmentIndex].commitmentUsed, - "Commitment already used" + commitment.dispatchTimestamp != 0, + "Commitment not found or already used" ); - uint256 windowToSettle = blockTracker.getWindowFromBlockNumber(commitment.blockNumber); + uint256 windowToSettle = blockTracker.getWindowFromBlockNumber( + commitment.blockNumber + ); // Mark this commitment as used to prevent replays - commitments[commitmentIndex].commitmentUsed = true; + // commitments[commitmentIndex].commitmentUsed = true; commitmentsCount[commitment.commiter] -= 1; bidderRegistry.retrieveFunds( @@ -657,6 +628,7 @@ contract PreConfCommitmentStore is OwnableUpgradeable { payable(commitment.commiter), residualBidPercentAfterDecay ); + delete commitments[commitmentIndex]; } /** diff --git a/contracts/contracts/ProviderRegistry.sol b/contracts/contracts/ProviderRegistry.sol index 773098f93..4ae373c4b 100644 --- a/contracts/contracts/ProviderRegistry.sol +++ b/contracts/contracts/ProviderRegistry.sol @@ -9,7 +9,11 @@ import {IProviderRegistry} from "./interfaces/IProviderRegistry.sol"; /// @title Provider Registry /// @author Kartik Chopra /// @notice This contract is for provider registry and staking. -contract ProviderRegistry is IProviderRegistry, OwnableUpgradeable, ReentrancyGuardUpgradeable { +contract ProviderRegistry is + IProviderRegistry, + OwnableUpgradeable, + ReentrancyGuardUpgradeable +{ /// @dev For improved precision uint256 constant PRECISION = 10 ** 25; uint256 constant PERCENT = 100 * PRECISION; @@ -47,7 +51,6 @@ contract ProviderRegistry is IProviderRegistry, OwnableUpgradeable, ReentrancyGu /// @dev Event for slashing funds event FundsSlashed(address indexed provider, uint256 amount); - /** * @dev Fallback function to revert all calls, ensuring no unintended interactions. */ @@ -158,11 +161,16 @@ contract ProviderRegistry is IProviderRegistry, OwnableUpgradeable, ReentrancyGu address payable bidder, uint256 residualBidPercentAfterDecay ) external nonReentrant onlyPreConfirmationEngine { - uint256 residualAmt = (amt * residualBidPercentAfterDecay * PRECISION) / PERCENT; - require(providerStakes[provider] >= residualAmt, "Insufficient funds to slash"); + uint256 residualAmt = (amt * residualBidPercentAfterDecay * PRECISION) / + PERCENT; + require( + providerStakes[provider] >= residualAmt, + "Insufficient funds to slash" + ); providerStakes[provider] -= residualAmt; - uint256 feeAmt = (residualAmt * uint256(feePercent) * PRECISION) / PERCENT; + uint256 feeAmt = (residualAmt * uint256(feePercent) * PRECISION) / + PERCENT; uint256 amtMinusFee = residualAmt - feeAmt; if (feeRecipient != address(0)) { @@ -223,7 +231,7 @@ contract ProviderRegistry is IProviderRegistry, OwnableUpgradeable, ReentrancyGu ) external nonReentrant { require(msg.sender == provider, "Only provider can unstake"); uint256 stake = providerStakes[provider]; - providerStakes[provider] = 0; + delete providerRegistered[provider]; require(stake > 0, "Provider Staked Amount is zero"); require( preConfirmationsContract != address(0), diff --git a/contracts/contracts/interfaces/IPreConfCommitmentStore.sol b/contracts/contracts/interfaces/IPreConfCommitmentStore.sol index e927e2da6..aec1ef980 100644 --- a/contracts/contracts/interfaces/IPreConfCommitmentStore.sol +++ b/contracts/contracts/interfaces/IPreConfCommitmentStore.sol @@ -10,7 +10,6 @@ interface IPreConfCommitmentStore { /// @dev Struct for all the information around preconfirmations commitment struct PreConfCommitment { - bool commitmentUsed; address bidder; address commiter; uint64 bid; diff --git a/contracts/test/OracleTest.sol b/contracts/test/OracleTest.sol index 82de73704..1aeb0137d 100644 --- a/contracts/test/OracleTest.sol +++ b/contracts/test/OracleTest.sol @@ -157,7 +157,6 @@ contract OracleTest is Test { oracle.processBuilderCommitmentForBlockNumber(index, blockNumber, provider, false, 50); vm.stopPrank(); assertEq(bidderRegistry.getProviderAmount(provider), bid*(50)/100); - } diff --git a/contracts/test/PreConfirmationConfTest.sol b/contracts/test/PreConfirmationConfTest.sol index 1ee6634c2..95d6dac3b 100644 --- a/contracts/test/PreConfirmationConfTest.sol +++ b/contracts/test/PreConfirmationConfTest.sol @@ -58,43 +58,51 @@ contract TestPreConfCommitmentStore is Test { address providerRegistryProxy = Upgrades.deployUUPSProxy( "ProviderRegistry.sol", - abi.encodeCall(ProviderRegistry.initialize, - (minStake, - feeRecipient, - feePercent, - address(this))) + abi.encodeCall( + ProviderRegistry.initialize, + (minStake, feeRecipient, feePercent, address(this)) + ) ); providerRegistry = ProviderRegistry(payable(providerRegistryProxy)); address blockTrackerProxy = Upgrades.deployUUPSProxy( "BlockTracker.sol", - abi.encodeCall(BlockTracker.initialize, - (address(this))) + abi.encodeCall(BlockTracker.initialize, (address(this))) ); blockTracker = BlockTracker(payable(blockTrackerProxy)); address bidderRegistryProxy = Upgrades.deployUUPSProxy( "BidderRegistry.sol", - abi.encodeCall(BidderRegistry.initialize, - (minStake, - feeRecipient, - feePercent, - address(this), - address(blockTracker))) + abi.encodeCall( + BidderRegistry.initialize, + ( + minStake, + feeRecipient, + feePercent, + address(this), + address(blockTracker) + ) + ) ); bidderRegistry = BidderRegistry(payable(bidderRegistryProxy)); - + address preconfStoreProxy = Upgrades.deployUUPSProxy( "PreConfCommitmentStore.sol", - abi.encodeCall(PreConfCommitmentStore.initialize, - (address(providerRegistry), // Provider Registry - address(bidderRegistry), // User Registry - feeRecipient, // Oracle - address(this), - address(blockTracker), // Block Tracker - 500)) // Commitment Dispatch Window + abi.encodeCall( + PreConfCommitmentStore.initialize, + ( + address(providerRegistry), // Provider Registry + address(bidderRegistry), // User Registry + feeRecipient, // Oracle + address(this), + address(blockTracker), // Block Tracker + 500 + ) + ) // Commitment Dispatch Window + ); + preConfCommitmentStore = PreConfCommitmentStore( + payable(preconfStoreProxy) ); - preConfCommitmentStore = PreConfCommitmentStore(payable(preconfStoreProxy)); // Sets fake block timestamp vm.warp(16); @@ -133,7 +141,11 @@ contract TestPreConfCommitmentStore is Test { // Step 2: Store the commitment bytes32 commitmentIndex = preConfCommitmentStore - .storeEncryptedCommitment(commitmentDigest, commitmentSignature, 1000); + .storeEncryptedCommitment( + commitmentDigest, + commitmentSignature, + 1000 + ); // Step 3: Verify the results // a. Check that the commitment index is correctly generated and not zero @@ -146,7 +158,6 @@ contract TestPreConfCommitmentStore is Test { ); // c. Assertions to verify the stored commitment matches the input - assertEq(commitment.commitmentUsed, false); assertEq(commitment.commiter, committer); assertEq(commitment.commitmentDigest, commitmentDigest); assertEq(commitment.commitmentSignature, commitmentSignature); @@ -167,13 +178,20 @@ contract TestPreConfCommitmentStore is Test { vm.prank(committer); vm.warp(1000); - vm.expectRevert("Invalid dispatch timestamp, block.timestamp - dispatchTimestamp < commitment_dispatch_window"); + vm.expectRevert( + "Invalid dispatch timestamp, block.timestamp - dispatchTimestamp < commitmentDispatchWindow" + ); - preConfCommitmentStore - .storeEncryptedCommitment(commitmentDigest, commitmentSignature, _testCommitmentAliceBob.dispatchTimestamp); + preConfCommitmentStore.storeEncryptedCommitment( + commitmentDigest, + commitmentSignature, + _testCommitmentAliceBob.dispatchTimestamp + ); } - function test_StoreCommitmentFailureDueToTimestampValidationWithNewWindow() public { + function test_StoreCommitmentFailureDueToTimestampValidationWithNewWindow() + public + { bytes32 commitmentDigest = keccak256( abi.encodePacked("commitment data") ); @@ -188,9 +206,14 @@ contract TestPreConfCommitmentStore is Test { vm.prank(preConfCommitmentStore.owner()); preConfCommitmentStore.updateCommitmentDispatchWindow(200); vm.warp(200 + _testCommitmentAliceBob.dispatchTimestamp); - vm.expectRevert("Invalid dispatch timestamp, block.timestamp - dispatchTimestamp < commitment_dispatch_window"); - preConfCommitmentStore - .storeEncryptedCommitment(commitmentDigest, commitmentSignature, _testCommitmentAliceBob.dispatchTimestamp); + vm.expectRevert( + "Invalid dispatch timestamp, block.timestamp - dispatchTimestamp < commitmentDispatchWindow" + ); + preConfCommitmentStore.storeEncryptedCommitment( + commitmentDigest, + commitmentSignature, + _testCommitmentAliceBob.dispatchTimestamp + ); } function test_UpdateOracle() public { @@ -335,7 +358,7 @@ contract TestPreConfCommitmentStore is Test { assertEq(commitmentTxnHash, _testCommitmentAliceBob.txnHash); } - function verifyCommitmentNotUsed ( + function verifyCommitmentNotUsed( string memory txnHash, uint64 bid, uint64 blockNumber, @@ -362,9 +385,22 @@ contract TestPreConfCommitmentStore is Test { _bytesToHexString(sharedSecretKey) ); - (bool commitmentUsed, , , , , , , , , , , , , ) = preConfCommitmentStore - .commitments(preConfHash); - assertEq(commitmentUsed, false); + ( + , + , + , + , + , + , + , + , + , + , + , + uint64 dispatchTimestamp, + + ) = preConfCommitmentStore.commitments(preConfHash); + assertEq(dispatchTimestamp, 0); return bidHash; } @@ -400,7 +436,11 @@ contract TestPreConfCommitmentStore is Test { ); bytes32 commitmentIndex = preConfCommitmentStore - .storeEncryptedCommitment(commitmentHash, commitmentSignature, dispatchTimestamp); + .storeEncryptedCommitment( + commitmentHash, + commitmentSignature, + dispatchTimestamp + ); return commitmentIndex; } @@ -460,16 +500,7 @@ contract TestPreConfCommitmentStore is Test { sharedSecretKey ); - bytes32[] memory commitments = preConfCommitmentStore - .getCommitmentsByCommitter(commiterAddress); - - assert(commitments.length >= 1); - - assertEq( - commitment.commitmentUsed, - false, - "Commitment should have been marked as used" - ); + assertNotEq(commiterAddress, address(0)); assertEq(commitment.bid, bid, "Stored bid should match input bid"); assertEq( commitment.blockNumber, @@ -497,7 +528,9 @@ contract TestPreConfCommitmentStore is Test { (address bidder, ) = makeAddrAndKey("alice"); vm.deal(bidder, 5 ether); vm.prank(bidder); - uint256 window = blockTracker.getWindowFromBlockNumber(_testCommitmentAliceBob.blockNumber); + uint256 window = blockTracker.getWindowFromBlockNumber( + _testCommitmentAliceBob.blockNumber + ); vm.prank(bidder); bidderRegistry.depositForSpecificWindow{value: 2 ether}(window); // Step 1: Verify that the commitment has not been used before @@ -541,8 +574,12 @@ contract TestPreConfCommitmentStore is Test { (address bidder, ) = makeAddrAndKey("alice"); vm.deal(bidder, 5 ether); vm.prank(bidder); - uint256 depositWindow = blockTracker.getWindowFromBlockNumber(_testCommitmentAliceBob.blockNumber); - bidderRegistry.depositForSpecificWindow{value: 2 ether}(depositWindow); + uint256 depositWindow = blockTracker.getWindowFromBlockNumber( + _testCommitmentAliceBob.blockNumber + ); + bidderRegistry.depositForSpecificWindow{value: 2 ether}( + depositWindow + ); // Step 1: Verify that the commitment has not been used before bytes32 bidHash = verifyCommitmentNotUsed( @@ -565,10 +602,23 @@ contract TestPreConfCommitmentStore is Test { _bytesToHexString(_testCommitmentAliceBob.sharedSecretKey) ); - // Verify that the commitment has not been used before - (bool commitmentUsed, , , , , , , , , , , , , ) = preConfCommitmentStore - .commitments(preConfHash); - assert(commitmentUsed == false); + // Verify that the commitment has not been set before + ( + , + , + , + , + , + , + , + , + , + , + , + uint64 dispatchTimestamp, + + ) = preConfCommitmentStore.commitments(preConfHash); + assert(dispatchTimestamp == 0); bytes32 encryptedIndex = storeCommitment( _testCommitmentAliceBob.bid, _testCommitmentAliceBob.blockNumber, @@ -577,7 +627,7 @@ contract TestPreConfCommitmentStore is Test { _testCommitmentAliceBob.decayEndTimestamp, _testCommitmentAliceBob.bidSignature, _testCommitmentAliceBob.commitmentSignature, - _testCommitmentAliceBob.dispatchTimestamp, + _testCommitmentAliceBob.dispatchTimestamp, _testCommitmentAliceBob.sharedSecretKey ); providerRegistry.setPreconfirmationsContract( @@ -605,10 +655,10 @@ contract TestPreConfCommitmentStore is Test { vm.prank(feeRecipient); preConfCommitmentStore.initiateSlash(index, 100); - (commitmentUsed, , , , , , , , , , , , , ) = preConfCommitmentStore + (, , , , , , , , , , , dispatchTimestamp, ) = preConfCommitmentStore .commitments(index); - // Verify that the commitment has been marked as used - assert(commitmentUsed == true); + // Verify that the commitment has been deleted + assert(dispatchTimestamp == 0); } // commitmentHash value is internal to contract and not asserted } @@ -619,8 +669,12 @@ contract TestPreConfCommitmentStore is Test { (address bidder, ) = makeAddrAndKey("alice"); vm.deal(bidder, 5 ether); vm.prank(bidder); - uint256 depositWindow = blockTracker.getWindowFromBlockNumber(_testCommitmentAliceBob.blockNumber); - bidderRegistry.depositForSpecificWindow{value: 2 ether}(depositWindow); + uint256 depositWindow = blockTracker.getWindowFromBlockNumber( + _testCommitmentAliceBob.blockNumber + ); + bidderRegistry.depositForSpecificWindow{value: 2 ether}( + depositWindow + ); // Step 1: Verify that the commitment has not been used before bytes32 bidHash = verifyCommitmentNotUsed( @@ -643,9 +697,22 @@ contract TestPreConfCommitmentStore is Test { ); // Verify that the commitment has not been used before - (bool commitmentUsed, , , , , , , , , , , , , ) = preConfCommitmentStore - .commitments(preConfHash); - assert(commitmentUsed == false); + ( + , + , + , + , + , + , + , + , + , + , + , + uint64 dispatchTimestamp, + + ) = preConfCommitmentStore.commitments(preConfHash); + assert(dispatchTimestamp == 0); bytes32 encryptedIndex = storeCommitment( _testCommitmentAliceBob.bid, _testCommitmentAliceBob.blockNumber, @@ -662,7 +729,10 @@ contract TestPreConfCommitmentStore is Test { vm.prank(commiter); providerRegistry.registerAndStake{value: 4 ether}(); blockTracker.addBuilderAddress("test", commiter); - blockTracker.recordL1Block(_testCommitmentAliceBob.blockNumber, "test"); + blockTracker.recordL1Block( + _testCommitmentAliceBob.blockNumber, + "test" + ); bytes32 index = openCommitment( commiter, encryptedIndex, @@ -678,10 +748,10 @@ contract TestPreConfCommitmentStore is Test { vm.prank(feeRecipient); preConfCommitmentStore.initiateReward(index, 100); - (commitmentUsed, , , , , , , , , , , , , ) = preConfCommitmentStore + (, , , , , , , , , , , dispatchTimestamp, ) = preConfCommitmentStore .commitments(index); // Verify that the commitment has been marked as used - assert(commitmentUsed == true); + assert(dispatchTimestamp == 0); // commitmentHash value is internal to contract and not asserted } } @@ -691,10 +761,14 @@ contract TestPreConfCommitmentStore is Test { { (address bidder, ) = makeAddrAndKey("alice"); uint64 blockNumber = 66; - uint256 depositWindow = blockTracker.getWindowFromBlockNumber(blockNumber); + uint256 depositWindow = blockTracker.getWindowFromBlockNumber( + blockNumber + ); vm.deal(bidder, 5 ether); vm.prank(bidder); - bidderRegistry.depositForSpecificWindow{value: 2 ether}(depositWindow); + bidderRegistry.depositForSpecificWindow{value: 2 ether}( + depositWindow + ); // Step 1: Verify that the commitment has not been used before bytes32 bidHash = verifyCommitmentNotUsed( @@ -717,9 +791,22 @@ contract TestPreConfCommitmentStore is Test { ); // Verify that the commitment has not been used before - (bool commitmentUsed, , , , , , , , , , , , , ) = preConfCommitmentStore - .commitments(preConfHash); - assert(commitmentUsed == false); + ( + , + , + , + , + , + , + , + , + , + , + , + uint64 dispatchTimestamp, + + ) = preConfCommitmentStore.commitments(preConfHash); + assert(dispatchTimestamp == 0); bytes32 encryptedIndex = storeCommitment( _testCommitmentAliceBob.bid, blockNumber, @@ -753,10 +840,10 @@ contract TestPreConfCommitmentStore is Test { vm.prank(feeRecipient); preConfCommitmentStore.initiateReward(index, 0); - (commitmentUsed, , , , , , , , , , , , , ) = preConfCommitmentStore + (, , , , , , , , , , , dispatchTimestamp, ) = preConfCommitmentStore .commitments(index); // Verify that the commitment has been marked as used - assert(commitmentUsed == true); + assert(dispatchTimestamp == 0); // commitmentHash value is internal to contract and not asserted assert(bidderRegistry.lockedFunds(bidder, window) == 2 ether); @@ -775,4 +862,4 @@ contract TestPreConfCommitmentStore is Test { } return string(_string); } -} \ No newline at end of file +}