From c72e3939e2fc9534914bb41adc55ee2012b905f1 Mon Sep 17 00:00:00 2001 From: Nami Date: Fri, 23 Feb 2024 18:19:53 +0400 Subject: [PATCH] Fix edge case with 1 abi type event (#44) --- package.json | 2 +- src/cmd/deploy.ts | 8 +- .../docs-schemas/definitions.schema.json | 2 +- ...efinitions-abitype-anyof-arrayabi-items.md | 3 + ...ions-definitions-abitype-anyof-arrayabi.md | 2 +- src/types/schemas/definitions.schema.json | 2 +- src/types/types/resources.schema.d.ts | 2 +- src/utils/index.ts | 20 ++- yarn.lock | 170 +++++++++--------- 9 files changed, 115 insertions(+), 96 deletions(-) create mode 100644 src/types/docs/definitions-definitions-abitype-anyof-arrayabi-items.md diff --git a/package.json b/package.json index da26a24..9bf60d8 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ "typescript": "^4.9.5" }, "dependencies": { - "@openzeppelin/defender-sdk": "^1.8.0", + "@openzeppelin/defender-sdk": "^1.10.0", "keccak256": "^1.0.6", "lodash": "^4.17.21", "prompt": "^1.3.0" diff --git a/src/cmd/deploy.ts b/src/cmd/deploy.ts index 700b138..7da3fcf 100644 --- a/src/cmd/deploy.ts +++ b/src/cmd/deploy.ts @@ -874,7 +874,7 @@ export default class DefenderDeploy { paused: match.paused, skipABIValidation: match.skipABIValidation, alertThreshold: match.alertThreshold, - autotaskTrigger: match.notifyConfig?.autotaskId, + actionTrigger: match.notifyConfig?.actionId, alertTimeoutMs: match.notifyConfig?.timeoutMs, alertMessageBody: match.notifyConfig?.messageBody, alertMessageSubject: match.notifyConfig?.messageSubject, @@ -896,9 +896,9 @@ export default class DefenderDeploy { blockConditions[0]!.txConditions[0]!.expression, privateFortaNodeId: (isForta(match) && match.privateFortaNodeId) || undefined, addresses: isBlock(match) ? addressRule && addressRule.addresses : match.fortaRule?.addresses, - autotaskCondition: isBlock(match) - ? addressRule && addressRule.autotaskCondition?.autotaskId - : match.fortaRule?.autotaskCondition?.autotaskId, + actionCondition: isBlock(match) + ? addressRule && addressRule.actionCondition?.actionId + : match.fortaRule?.actionCondition?.actionId, fortaLastProcessedTime: (isForta(match) && match.fortaLastProcessedTime) || undefined, agentIDs: (isForta(match) && match.fortaRule?.agentIDs) || undefined, fortaConditions: (isForta(match) && match.fortaRule.conditions) || undefined, diff --git a/src/types/docs-schemas/definitions.schema.json b/src/types/docs-schemas/definitions.schema.json index 9848590..111cad7 100644 --- a/src/types/docs-schemas/definitions.schema.json +++ b/src/types/docs-schemas/definitions.schema.json @@ -737,7 +737,7 @@ "title": "AbiType", "anyOf": [ { "title": "StringABI", "type": "string" }, - { "title": "ArrayABI", "type": "array" } + { "title": "ArrayABI", "type": "array", "items": { "type": "string" } } ] }, "safe-contracts": { diff --git a/src/types/docs/definitions-definitions-abitype-anyof-arrayabi-items.md b/src/types/docs/definitions-definitions-abitype-anyof-arrayabi-items.md new file mode 100644 index 0000000..98d2045 --- /dev/null +++ b/src/types/docs/definitions-definitions-abitype-anyof-arrayabi-items.md @@ -0,0 +1,3 @@ +## items Type + +`string` diff --git a/src/types/docs/definitions-definitions-abitype-anyof-arrayabi.md b/src/types/docs/definitions-definitions-abitype-anyof-arrayabi.md index 56da2bd..6348c35 100644 --- a/src/types/docs/definitions-definitions-abitype-anyof-arrayabi.md +++ b/src/types/docs/definitions-definitions-abitype-anyof-arrayabi.md @@ -1,3 +1,3 @@ ## 1 Type -`array` ([ArrayABI](definitions-definitions-abitype-anyof-arrayabi.md)) +`string[]` diff --git a/src/types/schemas/definitions.schema.json b/src/types/schemas/definitions.schema.json index 4cc32e7..b4ea47b 100644 --- a/src/types/schemas/definitions.schema.json +++ b/src/types/schemas/definitions.schema.json @@ -1 +1 @@ -{"$id":"definitions.schema.json","$schema":"http://json-schema.org/draft-07/schema#","title":"Definitions","definitions":{"defender-id":{"title":"DefenderID","type":"string","pattern":"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-(8|9|a|b)[0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"},"address":{"title":"Address","type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"risk-category":{"title":"RiskCategory","type":"string","enum":["NONE","GOVERNANCE","ACCESS-CONTROL","SUSPICIOUS","FINANCIAL","TECHNICAL"]},"public-network":{"title":"PublicNetwork","type":"string","enum":["mainnet","sepolia","goerli","xdai","sokol","fuse","bsc","bsctest","fantom","fantomtest","moonbase","moonriver","moonbeam","matic","mumbai","matic-zkevm","matic-zkevm-testnet","avalanche","fuji","arbitrum","arbitrum-nova","arbitrum-goerli","arbitrum-sepolia","optimism","optimism-goerli","optimism-sepolia","celo","alfajores","harmony-s0","harmony-test-s0","aurora","auroratest","hedera","hederatest","zksync","zksync-goerli","zksync-sepolia","base","base-goerli","base-sepolia","linea-goerli","linea","mantle","scroll","scroll-sepolia","meld","meld-kanazawa"]},"custom-network":{"title":"CustomNetwork","type":"string","enum":["x-dfk-avax-chain","x-dfk-avax-chain-test","x-security-alliance"]},"tenant-network":{"title":"TenantNetwork","type":"string"},"network":{"title":"Network","anyOf":[{"$ref":"#/definitions/supported-network"},{"$ref":"#/definitions/tenant-network"}]},"supported-network":{"title":"SupportedNetwork","oneOf":[{"$ref":"#/definitions/public-network"},{"$ref":"#/definitions/custom-network"}]},"policy":{"title":"Policy","type":"object","properties":{"gas-price-cap":{"type":"integer"},"whitelist-receivers":{"title":"WhitelistReceivers","type":"array","items":{"type":"string"}},"eip1559-pricing":{"type":"boolean"},"private-transactions":{"type":"boolean"}}},"relayer":{"title":"Relayer","type":"object","properties":{"name":{"type":"string"},"network":{"$ref":"#/definitions/network","format":"uri-reference"},"min-balance":{"type":"integer"},"address-from-relayer":{"title":"AddressFromRelayer","anyOf":[{"type":"object"},{"type":"string"}]},"policy":{"$ref":"#/definitions/policy","format":"uri-reference"},"api-keys":{"title":"RelayerAPIKeys","type":"array","items":{"type":"string"}}},"required":["name","network","min-balance"]},"contract":{"title":"Contract","type":"object","properties":{"name":{"type":"string"},"address":{"$ref":"#/definitions/address","format":"uri-reference"},"network":{"$ref":"#/definitions/network","format":"uri-reference"},"abi":{"$ref":"#/definitions/abi"},"nat-spec":{"type":"string"}},"required":["name","address","network"]},"notificationType":{"title":"NotificationType","type":"string","enum":["slack","email","discord","telegram","datadog","webhook","opsgenie","pager-duty"]},"datadogConfig":{"title":"DatadogConfig","type":"object","properties":{"api-key":{"type":"string"},"metric-prefix":{"type":"string","maxLength":100,"pattern":"^[A-Za-z]+[A-Za-z0-9_\\.]*\\.$"}},"required":["api-key","metric-prefix"]},"urlConfig":{"title":"UrlConfig","type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"]},"telegramBotConfig":{"title":"TelegramConfig","type":"object","properties":{"bot-token":{"type":"string"},"chat-id":{"type":"string"}},"required":["bot-token","chat-id"]},"emailConfig":{"title":"EmailConfig","type":"object","properties":{"emails":{"title":"Emails","type":"array","items":{"type":"string","format":"email"},"default":[]}},"required":["emails"]},"opsgenieUserType":{"title":"OpsgenieUserType","type":"string","enum":["team","user","escalation","schedule"]},"opsgeniePriorityLevel":{"title":"OpsgeniePriorityLevel","type":"string","enum":["P1","P2","P3","P4","P5"]},"opsgenieInstanceLocation":{"title":"OpsgenieInstanceLocation","type":"string","enum":["US","EU"]},"opsgenieUser":{"title":"OpsgenieUser","type":"object","properties":{"username":{"type":"string"},"fullName":{"type":"string"},"id":{"type":"string"},"type":{"$ref":"#/definitions/opsgenieUserType"}},"required":["type","username"],"additionalProperties":false},"opsgenieConfig":{"title":"OpsgenieConfig","properties":{"apiKey":{"type":"string"},"instanceLocation":{"$ref":"#/definitions/opsgenieInstanceLocation"},"alias":{"type":"string","maxLength":512},"responders":{"title":"OpsgenieConfigResponders","type":"array","items":{"$ref":"#/definitions/opsgenieUser"}},"visibleTo":{"title":"OpsgenieConfigVisibleTo","type":"array","items":{"$ref":"#/definitions/opsgenieUser"}},"actions":{"title":"OpsgenieConfigActions","type":"array","maxItems":10,"items":{"type":"string","maxLength":50}},"tags":{"title":"OpsgenieConfigTags","type":"array","maxItems":10,"items":{"type":"string","maxLength":50}},"details":{"title":"OpsgenieConfigDetails","type":"object","additionalProperties":{"type":"string"}},"entity":{"type":"string","maxLength":512},"priority":{"$ref":"#/definitions/opsgeniePriorityLevel"},"note":{"type":"string","maxLength":25000}},"required":["apiKey","instanceLocation"],"additionalProperties":false},"pagerDutyEventType":{"title":"PagerDutyEventType","type":"string","enum":["change","alert"]},"pagerDutyEventAction":{"title":"PagerDutyEventAction","type":"string","enum":["trigger","acknowledge","resolve"]},"pagerDutySeverity":{"title":"PagerDutySeverity","type":"string","enum":["critical","error","warning","info"]},"pagerDutyConfig":{"title":"PagerDutyConfig","properties":{"token":{"type":"string"},"eventType":{"$ref":"#/definitions/pagerDutyEventType"},"routingKey":{"type":"string","maxLength":32,"minLength":32},"eventAction":{"$ref":"#/definitions/pagerDutyEventAction"},"dedupKey":{"type":"string","maxLength":255},"severity":{"$ref":"#/definitions/pagerDutySeverity"},"component":{"type":"string"},"group":{"type":"string"},"class":{"type":"string"},"customDetails":{"title":"PagerDutyConfigCustomDetails","type":"object","additionalProperties":{"type":"string"}}},"if":{"properties":{"eventType":{"const":"alert"}}},"then":{"required":["eventAction","severity"]},"required":["token","eventType","routingKey"],"additionalProperties":false},"notification":{"title":"Notification","type":"object","properties":{"type":{"$ref":"#/definitions/notificationType","format":"uri-reference"},"name":{"type":"string"},"paused":{"type":"boolean"},"config":{"title":"Config","type":"object","oneOf":[{"$ref":"#/definitions/emailConfig","format":"uri-reference"},{"$ref":"#/definitions/telegramBotConfig","format":"uri-reference"},{"$ref":"#/definitions/datadogConfig","format":"uri-reference"},{"$ref":"#/definitions/urlConfig","format":"uri-reference"},{"$ref":"#/definitions/opsgenieConfig","format":"uri-reference"},{"$ref":"#/definitions/pagerDutyConfig","format":"uri-reference"}]}},"required":["type","name","paused","config"]},"category":{"title":"Category","type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"notification-ids":{"title":"CategoryNotificationIds","type":"array","items":{"$ref":"#/definitions/notification-or-defender-id","format":"uri-reference"}}},"required":["name"]},"block-monitor":{"title":"BlockMonitor","type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["BLOCK"]},"network":{"$ref":"#/definitions/network","format":"uri-reference"},"contracts":{"title":"Contracts","type":"array","items":{"$ref":"#/definitions/contract-or-defender-id","format":"uri-reference"}},"addresses":{"title":"Addresses","type":"array","items":{"$ref":"#/definitions/address","format":"uri-reference"}},"abi":{"$ref":"#/definitions/abi"},"alert-threshold":{"title":"AlertThreshold","type":"object","properties":{"amount":{"type":"integer"},"window-seconds":{"type":"integer"}},"required":["amount","window-seconds"]},"paused":{"type":"boolean"},"skip-abi-validation":{"type":"boolean","description":"A boolean value that indicates whether the UI should skip ABI validation checks. Enable this if you wish to use custom or partial ABIs for your monitors."},"action-condition":{"$ref":"#/definitions/action-or-defender-id","format":"uri-reference"},"action-trigger":{"$ref":"#/definitions/action-or-defender-id","format":"uri-reference"},"confirm-level":{"oneOf":[{"type":"string","enum":["safe","finalized"]},{"type":"integer"}]},"notify-config":{"title":"NotifyConfig","type":"object","properties":{"timeout":{"type":"integer"},"message":{"type":"string"},"message-subject":{"type":"string"},"category":{"$ref":"#/definitions/category-or-defender-id","format":"uri-reference"},"channels":{"title":"Channels","type":"array","items":{"$ref":"#/definitions/notification-or-defender-id","format":"uri-reference"}}},"required":["channels"]},"conditions":{"title":"Conditions","type":"object","properties":{"event":{"title":"Event","type":"array","items":{"title":"EventItems","type":"object","properties":{"signature":{"type":"string"},"expression":{"type":"string"}},"required":["signature"]}},"function":{"title":"Function","type":"array","items":{"title":"FunctionItems","type":"object","properties":{"signature":{"type":"string"},"expression":{"type":"string"}},"required":["signature"]}},"transaction":{"type":"string"}}},"risk-category":{"$ref":"#/definitions/risk-category"}},"required":["name","type","network","notify-config"]},"forta-monitor":{"title":"FortaMonitor","type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["FORTA"]},"network":{"$ref":"#/definitions/network","format":"uri-reference"},"contracts":{"title":"Contracts","type":"array","items":{"$ref":"#/definitions/contract-or-defender-id","format":"uri-reference"}},"addresses":{"title":"Addresses","type":"array","items":{"$ref":"#/definitions/address","format":"uri-reference"}},"abi":{"$ref":"#/definitions/abi"},"alert-threshold":{"title":"AlertThreshold","type":"object","properties":{"amount":{"type":"integer"},"window-seconds":{"type":"integer"}}},"paused":{"type":"boolean"},"action-condition":{"$ref":"#/definitions/action-or-defender-id","format":"uri-reference"},"action-trigger":{"$ref":"#/definitions/action-or-defender-id","format":"uri-reference"},"notify-config":{"title":"NotifyConfig","type":"object","properties":{"timeout":{"type":"integer"},"message":{"type":"string"},"message-subject":{"type":"string"},"category":{"$ref":"#/definitions/category-or-defender-id","format":"uri-reference"},"channels":{"title":"Channels","type":"array","items":{"$ref":"#/definitions/notification-or-defender-id","format":"uri-reference"}}},"required":["channels"]},"conditions":{"title":"Conditions","type":"object","properties":{"min-scanner-count":{"type":"integer"},"severity":{"type":"integer","enum":[0,1,2,3,4,5]},"alert-ids":{"title":"AlertIDs","type":"array","items":{"type":"string"}}},"required":["min-scanner-count"]},"forta-node-id":{"type":"string"},"forta-last-processed-time":{"type":"string"},"agent-ids":{"title":"AgentIDs","type":"array","items":{"type":"string"}},"risk-category":{"$ref":"#/definitions/risk-category"}},"required":["name","type","notify-config"],"dependencies":{"addresses":["network"],"network":["addresses"]}},"monitor":{"title":"Monitor","type":"object","oneOf":[{"$ref":"#/definitions/block-monitor","format":"uri-reference"},{"$ref":"#/definitions/forta-monitor","format":"uri-reference"}]},"relayer-or-defender-id":{"title":"RelayerOrDefenderID","anyOf":[{"type":"object","$ref":"#/definitions/relayer","format":"uri-reference"},{"type":"string","$ref":"#/definitions/defender-id","format":"uri-reference"}]},"action-or-defender-id":{"title":"ActionOrDefenderID","anyOf":[{"type":"object","$ref":"#/definitions/action","format":"uri-reference"},{"type":"string","$ref":"#/definitions/defender-id","format":"uri-reference"}]},"monitor-or-defender-id":{"title":"MonitorOrDefenderID","anyOf":[{"type":"object","$ref":"#/definitions/monitor","format":"uri-reference"},{"type":"string","$ref":"#/definitions/defender-id","format":"uri-reference"}]},"forked-network-or-defender-id":{"title":"ForkedNetworkOrDefenderID","anyOf":[{"type":"object","$ref":"#/definitions/forked-network-request","format":"uri-reference"},{"type":"string","$ref":"#/definitions/defender-id","format":"uri-reference"}]},"private-network-or-defender-id":{"title":"PrivateNetworkOrDefenderID","anyOf":[{"type":"object","$ref":"#/definitions/private-network-request","format":"uri-reference"},{"type":"string","$ref":"#/definitions/defender-id","format":"uri-reference"}]},"block-explorer-api-key-or-defender-id":{"title":"BlockExplorerApiKeyOrDefenderID","anyOf":[{"type":"object","$ref":"#/definitions/block-explorer-api-key","format":"uri-reference"},{"type":"string","$ref":"#/definitions/defender-id","format":"uri-reference"}]},"category-or-defender-id":{"title":"CategoryOrDefenderID","anyOf":[{"type":"object","$ref":"#/definitions/category","format":"uri-reference"},{"type":"string","$ref":"#/definitions/defender-id","format":"uri-reference"}]},"notification-or-defender-id":{"title":"NotificationOrDefenderID","anyOf":[{"type":"object","$ref":"#/definitions/notification","format":"uri-reference"},{"type":"string","$ref":"#/definitions/defender-id","format":"uri-reference"}]},"contract-or-defender-id":{"title":"ContractOrDefenderID","anyOf":[{"type":"object","$ref":"#/definitions/contract","format":"uri-reference"},{"title":"DefenderID","type":"string","pattern":"^[a-zA-Z0-9]+[-]{1}0x[a-fA-F0-9]{40}$"}]},"policy-or-defender-id":{"title":"PolicyOrDefenderID","anyOf":[{"type":"object","$ref":"#/definitions/policy","format":"uri-reference"},{"type":"string","$ref":"#/definitions/defender-id","format":"uri-reference"}]},"action":{"title":"Action","type":"object","properties":{"name":{"type":"string"},"path":{"type":"string"},"relayer":{"$ref":"#/definitions/relayer-or-defender-id","format":"uri-reference"},"trigger":{"title":"Trigger","type":"object","properties":{"type":{"title":"TriggerType","type":"string","enum":["schedule","webhook","sentinel","monitor-filter"]},"cron":{"title":"TriggerCron","type":"string"},"frequency":{"title":"TriggerFrequency","type":"integer"}},"if":{"properties":{"type":{"const":"schedule"}}},"then":{"oneOf":[{"required":["cron"]},{"required":["frequency"]}]},"else":{},"required":["type"]},"paused":{"type":"boolean"},"environment-variables":{"type":"object","additionalProperties":{"type":"string"}}},"required":["name","path","trigger","paused"]},"block-explorer-api-key":{"title":"BlockExplorerApiKey","type":"object","properties":{"key":{"type":"string"},"network":{"$ref":"#/definitions/network","format":"uri-reference"}},"required":["key","network"]},"abi":{"title":"AbiType","anyOf":[{"title":"StringABI","type":"string"},{"title":"ArrayABI","type":"array"}]},"safe-contracts":{"title":"SafeContracts","type":"object","additionalProperties":false,"required":["master","proxy-factory","multi-send-call-only"],"properties":{"master":{"$ref":"#/definitions/address","format":"uri-reference"},"proxy-factory":{"$ref":"#/definitions/address","format":"uri-reference"},"multi-send-call-only":{"$ref":"#/definitions/address","format":"uri-reference"},"create-call":{"$ref":"#/definitions/address","format":"uri-reference"}}},"tenant-network-eip-configuration":{"title":"TenantNetworkEIPConfiguration","type":"object","additionalProperties":false,"properties":{"isEIP1559":{"type":"boolean"}}},"tenant-network-configuration":{"title":"TenantNetworkConfiguration","type":"object","additionalProperties":false,"required":["symbol"],"properties":{"symbol":{"type":"string","minLength":3,"maxLength":6},"eips":{"$ref":"#/definitions/tenant-network-eip-configuration"},"safe-contracts":{"$ref":"#/definitions/safe-contracts"},"subgraph-url":{"type":"string","pattern":"^(http(s)?://)[\\w.-]+(?:\\.[\\w\\.-]+)+[\\w\\-\\._~:/?#[\\]@!\\$&'\\(\\)\\*\\+,;=.]+$"}}},"forked-network-request":{"title":"ForkedNetworkRequest","type":"object","additionalProperties":false,"required":["name","supported-network","rpc-url"],"properties":{"name":{"$ref":"#/definitions/tenant-network"},"supported-network":{"$ref":"#/definitions/supported-network"},"rpc-url":{"type":"string","pattern":"^(http|https)://"},"api-key":{"type":"string"},"block-explorer-url":{"type":"string","pattern":"^(http(s)?://)[\\w.-]+(?:\\.[\\w\\.-]+)+[\\w\\-\\._~:/?#[\\]@!\\$&'\\(\\)\\*\\+,;=.]+$"}}},"private-network-request":{"title":"PrivateNetworkRequest","type":"object","additionalProperties":false,"required":["name","configuration","rpc-url"],"properties":{"name":{"$ref":"#/definitions/tenant-network"},"configuration":{"$ref":"#/definitions/tenant-network-configuration"},"rpc-url":{"type":"string","pattern":"^(http|https)://"},"api-key":{"type":"string"},"block-explorer-url":{"type":"string","pattern":"^(http(s)?://)[\\w.-]+(?:\\.[\\w\\.-]+)+[\\w\\-\\._~:/?#[\\]@!\\$&'\\(\\)\\*\\+,;=.]+$"}}}}} +{"$id":"definitions.schema.json","$schema":"http://json-schema.org/draft-07/schema#","title":"Definitions","definitions":{"defender-id":{"title":"DefenderID","type":"string","pattern":"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-(8|9|a|b)[0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"},"address":{"title":"Address","type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"risk-category":{"title":"RiskCategory","type":"string","enum":["NONE","GOVERNANCE","ACCESS-CONTROL","SUSPICIOUS","FINANCIAL","TECHNICAL"]},"public-network":{"title":"PublicNetwork","type":"string","enum":["mainnet","sepolia","goerli","xdai","sokol","fuse","bsc","bsctest","fantom","fantomtest","moonbase","moonriver","moonbeam","matic","mumbai","matic-zkevm","matic-zkevm-testnet","avalanche","fuji","arbitrum","arbitrum-nova","arbitrum-goerli","arbitrum-sepolia","optimism","optimism-goerli","optimism-sepolia","celo","alfajores","harmony-s0","harmony-test-s0","aurora","auroratest","hedera","hederatest","zksync","zksync-goerli","zksync-sepolia","base","base-goerli","base-sepolia","linea-goerli","linea","mantle","scroll","scroll-sepolia","meld","meld-kanazawa"]},"custom-network":{"title":"CustomNetwork","type":"string","enum":["x-dfk-avax-chain","x-dfk-avax-chain-test","x-security-alliance"]},"tenant-network":{"title":"TenantNetwork","type":"string"},"network":{"title":"Network","anyOf":[{"$ref":"#/definitions/supported-network"},{"$ref":"#/definitions/tenant-network"}]},"supported-network":{"title":"SupportedNetwork","oneOf":[{"$ref":"#/definitions/public-network"},{"$ref":"#/definitions/custom-network"}]},"policy":{"title":"Policy","type":"object","properties":{"gas-price-cap":{"type":"integer"},"whitelist-receivers":{"title":"WhitelistReceivers","type":"array","items":{"type":"string"}},"eip1559-pricing":{"type":"boolean"},"private-transactions":{"type":"boolean"}}},"relayer":{"title":"Relayer","type":"object","properties":{"name":{"type":"string"},"network":{"$ref":"#/definitions/network","format":"uri-reference"},"min-balance":{"type":"integer"},"address-from-relayer":{"title":"AddressFromRelayer","anyOf":[{"type":"object"},{"type":"string"}]},"policy":{"$ref":"#/definitions/policy","format":"uri-reference"},"api-keys":{"title":"RelayerAPIKeys","type":"array","items":{"type":"string"}}},"required":["name","network","min-balance"]},"contract":{"title":"Contract","type":"object","properties":{"name":{"type":"string"},"address":{"$ref":"#/definitions/address","format":"uri-reference"},"network":{"$ref":"#/definitions/network","format":"uri-reference"},"abi":{"$ref":"#/definitions/abi"},"nat-spec":{"type":"string"}},"required":["name","address","network"]},"notificationType":{"title":"NotificationType","type":"string","enum":["slack","email","discord","telegram","datadog","webhook","opsgenie","pager-duty"]},"datadogConfig":{"title":"DatadogConfig","type":"object","properties":{"api-key":{"type":"string"},"metric-prefix":{"type":"string","maxLength":100,"pattern":"^[A-Za-z]+[A-Za-z0-9_\\.]*\\.$"}},"required":["api-key","metric-prefix"]},"urlConfig":{"title":"UrlConfig","type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"]},"telegramBotConfig":{"title":"TelegramConfig","type":"object","properties":{"bot-token":{"type":"string"},"chat-id":{"type":"string"}},"required":["bot-token","chat-id"]},"emailConfig":{"title":"EmailConfig","type":"object","properties":{"emails":{"title":"Emails","type":"array","items":{"type":"string","format":"email"},"default":[]}},"required":["emails"]},"opsgenieUserType":{"title":"OpsgenieUserType","type":"string","enum":["team","user","escalation","schedule"]},"opsgeniePriorityLevel":{"title":"OpsgeniePriorityLevel","type":"string","enum":["P1","P2","P3","P4","P5"]},"opsgenieInstanceLocation":{"title":"OpsgenieInstanceLocation","type":"string","enum":["US","EU"]},"opsgenieUser":{"title":"OpsgenieUser","type":"object","properties":{"username":{"type":"string"},"fullName":{"type":"string"},"id":{"type":"string"},"type":{"$ref":"#/definitions/opsgenieUserType"}},"required":["type","username"],"additionalProperties":false},"opsgenieConfig":{"title":"OpsgenieConfig","properties":{"apiKey":{"type":"string"},"instanceLocation":{"$ref":"#/definitions/opsgenieInstanceLocation"},"alias":{"type":"string","maxLength":512},"responders":{"title":"OpsgenieConfigResponders","type":"array","items":{"$ref":"#/definitions/opsgenieUser"}},"visibleTo":{"title":"OpsgenieConfigVisibleTo","type":"array","items":{"$ref":"#/definitions/opsgenieUser"}},"actions":{"title":"OpsgenieConfigActions","type":"array","maxItems":10,"items":{"type":"string","maxLength":50}},"tags":{"title":"OpsgenieConfigTags","type":"array","maxItems":10,"items":{"type":"string","maxLength":50}},"details":{"title":"OpsgenieConfigDetails","type":"object","additionalProperties":{"type":"string"}},"entity":{"type":"string","maxLength":512},"priority":{"$ref":"#/definitions/opsgeniePriorityLevel"},"note":{"type":"string","maxLength":25000}},"required":["apiKey","instanceLocation"],"additionalProperties":false},"pagerDutyEventType":{"title":"PagerDutyEventType","type":"string","enum":["change","alert"]},"pagerDutyEventAction":{"title":"PagerDutyEventAction","type":"string","enum":["trigger","acknowledge","resolve"]},"pagerDutySeverity":{"title":"PagerDutySeverity","type":"string","enum":["critical","error","warning","info"]},"pagerDutyConfig":{"title":"PagerDutyConfig","properties":{"token":{"type":"string"},"eventType":{"$ref":"#/definitions/pagerDutyEventType"},"routingKey":{"type":"string","maxLength":32,"minLength":32},"eventAction":{"$ref":"#/definitions/pagerDutyEventAction"},"dedupKey":{"type":"string","maxLength":255},"severity":{"$ref":"#/definitions/pagerDutySeverity"},"component":{"type":"string"},"group":{"type":"string"},"class":{"type":"string"},"customDetails":{"title":"PagerDutyConfigCustomDetails","type":"object","additionalProperties":{"type":"string"}}},"if":{"properties":{"eventType":{"const":"alert"}}},"then":{"required":["eventAction","severity"]},"required":["token","eventType","routingKey"],"additionalProperties":false},"notification":{"title":"Notification","type":"object","properties":{"type":{"$ref":"#/definitions/notificationType","format":"uri-reference"},"name":{"type":"string"},"paused":{"type":"boolean"},"config":{"title":"Config","type":"object","oneOf":[{"$ref":"#/definitions/emailConfig","format":"uri-reference"},{"$ref":"#/definitions/telegramBotConfig","format":"uri-reference"},{"$ref":"#/definitions/datadogConfig","format":"uri-reference"},{"$ref":"#/definitions/urlConfig","format":"uri-reference"},{"$ref":"#/definitions/opsgenieConfig","format":"uri-reference"},{"$ref":"#/definitions/pagerDutyConfig","format":"uri-reference"}]}},"required":["type","name","paused","config"]},"category":{"title":"Category","type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"notification-ids":{"title":"CategoryNotificationIds","type":"array","items":{"$ref":"#/definitions/notification-or-defender-id","format":"uri-reference"}}},"required":["name"]},"block-monitor":{"title":"BlockMonitor","type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["BLOCK"]},"network":{"$ref":"#/definitions/network","format":"uri-reference"},"contracts":{"title":"Contracts","type":"array","items":{"$ref":"#/definitions/contract-or-defender-id","format":"uri-reference"}},"addresses":{"title":"Addresses","type":"array","items":{"$ref":"#/definitions/address","format":"uri-reference"}},"abi":{"$ref":"#/definitions/abi"},"alert-threshold":{"title":"AlertThreshold","type":"object","properties":{"amount":{"type":"integer"},"window-seconds":{"type":"integer"}},"required":["amount","window-seconds"]},"paused":{"type":"boolean"},"skip-abi-validation":{"type":"boolean","description":"A boolean value that indicates whether the UI should skip ABI validation checks. Enable this if you wish to use custom or partial ABIs for your monitors."},"action-condition":{"$ref":"#/definitions/action-or-defender-id","format":"uri-reference"},"action-trigger":{"$ref":"#/definitions/action-or-defender-id","format":"uri-reference"},"confirm-level":{"oneOf":[{"type":"string","enum":["safe","finalized"]},{"type":"integer"}]},"notify-config":{"title":"NotifyConfig","type":"object","properties":{"timeout":{"type":"integer"},"message":{"type":"string"},"message-subject":{"type":"string"},"category":{"$ref":"#/definitions/category-or-defender-id","format":"uri-reference"},"channels":{"title":"Channels","type":"array","items":{"$ref":"#/definitions/notification-or-defender-id","format":"uri-reference"}}},"required":["channels"]},"conditions":{"title":"Conditions","type":"object","properties":{"event":{"title":"Event","type":"array","items":{"title":"EventItems","type":"object","properties":{"signature":{"type":"string"},"expression":{"type":"string"}},"required":["signature"]}},"function":{"title":"Function","type":"array","items":{"title":"FunctionItems","type":"object","properties":{"signature":{"type":"string"},"expression":{"type":"string"}},"required":["signature"]}},"transaction":{"type":"string"}}},"risk-category":{"$ref":"#/definitions/risk-category"}},"required":["name","type","network","notify-config"]},"forta-monitor":{"title":"FortaMonitor","type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["FORTA"]},"network":{"$ref":"#/definitions/network","format":"uri-reference"},"contracts":{"title":"Contracts","type":"array","items":{"$ref":"#/definitions/contract-or-defender-id","format":"uri-reference"}},"addresses":{"title":"Addresses","type":"array","items":{"$ref":"#/definitions/address","format":"uri-reference"}},"abi":{"$ref":"#/definitions/abi"},"alert-threshold":{"title":"AlertThreshold","type":"object","properties":{"amount":{"type":"integer"},"window-seconds":{"type":"integer"}}},"paused":{"type":"boolean"},"action-condition":{"$ref":"#/definitions/action-or-defender-id","format":"uri-reference"},"action-trigger":{"$ref":"#/definitions/action-or-defender-id","format":"uri-reference"},"notify-config":{"title":"NotifyConfig","type":"object","properties":{"timeout":{"type":"integer"},"message":{"type":"string"},"message-subject":{"type":"string"},"category":{"$ref":"#/definitions/category-or-defender-id","format":"uri-reference"},"channels":{"title":"Channels","type":"array","items":{"$ref":"#/definitions/notification-or-defender-id","format":"uri-reference"}}},"required":["channels"]},"conditions":{"title":"Conditions","type":"object","properties":{"min-scanner-count":{"type":"integer"},"severity":{"type":"integer","enum":[0,1,2,3,4,5]},"alert-ids":{"title":"AlertIDs","type":"array","items":{"type":"string"}}},"required":["min-scanner-count"]},"forta-node-id":{"type":"string"},"forta-last-processed-time":{"type":"string"},"agent-ids":{"title":"AgentIDs","type":"array","items":{"type":"string"}},"risk-category":{"$ref":"#/definitions/risk-category"}},"required":["name","type","notify-config"],"dependencies":{"addresses":["network"],"network":["addresses"]}},"monitor":{"title":"Monitor","type":"object","oneOf":[{"$ref":"#/definitions/block-monitor","format":"uri-reference"},{"$ref":"#/definitions/forta-monitor","format":"uri-reference"}]},"relayer-or-defender-id":{"title":"RelayerOrDefenderID","anyOf":[{"type":"object","$ref":"#/definitions/relayer","format":"uri-reference"},{"type":"string","$ref":"#/definitions/defender-id","format":"uri-reference"}]},"action-or-defender-id":{"title":"ActionOrDefenderID","anyOf":[{"type":"object","$ref":"#/definitions/action","format":"uri-reference"},{"type":"string","$ref":"#/definitions/defender-id","format":"uri-reference"}]},"monitor-or-defender-id":{"title":"MonitorOrDefenderID","anyOf":[{"type":"object","$ref":"#/definitions/monitor","format":"uri-reference"},{"type":"string","$ref":"#/definitions/defender-id","format":"uri-reference"}]},"forked-network-or-defender-id":{"title":"ForkedNetworkOrDefenderID","anyOf":[{"type":"object","$ref":"#/definitions/forked-network-request","format":"uri-reference"},{"type":"string","$ref":"#/definitions/defender-id","format":"uri-reference"}]},"private-network-or-defender-id":{"title":"PrivateNetworkOrDefenderID","anyOf":[{"type":"object","$ref":"#/definitions/private-network-request","format":"uri-reference"},{"type":"string","$ref":"#/definitions/defender-id","format":"uri-reference"}]},"block-explorer-api-key-or-defender-id":{"title":"BlockExplorerApiKeyOrDefenderID","anyOf":[{"type":"object","$ref":"#/definitions/block-explorer-api-key","format":"uri-reference"},{"type":"string","$ref":"#/definitions/defender-id","format":"uri-reference"}]},"category-or-defender-id":{"title":"CategoryOrDefenderID","anyOf":[{"type":"object","$ref":"#/definitions/category","format":"uri-reference"},{"type":"string","$ref":"#/definitions/defender-id","format":"uri-reference"}]},"notification-or-defender-id":{"title":"NotificationOrDefenderID","anyOf":[{"type":"object","$ref":"#/definitions/notification","format":"uri-reference"},{"type":"string","$ref":"#/definitions/defender-id","format":"uri-reference"}]},"contract-or-defender-id":{"title":"ContractOrDefenderID","anyOf":[{"type":"object","$ref":"#/definitions/contract","format":"uri-reference"},{"title":"DefenderID","type":"string","pattern":"^[a-zA-Z0-9]+[-]{1}0x[a-fA-F0-9]{40}$"}]},"policy-or-defender-id":{"title":"PolicyOrDefenderID","anyOf":[{"type":"object","$ref":"#/definitions/policy","format":"uri-reference"},{"type":"string","$ref":"#/definitions/defender-id","format":"uri-reference"}]},"action":{"title":"Action","type":"object","properties":{"name":{"type":"string"},"path":{"type":"string"},"relayer":{"$ref":"#/definitions/relayer-or-defender-id","format":"uri-reference"},"trigger":{"title":"Trigger","type":"object","properties":{"type":{"title":"TriggerType","type":"string","enum":["schedule","webhook","sentinel","monitor-filter"]},"cron":{"title":"TriggerCron","type":"string"},"frequency":{"title":"TriggerFrequency","type":"integer"}},"if":{"properties":{"type":{"const":"schedule"}}},"then":{"oneOf":[{"required":["cron"]},{"required":["frequency"]}]},"else":{},"required":["type"]},"paused":{"type":"boolean"},"environment-variables":{"type":"object","additionalProperties":{"type":"string"}}},"required":["name","path","trigger","paused"]},"block-explorer-api-key":{"title":"BlockExplorerApiKey","type":"object","properties":{"key":{"type":"string"},"network":{"$ref":"#/definitions/network","format":"uri-reference"}},"required":["key","network"]},"abi":{"title":"AbiType","anyOf":[{"title":"StringABI","type":"string"},{"title":"ArrayABI","type":"array","items":{"type":"string"}}]},"safe-contracts":{"title":"SafeContracts","type":"object","additionalProperties":false,"required":["master","proxy-factory","multi-send-call-only"],"properties":{"master":{"$ref":"#/definitions/address","format":"uri-reference"},"proxy-factory":{"$ref":"#/definitions/address","format":"uri-reference"},"multi-send-call-only":{"$ref":"#/definitions/address","format":"uri-reference"},"create-call":{"$ref":"#/definitions/address","format":"uri-reference"}}},"tenant-network-eip-configuration":{"title":"TenantNetworkEIPConfiguration","type":"object","additionalProperties":false,"properties":{"isEIP1559":{"type":"boolean"}}},"tenant-network-configuration":{"title":"TenantNetworkConfiguration","type":"object","additionalProperties":false,"required":["symbol"],"properties":{"symbol":{"type":"string","minLength":3,"maxLength":6},"eips":{"$ref":"#/definitions/tenant-network-eip-configuration"},"safe-contracts":{"$ref":"#/definitions/safe-contracts"},"subgraph-url":{"type":"string","pattern":"^(http(s)?://)[\\w.-]+(?:\\.[\\w\\.-]+)+[\\w\\-\\._~:/?#[\\]@!\\$&'\\(\\)\\*\\+,;=.]+$"}}},"forked-network-request":{"title":"ForkedNetworkRequest","type":"object","additionalProperties":false,"required":["name","supported-network","rpc-url"],"properties":{"name":{"$ref":"#/definitions/tenant-network"},"supported-network":{"$ref":"#/definitions/supported-network"},"rpc-url":{"type":"string","pattern":"^(http|https)://"},"api-key":{"type":"string"},"block-explorer-url":{"type":"string","pattern":"^(http(s)?://)[\\w.-]+(?:\\.[\\w\\.-]+)+[\\w\\-\\._~:/?#[\\]@!\\$&'\\(\\)\\*\\+,;=.]+$"}}},"private-network-request":{"title":"PrivateNetworkRequest","type":"object","additionalProperties":false,"required":["name","configuration","rpc-url"],"properties":{"name":{"$ref":"#/definitions/tenant-network"},"configuration":{"$ref":"#/definitions/tenant-network-configuration"},"rpc-url":{"type":"string","pattern":"^(http|https)://"},"api-key":{"type":"string"},"block-explorer-url":{"type":"string","pattern":"^(http(s)?://)[\\w.-]+(?:\\.[\\w\\.-]+)+[\\w\\-\\._~:/?#[\\]@!\\$&'\\(\\)\\*\\+,;=.]+$"}}}}} diff --git a/src/types/types/resources.schema.d.ts b/src/types/types/resources.schema.d.ts index 1d74a51..d4485e5 100644 --- a/src/types/types/resources.schema.d.ts +++ b/src/types/types/resources.schema.d.ts @@ -130,7 +130,7 @@ export type Address = string; export type Network1 = SupportedNetwork | TenantNetwork; export type AbiType = StringABI | ArrayABI; export type StringABI = string; -export type ArrayABI = unknown[]; +export type ArrayABI = string[]; export type DefenderID5 = string; export type MonitorOrDefenderID = Monitor | DefenderID6; export type Monitor = BlockMonitor | FortaMonitor; diff --git a/src/utils/index.ts b/src/utils/index.ts index ce8ec47..629968b 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -38,6 +38,7 @@ import { } from '../types'; import { sanitise } from './sanitise'; import { + AbiType, Action, ActionOrDefenderID, ActionSecrets, @@ -317,6 +318,16 @@ const getDefenderContract = ( return contracts.find((a) => `${a.network}-${a.address}` === `${resource.network}-${resource.address}`); }; +const parseMonitorAbi = (abi: AbiType | undefined) => { + // Because the way AbiType is typed (string | string[]), a list with 1 string item is interpreted as a string rather than string[] + // Therefore, JSON.parse may fail if the string is not a valid JSON + try { + return abi && JSON.stringify(typeof abi === 'string' ? JSON.parse(abi) : abi); + } catch (e) { + return abi && JSON.stringify([abi]); + } +}; + export const constructMonitor = ( context: Serverless, resources: Resources, @@ -353,9 +364,8 @@ export const constructMonitor = ( // otherwise getDefenderContract will return old values const monitorContracts = monitor.contracts?.map((contract) => getDefenderContract(contract, contracts)); // if monitor.abi is defined, we use that over the first entry from monitorContracts by default - const monitorABI = - (monitor.abi && JSON.stringify(typeof monitor.abi === 'string' ? JSON.parse(monitor.abi) : monitor.abi)) || - monitorContracts?.[0]?.abi; + const monitorABI = parseMonitorAbi(monitor.abi) || monitorContracts?.[0]?.abi; + // Pull addresses from either monitor.addresses or monitor.contracts const monitorAddresses = (monitorContracts && @@ -378,8 +388,8 @@ export const constructMonitor = ( addresses: monitorAddresses, abi: monitorABI, paused: monitor.paused, - autotaskCondition: actionCondition && actionCondition.actionId, - autotaskTrigger: actionTrigger && actionTrigger.actionId, + actionCondition: actionCondition && actionCondition.actionId, + actionTrigger: actionTrigger && actionTrigger.actionId, alertThreshold: threshold && { amount: threshold.amount, windowSeconds: threshold['window-seconds'], diff --git a/yarn.lock b/yarn.lock index abc5800..48117b8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -410,97 +410,98 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" -"@openzeppelin/defender-sdk-account-client@^1.8.0": - version "1.8.0" - resolved "https://registry.yarnpkg.com/@openzeppelin/defender-sdk-account-client/-/defender-sdk-account-client-1.8.0.tgz#ebefcc7f893dac1bae653efcc75b4f48abb46b1a" - integrity sha512-S/G+Cmemi3D0dBlAfQBL4/ZAVt+LtivIg+oWKGaUr3wG2usx12CURMaTTb087FlQabdpxEqiExb5xTCSeKBZ9g== +"@openzeppelin/defender-sdk-account-client@^1.10.0": + version "1.10.0" + resolved "https://registry.yarnpkg.com/@openzeppelin/defender-sdk-account-client/-/defender-sdk-account-client-1.10.0.tgz#7305575a0ad369eeba381b356ff24e06c481c07a" + integrity sha512-Zs1DbnzUizlmghv8FuOsiHcs9sBuJzP685YY0/u8l0TsG6SOlNnqlF7O94OecF4gJ2chNVLmCrPltcycjI21vg== dependencies: - "@openzeppelin/defender-sdk-base-client" "^1.8.0" - axios "^1.4.0" + "@openzeppelin/defender-sdk-base-client" "^1.10.0" + axios "^1.6.7" lodash "^4.17.21" -"@openzeppelin/defender-sdk-action-client@^1.8.0": - version "1.8.0" - resolved "https://registry.yarnpkg.com/@openzeppelin/defender-sdk-action-client/-/defender-sdk-action-client-1.8.0.tgz#971562101aedd2f35dd3ec500aacf987b7708fc3" - integrity sha512-+hngMvj/5YMAJ7lDKNWOJRPO4bG3KOZhgzzJpGIFOJo4vk3qRY/ogb30uDl1+aSXGCLTrtlTlwcRCM2rLyhZBQ== +"@openzeppelin/defender-sdk-action-client@^1.10.0": + version "1.10.0" + resolved "https://registry.yarnpkg.com/@openzeppelin/defender-sdk-action-client/-/defender-sdk-action-client-1.10.0.tgz#af514c6a83b19d646c6ed6979bbb21f68f9de56b" + integrity sha512-1RoNbqpkEz69XA5TeUzDw17ua3/7exRYrDgbJQv4VLtoHLWD3bkNFJCStdAFiyBd5x06quW1QSg11KkiNBjkRg== dependencies: - "@openzeppelin/defender-sdk-base-client" "^1.8.0" - axios "^1.4.0" + "@openzeppelin/defender-sdk-base-client" "^1.10.0" + axios "^1.6.7" + dotenv "^16.3.1" glob "^7.1.6" jszip "^3.10.1" lodash "^4.17.21" -"@openzeppelin/defender-sdk-base-client@^1.8.0": - version "1.8.0" - resolved "https://registry.yarnpkg.com/@openzeppelin/defender-sdk-base-client/-/defender-sdk-base-client-1.8.0.tgz#2209a060ce61b4dfc44c7ac0c2b1d86e18b69f7d" - integrity sha512-XIJat6BW2CTM74AwG5IL0Q/aE6RXj8x7smnVKmBql4wMvmirVW+njfwzZCLhUTiBXg9AlHxIInEF14SabfIisg== +"@openzeppelin/defender-sdk-base-client@^1.10.0": + version "1.10.0" + resolved "https://registry.yarnpkg.com/@openzeppelin/defender-sdk-base-client/-/defender-sdk-base-client-1.10.0.tgz#038a5b13f92e03de42382ec331b670f40a915816" + integrity sha512-V21oI4G54sdEJ9lVN8q5OqfFRUoVDzjeXfWgpQvUpfy69r56NnE57D6e5RLG1fRp1J0APfW3lFjaaLwl0kqZpg== dependencies: amazon-cognito-identity-js "^6.3.6" async-retry "^1.3.3" -"@openzeppelin/defender-sdk-deploy-client@^1.8.0": - version "1.8.0" - resolved "https://registry.yarnpkg.com/@openzeppelin/defender-sdk-deploy-client/-/defender-sdk-deploy-client-1.8.0.tgz#1e186d2b3ff176c6a4c03e8207bad8022528975f" - integrity sha512-/tNS2EnHuA5l095wzMbIkGMDNHZLcZQ2eLUP8z+AeKaAUeR2z4qzZ1ul21kR3EJURAyoy8aULFZanLggoBWHrA== +"@openzeppelin/defender-sdk-deploy-client@^1.10.0": + version "1.10.0" + resolved "https://registry.yarnpkg.com/@openzeppelin/defender-sdk-deploy-client/-/defender-sdk-deploy-client-1.10.0.tgz#64d7789eceede36ec12dcdae0dc4b67ffa7ae97d" + integrity sha512-PckmUQYwe26/u/s3sjLateSNtKQ0tdAaOyP6spsgaT+us+XUUqAt/EUfEJdGpt8JApsRWYzrQzH6Z0ywoUyqyw== dependencies: "@ethersproject/abi" "^5.7.0" - "@openzeppelin/defender-sdk-base-client" "^1.8.0" - axios "^1.4.0" + "@openzeppelin/defender-sdk-base-client" "^1.10.0" + axios "^1.6.7" lodash "^4.17.21" -"@openzeppelin/defender-sdk-monitor-client@^1.8.0": - version "1.8.0" - resolved "https://registry.yarnpkg.com/@openzeppelin/defender-sdk-monitor-client/-/defender-sdk-monitor-client-1.8.0.tgz#55f1e91a06f739c8311ed1456c5c4abd76c32cdf" - integrity sha512-eZDWs01c7+8V/d6ct6RvNKYnuTzueYxwkuoZhG9BUoT5ALmtPQJlRZrjguuBzI7+zYwCS57y4ymro7453hOKeA== +"@openzeppelin/defender-sdk-monitor-client@^1.10.0": + version "1.10.0" + resolved "https://registry.yarnpkg.com/@openzeppelin/defender-sdk-monitor-client/-/defender-sdk-monitor-client-1.10.0.tgz#432ef928e07be700d9e2d7e9eedd8cb81999d844" + integrity sha512-89d0+g/7/7ZIcjuW564z4f2iHHQswCpMuOb8LpjQWt6PkMDOQdiVU/v7+kve3ixZODTRamY7cx+OGz5+n93Mkw== dependencies: "@ethersproject/abi" "^5.7.0" - "@openzeppelin/defender-sdk-base-client" "^1.8.0" - axios "^1.4.0" + "@openzeppelin/defender-sdk-base-client" "^1.10.0" + axios "^1.6.7" lodash "^4.17.21" -"@openzeppelin/defender-sdk-network-client@^1.8.0": - version "1.8.0" - resolved "https://registry.yarnpkg.com/@openzeppelin/defender-sdk-network-client/-/defender-sdk-network-client-1.8.0.tgz#84ab6c28ba8162f146304363546682f24c409154" - integrity sha512-Fuefe+cSlyG8qvPlgbVCtbYlsh0WgbbgAcalNbLq1esW6XHAMzYT2AoHISY2BVADtm7rpyb5fgT6lI3PWIoIcQ== +"@openzeppelin/defender-sdk-network-client@^1.10.0": + version "1.10.0" + resolved "https://registry.yarnpkg.com/@openzeppelin/defender-sdk-network-client/-/defender-sdk-network-client-1.10.0.tgz#0da6113d994f1b48a4cee4313e1befc31acab800" + integrity sha512-nrSuJ4KKhTIO2f1WIKtCq0XbeHb4ExqvpIE2g4yf/k8DmZuM9SR6xNDLz7wuKt11u+U88AYBN9MoiKRo/ybp6w== dependencies: "@ethersproject/abi" "^5.7.0" - "@openzeppelin/defender-sdk-base-client" "^1.8.0" - axios "^1.4.0" + "@openzeppelin/defender-sdk-base-client" "^1.10.0" + axios "^1.6.7" lodash "^4.17.21" -"@openzeppelin/defender-sdk-notification-channel-client@^1.8.0": - version "1.8.0" - resolved "https://registry.yarnpkg.com/@openzeppelin/defender-sdk-notification-channel-client/-/defender-sdk-notification-channel-client-1.8.0.tgz#b9dcd6fee39eefc2090e5ba3a86d9c7b62b47512" - integrity sha512-V7YJkEdxDDg3L9tcRS/K0FciYdwNhDNCwU5zCPAYHwHii0PDhz6XjB2g/zWLxhZMzOtY246swrnXiOYfvjwirA== +"@openzeppelin/defender-sdk-notification-channel-client@^1.10.0": + version "1.10.0" + resolved "https://registry.yarnpkg.com/@openzeppelin/defender-sdk-notification-channel-client/-/defender-sdk-notification-channel-client-1.10.0.tgz#27a96f99ef5fc1a0a47b084fdefced3de7c3f3e6" + integrity sha512-TLDsKU5RMyayAaulHXA2SurRuSJy0+59HEM/gHUf/eQTH8MXIhq+MWaxRCBZdcAm6OSkl3xI9gc791VJ1kTToA== dependencies: "@ethersproject/abi" "^5.7.0" - "@openzeppelin/defender-sdk-base-client" "^1.8.0" - axios "^1.4.0" + "@openzeppelin/defender-sdk-base-client" "^1.10.0" + axios "^1.6.7" lodash "^4.17.21" -"@openzeppelin/defender-sdk-proposal-client@^1.8.0": - version "1.8.0" - resolved "https://registry.yarnpkg.com/@openzeppelin/defender-sdk-proposal-client/-/defender-sdk-proposal-client-1.8.0.tgz#1273b4ac8966fcf024ae03bb96aa2c5ba4137356" - integrity sha512-EIPE3yDK0cbnHpt5ptR20yzW/ao2Qzv5v17Hwu83VG95L5csIMmy7ndjmAie15gaB9Xkw1MKdpHmHhzmohESPg== +"@openzeppelin/defender-sdk-proposal-client@^1.10.0": + version "1.10.0" + resolved "https://registry.yarnpkg.com/@openzeppelin/defender-sdk-proposal-client/-/defender-sdk-proposal-client-1.10.0.tgz#28cbae423a03ea203f63f57e5c00dd1b502f7bdc" + integrity sha512-t5nIoeusfDzyyTro45u1nuVQ8wrt9oCscDcOmkRyrQCaOUWxFz7i7xYAt3pC4vOjeMpVGfm68fp/VgLvU0S5Rw== dependencies: - "@openzeppelin/defender-sdk-base-client" "^1.8.0" - axios "^1.4.0" + "@openzeppelin/defender-sdk-base-client" "^1.10.0" + axios "^1.6.7" ethers "^6.9.0" lodash "^4.17.21" -"@openzeppelin/defender-sdk-relay-client@^1.8.0": - version "1.8.0" - resolved "https://registry.yarnpkg.com/@openzeppelin/defender-sdk-relay-client/-/defender-sdk-relay-client-1.8.0.tgz#fafcc4687cabe44bf61c5613da22bcf20d0c8c0e" - integrity sha512-l50OmHl51Hnf5RMZHCVI1PBqb9Af5/DZJKefKqEMA2QpOwnY9gopeFcOsyPWS+d1EDHTUDrKpsFzpCifWWyxeA== +"@openzeppelin/defender-sdk-relay-client@^1.10.0": + version "1.10.0" + resolved "https://registry.yarnpkg.com/@openzeppelin/defender-sdk-relay-client/-/defender-sdk-relay-client-1.10.0.tgz#53425ac91bffc38b06f3a93f1690edc1dd404817" + integrity sha512-0m15nNDZ3U5imFarl/0up/RoltvhHQBPNUuXAXiLAFoeDx9i2W5VjWvHbTqeUREqyJKyruuPQgxT9zk4oHX4KQ== dependencies: - "@openzeppelin/defender-sdk-base-client" "^1.8.0" - axios "^1.4.0" + "@openzeppelin/defender-sdk-base-client" "^1.10.0" + axios "^1.6.7" lodash "^4.17.21" -"@openzeppelin/defender-sdk-relay-signer-client@^1.8.0": - version "1.8.0" - resolved "https://registry.yarnpkg.com/@openzeppelin/defender-sdk-relay-signer-client/-/defender-sdk-relay-signer-client-1.8.0.tgz#c7825428c44e0b2c3912dc5817e3c65081de09f6" - integrity sha512-nZyIKk7dQHWVbtSEsr7zQWVaiX3Ftn/D9ucOCr0+tuWDM70UXrZ8uvLX3MfRPKpc8GAkZjBbUPMLcppLu3g8VQ== +"@openzeppelin/defender-sdk-relay-signer-client@^1.10.0": + version "1.10.0" + resolved "https://registry.yarnpkg.com/@openzeppelin/defender-sdk-relay-signer-client/-/defender-sdk-relay-signer-client-1.10.0.tgz#9b316ef1bcd7e7a7f8037da907037ba6e158b22a" + integrity sha512-ne/rB7HMho8RBJKc0lb0Fg/A6gLNxW6Qgbq9rvuxm7C+X976Egws67wwQvG4yIHVi8bjXbOvJrv5QRLqhZ99kQ== dependencies: "@ethersproject/bignumber" "^5.7.0" "@ethersproject/bytes" "^5.7.0" @@ -510,26 +511,26 @@ "@ethersproject/properties" "^5.7.0" "@ethersproject/random" "^5.7.0" "@ethersproject/strings" "^5.7.0" - "@openzeppelin/defender-sdk-base-client" "^1.8.0" + "@openzeppelin/defender-sdk-base-client" "^1.10.0" amazon-cognito-identity-js "^6.3.6" - axios "^1.4.0" + axios "^1.6.7" lodash "^4.17.21" -"@openzeppelin/defender-sdk@^1.8.0": - version "1.8.0" - resolved "https://registry.yarnpkg.com/@openzeppelin/defender-sdk/-/defender-sdk-1.8.0.tgz#e5455d9eb29a2eb29089742e1f27cd2afa406ff0" - integrity sha512-aFlOLKqJgRcXa5u3uzAhz53BHAUP6S2kyWu4q5M7/9FsyXP6norqe8p6eH67aLuuAZzPzYN+t5M2ebarSW4fag== - dependencies: - "@openzeppelin/defender-sdk-account-client" "^1.8.0" - "@openzeppelin/defender-sdk-action-client" "^1.8.0" - "@openzeppelin/defender-sdk-base-client" "^1.8.0" - "@openzeppelin/defender-sdk-deploy-client" "^1.8.0" - "@openzeppelin/defender-sdk-monitor-client" "^1.8.0" - "@openzeppelin/defender-sdk-network-client" "^1.8.0" - "@openzeppelin/defender-sdk-notification-channel-client" "^1.8.0" - "@openzeppelin/defender-sdk-proposal-client" "^1.8.0" - "@openzeppelin/defender-sdk-relay-client" "^1.8.0" - "@openzeppelin/defender-sdk-relay-signer-client" "^1.8.0" +"@openzeppelin/defender-sdk@^1.10.0": + version "1.10.0" + resolved "https://registry.yarnpkg.com/@openzeppelin/defender-sdk/-/defender-sdk-1.10.0.tgz#4d20b328c77e84f20a564f23ee7d8d13c165b8d1" + integrity sha512-pHkHedLb5bAIRSrEpNvJ+lnb4bRwzVi/psU8Q+wQW/K4Er4hYc5Ei/utuz1gATr5v9aMoR1etUqZXVDZT0Obcw== + dependencies: + "@openzeppelin/defender-sdk-account-client" "^1.10.0" + "@openzeppelin/defender-sdk-action-client" "^1.10.0" + "@openzeppelin/defender-sdk-base-client" "^1.10.0" + "@openzeppelin/defender-sdk-deploy-client" "^1.10.0" + "@openzeppelin/defender-sdk-monitor-client" "^1.10.0" + "@openzeppelin/defender-sdk-network-client" "^1.10.0" + "@openzeppelin/defender-sdk-notification-channel-client" "^1.10.0" + "@openzeppelin/defender-sdk-proposal-client" "^1.10.0" + "@openzeppelin/defender-sdk-relay-client" "^1.10.0" + "@openzeppelin/defender-sdk-relay-signer-client" "^1.10.0" "@polka/url@^0.5.0": version "0.5.0" @@ -857,12 +858,12 @@ asynckit@^0.4.0: resolved "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz" integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== -axios@^1.4.0: - version "1.6.1" - resolved "https://registry.npmjs.org/axios/-/axios-1.6.1.tgz" - integrity sha512-vfBmhDpKafglh0EldBEbVuoe7DyAavGSLWhuSm5ZSEKQnHhBf0xAAwybbNH1IkrJNGnS/VG4I5yxig1pCEXE4g== +axios@^1.6.7: + version "1.6.7" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.7.tgz#7b48c2e27c96f9c68a2f8f31e2ab19f59b06b0a7" + integrity sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA== dependencies: - follow-redirects "^1.15.0" + follow-redirects "^1.15.4" form-data "^4.0.0" proxy-from-env "^1.1.0" @@ -1114,6 +1115,11 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" +dotenv@^16.3.1: + version "16.4.5" + resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.4.5.tgz#cdd3b3b604cb327e286b4762e13502f717cb099f" + integrity sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg== + elliptic@6.5.4: version "6.5.4" resolved "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz" @@ -1434,10 +1440,10 @@ flatted@^3.1.0: resolved "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz" integrity sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ== -follow-redirects@^1.15.0: - version "1.15.2" - resolved "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz" - integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== +follow-redirects@^1.15.4: + version "1.15.5" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.5.tgz#54d4d6d062c0fa7d9d17feb008461550e3ba8020" + integrity sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw== form-data@^4.0.0: version "4.0.0"