Skip to content

Commit

Permalink
Add some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mdehoog committed Dec 8, 2024
1 parent b5a4a93 commit 1f755eb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/ResolvingProxy.sol
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.15;

// The ProxyAdmin contract conforms to this interface.
interface IResolver {
function getProxyImplementation(address _proxy) external view returns (address);
}

/// @notice Proxy is a transparent proxy that passes through the call if the caller is the owner or
/// if the caller is address(0), meaning that the call originated from an off-chain
/// simulation.
/// @notice ResolvingProxy is a modification of the op-stack Proxy contract that allows for
/// proxying a proxy. This is useful to have a central upgradable proxy that this
/// contract can point to, but also support detaching this proxy so it can have its
/// own implementation.
/// @dev Only proxies that are owned by a ProxyAdmin can be proxied by this contract,
/// because it calls getProxyImplementation() on the ProxyAdmin to retrieve the
/// implementation address.
/// @dev This contract is based on the EIP-1967 transparent proxy standard. It is slightly
/// simplified in that it doesn't emit logs for implementation and admin changes. This
/// is to simplify the assembly implementation provided in ResolvingProxyFactory.
contract ResolvingProxy {
/// @notice The storage slot that holds the address of a proxy implementation.
/// @dev `bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)`
Expand Down
5 changes: 5 additions & 0 deletions src/ResolvingProxyFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ pragma solidity ^0.8.15;

import {ResolvingProxy} from "./ResolvingProxy.sol";

/// @title ResolvingProxyFactory
/// @notice ResolvingProxyFactory is a factory contract that creates ResolvingProxy instances.
/// @dev The setupProxy / proxyAddress functions provide a smaller assembly-based ResolvingProxy
/// implementation that is more gas efficient to deploy and operate than the solidity
/// ResolvingProxy implementation.
library ResolvingProxyFactory {
function setupProxy(address proxy, address admin, bytes32 salt) internal returns (address instance) {
/// @solidity memory-safe-assembly
Expand Down

0 comments on commit 1f755eb

Please sign in to comment.