Skip to content

Commit

Permalink
Update IRegistrar and SharePriceOracle to work with Chainlink Automat…
Browse files Browse the repository at this point in the history
…ion v2.3
  • Loading branch information
otsalex committed Nov 12, 2024
1 parent 66e9d39 commit c9cf454
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
11 changes: 6 additions & 5 deletions src/base/ERC4626SharePriceOracle.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
11 changes: 6 additions & 5 deletions src/interfaces/external/Chainlink/IRegistrar.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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,
Expand Down

0 comments on commit c9cf454

Please sign in to comment.