Skip to content

Commit c5d4be6

Browse files
authoredNov 13, 2024··
refactor: bold interfaces (#262)
* refactor: bold interfaces * 3.0.0-alpha.1 * fix: missing interface methods * fix: use interface when possible * fix: format * 3.0.0-alpha.2 * chore: update slither db * fix: allowlist npm audit issue
1 parent 951326d commit c5d4be6

18 files changed

+440
-410
lines changed
 

‎audit-ci.jsonc

+7-1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@
6767
// Regular Expression Denial of Service (ReDoS) in micromatch
6868
"GHSA-952p-6rrq-rcjv",
6969
// cookie accepts cookie name, path, and domain with out of bounds characters
70-
"GHSA-pxg6-pf52-xh8x"
70+
"GHSA-pxg6-pf52-xh8x",
71+
// Elliptic's verify function omits uniqueness validation
72+
"GHSA-434g-2637-qmqr",
73+
// Valid ECDSA signatures erroneously rejected in Elliptic
74+
"GHSA-fc9h-whq2-v747",
75+
// secp256k1-node allows private key extraction over ECDH
76+
"GHSA-584q-6j8j-r5pm"
7177
]
7278
}

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@arbitrum/nitro-contracts",
3-
"version": "3.0.0-alpha.0",
3+
"version": "3.0.0-alpha.2",
44
"description": "Layer 2 precompiles and rollup for Arbitrum Nitro",
55
"author": "Offchain Labs, Inc.",
66
"license": "BUSL-1.1",

‎slither.db.json

+1-1
Large diffs are not rendered by default.

‎src/assertionStakingPool/EdgeStakingPool.sol

+3-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ pragma solidity ^0.8.0;
66

77
import "./AbsBoldStakingPool.sol";
88
import "./interfaces/IEdgeStakingPool.sol";
9-
import "../challengeV2/EdgeChallengeManager.sol";
109

