Skip to content

Commit

Permalink
Add more comments
Browse files Browse the repository at this point in the history
  • Loading branch information
matYang committed Oct 18, 2023
1 parent 0fc8932 commit 34f74a2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion contracts/src/v0.8/ccip/ARM.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {IARM} from "./interfaces/IARM.sol";

import {OwnerIsCreator} from "./../shared/access/OwnerIsCreator.sol";

/// @dev This contract is owned by RMN, if changes required, please notify RMN.
/// @dev This contract is owned by RMN, if changing, please notify RMN.
contract ARM is IARM, OwnerIsCreator, ITypeAndVersion {
// STATIC CONFIG
// solhint-disable-next-line chainlink-solidity/all-caps-constant-storage-variables
Expand Down
1 change: 1 addition & 0 deletions contracts/src/v0.8/ccip/CommitStore.sol
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ contract CommitStore is ICommitStore, ITypeAndVersion, OCR2Base {
}

/// @notice a sequenceNumber interval
/// @dev RMN depends on this struct, if changing, please notify RMN.
struct Interval {
uint64 min; // ───╮ Minimum sequence number, inclusive
uint64 max; // ───╯ Maximum sequence number, inclusive
Expand Down
1 change: 1 addition & 0 deletions contracts/src/v0.8/ccip/libraries/Client.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ pragma solidity ^0.8.0;

// End consumer library.
library Client {
/// @dev RMN depends on this struct, if changing, please notify RMN.
struct EVMTokenAmount {
address token; // token address on the local chain.
uint256 amount; // Amount of tokens.
Expand Down
9 changes: 8 additions & 1 deletion contracts/src/v0.8/ccip/libraries/Internal.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,36 @@ library Internal {
// repeated out-of-gas scenarios.
uint16 internal constant MAX_RET_BYTES = 4 + 4 * 32;

/// @notice A collection of token price and gas price updates.
/// @dev RMN depends on this struct, if changing, please notify RMN.
struct PriceUpdates {
TokenPriceUpdate[] tokenPriceUpdates;
GasPriceUpdate[] gasPriceUpdates;
}

/// @notice Token price in USD.
/// @dev RMN depends on this struct, if changing, please notify RMN.
struct TokenPriceUpdate {
address sourceToken; // Source token
uint224 usdPerToken; // 1e18 USD per smallest unit of token
}

/// @notice Gas price for a given chain in USD, its value may contain tightly packed fields.
/// @dev RMN depends on this struct, if changing, please notify RMN.
struct GasPriceUpdate {
uint64 destChainSelector; // Destination chain selector
uint224 usdPerUnitGas; // 1e18 USD per smallest unit (e.g. wei) of destination chain gas
}

/// @notice A timestamped uint224 value that can contain several tightly packed fields.
struct TimestampedPackedUint224 {
uint224 value; // ───────╮ Value in uint224, packed.
uint32 timestamp; // ────╯ Timestamp of the most recent price update.
}

/// @dev Gas price is stored in 112-bit unsigned int. uint224 can pack 2 prices.
/// When packing L1 and L2 gas prices, L1 gas price is left-shifted to the higher-order bits.
/// Using uint8, which is strictly lower than 1st shift operand, to avoid shift operand type warning.
/// Using uint8 type, which cannot be higher than other bit shift operands, to avoid shift operand type warning.
uint8 public constant GAS_PRICE_BITS = 112;

struct PoolUpdate {
Expand Down

0 comments on commit 34f74a2

Please sign in to comment.