From f4ba8fc98936467eb4a74454f124499ac0137493 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=BA=C3=B1ez?= Date: Wed, 10 Jan 2024 15:24:34 +0100 Subject: [PATCH 01/10] BetaProgramInitiator deployment script and constructor file --- .../mainnet/beta_program_initiator.yml | 20 +++++++++++++++ scripts/mainnet/deploy_beta_program.py | 25 +++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 deployment/constructor_params/mainnet/beta_program_initiator.yml create mode 100644 scripts/mainnet/deploy_beta_program.py diff --git a/deployment/constructor_params/mainnet/beta_program_initiator.yml b/deployment/constructor_params/mainnet/beta_program_initiator.yml new file mode 100644 index 00000000..502666ef --- /dev/null +++ b/deployment/constructor_params/mainnet/beta_program_initiator.yml @@ -0,0 +1,20 @@ +deployment: + name: beta-program-initiator + chain_id: 137 + +artifacts: + dir: ./deployment/artifacts/ + filename: beta_program_initiator.json + +constants: + # See deployment/artifacts/mainnet.json + COORDINATOR_PROXY: "0xE74259e3dafe30bAA8700238e324b47aC98FE755" + # See https://github.com/nucypher/tdec/issues/137#issuecomment-1881525878 + # and https://app.safe.global/home?safe=matic:0x861aa915C785dEe04684444560fC7A2AB43a1543 + EXECUTOR_MULTISIG: "0x861aa915C785dEe04684444560fC7A2AB43a1543" + +contracts: + - BetaProgramInitiator: + constructor: + _coordinator: $COORDINATOR_PROXY + _executor: $EXECUTOR_MULTISIG diff --git a/scripts/mainnet/deploy_beta_program.py b/scripts/mainnet/deploy_beta_program.py new file mode 100644 index 00000000..27a009ac --- /dev/null +++ b/scripts/mainnet/deploy_beta_program.py @@ -0,0 +1,25 @@ +#!/usr/bin/python3 + +from ape import project + +from deployment.constants import ( + CONSTRUCTOR_PARAMS_DIR, ARTIFACTS_DIR, +) +from deployment.params import Deployer +from deployment.registry import merge_registries + +VERIFY = False +CONSTRUCTOR_PARAMS_FILEPATH = CONSTRUCTOR_PARAMS_DIR / "mainnet" / "beta_program_initiator.yml" +MAINNET_REGISTRY = ARTIFACTS_DIR / "mainnet.json" + + +def main(): + deployer = Deployer.from_yaml(filepath=CONSTRUCTOR_PARAMS_FILEPATH, verify=VERIFY) + beta_program_initiator = deployer.deploy(project.BetaProgramInitiator) + deployments = [beta_program_initiator] + deployer.finalize(deployments=deployments) + merge_registries( + registry_1_filepath=MAINNET_REGISTRY, + registry_2_filepath=deployer.registry_filepath, + output_filepath=MAINNET_REGISTRY, + ) From 5244f26de4f20f2900a4394d484ce11c04cd437a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=BA=C3=B1ez?= Date: Wed, 10 Jan 2024 15:25:23 +0100 Subject: [PATCH 02/10] Added BetaProgramInitiator deployment to mainnet registry --- deployment/artifacts/mainnet.json | 369 ++++++++++++++++++++++++++++++ 1 file changed, 369 insertions(+) diff --git a/deployment/artifacts/mainnet.json b/deployment/artifacts/mainnet.json index 94feab4d..c287a4d8 100644 --- a/deployment/artifacts/mainnet.json +++ b/deployment/artifacts/mainnet.json @@ -1540,6 +1540,375 @@ } }, "137": { + "BetaProgramInitiator": { + "address": "0x2A8eA9760CB41a36f8320B8020173D3CA0495FC8", + "abi": [ + { + "type": "constructor", + "stateMutability": "nonpayable", + "inputs": [ + { + "name": "_coordinator", + "type": "address", + "internalType": "contract Coordinator" + }, + { + "name": "_executor", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "AddressEmptyCode", + "inputs": [ + { + "name": "target", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "AddressInsufficientBalance", + "inputs": [ + { + "name": "account", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "FailedInnerCall", + "inputs": [] + }, + { + "type": "error", + "name": "SafeERC20FailedOperation", + "inputs": [ + { + "name": "token", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "event", + "name": "FailedRequestRefunded", + "inputs": [ + { + "name": "requestIndex", + "type": "uint256", + "internalType": "uint256", + "indexed": true + }, + { + "name": "refundAmount", + "type": "uint256", + "internalType": "uint256", + "indexed": false + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "RequestCanceled", + "inputs": [ + { + "name": "sender", + "type": "address", + "internalType": "address", + "indexed": true + }, + { + "name": "requestIndex", + "type": "uint256", + "internalType": "uint256", + "indexed": true + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "RequestExecuted", + "inputs": [ + { + "name": "requestIndex", + "type": "uint256", + "internalType": "uint256", + "indexed": true + }, + { + "name": "ritualId", + "type": "uint256", + "internalType": "uint256", + "indexed": true + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "RequestRegistered", + "inputs": [ + { + "name": "sender", + "type": "address", + "internalType": "address", + "indexed": true + }, + { + "name": "requestIndex", + "type": "uint256", + "internalType": "uint256", + "indexed": true + }, + { + "name": "providers", + "type": "address[]", + "internalType": "address[]", + "indexed": false + }, + { + "name": "authority", + "type": "address", + "internalType": "address", + "indexed": false + }, + { + "name": "duration", + "type": "uint32", + "internalType": "uint32", + "indexed": false + }, + { + "name": "accessController", + "type": "address", + "internalType": "contract IEncryptionAuthorizer", + "indexed": false + }, + { + "name": "payment", + "type": "uint256", + "internalType": "uint256", + "indexed": false + } + ], + "anonymous": false + }, + { + "type": "function", + "name": "NO_RITUAL", + "stateMutability": "view", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint32", + "internalType": "uint32" + } + ] + }, + { + "type": "function", + "name": "cancelInitiationRequest", + "stateMutability": "nonpayable", + "inputs": [ + { + "name": "requestIndex", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "coordinator", + "stateMutability": "view", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "contract Coordinator" + } + ] + }, + { + "type": "function", + "name": "currency", + "stateMutability": "view", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "contract IERC20" + } + ] + }, + { + "type": "function", + "name": "executeInitiationRequest", + "stateMutability": "nonpayable", + "inputs": [ + { + "name": "requestIndex", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "executor", + "stateMutability": "view", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "function", + "name": "getProviders", + "stateMutability": "view", + "inputs": [ + { + "name": "requestIndex", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "address[]", + "internalType": "address[]" + } + ] + }, + { + "type": "function", + "name": "getRequestsLength", + "stateMutability": "view", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "type": "function", + "name": "refundFailedRequest", + "stateMutability": "nonpayable", + "inputs": [ + { + "name": "requestIndex", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "registerInitiationRequest", + "stateMutability": "nonpayable", + "inputs": [ + { + "name": "providers", + "type": "address[]", + "internalType": "address[]" + }, + { + "name": "authority", + "type": "address", + "internalType": "address" + }, + { + "name": "duration", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "accessController", + "type": "address", + "internalType": "contract IEncryptionAuthorizer" + } + ], + "outputs": [ + { + "name": "requestIndex", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "type": "function", + "name": "requests", + "stateMutability": "view", + "inputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "authority", + "type": "address", + "internalType": "address" + }, + { + "name": "duration", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "accessController", + "type": "address", + "internalType": "contract IEncryptionAuthorizer" + }, + { + "name": "sender", + "type": "address", + "internalType": "address" + }, + { + "name": "ritualId", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "payment", + "type": "uint256", + "internalType": "uint256" + } + ] + } + ], + "tx_hash": "0xd20ad04b6b39c7913e313c75c566170bd9891649cf2bae0706bb11ac23404626", + "block_number": 51972892, + "deployer": "0x1591165F1BF8B73de7053A6BE6f239BC15076879" + }, "Coordinator": { "address": "0xE74259e3dafe30bAA8700238e324b47aC98FE755", "abi": [ From 2bcd4fa310fe9354ed344dc62b1cb20823c79a07 Mon Sep 17 00:00:00 2001 From: derekpierre Date: Wed, 10 Jan 2024 16:27:30 -0500 Subject: [PATCH 03/10] Beta Program initiator deployment script for lynx. --- .../lynx/beta_program_initiator.yml | 20 +++++++++++++++ scripts/lynx/deploy_beta_program.py | 25 +++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 deployment/constructor_params/lynx/beta_program_initiator.yml create mode 100644 scripts/lynx/deploy_beta_program.py diff --git a/deployment/constructor_params/lynx/beta_program_initiator.yml b/deployment/constructor_params/lynx/beta_program_initiator.yml new file mode 100644 index 00000000..9a511aee --- /dev/null +++ b/deployment/constructor_params/lynx/beta_program_initiator.yml @@ -0,0 +1,20 @@ +deployment: + name: beta-program-initiator + chain_id: 80001 + +artifacts: + dir: ./deployment/artifacts/ + filename: beta_program_initiator_lynx.json + +constants: + # See deployment/artifacts/lynx.json + COORDINATOR_PROXY: "0x530608219a8A671FD183534b17E2a2CE09e782a4" + + # lynx deployer account + EXECUTOR: "0x3B42d26E19FF860bC4dEbB920DD8caA53F93c600" + +contracts: + - BetaProgramInitiator: + constructor: + _coordinator: $COORDINATOR_PROXY + _executor: EXECUTOR diff --git a/scripts/lynx/deploy_beta_program.py b/scripts/lynx/deploy_beta_program.py new file mode 100644 index 00000000..d7ffe75e --- /dev/null +++ b/scripts/lynx/deploy_beta_program.py @@ -0,0 +1,25 @@ +#!/usr/bin/python3 + +from ape import project + +from deployment.constants import ( + CONSTRUCTOR_PARAMS_DIR, ARTIFACTS_DIR, +) +from deployment.params import Deployer +from deployment.registry import merge_registries + +VERIFY = False +CONSTRUCTOR_PARAMS_FILEPATH = CONSTRUCTOR_PARAMS_DIR / "lynx" / "beta_program_initiator.yml" +LYNX_REGISTRY = ARTIFACTS_DIR / "lynx.json" + + +def main(): + deployer = Deployer.from_yaml(filepath=CONSTRUCTOR_PARAMS_FILEPATH, verify=VERIFY) + beta_program_initiator = deployer.deploy(project.BetaProgramInitiator) + deployments = [beta_program_initiator] + deployer.finalize(deployments=deployments) + merge_registries( + registry_1_filepath=LYNX_REGISTRY, + registry_2_filepath=deployer.registry_filepath, + output_filepath=LYNX_REGISTRY, + ) From 11c24fbd5cefc4ad7cd54f7da1214b8c8332ca75 Mon Sep 17 00:00:00 2001 From: derekpierre Date: Wed, 10 Jan 2024 16:31:59 -0500 Subject: [PATCH 04/10] Beta Program initiator deployment script for tapir. --- .../tapir/beta_program_initiator.yml | 20 +++++++++++++++ scripts/tapir/deploy_beta_program.py | 25 +++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 deployment/constructor_params/tapir/beta_program_initiator.yml create mode 100644 scripts/tapir/deploy_beta_program.py diff --git a/deployment/constructor_params/tapir/beta_program_initiator.yml b/deployment/constructor_params/tapir/beta_program_initiator.yml new file mode 100644 index 00000000..ffda59e7 --- /dev/null +++ b/deployment/constructor_params/tapir/beta_program_initiator.yml @@ -0,0 +1,20 @@ +deployment: + name: beta-program-initiator + chain_id: 80001 + +artifacts: + dir: ./deployment/artifacts/ + filename: beta_program_initiator_tapir.json + +constants: + # See deployment/artifacts/tapir.json + COORDINATOR_PROXY: "0xdED71c37e4e17aF2c825c2A4441Dd6BF5A98D194" + + # tapir deployer account + EXECUTOR: "0x3B42d26E19FF860bC4dEbB920DD8caA53F93c600" + +contracts: + - BetaProgramInitiator: + constructor: + _coordinator: $COORDINATOR_PROXY + _executor: EXECUTOR diff --git a/scripts/tapir/deploy_beta_program.py b/scripts/tapir/deploy_beta_program.py new file mode 100644 index 00000000..d6c55a10 --- /dev/null +++ b/scripts/tapir/deploy_beta_program.py @@ -0,0 +1,25 @@ +#!/usr/bin/python3 + +from ape import project + +from deployment.constants import ( + CONSTRUCTOR_PARAMS_DIR, ARTIFACTS_DIR, +) +from deployment.params import Deployer +from deployment.registry import merge_registries + +VERIFY = False +CONSTRUCTOR_PARAMS_FILEPATH = CONSTRUCTOR_PARAMS_DIR / "tapir" / "beta_program_initiator.yml" +TAPIR_REGISTRY = ARTIFACTS_DIR / "tapir.json" + + +def main(): + deployer = Deployer.from_yaml(filepath=CONSTRUCTOR_PARAMS_FILEPATH, verify=VERIFY) + beta_program_initiator = deployer.deploy(project.BetaProgramInitiator) + deployments = [beta_program_initiator] + deployer.finalize(deployments=deployments) + merge_registries( + registry_1_filepath=TAPIR_REGISTRY, + registry_2_filepath=deployer.registry_filepath, + output_filepath=TAPIR_REGISTRY, + ) From 582be7feeef24a20a8a98e64a2bd78dc999f09a5 Mon Sep 17 00:00:00 2001 From: derekpierre Date: Fri, 12 Jan 2024 15:57:48 -0500 Subject: [PATCH 05/10] Prefix use of EXECUTOR constant with $. --- deployment/constructor_params/lynx/beta_program_initiator.yml | 2 +- deployment/constructor_params/tapir/beta_program_initiator.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deployment/constructor_params/lynx/beta_program_initiator.yml b/deployment/constructor_params/lynx/beta_program_initiator.yml index 9a511aee..66ceb9c8 100644 --- a/deployment/constructor_params/lynx/beta_program_initiator.yml +++ b/deployment/constructor_params/lynx/beta_program_initiator.yml @@ -17,4 +17,4 @@ contracts: - BetaProgramInitiator: constructor: _coordinator: $COORDINATOR_PROXY - _executor: EXECUTOR + _executor: $EXECUTOR diff --git a/deployment/constructor_params/tapir/beta_program_initiator.yml b/deployment/constructor_params/tapir/beta_program_initiator.yml index ffda59e7..0b0b076c 100644 --- a/deployment/constructor_params/tapir/beta_program_initiator.yml +++ b/deployment/constructor_params/tapir/beta_program_initiator.yml @@ -17,4 +17,4 @@ contracts: - BetaProgramInitiator: constructor: _coordinator: $COORDINATOR_PROXY - _executor: EXECUTOR + _executor: $EXECUTOR From 9a44a8a8f2a13fabaf6de518878ecdf787f3a5d4 Mon Sep 17 00:00:00 2001 From: derekpierre Date: Fri, 12 Jan 2024 15:58:40 -0500 Subject: [PATCH 06/10] Deployment of BetaProgramIntitiator for lynx. --- deployment/artifacts/lynx.json | 369 +++++++++++++++++++++++++++++++++ 1 file changed, 369 insertions(+) diff --git a/deployment/artifacts/lynx.json b/deployment/artifacts/lynx.json index 049d569f..111fc8a7 100644 --- a/deployment/artifacts/lynx.json +++ b/deployment/artifacts/lynx.json @@ -1,5 +1,374 @@ { "80001": { + "BetaProgramInitiator": { + "address": "0xb6e6512F4c9A74Ef1b742d832852769F3CEE646c", + "abi": [ + { + "type": "constructor", + "stateMutability": "nonpayable", + "inputs": [ + { + "name": "_coordinator", + "type": "address", + "internalType": "contract Coordinator" + }, + { + "name": "_executor", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "AddressEmptyCode", + "inputs": [ + { + "name": "target", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "AddressInsufficientBalance", + "inputs": [ + { + "name": "account", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "FailedInnerCall", + "inputs": [] + }, + { + "type": "error", + "name": "SafeERC20FailedOperation", + "inputs": [ + { + "name": "token", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "event", + "name": "FailedRequestRefunded", + "inputs": [ + { + "name": "requestIndex", + "type": "uint256", + "internalType": "uint256", + "indexed": true + }, + { + "name": "refundAmount", + "type": "uint256", + "internalType": "uint256", + "indexed": false + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "RequestCanceled", + "inputs": [ + { + "name": "sender", + "type": "address", + "internalType": "address", + "indexed": true + }, + { + "name": "requestIndex", + "type": "uint256", + "internalType": "uint256", + "indexed": true + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "RequestExecuted", + "inputs": [ + { + "name": "requestIndex", + "type": "uint256", + "internalType": "uint256", + "indexed": true + }, + { + "name": "ritualId", + "type": "uint256", + "internalType": "uint256", + "indexed": true + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "RequestRegistered", + "inputs": [ + { + "name": "sender", + "type": "address", + "internalType": "address", + "indexed": true + }, + { + "name": "requestIndex", + "type": "uint256", + "internalType": "uint256", + "indexed": true + }, + { + "name": "providers", + "type": "address[]", + "internalType": "address[]", + "indexed": false + }, + { + "name": "authority", + "type": "address", + "internalType": "address", + "indexed": false + }, + { + "name": "duration", + "type": "uint32", + "internalType": "uint32", + "indexed": false + }, + { + "name": "accessController", + "type": "address", + "internalType": "contract IEncryptionAuthorizer", + "indexed": false + }, + { + "name": "payment", + "type": "uint256", + "internalType": "uint256", + "indexed": false + } + ], + "anonymous": false + }, + { + "type": "function", + "name": "NO_RITUAL", + "stateMutability": "view", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint32", + "internalType": "uint32" + } + ] + }, + { + "type": "function", + "name": "cancelInitiationRequest", + "stateMutability": "nonpayable", + "inputs": [ + { + "name": "requestIndex", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "coordinator", + "stateMutability": "view", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "contract Coordinator" + } + ] + }, + { + "type": "function", + "name": "currency", + "stateMutability": "view", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "contract IERC20" + } + ] + }, + { + "type": "function", + "name": "executeInitiationRequest", + "stateMutability": "nonpayable", + "inputs": [ + { + "name": "requestIndex", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "executor", + "stateMutability": "view", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "function", + "name": "getProviders", + "stateMutability": "view", + "inputs": [ + { + "name": "requestIndex", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "address[]", + "internalType": "address[]" + } + ] + }, + { + "type": "function", + "name": "getRequestsLength", + "stateMutability": "view", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "type": "function", + "name": "refundFailedRequest", + "stateMutability": "nonpayable", + "inputs": [ + { + "name": "requestIndex", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "registerInitiationRequest", + "stateMutability": "nonpayable", + "inputs": [ + { + "name": "providers", + "type": "address[]", + "internalType": "address[]" + }, + { + "name": "authority", + "type": "address", + "internalType": "address" + }, + { + "name": "duration", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "accessController", + "type": "address", + "internalType": "contract IEncryptionAuthorizer" + } + ], + "outputs": [ + { + "name": "requestIndex", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "type": "function", + "name": "requests", + "stateMutability": "view", + "inputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "authority", + "type": "address", + "internalType": "address" + }, + { + "name": "duration", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "accessController", + "type": "address", + "internalType": "contract IEncryptionAuthorizer" + }, + { + "name": "sender", + "type": "address", + "internalType": "address" + }, + { + "name": "ritualId", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "payment", + "type": "uint256", + "internalType": "uint256" + } + ] + } + ], + "tx_hash": "0xa96fa3337c1259b97b31b86afa8f8a606d1d8ef8529d570a404c28cac5f4f0fd", + "block_number": 44702414, + "deployer": "0x3B42d26E19FF860bC4dEbB920DD8caA53F93c600" + }, "Coordinator": { "address": "0x530608219a8A671FD183534b17E2a2CE09e782a4", "abi": [ From e6c0e777f359e291f9bc70d7792146957606b20d Mon Sep 17 00:00:00 2001 From: derekpierre Date: Fri, 12 Jan 2024 15:59:29 -0500 Subject: [PATCH 07/10] Deployment of BetaProgramInitiator for tapir. --- deployment/artifacts/tapir.json | 369 ++++++++++++++++++++++++++++++++ 1 file changed, 369 insertions(+) diff --git a/deployment/artifacts/tapir.json b/deployment/artifacts/tapir.json index ce35a8c0..c3474060 100644 --- a/deployment/artifacts/tapir.json +++ b/deployment/artifacts/tapir.json @@ -2294,6 +2294,375 @@ } }, "80001": { + "BetaProgramInitiator": { + "address": "0x070fbc5a82776A1fd9945824d0719E4E7a5Ac01c", + "abi": [ + { + "type": "constructor", + "stateMutability": "nonpayable", + "inputs": [ + { + "name": "_coordinator", + "type": "address", + "internalType": "contract Coordinator" + }, + { + "name": "_executor", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "AddressEmptyCode", + "inputs": [ + { + "name": "target", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "AddressInsufficientBalance", + "inputs": [ + { + "name": "account", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "FailedInnerCall", + "inputs": [] + }, + { + "type": "error", + "name": "SafeERC20FailedOperation", + "inputs": [ + { + "name": "token", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "event", + "name": "FailedRequestRefunded", + "inputs": [ + { + "name": "requestIndex", + "type": "uint256", + "internalType": "uint256", + "indexed": true + }, + { + "name": "refundAmount", + "type": "uint256", + "internalType": "uint256", + "indexed": false + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "RequestCanceled", + "inputs": [ + { + "name": "sender", + "type": "address", + "internalType": "address", + "indexed": true + }, + { + "name": "requestIndex", + "type": "uint256", + "internalType": "uint256", + "indexed": true + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "RequestExecuted", + "inputs": [ + { + "name": "requestIndex", + "type": "uint256", + "internalType": "uint256", + "indexed": true + }, + { + "name": "ritualId", + "type": "uint256", + "internalType": "uint256", + "indexed": true + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "RequestRegistered", + "inputs": [ + { + "name": "sender", + "type": "address", + "internalType": "address", + "indexed": true + }, + { + "name": "requestIndex", + "type": "uint256", + "internalType": "uint256", + "indexed": true + }, + { + "name": "providers", + "type": "address[]", + "internalType": "address[]", + "indexed": false + }, + { + "name": "authority", + "type": "address", + "internalType": "address", + "indexed": false + }, + { + "name": "duration", + "type": "uint32", + "internalType": "uint32", + "indexed": false + }, + { + "name": "accessController", + "type": "address", + "internalType": "contract IEncryptionAuthorizer", + "indexed": false + }, + { + "name": "payment", + "type": "uint256", + "internalType": "uint256", + "indexed": false + } + ], + "anonymous": false + }, + { + "type": "function", + "name": "NO_RITUAL", + "stateMutability": "view", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint32", + "internalType": "uint32" + } + ] + }, + { + "type": "function", + "name": "cancelInitiationRequest", + "stateMutability": "nonpayable", + "inputs": [ + { + "name": "requestIndex", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "coordinator", + "stateMutability": "view", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "contract Coordinator" + } + ] + }, + { + "type": "function", + "name": "currency", + "stateMutability": "view", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "contract IERC20" + } + ] + }, + { + "type": "function", + "name": "executeInitiationRequest", + "stateMutability": "nonpayable", + "inputs": [ + { + "name": "requestIndex", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "executor", + "stateMutability": "view", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "function", + "name": "getProviders", + "stateMutability": "view", + "inputs": [ + { + "name": "requestIndex", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "address[]", + "internalType": "address[]" + } + ] + }, + { + "type": "function", + "name": "getRequestsLength", + "stateMutability": "view", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "type": "function", + "name": "refundFailedRequest", + "stateMutability": "nonpayable", + "inputs": [ + { + "name": "requestIndex", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "registerInitiationRequest", + "stateMutability": "nonpayable", + "inputs": [ + { + "name": "providers", + "type": "address[]", + "internalType": "address[]" + }, + { + "name": "authority", + "type": "address", + "internalType": "address" + }, + { + "name": "duration", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "accessController", + "type": "address", + "internalType": "contract IEncryptionAuthorizer" + } + ], + "outputs": [ + { + "name": "requestIndex", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "type": "function", + "name": "requests", + "stateMutability": "view", + "inputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "authority", + "type": "address", + "internalType": "address" + }, + { + "name": "duration", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "accessController", + "type": "address", + "internalType": "contract IEncryptionAuthorizer" + }, + { + "name": "sender", + "type": "address", + "internalType": "address" + }, + { + "name": "ritualId", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "payment", + "type": "uint256", + "internalType": "uint256" + } + ] + } + ], + "tx_hash": "0x78cd0d69f29577ce123a19e8a67ffbd945206b19f488f3989e9e75d331df1389", + "block_number": 44702626, + "deployer": "0x3B42d26E19FF860bC4dEbB920DD8caA53F93c600" + }, "Coordinator": { "address": "0xdED71c37e4e17aF2c825c2A4441Dd6BF5A98D194", "abi": [ From 8f1c579832cbe3fbbd76626e6d8de62724e2d3c4 Mon Sep 17 00:00:00 2001 From: derekpierre Date: Fri, 12 Jan 2024 16:00:32 -0500 Subject: [PATCH 08/10] Improve grant_initiator_role script to take a grant address. --- scripts/grant_initiator_role.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/grant_initiator_role.py b/scripts/grant_initiator_role.py index d4041f93..1d7f87cf 100644 --- a/scripts/grant_initiator_role.py +++ b/scripts/grant_initiator_role.py @@ -19,7 +19,14 @@ type=click.Choice(SUPPORTED_TACO_DOMAINS), required=True, ) -def cli(network, account, domain): +@click.option( + "--grant-address", + "-g", + help="Address to grant initiator role", + type=str, + required=False, +) +def cli(network, account, domain, grant_address): check_plugins() transactor = Transactor(account) registry_filepath = registry_filepath_from_domain(domain=domain) @@ -31,7 +38,7 @@ def cli(network, account, domain): transactor.transact( coordinator.grantRole, initiator_role_hash, - transactor.get_account().address, # <- new initiator + grant_address, # <- new initiator ) From f382472a5d42dc3ea4ece999c7bd3d9b9bb1d752 Mon Sep 17 00:00:00 2001 From: derekpierre Date: Mon, 15 Jan 2024 09:14:59 -0500 Subject: [PATCH 09/10] Add script to specifically update Coordinator contract on lynx. --- .../lynx/upgrade-coordinator.yml | 18 ++++++++++++ scripts/lynx/upgrade_coordinator.py | 29 +++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 deployment/constructor_params/lynx/upgrade-coordinator.yml create mode 100644 scripts/lynx/upgrade_coordinator.py diff --git a/deployment/constructor_params/lynx/upgrade-coordinator.yml b/deployment/constructor_params/lynx/upgrade-coordinator.yml new file mode 100644 index 00000000..8748530f --- /dev/null +++ b/deployment/constructor_params/lynx/upgrade-coordinator.yml @@ -0,0 +1,18 @@ +deployment: + name: lynx-upgrade-coordinator + chain_id: 80001 + +artifacts: + dir: ./deployment/artifacts/ + filename: lynx-upgrade-coordinator.json + +constants: + TACO_CHILD_APPLICATION: "0x8BFB087C4427387dFA217599EA0b860b3F3C49A3" + LYNX_RITUAL_TOKEN: "0x6DED3A2DCaC9dcB62253F063D765F323D6E4be82" + +contracts: + - Coordinator: + constructor: + _application: $TACO_CHILD_APPLICATION + _currency: $LYNX_RITUAL_TOKEN + _feeRatePerSecond: 1 diff --git a/scripts/lynx/upgrade_coordinator.py b/scripts/lynx/upgrade_coordinator.py new file mode 100644 index 00000000..be766a35 --- /dev/null +++ b/scripts/lynx/upgrade_coordinator.py @@ -0,0 +1,29 @@ +#!/usr/bin/python3 + +from ape import project +from deployment.constants import CONSTRUCTOR_PARAMS_DIR, ARTIFACTS_DIR +from deployment.params import Deployer +from deployment.registry import contracts_from_registry + +VERIFY = False +CONSTRUCTOR_PARAMS_FILEPATH = CONSTRUCTOR_PARAMS_DIR / "lynx" / "upgrade-coordinator.yml" + + +def main(): + """ + This script upgrades Coordinator on Lynx/Mumbai. + """ + + deployer = Deployer.from_yaml(filepath=CONSTRUCTOR_PARAMS_FILEPATH, verify=VERIFY) + instances = contracts_from_registry(filepath=ARTIFACTS_DIR/'lynx.json', chain_id=80001) + + coordinator = deployer.upgrade( + project.Coordinator, + instances[project.Coordinator.contract_type.name].address + ) + + deployments = [ + coordinator, + ] + + deployer.finalize(deployments=deployments) From 8ab6d754fad819eb77473685d1d4c5bc5b2013ca Mon Sep 17 00:00:00 2001 From: derekpierre Date: Mon, 15 Jan 2024 12:39:15 -0500 Subject: [PATCH 10/10] Update Coordinator ABI in lynx contract registry. --- deployment/artifacts/lynx.json | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/deployment/artifacts/lynx.json b/deployment/artifacts/lynx.json index 111fc8a7..20114c44 100644 --- a/deployment/artifacts/lynx.json +++ b/deployment/artifacts/lynx.json @@ -1031,6 +1031,30 @@ } ] }, + { + "type": "function", + "name": "feeDeduction", + "stateMutability": "pure", + "inputs": [ + { + "name": "pending", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "duration", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ] + }, { "type": "function", "name": "feeRatePerSecond",