From 9fa3dc4f692bdee9f4379de749e71625040a39aa Mon Sep 17 00:00:00 2001 From: Victoria Zotova Date: Fri, 5 Jul 2024 10:34:58 -0400 Subject: [PATCH 1/9] Adds free fee model --- .../contracts/coordination/FreeFeeModel.sol | 39 +++++++++++++++++++ .../contracts/coordination/IFeeModel.sol | 2 - 2 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 contracts/contracts/coordination/FreeFeeModel.sol diff --git a/contracts/contracts/coordination/FreeFeeModel.sol b/contracts/contracts/coordination/FreeFeeModel.sol new file mode 100644 index 00000000..726a6e1b --- /dev/null +++ b/contracts/contracts/coordination/FreeFeeModel.sol @@ -0,0 +1,39 @@ +// SPDX-License-Identifier: AGPL-3.0-or-later + +pragma solidity ^0.8.0; + +import "@openzeppelin/contracts/access/Ownable.sol"; + +/** + * @title FreeFeeModel + * @notice Free FeeModel + */ +contract FreeFeeModel is Ownable { + mapping(address initiator => bool approved) public initiatorWhiteList; + + constructor() Ownable(msg.sender) {} + + function approveInitiator(address initiator) external onlyOwner { + initiatorWhiteList[initiator] = true; + } + + function processRitualPayment(address initiator, uint32, uint256, uint32) external { + require(initiatorWhiteList[initiator], "Initiator not approved"); + } + + function processRitualExtending(address initiator, uint32, uint256, uint32) external { + require(initiatorWhiteList[initiator], "Initiator not approved"); + } + + function beforeSetAuthorization( + uint32 ritualId, + address[] calldata addresses, + bool value + ) external { + // solhint-disable-previous-line no-empty-blocks + } + + function beforeIsAuthorized(uint32 ritualId) external view { + // solhint-disable-previous-line no-empty-blocks + } +} diff --git a/contracts/contracts/coordination/IFeeModel.sol b/contracts/contracts/coordination/IFeeModel.sol index efb9701d..6a002304 100644 --- a/contracts/contracts/coordination/IFeeModel.sol +++ b/contracts/contracts/coordination/IFeeModel.sol @@ -2,8 +2,6 @@ pragma solidity ^0.8.0; -import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; - /** * @title IFeeModel * @notice IFeeModel From a3257b4c60e66b8ec755369b1f5ccf042e3314b2 Mon Sep 17 00:00:00 2001 From: Manuel Montenegro Date: Fri, 5 Jul 2024 17:21:57 +0200 Subject: [PATCH 2/9] Fix deployer.finalize() function for ape 0.8.8 --- deployment/registry.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/deployment/registry.py b/deployment/registry.py index 74c7b8b4..fb94ef3a 100644 --- a/deployment/registry.py +++ b/deployment/registry.py @@ -6,6 +6,7 @@ from typing import Dict, List, NamedTuple, Optional from ape.contracts import ContractInstance +from ape import chain from eth_typing import ChecksumAddress from eth_utils import to_checksum_address from web3.types import ABI @@ -59,7 +60,7 @@ def _get_entry( ) -> RegistryEntry: contract_abi = _get_abi(contract_instance) contract_name = _get_name(contract_instance=contract_instance, registry_names=registry_names) - receipt = contract_instance.receipt + receipt = chain.get_receipt(contract_instance.txn_hash) entry = RegistryEntry( name=contract_name, address=to_checksum_address(contract_instance.address), From 34432e8d6dc47050a8449cd7c86d599582f62a04 Mon Sep 17 00:00:00 2001 From: Manuel Montenegro Date: Fri, 5 Jul 2024 17:23:07 +0200 Subject: [PATCH 3/9] Add Free Fee Model deployment script --- .../lynx/free-fee-model.yml | 10 ++++++++ scripts/lynx/deploy_free_fee_model.py | 23 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 deployment/constructor_params/lynx/free-fee-model.yml create mode 100644 scripts/lynx/deploy_free_fee_model.py diff --git a/deployment/constructor_params/lynx/free-fee-model.yml b/deployment/constructor_params/lynx/free-fee-model.yml new file mode 100644 index 00000000..b57535dd --- /dev/null +++ b/deployment/constructor_params/lynx/free-fee-model.yml @@ -0,0 +1,10 @@ +deployment: + name: lynx-free-fee-model + chain_id: 80002 + +artifacts: + dir: ./deployment/artifacts/ + filename: free-fee-model.json + +contracts: + - FreeFeeModel diff --git a/scripts/lynx/deploy_free_fee_model.py b/scripts/lynx/deploy_free_fee_model.py new file mode 100644 index 00000000..64d75852 --- /dev/null +++ b/scripts/lynx/deploy_free_fee_model.py @@ -0,0 +1,23 @@ +#!/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" / "free-fee-model.yml" +LYNX_REGISTRY = ARTIFACTS_DIR / "lynx.json" + + +def main(): + deployer = Deployer.from_yaml(filepath=CONSTRUCTOR_PARAMS_FILEPATH, verify=VERIFY) + + free_fee_model = deployer.deploy(project.FreeFeeModel) + + deployments = [free_fee_model] + + deployer.finalize(deployments=deployments) From 96bdc96fc2f9ee105f2f57fc99433584487ad8df Mon Sep 17 00:00:00 2001 From: Manuel Montenegro Date: Fri, 5 Jul 2024 17:23:35 +0200 Subject: [PATCH 4/9] Add Free Fee Model contract to the Lynx registry --- deployment/artifacts/lynx.json | 234 ++++++++++++++++++++++++++++++++- 1 file changed, 233 insertions(+), 1 deletion(-) diff --git a/deployment/artifacts/lynx.json b/deployment/artifacts/lynx.json index d03a8e7f..c8a266b9 100644 --- a/deployment/artifacts/lynx.json +++ b/deployment/artifacts/lynx.json @@ -4933,6 +4933,238 @@ "block_number": 5198668, "deployer": "0x3B42d26E19FF860bC4dEbB920DD8caA53F93c600" }, + "FreeFeeModel": { + "address": "0x14EB9BB700E45D2Ee9233056b8cc341276c688Ba", + "abi": [ + { + "type": "constructor", + "stateMutability": "nonpayable", + "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": "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": "approveInitiator", + "stateMutability": "nonpayable", + "inputs": [ + { + "name": "initiator", + "type": "address", + "components": null, + "internal_type": "address" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "beforeIsAuthorized", + "stateMutability": "view", + "inputs": [ + { + "name": "ritualId", + "type": "uint32", + "components": null, + "internal_type": "uint32" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "beforeSetAuthorization", + "stateMutability": "nonpayable", + "inputs": [ + { + "name": "ritualId", + "type": "uint32", + "components": null, + "internal_type": "uint32" + }, + { + "name": "addresses", + "type": "address[]", + "components": null, + "internal_type": "address[]" + }, + { + "name": "value", + "type": "bool", + "components": null, + "internal_type": "bool" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "initiatorWhiteList", + "stateMutability": "view", + "inputs": [ + { + "name": "initiator", + "type": "address", + "components": null, + "internal_type": "address" + } + ], + "outputs": [ + { + "name": "approved", + "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": "processRitualExtending", + "stateMutability": "nonpayable", + "inputs": [ + { + "name": "initiator", + "type": "address", + "components": null, + "internal_type": "address" + }, + { + "name": "", + "type": "uint32", + "components": null, + "internal_type": "uint32" + }, + { + "name": "", + "type": "uint256", + "components": null, + "internal_type": "uint256" + }, + { + "name": "", + "type": "uint32", + "components": null, + "internal_type": "uint32" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "processRitualPayment", + "stateMutability": "nonpayable", + "inputs": [ + { + "name": "initiator", + "type": "address", + "components": null, + "internal_type": "address" + }, + { + "name": "", + "type": "uint32", + "components": null, + "internal_type": "uint32" + }, + { + "name": "", + "type": "uint256", + "components": null, + "internal_type": "uint256" + }, + { + "name": "", + "type": "uint32", + "components": null, + "internal_type": "uint32" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "renounceOwnership", + "stateMutability": "nonpayable", + "inputs": [], + "outputs": [] + }, + { + "type": "function", + "name": "transferOwnership", + "stateMutability": "nonpayable", + "inputs": [ + { + "name": "newOwner", + "type": "address", + "components": null, + "internal_type": "address" + } + ], + "outputs": [] + } + ], + "tx_hash": "0x9672d91bcbab5b746288e592e420c7cda089ef598023971d6525243d1504758b", + "block_number": 9106650, + "deployer": "0x3B42d26E19FF860bC4dEbB920DD8caA53F93c600" + }, "GlobalAllowList": { "address": "0xd5a66BF5f63dccAFEC74AEe1ba755CD7e06F683a", "abi": [ @@ -6737,4 +6969,4 @@ "deployer": "0x3B42d26E19FF860bC4dEbB920DD8caA53F93c600" } } -} +} \ No newline at end of file From 07eec03f797685be52222a659c3b7ec9e3a8e265 Mon Sep 17 00:00:00 2001 From: Manuel Montenegro Date: Fri, 5 Jul 2024 17:27:50 +0200 Subject: [PATCH 5/9] Add coordinator approve free fee model script --- .../coordinator_approve_free_fee_model.py | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 scripts/lynx/coordinator_approve_free_fee_model.py diff --git a/scripts/lynx/coordinator_approve_free_fee_model.py b/scripts/lynx/coordinator_approve_free_fee_model.py new file mode 100644 index 00000000..32db8230 --- /dev/null +++ b/scripts/lynx/coordinator_approve_free_fee_model.py @@ -0,0 +1,25 @@ +#!/usr/bin/python3 + +from ape import project, networks + +from deployment.constants import ARTIFACTS_DIR +from deployment.params import Transactor +from deployment.registry import contracts_from_registry + +LYNX_REGISTRY_FILEPATH = ARTIFACTS_DIR / "lynx.json" + +def main(): + """ + Coordinator approves the fee model for Free Fee Model + + ape run lynx coordinator_approve_free_fee_model --network polygon:amoy:infura + """ + + transactor = Transactor() + deployments = contracts_from_registry( + filepath=LYNX_REGISTRY_FILEPATH, chain_id=networks.active_provider.chain_id + ) + coordinator = deployments[project.Coordinator.contract_type.name] + free_fee_model = deployments[project.FreeFeeModel.contract_type.name] + + transactor.transact(coordinator.approveFeeModel, free_fee_model.address) From ae03fc83abed49d4138c8b6fd80694b7e670393b Mon Sep 17 00:00:00 2001 From: derekpierre Date: Mon, 8 Jul 2024 15:06:27 -0400 Subject: [PATCH 6/9] Stop using deprecated method in favour of updated method. This will prevent the weird ABI values from being used ("internal_type" and "components": null) in the resulting contract registry during deployment finalization. --- deployment/registry.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/registry.py b/deployment/registry.py index fb94ef3a..8e1483ef 100644 --- a/deployment/registry.py +++ b/deployment/registry.py @@ -36,7 +36,7 @@ def _get_abi(contract_instance: ContractInstance) -> ABI: """Returns the ABI of a contract instance.""" contract_abi = list() for entry in contract_instance.contract_type.abi: - contract_abi.append(entry.dict()) + contract_abi.append(entry.model_dump()) return contract_abi From 7b8f379f69cc116f5cbae5a4b26983eeb76c5b31 Mon Sep 17 00:00:00 2001 From: derekpierre Date: Mon, 8 Jul 2024 15:13:13 -0400 Subject: [PATCH 7/9] Fix contract registry to remove weird ABI values due to deprecated function being used to obtain ABI from ape contract type. --- deployment/artifacts/lynx.json | 362 +++++++++++---------------------- 1 file changed, 121 insertions(+), 241 deletions(-) diff --git a/deployment/artifacts/lynx.json b/deployment/artifacts/lynx.json index c8a266b9..8be2da6a 100644 --- a/deployment/artifacts/lynx.json +++ b/deployment/artifacts/lynx.json @@ -2304,68 +2304,57 @@ { "name": "_coordinator", "type": "address", - "components": null, - "internal_type": "contract Coordinator" + "internalType": "contract Coordinator" }, { "name": "_accessController", "type": "address", - "components": null, - "internal_type": "contract GlobalAllowList" + "internalType": "contract GlobalAllowList" }, { "name": "_feeToken", "type": "address", - "components": null, - "internal_type": "contract IERC20" + "internalType": "contract IERC20" }, { "name": "_adopter", "type": "address", - "components": null, - "internal_type": "address" + "internalType": "address" }, { "name": "_initialBaseFeeRate", "type": "uint256", - "components": null, - "internal_type": "uint256" + "internalType": "uint256" }, { "name": "_baseFeeRateIncrease", "type": "uint256", - "components": null, - "internal_type": "uint256" + "internalType": "uint256" }, { "name": "_encryptorFeeRate", "type": "uint256", - "components": null, - "internal_type": "uint256" + "internalType": "uint256" }, { "name": "_maxNodes", "type": "uint256", - "components": null, - "internal_type": "uint256" + "internalType": "uint256" }, { "name": "_subscriptionPeriodDuration", "type": "uint32", - "components": null, - "internal_type": "uint32" + "internalType": "uint32" }, { "name": "_yellowPeriodDuration", "type": "uint32", - "components": null, - "internal_type": "uint32" + "internalType": "uint32" }, { "name": "_redPeriodDuration", "type": "uint32", - "components": null, - "internal_type": "uint32" + "internalType": "uint32" } ] }, @@ -2376,8 +2365,7 @@ { "name": "target", "type": "address", - "components": null, - "internal_type": "address" + "internalType": "address" } ] }, @@ -2388,8 +2376,7 @@ { "name": "account", "type": "address", - "components": null, - "internal_type": "address" + "internalType": "address" } ] }, @@ -2415,8 +2402,7 @@ { "name": "owner", "type": "address", - "components": null, - "internal_type": "address" + "internalType": "address" } ] }, @@ -2427,8 +2413,7 @@ { "name": "account", "type": "address", - "components": null, - "internal_type": "address" + "internalType": "address" } ] }, @@ -2439,8 +2424,7 @@ { "name": "token", "type": "address", - "components": null, - "internal_type": "address" + "internalType": "address" } ] }, @@ -2451,29 +2435,25 @@ { "name": "sponsor", "type": "address", - "components": null, - "internal_type": "address", + "internalType": "address", "indexed": true }, { "name": "amount", "type": "uint256", - "components": null, - "internal_type": "uint256", + "internalType": "uint256", "indexed": false }, { "name": "encryptorSlots", "type": "uint128", - "components": null, - "internal_type": "uint128", + "internalType": "uint128", "indexed": false }, { "name": "endOfCurrentPeriod", "type": "uint32", - "components": null, - "internal_type": "uint32", + "internalType": "uint32", "indexed": false } ], @@ -2486,8 +2466,7 @@ { "name": "version", "type": "uint64", - "components": null, - "internal_type": "uint64", + "internalType": "uint64", "indexed": false } ], @@ -2500,15 +2479,13 @@ { "name": "previousOwner", "type": "address", - "components": null, - "internal_type": "address", + "internalType": "address", "indexed": true }, { "name": "newOwner", "type": "address", - "components": null, - "internal_type": "address", + "internalType": "address", "indexed": true } ], @@ -2521,29 +2498,25 @@ { "name": "subscriber", "type": "address", - "components": null, - "internal_type": "address", + "internalType": "address", "indexed": true }, { "name": "amount", "type": "uint256", - "components": null, - "internal_type": "uint256", + "internalType": "uint256", "indexed": false }, { "name": "encryptorSlots", "type": "uint128", - "components": null, - "internal_type": "uint128", + "internalType": "uint128", "indexed": false }, { "name": "endOfSubscription", "type": "uint32", - "components": null, - "internal_type": "uint32", + "internalType": "uint32", "indexed": false } ], @@ -2556,15 +2529,13 @@ { "name": "treasury", "type": "address", - "components": null, - "internal_type": "address", + "internalType": "address", "indexed": true }, { "name": "amount", "type": "uint256", - "components": null, - "internal_type": "uint256", + "internalType": "uint256", "indexed": false } ], @@ -2579,8 +2550,7 @@ { "name": "", "type": "uint32", - "components": null, - "internal_type": "uint32" + "internalType": "uint32" } ] }, @@ -2593,8 +2563,7 @@ { "name": "", "type": "uint256", - "components": null, - "internal_type": "uint256" + "internalType": "uint256" } ] }, @@ -2607,8 +2576,7 @@ { "name": "", "type": "address", - "components": null, - "internal_type": "contract GlobalAllowList" + "internalType": "contract GlobalAllowList" } ] }, @@ -2621,8 +2589,7 @@ { "name": "", "type": "uint32", - "components": null, - "internal_type": "uint32" + "internalType": "uint32" } ] }, @@ -2635,8 +2602,7 @@ { "name": "", "type": "address", - "components": null, - "internal_type": "address" + "internalType": "address" } ] }, @@ -2649,8 +2615,7 @@ { "name": "", "type": "uint256", - "components": null, - "internal_type": "uint256" + "internalType": "uint256" } ] }, @@ -2662,16 +2627,14 @@ { "name": "periodNumber", "type": "uint256", - "components": null, - "internal_type": "uint256" + "internalType": "uint256" } ], "outputs": [ { "name": "", "type": "uint256", - "components": null, - "internal_type": "uint256" + "internalType": "uint256" } ] }, @@ -2684,8 +2647,7 @@ { "name": "", "type": "uint256", - "components": null, - "internal_type": "uint256" + "internalType": "uint256" } ] }, @@ -2697,8 +2659,7 @@ { "name": "ritualId", "type": "uint32", - "components": null, - "internal_type": "uint32" + "internalType": "uint32" } ], "outputs": [] @@ -2711,20 +2672,17 @@ { "name": "ritualId", "type": "uint32", - "components": null, - "internal_type": "uint32" + "internalType": "uint32" }, { "name": "addresses", "type": "address[]", - "components": null, - "internal_type": "address[]" + "internalType": "address[]" }, { "name": "value", "type": "bool", - "components": null, - "internal_type": "bool" + "internalType": "bool" } ], "outputs": [] @@ -2737,22 +2695,19 @@ { "name": "periodNumber", "type": "uint256", - "components": null, - "internal_type": "uint256" + "internalType": "uint256" } ], "outputs": [ { "name": "paid", "type": "bool", - "components": null, - "internal_type": "bool" + "internalType": "bool" }, { "name": "encryptorSlots", "type": "uint128", - "components": null, - "internal_type": "uint128" + "internalType": "uint128" } ] }, @@ -2765,8 +2720,7 @@ { "name": "", "type": "address", - "components": null, - "internal_type": "contract Coordinator" + "internalType": "contract Coordinator" } ] }, @@ -2779,8 +2733,7 @@ { "name": "", "type": "uint256", - "components": null, - "internal_type": "uint256" + "internalType": "uint256" } ] }, @@ -2792,22 +2745,19 @@ { "name": "encryptorSlots", "type": "uint128", - "components": null, - "internal_type": "uint128" + "internalType": "uint128" }, { "name": "duration", "type": "uint32", - "components": null, - "internal_type": "uint32" + "internalType": "uint32" } ], "outputs": [ { "name": "", "type": "uint256", - "components": null, - "internal_type": "uint256" + "internalType": "uint256" } ] }, @@ -2820,8 +2770,7 @@ { "name": "", "type": "address", - "components": null, - "internal_type": "contract IERC20" + "internalType": "contract IERC20" } ] }, @@ -2834,8 +2783,7 @@ { "name": "", "type": "uint256", - "components": null, - "internal_type": "uint256" + "internalType": "uint256" } ] }, @@ -2848,8 +2796,7 @@ { "name": "endOfSubscription", "type": "uint32", - "components": null, - "internal_type": "uint32" + "internalType": "uint32" } ] }, @@ -2861,16 +2808,14 @@ { "name": "periodNumber", "type": "uint256", - "components": null, - "internal_type": "uint256" + "internalType": "uint256" } ], "outputs": [ { "name": "", "type": "uint256", - "components": null, - "internal_type": "uint256" + "internalType": "uint256" } ] }, @@ -2883,8 +2828,7 @@ { "name": "", "type": "uint256", - "components": null, - "internal_type": "uint256" + "internalType": "uint256" } ] }, @@ -2896,8 +2840,7 @@ { "name": "_treasury", "type": "address", - "components": null, - "internal_type": "address" + "internalType": "address" } ], "outputs": [] @@ -2910,16 +2853,14 @@ { "name": "periodNumber", "type": "uint256", - "components": null, - "internal_type": "uint256" + "internalType": "uint256" } ], "outputs": [ { "name": "", "type": "bool", - "components": null, - "internal_type": "bool" + "internalType": "bool" } ] }, @@ -2932,8 +2873,7 @@ { "name": "", "type": "uint256", - "components": null, - "internal_type": "uint256" + "internalType": "uint256" } ] }, @@ -2946,8 +2886,7 @@ { "name": "", "type": "address", - "components": null, - "internal_type": "address" + "internalType": "address" } ] }, @@ -2959,8 +2898,7 @@ { "name": "additionalEncryptorSlots", "type": "uint128", - "components": null, - "internal_type": "uint128" + "internalType": "uint128" } ], "outputs": [] @@ -2973,8 +2911,7 @@ { "name": "encryptorSlots", "type": "uint128", - "components": null, - "internal_type": "uint128" + "internalType": "uint128" } ], "outputs": [] @@ -2987,26 +2924,22 @@ { "name": "", "type": "address", - "components": null, - "internal_type": "address" + "internalType": "address" }, { "name": "ritualId", "type": "uint32", - "components": null, - "internal_type": "uint32" + "internalType": "uint32" }, { "name": "", "type": "uint256", - "components": null, - "internal_type": "uint256" + "internalType": "uint256" }, { "name": "", "type": "uint32", - "components": null, - "internal_type": "uint32" + "internalType": "uint32" } ], "outputs": [] @@ -3019,26 +2952,22 @@ { "name": "initiator", "type": "address", - "components": null, - "internal_type": "address" + "internalType": "address" }, { "name": "ritualId", "type": "uint32", - "components": null, - "internal_type": "uint32" + "internalType": "uint32" }, { "name": "numberOfProviders", "type": "uint256", - "components": null, - "internal_type": "uint256" + "internalType": "uint256" }, { "name": "duration", "type": "uint32", - "components": null, - "internal_type": "uint32" + "internalType": "uint32" } ], "outputs": [] @@ -3052,8 +2981,7 @@ { "name": "", "type": "uint32", - "components": null, - "internal_type": "uint32" + "internalType": "uint32" } ] }, @@ -3073,8 +3001,7 @@ { "name": "", "type": "uint32", - "components": null, - "internal_type": "uint32" + "internalType": "uint32" } ] }, @@ -3087,8 +3014,7 @@ { "name": "", "type": "uint32", - "components": null, - "internal_type": "uint32" + "internalType": "uint32" } ] }, @@ -3100,8 +3026,7 @@ { "name": "newOwner", "type": "address", - "components": null, - "internal_type": "address" + "internalType": "address" } ], "outputs": [] @@ -3115,8 +3040,7 @@ { "name": "", "type": "uint256", - "components": null, - "internal_type": "uint256" + "internalType": "uint256" } ] }, @@ -3128,8 +3052,7 @@ { "name": "amount", "type": "uint256", - "components": null, - "internal_type": "uint256" + "internalType": "uint256" } ], "outputs": [] @@ -3143,8 +3066,7 @@ { "name": "", "type": "uint32", - "components": null, - "internal_type": "uint32" + "internalType": "uint32" } ] } @@ -4948,8 +4870,7 @@ { "name": "owner", "type": "address", - "components": null, - "internal_type": "address" + "internalType": "address" } ] }, @@ -4960,8 +4881,7 @@ { "name": "account", "type": "address", - "components": null, - "internal_type": "address" + "internalType": "address" } ] }, @@ -4972,15 +4892,13 @@ { "name": "previousOwner", "type": "address", - "components": null, - "internal_type": "address", + "internalType": "address", "indexed": true }, { "name": "newOwner", "type": "address", - "components": null, - "internal_type": "address", + "internalType": "address", "indexed": true } ], @@ -4994,8 +4912,7 @@ { "name": "initiator", "type": "address", - "components": null, - "internal_type": "address" + "internalType": "address" } ], "outputs": [] @@ -5008,8 +4925,7 @@ { "name": "ritualId", "type": "uint32", - "components": null, - "internal_type": "uint32" + "internalType": "uint32" } ], "outputs": [] @@ -5022,20 +4938,17 @@ { "name": "ritualId", "type": "uint32", - "components": null, - "internal_type": "uint32" + "internalType": "uint32" }, { "name": "addresses", "type": "address[]", - "components": null, - "internal_type": "address[]" + "internalType": "address[]" }, { "name": "value", "type": "bool", - "components": null, - "internal_type": "bool" + "internalType": "bool" } ], "outputs": [] @@ -5048,16 +4961,14 @@ { "name": "initiator", "type": "address", - "components": null, - "internal_type": "address" + "internalType": "address" } ], "outputs": [ { "name": "approved", "type": "bool", - "components": null, - "internal_type": "bool" + "internalType": "bool" } ] }, @@ -5070,8 +4981,7 @@ { "name": "", "type": "address", - "components": null, - "internal_type": "address" + "internalType": "address" } ] }, @@ -5083,26 +4993,22 @@ { "name": "initiator", "type": "address", - "components": null, - "internal_type": "address" + "internalType": "address" }, { "name": "", "type": "uint32", - "components": null, - "internal_type": "uint32" + "internalType": "uint32" }, { "name": "", "type": "uint256", - "components": null, - "internal_type": "uint256" + "internalType": "uint256" }, { "name": "", "type": "uint32", - "components": null, - "internal_type": "uint32" + "internalType": "uint32" } ], "outputs": [] @@ -5115,26 +5021,22 @@ { "name": "initiator", "type": "address", - "components": null, - "internal_type": "address" + "internalType": "address" }, { "name": "", "type": "uint32", - "components": null, - "internal_type": "uint32" + "internalType": "uint32" }, { "name": "", "type": "uint256", - "components": null, - "internal_type": "uint256" + "internalType": "uint256" }, { "name": "", "type": "uint32", - "components": null, - "internal_type": "uint32" + "internalType": "uint32" } ], "outputs": [] @@ -5154,8 +5056,7 @@ { "name": "newOwner", "type": "address", - "components": null, - "internal_type": "address" + "internalType": "address" } ], "outputs": [] @@ -5175,8 +5076,7 @@ { "name": "_coordinator", "type": "address", - "components": null, - "internal_type": "contract Coordinator" + "internalType": "contract Coordinator" } ] }, @@ -5192,8 +5092,7 @@ { "name": "length", "type": "uint256", - "components": null, - "internal_type": "uint256" + "internalType": "uint256" } ] }, @@ -5204,8 +5103,7 @@ { "name": "s", "type": "bytes32", - "components": null, - "internal_type": "bytes32" + "internalType": "bytes32" } ] }, @@ -5216,22 +5114,19 @@ { "name": "ritualId", "type": "uint32", - "components": null, - "internal_type": "uint32", + "internalType": "uint32", "indexed": true }, { "name": "_address", "type": "address", - "components": null, - "internal_type": "address", + "internalType": "address", "indexed": true }, { "name": "isAuthorized", "type": "bool", - "components": null, - "internal_type": "bool", + "internalType": "bool", "indexed": false } ], @@ -5246,8 +5141,7 @@ { "name": "", "type": "uint32", - "components": null, - "internal_type": "uint32" + "internalType": "uint32" } ] }, @@ -5259,16 +5153,14 @@ { "name": "", "type": "uint32", - "components": null, - "internal_type": "uint32" + "internalType": "uint32" } ], "outputs": [ { "name": "", "type": "uint256", - "components": null, - "internal_type": "uint256" + "internalType": "uint256" } ] }, @@ -5280,14 +5172,12 @@ { "name": "ritualId", "type": "uint32", - "components": null, - "internal_type": "uint32" + "internalType": "uint32" }, { "name": "addresses", "type": "address[]", - "components": null, - "internal_type": "address[]" + "internalType": "address[]" } ], "outputs": [] @@ -5301,8 +5191,7 @@ { "name": "", "type": "address", - "components": null, - "internal_type": "contract Coordinator" + "internalType": "contract Coordinator" } ] }, @@ -5314,14 +5203,12 @@ { "name": "ritualId", "type": "uint32", - "components": null, - "internal_type": "uint32" + "internalType": "uint32" }, { "name": "addresses", "type": "address[]", - "components": null, - "internal_type": "address[]" + "internalType": "address[]" } ], "outputs": [] @@ -5334,22 +5221,19 @@ { "name": "ritualId", "type": "uint32", - "components": null, - "internal_type": "uint32" + "internalType": "uint32" }, { "name": "encryptor", "type": "address", - "components": null, - "internal_type": "address" + "internalType": "address" } ], "outputs": [ { "name": "", "type": "bool", - "components": null, - "internal_type": "bool" + "internalType": "bool" } ] }, @@ -5361,28 +5245,24 @@ { "name": "ritualId", "type": "uint32", - "components": null, - "internal_type": "uint32" + "internalType": "uint32" }, { "name": "evidence", "type": "bytes", - "components": null, - "internal_type": "bytes" + "internalType": "bytes" }, { "name": "ciphertextHeader", "type": "bytes", - "components": null, - "internal_type": "bytes" + "internalType": "bytes" } ], "outputs": [ { "name": "", "type": "bool", - "components": null, - "internal_type": "bool" + "internalType": "bool" } ] } @@ -6969,4 +6849,4 @@ "deployer": "0x3B42d26E19FF860bC4dEbB920DD8caA53F93c600" } } -} \ No newline at end of file +} From 1eb0cc833dea0597e749e3afeacaa40de829baf1 Mon Sep 17 00:00:00 2001 From: Manuel Montenegro Date: Tue, 9 Jul 2024 11:13:17 +0200 Subject: [PATCH 8/9] Update Coordinator ABI --- deployment/artifacts/lynx.json | 347 ++++++++++++++------------------- 1 file changed, 148 insertions(+), 199 deletions(-) diff --git a/deployment/artifacts/lynx.json b/deployment/artifacts/lynx.json index 8be2da6a..1f5d5793 100644 --- a/deployment/artifacts/lynx.json +++ b/deployment/artifacts/lynx.json @@ -3086,16 +3086,6 @@ "name": "_application", "type": "address", "internalType": "contract ITACoChildApplication" - }, - { - "name": "_currency", - "type": "address", - "internalType": "contract IERC20" - }, - { - "name": "_feeRatePerSecond", - "type": "uint256", - "internalType": "uint256" } ] }, @@ -3147,33 +3137,6 @@ } ] }, - { - "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": "InvalidInitialization", @@ -3200,17 +3163,6 @@ } ] }, - { - "type": "error", - "name": "SafeERC20FailedOperation", - "inputs": [ - { - "name": "token", - "type": "address", - "internalType": "address" - } - ] - }, { "type": "event", "name": "AggregationPosted", @@ -3305,6 +3257,19 @@ ], "anonymous": false }, + { + "type": "event", + "name": "FeeModelApproved", + "inputs": [ + { + "name": "feeModel", + "type": "address", + "internalType": "contract IFeeModel", + "indexed": false + } + ], + "anonymous": false + }, { "type": "event", "name": "Initialized", @@ -3417,6 +3382,25 @@ ], "anonymous": false }, + { + "type": "event", + "name": "RitualExtended", + "inputs": [ + { + "name": "ritualId", + "type": "uint32", + "internalType": "uint32", + "indexed": true + }, + { + "name": "endTimestamp", + "type": "uint32", + "internalType": "uint32", + "indexed": false + } + ], + "anonymous": false + }, { "type": "event", "name": "RoleAdminChanged", @@ -3587,19 +3571,6 @@ } ] }, - { - "type": "function", - "name": "INITIATOR_ROLE", - "stateMutability": "view", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "bytes32" - } - ] - }, { "type": "function", "name": "TREASURY_ROLE", @@ -3633,6 +3604,19 @@ } ] }, + { + "type": "function", + "name": "approveFeeModel", + "stateMutability": "nonpayable", + "inputs": [ + { + "name": "feeModel", + "type": "address", + "internalType": "contract IFeeModel" + } + ], + "outputs": [] + }, { "type": "function", "name": "beginDefaultAdminTransfer", @@ -3687,33 +3671,33 @@ }, { "type": "function", - "name": "currency", + "name": "defaultAdmin", "stateMutability": "view", "inputs": [], "outputs": [ { "name": "", "type": "address", - "internalType": "contract IERC20" + "internalType": "address" } ] }, { "type": "function", - "name": "defaultAdmin", + "name": "defaultAdminDelay", "stateMutability": "view", "inputs": [], "outputs": [ { "name": "", - "type": "address", - "internalType": "address" + "type": "uint48", + "internalType": "uint48" } ] }, { "type": "function", - "name": "defaultAdminDelay", + "name": "defaultAdminDelayIncreaseWait", "stateMutability": "view", "inputs": [], "outputs": [ @@ -3726,57 +3710,101 @@ }, { "type": "function", - "name": "defaultAdminDelayIncreaseWait", + "name": "extendRitual", + "stateMutability": "nonpayable", + "inputs": [ + { + "name": "ritualId", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "duration", + "type": "uint32", + "internalType": "uint32" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "feeModelsRegistry", "stateMutability": "view", - "inputs": [], + "inputs": [ + { + "name": "", + "type": "address", + "internalType": "contract IFeeModel" + } + ], "outputs": [ { "name": "", - "type": "uint48", - "internalType": "uint48" + "type": "bool", + "internalType": "bool" } ] }, { "type": "function", - "name": "feeDeduction", - "stateMutability": "pure", + "name": "getAccessController", + "stateMutability": "view", "inputs": [ { - "name": "", - "type": "uint256", - "internalType": "uint256" - }, + "name": "ritualId", + "type": "uint32", + "internalType": "uint32" + } + ], + "outputs": [ { "name": "", - "type": "uint256", - "internalType": "uint256" + "type": "address", + "internalType": "contract IEncryptionAuthorizer" + } + ] + }, + { + "type": "function", + "name": "getAuthority", + "stateMutability": "view", + "inputs": [ + { + "name": "ritualId", + "type": "uint32", + "internalType": "uint32" } ], "outputs": [ { "name": "", - "type": "uint256", - "internalType": "uint256" + "type": "address", + "internalType": "address" } ] }, { "type": "function", - "name": "feeRatePerSecond", + "name": "getFeeModel", "stateMutability": "view", - "inputs": [], + "inputs": [ + { + "name": "ritualId", + "type": "uint32", + "internalType": "uint32" + } + ], "outputs": [ { "name": "", - "type": "uint256", - "internalType": "uint256" + "type": "address", + "internalType": "contract IFeeModel" } ] }, { "type": "function", - "name": "getAuthority", + "name": "getInitiator", "stateMutability": "view", "inputs": [ { @@ -4109,30 +4137,6 @@ } ] }, - { - "type": "function", - "name": "getRitualInitiationCost", - "stateMutability": "view", - "inputs": [ - { - "name": "providers", - "type": "address[]", - "internalType": "address[]" - }, - { - "name": "duration", - "type": "uint32", - "internalType": "uint32" - } - ], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ] - }, { "type": "function", "name": "getRitualState", @@ -4190,6 +4194,30 @@ } ] }, + { + "type": "function", + "name": "getTimestamps", + "stateMutability": "view", + "inputs": [ + { + "name": "ritualId", + "type": "uint32", + "internalType": "uint32" + } + ], + "outputs": [ + { + "name": "initTimestamp", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "endTimestamp", + "type": "uint32", + "internalType": "uint32" + } + ] + }, { "type": "function", "name": "grantRole", @@ -4260,6 +4288,11 @@ "name": "initiateRitual", "stateMutability": "nonpayable", "inputs": [ + { + "name": "feeModel", + "type": "address", + "internalType": "contract IFeeModel" + }, { "name": "providers", "type": "address[]", @@ -4318,19 +4351,6 @@ } ] }, - { - "type": "function", - "name": "isInitiationPublic", - "stateMutability": "view", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "bool", - "internalType": "bool" - } - ] - }, { "type": "function", "name": "isParticipant", @@ -4393,13 +4413,6 @@ } ] }, - { - "type": "function", - "name": "makeInitiationPublic", - "stateMutability": "nonpayable", - "inputs": [], - "outputs": [] - }, { "type": "function", "name": "maxDkgSize", @@ -4475,25 +4488,6 @@ } ] }, - { - "type": "function", - "name": "pendingFees", - "stateMutability": "view", - "inputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ] - }, { "type": "function", "name": "postAggregation", @@ -4552,25 +4546,6 @@ ], "outputs": [] }, - { - "type": "function", - "name": "processPendingFee", - "stateMutability": "nonpayable", - "inputs": [ - { - "name": "ritualId", - "type": "uint32", - "internalType": "uint32" - } - ], - "outputs": [ - { - "name": "refundableFee", - "type": "uint256", - "internalType": "uint256" - } - ] - }, { "type": "function", "name": "renounceRole", @@ -4690,6 +4665,11 @@ "name": "aggregatedTranscript", "type": "bytes", "internalType": "bytes" + }, + { + "name": "feeModel", + "type": "address", + "internalType": "contract IFeeModel" } ] }, @@ -4801,19 +4781,6 @@ } ] }, - { - "type": "function", - "name": "totalPendingFees", - "stateMutability": "view", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ] - }, { "type": "function", "name": "transferRitualAuthority", @@ -4831,24 +4798,6 @@ } ], "outputs": [] - }, - { - "type": "function", - "name": "withdrawTokens", - "stateMutability": "nonpayable", - "inputs": [ - { - "name": "token", - "type": "address", - "internalType": "contract IERC20" - }, - { - "name": "amount", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [] } ], "tx_hash": "0x4207f1fd038945ef7d5da06a0989446d3ed2eb031adad1233c7e3a61951652a1", From d0a809ebfdee16b1cac790885b1ec269a93e486b Mon Sep 17 00:00:00 2001 From: Manuel Montenegro Date: Tue, 9 Jul 2024 16:53:14 +0200 Subject: [PATCH 9/9] Rename coordinator approves BqETH fee model script --- ...pprove_fee_model.py => coordinator_approve_bqeth_fee_model.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename scripts/lynx/{coordinator_approve_fee_model.py => coordinator_approve_bqeth_fee_model.py} (100%) diff --git a/scripts/lynx/coordinator_approve_fee_model.py b/scripts/lynx/coordinator_approve_bqeth_fee_model.py similarity index 100% rename from scripts/lynx/coordinator_approve_fee_model.py rename to scripts/lynx/coordinator_approve_bqeth_fee_model.py