From c9cf454616ce1ac40fb381e1b54aa2cb3c8bb5a3 Mon Sep 17 00:00:00 2001 From: otsalex Date: Tue, 12 Nov 2024 13:07:04 +0200 Subject: [PATCH] Update IRegistrar and SharePriceOracle to work with Chainlink Automation v2.3 --- src/base/ERC4626SharePriceOracle.sol | 11 ++++++----- src/interfaces/external/Chainlink/IRegistrar.sol | 11 ++++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/base/ERC4626SharePriceOracle.sol b/src/base/ERC4626SharePriceOracle.sol index 4c98835b2..b14b5fc84 100644 --- a/src/base/ERC4626SharePriceOracle.sol +++ b/src/base/ERC4626SharePriceOracle.sol @@ -297,16 +297,17 @@ contract ERC4626SharePriceOracle is AutomationCompatibleInterface { IRegistrar registrar = IRegistrar(automationRegistrar); IRegistry registry = IRegistry(automationRegistry); IRegistrar.RegistrationParams memory params = IRegistrar.RegistrationParams({ - name: string.concat(target.name(), " Share Price Oracle"), - encryptedEmail: hex"", upkeepContract: address(this), - gasLimit: UPKEEP_GAS_LIMIT, + amount: initialUpkeepFunds, adminAddress: automationAdmin, + gasLimit: UPKEEP_GAS_LIMIT, triggerType: 0, + billingToken: address(link), + name: string.concat(target.name(), " Share Price Oracle"), + encryptedEmail: hex"", checkData: hex"", triggerConfig: hex"", - offchainConfig: hex"", - amount: initialUpkeepFunds + offchainConfig: hex"" }); link.safeApprove(automationRegistrar, initialUpkeepFunds); diff --git a/src/interfaces/external/Chainlink/IRegistrar.sol b/src/interfaces/external/Chainlink/IRegistrar.sol index cb42b4727..58811d7a4 100644 --- a/src/interfaces/external/Chainlink/IRegistrar.sol +++ b/src/interfaces/external/Chainlink/IRegistrar.sol @@ -3,16 +3,17 @@ pragma solidity 0.8.21; interface IRegistrar { struct RegistrationParams { - string name; - bytes encryptedEmail; address upkeepContract; - uint32 gasLimit; + uint96 amount; address adminAddress; + uint32 gasLimit; uint8 triggerType; + address billingToken; + string name; + bytes encryptedEmail; bytes checkData; bytes triggerConfig; bytes offchainConfig; - uint96 amount; } enum AutoApproveType { @@ -21,7 +22,7 @@ interface IRegistrar { ENABLED_ALL } - function registerUpkeep(RegistrationParams calldata requestParams) external returns (uint256 id); + function registerUpkeep(RegistrationParams calldata requestParams) external payable returns (uint256 id); function setTriggerConfig( uint8 triggerType,