@@ -164,7 +164,7 @@ contract L1Resolver is IExtendedResolver, ERC165, Ownable {
164
164
function resolve (bytes calldata name , bytes calldata data ) external view override returns (bytes memory ) {
165
165
// Check for base.eth resolution, and resolve return early if so
166
166
if (keccak256 (BASE_ETH_NAME) == keccak256 (name)) {
167
- return IExtendedResolver (rootResolver). resolve (name, data);
167
+ return _resolve (name, data);
168
168
}
169
169
170
170
bytes memory callData = abi.encodeWithSelector (IExtendedResolver.resolve.selector , name, data);
@@ -207,6 +207,28 @@ contract L1Resolver is IExtendedResolver, ERC165, Ownable {
207
207
|| ERC165 (rootResolver).supportsInterface (interfaceID);
208
208
}
209
209
210
+ /// @notice Internal method for completing `resolve` intended for the `rootResolver`.
211
+ ///
212
+ /// @dev The `PublicResolver` located at `rootResolver` does not implement the `resolve(bytes,bytes)` method.
213
+ /// This method completes the resolution request by staticcalling `rootResolver` with the resolve request.
214
+ /// Implementation matches the ENS `ExtendedResolver:resolve(bytes,bytes)` method with the exception that it `staticcall`s the
215
+ /// the `rootResolver` instead of `address(this)`.
216
+ ///
217
+ /// @param data The ABI encoded data for the underlying resolution function (Eg, addr(bytes32), text(bytes32,string), etc).
218
+ ///
219
+ /// @return The return data, ABI encoded identically to the underlying function.
220
+ function _resolve (bytes memory , bytes memory data ) internal view returns (bytes memory ) {
221
+ (bool success , bytes memory result ) = rootResolver.staticcall (data);
222
+ if (success) {
223
+ return result;
224
+ } else {
225
+ // Revert with the reason provided by the call
226
+ assembly {
227
+ revert (add (result, 0x20 ), mload (result))
228
+ }
229
+ }
230
+ }
231
+
210
232
/// @notice Generic handler for requests to the `rootResolver`
211
233
///
212
234
/// @dev Inspired by the passthrough logic of proxy contracts, but leveraging `call` instead of `delegatecall`
0 commit comments