Hi @msolomon4 ,
msolomon4:
I’d also like to be able to upgrade the underlying logic of the Forwarder contract, and, since the proxy contracts delegate calls to this contract, my understanding is all proxy contracts would consequently be updated by simply updating the logic contract.
My understanding is that minimal proxies are not upgradeable. We can change the logic contract that future minimal proxies point to, but can't change existing minimal proxies.
I suggest reading (if you haven't already): Deep dive into the Minimal Proxy contract
You may want to consider using OpenZeppelin's ProxyFactory to deploy minimal proxies:
event ProxyCreated(address proxy);
bytes32 private contractCodeHash;
constructor() public {
contractCodeHash = keccak256(
type(InitializableAdminUpgradeabilityProxy).creationCode
);
}
function deployMinimal(address _logic, bytes memory _data) public returns (address proxy) {
// Adapted from https://github.com/optionality/clone-factory/blob/32782f82dfc5a00d103a7e61a17a5dedbd1e8e9d/contracts/CloneFactory.sol
bytes20 targetBytes = bytes20(_logic);
assembly {
let clone := mload(0x40)
mstore(clone, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)
mstore(add(clone, 0x14), targetBytes)
mstore(add(clone, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000)
proxy := create(0, clone, 0x37)
}
What I am not sure of is how to encode the initialization data in Solidity, hopefully someone in the community can provide this answer.