Skip to content

Commit

Permalink
Added Base Sepolia to ChainUtils (#13216)
Browse files Browse the repository at this point in the history
* Added Base Sepolia to ChainUtils

* Added tags to changeset files
  • Loading branch information
ibrajer authored May 20, 2024
1 parent 5374a57 commit 6099abb
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 16 deletions.
5 changes: 5 additions & 0 deletions .changeset/giant-islands-think.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

Added Base Sepolia to ChainUtils #changed
5 changes: 5 additions & 0 deletions contracts/.changeset/smart-rules-love.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@chainlink/contracts": patch
---

Added Base Sepolia to ChainUtils #changed
6 changes: 4 additions & 2 deletions contracts/src/v0.8/ChainSpecificUtil.sol
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ library ChainSpecificUtil {
/// @dev Base is a OP stack based rollup and follows the same L1 pricing logic as Optimism.
uint256 private constant BASE_MAINNET_CHAIN_ID = 8453;
uint256 private constant BASE_GOERLI_CHAIN_ID = 84531;
uint256 private constant BASE_SEPOLIA_CHAIN_ID = 84532;

// ------------ End Optimism Constants ------------

Expand Down Expand Up @@ -125,15 +126,16 @@ library ChainSpecificUtil {

/**
* @notice Return true if and only if the provided chain ID is an Optimism chain ID.
* @notice Note that optimism chain id's are also OP stack chain id's.
* @notice Note that optimism chain id's are also OP stack chain id's (e.g. Base).
*/
function _isOptimismChainId(uint256 chainId) internal pure returns (bool) {
return
chainId == OP_MAINNET_CHAIN_ID ||
chainId == OP_GOERLI_CHAIN_ID ||
chainId == OP_SEPOLIA_CHAIN_ID ||
chainId == BASE_MAINNET_CHAIN_ID ||
chainId == BASE_GOERLI_CHAIN_ID;
chainId == BASE_GOERLI_CHAIN_ID ||
chainId == BASE_SEPOLIA_CHAIN_ID;
}

function _calculateOptimismL1DataFee(uint256 calldataSizeBytes) internal view returns (uint256) {
Expand Down
6 changes: 4 additions & 2 deletions contracts/src/v0.8/ChainSpecificUtil_v0_8_6.sol
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ library ChainSpecificUtil {
/// @dev Base is a OP stack based rollup and follows the same L1 pricing logic as Optimism.
uint256 private constant BASE_MAINNET_CHAIN_ID = 8453;
uint256 private constant BASE_GOERLI_CHAIN_ID = 84531;
uint256 private constant BASE_SEPOLIA_CHAIN_ID = 84532;

// ------------ End Optimism Constants ------------

Expand Down Expand Up @@ -125,15 +126,16 @@ library ChainSpecificUtil {

/**
* @notice Return true if and only if the provided chain ID is an Optimism chain ID.
* @notice Note that optimism chain id's are also OP stack chain id's.
* @notice Note that optimism chain id's are also OP stack chain id's (e.g. Base).
*/
function _isOptimismChainId(uint256 chainId) internal pure returns (bool) {
return
chainId == OP_MAINNET_CHAIN_ID ||
chainId == OP_GOERLI_CHAIN_ID ||
chainId == OP_SEPOLIA_CHAIN_ID ||
chainId == BASE_MAINNET_CHAIN_ID ||
chainId == BASE_GOERLI_CHAIN_ID;
chainId == BASE_GOERLI_CHAIN_ID ||
chainId == BASE_SEPOLIA_CHAIN_ID;
}

function _calculateOptimismL1DataFee(uint256 calldataSizeBytes) internal view returns (uint256) {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading

0 comments on commit 6099abb

Please sign in to comment.