1110
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
1211
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
@@ -35,7 +34,7 @@ contract EdgeStakingPool is AbsBoldStakingPool, IEdgeStakingPool {
3534
constructor(
3635
address _challengeManager,
3736
bytes32 _edgeId
38-
) AbsBoldStakingPool(address(EdgeChallengeManager(_challengeManager).stakeToken())) {
37+
) AbsBoldStakingPool(address(IEdgeChallengeManager(_challengeManager).stakeToken())) {
3938
if (_edgeId == bytes32(0)) {
4039
revert EmptyEdgeId();
4140
}
@@ -47,9 +46,9 @@ contract EdgeStakingPool is AbsBoldStakingPool, IEdgeStakingPool {
4746
function createEdge(
4847
CreateEdgeArgs calldata args
4948
) external {
50-
uint256 requiredStake = EdgeChallengeManager(challengeManager).stakeAmounts(args.level);
49+
uint256 requiredStake = IEdgeChallengeManager(challengeManager).stakeAmounts(args.level);
5150
IERC20(stakeToken).safeIncreaseAllowance(address(challengeManager), requiredStake);
52-
bytes32 newEdgeId = EdgeChallengeManager(challengeManager).createLayerZeroEdge(args);
51+
bytes32 newEdgeId = IEdgeChallengeManager(challengeManager).createLayerZeroEdge(args);
5352
if (newEdgeId != edgeId) {
5453
revert IncorrectEdgeId(newEdgeId, edgeId);
5554
}

‎src/assertionStakingPool/interfaces/IEdgeStakingPool.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
pragma solidity ^0.8.0;
66

7-
import "../../challengeV2/EdgeChallengeManager.sol";
7+
import "../../challengeV2/IEdgeChallengeManager.sol";
88
import "./IAbsBoldStakingPool.sol";
99

1010
interface IEdgeStakingPool is IAbsBoldStakingPool {

‎src/challengeV2/EdgeChallengeManager.sol

+1-225
Original file line numberDiff line numberDiff line change
@@ -6,238 +6,14 @@ pragma solidity ^0.8.17;
66

77
import "../rollup/Assertion.sol";
88
import "./libraries/UintUtilsLib.sol";
9-
import "./IAssertionChain.sol";
9+
import "./IEdgeChallengeManager.sol";
1010
import "./libraries/EdgeChallengeManagerLib.sol";
1111
import "../libraries/Constants.sol";
1212
import "../state/Machine.sol";
1313

1414
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
1515
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
1616

17-
/// @title EdgeChallengeManager interface
18-
interface IEdgeChallengeManager {
19-
/// @notice Initialize the EdgeChallengeManager. EdgeChallengeManagers are upgradeable
20-
/// so use the initializer paradigm
21-
/// @param _assertionChain The assertion chain contract
22-
/// @param _challengePeriodBlocks The amount of cumulative time an edge must spend unrivaled before it can be confirmed
23-
/// This should be the censorship period + the cumulative amount of time needed to do any
24-
/// offchain calculation. We currently estimate around 10 mins for each layer zero edge and 1
25-
/// one minute for each other edge.
26-
/// @param _oneStepProofEntry The one step proof logic
27-
/// @param layerZeroBlockEdgeHeight The end height of layer zero edges of type Block
28-
/// @param layerZeroBigStepEdgeHeight The end height of layer zero edges of type BigStep
29-
/// @param layerZeroSmallStepEdgeHeight The end height of layer zero edges of type SmallStep
30-
/// @param _stakeToken The token that stake will be provided in when creating zero layer block edges
31-
/// @param _excessStakeReceiver The address that excess stake will be sent to when 2nd+ block edge is created
32-
/// @param _numBigStepLevel The number of bigstep levels
33-
/// @param _stakeAmounts The stake amount for each level. (first element is for block level)
34-
function initialize(
35-
IAssertionChain _assertionChain,
36-
uint64 _challengePeriodBlocks,
37-
IOneStepProofEntry _oneStepProofEntry,
38-
uint256 layerZeroBlockEdgeHeight,
39-
uint256 layerZeroBigStepEdgeHeight,
40-
uint256 layerZeroSmallStepEdgeHeight,
41-
IERC20 _stakeToken,
42-
address _excessStakeReceiver,
43-
uint8 _numBigStepLevel,
44-
uint256[] calldata _stakeAmounts
45-
) external;
46-
47-
function challengePeriodBlocks() external view returns (uint64);
48-
49-
/// @notice The one step proof resolver used to decide between rival SmallStep edges of length 1
50-
function oneStepProofEntry() external view returns (IOneStepProofEntry);
51-
52-
/// @notice Performs necessary checks and creates a new layer zero edge
53-
/// @param args Edge creation args
54-
function createLayerZeroEdge(
55-
CreateEdgeArgs calldata args
56-
) external returns (bytes32);
57-
58-
/// @notice Bisect an edge. This creates two child edges:
59-
/// lowerChild: has the same start root and height as this edge, but a different end root and height
60-
/// upperChild: has the same end root and height as this edge, but a different start root and height
61-
/// The lower child end root and height are equal to the upper child start root and height. This height
62-
/// is the mandatoryBisectionHeight.
63-
/// The lower child may already exist, however it's not possible for the upper child to exist as that would
64-
/// mean that the edge has already been bisected
65-
/// @param edgeId Edge to bisect
66-
/// @param bisectionHistoryRoot The new history root to be used in the lower and upper children
67-
/// @param prefixProof A proof to show that the bisectionHistoryRoot commits to a prefix of the current endHistoryRoot
68-
/// @return lowerChildId The id of the newly created lower child edge
69-
/// @return upperChildId The id of the newly created upper child edge
70-
function bisectEdge(
71-
bytes32 edgeId,
72-
bytes32 bisectionHistoryRoot,
73-
bytes calldata prefixProof
74-
) external returns (bytes32, bytes32);
75-
76-
/// @notice An edge can be confirmed if the total amount of time it and a single chain of its direct ancestors
77-
/// has spent unrivaled is greater than the challenge period.
78-
/// @dev Edges inherit time from their parents, so the sum of unrivaled timers is compared against the threshold.
79-
/// Given that an edge cannot become unrivaled after becoming rivaled, once the threshold is passed
80-
/// it will always remain passed. The direct ancestors of an edge are linked by parent-child links for edges
81-
/// of the same level, and claimId-edgeId links for zero layer edges that claim an edge in the level below.
82-
/// This method also includes the amount of time the assertion being claimed spent without a sibling
83-
/// @param edgeId The id of the edge to confirm
84-
function confirmEdgeByTime(
85-
bytes32 edgeId,
86-
AssertionStateData calldata claimStateData
87-
) external;
88-
89-
/// @notice Update multiple edges' timer cache by their children. Equivalent to calling updateTimerCacheByChildren for each edge.
90-
/// May update timer cache above maximum if the last edge's timer cache was below maximumCachedTime.
91-
/// Revert when the last edge's timer cache is already equal to or above maximumCachedTime.
92-
/// @param edgeIds The ids of the edges to update
93-
/// @param maximumCachedTime The maximum amount of cached time allowed on the last edge (β∗)
94-
function multiUpdateTimeCacheByChildren(
95-
bytes32[] calldata edgeIds,
96-
uint256 maximumCachedTime
97-
) external;
98-
99-
/// @notice Update an edge's timer cache by its children.
100-
/// Sets the edge's timer cache to its timeUnrivaled + (minimum timer cache of its children).
101-
/// May update timer cache above maximum if the last edge's timer cache was below maximumCachedTime.
102-
/// Revert when the edge's timer cache is already equal to or above maximumCachedTime.
103-
/// @param edgeId The id of the edge to update
104-
/// @param maximumCachedTime The maximum amount of cached time allowed on the edge (β∗)
105-
function updateTimerCacheByChildren(bytes32 edgeId, uint256 maximumCachedTime) external;
106-
107-
/// @notice Given a one step fork edge and an edge with matching claim id,
108-
/// set the one step fork edge's timer cache to its timeUnrivaled + claiming edge's timer cache.
109-
/// May update timer cache above maximum if the last edge's timer cache was below maximumCachedTime.
110-
/// Revert when the edge's timer cache is already equal to or above maximumCachedTime.
111-
/// @param edgeId The id of the edge to update
112-
/// @param claimingEdgeId The id of the edge which has a claimId equal to edgeId
113-
/// @param maximumCachedTime The maximum amount of cached time allowed on the edge (β∗)
114-
function updateTimerCacheByClaim(
115-
bytes32 edgeId,
116-
bytes32 claimingEdgeId,
117-
uint256 maximumCachedTime
118-
) external;
119-
120-
/// @notice Confirm an edge by executing a one step proof
121-
/// @dev One step proofs can only be executed against edges that have length one and of type SmallStep
122-
/// @param edgeId The id of the edge to confirm
123-
/// @param oneStepData Input data to the one step proof
124-
/// @param prevConfig Data about the config set in prev
125-
/// @param beforeHistoryInclusionProof Proof that the state which is the start of the edge is committed to by the startHistoryRoot
126-
/// @param afterHistoryInclusionProof Proof that the state which is the end of the edge is committed to by the endHistoryRoot
127-
function confirmEdgeByOneStepProof(
128-
bytes32 edgeId,
129-
OneStepData calldata oneStepData,
130-
ConfigData calldata prevConfig,
131-
bytes32[] calldata beforeHistoryInclusionProof,
132-
bytes32[] calldata afterHistoryInclusionProof
133-
) external;
134-
135-
/// @notice When zero layer block edges are created a stake is also provided
136-
/// The stake on this edge can be refunded if the edge is confirme
137-
function refundStake(
138-
bytes32 edgeId
139-
) external;
140-
141-
/// @notice Zero layer edges have to be a fixed height.
142-
/// This function returns the end height for a given edge type
143-
function getLayerZeroEndHeight(
144-
EdgeType eType
145-
) external view returns (uint256);
146-
147-
/// @notice Calculate the unique id of an edge
148-
/// @param level The level of the edge
149-
/// @param originId The origin id of the edge
150-
/// @param startHeight The start height of the edge
151-
/// @param startHistoryRoot The start history root of the edge
152-
/// @param endHeight The end height of the edge
153-
/// @param endHistoryRoot The end history root of the edge
154-
function calculateEdgeId(
155-
uint8 level,
156-
bytes32 originId,
157-
uint256 startHeight,
158-
bytes32 startHistoryRoot,
159-
uint256 endHeight,
160-
bytes32 endHistoryRoot
161-
) external pure returns (bytes32);
162-
163-
/// @notice Calculate the mutual id of the edge
164-
/// Edges that are rivals share the same mutual id
165-
/// @param level The level of the edge
166-
/// @param originId The origin id of the edge
167-
/// @param startHeight The start height of the edge
168-
/// @param startHistoryRoot The start history root of the edge
169-
/// @param endHeight The end height of the edge
170-
function calculateMutualId(
171-
uint8 level,
172-
bytes32 originId,
173-
uint256 startHeight,
174-
bytes32 startHistoryRoot,
175-
uint256 endHeight
176-
) external pure returns (bytes32);
177-
178-
/// @notice Has the edge already been stored in the manager
179-
function edgeExists(
180-
bytes32 edgeId
181-
) external view returns (bool);
182-
183-
/// @notice Get full edge data for an edge
184-
function getEdge(
185-
bytes32 edgeId
186-
) external view returns (ChallengeEdge memory);
187-
188-
/// @notice The length of the edge, from start height to end height
189-
function edgeLength(
190-
bytes32 edgeId
191-
) external view returns (uint256);
192-
193-
/// @notice Does this edge currently have one or more rivals
194-
/// Rival edges share the same mutual id
195-
function hasRival(
196-
bytes32 edgeId
197-
) external view returns (bool);
198-
199-
/// @notice The confirmed rival of this mutual id
200-
/// Returns 0 if one does not exist
201-
function confirmedRival(
202-
bytes32 mutualId
203-
) external view returns (bytes32);
204-
205-
/// @notice Does the edge have at least one rival, and it has length one
206-
function hasLengthOneRival(
207-
bytes32 edgeId
208-
) external view returns (bool);
209-
210-
/// @notice The amount of time this edge has spent without rivals
211-
/// This value is increasing whilst an edge is unrivaled, once a rival is created
212-
/// it is fixed. If an edge has rivals from the moment it is created then it will have
213-
/// a zero time unrivaled
214-
function timeUnrivaled(
215-
bytes32 edgeId
216-
) external view returns (uint256);
217-
218-
/// @notice Get the id of the prev assertion that this edge is originates from
219-
/// @dev Uses the parent chain to traverse upwards SmallStep->BigStep->Block->Assertion
220-
/// until it gets to the origin assertion
221-
function getPrevAssertionHash(
222-
bytes32 edgeId
223-
) external view returns (bytes32);
224-
225-
/// @notice Fetch the raw first rival record for the given mutual id
226-
/// @dev Returns 0 if there is no edge with the given mutual id
227-
/// Returns a magic value if there is one edge but it is unrivaled
228-
/// Returns the id of the second edge created with the mutual id, if > 1 exists
229-
function firstRival(
230-
bytes32 mutualId
231-
) external view returns (bytes32);
232-
233-
/// @notice True if an account has made a layer zero edge with the given mutual id.
234-
/// This is only tracked when the validator whitelist is enabled
235-
function hasMadeLayerZeroRival(
236-
address account,
237-
bytes32 mutualId
238-
) external view returns (bool);
239-
}
240-
24117
/// @title A challenge manager that uses edge structures to decide between Assertions
24218
/// @notice When two assertions are created that have the same predecessor the protocol needs to decide which of the two is correct
24319
/// This challenge manager allows the staker who has created the valid assertion to enforce that it will be confirmed, and all

‎src/challengeV2/IAssertionChain.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// For license information, see https://github.com/offchainlabs/bold/blob/main/LICENSE
33
// SPDX-License-Identifier: BUSL-1.1
44
//
5-
pragma solidity ^0.8.17;
5+
pragma solidity ^0.8.0;
66

77
import "../bridge/IBridge.sol";
88
import "../osp/IOneStepProofEntry.sol";
+239
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,239 @@
1+
// Copyright 2023, Offchain Labs, Inc.
2+
// For license information, see https://github.com/offchainlabs/bold/blob/main/LICENSE
3+
// SPDX-License-Identifier: BUSL-1.1
4+
//
5+
pragma solidity ^0.8.0;
6+
7+
import "./IAssertionChain.sol";
8+
import "./libraries/Structs.sol";
9+
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
10+
11+
/// @title EdgeChallengeManager interface
12+
interface IEdgeChallengeManager {
13+
/// @notice Initialize the EdgeChallengeManager. EdgeChallengeManagers are upgradeable
14+
/// so use the initializer paradigm
15+
/// @param _assertionChain The assertion chain contract
16+
/// @param _challengePeriodBlocks The amount of cumulative time an edge must spend unrivaled before it can be confirmed
17+
/// This should be the censorship period + the cumulative amount of time needed to do any
18+
/// offchain calculation. We currently estimate around 10 mins for each layer zero edge and 1
19+
/// one minute for each other edge.
20+
/// @param _oneStepProofEntry The one step proof logic
21+
/// @param layerZeroBlockEdgeHeight The end height of layer zero edges of type Block
22+
/// @param layerZeroBigStepEdgeHeight The end height of layer zero edges of type BigStep
23+
/// @param layerZeroSmallStepEdgeHeight The end height of layer zero edges of type SmallStep
24+
/// @param _stakeToken The token that stake will be provided in when creating zero layer block edges
25+
/// @param _excessStakeReceiver The address that excess stake will be sent to when 2nd+ block edge is created
26+
/// @param _numBigStepLevel The number of bigstep levels
27+
/// @param _stakeAmounts The stake amount for each level. (first element is for block level)
28+
function initialize(
29+
IAssertionChain _assertionChain,
30+
uint64 _challengePeriodBlocks,
31+
IOneStepProofEntry _oneStepProofEntry,
32+
uint256 layerZeroBlockEdgeHeight,
33+
uint256 layerZeroBigStepEdgeHeight,
34+
uint256 layerZeroSmallStepEdgeHeight,
35+
IERC20 _stakeToken,
36+
address _excessStakeReceiver,
37+
uint8 _numBigStepLevel,
38+
uint256[] calldata _stakeAmounts
39+
) external;
40+
41+
function stakeToken() external view returns (IERC20);
42+
43+
function stakeAmounts(
44+
uint256
45+
) external view returns (uint256);
46+
47+
function challengePeriodBlocks() external view returns (uint64);
48+
49+
/// @notice The one step proof resolver used to decide between rival SmallStep edges of length 1
50+
function oneStepProofEntry() external view returns (IOneStepProofEntry);
51+
52+
/// @notice Performs necessary checks and creates a new layer zero edge
53+
/// @param args Edge creation args
54+
function createLayerZeroEdge(
55+
CreateEdgeArgs calldata args
56+
) external returns (bytes32);
57+
58+
/// @notice Bisect an edge. This creates two child edges:
59+
/// lowerChild: has the same start root and height as this edge, but a different end root and height
60+
/// upperChild: has the same end root and height as this edge, but a different start root and height
61+
/// The lower child end root and height are equal to the upper child start root and height. This height
62+
/// is the mandatoryBisectionHeight.
63+
/// The lower child may already exist, however it's not possible for the upper child to exist as that would
64+
/// mean that the edge has already been bisected
65+
/// @param edgeId Edge to bisect
66+
/// @param bisectionHistoryRoot The new history root to be used in the lower and upper children
67+
/// @param prefixProof A proof to show that the bisectionHistoryRoot commits to a prefix of the current endHistoryRoot
68+
/// @return lowerChildId The id of the newly created lower child edge
69+
/// @return upperChildId The id of the newly created upper child edge
70+
function bisectEdge(
71+
bytes32 edgeId,
72+
bytes32 bisectionHistoryRoot,
73+
bytes calldata prefixProof
74+
) external returns (bytes32, bytes32);
75+
76+
/// @notice An edge can be confirmed if the total amount of time it and a single chain of its direct ancestors
77+
/// has spent unrivaled is greater than the challenge period.
78+
/// @dev Edges inherit time from their parents, so the sum of unrivaled timers is compared against the threshold.
79+
/// Given that an edge cannot become unrivaled after becoming rivaled, once the threshold is passed
80+
/// it will always remain passed. The direct ancestors of an edge are linked by parent-child links for edges
81+
/// of the same level, and claimId-edgeId links for zero layer edges that claim an edge in the level below.
82+
/// This method also includes the amount of time the assertion being claimed spent without a sibling
83+
/// @param edgeId The id of the edge to confirm
84+
function confirmEdgeByTime(
85+
bytes32 edgeId,
86+
AssertionStateData calldata claimStateData
87+
) external;
88+
89+
/// @notice Update multiple edges' timer cache by their children. Equivalent to calling updateTimerCacheByChildren for each edge.
90+
/// May update timer cache above maximum if the last edge's timer cache was below maximumCachedTime.
91+
/// Revert when the last edge's timer cache is already equal to or above maximumCachedTime.
92+
/// @param edgeIds The ids of the edges to update
93+
/// @param maximumCachedTime The maximum amount of cached time allowed on the last edge (β∗)
94+
function multiUpdateTimeCacheByChildren(
95+
bytes32[] calldata edgeIds,
96+
uint256 maximumCachedTime
97+
) external;
98+
99+
/// @notice Update an edge's timer cache by its children.
100+
/// Sets the edge's timer cache to its timeUnrivaled + (minimum timer cache of its children).
101+
/// May update timer cache above maximum if the last edge's timer cache was below maximumCachedTime.
102+
/// Revert when the edge's timer cache is already equal to or above maximumCachedTime.
103+
/// @param edgeId The id of the edge to update
104+
/// @param maximumCachedTime The maximum amount of cached time allowed on the edge (β∗)
105+
function updateTimerCacheByChildren(bytes32 edgeId, uint256 maximumCachedTime) external;
106+
107+
/// @notice Given a one step fork edge and an edge with matching claim id,
108+
/// set the one step fork edge's timer cache to its timeUnrivaled + claiming edge's timer cache.
109+
/// May update timer cache above maximum if the last edge's timer cache was below maximumCachedTime.
110+
/// Revert when the edge's timer cache is already equal to or above maximumCachedTime.
111+
/// @param edgeId The id of the edge to update
112+
/// @param claimingEdgeId The id of the edge which has a claimId equal to edgeId
113+
/// @param maximumCachedTime The maximum amount of cached time allowed on the edge (β∗)
114+
function updateTimerCacheByClaim(
115+
bytes32 edgeId,
116+
bytes32 claimingEdgeId,
117+
uint256 maximumCachedTime
118+
) external;
119+
120+
/// @notice Confirm an edge by executing a one step proof
121+
/// @dev One step proofs can only be executed against edges that have length one and of type SmallStep
122+
/// @param edgeId The id of the edge to confirm
123+
/// @param oneStepData Input data to the one step proof
124+
/// @param prevConfig Data about the config set in prev
125+
/// @param beforeHistoryInclusionProof Proof that the state which is the start of the edge is committed to by the startHistoryRoot
126+
/// @param afterHistoryInclusionProof Proof that the state which is the end of the edge is committed to by the endHistoryRoot
127+
function confirmEdgeByOneStepProof(
128+
bytes32 edgeId,
129+
OneStepData calldata oneStepData,
130+
ConfigData calldata prevConfig,
131+
bytes32[] calldata beforeHistoryInclusionProof,
132+
bytes32[] calldata afterHistoryInclusionProof
133+
) external;
134+
135+
/// @notice When zero layer block edges are created a stake is also provided
136+
/// The stake on this edge can be refunded if the edge is confirme
137+
function refundStake(
138+
bytes32 edgeId
139+
) external;
140+
141+
/// @notice Zero layer edges have to be a fixed height.
142+
/// This function returns the end height for a given edge type
143+
function getLayerZeroEndHeight(
144+
EdgeType eType
145+
) external view returns (uint256);
146+
147+
/// @notice Calculate the unique id of an edge
148+
/// @param level The level of the edge
149+
/// @param originId The origin id of the edge
150+
/// @param startHeight The start height of the edge
151+
/// @param startHistoryRoot The start history root of the edge
152+
/// @param endHeight The end height of the edge
153+
/// @param endHistoryRoot The end history root of the edge
154+
function calculateEdgeId(
155+
uint8 level,
156+
bytes32 originId,
157+
uint256 startHeight,
158+
bytes32 startHistoryRoot,
159+
uint256 endHeight,
160+
bytes32 endHistoryRoot
161+
) external pure returns (bytes32);
162+
163+
/// @notice Calculate the mutual id of the edge
164+
/// Edges that are rivals share the same mutual id
165+
/// @param level The level of the edge
166+
/// @param originId The origin id of the edge
167+
/// @param startHeight The start height of the edge
168+
/// @param startHistoryRoot The start history root of the edge
169+
/// @param endHeight The end height of the edge
170+
function calculateMutualId(
171+
uint8 level,
172+
bytes32 originId,
173+
uint256 startHeight,
174+
bytes32 startHistoryRoot,
175+
uint256 endHeight
176+
) external pure returns (bytes32);
177+
178+
/// @notice Has the edge already been stored in the manager
179+
function edgeExists(
180+
bytes32 edgeId
181+
) external view returns (bool);
182+
183+
/// @notice Get full edge data for an edge
184+
function getEdge(
185+
bytes32 edgeId
186+
) external view returns (ChallengeEdge memory);
187+
188+
/// @notice The length of the edge, from start height to end height
189+
function edgeLength(
190+
bytes32 edgeId
191+
) external view returns (uint256);
192+
193+
/// @notice Does this edge currently have one or more rivals
194+
/// Rival edges share the same mutual id
195+
function hasRival(
196+
bytes32 edgeId
197+
) external view returns (bool);
198+
199+
/// @notice The confirmed rival of this mutual id
200+
/// Returns 0 if one does not exist
201+
function confirmedRival(
202+
bytes32 mutualId
203+
) external view returns (bytes32);
204+
205+
/// @notice Does the edge have at least one rival, and it has length one
206+
function hasLengthOneRival(
207+
bytes32 edgeId
208+
) external view returns (bool);
209+
210+
/// @notice The amount of time this edge has spent without rivals
211+
/// This value is increasing whilst an edge is unrivaled, once a rival is created
212+
/// it is fixed. If an edge has rivals from the moment it is created then it will have
213+
/// a zero time unrivaled
214+
function timeUnrivaled(
215+
bytes32 edgeId
216+
) external view returns (uint256);
217+
218+
/// @notice Get the id of the prev assertion that this edge is originates from
219+
/// @dev Uses the parent chain to traverse upwards SmallStep->BigStep->Block->Assertion
220+
/// until it gets to the origin assertion
221+
function getPrevAssertionHash(
222+
bytes32 edgeId
223+
) external view returns (bytes32);
224+
225+
/// @notice Fetch the raw first rival record for the given mutual id
226+
/// @dev Returns 0 if there is no edge with the given mutual id
227+
/// Returns a magic value if there is one edge but it is unrivaled
228+
/// Returns the id of the second edge created with the mutual id, if > 1 exists
229+
function firstRival(
230+
bytes32 mutualId
231+
) external view returns (bytes32);
232+
233+
/// @notice True if an account has made a layer zero edge with the given mutual id.
234+
/// This is only tracked when the validator whitelist is enabled
235+
function hasMadeLayerZeroRival(
236+
address account,
237+
bytes32 mutualId
238+
) external view returns (bool);
239+
}

‎src/challengeV2/libraries/ChallengeEdgeLib.sol

+1-57
Original file line numberDiff line numberDiff line change
@@ -6,63 +6,7 @@ pragma solidity ^0.8.17;
66

77
import "./Enums.sol";
88
import "./ChallengeErrors.sol";
9-
10-
/// @notice An edge committing to a range of states. These edges will be bisected, slowly
11-
/// reducing them in length until they reach length one. At that point new edges of a different
12-
/// level will be added that claim the result of this edge, or a one step proof will be calculated
13-
/// if the edge level is already of type SmallStep.
14-
struct ChallengeEdge {
15-
/// @notice The origin id is a link from the edge to an edge or assertion at a lower level.
16-
/// Intuitively all edges with the same origin id agree on the information committed to in the origin id
17-
/// For a SmallStep edge the origin id is the 'mutual' id of the length one BigStep edge being claimed by the zero layer ancestors of this edge
18-
/// For a BigStep edge the origin id is the 'mutual' id of the length one Block edge being claimed by the zero layer ancestors of this edge
19-
/// For a Block edge the origin id is the assertion hash of the assertion that is the root of the challenge - all edges in this challenge agree
20-
/// that that assertion hash is valid.
21-
/// The purpose of the origin id is to ensure that only edges that agree on a common start position
22-
/// are being compared against one another.
23-
bytes32 originId;
24-
/// @notice A root of all the states in the history up to the startHeight
25-
bytes32 startHistoryRoot;
26-
/// @notice The height of the start history root
27-
uint256 startHeight;
28-
/// @notice A root of all the states in the history up to the endHeight. Since endHeight > startHeight, the startHistoryRoot must
29-
/// commit to a prefix of the states committed to by the endHistoryRoot
30-
bytes32 endHistoryRoot;
31-
/// @notice The height of the end history root
32-
uint256 endHeight;
33-
/// @notice Edges can be bisected into two children. If this edge has been bisected the id of the
34-
/// lower child is populated here, until that time this value is 0. The lower child has startHistoryRoot and startHeight
35-
/// equal to this edge, but endHistoryRoot and endHeight equal to some prefix of the endHistoryRoot of this edge
36-
bytes32 lowerChildId;
37-
/// @notice Edges can be bisected into two children. If this edge has been bisected the id of the
38-
/// upper child is populated here, until that time this value is 0. The upper child has startHistoryRoot and startHeight
39-
/// equal to some prefix of the endHistoryRoot of this edge, and endHistoryRoot and endHeight equal to this edge
40-
bytes32 upperChildId;
41-
/// @notice The edge or assertion in the upper level that this edge claims to be true.
42-
/// Only populated on zero layer edges
43-
bytes32 claimId;
44-
/// @notice The entity that supplied a mini-stake accompanying this edge
45-
/// Only populated on zero layer edges
46-
address staker;
47-
/// @notice The block number when this edge was created
48-
uint64 createdAtBlock;
49-
/// @notice The block number at which this edge was confirmed
50-
/// Zero if not confirmed
51-
uint64 confirmedAtBlock;
52-
/// @notice Current status of this edge. All edges are created Pending, and may be updated to Confirmed
53-
/// Once Confirmed they cannot transition back to Pending
54-
EdgeStatus status;
55-
/// @notice The level of this edge.
56-
/// Level 0 is type Block
57-
/// Last level (defined by NUM_BIGSTEP_LEVEL + 1) is type SmallStep
58-
/// All levels in between are of type BigStep
59-
uint8 level;
60-
/// @notice Set to true when the staker has been refunded. Can only be set to true if the status is Confirmed
61-
/// and the staker is non zero.
62-
bool refunded;
63-
/// @notice TODO
64-
uint64 totalTimeUnrivaledCache;
65-
}
9+
import "./Structs.sol";
6610

6711
library ChallengeEdgeLib {
6812
/// @notice Common checks to do when adding an edge

‎src/challengeV2/libraries/EdgeChallengeManagerLib.sol

+2-113
Original file line numberDiff line numberDiff line change
@@ -8,124 +8,13 @@ import "./UintUtilsLib.sol";
88
import "./MerkleTreeAccumulatorLib.sol";
99
import "./ChallengeEdgeLib.sol";
1010
import "../../osp/IOneStepProofEntry.sol";
11-
import "../../rollup/AssertionState.sol";
1211
import "../../libraries/Constants.sol";
1312
import "./ChallengeErrors.sol";
14-
15-
/// @notice An execution state and proof to show that it's valid
16-
struct AssertionStateData {
17-
/// @notice An execution state
18-
AssertionState assertionState;
19-
/// @notice assertion Hash of the prev assertion
20-
bytes32 prevAssertionHash;
21-
/// @notice Inbox accumulator of the assertion
22-
bytes32 inboxAcc;
23-
}
24-
25-
/// @notice Data for creating a layer zero edge
26-
struct CreateEdgeArgs {
27-
/// @notice The level of edge to be created. Challenges are decomposed into multiple levels.
28-
/// The first (level 0) being of type Block, followed by n (set by NUM_BIGSTEP_LEVEL) levels of type BigStep, and finally
29-
/// followed by a single level of type SmallStep. Each level is bisected until an edge
30-
/// of length one is reached before proceeding to the next level. The first edge in each level (the layer zero edge)
31-
/// makes a claim about an assertion or assertion in the lower level.
32-
/// Finally in the last level, a SmallStep edge is added that claims a lower level length one BigStep edge, and these
33-
/// SmallStep edges are bisected until they reach length one. A length one small step edge
34-
/// can then be directly executed using a one-step proof.
35-
uint8 level;
36-
/// @notice The end history root of the edge to be created
37-
bytes32 endHistoryRoot;
38-
/// @notice The end height of the edge to be created.
39-
/// @dev End height is deterministic for different levels but supplying it here gives the
40-
/// caller a bit of extra security that they are supplying data for the correct level of edge
41-
uint256 endHeight;
42-
/// @notice The edge, or assertion, that is being claimed correct by the newly created edge.
43-
bytes32 claimId;
44-
/// @notice Proof that the start history root commits to a prefix of the states that
45-
/// end history root commits to
46-
bytes prefixProof;
47-
/// @notice Edge type specific data
48-
/// For Block type edges this is the abi encoding of:
49-
/// bytes32[]: Inclusion proof - proof to show that the end state is the last state in the end history root
50-
/// AssertionStateData: the before state of the edge
51-
/// AssertionStateData: the after state of the edge
52-
/// bytes32 predecessorId: id of the prev assertion
53-
/// bytes32 inboxAcc: the inbox accumulator of the assertion
54-
/// For BigStep and SmallStep edges this is the abi encoding of:
55-
/// bytes32: Start state - first state the edge commits to
56-
/// bytes32: End state - last state the edge commits to
57-
/// bytes32[]: Claim start inclusion proof - proof to show the start state is the first state in the claim edge
58-
/// bytes32[]: Claim end inclusion proof - proof to show the end state is the last state in the claim edge
59-
/// bytes32[]: Inclusion proof - proof to show that the end state is the last state in the end history root
60-
bytes proof;
61-
}
62-
63-
/// @notice Data parsed raw proof data
64-
struct ProofData {
65-
/// @notice The first state being committed to by an edge
66-
bytes32 startState;
67-
/// @notice The last state being committed to by an edge
68-
bytes32 endState;
69-
/// @notice A proof that the end state is included in the edge
70-
bytes32[] inclusionProof;
71-
}
72-
73-
/// @notice Stores all edges and their rival status
74-
struct EdgeStore {
75-
/// @notice A mapping of edge id to edges. Edges are never deleted, only created, and potentially confirmed.
76-
mapping(bytes32 => ChallengeEdge) edges;
77-
/// @notice A mapping of mutualId to edge id. Rivals share the same mutual id, and here we
78-
/// store the edge id of the second edge that was created with the same mutual id - the first rival
79-
/// When only one edge exists for a specific mutual id then a special magic string hash is stored instead
80-
/// of the first rival id, to signify that a single edge does exist with this mutual id
81-
mapping(bytes32 => bytes32) firstRivals;
82-
/// @notice A mapping of mutualId to the edge id of the confirmed rival with that mutualId
83-
/// @dev Each group of rivals (edges sharing mutual id) can only have at most one confirmed edge
84-
mapping(bytes32 => bytes32) confirmedRivals;
85-
/// @notice A mapping of account -> mutualId -> bool indicating if the account has created a layer zero edge with a mutual id
86-
mapping(address => mapping(bytes32 => bool)) hasMadeLayerZeroRival;
87-
}
88-
89-
/// @notice Input data to a one step proof
90-
struct OneStepData {
91-
/// @notice The hash of the state that's being executed from
92-
bytes32 beforeHash;
93-
/// @notice Proof data to accompany the execution context
94-
bytes proof;
95-
}
96-
97-
/// @notice Data about a recently added edge
98-
struct EdgeAddedData {
99-
bytes32 edgeId;
100-
bytes32 mutualId;
101-
bytes32 originId;
102-
bytes32 claimId;
103-
uint256 length;
104-
uint8 level;
105-
bool hasRival;
106-
bool isLayerZero;
107-
}
108-
109-
/// @notice Data about an assertion that is being claimed by an edge
110-
/// @dev This extra information that is needed in order to verify that a block edge can be created
111-
struct AssertionReferenceData {
112-
/// @notice The id of the assertion - will be used in a sanity check
113-
bytes32 assertionHash;
114-
/// @notice The predecessor of the assertion
115-
bytes32 predecessorId;
116-
/// @notice Is the assertion pending
117-
bool isPending;
118-
/// @notice Does the assertion have a sibling
119-
bool hasSibling;
120-
/// @notice The execution state of the predecessor assertion
121-
AssertionState startState;
122-
/// @notice The execution state of the assertion being claimed
123-
AssertionState endState;
124-
}
125-
13+
import "./Structs.sol";
12614
/// @title Core functionality for the Edge Challenge Manager
12715
/// @notice The edge manager library allows edges to be added and bisected, and keeps track of the amount
12816
/// of time an edge remained unrivaled.
17+
12918
library EdgeChallengeManagerLib {
13019
using ChallengeEdgeLib for ChallengeEdge;
13120
using GlobalStateLib for GlobalState;

‎src/challengeV2/libraries/Structs.sol

+176
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
// Copyright 2023, Offchain Labs, Inc.
2+
// For license information, see https://github.com/offchainlabs/bold/blob/main/LICENSE
3+
// SPDX-License-Identifier: BUSL-1.1
4+
//
5+
pragma solidity ^0.8.0;
6+
7+
import "./Enums.sol";
8+
import "../../rollup/AssertionState.sol";
9+
10+
/// @notice An execution state and proof to show that it's valid
11+
struct AssertionStateData {
12+
/// @notice An execution state
13+
AssertionState assertionState;
14+
/// @notice assertion Hash of the prev assertion
15+
bytes32 prevAssertionHash;
16+
/// @notice Inbox accumulator of the assertion
17+
bytes32 inboxAcc;
18+
}
19+
20+
/// @notice Data for creating a layer zero edge
21+
struct CreateEdgeArgs {
22+
/// @notice The level of edge to be created. Challenges are decomposed into multiple levels.
23+
/// The first (level 0) being of type Block, followed by n (set by NUM_BIGSTEP_LEVEL) levels of type BigStep, and finally
24+
/// followed by a single level of type SmallStep. Each level is bisected until an edge
25+
/// of length one is reached before proceeding to the next level. The first edge in each level (the layer zero edge)
26+
/// makes a claim about an assertion or assertion in the lower level.
27+
/// Finally in the last level, a SmallStep edge is added that claims a lower level length one BigStep edge, and these
28+
/// SmallStep edges are bisected until they reach length one. A length one small step edge
29+
/// can then be directly executed using a one-step proof.
30+
uint8 level;
31+
/// @notice The end history root of the edge to be created
32+
bytes32 endHistoryRoot;
33+
/// @notice The end height of the edge to be created.
34+
/// @dev End height is deterministic for different levels but supplying it here gives the
35+
/// caller a bit of extra security that they are supplying data for the correct level of edge
36+
uint256 endHeight;
37+
/// @notice The edge, or assertion, that is being claimed correct by the newly created edge.
38+
bytes32 claimId;
39+
/// @notice Proof that the start history root commits to a prefix of the states that
40+
/// end history root commits to
41+
bytes prefixProof;
42+
/// @notice Edge type specific data
43+
/// For Block type edges this is the abi encoding of:
44+
/// bytes32[]: Inclusion proof - proof to show that the end state is the last state in the end history root
45+
/// AssertionStateData: the before state of the edge
46+
/// AssertionStateData: the after state of the edge
47+
/// bytes32 predecessorId: id of the prev assertion
48+
/// bytes32 inboxAcc: the inbox accumulator of the assertion
49+
/// For BigStep and SmallStep edges this is the abi encoding of:
50+
/// bytes32: Start state - first state the edge commits to
51+
/// bytes32: End state - last state the edge commits to
52+
/// bytes32[]: Claim start inclusion proof - proof to show the start state is the first state in the claim edge
53+
/// bytes32[]: Claim end inclusion proof - proof to show the end state is the last state in the claim edge
54+
/// bytes32[]: Inclusion proof - proof to show that the end state is the last state in the end history root
55+
bytes proof;
56+
}
57+
58+
/// @notice Data parsed raw proof data
59+
struct ProofData {
60+
/// @notice The first state being committed to by an edge
61+
bytes32 startState;
62+
/// @notice The last state being committed to by an edge
63+
bytes32 endState;
64+
/// @notice A proof that the end state is included in the edge
65+
bytes32[] inclusionProof;
66+
}
67+
68+
/// @notice Stores all edges and their rival status
69+
struct EdgeStore {
70+
/// @notice A mapping of edge id to edges. Edges are never deleted, only created, and potentially confirmed.
71+
mapping(bytes32 => ChallengeEdge) edges;
72+
/// @notice A mapping of mutualId to edge id. Rivals share the same mutual id, and here we
73+
/// store the edge id of the second edge that was created with the same mutual id - the first rival
74+
/// When only one edge exists for a specific mutual id then a special magic string hash is stored instead
75+
/// of the first rival id, to signify that a single edge does exist with this mutual id
76+
mapping(bytes32 => bytes32) firstRivals;
77+
/// @notice A mapping of mutualId to the edge id of the confirmed rival with that mutualId
78+
/// @dev Each group of rivals (edges sharing mutual id) can only have at most one confirmed edge
79+
mapping(bytes32 => bytes32) confirmedRivals;
80+
/// @notice A mapping of account -> mutualId -> bool indicating if the account has created a layer zero edge with a mutual id
81+
mapping(address => mapping(bytes32 => bool)) hasMadeLayerZeroRival;
82+
}
83+
84+
/// @notice Input data to a one step proof
85+
struct OneStepData {
86+
/// @notice The hash of the state that's being executed from
87+
bytes32 beforeHash;
88+
/// @notice Proof data to accompany the execution context
89+
bytes proof;
90+
}
91+
92+
/// @notice Data about a recently added edge
93+
struct EdgeAddedData {
94+
bytes32 edgeId;
95+
bytes32 mutualId;
96+
bytes32 originId;
97+
bytes32 claimId;
98+
uint256 length;
99+
uint8 level;
100+
bool hasRival;
101+
bool isLayerZero;
102+
}
103+
104+
/// @notice Data about an assertion that is being claimed by an edge
105+
/// @dev This extra information that is needed in order to verify that a block edge can be created
106+
struct AssertionReferenceData {
107+
/// @notice The id of the assertion - will be used in a sanity check
108+
bytes32 assertionHash;
109+
/// @notice The predecessor of the assertion
110+
bytes32 predecessorId;
111+
/// @notice Is the assertion pending
112+
bool isPending;
113+
/// @notice Does the assertion have a sibling
114+
bool hasSibling;
115+
/// @notice The execution state of the predecessor assertion
116+
AssertionState startState;
117+
/// @notice The execution state of the assertion being claimed
118+
AssertionState endState;
119+
}
120+
121+
/// @notice An edge committing to a range of states. These edges will be bisected, slowly
122+
/// reducing them in length until they reach length one. At that point new edges of a different
123+
/// level will be added that claim the result of this edge, or a one step proof will be calculated
124+
/// if the edge level is already of type SmallStep.
125+
struct ChallengeEdge {
126+
/// @notice The origin id is a link from the edge to an edge or assertion at a lower level.
127+
/// Intuitively all edges with the same origin id agree on the information committed to in the origin id
128+
/// For a SmallStep edge the origin id is the 'mutual' id of the length one BigStep edge being claimed by the zero layer ancestors of this edge
129+
/// For a BigStep edge the origin id is the 'mutual' id of the length one Block edge being claimed by the zero layer ancestors of this edge
130+
/// For a Block edge the origin id is the assertion hash of the assertion that is the root of the challenge - all edges in this challenge agree
131+
/// that that assertion hash is valid.
132+
/// The purpose of the origin id is to ensure that only edges that agree on a common start position
133+
/// are being compared against one another.
134+
bytes32 originId;
135+
/// @notice A root of all the states in the history up to the startHeight
136+
bytes32 startHistoryRoot;
137+
/// @notice The height of the start history root
138+
uint256 startHeight;
139+
/// @notice A root of all the states in the history up to the endHeight. Since endHeight > startHeight, the startHistoryRoot must
140+
/// commit to a prefix of the states committed to by the endHistoryRoot
141+
bytes32 endHistoryRoot;
142+
/// @notice The height of the end history root
143+
uint256 endHeight;
144+
/// @notice Edges can be bisected into two children. If this edge has been bisected the id of the
145+
/// lower child is populated here, until that time this value is 0. The lower child has startHistoryRoot and startHeight
146+
/// equal to this edge, but endHistoryRoot and endHeight equal to some prefix of the endHistoryRoot of this edge
147+
bytes32 lowerChildId;
148+
/// @notice Edges can be bisected into two children. If this edge has been bisected the id of the
149+
/// upper child is populated here, until that time this value is 0. The upper child has startHistoryRoot and startHeight
150+
/// equal to some prefix of the endHistoryRoot of this edge, and endHistoryRoot and endHeight equal to this edge
151+
bytes32 upperChildId;
152+
/// @notice The edge or assertion in the upper level that this edge claims to be true.
153+
/// Only populated on zero layer edges
154+
bytes32 claimId;
155+
/// @notice The entity that supplied a mini-stake accompanying this edge
156+
/// Only populated on zero layer edges
157+
address staker;
158+
/// @notice The block number when this edge was created
159+
uint64 createdAtBlock;
160+
/// @notice The block number at which this edge was confirmed
161+
/// Zero if not confirmed
162+
uint64 confirmedAtBlock;
163+
/// @notice Current status of this edge. All edges are created Pending, and may be updated to Confirmed
164+
/// Once Confirmed they cannot transition back to Pending
165+
EdgeStatus status;
166+
/// @notice The level of this edge.
167+
/// Level 0 is type Block
168+
/// Last level (defined by NUM_BIGSTEP_LEVEL + 1) is type SmallStep
169+
/// All levels in between are of type BigStep
170+
uint8 level;
171+
/// @notice Set to true when the staker has been refunded. Can only be set to true if the status is Confirmed
172+
/// and the staker is non zero.
173+
bool refunded;
174+
/// @notice TODO
175+
uint64 totalTimeUnrivaledCache;
176+
}

‎src/mocks/SimpleOneStepProofEntry.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//
55
pragma solidity ^0.8.17;
66

7-
import "../challengeV2/EdgeChallengeManager.sol";
7+
import "../challengeV2/IEdgeChallengeManager.sol";
88
import "../state/Deserialize.sol";
99

1010
contract SimpleOneStepProofEntry is IOneStepProofEntry {

‎src/rollup/Config.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import "../bridge/IOutbox.sol";
1212
import "../bridge/IInboxBase.sol";
1313
import "./IRollupEventInbox.sol";
1414
import "./IRollupLogic.sol";
15-
import "../challengeV2/EdgeChallengeManager.sol";
15+
import "../challengeV2/IEdgeChallengeManager.sol";
1616

1717
struct Config {
1818
uint64 confirmPeriodBlocks;

‎src/rollup/IRollupCore.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import "../bridge/IBridge.sol";
99
import "../bridge/IOutbox.sol";
1010
import "../bridge/IInboxBase.sol";
1111
import "./IRollupEventInbox.sol";
12-
import "../challengeV2/EdgeChallengeManager.sol";
12+
import "../challengeV2/IEdgeChallengeManager.sol";
1313
import "../challengeV2/IAssertionChain.sol";
1414

1515
interface IRollupCore is IAssertionChain {

‎src/rollup/RollupCore.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import "../state/Machine.sol";
1717
import "../bridge/ISequencerInbox.sol";
1818
import "../bridge/IBridge.sol";
1919
import "../bridge/IOutbox.sol";
20-
import "../challengeV2/EdgeChallengeManager.sol";
20+
import "../challengeV2/IEdgeChallengeManager.sol";
2121
import "../libraries/ArbitrumChecker.sol";
2222

2323
abstract contract RollupCore is IRollupCore, PausableUpgradeable {

‎src/rollup/RollupLib.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import "../bridge/IOutbox.sol";
1212
import "../bridge/IInboxBase.sol";
1313
import "./Assertion.sol";
1414
import "./IRollupEventInbox.sol";
15-
import "../challengeV2/EdgeChallengeManager.sol";
15+
import "../challengeV2/IEdgeChallengeManager.sol";
1616

1717
library RollupLib {
1818
using GlobalStateLib for GlobalState;

‎src/rollup/RollupUserLogic.sol

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
pragma solidity ^0.8.0;
66

77
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
8+
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
89

910
import {IRollupUser} from "./IRollupLogic.sol";
1011
import "../libraries/UUPSNotUpgradeable.sol";

‎test/MockAssertionChain.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ pragma solidity ^0.8.17;
33

44
import "forge-std/Test.sol";
55
import {IAssertionChain} from "../src/challengeV2/IAssertionChain.sol";
6-
import {IEdgeChallengeManager} from "../src/challengeV2/EdgeChallengeManager.sol";
6+
import {IEdgeChallengeManager} from "../src/challengeV2/IEdgeChallengeManager.sol";
77
import "../src/bridge/IBridge.sol";
88
import "../src/rollup/RollupLib.sol";
99
import "./challengeV2/StateTools.sol";

0 commit comments

Comments
 (0)
Please sign in to comment.