-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WIP] Auto 9112 convert registry / registrar to use billing token (#1…
…2418) * refactor registrar to support billing tokens on registration * fix registry tests * add tests for billing token on registration path * make registrar check for valid billing tokens * use billing token in calculatePaymentAmount() * regenerate master interface * change UnsupportedBillingToken to InvalidBillingToken * update foundry tests * refactor foundry tests * use billing token agnostic reserve amounts * add getReserveAmount() * update registrar to support min amounts per billing token * update comments * remove billing params from OnChainConfig * use safeCast to uint96 for balances * make min spend configurable per billing token * use billing token for funding in registrar * change premiumWei to premium * regenerate master interface after rebase * regenerate wrappers * add changeset * run lint fix
- Loading branch information
Showing
18 changed files
with
1,889 additions
and
1,265 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@chainlink/contracts": minor | ||
--- | ||
|
||
introduce native billing support to automation registry v2.3 |
60 changes: 43 additions & 17 deletions
60
contracts/src/v0.8/automation/dev/interfaces/v2_3/IAutomationRegistryMaster2_3.sol
Large diffs are not rendered by default.
Oops, something went wrong.
42 changes: 42 additions & 0 deletions
42
contracts/src/v0.8/automation/dev/test/AutomationRegistrar2_3.t.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// SPDX-License-Identifier: BUSL-1.1 | ||
pragma solidity 0.8.19; | ||
|
||
import {BaseTest} from "./BaseTest.t.sol"; | ||
import {IAutomationRegistryMaster2_3} from "../interfaces/v2_3/IAutomationRegistryMaster2_3.sol"; | ||
import {AutomationRegistrar2_3} from "../v2_3/AutomationRegistrar2_3.sol"; | ||
import {IERC20} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; | ||
|
||
// forge test --match-path src/v0.8/automation/dev/test/AutomationRegistrar2_3.t.sol | ||
|
||
contract SetUp is BaseTest { | ||
IAutomationRegistryMaster2_3 internal registry; | ||
AutomationRegistrar2_3 internal registrar; | ||
|
||
function setUp() public override { | ||
super.setUp(); | ||
registry = deployRegistry(); | ||
AutomationRegistrar2_3.InitialTriggerConfig[] | ||
memory triggerConfigs = new AutomationRegistrar2_3.InitialTriggerConfig[](2); | ||
triggerConfigs[0] = AutomationRegistrar2_3.InitialTriggerConfig({ | ||
triggerType: 0, // condition | ||
autoApproveType: AutomationRegistrar2_3.AutoApproveType.DISABLED, | ||
autoApproveMaxAllowed: 0 | ||
}); | ||
triggerConfigs[1] = AutomationRegistrar2_3.InitialTriggerConfig({ | ||
triggerType: 1, // log | ||
autoApproveType: AutomationRegistrar2_3.AutoApproveType.DISABLED, | ||
autoApproveMaxAllowed: 0 | ||
}); | ||
IERC20[] memory billingTokens; | ||
uint256[] memory minRegistrationFees; | ||
registrar = new AutomationRegistrar2_3( | ||
address(linkToken), | ||
registry, | ||
triggerConfigs, | ||
billingTokens, | ||
minRegistrationFees | ||
); | ||
} | ||
} | ||
|
||
contract OnTokenTransfer is SetUp {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.