-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(protocol): allow tier configuration based on block numbers. (#17399
) Co-authored-by: Brecht Devos <[email protected]>
- Loading branch information
Showing
15 changed files
with
69 additions
and
64 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
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
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
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
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 |
---|---|---|
|
@@ -4,7 +4,6 @@ pragma solidity 0.8.24; | |
import "./TierProviderBase.sol"; | ||
|
||
/// @title DevnetTierProvider | ||
/// @dev Labeled in AddressResolver as "tier_provider" | ||
/// @custom:security-contact [email protected] | ||
contract DevnetTierProvider is TierProviderBase { | ||
/// @inheritdoc ITierProvider | ||
|
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
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,12 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.24; | ||
|
||
/// @title ITierRouter | ||
/// @notice Defines interface to return an ITierProvider | ||
/// @custom:security-contact [email protected] | ||
interface ITierRouter { | ||
/// @dev Returns the address of the TierProvider for a given block. | ||
/// @param blockId ID of the block. | ||
/// @return The address of the corresponding TierProvider. | ||
function getProvider(uint256 blockId) external view returns (address); | ||
} |
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 |
---|---|---|
|
@@ -4,7 +4,6 @@ pragma solidity 0.8.24; | |
import "./TierProviderBase.sol"; | ||
|
||
/// @title TierProviderV2 | ||
/// @dev Labeled in AddressResolver as "tier_provider" | ||
/// @custom:security-contact [email protected] | ||
contract TierProviderV2 is TierProviderBase { | ||
/// @inheritdoc ITierProvider | ||
|
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 |
---|---|---|
|
@@ -4,7 +4,6 @@ pragma solidity 0.8.24; | |
import "./TierProviderBase.sol"; | ||
|
||
/// @title TierProviderV3 | ||
/// @dev Labeled in AddressResolver as "tier_provider" | ||
/// @custom:security-contact [email protected] | ||
contract TierProviderV3 is TierProviderBase { | ||
/// @inheritdoc ITierProvider | ||
|
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,14 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.24; | ||
|
||
import "./ITierRouter.sol"; | ||
|
||
/// @title TierRouter | ||
/// @dev Labeled in AddressResolver as "tier_router" | ||
/// @custom:security-contact [email protected] | ||
contract TierRouter is ITierRouter { | ||
/// @inheritdoc ITierRouter | ||
function getProvider(uint256 /*_blockId*/ ) external pure returns (address) { | ||
return 0x4cffe56C947E26D07C14020499776DB3e9AE3a23; | ||
} | ||
} |
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
This file was deleted.
Oops, something went wrong.
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
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
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 |
---|---|---|
|
@@ -3,14 +3,20 @@ pragma solidity 0.8.24; | |
|
||
import "../../contracts/common/LibStrings.sol"; | ||
import "../../contracts/L1/tiers/ITierProvider.sol"; | ||
import "../../contracts/L1/tiers/ITierRouter.sol"; | ||
|
||
/// @title TestTierProvider | ||
/// @dev Labeled in AddressResolver as "tier_provider" | ||
/// @dev Labeled in AddressResolver as "tier_router" | ||
/// @custom:security-contact [email protected] | ||
contract TestTierProvider is ITierProvider { | ||
contract TestTierProvider is ITierProvider, ITierRouter { | ||
uint256[50] private __gap; | ||
|
||
/// @inheritdoc ITierRouter | ||
function getProvider(uint256) external view returns (address) { | ||
return address(this); | ||
} | ||
/// @inheritdoc ITierProvider | ||
|
||
function getTier(uint16 _tierId) public pure override returns (ITierProvider.Tier memory) { | ||
if (_tierId == LibTiers.TIER_OPTIMISTIC) { | ||
return ITierProvider.Tier({ | ||
|