diff --git a/contracts-abi/abi/BidderRegistry.abi b/contracts-abi/abi/BidderRegistry.abi index ed03eaad8..462e39f59 100644 --- a/contracts-abi/abi/BidderRegistry.abi +++ b/contracts-abi/abi/BidderRegistry.abi @@ -1,33 +1,7 @@ [ { "type": "constructor", - "inputs": [ - { - "name": "_minDeposit", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "_feeRecipient", - "type": "address", - "internalType": "address" - }, - { - "name": "_feePercent", - "type": "uint16", - "internalType": "uint16" - }, - { - "name": "_owner", - "type": "address", - "internalType": "address" - }, - { - "name": "_blockTracker", - "type": "address", - "internalType": "address" - } - ], + "inputs": [], "stateMutability": "nonpayable" }, { @@ -235,6 +209,39 @@ ], "stateMutability": "view" }, + { + "type": "function", + "name": "initialize", + "inputs": [ + { + "name": "_minDeposit", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "_feeRecipient", + "type": "address", + "internalType": "address" + }, + { + "name": "_feePercent", + "type": "uint16", + "internalType": "uint16" + }, + { + "name": "_owner", + "type": "address", + "internalType": "address" + }, + { + "name": "_blockTracker", + "type": "address", + "internalType": "address" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, { "type": "function", "name": "lockedFunds", @@ -604,6 +611,19 @@ ], "anonymous": false }, + { + "type": "event", + "name": "Initialized", + "inputs": [ + { + "name": "version", + "type": "uint64", + "indexed": false, + "internalType": "uint64" + } + ], + "anonymous": false + }, { "type": "event", "name": "OwnershipTransferred", @@ -622,5 +642,42 @@ } ], "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" + } + ] + }, + { + "type": "error", + "name": "ReentrancyGuardReentrantCall", + "inputs": [] } ] diff --git a/contracts-abi/abi/BlockTracker.abi b/contracts-abi/abi/BlockTracker.abi index aff471dd7..432b0f50c 100644 --- a/contracts-abi/abi/BlockTracker.abi +++ b/contracts-abi/abi/BlockTracker.abi @@ -1,13 +1,7 @@ [ { "type": "constructor", - "inputs": [ - { - "name": "_owner", - "type": "address", - "internalType": "address" - } - ], + "inputs": [], "stateMutability": "nonpayable" }, { @@ -183,6 +177,19 @@ ], "stateMutability": "view" }, + { + "type": "function", + "name": "initialize", + "inputs": [ + { + "name": "_owner", + "type": "address", + "internalType": "address" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, { "type": "function", "name": "owner", @@ -234,6 +241,19 @@ "outputs": [], "stateMutability": "nonpayable" }, + { + "type": "event", + "name": "Initialized", + "inputs": [ + { + "name": "version", + "type": "uint64", + "indexed": false, + "internalType": "uint64" + } + ], + "anonymous": false + }, { "type": "event", "name": "NewBlocksPerWindow", @@ -303,5 +323,37 @@ } ], "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" + } + ] } ] diff --git a/contracts-abi/abi/L1Gateway.abi b/contracts-abi/abi/L1Gateway.abi index df94e7d37..a9f90a859 100644 --- a/contracts-abi/abi/L1Gateway.abi +++ b/contracts-abi/abi/L1Gateway.abi @@ -1,28 +1,7 @@ [ { "type": "constructor", - "inputs": [ - { - "name": "_owner", - "type": "address", - "internalType": "address" - }, - { - "name": "_relayer", - "type": "address", - "internalType": "address" - }, - { - "name": "_finalizationFee", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "_counterpartyFee", - "type": "uint256", - "internalType": "uint256" - } - ], + "inputs": [], "stateMutability": "nonpayable" }, { @@ -78,6 +57,34 @@ "outputs": [], "stateMutability": "nonpayable" }, + { + "type": "function", + "name": "initialize", + "inputs": [ + { + "name": "_owner", + "type": "address", + "internalType": "address" + }, + { + "name": "_relayer", + "type": "address", + "internalType": "address" + }, + { + "name": "_finalizationFee", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "_counterpartyFee", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, { "type": "function", "name": "initiateTransfer", @@ -174,6 +181,19 @@ "outputs": [], "stateMutability": "nonpayable" }, + { + "type": "event", + "name": "Initialized", + "inputs": [ + { + "name": "version", + "type": "uint64", + "indexed": false, + "internalType": "uint64" + } + ], + "anonymous": false + }, { "type": "event", "name": "OwnershipTransferred", @@ -248,5 +268,37 @@ } ], "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" + } + ] } ] diff --git a/contracts-abi/abi/Oracle.abi b/contracts-abi/abi/Oracle.abi index b22ed64c4..2c80c3041 100644 --- a/contracts-abi/abi/Oracle.abi +++ b/contracts-abi/abi/Oracle.abi @@ -1,23 +1,7 @@ [ { "type": "constructor", - "inputs": [ - { - "name": "_preConfContract", - "type": "address", - "internalType": "address" - }, - { - "name": "_blockTrackerContract", - "type": "address", - "internalType": "address" - }, - { - "name": "_owner", - "type": "address", - "internalType": "address" - } - ], + "inputs": [], "stateMutability": "nonpayable" }, { @@ -47,6 +31,29 @@ ], "stateMutability": "view" }, + { + "type": "function", + "name": "initialize", + "inputs": [ + { + "name": "_preConfContract", + "type": "address", + "internalType": "address" + }, + { + "name": "_blockTrackerContract", + "type": "address", + "internalType": "address" + }, + { + "name": "_owner", + "type": "address", + "internalType": "address" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, { "type": "function", "name": "owner", @@ -132,6 +139,19 @@ ], "anonymous": false }, + { + "type": "event", + "name": "Initialized", + "inputs": [ + { + "name": "version", + "type": "uint64", + "indexed": false, + "internalType": "uint64" + } + ], + "anonymous": false + }, { "type": "event", "name": "OwnershipTransferred", @@ -150,5 +170,37 @@ } ], "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" + } + ] } ] diff --git a/contracts-abi/abi/PreConfCommitmentStore.abi b/contracts-abi/abi/PreConfCommitmentStore.abi index d3befc7de..925b92b4c 100644 --- a/contracts-abi/abi/PreConfCommitmentStore.abi +++ b/contracts-abi/abi/PreConfCommitmentStore.abi @@ -1,38 +1,7 @@ [ { "type": "constructor", - "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" - } - ], + "inputs": [], "stateMutability": "nonpayable" }, { @@ -756,6 +725,44 @@ ], "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", @@ -1293,6 +1300,19 @@ ], "anonymous": false }, + { + "type": "event", + "name": "Initialized", + "inputs": [ + { + "name": "version", + "type": "uint64", + "indexed": false, + "internalType": "uint64" + } + ], + "anonymous": false + }, { "type": "event", "name": "OwnershipTransferred", @@ -1342,5 +1362,37 @@ } ], "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" + } + ] } ] diff --git a/contracts-abi/abi/ProviderRegistry.abi b/contracts-abi/abi/ProviderRegistry.abi index 5d8fc115d..a6462060b 100644 --- a/contracts-abi/abi/ProviderRegistry.abi +++ b/contracts-abi/abi/ProviderRegistry.abi @@ -1,28 +1,7 @@ [ { "type": "constructor", - "inputs": [ - { - "name": "_minStake", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "_feeRecipient", - "type": "address", - "internalType": "address" - }, - { - "name": "_feePercent", - "type": "uint16", - "internalType": "uint16" - }, - { - "name": "_owner", - "type": "address", - "internalType": "address" - } - ], + "inputs": [], "stateMutability": "nonpayable" }, { @@ -117,6 +96,34 @@ ], "stateMutability": "view" }, + { + "type": "function", + "name": "initialize", + "inputs": [ + { + "name": "_minStake", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "_feeRecipient", + "type": "address", + "internalType": "address" + }, + { + "name": "_feePercent", + "type": "uint16", + "internalType": "uint16" + }, + { + "name": "_owner", + "type": "address", + "internalType": "address" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, { "type": "function", "name": "minStake", @@ -359,6 +366,19 @@ ], "anonymous": false }, + { + "type": "event", + "name": "Initialized", + "inputs": [ + { + "name": "version", + "type": "uint64", + "indexed": false, + "internalType": "uint64" + } + ], + "anonymous": false + }, { "type": "event", "name": "OwnershipTransferred", @@ -396,5 +416,42 @@ } ], "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" + } + ] + }, + { + "type": "error", + "name": "ReentrancyGuardReentrantCall", + "inputs": [] } ] diff --git a/contracts-abi/abi/SettlementGateway.abi b/contracts-abi/abi/SettlementGateway.abi index e15e60a38..f130c8e74 100644 --- a/contracts-abi/abi/SettlementGateway.abi +++ b/contracts-abi/abi/SettlementGateway.abi @@ -1,33 +1,7 @@ [ { "type": "constructor", - "inputs": [ - { - "name": "_whitelistAddr", - "type": "address", - "internalType": "address" - }, - { - "name": "_owner", - "type": "address", - "internalType": "address" - }, - { - "name": "_relayer", - "type": "address", - "internalType": "address" - }, - { - "name": "_finalizationFee", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "_counterpartyFee", - "type": "uint256", - "internalType": "uint256" - } - ], + "inputs": [], "stateMutability": "nonpayable" }, { @@ -79,6 +53,39 @@ "outputs": [], "stateMutability": "nonpayable" }, + { + "type": "function", + "name": "initialize", + "inputs": [ + { + "name": "_whitelistAddr", + "type": "address", + "internalType": "address" + }, + { + "name": "_owner", + "type": "address", + "internalType": "address" + }, + { + "name": "_relayer", + "type": "address", + "internalType": "address" + }, + { + "name": "_finalizationFee", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "_counterpartyFee", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, { "type": "function", "name": "initiateTransfer", @@ -188,6 +195,19 @@ ], "stateMutability": "view" }, + { + "type": "event", + "name": "Initialized", + "inputs": [ + { + "name": "version", + "type": "uint64", + "indexed": false, + "internalType": "uint64" + } + ], + "anonymous": false + }, { "type": "event", "name": "OwnershipTransferred", @@ -262,5 +282,37 @@ } ], "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" + } + ] } ] diff --git a/contracts-abi/abi/ValidatorRegistry.abi b/contracts-abi/abi/ValidatorRegistry.abi index c452842e3..f8686c0c3 100644 --- a/contracts-abi/abi/ValidatorRegistry.abi +++ b/contracts-abi/abi/ValidatorRegistry.abi @@ -4,6 +4,14 @@ "inputs": [], "stateMutability": "nonpayable" }, + { + "type": "fallback", + "stateMutability": "payable" + }, + { + "type": "receive", + "stateMutability": "payable" + }, { "type": "function", "name": "getBlocksTillWithdrawAllowed", diff --git a/contracts-abi/clients/BidderRegistry/BidderRegistry.go b/contracts-abi/clients/BidderRegistry/BidderRegistry.go index 95c75c58f..49d11c676 100644 --- a/contracts-abi/clients/BidderRegistry/BidderRegistry.go +++ b/contracts-abi/clients/BidderRegistry/BidderRegistry.go @@ -31,7 +31,7 @@ var ( // BidderregistryMetaData contains all meta data concerning the Bidderregistry contract. var BidderregistryMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_minDeposit\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_feeRecipient\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_feePercent\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_blockTracker\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"fallback\",\"stateMutability\":\"payable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"BidPayment\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"bidAmt\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"state\",\"type\":\"uint8\",\"internalType\":\"enumIBidderRegistry.State\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"OpenBid\",\"inputs\":[{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"bid\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"bidderRegistered\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blockTrackerContract\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIBlockTracker\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"depositForSpecificWindow\",\"inputs\":[{\"name\":\"window\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"feePercent\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"feeRecipient\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"feeRecipientAmount\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getDeposit\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"window\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getFeeRecipientAmount\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getProviderAmount\",\"inputs\":[{\"name\":\"provider\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"lockedFunds\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"minDeposit\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"preConfirmationsContract\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"protocolFeeAmount\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"providerAmount\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"retrieveFunds\",\"inputs\":[{\"name\":\"windowToSettle\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"provider\",\"type\":\"address\",\"internalType\":\"addresspayable\"},{\"name\":\"residualBidPercentAfterDecay\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setNewFeePercent\",\"inputs\":[{\"name\":\"newFeePercent\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setNewFeeRecipient\",\"inputs\":[{\"name\":\"newFeeRecipient\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setPreconfirmationsContract\",\"inputs\":[{\"name\":\"contractAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"unlockFunds\",\"inputs\":[{\"name\":\"window\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"bidID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawBidderAmountFromWindow\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"addresspayable\"},{\"name\":\"window\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawFeeRecipientAmount\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawProtocolFee\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"addresspayable\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawProviderAmount\",\"inputs\":[{\"name\":\"provider\",\"type\":\"address\",\"internalType\":\"addresspayable\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"BidderRegistered\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"depositedAmount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"windowNumber\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"BidderWithdrawal\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"window\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"FundsRetrieved\",\"inputs\":[{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"bidder\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"window\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"FundsRewarded\",\"inputs\":[{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"bidder\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"provider\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"window\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"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}]", + ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"fallback\",\"stateMutability\":\"payable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"BidPayment\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"bidAmt\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"state\",\"type\":\"uint8\",\"internalType\":\"enumIBidderRegistry.State\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"OpenBid\",\"inputs\":[{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"bid\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"bidderRegistered\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blockTrackerContract\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIBlockTracker\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"depositForSpecificWindow\",\"inputs\":[{\"name\":\"window\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"feePercent\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"feeRecipient\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"feeRecipientAmount\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getDeposit\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"window\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getFeeRecipientAmount\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getProviderAmount\",\"inputs\":[{\"name\":\"provider\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_minDeposit\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_feeRecipient\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_feePercent\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_blockTracker\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"lockedFunds\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"minDeposit\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"preConfirmationsContract\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"protocolFeeAmount\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"providerAmount\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"retrieveFunds\",\"inputs\":[{\"name\":\"windowToSettle\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"provider\",\"type\":\"address\",\"internalType\":\"addresspayable\"},{\"name\":\"residualBidPercentAfterDecay\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setNewFeePercent\",\"inputs\":[{\"name\":\"newFeePercent\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setNewFeeRecipient\",\"inputs\":[{\"name\":\"newFeeRecipient\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setPreconfirmationsContract\",\"inputs\":[{\"name\":\"contractAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"unlockFunds\",\"inputs\":[{\"name\":\"window\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"bidID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawBidderAmountFromWindow\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"addresspayable\"},{\"name\":\"window\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawFeeRecipientAmount\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawProtocolFee\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"addresspayable\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawProviderAmount\",\"inputs\":[{\"name\":\"provider\",\"type\":\"address\",\"internalType\":\"addresspayable\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"BidderRegistered\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"depositedAmount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"windowNumber\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"BidderWithdrawal\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"window\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"FundsRetrieved\",\"inputs\":[{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"bidder\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"window\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"FundsRewarded\",\"inputs\":[{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"bidder\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"provider\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"window\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"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\":\"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\"}]},{\"type\":\"error\",\"name\":\"ReentrancyGuardReentrantCall\",\"inputs\":[]}]", } // BidderregistryABI is the input ABI used to generate the binding from. @@ -706,6 +706,27 @@ func (_Bidderregistry *BidderregistryTransactorSession) DepositForSpecificWindow return _Bidderregistry.Contract.DepositForSpecificWindow(&_Bidderregistry.TransactOpts, window) } +// Initialize is a paid mutator transaction binding the contract method 0x12c27ca2. +// +// Solidity: function initialize(uint256 _minDeposit, address _feeRecipient, uint16 _feePercent, address _owner, address _blockTracker) returns() +func (_Bidderregistry *BidderregistryTransactor) Initialize(opts *bind.TransactOpts, _minDeposit *big.Int, _feeRecipient common.Address, _feePercent uint16, _owner common.Address, _blockTracker common.Address) (*types.Transaction, error) { + return _Bidderregistry.contract.Transact(opts, "initialize", _minDeposit, _feeRecipient, _feePercent, _owner, _blockTracker) +} + +// Initialize is a paid mutator transaction binding the contract method 0x12c27ca2. +// +// Solidity: function initialize(uint256 _minDeposit, address _feeRecipient, uint16 _feePercent, address _owner, address _blockTracker) returns() +func (_Bidderregistry *BidderregistrySession) Initialize(_minDeposit *big.Int, _feeRecipient common.Address, _feePercent uint16, _owner common.Address, _blockTracker common.Address) (*types.Transaction, error) { + return _Bidderregistry.Contract.Initialize(&_Bidderregistry.TransactOpts, _minDeposit, _feeRecipient, _feePercent, _owner, _blockTracker) +} + +// Initialize is a paid mutator transaction binding the contract method 0x12c27ca2. +// +// Solidity: function initialize(uint256 _minDeposit, address _feeRecipient, uint16 _feePercent, address _owner, address _blockTracker) returns() +func (_Bidderregistry *BidderregistryTransactorSession) Initialize(_minDeposit *big.Int, _feeRecipient common.Address, _feePercent uint16, _owner common.Address, _blockTracker common.Address) (*types.Transaction, error) { + return _Bidderregistry.Contract.Initialize(&_Bidderregistry.TransactOpts, _minDeposit, _feeRecipient, _feePercent, _owner, _blockTracker) +} + // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() @@ -1590,6 +1611,140 @@ func (_Bidderregistry *BidderregistryFilterer) ParseFundsRewarded(log types.Log) return event, nil } +// BidderregistryInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the Bidderregistry contract. +type BidderregistryInitializedIterator struct { + Event *BidderregistryInitialized // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *BidderregistryInitializedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(BidderregistryInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(BidderregistryInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *BidderregistryInitializedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *BidderregistryInitializedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// BidderregistryInitialized represents a Initialized event raised by the Bidderregistry contract. +type BidderregistryInitialized struct { + Version uint64 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterInitialized is a free log retrieval operation binding the contract event 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2. +// +// Solidity: event Initialized(uint64 version) +func (_Bidderregistry *BidderregistryFilterer) FilterInitialized(opts *bind.FilterOpts) (*BidderregistryInitializedIterator, error) { + + logs, sub, err := _Bidderregistry.contract.FilterLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return &BidderregistryInitializedIterator{contract: _Bidderregistry.contract, event: "Initialized", logs: logs, sub: sub}, nil +} + +// WatchInitialized is a free log subscription operation binding the contract event 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2. +// +// Solidity: event Initialized(uint64 version) +func (_Bidderregistry *BidderregistryFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *BidderregistryInitialized) (event.Subscription, error) { + + logs, sub, err := _Bidderregistry.contract.WatchLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(BidderregistryInitialized) + if err := _Bidderregistry.contract.UnpackLog(event, "Initialized", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseInitialized is a log parse operation binding the contract event 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2. +// +// Solidity: event Initialized(uint64 version) +func (_Bidderregistry *BidderregistryFilterer) ParseInitialized(log types.Log) (*BidderregistryInitialized, error) { + event := new(BidderregistryInitialized) + if err := _Bidderregistry.contract.UnpackLog(event, "Initialized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + // BidderregistryOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the Bidderregistry contract. type BidderregistryOwnershipTransferredIterator struct { Event *BidderregistryOwnershipTransferred // Event containing the contract specifics and raw log diff --git a/contracts-abi/clients/BlockTracker/BlockTracker.go b/contracts-abi/clients/BlockTracker/BlockTracker.go index a23393e00..e4fa67d70 100644 --- a/contracts-abi/clients/BlockTracker/BlockTracker.go +++ b/contracts-abi/clients/BlockTracker/BlockTracker.go @@ -31,7 +31,7 @@ var ( // BlocktrackerMetaData contains all meta data concerning the Blocktracker contract. var BlocktrackerMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"fallback\",\"stateMutability\":\"payable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"addBuilderAddress\",\"inputs\":[{\"name\":\"builderName\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"builderAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"blockBuilderNameToAddress\",\"inputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blockWinners\",\"inputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blocksPerWindow\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"currentWindow\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getBlockWinner\",\"inputs\":[{\"name\":\"blockNumber\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getBlocksPerWindow\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getBuilder\",\"inputs\":[{\"name\":\"builderNameGrafiti\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getCurrentWindow\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getWindowFromBlockNumber\",\"inputs\":[{\"name\":\"blockNumber\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"recordL1Block\",\"inputs\":[{\"name\":\"_blockNumber\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_winnerGraffiti\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"NewBlocksPerWindow\",\"inputs\":[{\"name\":\"blocksPerWindow\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"NewL1Block\",\"inputs\":[{\"name\":\"blockNumber\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"},{\"name\":\"winner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"window\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"NewWindow\",\"inputs\":[{\"name\":\"window\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"}],\"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}]", + ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"fallback\",\"stateMutability\":\"payable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"addBuilderAddress\",\"inputs\":[{\"name\":\"builderName\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"builderAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"blockBuilderNameToAddress\",\"inputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blockWinners\",\"inputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blocksPerWindow\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"currentWindow\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getBlockWinner\",\"inputs\":[{\"name\":\"blockNumber\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getBlocksPerWindow\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getBuilder\",\"inputs\":[{\"name\":\"builderNameGrafiti\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getCurrentWindow\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getWindowFromBlockNumber\",\"inputs\":[{\"name\":\"blockNumber\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"recordL1Block\",\"inputs\":[{\"name\":\"_blockNumber\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_winnerGraffiti\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"NewBlocksPerWindow\",\"inputs\":[{\"name\":\"blocksPerWindow\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"NewL1Block\",\"inputs\":[{\"name\":\"blockNumber\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"},{\"name\":\"winner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"window\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"NewWindow\",\"inputs\":[{\"name\":\"window\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"}],\"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\":\"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\"}]}]", } // BlocktrackerABI is the input ABI used to generate the binding from. @@ -511,6 +511,27 @@ func (_Blocktracker *BlocktrackerTransactorSession) AddBuilderAddress(builderNam return _Blocktracker.Contract.AddBuilderAddress(&_Blocktracker.TransactOpts, builderName, builderAddress) } +// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. +// +// Solidity: function initialize(address _owner) returns() +func (_Blocktracker *BlocktrackerTransactor) Initialize(opts *bind.TransactOpts, _owner common.Address) (*types.Transaction, error) { + return _Blocktracker.contract.Transact(opts, "initialize", _owner) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. +// +// Solidity: function initialize(address _owner) returns() +func (_Blocktracker *BlocktrackerSession) Initialize(_owner common.Address) (*types.Transaction, error) { + return _Blocktracker.Contract.Initialize(&_Blocktracker.TransactOpts, _owner) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. +// +// Solidity: function initialize(address _owner) returns() +func (_Blocktracker *BlocktrackerTransactorSession) Initialize(_owner common.Address) (*types.Transaction, error) { + return _Blocktracker.Contract.Initialize(&_Blocktracker.TransactOpts, _owner) +} + // RecordL1Block is a paid mutator transaction binding the contract method 0x1d63f108. // // Solidity: function recordL1Block(uint256 _blockNumber, string _winnerGraffiti) returns() @@ -616,6 +637,140 @@ func (_Blocktracker *BlocktrackerTransactorSession) Receive() (*types.Transactio return _Blocktracker.Contract.Receive(&_Blocktracker.TransactOpts) } +// BlocktrackerInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the Blocktracker contract. +type BlocktrackerInitializedIterator struct { + Event *BlocktrackerInitialized // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *BlocktrackerInitializedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(BlocktrackerInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(BlocktrackerInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *BlocktrackerInitializedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *BlocktrackerInitializedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// BlocktrackerInitialized represents a Initialized event raised by the Blocktracker contract. +type BlocktrackerInitialized struct { + Version uint64 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterInitialized is a free log retrieval operation binding the contract event 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2. +// +// Solidity: event Initialized(uint64 version) +func (_Blocktracker *BlocktrackerFilterer) FilterInitialized(opts *bind.FilterOpts) (*BlocktrackerInitializedIterator, error) { + + logs, sub, err := _Blocktracker.contract.FilterLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return &BlocktrackerInitializedIterator{contract: _Blocktracker.contract, event: "Initialized", logs: logs, sub: sub}, nil +} + +// WatchInitialized is a free log subscription operation binding the contract event 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2. +// +// Solidity: event Initialized(uint64 version) +func (_Blocktracker *BlocktrackerFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *BlocktrackerInitialized) (event.Subscription, error) { + + logs, sub, err := _Blocktracker.contract.WatchLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(BlocktrackerInitialized) + if err := _Blocktracker.contract.UnpackLog(event, "Initialized", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseInitialized is a log parse operation binding the contract event 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2. +// +// Solidity: event Initialized(uint64 version) +func (_Blocktracker *BlocktrackerFilterer) ParseInitialized(log types.Log) (*BlocktrackerInitialized, error) { + event := new(BlocktrackerInitialized) + if err := _Blocktracker.contract.UnpackLog(event, "Initialized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + // BlocktrackerNewBlocksPerWindowIterator is returned from FilterNewBlocksPerWindow and is used to iterate over the raw logs and unpacked data for NewBlocksPerWindow events raised by the Blocktracker contract. type BlocktrackerNewBlocksPerWindowIterator struct { Event *BlocktrackerNewBlocksPerWindow // Event containing the contract specifics and raw log diff --git a/contracts-abi/clients/L1Gateway/L1Gateway.go b/contracts-abi/clients/L1Gateway/L1Gateway.go index 6799ade48..df196108e 100644 --- a/contracts-abi/clients/L1Gateway/L1Gateway.go +++ b/contracts-abi/clients/L1Gateway/L1Gateway.go @@ -31,7 +31,7 @@ var ( // L1gatewayMetaData contains all meta data concerning the L1gateway contract. var L1gatewayMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_relayer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_finalizationFee\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_counterpartyFee\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"counterpartyFee\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"finalizationFee\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"finalizeTransfer\",\"inputs\":[{\"name\":\"_recipient\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_counterpartyIdx\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initiateTransfer\",\"inputs\":[{\"name\":\"_recipient\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"returnIdx\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"relayer\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferFinalizedIdx\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"transferInitiatedIdx\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"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\":\"TransferFinalized\",\"inputs\":[{\"name\":\"recipient\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"counterpartyIdx\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"TransferInitiated\",\"inputs\":[{\"name\":\"sender\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"recipient\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"transferIdx\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"}],\"anonymous\":false}]", + ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"counterpartyFee\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"finalizationFee\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"finalizeTransfer\",\"inputs\":[{\"name\":\"_recipient\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_counterpartyIdx\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_relayer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_finalizationFee\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_counterpartyFee\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initiateTransfer\",\"inputs\":[{\"name\":\"_recipient\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"returnIdx\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"relayer\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferFinalizedIdx\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"transferInitiatedIdx\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"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\":\"TransferFinalized\",\"inputs\":[{\"name\":\"recipient\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"counterpartyIdx\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"TransferInitiated\",\"inputs\":[{\"name\":\"sender\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"recipient\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"transferIdx\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"}],\"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\"}]}]", } // L1gatewayABI is the input ABI used to generate the binding from. @@ -387,6 +387,27 @@ func (_L1gateway *L1gatewayTransactorSession) FinalizeTransfer(_recipient common return _L1gateway.Contract.FinalizeTransfer(&_L1gateway.TransactOpts, _recipient, _amount, _counterpartyIdx) } +// Initialize is a paid mutator transaction binding the contract method 0xeb990c59. +// +// Solidity: function initialize(address _owner, address _relayer, uint256 _finalizationFee, uint256 _counterpartyFee) returns() +func (_L1gateway *L1gatewayTransactor) Initialize(opts *bind.TransactOpts, _owner common.Address, _relayer common.Address, _finalizationFee *big.Int, _counterpartyFee *big.Int) (*types.Transaction, error) { + return _L1gateway.contract.Transact(opts, "initialize", _owner, _relayer, _finalizationFee, _counterpartyFee) +} + +// Initialize is a paid mutator transaction binding the contract method 0xeb990c59. +// +// Solidity: function initialize(address _owner, address _relayer, uint256 _finalizationFee, uint256 _counterpartyFee) returns() +func (_L1gateway *L1gatewaySession) Initialize(_owner common.Address, _relayer common.Address, _finalizationFee *big.Int, _counterpartyFee *big.Int) (*types.Transaction, error) { + return _L1gateway.Contract.Initialize(&_L1gateway.TransactOpts, _owner, _relayer, _finalizationFee, _counterpartyFee) +} + +// Initialize is a paid mutator transaction binding the contract method 0xeb990c59. +// +// Solidity: function initialize(address _owner, address _relayer, uint256 _finalizationFee, uint256 _counterpartyFee) returns() +func (_L1gateway *L1gatewayTransactorSession) Initialize(_owner common.Address, _relayer common.Address, _finalizationFee *big.Int, _counterpartyFee *big.Int) (*types.Transaction, error) { + return _L1gateway.Contract.Initialize(&_L1gateway.TransactOpts, _owner, _relayer, _finalizationFee, _counterpartyFee) +} + // InitiateTransfer is a paid mutator transaction binding the contract method 0xb504cd1e. // // Solidity: function initiateTransfer(address _recipient, uint256 _amount) payable returns(uint256 returnIdx) @@ -471,6 +492,140 @@ func (_L1gateway *L1gatewayTransactorSession) Receive() (*types.Transaction, err return _L1gateway.Contract.Receive(&_L1gateway.TransactOpts) } +// L1gatewayInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the L1gateway contract. +type L1gatewayInitializedIterator struct { + Event *L1gatewayInitialized // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *L1gatewayInitializedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(L1gatewayInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(L1gatewayInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *L1gatewayInitializedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *L1gatewayInitializedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// L1gatewayInitialized represents a Initialized event raised by the L1gateway contract. +type L1gatewayInitialized struct { + Version uint64 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterInitialized is a free log retrieval operation binding the contract event 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2. +// +// Solidity: event Initialized(uint64 version) +func (_L1gateway *L1gatewayFilterer) FilterInitialized(opts *bind.FilterOpts) (*L1gatewayInitializedIterator, error) { + + logs, sub, err := _L1gateway.contract.FilterLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return &L1gatewayInitializedIterator{contract: _L1gateway.contract, event: "Initialized", logs: logs, sub: sub}, nil +} + +// WatchInitialized is a free log subscription operation binding the contract event 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2. +// +// Solidity: event Initialized(uint64 version) +func (_L1gateway *L1gatewayFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *L1gatewayInitialized) (event.Subscription, error) { + + logs, sub, err := _L1gateway.contract.WatchLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(L1gatewayInitialized) + if err := _L1gateway.contract.UnpackLog(event, "Initialized", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseInitialized is a log parse operation binding the contract event 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2. +// +// Solidity: event Initialized(uint64 version) +func (_L1gateway *L1gatewayFilterer) ParseInitialized(log types.Log) (*L1gatewayInitialized, error) { + event := new(L1gatewayInitialized) + if err := _L1gateway.contract.UnpackLog(event, "Initialized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + // L1gatewayOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the L1gateway contract. type L1gatewayOwnershipTransferredIterator struct { Event *L1gatewayOwnershipTransferred // Event containing the contract specifics and raw log diff --git a/contracts-abi/clients/Oracle/Oracle.go b/contracts-abi/clients/Oracle/Oracle.go index ef51be249..46efdb217 100644 --- a/contracts-abi/clients/Oracle/Oracle.go +++ b/contracts-abi/clients/Oracle/Oracle.go @@ -31,7 +31,7 @@ var ( // OracleMetaData contains all meta data concerning the Oracle contract. var OracleMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_preConfContract\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_blockTrackerContract\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"fallback\",\"stateMutability\":\"payable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"blockBuilderNameToAddress\",\"inputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"processBuilderCommitmentForBlockNumber\",\"inputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"blockNumber\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"builder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"isSlash\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"residualBidPercentAfterDecay\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"CommitmentProcessed\",\"inputs\":[{\"name\":\"commitmentHash\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"isSlash\",\"type\":\"bool\",\"indexed\":false,\"internalType\":\"bool\"}],\"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}]", + ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"fallback\",\"stateMutability\":\"payable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"blockBuilderNameToAddress\",\"inputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_preConfContract\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_blockTrackerContract\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"processBuilderCommitmentForBlockNumber\",\"inputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"blockNumber\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"builder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"isSlash\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"residualBidPercentAfterDecay\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"CommitmentProcessed\",\"inputs\":[{\"name\":\"commitmentHash\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"isSlash\",\"type\":\"bool\",\"indexed\":false,\"internalType\":\"bool\"}],\"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\":\"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\"}]}]", } // OracleABI is the input ABI used to generate the binding from. @@ -242,6 +242,27 @@ func (_Oracle *OracleCallerSession) Owner() (common.Address, error) { return _Oracle.Contract.Owner(&_Oracle.CallOpts) } +// Initialize is a paid mutator transaction binding the contract method 0xc0c53b8b. +// +// Solidity: function initialize(address _preConfContract, address _blockTrackerContract, address _owner) returns() +func (_Oracle *OracleTransactor) Initialize(opts *bind.TransactOpts, _preConfContract common.Address, _blockTrackerContract common.Address, _owner common.Address) (*types.Transaction, error) { + return _Oracle.contract.Transact(opts, "initialize", _preConfContract, _blockTrackerContract, _owner) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc0c53b8b. +// +// Solidity: function initialize(address _preConfContract, address _blockTrackerContract, address _owner) returns() +func (_Oracle *OracleSession) Initialize(_preConfContract common.Address, _blockTrackerContract common.Address, _owner common.Address) (*types.Transaction, error) { + return _Oracle.Contract.Initialize(&_Oracle.TransactOpts, _preConfContract, _blockTrackerContract, _owner) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc0c53b8b. +// +// Solidity: function initialize(address _preConfContract, address _blockTrackerContract, address _owner) returns() +func (_Oracle *OracleTransactorSession) Initialize(_preConfContract common.Address, _blockTrackerContract common.Address, _owner common.Address) (*types.Transaction, error) { + return _Oracle.Contract.Initialize(&_Oracle.TransactOpts, _preConfContract, _blockTrackerContract, _owner) +} + // ProcessBuilderCommitmentForBlockNumber is a paid mutator transaction binding the contract method 0x40d46772. // // Solidity: function processBuilderCommitmentForBlockNumber(bytes32 commitmentIndex, uint256 blockNumber, address builder, bool isSlash, uint256 residualBidPercentAfterDecay) returns() @@ -482,6 +503,140 @@ func (_Oracle *OracleFilterer) ParseCommitmentProcessed(log types.Log) (*OracleC return event, nil } +// OracleInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the Oracle contract. +type OracleInitializedIterator struct { + Event *OracleInitialized // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *OracleInitializedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(OracleInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(OracleInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *OracleInitializedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *OracleInitializedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// OracleInitialized represents a Initialized event raised by the Oracle contract. +type OracleInitialized struct { + Version uint64 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterInitialized is a free log retrieval operation binding the contract event 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2. +// +// Solidity: event Initialized(uint64 version) +func (_Oracle *OracleFilterer) FilterInitialized(opts *bind.FilterOpts) (*OracleInitializedIterator, error) { + + logs, sub, err := _Oracle.contract.FilterLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return &OracleInitializedIterator{contract: _Oracle.contract, event: "Initialized", logs: logs, sub: sub}, nil +} + +// WatchInitialized is a free log subscription operation binding the contract event 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2. +// +// Solidity: event Initialized(uint64 version) +func (_Oracle *OracleFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *OracleInitialized) (event.Subscription, error) { + + logs, sub, err := _Oracle.contract.WatchLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(OracleInitialized) + if err := _Oracle.contract.UnpackLog(event, "Initialized", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseInitialized is a log parse operation binding the contract event 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2. +// +// Solidity: event Initialized(uint64 version) +func (_Oracle *OracleFilterer) ParseInitialized(log types.Log) (*OracleInitialized, error) { + event := new(OracleInitialized) + if err := _Oracle.contract.UnpackLog(event, "Initialized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + // OracleOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the Oracle contract. type OracleOwnershipTransferredIterator struct { Event *OracleOwnershipTransferred // Event containing the contract specifics and raw log diff --git a/contracts-abi/clients/PreConfCommitmentStore/PreConfCommitmentStore.go b/contracts-abi/clients/PreConfCommitmentStore/PreConfCommitmentStore.go index ba6ac8c95..6f86d4b78 100644 --- a/contracts-abi/clients/PreConfCommitmentStore/PreConfCommitmentStore.go +++ b/contracts-abi/clients/PreConfCommitmentStore/PreConfCommitmentStore.go @@ -58,7 +58,7 @@ type PreConfCommitmentStorePreConfCommitment struct { // PreconfcommitmentstoreMetaData contains all meta data concerning the Preconfcommitmentstore contract. var PreconfcommitmentstoreMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"constructor\",\"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\"}],\"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\":\"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\":\"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}]", + 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\"}]}]", } // PreconfcommitmentstoreABI is the input ABI used to generate the binding from. @@ -1268,6 +1268,27 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreCallerSession) VerifyPreCon return _Preconfcommitmentstore.Contract.VerifyPreConfCommitment(&_Preconfcommitmentstore.CallOpts, txnHash, bid, blockNumber, decayStartTimeStamp, decayEndTimeStamp, bidHash, bidSignature, commitmentSignature, sharedSecretKey) } +// 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) +} + +// 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) +} + +// 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) +} + // InitiateReward is a paid mutator transaction binding the contract method 0x03faf979. // // Solidity: function initiateReward(bytes32 commitmentIndex, uint256 residualBidPercentAfterDecay) returns() @@ -1825,6 +1846,140 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreFilterer) ParseEncryptedCom return event, nil } +// PreconfcommitmentstoreInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the Preconfcommitmentstore contract. +type PreconfcommitmentstoreInitializedIterator struct { + Event *PreconfcommitmentstoreInitialized // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *PreconfcommitmentstoreInitializedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(PreconfcommitmentstoreInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(PreconfcommitmentstoreInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *PreconfcommitmentstoreInitializedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *PreconfcommitmentstoreInitializedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// PreconfcommitmentstoreInitialized represents a Initialized event raised by the Preconfcommitmentstore contract. +type PreconfcommitmentstoreInitialized struct { + Version uint64 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterInitialized is a free log retrieval operation binding the contract event 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2. +// +// Solidity: event Initialized(uint64 version) +func (_Preconfcommitmentstore *PreconfcommitmentstoreFilterer) FilterInitialized(opts *bind.FilterOpts) (*PreconfcommitmentstoreInitializedIterator, error) { + + logs, sub, err := _Preconfcommitmentstore.contract.FilterLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return &PreconfcommitmentstoreInitializedIterator{contract: _Preconfcommitmentstore.contract, event: "Initialized", logs: logs, sub: sub}, nil +} + +// WatchInitialized is a free log subscription operation binding the contract event 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2. +// +// Solidity: event Initialized(uint64 version) +func (_Preconfcommitmentstore *PreconfcommitmentstoreFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *PreconfcommitmentstoreInitialized) (event.Subscription, error) { + + logs, sub, err := _Preconfcommitmentstore.contract.WatchLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(PreconfcommitmentstoreInitialized) + if err := _Preconfcommitmentstore.contract.UnpackLog(event, "Initialized", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseInitialized is a log parse operation binding the contract event 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2. +// +// Solidity: event Initialized(uint64 version) +func (_Preconfcommitmentstore *PreconfcommitmentstoreFilterer) ParseInitialized(log types.Log) (*PreconfcommitmentstoreInitialized, error) { + event := new(PreconfcommitmentstoreInitialized) + if err := _Preconfcommitmentstore.contract.UnpackLog(event, "Initialized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + // PreconfcommitmentstoreOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the Preconfcommitmentstore contract. type PreconfcommitmentstoreOwnershipTransferredIterator struct { Event *PreconfcommitmentstoreOwnershipTransferred // Event containing the contract specifics and raw log diff --git a/contracts-abi/clients/ProviderRegistry/ProviderRegistry.go b/contracts-abi/clients/ProviderRegistry/ProviderRegistry.go index 033398601..1fce09dd1 100644 --- a/contracts-abi/clients/ProviderRegistry/ProviderRegistry.go +++ b/contracts-abi/clients/ProviderRegistry/ProviderRegistry.go @@ -31,7 +31,7 @@ var ( // ProviderregistryMetaData contains all meta data concerning the Providerregistry contract. var ProviderregistryMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_minStake\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_feeRecipient\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_feePercent\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"fallback\",\"stateMutability\":\"payable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"bidderAmount\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"checkStake\",\"inputs\":[{\"name\":\"provider\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"depositFunds\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"feePercent\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"feeRecipient\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"feeRecipientAmount\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"minStake\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"preConfirmationsContract\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"providerRegistered\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"providerStakes\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"registerAndStake\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setNewFeePercent\",\"inputs\":[{\"name\":\"newFeePercent\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setNewFeeRecipient\",\"inputs\":[{\"name\":\"newFeeRecipient\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setPreconfirmationsContract\",\"inputs\":[{\"name\":\"contractAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"slash\",\"inputs\":[{\"name\":\"amt\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"provider\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"addresspayable\"},{\"name\":\"residualBidPercentAfterDecay\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawBidderAmount\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawFeeRecipientAmount\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawStakedAmount\",\"inputs\":[{\"name\":\"provider\",\"type\":\"address\",\"internalType\":\"addresspayable\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"FundsDeposited\",\"inputs\":[{\"name\":\"provider\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"FundsSlashed\",\"inputs\":[{\"name\":\"provider\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"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\":\"ProviderRegistered\",\"inputs\":[{\"name\":\"provider\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"stakedAmount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false}]", + ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"fallback\",\"stateMutability\":\"payable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"bidderAmount\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"checkStake\",\"inputs\":[{\"name\":\"provider\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"depositFunds\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"feePercent\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"feeRecipient\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"feeRecipientAmount\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_minStake\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_feeRecipient\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_feePercent\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"minStake\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"preConfirmationsContract\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"providerRegistered\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"providerStakes\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"registerAndStake\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setNewFeePercent\",\"inputs\":[{\"name\":\"newFeePercent\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setNewFeeRecipient\",\"inputs\":[{\"name\":\"newFeeRecipient\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setPreconfirmationsContract\",\"inputs\":[{\"name\":\"contractAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"slash\",\"inputs\":[{\"name\":\"amt\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"provider\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"addresspayable\"},{\"name\":\"residualBidPercentAfterDecay\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawBidderAmount\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawFeeRecipientAmount\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawStakedAmount\",\"inputs\":[{\"name\":\"provider\",\"type\":\"address\",\"internalType\":\"addresspayable\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"FundsDeposited\",\"inputs\":[{\"name\":\"provider\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"FundsSlashed\",\"inputs\":[{\"name\":\"provider\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"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\":\"ProviderRegistered\",\"inputs\":[{\"name\":\"provider\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"stakedAmount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"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\"}]},{\"type\":\"error\",\"name\":\"ReentrancyGuardReentrantCall\",\"inputs\":[]}]", } // ProviderregistryABI is the input ABI used to generate the binding from. @@ -511,6 +511,27 @@ func (_Providerregistry *ProviderregistryTransactorSession) DepositFunds() (*typ return _Providerregistry.Contract.DepositFunds(&_Providerregistry.TransactOpts) } +// Initialize is a paid mutator transaction binding the contract method 0x66953e62. +// +// Solidity: function initialize(uint256 _minStake, address _feeRecipient, uint16 _feePercent, address _owner) returns() +func (_Providerregistry *ProviderregistryTransactor) Initialize(opts *bind.TransactOpts, _minStake *big.Int, _feeRecipient common.Address, _feePercent uint16, _owner common.Address) (*types.Transaction, error) { + return _Providerregistry.contract.Transact(opts, "initialize", _minStake, _feeRecipient, _feePercent, _owner) +} + +// Initialize is a paid mutator transaction binding the contract method 0x66953e62. +// +// Solidity: function initialize(uint256 _minStake, address _feeRecipient, uint16 _feePercent, address _owner) returns() +func (_Providerregistry *ProviderregistrySession) Initialize(_minStake *big.Int, _feeRecipient common.Address, _feePercent uint16, _owner common.Address) (*types.Transaction, error) { + return _Providerregistry.Contract.Initialize(&_Providerregistry.TransactOpts, _minStake, _feeRecipient, _feePercent, _owner) +} + +// Initialize is a paid mutator transaction binding the contract method 0x66953e62. +// +// Solidity: function initialize(uint256 _minStake, address _feeRecipient, uint16 _feePercent, address _owner) returns() +func (_Providerregistry *ProviderregistryTransactorSession) Initialize(_minStake *big.Int, _feeRecipient common.Address, _feePercent uint16, _owner common.Address) (*types.Transaction, error) { + return _Providerregistry.Contract.Initialize(&_Providerregistry.TransactOpts, _minStake, _feeRecipient, _feePercent, _owner) +} + // RegisterAndStake is a paid mutator transaction binding the contract method 0x84d180ee. // // Solidity: function registerAndStake() payable returns() @@ -1053,6 +1074,140 @@ func (_Providerregistry *ProviderregistryFilterer) ParseFundsSlashed(log types.L return event, nil } +// ProviderregistryInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the Providerregistry contract. +type ProviderregistryInitializedIterator struct { + Event *ProviderregistryInitialized // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *ProviderregistryInitializedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(ProviderregistryInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(ProviderregistryInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *ProviderregistryInitializedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ProviderregistryInitializedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ProviderregistryInitialized represents a Initialized event raised by the Providerregistry contract. +type ProviderregistryInitialized struct { + Version uint64 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterInitialized is a free log retrieval operation binding the contract event 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2. +// +// Solidity: event Initialized(uint64 version) +func (_Providerregistry *ProviderregistryFilterer) FilterInitialized(opts *bind.FilterOpts) (*ProviderregistryInitializedIterator, error) { + + logs, sub, err := _Providerregistry.contract.FilterLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return &ProviderregistryInitializedIterator{contract: _Providerregistry.contract, event: "Initialized", logs: logs, sub: sub}, nil +} + +// WatchInitialized is a free log subscription operation binding the contract event 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2. +// +// Solidity: event Initialized(uint64 version) +func (_Providerregistry *ProviderregistryFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *ProviderregistryInitialized) (event.Subscription, error) { + + logs, sub, err := _Providerregistry.contract.WatchLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(ProviderregistryInitialized) + if err := _Providerregistry.contract.UnpackLog(event, "Initialized", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseInitialized is a log parse operation binding the contract event 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2. +// +// Solidity: event Initialized(uint64 version) +func (_Providerregistry *ProviderregistryFilterer) ParseInitialized(log types.Log) (*ProviderregistryInitialized, error) { + event := new(ProviderregistryInitialized) + if err := _Providerregistry.contract.UnpackLog(event, "Initialized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + // ProviderregistryOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the Providerregistry contract. type ProviderregistryOwnershipTransferredIterator struct { Event *ProviderregistryOwnershipTransferred // Event containing the contract specifics and raw log diff --git a/contracts-abi/clients/SettlementGateway/SettlementGateway.go b/contracts-abi/clients/SettlementGateway/SettlementGateway.go index a1fca7f9e..8a713282d 100644 --- a/contracts-abi/clients/SettlementGateway/SettlementGateway.go +++ b/contracts-abi/clients/SettlementGateway/SettlementGateway.go @@ -31,7 +31,7 @@ var ( // SettlementgatewayMetaData contains all meta data concerning the Settlementgateway contract. var SettlementgatewayMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_whitelistAddr\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_relayer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_finalizationFee\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_counterpartyFee\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"counterpartyFee\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"finalizationFee\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"finalizeTransfer\",\"inputs\":[{\"name\":\"_recipient\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_counterpartyIdx\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initiateTransfer\",\"inputs\":[{\"name\":\"_recipient\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"returnIdx\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"relayer\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferFinalizedIdx\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"transferInitiatedIdx\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"whitelistAddr\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"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\":\"TransferFinalized\",\"inputs\":[{\"name\":\"recipient\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"counterpartyIdx\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"TransferInitiated\",\"inputs\":[{\"name\":\"sender\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"recipient\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"transferIdx\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"}],\"anonymous\":false}]", + ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"counterpartyFee\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"finalizationFee\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"finalizeTransfer\",\"inputs\":[{\"name\":\"_recipient\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_counterpartyIdx\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_whitelistAddr\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_relayer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_finalizationFee\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_counterpartyFee\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initiateTransfer\",\"inputs\":[{\"name\":\"_recipient\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"returnIdx\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"relayer\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferFinalizedIdx\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"transferInitiatedIdx\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"whitelistAddr\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"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\":\"TransferFinalized\",\"inputs\":[{\"name\":\"recipient\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"counterpartyIdx\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"TransferInitiated\",\"inputs\":[{\"name\":\"sender\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"recipient\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"transferIdx\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"}],\"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\"}]}]", } // SettlementgatewayABI is the input ABI used to generate the binding from. @@ -418,6 +418,27 @@ func (_Settlementgateway *SettlementgatewayTransactorSession) FinalizeTransfer(_ return _Settlementgateway.Contract.FinalizeTransfer(&_Settlementgateway.TransactOpts, _recipient, _amount, _counterpartyIdx) } +// Initialize is a paid mutator transaction binding the contract method 0xa6b63eb8. +// +// Solidity: function initialize(address _whitelistAddr, address _owner, address _relayer, uint256 _finalizationFee, uint256 _counterpartyFee) returns() +func (_Settlementgateway *SettlementgatewayTransactor) Initialize(opts *bind.TransactOpts, _whitelistAddr common.Address, _owner common.Address, _relayer common.Address, _finalizationFee *big.Int, _counterpartyFee *big.Int) (*types.Transaction, error) { + return _Settlementgateway.contract.Transact(opts, "initialize", _whitelistAddr, _owner, _relayer, _finalizationFee, _counterpartyFee) +} + +// Initialize is a paid mutator transaction binding the contract method 0xa6b63eb8. +// +// Solidity: function initialize(address _whitelistAddr, address _owner, address _relayer, uint256 _finalizationFee, uint256 _counterpartyFee) returns() +func (_Settlementgateway *SettlementgatewaySession) Initialize(_whitelistAddr common.Address, _owner common.Address, _relayer common.Address, _finalizationFee *big.Int, _counterpartyFee *big.Int) (*types.Transaction, error) { + return _Settlementgateway.Contract.Initialize(&_Settlementgateway.TransactOpts, _whitelistAddr, _owner, _relayer, _finalizationFee, _counterpartyFee) +} + +// Initialize is a paid mutator transaction binding the contract method 0xa6b63eb8. +// +// Solidity: function initialize(address _whitelistAddr, address _owner, address _relayer, uint256 _finalizationFee, uint256 _counterpartyFee) returns() +func (_Settlementgateway *SettlementgatewayTransactorSession) Initialize(_whitelistAddr common.Address, _owner common.Address, _relayer common.Address, _finalizationFee *big.Int, _counterpartyFee *big.Int) (*types.Transaction, error) { + return _Settlementgateway.Contract.Initialize(&_Settlementgateway.TransactOpts, _whitelistAddr, _owner, _relayer, _finalizationFee, _counterpartyFee) +} + // InitiateTransfer is a paid mutator transaction binding the contract method 0xb504cd1e. // // Solidity: function initiateTransfer(address _recipient, uint256 _amount) payable returns(uint256 returnIdx) @@ -481,6 +502,140 @@ func (_Settlementgateway *SettlementgatewayTransactorSession) TransferOwnership( return _Settlementgateway.Contract.TransferOwnership(&_Settlementgateway.TransactOpts, newOwner) } +// SettlementgatewayInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the Settlementgateway contract. +type SettlementgatewayInitializedIterator struct { + Event *SettlementgatewayInitialized // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *SettlementgatewayInitializedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SettlementgatewayInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SettlementgatewayInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SettlementgatewayInitializedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SettlementgatewayInitializedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SettlementgatewayInitialized represents a Initialized event raised by the Settlementgateway contract. +type SettlementgatewayInitialized struct { + Version uint64 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterInitialized is a free log retrieval operation binding the contract event 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2. +// +// Solidity: event Initialized(uint64 version) +func (_Settlementgateway *SettlementgatewayFilterer) FilterInitialized(opts *bind.FilterOpts) (*SettlementgatewayInitializedIterator, error) { + + logs, sub, err := _Settlementgateway.contract.FilterLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return &SettlementgatewayInitializedIterator{contract: _Settlementgateway.contract, event: "Initialized", logs: logs, sub: sub}, nil +} + +// WatchInitialized is a free log subscription operation binding the contract event 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2. +// +// Solidity: event Initialized(uint64 version) +func (_Settlementgateway *SettlementgatewayFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *SettlementgatewayInitialized) (event.Subscription, error) { + + logs, sub, err := _Settlementgateway.contract.WatchLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SettlementgatewayInitialized) + if err := _Settlementgateway.contract.UnpackLog(event, "Initialized", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseInitialized is a log parse operation binding the contract event 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2. +// +// Solidity: event Initialized(uint64 version) +func (_Settlementgateway *SettlementgatewayFilterer) ParseInitialized(log types.Log) (*SettlementgatewayInitialized, error) { + event := new(SettlementgatewayInitialized) + if err := _Settlementgateway.contract.UnpackLog(event, "Initialized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + // SettlementgatewayOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the Settlementgateway contract. type SettlementgatewayOwnershipTransferredIterator struct { Event *SettlementgatewayOwnershipTransferred // Event containing the contract specifics and raw log diff --git a/contracts-abi/clients/ValidatorRegistry/ValidatorRegistry.go b/contracts-abi/clients/ValidatorRegistry/ValidatorRegistry.go index 36cc2f2c7..55a84b142 100644 --- a/contracts-abi/clients/ValidatorRegistry/ValidatorRegistry.go +++ b/contracts-abi/clients/ValidatorRegistry/ValidatorRegistry.go @@ -31,7 +31,7 @@ var ( // ValidatorregistryMetaData contains all meta data concerning the Validatorregistry contract. var ValidatorregistryMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"getBlocksTillWithdrawAllowed\",\"inputs\":[{\"name\":\"valBLSPubKey\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getNumberOfStakedValidators\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getStakedAmount\",\"inputs\":[{\"name\":\"valBLSPubKey\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getStakedValidators\",\"inputs\":[{\"name\":\"start\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"end\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes[]\",\"internalType\":\"bytes[]\"},{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getUnstakingAmount\",\"inputs\":[{\"name\":\"valBLSPubKey\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_minStake\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_unstakePeriodBlocks\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"isStaked\",\"inputs\":[{\"name\":\"valBLSPubKey\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"minStake\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"stake\",\"inputs\":[{\"name\":\"valBLSPubKeys\",\"type\":\"bytes[]\",\"internalType\":\"bytes[]\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"stakeOriginators\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"stakedValsetVersion\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"unstake\",\"inputs\":[{\"name\":\"blsPubKeys\",\"type\":\"bytes[]\",\"internalType\":\"bytes[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"unstakeBlockNums\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"unstakePeriodBlocks\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"unstakingBalances\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"withdraw\",\"inputs\":[{\"name\":\"blsPubKeys\",\"type\":\"bytes[]\",\"internalType\":\"bytes[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"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\":\"StakeWithdrawn\",\"inputs\":[{\"name\":\"txOriginator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"valBLSPubKey\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Staked\",\"inputs\":[{\"name\":\"txOriginator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"valBLSPubKey\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Unstaked\",\"inputs\":[{\"name\":\"txOriginator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"valBLSPubKey\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"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\"}]},{\"type\":\"error\",\"name\":\"ReentrancyGuardReentrantCall\",\"inputs\":[]}]", + ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"fallback\",\"stateMutability\":\"payable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"getBlocksTillWithdrawAllowed\",\"inputs\":[{\"name\":\"valBLSPubKey\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getNumberOfStakedValidators\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getStakedAmount\",\"inputs\":[{\"name\":\"valBLSPubKey\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getStakedValidators\",\"inputs\":[{\"name\":\"start\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"end\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes[]\",\"internalType\":\"bytes[]\"},{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getUnstakingAmount\",\"inputs\":[{\"name\":\"valBLSPubKey\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_minStake\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_unstakePeriodBlocks\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"isStaked\",\"inputs\":[{\"name\":\"valBLSPubKey\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"minStake\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"stake\",\"inputs\":[{\"name\":\"valBLSPubKeys\",\"type\":\"bytes[]\",\"internalType\":\"bytes[]\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"stakeOriginators\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"stakedValsetVersion\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"unstake\",\"inputs\":[{\"name\":\"blsPubKeys\",\"type\":\"bytes[]\",\"internalType\":\"bytes[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"unstakeBlockNums\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"unstakePeriodBlocks\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"unstakingBalances\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"withdraw\",\"inputs\":[{\"name\":\"blsPubKeys\",\"type\":\"bytes[]\",\"internalType\":\"bytes[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"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\":\"StakeWithdrawn\",\"inputs\":[{\"name\":\"txOriginator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"valBLSPubKey\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Staked\",\"inputs\":[{\"name\":\"txOriginator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"valBLSPubKey\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Unstaked\",\"inputs\":[{\"name\":\"txOriginator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"valBLSPubKey\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"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\"}]},{\"type\":\"error\",\"name\":\"ReentrancyGuardReentrantCall\",\"inputs\":[]}]", } // ValidatorregistryABI is the input ABI used to generate the binding from. @@ -711,6 +711,48 @@ func (_Validatorregistry *ValidatorregistryTransactorSession) Withdraw(blsPubKey return _Validatorregistry.Contract.Withdraw(&_Validatorregistry.TransactOpts, blsPubKeys) } +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() payable returns() +func (_Validatorregistry *ValidatorregistryTransactor) Fallback(opts *bind.TransactOpts, calldata []byte) (*types.Transaction, error) { + return _Validatorregistry.contract.RawTransact(opts, calldata) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() payable returns() +func (_Validatorregistry *ValidatorregistrySession) Fallback(calldata []byte) (*types.Transaction, error) { + return _Validatorregistry.Contract.Fallback(&_Validatorregistry.TransactOpts, calldata) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() payable returns() +func (_Validatorregistry *ValidatorregistryTransactorSession) Fallback(calldata []byte) (*types.Transaction, error) { + return _Validatorregistry.Contract.Fallback(&_Validatorregistry.TransactOpts, calldata) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_Validatorregistry *ValidatorregistryTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Validatorregistry.contract.RawTransact(opts, nil) // calldata is disallowed for receive function +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_Validatorregistry *ValidatorregistrySession) Receive() (*types.Transaction, error) { + return _Validatorregistry.Contract.Receive(&_Validatorregistry.TransactOpts) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_Validatorregistry *ValidatorregistryTransactorSession) Receive() (*types.Transaction, error) { + return _Validatorregistry.Contract.Receive(&_Validatorregistry.TransactOpts) +} + // ValidatorregistryInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the Validatorregistry contract. type ValidatorregistryInitializedIterator struct { Event *ValidatorregistryInitialized // Event containing the contract specifics and raw log diff --git a/contracts-abi/config/testnet.go b/contracts-abi/config/testnet.go index eb74d2c07..1f01478cc 100644 --- a/contracts-abi/config/testnet.go +++ b/contracts-abi/config/testnet.go @@ -9,9 +9,9 @@ type Contracts struct { } var TestnetContracts = Contracts{ - BidderRegistry: "0x1E218818D409E0f00dfeBE8A960F7585d4fDff70", - ProviderRegistry: "0x0332388390d9df01cA3d26269f2B1Fc314deD9c0", - PreconfCommitmentStore: "0x2Aff805aBdF1Fe79AfcF8B3a9B4B45ECcD6b6D6e", - Oracle: "0x77A4FE615de28fdf0bF68D9B9ba773A32b5C7630", - BlockTracker: "0x042744D8cF66d8455350D43F9e09CA73b5C0CB94", + BidderRegistry: "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9", + ProviderRegistry: "0x5FC8d32690cc91D4c39d9d3abcBD16989F875707", + PreconfCommitmentStore: "0xa513E6E4b8f2a923D98304ec87F64353C4D5C853", + Oracle: "0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e", + BlockTracker: "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512", } diff --git a/contracts-abi/script.sh b/contracts-abi/script.sh index ff30bb73f..d1cf585a0 100755 --- a/contracts-abi/script.sh +++ b/contracts-abi/script.sh @@ -26,7 +26,7 @@ extract_and_save_abi "$BASE_DIR/out/ProviderRegistry.sol/ProviderRegistry.json" extract_and_save_abi "$BASE_DIR/out/Oracle.sol/Oracle.json" "$ABI_DIR/Oracle.abi" # Extract ABI for PreConfCommitmentStore.json -extract_and_save_abi "$BASE_DIR/out/PreConfirmations.sol/PreConfCommitmentStore.json" "$ABI_DIR/PreConfCommitmentStore.abi" +extract_and_save_abi "$BASE_DIR/out/PreConfCommitmentStore.sol/PreConfCommitmentStore.json" "$ABI_DIR/PreConfCommitmentStore.abi" # Extract ABI for SettlementGateway.json extract_and_save_abi "$BASE_DIR/out/SettlementGateway.sol/SettlementGateway.json" "$ABI_DIR/SettlementGateway.abi" diff --git a/contracts/Makefile b/contracts/Makefile index ce30c0417..6d86c1516 100644 --- a/contracts/Makefile +++ b/contracts/Makefile @@ -2,3 +2,7 @@ deploy-val-reg: forge clean DEPLOY_TYPE="validator-registry" RPC_URL="http://localhost:8545" PRIVATE_KEY="0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" CHAIN_ID="17864" ./entrypoint.sh + +deploy-core: + forge clean + DEPLOY_TYPE="core" RPC_URL="http://localhost:8545" PRIVATE_KEY="0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" CHAIN_ID="17864" ./entrypoint.sh diff --git a/contracts/contracts/BidderRegistry.sol b/contracts/contracts/BidderRegistry.sol index e81e28bbf..28f237a50 100644 --- a/contracts/contracts/BidderRegistry.sol +++ b/contracts/contracts/BidderRegistry.sol @@ -1,15 +1,16 @@ // SPDX-License-Identifier: BSL 1.1 -pragma solidity ^0.8.15; +pragma solidity ^0.8.20; + +import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; +import {ReentrancyGuardUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol"; -import {Ownable} from "@openzeppelin-contracts/contracts/access/Ownable.sol"; -import {ReentrancyGuard} from "@openzeppelin-contracts/contracts/security/ReentrancyGuard.sol"; import {IBidderRegistry} from "./interfaces/IBidderRegistry.sol"; import {IBlockTracker} from "./interfaces/IBlockTracker.sol"; /// @title Bidder Registry /// @author Kartik Chopra /// @notice This contract is for bidder registry and staking. -contract BidderRegistry is IBidderRegistry, Ownable, ReentrancyGuard { +contract BidderRegistry is IBidderRegistry, OwnableUpgradeable, ReentrancyGuardUpgradeable { /// @dev For improved precision uint256 constant PRECISION = 10 ** 25; uint256 constant PERCENT = 100 * PRECISION; @@ -94,24 +95,30 @@ contract BidderRegistry is IBidderRegistry, Ownable, ReentrancyGuard { } /** - * @dev Constructor to initialize the contract with a minimum deposit requirement. + * @dev Initializes the contract with a minimum deposit requirement. * @param _minDeposit The minimum deposit required for bidder registration. * @param _feeRecipient The address that receives fee * @param _feePercent The fee percentage for protocol * @param _owner Owner of the contract, explicitly needed since contract is deployed w/ create2 factory. */ - constructor( + function initialize( uint256 _minDeposit, address _feeRecipient, uint16 _feePercent, address _owner, address _blockTracker - ) { + ) external initializer { minDeposit = _minDeposit; feeRecipient = _feeRecipient; feePercent = _feePercent; blockTrackerContract = IBlockTracker(_blockTracker); - _transferOwnership(_owner); + __Ownable_init(_owner); + } + + /// @dev See https://docs.openzeppelin.com/upgrades-plugins/1.x/writing-upgradeable#initializing_the_implementation_contract + /// @custom:oz-upgrades-unsafe-allow constructor + constructor() { + _disableInitializers(); } /** diff --git a/contracts/contracts/BlockTracker.sol b/contracts/contracts/BlockTracker.sol index ef4d41d8e..dea175b30 100644 --- a/contracts/contracts/BlockTracker.sol +++ b/contracts/contracts/BlockTracker.sol @@ -1,12 +1,13 @@ +// SPDX-License-Identifier: BSL 1.1 pragma solidity ^0.8.20; -import {Ownable} from "@openzeppelin-contracts/contracts/access/Ownable.sol"; +import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; /** * @title BlockTracker * @dev A contract that tracks Ethereum blocks and their winners. */ -contract BlockTracker is Ownable { +contract BlockTracker is OwnableUpgradeable { /// @dev Event emitted when a new L1 block is tracked. event NewL1Block( uint256 indexed blockNumber, @@ -20,8 +21,8 @@ contract BlockTracker is Ownable { /// @dev Event emitted when the number of blocks per window is updated. event NewBlocksPerWindow(uint256 blocksPerWindow); - uint256 public currentWindow = 1; - uint256 public blocksPerWindow = 10; + uint256 public currentWindow; + uint256 public blocksPerWindow; // Mapping from block number to the winner's address mapping(uint256 => address) public blockWinners; @@ -33,8 +34,16 @@ contract BlockTracker is Ownable { * @dev Initializes the BlockTracker contract with the specified owner. * @param _owner The address of the contract owner. */ - constructor(address _owner) Ownable() { - _transferOwnership(_owner); + function initialize(address _owner) external initializer { + currentWindow = 1; + blocksPerWindow = 10; + __Ownable_init(_owner); + } + + /// @dev See https://docs.openzeppelin.com/upgrades-plugins/1.x/writing-upgradeable#initializing_the_implementation_contract + /// @custom:oz-upgrades-unsafe-allow constructor + constructor() { + _disableInitializers(); } /** diff --git a/contracts/contracts/Oracle.sol b/contracts/contracts/Oracle.sol index 2b978420e..e8747c4a5 100644 --- a/contracts/contracts/Oracle.sol +++ b/contracts/contracts/Oracle.sol @@ -1,10 +1,10 @@ // SPDX-License-Identifier: BSL 1.1 pragma solidity ^0.8.20; -import {Ownable} from "@openzeppelin-contracts/contracts/access/Ownable.sol"; -import {PreConfCommitmentStore} from "./PreConfirmations.sol"; +import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; +import {PreConfCommitmentStore} from "./PreConfCommitmentStore.sol"; import {IProviderRegistry} from "./interfaces/IProviderRegistry.sol"; -import {IPreConfCommitmentStore} from './interfaces/IPreConfirmations.sol'; +import {IPreConfCommitmentStore} from './interfaces/IPreConfCommitmentStore.sol'; import {IBidderRegistry} from './interfaces/IBidderRegistry.sol'; import {IBlockTracker} from "./interfaces/IBlockTracker.sol"; @@ -16,7 +16,7 @@ import {IBlockTracker} from "./interfaces/IBlockTracker.sol"; * @title Oracle - A contract for Fetching L1 Block Builder Info and Block Data. * @dev This contract serves as an oracle to fetch and process Ethereum Layer 1 block data. */ -contract Oracle is Ownable { +contract Oracle is OwnableUpgradeable { /// @dev Maps builder names to their respective Ethereum addresses. mapping(string => address) public blockBuilderNameToAddress; @@ -40,18 +40,24 @@ contract Oracle is Ownable { IBlockTracker private blockTrackerContract; /** - * @dev Constructor to initialize the contract with a PreConfirmations contract. + * @dev Initializes the contract with a PreConfirmations contract. * @param _preConfContract The address of the pre-confirmations contract. * @param _owner Owner of the contract, explicitly needed since contract is deployed with create2 factory. */ - constructor( + function initialize( address _preConfContract, address _blockTrackerContract, address _owner - ) Ownable() { + ) external initializer { preConfContract = IPreConfCommitmentStore(_preConfContract); blockTrackerContract = IBlockTracker(_blockTrackerContract); - _transferOwnership(_owner); + __Ownable_init(_owner); + } + + /// @dev See https://docs.openzeppelin.com/upgrades-plugins/1.x/writing-upgradeable#initializing_the_implementation_contract + /// @custom:oz-upgrades-unsafe-allow constructor + constructor() { + _disableInitializers(); } /// @dev Event emitted when a commitment is processed. diff --git a/contracts/contracts/PreConfirmations.sol b/contracts/contracts/PreConfCommitmentStore.sol similarity index 97% rename from contracts/contracts/PreConfirmations.sol rename to contracts/contracts/PreConfCommitmentStore.sol index 204cc5504..d8387b0af 100644 --- a/contracts/contracts/PreConfirmations.sol +++ b/contracts/contracts/PreConfCommitmentStore.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: BSL 1.1 -pragma solidity ^0.8.15; +pragma solidity ^0.8.20; import {ECDSA} from "@openzeppelin-contracts/contracts/utils/cryptography/ECDSA.sol"; -import {Ownable} from "@openzeppelin-contracts/contracts/access/Ownable.sol"; +import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import {IProviderRegistry} from "./interfaces/IProviderRegistry.sol"; import {IBidderRegistry} from "./interfaces/IBidderRegistry.sol"; @@ -14,7 +14,7 @@ import "forge-std/console.sol"; * @title PreConfCommitmentStore - A contract for managing preconfirmation commitments and bids. * @notice This contract allows bidders to make precommitments and bids and provides a mechanism for the oracle to verify and process them. */ -contract PreConfCommitmentStore is Ownable { +contract PreConfCommitmentStore is OwnableUpgradeable { using ECDSA for bytes32; /// @dev EIP-712 Type Hash for preconfirmation commitment @@ -165,19 +165,19 @@ contract PreConfCommitmentStore is Ownable { * @param _oracle The address of the oracle. * @param _owner Owner of the contract, explicitly needed since contract is deployed w/ create2 factory. */ - constructor( + function initialize( address _providerRegistry, address _bidderRegistry, address _oracle, address _owner, address _blockTracker, uint64 _commitment_dispatch_window - ) { + ) external initializer { oracle = _oracle; blockTracker = IBlockTracker(_blockTracker); providerRegistry = IProviderRegistry(_providerRegistry); bidderRegistry = IBidderRegistry(_bidderRegistry); - _transferOwnership(_owner); + __Ownable_init(_owner); // EIP-712 domain separator DOMAIN_SEPARATOR_PRECONF = keccak256( @@ -206,6 +206,12 @@ contract PreConfCommitmentStore is Ownable { commitment_dispatch_window = newDispatchWindow; } + /// @dev See https://docs.openzeppelin.com/upgrades-plugins/1.x/writing-upgradeable#initializing_the_implementation_contract + /// @custom:oz-upgrades-unsafe-allow constructor + constructor() { + _disableInitializers(); + } + /** * @dev Gives digest to be signed for bids * @param _txnHash transaction Hash. diff --git a/contracts/contracts/ProviderRegistry.sol b/contracts/contracts/ProviderRegistry.sol index 441d4e855..773098f93 100644 --- a/contracts/contracts/ProviderRegistry.sol +++ b/contracts/contracts/ProviderRegistry.sol @@ -1,15 +1,15 @@ // SPDX-License-Identifier: BSL 1.1 -pragma solidity ^0.8.15; +pragma solidity ^0.8.20; -import {Ownable} from "@openzeppelin-contracts/contracts/access/Ownable.sol"; -import {ReentrancyGuard} from "@openzeppelin-contracts/contracts/security/ReentrancyGuard.sol"; -import {PreConfCommitmentStore} from "./PreConfirmations.sol"; +import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; +import {ReentrancyGuardUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol"; +import {PreConfCommitmentStore} from "./PreConfCommitmentStore.sol"; 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, Ownable, ReentrancyGuard { +contract ProviderRegistry is IProviderRegistry, OwnableUpgradeable, ReentrancyGuardUpgradeable { /// @dev For improved precision uint256 constant PRECISION = 10 ** 25; uint256 constant PERCENT = 100 * PRECISION; @@ -64,22 +64,28 @@ contract ProviderRegistry is IProviderRegistry, Ownable, ReentrancyGuard { } /** - * @dev Constructor to initialize the contract with a minimum stake requirement. + * @dev Initializes the contract with a minimum stake requirement. * @param _minStake The minimum stake required for provider registration. * @param _feeRecipient The address that receives fee * @param _feePercent The fee percentage for protocol * @param _owner Owner of the contract, explicitly needed since contract is deployed w/ create2 factory. */ - constructor( + function initialize( uint256 _minStake, address _feeRecipient, uint16 _feePercent, address _owner - ) { + ) external initializer { minStake = _minStake; feeRecipient = _feeRecipient; feePercent = _feePercent; - _transferOwnership(_owner); + __Ownable_init(_owner); + } + + /// @dev See https://docs.openzeppelin.com/upgrades-plugins/1.x/writing-upgradeable#initializing_the_implementation_contract + /// @custom:oz-upgrades-unsafe-allow constructor + constructor() { + _disableInitializers(); } /** diff --git a/contracts/contracts/ValidatorRegistry.sol b/contracts/contracts/ValidatorRegistry.sol index dacb96d86..ae384820d 100644 --- a/contracts/contracts/ValidatorRegistry.sol +++ b/contracts/contracts/ValidatorRegistry.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BSL 1.1 -pragma solidity ^0.8.15; +pragma solidity ^0.8.20; import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import {ReentrancyGuardUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol"; @@ -21,6 +21,20 @@ contract ValidatorRegistry is OwnableUpgradeable, ReentrancyGuardUpgradeable { /// @dev Number of blocks required between unstake initiation and withdrawal. uint256 public unstakePeriodBlocks; + /** + * @dev Fallback function to revert all calls, ensuring no unintended interactions. + */ + fallback() external payable { + revert("Invalid call"); + } + + /** + * @dev Receive function is disabled for this contract to prevent unintended interactions. + */ + receive() external payable { + revert("Invalid call"); + } + function initialize( uint256 _minStake, uint256 _unstakePeriodBlocks, diff --git a/contracts/contracts/Whitelist.sol b/contracts/contracts/Whitelist.sol index 7fd7846f3..f39838f9a 100644 --- a/contracts/contracts/Whitelist.sol +++ b/contracts/contracts/Whitelist.sol @@ -1,18 +1,24 @@ // SPDX-License-Identifier: BSL 1.1 -pragma solidity ^0.8.15; +pragma solidity ^0.8.20; -import {Ownable} from "@openzeppelin-contracts/contracts/access/Ownable.sol"; +import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; // Contract that allows an admin to add/remove addresses from the whitelist, // and allows whitelisted addresses to mint native tokens. // // The whitelist contract's create2 address must be funded on genesis. -contract Whitelist is Ownable { +contract Whitelist is OwnableUpgradeable { mapping(address => bool) public whitelistedAddresses; - constructor(address _owner) Ownable() { - _transferOwnership(_owner); + function initialize(address _owner) external initializer { + __Ownable_init(_owner); + } + + /// @dev See https://docs.openzeppelin.com/upgrades-plugins/1.x/writing-upgradeable#initializing_the_implementation_contract + /// @custom:oz-upgrades-unsafe-allow constructor + constructor() { + _disableInitializers(); } function addToWhitelist(address _address) external onlyOwner { diff --git a/contracts/contracts/interfaces/IBidderRegistry.sol b/contracts/contracts/interfaces/IBidderRegistry.sol index ca0ad0b23..211f9006b 100644 --- a/contracts/contracts/interfaces/IBidderRegistry.sol +++ b/contracts/contracts/interfaces/IBidderRegistry.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BSL 1.1 -pragma solidity ^0.8.15; +pragma solidity ^0.8.20; interface IBidderRegistry { struct PreConfCommitment { diff --git a/contracts/contracts/interfaces/IBlockTracker.sol b/contracts/contracts/interfaces/IBlockTracker.sol index c2e73d676..789dc5e1b 100644 --- a/contracts/contracts/interfaces/IBlockTracker.sol +++ b/contracts/contracts/interfaces/IBlockTracker.sol @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: MIT +// SPDX-License-Identifier: BSL 1.1 pragma solidity ^0.8.20; /// @title IBlockTracker interface for BlockTracker contract diff --git a/contracts/contracts/interfaces/IPreConfirmations.sol b/contracts/contracts/interfaces/IPreConfCommitmentStore.sol similarity index 100% rename from contracts/contracts/interfaces/IPreConfirmations.sol rename to contracts/contracts/interfaces/IPreConfCommitmentStore.sol diff --git a/contracts/contracts/interfaces/IProviderRegistry.sol b/contracts/contracts/interfaces/IProviderRegistry.sol index dd86a4fc8..ff9b6a8d8 100644 --- a/contracts/contracts/interfaces/IProviderRegistry.sol +++ b/contracts/contracts/interfaces/IProviderRegistry.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BSL 1.1 -pragma solidity ^0.8.15; +pragma solidity ^0.8.20; interface IProviderRegistry { function registerAndStake() external payable; diff --git a/contracts/contracts/interfaces/IWhitelist.sol b/contracts/contracts/interfaces/IWhitelist.sol index 1b8db763c..c059cdd48 100644 --- a/contracts/contracts/interfaces/IWhitelist.sol +++ b/contracts/contracts/interfaces/IWhitelist.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BSL 1.1 -pragma solidity ^0.8.15; +pragma solidity ^0.8.20; interface IWhitelist { function mint(address _mintTo, uint256 _amount) external; diff --git a/contracts/contracts/standard-bridge/Gateway.sol b/contracts/contracts/standard-bridge/Gateway.sol index 9f9ec3448..4244e88d3 100644 --- a/contracts/contracts/standard-bridge/Gateway.sol +++ b/contracts/contracts/standard-bridge/Gateway.sol @@ -1,12 +1,12 @@ // SPDX-License-Identifier: BSL 1.1 -pragma solidity ^0.8.15; +pragma solidity ^0.8.20; -import {Ownable} from "@openzeppelin-contracts/contracts/access/Ownable.sol"; +import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; /** * @dev Gateway contract for standard bridge. */ -abstract contract Gateway is Ownable { +abstract contract Gateway is OwnableUpgradeable { // @dev index for tracking transfer initiations. // Also total number of transfers initiated from this gateway. @@ -17,24 +17,14 @@ abstract contract Gateway is Ownable { uint256 public transferFinalizedIdx; // @dev Address of relayer account. - address public immutable relayer; + address public relayer; // @dev Flat fee (wei) paid to relayer on destination chain upon transfer finalization. // This must be greater than what relayer will pay per tx. - uint256 public immutable finalizationFee; + uint256 public finalizationFee; // The counterparty's finalization fee (wei), included for UX purposes - uint256 public immutable counterpartyFee; - - constructor(address _owner, address _relayer, - uint256 _finalizationFee, uint256 _counterpartyFee) Ownable() { - relayer = _relayer; - finalizationFee = _finalizationFee; - counterpartyFee = _counterpartyFee; - transferInitiatedIdx = 0; - transferFinalizedIdx = 1; // First expected transfer index is 1 - _transferOwnership(_owner); - } + uint256 public counterpartyFee; function initiateTransfer(address _recipient, uint256 _amount ) external payable returns (uint256 returnIdx) { diff --git a/contracts/contracts/standard-bridge/L1Gateway.sol b/contracts/contracts/standard-bridge/L1Gateway.sol index 1c0faf049..4bd03d4e1 100644 --- a/contracts/contracts/standard-bridge/L1Gateway.sol +++ b/contracts/contracts/standard-bridge/L1Gateway.sol @@ -1,12 +1,29 @@ // SPDX-License-Identifier: BSL 1.1 -pragma solidity ^0.8.15; +pragma solidity ^0.8.20; import {Gateway} from "./Gateway.sol"; contract L1Gateway is Gateway { - constructor(address _owner, address _relayer, uint256 _finalizationFee, uint256 _counterpartyFee - ) Gateway(_owner, _relayer, _finalizationFee, _counterpartyFee) {} + function initialize( + address _owner, + address _relayer, + uint256 _finalizationFee, + uint256 _counterpartyFee + ) external initializer { + relayer = _relayer; + finalizationFee = _finalizationFee; + counterpartyFee = _counterpartyFee; + transferInitiatedIdx = 0; + transferFinalizedIdx = 1; // First expected transfer index is 1 + __Ownable_init(_owner); + } + + /// @dev See https://docs.openzeppelin.com/upgrades-plugins/1.x/writing-upgradeable#initializing_the_implementation_contract + /// @custom:oz-upgrades-unsafe-allow constructor + constructor() { + _disableInitializers(); + } function _decrementMsgSender(uint256 _amount) internal override { require(msg.value == _amount, "Incorrect Ether value sent"); diff --git a/contracts/contracts/standard-bridge/SettlementGateway.sol b/contracts/contracts/standard-bridge/SettlementGateway.sol index 68d3a4fb1..e96bbaa3d 100644 --- a/contracts/contracts/standard-bridge/SettlementGateway.sol +++ b/contracts/contracts/standard-bridge/SettlementGateway.sol @@ -1,20 +1,37 @@ // SPDX-License-Identifier: BSL 1.1 -pragma solidity ^0.8.15; +pragma solidity ^0.8.20; import {Gateway} from "./Gateway.sol"; import {IWhitelist} from "../interfaces/IWhitelist.sol"; -contract SettlementGateway is Gateway{ +contract SettlementGateway is Gateway { // Assuming deployer is 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266, // whitelist's create2 addr should be 0x57508f0B0f3426758F1f3D63ad4935a7c9383620. // This variable is not hardcoded for testing purposes. - address public immutable whitelistAddr; + address public whitelistAddr; - constructor(address _whitelistAddr, address _owner, address _relayer, uint256 _finalizationFee, uint256 _counterpartyFee - ) Gateway(_owner, _relayer, _finalizationFee, _counterpartyFee) { - whitelistAddr = _whitelistAddr; - } + function initialize( + address _whitelistAddr, + address _owner, + address _relayer, + uint256 _finalizationFee, + uint256 _counterpartyFee + ) external initializer { + whitelistAddr = _whitelistAddr; + relayer = _relayer; + finalizationFee = _finalizationFee; + counterpartyFee = _counterpartyFee; + transferInitiatedIdx = 0; + transferFinalizedIdx = 1; // First expected transfer index is 1 + __Ownable_init(_owner); + } + + /// @dev See https://docs.openzeppelin.com/upgrades-plugins/1.x/writing-upgradeable#initializing_the_implementation_contract + /// @custom:oz-upgrades-unsafe-allow constructor + constructor() { + _disableInitializers(); + } // Burns native ether on settlement chain by sending it to the whitelist contract, // there should be equiv ether on L1 which will be UNLOCKED during finalization. diff --git a/contracts/contracts/utils/EnumerableMap.sol b/contracts/contracts/utils/EnumerableMap.sol index 954798b29..dd238b81e 100644 --- a/contracts/contracts/utils/EnumerableMap.sol +++ b/contracts/contracts/utils/EnumerableMap.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BSL 1.1 -pragma solidity ^0.8.15; +pragma solidity ^0.8.20; import {EnumerableSet} from "./EnumerableSet.sol"; diff --git a/contracts/contracts/utils/EnumerableSet.sol b/contracts/contracts/utils/EnumerableSet.sol index 5afea32ee..68dde8a50 100644 --- a/contracts/contracts/utils/EnumerableSet.sol +++ b/contracts/contracts/utils/EnumerableSet.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BSL 1.1 -pragma solidity ^0.8.15; +pragma solidity ^0.8.20; /// @title Implements an enumerable set of bytes arrays. /// @notice Adapted from OpenZeppelin's EnumerableSet.sol implementation. diff --git a/contracts/scripts/DeployScripts.s.sol b/contracts/scripts/DeployScripts.s.sol index f0b364d02..5373bce49 100644 --- a/contracts/scripts/DeployScripts.s.sol +++ b/contracts/scripts/DeployScripts.s.sol @@ -1,9 +1,9 @@ // SPDX-License-Identifier: BSL 1.1 -pragma solidity ^0.8.15; +pragma solidity ^0.8.20; import "forge-std/Script.sol"; import "../contracts/BidderRegistry.sol"; import "../contracts/ProviderRegistry.sol"; -import "../contracts/PreConfirmations.sol"; +import "../contracts/PreConfCommitmentStore.sol"; import "../contracts/Oracle.sol"; import "../contracts/Whitelist.sol"; import "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol"; @@ -11,45 +11,11 @@ import "../contracts/ValidatorRegistry.sol"; import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol"; import "../contracts/BlockTracker.sol"; -// Deploy scripts should inherit this contract if they deploy using create2 deterministic addrs. -contract Create2Deployer { - address constant _CREATE2_PROXY = - 0x4e59b44847b379578588920cA78FbF26c0B4956C; - address constant _EXPECTED_DEPLOYER = - 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266; - - function _checkCreate2Deployed() internal view { - require( - isContractDeployed(_CREATE2_PROXY), - "Create2 proxy needs to be deployed. See https://github.com/primev/deterministic-deployment-proxy" - ); - } - - function _checkDeployer() internal view { - if (msg.sender != _EXPECTED_DEPLOYER) { - console.log( - "Warning: deployer is not expected address of 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266. Contracts addresses will not match documentation" - ); - } - } - - function isContractDeployed(address addr) public view returns (bool) { - uint size; - assembly { - size := extcodesize(addr) - } - return size > 0; - } -} - // Deploys core contracts -contract DeployScript is Script, Create2Deployer { +contract DeployScript is Script { function run() external { vm.startBroadcast(); - _checkCreate2Deployed(); - _checkDeployer(); - // Replace these with your contract's constructor parameters uint256 minStake = 1 ether; address feeRecipient = address( @@ -57,45 +23,35 @@ contract DeployScript is Script, Create2Deployer { ); uint16 feePercent = 2; uint64 commitmentDispatchWindow = 2000; - uint256 blocksPerWindow = 10; - // Forge deploy with salt uses create2 proxy from https://github.com/primev/deterministic-deployment-proxy - bytes32 salt = 0x8989000000000000000000000000000000000000000000000000000000000000; - BlockTracker blockTracker = new BlockTracker{salt: salt}(msg.sender); + address blockTrackerProxy = Upgrades.deployUUPSProxy( + "BlockTracker.sol", + abi.encodeCall(BlockTracker.initialize, (msg.sender)) + ); + BlockTracker blockTracker = BlockTracker(payable(blockTrackerProxy)); console.log("BlockTracker deployed to:", address(blockTracker)); - BidderRegistry bidderRegistry = new BidderRegistry{salt: salt}( - minStake, - feeRecipient, - feePercent, - msg.sender, - address(blockTracker) + address bidderRegistryProxy = Upgrades.deployUUPSProxy( + "BidderRegistry.sol", + abi.encodeCall(BidderRegistry.initialize, (minStake, feeRecipient, feePercent, msg.sender, address(blockTracker))) ); + BidderRegistry bidderRegistry = BidderRegistry(payable(bidderRegistryProxy)); console.log("BidderRegistry deployed to:", address(bidderRegistry)); - ProviderRegistry providerRegistry = new ProviderRegistry{salt: salt}( - minStake, - feeRecipient, - feePercent, - msg.sender + address providerRegistryProxy = Upgrades.deployUUPSProxy( + "ProviderRegistry.sol", + abi.encodeCall(ProviderRegistry.initialize, (minStake, feeRecipient, feePercent, msg.sender)) ); + ProviderRegistry providerRegistry = ProviderRegistry(payable(providerRegistryProxy)); console.log("ProviderRegistry deployed to:", address(providerRegistry)); - PreConfCommitmentStore preConfCommitmentStore = new PreConfCommitmentStore{ - salt: salt - }( - address(providerRegistry), - address(bidderRegistry), - feeRecipient, - msg.sender, - address(blockTracker), - commitmentDispatchWindow - ); - console.log( - "PreConfCommitmentStore deployed to:", - address(preConfCommitmentStore) + address preconfCommitmentStoreProxy = Upgrades.deployUUPSProxy( + "PreConfCommitmentStore.sol", + abi.encodeCall(PreConfCommitmentStore.initialize, (address(providerRegistry), address(bidderRegistry), feeRecipient, msg.sender, address(blockTracker), commitmentDispatchWindow)) ); + PreConfCommitmentStore preConfCommitmentStore = PreConfCommitmentStore(payable(preconfCommitmentStoreProxy)); + console.log("PreConfCommitmentStore deployed to:", address(preConfCommitmentStore)); providerRegistry.setPreconfirmationsContract( address(preConfCommitmentStore) @@ -113,11 +69,11 @@ contract DeployScript is Script, Create2Deployer { address(preConfCommitmentStore) ); - Oracle oracle = new Oracle{salt: salt}( - address(preConfCommitmentStore), - address(blockTracker), - msg.sender + address oracleProxy = Upgrades.deployUUPSProxy( + "Oracle.sol", + abi.encodeCall(Oracle.initialize, (address(preConfCommitmentStore), address(blockTracker), msg.sender)) ); + Oracle oracle = Oracle(payable(oracleProxy)); console.log("Oracle deployed to:", address(oracle)); preConfCommitmentStore.updateOracle(address(oracle)); @@ -131,36 +87,25 @@ contract DeployScript is Script, Create2Deployer { } // Deploys whitelist contract and adds HypERC20 to whitelist -contract DeployWhitelist is Script, Create2Deployer { +contract DeployWhitelist is Script { function run() external { console.log( "Warning: DeployWhitelist is deprecated and only for backwards compatibility with hyperlane" ); - address expectedWhiteListAddr = 0x57508f0B0f3426758F1f3D63ad4935a7c9383620; - if (isContractDeployed(expectedWhiteListAddr)) { - console.log( - "Whitelist already deployed to:", - expectedWhiteListAddr - ); - return; - } - vm.startBroadcast(); - _checkCreate2Deployed(); - _checkDeployer(); - address hypERC20Addr = vm.envAddress("HYP_ERC20_ADDR"); require( hypERC20Addr != address(0), "Address to whitelist not provided" ); - // Forge deploy with salt uses create2 proxy from https://github.com/primev/deterministic-deployment-proxy - bytes32 salt = 0x8989000000000000000000000000000000000000000000000000000000000000; - - Whitelist whitelist = new Whitelist{salt: salt}(msg.sender); + address whitelistProxy = Upgrades.deployUUPSProxy( + "Whitelist.sol", + abi.encodeCall(Whitelist.initialize, (msg.sender)) + ); + Whitelist whitelist = Whitelist(payable(whitelistProxy)); console.log("Whitelist deployed to:", address(whitelist)); whitelist.addToWhitelist(address(hypERC20Addr)); @@ -195,7 +140,7 @@ contract DeployValidatorRegistry is Script { address(proxy) ); - ValidatorRegistry validatorRegistry = ValidatorRegistry(proxy); + ValidatorRegistry validatorRegistry = ValidatorRegistry(payable(proxy)); console.log("ValidatorRegistry owner:", validatorRegistry.owner()); vm.stopBroadcast(); diff --git a/contracts/scripts/DeployStandardBridge.s.sol b/contracts/scripts/DeployStandardBridge.s.sol index 301949dce..03ee32b44 100644 --- a/contracts/scripts/DeployStandardBridge.s.sol +++ b/contracts/scripts/DeployStandardBridge.s.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BSL 1.1 -pragma solidity ^0.8.15; +pragma solidity ^0.8.20; import "forge-std/Script.sol"; import {Create2Deployer} from "../scripts/DeployScripts.s.sol"; import {SettlementGateway} from "../contracts/standard-bridge/SettlementGateway.sol"; @@ -7,40 +7,31 @@ import {L1Gateway} from "../contracts/standard-bridge/L1Gateway.sol"; import {Whitelist} from "../contracts/Whitelist.sol"; import {Strings} from "@openzeppelin/contracts/utils/Strings.sol"; -contract DeploySettlementGateway is Script, Create2Deployer { +contract DeploySettlementGateway is Script { function run() external { vm.startBroadcast(); - _checkCreate2Deployed(); - _checkDeployer(); - - // Forge deploy with salt uses create2 proxy from https://github.com/primev/deterministic-deployment-proxy - bytes32 salt = 0x8989000000000000000000000000000000000000000000000000000000000000; - - address expectedWhitelistAddr = 0x57508f0B0f3426758F1f3D63ad4935a7c9383620; - if (isContractDeployed(expectedWhitelistAddr)) { - console.log("Whitelist must not be deployed to execute DeploySettlementGateway script. Exiting..."); - return; - } - address relayerAddr = vm.envAddress("RELAYER_ADDR"); - SettlementGateway gateway = new SettlementGateway{salt: salt}( - expectedWhitelistAddr, - msg.sender, // Owner + + address sgProxy = Upgrades.deployUUPSProxy( + "SettlementGateway.sol", + abi.encodeCall(SettlementGateway.initialize, + (msg.sender, // Owner relayerAddr, - 1, 1); // Fees set to 1 wei for now + 1, 1)) // Fees set to 1 wei for now + ); + SettlementGateway gateway = SettlementGateway(sgProxy); console.log("Standard bridge gateway for settlement chain deployed to:", address(gateway)); - Whitelist whitelist = new Whitelist{salt: salt}(msg.sender); + address whitelistProxy = Upgrades.deployUUPSProxy( + "Whitelist.sol", + abi.encodeCall(Whitelist.initialize, (msg.sender)) + ); + Whitelist whitelist = Whitelist(whitelistProxy); console.log("Whitelist deployed to:", address(whitelist)); - if (!isContractDeployed(expectedWhitelistAddr)) { - console.log("Whitelist not deployed to expected address:", expectedWhitelistAddr); - return; - } - whitelist.addToWhitelist(address(gateway)); console.log("Settlement gateway has been whitelisted. Gateway contract address:", address(gateway)); @@ -57,23 +48,21 @@ contract DeploySettlementGateway is Script, Create2Deployer { } } -contract DeployL1Gateway is Script, Create2Deployer { +contract DeployL1Gateway is Script { function run() external { vm.startBroadcast(); - _checkCreate2Deployed(); - _checkDeployer(); - - // Forge deploy with salt uses create2 proxy from https://github.com/primev/deterministic-deployment-proxy - bytes32 salt = 0x8989000000000000000000000000000000000000000000000000000000000000; - address relayerAddr = vm.envAddress("RELAYER_ADDR"); - L1Gateway gateway = new L1Gateway{salt: salt}( - msg.sender, // Owner + address l1gProxy = Upgrades.deployUUPSProxy( + "L1Gateway.sol", + abi.encodeCall(L1Gateway.initialize, + (msg.sender, // Owner relayerAddr, - 1, 1); // Fees set to 1 wei for now + 1, 1)) // Fees set to 1 wei for now + ); + L1Gateway gateway = L1Gateway(l1gProxy); console.log("Standard bridge gateway for l1 deployed to:", address(gateway)); diff --git a/contracts/scripts/ValidatorExampleScript.s.sol b/contracts/scripts/ValidatorExampleScript.s.sol index 85bcee785..1df66a43b 100644 --- a/contracts/scripts/ValidatorExampleScript.s.sol +++ b/contracts/scripts/ValidatorExampleScript.s.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.15; +pragma solidity ^0.8.20; import "forge-std/Script.sol"; import "forge-std/console.sol"; diff --git a/contracts/slither.md b/contracts/slither.md index 13337d0e3..8296a1a17 100644 --- a/contracts/slither.md +++ b/contracts/slither.md @@ -127,22 +127,22 @@ Impact: Medium Confidence: High - [ ] ID-13 Contract locking ether found: - Contract [PreConfCommitmentStore](contracts/PreConfirmations.sol#L16-L448) has payable functions: - - [PreConfCommitmentStore.fallback()](contracts/PreConfirmations.sol#L99-L101) - - [PreConfCommitmentStore.receive()](contracts/PreConfirmations.sol#L106-L108) + Contract [PreConfCommitmentStore](contracts/PreConfCommitmentStore.sol#L16-L448) has payable functions: + - [PreConfCommitmentStore.fallback()](contracts/PreConfCommitmentStore.sol#L99-L101) + - [PreConfCommitmentStore.receive()](contracts/PreConfCommitmentStore.sol#L106-L108) But does not have a function to withdraw the ether -contracts/PreConfirmations.sol#L16-L448 +contracts/PreConfCommitmentStore.sol#L16-L448 ## events-access Impact: Low Confidence: Medium - [ ] ID-14 -[PreConfCommitmentStore.updateOracle(address)](contracts/PreConfirmations.sol#L393-L395) should emit an event for: - - [oracle = newOracle](contracts/PreConfirmations.sol#L394) +[PreConfCommitmentStore.updateOracle(address)](contracts/PreConfCommitmentStore.sol#L393-L395) should emit an event for: + - [oracle = newOracle](contracts/PreConfCommitmentStore.sol#L394) -contracts/PreConfirmations.sol#L393-L395 +contracts/PreConfCommitmentStore.sol#L393-L395 - [ ] ID-15 @@ -191,10 +191,10 @@ contracts/BidderRegistry.sol#L165 - [ ] ID-21 -[PreConfCommitmentStore.updateOracle(address).newOracle](contracts/PreConfirmations.sol#L393) lacks a zero-check on : - - [oracle = newOracle](contracts/PreConfirmations.sol#L394) +[PreConfCommitmentStore.updateOracle(address).newOracle](contracts/PreConfCommitmentStore.sol#L393) lacks a zero-check on : + - [oracle = newOracle](contracts/PreConfCommitmentStore.sol#L394) -contracts/PreConfirmations.sol#L393 +contracts/PreConfCommitmentStore.sol#L393 - [ ] ID-22 @@ -226,10 +226,10 @@ contracts/BidderRegistry.sol#L208 - [ ] ID-26 -[PreConfCommitmentStore.constructor(address,address,address)._oracle](contracts/PreConfirmations.sol#L127) lacks a zero-check on : - - [oracle = _oracle](contracts/PreConfirmations.sol#L129) +[PreConfCommitmentStore.constructor(address,address,address)._oracle](contracts/PreConfCommitmentStore.sol#L127) lacks a zero-check on : + - [oracle = _oracle](contracts/PreConfCommitmentStore.sol#L129) -contracts/PreConfirmations.sol#L127 +contracts/PreConfCommitmentStore.sol#L127 ## assembly @@ -340,9 +340,9 @@ contracts/interfaces/IProviderRegistry.sol#L2 - [ ] ID-43 -Pragma version[^0.8.20](contracts/PreConfirmations.sol#L2) necessitates a version too recent to be trusted. Consider deploying with 0.8.18. +Pragma version[^0.8.20](contracts/PreConfCommitmentStore.sol#L2) necessitates a version too recent to be trusted. Consider deploying with 0.8.18. -contracts/PreConfirmations.sol#L2 +contracts/PreConfCommitmentStore.sol#L2 - [ ] ID-44 @@ -413,90 +413,90 @@ contracts/ProviderRegistry.sol#L191-L198 Impact: Informational Confidence: High - [ ] ID-53 -Parameter [PreConfCommitmentStore.getPreConfHash(string,uint64,uint64,bytes32,string)._txnHash](contracts/PreConfirmations.sol#L196) is not in mixedCase +Parameter [PreConfCommitmentStore.getPreConfHash(string,uint64,uint64,bytes32,string)._txnHash](contracts/PreConfCommitmentStore.sol#L196) is not in mixedCase -contracts/PreConfirmations.sol#L196 +contracts/PreConfCommitmentStore.sol#L196 - [ ] ID-54 -Variable [PreConfCommitmentStore.DOMAIN_SEPARATOR_BID](contracts/PreConfirmations.sol#L39) is not in mixedCase +Variable [PreConfCommitmentStore.DOMAIN_SEPARATOR_BID](contracts/PreConfCommitmentStore.sol#L39) is not in mixedCase -contracts/PreConfirmations.sol#L39 +contracts/PreConfCommitmentStore.sol#L39 - [ ] ID-55 -Function [PreConfCommitmentStore._bytesToHexString(bytes)](contracts/PreConfirmations.sol#L437-L447) is not in mixedCase +Function [PreConfCommitmentStore._bytesToHexString(bytes)](contracts/PreConfCommitmentStore.sol#L437-L447) is not in mixedCase -contracts/PreConfirmations.sol#L437-L447 +contracts/PreConfCommitmentStore.sol#L437-L447 - [ ] ID-56 -Parameter [PreConfCommitmentStore.getPreConfHash(string,uint64,uint64,bytes32,string)._blockNumber](contracts/PreConfirmations.sol#L198) is not in mixedCase +Parameter [PreConfCommitmentStore.getPreConfHash(string,uint64,uint64,bytes32,string)._blockNumber](contracts/PreConfCommitmentStore.sol#L198) is not in mixedCase -contracts/PreConfirmations.sol#L198 +contracts/PreConfCommitmentStore.sol#L198 - [ ] ID-57 -Variable [PreConfCommitmentStore.DOMAIN_SEPARATOR_PRECONF](contracts/PreConfirmations.sol#L36) is not in mixedCase +Variable [PreConfCommitmentStore.DOMAIN_SEPARATOR_PRECONF](contracts/PreConfCommitmentStore.sol#L36) is not in mixedCase -contracts/PreConfirmations.sol#L36 +contracts/PreConfCommitmentStore.sol#L36 - [ ] ID-58 -Parameter [PreConfCommitmentStore.getPreConfHash(string,uint64,uint64,bytes32,string)._bid](contracts/PreConfirmations.sol#L197) is not in mixedCase +Parameter [PreConfCommitmentStore.getPreConfHash(string,uint64,uint64,bytes32,string)._bid](contracts/PreConfCommitmentStore.sol#L197) is not in mixedCase -contracts/PreConfirmations.sol#L197 +contracts/PreConfCommitmentStore.sol#L197 - [ ] ID-59 -Parameter [PreConfCommitmentStore.getBidHash(string,uint64,uint64)._txnHash](contracts/PreConfirmations.sol#L169) is not in mixedCase +Parameter [PreConfCommitmentStore.getBidHash(string,uint64,uint64)._txnHash](contracts/PreConfCommitmentStore.sol#L169) is not in mixedCase -contracts/PreConfirmations.sol#L169 +contracts/PreConfCommitmentStore.sol#L169 - [ ] ID-60 -Parameter [PreConfCommitmentStore._bytesToHexString(bytes)._bytes](contracts/PreConfirmations.sol#L438) is not in mixedCase +Parameter [PreConfCommitmentStore._bytesToHexString(bytes)._bytes](contracts/PreConfCommitmentStore.sol#L438) is not in mixedCase -contracts/PreConfirmations.sol#L438 +contracts/PreConfCommitmentStore.sol#L438 - [ ] ID-61 -Parameter [PreConfCommitmentStore.getBidHash(string,uint64,uint64)._blockNumber](contracts/PreConfirmations.sol#L171) is not in mixedCase +Parameter [PreConfCommitmentStore.getBidHash(string,uint64,uint64)._blockNumber](contracts/PreConfCommitmentStore.sol#L171) is not in mixedCase -contracts/PreConfirmations.sol#L171 +contracts/PreConfCommitmentStore.sol#L171 - [ ] ID-62 -Parameter [PreConfCommitmentStore.getPreConfHash(string,uint64,uint64,bytes32,string)._bidHash](contracts/PreConfirmations.sol#L199) is not in mixedCase +Parameter [PreConfCommitmentStore.getPreConfHash(string,uint64,uint64,bytes32,string)._bidHash](contracts/PreConfCommitmentStore.sol#L199) is not in mixedCase -contracts/PreConfirmations.sol#L199 +contracts/PreConfCommitmentStore.sol#L199 - [ ] ID-63 -Parameter [PreConfCommitmentStore.getBidHash(string,uint64,uint64)._bid](contracts/PreConfirmations.sol#L170) is not in mixedCase +Parameter [PreConfCommitmentStore.getBidHash(string,uint64,uint64)._bid](contracts/PreConfCommitmentStore.sol#L170) is not in mixedCase -contracts/PreConfirmations.sol#L170 +contracts/PreConfCommitmentStore.sol#L170 - [ ] ID-64 -Parameter [PreConfCommitmentStore.getPreConfHash(string,uint64,uint64,bytes32,string)._bidSignature](contracts/PreConfirmations.sol#L200) is not in mixedCase +Parameter [PreConfCommitmentStore.getPreConfHash(string,uint64,uint64,bytes32,string)._bidSignature](contracts/PreConfCommitmentStore.sol#L200) is not in mixedCase -contracts/PreConfirmations.sol#L200 +contracts/PreConfCommitmentStore.sol#L200 ## immutable-states Impact: Optimization Confidence: High - [ ] ID-65 -[PreConfCommitmentStore.DOMAIN_SEPARATOR_BID](contracts/PreConfirmations.sol#L39) should be immutable +[PreConfCommitmentStore.DOMAIN_SEPARATOR_BID](contracts/PreConfCommitmentStore.sol#L39) should be immutable -contracts/PreConfirmations.sol#L39 +contracts/PreConfCommitmentStore.sol#L39 - [ ] ID-66 -[PreConfCommitmentStore.DOMAIN_SEPARATOR_PRECONF](contracts/PreConfirmations.sol#L36) should be immutable +[PreConfCommitmentStore.DOMAIN_SEPARATOR_PRECONF](contracts/PreConfCommitmentStore.sol#L36) should be immutable -contracts/PreConfirmations.sol#L36 +contracts/PreConfCommitmentStore.sol#L36 - [ ] ID-67 diff --git a/contracts/test/BidderRegistryTest.sol b/contracts/test/BidderRegistryTest.sol index 67a737419..95ebf2eb1 100644 --- a/contracts/test/BidderRegistryTest.sol +++ b/contracts/test/BidderRegistryTest.sol @@ -5,6 +5,8 @@ import "forge-std/Test.sol"; import {BidderRegistry} from "../contracts/BidderRegistry.sol"; import {BlockTracker} from "../contracts/BlockTracker.sol"; +import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol"; + contract BidderRegistryTest is Test { uint256 testNumber; BidderRegistry internal bidderRegistry; @@ -22,8 +24,18 @@ contract BidderRegistryTest is Test { feePercent = 10; minStake = 1e18 wei; feeRecipient = vm.addr(9); - blockTracker = new BlockTracker(address(this)); - bidderRegistry = new BidderRegistry(minStake, feeRecipient, feePercent, address(this), address(blockTracker)); + + address blockTrackerProxy = Upgrades.deployUUPSProxy( + "BlockTracker.sol", + 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))) + ); + bidderRegistry = BidderRegistry(payable(bidderRegistryProxy)); bidder = vm.addr(1); vm.deal(bidder, 1000 ether); diff --git a/contracts/test/OracleTest.sol b/contracts/test/OracleTest.sol index 7c43c42b8..82de73704 100644 --- a/contracts/test/OracleTest.sol +++ b/contracts/test/OracleTest.sol @@ -3,12 +3,14 @@ pragma solidity ^0.8.20; import "forge-std/Test.sol"; import "../contracts/Oracle.sol"; -import "../contracts/PreConfirmations.sol"; -import "../contracts/interfaces/IPreConfirmations.sol"; +import "../contracts/PreConfCommitmentStore.sol"; +import "../contracts/interfaces/IPreConfCommitmentStore.sol"; import "../contracts/ProviderRegistry.sol"; import "../contracts/BidderRegistry.sol"; import "../contracts/BlockTracker.sol"; +import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol"; + contract OracleTest is Test { address internal owner; using ECDSA for bytes32; @@ -66,30 +68,57 @@ contract OracleTest is Test { minStake = 1e18 wei; feeRecipient = vm.addr(9); - providerRegistry = new ProviderRegistry( - minStake, - feeRecipient, - feePercent, - address(this) + address proxy = Upgrades.deployUUPSProxy( + "ProviderRegistry.sol", + abi.encodeCall(ProviderRegistry.initialize, (minStake, feeRecipient, feePercent, address(this))) ); + providerRegistry = ProviderRegistry(payable(proxy)); + address ownerInstance = 0x6d503Fd50142C7C469C7c6B64794B55bfa6883f3; - blockTracker = new BlockTracker(ownerInstance); - bidderRegistry = new BidderRegistry(minStake, feeRecipient, feePercent, address(this), address(blockTracker)); - preConfCommitmentStore = new PreConfCommitmentStore( - address(providerRegistry), // Provider Registry - address(bidderRegistry), // User Registry - feeRecipient, // Oracle + + address blockTrackerProxy = Upgrades.deployUUPSProxy( + "BlockTracker.sol", + abi.encodeCall(BlockTracker.initialize, (ownerInstance)) + ); + blockTracker = BlockTracker(payable(blockTrackerProxy)); + + address proxy3 = Upgrades.deployUUPSProxy( + "BidderRegistry.sol", + abi.encodeCall(BidderRegistry.initialize, + (minStake, + feeRecipient, + feePercent, + address(this), + address(blockTracker))) + ); + bidderRegistry = BidderRegistry(payable(proxy3)); + + address proxy4 = Upgrades.deployUUPSProxy( + "PreConfCommitmentStore.sol", + abi.encodeCall(PreConfCommitmentStore.initialize, + (address(providerRegistry), + address(bidderRegistry), + feeRecipient, address(this), - address(blockTracker), // Block Tracker - 500 + address(blockTracker), + 500)) ); - + preConfCommitmentStore = PreConfCommitmentStore(payable(proxy4)); + vm.deal(ownerInstance, 5 ether); vm.startPrank(ownerInstance); uint256 window = blockTracker.getCurrentWindow(); bidderRegistry.depositForSpecificWindow{value: 2 ether}(window+1); - oracle = new Oracle(address(preConfCommitmentStore), address(blockTracker), ownerInstance); + address oracleProxy = Upgrades.deployUUPSProxy( + "Oracle.sol", + abi.encodeCall(Oracle.initialize, + (address(preConfCommitmentStore), + address(blockTracker), + ownerInstance)) + ); + oracle = Oracle(payable(oracleProxy)); + vm.stopPrank(); preConfCommitmentStore.updateOracle(address(oracle)); @@ -121,7 +150,7 @@ contract OracleTest is Test { providerRegistry.registerAndStake{value: 250 ether}(); vm.stopPrank(); - bytes32 index = constructAndStoreCommitment(bid, blockNumber, txn, 10, 20, bidderPk, providerPk, provider, dispatchTimestampTesting); + bytes32 index = constructAndStoreCommitment(bid, blockNumber, txn, bidderPk, providerPk, provider, dispatchTimestampTesting); vm.startPrank(address(0x6d503Fd50142C7C469C7c6B64794B55bfa6883f3)); @@ -150,7 +179,7 @@ contract OracleTest is Test { providerRegistry.registerAndStake{value: 250 ether}(); vm.stopPrank(); - bytes32 index = constructAndStoreCommitment(bid, blockNumber, txn, 10, 20, bidderPk, providerPk, provider, dispatchTimestampTesting); + bytes32 index = constructAndStoreCommitment(bid, blockNumber, txn, bidderPk, providerPk, provider, dispatchTimestampTesting); vm.startPrank(address(0x6d503Fd50142C7C469C7c6B64794B55bfa6883f3)); @@ -184,8 +213,8 @@ contract OracleTest is Test { providerRegistry.registerAndStake{value: 250 ether}(); vm.stopPrank(); - bytes32 index1 = constructAndStoreCommitment(bid, blockNumber, txn1, 10, 20, bidderPk, providerPk, provider, dispatchTimestampTesting); - bytes32 index2 = constructAndStoreCommitment(bid, blockNumber, txn2, 10, 20, bidderPk, providerPk, provider, dispatchTimestampTesting); + bytes32 index1 = constructAndStoreCommitment(bid, blockNumber, txn1, bidderPk, providerPk, provider, dispatchTimestampTesting); + bytes32 index2 = constructAndStoreCommitment(bid, blockNumber, txn2, bidderPk, providerPk, provider, dispatchTimestampTesting); vm.startPrank(address(0x6d503Fd50142C7C469C7c6B64794B55bfa6883f3)); @@ -223,10 +252,10 @@ contract OracleTest is Test { providerRegistry.registerAndStake{value: 250 ether}(); vm.stopPrank(); - bytes32 index1 = constructAndStoreCommitment(bid, blockNumber, txn1, 10, 20, bidderPk, providerPk, provider, dispatchTimestampTesting); - bytes32 index2 = constructAndStoreCommitment(bid, blockNumber, txn2, 10, 20, bidderPk, providerPk, provider, dispatchTimestampTesting); - bytes32 index3 = constructAndStoreCommitment(bid, blockNumber, txn3, 10, 20, bidderPk, providerPk, provider, dispatchTimestampTesting); - bytes32 index4 = constructAndStoreCommitment(bid, blockNumber, txn4, 10, 20, bidderPk, providerPk, provider, dispatchTimestampTesting); + bytes32 index1 = constructAndStoreCommitment(bid, blockNumber, txn1, bidderPk, providerPk, provider, dispatchTimestampTesting); + bytes32 index2 = constructAndStoreCommitment(bid, blockNumber, txn2, bidderPk, providerPk, provider, dispatchTimestampTesting); + bytes32 index3 = constructAndStoreCommitment(bid, blockNumber, txn3, bidderPk, providerPk, provider, dispatchTimestampTesting); + bytes32 index4 = constructAndStoreCommitment(bid, blockNumber, txn4, bidderPk, providerPk, provider, dispatchTimestampTesting); vm.startPrank(address(0x6d503Fd50142C7C469C7c6B64794B55bfa6883f3)); @@ -320,13 +349,13 @@ contract OracleTest is Test { /** constructAndStoreCommitment is a helper function to construct and store a commitment + Note decayStartTimestamp and decayEndTimestamp are hardcoded to 10 and 20 respectively + to avoid "stack too deep" errors. */ function constructAndStoreCommitment( uint64 bid, uint64 blockNumber, string memory txnHash, - uint64 decayStartTimestamp, - uint64 decayEndTimestamp, uint256 bidderPk, uint256 signerPk, address provider, @@ -336,8 +365,8 @@ contract OracleTest is Test { txnHash, bid, blockNumber, - decayStartTimestamp, - decayEndTimestamp + 10, + 20 ); @@ -348,8 +377,8 @@ contract OracleTest is Test { txnHash, bid, blockNumber, - decayStartTimestamp, - decayEndTimestamp, + 10, + 20, bidHash, _bytesToHexString(bidSignature), _bytesToHexString(sharedSecretKey) @@ -373,8 +402,8 @@ contract OracleTest is Test { bid, blockNumber, txnHash, - decayStartTimestamp, - decayEndTimestamp, + 10, + 20, bidSignature, commitmentSignature, sharedSecretKey diff --git a/contracts/test/PreConfirmationConfTest.sol b/contracts/test/PreConfirmationConfTest.sol index cc0e51db9..1ee6634c2 100644 --- a/contracts/test/PreConfirmationConfTest.sol +++ b/contracts/test/PreConfirmationConfTest.sol @@ -3,12 +3,14 @@ pragma solidity ^0.8.20; import "forge-std/Test.sol"; -import {PreConfCommitmentStore} from "../contracts/PreConfirmations.sol"; +import {PreConfCommitmentStore} from "../contracts/PreConfCommitmentStore.sol"; import "../contracts/ProviderRegistry.sol"; import "../contracts/BidderRegistry.sol"; import "../contracts/BlockTracker.sol"; import "forge-std/console.sol"; +import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol"; + contract TestPreConfCommitmentStore is Test { struct TestCommitment { uint64 bid; @@ -53,29 +55,46 @@ contract TestPreConfCommitmentStore is Test { feePercent = 10; minStake = 1e18 wei; feeRecipient = vm.addr(9); - providerRegistry = new ProviderRegistry( - minStake, - feeRecipient, - feePercent, - address(this) - ); - blockTracker = new BlockTracker(address(this)); - bidderRegistry = new BidderRegistry( - minStake, - feeRecipient, - feePercent, - address(this), - address(blockTracker) - ); - preConfCommitmentStore = new PreConfCommitmentStore( - address(providerRegistry), // Provider Registry + address providerRegistryProxy = Upgrades.deployUUPSProxy( + "ProviderRegistry.sol", + 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))) + ); + blockTracker = BlockTracker(payable(blockTrackerProxy)); + + address bidderRegistryProxy = Upgrades.deployUUPSProxy( + "BidderRegistry.sol", + 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 + 500)) // Commitment Dispatch Window ); + preConfCommitmentStore = PreConfCommitmentStore(payable(preconfStoreProxy)); // Sets fake block timestamp vm.warp(16); @@ -133,7 +152,6 @@ contract TestPreConfCommitmentStore is Test { assertEq(commitment.commitmentSignature, commitmentSignature); } - function test_StoreCommitmentFailureDueToTimestampValidation() public { bytes32 commitmentDigest = keccak256( abi.encodePacked("commitment data") @@ -317,7 +335,7 @@ contract TestPreConfCommitmentStore is Test { assertEq(commitmentTxnHash, _testCommitmentAliceBob.txnHash); } - function verifyCommitmentNotUsed( + function verifyCommitmentNotUsed ( string memory txnHash, uint64 bid, uint64 blockNumber, diff --git a/contracts/test/ProviderRegistryTest.sol b/contracts/test/ProviderRegistryTest.sol index 2efd1ccc5..334972bb6 100644 --- a/contracts/test/ProviderRegistryTest.sol +++ b/contracts/test/ProviderRegistryTest.sol @@ -4,9 +4,11 @@ pragma solidity ^0.8.20; import "forge-std/Test.sol"; import {ProviderRegistry} from "../contracts/ProviderRegistry.sol"; import {BidderRegistry} from "../contracts/BidderRegistry.sol"; -import {PreConfCommitmentStore} from "../contracts/PreConfirmations.sol"; +import {PreConfCommitmentStore} from "../contracts/PreConfCommitmentStore.sol"; import {BlockTracker} from "../contracts/BlockTracker.sol"; +import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol"; + contract ProviderRegistryTest is Test { uint256 testNumber; ProviderRegistry internal providerRegistry; @@ -25,23 +27,45 @@ contract ProviderRegistryTest is Test { minStake = 1e18 wei; feeRecipient = vm.addr(9); - providerRegistry = new ProviderRegistry( - minStake, - feeRecipient, - feePercent, - address(this) + address providerRegistryProxy = Upgrades.deployUUPSProxy( + "ProviderRegistry.sol", + abi.encodeCall(ProviderRegistry.initialize, + (minStake, + feeRecipient, + feePercent, + address(this))) ); - blockTracker = new BlockTracker(address(this)); - bidderRegistry = new BidderRegistry(minStake, feeRecipient, feePercent, address(this), address(blockTracker)); + providerRegistry = ProviderRegistry(payable(providerRegistryProxy)); - preConfCommitmentStore = new PreConfCommitmentStore( - address(providerRegistry), // Provider Registry + address blockTrackerProxy = Upgrades.deployUUPSProxy( + "BlockTracker.sol", + 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))) + ); + bidderRegistry = BidderRegistry(payable(bidderRegistryProxy)); + + address preconfStoreProxy = Upgrades.deployUUPSProxy( + "PreConfCommitmentStore.sol", + abi.encodeCall(PreConfCommitmentStore.initialize, + (address(providerRegistry), // Provider Registry address(bidderRegistry), // User Registry address(blockTracker), // Block Tracker feeRecipient, // Oracle address(this), - 500 + 500)) ); + preConfCommitmentStore = PreConfCommitmentStore(payable(preconfStoreProxy)); provider = vm.addr(1); vm.deal(provider, 100 ether); diff --git a/contracts/test/ValidatorRegistryTest.sol b/contracts/test/ValidatorRegistryTest.sol index ec88ec416..56621b97b 100644 --- a/contracts/test/ValidatorRegistryTest.sol +++ b/contracts/test/ValidatorRegistryTest.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BSL 1.1 -pragma solidity ^0.8.15; +pragma solidity ^0.8.20; import "forge-std/Test.sol"; import "../contracts/ValidatorRegistry.sol"; @@ -35,7 +35,7 @@ contract ValidatorRegistryTest is Test { "ValidatorRegistry.sol", abi.encodeCall(ValidatorRegistry.initialize, (MIN_STAKE, UNSTAKE_PERIOD, owner)) ); - validatorRegistry = ValidatorRegistry(proxy); + validatorRegistry = ValidatorRegistry(payable(proxy)); } function testSecondInitialize() public { diff --git a/contracts/test/WhitelistTest.sol b/contracts/test/WhitelistTest.sol index 4d8a9269e..839789788 100644 --- a/contracts/test/WhitelistTest.sol +++ b/contracts/test/WhitelistTest.sol @@ -4,6 +4,8 @@ pragma solidity ^0.8.20; import "forge-std/Test.sol"; import "../contracts/Whitelist.sol"; +import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol"; + // Tests the Whitelist contract. // Note precompile interactions to mint/burn must be tested manually. contract WhitelistTest is Test { @@ -17,7 +19,12 @@ contract WhitelistTest is Test { admin = address(this); // Original contract deployer as admin normalBidder = address(0x100); addressInstance = address(0x200); - whitelist = new Whitelist(admin); + + address whitelistProxy = Upgrades.deployUUPSProxy( + "Whitelist.sol", + abi.encodeCall(Whitelist.initialize, (admin)) + ); + whitelist = Whitelist(payable(whitelistProxy)); } function test_IsWhitelisted() public { @@ -44,7 +51,7 @@ contract WhitelistTest is Test { function test_RevertNormalBidderAddToWhitelist() public { vm.prank(normalBidder); - vm.expectRevert("Ownable: caller is not the owner"); + vm.expectRevert(); // Only owner can add to whitelist whitelist.addToWhitelist(addressInstance); } @@ -53,7 +60,7 @@ contract WhitelistTest is Test { whitelist.addToWhitelist(addressInstance); assertTrue(whitelist.isWhitelisted(addressInstance)); vm.prank(normalBidder); - vm.expectRevert("Ownable: caller is not the owner"); + vm.expectRevert(); // Only owner can remove from whitelist whitelist.removeFromWhitelist(addressInstance); } } diff --git a/contracts/test/standard-bridge/L1GatewayTest.sol b/contracts/test/standard-bridge/L1GatewayTest.sol index c06e5a70d..b5a6e968b 100644 --- a/contracts/test/standard-bridge/L1GatewayTest.sol +++ b/contracts/test/standard-bridge/L1GatewayTest.sol @@ -1,9 +1,11 @@ // SPDX-License-Identifier: BSL 1.1 -pragma solidity ^0.8.15; +pragma solidity ^0.8.20; import "forge-std/Test.sol"; import "../../contracts/standard-bridge/L1Gateway.sol"; +import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol"; + contract L1GatewayTest is Test { L1Gateway l1Gateway; address owner; @@ -18,7 +20,15 @@ contract L1GatewayTest is Test { bridgeUser = address(0x101); finalizationFee = 0.1 ether; counterpartyFee = 0.05 ether; - l1Gateway = new L1Gateway(owner, relayer, finalizationFee, counterpartyFee); + + address l1GatewayProxy = Upgrades.deployUUPSProxy( + "L1Gateway.sol", + abi.encodeCall(L1Gateway.initialize, + (owner, + relayer, + finalizationFee, + counterpartyFee))); + l1Gateway = L1Gateway(payable(l1GatewayProxy)); } function test_ConstructorSetsVariablesCorrectly() public view { diff --git a/contracts/test/standard-bridge/SettlementGatewayTest.sol b/contracts/test/standard-bridge/SettlementGatewayTest.sol index e29bb452d..2efb8c9ed 100644 --- a/contracts/test/standard-bridge/SettlementGatewayTest.sol +++ b/contracts/test/standard-bridge/SettlementGatewayTest.sol @@ -1,11 +1,13 @@ // SPDX-License-Identifier: BSL 1.1 -pragma solidity ^0.8.15; +pragma solidity ^0.8.20; import "forge-std/Test.sol"; import "../../contracts/standard-bridge/SettlementGateway.sol"; import "../../contracts/interfaces/IWhitelist.sol"; import "../../contracts/Whitelist.sol"; +import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol"; + contract SettlementGatewayTest is Test { SettlementGateway settlementGateway; @@ -23,8 +25,24 @@ contract SettlementGatewayTest is Test { bridgeUser = address(0x101); finalizationFee = 0.05 ether; counterpartyFee = 0.1 ether; - whitelist = new Whitelist(owner); - settlementGateway = new SettlementGateway(address(whitelist), owner, relayer, finalizationFee, counterpartyFee); + + address whitelistProxy = Upgrades.deployUUPSProxy( + "Whitelist.sol", + abi.encodeCall(Whitelist.initialize, (owner)) + ); + whitelist = Whitelist(payable(whitelistProxy)); + + address settlementGatewayProxy = Upgrades.deployUUPSProxy( + "SettlementGateway.sol", + abi.encodeCall(SettlementGateway.initialize, + (address(whitelist), + owner, + relayer, + finalizationFee, + counterpartyFee)) + ); + settlementGateway = SettlementGateway(payable(settlementGatewayProxy)); + vm.prank(owner); whitelist.addToWhitelist(address(settlementGateway)); } diff --git a/contracts/test/utils/EnumerableMapTest.sol b/contracts/test/utils/EnumerableMapTest.sol index b2b6fed33..de5271a39 100644 --- a/contracts/test/utils/EnumerableMapTest.sol +++ b/contracts/test/utils/EnumerableMapTest.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BSL 1.1 -pragma solidity ^0.8.15; +pragma solidity ^0.8.20; import "forge-std/Test.sol"; import "../../contracts/utils/EnumerableMap.sol"; diff --git a/contracts/test/utils/EnumerableSetTest.sol b/contracts/test/utils/EnumerableSetTest.sol index 8e3461816..61df20ea3 100644 --- a/contracts/test/utils/EnumerableSetTest.sol +++ b/contracts/test/utils/EnumerableSetTest.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BSL 1.1 -pragma solidity ^0.8.15; +pragma solidity ^0.8.20; import "forge-std/Test.sol"; import "../../contracts/utils/EnumerableSet.sol";