diff --git a/contracts-abi/abi/BidderRegistry.abi b/contracts-abi/abi/BidderRegistry.abi index d3f05bedd..8c0702f76 100644 --- a/contracts-abi/abi/BidderRegistry.abi +++ b/contracts-abi/abi/BidderRegistry.abi @@ -173,20 +173,7 @@ }, { "type": "function", - "name": "feeRecipient", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "address", - "internalType": "address" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "feeRecipientAmount", + "name": "getAccumulatedProtocolFee", "inputs": [], "outputs": [ { @@ -221,19 +208,6 @@ ], "stateMutability": "view" }, - { - "type": "function", - "name": "getFeeRecipientAmount", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, { "type": "function", "name": "getProviderAmount", @@ -258,7 +232,7 @@ "name": "initialize", "inputs": [ { - "name": "_feeRecipient", + "name": "_protocolFeeRecipient", "type": "address", "internalType": "address" }, @@ -281,6 +255,11 @@ "name": "_blocksPerWindow", "type": "uint256", "internalType": "uint256" + }, + { + "name": "_feePayoutPeriodBlocks", + "type": "uint256", + "internalType": "uint256" } ], "outputs": [], @@ -310,6 +289,13 @@ ], "stateMutability": "view" }, + { + "type": "function", + "name": "manuallyWithdrawProtocolFee", + "inputs": [], + "outputs": [], + "stateMutability": "nonpayable" + }, { "type": "function", "name": "maxBidPerBlock", @@ -403,11 +389,26 @@ }, { "type": "function", - "name": "protocolFeeAmount", + "name": "protocolFeeTracker", "inputs": [], "outputs": [ { - "name": "", + "name": "recipient", + "type": "address", + "internalType": "address" + }, + { + "name": "accumulatedAmount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "lastPayoutBlock", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "payoutPeriodBlocks", "type": "uint256", "internalType": "uint256" } @@ -481,6 +482,19 @@ "outputs": [], "stateMutability": "nonpayable" }, + { + "type": "function", + "name": "setNewFeePayoutPeriodBlocks", + "inputs": [ + { + "name": "newFeePayoutPeriodBlocks", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, { "type": "function", "name": "setNewFeePercent", @@ -496,10 +510,10 @@ }, { "type": "function", - "name": "setNewFeeRecipient", + "name": "setNewProtocolFeeRecipient", "inputs": [ { - "name": "newFeeRecipient", + "name": "newProtocolFeeRecipient", "type": "address", "internalType": "address" } @@ -611,13 +625,6 @@ "outputs": [], "stateMutability": "nonpayable" }, - { - "type": "function", - "name": "withdrawFeeRecipientAmount", - "inputs": [], - "outputs": [], - "stateMutability": "nonpayable" - }, { "type": "function", "name": "withdrawFromWindows", @@ -631,19 +638,6 @@ "outputs": [], "stateMutability": "nonpayable" }, - { - "type": "function", - "name": "withdrawProtocolFee", - "inputs": [ - { - "name": "treasuryAddress", - "type": "address", - "internalType": "address payable" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, { "type": "function", "name": "withdrawProviderAmount", @@ -707,6 +701,38 @@ ], "anonymous": false }, + { + "type": "event", + "name": "FeePayoutPeriodBlocksUpdated", + "inputs": [ + { + "name": "newFeePayoutPeriodBlocks", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "FeeTransfer", + "inputs": [ + { + "name": "amount", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "recipient", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, { "type": "event", "name": "FundsRetrieved", @@ -826,6 +852,19 @@ ], "anonymous": false }, + { + "type": "event", + "name": "ProtocolFeeRecipientUpdated", + "inputs": [ + { + "name": "newProtocolFeeRecipient", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, { "type": "event", "name": "Upgraded", diff --git a/contracts-abi/abi/PreConfCommitmentStore.abi b/contracts-abi/abi/PreConfCommitmentStore.abi index 515d30afb..f36ba4793 100644 --- a/contracts-abi/abi/PreConfCommitmentStore.abi +++ b/contracts-abi/abi/PreConfCommitmentStore.abi @@ -717,7 +717,7 @@ "internalType": "address" }, { - "name": "_oracle", + "name": "_oracleContract", "type": "address", "internalType": "address" }, @@ -847,7 +847,7 @@ }, { "type": "function", - "name": "oracle", + "name": "oracleContract", "inputs": [], "outputs": [ { @@ -987,10 +987,10 @@ }, { "type": "function", - "name": "updateOracle", + "name": "updateOracleContract", "inputs": [ { - "name": "newOracle", + "name": "newOracleContract", "type": "address", "internalType": "address" } diff --git a/contracts-abi/abi/ProviderRegistry.abi b/contracts-abi/abi/ProviderRegistry.abi index 00f4330aa..1a4fe5d76 100644 --- a/contracts-abi/abi/ProviderRegistry.abi +++ b/contracts-abi/abi/ProviderRegistry.abi @@ -92,20 +92,7 @@ }, { "type": "function", - "name": "feeRecipient", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "address", - "internalType": "address" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "feeRecipientAmount", + "name": "getAccumulatedProtocolFee", "inputs": [], "outputs": [ { @@ -164,7 +151,7 @@ "internalType": "uint256" }, { - "name": "_feeRecipient", + "name": "_protocolFeeRecipient", "type": "address", "internalType": "address" }, @@ -182,6 +169,11 @@ "name": "_withdrawalDelay", "type": "uint256", "internalType": "uint256" + }, + { + "name": "_protocolFeePayoutPeriodBlocks", + "type": "uint256", + "internalType": "uint256" } ], "outputs": [], @@ -200,6 +192,13 @@ "outputs": [], "stateMutability": "view" }, + { + "type": "function", + "name": "manuallyWithdrawProtocolFee", + "inputs": [], + "outputs": [], + "stateMutability": "nonpayable" + }, { "type": "function", "name": "minStake", @@ -254,11 +253,26 @@ }, { "type": "function", - "name": "protocolFeeAmount", + "name": "protocolFeeTracker", "inputs": [], "outputs": [ { - "name": "", + "name": "recipient", + "type": "address", + "internalType": "address" + }, + { + "name": "accumulatedAmount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "lastPayoutBlock", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "payoutPeriodBlocks", "type": "uint256", "internalType": "uint256" } @@ -336,6 +350,19 @@ "outputs": [], "stateMutability": "nonpayable" }, + { + "type": "function", + "name": "setFeePayoutPeriodBlocks", + "inputs": [ + { + "name": "_feePayoutPeriodBlocks", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, { "type": "function", "name": "setNewFeePercent", @@ -351,7 +378,7 @@ }, { "type": "function", - "name": "setNewFeeRecipient", + "name": "setNewProtocolFeeRecipient", "inputs": [ { "name": "newFeeRecipient", @@ -468,26 +495,6 @@ "outputs": [], "stateMutability": "nonpayable" }, - { - "type": "function", - "name": "withdrawFeeRecipientAmount", - "inputs": [], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "withdrawProtocolFee", - "inputs": [ - { - "name": "treasuryAddress", - "type": "address", - "internalType": "address payable" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, { "type": "function", "name": "withdrawalDelay", @@ -520,6 +527,38 @@ ], "stateMutability": "view" }, + { + "type": "event", + "name": "FeePayoutPeriodBlocksUpdated", + "inputs": [ + { + "name": "newFeePayoutPeriodBlocks", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "FeeTransfer", + "inputs": [ + { + "name": "amount", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "recipient", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, { "type": "event", "name": "FundsDeposited", @@ -609,6 +648,19 @@ ], "anonymous": false }, + { + "type": "event", + "name": "ProtocolFeeRecipientUpdated", + "inputs": [ + { + "name": "newProtocolFeeRecipient", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, { "type": "event", "name": "ProviderRegistered", diff --git a/contracts-abi/clients/BidderRegistry/BidderRegistry.go b/contracts-abi/clients/BidderRegistry/BidderRegistry.go index 5ec2d60a8..f0db31c69 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\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"fallback\",\"stateMutability\":\"payable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"PERCENT\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"PRECISION\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"UPGRADE_INTERFACE_VERSION\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"acceptOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"bidPayment\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"bidAmt\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"state\",\"type\":\"uint8\",\"internalType\":\"enumIBidderRegistry.State\"}],\"stateMutability\":\"view\"},{\"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\":\"blocksPerWindow\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"depositForWindow\",\"inputs\":[{\"name\":\"window\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"depositForWindows\",\"inputs\":[{\"name\":\"windows\",\"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\":\"_feeRecipient\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_feePercent\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_blockTracker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_blocksPerWindow\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"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\":\"maxBidPerBlock\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"openBid\",\"inputs\":[{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"bid\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"pendingOwner\",\"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\":\"proxiableUUID\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"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\":\"upgradeToAndCall\",\"inputs\":[{\"name\":\"newImplementation\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"usedFunds\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"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\":\"withdrawFromWindows\",\"inputs\":[{\"name\":\"windows\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawProtocolFee\",\"inputs\":[{\"name\":\"treasuryAddress\",\"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\":true,\"internalType\":\"uint256\"},{\"name\":\"windowNumber\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"BidderWithdrawal\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"window\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":true,\"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\":true,\"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\":\"OwnershipTransferStarted\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"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\":\"Upgraded\",\"inputs\":[{\"name\":\"implementation\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"AddressEmptyCode\",\"inputs\":[{\"name\":\"target\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"ERC1967InvalidImplementation\",\"inputs\":[{\"name\":\"implementation\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"ERC1967NonPayable\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"FailedInnerCall\",\"inputs\":[]},{\"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\":[]},{\"type\":\"error\",\"name\":\"UUPSUnauthorizedCallContext\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"UUPSUnsupportedProxiableUUID\",\"inputs\":[{\"name\":\"slot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]}]", + ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"fallback\",\"stateMutability\":\"payable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"PERCENT\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"PRECISION\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"UPGRADE_INTERFACE_VERSION\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"acceptOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"bidPayment\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"bidAmt\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"state\",\"type\":\"uint8\",\"internalType\":\"enumIBidderRegistry.State\"}],\"stateMutability\":\"view\"},{\"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\":\"blocksPerWindow\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"depositForWindow\",\"inputs\":[{\"name\":\"window\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"depositForWindows\",\"inputs\":[{\"name\":\"windows\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"feePercent\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getAccumulatedProtocolFee\",\"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\":\"getProviderAmount\",\"inputs\":[{\"name\":\"provider\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_protocolFeeRecipient\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_feePercent\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_blockTracker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_blocksPerWindow\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_feePayoutPeriodBlocks\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"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\":\"manuallyWithdrawProtocolFee\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"maxBidPerBlock\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"openBid\",\"inputs\":[{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"bid\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"pendingOwner\",\"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\":\"protocolFeeTracker\",\"inputs\":[],\"outputs\":[{\"name\":\"recipient\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"accumulatedAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"lastPayoutBlock\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"payoutPeriodBlocks\",\"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\":\"proxiableUUID\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"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\":\"setNewFeePayoutPeriodBlocks\",\"inputs\":[{\"name\":\"newFeePayoutPeriodBlocks\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setNewFeePercent\",\"inputs\":[{\"name\":\"newFeePercent\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setNewProtocolFeeRecipient\",\"inputs\":[{\"name\":\"newProtocolFeeRecipient\",\"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\":\"upgradeToAndCall\",\"inputs\":[{\"name\":\"newImplementation\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"usedFunds\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"withdrawBidderAmountFromWindow\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"addresspayable\"},{\"name\":\"window\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawFromWindows\",\"inputs\":[{\"name\":\"windows\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"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\":true,\"internalType\":\"uint256\"},{\"name\":\"windowNumber\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"BidderWithdrawal\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"window\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"FeePayoutPeriodBlocksUpdated\",\"inputs\":[{\"name\":\"newFeePayoutPeriodBlocks\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"FeeTransfer\",\"inputs\":[{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"recipient\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"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\":true,\"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\":\"OwnershipTransferStarted\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"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\":\"ProtocolFeeRecipientUpdated\",\"inputs\":[{\"name\":\"newProtocolFeeRecipient\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Upgraded\",\"inputs\":[{\"name\":\"implementation\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"AddressEmptyCode\",\"inputs\":[{\"name\":\"target\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"ERC1967InvalidImplementation\",\"inputs\":[{\"name\":\"implementation\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"ERC1967NonPayable\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"FailedInnerCall\",\"inputs\":[]},{\"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\":[]},{\"type\":\"error\",\"name\":\"UUPSUnauthorizedCallContext\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"UUPSUnsupportedProxiableUUID\",\"inputs\":[{\"name\":\"slot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]}]", } // BidderregistryABI is the input ABI used to generate the binding from. @@ -447,43 +447,12 @@ func (_Bidderregistry *BidderregistryCallerSession) FeePercent() (uint16, error) return _Bidderregistry.Contract.FeePercent(&_Bidderregistry.CallOpts) } -// FeeRecipient is a free data retrieval call binding the contract method 0x46904840. +// GetAccumulatedProtocolFee is a free data retrieval call binding the contract method 0x2dde2218. // -// Solidity: function feeRecipient() view returns(address) -func (_Bidderregistry *BidderregistryCaller) FeeRecipient(opts *bind.CallOpts) (common.Address, error) { +// Solidity: function getAccumulatedProtocolFee() view returns(uint256) +func (_Bidderregistry *BidderregistryCaller) GetAccumulatedProtocolFee(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} - err := _Bidderregistry.contract.Call(opts, &out, "feeRecipient") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// FeeRecipient is a free data retrieval call binding the contract method 0x46904840. -// -// Solidity: function feeRecipient() view returns(address) -func (_Bidderregistry *BidderregistrySession) FeeRecipient() (common.Address, error) { - return _Bidderregistry.Contract.FeeRecipient(&_Bidderregistry.CallOpts) -} - -// FeeRecipient is a free data retrieval call binding the contract method 0x46904840. -// -// Solidity: function feeRecipient() view returns(address) -func (_Bidderregistry *BidderregistryCallerSession) FeeRecipient() (common.Address, error) { - return _Bidderregistry.Contract.FeeRecipient(&_Bidderregistry.CallOpts) -} - -// FeeRecipientAmount is a free data retrieval call binding the contract method 0xe0ae4ebd. -// -// Solidity: function feeRecipientAmount() view returns(uint256) -func (_Bidderregistry *BidderregistryCaller) FeeRecipientAmount(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _Bidderregistry.contract.Call(opts, &out, "feeRecipientAmount") + err := _Bidderregistry.contract.Call(opts, &out, "getAccumulatedProtocolFee") if err != nil { return *new(*big.Int), err @@ -495,18 +464,18 @@ func (_Bidderregistry *BidderregistryCaller) FeeRecipientAmount(opts *bind.CallO } -// FeeRecipientAmount is a free data retrieval call binding the contract method 0xe0ae4ebd. +// GetAccumulatedProtocolFee is a free data retrieval call binding the contract method 0x2dde2218. // -// Solidity: function feeRecipientAmount() view returns(uint256) -func (_Bidderregistry *BidderregistrySession) FeeRecipientAmount() (*big.Int, error) { - return _Bidderregistry.Contract.FeeRecipientAmount(&_Bidderregistry.CallOpts) +// Solidity: function getAccumulatedProtocolFee() view returns(uint256) +func (_Bidderregistry *BidderregistrySession) GetAccumulatedProtocolFee() (*big.Int, error) { + return _Bidderregistry.Contract.GetAccumulatedProtocolFee(&_Bidderregistry.CallOpts) } -// FeeRecipientAmount is a free data retrieval call binding the contract method 0xe0ae4ebd. +// GetAccumulatedProtocolFee is a free data retrieval call binding the contract method 0x2dde2218. // -// Solidity: function feeRecipientAmount() view returns(uint256) -func (_Bidderregistry *BidderregistryCallerSession) FeeRecipientAmount() (*big.Int, error) { - return _Bidderregistry.Contract.FeeRecipientAmount(&_Bidderregistry.CallOpts) +// Solidity: function getAccumulatedProtocolFee() view returns(uint256) +func (_Bidderregistry *BidderregistryCallerSession) GetAccumulatedProtocolFee() (*big.Int, error) { + return _Bidderregistry.Contract.GetAccumulatedProtocolFee(&_Bidderregistry.CallOpts) } // GetDeposit is a free data retrieval call binding the contract method 0x2726b506. @@ -540,37 +509,6 @@ func (_Bidderregistry *BidderregistryCallerSession) GetDeposit(bidder common.Add return _Bidderregistry.Contract.GetDeposit(&_Bidderregistry.CallOpts, bidder, window) } -// GetFeeRecipientAmount is a free data retrieval call binding the contract method 0xc286f373. -// -// Solidity: function getFeeRecipientAmount() view returns(uint256) -func (_Bidderregistry *BidderregistryCaller) GetFeeRecipientAmount(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _Bidderregistry.contract.Call(opts, &out, "getFeeRecipientAmount") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// GetFeeRecipientAmount is a free data retrieval call binding the contract method 0xc286f373. -// -// Solidity: function getFeeRecipientAmount() view returns(uint256) -func (_Bidderregistry *BidderregistrySession) GetFeeRecipientAmount() (*big.Int, error) { - return _Bidderregistry.Contract.GetFeeRecipientAmount(&_Bidderregistry.CallOpts) -} - -// GetFeeRecipientAmount is a free data retrieval call binding the contract method 0xc286f373. -// -// Solidity: function getFeeRecipientAmount() view returns(uint256) -func (_Bidderregistry *BidderregistryCallerSession) GetFeeRecipientAmount() (*big.Int, error) { - return _Bidderregistry.Contract.GetFeeRecipientAmount(&_Bidderregistry.CallOpts) -} - // GetProviderAmount is a free data retrieval call binding the contract method 0x0ebe2555. // // Solidity: function getProviderAmount(address provider) view returns(uint256) @@ -757,35 +695,59 @@ func (_Bidderregistry *BidderregistryCallerSession) PreConfirmationsContract() ( return _Bidderregistry.Contract.PreConfirmationsContract(&_Bidderregistry.CallOpts) } -// ProtocolFeeAmount is a free data retrieval call binding the contract method 0x8ec9c93b. +// ProtocolFeeTracker is a free data retrieval call binding the contract method 0x291af92c. // -// Solidity: function protocolFeeAmount() view returns(uint256) -func (_Bidderregistry *BidderregistryCaller) ProtocolFeeAmount(opts *bind.CallOpts) (*big.Int, error) { +// Solidity: function protocolFeeTracker() view returns(address recipient, uint256 accumulatedAmount, uint256 lastPayoutBlock, uint256 payoutPeriodBlocks) +func (_Bidderregistry *BidderregistryCaller) ProtocolFeeTracker(opts *bind.CallOpts) (struct { + Recipient common.Address + AccumulatedAmount *big.Int + LastPayoutBlock *big.Int + PayoutPeriodBlocks *big.Int +}, error) { var out []interface{} - err := _Bidderregistry.contract.Call(opts, &out, "protocolFeeAmount") + err := _Bidderregistry.contract.Call(opts, &out, "protocolFeeTracker") + outstruct := new(struct { + Recipient common.Address + AccumulatedAmount *big.Int + LastPayoutBlock *big.Int + PayoutPeriodBlocks *big.Int + }) if err != nil { - return *new(*big.Int), err + return *outstruct, err } - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + outstruct.Recipient = *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + outstruct.AccumulatedAmount = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + outstruct.LastPayoutBlock = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) + outstruct.PayoutPeriodBlocks = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) - return out0, err + return *outstruct, err } -// ProtocolFeeAmount is a free data retrieval call binding the contract method 0x8ec9c93b. +// ProtocolFeeTracker is a free data retrieval call binding the contract method 0x291af92c. // -// Solidity: function protocolFeeAmount() view returns(uint256) -func (_Bidderregistry *BidderregistrySession) ProtocolFeeAmount() (*big.Int, error) { - return _Bidderregistry.Contract.ProtocolFeeAmount(&_Bidderregistry.CallOpts) +// Solidity: function protocolFeeTracker() view returns(address recipient, uint256 accumulatedAmount, uint256 lastPayoutBlock, uint256 payoutPeriodBlocks) +func (_Bidderregistry *BidderregistrySession) ProtocolFeeTracker() (struct { + Recipient common.Address + AccumulatedAmount *big.Int + LastPayoutBlock *big.Int + PayoutPeriodBlocks *big.Int +}, error) { + return _Bidderregistry.Contract.ProtocolFeeTracker(&_Bidderregistry.CallOpts) } -// ProtocolFeeAmount is a free data retrieval call binding the contract method 0x8ec9c93b. +// ProtocolFeeTracker is a free data retrieval call binding the contract method 0x291af92c. // -// Solidity: function protocolFeeAmount() view returns(uint256) -func (_Bidderregistry *BidderregistryCallerSession) ProtocolFeeAmount() (*big.Int, error) { - return _Bidderregistry.Contract.ProtocolFeeAmount(&_Bidderregistry.CallOpts) +// Solidity: function protocolFeeTracker() view returns(address recipient, uint256 accumulatedAmount, uint256 lastPayoutBlock, uint256 payoutPeriodBlocks) +func (_Bidderregistry *BidderregistryCallerSession) ProtocolFeeTracker() (struct { + Recipient common.Address + AccumulatedAmount *big.Int + LastPayoutBlock *big.Int + PayoutPeriodBlocks *big.Int +}, error) { + return _Bidderregistry.Contract.ProtocolFeeTracker(&_Bidderregistry.CallOpts) } // ProviderAmount is a free data retrieval call binding the contract method 0x180d02cb. @@ -944,25 +906,46 @@ func (_Bidderregistry *BidderregistryTransactorSession) DepositForWindows(window return _Bidderregistry.Contract.DepositForWindows(&_Bidderregistry.TransactOpts, windows) } -// Initialize is a paid mutator transaction binding the contract method 0x987cb9ae. +// Initialize is a paid mutator transaction binding the contract method 0x83efe8aa. +// +// Solidity: function initialize(address _protocolFeeRecipient, uint16 _feePercent, address _owner, address _blockTracker, uint256 _blocksPerWindow, uint256 _feePayoutPeriodBlocks) returns() +func (_Bidderregistry *BidderregistryTransactor) Initialize(opts *bind.TransactOpts, _protocolFeeRecipient common.Address, _feePercent uint16, _owner common.Address, _blockTracker common.Address, _blocksPerWindow *big.Int, _feePayoutPeriodBlocks *big.Int) (*types.Transaction, error) { + return _Bidderregistry.contract.Transact(opts, "initialize", _protocolFeeRecipient, _feePercent, _owner, _blockTracker, _blocksPerWindow, _feePayoutPeriodBlocks) +} + +// Initialize is a paid mutator transaction binding the contract method 0x83efe8aa. +// +// Solidity: function initialize(address _protocolFeeRecipient, uint16 _feePercent, address _owner, address _blockTracker, uint256 _blocksPerWindow, uint256 _feePayoutPeriodBlocks) returns() +func (_Bidderregistry *BidderregistrySession) Initialize(_protocolFeeRecipient common.Address, _feePercent uint16, _owner common.Address, _blockTracker common.Address, _blocksPerWindow *big.Int, _feePayoutPeriodBlocks *big.Int) (*types.Transaction, error) { + return _Bidderregistry.Contract.Initialize(&_Bidderregistry.TransactOpts, _protocolFeeRecipient, _feePercent, _owner, _blockTracker, _blocksPerWindow, _feePayoutPeriodBlocks) +} + +// Initialize is a paid mutator transaction binding the contract method 0x83efe8aa. // -// Solidity: function initialize(address _feeRecipient, uint16 _feePercent, address _owner, address _blockTracker, uint256 _blocksPerWindow) returns() -func (_Bidderregistry *BidderregistryTransactor) Initialize(opts *bind.TransactOpts, _feeRecipient common.Address, _feePercent uint16, _owner common.Address, _blockTracker common.Address, _blocksPerWindow *big.Int) (*types.Transaction, error) { - return _Bidderregistry.contract.Transact(opts, "initialize", _feeRecipient, _feePercent, _owner, _blockTracker, _blocksPerWindow) +// Solidity: function initialize(address _protocolFeeRecipient, uint16 _feePercent, address _owner, address _blockTracker, uint256 _blocksPerWindow, uint256 _feePayoutPeriodBlocks) returns() +func (_Bidderregistry *BidderregistryTransactorSession) Initialize(_protocolFeeRecipient common.Address, _feePercent uint16, _owner common.Address, _blockTracker common.Address, _blocksPerWindow *big.Int, _feePayoutPeriodBlocks *big.Int) (*types.Transaction, error) { + return _Bidderregistry.Contract.Initialize(&_Bidderregistry.TransactOpts, _protocolFeeRecipient, _feePercent, _owner, _blockTracker, _blocksPerWindow, _feePayoutPeriodBlocks) } -// Initialize is a paid mutator transaction binding the contract method 0x987cb9ae. +// ManuallyWithdrawProtocolFee is a paid mutator transaction binding the contract method 0xdbf63530. // -// Solidity: function initialize(address _feeRecipient, uint16 _feePercent, address _owner, address _blockTracker, uint256 _blocksPerWindow) returns() -func (_Bidderregistry *BidderregistrySession) Initialize(_feeRecipient common.Address, _feePercent uint16, _owner common.Address, _blockTracker common.Address, _blocksPerWindow *big.Int) (*types.Transaction, error) { - return _Bidderregistry.Contract.Initialize(&_Bidderregistry.TransactOpts, _feeRecipient, _feePercent, _owner, _blockTracker, _blocksPerWindow) +// Solidity: function manuallyWithdrawProtocolFee() returns() +func (_Bidderregistry *BidderregistryTransactor) ManuallyWithdrawProtocolFee(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Bidderregistry.contract.Transact(opts, "manuallyWithdrawProtocolFee") } -// Initialize is a paid mutator transaction binding the contract method 0x987cb9ae. +// ManuallyWithdrawProtocolFee is a paid mutator transaction binding the contract method 0xdbf63530. // -// Solidity: function initialize(address _feeRecipient, uint16 _feePercent, address _owner, address _blockTracker, uint256 _blocksPerWindow) returns() -func (_Bidderregistry *BidderregistryTransactorSession) Initialize(_feeRecipient common.Address, _feePercent uint16, _owner common.Address, _blockTracker common.Address, _blocksPerWindow *big.Int) (*types.Transaction, error) { - return _Bidderregistry.Contract.Initialize(&_Bidderregistry.TransactOpts, _feeRecipient, _feePercent, _owner, _blockTracker, _blocksPerWindow) +// Solidity: function manuallyWithdrawProtocolFee() returns() +func (_Bidderregistry *BidderregistrySession) ManuallyWithdrawProtocolFee() (*types.Transaction, error) { + return _Bidderregistry.Contract.ManuallyWithdrawProtocolFee(&_Bidderregistry.TransactOpts) +} + +// ManuallyWithdrawProtocolFee is a paid mutator transaction binding the contract method 0xdbf63530. +// +// Solidity: function manuallyWithdrawProtocolFee() returns() +func (_Bidderregistry *BidderregistryTransactorSession) ManuallyWithdrawProtocolFee() (*types.Transaction, error) { + return _Bidderregistry.Contract.ManuallyWithdrawProtocolFee(&_Bidderregistry.TransactOpts) } // OpenBid is a paid mutator transaction binding the contract method 0x2a241d75. @@ -1028,6 +1011,27 @@ func (_Bidderregistry *BidderregistryTransactorSession) RetrieveFunds(windowToSe return _Bidderregistry.Contract.RetrieveFunds(&_Bidderregistry.TransactOpts, windowToSettle, commitmentDigest, provider, residualBidPercentAfterDecay) } +// SetNewFeePayoutPeriodBlocks is a paid mutator transaction binding the contract method 0xe29136c0. +// +// Solidity: function setNewFeePayoutPeriodBlocks(uint256 newFeePayoutPeriodBlocks) returns() +func (_Bidderregistry *BidderregistryTransactor) SetNewFeePayoutPeriodBlocks(opts *bind.TransactOpts, newFeePayoutPeriodBlocks *big.Int) (*types.Transaction, error) { + return _Bidderregistry.contract.Transact(opts, "setNewFeePayoutPeriodBlocks", newFeePayoutPeriodBlocks) +} + +// SetNewFeePayoutPeriodBlocks is a paid mutator transaction binding the contract method 0xe29136c0. +// +// Solidity: function setNewFeePayoutPeriodBlocks(uint256 newFeePayoutPeriodBlocks) returns() +func (_Bidderregistry *BidderregistrySession) SetNewFeePayoutPeriodBlocks(newFeePayoutPeriodBlocks *big.Int) (*types.Transaction, error) { + return _Bidderregistry.Contract.SetNewFeePayoutPeriodBlocks(&_Bidderregistry.TransactOpts, newFeePayoutPeriodBlocks) +} + +// SetNewFeePayoutPeriodBlocks is a paid mutator transaction binding the contract method 0xe29136c0. +// +// Solidity: function setNewFeePayoutPeriodBlocks(uint256 newFeePayoutPeriodBlocks) returns() +func (_Bidderregistry *BidderregistryTransactorSession) SetNewFeePayoutPeriodBlocks(newFeePayoutPeriodBlocks *big.Int) (*types.Transaction, error) { + return _Bidderregistry.Contract.SetNewFeePayoutPeriodBlocks(&_Bidderregistry.TransactOpts, newFeePayoutPeriodBlocks) +} + // SetNewFeePercent is a paid mutator transaction binding the contract method 0xfb22febf. // // Solidity: function setNewFeePercent(uint16 newFeePercent) returns() @@ -1049,25 +1053,25 @@ func (_Bidderregistry *BidderregistryTransactorSession) SetNewFeePercent(newFeeP return _Bidderregistry.Contract.SetNewFeePercent(&_Bidderregistry.TransactOpts, newFeePercent) } -// SetNewFeeRecipient is a paid mutator transaction binding the contract method 0xa26652ea. +// SetNewProtocolFeeRecipient is a paid mutator transaction binding the contract method 0x184ac28e. // -// Solidity: function setNewFeeRecipient(address newFeeRecipient) returns() -func (_Bidderregistry *BidderregistryTransactor) SetNewFeeRecipient(opts *bind.TransactOpts, newFeeRecipient common.Address) (*types.Transaction, error) { - return _Bidderregistry.contract.Transact(opts, "setNewFeeRecipient", newFeeRecipient) +// Solidity: function setNewProtocolFeeRecipient(address newProtocolFeeRecipient) returns() +func (_Bidderregistry *BidderregistryTransactor) SetNewProtocolFeeRecipient(opts *bind.TransactOpts, newProtocolFeeRecipient common.Address) (*types.Transaction, error) { + return _Bidderregistry.contract.Transact(opts, "setNewProtocolFeeRecipient", newProtocolFeeRecipient) } -// SetNewFeeRecipient is a paid mutator transaction binding the contract method 0xa26652ea. +// SetNewProtocolFeeRecipient is a paid mutator transaction binding the contract method 0x184ac28e. // -// Solidity: function setNewFeeRecipient(address newFeeRecipient) returns() -func (_Bidderregistry *BidderregistrySession) SetNewFeeRecipient(newFeeRecipient common.Address) (*types.Transaction, error) { - return _Bidderregistry.Contract.SetNewFeeRecipient(&_Bidderregistry.TransactOpts, newFeeRecipient) +// Solidity: function setNewProtocolFeeRecipient(address newProtocolFeeRecipient) returns() +func (_Bidderregistry *BidderregistrySession) SetNewProtocolFeeRecipient(newProtocolFeeRecipient common.Address) (*types.Transaction, error) { + return _Bidderregistry.Contract.SetNewProtocolFeeRecipient(&_Bidderregistry.TransactOpts, newProtocolFeeRecipient) } -// SetNewFeeRecipient is a paid mutator transaction binding the contract method 0xa26652ea. +// SetNewProtocolFeeRecipient is a paid mutator transaction binding the contract method 0x184ac28e. // -// Solidity: function setNewFeeRecipient(address newFeeRecipient) returns() -func (_Bidderregistry *BidderregistryTransactorSession) SetNewFeeRecipient(newFeeRecipient common.Address) (*types.Transaction, error) { - return _Bidderregistry.Contract.SetNewFeeRecipient(&_Bidderregistry.TransactOpts, newFeeRecipient) +// Solidity: function setNewProtocolFeeRecipient(address newProtocolFeeRecipient) returns() +func (_Bidderregistry *BidderregistryTransactorSession) SetNewProtocolFeeRecipient(newProtocolFeeRecipient common.Address) (*types.Transaction, error) { + return _Bidderregistry.Contract.SetNewProtocolFeeRecipient(&_Bidderregistry.TransactOpts, newProtocolFeeRecipient) } // SetPreconfirmationsContract is a paid mutator transaction binding the contract method 0xf6c7e476. @@ -1175,27 +1179,6 @@ func (_Bidderregistry *BidderregistryTransactorSession) WithdrawBidderAmountFrom return _Bidderregistry.Contract.WithdrawBidderAmountFromWindow(&_Bidderregistry.TransactOpts, bidder, window) } -// WithdrawFeeRecipientAmount is a paid mutator transaction binding the contract method 0x7e5713d8. -// -// Solidity: function withdrawFeeRecipientAmount() returns() -func (_Bidderregistry *BidderregistryTransactor) WithdrawFeeRecipientAmount(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Bidderregistry.contract.Transact(opts, "withdrawFeeRecipientAmount") -} - -// WithdrawFeeRecipientAmount is a paid mutator transaction binding the contract method 0x7e5713d8. -// -// Solidity: function withdrawFeeRecipientAmount() returns() -func (_Bidderregistry *BidderregistrySession) WithdrawFeeRecipientAmount() (*types.Transaction, error) { - return _Bidderregistry.Contract.WithdrawFeeRecipientAmount(&_Bidderregistry.TransactOpts) -} - -// WithdrawFeeRecipientAmount is a paid mutator transaction binding the contract method 0x7e5713d8. -// -// Solidity: function withdrawFeeRecipientAmount() returns() -func (_Bidderregistry *BidderregistryTransactorSession) WithdrawFeeRecipientAmount() (*types.Transaction, error) { - return _Bidderregistry.Contract.WithdrawFeeRecipientAmount(&_Bidderregistry.TransactOpts) -} - // WithdrawFromWindows is a paid mutator transaction binding the contract method 0x6745206a. // // Solidity: function withdrawFromWindows(uint256[] windows) returns() @@ -1217,27 +1200,6 @@ func (_Bidderregistry *BidderregistryTransactorSession) WithdrawFromWindows(wind return _Bidderregistry.Contract.WithdrawFromWindows(&_Bidderregistry.TransactOpts, windows) } -// WithdrawProtocolFee is a paid mutator transaction binding the contract method 0x668fb6dc. -// -// Solidity: function withdrawProtocolFee(address treasuryAddress) returns() -func (_Bidderregistry *BidderregistryTransactor) WithdrawProtocolFee(opts *bind.TransactOpts, treasuryAddress common.Address) (*types.Transaction, error) { - return _Bidderregistry.contract.Transact(opts, "withdrawProtocolFee", treasuryAddress) -} - -// WithdrawProtocolFee is a paid mutator transaction binding the contract method 0x668fb6dc. -// -// Solidity: function withdrawProtocolFee(address treasuryAddress) returns() -func (_Bidderregistry *BidderregistrySession) WithdrawProtocolFee(treasuryAddress common.Address) (*types.Transaction, error) { - return _Bidderregistry.Contract.WithdrawProtocolFee(&_Bidderregistry.TransactOpts, treasuryAddress) -} - -// WithdrawProtocolFee is a paid mutator transaction binding the contract method 0x668fb6dc. -// -// Solidity: function withdrawProtocolFee(address treasuryAddress) returns() -func (_Bidderregistry *BidderregistryTransactorSession) WithdrawProtocolFee(treasuryAddress common.Address) (*types.Transaction, error) { - return _Bidderregistry.Contract.WithdrawProtocolFee(&_Bidderregistry.TransactOpts, treasuryAddress) -} - // WithdrawProviderAmount is a paid mutator transaction binding the contract method 0x9a2dd5ba. // // Solidity: function withdrawProviderAmount(address provider) returns() @@ -1625,6 +1587,295 @@ func (_Bidderregistry *BidderregistryFilterer) ParseBidderWithdrawal(log types.L return event, nil } +// BidderregistryFeePayoutPeriodBlocksUpdatedIterator is returned from FilterFeePayoutPeriodBlocksUpdated and is used to iterate over the raw logs and unpacked data for FeePayoutPeriodBlocksUpdated events raised by the Bidderregistry contract. +type BidderregistryFeePayoutPeriodBlocksUpdatedIterator struct { + Event *BidderregistryFeePayoutPeriodBlocksUpdated // 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 *BidderregistryFeePayoutPeriodBlocksUpdatedIterator) 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(BidderregistryFeePayoutPeriodBlocksUpdated) + 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(BidderregistryFeePayoutPeriodBlocksUpdated) + 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 *BidderregistryFeePayoutPeriodBlocksUpdatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *BidderregistryFeePayoutPeriodBlocksUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// BidderregistryFeePayoutPeriodBlocksUpdated represents a FeePayoutPeriodBlocksUpdated event raised by the Bidderregistry contract. +type BidderregistryFeePayoutPeriodBlocksUpdated struct { + NewFeePayoutPeriodBlocks *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterFeePayoutPeriodBlocksUpdated is a free log retrieval operation binding the contract event 0x1b8b3f7fd7594ce5b7155b4c56b19bd6a1eac8c1ec5d941635acf104c8db3571. +// +// Solidity: event FeePayoutPeriodBlocksUpdated(uint256 indexed newFeePayoutPeriodBlocks) +func (_Bidderregistry *BidderregistryFilterer) FilterFeePayoutPeriodBlocksUpdated(opts *bind.FilterOpts, newFeePayoutPeriodBlocks []*big.Int) (*BidderregistryFeePayoutPeriodBlocksUpdatedIterator, error) { + + var newFeePayoutPeriodBlocksRule []interface{} + for _, newFeePayoutPeriodBlocksItem := range newFeePayoutPeriodBlocks { + newFeePayoutPeriodBlocksRule = append(newFeePayoutPeriodBlocksRule, newFeePayoutPeriodBlocksItem) + } + + logs, sub, err := _Bidderregistry.contract.FilterLogs(opts, "FeePayoutPeriodBlocksUpdated", newFeePayoutPeriodBlocksRule) + if err != nil { + return nil, err + } + return &BidderregistryFeePayoutPeriodBlocksUpdatedIterator{contract: _Bidderregistry.contract, event: "FeePayoutPeriodBlocksUpdated", logs: logs, sub: sub}, nil +} + +// WatchFeePayoutPeriodBlocksUpdated is a free log subscription operation binding the contract event 0x1b8b3f7fd7594ce5b7155b4c56b19bd6a1eac8c1ec5d941635acf104c8db3571. +// +// Solidity: event FeePayoutPeriodBlocksUpdated(uint256 indexed newFeePayoutPeriodBlocks) +func (_Bidderregistry *BidderregistryFilterer) WatchFeePayoutPeriodBlocksUpdated(opts *bind.WatchOpts, sink chan<- *BidderregistryFeePayoutPeriodBlocksUpdated, newFeePayoutPeriodBlocks []*big.Int) (event.Subscription, error) { + + var newFeePayoutPeriodBlocksRule []interface{} + for _, newFeePayoutPeriodBlocksItem := range newFeePayoutPeriodBlocks { + newFeePayoutPeriodBlocksRule = append(newFeePayoutPeriodBlocksRule, newFeePayoutPeriodBlocksItem) + } + + logs, sub, err := _Bidderregistry.contract.WatchLogs(opts, "FeePayoutPeriodBlocksUpdated", newFeePayoutPeriodBlocksRule) + 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(BidderregistryFeePayoutPeriodBlocksUpdated) + if err := _Bidderregistry.contract.UnpackLog(event, "FeePayoutPeriodBlocksUpdated", 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 +} + +// ParseFeePayoutPeriodBlocksUpdated is a log parse operation binding the contract event 0x1b8b3f7fd7594ce5b7155b4c56b19bd6a1eac8c1ec5d941635acf104c8db3571. +// +// Solidity: event FeePayoutPeriodBlocksUpdated(uint256 indexed newFeePayoutPeriodBlocks) +func (_Bidderregistry *BidderregistryFilterer) ParseFeePayoutPeriodBlocksUpdated(log types.Log) (*BidderregistryFeePayoutPeriodBlocksUpdated, error) { + event := new(BidderregistryFeePayoutPeriodBlocksUpdated) + if err := _Bidderregistry.contract.UnpackLog(event, "FeePayoutPeriodBlocksUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// BidderregistryFeeTransferIterator is returned from FilterFeeTransfer and is used to iterate over the raw logs and unpacked data for FeeTransfer events raised by the Bidderregistry contract. +type BidderregistryFeeTransferIterator struct { + Event *BidderregistryFeeTransfer // 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 *BidderregistryFeeTransferIterator) 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(BidderregistryFeeTransfer) + 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(BidderregistryFeeTransfer) + 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 *BidderregistryFeeTransferIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *BidderregistryFeeTransferIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// BidderregistryFeeTransfer represents a FeeTransfer event raised by the Bidderregistry contract. +type BidderregistryFeeTransfer struct { + Amount *big.Int + Recipient common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterFeeTransfer is a free log retrieval operation binding the contract event 0x445bb6587d6cd09e272a0d1e5179e772b547dbf1041b6163f86bb62e86f25031. +// +// Solidity: event FeeTransfer(uint256 amount, address indexed recipient) +func (_Bidderregistry *BidderregistryFilterer) FilterFeeTransfer(opts *bind.FilterOpts, recipient []common.Address) (*BidderregistryFeeTransferIterator, error) { + + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _Bidderregistry.contract.FilterLogs(opts, "FeeTransfer", recipientRule) + if err != nil { + return nil, err + } + return &BidderregistryFeeTransferIterator{contract: _Bidderregistry.contract, event: "FeeTransfer", logs: logs, sub: sub}, nil +} + +// WatchFeeTransfer is a free log subscription operation binding the contract event 0x445bb6587d6cd09e272a0d1e5179e772b547dbf1041b6163f86bb62e86f25031. +// +// Solidity: event FeeTransfer(uint256 amount, address indexed recipient) +func (_Bidderregistry *BidderregistryFilterer) WatchFeeTransfer(opts *bind.WatchOpts, sink chan<- *BidderregistryFeeTransfer, recipient []common.Address) (event.Subscription, error) { + + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _Bidderregistry.contract.WatchLogs(opts, "FeeTransfer", recipientRule) + 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(BidderregistryFeeTransfer) + if err := _Bidderregistry.contract.UnpackLog(event, "FeeTransfer", 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 +} + +// ParseFeeTransfer is a log parse operation binding the contract event 0x445bb6587d6cd09e272a0d1e5179e772b547dbf1041b6163f86bb62e86f25031. +// +// Solidity: event FeeTransfer(uint256 amount, address indexed recipient) +func (_Bidderregistry *BidderregistryFilterer) ParseFeeTransfer(log types.Log) (*BidderregistryFeeTransfer, error) { + event := new(BidderregistryFeeTransfer) + if err := _Bidderregistry.contract.UnpackLog(event, "FeeTransfer", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + // BidderregistryFundsRetrievedIterator is returned from FilterFundsRetrieved and is used to iterate over the raw logs and unpacked data for FundsRetrieved events raised by the Bidderregistry contract. type BidderregistryFundsRetrievedIterator struct { Event *BidderregistryFundsRetrieved // Event containing the contract specifics and raw log @@ -2392,6 +2643,150 @@ func (_Bidderregistry *BidderregistryFilterer) ParseOwnershipTransferred(log typ return event, nil } +// BidderregistryProtocolFeeRecipientUpdatedIterator is returned from FilterProtocolFeeRecipientUpdated and is used to iterate over the raw logs and unpacked data for ProtocolFeeRecipientUpdated events raised by the Bidderregistry contract. +type BidderregistryProtocolFeeRecipientUpdatedIterator struct { + Event *BidderregistryProtocolFeeRecipientUpdated // 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 *BidderregistryProtocolFeeRecipientUpdatedIterator) 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(BidderregistryProtocolFeeRecipientUpdated) + 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(BidderregistryProtocolFeeRecipientUpdated) + 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 *BidderregistryProtocolFeeRecipientUpdatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *BidderregistryProtocolFeeRecipientUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// BidderregistryProtocolFeeRecipientUpdated represents a ProtocolFeeRecipientUpdated event raised by the Bidderregistry contract. +type BidderregistryProtocolFeeRecipientUpdated struct { + NewProtocolFeeRecipient common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterProtocolFeeRecipientUpdated is a free log retrieval operation binding the contract event 0xc1b5345cce283376356748dc57f2dfa7120431d016fc7ca9ba641bc65f91411d. +// +// Solidity: event ProtocolFeeRecipientUpdated(address indexed newProtocolFeeRecipient) +func (_Bidderregistry *BidderregistryFilterer) FilterProtocolFeeRecipientUpdated(opts *bind.FilterOpts, newProtocolFeeRecipient []common.Address) (*BidderregistryProtocolFeeRecipientUpdatedIterator, error) { + + var newProtocolFeeRecipientRule []interface{} + for _, newProtocolFeeRecipientItem := range newProtocolFeeRecipient { + newProtocolFeeRecipientRule = append(newProtocolFeeRecipientRule, newProtocolFeeRecipientItem) + } + + logs, sub, err := _Bidderregistry.contract.FilterLogs(opts, "ProtocolFeeRecipientUpdated", newProtocolFeeRecipientRule) + if err != nil { + return nil, err + } + return &BidderregistryProtocolFeeRecipientUpdatedIterator{contract: _Bidderregistry.contract, event: "ProtocolFeeRecipientUpdated", logs: logs, sub: sub}, nil +} + +// WatchProtocolFeeRecipientUpdated is a free log subscription operation binding the contract event 0xc1b5345cce283376356748dc57f2dfa7120431d016fc7ca9ba641bc65f91411d. +// +// Solidity: event ProtocolFeeRecipientUpdated(address indexed newProtocolFeeRecipient) +func (_Bidderregistry *BidderregistryFilterer) WatchProtocolFeeRecipientUpdated(opts *bind.WatchOpts, sink chan<- *BidderregistryProtocolFeeRecipientUpdated, newProtocolFeeRecipient []common.Address) (event.Subscription, error) { + + var newProtocolFeeRecipientRule []interface{} + for _, newProtocolFeeRecipientItem := range newProtocolFeeRecipient { + newProtocolFeeRecipientRule = append(newProtocolFeeRecipientRule, newProtocolFeeRecipientItem) + } + + logs, sub, err := _Bidderregistry.contract.WatchLogs(opts, "ProtocolFeeRecipientUpdated", newProtocolFeeRecipientRule) + 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(BidderregistryProtocolFeeRecipientUpdated) + if err := _Bidderregistry.contract.UnpackLog(event, "ProtocolFeeRecipientUpdated", 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 +} + +// ParseProtocolFeeRecipientUpdated is a log parse operation binding the contract event 0xc1b5345cce283376356748dc57f2dfa7120431d016fc7ca9ba641bc65f91411d. +// +// Solidity: event ProtocolFeeRecipientUpdated(address indexed newProtocolFeeRecipient) +func (_Bidderregistry *BidderregistryFilterer) ParseProtocolFeeRecipientUpdated(log types.Log) (*BidderregistryProtocolFeeRecipientUpdated, error) { + event := new(BidderregistryProtocolFeeRecipientUpdated) + if err := _Bidderregistry.contract.UnpackLog(event, "ProtocolFeeRecipientUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + // BidderregistryUpgradedIterator is returned from FilterUpgraded and is used to iterate over the raw logs and unpacked data for Upgraded events raised by the Bidderregistry contract. type BidderregistryUpgradedIterator struct { Event *BidderregistryUpgraded // 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 14297e5a7..4549e4399 100644 --- a/contracts-abi/clients/PreConfCommitmentStore/PreConfCommitmentStore.go +++ b/contracts-abi/clients/PreConfCommitmentStore/PreConfCommitmentStore.go @@ -73,7 +73,7 @@ type IPreConfCommitmentStorePreConfCommitment struct { // PreconfcommitmentstoreMetaData contains all meta data concerning the Preconfcommitmentstore contract. var PreconfcommitmentstoreMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"fallback\",\"stateMutability\":\"payable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"DOMAIN_SEPARATOR_BID\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"DOMAIN_SEPARATOR_PRECONF\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"EIP712_BID_TYPEHASH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"EIP712_COMMITMENT_TYPEHASH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"HEXCHARS\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"UPGRADE_INTERFACE_VERSION\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"acceptOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"bidderRegistry\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIBidderRegistry\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blockTracker\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIBlockTracker\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blocksPerWindow\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"commitmentDispatchWindow\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"commitments\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"isUsed\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"dispatchTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"committer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"bid\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"bidHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"commitmentHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"bidSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"sharedSecretKey\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"revertingTxHashes\",\"type\":\"string\",\"internalType\":\"string\"}],\"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\":\"isUsed\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"committer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"dispatchTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getBidHash\",\"inputs\":[{\"name\":\"_txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"_revertingTxHashes\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"_bid\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"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\":\"pure\"},{\"type\":\"function\",\"name\":\"getCommitment\",\"inputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIPreConfCommitmentStore.PreConfCommitment\",\"components\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"isUsed\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"dispatchTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"committer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"bid\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"bidHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"commitmentHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"bidSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"sharedSecretKey\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"revertingTxHashes\",\"type\":\"string\",\"internalType\":\"string\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getCommitmentIndex\",\"inputs\":[{\"name\":\"commitment\",\"type\":\"tuple\",\"internalType\":\"structIPreConfCommitmentStore.PreConfCommitment\",\"components\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"isUsed\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"dispatchTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"committer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"bid\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"bidHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"commitmentHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"bidSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"sharedSecretKey\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"revertingTxHashes\",\"type\":\"string\",\"internalType\":\"string\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"getEncryptedCommitment\",\"inputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIPreConfCommitmentStore.EncrPreConfCommitment\",\"components\":[{\"name\":\"isUsed\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"committer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"dispatchTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getEncryptedCommitmentIndex\",\"inputs\":[{\"name\":\"commitment\",\"type\":\"tuple\",\"internalType\":\"structIPreConfCommitmentStore.EncrPreConfCommitment\",\"components\":[{\"name\":\"isUsed\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"committer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"dispatchTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"getPreConfHash\",\"inputs\":[{\"name\":\"_txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"_revertingTxHashes\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"_bid\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"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\":\"pure\"},{\"type\":\"function\",\"name\":\"getTxnHashFromCommitment\",\"inputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_providerRegistry\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_bidderRegistry\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_oracle\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_blockTracker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_commitmentDispatchWindow\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_blocksPerWindow\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"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\":\"openCommitment\",\"inputs\":[{\"name\":\"encryptedCommitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"bid\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"revertingTxHashes\",\"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\":\"pendingOwner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"providerRegistry\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIProviderRegistry\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"proxiableUUID\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"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\":\"upgradeToAndCall\",\"inputs\":[{\"name\":\"newImplementation\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"verifyBid\",\"inputs\":[{\"name\":\"bid\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"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\":\"revertingTxHashes\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"bidSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"messageDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"recoveredAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"verifyPreConfCommitment\",\"inputs\":[{\"name\":\"params\",\"type\":\"tuple\",\"internalType\":\"structIPreConfCommitmentStore.CommitmentParams\",\"components\":[{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"revertingTxHashes\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"bid\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"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\":\"committerAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"pure\"},{\"type\":\"event\",\"name\":\"CommitmentStored\",\"inputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"bidder\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"committer\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"bid\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"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\":\"revertingTxHashes\",\"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\":\"committer\",\"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\":\"OwnershipTransferStarted\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"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\":\"revertingTxHashes\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"},{\"name\":\"bid\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Upgraded\",\"inputs\":[{\"name\":\"implementation\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"AddressEmptyCode\",\"inputs\":[{\"name\":\"target\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"ERC1967InvalidImplementation\",\"inputs\":[{\"name\":\"implementation\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"ERC1967NonPayable\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"FailedInnerCall\",\"inputs\":[]},{\"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\":\"UUPSUnauthorizedCallContext\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"UUPSUnsupportedProxiableUUID\",\"inputs\":[{\"name\":\"slot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]}]", + 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\":\"HEXCHARS\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"UPGRADE_INTERFACE_VERSION\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"acceptOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"bidderRegistry\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIBidderRegistry\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blockTracker\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIBlockTracker\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blocksPerWindow\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"commitmentDispatchWindow\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"commitments\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"isUsed\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"dispatchTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"committer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"bid\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"bidHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"commitmentHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"bidSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"sharedSecretKey\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"revertingTxHashes\",\"type\":\"string\",\"internalType\":\"string\"}],\"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\":\"isUsed\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"committer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"dispatchTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getBidHash\",\"inputs\":[{\"name\":\"_txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"_revertingTxHashes\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"_bid\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"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\":\"pure\"},{\"type\":\"function\",\"name\":\"getCommitment\",\"inputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIPreConfCommitmentStore.PreConfCommitment\",\"components\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"isUsed\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"dispatchTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"committer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"bid\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"bidHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"commitmentHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"bidSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"sharedSecretKey\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"revertingTxHashes\",\"type\":\"string\",\"internalType\":\"string\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getCommitmentIndex\",\"inputs\":[{\"name\":\"commitment\",\"type\":\"tuple\",\"internalType\":\"structIPreConfCommitmentStore.PreConfCommitment\",\"components\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"isUsed\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"dispatchTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"committer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"bid\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"bidHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"commitmentHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"bidSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"sharedSecretKey\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"revertingTxHashes\",\"type\":\"string\",\"internalType\":\"string\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"getEncryptedCommitment\",\"inputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIPreConfCommitmentStore.EncrPreConfCommitment\",\"components\":[{\"name\":\"isUsed\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"committer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"dispatchTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getEncryptedCommitmentIndex\",\"inputs\":[{\"name\":\"commitment\",\"type\":\"tuple\",\"internalType\":\"structIPreConfCommitmentStore.EncrPreConfCommitment\",\"components\":[{\"name\":\"isUsed\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"committer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"dispatchTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"getPreConfHash\",\"inputs\":[{\"name\":\"_txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"_revertingTxHashes\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"_bid\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"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\":\"pure\"},{\"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\":\"_oracleContract\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_blockTracker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_commitmentDispatchWindow\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_blocksPerWindow\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"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\":\"openCommitment\",\"inputs\":[{\"name\":\"encryptedCommitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"bid\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"revertingTxHashes\",\"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\":\"oracleContract\",\"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\":\"pendingOwner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"providerRegistry\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIProviderRegistry\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"proxiableUUID\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"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\":\"updateOracleContract\",\"inputs\":[{\"name\":\"newOracleContract\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"updateProviderRegistry\",\"inputs\":[{\"name\":\"newProviderRegistry\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"upgradeToAndCall\",\"inputs\":[{\"name\":\"newImplementation\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"verifyBid\",\"inputs\":[{\"name\":\"bid\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"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\":\"revertingTxHashes\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"bidSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"messageDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"recoveredAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"verifyPreConfCommitment\",\"inputs\":[{\"name\":\"params\",\"type\":\"tuple\",\"internalType\":\"structIPreConfCommitmentStore.CommitmentParams\",\"components\":[{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"revertingTxHashes\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"bid\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"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\":\"committerAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"pure\"},{\"type\":\"event\",\"name\":\"CommitmentStored\",\"inputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"bidder\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"committer\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"bid\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"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\":\"revertingTxHashes\",\"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\":\"committer\",\"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\":\"OwnershipTransferStarted\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"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\":\"revertingTxHashes\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"},{\"name\":\"bid\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Upgraded\",\"inputs\":[{\"name\":\"implementation\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"AddressEmptyCode\",\"inputs\":[{\"name\":\"target\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"ERC1967InvalidImplementation\",\"inputs\":[{\"name\":\"implementation\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"ERC1967NonPayable\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"FailedInnerCall\",\"inputs\":[]},{\"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\":\"UUPSUnauthorizedCallContext\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"UUPSUnsupportedProxiableUUID\",\"inputs\":[{\"name\":\"slot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]}]", } // PreconfcommitmentstoreABI is the input ABI used to generate the binding from. @@ -950,12 +950,12 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreCallerSession) GetTxnHashFr return _Preconfcommitmentstore.Contract.GetTxnHashFromCommitment(&_Preconfcommitmentstore.CallOpts, commitmentIndex) } -// Oracle is a free data retrieval call binding the contract method 0x7dc0d1d0. +// OracleContract is a free data retrieval call binding the contract method 0xbece7532. // -// Solidity: function oracle() view returns(address) -func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) Oracle(opts *bind.CallOpts) (common.Address, error) { +// Solidity: function oracleContract() view returns(address) +func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) OracleContract(opts *bind.CallOpts) (common.Address, error) { var out []interface{} - err := _Preconfcommitmentstore.contract.Call(opts, &out, "oracle") + err := _Preconfcommitmentstore.contract.Call(opts, &out, "oracleContract") if err != nil { return *new(common.Address), err @@ -967,18 +967,18 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) Oracle(opts *bind.C } -// Oracle is a free data retrieval call binding the contract method 0x7dc0d1d0. +// OracleContract is a free data retrieval call binding the contract method 0xbece7532. // -// Solidity: function oracle() view returns(address) -func (_Preconfcommitmentstore *PreconfcommitmentstoreSession) Oracle() (common.Address, error) { - return _Preconfcommitmentstore.Contract.Oracle(&_Preconfcommitmentstore.CallOpts) +// Solidity: function oracleContract() view returns(address) +func (_Preconfcommitmentstore *PreconfcommitmentstoreSession) OracleContract() (common.Address, error) { + return _Preconfcommitmentstore.Contract.OracleContract(&_Preconfcommitmentstore.CallOpts) } -// Oracle is a free data retrieval call binding the contract method 0x7dc0d1d0. +// OracleContract is a free data retrieval call binding the contract method 0xbece7532. // -// Solidity: function oracle() view returns(address) -func (_Preconfcommitmentstore *PreconfcommitmentstoreCallerSession) Oracle() (common.Address, error) { - return _Preconfcommitmentstore.Contract.Oracle(&_Preconfcommitmentstore.CallOpts) +// Solidity: function oracleContract() view returns(address) +func (_Preconfcommitmentstore *PreconfcommitmentstoreCallerSession) OracleContract() (common.Address, error) { + return _Preconfcommitmentstore.Contract.OracleContract(&_Preconfcommitmentstore.CallOpts) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. @@ -1218,23 +1218,23 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreTransactorSession) AcceptOw // Initialize is a paid mutator transaction binding the contract method 0xd8d0cbc1. // -// Solidity: function initialize(address _providerRegistry, address _bidderRegistry, address _oracle, address _owner, address _blockTracker, uint64 _commitmentDispatchWindow, uint256 _blocksPerWindow) returns() -func (_Preconfcommitmentstore *PreconfcommitmentstoreTransactor) Initialize(opts *bind.TransactOpts, _providerRegistry common.Address, _bidderRegistry common.Address, _oracle common.Address, _owner common.Address, _blockTracker common.Address, _commitmentDispatchWindow uint64, _blocksPerWindow *big.Int) (*types.Transaction, error) { - return _Preconfcommitmentstore.contract.Transact(opts, "initialize", _providerRegistry, _bidderRegistry, _oracle, _owner, _blockTracker, _commitmentDispatchWindow, _blocksPerWindow) +// Solidity: function initialize(address _providerRegistry, address _bidderRegistry, address _oracleContract, address _owner, address _blockTracker, uint64 _commitmentDispatchWindow, uint256 _blocksPerWindow) returns() +func (_Preconfcommitmentstore *PreconfcommitmentstoreTransactor) Initialize(opts *bind.TransactOpts, _providerRegistry common.Address, _bidderRegistry common.Address, _oracleContract common.Address, _owner common.Address, _blockTracker common.Address, _commitmentDispatchWindow uint64, _blocksPerWindow *big.Int) (*types.Transaction, error) { + return _Preconfcommitmentstore.contract.Transact(opts, "initialize", _providerRegistry, _bidderRegistry, _oracleContract, _owner, _blockTracker, _commitmentDispatchWindow, _blocksPerWindow) } // Initialize is a paid mutator transaction binding the contract method 0xd8d0cbc1. // -// Solidity: function initialize(address _providerRegistry, address _bidderRegistry, address _oracle, address _owner, address _blockTracker, uint64 _commitmentDispatchWindow, uint256 _blocksPerWindow) returns() -func (_Preconfcommitmentstore *PreconfcommitmentstoreSession) Initialize(_providerRegistry common.Address, _bidderRegistry common.Address, _oracle common.Address, _owner common.Address, _blockTracker common.Address, _commitmentDispatchWindow uint64, _blocksPerWindow *big.Int) (*types.Transaction, error) { - return _Preconfcommitmentstore.Contract.Initialize(&_Preconfcommitmentstore.TransactOpts, _providerRegistry, _bidderRegistry, _oracle, _owner, _blockTracker, _commitmentDispatchWindow, _blocksPerWindow) +// Solidity: function initialize(address _providerRegistry, address _bidderRegistry, address _oracleContract, address _owner, address _blockTracker, uint64 _commitmentDispatchWindow, uint256 _blocksPerWindow) returns() +func (_Preconfcommitmentstore *PreconfcommitmentstoreSession) Initialize(_providerRegistry common.Address, _bidderRegistry common.Address, _oracleContract common.Address, _owner common.Address, _blockTracker common.Address, _commitmentDispatchWindow uint64, _blocksPerWindow *big.Int) (*types.Transaction, error) { + return _Preconfcommitmentstore.Contract.Initialize(&_Preconfcommitmentstore.TransactOpts, _providerRegistry, _bidderRegistry, _oracleContract, _owner, _blockTracker, _commitmentDispatchWindow, _blocksPerWindow) } // Initialize is a paid mutator transaction binding the contract method 0xd8d0cbc1. // -// Solidity: function initialize(address _providerRegistry, address _bidderRegistry, address _oracle, address _owner, address _blockTracker, uint64 _commitmentDispatchWindow, uint256 _blocksPerWindow) returns() -func (_Preconfcommitmentstore *PreconfcommitmentstoreTransactorSession) Initialize(_providerRegistry common.Address, _bidderRegistry common.Address, _oracle common.Address, _owner common.Address, _blockTracker common.Address, _commitmentDispatchWindow uint64, _blocksPerWindow *big.Int) (*types.Transaction, error) { - return _Preconfcommitmentstore.Contract.Initialize(&_Preconfcommitmentstore.TransactOpts, _providerRegistry, _bidderRegistry, _oracle, _owner, _blockTracker, _commitmentDispatchWindow, _blocksPerWindow) +// Solidity: function initialize(address _providerRegistry, address _bidderRegistry, address _oracleContract, address _owner, address _blockTracker, uint64 _commitmentDispatchWindow, uint256 _blocksPerWindow) returns() +func (_Preconfcommitmentstore *PreconfcommitmentstoreTransactorSession) Initialize(_providerRegistry common.Address, _bidderRegistry common.Address, _oracleContract common.Address, _owner common.Address, _blockTracker common.Address, _commitmentDispatchWindow uint64, _blocksPerWindow *big.Int) (*types.Transaction, error) { + return _Preconfcommitmentstore.Contract.Initialize(&_Preconfcommitmentstore.TransactOpts, _providerRegistry, _bidderRegistry, _oracleContract, _owner, _blockTracker, _commitmentDispatchWindow, _blocksPerWindow) } // InitiateReward is a paid mutator transaction binding the contract method 0x03faf979. @@ -1405,25 +1405,25 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreTransactorSession) UpdateCo return _Preconfcommitmentstore.Contract.UpdateCommitmentDispatchWindow(&_Preconfcommitmentstore.TransactOpts, newDispatchWindow) } -// UpdateOracle is a paid mutator transaction binding the contract method 0x1cb44dfc. +// UpdateOracleContract is a paid mutator transaction binding the contract method 0xd3bab58f. // -// Solidity: function updateOracle(address newOracle) returns() -func (_Preconfcommitmentstore *PreconfcommitmentstoreTransactor) UpdateOracle(opts *bind.TransactOpts, newOracle common.Address) (*types.Transaction, error) { - return _Preconfcommitmentstore.contract.Transact(opts, "updateOracle", newOracle) +// Solidity: function updateOracleContract(address newOracleContract) returns() +func (_Preconfcommitmentstore *PreconfcommitmentstoreTransactor) UpdateOracleContract(opts *bind.TransactOpts, newOracleContract common.Address) (*types.Transaction, error) { + return _Preconfcommitmentstore.contract.Transact(opts, "updateOracleContract", newOracleContract) } -// UpdateOracle is a paid mutator transaction binding the contract method 0x1cb44dfc. +// UpdateOracleContract is a paid mutator transaction binding the contract method 0xd3bab58f. // -// Solidity: function updateOracle(address newOracle) returns() -func (_Preconfcommitmentstore *PreconfcommitmentstoreSession) UpdateOracle(newOracle common.Address) (*types.Transaction, error) { - return _Preconfcommitmentstore.Contract.UpdateOracle(&_Preconfcommitmentstore.TransactOpts, newOracle) +// Solidity: function updateOracleContract(address newOracleContract) returns() +func (_Preconfcommitmentstore *PreconfcommitmentstoreSession) UpdateOracleContract(newOracleContract common.Address) (*types.Transaction, error) { + return _Preconfcommitmentstore.Contract.UpdateOracleContract(&_Preconfcommitmentstore.TransactOpts, newOracleContract) } -// UpdateOracle is a paid mutator transaction binding the contract method 0x1cb44dfc. +// UpdateOracleContract is a paid mutator transaction binding the contract method 0xd3bab58f. // -// Solidity: function updateOracle(address newOracle) returns() -func (_Preconfcommitmentstore *PreconfcommitmentstoreTransactorSession) UpdateOracle(newOracle common.Address) (*types.Transaction, error) { - return _Preconfcommitmentstore.Contract.UpdateOracle(&_Preconfcommitmentstore.TransactOpts, newOracle) +// Solidity: function updateOracleContract(address newOracleContract) returns() +func (_Preconfcommitmentstore *PreconfcommitmentstoreTransactorSession) UpdateOracleContract(newOracleContract common.Address) (*types.Transaction, error) { + return _Preconfcommitmentstore.Contract.UpdateOracleContract(&_Preconfcommitmentstore.TransactOpts, newOracleContract) } // UpdateProviderRegistry is a paid mutator transaction binding the contract method 0x92d2e3e7. diff --git a/contracts-abi/clients/ProviderRegistry/ProviderRegistry.go b/contracts-abi/clients/ProviderRegistry/ProviderRegistry.go index aca9c6897..c2f1a4653 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\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"fallback\",\"stateMutability\":\"payable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"PERCENT\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"PRECISION\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"UPGRADE_INTERFACE_VERSION\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"acceptOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"eoaToBlsPubkey\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"view\"},{\"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\":\"getBLSKey\",\"inputs\":[{\"name\":\"provider\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getProviderStake\",\"inputs\":[{\"name\":\"provider\",\"type\":\"address\",\"internalType\":\"address\"}],\"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\"},{\"name\":\"_withdrawalDelay\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"isProviderValid\",\"inputs\":[{\"name\":\"provider\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"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\":\"pendingOwner\",\"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\":\"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\":\"proxiableUUID\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"registerAndStake\",\"inputs\":[{\"name\":\"blsPublicKey\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"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\":\"setWithdrawalDelay\",\"inputs\":[{\"name\":\"_withdrawalDelay\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"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\":\"stake\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"unstake\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"upgradeToAndCall\",\"inputs\":[{\"name\":\"newImplementation\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"withdraw\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawFeeRecipientAmount\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawProtocolFee\",\"inputs\":[{\"name\":\"treasuryAddress\",\"type\":\"address\",\"internalType\":\"addresspayable\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawalDelay\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"withdrawalRequests\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"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\":\"OwnershipTransferStarted\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"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\"},{\"name\":\"blsPublicKey\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Unstake\",\"inputs\":[{\"name\":\"provider\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"timestamp\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Upgraded\",\"inputs\":[{\"name\":\"implementation\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Withdraw\",\"inputs\":[{\"name\":\"provider\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"WithdrawalDelayUpdated\",\"inputs\":[{\"name\":\"newWithdrawalDelay\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"AddressEmptyCode\",\"inputs\":[{\"name\":\"target\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"ERC1967InvalidImplementation\",\"inputs\":[{\"name\":\"implementation\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"ERC1967NonPayable\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"FailedInnerCall\",\"inputs\":[]},{\"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\":[]},{\"type\":\"error\",\"name\":\"UUPSUnauthorizedCallContext\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"UUPSUnsupportedProxiableUUID\",\"inputs\":[{\"name\":\"slot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]}]", + ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"fallback\",\"stateMutability\":\"payable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"PERCENT\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"PRECISION\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"UPGRADE_INTERFACE_VERSION\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"acceptOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"eoaToBlsPubkey\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"feePercent\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getAccumulatedProtocolFee\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getBLSKey\",\"inputs\":[{\"name\":\"provider\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getProviderStake\",\"inputs\":[{\"name\":\"provider\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_minStake\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_protocolFeeRecipient\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_feePercent\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_withdrawalDelay\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_protocolFeePayoutPeriodBlocks\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"isProviderValid\",\"inputs\":[{\"name\":\"provider\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"manuallyWithdrawProtocolFee\",\"inputs\":[],\"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\":\"pendingOwner\",\"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\":\"protocolFeeTracker\",\"inputs\":[],\"outputs\":[{\"name\":\"recipient\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"accumulatedAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"lastPayoutBlock\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"payoutPeriodBlocks\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"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\":\"proxiableUUID\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"registerAndStake\",\"inputs\":[{\"name\":\"blsPublicKey\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setFeePayoutPeriodBlocks\",\"inputs\":[{\"name\":\"_feePayoutPeriodBlocks\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setNewFeePercent\",\"inputs\":[{\"name\":\"newFeePercent\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setNewProtocolFeeRecipient\",\"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\":\"setWithdrawalDelay\",\"inputs\":[{\"name\":\"_withdrawalDelay\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"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\":\"stake\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"unstake\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"upgradeToAndCall\",\"inputs\":[{\"name\":\"newImplementation\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"withdraw\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawalDelay\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"withdrawalRequests\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"FeePayoutPeriodBlocksUpdated\",\"inputs\":[{\"name\":\"newFeePayoutPeriodBlocks\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"FeeTransfer\",\"inputs\":[{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"recipient\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"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\":\"OwnershipTransferStarted\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"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\":\"ProtocolFeeRecipientUpdated\",\"inputs\":[{\"name\":\"newProtocolFeeRecipient\",\"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\"},{\"name\":\"blsPublicKey\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Unstake\",\"inputs\":[{\"name\":\"provider\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"timestamp\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Upgraded\",\"inputs\":[{\"name\":\"implementation\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Withdraw\",\"inputs\":[{\"name\":\"provider\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"WithdrawalDelayUpdated\",\"inputs\":[{\"name\":\"newWithdrawalDelay\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"AddressEmptyCode\",\"inputs\":[{\"name\":\"target\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"ERC1967InvalidImplementation\",\"inputs\":[{\"name\":\"implementation\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"ERC1967NonPayable\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"FailedInnerCall\",\"inputs\":[]},{\"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\":[]},{\"type\":\"error\",\"name\":\"UUPSUnauthorizedCallContext\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"UUPSUnsupportedProxiableUUID\",\"inputs\":[{\"name\":\"slot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]}]", } // ProviderregistryABI is the input ABI used to generate the binding from. @@ -335,43 +335,12 @@ func (_Providerregistry *ProviderregistryCallerSession) FeePercent() (uint16, er return _Providerregistry.Contract.FeePercent(&_Providerregistry.CallOpts) } -// FeeRecipient is a free data retrieval call binding the contract method 0x46904840. +// GetAccumulatedProtocolFee is a free data retrieval call binding the contract method 0x2dde2218. // -// Solidity: function feeRecipient() view returns(address) -func (_Providerregistry *ProviderregistryCaller) FeeRecipient(opts *bind.CallOpts) (common.Address, error) { +// Solidity: function getAccumulatedProtocolFee() view returns(uint256) +func (_Providerregistry *ProviderregistryCaller) GetAccumulatedProtocolFee(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} - err := _Providerregistry.contract.Call(opts, &out, "feeRecipient") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// FeeRecipient is a free data retrieval call binding the contract method 0x46904840. -// -// Solidity: function feeRecipient() view returns(address) -func (_Providerregistry *ProviderregistrySession) FeeRecipient() (common.Address, error) { - return _Providerregistry.Contract.FeeRecipient(&_Providerregistry.CallOpts) -} - -// FeeRecipient is a free data retrieval call binding the contract method 0x46904840. -// -// Solidity: function feeRecipient() view returns(address) -func (_Providerregistry *ProviderregistryCallerSession) FeeRecipient() (common.Address, error) { - return _Providerregistry.Contract.FeeRecipient(&_Providerregistry.CallOpts) -} - -// FeeRecipientAmount is a free data retrieval call binding the contract method 0xe0ae4ebd. -// -// Solidity: function feeRecipientAmount() view returns(uint256) -func (_Providerregistry *ProviderregistryCaller) FeeRecipientAmount(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _Providerregistry.contract.Call(opts, &out, "feeRecipientAmount") + err := _Providerregistry.contract.Call(opts, &out, "getAccumulatedProtocolFee") if err != nil { return *new(*big.Int), err @@ -383,18 +352,18 @@ func (_Providerregistry *ProviderregistryCaller) FeeRecipientAmount(opts *bind.C } -// FeeRecipientAmount is a free data retrieval call binding the contract method 0xe0ae4ebd. +// GetAccumulatedProtocolFee is a free data retrieval call binding the contract method 0x2dde2218. // -// Solidity: function feeRecipientAmount() view returns(uint256) -func (_Providerregistry *ProviderregistrySession) FeeRecipientAmount() (*big.Int, error) { - return _Providerregistry.Contract.FeeRecipientAmount(&_Providerregistry.CallOpts) +// Solidity: function getAccumulatedProtocolFee() view returns(uint256) +func (_Providerregistry *ProviderregistrySession) GetAccumulatedProtocolFee() (*big.Int, error) { + return _Providerregistry.Contract.GetAccumulatedProtocolFee(&_Providerregistry.CallOpts) } -// FeeRecipientAmount is a free data retrieval call binding the contract method 0xe0ae4ebd. +// GetAccumulatedProtocolFee is a free data retrieval call binding the contract method 0x2dde2218. // -// Solidity: function feeRecipientAmount() view returns(uint256) -func (_Providerregistry *ProviderregistryCallerSession) FeeRecipientAmount() (*big.Int, error) { - return _Providerregistry.Contract.FeeRecipientAmount(&_Providerregistry.CallOpts) +// Solidity: function getAccumulatedProtocolFee() view returns(uint256) +func (_Providerregistry *ProviderregistryCallerSession) GetAccumulatedProtocolFee() (*big.Int, error) { + return _Providerregistry.Contract.GetAccumulatedProtocolFee(&_Providerregistry.CallOpts) } // GetBLSKey is a free data retrieval call binding the contract method 0xb50c522e. @@ -612,35 +581,59 @@ func (_Providerregistry *ProviderregistryCallerSession) PreConfirmationsContract return _Providerregistry.Contract.PreConfirmationsContract(&_Providerregistry.CallOpts) } -// ProtocolFeeAmount is a free data retrieval call binding the contract method 0x8ec9c93b. +// ProtocolFeeTracker is a free data retrieval call binding the contract method 0x291af92c. // -// Solidity: function protocolFeeAmount() view returns(uint256) -func (_Providerregistry *ProviderregistryCaller) ProtocolFeeAmount(opts *bind.CallOpts) (*big.Int, error) { +// Solidity: function protocolFeeTracker() view returns(address recipient, uint256 accumulatedAmount, uint256 lastPayoutBlock, uint256 payoutPeriodBlocks) +func (_Providerregistry *ProviderregistryCaller) ProtocolFeeTracker(opts *bind.CallOpts) (struct { + Recipient common.Address + AccumulatedAmount *big.Int + LastPayoutBlock *big.Int + PayoutPeriodBlocks *big.Int +}, error) { var out []interface{} - err := _Providerregistry.contract.Call(opts, &out, "protocolFeeAmount") - + err := _Providerregistry.contract.Call(opts, &out, "protocolFeeTracker") + + outstruct := new(struct { + Recipient common.Address + AccumulatedAmount *big.Int + LastPayoutBlock *big.Int + PayoutPeriodBlocks *big.Int + }) if err != nil { - return *new(*big.Int), err + return *outstruct, err } - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + outstruct.Recipient = *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + outstruct.AccumulatedAmount = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + outstruct.LastPayoutBlock = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) + outstruct.PayoutPeriodBlocks = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) - return out0, err + return *outstruct, err } -// ProtocolFeeAmount is a free data retrieval call binding the contract method 0x8ec9c93b. +// ProtocolFeeTracker is a free data retrieval call binding the contract method 0x291af92c. // -// Solidity: function protocolFeeAmount() view returns(uint256) -func (_Providerregistry *ProviderregistrySession) ProtocolFeeAmount() (*big.Int, error) { - return _Providerregistry.Contract.ProtocolFeeAmount(&_Providerregistry.CallOpts) +// Solidity: function protocolFeeTracker() view returns(address recipient, uint256 accumulatedAmount, uint256 lastPayoutBlock, uint256 payoutPeriodBlocks) +func (_Providerregistry *ProviderregistrySession) ProtocolFeeTracker() (struct { + Recipient common.Address + AccumulatedAmount *big.Int + LastPayoutBlock *big.Int + PayoutPeriodBlocks *big.Int +}, error) { + return _Providerregistry.Contract.ProtocolFeeTracker(&_Providerregistry.CallOpts) } -// ProtocolFeeAmount is a free data retrieval call binding the contract method 0x8ec9c93b. +// ProtocolFeeTracker is a free data retrieval call binding the contract method 0x291af92c. // -// Solidity: function protocolFeeAmount() view returns(uint256) -func (_Providerregistry *ProviderregistryCallerSession) ProtocolFeeAmount() (*big.Int, error) { - return _Providerregistry.Contract.ProtocolFeeAmount(&_Providerregistry.CallOpts) +// Solidity: function protocolFeeTracker() view returns(address recipient, uint256 accumulatedAmount, uint256 lastPayoutBlock, uint256 payoutPeriodBlocks) +func (_Providerregistry *ProviderregistryCallerSession) ProtocolFeeTracker() (struct { + Recipient common.Address + AccumulatedAmount *big.Int + LastPayoutBlock *big.Int + PayoutPeriodBlocks *big.Int +}, error) { + return _Providerregistry.Contract.ProtocolFeeTracker(&_Providerregistry.CallOpts) } // ProviderRegistered is a free data retrieval call binding the contract method 0xab255b41. @@ -819,25 +812,46 @@ func (_Providerregistry *ProviderregistryTransactorSession) AcceptOwnership() (* return _Providerregistry.Contract.AcceptOwnership(&_Providerregistry.TransactOpts) } -// Initialize is a paid mutator transaction binding the contract method 0xe919dbae. +// Initialize is a paid mutator transaction binding the contract method 0xc8387461. // -// Solidity: function initialize(uint256 _minStake, address _feeRecipient, uint16 _feePercent, address _owner, uint256 _withdrawalDelay) returns() -func (_Providerregistry *ProviderregistryTransactor) Initialize(opts *bind.TransactOpts, _minStake *big.Int, _feeRecipient common.Address, _feePercent uint16, _owner common.Address, _withdrawalDelay *big.Int) (*types.Transaction, error) { - return _Providerregistry.contract.Transact(opts, "initialize", _minStake, _feeRecipient, _feePercent, _owner, _withdrawalDelay) +// Solidity: function initialize(uint256 _minStake, address _protocolFeeRecipient, uint16 _feePercent, address _owner, uint256 _withdrawalDelay, uint256 _protocolFeePayoutPeriodBlocks) returns() +func (_Providerregistry *ProviderregistryTransactor) Initialize(opts *bind.TransactOpts, _minStake *big.Int, _protocolFeeRecipient common.Address, _feePercent uint16, _owner common.Address, _withdrawalDelay *big.Int, _protocolFeePayoutPeriodBlocks *big.Int) (*types.Transaction, error) { + return _Providerregistry.contract.Transact(opts, "initialize", _minStake, _protocolFeeRecipient, _feePercent, _owner, _withdrawalDelay, _protocolFeePayoutPeriodBlocks) } -// Initialize is a paid mutator transaction binding the contract method 0xe919dbae. +// Initialize is a paid mutator transaction binding the contract method 0xc8387461. // -// Solidity: function initialize(uint256 _minStake, address _feeRecipient, uint16 _feePercent, address _owner, uint256 _withdrawalDelay) returns() -func (_Providerregistry *ProviderregistrySession) Initialize(_minStake *big.Int, _feeRecipient common.Address, _feePercent uint16, _owner common.Address, _withdrawalDelay *big.Int) (*types.Transaction, error) { - return _Providerregistry.Contract.Initialize(&_Providerregistry.TransactOpts, _minStake, _feeRecipient, _feePercent, _owner, _withdrawalDelay) +// Solidity: function initialize(uint256 _minStake, address _protocolFeeRecipient, uint16 _feePercent, address _owner, uint256 _withdrawalDelay, uint256 _protocolFeePayoutPeriodBlocks) returns() +func (_Providerregistry *ProviderregistrySession) Initialize(_minStake *big.Int, _protocolFeeRecipient common.Address, _feePercent uint16, _owner common.Address, _withdrawalDelay *big.Int, _protocolFeePayoutPeriodBlocks *big.Int) (*types.Transaction, error) { + return _Providerregistry.Contract.Initialize(&_Providerregistry.TransactOpts, _minStake, _protocolFeeRecipient, _feePercent, _owner, _withdrawalDelay, _protocolFeePayoutPeriodBlocks) } -// Initialize is a paid mutator transaction binding the contract method 0xe919dbae. +// Initialize is a paid mutator transaction binding the contract method 0xc8387461. // -// Solidity: function initialize(uint256 _minStake, address _feeRecipient, uint16 _feePercent, address _owner, uint256 _withdrawalDelay) returns() -func (_Providerregistry *ProviderregistryTransactorSession) Initialize(_minStake *big.Int, _feeRecipient common.Address, _feePercent uint16, _owner common.Address, _withdrawalDelay *big.Int) (*types.Transaction, error) { - return _Providerregistry.Contract.Initialize(&_Providerregistry.TransactOpts, _minStake, _feeRecipient, _feePercent, _owner, _withdrawalDelay) +// Solidity: function initialize(uint256 _minStake, address _protocolFeeRecipient, uint16 _feePercent, address _owner, uint256 _withdrawalDelay, uint256 _protocolFeePayoutPeriodBlocks) returns() +func (_Providerregistry *ProviderregistryTransactorSession) Initialize(_minStake *big.Int, _protocolFeeRecipient common.Address, _feePercent uint16, _owner common.Address, _withdrawalDelay *big.Int, _protocolFeePayoutPeriodBlocks *big.Int) (*types.Transaction, error) { + return _Providerregistry.Contract.Initialize(&_Providerregistry.TransactOpts, _minStake, _protocolFeeRecipient, _feePercent, _owner, _withdrawalDelay, _protocolFeePayoutPeriodBlocks) +} + +// ManuallyWithdrawProtocolFee is a paid mutator transaction binding the contract method 0xdbf63530. +// +// Solidity: function manuallyWithdrawProtocolFee() returns() +func (_Providerregistry *ProviderregistryTransactor) ManuallyWithdrawProtocolFee(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Providerregistry.contract.Transact(opts, "manuallyWithdrawProtocolFee") +} + +// ManuallyWithdrawProtocolFee is a paid mutator transaction binding the contract method 0xdbf63530. +// +// Solidity: function manuallyWithdrawProtocolFee() returns() +func (_Providerregistry *ProviderregistrySession) ManuallyWithdrawProtocolFee() (*types.Transaction, error) { + return _Providerregistry.Contract.ManuallyWithdrawProtocolFee(&_Providerregistry.TransactOpts) +} + +// ManuallyWithdrawProtocolFee is a paid mutator transaction binding the contract method 0xdbf63530. +// +// Solidity: function manuallyWithdrawProtocolFee() returns() +func (_Providerregistry *ProviderregistryTransactorSession) ManuallyWithdrawProtocolFee() (*types.Transaction, error) { + return _Providerregistry.Contract.ManuallyWithdrawProtocolFee(&_Providerregistry.TransactOpts) } // RegisterAndStake is a paid mutator transaction binding the contract method 0x8e3d03f6. @@ -882,6 +896,27 @@ func (_Providerregistry *ProviderregistryTransactorSession) RenounceOwnership() return _Providerregistry.Contract.RenounceOwnership(&_Providerregistry.TransactOpts) } +// SetFeePayoutPeriodBlocks is a paid mutator transaction binding the contract method 0x7cbf9f6e. +// +// Solidity: function setFeePayoutPeriodBlocks(uint256 _feePayoutPeriodBlocks) returns() +func (_Providerregistry *ProviderregistryTransactor) SetFeePayoutPeriodBlocks(opts *bind.TransactOpts, _feePayoutPeriodBlocks *big.Int) (*types.Transaction, error) { + return _Providerregistry.contract.Transact(opts, "setFeePayoutPeriodBlocks", _feePayoutPeriodBlocks) +} + +// SetFeePayoutPeriodBlocks is a paid mutator transaction binding the contract method 0x7cbf9f6e. +// +// Solidity: function setFeePayoutPeriodBlocks(uint256 _feePayoutPeriodBlocks) returns() +func (_Providerregistry *ProviderregistrySession) SetFeePayoutPeriodBlocks(_feePayoutPeriodBlocks *big.Int) (*types.Transaction, error) { + return _Providerregistry.Contract.SetFeePayoutPeriodBlocks(&_Providerregistry.TransactOpts, _feePayoutPeriodBlocks) +} + +// SetFeePayoutPeriodBlocks is a paid mutator transaction binding the contract method 0x7cbf9f6e. +// +// Solidity: function setFeePayoutPeriodBlocks(uint256 _feePayoutPeriodBlocks) returns() +func (_Providerregistry *ProviderregistryTransactorSession) SetFeePayoutPeriodBlocks(_feePayoutPeriodBlocks *big.Int) (*types.Transaction, error) { + return _Providerregistry.Contract.SetFeePayoutPeriodBlocks(&_Providerregistry.TransactOpts, _feePayoutPeriodBlocks) +} + // SetNewFeePercent is a paid mutator transaction binding the contract method 0xfb22febf. // // Solidity: function setNewFeePercent(uint16 newFeePercent) returns() @@ -903,25 +938,25 @@ func (_Providerregistry *ProviderregistryTransactorSession) SetNewFeePercent(new return _Providerregistry.Contract.SetNewFeePercent(&_Providerregistry.TransactOpts, newFeePercent) } -// SetNewFeeRecipient is a paid mutator transaction binding the contract method 0xa26652ea. +// SetNewProtocolFeeRecipient is a paid mutator transaction binding the contract method 0x184ac28e. // -// Solidity: function setNewFeeRecipient(address newFeeRecipient) returns() -func (_Providerregistry *ProviderregistryTransactor) SetNewFeeRecipient(opts *bind.TransactOpts, newFeeRecipient common.Address) (*types.Transaction, error) { - return _Providerregistry.contract.Transact(opts, "setNewFeeRecipient", newFeeRecipient) +// Solidity: function setNewProtocolFeeRecipient(address newFeeRecipient) returns() +func (_Providerregistry *ProviderregistryTransactor) SetNewProtocolFeeRecipient(opts *bind.TransactOpts, newFeeRecipient common.Address) (*types.Transaction, error) { + return _Providerregistry.contract.Transact(opts, "setNewProtocolFeeRecipient", newFeeRecipient) } -// SetNewFeeRecipient is a paid mutator transaction binding the contract method 0xa26652ea. +// SetNewProtocolFeeRecipient is a paid mutator transaction binding the contract method 0x184ac28e. // -// Solidity: function setNewFeeRecipient(address newFeeRecipient) returns() -func (_Providerregistry *ProviderregistrySession) SetNewFeeRecipient(newFeeRecipient common.Address) (*types.Transaction, error) { - return _Providerregistry.Contract.SetNewFeeRecipient(&_Providerregistry.TransactOpts, newFeeRecipient) +// Solidity: function setNewProtocolFeeRecipient(address newFeeRecipient) returns() +func (_Providerregistry *ProviderregistrySession) SetNewProtocolFeeRecipient(newFeeRecipient common.Address) (*types.Transaction, error) { + return _Providerregistry.Contract.SetNewProtocolFeeRecipient(&_Providerregistry.TransactOpts, newFeeRecipient) } -// SetNewFeeRecipient is a paid mutator transaction binding the contract method 0xa26652ea. +// SetNewProtocolFeeRecipient is a paid mutator transaction binding the contract method 0x184ac28e. // -// Solidity: function setNewFeeRecipient(address newFeeRecipient) returns() -func (_Providerregistry *ProviderregistryTransactorSession) SetNewFeeRecipient(newFeeRecipient common.Address) (*types.Transaction, error) { - return _Providerregistry.Contract.SetNewFeeRecipient(&_Providerregistry.TransactOpts, newFeeRecipient) +// Solidity: function setNewProtocolFeeRecipient(address newFeeRecipient) returns() +func (_Providerregistry *ProviderregistryTransactorSession) SetNewProtocolFeeRecipient(newFeeRecipient common.Address) (*types.Transaction, error) { + return _Providerregistry.Contract.SetNewProtocolFeeRecipient(&_Providerregistry.TransactOpts, newFeeRecipient) } // SetPreconfirmationsContract is a paid mutator transaction binding the contract method 0xf6c7e476. @@ -1092,48 +1127,6 @@ func (_Providerregistry *ProviderregistryTransactorSession) Withdraw() (*types.T return _Providerregistry.Contract.Withdraw(&_Providerregistry.TransactOpts) } -// WithdrawFeeRecipientAmount is a paid mutator transaction binding the contract method 0x7e5713d8. -// -// Solidity: function withdrawFeeRecipientAmount() returns() -func (_Providerregistry *ProviderregistryTransactor) WithdrawFeeRecipientAmount(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Providerregistry.contract.Transact(opts, "withdrawFeeRecipientAmount") -} - -// WithdrawFeeRecipientAmount is a paid mutator transaction binding the contract method 0x7e5713d8. -// -// Solidity: function withdrawFeeRecipientAmount() returns() -func (_Providerregistry *ProviderregistrySession) WithdrawFeeRecipientAmount() (*types.Transaction, error) { - return _Providerregistry.Contract.WithdrawFeeRecipientAmount(&_Providerregistry.TransactOpts) -} - -// WithdrawFeeRecipientAmount is a paid mutator transaction binding the contract method 0x7e5713d8. -// -// Solidity: function withdrawFeeRecipientAmount() returns() -func (_Providerregistry *ProviderregistryTransactorSession) WithdrawFeeRecipientAmount() (*types.Transaction, error) { - return _Providerregistry.Contract.WithdrawFeeRecipientAmount(&_Providerregistry.TransactOpts) -} - -// WithdrawProtocolFee is a paid mutator transaction binding the contract method 0x668fb6dc. -// -// Solidity: function withdrawProtocolFee(address treasuryAddress) returns() -func (_Providerregistry *ProviderregistryTransactor) WithdrawProtocolFee(opts *bind.TransactOpts, treasuryAddress common.Address) (*types.Transaction, error) { - return _Providerregistry.contract.Transact(opts, "withdrawProtocolFee", treasuryAddress) -} - -// WithdrawProtocolFee is a paid mutator transaction binding the contract method 0x668fb6dc. -// -// Solidity: function withdrawProtocolFee(address treasuryAddress) returns() -func (_Providerregistry *ProviderregistrySession) WithdrawProtocolFee(treasuryAddress common.Address) (*types.Transaction, error) { - return _Providerregistry.Contract.WithdrawProtocolFee(&_Providerregistry.TransactOpts, treasuryAddress) -} - -// WithdrawProtocolFee is a paid mutator transaction binding the contract method 0x668fb6dc. -// -// Solidity: function withdrawProtocolFee(address treasuryAddress) returns() -func (_Providerregistry *ProviderregistryTransactorSession) WithdrawProtocolFee(treasuryAddress common.Address) (*types.Transaction, error) { - return _Providerregistry.Contract.WithdrawProtocolFee(&_Providerregistry.TransactOpts, treasuryAddress) -} - // Fallback is a paid mutator transaction binding the contract fallback function. // // Solidity: fallback() payable returns() @@ -1176,6 +1169,295 @@ func (_Providerregistry *ProviderregistryTransactorSession) Receive() (*types.Tr return _Providerregistry.Contract.Receive(&_Providerregistry.TransactOpts) } +// ProviderregistryFeePayoutPeriodBlocksUpdatedIterator is returned from FilterFeePayoutPeriodBlocksUpdated and is used to iterate over the raw logs and unpacked data for FeePayoutPeriodBlocksUpdated events raised by the Providerregistry contract. +type ProviderregistryFeePayoutPeriodBlocksUpdatedIterator struct { + Event *ProviderregistryFeePayoutPeriodBlocksUpdated // 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 *ProviderregistryFeePayoutPeriodBlocksUpdatedIterator) 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(ProviderregistryFeePayoutPeriodBlocksUpdated) + 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(ProviderregistryFeePayoutPeriodBlocksUpdated) + 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 *ProviderregistryFeePayoutPeriodBlocksUpdatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ProviderregistryFeePayoutPeriodBlocksUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ProviderregistryFeePayoutPeriodBlocksUpdated represents a FeePayoutPeriodBlocksUpdated event raised by the Providerregistry contract. +type ProviderregistryFeePayoutPeriodBlocksUpdated struct { + NewFeePayoutPeriodBlocks *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterFeePayoutPeriodBlocksUpdated is a free log retrieval operation binding the contract event 0x1b8b3f7fd7594ce5b7155b4c56b19bd6a1eac8c1ec5d941635acf104c8db3571. +// +// Solidity: event FeePayoutPeriodBlocksUpdated(uint256 indexed newFeePayoutPeriodBlocks) +func (_Providerregistry *ProviderregistryFilterer) FilterFeePayoutPeriodBlocksUpdated(opts *bind.FilterOpts, newFeePayoutPeriodBlocks []*big.Int) (*ProviderregistryFeePayoutPeriodBlocksUpdatedIterator, error) { + + var newFeePayoutPeriodBlocksRule []interface{} + for _, newFeePayoutPeriodBlocksItem := range newFeePayoutPeriodBlocks { + newFeePayoutPeriodBlocksRule = append(newFeePayoutPeriodBlocksRule, newFeePayoutPeriodBlocksItem) + } + + logs, sub, err := _Providerregistry.contract.FilterLogs(opts, "FeePayoutPeriodBlocksUpdated", newFeePayoutPeriodBlocksRule) + if err != nil { + return nil, err + } + return &ProviderregistryFeePayoutPeriodBlocksUpdatedIterator{contract: _Providerregistry.contract, event: "FeePayoutPeriodBlocksUpdated", logs: logs, sub: sub}, nil +} + +// WatchFeePayoutPeriodBlocksUpdated is a free log subscription operation binding the contract event 0x1b8b3f7fd7594ce5b7155b4c56b19bd6a1eac8c1ec5d941635acf104c8db3571. +// +// Solidity: event FeePayoutPeriodBlocksUpdated(uint256 indexed newFeePayoutPeriodBlocks) +func (_Providerregistry *ProviderregistryFilterer) WatchFeePayoutPeriodBlocksUpdated(opts *bind.WatchOpts, sink chan<- *ProviderregistryFeePayoutPeriodBlocksUpdated, newFeePayoutPeriodBlocks []*big.Int) (event.Subscription, error) { + + var newFeePayoutPeriodBlocksRule []interface{} + for _, newFeePayoutPeriodBlocksItem := range newFeePayoutPeriodBlocks { + newFeePayoutPeriodBlocksRule = append(newFeePayoutPeriodBlocksRule, newFeePayoutPeriodBlocksItem) + } + + logs, sub, err := _Providerregistry.contract.WatchLogs(opts, "FeePayoutPeriodBlocksUpdated", newFeePayoutPeriodBlocksRule) + 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(ProviderregistryFeePayoutPeriodBlocksUpdated) + if err := _Providerregistry.contract.UnpackLog(event, "FeePayoutPeriodBlocksUpdated", 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 +} + +// ParseFeePayoutPeriodBlocksUpdated is a log parse operation binding the contract event 0x1b8b3f7fd7594ce5b7155b4c56b19bd6a1eac8c1ec5d941635acf104c8db3571. +// +// Solidity: event FeePayoutPeriodBlocksUpdated(uint256 indexed newFeePayoutPeriodBlocks) +func (_Providerregistry *ProviderregistryFilterer) ParseFeePayoutPeriodBlocksUpdated(log types.Log) (*ProviderregistryFeePayoutPeriodBlocksUpdated, error) { + event := new(ProviderregistryFeePayoutPeriodBlocksUpdated) + if err := _Providerregistry.contract.UnpackLog(event, "FeePayoutPeriodBlocksUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// ProviderregistryFeeTransferIterator is returned from FilterFeeTransfer and is used to iterate over the raw logs and unpacked data for FeeTransfer events raised by the Providerregistry contract. +type ProviderregistryFeeTransferIterator struct { + Event *ProviderregistryFeeTransfer // 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 *ProviderregistryFeeTransferIterator) 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(ProviderregistryFeeTransfer) + 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(ProviderregistryFeeTransfer) + 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 *ProviderregistryFeeTransferIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ProviderregistryFeeTransferIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ProviderregistryFeeTransfer represents a FeeTransfer event raised by the Providerregistry contract. +type ProviderregistryFeeTransfer struct { + Amount *big.Int + Recipient common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterFeeTransfer is a free log retrieval operation binding the contract event 0x445bb6587d6cd09e272a0d1e5179e772b547dbf1041b6163f86bb62e86f25031. +// +// Solidity: event FeeTransfer(uint256 amount, address indexed recipient) +func (_Providerregistry *ProviderregistryFilterer) FilterFeeTransfer(opts *bind.FilterOpts, recipient []common.Address) (*ProviderregistryFeeTransferIterator, error) { + + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _Providerregistry.contract.FilterLogs(opts, "FeeTransfer", recipientRule) + if err != nil { + return nil, err + } + return &ProviderregistryFeeTransferIterator{contract: _Providerregistry.contract, event: "FeeTransfer", logs: logs, sub: sub}, nil +} + +// WatchFeeTransfer is a free log subscription operation binding the contract event 0x445bb6587d6cd09e272a0d1e5179e772b547dbf1041b6163f86bb62e86f25031. +// +// Solidity: event FeeTransfer(uint256 amount, address indexed recipient) +func (_Providerregistry *ProviderregistryFilterer) WatchFeeTransfer(opts *bind.WatchOpts, sink chan<- *ProviderregistryFeeTransfer, recipient []common.Address) (event.Subscription, error) { + + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _Providerregistry.contract.WatchLogs(opts, "FeeTransfer", recipientRule) + 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(ProviderregistryFeeTransfer) + if err := _Providerregistry.contract.UnpackLog(event, "FeeTransfer", 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 +} + +// ParseFeeTransfer is a log parse operation binding the contract event 0x445bb6587d6cd09e272a0d1e5179e772b547dbf1041b6163f86bb62e86f25031. +// +// Solidity: event FeeTransfer(uint256 amount, address indexed recipient) +func (_Providerregistry *ProviderregistryFilterer) ParseFeeTransfer(log types.Log) (*ProviderregistryFeeTransfer, error) { + event := new(ProviderregistryFeeTransfer) + if err := _Providerregistry.contract.UnpackLog(event, "FeeTransfer", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + // ProviderregistryFundsDepositedIterator is returned from FilterFundsDeposited and is used to iterate over the raw logs and unpacked data for FundsDeposited events raised by the Providerregistry contract. type ProviderregistryFundsDepositedIterator struct { Event *ProviderregistryFundsDeposited // Event containing the contract specifics and raw log @@ -1906,6 +2188,150 @@ func (_Providerregistry *ProviderregistryFilterer) ParseOwnershipTransferred(log return event, nil } +// ProviderregistryProtocolFeeRecipientUpdatedIterator is returned from FilterProtocolFeeRecipientUpdated and is used to iterate over the raw logs and unpacked data for ProtocolFeeRecipientUpdated events raised by the Providerregistry contract. +type ProviderregistryProtocolFeeRecipientUpdatedIterator struct { + Event *ProviderregistryProtocolFeeRecipientUpdated // 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 *ProviderregistryProtocolFeeRecipientUpdatedIterator) 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(ProviderregistryProtocolFeeRecipientUpdated) + 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(ProviderregistryProtocolFeeRecipientUpdated) + 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 *ProviderregistryProtocolFeeRecipientUpdatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ProviderregistryProtocolFeeRecipientUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ProviderregistryProtocolFeeRecipientUpdated represents a ProtocolFeeRecipientUpdated event raised by the Providerregistry contract. +type ProviderregistryProtocolFeeRecipientUpdated struct { + NewProtocolFeeRecipient common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterProtocolFeeRecipientUpdated is a free log retrieval operation binding the contract event 0xc1b5345cce283376356748dc57f2dfa7120431d016fc7ca9ba641bc65f91411d. +// +// Solidity: event ProtocolFeeRecipientUpdated(address indexed newProtocolFeeRecipient) +func (_Providerregistry *ProviderregistryFilterer) FilterProtocolFeeRecipientUpdated(opts *bind.FilterOpts, newProtocolFeeRecipient []common.Address) (*ProviderregistryProtocolFeeRecipientUpdatedIterator, error) { + + var newProtocolFeeRecipientRule []interface{} + for _, newProtocolFeeRecipientItem := range newProtocolFeeRecipient { + newProtocolFeeRecipientRule = append(newProtocolFeeRecipientRule, newProtocolFeeRecipientItem) + } + + logs, sub, err := _Providerregistry.contract.FilterLogs(opts, "ProtocolFeeRecipientUpdated", newProtocolFeeRecipientRule) + if err != nil { + return nil, err + } + return &ProviderregistryProtocolFeeRecipientUpdatedIterator{contract: _Providerregistry.contract, event: "ProtocolFeeRecipientUpdated", logs: logs, sub: sub}, nil +} + +// WatchProtocolFeeRecipientUpdated is a free log subscription operation binding the contract event 0xc1b5345cce283376356748dc57f2dfa7120431d016fc7ca9ba641bc65f91411d. +// +// Solidity: event ProtocolFeeRecipientUpdated(address indexed newProtocolFeeRecipient) +func (_Providerregistry *ProviderregistryFilterer) WatchProtocolFeeRecipientUpdated(opts *bind.WatchOpts, sink chan<- *ProviderregistryProtocolFeeRecipientUpdated, newProtocolFeeRecipient []common.Address) (event.Subscription, error) { + + var newProtocolFeeRecipientRule []interface{} + for _, newProtocolFeeRecipientItem := range newProtocolFeeRecipient { + newProtocolFeeRecipientRule = append(newProtocolFeeRecipientRule, newProtocolFeeRecipientItem) + } + + logs, sub, err := _Providerregistry.contract.WatchLogs(opts, "ProtocolFeeRecipientUpdated", newProtocolFeeRecipientRule) + 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(ProviderregistryProtocolFeeRecipientUpdated) + if err := _Providerregistry.contract.UnpackLog(event, "ProtocolFeeRecipientUpdated", 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 +} + +// ParseProtocolFeeRecipientUpdated is a log parse operation binding the contract event 0xc1b5345cce283376356748dc57f2dfa7120431d016fc7ca9ba641bc65f91411d. +// +// Solidity: event ProtocolFeeRecipientUpdated(address indexed newProtocolFeeRecipient) +func (_Providerregistry *ProviderregistryFilterer) ParseProtocolFeeRecipientUpdated(log types.Log) (*ProviderregistryProtocolFeeRecipientUpdated, error) { + event := new(ProviderregistryProtocolFeeRecipientUpdated) + if err := _Providerregistry.contract.UnpackLog(event, "ProtocolFeeRecipientUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + // ProviderregistryProviderRegisteredIterator is returned from FilterProviderRegistered and is used to iterate over the raw logs and unpacked data for ProviderRegistered events raised by the Providerregistry contract. type ProviderregistryProviderRegisteredIterator struct { Event *ProviderregistryProviderRegistered // Event containing the contract specifics and raw log diff --git a/contracts/contracts/BidderRegistry.sol b/contracts/contracts/BidderRegistry.sol index 2ebd70e6e..c1fa586d7 100644 --- a/contracts/contracts/BidderRegistry.sol +++ b/contracts/contracts/BidderRegistry.sol @@ -4,10 +4,10 @@ pragma solidity 0.8.20; import {Ownable2StepUpgradeable} from "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol"; import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; import {ReentrancyGuardUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol"; - import {IBidderRegistry} from "./interfaces/IBidderRegistry.sol"; import {IBlockTracker} from "./interfaces/IBlockTracker.sol"; import {WindowFromBlockNumber} from "./utils/WindowFromBlockNumber.sol"; +import {FeePayout} from "./utils/FeePayout.sol"; /// @title Bidder Registry /// @author Kartik Chopra @@ -18,16 +18,12 @@ contract BidderRegistry is ReentrancyGuardUpgradeable, UUPSUpgradeable { + using FeePayout for FeePayout.Tracker; + /// @dev For improved precision uint256 constant public PRECISION = 10 ** 25; uint256 constant public PERCENT = 100 * PRECISION; - /// @dev Amount assigned to feeRecipient - uint256 public feeRecipientAmount; - - /// @dev protocol fee, left over amount when there is no fee recipient assigned - uint256 public protocolFeeAmount; - /// @dev Address of the pre-confirmations contract address public preConfirmationsContract; @@ -37,8 +33,8 @@ contract BidderRegistry is /// @dev Block tracker contract IBlockTracker public blockTrackerContract; - /// @dev Fee recipient - address public feeRecipient; + /// Struct enabling automatic protocol fee payouts + FeePayout.Tracker public protocolFeeTracker; /// @dev Mapping for if bidder is registered mapping(address => bool) public bidderRegistered; @@ -92,6 +88,12 @@ contract BidderRegistry is uint256 indexed amount ); + /// @dev Event emitted when the protocol fee recipient is updated + event ProtocolFeeRecipientUpdated(address indexed newProtocolFeeRecipient); + + /// @dev Event emitted when the fee payout period in blocks is updated + event FeePayoutPeriodBlocksUpdated(uint256 indexed newFeePayoutPeriodBlocks); + /** * @dev Modifier to restrict a function to only be callable by the pre-confirmations contract. */ @@ -105,20 +107,22 @@ contract BidderRegistry is /** * @dev Initializes the contract with a minimum deposit requirement. - * @param _feeRecipient The address that receives fee + * @param _protocolFeeRecipient The address that accumulates protocol fees * @param _feePercent The fee percentage for protocol * @param _owner Owner of the contract, explicitly needed since contract is deployed w/ create2 factory. * @param _blockTracker The address of the block tracker contract. * @param _blocksPerWindow The number of blocks per window. + * @param _feePayoutPeriodBlocks The number of blocks for the fee payout period */ function initialize( - address _feeRecipient, + address _protocolFeeRecipient, uint16 _feePercent, address _owner, address _blockTracker, - uint256 _blocksPerWindow + uint256 _blocksPerWindow, + uint256 _feePayoutPeriodBlocks ) external initializer { - feeRecipient = _feeRecipient; + FeePayout.init(protocolFeeTracker, _protocolFeeRecipient, _feePayoutPeriodBlocks); feePercent = _feePercent; blockTrackerContract = IBlockTracker(_blockTracker); blocksPerWindow = _blocksPerWindow; @@ -272,10 +276,9 @@ contract BidderRegistry is PERCENT; uint256 amtMinusFeeAndDecay = decayedAmt - feeAmt; - if (feeRecipient != address(0)) { - feeRecipientAmount += feeAmt; - } else { - protocolFeeAmount += feeAmt; + protocolFeeTracker.accumulatedAmount += feeAmt; + if (FeePayout.isPayoutDue(protocolFeeTracker)) { + FeePayout.transferToRecipient(protocolFeeTracker); } providerAmount[provider] += amtMinusFeeAndDecay; @@ -376,10 +379,11 @@ contract BidderRegistry is /** * @notice Sets the new fee recipient * @dev onlyOwner restriction - * @param newFeeRecipient The address to transfer the slashed funds to. + * @param newProtocolFeeRecipient The new address to accumulate protocol fees */ - function setNewFeeRecipient(address newFeeRecipient) external onlyOwner { - feeRecipient = newFeeRecipient; + function setNewProtocolFeeRecipient(address newProtocolFeeRecipient) external onlyOwner { + protocolFeeTracker.recipient = newProtocolFeeRecipient; + emit ProtocolFeeRecipientUpdated(newProtocolFeeRecipient); } /** @@ -391,15 +395,14 @@ contract BidderRegistry is feePercent = newFeePercent; } - /** - * @dev Withdraw funds to the fee recipient. + /** + * @notice Sets the new fee payout period in blocks + * @dev onlyOwner restriction + * @param newFeePayoutPeriodBlocks The new fee payout period in blocks */ - function withdrawFeeRecipientAmount() external nonReentrant { - uint256 amount = feeRecipientAmount; - feeRecipientAmount = 0; - require(amount != 0, "fee amount is zero"); - (bool successFee, ) = feeRecipient.call{value: amount}(""); - require(successFee, "fee transfer failed"); + function setNewFeePayoutPeriodBlocks(uint256 newFeePayoutPeriodBlocks) external onlyOwner { + protocolFeeTracker.payoutPeriodBlocks = newFeePayoutPeriodBlocks; + emit FeePayoutPeriodBlocksUpdated(newFeePayoutPeriodBlocks); } /** @@ -451,17 +454,11 @@ contract BidderRegistry is } /** - * @dev Withdraw protocol fee. - * @param treasuryAddress The address of the treasury. + * @dev Manually withdraws accumulated protocol fees to the recipient + * to cover the edge case that oracle doesn't slash/reward, and funds still need to be withdrawn. */ - function withdrawProtocolFee( - address payable treasuryAddress - ) external onlyOwner nonReentrant { - uint256 _protocolFeeAmount = protocolFeeAmount; - protocolFeeAmount = 0; - require(_protocolFeeAmount != 0, "insufficient protocol fee amount"); - (bool success, ) = treasuryAddress.call{value: _protocolFeeAmount}(""); - require(success, "transfer failed"); + function manuallyWithdrawProtocolFee() external onlyOwner { + FeePayout.transferToRecipient(protocolFeeTracker); } /** @@ -474,13 +471,6 @@ contract BidderRegistry is return providerAmount[provider]; } - /** - * @dev Get the amount assigned to the fee recipient (treasury). - */ - function getFeeRecipientAmount() external view onlyOwner returns (uint256) { - return feeRecipientAmount; - } - /** * @dev Check the deposit of a bidder. * @param bidder The address of the bidder. @@ -494,6 +484,11 @@ contract BidderRegistry is return lockedFunds[bidder][window]; } + /// @return protocolFee amount not yet transferred to recipient + function getAccumulatedProtocolFee() external view returns (uint256) { + return protocolFeeTracker.accumulatedAmount; + } + // solhint-disable-next-line no-empty-blocks function _authorizeUpgrade(address) internal override onlyOwner {} } diff --git a/contracts/contracts/PreConfCommitmentStore.sol b/contracts/contracts/PreConfCommitmentStore.sol index b78e9081a..6c34d855d 100644 --- a/contracts/contracts/PreConfCommitmentStore.sol +++ b/contracts/contracts/PreConfCommitmentStore.sol @@ -57,8 +57,8 @@ contract PreConfCommitmentStore is IPreConfCommitmentStore, Ownable2StepUpgradea // Represents the dispatch window in milliseconds uint64 public commitmentDispatchWindow; - /// @dev Address of the oracle - address public oracle; + /// @dev Address of the oracle contract + address public oracleContract; /// @dev The number of blocks per window uint256 public blocksPerWindow; @@ -84,10 +84,10 @@ contract PreConfCommitmentStore is IPreConfCommitmentStore, Ownable2StepUpgradea mapping(bytes32 => EncrPreConfCommitment) public encryptedCommitments; /** - * @dev Makes sure transaction sender is oracle + * @dev Makes sure transaction sender is oracle contract */ - modifier onlyOracle() { - require(msg.sender == oracle, "sender is not oracle"); + modifier onlyOracleContract() { + require(msg.sender == oracleContract, "sender is not oracle contract"); _; } @@ -95,29 +95,28 @@ contract PreConfCommitmentStore is IPreConfCommitmentStore, Ownable2StepUpgradea * @dev Initializes the contract with the specified registry addresses, oracle, name, and version. * @param _providerRegistry The address of the provider registry. * @param _bidderRegistry The address of the bidder registry. - * @param _blockTracker The address of the block tracker. - * @param _oracle The address of the oracle. + * @param _oracleContract The address of the oracle contract. * @param _owner Owner of the contract, explicitly needed since contract is deployed w/ create2 factory. + * @param _blockTracker The address of the block tracker. * @param _commitmentDispatchWindow The dispatch window for commitments. * @param _blocksPerWindow The number of blocks per window. */ function initialize( address _providerRegistry, address _bidderRegistry, - address _oracle, + address _oracleContract, address _owner, address _blockTracker, uint64 _commitmentDispatchWindow, uint256 _blocksPerWindow ) external initializer { - oracle = _oracle; - blockTracker = IBlockTracker(_blockTracker); providerRegistry = IProviderRegistry(_providerRegistry); bidderRegistry = IBidderRegistry(_bidderRegistry); - blocksPerWindow = _blocksPerWindow; + oracleContract = _oracleContract; __Ownable_init(_owner); - + blockTracker = IBlockTracker(_blockTracker); commitmentDispatchWindow = _commitmentDispatchWindow; + blocksPerWindow = _blocksPerWindow; } /// @dev See https://docs.openzeppelin.com/upgrades-plugins/1.x/writing-upgradeable#initializing_the_implementation_contract @@ -151,11 +150,11 @@ contract PreConfCommitmentStore is IPreConfCommitmentStore, Ownable2StepUpgradea } /** - * @dev Updates the address of the oracle. - * @param newOracle The new oracle address. + * @dev Updates the address of the oracle contract. + * @param newOracleContract The new oracle contract address. */ - function updateOracle(address newOracle) external onlyOwner { - oracle = newOracle; + function updateOracleContract(address newOracleContract) external onlyOwner { + oracleContract = newOracleContract; } /** @@ -361,7 +360,7 @@ contract PreConfCommitmentStore is IPreConfCommitmentStore, Ownable2StepUpgradea function initiateSlash( bytes32 commitmentIndex, uint256 residualBidPercentAfterDecay - ) public onlyOracle { + ) public onlyOracleContract { PreConfCommitment storage commitment = commitments[commitmentIndex]; require(!commitment.isUsed, "Commitment already used"); @@ -390,7 +389,7 @@ contract PreConfCommitmentStore is IPreConfCommitmentStore, Ownable2StepUpgradea function initiateReward( bytes32 commitmentIndex, uint256 residualBidPercentAfterDecay - ) public onlyOracle { + ) public onlyOracleContract { PreConfCommitment storage commitment = commitments[commitmentIndex]; require(!commitment.isUsed, "Commitment already used"); diff --git a/contracts/contracts/ProviderRegistry.sol b/contracts/contracts/ProviderRegistry.sol index 220da655c..abfca4b34 100644 --- a/contracts/contracts/ProviderRegistry.sol +++ b/contracts/contracts/ProviderRegistry.sol @@ -4,9 +4,9 @@ pragma solidity 0.8.20; import {Ownable2StepUpgradeable} from "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol"; import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; import {ReentrancyGuardUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol"; - import {PreConfCommitmentStore} from "./PreConfCommitmentStore.sol"; import {IProviderRegistry} from "./interfaces/IProviderRegistry.sol"; +import {FeePayout} from "./utils/FeePayout.sol"; /// @title Provider Registry /// @author Kartik Chopra @@ -17,6 +17,8 @@ contract ProviderRegistry is UUPSUpgradeable, ReentrancyGuardUpgradeable { + using FeePayout for FeePayout.Tracker; + /// @dev For improved precision uint256 public constant PRECISION = 10 ** 25; uint256 public constant PERCENT = 100 * PRECISION; @@ -24,24 +26,18 @@ contract ProviderRegistry is /// @dev Minimum stake required for registration uint256 public minStake; - /// @dev Amount assigned to feeRecipient - uint256 public feeRecipientAmount; - - /// @dev Amount assigned to protocol fee - uint256 public protocolFeeAmount; - /// @dev Address of the pre-confirmations contract address public preConfirmationsContract; /// @dev Fee percent that would be taken by protocol when provider is slashed uint16 public feePercent; - /// @dev Fee recipient - address public feeRecipient; - /// @dev Configurable withdrawal delay in milliseconds uint256 public withdrawalDelay; + /// Struct enabling automatic protocol fee payouts + FeePayout.Tracker public protocolFeeTracker; + /// @dev Mapping from provider address to whether they are registered or not mapping(address => bool) public providerRegistered; /// @dev Mapping from a provider's EOA address to their BLS public key @@ -63,6 +59,10 @@ contract ProviderRegistry is event Withdraw(address indexed provider, uint256 amount); /// @dev Event emitted when the withdrawal delay is updated event WithdrawalDelayUpdated(uint256 newWithdrawalDelay); + /// @dev Event emitted when the protocol fee recipient is updated + event ProtocolFeeRecipientUpdated(address indexed newProtocolFeeRecipient); + /// @dev Event emitted when the fee payout period in blocks is updated + event FeePayoutPeriodBlocksUpdated(uint256 indexed newFeePayoutPeriodBlocks); /** * @dev Modifier to restrict a function to only be callable by the pre-confirmations contract. @@ -78,20 +78,22 @@ contract ProviderRegistry is /** * @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 _protocolFeeRecipient The address that accumulates protocol fees * @param _feePercent The fee percentage for protocol * @param _owner Owner of the contract, explicitly needed since contract is deployed w/ create2 factory. * @param _withdrawalDelay The withdrawal delay in milliseconds. + * @param _protocolFeePayoutPeriodBlocks The min number of blocks between protocol fee payouts */ function initialize( uint256 _minStake, - address _feeRecipient, + address _protocolFeeRecipient, uint16 _feePercent, address _owner, - uint256 _withdrawalDelay + uint256 _withdrawalDelay, + uint256 _protocolFeePayoutPeriodBlocks ) external initializer { + FeePayout.init(protocolFeeTracker, _protocolFeeRecipient, _protocolFeePayoutPeriodBlocks); minStake = _minStake; - feeRecipient = _feeRecipient; feePercent = _feePercent; withdrawalDelay = _withdrawalDelay; __Ownable_init(_owner); @@ -163,10 +165,9 @@ contract ProviderRegistry is uint256 feeAmt = (residualAmt * uint256(feePercent) * PRECISION) / PERCENT; uint256 amtMinusFee = residualAmt - feeAmt; - if (feeRecipient != address(0)) { - feeRecipientAmount += feeAmt; - } else { - protocolFeeAmount += feeAmt; + protocolFeeTracker.accumulatedAmount += feeAmt; + if (FeePayout.isPayoutDue(protocolFeeTracker)) { + FeePayout.transferToRecipient(protocolFeeTracker); } (bool success, ) = payable(bidder).call{value: amtMinusFee}(""); @@ -176,12 +177,13 @@ contract ProviderRegistry is } /** - * @notice Sets the new fee recipient + * @notice Sets a new protocol fee recipient * @dev onlyOwner restriction - * @param newFeeRecipient The address to transfer the slashed funds to. + * @param newFeeRecipient The address of the new protocol fee recipient */ - function setNewFeeRecipient(address newFeeRecipient) external onlyOwner { - feeRecipient = newFeeRecipient; + function setNewProtocolFeeRecipient(address newFeeRecipient) external onlyOwner { + protocolFeeTracker.recipient = newFeeRecipient; + emit ProtocolFeeRecipientUpdated(newFeeRecipient); } /** @@ -201,13 +203,11 @@ contract ProviderRegistry is emit WithdrawalDelayUpdated(_withdrawalDelay); } - /** - * @dev Reward funds to the fee receipt. - */ - function withdrawFeeRecipientAmount() external nonReentrant { - feeRecipientAmount = 0; - (bool successFee, ) = feeRecipient.call{value: feeRecipientAmount}(""); - require(successFee, "fee recipient transfer failed"); + /// @dev Sets the fee payout period in blocks + /// @param _feePayoutPeriodBlocks The new fee payout period in blocks + function setFeePayoutPeriodBlocks(uint256 _feePayoutPeriodBlocks) external onlyOwner { + protocolFeeTracker.payoutPeriodBlocks = _feePayoutPeriodBlocks; + emit FeePayoutPeriodBlocksUpdated(_feePayoutPeriodBlocks); } /// @dev Requests unstake of the staked amount. @@ -242,17 +242,11 @@ contract ProviderRegistry is } /** - * @dev Withdraw protocol fee. - * @param treasuryAddress The address of the treasury. + * @dev Manually withdraws accumulated protocol fees to the recipient + * to cover the edge case that oracle doesn't slash/reward, and funds still need to be withdrawn. */ - function withdrawProtocolFee( - address payable treasuryAddress - ) external onlyOwner nonReentrant { - uint256 _protocolFeeAmount = protocolFeeAmount; - protocolFeeAmount = 0; - require(_protocolFeeAmount != 0, "insufficient protocol fee amount"); - (bool success, ) = treasuryAddress.call{value: _protocolFeeAmount}(""); - require(success, "transfer failed"); + function manuallyWithdrawProtocolFee() external onlyOwner { + FeePayout.transferToRecipient(protocolFeeTracker); } /** @@ -269,6 +263,11 @@ contract ProviderRegistry is return eoaToBlsPubkey[provider]; } + /// @return protocolFee amount not yet transferred to recipient + function getAccumulatedProtocolFee() external view returns (uint256) { + return protocolFeeTracker.accumulatedAmount; + } + /** * @dev Register and stake function for providers. * @param blsPublicKey The BLS public key of the provider. diff --git a/contracts/contracts/interfaces/IPreConfCommitmentStore.sol b/contracts/contracts/interfaces/IPreConfCommitmentStore.sol index dd464f56d..53602e8f4 100644 --- a/contracts/contracts/interfaces/IPreConfCommitmentStore.sol +++ b/contracts/contracts/interfaces/IPreConfCommitmentStore.sol @@ -113,10 +113,10 @@ interface IPreConfCommitmentStore { function updateCommitmentDispatchWindow(uint64 newDispatchWindow) external; /** - * @dev Updates the address of the oracle. - * @param newOracle The new oracle address. + * @dev Updates the address of the oracle contract. + * @param newOracleContract The new oracle contract address. */ - function updateOracle(address newOracle) external; + function updateOracleContract(address newOracleContract) external; /** * @dev Updates the address of the bidder registry. diff --git a/contracts/contracts/utils/FeePayout.sol b/contracts/contracts/utils/FeePayout.sol new file mode 100644 index 000000000..1e3db39b4 --- /dev/null +++ b/contracts/contracts/utils/FeePayout.sol @@ -0,0 +1,47 @@ +// SPDX-License-Identifier: BSL 1.1 +pragma solidity 0.8.20; + +library FeePayout { + + struct Tracker { + /// @dev Address that accumulates fees + address recipient; + /// @dev Accumulated fees since last payout + uint256 accumulatedAmount; + /// @dev Block number when the last fee payout was made + uint256 lastPayoutBlock; + /// @dev Min number of blocks between payouts + uint256 payoutPeriodBlocks; + } + + /// @dev Event emitted when fees are transferred to the recipient. + event FeeTransfer(uint256 amount, address indexed recipient); + + /// @dev Initialize a new fee tracker in storage + function init(Tracker storage self, address _recipient, uint256 _payoutPeriodBlocks) internal { + require(_recipient != address(0), "fee recipient is zero"); + require(_payoutPeriodBlocks != 0, "pay period must be positive"); + self.recipient = _recipient; + self.accumulatedAmount = 0; + self.lastPayoutBlock = block.number; + self.payoutPeriodBlocks = _payoutPeriodBlocks; + } + + /// @dev Transfers the accumulated fees to the recipient and resets the tracker + /// @param tracker The FeePayout.Tracker struct + function transferToRecipient(Tracker storage tracker) internal { + uint256 amountToPay = tracker.accumulatedAmount; + (bool success, ) = payable(tracker.recipient).call{value: amountToPay}(""); + require(success, "transfer to recipient failed"); + tracker.accumulatedAmount = 0; + tracker.lastPayoutBlock = block.number; + emit FeeTransfer(amountToPay, tracker.recipient); + } + + /// @dev Checks if a fee payout is due + /// @param tracker The FeePayout.Tracker struct + /// @return true if a payout is due, false otherwise + function isPayoutDue(Tracker storage tracker) internal view returns (bool) { + return block.number > tracker.lastPayoutBlock + tracker.payoutPeriodBlocks; + } +} diff --git a/contracts/scripts/DeployScripts.s.sol b/contracts/scripts/DeployScripts.s.sol index 1b79e44cd..60aef78b0 100644 --- a/contracts/scripts/DeployScripts.s.sol +++ b/contracts/scripts/DeployScripts.s.sol @@ -20,42 +20,64 @@ contract DeployScript is Script { function run() external { vm.startBroadcast(); - // Replace these with your contract's constructor parameters uint256 minStake = 1 ether; - address feeRecipient = address( - 0x68bC10674b265f266b4b1F079Fa06eF4045c3ab9 + address protocolFeeRecipient = address( + 0xfA0B0f5d298d28EFE4d35641724141ef19C05684 // Placeholder for now, L1 preconf.eth address ); uint16 feePercent = 2; uint64 commitmentDispatchWindow = 2000; uint256 blocksPerWindow = 10; uint256 withdrawalDelay = 24 * 3600 * 1000; // 24 hours in milliseconds + uint256 protocolFeePayoutPeriodBlocks = 5 * 3600; // 1 hour with 200ms blocks address oracleKeystoreAddress = vm.envAddress("ORACLE_KEYSTORE_ADDRESS"); require(oracleKeystoreAddress != address(0), "missing Oracle keystore address"); address blockTrackerProxy = Upgrades.deployUUPSProxy( "BlockTracker.sol", - abi.encodeCall(BlockTracker.initialize, (blocksPerWindow, oracleKeystoreAddress, msg.sender)) + abi.encodeCall(BlockTracker.initialize, + (blocksPerWindow, // blocksPerWindow_ param + oracleKeystoreAddress, // oracleAccount_ param + msg.sender)) // owner_ param ); BlockTracker blockTracker = BlockTracker(payable(blockTrackerProxy)); console.log("BlockTracker:", address(blockTracker)); address bidderRegistryProxy = Upgrades.deployUUPSProxy( "BidderRegistry.sol", - abi.encodeCall(BidderRegistry.initialize, (feeRecipient, feePercent, msg.sender, address(blockTracker), blocksPerWindow)) + abi.encodeCall(BidderRegistry.initialize, + (protocolFeeRecipient, // _protocolFeeRecipient param + feePercent, // _feePercent param + msg.sender, // _owner param + address(blockTracker), // _blockTracker param + blocksPerWindow, // _blocksPerWindow param + protocolFeePayoutPeriodBlocks)) // _protocolFeePayoutPeriodBlocks param ); BidderRegistry bidderRegistry = BidderRegistry(payable(bidderRegistryProxy)); console.log("BidderRegistry:", address(bidderRegistry)); address providerRegistryProxy = Upgrades.deployUUPSProxy( "ProviderRegistry.sol", - abi.encodeCall(ProviderRegistry.initialize, (minStake, feeRecipient, feePercent, msg.sender, withdrawalDelay)) + abi.encodeCall(ProviderRegistry.initialize, + (minStake, // _minStake param + protocolFeeRecipient, // _protocolFeeRecipient param + feePercent, // _feePercent param + msg.sender, // _owner param + withdrawalDelay, // _withdrawalDelay param + protocolFeePayoutPeriodBlocks)) // _protocolFeePayoutPeriodBlocks param ); ProviderRegistry providerRegistry = ProviderRegistry(payable(providerRegistryProxy)); console.log("ProviderRegistry:", address(providerRegistry)); address preconfCommitmentStoreProxy = Upgrades.deployUUPSProxy( "PreConfCommitmentStore.sol", - abi.encodeCall(PreConfCommitmentStore.initialize, (address(providerRegistry), address(bidderRegistry), feeRecipient, msg.sender, address(blockTracker), commitmentDispatchWindow, blocksPerWindow)) + abi.encodeCall(PreConfCommitmentStore.initialize, + (address(providerRegistry), // _providerRegistry param + address(bidderRegistry), // _bidderRegistry param + address(0x0), // _oracleContract param, updated later in script. + msg.sender, // _owner param + address(blockTracker), // _blockTracker param + commitmentDispatchWindow, // _commitmentDispatchWindow param + blocksPerWindow)) // _blocksPerWindow param ); PreConfCommitmentStore preConfCommitmentStore = PreConfCommitmentStore(payable(preconfCommitmentStoreProxy)); console.log("PreConfCommitmentStore:", address(preConfCommitmentStore)); @@ -72,12 +94,16 @@ contract DeployScript is Script { address oracleProxy = Upgrades.deployUUPSProxy( "Oracle.sol", - abi.encodeCall(Oracle.initialize, (address(preConfCommitmentStore), address(blockTracker), oracleKeystoreAddress, msg.sender)) + abi.encodeCall(Oracle.initialize, + (address(preConfCommitmentStore), // preConfContract_ param + address(blockTracker), // blockTrackerContract_ param + oracleKeystoreAddress, // oracleAcount_ param + msg.sender)) // owner_ param ); Oracle oracle = Oracle(payable(oracleProxy)); console.log("Oracle:", address(oracle)); - preConfCommitmentStore.updateOracle(address(oracle)); + preConfCommitmentStore.updateOracleContract(address(oracle)); console.log("PreConfCommitmentStoreWithOracle:", address(oracle)); vm.stopBroadcast(); diff --git a/contracts/test/BidderRegistryTest.sol b/contracts/test/BidderRegistryTest.sol index fe7a44a62..95ade2f58 100644 --- a/contracts/test/BidderRegistryTest.sol +++ b/contracts/test/BidderRegistryTest.sol @@ -9,23 +9,29 @@ import {IBidderRegistry} from "../contracts/interfaces/IBidderRegistry.sol"; import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol"; contract BidderRegistryTest is Test { - uint256 testNumber; - BidderRegistry internal bidderRegistry; - uint16 internal feePercent; - uint256 internal minStake; - address internal bidder; - address internal feeRecipient; - uint256 blocksPerWindow; - BlockTracker internal blockTracker; + uint256 public testNumber; + BidderRegistry public bidderRegistry; + uint16 public feePercent; + uint256 public minStake; + address public bidder; + address public feeRecipient; + uint256 public feePayoutPeriodBlocks; + uint256 public blocksPerWindow; + BlockTracker public blockTracker; /// @dev Event emitted when a bidder is registered with their staked amount event BidderRegistered(address indexed bidder, uint256 indexed stakedAmount, uint256 indexed windowNumber); + event FeeTransfer(uint256 amount, address indexed recipient); + event ProtocolFeeRecipientUpdated(address indexed newProtocolFeeRecipient); + event FeePayoutPeriodBlocksUpdated(uint256 indexed newFeePayoutPeriodBlocks); + function setUp() public { testNumber = 42; feePercent = 10; minStake = 1e18 wei; feeRecipient = vm.addr(9); + feePayoutPeriodBlocks = 100; blocksPerWindow = 10; address blockTrackerProxy = Upgrades.deployUUPSProxy( "BlockTracker.sol", @@ -35,7 +41,7 @@ contract BidderRegistryTest is Test { address bidderRegistryProxy = Upgrades.deployUUPSProxy( "BidderRegistry.sol", - abi.encodeCall(BidderRegistry.initialize, (feeRecipient, feePercent, address(this), address(blockTracker), blocksPerWindow)) + abi.encodeCall(BidderRegistry.initialize, (feeRecipient, feePercent, address(this), address(blockTracker), blocksPerWindow, feePayoutPeriodBlocks)) ); bidderRegistry = BidderRegistry(payable(bidderRegistryProxy)); @@ -45,7 +51,11 @@ contract BidderRegistryTest is Test { } function test_VerifyInitialContractState() public view { - assertEq(bidderRegistry.feeRecipient(), feeRecipient); + (address recipient, uint256 accumulatedAmount, uint256 lastPayoutBlock, uint256 payoutPeriodBlocks) = bidderRegistry.protocolFeeTracker(); + assertEq(recipient, feeRecipient); + assertEq(payoutPeriodBlocks, feePayoutPeriodBlocks); + assertEq(lastPayoutBlock, block.number); + assertEq(accumulatedAmount, 0); assertEq(bidderRegistry.feePercent(), feePercent); assertEq(bidderRegistry.preConfirmationsContract(), address(0)); assertEq(bidderRegistry.bidderRegistered(bidder), false); @@ -89,38 +99,53 @@ contract BidderRegistryTest is Test { bidderRegistry.depositForWindow{value: 1 wei}(2); } - function testFail_receive() public { + function testFail_Receive() public { vm.prank(bidder); vm.expectRevert(bytes("")); (bool success, ) = address(bidderRegistry).call{value: 1 wei}(""); require(success, "couldn't transfer to bidder"); } - function testFail_fallback() public { + function testFail_Fallback() public { vm.prank(bidder); vm.expectRevert(bytes("")); (bool success, ) = address(bidderRegistry).call{value: 1 wei}(""); require(success, "couldn't transfer to bidder"); } - function test_SetNewFeeRecipient() public { + function test_SetNewProtocolFeeRecipient() public { address newRecipient = vm.addr(2); vm.prank(address(this)); - bidderRegistry.setNewFeeRecipient(newRecipient); - - assertEq(bidderRegistry.feeRecipient(), newRecipient); + vm.expectEmit(true, true, true, true); + emit ProtocolFeeRecipientUpdated(newRecipient); + bidderRegistry.setNewProtocolFeeRecipient(newRecipient); + (address recipient, , , ) = bidderRegistry.protocolFeeTracker(); + assertEq(recipient, newRecipient); } - function testFail_SetNewFeeRecipient() public { + function testFail_SetNewProtocolFeeRecipient() public { address newRecipient = vm.addr(2); vm.expectRevert(bytes("")); - bidderRegistry.setNewFeeRecipient(newRecipient); + bidderRegistry.setNewProtocolFeeRecipient(newRecipient); + } + + function test_SetNewFeePayoutPeriodBlocks() public { + vm.prank(address(this)); + vm.expectEmit(true, true, true, true); + emit FeePayoutPeriodBlocksUpdated(890); + bidderRegistry.setNewFeePayoutPeriodBlocks(890); + (, , , uint256 payoutPeriodBlocks) = bidderRegistry.protocolFeeTracker(); + assertEq(payoutPeriodBlocks, 890); + } + + function testFail_SetNewFeePayoutPeriodBlocks() public { + vm.expectRevert(bytes("")); + bidderRegistry.setNewFeePayoutPeriodBlocks(83424); } function test_SetNewFeePercent() public { vm.prank(address(this)); bidderRegistry.setNewFeePercent(uint16(25)); - assertEq(bidderRegistry.feePercent(), uint16(25)); } @@ -133,7 +158,6 @@ contract BidderRegistryTest is Test { vm.prank(address(this)); address newPreConfContract = vm.addr(3); bidderRegistry.setPreconfirmationsContract(newPreConfContract); - assertEq(bidderRegistry.preConfirmationsContract(), newPreConfContract); } @@ -160,12 +184,10 @@ contract BidderRegistryTest is Test { bidderRegistry.retrieveFunds(nextWindow, bidID, payable(provider), 100); uint256 providerAmount = bidderRegistry.providerAmount(provider); - uint256 feeRecipientAmount = bidderRegistry.feeRecipientAmount(); + uint256 feeRecipientAmount = bidderRegistry.getAccumulatedProtocolFee(); assertEq(providerAmount, 900000000000000000); assertEq(feeRecipientAmount, 100000000000000000); - assertEq(bidderRegistry.getFeeRecipientAmount(), 100000000000000000); - assertEq(bidderRegistry.lockedFunds(bidder, nextWindow), 63 ether); } @@ -188,11 +210,10 @@ contract BidderRegistryTest is Test { bidderRegistry.retrieveFunds(nextWindow, bidID, payable(provider), 50); uint256 providerAmount = bidderRegistry.providerAmount(provider); - uint256 feeRecipientAmount = bidderRegistry.feeRecipientAmount(); + uint256 feeRecipientAmount = bidderRegistry.getAccumulatedProtocolFee(); assertEq(providerAmount, 450000000000000000); assertEq(feeRecipientAmount, 50000000000000000); - assertEq(bidderRegistry.getFeeRecipientAmount(), 50000000000000000); assertEq(bidder.balance, bidderBalance + 500000000000000000); assertEq(bidderRegistry.lockedFunds(bidder, nextWindow), 63 ether); @@ -217,7 +238,7 @@ contract BidderRegistryTest is Test { bidderRegistry.unlockFunds(nextWindow, bidID); uint256 providerAmount = bidderRegistry.providerAmount(provider); - uint256 feeRecipientAmount = bidderRegistry.feeRecipientAmount(); + uint256 feeRecipientAmount = bidderRegistry.getAccumulatedProtocolFee(); assertEq(providerAmount, 0); assertEq(feeRecipientAmount, 0); @@ -226,35 +247,6 @@ contract BidderRegistryTest is Test { assertEq(bidderRegistry.lockedFunds(bidder, nextWindow), 63 ether); } - function test_shouldRetrieveFundsWithoutFeeRecipient() public { - vm.prank(address(this)); - uint256 feerecipientValueBefore = bidderRegistry.feeRecipientAmount(); - - bidderRegistry.setNewFeeRecipient(address(0)); - bidderRegistry.setPreconfirmationsContract(address(this)); - - uint256 currentWindow = blockTracker.getCurrentWindow(); - uint256 nextWindow = currentWindow + 1; - vm.prank(bidder); - bidderRegistry.depositForWindow{value: 64 ether}(nextWindow); - - address provider = vm.addr(4); - uint64 blockNumber = uint64(blocksPerWindow + 2); - blockTracker.addBuilderAddress("test", provider); - blockTracker.recordL1Block(blockNumber, "test"); - bytes32 bidID = keccak256("1234"); - bidderRegistry.openBid(bidID, 1 ether, bidder, blockNumber); - bidderRegistry.retrieveFunds(nextWindow, bidID, payable(provider), 100); - - uint256 feerecipientValueAfter = bidderRegistry.feeRecipientAmount(); - uint256 providerAmount = bidderRegistry.providerAmount(provider); - - assertEq(providerAmount, 900000000000000000); - assertEq(feerecipientValueAfter, feerecipientValueBefore); - - assertEq(bidderRegistry.lockedFunds(bidder, nextWindow), 63 ether); - } - function testFail_shouldRetrieveFundsNotPreConf() public { vm.prank(bidder); uint256 currentWindow = blockTracker.getCurrentWindow(); @@ -286,33 +278,6 @@ contract BidderRegistryTest is Test { bidderRegistry.retrieveFunds(nextWindow, bidID, payable(provider),100); } - function test_withdrawFeeRecipientAmount() public { - bidderRegistry.setPreconfirmationsContract(address(this)); - uint256 currentWindow = blockTracker.getCurrentWindow(); - uint256 nextWindow = currentWindow + 1; - vm.prank(bidder); - bidderRegistry.depositForWindow{value: 64 ether}(nextWindow); - address provider = vm.addr(4); - uint256 balanceBefore = feeRecipient.balance; - bytes32 bidID = keccak256("1234"); - uint64 blockNumber = uint64(blocksPerWindow + 2); - blockTracker.addBuilderAddress("test", provider); - blockTracker.recordL1Block(blockNumber, "test"); - - bidderRegistry.openBid(bidID, 1 ether, bidder, blockNumber); - bidderRegistry.retrieveFunds(nextWindow, bidID, payable(provider),100); - bidderRegistry.withdrawFeeRecipientAmount(); - uint256 balanceAfter = feeRecipient.balance; - assertEq(balanceAfter - balanceBefore, 100000000000000000); - assertEq(bidderRegistry.feeRecipientAmount(), 0); - assertEq(bidderRegistry.getFeeRecipientAmount(), 0); - } - - function testFail_withdrawFeeRecipientAmount() public { - bidderRegistry.setPreconfirmationsContract(address(this)); - bidderRegistry.withdrawFeeRecipientAmount(); - } - function test_withdrawProviderAmount() public { bidderRegistry.setPreconfirmationsContract(address(this)); uint256 currentWindow = blockTracker.getCurrentWindow(); @@ -345,50 +310,6 @@ contract BidderRegistryTest is Test { bidderRegistry.withdrawProviderAmount(payable(provider)); } - function test_withdrawProtocolFee() public { - address provider = vm.addr(4); - bidderRegistry.setPreconfirmationsContract(address(this)); - bidderRegistry.setNewFeeRecipient(address(0)); - uint256 currentWindow = blockTracker.getCurrentWindow(); - uint256 nextWindow = currentWindow + 1; - vm.prank(bidder); - bidderRegistry.depositForWindow{value: 128 ether}(nextWindow); - uint256 balanceBefore = address(bidder).balance; - bytes32 bidID = keccak256("1234"); - uint64 blockNumber = uint64(blocksPerWindow + 2); - blockTracker.addBuilderAddress("test", provider); - blockTracker.recordL1Block(blockNumber, "test"); - - bidderRegistry.openBid(bidID, 2 ether, bidder, blockNumber); - bidderRegistry.retrieveFunds(nextWindow, bidID, payable(provider), 100); - vm.prank(bidderRegistry.owner()); - bidderRegistry.withdrawProtocolFee(payable(address(bidder))); - uint256 balanceAfter = address(bidder).balance; - assertEq(balanceAfter - balanceBefore, 200000000000000000); - assertEq(bidderRegistry.protocolFeeAmount(), 0); - } - - function testFail_withdrawProtocolFee() public { - bidderRegistry.setPreconfirmationsContract(address(this)); - bidderRegistry.setNewFeeRecipient(address(0)); - vm.prank(bidder); - uint256 currentWindow = blockTracker.getCurrentWindow(); - uint256 nextWindow = currentWindow + 1; - bidderRegistry.depositForWindow{value: 5 ether}(nextWindow); - vm.prank(bidderRegistry.owner()); - bidderRegistry.withdrawProtocolFee(payable(address(bidder))); - } - - function testFail_withdrawProtocolFeeNotOwner() public { - bidderRegistry.setPreconfirmationsContract(address(this)); - bidderRegistry.setNewFeeRecipient(address(0)); - vm.prank(bidder); - uint256 currentWindow = blockTracker.getCurrentWindow(); - uint256 nextWindow = currentWindow + 1; - bidderRegistry.depositForWindow{value: 5 ether}(nextWindow); - bidderRegistry.withdrawProtocolFee(payable(address(bidder))); - } - function test_DepositForWindows() public { uint256[] memory windows = new uint256[](3); uint256 currentWindow = blockTracker.getCurrentWindow(); @@ -455,7 +376,7 @@ contract BidderRegistryTest is Test { } } - function test_openBid_transferExcessBid() public { + function test_OpenBidtransferExcessBid() public { bytes32 commitmentDigest = keccak256("commitment"); uint256 bid = 3 ether; address testBidder = vm.addr(2); @@ -493,4 +414,49 @@ contract BidderRegistryTest is Test { assertEq(storedBidAmt, expectedBid); assertEq(uint(storedState), uint(IBidderRegistry.State.PreConfirmed)); } + + function test_ProtocolFeePayout() public { + (, , uint256 lastPayoutBlock,) = bidderRegistry.protocolFeeTracker(); + assertEq(lastPayoutBlock, 1); + assertEq(bidderRegistry.getAccumulatedProtocolFee(), 0); + vm.roll(250); // roll past protocol fee payout period + + bidderRegistry.setPreconfirmationsContract(address(this)); + uint256 currentWindow = blockTracker.getCurrentWindow(); + uint256 nextWindow = currentWindow + 1; + vm.prank(bidder); + bidderRegistry.depositForWindow{value: 64 ether}(nextWindow); + address provider = vm.addr(4); + uint256 balanceBefore = feeRecipient.balance; + bytes32 bidID = keccak256("1234"); + uint64 blockNumber = uint64(blocksPerWindow + 2); + blockTracker.addBuilderAddress("test", provider); + blockTracker.recordL1Block(blockNumber, "test"); + bidderRegistry.openBid(bidID, 1 ether, bidder, blockNumber); + vm.expectEmit(true, true, true, true); + emit FeeTransfer(100000000000000000, feeRecipient); + bidderRegistry.retrieveFunds(nextWindow, bidID, payable(provider),100); + uint256 balanceAfter = feeRecipient.balance; + assertEq(balanceAfter - balanceBefore, 100000000000000000); + assertEq(bidderRegistry.getAccumulatedProtocolFee(), 0); + } + + function test_ProtocolFeeAccumulation() public { + bidderRegistry.setPreconfirmationsContract(address(this)); + uint256 currentWindow = blockTracker.getCurrentWindow(); + uint256 nextWindow = currentWindow + 1; + vm.prank(bidder); + bidderRegistry.depositForWindow{value: 64 ether}(nextWindow); + address provider = vm.addr(4); + uint256 balanceBefore = feeRecipient.balance; + bytes32 bidID = keccak256("1234"); + uint64 blockNumber = uint64(blocksPerWindow + 2); + blockTracker.addBuilderAddress("test", provider); + blockTracker.recordL1Block(blockNumber, "test"); + bidderRegistry.openBid(bidID, 1 ether, bidder, blockNumber); + bidderRegistry.retrieveFunds(nextWindow, bidID, payable(provider),100); + uint256 balanceAfter = feeRecipient.balance; + assertEq(balanceAfter - balanceBefore, 0); + assertEq(bidderRegistry.getAccumulatedProtocolFee(), 100000000000000000); + } } diff --git a/contracts/test/OracleTest.sol b/contracts/test/OracleTest.sol index 9bf5f1a38..393563d08 100644 --- a/contracts/test/OracleTest.sol +++ b/contracts/test/OracleTest.sol @@ -32,6 +32,7 @@ contract OracleTest is Test { uint256 public blocksPerWindow; bytes public constant validBLSPubkey = hex"80000cddeec66a800e00b0ccbb62f12298073603f5209e812abbac7e870482e488dd1bbe533a9d44497ba8b756e1e82b"; uint256 public constant withdrawalDelay = 24 * 3600; // 24 hours + uint256 public constant protocolFeePayoutPeriodBlocks = 100; struct TestCommitment { uint64 bid; uint64 blockNumber; @@ -85,7 +86,7 @@ contract OracleTest is Test { "ProviderRegistry.sol", abi.encodeCall( ProviderRegistry.initialize, - (minStake, feeRecipient, feePercent, address(this), withdrawalDelay) + (minStake, feeRecipient, feePercent, address(this), withdrawalDelay, protocolFeePayoutPeriodBlocks) ) ); providerRegistry = ProviderRegistry(payable(proxy)); @@ -107,7 +108,8 @@ contract OracleTest is Test { feePercent, address(this), address(blockTracker), - blocksPerWindow + blocksPerWindow, + protocolFeePayoutPeriodBlocks ) ) ); @@ -151,7 +153,7 @@ contract OracleTest is Test { vm.stopPrank(); - preConfCommitmentStore.updateOracle(address(oracle)); + preConfCommitmentStore.updateOracleContract(address(oracle)); bidderRegistry.setPreconfirmationsContract( address(preConfCommitmentStore) ); diff --git a/contracts/test/PreConfirmationConfTest.sol b/contracts/test/PreConfirmationConfTest.sol index 53bb2a516..ceaf860fe 100644 --- a/contracts/test/PreConfirmationConfTest.sol +++ b/contracts/test/PreConfirmationConfTest.sol @@ -38,8 +38,10 @@ contract TestPreConfCommitmentStore is Test { BlockTracker public blockTracker; uint256 public blocksPerWindow; BidderRegistry public bidderRegistry; - bytes public constant validBLSPubkey = hex"80000cddeec66a800e00b0ccbb62f12298073603f5209e812abbac7e870482e488dd1bbe533a9d44497ba8b756e1e82b"; + bytes public validBLSPubkey = hex"80000cddeec66a800e00b0ccbb62f12298073603f5209e812abbac7e870482e488dd1bbe533a9d44497ba8b756e1e82b"; uint256 public withdrawalDelay; + uint256 public protocolFeePayoutPeriodBlocks; + address public oracleContract; function setUp() public { _testCommitmentAliceBob = TestCommitment( 2, @@ -61,11 +63,13 @@ contract TestPreConfCommitmentStore is Test { feeRecipient = vm.addr(9); blocksPerWindow = 10; withdrawalDelay = 24 * 3600; // 24 hours + protocolFeePayoutPeriodBlocks = 100; + oracleContract = address(0x6793); address providerRegistryProxy = Upgrades.deployUUPSProxy( "ProviderRegistry.sol", abi.encodeCall( ProviderRegistry.initialize, - (minStake, feeRecipient, feePercent, address(this), withdrawalDelay) + (minStake, feeRecipient, feePercent, address(this), withdrawalDelay, protocolFeePayoutPeriodBlocks) ) ); providerRegistry = ProviderRegistry(payable(providerRegistryProxy)); @@ -88,7 +92,8 @@ contract TestPreConfCommitmentStore is Test { feePercent, address(this), address(blockTracker), - blocksPerWindow + blocksPerWindow, + protocolFeePayoutPeriodBlocks ) ) ); @@ -101,7 +106,7 @@ contract TestPreConfCommitmentStore is Test { ( address(providerRegistry), // Provider Registry address(bidderRegistry), // User Registry - feeRecipient, // Oracle + oracleContract, // Oracle address(this), address(blockTracker), // Block Tracker 500, @@ -120,7 +125,7 @@ contract TestPreConfCommitmentStore is Test { ); } - function test_getBidHash() public { + function test_GetBidHash1() public { // Step 1: Prepare the test commitment data PreConfCommitmentStore.CommitmentParams memory testCommitment = IPreConfCommitmentStore.CommitmentParams({ txnHash: "0xkartik", @@ -172,7 +177,7 @@ contract TestPreConfCommitmentStore is Test { } function test_Initialize() public view { - assertEq(preConfCommitmentStore.oracle(), feeRecipient); + assertEq(preConfCommitmentStore.oracleContract(), oracleContract); assertEq( address(preConfCommitmentStore.providerRegistry()), address(providerRegistry) @@ -183,7 +188,7 @@ contract TestPreConfCommitmentStore is Test { ); } - function test_storeEncryptedCommitment() public { + function test_StoreEncryptedCommitment() public { // Step 1: Prepare the commitment information and signature bytes32 commitmentDigest = keccak256( abi.encodePacked("commitment data") @@ -275,8 +280,9 @@ contract TestPreConfCommitmentStore is Test { } function test_UpdateOracle() public { - preConfCommitmentStore.updateOracle(feeRecipient); - assertEq(preConfCommitmentStore.oracle(), feeRecipient); + address newOracle = address(0x123); + preConfCommitmentStore.updateOracleContract(newOracle); + assertEq(preConfCommitmentStore.oracleContract(), newOracle); } function test_UpdateProviderRegistry() public { @@ -295,7 +301,7 @@ contract TestPreConfCommitmentStore is Test { ); } - function test_GetBidHash() public view { + function test_GetBidHash2() public view { bytes32 bidHash = preConfCommitmentStore.getBidHash( _testCommitmentAliceBob.txnHash, _testCommitmentAliceBob.revertingTxHashes, @@ -340,18 +346,6 @@ contract TestPreConfCommitmentStore is Test { signature = abi.encodePacked(r, s, v); } - function _bytes32ToHexString( - bytes32 _bytes32 - ) internal pure returns (string memory) { - bytes memory HEXCHARS = "0123456789abcdef"; - bytes memory _string = new bytes(64); - for (uint8 i = 0; i < 32; ++i) { - _string[i * 2] = HEXCHARS[uint8(_bytes32[i] >> 4)]; - _string[1 + i * 2] = HEXCHARS[uint8(_bytes32[i] & 0x0f)]; - } - return string(_string); - } - function test_StoreCommitment() public { (address bidder, ) = makeAddrAndKey("alice"); vm.deal(bidder, 5 ether); @@ -717,7 +711,7 @@ contract TestPreConfCommitmentStore is Test { _testCommitmentAliceBob.commitmentSignature, _testCommitmentAliceBob.sharedSecretKey ); - vm.prank(feeRecipient); + vm.prank(oracleContract); preConfCommitmentStore.initiateSlash(index, 100); (,isUsed, , , , , , , , , , , , ,) = preConfCommitmentStore @@ -806,7 +800,7 @@ contract TestPreConfCommitmentStore is Test { _testCommitmentAliceBob.commitmentSignature, _testCommitmentAliceBob.sharedSecretKey ); - vm.prank(feeRecipient); + vm.prank(oracleContract); preConfCommitmentStore.initiateReward(index, 100); (,isUsed, , , , , , , , , , , , ,) = preConfCommitmentStore @@ -893,7 +887,7 @@ contract TestPreConfCommitmentStore is Test { _testCommitmentAliceBob.sharedSecretKey ); uint256 window = blockTracker.getCurrentWindow(); - vm.prank(feeRecipient); + vm.prank(oracleContract); preConfCommitmentStore.initiateReward(index, 0); (,isUsed, , , , , , , , , , , , ,) = preConfCommitmentStore @@ -908,7 +902,7 @@ contract TestPreConfCommitmentStore is Test { } } - function test_storeEncryptedCommitment_InsufficientStake() public { + function test_StoreEncryptedCommitmentInsufficientStake() public { // Step 1: Prepare the commitment information and signature bytes32 commitmentDigest = keccak256( abi.encodePacked("commitment data") @@ -930,7 +924,7 @@ contract TestPreConfCommitmentStore is Test { ); } - function test_storeEncryptedCommitment_PendingWithdrawal() public { + function test_StoreEncryptedCommitmentPendingWithdrawal() public { // Step 1: Prepare the commitment information and signature bytes32 commitmentDigest = keccak256( abi.encodePacked("commitment data") @@ -964,11 +958,23 @@ contract TestPreConfCommitmentStore is Test { function _bytesToHexString( bytes memory _bytes ) internal pure returns (string memory) { - bytes memory HEXCHARS = "0123456789abcdef"; + bytes memory hexChars = "0123456789abcdef"; bytes memory _string = new bytes(_bytes.length * 2); for (uint256 i = 0; i < _bytes.length; ++i) { - _string[i * 2] = HEXCHARS[uint8(_bytes[i] >> 4)]; - _string[1 + i * 2] = HEXCHARS[uint8(_bytes[i] & 0x0f)]; + _string[i * 2] = hexChars[uint8(_bytes[i] >> 4)]; + _string[1 + i * 2] = hexChars[uint8(_bytes[i] & 0x0f)]; + } + return string(_string); + } + + function _bytes32ToHexString( + bytes32 _bytes32 + ) internal pure returns (string memory) { + bytes memory hexChars = "0123456789abcdef"; + bytes memory _string = new bytes(64); + for (uint8 i = 0; i < 32; ++i) { + _string[i * 2] = hexChars[uint8(_bytes32[i] >> 4)]; + _string[1 + i * 2] = hexChars[uint8(_bytes32[i] & 0x0f)]; } return string(_string); } diff --git a/contracts/test/ProviderRegistryTest.sol b/contracts/test/ProviderRegistryTest.sol index 3cacf663b..107bca189 100644 --- a/contracts/test/ProviderRegistryTest.sol +++ b/contracts/test/ProviderRegistryTest.sol @@ -21,10 +21,14 @@ contract ProviderRegistryTest is Test { BlockTracker public blockTracker; uint256 public blocksPerWindow; uint256 public withdrawalDelay; - bytes public constant validBLSPubkey = hex"80000cddeec66a800e00b0ccbb62f12298073603f5209e812abbac7e870482e488dd1bbe533a9d44497ba8b756e1e82b"; + bytes public validBLSPubkey = hex"80000cddeec66a800e00b0ccbb62f12298073603f5209e812abbac7e870482e488dd1bbe533a9d44497ba8b756e1e82b"; + uint256 public protocolFeePayoutPeriodBlocks; event ProviderRegistered(address indexed provider, uint256 stakedAmount, bytes blsPublicKey); event WithdrawalRequested(address indexed provider, uint256 timestamp); event WithdrawalCompleted(address indexed provider, uint256 amount); + event FeeTransfer(uint256 amount, address indexed recipient); + event ProtocolFeeRecipientUpdated(address indexed newProtocolFeeRecipient); + event FeePayoutPeriodBlocksUpdated(uint256 indexed newFeePayoutPeriodBlocks); function setUp() public { testNumber = 42; @@ -33,6 +37,7 @@ contract ProviderRegistryTest is Test { feeRecipient = vm.addr(9); blocksPerWindow = 10; withdrawalDelay = 24 * 3600; // 24 hours + protocolFeePayoutPeriodBlocks = 100; address providerRegistryProxy = Upgrades.deployUUPSProxy( "ProviderRegistry.sol", abi.encodeCall(ProviderRegistry.initialize, @@ -40,7 +45,8 @@ contract ProviderRegistryTest is Test { feeRecipient, feePercent, address(this), - withdrawalDelay + withdrawalDelay, + protocolFeePayoutPeriodBlocks )) ); providerRegistry = ProviderRegistry(payable(providerRegistryProxy)); @@ -59,7 +65,8 @@ contract ProviderRegistryTest is Test { feePercent, address(this), address(blockTracker), - blocksPerWindow)) + blocksPerWindow, + protocolFeePayoutPeriodBlocks)) ); bidderRegistry = BidderRegistry(payable(bidderRegistryProxy)); @@ -83,10 +90,16 @@ contract ProviderRegistryTest is Test { function test_VerifyInitialContractState() public view { assertEq(providerRegistry.minStake(), 1e18 wei); - assertEq(providerRegistry.feeRecipient(), feeRecipient); + assertEq(feePercent, feePercent); + assertEq(withdrawalDelay, withdrawalDelay); assertEq(providerRegistry.feePercent(), feePercent); assertEq(providerRegistry.preConfirmationsContract(), address(0)); assertEq(providerRegistry.providerRegistered(provider), false); + (address recipient, uint256 accumulatedAmount, uint256 lastPayoutBlock, uint256 payoutPeriodBlocks) = bidderRegistry.protocolFeeTracker(); + assertEq(recipient, feeRecipient); + assertEq(payoutPeriodBlocks, protocolFeePayoutPeriodBlocks); + assertEq(lastPayoutBlock, block.number); + assertEq(accumulatedAmount, 0); } function testFail_ProviderStakeAndRegisterMinStake() public { @@ -130,7 +143,7 @@ contract ProviderRegistryTest is Test { providerRegistry.registerAndStake{value: 1 wei}(validBLSPubkey); } - function testFail_receive() public { + function testFail_Receive() public { vm.deal(provider, 3 ether); vm.prank(provider); vm.expectRevert(bytes("")); @@ -138,7 +151,7 @@ contract ProviderRegistryTest is Test { require(success, "Couldn't transfer to provider"); } - function testFail_fallback() public { + function testFail_Fallback() public { vm.deal(provider, 3 ether); vm.prank(provider); vm.expectRevert(bytes("")); @@ -146,18 +159,34 @@ contract ProviderRegistryTest is Test { require(success, "Couldn't transfer to provider"); } - function test_SetNewFeeRecipient() public { + function test_SetNewProtocolFeeRecipient() public { address newRecipient = vm.addr(2); vm.prank(address(this)); - providerRegistry.setNewFeeRecipient(newRecipient); - - assertEq(providerRegistry.feeRecipient(), newRecipient); + vm.expectEmit(true, true, true, true); + emit ProtocolFeeRecipientUpdated(newRecipient); + providerRegistry.setNewProtocolFeeRecipient(newRecipient); + (address recipient, , ,) = providerRegistry.protocolFeeTracker(); + assertEq(recipient, newRecipient); } - function testFail_SetNewFeeRecipient() public { + function testFail_SetNewProtocolFeeRecipient() public { address newRecipient = vm.addr(2); vm.expectRevert(bytes("")); - providerRegistry.setNewFeeRecipient(newRecipient); + providerRegistry.setNewProtocolFeeRecipient(newRecipient); + } + + function test_SetNewFeePayoutPeriodBlocks() public { + vm.prank(address(this)); + vm.expectEmit(true, true, true, true); + emit FeePayoutPeriodBlocksUpdated(890); + providerRegistry.setFeePayoutPeriodBlocks(890); + (, , , uint256 payoutPeriodBlocks) = providerRegistry.protocolFeeTracker(); + assertEq(payoutPeriodBlocks, 890); + } + + function testFail_SetNewFeePayoutPeriodBlocks() public { + vm.expectRevert(bytes("")); + providerRegistry.setFeePayoutPeriodBlocks(83424); } function test_SetNewFeePercent() public { @@ -189,7 +218,7 @@ contract ProviderRegistryTest is Test { providerRegistry.setPreconfirmationsContract(address(0)); } - function test_shouldSlashProvider() public { + function test_ShouldSlashProvider() public { providerRegistry.setPreconfirmationsContract(address(this)); vm.deal(provider, 3 ether); vm.prank(provider); @@ -200,13 +229,13 @@ contract ProviderRegistryTest is Test { providerRegistry.slash(1 ether, provider, payable(bidder), 100); assertEq(bidder.balance, 900000000000000000 wei); - assertEq(providerRegistry.feeRecipientAmount(), 100000000000000000 wei); + assertEq(providerRegistry.getAccumulatedProtocolFee(), 100000000000000000 wei); assertEq(providerRegistry.providerStakes(provider), 1 ether); } - function test_shouldSlashProviderWithoutFeeRecipient() public { + function test_ShouldSlashProviderWithoutFeeRecipient() public { vm.prank(address(this)); - providerRegistry.setNewFeeRecipient(address(0)); + providerRegistry.setNewProtocolFeeRecipient(address(0)); providerRegistry.setPreconfirmationsContract(address(this)); vm.deal(provider, 3 ether); @@ -221,7 +250,7 @@ contract ProviderRegistryTest is Test { assertEq(providerRegistry.providerStakes(provider), 1 ether); } - function testFail_shouldRetrieveFundsNotPreConf() public { + function testFail_ShouldRetrieveFundsNotPreConf() public { vm.deal(provider, 3 ether); vm.prank(provider); providerRegistry.registerAndStake{value: 2 ether}(validBLSPubkey); @@ -230,7 +259,7 @@ contract ProviderRegistryTest is Test { providerRegistry.slash(1 ether, provider, payable(bidder),100); } - function testFail_shouldRetrieveFundsGreaterThanStake() public { + function testFail_ShouldRetrieveFundsGreaterThanStake() public { vm.prank(address(this)); providerRegistry.setPreconfirmationsContract(address(this)); @@ -244,29 +273,47 @@ contract ProviderRegistryTest is Test { providerRegistry.slash(3 ether, provider, payable(bidder), 100); } - function test_FeeRecipientAmount() public { - providerRegistry.setNewFeeRecipient(vm.addr(6)); + function test_ProtocolFeeBehavior() public { + providerRegistry.setNewProtocolFeeRecipient(vm.addr(6)); vm.deal(provider, 3 ether); vm.prank(provider); + address bidder = vm.addr(4); + providerRegistry.registerAndStake{value: 2 ether}(validBLSPubkey); providerRegistry.setPreconfirmationsContract(address(this)); - providerRegistry.slash(1e18 wei, provider, payable(provider),50); + providerRegistry.slash(1e18 wei, provider, payable(bidder), 50); assertEq( - providerRegistry.feeRecipientAmount(), + providerRegistry.getAccumulatedProtocolFee(), 5e16 wei, "FeeRecipientAmount should match" ); - providerRegistry.withdrawFeeRecipientAmount(); + + address newProvider = vm.addr(11); + vm.deal(newProvider, 3 ether); + vm.prank(newProvider); + providerRegistry.registerAndStake{value: 2 ether}(validBLSPubkey); + + vm.roll(350); // roll past protocol fee payout period + + vm.expectEmit(true, true, true, true); + emit FeeTransfer(1e17 wei, vm.addr(6)); + providerRegistry.slash(1e18 wei, newProvider, payable(bidder), 50); + assertEq( - providerRegistry.feeRecipientAmount(), + providerRegistry.getAccumulatedProtocolFee(), 0, - "FeeRecipientAmount should be zero after withdrawal" + "Accumulated protocol fee should be zero" + ); + assertEq( + vm.addr(6).balance, + 1e17 wei, + "FeeRecipient should have received 1e17 wei" ); } function test_WithdrawStakedAmountWithoutFeeRecipient() public { - providerRegistry.setNewFeeRecipient(address(0)); + providerRegistry.setNewProtocolFeeRecipient(address(0)); address newProvider = vm.addr(8); address bidder = vm.addr(9); vm.deal(newProvider, 3 ether);