From 4258c3ede9d6c7adc3321910c75520cf08106fa3 Mon Sep 17 00:00:00 2001 From: James Campbell Date: Tue, 13 Aug 2024 15:07:49 +0200 Subject: [PATCH] Deploy InfractionCollector to tapir --- deployment/artifacts/tapir.json | 241 +++++++++++++++++- .../constructor_params/tapir/infraction.yml | 19 ++ scripts/tapir/deploy_infraction.py | 20 ++ 3 files changed, 279 insertions(+), 1 deletion(-) create mode 100644 deployment/constructor_params/tapir/infraction.yml create mode 100644 scripts/tapir/deploy_infraction.py diff --git a/deployment/artifacts/tapir.json b/deployment/artifacts/tapir.json index 7805a95fc..54afe8fc7 100644 --- a/deployment/artifacts/tapir.json +++ b/deployment/artifacts/tapir.json @@ -4657,6 +4657,245 @@ "block_number": 5393004, "deployer": "0x3B42d26E19FF860bC4dEbB920DD8caA53F93c600" }, + "InfractionCollector": { + "address": "0xb6400F55857716A3Ff863e6bE867F01F23C71793", + "abi": [ + { + "type": "constructor", + "stateMutability": "nonpayable", + "inputs": [ + { + "name": "_coordinator", + "type": "address", + "components": null, + "internal_type": "contract Coordinator" + }, + { + "name": "_tacoChildApplication", + "type": "address", + "components": null, + "internal_type": "contract ITACoChildApplication" + } + ] + }, + { + "type": "error", + "name": "InvalidInitialization", + "inputs": [] + }, + { + "type": "error", + "name": "NotInitializing", + "inputs": [] + }, + { + "type": "error", + "name": "OwnableInvalidOwner", + "inputs": [ + { + "name": "owner", + "type": "address", + "components": null, + "internal_type": "address" + } + ] + }, + { + "type": "error", + "name": "OwnableUnauthorizedAccount", + "inputs": [ + { + "name": "account", + "type": "address", + "components": null, + "internal_type": "address" + } + ] + }, + { + "type": "event", + "name": "InfractionReported", + "inputs": [ + { + "name": "ritualId", + "type": "uint32", + "components": null, + "internal_type": "uint32", + "indexed": true + }, + { + "name": "stakingProvider", + "type": "address", + "components": null, + "internal_type": "address", + "indexed": true + }, + { + "name": "infractionType", + "type": "uint8", + "components": null, + "internal_type": "enum InfractionCollector.InfractionType", + "indexed": false + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "Initialized", + "inputs": [ + { + "name": "version", + "type": "uint64", + "components": null, + "internal_type": "uint64", + "indexed": false + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "OwnershipTransferred", + "inputs": [ + { + "name": "previousOwner", + "type": "address", + "components": null, + "internal_type": "address", + "indexed": true + }, + { + "name": "newOwner", + "type": "address", + "components": null, + "internal_type": "address", + "indexed": true + } + ], + "anonymous": false + }, + { + "type": "function", + "name": "coordinator", + "stateMutability": "view", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "components": null, + "internal_type": "contract Coordinator" + } + ] + }, + { + "type": "function", + "name": "infractions", + "stateMutability": "view", + "inputs": [ + { + "name": "ritualId", + "type": "uint32", + "components": null, + "internal_type": "uint32" + }, + { + "name": "stakingProvider", + "type": "address", + "components": null, + "internal_type": "address" + }, + { + "name": "", + "type": "uint8", + "components": null, + "internal_type": "enum InfractionCollector.InfractionType" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "components": null, + "internal_type": "bool" + } + ] + }, + { + "type": "function", + "name": "owner", + "stateMutability": "view", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "components": null, + "internal_type": "address" + } + ] + }, + { + "type": "function", + "name": "renounceOwnership", + "stateMutability": "nonpayable", + "inputs": [], + "outputs": [] + }, + { + "type": "function", + "name": "reportMissingTranscript", + "stateMutability": "nonpayable", + "inputs": [ + { + "name": "ritualId", + "type": "uint32", + "components": null, + "internal_type": "uint32" + }, + { + "name": "stakingProviders", + "type": "address[]", + "components": null, + "internal_type": "address[]" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "tacoChildApplication", + "stateMutability": "view", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "components": null, + "internal_type": "contract ITACoChildApplication" + } + ] + }, + { + "type": "function", + "name": "transferOwnership", + "stateMutability": "nonpayable", + "inputs": [ + { + "name": "newOwner", + "type": "address", + "components": null, + "internal_type": "address" + } + ], + "outputs": [] + } + ], + "tx_hash": "0x7c11685e52dca884556e225541211e3d747da2bd796fb88c75fdeed3910ba488", + "block_number": 10667701, + "deployer": "0x3B42d26E19FF860bC4dEbB920DD8caA53F93c600" + }, "MockPolygonChild": { "address": "0x970b5f6A299813cA9DC45Be8446929b6513903f9", "abi": [ @@ -6235,4 +6474,4 @@ "deployer": "0x3B42d26E19FF860bC4dEbB920DD8caA53F93c600" } } -} +} \ No newline at end of file diff --git a/deployment/constructor_params/tapir/infraction.yml b/deployment/constructor_params/tapir/infraction.yml new file mode 100644 index 000000000..8c2f03cf1 --- /dev/null +++ b/deployment/constructor_params/tapir/infraction.yml @@ -0,0 +1,19 @@ +deployment: + name: infraction + chain_id: 80002 + +artifacts: + dir: ./deployment/artifacts/ + filename: tapir.json + +constants: + # See deployment/artifacts/tapir.json + COORDINATOR_PROXY: "0xE690b6bCC0616Dc5294fF84ff4e00335cA52C388" + TACO_CHILD_PROXY: "0x489287Ed5BdF7a35fEE411FBdCc47331093D0769" + +contracts: + - InfractionCollector: + proxy: + constructor: + _coordinator: $COORDINATOR_PROXY + _tacoChildApplication: $TACO_CHILD_PROXY diff --git a/scripts/tapir/deploy_infraction.py b/scripts/tapir/deploy_infraction.py new file mode 100644 index 000000000..ec8944e70 --- /dev/null +++ b/scripts/tapir/deploy_infraction.py @@ -0,0 +1,20 @@ +#!/usr/bin/python3 + +from ape import project + +from deployment.constants import ( + CONSTRUCTOR_PARAMS_DIR, ARTIFACTS_DIR, +) +from deployment.params import Deployer + +VERIFY = False +CONSTRUCTOR_PARAMS_FILEPATH = CONSTRUCTOR_PARAMS_DIR / "tapir" / "infraction.yml" +TAPIR_REGISTRY = ARTIFACTS_DIR / "tapir.json" + + +def main(): + deployer = Deployer.from_yaml(filepath=CONSTRUCTOR_PARAMS_FILEPATH, verify=VERIFY) + infraction = deployer.deploy(project.InfractionCollector) + deployments = [infraction] + deployer.finalize(deployments=deployments) +