diff --git a/cmd/main.go b/cmd/main.go index 04d33d0..53c83f5 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -5,22 +5,39 @@ import ( "time" "validator/config" "validator/pkgs/clients" - "validator/pkgs/helpers" + "validator/pkgs/ipfs" + "validator/pkgs/prost" + "validator/pkgs/redis" + "validator/pkgs/utils" ) func main() { - var wg sync.WaitGroup + // Initiate logger + utils.InitLogger() - helpers.InitLogger() + // Load the config object config.LoadConfig() - clients.InitializeReportingClient(config.SettingsObj.SlackReportingUrl, 60*time.Second) - helpers.ConfigureClient() - helpers.ConfigureContractInstance() - helpers.RedisClient = helpers.NewRedisClient() - helpers.ConnectIPFSNode() - helpers.PopulateStateVars() + + // Initialize reporting service + clients.InitializeReportingClient(config.SettingsObj.SlackReportingUrl, 5*time.Second) + + // Initialize tx relayer service + clients.InitializeTxClient(config.SettingsObj.TxRelayerUrl, time.Duration(config.SettingsObj.HttpTimeout)*time.Second) + + // Setup redis + redis.RedisClient = redis.NewRedisClient() + + // Connect to IPFS node + ipfs.ConnectIPFSNode() + + // Set up the RPC client, contract, and ABI instance + prost.ConfigureClient() + prost.ConfigureContractInstance() + prost.ConfigureABI() + + var wg sync.WaitGroup wg.Add(1) - go helpers.StartFetchingBlocks() + go prost.StartBatchAttestation() // Start batch attestation process wg.Wait() } diff --git a/config/settings.go b/config/settings.go index ebfbdfb..2c6719a 100644 --- a/config/settings.go +++ b/config/settings.go @@ -1,114 +1,72 @@ package config import ( - "crypto/ecdsa" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - log "github.com/sirupsen/logrus" + "encoding/json" + "log" "os" "strconv" + + "github.com/ethereum/go-ethereum/common" ) var SettingsObj *Settings type Settings struct { - ClientUrl string - ContractAddress string - DataMarketAddress common.Address - RedisHost string - RedisPort string - IPFSUrl string - SignerAccountAddress common.Address - PrivateKey *ecdsa.PrivateKey - ChainID int - BlockTime int - BatchSubmissionLimit int - SlackReportingUrl string - RedisDB int + ClientUrl string + ContractAddress string + RedisHost string + RedisPort string + RedisDB string + IPFSUrl string + SlackReportingUrl string + TxRelayerUrl string + TxRelayerAuthWriteToken string + DataMarketAddresses []string + DataMarketContractAddresses []common.Address + BlockTime int + HttpTimeout int } func LoadConfig() { - var err error - - missingEnvVars := []string{} - - requiredEnvVars := []string{ - "PROST_RPC_URL", - "PROTOCOL_STATE_CONTRACT", - "REDIS_HOST", - "REDIS_DB", - "REDIS_PORT", - "IPFS_URL", - "DATA_MARKET_CONTRACT", - "SIGNER_ACCOUNT_PRIVATE_KEY", - "BATCH_SUBMISSION_LIMIT", - "PROST_CHAIN_ID", - "BLOCK_TIME", - "SLACK_REPORTING_URL", - } + dataMarketAddresses := getEnv("DATA_MARKET_ADDRESSES", "[]") + dataMarketAddressesList := []string{} - for envVar := range requiredEnvVars { - if getEnv(requiredEnvVars[envVar], "") == "" { - missingEnvVars = append(missingEnvVars, requiredEnvVars[envVar]) - } + err := json.Unmarshal([]byte(dataMarketAddresses), &dataMarketAddressesList) + if err != nil { + log.Fatalf("Failed to parse DATA_MARKET_ADDRESSES environment variable: %v", err) } - - if len(missingEnvVars) > 0 { - log.Fatalf("Missing required environment variables: %v", missingEnvVars) + if len(dataMarketAddressesList) == 0 { + log.Fatalf("DATA_MARKET_ADDRESSES environment variable has an empty array") } config := Settings{ - ClientUrl: getEnv("PROST_RPC_URL", ""), - ContractAddress: getEnv("PROTOCOL_STATE_CONTRACT", ""), - RedisHost: getEnv("REDIS_HOST", ""), - RedisPort: getEnv("REDIS_PORT", ""), - IPFSUrl: getEnv("IPFS_URL", ""), - SlackReportingUrl: getEnv("SLACK_REPORTING_URL", ""), - } - - config.ChainID, err = strconv.Atoi(getEnv("PROST_CHAIN_ID", "")) - if err != nil { - log.Fatalf("PROST_CHAIN_ID is not a valid integer") - } - - config.BlockTime, err = strconv.Atoi(getEnv("BLOCK_TIME", "")) - if err != nil { - log.Fatalf("BLOCK_TIME is not a valid integer") + ClientUrl: getEnv("PROST_RPC_URL", ""), + ContractAddress: getEnv("PROTOCOL_STATE_CONTRACT", ""), + RedisHost: getEnv("REDIS_HOST", ""), + RedisPort: getEnv("REDIS_PORT", ""), + RedisDB: getEnv("REDIS_DB", ""), + IPFSUrl: getEnv("IPFS_URL", ""), + SlackReportingUrl: getEnv("SLACK_REPORTING_URL", ""), + TxRelayerUrl: getEnv("TX_RELAYER_URL", ""), + TxRelayerAuthWriteToken: getEnv("TX_RELAYER_AUTH_WRITE_TOKEN", ""), + DataMarketAddresses: dataMarketAddressesList, } - config.BatchSubmissionLimit, err = strconv.Atoi(getEnv("BATCH_SUBMISSION_LIMIT", "")) - if err != nil { - log.Fatalf("BATCH_SUBMISSION_LIMIT is not a valid integer") + for _, addr := range config.DataMarketAddresses { + config.DataMarketContractAddresses = append(config.DataMarketContractAddresses, common.HexToAddress(addr)) } - config.PrivateKey, err = crypto.HexToECDSA(getEnv("SIGNER_ACCOUNT_PRIVATE_KEY", "")) - if err != nil { - log.Fatalf("SIGNER_ACCOUNT_PRIVATE_KEY is not a valid private key") + blockTime, blockTimeParseErr := strconv.Atoi(getEnv("BLOCK_TIME", "")) + if blockTimeParseErr != nil { + log.Fatalf("Failed to parse BLOCK_TIME environment variable: %v", blockTimeParseErr) } + config.BlockTime = blockTime - config.RedisDB, err = strconv.Atoi(getEnv("REDIS_DB", "")) - if err != nil { - log.Fatalf("REDIS_DB is not a valid integer") + httpTimeout, timeoutParseErr := strconv.Atoi(getEnv("HTTP_TIMEOUT", "")) + if timeoutParseErr != nil { + log.Fatalf("Failed to parse HTTP_TIMEOUT environment variable: %v", timeoutParseErr) } - - // get signer address from private key - config.SignerAccountAddress = crypto.PubkeyToAddress(config.PrivateKey.PublicKey) - - config.DataMarketAddress = common.HexToAddress(getEnv("DATA_MARKET_CONTRACT", "")) - - log.Infoln("Configuration loaded successfully") - log.Infoln("Client URL: ", config.ClientUrl) - log.Infoln("Contract Address: ", config.ContractAddress) - log.Infoln("Redis Host: ", config.RedisHost) - log.Infoln("Redis Port: ", config.RedisPort) - log.Infoln("Redis DB: ", config.RedisDB) - log.Infoln("IPFS URL: ", config.IPFSUrl) - log.Infoln("Chain ID: ", config.ChainID) - log.Infoln("Block Time: ", config.BlockTime) - log.Infoln("Batch Submission Limit: ", config.BatchSubmissionLimit) - log.Infoln("Signer Account Address: ", config.SignerAccountAddress.Hex()) - log.Infoln("Data Market Address: ", config.DataMarketAddress.Hex()) - log.Infoln("Slack Reporting URL: ", config.SlackReportingUrl) + config.HttpTimeout = httpTimeout SettingsObj = &config } @@ -120,9 +78,3 @@ func getEnv(key, defaultValue string) string { } return value } - -func checkOptionalEnvVar(value, key string) { - if value == "" { - log.Warnf("Optional environment variable %s is not set", key) - } -} diff --git a/go.mod b/go.mod index 8623e26..c47a87c 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,9 @@ module validator -go 1.22 +go 1.21 require ( + github.com/cenkalti/backoff v2.2.1+incompatible github.com/cenkalti/backoff/v4 v4.2.0 github.com/ethereum/go-ethereum v1.13.12 github.com/go-redis/redis/v8 v8.11.5 diff --git a/go.sum b/go.sum index 451d5d8..2c67d85 100644 --- a/go.sum +++ b/go.sum @@ -18,6 +18,8 @@ github.com/btcsuite/btcd/btcec/v2 v2.2.0 h1:fzn1qaOt32TuLjFlkzYSsBC35Q3KUjT1SwPx github.com/btcsuite/btcd/btcec/v2 v2.2.0/go.mod h1:U7MHm051Al6XmscBQ0BoNydpOTsFAn707034b5nY8zU= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= +github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= +github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/cenkalti/backoff/v4 v4.2.0 h1:HN5dHm3WBOgndBH6E8V0q2jIYIR3s9yglV8k/+MN3u4= github.com/cenkalti/backoff/v4 v4.2.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/cespare/cp v0.1.0 h1:SE+dxFebS7Iik5LK0tsi1k9ZCxEaFX4AjQmoyA+1dJk= diff --git a/pkgs/clients/reporting.go b/pkgs/clients/reporting.go index 1aace2a..1ea1734 100644 --- a/pkgs/clients/reporting.go +++ b/pkgs/clients/reporting.go @@ -5,9 +5,10 @@ import ( "crypto/tls" "encoding/json" "fmt" - log "github.com/sirupsen/logrus" "net/http" "time" + + log "github.com/sirupsen/logrus" ) var reportingClient *ReportingService @@ -37,7 +38,6 @@ func (s ValidatorAlert) String() string { // sendPostRequest sends a POST request to the specified URL func SendFailureNotification(processName, errorMsg, timestamp, severity string) { - issue := ValidatorAlert{ processName, errorMsg, @@ -46,11 +46,11 @@ func SendFailureNotification(processName, errorMsg, timestamp, severity string) } jsonData, err := json.Marshal(issue) - log.Debugln("Sending notification: ", string(jsonData)) if err != nil { log.Errorln("Unable to marshal notification: ", issue) return } + req, err := http.NewRequest("POST", reportingClient.url, bytes.NewBuffer(jsonData)) if err != nil { log.Errorln("Error creating request: ", err) diff --git a/pkgs/clients/txClient.go b/pkgs/clients/txClient.go new file mode 100644 index 0000000..9e72273 --- /dev/null +++ b/pkgs/clients/txClient.go @@ -0,0 +1,70 @@ +package clients + +import ( + "bytes" + "crypto/tls" + "encoding/json" + "fmt" + "math/big" + "net/http" + "time" + "validator/config" +) + +type TxRelayerClient struct { + url string + client *http.Client +} + +type BatchAttestationRequest struct { + DataMarketAddress string `json:"dataMarketAddress"` + BatchCID string `json:"batchCID"` + EpochID *big.Int `json:"epochID"` + RootHash string `json:"rootHash"` + AuthToken string `json:"authToken"` +} + +var txRelayerClient *TxRelayerClient + +// InitializeTxClient initializes the TxRelayerClient with the provided URL and timeout +func InitializeTxClient(url string, timeout time.Duration) { + txRelayerClient = &TxRelayerClient{ + url: url, + client: &http.Client{ + Timeout: timeout, + Transport: &http.Transport{ + TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, + }, + }, + } +} + +// SubmitBatchAttestationRequest submits details for batch attestattion to the transaction relayer service +func SubmitBatchAttestationRequest(dataMarketAddress, batchCID, rootHash string, epochID *big.Int) error { + request := BatchAttestationRequest{ + DataMarketAddress: dataMarketAddress, + BatchCID: batchCID, + EpochID: epochID, + RootHash: rootHash, + AuthToken: config.SettingsObj.TxRelayerAuthWriteToken, + } + + jsonData, err := json.Marshal(request) + if err != nil { + return fmt.Errorf("unable to marshal batch attestation request: %w", err) + } + + url := fmt.Sprintf("%s/submitBatchAttestation", txRelayerClient.url) + + resp, err := txRelayerClient.client.Post(url, "application/json", bytes.NewBuffer(jsonData)) + if err != nil { + return fmt.Errorf("unable to send batch attestation request: %w", err) + } + defer resp.Body.Close() + + if resp.StatusCode != http.StatusOK { + return fmt.Errorf("failed to send batch attestation request, status code: %d", resp.StatusCode) + } + + return nil +} diff --git a/pkgs/constants.go b/pkgs/constants.go new file mode 100644 index 0000000..d9d2009 --- /dev/null +++ b/pkgs/constants.go @@ -0,0 +1,26 @@ +package pkgs + +import "time" + +// Process Name Constants +// process : identifier +const ( + ProcessEvents = "Validator: ProcessEvents" + BuildMerkleTree = "Validator: BuildMerkleTree" + ContractSubmission = "Validator: ContractSubmission" + StartFetchingBlocks = "Validator: StartFetchingBlocks" + FetchBatchSubmission = "Validator: FetchBatchSubmission" + StoreBatchSubmission = "Validator: StoreBatchSubmission" + SendBatchAttestationToRelayer = "Validator: SendBatchAttestationToRelayer" +) + +// General Key Constants +const ( + ValidatorKey = "ValidatorKey" + ValidatorSetKey = "ValidatorSetKey" +) + +// General Constants +const ( + Day = 24 * time.Hour +) diff --git a/pkgs/contract/abi.json b/pkgs/contract/abi.json new file mode 100644 index 0000000..467bf41 --- /dev/null +++ b/pkgs/contract/abi.json @@ -0,0 +1,2711 @@ +[ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "AddressEmptyCode", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "ERC1967InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "ERC1967NonPayable", + "type": "error" + }, + { + "inputs": [], + "name": "FailedCall", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnableInvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "OwnableUnauthorizedAccount", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "dataMarketAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "adminAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "AdminsUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "dataMarketAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "epochId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + } + ], + "name": "BatchSubmissionsCompleted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "dataMarketAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "snapshotterAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "slotId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "dayId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + } + ], + "name": "DailyTaskCompletedEvent", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "ownerAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "epochSize", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "sourceChainId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "sourceChainBlockTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "useBlockNumberAsEpochId", + "type": "bool" + }, + { + "indexed": false, + "internalType": "address", + "name": "protocolState", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "dataMarketAddress", + "type": "address" + } + ], + "name": "DataMarketCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "dataMarketAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "dayId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + } + ], + "name": "DayStartedEvent", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "dataMarketAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "batchCid", + "type": "string" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "epochId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "validatorAddr", + "type": "address" + } + ], + "name": "DelayedAttestationSubmitted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "dataMarketAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "batchCid", + "type": "string" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "epochId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + } + ], + "name": "DelayedBatchSubmitted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "dataMarketAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "snapshotterAddr", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "slotId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "snapshotCid", + "type": "string" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "epochId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "projectId", + "type": "string" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + } + ], + "name": "DelayedSnapshotSubmitted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "EmergencyWithdraw", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "dataMarketAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "epochId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "begin", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "end", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + } + ], + "name": "EpochReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + } + ], + "name": "RewardsClaimed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "dataMarketAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "snapshotterAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "slotId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "dayId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "rewardPoints", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + } + ], + "name": "RewardsDistributedEvent", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "dataMarketAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sequencerAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "SequencersUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "dataMarketAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "batchCid", + "type": "string" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "epochId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "validatorAddr", + "type": "address" + } + ], + "name": "SnapshotBatchAttestationSubmitted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "dataMarketAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "epochId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "string", + "name": "batchCid", + "type": "string" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + } + ], + "name": "SnapshotBatchFinalized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "dataMarketAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "batchCid", + "type": "string" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "epochId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + } + ], + "name": "SnapshotBatchSubmitted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "dataMarketAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "epochId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "epochEnd", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "projectId", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "snapshotCid", + "type": "string" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + } + ], + "name": "SnapshotFinalized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "dataMarketAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "epochId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "string", + "name": "batchCid", + "type": "string" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + } + ], + "name": "TriggerBatchResubmission", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "dataMarketAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "epochId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "string", + "name": "batchCid", + "type": "string" + }, + { + "indexed": false, + "internalType": "address", + "name": "validator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + } + ], + "name": "ValidatorAttestationsInvalidated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "dataMarketAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "validatorAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "ValidatorsUpdated", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + } + ], + "name": "DAY_SIZE", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + } + ], + "name": "EPOCH_SIZE", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + } + ], + "name": "SOURCE_CHAIN_BLOCK_TIME", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + } + ], + "name": "SOURCE_CHAIN_ID", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "UPGRADE_INTERFACE_VERSION", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + } + ], + "name": "USE_BLOCK_NUMBER_AS_EPOCH_ID", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "allSnapshotters", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + } + ], + "name": "attestationSubmissionWindow", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + }, + { + "internalType": "string", + "name": "batchCid", + "type": "string" + }, + { + "internalType": "address", + "name": "validator", + "type": "address" + } + ], + "name": "attestationsReceived", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + }, + { + "internalType": "string", + "name": "batchCid", + "type": "string" + }, + { + "internalType": "bytes32", + "name": "finalizedCidsRootHash", + "type": "bytes32" + } + ], + "name": "attestationsReceivedCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + }, + { + "internalType": "string", + "name": "batchCid", + "type": "string" + } + ], + "name": "batchCidAttestationStatus", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + }, + { + "internalType": "string", + "name": "batchCid", + "type": "string" + }, + { + "internalType": "uint256", + "name": "idx", + "type": "uint256" + } + ], + "name": "batchCidDivergentValidators", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + }, + { + "internalType": "string", + "name": "batchCid", + "type": "string" + } + ], + "name": "batchCidSequencerAttestation", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + }, + { + "internalType": "string", + "name": "batchCid", + "type": "string" + } + ], + "name": "batchCidToProjects", + "outputs": [ + { + "internalType": "string[]", + "name": "", + "type": "string[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + } + ], + "name": "batchSubmissionWindow", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + }, + { + "internalType": "string", + "name": "batchCid", + "type": "string" + }, + { + "internalType": "uint256", + "name": "epochId", + "type": "uint256" + } + ], + "name": "checkDynamicConsensusAttestations", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + }, + { + "internalType": "uint256", + "name": "slotId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "day", + "type": "uint256" + } + ], + "name": "checkSlotTaskStatusForDay", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_user", + "type": "address" + } + ], + "name": "claimRewards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "ownerAddress", + "type": "address" + }, + { + "internalType": "uint8", + "name": "epochSize", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "sourceChainId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sourceChainBlockTime", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "useBlockNumberAsEpochId", + "type": "bool" + } + ], + "name": "createDataMarket", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + } + ], + "name": "currentEpoch", + "outputs": [ + { + "internalType": "uint256", + "name": "begin", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "epochId", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + } + ], + "name": "dailySnapshotQuota", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "dataMarketCount", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "dataMarketAddress", + "type": "address" + } + ], + "name": "dataMarketEnabled", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "dataMarketFactory", + "outputs": [ + { + "internalType": "contract DataMarketFactory", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint8", + "name": "dataMarketId", + "type": "uint8" + } + ], + "name": "dataMarketIdToAddress", + "outputs": [ + { + "internalType": "address", + "name": "dataMarketAddress", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "dataMarkets", + "outputs": [ + { + "internalType": "address", + "name": "ownerAddress", + "type": "address" + }, + { + "internalType": "uint8", + "name": "epochSize", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "sourceChainId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sourceChainBlockTime", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "useBlockNumberAsEpochId", + "type": "bool" + }, + { + "internalType": "bool", + "name": "enabled", + "type": "bool" + }, + { + "internalType": "address", + "name": "dataMarketAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "createdAt", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + } + ], + "name": "dayCounter", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + } + ], + "name": "deploymentBlockNumber", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "emergencyWithdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "enabledNodeCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + }, + { + "internalType": "uint256", + "name": "epochId", + "type": "uint256" + } + ], + "name": "endBatchSubmissions", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + }, + { + "internalType": "uint256", + "name": "epochId", + "type": "uint256" + } + ], + "name": "epochIdToBatchCids", + "outputs": [ + { + "internalType": "string[]", + "name": "", + "type": "string[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + }, + { + "internalType": "uint256", + "name": "epochId", + "type": "uint256" + } + ], + "name": "epochInfo", + "outputs": [ + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "blocknumber", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "epochEnd", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + } + ], + "name": "epochManager", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + } + ], + "name": "epochsInADay", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + }, + { + "internalType": "string", + "name": "batchCid", + "type": "string" + }, + { + "internalType": "uint256", + "name": "epochId", + "type": "uint256" + } + ], + "name": "forceCompleteConsensusAttestations", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + }, + { + "internalType": "uint256", + "name": "begin", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "forceSkipEpoch", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + } + ], + "name": "getEpochManager", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + } + ], + "name": "getSequencerId", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + } + ], + "name": "getSequencers", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + }, + { + "internalType": "uint256", + "name": "slotId", + "type": "uint256" + } + ], + "name": "getSlotInfo", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "slotId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "snapshotterAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "rewardPoints", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "currentDaySnapshotCount", + "type": "uint256" + } + ], + "internalType": "struct PowerloomDataMarket.SlotInfo", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "slotId", + "type": "uint256" + } + ], + "name": "getSlotRewards", + "outputs": [ + { + "internalType": "uint256", + "name": "rewards", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getTotalNodeCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + } + ], + "name": "getTotalSequencersCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getTotalSnapshotterCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + } + ], + "name": "getTotalValidatorsCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + } + ], + "name": "getValidators", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "initialOwner", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + }, + { + "internalType": "string", + "name": "projectId", + "type": "string" + } + ], + "name": "lastFinalizedSnapshot", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + }, + { + "internalType": "string", + "name": "projectId", + "type": "string" + } + ], + "name": "lastSequencerFinalizedSnapshot", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_dayCounter", + "type": "uint256" + } + ], + "name": "loadCurrentDay", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + }, + { + "internalType": "uint256", + "name": "slotId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "dayId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "snapshotCount", + "type": "uint256" + } + ], + "name": "loadSlotSubmissions", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + }, + { + "internalType": "string", + "name": "batchCid", + "type": "string" + } + ], + "name": "maxAttestationFinalizedRootHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + }, + { + "internalType": "string", + "name": "batchCid", + "type": "string" + } + ], + "name": "maxAttestationsCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + }, + { + "internalType": "string", + "name": "projectId", + "type": "string" + }, + { + "internalType": "uint256", + "name": "epochId", + "type": "uint256" + } + ], + "name": "maxSnapshotsCid", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + } + ], + "name": "minAttestationsForConsensus", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + }, + { + "internalType": "string", + "name": "projectId", + "type": "string" + } + ], + "name": "projectFirstEpochId", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + }, + { + "internalType": "uint256", + "name": "begin", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "releaseEpoch", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + } + ], + "name": "rewardPoolSize", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + } + ], + "name": "rewardsEnabled", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + }, + { + "internalType": "string", + "name": "_sequencerId", + "type": "string" + } + ], + "name": "setSequencerId", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + }, + { + "internalType": "uint256", + "name": "slotId", + "type": "uint256" + } + ], + "name": "slotRewardPoints", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "slotRewards", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "slotId", + "type": "uint256" + } + ], + "name": "slotSnapshotterMapping", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + }, + { + "internalType": "uint256", + "name": "slotId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "dayId", + "type": "uint256" + } + ], + "name": "slotSubmissionCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + }, + { + "internalType": "string", + "name": "projectId", + "type": "string" + }, + { + "internalType": "uint256", + "name": "epochId", + "type": "uint256" + } + ], + "name": "snapshotStatus", + "outputs": [ + { + "internalType": "enum PowerloomDataMarket.SnapshotStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "string", + "name": "snapshotCid", + "type": "string" + }, + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + } + ], + "name": "snapshotSubmissionWindow", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "snapshotterState", + "outputs": [ + { + "internalType": "contract PowerloomNodes", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + }, + { + "internalType": "string", + "name": "batchCid", + "type": "string" + }, + { + "internalType": "uint256", + "name": "epochId", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "finalizedCidsRootHash", + "type": "bytes32" + } + ], + "name": "submitBatchAttestation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + }, + { + "internalType": "string", + "name": "batchCid", + "type": "string" + }, + { + "internalType": "uint256", + "name": "epochId", + "type": "uint256" + }, + { + "internalType": "string[]", + "name": "projectIds", + "type": "string[]" + }, + { + "internalType": "string[]", + "name": "snapshotCids", + "type": "string[]" + }, + { + "internalType": "bytes32", + "name": "finalizedCidsRootHash", + "type": "bytes32" + } + ], + "name": "submitSubmissionBatch", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "dataMarketAddress", + "type": "address" + }, + { + "internalType": "bool", + "name": "enabled", + "type": "bool" + } + ], + "name": "toggleDataMarket", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + } + ], + "name": "toggleRewards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + }, + { + "internalType": "enum PowerloomDataMarket.Role", + "name": "role", + "type": "uint8" + }, + { + "internalType": "address[]", + "name": "_addresses", + "type": "address[]" + }, + { + "internalType": "bool[]", + "name": "_status", + "type": "bool[]" + } + ], + "name": "updateAddresses", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + }, + { + "internalType": "uint256", + "name": "newattestationSubmissionWindow", + "type": "uint256" + } + ], + "name": "updateAttestationSubmissionWindow", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + }, + { + "internalType": "uint256", + "name": "newbatchSubmissionWindow", + "type": "uint256" + } + ], + "name": "updateBatchSubmissionWindow", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_dailySnapshotQuota", + "type": "uint256" + } + ], + "name": "updateDailySnapshotQuota", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_address", + "type": "address" + } + ], + "name": "updateDataMarketFactory", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + }, + { + "internalType": "uint256", + "name": "newDaySize", + "type": "uint256" + } + ], + "name": "updateDaySize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + }, + { + "internalType": "address", + "name": "_address", + "type": "address" + } + ], + "name": "updateEpochManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_minAttestationsForConsensus", + "type": "uint256" + } + ], + "name": "updateMinAttestationsForConsensus", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + }, + { + "internalType": "uint256", + "name": "newRewardPoolSize", + "type": "uint256" + } + ], + "name": "updateRewardPoolSize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "slotIds", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "submissionsList", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "day", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "eligibleNodes", + "type": "uint256" + } + ], + "name": "updateRewards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PowerloomDataMarket", + "name": "dataMarket", + "type": "address" + }, + { + "internalType": "uint256", + "name": "newsnapshotSubmissionWindow", + "type": "uint256" + } + ], + "name": "updateSnapshotSubmissionWindow", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_address", + "type": "address" + } + ], + "name": "updateSnapshotterState", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "userInfo", + "outputs": [ + { + "internalType": "uint256", + "name": "totalRewards", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalClaimed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastClaimed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastUpdated", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + } +] \ No newline at end of file diff --git a/pkgs/contract/contract/contract.go b/pkgs/contract/contract.go similarity index 74% rename from pkgs/contract/contract/contract.go rename to pkgs/contract/contract.go index 8a282d7..f46e6e8 100644 --- a/pkgs/contract/contract/contract.go +++ b/pkgs/contract/contract.go @@ -29,15 +29,6 @@ var ( _ = abi.ConvertType ) -// PowerloomDataMarketRequest is an auto generated low-level Go binding around an user-defined struct. -type PowerloomDataMarketRequest struct { - SlotId *big.Int - Deadline *big.Int - SnapshotCid string - EpochId *big.Int - ProjectId string -} - // PowerloomDataMarketSlotInfo is an auto generated low-level Go binding around an user-defined struct. type PowerloomDataMarketSlotInfo struct { SlotId *big.Int @@ -48,7 +39,7 @@ type PowerloomDataMarketSlotInfo struct { // ContractMetaData contains all meta data concerning the Contract contract. var ContractMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"}],\"name\":\"AddressEmptyCode\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"ERC1967InvalidImplementation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ERC1967NonPayable\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedInnerCall\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidInitialization\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"OwnableInvalidOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"OwnableUnauthorizedAccount\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UUPSUnauthorizedCallContext\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"slot\",\"type\":\"bytes32\"}],\"name\":\"UUPSUnsupportedProxiableUUID\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dataMarketAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"adminAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"name\":\"AdminsUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dataMarketAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"epochId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"BatchSubmissionsCompleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dataMarketAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"snapshotterAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"slotId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"dayId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"DailyTaskCompletedEvent\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"ownerAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"epochSize\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"sourceChainId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"sourceChainBlockTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"useBlockNumberAsEpochId\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"protocolState\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"dataMarketAddress\",\"type\":\"address\"}],\"name\":\"DataMarketCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dataMarketAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"dayId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"DayStartedEvent\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dataMarketAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"batchId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"epochId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"validatorAddr\",\"type\":\"address\"}],\"name\":\"DelayedAttestationSubmitted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dataMarketAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"batchId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"batchCid\",\"type\":\"string\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"epochId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"DelayedBatchSubmitted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dataMarketAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"snapshotterAddr\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"slotId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"snapshotCid\",\"type\":\"string\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"epochId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"projectId\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"DelayedSnapshotSubmitted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dataMarketAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"epochId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"begin\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"end\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"EpochReleased\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dataMarketAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"projectType\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"enableEpochId\",\"type\":\"uint256\"}],\"name\":\"ProjectTypeUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dataMarketAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string[]\",\"name\":\"projects\",\"type\":\"string[]\"},{\"indexed\":false,\"internalType\":\"bool[]\",\"name\":\"status\",\"type\":\"bool[]\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"enableEpochId\",\"type\":\"uint256\"}],\"name\":\"ProjectsUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dataMarketAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sequencerAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"name\":\"SequencersUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dataMarketAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"batchId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"epochId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"validatorAddr\",\"type\":\"address\"}],\"name\":\"SnapshotBatchAttestationSubmitted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dataMarketAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"epochId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"batchId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"SnapshotBatchFinalized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dataMarketAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"batchId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"batchCid\",\"type\":\"string\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"epochId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"SnapshotBatchSubmitted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dataMarketAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"epochId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"epochEnd\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"projectId\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"snapshotCid\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"SnapshotFinalized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dataMarketAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"epochId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"batchId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"TriggerBatchResubmission\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dataMarketAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"epochId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"batchId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"validator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"ValidatorAttestationsInvalidated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dataMarketAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"validatorAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"name\":\"ValidatorsUpdated\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"}],\"name\":\"EPOCH_SIZE\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"}],\"name\":\"SOURCE_CHAIN_BLOCK_TIME\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"}],\"name\":\"SOURCE_CHAIN_ID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"UPGRADE_INTERFACE_VERSION\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"}],\"name\":\"USE_BLOCK_NUMBER_AS_EPOCH_ID\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"allSnapshotters\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"projectType\",\"type\":\"string\"}],\"name\":\"allowedProjectTypes\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"_slotIds\",\"type\":\"uint256[]\"},{\"internalType\":\"address[]\",\"name\":\"_snapshotterAddresses\",\"type\":\"address[]\"}],\"name\":\"assignSnapshotterToSlotBulk\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"}],\"name\":\"attestationSubmissionWindow\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"batchId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"validator\",\"type\":\"address\"}],\"name\":\"attestationsReceived\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"batchId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"finalizedCidsRootHash\",\"type\":\"bytes32\"}],\"name\":\"attestationsReceivedCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"batchId\",\"type\":\"uint256\"}],\"name\":\"batchIdAttestationStatus\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"batchId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"idx\",\"type\":\"uint256\"}],\"name\":\"batchIdDivergentValidators\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"batchId\",\"type\":\"uint256\"}],\"name\":\"batchIdSequencerAttestation\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"batchId\",\"type\":\"uint256\"}],\"name\":\"batchIdToProjects\",\"outputs\":[{\"internalType\":\"string[]\",\"name\":\"\",\"type\":\"string[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"}],\"name\":\"batchSubmissionWindow\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"batchId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"epochId\",\"type\":\"uint256\"}],\"name\":\"checkDynamicConsensusAttestations\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"slotId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"day\",\"type\":\"uint256\"}],\"name\":\"checkSlotTaskStatusForDay\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"ownerAddress\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"epochSize\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"sourceChainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"sourceChainBlockTime\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"useBlockNumberAsEpochId\",\"type\":\"bool\"}],\"name\":\"createDataMarket\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"}],\"name\":\"currentBatchId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"}],\"name\":\"currentEpoch\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"begin\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"end\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"epochId\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"}],\"name\":\"dailySnapshotQuota\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"dataMarketCount\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"dataMarketAddress\",\"type\":\"address\"}],\"name\":\"dataMarketEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"dataMarketFactory\",\"outputs\":[{\"internalType\":\"contractDataMarketFactory\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"dataMarketId\",\"type\":\"uint8\"}],\"name\":\"dataMarketIdToAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"dataMarketAddress\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"dataMarkets\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"ownerAddress\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"epochSize\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"sourceChainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"sourceChainBlockTime\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"useBlockNumberAsEpochId\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"dataMarketAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"createdAt\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"}],\"name\":\"dayCounter\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"}],\"name\":\"deploymentBlockNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"epochId\",\"type\":\"uint256\"}],\"name\":\"endBatchSubmissions\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"epochId\",\"type\":\"uint256\"}],\"name\":\"epochIdToBatchIds\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"epochId\",\"type\":\"uint256\"}],\"name\":\"epochInfo\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blocknumber\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"epochEnd\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"}],\"name\":\"epochManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"}],\"name\":\"epochsInADay\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"batchId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"epochId\",\"type\":\"uint256\"}],\"name\":\"forceCompleteConsensusAttestations\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"begin\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"end\",\"type\":\"uint256\"}],\"name\":\"forceSkipEpoch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"}],\"name\":\"getEpochManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"}],\"name\":\"getSequencerId\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"}],\"name\":\"getSequencers\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"slotId\",\"type\":\"uint256\"}],\"name\":\"getSlotInfo\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"slotId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"snapshotterAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"rewardPoints\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"currentDaySnapshotCount\",\"type\":\"uint256\"}],\"internalType\":\"structPowerloomDataMarket.SlotInfo\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"slotId\",\"type\":\"uint256\"}],\"name\":\"getSlotRewards\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"rewards\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"}],\"name\":\"getTotalSequencersCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTotalSnapshotterCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"}],\"name\":\"getTotalValidatorsCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"}],\"name\":\"getValidators\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"initialOwner\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"projectId\",\"type\":\"string\"}],\"name\":\"lastFinalizedSnapshot\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_dayCounter\",\"type\":\"uint256\"}],\"name\":\"loadCurrentDay\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"slotId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"dayId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"snapshotCount\",\"type\":\"uint256\"}],\"name\":\"loadSlotSubmissions\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"batchId\",\"type\":\"uint256\"}],\"name\":\"maxAttestationFinalizedRootHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"batchId\",\"type\":\"uint256\"}],\"name\":\"maxAttestationsCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"projectId\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"epochId\",\"type\":\"uint256\"}],\"name\":\"maxSnapshotsCid\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"}],\"name\":\"minAttestationsForConsensus\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"}],\"name\":\"minSubmissionsForConsensus\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"projectId\",\"type\":\"string\"}],\"name\":\"projectFirstEpochId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"begin\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"end\",\"type\":\"uint256\"}],\"name\":\"releaseEpoch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"}],\"name\":\"rewardBasePoints\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"}],\"name\":\"rewardsEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_sequencerId\",\"type\":\"string\"}],\"name\":\"setSequencerId\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"slotCounter\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"slotId\",\"type\":\"uint256\"}],\"name\":\"slotRewardPoints\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"slotRewards\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"slotId\",\"type\":\"uint256\"}],\"name\":\"slotSnapshotterMapping\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"slotId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"dayId\",\"type\":\"uint256\"}],\"name\":\"slotSubmissionCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"projectId\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"epochId\",\"type\":\"uint256\"}],\"name\":\"snapshotStatus\",\"outputs\":[{\"internalType\":\"enumPowerloomDataMarket.SnapshotStatus\",\"name\":\"status\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"snapshotCid\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"}],\"name\":\"snapshotSubmissionWindow\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"snapshotterState\",\"outputs\":[{\"internalType\":\"contractSnapshotterState\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"batchId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"epochId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"finalizedCidsRootHash\",\"type\":\"bytes32\"}],\"name\":\"submitBatchAttestation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"slotId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"snapshotCid\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"epochId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"projectId\",\"type\":\"string\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"slotId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"snapshotCid\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"epochId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"projectId\",\"type\":\"string\"}],\"internalType\":\"structPowerloomDataMarket.Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"submitSnapshot\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"batchCid\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"batchId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"epochId\",\"type\":\"uint256\"},{\"internalType\":\"string[]\",\"name\":\"projectIds\",\"type\":\"string[]\"},{\"internalType\":\"string[]\",\"name\":\"snapshotCids\",\"type\":\"string[]\"},{\"internalType\":\"bytes32\",\"name\":\"finalizedCidsRootHash\",\"type\":\"bytes32\"}],\"name\":\"submitSubmissionBatch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"dataMarketAddress\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"name\":\"toggleDataMarket\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"}],\"name\":\"toggleFallback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"}],\"name\":\"toggleRewards\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"enumPowerloomDataMarket.Role\",\"name\":\"role\",\"type\":\"uint8\"},{\"internalType\":\"address[]\",\"name\":\"_addresses\",\"type\":\"address[]\"},{\"internalType\":\"bool[]\",\"name\":\"_status\",\"type\":\"bool[]\"}],\"name\":\"updateAddresses\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_projectType\",\"type\":\"string\"},{\"internalType\":\"bool\",\"name\":\"_status\",\"type\":\"bool\"}],\"name\":\"updateAllowedProjectType\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"newattestationSubmissionWindow\",\"type\":\"uint256\"}],\"name\":\"updateAttestationSubmissionWindow\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"newbatchSubmissionWindow\",\"type\":\"uint256\"}],\"name\":\"updateBatchSubmissionWindow\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_dailySnapshotQuota\",\"type\":\"uint256\"}],\"name\":\"updateDailySnapshotQuota\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"}],\"name\":\"updateDataMarketFactory\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"}],\"name\":\"updateEpochManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"_fallbackNodes\",\"type\":\"address[]\"},{\"internalType\":\"bool[]\",\"name\":\"_status\",\"type\":\"bool[]\"}],\"name\":\"updateFallbackNodes\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_minAttestationsForConsensus\",\"type\":\"uint256\"}],\"name\":\"updateMinAttestationsForConsensus\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_minSubmissionsForConsensus\",\"type\":\"uint256\"}],\"name\":\"updateMinSnapshottersForConsensus\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"string[]\",\"name\":\"_projects\",\"type\":\"string[]\"},{\"internalType\":\"bool[]\",\"name\":\"_status\",\"type\":\"bool[]\"}],\"name\":\"updateProjects\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"newRewardBasePoints\",\"type\":\"uint256\"}],\"name\":\"updateRewardBasePoints\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"slotIds\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"submissionsList\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256\",\"name\":\"day\",\"type\":\"uint256\"}],\"name\":\"updateRewards\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"newsnapshotSubmissionWindow\",\"type\":\"uint256\"}],\"name\":\"updateSnapshotSubmissionWindow\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"}],\"name\":\"updateSnapshotterState\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}]", + ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"}],\"name\":\"AddressEmptyCode\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"ERC1967InvalidImplementation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ERC1967NonPayable\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedCall\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidInitialization\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"OwnableInvalidOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"OwnableUnauthorizedAccount\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UUPSUnauthorizedCallContext\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"slot\",\"type\":\"bytes32\"}],\"name\":\"UUPSUnsupportedProxiableUUID\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dataMarketAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"adminAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"name\":\"AdminsUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dataMarketAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"epochId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"BatchSubmissionsCompleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dataMarketAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"snapshotterAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"slotId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"dayId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"DailyTaskCompletedEvent\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"ownerAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"epochSize\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"sourceChainId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"sourceChainBlockTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"useBlockNumberAsEpochId\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"protocolState\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"dataMarketAddress\",\"type\":\"address\"}],\"name\":\"DataMarketCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dataMarketAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"dayId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"DayStartedEvent\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dataMarketAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"batchCid\",\"type\":\"string\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"epochId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"validatorAddr\",\"type\":\"address\"}],\"name\":\"DelayedAttestationSubmitted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dataMarketAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"batchCid\",\"type\":\"string\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"epochId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"DelayedBatchSubmitted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dataMarketAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"snapshotterAddr\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"slotId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"snapshotCid\",\"type\":\"string\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"epochId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"projectId\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"DelayedSnapshotSubmitted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"EmergencyWithdraw\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dataMarketAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"epochId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"begin\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"end\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"EpochReleased\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"RewardsClaimed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dataMarketAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"snapshotterAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"slotId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"dayId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"rewardPoints\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"RewardsDistributedEvent\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dataMarketAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sequencerAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"name\":\"SequencersUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dataMarketAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"batchCid\",\"type\":\"string\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"epochId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"validatorAddr\",\"type\":\"address\"}],\"name\":\"SnapshotBatchAttestationSubmitted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dataMarketAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"epochId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"string\",\"name\":\"batchCid\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"SnapshotBatchFinalized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dataMarketAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"batchCid\",\"type\":\"string\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"epochId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"SnapshotBatchSubmitted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dataMarketAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"epochId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"epochEnd\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"projectId\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"snapshotCid\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"SnapshotFinalized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dataMarketAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"epochId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"string\",\"name\":\"batchCid\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"TriggerBatchResubmission\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dataMarketAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"epochId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"string\",\"name\":\"batchCid\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"validator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"ValidatorAttestationsInvalidated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dataMarketAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"validatorAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"name\":\"ValidatorsUpdated\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"}],\"name\":\"DAY_SIZE\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"}],\"name\":\"EPOCH_SIZE\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"}],\"name\":\"SOURCE_CHAIN_BLOCK_TIME\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"}],\"name\":\"SOURCE_CHAIN_ID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"UPGRADE_INTERFACE_VERSION\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"}],\"name\":\"USE_BLOCK_NUMBER_AS_EPOCH_ID\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"allSnapshotters\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"}],\"name\":\"attestationSubmissionWindow\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"batchCid\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"validator\",\"type\":\"address\"}],\"name\":\"attestationsReceived\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"batchCid\",\"type\":\"string\"},{\"internalType\":\"bytes32\",\"name\":\"finalizedCidsRootHash\",\"type\":\"bytes32\"}],\"name\":\"attestationsReceivedCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"batchCid\",\"type\":\"string\"}],\"name\":\"batchCidAttestationStatus\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"batchCid\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"idx\",\"type\":\"uint256\"}],\"name\":\"batchCidDivergentValidators\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"batchCid\",\"type\":\"string\"}],\"name\":\"batchCidSequencerAttestation\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"batchCid\",\"type\":\"string\"}],\"name\":\"batchCidToProjects\",\"outputs\":[{\"internalType\":\"string[]\",\"name\":\"\",\"type\":\"string[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"}],\"name\":\"batchSubmissionWindow\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"batchCid\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"epochId\",\"type\":\"uint256\"}],\"name\":\"checkDynamicConsensusAttestations\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"slotId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"day\",\"type\":\"uint256\"}],\"name\":\"checkSlotTaskStatusForDay\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_user\",\"type\":\"address\"}],\"name\":\"claimRewards\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"ownerAddress\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"epochSize\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"sourceChainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"sourceChainBlockTime\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"useBlockNumberAsEpochId\",\"type\":\"bool\"}],\"name\":\"createDataMarket\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"}],\"name\":\"currentEpoch\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"begin\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"end\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"epochId\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"}],\"name\":\"dailySnapshotQuota\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"dataMarketCount\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"dataMarketAddress\",\"type\":\"address\"}],\"name\":\"dataMarketEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"dataMarketFactory\",\"outputs\":[{\"internalType\":\"contractDataMarketFactory\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"dataMarketId\",\"type\":\"uint8\"}],\"name\":\"dataMarketIdToAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"dataMarketAddress\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"dataMarkets\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"ownerAddress\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"epochSize\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"sourceChainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"sourceChainBlockTime\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"useBlockNumberAsEpochId\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"dataMarketAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"createdAt\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"}],\"name\":\"dayCounter\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"}],\"name\":\"deploymentBlockNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"emergencyWithdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"enabledNodeCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"epochId\",\"type\":\"uint256\"}],\"name\":\"endBatchSubmissions\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"epochId\",\"type\":\"uint256\"}],\"name\":\"epochIdToBatchCids\",\"outputs\":[{\"internalType\":\"string[]\",\"name\":\"\",\"type\":\"string[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"epochId\",\"type\":\"uint256\"}],\"name\":\"epochInfo\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blocknumber\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"epochEnd\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"}],\"name\":\"epochManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"}],\"name\":\"epochsInADay\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"batchCid\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"epochId\",\"type\":\"uint256\"}],\"name\":\"forceCompleteConsensusAttestations\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"begin\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"end\",\"type\":\"uint256\"}],\"name\":\"forceSkipEpoch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"}],\"name\":\"getEpochManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"}],\"name\":\"getSequencerId\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"}],\"name\":\"getSequencers\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"slotId\",\"type\":\"uint256\"}],\"name\":\"getSlotInfo\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"slotId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"snapshotterAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"rewardPoints\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"currentDaySnapshotCount\",\"type\":\"uint256\"}],\"internalType\":\"structPowerloomDataMarket.SlotInfo\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"slotId\",\"type\":\"uint256\"}],\"name\":\"getSlotRewards\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"rewards\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTotalNodeCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"}],\"name\":\"getTotalSequencersCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTotalSnapshotterCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"}],\"name\":\"getTotalValidatorsCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"}],\"name\":\"getValidators\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"initialOwner\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"projectId\",\"type\":\"string\"}],\"name\":\"lastFinalizedSnapshot\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"projectId\",\"type\":\"string\"}],\"name\":\"lastSequencerFinalizedSnapshot\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_dayCounter\",\"type\":\"uint256\"}],\"name\":\"loadCurrentDay\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"slotId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"dayId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"snapshotCount\",\"type\":\"uint256\"}],\"name\":\"loadSlotSubmissions\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"batchCid\",\"type\":\"string\"}],\"name\":\"maxAttestationFinalizedRootHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"batchCid\",\"type\":\"string\"}],\"name\":\"maxAttestationsCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"projectId\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"epochId\",\"type\":\"uint256\"}],\"name\":\"maxSnapshotsCid\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"}],\"name\":\"minAttestationsForConsensus\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"projectId\",\"type\":\"string\"}],\"name\":\"projectFirstEpochId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"begin\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"end\",\"type\":\"uint256\"}],\"name\":\"releaseEpoch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"}],\"name\":\"rewardPoolSize\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"}],\"name\":\"rewardsEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_sequencerId\",\"type\":\"string\"}],\"name\":\"setSequencerId\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"slotId\",\"type\":\"uint256\"}],\"name\":\"slotRewardPoints\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"slotRewards\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"slotId\",\"type\":\"uint256\"}],\"name\":\"slotSnapshotterMapping\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"slotId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"dayId\",\"type\":\"uint256\"}],\"name\":\"slotSubmissionCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"projectId\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"epochId\",\"type\":\"uint256\"}],\"name\":\"snapshotStatus\",\"outputs\":[{\"internalType\":\"enumPowerloomDataMarket.SnapshotStatus\",\"name\":\"status\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"snapshotCid\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"}],\"name\":\"snapshotSubmissionWindow\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"snapshotterState\",\"outputs\":[{\"internalType\":\"contractPowerloomNodes\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"batchCid\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"epochId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"finalizedCidsRootHash\",\"type\":\"bytes32\"}],\"name\":\"submitBatchAttestation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"batchCid\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"epochId\",\"type\":\"uint256\"},{\"internalType\":\"string[]\",\"name\":\"projectIds\",\"type\":\"string[]\"},{\"internalType\":\"string[]\",\"name\":\"snapshotCids\",\"type\":\"string[]\"},{\"internalType\":\"bytes32\",\"name\":\"finalizedCidsRootHash\",\"type\":\"bytes32\"}],\"name\":\"submitSubmissionBatch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"dataMarketAddress\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"name\":\"toggleDataMarket\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"}],\"name\":\"toggleRewards\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"enumPowerloomDataMarket.Role\",\"name\":\"role\",\"type\":\"uint8\"},{\"internalType\":\"address[]\",\"name\":\"_addresses\",\"type\":\"address[]\"},{\"internalType\":\"bool[]\",\"name\":\"_status\",\"type\":\"bool[]\"}],\"name\":\"updateAddresses\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"newattestationSubmissionWindow\",\"type\":\"uint256\"}],\"name\":\"updateAttestationSubmissionWindow\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"newbatchSubmissionWindow\",\"type\":\"uint256\"}],\"name\":\"updateBatchSubmissionWindow\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_dailySnapshotQuota\",\"type\":\"uint256\"}],\"name\":\"updateDailySnapshotQuota\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"}],\"name\":\"updateDataMarketFactory\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"newDaySize\",\"type\":\"uint256\"}],\"name\":\"updateDaySize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"}],\"name\":\"updateEpochManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_minAttestationsForConsensus\",\"type\":\"uint256\"}],\"name\":\"updateMinAttestationsForConsensus\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"newRewardPoolSize\",\"type\":\"uint256\"}],\"name\":\"updateRewardPoolSize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"slotIds\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"submissionsList\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256\",\"name\":\"day\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"eligibleNodes\",\"type\":\"uint256\"}],\"name\":\"updateRewards\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractPowerloomDataMarket\",\"name\":\"dataMarket\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"newsnapshotSubmissionWindow\",\"type\":\"uint256\"}],\"name\":\"updateSnapshotSubmissionWindow\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"}],\"name\":\"updateSnapshotterState\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"userInfo\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"totalRewards\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"totalClaimed\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lastClaimed\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lastUpdated\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", } // ContractABI is the input ABI used to generate the binding from. @@ -197,6 +188,37 @@ func (_Contract *ContractTransactorRaw) Transact(opts *bind.TransactOpts, method return _Contract.Contract.contract.Transact(opts, method, params...) } +// DAYSIZE is a free data retrieval call binding the contract method 0x04a0a5bb. +// +// Solidity: function DAY_SIZE(address dataMarket) view returns(uint256) +func (_Contract *ContractCaller) DAYSIZE(opts *bind.CallOpts, dataMarket common.Address) (*big.Int, error) { + var out []interface{} + err := _Contract.contract.Call(opts, &out, "DAY_SIZE", dataMarket) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// DAYSIZE is a free data retrieval call binding the contract method 0x04a0a5bb. +// +// Solidity: function DAY_SIZE(address dataMarket) view returns(uint256) +func (_Contract *ContractSession) DAYSIZE(dataMarket common.Address) (*big.Int, error) { + return _Contract.Contract.DAYSIZE(&_Contract.CallOpts, dataMarket) +} + +// DAYSIZE is a free data retrieval call binding the contract method 0x04a0a5bb. +// +// Solidity: function DAY_SIZE(address dataMarket) view returns(uint256) +func (_Contract *ContractCallerSession) DAYSIZE(dataMarket common.Address) (*big.Int, error) { + return _Contract.Contract.DAYSIZE(&_Contract.CallOpts, dataMarket) +} + // EPOCHSIZE is a free data retrieval call binding the contract method 0xc12c2aa9. // // Solidity: function EPOCH_SIZE(address dataMarket) view returns(uint8) @@ -383,37 +405,6 @@ func (_Contract *ContractCallerSession) AllSnapshotters(addr common.Address) (bo return _Contract.Contract.AllSnapshotters(&_Contract.CallOpts, addr) } -// AllowedProjectTypes is a free data retrieval call binding the contract method 0xc17b3434. -// -// Solidity: function allowedProjectTypes(address dataMarket, string projectType) view returns(bool) -func (_Contract *ContractCaller) AllowedProjectTypes(opts *bind.CallOpts, dataMarket common.Address, projectType string) (bool, error) { - var out []interface{} - err := _Contract.contract.Call(opts, &out, "allowedProjectTypes", dataMarket, projectType) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// AllowedProjectTypes is a free data retrieval call binding the contract method 0xc17b3434. -// -// Solidity: function allowedProjectTypes(address dataMarket, string projectType) view returns(bool) -func (_Contract *ContractSession) AllowedProjectTypes(dataMarket common.Address, projectType string) (bool, error) { - return _Contract.Contract.AllowedProjectTypes(&_Contract.CallOpts, dataMarket, projectType) -} - -// AllowedProjectTypes is a free data retrieval call binding the contract method 0xc17b3434. -// -// Solidity: function allowedProjectTypes(address dataMarket, string projectType) view returns(bool) -func (_Contract *ContractCallerSession) AllowedProjectTypes(dataMarket common.Address, projectType string) (bool, error) { - return _Contract.Contract.AllowedProjectTypes(&_Contract.CallOpts, dataMarket, projectType) -} - // AttestationSubmissionWindow is a free data retrieval call binding the contract method 0xe1d5fbce. // // Solidity: function attestationSubmissionWindow(address dataMarket) view returns(uint256) @@ -445,12 +436,12 @@ func (_Contract *ContractCallerSession) AttestationSubmissionWindow(dataMarket c return _Contract.Contract.AttestationSubmissionWindow(&_Contract.CallOpts, dataMarket) } -// AttestationsReceived is a free data retrieval call binding the contract method 0xb09c5e2f. +// AttestationsReceived is a free data retrieval call binding the contract method 0x53a5a874. // -// Solidity: function attestationsReceived(address dataMarket, uint256 batchId, address validator) view returns(bool) -func (_Contract *ContractCaller) AttestationsReceived(opts *bind.CallOpts, dataMarket common.Address, batchId *big.Int, validator common.Address) (bool, error) { +// Solidity: function attestationsReceived(address dataMarket, string batchCid, address validator) view returns(bool) +func (_Contract *ContractCaller) AttestationsReceived(opts *bind.CallOpts, dataMarket common.Address, batchCid string, validator common.Address) (bool, error) { var out []interface{} - err := _Contract.contract.Call(opts, &out, "attestationsReceived", dataMarket, batchId, validator) + err := _Contract.contract.Call(opts, &out, "attestationsReceived", dataMarket, batchCid, validator) if err != nil { return *new(bool), err @@ -462,26 +453,26 @@ func (_Contract *ContractCaller) AttestationsReceived(opts *bind.CallOpts, dataM } -// AttestationsReceived is a free data retrieval call binding the contract method 0xb09c5e2f. +// AttestationsReceived is a free data retrieval call binding the contract method 0x53a5a874. // -// Solidity: function attestationsReceived(address dataMarket, uint256 batchId, address validator) view returns(bool) -func (_Contract *ContractSession) AttestationsReceived(dataMarket common.Address, batchId *big.Int, validator common.Address) (bool, error) { - return _Contract.Contract.AttestationsReceived(&_Contract.CallOpts, dataMarket, batchId, validator) +// Solidity: function attestationsReceived(address dataMarket, string batchCid, address validator) view returns(bool) +func (_Contract *ContractSession) AttestationsReceived(dataMarket common.Address, batchCid string, validator common.Address) (bool, error) { + return _Contract.Contract.AttestationsReceived(&_Contract.CallOpts, dataMarket, batchCid, validator) } -// AttestationsReceived is a free data retrieval call binding the contract method 0xb09c5e2f. +// AttestationsReceived is a free data retrieval call binding the contract method 0x53a5a874. // -// Solidity: function attestationsReceived(address dataMarket, uint256 batchId, address validator) view returns(bool) -func (_Contract *ContractCallerSession) AttestationsReceived(dataMarket common.Address, batchId *big.Int, validator common.Address) (bool, error) { - return _Contract.Contract.AttestationsReceived(&_Contract.CallOpts, dataMarket, batchId, validator) +// Solidity: function attestationsReceived(address dataMarket, string batchCid, address validator) view returns(bool) +func (_Contract *ContractCallerSession) AttestationsReceived(dataMarket common.Address, batchCid string, validator common.Address) (bool, error) { + return _Contract.Contract.AttestationsReceived(&_Contract.CallOpts, dataMarket, batchCid, validator) } -// AttestationsReceivedCount is a free data retrieval call binding the contract method 0x97b0b79f. +// AttestationsReceivedCount is a free data retrieval call binding the contract method 0x751b8eeb. // -// Solidity: function attestationsReceivedCount(address dataMarket, uint256 batchId, bytes32 finalizedCidsRootHash) view returns(uint256) -func (_Contract *ContractCaller) AttestationsReceivedCount(opts *bind.CallOpts, dataMarket common.Address, batchId *big.Int, finalizedCidsRootHash [32]byte) (*big.Int, error) { +// Solidity: function attestationsReceivedCount(address dataMarket, string batchCid, bytes32 finalizedCidsRootHash) view returns(uint256) +func (_Contract *ContractCaller) AttestationsReceivedCount(opts *bind.CallOpts, dataMarket common.Address, batchCid string, finalizedCidsRootHash [32]byte) (*big.Int, error) { var out []interface{} - err := _Contract.contract.Call(opts, &out, "attestationsReceivedCount", dataMarket, batchId, finalizedCidsRootHash) + err := _Contract.contract.Call(opts, &out, "attestationsReceivedCount", dataMarket, batchCid, finalizedCidsRootHash) if err != nil { return *new(*big.Int), err @@ -493,26 +484,26 @@ func (_Contract *ContractCaller) AttestationsReceivedCount(opts *bind.CallOpts, } -// AttestationsReceivedCount is a free data retrieval call binding the contract method 0x97b0b79f. +// AttestationsReceivedCount is a free data retrieval call binding the contract method 0x751b8eeb. // -// Solidity: function attestationsReceivedCount(address dataMarket, uint256 batchId, bytes32 finalizedCidsRootHash) view returns(uint256) -func (_Contract *ContractSession) AttestationsReceivedCount(dataMarket common.Address, batchId *big.Int, finalizedCidsRootHash [32]byte) (*big.Int, error) { - return _Contract.Contract.AttestationsReceivedCount(&_Contract.CallOpts, dataMarket, batchId, finalizedCidsRootHash) +// Solidity: function attestationsReceivedCount(address dataMarket, string batchCid, bytes32 finalizedCidsRootHash) view returns(uint256) +func (_Contract *ContractSession) AttestationsReceivedCount(dataMarket common.Address, batchCid string, finalizedCidsRootHash [32]byte) (*big.Int, error) { + return _Contract.Contract.AttestationsReceivedCount(&_Contract.CallOpts, dataMarket, batchCid, finalizedCidsRootHash) } -// AttestationsReceivedCount is a free data retrieval call binding the contract method 0x97b0b79f. +// AttestationsReceivedCount is a free data retrieval call binding the contract method 0x751b8eeb. // -// Solidity: function attestationsReceivedCount(address dataMarket, uint256 batchId, bytes32 finalizedCidsRootHash) view returns(uint256) -func (_Contract *ContractCallerSession) AttestationsReceivedCount(dataMarket common.Address, batchId *big.Int, finalizedCidsRootHash [32]byte) (*big.Int, error) { - return _Contract.Contract.AttestationsReceivedCount(&_Contract.CallOpts, dataMarket, batchId, finalizedCidsRootHash) +// Solidity: function attestationsReceivedCount(address dataMarket, string batchCid, bytes32 finalizedCidsRootHash) view returns(uint256) +func (_Contract *ContractCallerSession) AttestationsReceivedCount(dataMarket common.Address, batchCid string, finalizedCidsRootHash [32]byte) (*big.Int, error) { + return _Contract.Contract.AttestationsReceivedCount(&_Contract.CallOpts, dataMarket, batchCid, finalizedCidsRootHash) } -// BatchIdAttestationStatus is a free data retrieval call binding the contract method 0xd4e1a3d1. +// BatchCidAttestationStatus is a free data retrieval call binding the contract method 0xb646154f. // -// Solidity: function batchIdAttestationStatus(address dataMarket, uint256 batchId) view returns(bool) -func (_Contract *ContractCaller) BatchIdAttestationStatus(opts *bind.CallOpts, dataMarket common.Address, batchId *big.Int) (bool, error) { +// Solidity: function batchCidAttestationStatus(address dataMarket, string batchCid) view returns(bool) +func (_Contract *ContractCaller) BatchCidAttestationStatus(opts *bind.CallOpts, dataMarket common.Address, batchCid string) (bool, error) { var out []interface{} - err := _Contract.contract.Call(opts, &out, "batchIdAttestationStatus", dataMarket, batchId) + err := _Contract.contract.Call(opts, &out, "batchCidAttestationStatus", dataMarket, batchCid) if err != nil { return *new(bool), err @@ -524,26 +515,26 @@ func (_Contract *ContractCaller) BatchIdAttestationStatus(opts *bind.CallOpts, d } -// BatchIdAttestationStatus is a free data retrieval call binding the contract method 0xd4e1a3d1. +// BatchCidAttestationStatus is a free data retrieval call binding the contract method 0xb646154f. // -// Solidity: function batchIdAttestationStatus(address dataMarket, uint256 batchId) view returns(bool) -func (_Contract *ContractSession) BatchIdAttestationStatus(dataMarket common.Address, batchId *big.Int) (bool, error) { - return _Contract.Contract.BatchIdAttestationStatus(&_Contract.CallOpts, dataMarket, batchId) +// Solidity: function batchCidAttestationStatus(address dataMarket, string batchCid) view returns(bool) +func (_Contract *ContractSession) BatchCidAttestationStatus(dataMarket common.Address, batchCid string) (bool, error) { + return _Contract.Contract.BatchCidAttestationStatus(&_Contract.CallOpts, dataMarket, batchCid) } -// BatchIdAttestationStatus is a free data retrieval call binding the contract method 0xd4e1a3d1. +// BatchCidAttestationStatus is a free data retrieval call binding the contract method 0xb646154f. // -// Solidity: function batchIdAttestationStatus(address dataMarket, uint256 batchId) view returns(bool) -func (_Contract *ContractCallerSession) BatchIdAttestationStatus(dataMarket common.Address, batchId *big.Int) (bool, error) { - return _Contract.Contract.BatchIdAttestationStatus(&_Contract.CallOpts, dataMarket, batchId) +// Solidity: function batchCidAttestationStatus(address dataMarket, string batchCid) view returns(bool) +func (_Contract *ContractCallerSession) BatchCidAttestationStatus(dataMarket common.Address, batchCid string) (bool, error) { + return _Contract.Contract.BatchCidAttestationStatus(&_Contract.CallOpts, dataMarket, batchCid) } -// BatchIdDivergentValidators is a free data retrieval call binding the contract method 0x52ec368a. +// BatchCidDivergentValidators is a free data retrieval call binding the contract method 0x4ecac85a. // -// Solidity: function batchIdDivergentValidators(address dataMarket, uint256 batchId, uint256 idx) view returns(address) -func (_Contract *ContractCaller) BatchIdDivergentValidators(opts *bind.CallOpts, dataMarket common.Address, batchId *big.Int, idx *big.Int) (common.Address, error) { +// Solidity: function batchCidDivergentValidators(address dataMarket, string batchCid, uint256 idx) view returns(address) +func (_Contract *ContractCaller) BatchCidDivergentValidators(opts *bind.CallOpts, dataMarket common.Address, batchCid string, idx *big.Int) (common.Address, error) { var out []interface{} - err := _Contract.contract.Call(opts, &out, "batchIdDivergentValidators", dataMarket, batchId, idx) + err := _Contract.contract.Call(opts, &out, "batchCidDivergentValidators", dataMarket, batchCid, idx) if err != nil { return *new(common.Address), err @@ -555,26 +546,26 @@ func (_Contract *ContractCaller) BatchIdDivergentValidators(opts *bind.CallOpts, } -// BatchIdDivergentValidators is a free data retrieval call binding the contract method 0x52ec368a. +// BatchCidDivergentValidators is a free data retrieval call binding the contract method 0x4ecac85a. // -// Solidity: function batchIdDivergentValidators(address dataMarket, uint256 batchId, uint256 idx) view returns(address) -func (_Contract *ContractSession) BatchIdDivergentValidators(dataMarket common.Address, batchId *big.Int, idx *big.Int) (common.Address, error) { - return _Contract.Contract.BatchIdDivergentValidators(&_Contract.CallOpts, dataMarket, batchId, idx) +// Solidity: function batchCidDivergentValidators(address dataMarket, string batchCid, uint256 idx) view returns(address) +func (_Contract *ContractSession) BatchCidDivergentValidators(dataMarket common.Address, batchCid string, idx *big.Int) (common.Address, error) { + return _Contract.Contract.BatchCidDivergentValidators(&_Contract.CallOpts, dataMarket, batchCid, idx) } -// BatchIdDivergentValidators is a free data retrieval call binding the contract method 0x52ec368a. +// BatchCidDivergentValidators is a free data retrieval call binding the contract method 0x4ecac85a. // -// Solidity: function batchIdDivergentValidators(address dataMarket, uint256 batchId, uint256 idx) view returns(address) -func (_Contract *ContractCallerSession) BatchIdDivergentValidators(dataMarket common.Address, batchId *big.Int, idx *big.Int) (common.Address, error) { - return _Contract.Contract.BatchIdDivergentValidators(&_Contract.CallOpts, dataMarket, batchId, idx) +// Solidity: function batchCidDivergentValidators(address dataMarket, string batchCid, uint256 idx) view returns(address) +func (_Contract *ContractCallerSession) BatchCidDivergentValidators(dataMarket common.Address, batchCid string, idx *big.Int) (common.Address, error) { + return _Contract.Contract.BatchCidDivergentValidators(&_Contract.CallOpts, dataMarket, batchCid, idx) } -// BatchIdSequencerAttestation is a free data retrieval call binding the contract method 0x2564a9a6. +// BatchCidSequencerAttestation is a free data retrieval call binding the contract method 0xc1045a5f. // -// Solidity: function batchIdSequencerAttestation(address dataMarket, uint256 batchId) view returns(bytes32) -func (_Contract *ContractCaller) BatchIdSequencerAttestation(opts *bind.CallOpts, dataMarket common.Address, batchId *big.Int) ([32]byte, error) { +// Solidity: function batchCidSequencerAttestation(address dataMarket, string batchCid) view returns(bytes32) +func (_Contract *ContractCaller) BatchCidSequencerAttestation(opts *bind.CallOpts, dataMarket common.Address, batchCid string) ([32]byte, error) { var out []interface{} - err := _Contract.contract.Call(opts, &out, "batchIdSequencerAttestation", dataMarket, batchId) + err := _Contract.contract.Call(opts, &out, "batchCidSequencerAttestation", dataMarket, batchCid) if err != nil { return *new([32]byte), err @@ -586,26 +577,26 @@ func (_Contract *ContractCaller) BatchIdSequencerAttestation(opts *bind.CallOpts } -// BatchIdSequencerAttestation is a free data retrieval call binding the contract method 0x2564a9a6. +// BatchCidSequencerAttestation is a free data retrieval call binding the contract method 0xc1045a5f. // -// Solidity: function batchIdSequencerAttestation(address dataMarket, uint256 batchId) view returns(bytes32) -func (_Contract *ContractSession) BatchIdSequencerAttestation(dataMarket common.Address, batchId *big.Int) ([32]byte, error) { - return _Contract.Contract.BatchIdSequencerAttestation(&_Contract.CallOpts, dataMarket, batchId) +// Solidity: function batchCidSequencerAttestation(address dataMarket, string batchCid) view returns(bytes32) +func (_Contract *ContractSession) BatchCidSequencerAttestation(dataMarket common.Address, batchCid string) ([32]byte, error) { + return _Contract.Contract.BatchCidSequencerAttestation(&_Contract.CallOpts, dataMarket, batchCid) } -// BatchIdSequencerAttestation is a free data retrieval call binding the contract method 0x2564a9a6. +// BatchCidSequencerAttestation is a free data retrieval call binding the contract method 0xc1045a5f. // -// Solidity: function batchIdSequencerAttestation(address dataMarket, uint256 batchId) view returns(bytes32) -func (_Contract *ContractCallerSession) BatchIdSequencerAttestation(dataMarket common.Address, batchId *big.Int) ([32]byte, error) { - return _Contract.Contract.BatchIdSequencerAttestation(&_Contract.CallOpts, dataMarket, batchId) +// Solidity: function batchCidSequencerAttestation(address dataMarket, string batchCid) view returns(bytes32) +func (_Contract *ContractCallerSession) BatchCidSequencerAttestation(dataMarket common.Address, batchCid string) ([32]byte, error) { + return _Contract.Contract.BatchCidSequencerAttestation(&_Contract.CallOpts, dataMarket, batchCid) } -// BatchIdToProjects is a free data retrieval call binding the contract method 0xda648f92. +// BatchCidToProjects is a free data retrieval call binding the contract method 0xe06a9ecb. // -// Solidity: function batchIdToProjects(address dataMarket, uint256 batchId) view returns(string[]) -func (_Contract *ContractCaller) BatchIdToProjects(opts *bind.CallOpts, dataMarket common.Address, batchId *big.Int) ([]string, error) { +// Solidity: function batchCidToProjects(address dataMarket, string batchCid) view returns(string[]) +func (_Contract *ContractCaller) BatchCidToProjects(opts *bind.CallOpts, dataMarket common.Address, batchCid string) ([]string, error) { var out []interface{} - err := _Contract.contract.Call(opts, &out, "batchIdToProjects", dataMarket, batchId) + err := _Contract.contract.Call(opts, &out, "batchCidToProjects", dataMarket, batchCid) if err != nil { return *new([]string), err @@ -617,18 +608,18 @@ func (_Contract *ContractCaller) BatchIdToProjects(opts *bind.CallOpts, dataMark } -// BatchIdToProjects is a free data retrieval call binding the contract method 0xda648f92. +// BatchCidToProjects is a free data retrieval call binding the contract method 0xe06a9ecb. // -// Solidity: function batchIdToProjects(address dataMarket, uint256 batchId) view returns(string[]) -func (_Contract *ContractSession) BatchIdToProjects(dataMarket common.Address, batchId *big.Int) ([]string, error) { - return _Contract.Contract.BatchIdToProjects(&_Contract.CallOpts, dataMarket, batchId) +// Solidity: function batchCidToProjects(address dataMarket, string batchCid) view returns(string[]) +func (_Contract *ContractSession) BatchCidToProjects(dataMarket common.Address, batchCid string) ([]string, error) { + return _Contract.Contract.BatchCidToProjects(&_Contract.CallOpts, dataMarket, batchCid) } -// BatchIdToProjects is a free data retrieval call binding the contract method 0xda648f92. +// BatchCidToProjects is a free data retrieval call binding the contract method 0xe06a9ecb. // -// Solidity: function batchIdToProjects(address dataMarket, uint256 batchId) view returns(string[]) -func (_Contract *ContractCallerSession) BatchIdToProjects(dataMarket common.Address, batchId *big.Int) ([]string, error) { - return _Contract.Contract.BatchIdToProjects(&_Contract.CallOpts, dataMarket, batchId) +// Solidity: function batchCidToProjects(address dataMarket, string batchCid) view returns(string[]) +func (_Contract *ContractCallerSession) BatchCidToProjects(dataMarket common.Address, batchCid string) ([]string, error) { + return _Contract.Contract.BatchCidToProjects(&_Contract.CallOpts, dataMarket, batchCid) } // BatchSubmissionWindow is a free data retrieval call binding the contract method 0x4d9c25d4. @@ -662,12 +653,12 @@ func (_Contract *ContractCallerSession) BatchSubmissionWindow(dataMarket common. return _Contract.Contract.BatchSubmissionWindow(&_Contract.CallOpts, dataMarket) } -// CheckDynamicConsensusAttestations is a free data retrieval call binding the contract method 0x20cfff83. +// CheckDynamicConsensusAttestations is a free data retrieval call binding the contract method 0x687d738d. // -// Solidity: function checkDynamicConsensusAttestations(address dataMarket, uint256 batchId, uint256 epochId) view returns(bool) -func (_Contract *ContractCaller) CheckDynamicConsensusAttestations(opts *bind.CallOpts, dataMarket common.Address, batchId *big.Int, epochId *big.Int) (bool, error) { +// Solidity: function checkDynamicConsensusAttestations(address dataMarket, string batchCid, uint256 epochId) view returns(bool) +func (_Contract *ContractCaller) CheckDynamicConsensusAttestations(opts *bind.CallOpts, dataMarket common.Address, batchCid string, epochId *big.Int) (bool, error) { var out []interface{} - err := _Contract.contract.Call(opts, &out, "checkDynamicConsensusAttestations", dataMarket, batchId, epochId) + err := _Contract.contract.Call(opts, &out, "checkDynamicConsensusAttestations", dataMarket, batchCid, epochId) if err != nil { return *new(bool), err @@ -679,18 +670,18 @@ func (_Contract *ContractCaller) CheckDynamicConsensusAttestations(opts *bind.Ca } -// CheckDynamicConsensusAttestations is a free data retrieval call binding the contract method 0x20cfff83. +// CheckDynamicConsensusAttestations is a free data retrieval call binding the contract method 0x687d738d. // -// Solidity: function checkDynamicConsensusAttestations(address dataMarket, uint256 batchId, uint256 epochId) view returns(bool) -func (_Contract *ContractSession) CheckDynamicConsensusAttestations(dataMarket common.Address, batchId *big.Int, epochId *big.Int) (bool, error) { - return _Contract.Contract.CheckDynamicConsensusAttestations(&_Contract.CallOpts, dataMarket, batchId, epochId) +// Solidity: function checkDynamicConsensusAttestations(address dataMarket, string batchCid, uint256 epochId) view returns(bool) +func (_Contract *ContractSession) CheckDynamicConsensusAttestations(dataMarket common.Address, batchCid string, epochId *big.Int) (bool, error) { + return _Contract.Contract.CheckDynamicConsensusAttestations(&_Contract.CallOpts, dataMarket, batchCid, epochId) } -// CheckDynamicConsensusAttestations is a free data retrieval call binding the contract method 0x20cfff83. +// CheckDynamicConsensusAttestations is a free data retrieval call binding the contract method 0x687d738d. // -// Solidity: function checkDynamicConsensusAttestations(address dataMarket, uint256 batchId, uint256 epochId) view returns(bool) -func (_Contract *ContractCallerSession) CheckDynamicConsensusAttestations(dataMarket common.Address, batchId *big.Int, epochId *big.Int) (bool, error) { - return _Contract.Contract.CheckDynamicConsensusAttestations(&_Contract.CallOpts, dataMarket, batchId, epochId) +// Solidity: function checkDynamicConsensusAttestations(address dataMarket, string batchCid, uint256 epochId) view returns(bool) +func (_Contract *ContractCallerSession) CheckDynamicConsensusAttestations(dataMarket common.Address, batchCid string, epochId *big.Int) (bool, error) { + return _Contract.Contract.CheckDynamicConsensusAttestations(&_Contract.CallOpts, dataMarket, batchCid, epochId) } // CheckSlotTaskStatusForDay is a free data retrieval call binding the contract method 0xc00d0f9c. @@ -724,37 +715,6 @@ func (_Contract *ContractCallerSession) CheckSlotTaskStatusForDay(dataMarket com return _Contract.Contract.CheckSlotTaskStatusForDay(&_Contract.CallOpts, dataMarket, slotId, day) } -// CurrentBatchId is a free data retrieval call binding the contract method 0x5edba3d3. -// -// Solidity: function currentBatchId(address dataMarket) view returns(uint256) -func (_Contract *ContractCaller) CurrentBatchId(opts *bind.CallOpts, dataMarket common.Address) (*big.Int, error) { - var out []interface{} - err := _Contract.contract.Call(opts, &out, "currentBatchId", dataMarket) - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// CurrentBatchId is a free data retrieval call binding the contract method 0x5edba3d3. -// -// Solidity: function currentBatchId(address dataMarket) view returns(uint256) -func (_Contract *ContractSession) CurrentBatchId(dataMarket common.Address) (*big.Int, error) { - return _Contract.Contract.CurrentBatchId(&_Contract.CallOpts, dataMarket) -} - -// CurrentBatchId is a free data retrieval call binding the contract method 0x5edba3d3. -// -// Solidity: function currentBatchId(address dataMarket) view returns(uint256) -func (_Contract *ContractCallerSession) CurrentBatchId(dataMarket common.Address) (*big.Int, error) { - return _Contract.Contract.CurrentBatchId(&_Contract.CallOpts, dataMarket) -} - // CurrentEpoch is a free data retrieval call binding the contract method 0x0736e19f. // // Solidity: function currentEpoch(address dataMarket) view returns(uint256 begin, uint256 end, uint256 epochId) @@ -1097,35 +1057,66 @@ func (_Contract *ContractCallerSession) DeploymentBlockNumber(dataMarket common. return _Contract.Contract.DeploymentBlockNumber(&_Contract.CallOpts, dataMarket) } -// EpochIdToBatchIds is a free data retrieval call binding the contract method 0xe72eeb97. +// EnabledNodeCount is a free data retrieval call binding the contract method 0xce7b6afb. +// +// Solidity: function enabledNodeCount() view returns(uint256) +func (_Contract *ContractCaller) EnabledNodeCount(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _Contract.contract.Call(opts, &out, "enabledNodeCount") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// EnabledNodeCount is a free data retrieval call binding the contract method 0xce7b6afb. +// +// Solidity: function enabledNodeCount() view returns(uint256) +func (_Contract *ContractSession) EnabledNodeCount() (*big.Int, error) { + return _Contract.Contract.EnabledNodeCount(&_Contract.CallOpts) +} + +// EnabledNodeCount is a free data retrieval call binding the contract method 0xce7b6afb. +// +// Solidity: function enabledNodeCount() view returns(uint256) +func (_Contract *ContractCallerSession) EnabledNodeCount() (*big.Int, error) { + return _Contract.Contract.EnabledNodeCount(&_Contract.CallOpts) +} + +// EpochIdToBatchCids is a free data retrieval call binding the contract method 0x2edb1d00. // -// Solidity: function epochIdToBatchIds(address dataMarket, uint256 epochId) view returns(uint256[]) -func (_Contract *ContractCaller) EpochIdToBatchIds(opts *bind.CallOpts, dataMarket common.Address, epochId *big.Int) ([]*big.Int, error) { +// Solidity: function epochIdToBatchCids(address dataMarket, uint256 epochId) view returns(string[]) +func (_Contract *ContractCaller) EpochIdToBatchCids(opts *bind.CallOpts, dataMarket common.Address, epochId *big.Int) ([]string, error) { var out []interface{} - err := _Contract.contract.Call(opts, &out, "epochIdToBatchIds", dataMarket, epochId) + err := _Contract.contract.Call(opts, &out, "epochIdToBatchCids", dataMarket, epochId) if err != nil { - return *new([]*big.Int), err + return *new([]string), err } - out0 := *abi.ConvertType(out[0], new([]*big.Int)).(*[]*big.Int) + out0 := *abi.ConvertType(out[0], new([]string)).(*[]string) return out0, err } -// EpochIdToBatchIds is a free data retrieval call binding the contract method 0xe72eeb97. +// EpochIdToBatchCids is a free data retrieval call binding the contract method 0x2edb1d00. // -// Solidity: function epochIdToBatchIds(address dataMarket, uint256 epochId) view returns(uint256[]) -func (_Contract *ContractSession) EpochIdToBatchIds(dataMarket common.Address, epochId *big.Int) ([]*big.Int, error) { - return _Contract.Contract.EpochIdToBatchIds(&_Contract.CallOpts, dataMarket, epochId) +// Solidity: function epochIdToBatchCids(address dataMarket, uint256 epochId) view returns(string[]) +func (_Contract *ContractSession) EpochIdToBatchCids(dataMarket common.Address, epochId *big.Int) ([]string, error) { + return _Contract.Contract.EpochIdToBatchCids(&_Contract.CallOpts, dataMarket, epochId) } -// EpochIdToBatchIds is a free data retrieval call binding the contract method 0xe72eeb97. +// EpochIdToBatchCids is a free data retrieval call binding the contract method 0x2edb1d00. // -// Solidity: function epochIdToBatchIds(address dataMarket, uint256 epochId) view returns(uint256[]) -func (_Contract *ContractCallerSession) EpochIdToBatchIds(dataMarket common.Address, epochId *big.Int) ([]*big.Int, error) { - return _Contract.Contract.EpochIdToBatchIds(&_Contract.CallOpts, dataMarket, epochId) +// Solidity: function epochIdToBatchCids(address dataMarket, uint256 epochId) view returns(string[]) +func (_Contract *ContractCallerSession) EpochIdToBatchCids(dataMarket common.Address, epochId *big.Int) ([]string, error) { + return _Contract.Contract.EpochIdToBatchCids(&_Contract.CallOpts, dataMarket, epochId) } // EpochInfo is a free data retrieval call binding the contract method 0xc9ab0c83. @@ -1395,6 +1386,37 @@ func (_Contract *ContractCallerSession) GetSlotRewards(slotId *big.Int) (*big.In return _Contract.Contract.GetSlotRewards(&_Contract.CallOpts, slotId) } +// GetTotalNodeCount is a free data retrieval call binding the contract method 0x4110fe25. +// +// Solidity: function getTotalNodeCount() view returns(uint256) +func (_Contract *ContractCaller) GetTotalNodeCount(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _Contract.contract.Call(opts, &out, "getTotalNodeCount") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetTotalNodeCount is a free data retrieval call binding the contract method 0x4110fe25. +// +// Solidity: function getTotalNodeCount() view returns(uint256) +func (_Contract *ContractSession) GetTotalNodeCount() (*big.Int, error) { + return _Contract.Contract.GetTotalNodeCount(&_Contract.CallOpts) +} + +// GetTotalNodeCount is a free data retrieval call binding the contract method 0x4110fe25. +// +// Solidity: function getTotalNodeCount() view returns(uint256) +func (_Contract *ContractCallerSession) GetTotalNodeCount() (*big.Int, error) { + return _Contract.Contract.GetTotalNodeCount(&_Contract.CallOpts) +} + // GetTotalSequencersCount is a free data retrieval call binding the contract method 0x665ebe8c. // // Solidity: function getTotalSequencersCount(address dataMarket) view returns(uint256) @@ -1550,12 +1572,43 @@ func (_Contract *ContractCallerSession) LastFinalizedSnapshot(dataMarket common. return _Contract.Contract.LastFinalizedSnapshot(&_Contract.CallOpts, dataMarket, projectId) } -// MaxAttestationFinalizedRootHash is a free data retrieval call binding the contract method 0x320eeed2. +// LastSequencerFinalizedSnapshot is a free data retrieval call binding the contract method 0x13be7391. +// +// Solidity: function lastSequencerFinalizedSnapshot(address dataMarket, string projectId) view returns(uint256) +func (_Contract *ContractCaller) LastSequencerFinalizedSnapshot(opts *bind.CallOpts, dataMarket common.Address, projectId string) (*big.Int, error) { + var out []interface{} + err := _Contract.contract.Call(opts, &out, "lastSequencerFinalizedSnapshot", dataMarket, projectId) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// LastSequencerFinalizedSnapshot is a free data retrieval call binding the contract method 0x13be7391. +// +// Solidity: function lastSequencerFinalizedSnapshot(address dataMarket, string projectId) view returns(uint256) +func (_Contract *ContractSession) LastSequencerFinalizedSnapshot(dataMarket common.Address, projectId string) (*big.Int, error) { + return _Contract.Contract.LastSequencerFinalizedSnapshot(&_Contract.CallOpts, dataMarket, projectId) +} + +// LastSequencerFinalizedSnapshot is a free data retrieval call binding the contract method 0x13be7391. +// +// Solidity: function lastSequencerFinalizedSnapshot(address dataMarket, string projectId) view returns(uint256) +func (_Contract *ContractCallerSession) LastSequencerFinalizedSnapshot(dataMarket common.Address, projectId string) (*big.Int, error) { + return _Contract.Contract.LastSequencerFinalizedSnapshot(&_Contract.CallOpts, dataMarket, projectId) +} + +// MaxAttestationFinalizedRootHash is a free data retrieval call binding the contract method 0xb1b65bd9. // -// Solidity: function maxAttestationFinalizedRootHash(address dataMarket, uint256 batchId) view returns(bytes32) -func (_Contract *ContractCaller) MaxAttestationFinalizedRootHash(opts *bind.CallOpts, dataMarket common.Address, batchId *big.Int) ([32]byte, error) { +// Solidity: function maxAttestationFinalizedRootHash(address dataMarket, string batchCid) view returns(bytes32) +func (_Contract *ContractCaller) MaxAttestationFinalizedRootHash(opts *bind.CallOpts, dataMarket common.Address, batchCid string) ([32]byte, error) { var out []interface{} - err := _Contract.contract.Call(opts, &out, "maxAttestationFinalizedRootHash", dataMarket, batchId) + err := _Contract.contract.Call(opts, &out, "maxAttestationFinalizedRootHash", dataMarket, batchCid) if err != nil { return *new([32]byte), err @@ -1567,26 +1620,26 @@ func (_Contract *ContractCaller) MaxAttestationFinalizedRootHash(opts *bind.Call } -// MaxAttestationFinalizedRootHash is a free data retrieval call binding the contract method 0x320eeed2. +// MaxAttestationFinalizedRootHash is a free data retrieval call binding the contract method 0xb1b65bd9. // -// Solidity: function maxAttestationFinalizedRootHash(address dataMarket, uint256 batchId) view returns(bytes32) -func (_Contract *ContractSession) MaxAttestationFinalizedRootHash(dataMarket common.Address, batchId *big.Int) ([32]byte, error) { - return _Contract.Contract.MaxAttestationFinalizedRootHash(&_Contract.CallOpts, dataMarket, batchId) +// Solidity: function maxAttestationFinalizedRootHash(address dataMarket, string batchCid) view returns(bytes32) +func (_Contract *ContractSession) MaxAttestationFinalizedRootHash(dataMarket common.Address, batchCid string) ([32]byte, error) { + return _Contract.Contract.MaxAttestationFinalizedRootHash(&_Contract.CallOpts, dataMarket, batchCid) } -// MaxAttestationFinalizedRootHash is a free data retrieval call binding the contract method 0x320eeed2. +// MaxAttestationFinalizedRootHash is a free data retrieval call binding the contract method 0xb1b65bd9. // -// Solidity: function maxAttestationFinalizedRootHash(address dataMarket, uint256 batchId) view returns(bytes32) -func (_Contract *ContractCallerSession) MaxAttestationFinalizedRootHash(dataMarket common.Address, batchId *big.Int) ([32]byte, error) { - return _Contract.Contract.MaxAttestationFinalizedRootHash(&_Contract.CallOpts, dataMarket, batchId) +// Solidity: function maxAttestationFinalizedRootHash(address dataMarket, string batchCid) view returns(bytes32) +func (_Contract *ContractCallerSession) MaxAttestationFinalizedRootHash(dataMarket common.Address, batchCid string) ([32]byte, error) { + return _Contract.Contract.MaxAttestationFinalizedRootHash(&_Contract.CallOpts, dataMarket, batchCid) } -// MaxAttestationsCount is a free data retrieval call binding the contract method 0x3230df83. +// MaxAttestationsCount is a free data retrieval call binding the contract method 0xc9f1c8fe. // -// Solidity: function maxAttestationsCount(address dataMarket, uint256 batchId) view returns(uint256) -func (_Contract *ContractCaller) MaxAttestationsCount(opts *bind.CallOpts, dataMarket common.Address, batchId *big.Int) (*big.Int, error) { +// Solidity: function maxAttestationsCount(address dataMarket, string batchCid) view returns(uint256) +func (_Contract *ContractCaller) MaxAttestationsCount(opts *bind.CallOpts, dataMarket common.Address, batchCid string) (*big.Int, error) { var out []interface{} - err := _Contract.contract.Call(opts, &out, "maxAttestationsCount", dataMarket, batchId) + err := _Contract.contract.Call(opts, &out, "maxAttestationsCount", dataMarket, batchCid) if err != nil { return *new(*big.Int), err @@ -1598,18 +1651,18 @@ func (_Contract *ContractCaller) MaxAttestationsCount(opts *bind.CallOpts, dataM } -// MaxAttestationsCount is a free data retrieval call binding the contract method 0x3230df83. +// MaxAttestationsCount is a free data retrieval call binding the contract method 0xc9f1c8fe. // -// Solidity: function maxAttestationsCount(address dataMarket, uint256 batchId) view returns(uint256) -func (_Contract *ContractSession) MaxAttestationsCount(dataMarket common.Address, batchId *big.Int) (*big.Int, error) { - return _Contract.Contract.MaxAttestationsCount(&_Contract.CallOpts, dataMarket, batchId) +// Solidity: function maxAttestationsCount(address dataMarket, string batchCid) view returns(uint256) +func (_Contract *ContractSession) MaxAttestationsCount(dataMarket common.Address, batchCid string) (*big.Int, error) { + return _Contract.Contract.MaxAttestationsCount(&_Contract.CallOpts, dataMarket, batchCid) } -// MaxAttestationsCount is a free data retrieval call binding the contract method 0x3230df83. +// MaxAttestationsCount is a free data retrieval call binding the contract method 0xc9f1c8fe. // -// Solidity: function maxAttestationsCount(address dataMarket, uint256 batchId) view returns(uint256) -func (_Contract *ContractCallerSession) MaxAttestationsCount(dataMarket common.Address, batchId *big.Int) (*big.Int, error) { - return _Contract.Contract.MaxAttestationsCount(&_Contract.CallOpts, dataMarket, batchId) +// Solidity: function maxAttestationsCount(address dataMarket, string batchCid) view returns(uint256) +func (_Contract *ContractCallerSession) MaxAttestationsCount(dataMarket common.Address, batchCid string) (*big.Int, error) { + return _Contract.Contract.MaxAttestationsCount(&_Contract.CallOpts, dataMarket, batchCid) } // MaxSnapshotsCid is a free data retrieval call binding the contract method 0x7e9ce892. @@ -1674,37 +1727,6 @@ func (_Contract *ContractCallerSession) MinAttestationsForConsensus(dataMarket c return _Contract.Contract.MinAttestationsForConsensus(&_Contract.CallOpts, dataMarket) } -// MinSubmissionsForConsensus is a free data retrieval call binding the contract method 0x0984dbd2. -// -// Solidity: function minSubmissionsForConsensus(address dataMarket) view returns(uint256) -func (_Contract *ContractCaller) MinSubmissionsForConsensus(opts *bind.CallOpts, dataMarket common.Address) (*big.Int, error) { - var out []interface{} - err := _Contract.contract.Call(opts, &out, "minSubmissionsForConsensus", dataMarket) - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// MinSubmissionsForConsensus is a free data retrieval call binding the contract method 0x0984dbd2. -// -// Solidity: function minSubmissionsForConsensus(address dataMarket) view returns(uint256) -func (_Contract *ContractSession) MinSubmissionsForConsensus(dataMarket common.Address) (*big.Int, error) { - return _Contract.Contract.MinSubmissionsForConsensus(&_Contract.CallOpts, dataMarket) -} - -// MinSubmissionsForConsensus is a free data retrieval call binding the contract method 0x0984dbd2. -// -// Solidity: function minSubmissionsForConsensus(address dataMarket) view returns(uint256) -func (_Contract *ContractCallerSession) MinSubmissionsForConsensus(dataMarket common.Address) (*big.Int, error) { - return _Contract.Contract.MinSubmissionsForConsensus(&_Contract.CallOpts, dataMarket) -} - // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) @@ -1798,12 +1820,12 @@ func (_Contract *ContractCallerSession) ProxiableUUID() ([32]byte, error) { return _Contract.Contract.ProxiableUUID(&_Contract.CallOpts) } -// RewardBasePoints is a free data retrieval call binding the contract method 0x7f59285a. +// RewardPoolSize is a free data retrieval call binding the contract method 0x5350fa81. // -// Solidity: function rewardBasePoints(address dataMarket) view returns(uint256) -func (_Contract *ContractCaller) RewardBasePoints(opts *bind.CallOpts, dataMarket common.Address) (*big.Int, error) { +// Solidity: function rewardPoolSize(address dataMarket) view returns(uint256) +func (_Contract *ContractCaller) RewardPoolSize(opts *bind.CallOpts, dataMarket common.Address) (*big.Int, error) { var out []interface{} - err := _Contract.contract.Call(opts, &out, "rewardBasePoints", dataMarket) + err := _Contract.contract.Call(opts, &out, "rewardPoolSize", dataMarket) if err != nil { return *new(*big.Int), err @@ -1815,18 +1837,18 @@ func (_Contract *ContractCaller) RewardBasePoints(opts *bind.CallOpts, dataMarke } -// RewardBasePoints is a free data retrieval call binding the contract method 0x7f59285a. +// RewardPoolSize is a free data retrieval call binding the contract method 0x5350fa81. // -// Solidity: function rewardBasePoints(address dataMarket) view returns(uint256) -func (_Contract *ContractSession) RewardBasePoints(dataMarket common.Address) (*big.Int, error) { - return _Contract.Contract.RewardBasePoints(&_Contract.CallOpts, dataMarket) +// Solidity: function rewardPoolSize(address dataMarket) view returns(uint256) +func (_Contract *ContractSession) RewardPoolSize(dataMarket common.Address) (*big.Int, error) { + return _Contract.Contract.RewardPoolSize(&_Contract.CallOpts, dataMarket) } -// RewardBasePoints is a free data retrieval call binding the contract method 0x7f59285a. +// RewardPoolSize is a free data retrieval call binding the contract method 0x5350fa81. // -// Solidity: function rewardBasePoints(address dataMarket) view returns(uint256) -func (_Contract *ContractCallerSession) RewardBasePoints(dataMarket common.Address) (*big.Int, error) { - return _Contract.Contract.RewardBasePoints(&_Contract.CallOpts, dataMarket) +// Solidity: function rewardPoolSize(address dataMarket) view returns(uint256) +func (_Contract *ContractCallerSession) RewardPoolSize(dataMarket common.Address) (*big.Int, error) { + return _Contract.Contract.RewardPoolSize(&_Contract.CallOpts, dataMarket) } // RewardsEnabled is a free data retrieval call binding the contract method 0x83450d26. @@ -1860,37 +1882,6 @@ func (_Contract *ContractCallerSession) RewardsEnabled(dataMarket common.Address return _Contract.Contract.RewardsEnabled(&_Contract.CallOpts, dataMarket) } -// SlotCounter is a free data retrieval call binding the contract method 0xe59a4105. -// -// Solidity: function slotCounter() view returns(uint256) -func (_Contract *ContractCaller) SlotCounter(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _Contract.contract.Call(opts, &out, "slotCounter") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// SlotCounter is a free data retrieval call binding the contract method 0xe59a4105. -// -// Solidity: function slotCounter() view returns(uint256) -func (_Contract *ContractSession) SlotCounter() (*big.Int, error) { - return _Contract.Contract.SlotCounter(&_Contract.CallOpts) -} - -// SlotCounter is a free data retrieval call binding the contract method 0xe59a4105. -// -// Solidity: function slotCounter() view returns(uint256) -func (_Contract *ContractCallerSession) SlotCounter() (*big.Int, error) { - return _Contract.Contract.SlotCounter(&_Contract.CallOpts) -} - // SlotRewardPoints is a free data retrieval call binding the contract method 0x9a2458a6. // // Solidity: function slotRewardPoints(address dataMarket, uint256 slotId) view returns(uint256) @@ -2127,25 +2118,80 @@ func (_Contract *ContractCallerSession) SnapshotterState() (common.Address, erro return _Contract.Contract.SnapshotterState(&_Contract.CallOpts) } -// AssignSnapshotterToSlotBulk is a paid mutator transaction binding the contract method 0x066522b0. +// UserInfo is a free data retrieval call binding the contract method 0x1959a002. // -// Solidity: function assignSnapshotterToSlotBulk(uint256[] _slotIds, address[] _snapshotterAddresses) returns() -func (_Contract *ContractTransactor) AssignSnapshotterToSlotBulk(opts *bind.TransactOpts, _slotIds []*big.Int, _snapshotterAddresses []common.Address) (*types.Transaction, error) { - return _Contract.contract.Transact(opts, "assignSnapshotterToSlotBulk", _slotIds, _snapshotterAddresses) +// Solidity: function userInfo(address ) view returns(uint256 totalRewards, uint256 totalClaimed, uint256 lastClaimed, uint256 lastUpdated) +func (_Contract *ContractCaller) UserInfo(opts *bind.CallOpts, arg0 common.Address) (struct { + TotalRewards *big.Int + TotalClaimed *big.Int + LastClaimed *big.Int + LastUpdated *big.Int +}, error) { + var out []interface{} + err := _Contract.contract.Call(opts, &out, "userInfo", arg0) + + outstruct := new(struct { + TotalRewards *big.Int + TotalClaimed *big.Int + LastClaimed *big.Int + LastUpdated *big.Int + }) + if err != nil { + return *outstruct, err + } + + outstruct.TotalRewards = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + outstruct.TotalClaimed = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + outstruct.LastClaimed = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) + outstruct.LastUpdated = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) + + return *outstruct, err + +} + +// UserInfo is a free data retrieval call binding the contract method 0x1959a002. +// +// Solidity: function userInfo(address ) view returns(uint256 totalRewards, uint256 totalClaimed, uint256 lastClaimed, uint256 lastUpdated) +func (_Contract *ContractSession) UserInfo(arg0 common.Address) (struct { + TotalRewards *big.Int + TotalClaimed *big.Int + LastClaimed *big.Int + LastUpdated *big.Int +}, error) { + return _Contract.Contract.UserInfo(&_Contract.CallOpts, arg0) +} + +// UserInfo is a free data retrieval call binding the contract method 0x1959a002. +// +// Solidity: function userInfo(address ) view returns(uint256 totalRewards, uint256 totalClaimed, uint256 lastClaimed, uint256 lastUpdated) +func (_Contract *ContractCallerSession) UserInfo(arg0 common.Address) (struct { + TotalRewards *big.Int + TotalClaimed *big.Int + LastClaimed *big.Int + LastUpdated *big.Int +}, error) { + return _Contract.Contract.UserInfo(&_Contract.CallOpts, arg0) +} + +// ClaimRewards is a paid mutator transaction binding the contract method 0xef5cfb8c. +// +// Solidity: function claimRewards(address _user) returns() +func (_Contract *ContractTransactor) ClaimRewards(opts *bind.TransactOpts, _user common.Address) (*types.Transaction, error) { + return _Contract.contract.Transact(opts, "claimRewards", _user) } -// AssignSnapshotterToSlotBulk is a paid mutator transaction binding the contract method 0x066522b0. +// ClaimRewards is a paid mutator transaction binding the contract method 0xef5cfb8c. // -// Solidity: function assignSnapshotterToSlotBulk(uint256[] _slotIds, address[] _snapshotterAddresses) returns() -func (_Contract *ContractSession) AssignSnapshotterToSlotBulk(_slotIds []*big.Int, _snapshotterAddresses []common.Address) (*types.Transaction, error) { - return _Contract.Contract.AssignSnapshotterToSlotBulk(&_Contract.TransactOpts, _slotIds, _snapshotterAddresses) +// Solidity: function claimRewards(address _user) returns() +func (_Contract *ContractSession) ClaimRewards(_user common.Address) (*types.Transaction, error) { + return _Contract.Contract.ClaimRewards(&_Contract.TransactOpts, _user) } -// AssignSnapshotterToSlotBulk is a paid mutator transaction binding the contract method 0x066522b0. +// ClaimRewards is a paid mutator transaction binding the contract method 0xef5cfb8c. // -// Solidity: function assignSnapshotterToSlotBulk(uint256[] _slotIds, address[] _snapshotterAddresses) returns() -func (_Contract *ContractTransactorSession) AssignSnapshotterToSlotBulk(_slotIds []*big.Int, _snapshotterAddresses []common.Address) (*types.Transaction, error) { - return _Contract.Contract.AssignSnapshotterToSlotBulk(&_Contract.TransactOpts, _slotIds, _snapshotterAddresses) +// Solidity: function claimRewards(address _user) returns() +func (_Contract *ContractTransactorSession) ClaimRewards(_user common.Address) (*types.Transaction, error) { + return _Contract.Contract.ClaimRewards(&_Contract.TransactOpts, _user) } // CreateDataMarket is a paid mutator transaction binding the contract method 0x1dbc586b. @@ -2169,6 +2215,27 @@ func (_Contract *ContractTransactorSession) CreateDataMarket(ownerAddress common return _Contract.Contract.CreateDataMarket(&_Contract.TransactOpts, ownerAddress, epochSize, sourceChainId, sourceChainBlockTime, useBlockNumberAsEpochId) } +// EmergencyWithdraw is a paid mutator transaction binding the contract method 0xdb2e21bc. +// +// Solidity: function emergencyWithdraw() returns() +func (_Contract *ContractTransactor) EmergencyWithdraw(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Contract.contract.Transact(opts, "emergencyWithdraw") +} + +// EmergencyWithdraw is a paid mutator transaction binding the contract method 0xdb2e21bc. +// +// Solidity: function emergencyWithdraw() returns() +func (_Contract *ContractSession) EmergencyWithdraw() (*types.Transaction, error) { + return _Contract.Contract.EmergencyWithdraw(&_Contract.TransactOpts) +} + +// EmergencyWithdraw is a paid mutator transaction binding the contract method 0xdb2e21bc. +// +// Solidity: function emergencyWithdraw() returns() +func (_Contract *ContractTransactorSession) EmergencyWithdraw() (*types.Transaction, error) { + return _Contract.Contract.EmergencyWithdraw(&_Contract.TransactOpts) +} + // EndBatchSubmissions is a paid mutator transaction binding the contract method 0x6ee55d73. // // Solidity: function endBatchSubmissions(address dataMarket, uint256 epochId) returns() @@ -2190,25 +2257,25 @@ func (_Contract *ContractTransactorSession) EndBatchSubmissions(dataMarket commo return _Contract.Contract.EndBatchSubmissions(&_Contract.TransactOpts, dataMarket, epochId) } -// ForceCompleteConsensusAttestations is a paid mutator transaction binding the contract method 0x05237c1b. +// ForceCompleteConsensusAttestations is a paid mutator transaction binding the contract method 0xff614fff. // -// Solidity: function forceCompleteConsensusAttestations(address dataMarket, uint256 batchId, uint256 epochId) returns() -func (_Contract *ContractTransactor) ForceCompleteConsensusAttestations(opts *bind.TransactOpts, dataMarket common.Address, batchId *big.Int, epochId *big.Int) (*types.Transaction, error) { - return _Contract.contract.Transact(opts, "forceCompleteConsensusAttestations", dataMarket, batchId, epochId) +// Solidity: function forceCompleteConsensusAttestations(address dataMarket, string batchCid, uint256 epochId) returns() +func (_Contract *ContractTransactor) ForceCompleteConsensusAttestations(opts *bind.TransactOpts, dataMarket common.Address, batchCid string, epochId *big.Int) (*types.Transaction, error) { + return _Contract.contract.Transact(opts, "forceCompleteConsensusAttestations", dataMarket, batchCid, epochId) } -// ForceCompleteConsensusAttestations is a paid mutator transaction binding the contract method 0x05237c1b. +// ForceCompleteConsensusAttestations is a paid mutator transaction binding the contract method 0xff614fff. // -// Solidity: function forceCompleteConsensusAttestations(address dataMarket, uint256 batchId, uint256 epochId) returns() -func (_Contract *ContractSession) ForceCompleteConsensusAttestations(dataMarket common.Address, batchId *big.Int, epochId *big.Int) (*types.Transaction, error) { - return _Contract.Contract.ForceCompleteConsensusAttestations(&_Contract.TransactOpts, dataMarket, batchId, epochId) +// Solidity: function forceCompleteConsensusAttestations(address dataMarket, string batchCid, uint256 epochId) returns() +func (_Contract *ContractSession) ForceCompleteConsensusAttestations(dataMarket common.Address, batchCid string, epochId *big.Int) (*types.Transaction, error) { + return _Contract.Contract.ForceCompleteConsensusAttestations(&_Contract.TransactOpts, dataMarket, batchCid, epochId) } -// ForceCompleteConsensusAttestations is a paid mutator transaction binding the contract method 0x05237c1b. +// ForceCompleteConsensusAttestations is a paid mutator transaction binding the contract method 0xff614fff. // -// Solidity: function forceCompleteConsensusAttestations(address dataMarket, uint256 batchId, uint256 epochId) returns() -func (_Contract *ContractTransactorSession) ForceCompleteConsensusAttestations(dataMarket common.Address, batchId *big.Int, epochId *big.Int) (*types.Transaction, error) { - return _Contract.Contract.ForceCompleteConsensusAttestations(&_Contract.TransactOpts, dataMarket, batchId, epochId) +// Solidity: function forceCompleteConsensusAttestations(address dataMarket, string batchCid, uint256 epochId) returns() +func (_Contract *ContractTransactorSession) ForceCompleteConsensusAttestations(dataMarket common.Address, batchCid string, epochId *big.Int) (*types.Transaction, error) { + return _Contract.Contract.ForceCompleteConsensusAttestations(&_Contract.TransactOpts, dataMarket, batchCid, epochId) } // ForceSkipEpoch is a paid mutator transaction binding the contract method 0x27856ff3. @@ -2358,67 +2425,46 @@ func (_Contract *ContractTransactorSession) SetSequencerId(dataMarket common.Add return _Contract.Contract.SetSequencerId(&_Contract.TransactOpts, dataMarket, _sequencerId) } -// SubmitBatchAttestation is a paid mutator transaction binding the contract method 0x31632255. +// SubmitBatchAttestation is a paid mutator transaction binding the contract method 0xcd4c1a34. // -// Solidity: function submitBatchAttestation(address dataMarket, uint256 batchId, uint256 epochId, bytes32 finalizedCidsRootHash) returns() -func (_Contract *ContractTransactor) SubmitBatchAttestation(opts *bind.TransactOpts, dataMarket common.Address, batchId *big.Int, epochId *big.Int, finalizedCidsRootHash [32]byte) (*types.Transaction, error) { - return _Contract.contract.Transact(opts, "submitBatchAttestation", dataMarket, batchId, epochId, finalizedCidsRootHash) +// Solidity: function submitBatchAttestation(address dataMarket, string batchCid, uint256 epochId, bytes32 finalizedCidsRootHash) returns() +func (_Contract *ContractTransactor) SubmitBatchAttestation(opts *bind.TransactOpts, dataMarket common.Address, batchCid string, epochId *big.Int, finalizedCidsRootHash [32]byte) (*types.Transaction, error) { + return _Contract.contract.Transact(opts, "submitBatchAttestation", dataMarket, batchCid, epochId, finalizedCidsRootHash) } -// SubmitBatchAttestation is a paid mutator transaction binding the contract method 0x31632255. +// SubmitBatchAttestation is a paid mutator transaction binding the contract method 0xcd4c1a34. // -// Solidity: function submitBatchAttestation(address dataMarket, uint256 batchId, uint256 epochId, bytes32 finalizedCidsRootHash) returns() -func (_Contract *ContractSession) SubmitBatchAttestation(dataMarket common.Address, batchId *big.Int, epochId *big.Int, finalizedCidsRootHash [32]byte) (*types.Transaction, error) { - return _Contract.Contract.SubmitBatchAttestation(&_Contract.TransactOpts, dataMarket, batchId, epochId, finalizedCidsRootHash) +// Solidity: function submitBatchAttestation(address dataMarket, string batchCid, uint256 epochId, bytes32 finalizedCidsRootHash) returns() +func (_Contract *ContractSession) SubmitBatchAttestation(dataMarket common.Address, batchCid string, epochId *big.Int, finalizedCidsRootHash [32]byte) (*types.Transaction, error) { + return _Contract.Contract.SubmitBatchAttestation(&_Contract.TransactOpts, dataMarket, batchCid, epochId, finalizedCidsRootHash) } -// SubmitBatchAttestation is a paid mutator transaction binding the contract method 0x31632255. +// SubmitBatchAttestation is a paid mutator transaction binding the contract method 0xcd4c1a34. // -// Solidity: function submitBatchAttestation(address dataMarket, uint256 batchId, uint256 epochId, bytes32 finalizedCidsRootHash) returns() -func (_Contract *ContractTransactorSession) SubmitBatchAttestation(dataMarket common.Address, batchId *big.Int, epochId *big.Int, finalizedCidsRootHash [32]byte) (*types.Transaction, error) { - return _Contract.Contract.SubmitBatchAttestation(&_Contract.TransactOpts, dataMarket, batchId, epochId, finalizedCidsRootHash) +// Solidity: function submitBatchAttestation(address dataMarket, string batchCid, uint256 epochId, bytes32 finalizedCidsRootHash) returns() +func (_Contract *ContractTransactorSession) SubmitBatchAttestation(dataMarket common.Address, batchCid string, epochId *big.Int, finalizedCidsRootHash [32]byte) (*types.Transaction, error) { + return _Contract.Contract.SubmitBatchAttestation(&_Contract.TransactOpts, dataMarket, batchCid, epochId, finalizedCidsRootHash) } -// SubmitSnapshot is a paid mutator transaction binding the contract method 0x5678a9d5. +// SubmitSubmissionBatch is a paid mutator transaction binding the contract method 0xcf396cbf. // -// Solidity: function submitSnapshot(address dataMarket, uint256 slotId, string snapshotCid, uint256 epochId, string projectId, (uint256,uint256,string,uint256,string) request, bytes signature) returns() -func (_Contract *ContractTransactor) SubmitSnapshot(opts *bind.TransactOpts, dataMarket common.Address, slotId *big.Int, snapshotCid string, epochId *big.Int, projectId string, request PowerloomDataMarketRequest, signature []byte) (*types.Transaction, error) { - return _Contract.contract.Transact(opts, "submitSnapshot", dataMarket, slotId, snapshotCid, epochId, projectId, request, signature) +// Solidity: function submitSubmissionBatch(address dataMarket, string batchCid, uint256 epochId, string[] projectIds, string[] snapshotCids, bytes32 finalizedCidsRootHash) returns() +func (_Contract *ContractTransactor) SubmitSubmissionBatch(opts *bind.TransactOpts, dataMarket common.Address, batchCid string, epochId *big.Int, projectIds []string, snapshotCids []string, finalizedCidsRootHash [32]byte) (*types.Transaction, error) { + return _Contract.contract.Transact(opts, "submitSubmissionBatch", dataMarket, batchCid, epochId, projectIds, snapshotCids, finalizedCidsRootHash) } -// SubmitSnapshot is a paid mutator transaction binding the contract method 0x5678a9d5. +// SubmitSubmissionBatch is a paid mutator transaction binding the contract method 0xcf396cbf. // -// Solidity: function submitSnapshot(address dataMarket, uint256 slotId, string snapshotCid, uint256 epochId, string projectId, (uint256,uint256,string,uint256,string) request, bytes signature) returns() -func (_Contract *ContractSession) SubmitSnapshot(dataMarket common.Address, slotId *big.Int, snapshotCid string, epochId *big.Int, projectId string, request PowerloomDataMarketRequest, signature []byte) (*types.Transaction, error) { - return _Contract.Contract.SubmitSnapshot(&_Contract.TransactOpts, dataMarket, slotId, snapshotCid, epochId, projectId, request, signature) +// Solidity: function submitSubmissionBatch(address dataMarket, string batchCid, uint256 epochId, string[] projectIds, string[] snapshotCids, bytes32 finalizedCidsRootHash) returns() +func (_Contract *ContractSession) SubmitSubmissionBatch(dataMarket common.Address, batchCid string, epochId *big.Int, projectIds []string, snapshotCids []string, finalizedCidsRootHash [32]byte) (*types.Transaction, error) { + return _Contract.Contract.SubmitSubmissionBatch(&_Contract.TransactOpts, dataMarket, batchCid, epochId, projectIds, snapshotCids, finalizedCidsRootHash) } -// SubmitSnapshot is a paid mutator transaction binding the contract method 0x5678a9d5. +// SubmitSubmissionBatch is a paid mutator transaction binding the contract method 0xcf396cbf. // -// Solidity: function submitSnapshot(address dataMarket, uint256 slotId, string snapshotCid, uint256 epochId, string projectId, (uint256,uint256,string,uint256,string) request, bytes signature) returns() -func (_Contract *ContractTransactorSession) SubmitSnapshot(dataMarket common.Address, slotId *big.Int, snapshotCid string, epochId *big.Int, projectId string, request PowerloomDataMarketRequest, signature []byte) (*types.Transaction, error) { - return _Contract.Contract.SubmitSnapshot(&_Contract.TransactOpts, dataMarket, slotId, snapshotCid, epochId, projectId, request, signature) -} - -// SubmitSubmissionBatch is a paid mutator transaction binding the contract method 0xc19e74d9. -// -// Solidity: function submitSubmissionBatch(address dataMarket, string batchCid, uint256 batchId, uint256 epochId, string[] projectIds, string[] snapshotCids, bytes32 finalizedCidsRootHash) returns() -func (_Contract *ContractTransactor) SubmitSubmissionBatch(opts *bind.TransactOpts, dataMarket common.Address, batchCid string, batchId *big.Int, epochId *big.Int, projectIds []string, snapshotCids []string, finalizedCidsRootHash [32]byte) (*types.Transaction, error) { - return _Contract.contract.Transact(opts, "submitSubmissionBatch", dataMarket, batchCid, batchId, epochId, projectIds, snapshotCids, finalizedCidsRootHash) -} - -// SubmitSubmissionBatch is a paid mutator transaction binding the contract method 0xc19e74d9. -// -// Solidity: function submitSubmissionBatch(address dataMarket, string batchCid, uint256 batchId, uint256 epochId, string[] projectIds, string[] snapshotCids, bytes32 finalizedCidsRootHash) returns() -func (_Contract *ContractSession) SubmitSubmissionBatch(dataMarket common.Address, batchCid string, batchId *big.Int, epochId *big.Int, projectIds []string, snapshotCids []string, finalizedCidsRootHash [32]byte) (*types.Transaction, error) { - return _Contract.Contract.SubmitSubmissionBatch(&_Contract.TransactOpts, dataMarket, batchCid, batchId, epochId, projectIds, snapshotCids, finalizedCidsRootHash) -} - -// SubmitSubmissionBatch is a paid mutator transaction binding the contract method 0xc19e74d9. -// -// Solidity: function submitSubmissionBatch(address dataMarket, string batchCid, uint256 batchId, uint256 epochId, string[] projectIds, string[] snapshotCids, bytes32 finalizedCidsRootHash) returns() -func (_Contract *ContractTransactorSession) SubmitSubmissionBatch(dataMarket common.Address, batchCid string, batchId *big.Int, epochId *big.Int, projectIds []string, snapshotCids []string, finalizedCidsRootHash [32]byte) (*types.Transaction, error) { - return _Contract.Contract.SubmitSubmissionBatch(&_Contract.TransactOpts, dataMarket, batchCid, batchId, epochId, projectIds, snapshotCids, finalizedCidsRootHash) +// Solidity: function submitSubmissionBatch(address dataMarket, string batchCid, uint256 epochId, string[] projectIds, string[] snapshotCids, bytes32 finalizedCidsRootHash) returns() +func (_Contract *ContractTransactorSession) SubmitSubmissionBatch(dataMarket common.Address, batchCid string, epochId *big.Int, projectIds []string, snapshotCids []string, finalizedCidsRootHash [32]byte) (*types.Transaction, error) { + return _Contract.Contract.SubmitSubmissionBatch(&_Contract.TransactOpts, dataMarket, batchCid, epochId, projectIds, snapshotCids, finalizedCidsRootHash) } // ToggleDataMarket is a paid mutator transaction binding the contract method 0xb34aebca. @@ -2442,27 +2488,6 @@ func (_Contract *ContractTransactorSession) ToggleDataMarket(dataMarketAddress c return _Contract.Contract.ToggleDataMarket(&_Contract.TransactOpts, dataMarketAddress, enabled) } -// ToggleFallback is a paid mutator transaction binding the contract method 0x32f6f519. -// -// Solidity: function toggleFallback(address dataMarket) returns() -func (_Contract *ContractTransactor) ToggleFallback(opts *bind.TransactOpts, dataMarket common.Address) (*types.Transaction, error) { - return _Contract.contract.Transact(opts, "toggleFallback", dataMarket) -} - -// ToggleFallback is a paid mutator transaction binding the contract method 0x32f6f519. -// -// Solidity: function toggleFallback(address dataMarket) returns() -func (_Contract *ContractSession) ToggleFallback(dataMarket common.Address) (*types.Transaction, error) { - return _Contract.Contract.ToggleFallback(&_Contract.TransactOpts, dataMarket) -} - -// ToggleFallback is a paid mutator transaction binding the contract method 0x32f6f519. -// -// Solidity: function toggleFallback(address dataMarket) returns() -func (_Contract *ContractTransactorSession) ToggleFallback(dataMarket common.Address) (*types.Transaction, error) { - return _Contract.Contract.ToggleFallback(&_Contract.TransactOpts, dataMarket) -} - // ToggleRewards is a paid mutator transaction binding the contract method 0x71746644. // // Solidity: function toggleRewards(address dataMarket) returns() @@ -2526,27 +2551,6 @@ func (_Contract *ContractTransactorSession) UpdateAddresses(dataMarket common.Ad return _Contract.Contract.UpdateAddresses(&_Contract.TransactOpts, dataMarket, role, _addresses, _status) } -// UpdateAllowedProjectType is a paid mutator transaction binding the contract method 0xb1a3f28d. -// -// Solidity: function updateAllowedProjectType(address dataMarket, string _projectType, bool _status) returns() -func (_Contract *ContractTransactor) UpdateAllowedProjectType(opts *bind.TransactOpts, dataMarket common.Address, _projectType string, _status bool) (*types.Transaction, error) { - return _Contract.contract.Transact(opts, "updateAllowedProjectType", dataMarket, _projectType, _status) -} - -// UpdateAllowedProjectType is a paid mutator transaction binding the contract method 0xb1a3f28d. -// -// Solidity: function updateAllowedProjectType(address dataMarket, string _projectType, bool _status) returns() -func (_Contract *ContractSession) UpdateAllowedProjectType(dataMarket common.Address, _projectType string, _status bool) (*types.Transaction, error) { - return _Contract.Contract.UpdateAllowedProjectType(&_Contract.TransactOpts, dataMarket, _projectType, _status) -} - -// UpdateAllowedProjectType is a paid mutator transaction binding the contract method 0xb1a3f28d. -// -// Solidity: function updateAllowedProjectType(address dataMarket, string _projectType, bool _status) returns() -func (_Contract *ContractTransactorSession) UpdateAllowedProjectType(dataMarket common.Address, _projectType string, _status bool) (*types.Transaction, error) { - return _Contract.Contract.UpdateAllowedProjectType(&_Contract.TransactOpts, dataMarket, _projectType, _status) -} - // UpdateAttestationSubmissionWindow is a paid mutator transaction binding the contract method 0x89afe86a. // // Solidity: function updateAttestationSubmissionWindow(address dataMarket, uint256 newattestationSubmissionWindow) returns() @@ -2631,6 +2635,27 @@ func (_Contract *ContractTransactorSession) UpdateDataMarketFactory(_address com return _Contract.Contract.UpdateDataMarketFactory(&_Contract.TransactOpts, _address) } +// UpdateDaySize is a paid mutator transaction binding the contract method 0x79145b89. +// +// Solidity: function updateDaySize(address dataMarket, uint256 newDaySize) returns() +func (_Contract *ContractTransactor) UpdateDaySize(opts *bind.TransactOpts, dataMarket common.Address, newDaySize *big.Int) (*types.Transaction, error) { + return _Contract.contract.Transact(opts, "updateDaySize", dataMarket, newDaySize) +} + +// UpdateDaySize is a paid mutator transaction binding the contract method 0x79145b89. +// +// Solidity: function updateDaySize(address dataMarket, uint256 newDaySize) returns() +func (_Contract *ContractSession) UpdateDaySize(dataMarket common.Address, newDaySize *big.Int) (*types.Transaction, error) { + return _Contract.Contract.UpdateDaySize(&_Contract.TransactOpts, dataMarket, newDaySize) +} + +// UpdateDaySize is a paid mutator transaction binding the contract method 0x79145b89. +// +// Solidity: function updateDaySize(address dataMarket, uint256 newDaySize) returns() +func (_Contract *ContractTransactorSession) UpdateDaySize(dataMarket common.Address, newDaySize *big.Int) (*types.Transaction, error) { + return _Contract.Contract.UpdateDaySize(&_Contract.TransactOpts, dataMarket, newDaySize) +} + // UpdateEpochManager is a paid mutator transaction binding the contract method 0x6e81f234. // // Solidity: function updateEpochManager(address dataMarket, address _address) returns() @@ -2652,27 +2677,6 @@ func (_Contract *ContractTransactorSession) UpdateEpochManager(dataMarket common return _Contract.Contract.UpdateEpochManager(&_Contract.TransactOpts, dataMarket, _address) } -// UpdateFallbackNodes is a paid mutator transaction binding the contract method 0x50304b62. -// -// Solidity: function updateFallbackNodes(address dataMarket, address[] _fallbackNodes, bool[] _status) returns() -func (_Contract *ContractTransactor) UpdateFallbackNodes(opts *bind.TransactOpts, dataMarket common.Address, _fallbackNodes []common.Address, _status []bool) (*types.Transaction, error) { - return _Contract.contract.Transact(opts, "updateFallbackNodes", dataMarket, _fallbackNodes, _status) -} - -// UpdateFallbackNodes is a paid mutator transaction binding the contract method 0x50304b62. -// -// Solidity: function updateFallbackNodes(address dataMarket, address[] _fallbackNodes, bool[] _status) returns() -func (_Contract *ContractSession) UpdateFallbackNodes(dataMarket common.Address, _fallbackNodes []common.Address, _status []bool) (*types.Transaction, error) { - return _Contract.Contract.UpdateFallbackNodes(&_Contract.TransactOpts, dataMarket, _fallbackNodes, _status) -} - -// UpdateFallbackNodes is a paid mutator transaction binding the contract method 0x50304b62. -// -// Solidity: function updateFallbackNodes(address dataMarket, address[] _fallbackNodes, bool[] _status) returns() -func (_Contract *ContractTransactorSession) UpdateFallbackNodes(dataMarket common.Address, _fallbackNodes []common.Address, _status []bool) (*types.Transaction, error) { - return _Contract.Contract.UpdateFallbackNodes(&_Contract.TransactOpts, dataMarket, _fallbackNodes, _status) -} - // UpdateMinAttestationsForConsensus is a paid mutator transaction binding the contract method 0xe4578d51. // // Solidity: function updateMinAttestationsForConsensus(address dataMarket, uint256 _minAttestationsForConsensus) returns() @@ -2694,88 +2698,46 @@ func (_Contract *ContractTransactorSession) UpdateMinAttestationsForConsensus(da return _Contract.Contract.UpdateMinAttestationsForConsensus(&_Contract.TransactOpts, dataMarket, _minAttestationsForConsensus) } -// UpdateMinSnapshottersForConsensus is a paid mutator transaction binding the contract method 0x3cb782cd. -// -// Solidity: function updateMinSnapshottersForConsensus(address dataMarket, uint256 _minSubmissionsForConsensus) returns() -func (_Contract *ContractTransactor) UpdateMinSnapshottersForConsensus(opts *bind.TransactOpts, dataMarket common.Address, _minSubmissionsForConsensus *big.Int) (*types.Transaction, error) { - return _Contract.contract.Transact(opts, "updateMinSnapshottersForConsensus", dataMarket, _minSubmissionsForConsensus) -} - -// UpdateMinSnapshottersForConsensus is a paid mutator transaction binding the contract method 0x3cb782cd. +// UpdateRewardPoolSize is a paid mutator transaction binding the contract method 0xd9ad5d2e. // -// Solidity: function updateMinSnapshottersForConsensus(address dataMarket, uint256 _minSubmissionsForConsensus) returns() -func (_Contract *ContractSession) UpdateMinSnapshottersForConsensus(dataMarket common.Address, _minSubmissionsForConsensus *big.Int) (*types.Transaction, error) { - return _Contract.Contract.UpdateMinSnapshottersForConsensus(&_Contract.TransactOpts, dataMarket, _minSubmissionsForConsensus) +// Solidity: function updateRewardPoolSize(address dataMarket, uint256 newRewardPoolSize) returns() +func (_Contract *ContractTransactor) UpdateRewardPoolSize(opts *bind.TransactOpts, dataMarket common.Address, newRewardPoolSize *big.Int) (*types.Transaction, error) { + return _Contract.contract.Transact(opts, "updateRewardPoolSize", dataMarket, newRewardPoolSize) } -// UpdateMinSnapshottersForConsensus is a paid mutator transaction binding the contract method 0x3cb782cd. +// UpdateRewardPoolSize is a paid mutator transaction binding the contract method 0xd9ad5d2e. // -// Solidity: function updateMinSnapshottersForConsensus(address dataMarket, uint256 _minSubmissionsForConsensus) returns() -func (_Contract *ContractTransactorSession) UpdateMinSnapshottersForConsensus(dataMarket common.Address, _minSubmissionsForConsensus *big.Int) (*types.Transaction, error) { - return _Contract.Contract.UpdateMinSnapshottersForConsensus(&_Contract.TransactOpts, dataMarket, _minSubmissionsForConsensus) +// Solidity: function updateRewardPoolSize(address dataMarket, uint256 newRewardPoolSize) returns() +func (_Contract *ContractSession) UpdateRewardPoolSize(dataMarket common.Address, newRewardPoolSize *big.Int) (*types.Transaction, error) { + return _Contract.Contract.UpdateRewardPoolSize(&_Contract.TransactOpts, dataMarket, newRewardPoolSize) } -// UpdateProjects is a paid mutator transaction binding the contract method 0x0589852d. +// UpdateRewardPoolSize is a paid mutator transaction binding the contract method 0xd9ad5d2e. // -// Solidity: function updateProjects(address dataMarket, string[] _projects, bool[] _status) returns() -func (_Contract *ContractTransactor) UpdateProjects(opts *bind.TransactOpts, dataMarket common.Address, _projects []string, _status []bool) (*types.Transaction, error) { - return _Contract.contract.Transact(opts, "updateProjects", dataMarket, _projects, _status) +// Solidity: function updateRewardPoolSize(address dataMarket, uint256 newRewardPoolSize) returns() +func (_Contract *ContractTransactorSession) UpdateRewardPoolSize(dataMarket common.Address, newRewardPoolSize *big.Int) (*types.Transaction, error) { + return _Contract.Contract.UpdateRewardPoolSize(&_Contract.TransactOpts, dataMarket, newRewardPoolSize) } -// UpdateProjects is a paid mutator transaction binding the contract method 0x0589852d. +// UpdateRewards is a paid mutator transaction binding the contract method 0x68af906d. // -// Solidity: function updateProjects(address dataMarket, string[] _projects, bool[] _status) returns() -func (_Contract *ContractSession) UpdateProjects(dataMarket common.Address, _projects []string, _status []bool) (*types.Transaction, error) { - return _Contract.Contract.UpdateProjects(&_Contract.TransactOpts, dataMarket, _projects, _status) +// Solidity: function updateRewards(address dataMarket, uint256[] slotIds, uint256[] submissionsList, uint256 day, uint256 eligibleNodes) returns() +func (_Contract *ContractTransactor) UpdateRewards(opts *bind.TransactOpts, dataMarket common.Address, slotIds []*big.Int, submissionsList []*big.Int, day *big.Int, eligibleNodes *big.Int) (*types.Transaction, error) { + return _Contract.contract.Transact(opts, "updateRewards", dataMarket, slotIds, submissionsList, day, eligibleNodes) } -// UpdateProjects is a paid mutator transaction binding the contract method 0x0589852d. +// UpdateRewards is a paid mutator transaction binding the contract method 0x68af906d. // -// Solidity: function updateProjects(address dataMarket, string[] _projects, bool[] _status) returns() -func (_Contract *ContractTransactorSession) UpdateProjects(dataMarket common.Address, _projects []string, _status []bool) (*types.Transaction, error) { - return _Contract.Contract.UpdateProjects(&_Contract.TransactOpts, dataMarket, _projects, _status) +// Solidity: function updateRewards(address dataMarket, uint256[] slotIds, uint256[] submissionsList, uint256 day, uint256 eligibleNodes) returns() +func (_Contract *ContractSession) UpdateRewards(dataMarket common.Address, slotIds []*big.Int, submissionsList []*big.Int, day *big.Int, eligibleNodes *big.Int) (*types.Transaction, error) { + return _Contract.Contract.UpdateRewards(&_Contract.TransactOpts, dataMarket, slotIds, submissionsList, day, eligibleNodes) } -// UpdateRewardBasePoints is a paid mutator transaction binding the contract method 0x7195df15. +// UpdateRewards is a paid mutator transaction binding the contract method 0x68af906d. // -// Solidity: function updateRewardBasePoints(address dataMarket, uint256 newRewardBasePoints) returns() -func (_Contract *ContractTransactor) UpdateRewardBasePoints(opts *bind.TransactOpts, dataMarket common.Address, newRewardBasePoints *big.Int) (*types.Transaction, error) { - return _Contract.contract.Transact(opts, "updateRewardBasePoints", dataMarket, newRewardBasePoints) -} - -// UpdateRewardBasePoints is a paid mutator transaction binding the contract method 0x7195df15. -// -// Solidity: function updateRewardBasePoints(address dataMarket, uint256 newRewardBasePoints) returns() -func (_Contract *ContractSession) UpdateRewardBasePoints(dataMarket common.Address, newRewardBasePoints *big.Int) (*types.Transaction, error) { - return _Contract.Contract.UpdateRewardBasePoints(&_Contract.TransactOpts, dataMarket, newRewardBasePoints) -} - -// UpdateRewardBasePoints is a paid mutator transaction binding the contract method 0x7195df15. -// -// Solidity: function updateRewardBasePoints(address dataMarket, uint256 newRewardBasePoints) returns() -func (_Contract *ContractTransactorSession) UpdateRewardBasePoints(dataMarket common.Address, newRewardBasePoints *big.Int) (*types.Transaction, error) { - return _Contract.Contract.UpdateRewardBasePoints(&_Contract.TransactOpts, dataMarket, newRewardBasePoints) -} - -// UpdateRewards is a paid mutator transaction binding the contract method 0x7d2bd53d. -// -// Solidity: function updateRewards(address dataMarket, uint256[] slotIds, uint256[] submissionsList, uint256 day) returns() -func (_Contract *ContractTransactor) UpdateRewards(opts *bind.TransactOpts, dataMarket common.Address, slotIds []*big.Int, submissionsList []*big.Int, day *big.Int) (*types.Transaction, error) { - return _Contract.contract.Transact(opts, "updateRewards", dataMarket, slotIds, submissionsList, day) -} - -// UpdateRewards is a paid mutator transaction binding the contract method 0x7d2bd53d. -// -// Solidity: function updateRewards(address dataMarket, uint256[] slotIds, uint256[] submissionsList, uint256 day) returns() -func (_Contract *ContractSession) UpdateRewards(dataMarket common.Address, slotIds []*big.Int, submissionsList []*big.Int, day *big.Int) (*types.Transaction, error) { - return _Contract.Contract.UpdateRewards(&_Contract.TransactOpts, dataMarket, slotIds, submissionsList, day) -} - -// UpdateRewards is a paid mutator transaction binding the contract method 0x7d2bd53d. -// -// Solidity: function updateRewards(address dataMarket, uint256[] slotIds, uint256[] submissionsList, uint256 day) returns() -func (_Contract *ContractTransactorSession) UpdateRewards(dataMarket common.Address, slotIds []*big.Int, submissionsList []*big.Int, day *big.Int) (*types.Transaction, error) { - return _Contract.Contract.UpdateRewards(&_Contract.TransactOpts, dataMarket, slotIds, submissionsList, day) +// Solidity: function updateRewards(address dataMarket, uint256[] slotIds, uint256[] submissionsList, uint256 day, uint256 eligibleNodes) returns() +func (_Contract *ContractTransactorSession) UpdateRewards(dataMarket common.Address, slotIds []*big.Int, submissionsList []*big.Int, day *big.Int, eligibleNodes *big.Int) (*types.Transaction, error) { + return _Contract.Contract.UpdateRewards(&_Contract.TransactOpts, dataMarket, slotIds, submissionsList, day, eligibleNodes) } // UpdateSnapshotSubmissionWindow is a paid mutator transaction binding the contract method 0xa02c3e9b. @@ -3655,16 +3617,16 @@ func (it *ContractDelayedAttestationSubmittedIterator) Close() error { // ContractDelayedAttestationSubmitted represents a DelayedAttestationSubmitted event raised by the Contract contract. type ContractDelayedAttestationSubmitted struct { DataMarketAddress common.Address - BatchId *big.Int + BatchCid string EpochId *big.Int Timestamp *big.Int ValidatorAddr common.Address Raw types.Log // Blockchain specific contextual infos } -// FilterDelayedAttestationSubmitted is a free log retrieval operation binding the contract event 0x4fd04f28641379ddef7bacd546c5e698814831a1c0772236c460aa42b029aa31. +// FilterDelayedAttestationSubmitted is a free log retrieval operation binding the contract event 0x23db68f6127736e9b15d04ab69c48dc844e007832c59edaf8f60cae2dd638808. // -// Solidity: event DelayedAttestationSubmitted(address indexed dataMarketAddress, uint256 batchId, uint256 indexed epochId, uint256 timestamp, address indexed validatorAddr) +// Solidity: event DelayedAttestationSubmitted(address indexed dataMarketAddress, string batchCid, uint256 indexed epochId, uint256 timestamp, address indexed validatorAddr) func (_Contract *ContractFilterer) FilterDelayedAttestationSubmitted(opts *bind.FilterOpts, dataMarketAddress []common.Address, epochId []*big.Int, validatorAddr []common.Address) (*ContractDelayedAttestationSubmittedIterator, error) { var dataMarketAddressRule []interface{} @@ -3689,9 +3651,9 @@ func (_Contract *ContractFilterer) FilterDelayedAttestationSubmitted(opts *bind. return &ContractDelayedAttestationSubmittedIterator{contract: _Contract.contract, event: "DelayedAttestationSubmitted", logs: logs, sub: sub}, nil } -// WatchDelayedAttestationSubmitted is a free log subscription operation binding the contract event 0x4fd04f28641379ddef7bacd546c5e698814831a1c0772236c460aa42b029aa31. +// WatchDelayedAttestationSubmitted is a free log subscription operation binding the contract event 0x23db68f6127736e9b15d04ab69c48dc844e007832c59edaf8f60cae2dd638808. // -// Solidity: event DelayedAttestationSubmitted(address indexed dataMarketAddress, uint256 batchId, uint256 indexed epochId, uint256 timestamp, address indexed validatorAddr) +// Solidity: event DelayedAttestationSubmitted(address indexed dataMarketAddress, string batchCid, uint256 indexed epochId, uint256 timestamp, address indexed validatorAddr) func (_Contract *ContractFilterer) WatchDelayedAttestationSubmitted(opts *bind.WatchOpts, sink chan<- *ContractDelayedAttestationSubmitted, dataMarketAddress []common.Address, epochId []*big.Int, validatorAddr []common.Address) (event.Subscription, error) { var dataMarketAddressRule []interface{} @@ -3741,9 +3703,9 @@ func (_Contract *ContractFilterer) WatchDelayedAttestationSubmitted(opts *bind.W }), nil } -// ParseDelayedAttestationSubmitted is a log parse operation binding the contract event 0x4fd04f28641379ddef7bacd546c5e698814831a1c0772236c460aa42b029aa31. +// ParseDelayedAttestationSubmitted is a log parse operation binding the contract event 0x23db68f6127736e9b15d04ab69c48dc844e007832c59edaf8f60cae2dd638808. // -// Solidity: event DelayedAttestationSubmitted(address indexed dataMarketAddress, uint256 batchId, uint256 indexed epochId, uint256 timestamp, address indexed validatorAddr) +// Solidity: event DelayedAttestationSubmitted(address indexed dataMarketAddress, string batchCid, uint256 indexed epochId, uint256 timestamp, address indexed validatorAddr) func (_Contract *ContractFilterer) ParseDelayedAttestationSubmitted(log types.Log) (*ContractDelayedAttestationSubmitted, error) { event := new(ContractDelayedAttestationSubmitted) if err := _Contract.contract.UnpackLog(event, "DelayedAttestationSubmitted", log); err != nil { @@ -3823,16 +3785,15 @@ func (it *ContractDelayedBatchSubmittedIterator) Close() error { // ContractDelayedBatchSubmitted represents a DelayedBatchSubmitted event raised by the Contract contract. type ContractDelayedBatchSubmitted struct { DataMarketAddress common.Address - BatchId *big.Int BatchCid string EpochId *big.Int Timestamp *big.Int Raw types.Log // Blockchain specific contextual infos } -// FilterDelayedBatchSubmitted is a free log retrieval operation binding the contract event 0xf2de85dca20817401360fd386051732f208a7508ed4ffa7c15686979da276ec6. +// FilterDelayedBatchSubmitted is a free log retrieval operation binding the contract event 0xa48b3f37894ae648db7ab45db773764cc131b15cb19978e17da7bcd79eaf64be. // -// Solidity: event DelayedBatchSubmitted(address indexed dataMarketAddress, uint256 batchId, string batchCid, uint256 indexed epochId, uint256 timestamp) +// Solidity: event DelayedBatchSubmitted(address indexed dataMarketAddress, string batchCid, uint256 indexed epochId, uint256 timestamp) func (_Contract *ContractFilterer) FilterDelayedBatchSubmitted(opts *bind.FilterOpts, dataMarketAddress []common.Address, epochId []*big.Int) (*ContractDelayedBatchSubmittedIterator, error) { var dataMarketAddressRule []interface{} @@ -3852,9 +3813,9 @@ func (_Contract *ContractFilterer) FilterDelayedBatchSubmitted(opts *bind.Filter return &ContractDelayedBatchSubmittedIterator{contract: _Contract.contract, event: "DelayedBatchSubmitted", logs: logs, sub: sub}, nil } -// WatchDelayedBatchSubmitted is a free log subscription operation binding the contract event 0xf2de85dca20817401360fd386051732f208a7508ed4ffa7c15686979da276ec6. +// WatchDelayedBatchSubmitted is a free log subscription operation binding the contract event 0xa48b3f37894ae648db7ab45db773764cc131b15cb19978e17da7bcd79eaf64be. // -// Solidity: event DelayedBatchSubmitted(address indexed dataMarketAddress, uint256 batchId, string batchCid, uint256 indexed epochId, uint256 timestamp) +// Solidity: event DelayedBatchSubmitted(address indexed dataMarketAddress, string batchCid, uint256 indexed epochId, uint256 timestamp) func (_Contract *ContractFilterer) WatchDelayedBatchSubmitted(opts *bind.WatchOpts, sink chan<- *ContractDelayedBatchSubmitted, dataMarketAddress []common.Address, epochId []*big.Int) (event.Subscription, error) { var dataMarketAddressRule []interface{} @@ -3899,9 +3860,9 @@ func (_Contract *ContractFilterer) WatchDelayedBatchSubmitted(opts *bind.WatchOp }), nil } -// ParseDelayedBatchSubmitted is a log parse operation binding the contract event 0xf2de85dca20817401360fd386051732f208a7508ed4ffa7c15686979da276ec6. +// ParseDelayedBatchSubmitted is a log parse operation binding the contract event 0xa48b3f37894ae648db7ab45db773764cc131b15cb19978e17da7bcd79eaf64be. // -// Solidity: event DelayedBatchSubmitted(address indexed dataMarketAddress, uint256 batchId, string batchCid, uint256 indexed epochId, uint256 timestamp) +// Solidity: event DelayedBatchSubmitted(address indexed dataMarketAddress, string batchCid, uint256 indexed epochId, uint256 timestamp) func (_Contract *ContractFilterer) ParseDelayedBatchSubmitted(log types.Log) (*ContractDelayedBatchSubmitted, error) { event := new(ContractDelayedBatchSubmitted) if err := _Contract.contract.UnpackLog(event, "DelayedBatchSubmitted", log); err != nil { @@ -4079,6 +4040,151 @@ func (_Contract *ContractFilterer) ParseDelayedSnapshotSubmitted(log types.Log) return event, nil } +// ContractEmergencyWithdrawIterator is returned from FilterEmergencyWithdraw and is used to iterate over the raw logs and unpacked data for EmergencyWithdraw events raised by the Contract contract. +type ContractEmergencyWithdrawIterator struct { + Event *ContractEmergencyWithdraw // 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 *ContractEmergencyWithdrawIterator) 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(ContractEmergencyWithdraw) + 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(ContractEmergencyWithdraw) + 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 *ContractEmergencyWithdrawIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ContractEmergencyWithdrawIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ContractEmergencyWithdraw represents a EmergencyWithdraw event raised by the Contract contract. +type ContractEmergencyWithdraw struct { + Owner common.Address + Amount *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterEmergencyWithdraw is a free log retrieval operation binding the contract event 0x5fafa99d0643513820be26656b45130b01e1c03062e1266bf36f88cbd3bd9695. +// +// Solidity: event EmergencyWithdraw(address indexed owner, uint256 amount) +func (_Contract *ContractFilterer) FilterEmergencyWithdraw(opts *bind.FilterOpts, owner []common.Address) (*ContractEmergencyWithdrawIterator, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + + logs, sub, err := _Contract.contract.FilterLogs(opts, "EmergencyWithdraw", ownerRule) + if err != nil { + return nil, err + } + return &ContractEmergencyWithdrawIterator{contract: _Contract.contract, event: "EmergencyWithdraw", logs: logs, sub: sub}, nil +} + +// WatchEmergencyWithdraw is a free log subscription operation binding the contract event 0x5fafa99d0643513820be26656b45130b01e1c03062e1266bf36f88cbd3bd9695. +// +// Solidity: event EmergencyWithdraw(address indexed owner, uint256 amount) +func (_Contract *ContractFilterer) WatchEmergencyWithdraw(opts *bind.WatchOpts, sink chan<- *ContractEmergencyWithdraw, owner []common.Address) (event.Subscription, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + + logs, sub, err := _Contract.contract.WatchLogs(opts, "EmergencyWithdraw", ownerRule) + 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(ContractEmergencyWithdraw) + if err := _Contract.contract.UnpackLog(event, "EmergencyWithdraw", 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 +} + +// ParseEmergencyWithdraw is a log parse operation binding the contract event 0x5fafa99d0643513820be26656b45130b01e1c03062e1266bf36f88cbd3bd9695. +// +// Solidity: event EmergencyWithdraw(address indexed owner, uint256 amount) +func (_Contract *ContractFilterer) ParseEmergencyWithdraw(log types.Log) (*ContractEmergencyWithdraw, error) { + event := new(ContractEmergencyWithdraw) + if err := _Contract.contract.UnpackLog(event, "EmergencyWithdraw", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + // ContractEpochReleasedIterator is returned from FilterEpochReleased and is used to iterate over the raw logs and unpacked data for EpochReleased events raised by the Contract contract. type ContractEpochReleasedIterator struct { Event *ContractEpochReleased // Event containing the contract specifics and raw log @@ -4522,9 +4628,9 @@ func (_Contract *ContractFilterer) ParseOwnershipTransferred(log types.Log) (*Co return event, nil } -// ContractProjectTypeUpdatedIterator is returned from FilterProjectTypeUpdated and is used to iterate over the raw logs and unpacked data for ProjectTypeUpdated events raised by the Contract contract. -type ContractProjectTypeUpdatedIterator struct { - Event *ContractProjectTypeUpdated // Event containing the contract specifics and raw log +// ContractRewardsClaimedIterator is returned from FilterRewardsClaimed and is used to iterate over the raw logs and unpacked data for RewardsClaimed events raised by the Contract contract. +type ContractRewardsClaimedIterator struct { + Event *ContractRewardsClaimed // 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 @@ -4538,7 +4644,7 @@ type ContractProjectTypeUpdatedIterator struct { // 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 *ContractProjectTypeUpdatedIterator) Next() bool { +func (it *ContractRewardsClaimedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -4547,7 +4653,7 @@ func (it *ContractProjectTypeUpdatedIterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(ContractProjectTypeUpdated) + it.Event = new(ContractRewardsClaimed) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -4562,7 +4668,7 @@ func (it *ContractProjectTypeUpdatedIterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(ContractProjectTypeUpdated) + it.Event = new(ContractRewardsClaimed) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -4578,54 +4684,53 @@ func (it *ContractProjectTypeUpdatedIterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *ContractProjectTypeUpdatedIterator) Error() error { +func (it *ContractRewardsClaimedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *ContractProjectTypeUpdatedIterator) Close() error { +func (it *ContractRewardsClaimedIterator) Close() error { it.sub.Unsubscribe() return nil } -// ContractProjectTypeUpdated represents a ProjectTypeUpdated event raised by the Contract contract. -type ContractProjectTypeUpdated struct { - DataMarketAddress common.Address - ProjectType string - Allowed bool - EnableEpochId *big.Int - Raw types.Log // Blockchain specific contextual infos +// ContractRewardsClaimed represents a RewardsClaimed event raised by the Contract contract. +type ContractRewardsClaimed struct { + User common.Address + Amount *big.Int + Timestamp *big.Int + Raw types.Log // Blockchain specific contextual infos } -// FilterProjectTypeUpdated is a free log retrieval operation binding the contract event 0x3c6dc99dfc227a11ad701f84af7d44db829ba6c5e71c85f0ba80da02a2c20b42. +// FilterRewardsClaimed is a free log retrieval operation binding the contract event 0xdacbdde355ba930696a362ea6738feb9f8bd52dfb3d81947558fd3217e23e325. // -// Solidity: event ProjectTypeUpdated(address indexed dataMarketAddress, string projectType, bool allowed, uint256 enableEpochId) -func (_Contract *ContractFilterer) FilterProjectTypeUpdated(opts *bind.FilterOpts, dataMarketAddress []common.Address) (*ContractProjectTypeUpdatedIterator, error) { +// Solidity: event RewardsClaimed(address indexed user, uint256 amount, uint256 timestamp) +func (_Contract *ContractFilterer) FilterRewardsClaimed(opts *bind.FilterOpts, user []common.Address) (*ContractRewardsClaimedIterator, error) { - var dataMarketAddressRule []interface{} - for _, dataMarketAddressItem := range dataMarketAddress { - dataMarketAddressRule = append(dataMarketAddressRule, dataMarketAddressItem) + var userRule []interface{} + for _, userItem := range user { + userRule = append(userRule, userItem) } - logs, sub, err := _Contract.contract.FilterLogs(opts, "ProjectTypeUpdated", dataMarketAddressRule) + logs, sub, err := _Contract.contract.FilterLogs(opts, "RewardsClaimed", userRule) if err != nil { return nil, err } - return &ContractProjectTypeUpdatedIterator{contract: _Contract.contract, event: "ProjectTypeUpdated", logs: logs, sub: sub}, nil + return &ContractRewardsClaimedIterator{contract: _Contract.contract, event: "RewardsClaimed", logs: logs, sub: sub}, nil } -// WatchProjectTypeUpdated is a free log subscription operation binding the contract event 0x3c6dc99dfc227a11ad701f84af7d44db829ba6c5e71c85f0ba80da02a2c20b42. +// WatchRewardsClaimed is a free log subscription operation binding the contract event 0xdacbdde355ba930696a362ea6738feb9f8bd52dfb3d81947558fd3217e23e325. // -// Solidity: event ProjectTypeUpdated(address indexed dataMarketAddress, string projectType, bool allowed, uint256 enableEpochId) -func (_Contract *ContractFilterer) WatchProjectTypeUpdated(opts *bind.WatchOpts, sink chan<- *ContractProjectTypeUpdated, dataMarketAddress []common.Address) (event.Subscription, error) { +// Solidity: event RewardsClaimed(address indexed user, uint256 amount, uint256 timestamp) +func (_Contract *ContractFilterer) WatchRewardsClaimed(opts *bind.WatchOpts, sink chan<- *ContractRewardsClaimed, user []common.Address) (event.Subscription, error) { - var dataMarketAddressRule []interface{} - for _, dataMarketAddressItem := range dataMarketAddress { - dataMarketAddressRule = append(dataMarketAddressRule, dataMarketAddressItem) + var userRule []interface{} + for _, userItem := range user { + userRule = append(userRule, userItem) } - logs, sub, err := _Contract.contract.WatchLogs(opts, "ProjectTypeUpdated", dataMarketAddressRule) + logs, sub, err := _Contract.contract.WatchLogs(opts, "RewardsClaimed", userRule) if err != nil { return nil, err } @@ -4635,8 +4740,8 @@ func (_Contract *ContractFilterer) WatchProjectTypeUpdated(opts *bind.WatchOpts, select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(ContractProjectTypeUpdated) - if err := _Contract.contract.UnpackLog(event, "ProjectTypeUpdated", log); err != nil { + event := new(ContractRewardsClaimed) + if err := _Contract.contract.UnpackLog(event, "RewardsClaimed", log); err != nil { return err } event.Raw = log @@ -4657,21 +4762,21 @@ func (_Contract *ContractFilterer) WatchProjectTypeUpdated(opts *bind.WatchOpts, }), nil } -// ParseProjectTypeUpdated is a log parse operation binding the contract event 0x3c6dc99dfc227a11ad701f84af7d44db829ba6c5e71c85f0ba80da02a2c20b42. +// ParseRewardsClaimed is a log parse operation binding the contract event 0xdacbdde355ba930696a362ea6738feb9f8bd52dfb3d81947558fd3217e23e325. // -// Solidity: event ProjectTypeUpdated(address indexed dataMarketAddress, string projectType, bool allowed, uint256 enableEpochId) -func (_Contract *ContractFilterer) ParseProjectTypeUpdated(log types.Log) (*ContractProjectTypeUpdated, error) { - event := new(ContractProjectTypeUpdated) - if err := _Contract.contract.UnpackLog(event, "ProjectTypeUpdated", log); err != nil { +// Solidity: event RewardsClaimed(address indexed user, uint256 amount, uint256 timestamp) +func (_Contract *ContractFilterer) ParseRewardsClaimed(log types.Log) (*ContractRewardsClaimed, error) { + event := new(ContractRewardsClaimed) + if err := _Contract.contract.UnpackLog(event, "RewardsClaimed", log); err != nil { return nil, err } event.Raw = log return event, nil } -// ContractProjectsUpdatedIterator is returned from FilterProjectsUpdated and is used to iterate over the raw logs and unpacked data for ProjectsUpdated events raised by the Contract contract. -type ContractProjectsUpdatedIterator struct { - Event *ContractProjectsUpdated // Event containing the contract specifics and raw log +// ContractRewardsDistributedEventIterator is returned from FilterRewardsDistributedEvent and is used to iterate over the raw logs and unpacked data for RewardsDistributedEvent events raised by the Contract contract. +type ContractRewardsDistributedEventIterator struct { + Event *ContractRewardsDistributedEvent // 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 @@ -4685,7 +4790,7 @@ type ContractProjectsUpdatedIterator struct { // 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 *ContractProjectsUpdatedIterator) Next() bool { +func (it *ContractRewardsDistributedEventIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -4694,7 +4799,7 @@ func (it *ContractProjectsUpdatedIterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(ContractProjectsUpdated) + it.Event = new(ContractRewardsDistributedEvent) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -4709,7 +4814,7 @@ func (it *ContractProjectsUpdatedIterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(ContractProjectsUpdated) + it.Event = new(ContractRewardsDistributedEvent) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -4725,54 +4830,56 @@ func (it *ContractProjectsUpdatedIterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *ContractProjectsUpdatedIterator) Error() error { +func (it *ContractRewardsDistributedEventIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *ContractProjectsUpdatedIterator) Close() error { +func (it *ContractRewardsDistributedEventIterator) Close() error { it.sub.Unsubscribe() return nil } -// ContractProjectsUpdated represents a ProjectsUpdated event raised by the Contract contract. -type ContractProjectsUpdated struct { - DataMarketAddress common.Address - Projects []string - Status []bool - EnableEpochId *big.Int - Raw types.Log // Blockchain specific contextual infos +// ContractRewardsDistributedEvent represents a RewardsDistributedEvent event raised by the Contract contract. +type ContractRewardsDistributedEvent struct { + DataMarketAddress common.Address + SnapshotterAddress common.Address + SlotId *big.Int + DayId *big.Int + RewardPoints *big.Int + Timestamp *big.Int + Raw types.Log // Blockchain specific contextual infos } -// FilterProjectsUpdated is a free log retrieval operation binding the contract event 0xcbf1b93d76451f05244e2f6139bf7266a14bac5182e5ed8981ab0ce36479efbf. +// FilterRewardsDistributedEvent is a free log retrieval operation binding the contract event 0xff2541745d6ce75b9522a6e9b397f0c46d824c46a8bd4c145797d01f770dcf78. // -// Solidity: event ProjectsUpdated(address indexed dataMarketAddress, string[] projects, bool[] status, uint256 enableEpochId) -func (_Contract *ContractFilterer) FilterProjectsUpdated(opts *bind.FilterOpts, dataMarketAddress []common.Address) (*ContractProjectsUpdatedIterator, error) { +// Solidity: event RewardsDistributedEvent(address indexed dataMarketAddress, address snapshotterAddress, uint256 slotId, uint256 dayId, uint256 rewardPoints, uint256 timestamp) +func (_Contract *ContractFilterer) FilterRewardsDistributedEvent(opts *bind.FilterOpts, dataMarketAddress []common.Address) (*ContractRewardsDistributedEventIterator, error) { var dataMarketAddressRule []interface{} for _, dataMarketAddressItem := range dataMarketAddress { dataMarketAddressRule = append(dataMarketAddressRule, dataMarketAddressItem) } - logs, sub, err := _Contract.contract.FilterLogs(opts, "ProjectsUpdated", dataMarketAddressRule) + logs, sub, err := _Contract.contract.FilterLogs(opts, "RewardsDistributedEvent", dataMarketAddressRule) if err != nil { return nil, err } - return &ContractProjectsUpdatedIterator{contract: _Contract.contract, event: "ProjectsUpdated", logs: logs, sub: sub}, nil + return &ContractRewardsDistributedEventIterator{contract: _Contract.contract, event: "RewardsDistributedEvent", logs: logs, sub: sub}, nil } -// WatchProjectsUpdated is a free log subscription operation binding the contract event 0xcbf1b93d76451f05244e2f6139bf7266a14bac5182e5ed8981ab0ce36479efbf. +// WatchRewardsDistributedEvent is a free log subscription operation binding the contract event 0xff2541745d6ce75b9522a6e9b397f0c46d824c46a8bd4c145797d01f770dcf78. // -// Solidity: event ProjectsUpdated(address indexed dataMarketAddress, string[] projects, bool[] status, uint256 enableEpochId) -func (_Contract *ContractFilterer) WatchProjectsUpdated(opts *bind.WatchOpts, sink chan<- *ContractProjectsUpdated, dataMarketAddress []common.Address) (event.Subscription, error) { +// Solidity: event RewardsDistributedEvent(address indexed dataMarketAddress, address snapshotterAddress, uint256 slotId, uint256 dayId, uint256 rewardPoints, uint256 timestamp) +func (_Contract *ContractFilterer) WatchRewardsDistributedEvent(opts *bind.WatchOpts, sink chan<- *ContractRewardsDistributedEvent, dataMarketAddress []common.Address) (event.Subscription, error) { var dataMarketAddressRule []interface{} for _, dataMarketAddressItem := range dataMarketAddress { dataMarketAddressRule = append(dataMarketAddressRule, dataMarketAddressItem) } - logs, sub, err := _Contract.contract.WatchLogs(opts, "ProjectsUpdated", dataMarketAddressRule) + logs, sub, err := _Contract.contract.WatchLogs(opts, "RewardsDistributedEvent", dataMarketAddressRule) if err != nil { return nil, err } @@ -4782,8 +4889,8 @@ func (_Contract *ContractFilterer) WatchProjectsUpdated(opts *bind.WatchOpts, si select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(ContractProjectsUpdated) - if err := _Contract.contract.UnpackLog(event, "ProjectsUpdated", log); err != nil { + event := new(ContractRewardsDistributedEvent) + if err := _Contract.contract.UnpackLog(event, "RewardsDistributedEvent", log); err != nil { return err } event.Raw = log @@ -4804,12 +4911,12 @@ func (_Contract *ContractFilterer) WatchProjectsUpdated(opts *bind.WatchOpts, si }), nil } -// ParseProjectsUpdated is a log parse operation binding the contract event 0xcbf1b93d76451f05244e2f6139bf7266a14bac5182e5ed8981ab0ce36479efbf. +// ParseRewardsDistributedEvent is a log parse operation binding the contract event 0xff2541745d6ce75b9522a6e9b397f0c46d824c46a8bd4c145797d01f770dcf78. // -// Solidity: event ProjectsUpdated(address indexed dataMarketAddress, string[] projects, bool[] status, uint256 enableEpochId) -func (_Contract *ContractFilterer) ParseProjectsUpdated(log types.Log) (*ContractProjectsUpdated, error) { - event := new(ContractProjectsUpdated) - if err := _Contract.contract.UnpackLog(event, "ProjectsUpdated", log); err != nil { +// Solidity: event RewardsDistributedEvent(address indexed dataMarketAddress, address snapshotterAddress, uint256 slotId, uint256 dayId, uint256 rewardPoints, uint256 timestamp) +func (_Contract *ContractFilterer) ParseRewardsDistributedEvent(log types.Log) (*ContractRewardsDistributedEvent, error) { + event := new(ContractRewardsDistributedEvent) + if err := _Contract.contract.UnpackLog(event, "RewardsDistributedEvent", log); err != nil { return nil, err } event.Raw = log @@ -5032,16 +5139,16 @@ func (it *ContractSnapshotBatchAttestationSubmittedIterator) Close() error { // ContractSnapshotBatchAttestationSubmitted represents a SnapshotBatchAttestationSubmitted event raised by the Contract contract. type ContractSnapshotBatchAttestationSubmitted struct { DataMarketAddress common.Address - BatchId *big.Int + BatchCid string EpochId *big.Int Timestamp *big.Int ValidatorAddr common.Address Raw types.Log // Blockchain specific contextual infos } -// FilterSnapshotBatchAttestationSubmitted is a free log retrieval operation binding the contract event 0xf4b2e45e85a2dfbff1f3d17d57722c58599f10a2a3b9764b6106e7ca0c21d22f. +// FilterSnapshotBatchAttestationSubmitted is a free log retrieval operation binding the contract event 0x0b0cf2ab04f090685b5b2ac9b8beb1cc821e28298914a0ae86d397c79fe63c01. // -// Solidity: event SnapshotBatchAttestationSubmitted(address indexed dataMarketAddress, uint256 batchId, uint256 indexed epochId, uint256 timestamp, address indexed validatorAddr) +// Solidity: event SnapshotBatchAttestationSubmitted(address indexed dataMarketAddress, string batchCid, uint256 indexed epochId, uint256 timestamp, address indexed validatorAddr) func (_Contract *ContractFilterer) FilterSnapshotBatchAttestationSubmitted(opts *bind.FilterOpts, dataMarketAddress []common.Address, epochId []*big.Int, validatorAddr []common.Address) (*ContractSnapshotBatchAttestationSubmittedIterator, error) { var dataMarketAddressRule []interface{} @@ -5066,9 +5173,9 @@ func (_Contract *ContractFilterer) FilterSnapshotBatchAttestationSubmitted(opts return &ContractSnapshotBatchAttestationSubmittedIterator{contract: _Contract.contract, event: "SnapshotBatchAttestationSubmitted", logs: logs, sub: sub}, nil } -// WatchSnapshotBatchAttestationSubmitted is a free log subscription operation binding the contract event 0xf4b2e45e85a2dfbff1f3d17d57722c58599f10a2a3b9764b6106e7ca0c21d22f. +// WatchSnapshotBatchAttestationSubmitted is a free log subscription operation binding the contract event 0x0b0cf2ab04f090685b5b2ac9b8beb1cc821e28298914a0ae86d397c79fe63c01. // -// Solidity: event SnapshotBatchAttestationSubmitted(address indexed dataMarketAddress, uint256 batchId, uint256 indexed epochId, uint256 timestamp, address indexed validatorAddr) +// Solidity: event SnapshotBatchAttestationSubmitted(address indexed dataMarketAddress, string batchCid, uint256 indexed epochId, uint256 timestamp, address indexed validatorAddr) func (_Contract *ContractFilterer) WatchSnapshotBatchAttestationSubmitted(opts *bind.WatchOpts, sink chan<- *ContractSnapshotBatchAttestationSubmitted, dataMarketAddress []common.Address, epochId []*big.Int, validatorAddr []common.Address) (event.Subscription, error) { var dataMarketAddressRule []interface{} @@ -5118,9 +5225,9 @@ func (_Contract *ContractFilterer) WatchSnapshotBatchAttestationSubmitted(opts * }), nil } -// ParseSnapshotBatchAttestationSubmitted is a log parse operation binding the contract event 0xf4b2e45e85a2dfbff1f3d17d57722c58599f10a2a3b9764b6106e7ca0c21d22f. +// ParseSnapshotBatchAttestationSubmitted is a log parse operation binding the contract event 0x0b0cf2ab04f090685b5b2ac9b8beb1cc821e28298914a0ae86d397c79fe63c01. // -// Solidity: event SnapshotBatchAttestationSubmitted(address indexed dataMarketAddress, uint256 batchId, uint256 indexed epochId, uint256 timestamp, address indexed validatorAddr) +// Solidity: event SnapshotBatchAttestationSubmitted(address indexed dataMarketAddress, string batchCid, uint256 indexed epochId, uint256 timestamp, address indexed validatorAddr) func (_Contract *ContractFilterer) ParseSnapshotBatchAttestationSubmitted(log types.Log) (*ContractSnapshotBatchAttestationSubmitted, error) { event := new(ContractSnapshotBatchAttestationSubmitted) if err := _Contract.contract.UnpackLog(event, "SnapshotBatchAttestationSubmitted", log); err != nil { @@ -5201,15 +5308,15 @@ func (it *ContractSnapshotBatchFinalizedIterator) Close() error { type ContractSnapshotBatchFinalized struct { DataMarketAddress common.Address EpochId *big.Int - BatchId *big.Int + BatchCid common.Hash Timestamp *big.Int Raw types.Log // Blockchain specific contextual infos } -// FilterSnapshotBatchFinalized is a free log retrieval operation binding the contract event 0x9737b8e7fb3913ba98706f4b1758ac14f5cf26afbb2457117aa3360b9cc85de1. +// FilterSnapshotBatchFinalized is a free log retrieval operation binding the contract event 0x5ce21fc72041bd91ef828e11b07f6d1107a20642ea918f190e1e2029d85fedfe. // -// Solidity: event SnapshotBatchFinalized(address indexed dataMarketAddress, uint256 indexed epochId, uint256 indexed batchId, uint256 timestamp) -func (_Contract *ContractFilterer) FilterSnapshotBatchFinalized(opts *bind.FilterOpts, dataMarketAddress []common.Address, epochId []*big.Int, batchId []*big.Int) (*ContractSnapshotBatchFinalizedIterator, error) { +// Solidity: event SnapshotBatchFinalized(address indexed dataMarketAddress, uint256 indexed epochId, string indexed batchCid, uint256 timestamp) +func (_Contract *ContractFilterer) FilterSnapshotBatchFinalized(opts *bind.FilterOpts, dataMarketAddress []common.Address, epochId []*big.Int, batchCid []string) (*ContractSnapshotBatchFinalizedIterator, error) { var dataMarketAddressRule []interface{} for _, dataMarketAddressItem := range dataMarketAddress { @@ -5219,22 +5326,22 @@ func (_Contract *ContractFilterer) FilterSnapshotBatchFinalized(opts *bind.Filte for _, epochIdItem := range epochId { epochIdRule = append(epochIdRule, epochIdItem) } - var batchIdRule []interface{} - for _, batchIdItem := range batchId { - batchIdRule = append(batchIdRule, batchIdItem) + var batchCidRule []interface{} + for _, batchCidItem := range batchCid { + batchCidRule = append(batchCidRule, batchCidItem) } - logs, sub, err := _Contract.contract.FilterLogs(opts, "SnapshotBatchFinalized", dataMarketAddressRule, epochIdRule, batchIdRule) + logs, sub, err := _Contract.contract.FilterLogs(opts, "SnapshotBatchFinalized", dataMarketAddressRule, epochIdRule, batchCidRule) if err != nil { return nil, err } return &ContractSnapshotBatchFinalizedIterator{contract: _Contract.contract, event: "SnapshotBatchFinalized", logs: logs, sub: sub}, nil } -// WatchSnapshotBatchFinalized is a free log subscription operation binding the contract event 0x9737b8e7fb3913ba98706f4b1758ac14f5cf26afbb2457117aa3360b9cc85de1. +// WatchSnapshotBatchFinalized is a free log subscription operation binding the contract event 0x5ce21fc72041bd91ef828e11b07f6d1107a20642ea918f190e1e2029d85fedfe. // -// Solidity: event SnapshotBatchFinalized(address indexed dataMarketAddress, uint256 indexed epochId, uint256 indexed batchId, uint256 timestamp) -func (_Contract *ContractFilterer) WatchSnapshotBatchFinalized(opts *bind.WatchOpts, sink chan<- *ContractSnapshotBatchFinalized, dataMarketAddress []common.Address, epochId []*big.Int, batchId []*big.Int) (event.Subscription, error) { +// Solidity: event SnapshotBatchFinalized(address indexed dataMarketAddress, uint256 indexed epochId, string indexed batchCid, uint256 timestamp) +func (_Contract *ContractFilterer) WatchSnapshotBatchFinalized(opts *bind.WatchOpts, sink chan<- *ContractSnapshotBatchFinalized, dataMarketAddress []common.Address, epochId []*big.Int, batchCid []string) (event.Subscription, error) { var dataMarketAddressRule []interface{} for _, dataMarketAddressItem := range dataMarketAddress { @@ -5244,12 +5351,12 @@ func (_Contract *ContractFilterer) WatchSnapshotBatchFinalized(opts *bind.WatchO for _, epochIdItem := range epochId { epochIdRule = append(epochIdRule, epochIdItem) } - var batchIdRule []interface{} - for _, batchIdItem := range batchId { - batchIdRule = append(batchIdRule, batchIdItem) + var batchCidRule []interface{} + for _, batchCidItem := range batchCid { + batchCidRule = append(batchCidRule, batchCidItem) } - logs, sub, err := _Contract.contract.WatchLogs(opts, "SnapshotBatchFinalized", dataMarketAddressRule, epochIdRule, batchIdRule) + logs, sub, err := _Contract.contract.WatchLogs(opts, "SnapshotBatchFinalized", dataMarketAddressRule, epochIdRule, batchCidRule) if err != nil { return nil, err } @@ -5281,9 +5388,9 @@ func (_Contract *ContractFilterer) WatchSnapshotBatchFinalized(opts *bind.WatchO }), nil } -// ParseSnapshotBatchFinalized is a log parse operation binding the contract event 0x9737b8e7fb3913ba98706f4b1758ac14f5cf26afbb2457117aa3360b9cc85de1. +// ParseSnapshotBatchFinalized is a log parse operation binding the contract event 0x5ce21fc72041bd91ef828e11b07f6d1107a20642ea918f190e1e2029d85fedfe. // -// Solidity: event SnapshotBatchFinalized(address indexed dataMarketAddress, uint256 indexed epochId, uint256 indexed batchId, uint256 timestamp) +// Solidity: event SnapshotBatchFinalized(address indexed dataMarketAddress, uint256 indexed epochId, string indexed batchCid, uint256 timestamp) func (_Contract *ContractFilterer) ParseSnapshotBatchFinalized(log types.Log) (*ContractSnapshotBatchFinalized, error) { event := new(ContractSnapshotBatchFinalized) if err := _Contract.contract.UnpackLog(event, "SnapshotBatchFinalized", log); err != nil { @@ -5363,16 +5470,15 @@ func (it *ContractSnapshotBatchSubmittedIterator) Close() error { // ContractSnapshotBatchSubmitted represents a SnapshotBatchSubmitted event raised by the Contract contract. type ContractSnapshotBatchSubmitted struct { DataMarketAddress common.Address - BatchId *big.Int BatchCid string EpochId *big.Int Timestamp *big.Int Raw types.Log // Blockchain specific contextual infos } -// FilterSnapshotBatchSubmitted is a free log retrieval operation binding the contract event 0x0b4031b6dda76fc423ccf9fba3aa5b0936474be3c9b7080c165c0744a002fe75. +// FilterSnapshotBatchSubmitted is a free log retrieval operation binding the contract event 0xcbd08c0021940d15cc732c670afbb27d5170795ee3a4ba0e47368452fae58c5d. // -// Solidity: event SnapshotBatchSubmitted(address indexed dataMarketAddress, uint256 batchId, string batchCid, uint256 indexed epochId, uint256 timestamp) +// Solidity: event SnapshotBatchSubmitted(address indexed dataMarketAddress, string batchCid, uint256 indexed epochId, uint256 timestamp) func (_Contract *ContractFilterer) FilterSnapshotBatchSubmitted(opts *bind.FilterOpts, dataMarketAddress []common.Address, epochId []*big.Int) (*ContractSnapshotBatchSubmittedIterator, error) { var dataMarketAddressRule []interface{} @@ -5392,9 +5498,9 @@ func (_Contract *ContractFilterer) FilterSnapshotBatchSubmitted(opts *bind.Filte return &ContractSnapshotBatchSubmittedIterator{contract: _Contract.contract, event: "SnapshotBatchSubmitted", logs: logs, sub: sub}, nil } -// WatchSnapshotBatchSubmitted is a free log subscription operation binding the contract event 0x0b4031b6dda76fc423ccf9fba3aa5b0936474be3c9b7080c165c0744a002fe75. +// WatchSnapshotBatchSubmitted is a free log subscription operation binding the contract event 0xcbd08c0021940d15cc732c670afbb27d5170795ee3a4ba0e47368452fae58c5d. // -// Solidity: event SnapshotBatchSubmitted(address indexed dataMarketAddress, uint256 batchId, string batchCid, uint256 indexed epochId, uint256 timestamp) +// Solidity: event SnapshotBatchSubmitted(address indexed dataMarketAddress, string batchCid, uint256 indexed epochId, uint256 timestamp) func (_Contract *ContractFilterer) WatchSnapshotBatchSubmitted(opts *bind.WatchOpts, sink chan<- *ContractSnapshotBatchSubmitted, dataMarketAddress []common.Address, epochId []*big.Int) (event.Subscription, error) { var dataMarketAddressRule []interface{} @@ -5439,9 +5545,9 @@ func (_Contract *ContractFilterer) WatchSnapshotBatchSubmitted(opts *bind.WatchO }), nil } -// ParseSnapshotBatchSubmitted is a log parse operation binding the contract event 0x0b4031b6dda76fc423ccf9fba3aa5b0936474be3c9b7080c165c0744a002fe75. +// ParseSnapshotBatchSubmitted is a log parse operation binding the contract event 0xcbd08c0021940d15cc732c670afbb27d5170795ee3a4ba0e47368452fae58c5d. // -// Solidity: event SnapshotBatchSubmitted(address indexed dataMarketAddress, uint256 batchId, string batchCid, uint256 indexed epochId, uint256 timestamp) +// Solidity: event SnapshotBatchSubmitted(address indexed dataMarketAddress, string batchCid, uint256 indexed epochId, uint256 timestamp) func (_Contract *ContractFilterer) ParseSnapshotBatchSubmitted(log types.Log) (*ContractSnapshotBatchSubmitted, error) { event := new(ContractSnapshotBatchSubmitted) if err := _Contract.contract.UnpackLog(event, "SnapshotBatchSubmitted", log); err != nil { @@ -5679,15 +5785,15 @@ func (it *ContractTriggerBatchResubmissionIterator) Close() error { type ContractTriggerBatchResubmission struct { DataMarketAddress common.Address EpochId *big.Int - BatchId *big.Int + BatchCid common.Hash Timestamp *big.Int Raw types.Log // Blockchain specific contextual infos } -// FilterTriggerBatchResubmission is a free log retrieval operation binding the contract event 0x4a87247b65ffdb6c5ebb776b6e70fc9bddc3402b413d82060701fd9c30a3ff07. +// FilterTriggerBatchResubmission is a free log retrieval operation binding the contract event 0x826e6849ff24825cbaeb8adb637217c5a8ef9fa9d8cd09ae58c5223254c25408. // -// Solidity: event TriggerBatchResubmission(address indexed dataMarketAddress, uint256 indexed epochId, uint256 indexed batchId, uint256 timestamp) -func (_Contract *ContractFilterer) FilterTriggerBatchResubmission(opts *bind.FilterOpts, dataMarketAddress []common.Address, epochId []*big.Int, batchId []*big.Int) (*ContractTriggerBatchResubmissionIterator, error) { +// Solidity: event TriggerBatchResubmission(address indexed dataMarketAddress, uint256 indexed epochId, string indexed batchCid, uint256 timestamp) +func (_Contract *ContractFilterer) FilterTriggerBatchResubmission(opts *bind.FilterOpts, dataMarketAddress []common.Address, epochId []*big.Int, batchCid []string) (*ContractTriggerBatchResubmissionIterator, error) { var dataMarketAddressRule []interface{} for _, dataMarketAddressItem := range dataMarketAddress { @@ -5697,22 +5803,22 @@ func (_Contract *ContractFilterer) FilterTriggerBatchResubmission(opts *bind.Fil for _, epochIdItem := range epochId { epochIdRule = append(epochIdRule, epochIdItem) } - var batchIdRule []interface{} - for _, batchIdItem := range batchId { - batchIdRule = append(batchIdRule, batchIdItem) + var batchCidRule []interface{} + for _, batchCidItem := range batchCid { + batchCidRule = append(batchCidRule, batchCidItem) } - logs, sub, err := _Contract.contract.FilterLogs(opts, "TriggerBatchResubmission", dataMarketAddressRule, epochIdRule, batchIdRule) + logs, sub, err := _Contract.contract.FilterLogs(opts, "TriggerBatchResubmission", dataMarketAddressRule, epochIdRule, batchCidRule) if err != nil { return nil, err } return &ContractTriggerBatchResubmissionIterator{contract: _Contract.contract, event: "TriggerBatchResubmission", logs: logs, sub: sub}, nil } -// WatchTriggerBatchResubmission is a free log subscription operation binding the contract event 0x4a87247b65ffdb6c5ebb776b6e70fc9bddc3402b413d82060701fd9c30a3ff07. +// WatchTriggerBatchResubmission is a free log subscription operation binding the contract event 0x826e6849ff24825cbaeb8adb637217c5a8ef9fa9d8cd09ae58c5223254c25408. // -// Solidity: event TriggerBatchResubmission(address indexed dataMarketAddress, uint256 indexed epochId, uint256 indexed batchId, uint256 timestamp) -func (_Contract *ContractFilterer) WatchTriggerBatchResubmission(opts *bind.WatchOpts, sink chan<- *ContractTriggerBatchResubmission, dataMarketAddress []common.Address, epochId []*big.Int, batchId []*big.Int) (event.Subscription, error) { +// Solidity: event TriggerBatchResubmission(address indexed dataMarketAddress, uint256 indexed epochId, string indexed batchCid, uint256 timestamp) +func (_Contract *ContractFilterer) WatchTriggerBatchResubmission(opts *bind.WatchOpts, sink chan<- *ContractTriggerBatchResubmission, dataMarketAddress []common.Address, epochId []*big.Int, batchCid []string) (event.Subscription, error) { var dataMarketAddressRule []interface{} for _, dataMarketAddressItem := range dataMarketAddress { @@ -5722,12 +5828,12 @@ func (_Contract *ContractFilterer) WatchTriggerBatchResubmission(opts *bind.Watc for _, epochIdItem := range epochId { epochIdRule = append(epochIdRule, epochIdItem) } - var batchIdRule []interface{} - for _, batchIdItem := range batchId { - batchIdRule = append(batchIdRule, batchIdItem) + var batchCidRule []interface{} + for _, batchCidItem := range batchCid { + batchCidRule = append(batchCidRule, batchCidItem) } - logs, sub, err := _Contract.contract.WatchLogs(opts, "TriggerBatchResubmission", dataMarketAddressRule, epochIdRule, batchIdRule) + logs, sub, err := _Contract.contract.WatchLogs(opts, "TriggerBatchResubmission", dataMarketAddressRule, epochIdRule, batchCidRule) if err != nil { return nil, err } @@ -5759,9 +5865,9 @@ func (_Contract *ContractFilterer) WatchTriggerBatchResubmission(opts *bind.Watc }), nil } -// ParseTriggerBatchResubmission is a log parse operation binding the contract event 0x4a87247b65ffdb6c5ebb776b6e70fc9bddc3402b413d82060701fd9c30a3ff07. +// ParseTriggerBatchResubmission is a log parse operation binding the contract event 0x826e6849ff24825cbaeb8adb637217c5a8ef9fa9d8cd09ae58c5223254c25408. // -// Solidity: event TriggerBatchResubmission(address indexed dataMarketAddress, uint256 indexed epochId, uint256 indexed batchId, uint256 timestamp) +// Solidity: event TriggerBatchResubmission(address indexed dataMarketAddress, uint256 indexed epochId, string indexed batchCid, uint256 timestamp) func (_Contract *ContractFilterer) ParseTriggerBatchResubmission(log types.Log) (*ContractTriggerBatchResubmission, error) { event := new(ContractTriggerBatchResubmission) if err := _Contract.contract.UnpackLog(event, "TriggerBatchResubmission", log); err != nil { @@ -5986,16 +6092,16 @@ func (it *ContractValidatorAttestationsInvalidatedIterator) Close() error { type ContractValidatorAttestationsInvalidated struct { DataMarketAddress common.Address EpochId *big.Int - BatchId *big.Int + BatchCid common.Hash Validator common.Address Timestamp *big.Int Raw types.Log // Blockchain specific contextual infos } -// FilterValidatorAttestationsInvalidated is a free log retrieval operation binding the contract event 0x714caf86f735bcfc9ca5f4e56456c4c16a6630870eaee41fa5748b2502a1317a. +// FilterValidatorAttestationsInvalidated is a free log retrieval operation binding the contract event 0xace836e24d26220daa574b979a6c9f9614da0cf8dd180e3fbfe974cf21c01c2a. // -// Solidity: event ValidatorAttestationsInvalidated(address indexed dataMarketAddress, uint256 indexed epochId, uint256 indexed batchId, address validator, uint256 timestamp) -func (_Contract *ContractFilterer) FilterValidatorAttestationsInvalidated(opts *bind.FilterOpts, dataMarketAddress []common.Address, epochId []*big.Int, batchId []*big.Int) (*ContractValidatorAttestationsInvalidatedIterator, error) { +// Solidity: event ValidatorAttestationsInvalidated(address indexed dataMarketAddress, uint256 indexed epochId, string indexed batchCid, address validator, uint256 timestamp) +func (_Contract *ContractFilterer) FilterValidatorAttestationsInvalidated(opts *bind.FilterOpts, dataMarketAddress []common.Address, epochId []*big.Int, batchCid []string) (*ContractValidatorAttestationsInvalidatedIterator, error) { var dataMarketAddressRule []interface{} for _, dataMarketAddressItem := range dataMarketAddress { @@ -6005,22 +6111,22 @@ func (_Contract *ContractFilterer) FilterValidatorAttestationsInvalidated(opts * for _, epochIdItem := range epochId { epochIdRule = append(epochIdRule, epochIdItem) } - var batchIdRule []interface{} - for _, batchIdItem := range batchId { - batchIdRule = append(batchIdRule, batchIdItem) + var batchCidRule []interface{} + for _, batchCidItem := range batchCid { + batchCidRule = append(batchCidRule, batchCidItem) } - logs, sub, err := _Contract.contract.FilterLogs(opts, "ValidatorAttestationsInvalidated", dataMarketAddressRule, epochIdRule, batchIdRule) + logs, sub, err := _Contract.contract.FilterLogs(opts, "ValidatorAttestationsInvalidated", dataMarketAddressRule, epochIdRule, batchCidRule) if err != nil { return nil, err } return &ContractValidatorAttestationsInvalidatedIterator{contract: _Contract.contract, event: "ValidatorAttestationsInvalidated", logs: logs, sub: sub}, nil } -// WatchValidatorAttestationsInvalidated is a free log subscription operation binding the contract event 0x714caf86f735bcfc9ca5f4e56456c4c16a6630870eaee41fa5748b2502a1317a. +// WatchValidatorAttestationsInvalidated is a free log subscription operation binding the contract event 0xace836e24d26220daa574b979a6c9f9614da0cf8dd180e3fbfe974cf21c01c2a. // -// Solidity: event ValidatorAttestationsInvalidated(address indexed dataMarketAddress, uint256 indexed epochId, uint256 indexed batchId, address validator, uint256 timestamp) -func (_Contract *ContractFilterer) WatchValidatorAttestationsInvalidated(opts *bind.WatchOpts, sink chan<- *ContractValidatorAttestationsInvalidated, dataMarketAddress []common.Address, epochId []*big.Int, batchId []*big.Int) (event.Subscription, error) { +// Solidity: event ValidatorAttestationsInvalidated(address indexed dataMarketAddress, uint256 indexed epochId, string indexed batchCid, address validator, uint256 timestamp) +func (_Contract *ContractFilterer) WatchValidatorAttestationsInvalidated(opts *bind.WatchOpts, sink chan<- *ContractValidatorAttestationsInvalidated, dataMarketAddress []common.Address, epochId []*big.Int, batchCid []string) (event.Subscription, error) { var dataMarketAddressRule []interface{} for _, dataMarketAddressItem := range dataMarketAddress { @@ -6030,12 +6136,12 @@ func (_Contract *ContractFilterer) WatchValidatorAttestationsInvalidated(opts *b for _, epochIdItem := range epochId { epochIdRule = append(epochIdRule, epochIdItem) } - var batchIdRule []interface{} - for _, batchIdItem := range batchId { - batchIdRule = append(batchIdRule, batchIdItem) + var batchCidRule []interface{} + for _, batchCidItem := range batchCid { + batchCidRule = append(batchCidRule, batchCidItem) } - logs, sub, err := _Contract.contract.WatchLogs(opts, "ValidatorAttestationsInvalidated", dataMarketAddressRule, epochIdRule, batchIdRule) + logs, sub, err := _Contract.contract.WatchLogs(opts, "ValidatorAttestationsInvalidated", dataMarketAddressRule, epochIdRule, batchCidRule) if err != nil { return nil, err } @@ -6067,9 +6173,9 @@ func (_Contract *ContractFilterer) WatchValidatorAttestationsInvalidated(opts *b }), nil } -// ParseValidatorAttestationsInvalidated is a log parse operation binding the contract event 0x714caf86f735bcfc9ca5f4e56456c4c16a6630870eaee41fa5748b2502a1317a. +// ParseValidatorAttestationsInvalidated is a log parse operation binding the contract event 0xace836e24d26220daa574b979a6c9f9614da0cf8dd180e3fbfe974cf21c01c2a. // -// Solidity: event ValidatorAttestationsInvalidated(address indexed dataMarketAddress, uint256 indexed epochId, uint256 indexed batchId, address validator, uint256 timestamp) +// Solidity: event ValidatorAttestationsInvalidated(address indexed dataMarketAddress, uint256 indexed epochId, string indexed batchCid, address validator, uint256 timestamp) func (_Contract *ContractFilterer) ParseValidatorAttestationsInvalidated(log types.Log) (*ContractValidatorAttestationsInvalidated, error) { event := new(ContractValidatorAttestationsInvalidated) if err := _Contract.contract.UnpackLog(event, "ValidatorAttestationsInvalidated", log); err != nil { diff --git a/pkgs/contract/contract/abi.json b/pkgs/contract/contract/abi.json deleted file mode 100644 index 053beab..0000000 --- a/pkgs/contract/contract/abi.json +++ /dev/null @@ -1,2820 +0,0 @@ -[ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "target", - "type": "address" - } - ], - "name": "AddressEmptyCode", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "ERC1967InvalidImplementation", - "type": "error" - }, - { - "inputs": [], - "name": "ERC1967NonPayable", - "type": "error" - }, - { - "inputs": [], - "name": "FailedInnerCall", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidInitialization", - "type": "error" - }, - { - "inputs": [], - "name": "NotInitializing", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "OwnableInvalidOwner", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "OwnableUnauthorizedAccount", - "type": "error" - }, - { - "inputs": [], - "name": "UUPSUnauthorizedCallContext", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "slot", - "type": "bytes32" - } - ], - "name": "UUPSUnsupportedProxiableUUID", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "dataMarketAddress", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "adminAddress", - "type": "address" - }, - { - "indexed": false, - "internalType": "bool", - "name": "allowed", - "type": "bool" - } - ], - "name": "AdminsUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "dataMarketAddress", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "epochId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "timestamp", - "type": "uint256" - } - ], - "name": "BatchSubmissionsCompleted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "dataMarketAddress", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "snapshotterAddress", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "slotId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "dayId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "timestamp", - "type": "uint256" - } - ], - "name": "DailyTaskCompletedEvent", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "ownerAddress", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint8", - "name": "epochSize", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "sourceChainId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "sourceChainBlockTime", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bool", - "name": "useBlockNumberAsEpochId", - "type": "bool" - }, - { - "indexed": false, - "internalType": "address", - "name": "protocolState", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "dataMarketAddress", - "type": "address" - } - ], - "name": "DataMarketCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "dataMarketAddress", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "dayId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "timestamp", - "type": "uint256" - } - ], - "name": "DayStartedEvent", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "dataMarketAddress", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "batchId", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "epochId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "timestamp", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "validatorAddr", - "type": "address" - } - ], - "name": "DelayedAttestationSubmitted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "dataMarketAddress", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "batchId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "string", - "name": "batchCid", - "type": "string" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "epochId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "timestamp", - "type": "uint256" - } - ], - "name": "DelayedBatchSubmitted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "dataMarketAddress", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "snapshotterAddr", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "slotId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "string", - "name": "snapshotCid", - "type": "string" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "epochId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "string", - "name": "projectId", - "type": "string" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "timestamp", - "type": "uint256" - } - ], - "name": "DelayedSnapshotSubmitted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "dataMarketAddress", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "epochId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "begin", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "end", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "timestamp", - "type": "uint256" - } - ], - "name": "EpochReleased", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint64", - "name": "version", - "type": "uint64" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "dataMarketAddress", - "type": "address" - }, - { - "indexed": false, - "internalType": "string", - "name": "projectType", - "type": "string" - }, - { - "indexed": false, - "internalType": "bool", - "name": "allowed", - "type": "bool" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "enableEpochId", - "type": "uint256" - } - ], - "name": "ProjectTypeUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "dataMarketAddress", - "type": "address" - }, - { - "indexed": false, - "internalType": "string[]", - "name": "projects", - "type": "string[]" - }, - { - "indexed": false, - "internalType": "bool[]", - "name": "status", - "type": "bool[]" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "enableEpochId", - "type": "uint256" - } - ], - "name": "ProjectsUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "dataMarketAddress", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "sequencerAddress", - "type": "address" - }, - { - "indexed": false, - "internalType": "bool", - "name": "allowed", - "type": "bool" - } - ], - "name": "SequencersUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "dataMarketAddress", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "batchId", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "epochId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "timestamp", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "validatorAddr", - "type": "address" - } - ], - "name": "SnapshotBatchAttestationSubmitted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "dataMarketAddress", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "epochId", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "batchId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "timestamp", - "type": "uint256" - } - ], - "name": "SnapshotBatchFinalized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "dataMarketAddress", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "batchId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "string", - "name": "batchCid", - "type": "string" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "epochId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "timestamp", - "type": "uint256" - } - ], - "name": "SnapshotBatchSubmitted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "dataMarketAddress", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "epochId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "epochEnd", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "string", - "name": "projectId", - "type": "string" - }, - { - "indexed": false, - "internalType": "string", - "name": "snapshotCid", - "type": "string" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "timestamp", - "type": "uint256" - } - ], - "name": "SnapshotFinalized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "dataMarketAddress", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "epochId", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "batchId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "timestamp", - "type": "uint256" - } - ], - "name": "TriggerBatchResubmission", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "dataMarketAddress", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "epochId", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "batchId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "validator", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "timestamp", - "type": "uint256" - } - ], - "name": "ValidatorAttestationsInvalidated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "dataMarketAddress", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "validatorAddress", - "type": "address" - }, - { - "indexed": false, - "internalType": "bool", - "name": "allowed", - "type": "bool" - } - ], - "name": "ValidatorsUpdated", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - } - ], - "name": "EPOCH_SIZE", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - } - ], - "name": "SOURCE_CHAIN_BLOCK_TIME", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - } - ], - "name": "SOURCE_CHAIN_ID", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "UPGRADE_INTERFACE_VERSION", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - } - ], - "name": "USE_BLOCK_NUMBER_AS_EPOCH_ID", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "allSnapshotters", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - }, - { - "internalType": "string", - "name": "projectType", - "type": "string" - } - ], - "name": "allowedProjectTypes", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256[]", - "name": "_slotIds", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "_snapshotterAddresses", - "type": "address[]" - } - ], - "name": "assignSnapshotterToSlotBulk", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - } - ], - "name": "attestationSubmissionWindow", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - }, - { - "internalType": "uint256", - "name": "batchId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "validator", - "type": "address" - } - ], - "name": "attestationsReceived", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - }, - { - "internalType": "uint256", - "name": "batchId", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "finalizedCidsRootHash", - "type": "bytes32" - } - ], - "name": "attestationsReceivedCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - }, - { - "internalType": "uint256", - "name": "batchId", - "type": "uint256" - } - ], - "name": "batchIdAttestationStatus", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - }, - { - "internalType": "uint256", - "name": "batchId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "idx", - "type": "uint256" - } - ], - "name": "batchIdDivergentValidators", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - }, - { - "internalType": "uint256", - "name": "batchId", - "type": "uint256" - } - ], - "name": "batchIdSequencerAttestation", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - }, - { - "internalType": "uint256", - "name": "batchId", - "type": "uint256" - } - ], - "name": "batchIdToProjects", - "outputs": [ - { - "internalType": "string[]", - "name": "", - "type": "string[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - } - ], - "name": "batchSubmissionWindow", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - }, - { - "internalType": "uint256", - "name": "batchId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "epochId", - "type": "uint256" - } - ], - "name": "checkDynamicConsensusAttestations", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - }, - { - "internalType": "uint256", - "name": "slotId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "day", - "type": "uint256" - } - ], - "name": "checkSlotTaskStatusForDay", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "ownerAddress", - "type": "address" - }, - { - "internalType": "uint8", - "name": "epochSize", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "sourceChainId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "sourceChainBlockTime", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "useBlockNumberAsEpochId", - "type": "bool" - } - ], - "name": "createDataMarket", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - } - ], - "name": "currentBatchId", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - } - ], - "name": "currentEpoch", - "outputs": [ - { - "internalType": "uint256", - "name": "begin", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "end", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "epochId", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - } - ], - "name": "dailySnapshotQuota", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "dataMarketCount", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "dataMarketAddress", - "type": "address" - } - ], - "name": "dataMarketEnabled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "dataMarketFactory", - "outputs": [ - { - "internalType": "contract DataMarketFactory", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "dataMarketId", - "type": "uint8" - } - ], - "name": "dataMarketIdToAddress", - "outputs": [ - { - "internalType": "address", - "name": "dataMarketAddress", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "dataMarkets", - "outputs": [ - { - "internalType": "address", - "name": "ownerAddress", - "type": "address" - }, - { - "internalType": "uint8", - "name": "epochSize", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "sourceChainId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "sourceChainBlockTime", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "useBlockNumberAsEpochId", - "type": "bool" - }, - { - "internalType": "bool", - "name": "enabled", - "type": "bool" - }, - { - "internalType": "address", - "name": "dataMarketAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "createdAt", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - } - ], - "name": "dayCounter", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - } - ], - "name": "deploymentBlockNumber", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - }, - { - "internalType": "uint256", - "name": "epochId", - "type": "uint256" - } - ], - "name": "endBatchSubmissions", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - }, - { - "internalType": "uint256", - "name": "epochId", - "type": "uint256" - } - ], - "name": "epochIdToBatchIds", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - }, - { - "internalType": "uint256", - "name": "epochId", - "type": "uint256" - } - ], - "name": "epochInfo", - "outputs": [ - { - "internalType": "uint256", - "name": "timestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "blocknumber", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "epochEnd", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - } - ], - "name": "epochManager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - } - ], - "name": "epochsInADay", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - }, - { - "internalType": "uint256", - "name": "batchId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "epochId", - "type": "uint256" - } - ], - "name": "forceCompleteConsensusAttestations", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - }, - { - "internalType": "uint256", - "name": "begin", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "end", - "type": "uint256" - } - ], - "name": "forceSkipEpoch", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - } - ], - "name": "getEpochManager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - } - ], - "name": "getSequencerId", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - } - ], - "name": "getSequencers", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - }, - { - "internalType": "uint256", - "name": "slotId", - "type": "uint256" - } - ], - "name": "getSlotInfo", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "slotId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "snapshotterAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "rewardPoints", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "currentDaySnapshotCount", - "type": "uint256" - } - ], - "internalType": "struct PowerloomDataMarket.SlotInfo", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "slotId", - "type": "uint256" - } - ], - "name": "getSlotRewards", - "outputs": [ - { - "internalType": "uint256", - "name": "rewards", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - } - ], - "name": "getTotalSequencersCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getTotalSnapshotterCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - } - ], - "name": "getTotalValidatorsCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - } - ], - "name": "getValidators", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "initialOwner", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - }, - { - "internalType": "string", - "name": "projectId", - "type": "string" - } - ], - "name": "lastFinalizedSnapshot", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_dayCounter", - "type": "uint256" - } - ], - "name": "loadCurrentDay", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - }, - { - "internalType": "uint256", - "name": "slotId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "dayId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "snapshotCount", - "type": "uint256" - } - ], - "name": "loadSlotSubmissions", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - }, - { - "internalType": "uint256", - "name": "batchId", - "type": "uint256" - } - ], - "name": "maxAttestationFinalizedRootHash", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - }, - { - "internalType": "uint256", - "name": "batchId", - "type": "uint256" - } - ], - "name": "maxAttestationsCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - }, - { - "internalType": "string", - "name": "projectId", - "type": "string" - }, - { - "internalType": "uint256", - "name": "epochId", - "type": "uint256" - } - ], - "name": "maxSnapshotsCid", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - } - ], - "name": "minAttestationsForConsensus", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - } - ], - "name": "minSubmissionsForConsensus", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - }, - { - "internalType": "string", - "name": "projectId", - "type": "string" - } - ], - "name": "projectFirstEpochId", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "proxiableUUID", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - }, - { - "internalType": "uint256", - "name": "begin", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "end", - "type": "uint256" - } - ], - "name": "releaseEpoch", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - } - ], - "name": "rewardBasePoints", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - } - ], - "name": "rewardsEnabled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - }, - { - "internalType": "string", - "name": "_sequencerId", - "type": "string" - } - ], - "name": "setSequencerId", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "slotCounter", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - }, - { - "internalType": "uint256", - "name": "slotId", - "type": "uint256" - } - ], - "name": "slotRewardPoints", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "slotRewards", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "slotId", - "type": "uint256" - } - ], - "name": "slotSnapshotterMapping", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - }, - { - "internalType": "uint256", - "name": "slotId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "dayId", - "type": "uint256" - } - ], - "name": "slotSubmissionCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - }, - { - "internalType": "string", - "name": "projectId", - "type": "string" - }, - { - "internalType": "uint256", - "name": "epochId", - "type": "uint256" - } - ], - "name": "snapshotStatus", - "outputs": [ - { - "internalType": "enum PowerloomDataMarket.SnapshotStatus", - "name": "status", - "type": "uint8" - }, - { - "internalType": "string", - "name": "snapshotCid", - "type": "string" - }, - { - "internalType": "uint256", - "name": "timestamp", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - } - ], - "name": "snapshotSubmissionWindow", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "snapshotterState", - "outputs": [ - { - "internalType": "contract SnapshotterState", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - }, - { - "internalType": "uint256", - "name": "batchId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "epochId", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "finalizedCidsRootHash", - "type": "bytes32" - } - ], - "name": "submitBatchAttestation", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - }, - { - "internalType": "uint256", - "name": "slotId", - "type": "uint256" - }, - { - "internalType": "string", - "name": "snapshotCid", - "type": "string" - }, - { - "internalType": "uint256", - "name": "epochId", - "type": "uint256" - }, - { - "internalType": "string", - "name": "projectId", - "type": "string" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "slotId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "string", - "name": "snapshotCid", - "type": "string" - }, - { - "internalType": "uint256", - "name": "epochId", - "type": "uint256" - }, - { - "internalType": "string", - "name": "projectId", - "type": "string" - } - ], - "internalType": "struct PowerloomDataMarket.Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "name": "submitSnapshot", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - }, - { - "internalType": "string", - "name": "batchCid", - "type": "string" - }, - { - "internalType": "uint256", - "name": "batchId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "epochId", - "type": "uint256" - }, - { - "internalType": "string[]", - "name": "projectIds", - "type": "string[]" - }, - { - "internalType": "string[]", - "name": "snapshotCids", - "type": "string[]" - }, - { - "internalType": "bytes32", - "name": "finalizedCidsRootHash", - "type": "bytes32" - } - ], - "name": "submitSubmissionBatch", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "dataMarketAddress", - "type": "address" - }, - { - "internalType": "bool", - "name": "enabled", - "type": "bool" - } - ], - "name": "toggleDataMarket", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - } - ], - "name": "toggleFallback", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - } - ], - "name": "toggleRewards", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - }, - { - "internalType": "enum PowerloomDataMarket.Role", - "name": "role", - "type": "uint8" - }, - { - "internalType": "address[]", - "name": "_addresses", - "type": "address[]" - }, - { - "internalType": "bool[]", - "name": "_status", - "type": "bool[]" - } - ], - "name": "updateAddresses", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - }, - { - "internalType": "string", - "name": "_projectType", - "type": "string" - }, - { - "internalType": "bool", - "name": "_status", - "type": "bool" - } - ], - "name": "updateAllowedProjectType", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - }, - { - "internalType": "uint256", - "name": "newattestationSubmissionWindow", - "type": "uint256" - } - ], - "name": "updateAttestationSubmissionWindow", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - }, - { - "internalType": "uint256", - "name": "newbatchSubmissionWindow", - "type": "uint256" - } - ], - "name": "updateBatchSubmissionWindow", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_dailySnapshotQuota", - "type": "uint256" - } - ], - "name": "updateDailySnapshotQuota", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_address", - "type": "address" - } - ], - "name": "updateDataMarketFactory", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - }, - { - "internalType": "address", - "name": "_address", - "type": "address" - } - ], - "name": "updateEpochManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - }, - { - "internalType": "address[]", - "name": "_fallbackNodes", - "type": "address[]" - }, - { - "internalType": "bool[]", - "name": "_status", - "type": "bool[]" - } - ], - "name": "updateFallbackNodes", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_minAttestationsForConsensus", - "type": "uint256" - } - ], - "name": "updateMinAttestationsForConsensus", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_minSubmissionsForConsensus", - "type": "uint256" - } - ], - "name": "updateMinSnapshottersForConsensus", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - }, - { - "internalType": "string[]", - "name": "_projects", - "type": "string[]" - }, - { - "internalType": "bool[]", - "name": "_status", - "type": "bool[]" - } - ], - "name": "updateProjects", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - }, - { - "internalType": "uint256", - "name": "newRewardBasePoints", - "type": "uint256" - } - ], - "name": "updateRewardBasePoints", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - }, - { - "internalType": "uint256[]", - "name": "slotIds", - "type": "uint256[]" - }, - { - "internalType": "uint256[]", - "name": "submissionsList", - "type": "uint256[]" - }, - { - "internalType": "uint256", - "name": "day", - "type": "uint256" - } - ], - "name": "updateRewards", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract PowerloomDataMarket", - "name": "dataMarket", - "type": "address" - }, - { - "internalType": "uint256", - "name": "newsnapshotSubmissionWindow", - "type": "uint256" - } - ], - "name": "updateSnapshotSubmissionWindow", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_address", - "type": "address" - } - ], - "name": "updateSnapshotterState", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - } -] \ No newline at end of file diff --git a/pkgs/helpers/chain.go b/pkgs/helpers/chain.go deleted file mode 100644 index 6c27678..0000000 --- a/pkgs/helpers/chain.go +++ /dev/null @@ -1,295 +0,0 @@ -package helpers - -import ( - "context" - "encoding/json" - "fmt" - "github.com/cenkalti/backoff/v4" - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethclient" - "github.com/sergerad/incremental-merkle-tree/imt" - log "github.com/sirupsen/logrus" - "math/big" - "sort" - "strconv" - "strings" - "time" - "validator/config" - "validator/pkgs/clients" - "validator/pkgs/contract/contract" -) - -var ( - Client *ethclient.Client - CurrentBlockNumber = new(big.Int) - CurrentEpochID = new(big.Int) -) - -func ConfigureClient() { - var err error - Client, err = ethclient.Dial(config.SettingsObj.ClientUrl) - if err != nil { - log.Fatal(err) - clients.SendFailureNotification("chain.go", "Failed to connect to blockchain client", time.Now().String(), "Critical") - } -} - -func SetupAuth() { - nonce, err := Client.PendingNonceAt(context.Background(), config.SettingsObj.SignerAccountAddress) - if err != nil { - log.Fatalf("Failed to get nonce: %v", err) - clients.SendFailureNotification("chain.go", "Failed to get pending noce for account", time.Now().String(), "Critical") - } - - Auth, err = bind.NewKeyedTransactorWithChainID(config.SettingsObj.PrivateKey, big.NewInt(int64(config.SettingsObj.ChainID))) - if err != nil { - log.Fatalf("Failed to create authorized transactor: %v", err) - clients.SendFailureNotification("chain.go", "Failed to create authorized transactor", time.Now().String(), "Critical") - } - - Auth.Nonce = big.NewInt(int64(nonce)) - Auth.Value = big.NewInt(0) // in wei - Auth.GasLimit = uint64(3000000) // in units - Auth.From = config.SettingsObj.SignerAccountAddress -} - -func UpdateGasPrice(multiplier int) { - gasPrice, err := Client.SuggestGasPrice(context.Background()) - if err != nil { - log.Errorf("Failed to get gas price: %v", err) - clients.SendFailureNotification("chain.go", "Failed to get gas price", time.Now().String(), "High") - } - Auth.GasPrice = gasPrice.Mul(gasPrice, big.NewInt(int64(multiplier))) -} - -func UpdateAuth(num int64) { - Auth.Nonce = new(big.Int).Add(Auth.Nonce, big.NewInt(num)) - UpdateGasPrice(1) -} - -func StartFetchingBlocks() { - contractABI, err := abi.JSON(strings.NewReader(contract.ContractMetaData.ABI)) // Replace with your contract ABI - - if err != nil { - log.Fatal(err) - clients.SendFailureNotification("chain.go", "Failed to parse contract ABI", time.Now().String(), "Critical") - } - - for { - var block *types.Block - block, err = Client.BlockByNumber(context.Background(), nil) - if err != nil || block == nil { - log.Errorf("Failed to fetch latest block: %s", err.Error()) - clients.SendFailureNotification("chain.go", "Failed to fetch latest block", time.Now().String(), "Medium") - continue - } - - if CurrentBlockNumber.Cmp(block.Header().Number) < 0 { - CurrentBlockNumber.Set(block.Header().Number) - log.Debugln("Current block: ", CurrentBlockNumber.String()) - - // iterate all transactions in parallel and search for events - go func() { - var logs []types.Log - var err error - - hash := block.Hash() - filterQuery := ethereum.FilterQuery{ - BlockHash: &hash, - Addresses: []common.Address{common.HexToAddress(config.SettingsObj.ContractAddress)}, - //Topics: [][]common.Hash{{contractABI.Events["SnapshotBatchSubmitted"].ID, contractABI.Events["EpochReleased"].ID}}, - } - - operation := func() error { - logs, err = Client.FilterLogs(context.Background(), filterQuery) - return err - } - - if err = backoff.Retry(operation, backoff.WithMaxRetries(backoff.NewConstantBackOff(200*time.Millisecond), 3)); err != nil { - log.Errorln("Error fetching logs: ", err.Error()) - clients.SendFailureNotification("ProcessEvents", fmt.Sprintf("Error fetching logs: %s", err.Error()), time.Now().String(), "High") - return - } - - for _, vLog := range logs { - if vLog.Address.Hex() != config.SettingsObj.ContractAddress { - continue - } - switch vLog.Topics[0].Hex() { - case contractABI.Events["SnapshotBatchSubmitted"].ID.Hex(): - event, err := Instance.ParseSnapshotBatchSubmitted(vLog) - if err != nil { - log.Debugln("Error unpacking SnapshotBatchSubmitted event:", err) - clients.SendFailureNotification("chain.go", "Error unpacking SnapshotBatchSubmitted event", time.Now().String(), "High") - continue - } - if event.DataMarketAddress == config.SettingsObj.DataMarketAddress { - go storeBatchSubmission(event) - } - // begin building merkle tree - - case contractABI.Events["EpochReleased"].ID.Hex(): - event, err := Instance.ParseEpochReleased(vLog) - if err != nil { - log.Debugln("Error unpacking epochReleased event:", err) - clients.SendFailureNotification("chain.go", "Error unpacking epochReleased event", time.Now().String(), "High") - continue - } - event.EpochId = new(big.Int).SetBytes(vLog.Topics[1][:]) - if event.DataMarketAddress == config.SettingsObj.DataMarketAddress { - if CurrentEpochID.Cmp(event.EpochId) < 0 { - CurrentEpochID.Set(event.EpochId) - go triggerValidationFlow(new(big.Int).Set(CurrentEpochID)) - log.Debugln("Epoch Released: ", event.EpochId.String()) - } - } - } - } - }() - time.Sleep(time.Duration(config.SettingsObj.BlockTime*500) * time.Millisecond) - } else { - time.Sleep(100 * time.Millisecond) - continue - } - } -} - -func PopulateStateVars() { - for { - if num, err := Client.BlockNumber(context.Background()); err == nil { - CurrentBlockNumber.SetUint64(num) - break - } else { - log.Debugln("Encountered error while fetching current block: ", err.Error()) - clients.SendFailureNotification("chain.go", "Encountered error while fetching current block", time.Now().String(), "Mild") - } - } - CurrentEpochID.Set(big.NewInt(0)) -} - -func storeBatchSubmission(event *contract.ContractSnapshotBatchSubmitted) { - batch := FetchSubmission(IPFSCon, event.BatchCid) - log.Debugf("Fetched batch %s for epoch %s with roothash %s from IPFS: ", batch.ID.String(), event.EpochId, batch.RootHash) - //submissions, err := json.Marshal(batch.Submissions) - //if err != nil { - // log.Errorf("Unable to unmarshal submissions for batch %d epochId %s: %s\n", batch.ID, event.EpochId.String(), err.Error()) - //} - submissionIds, err := json.Marshal(batch.SubmissionIds) - if err != nil { - log.Errorf("Unable to unmarshal submissionIds for batch %d epochId %s: %s\n", batch.ID, event.EpochId.String(), err.Error()) - clients.SendFailureNotification("chain.go", "Failed to marshal submissionIds", time.Now().String(), "High") - } - err = Set(context.Background(), RedisClient, fmt.Sprintf("%s.%s.%s", ValidatorKey, event.EpochId.String(), batch.ID.String()), string(submissionIds), time.Hour) - if err != nil { - log.Errorf("Unable to store submissions for batch %d epochId %s: %s\n", batch.ID, event.EpochId.String(), err.Error()) - clients.SendFailureNotification("chain.go", "Failed to store submissions", time.Now().String(), "High") - } -} - -func triggerValidationFlow(epochId *big.Int) { - batchSubmissionLimit := new(big.Int).Add(CurrentBlockNumber, big.NewInt(int64(config.SettingsObj.BatchSubmissionLimit))) - - for CurrentBlockNumber.Cmp(batchSubmissionLimit) < 0 { - time.Sleep(time.Duration(config.SettingsObj.BlockTime) * time.Second) - } - - pattern := fmt.Sprintf("%s.%s.*", ValidatorKey, epochId) - keys, err := FetchKeysForPattern(context.Background(), RedisClient, pattern) - - if err != nil { - log.Errorf("Unable to fetch keys for pattern %s: %s\n", pattern, err.Error()) - clients.SendFailureNotification("chain.go", "Failed to fetch keys for pattern", time.Now().String(), "High") - } - - sort.Slice(keys, func(i, j int) bool { - numI, _ := strconv.Atoi(strings.Split(keys[i], ".")[2]) - numJ, _ := strconv.Atoi(strings.Split(keys[j], ".")[2]) - return numI < numJ - }) - - tree, _ := imt.New() - - SetupAuth() - for _, key := range keys { - value, err := Get(context.Background(), RedisClient, key) - if err != nil { - log.Errorln("Error fetching data from redis: ", err.Error()) - clients.SendFailureNotification("chain.go", "Error fetching data from redis", time.Now().String(), "High") - } - log.Debugf("Fetched submissions for key %s\n", key) - var batchSubmissionIds []string - err = json.Unmarshal([]byte(value), &batchSubmissionIds) - if err != nil { - log.Errorf("Unable to unmarshal batch submissionIds for key: %s\n", key) - clients.SendFailureNotification("chain.go", "Failed to unmarshal batch submissionIds", time.Now().String(), "High") - } - _, err = UpdateMerkleTree(batchSubmissionIds, tree) - if err != nil { - log.Errorf("Unable to build Merkel tree: %s\n", err.Error()) - clients.SendFailureNotification("chain.go", "Failed to build Merkel tree", time.Now().String(), "High") - } - SubmitAttestation(key, tree.RootDigest()) - } - - ResetValidatorDBSubmissions(context.Background(), RedisClient, epochId) - - time.Sleep(time.Second * time.Duration(config.SettingsObj.BlockTime)) - - EnsureTxSuccess(epochId) -} - -func EnsureTxSuccess(epochID *big.Int) { - for { - keys, err := FetchKeysForPattern(context.Background(), RedisClient, fmt.Sprintf("%s.%s.*", TxsKey, epochID.String())) - SetupAuth() - if err != nil { - log.Debugf("Could not fetch submitted transactions: %s\n", err.Error()) - return - } else { - if keys == nil { - log.Debugln("No unsuccessful transactions remaining for epochId: ", epochID.String()) - return - } - log.Debugf("Fetched %d transactions for epoch %d", len(keys), epochID) - for _, key := range keys { - if value, err := Get(context.Background(), RedisClient, key); err != nil { - log.Errorf("Unable to fetch value for key: %s\n", key) - } else { - log.Debugf("Fetched value %s for key %s\n", value, key) - vals := strings.Split(value, ".") - - tx := vals[0] - cid := vals[3] - batchID := new(big.Int) - _, ok := batchID.SetString(vals[2], 10) - if !ok { - log.Errorf("Unable to convert bigInt string to bigInt: %s\n", vals[2]) - } - - nonce := strings.Split(key, ".")[3] - multiplier := 1 - if _, err := Client.TransactionReceipt(context.Background(), common.HexToHash(tx)); err != nil { - log.Errorf("Found unsuccessful transaction: %s, batchID: %d, nonce: %s", tx, batchID, nonce) - updatedNonce := Auth.Nonce.String() - UpdateGasPrice(1) - var reTx *types.Transaction - for reTx, err = Instance.SubmitBatchAttestation(Auth, config.SettingsObj.DataMarketAddress, batchID, epochID, [32]byte(common.Hex2Bytes(cid))); err != nil; { - updatedNonce = Auth.Nonce.String() - multiplier = HandleAttestationSubmissionError(err, multiplier, batchID.String()) - } - UpdateAuth(1) - RedisClient.Set(context.Background(), fmt.Sprintf("%s.%s.%d.%s", TxsKey, epochID.String(), batchID, updatedNonce), fmt.Sprintf("%s.%s.%s.%s", reTx.Hash().Hex(), epochID.String(), batchID.String(), cid), time.Hour) - } - if _, err := RedisClient.Del(context.Background(), fmt.Sprintf("%s.%s.%s.%s", TxsKey, epochID.String(), batchID.String(), nonce)).Result(); err != nil { - log.Errorf("Unable to delete transaction from redis: %s\n", err.Error()) - } - } - } - } - time.Sleep(time.Second * time.Duration(config.SettingsObj.BlockTime)) - } -} diff --git a/pkgs/helpers/constants.go b/pkgs/helpers/constants.go deleted file mode 100644 index 0567a5c..0000000 --- a/pkgs/helpers/constants.go +++ /dev/null @@ -1,4 +0,0 @@ -package helpers - -const ValidatorKey = "SnapshotSubmissionValidator" -const TxsKey = "AttestationTransactions" diff --git a/pkgs/helpers/contract.go b/pkgs/helpers/contract.go deleted file mode 100644 index 173749d..0000000 --- a/pkgs/helpers/contract.go +++ /dev/null @@ -1,44 +0,0 @@ -package helpers - -import ( - "context" - "fmt" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - log "github.com/sirupsen/logrus" - "math/big" - "strings" - "time" - "validator/config" - "validator/pkgs/contract/contract" -) - -var ( - Auth *bind.TransactOpts - Instance *contract.Contract -) - -func ConfigureContractInstance() { - Instance, _ = contract.NewContract(common.HexToAddress(config.SettingsObj.ContractAddress), Client) -} - -func SubmitAttestation(key string, cid []byte) { - vals := strings.Split(key, ".") - epochId, _ := new(big.Int).SetString(vals[1], 10) - batchId, _ := new(big.Int).SetString(vals[2], 10) - - multiplier := 1 - UpdateGasPrice(multiplier) - var tx *types.Transaction - var err error - nonce := Auth.Nonce.String() - for tx, err = Instance.SubmitBatchAttestation(Auth, config.SettingsObj.DataMarketAddress, batchId, epochId, [32]byte(cid)); err != nil; { - time.Sleep(time.Duration(config.SettingsObj.BlockTime) * time.Second) - nonce = Auth.Nonce.String() - multiplier = HandleAttestationSubmissionError(err, multiplier, batchId.String()) - } - RedisClient.Set(context.Background(), fmt.Sprintf("%s.%s.%s.%s", TxsKey, epochId.String(), batchId.String(), nonce), fmt.Sprintf("%s.%s.%s.%s", tx.Hash().Hex(), epochId.String(), batchId.String(), common.Bytes2Hex(cid)), time.Hour) - log.Debugf("Successfully submitted attestation for batch %s with roothash %s and nonce %s\n ", batchId.String(), common.Bytes2Hex(cid), nonce) - UpdateAuth(1) -} diff --git a/pkgs/helpers/database.go b/pkgs/helpers/database.go deleted file mode 100644 index 4e599c5..0000000 --- a/pkgs/helpers/database.go +++ /dev/null @@ -1,94 +0,0 @@ -package helpers - -import ( - "context" - "errors" - "fmt" - "github.com/go-redis/redis/v8" - log "github.com/sirupsen/logrus" - "math/big" - "time" - "validator/config" -) - -var RedisClient *redis.Client - -func NewRedisClient() *redis.Client { - return redis.NewClient(&redis.Options{ - Addr: fmt.Sprintf("%s:%s", config.SettingsObj.RedisHost, config.SettingsObj.RedisPort), // Redis server address - Password: "", // no password set - DB: config.SettingsObj.RedisDB, // use default DB - }) -} - -func Set(ctx context.Context, client *redis.Client, key string, value string, expiration time.Duration) error { - // TODO: This s probably not neccessary - if _, err := Get(ctx, client, key); err != nil && !errors.Is(err, redis.Nil) { - return err - } - if err := client.Set(ctx, key, value, expiration).Err(); err != nil { - return err - } - return nil -} - -func Get(ctx context.Context, client *redis.Client, key string) (string, error) { - val, err := client.Get(ctx, key).Result() - if err != nil && !errors.Is(err, redis.Nil) { - return "", err - } - return val, nil -} - -func FetchKeysForPattern(ctx context.Context, client *redis.Client, pattern string) ([]string, error) { - var allKeys []string - var cursor uint64 - - for { - keys, newCursor, err := client.Scan(ctx, cursor, pattern, 100).Result() - if err != nil { - return nil, errors.New(fmt.Sprintf("Error scanning keys for pattern %s: %v", pattern, err)) - } - allKeys = append(allKeys, keys...) - - cursor = newCursor - if cursor == 0 { - break - } - } - return allKeys, nil -} - -func ResetValidatorDBSubmissions(ctx context.Context, client *redis.Client, epochID *big.Int) { - pattern := fmt.Sprintf("%s.%d.*", ValidatorKey, epochID) - - // Use Scan to find keys matching the pattern. - var cursor uint64 - var n int - var keysToDelete []string - for { - var keys []string - var err error - keys, cursor, err = client.Scan(ctx, cursor, pattern, 100).Result() - if err != nil { - log.Errorf("Error scanning keys: %v", err) - } - keysToDelete = append(keysToDelete, keys...) - n += len(keys) - - if cursor == 0 { // No more keys - break - } - } - - // Delete the keys. - if len(keysToDelete) > 0 { - _, err := client.Del(ctx, keysToDelete...).Result() - if err != nil { - log.Errorf("Error deleting keys: %v", err) - } - log.Debugf("Deleted %d keys.\n", n) - } else { - log.Debugln("No keys found to delete.") - } -} diff --git a/pkgs/helpers/errors.go b/pkgs/helpers/errors.go deleted file mode 100644 index 24555cb..0000000 --- a/pkgs/helpers/errors.go +++ /dev/null @@ -1,34 +0,0 @@ -package helpers - -import ( - log "github.com/sirupsen/logrus" - "strings" - "time" - "validator/pkgs/clients" -) - -func HandleAttestationSubmissionError(err error, multiplier int, id string) int { - log.Debugf("Found error: %s proceeding with adjustments for attestation submission\n", err.Error()) - if strings.Contains(err.Error(), "transaction underpriced") { - log.Errorf("Could not submit batch: %s error: %s\n", id, err.Error()) - clients.SendFailureNotification("AttestationSubmission", err.Error(), time.Now().String(), "Medium") - multiplier++ - UpdateGasPrice(multiplier) - log.Debugln("Retrying with gas price: ", Auth.GasPrice.String()) - } else if strings.Contains(err.Error(), "nonce too low") { - log.Errorf("Nonce too low for batch: %s error: %s\n", id, err.Error()) - clients.SendFailureNotification("AttestationSubmission", err.Error(), time.Now().String(), "Medium") - UpdateAuth(1) - log.Debugln("Retrying with nonce: ", Auth.Nonce.String()) - } else if strings.Contains(err.Error(), "nonce too high") { - log.Errorf("Nonce too low for batch: %s error: %s\n", id, err.Error()) - clients.SendFailureNotification("AttestationSubmission", err.Error(), time.Now().String(), "Medium") - UpdateAuth(-1) - log.Debugln("Retrying with nonce: ", Auth.Nonce.String()) - } else { - // Handle other errors - log.Errorf("Unexpected error: %v", err) - clients.SendFailureNotification("AttestationSubmission", err.Error(), time.Now().String(), "High") - } - return multiplier -} diff --git a/pkgs/helpers/ipfs.go b/pkgs/helpers/ipfs.go deleted file mode 100644 index e33fe51..0000000 --- a/pkgs/helpers/ipfs.go +++ /dev/null @@ -1,62 +0,0 @@ -package helpers - -import ( - "bytes" - "encoding/json" - shell "github.com/ipfs/go-ipfs-api" - log "github.com/sirupsen/logrus" - "math/big" - "time" - "validator/config" - "validator/pkgs/clients" -) - -var IPFSCon *shell.Shell - -// Batch represents your data structure -type Batch struct { - ID *big.Int `json:"id"` - SubmissionIds []string `json:"submissionIds"` - Submissions []string `json:"submissions"` - RootHash string `json:"roothash"` -} - -// Connect to the local IPFS node -func ConnectIPFSNode() { - log.Debugf("Connecting to IPFS host: %s", config.SettingsObj.IPFSUrl) - IPFSCon = shell.NewShell(config.SettingsObj.IPFSUrl) -} - -func StoreOnIPFS(sh *shell.Shell, data *Batch) (string, error) { - jsonData, err := json.Marshal(data) - cid, err := sh.Add(bytes.NewReader(jsonData)) - if err != nil { - clients.SendFailureNotification("IPFS", "Error Storing on IPFS: "+err.Error(), time.Now().String(), "High") - return "", err - } - return cid, nil -} - -func FetchSubmission(sh *shell.Shell, cid string) *Batch { - data, err := sh.Cat(cid) - if err != nil { - clients.SendFailureNotification("IPFS", "Error Fetching from IPFS: "+err.Error(), time.Now().String(), "High") - return nil - } - - buf := new(bytes.Buffer) - _, err = buf.ReadFrom(data) - if err != nil { - clients.SendFailureNotification("IPFS", "Error Fetching from IPFS: "+err.Error(), time.Now().String(), "High") - return nil - } - - batch := &Batch{} - err = json.Unmarshal(buf.Bytes(), batch) // Unmarshal takes a byte slice directly - if err != nil { - clients.SendFailureNotification("IPFS", "Error unmarshalling fetched data from IPFS: "+err.Error(), time.Now().String(), "High") - return nil - } - - return batch -} diff --git a/pkgs/helpers/merkle.go b/pkgs/helpers/merkle.go deleted file mode 100644 index 29fcbbd..0000000 --- a/pkgs/helpers/merkle.go +++ /dev/null @@ -1,23 +0,0 @@ -package helpers - -import ( - "github.com/ethereum/go-ethereum/common" - "github.com/sergerad/incremental-merkle-tree/imt" - log "github.com/sirupsen/logrus" - "time" - "validator/pkgs/clients" -) - -func UpdateMerkleTree(sortedData []string, tree *imt.IncrementalMerkleTree) (*imt.IncrementalMerkleTree, error) { - log.Debugln("current hash: ", common.Bytes2Hex(tree.RootDigest())) - for _, value := range sortedData { - err := tree.AddLeaf([]byte(value)) - if err != nil { - log.Errorf("Error adding merkle tree leaf: %s\n", err.Error()) - clients.SendFailureNotification("merkle.go", "Error adding merkle tree leaf: "+err.Error(), time.Now().String(), "High") - return nil, err - } - } - - return tree, nil -} diff --git a/pkgs/helpers/validation.go b/pkgs/helpers/validation.go deleted file mode 100644 index 345b806..0000000 --- a/pkgs/helpers/validation.go +++ /dev/null @@ -1 +0,0 @@ -package helpers diff --git a/pkgs/ipfs/ipfs.go b/pkgs/ipfs/ipfs.go new file mode 100644 index 0000000..aacf5d3 --- /dev/null +++ b/pkgs/ipfs/ipfs.go @@ -0,0 +1,67 @@ +package ipfs + +import ( + "crypto/tls" + "encoding/json" + "io" + "net/http" + "time" + "validator/config" + + shell "github.com/ipfs/go-ipfs-api" + log "github.com/sirupsen/logrus" +) + +var IPFSClient *shell.Shell + +// Batch represents your data structure +type Batch struct { + SubmissionIDs []string `json:"submissionIDs"` + Submissions []string `json:"submissions"` + RootHash string `json:"roothash"` + PIDs []string `json:"pids"` + CIDs []string `json:"cids"` +} + +// ConnectIPFSNode connects to the IPFS node using the provided configuration +func ConnectIPFSNode() { + log.Debugf("Connecting to IPFS node at: %s", config.SettingsObj.IPFSUrl) + + IPFSClient = shell.NewShellWithClient( + config.SettingsObj.IPFSUrl, + &http.Client{ + Timeout: time.Duration(config.SettingsObj.HttpTimeout) * time.Second, + Transport: &http.Transport{ + TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, + MaxIdleConns: 10, + IdleConnTimeout: 5 * time.Second, + DisableKeepAlives: true, + }, + }, + ) +} + +func FetchSubmission(batchCID string) (*Batch, error) { + // Fetch data from IPFS + data, err := IPFSClient.Cat(batchCID) + if err != nil { + log.Errorf("Error fetching data from IPFS: %s", err.Error()) + return nil, err + } + + // Read the data directly from the reader + fetchedData, err := io.ReadAll(data) + if err != nil { + log.Errorf("Error reading data from IPFS: %v", err) + return nil, err + } + + // Unmarshal JSON into the Batch struct + var batch Batch + if err := json.Unmarshal(fetchedData, &batch); err != nil { + log.Errorf("Error unmarshalling fetched data from IPFS: %s", err.Error()) + return nil, err + } + + return &batch, nil +} diff --git a/pkgs/merkle/merkle.go b/pkgs/merkle/merkle.go new file mode 100644 index 0000000..1d06069 --- /dev/null +++ b/pkgs/merkle/merkle.go @@ -0,0 +1,18 @@ +package merkle + +import ( + "github.com/sergerad/incremental-merkle-tree/imt" + log "github.com/sirupsen/logrus" +) + +// UpdateMerkleTree adds all provided IDs to the Merkle tree as leaves and returns the updated tree +func UpdateMerkleTree(ids []string, tree *imt.IncrementalMerkleTree) (*imt.IncrementalMerkleTree, error) { + for _, id := range ids { + err := tree.AddLeaf([]byte(id)) + if err != nil { + log.Errorf("Error adding leaf to Merkle tree: %s\n", err.Error()) + return nil, err + } + } + return tree, nil +} diff --git a/pkgs/prost/contract.go b/pkgs/prost/contract.go new file mode 100644 index 0000000..8093cd2 --- /dev/null +++ b/pkgs/prost/contract.go @@ -0,0 +1,68 @@ +package prost + +import ( + "context" + "crypto/tls" + "net/http" + "strings" + "time" + "validator/config" + "validator/pkgs/clients" + "validator/pkgs/contract" + + "github.com/cenkalti/backoff/v4" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/ethereum/go-ethereum/rpc" + + log "github.com/sirupsen/logrus" +) + +var ( + Client *ethclient.Client + Instance *contract.Contract + ContractABI abi.ABI +) + +func ConfigureClient() { + rpcClient, err := rpc.DialOptions(context.Background(), config.SettingsObj.ClientUrl, rpc.WithHTTPClient(&http.Client{Transport: &http.Transport{TLSClientConfig: &tls.Config{InsecureSkipVerify: true}}})) + if err != nil { + log.Errorf("Failed to connect to client: %s", err) + log.Fatal(err) + } + + Client = ethclient.NewClient(rpcClient) +} + +func ConfigureContractInstance() { + Instance, _ = contract.NewContract(common.HexToAddress(config.SettingsObj.ContractAddress), Client) +} + +func ConfigureABI() { + contractABI, err := abi.JSON(strings.NewReader(contract.ContractMetaData.ABI)) + if err != nil { + log.Errorf("Failed to configure contract ABI: %s", err) + log.Fatal(err) + } + + ContractABI = contractABI +} + +func MustQuery[K any](ctx context.Context, call func() (val K, err error)) (K, error) { + expBackOff := backoff.NewConstantBackOff(1 * time.Second) + + var val K + operation := func() error { + var err error + val, err = call() + return err + } + // Use the retry package to execute the operation with backoff + err := backoff.Retry(operation, backoff.WithMaxRetries(expBackOff, 3)) + if err != nil { + clients.SendFailureNotification("Contract query error [MustQuery]", err.Error(), time.Now().String(), "High") + return *new(K), err + } + return val, err +} diff --git a/pkgs/prost/validation.go b/pkgs/prost/validation.go new file mode 100644 index 0000000..e0a3a52 --- /dev/null +++ b/pkgs/prost/validation.go @@ -0,0 +1,173 @@ +package prost + +import ( + "context" + "encoding/hex" + "encoding/json" + "fmt" + "math/big" + "time" + "validator/pkgs" + "validator/pkgs/clients" + "validator/pkgs/ipfs" + "validator/pkgs/merkle" + "validator/pkgs/redis" + + "github.com/cenkalti/backoff" + "github.com/ethereum/go-ethereum/crypto" + "github.com/sergerad/incremental-merkle-tree/imt" + log "github.com/sirupsen/logrus" +) + +type BatchDetails struct { + DataMarketAddress string + BatchCID string + EpochID *big.Int +} + +func StartBatchAttestation() { + log.Info("🚀 Batch Attestation has started...") + + for { + // Retrieve batch details from the Redis attestation queue + result, err := redis.RedisClient.BRPop(context.Background(), 0, "attestorQueue").Result() + if err != nil { + log.Errorf("Error fetching data from Redis queue: %v", err) + continue + } + + // Ensure valid data was retrieved from the queue + if len(result) < 2 { + log.Println("Invalid data received from Redis queue, skipping this entry") + continue + } + + // Parse the queue data into the BatchDetails structure + var batchDetails BatchDetails + err = json.Unmarshal([]byte(result[1]), &batchDetails) + if err != nil { + log.Errorf("Failed to parse batch details from Redis queue: %v", err) + continue + } + + // Log the details of the batch being processed + log.Infof("🔄 Starting attestation for batchCID %s in epoch %s within data market %s", batchDetails.BatchCID, batchDetails.EpochID.String(), batchDetails.DataMarketAddress) + + // Launch a go routine for the attestation process + go func(batchDetails BatchDetails) { + // Perform batch attestation + if err := batchDetails.Attest(); err != nil { + log.Errorf("Failed to attest batchCID %s in epoch %s within data market %s: %v", batchDetails.BatchCID, batchDetails.EpochID.String(), batchDetails.DataMarketAddress, err) + return + } + + // Log the successful attestation of the batch + log.Infof("✅ Successfully attested batchCID %s for epoch %s in data market %s", batchDetails.BatchCID, batchDetails.EpochID.String(), batchDetails.DataMarketAddress) + }(batchDetails) + } +} + +func (batchDetails *BatchDetails) Attest() error { + // Extract the epoch ID and the data market address from batch details + epochID := batchDetails.EpochID.String() + dataMarketAddress := batchDetails.DataMarketAddress + + // Fetch the batch from IPFS + batch, err := ipfs.FetchSubmission(batchDetails.BatchCID) + if err != nil { + errorMsg := fmt.Sprintf("Failed to fetch batch with CID %s, epoch %s, data market %s from IPFS: %s", batchDetails.BatchCID, epochID, dataMarketAddress, err.Error()) + clients.SendFailureNotification(pkgs.FetchBatchSubmission, errorMsg, time.Now().String(), "High") + log.Error(errorMsg) + return err + } + + log.Infof("📦 Fetched batch for CID %s, epoch %s, data market %s from IPFS", batchDetails.BatchCID, epochID, dataMarketAddress) + + // Marshal the retreived batch to JSON + batchJSON, err := json.Marshal(batch) + if err != nil { + errorMsg := fmt.Sprintf("Failed to marshal batch with CID %s in epoch %s, data market %s: %s", batchDetails.BatchCID, epochID, dataMarketAddress, err.Error()) + clients.SendFailureNotification(pkgs.StoreBatchSubmission, errorMsg, time.Now().String(), "High") + log.Error(errorMsg) + return err + } + + // Store the details associated with the batch in Redis + if err := redis.StoreValidatorDetails(context.Background(), dataMarketAddress, epochID, batch.RootHash, string(batchJSON)); err != nil { + errorMsg := fmt.Sprintf("Failed to store batch details for epoch %s, data market %s in Redis: %s", epochID, dataMarketAddress, err.Error()) + clients.SendFailureNotification(pkgs.StoreBatchSubmission, errorMsg, time.Now().String(), "High") + log.Error(errorMsg) + return err + } + + log.Infof("✅ Successfully stored batch details for CID %s, epoch %s, data market %s in Redis", batchDetails.BatchCID, epochID, dataMarketAddress) + + // Create a new Merkle tree + merkleTree, err := imt.New() + if err != nil { + errorMsg := fmt.Sprintf("Failed to initialize Merkle tree for epoch %s, data market %s: %s", epochID, dataMarketAddress, err.Error()) + clients.SendFailureNotification(pkgs.BuildMerkleTree, errorMsg, time.Now().String(), "High") + log.Error(errorMsg) + return err + } + + log.Infof("🌲 Successfully updated Merkle tree for epoch %s, data market %s", epochID, dataMarketAddress) + + // Update the Merkle tree with finalized CIDs from the batch + if _, err = merkle.UpdateMerkleTree(batch.CIDs, merkleTree); err != nil { + errorMsg := fmt.Sprintf("Error updating Merkle tree with finalized CIDs for epoch %s, data market %s: %v", epochID, dataMarketAddress, err.Error()) + clients.SendFailureNotification(pkgs.BuildMerkleTree, errorMsg, time.Now().String(), "High") + log.Error(errorMsg) + return err + } + + // Calculate the root hash of the Merkle tree + finalizedCIDsRootHash := GetRootHash(merkleTree) + + // Submit batch attestation to the external tx Relayer service with retry mechanism + if err := SubmitBatchAttestationToRelayer(dataMarketAddress, batchDetails.BatchCID, hex.EncodeToString(finalizedCIDsRootHash[:]), batchDetails.EpochID); err != nil { + errorMsg := fmt.Sprintf("🚨 Relayer submission failed: CID %s, epoch %s, data market %s: %v", batchDetails.BatchCID, batchDetails.EpochID, dataMarketAddress, err) + clients.SendFailureNotification(pkgs.SendBatchAttestationToRelayer, errorMsg, time.Now().String(), "High") + log.Error(errorMsg) + return err + } + + log.Infof("📤 Successfully submitted batch attestation to relayer with CID %s, epoch %s, data market %s", batchDetails.BatchCID, epochID, dataMarketAddress) + + return nil +} + +func SubmitBatchAttestationToRelayer(dataMarketAddress, batchCID, rootHash string, epochID *big.Int) error { + // Define the operation that will be retried + operation := func() error { + // Attempt batch attestation submission + err := clients.SubmitBatchAttestationRequest(dataMarketAddress, batchCID, rootHash, epochID) + if err != nil { + log.Errorf("Failed to send batch attestation for epoch %s, data market %s: %v", epochID, dataMarketAddress, err) + return err // Return error to trigger retry + } + + log.Infof("Successfully submitted batch attestation for epoch %s, data market %s", epochID, dataMarketAddress) + return nil // Successful submission, no need for further retries + } + + // Customize the backoff configuration + backoffConfig := backoff.NewExponentialBackOff() + backoffConfig.InitialInterval = 1 * time.Second // Start with a 1-second delay + backoffConfig.Multiplier = 1.5 // Increase interval by 1.5x after each retry + backoffConfig.MaxInterval = 4 * time.Second // Set max interval between retries + backoffConfig.MaxElapsedTime = 10 * time.Second // Retry for a maximum of 10 seconds + + // Limit retries to 3 times within 10 seconds + if err := backoff.Retry(operation, backoff.WithMaxRetries(backoffConfig, 3)); err != nil { + log.Errorf("Failed to submit batch attestation for epoch %s, data market %s after multiple retries: %v", epochID, dataMarketAddress, err) + return err + } + + return nil +} + +// GetRootHash returns hash representation of the root digest of the Merkle tree +func GetRootHash(tree *imt.IncrementalMerkleTree) [32]byte { + return crypto.Keccak256Hash(tree.RootDigest()) +} diff --git a/pkgs/redis/client.go b/pkgs/redis/client.go new file mode 100644 index 0000000..8e1c057 --- /dev/null +++ b/pkgs/redis/client.go @@ -0,0 +1,75 @@ +package redis + +import ( + "context" + "errors" + "fmt" + "log" + "strconv" + "time" + "validator/config" + "validator/pkgs" + + "github.com/go-redis/redis/v8" +) + +var RedisClient *redis.Client + +func NewRedisClient() *redis.Client { + db, err := strconv.Atoi(config.SettingsObj.RedisDB) + if err != nil { + log.Fatalf("Incorrect redis db: %s", err.Error()) + } + return redis.NewClient(&redis.Options{ + Addr: fmt.Sprintf("%s:%s", config.SettingsObj.RedisHost, config.SettingsObj.RedisPort), // Redis server address + Password: "", // no password set + DB: db, + PoolSize: 1000, + ReadTimeout: 200 * time.Millisecond, + WriteTimeout: 200 * time.Millisecond, + DialTimeout: 5 * time.Second, + IdleTimeout: 5 * time.Minute, + }) +} + +func AddToSet(ctx context.Context, set string, keys ...string) error { + if err := RedisClient.SAdd(ctx, set, keys).Err(); err != nil { + return fmt.Errorf("unable to add to set: %s", err.Error()) + } + return nil +} + +func Get(ctx context.Context, key string) (string, error) { + val, err := RedisClient.Get(ctx, key).Result() + if err != nil { + if errors.Is(err, redis.Nil) { + return "", nil + } else { + return "", err + } + } + return val, nil +} + +func Set(ctx context.Context, key, value string) error { + return RedisClient.Set(ctx, key, value, 0).Err() +} + +// Use this when you want to set an expiration +func SetWithExpiration(ctx context.Context, key, value string, expiration time.Duration) error { + return RedisClient.Set(ctx, key, value, expiration).Err() +} + +func StoreValidatorDetails(ctx context.Context, dataMarketAddress, epochID, rootHash, details string) error { + // Store the batch roothash in the master set + if err := AddToSet(ctx, ValidatorSet(dataMarketAddress, epochID), rootHash); err != nil { + return fmt.Errorf("failed to add roothash %s to validator set for epoch %s, data market %s: %v", rootHash, epochID, dataMarketAddress, err) + } + + // Store the batch details associated with the given roothash in Redis + if err := SetWithExpiration(ctx, SnapshotSubmissionValidatorKey(dataMarketAddress, epochID, rootHash), details, pkgs.Day*3); err != nil { + return fmt.Errorf("failed to store batch details for roothash %s, epoch %s, data market %s in Redis: %w", rootHash, epochID, dataMarketAddress, err) + } + + return nil +} diff --git a/pkgs/redis/keys.go b/pkgs/redis/keys.go new file mode 100644 index 0000000..df41829 --- /dev/null +++ b/pkgs/redis/keys.go @@ -0,0 +1,15 @@ +package redis + +import ( + "fmt" + "strings" + "validator/pkgs" +) + +func ValidatorSet(dataMarketAddress, epochID string) string { + return fmt.Sprintf("%s.%s.%s", pkgs.ValidatorSetKey, strings.ToLower(dataMarketAddress), epochID) +} + +func SnapshotSubmissionValidatorKey(dataMarketAddress, epochID, rootHash string) string { + return fmt.Sprintf("%s.%s.%s.%s", pkgs.ValidatorKey, strings.ToLower(dataMarketAddress), epochID, rootHash) +} diff --git a/pkgs/helpers/logger.go b/pkgs/utils/logger.go similarity index 92% rename from pkgs/helpers/logger.go rename to pkgs/utils/logger.go index 16b7f7a..be2d900 100644 --- a/pkgs/helpers/logger.go +++ b/pkgs/utils/logger.go @@ -1,12 +1,13 @@ -package helpers +package utils import ( "fmt" - log "github.com/sirupsen/logrus" - "github.com/sirupsen/logrus/hooks/writer" "io" "os" "strconv" + + log "github.com/sirupsen/logrus" + "github.com/sirupsen/logrus/hooks/writer" ) func InitLogger() { @@ -38,11 +39,12 @@ func InitLogger() { } else { logLevel, err := strconv.ParseUint(os.Args[1], 10, 32) if err != nil || logLevel > 6 { - log.SetLevel(log.DebugLevel) //TODO: Change default level to error + log.SetLevel(log.ErrorLevel) } else { //TODO: Need to come up with approach to dynamically update logLevel. log.SetLevel(log.Level(logLevel)) } } + log.SetFormatter(&log.TextFormatter{FullTimestamp: true}) }