Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[N-09] Naming issues #433

Merged
merged 1 commit into from
Jun 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Third-party contracts (e.g. OZ proxies) live under `contracts/vendor`.

There are currently two Comet-related contracts that extend directly from the vendor contracts. The contracts are:

1. **TransparentUpgradeableConfiguratorProxy**: This contract extends OZ's `TransparentUpgradeableProxy`. We override the `_beforeFallback` function so that the proxy's admin can directly call the implementation. We only need this feature for the Configurator's proxy.
1. **ConfiguratorProxy**: This contract extends OZ's `TransparentUpgradeableProxy`. We override the `_beforeFallback` function so that the proxy's admin can directly call the implementation. We only need this feature for the Configurator's proxy.
2. **CometProxyAdmin**: This contract extends OZ's `ProxyAdmin`. We created a new function called `deployAndUpgradeTo`, which calls `Configurator.deploy()` and upgrades Comet proxy's implementation to this newly deployed Comet contract. This function is needed so we can pass the address of the new Comet to the `Proxy.upgrade()` call in one transaction.

## Usage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import "./vendor/proxy/transparent/TransparentUpgradeableProxy.sol";
/**
* @dev A TransparentUpgradeableProxy that allows its admin to call its implementation.
*/
contract TransparentUpgradeableConfiguratorProxy is TransparentUpgradeableProxy {
contract ConfiguratorProxy is TransparentUpgradeableProxy {
jflatow marked this conversation as resolved.
Show resolved Hide resolved
/**
* @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and
* optionally initialized with `_data` as explained in {UpgradeableProxy-constructor}.
Expand Down
10 changes: 5 additions & 5 deletions src/deploy/Development.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import {
Configurator__factory,
CometProxyAdmin,
CometProxyAdmin__factory,
TransparentUpgradeableConfiguratorProxy,
TransparentUpgradeableConfiguratorProxy__factory,
ConfiguratorProxy,
ConfiguratorProxy__factory,
ProxyAdmin,
} from '../../build/types';
import { ConfigurationStruct } from '../../build/types/Comet';
Expand Down Expand Up @@ -222,10 +222,10 @@ export async function deployDevelopmentComet(
if (deployProxy.deployConfiguratorProxy) {
// Configuration proxy
configuratorProxy = await deploymentManager.deploy<
TransparentUpgradeableConfiguratorProxy,
TransparentUpgradeableConfiguratorProxy__factory,
ConfiguratorProxy,
ConfiguratorProxy__factory,
[string, string, string]
>('TransparentUpgradeableConfiguratorProxy.sol', [
>('ConfiguratorProxy.sol', [
configurator.address,
proxyAdmin.address,
(await configurator.populateTransaction.initialize(timelock.address, cometFactory.address, configuration)).data, // new time lock is set, which we don't want
Expand Down
10 changes: 5 additions & 5 deletions src/deploy/Network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import {
CometProxyAdmin__factory,
TransparentUpgradeableProxy,
TransparentUpgradeableProxy__factory,
TransparentUpgradeableConfiguratorProxy,
TransparentUpgradeableConfiguratorProxy__factory,
ConfiguratorProxy,
ConfiguratorProxy__factory,
Configurator,
Configurator__factory,
SimpleTimelock,
Expand Down Expand Up @@ -144,10 +144,10 @@ export async function deployNetworkComet(
if (deployProxy.deployConfiguratorProxy) {
// Configuration proxy
configuratorProxy = await deploymentManager.deploy<
TransparentUpgradeableConfiguratorProxy,
TransparentUpgradeableConfiguratorProxy__factory,
ConfiguratorProxy,
ConfiguratorProxy__factory,
[string, string, string]
>('TransparentUpgradeableConfiguratorProxy.sol', [
>('ConfiguratorProxy.sol', [
configurator.address,
proxyAdmin.address,
(await configurator.populateTransaction.initialize(timelock.address, cometFactory.address, configuration)).data, // new time lock is set, which we don't want
Expand Down
8 changes: 4 additions & 4 deletions test/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import {
SimplePriceFeed__factory,
TransparentUpgradeableProxy,
TransparentUpgradeableProxy__factory,
TransparentUpgradeableConfiguratorProxy,
TransparentUpgradeableConfiguratorProxy__factory,
ConfiguratorProxy,
ConfiguratorProxy__factory,
CometProxyAdmin,
CometProxyAdmin__factory,
CometFactory,
Expand Down Expand Up @@ -102,7 +102,7 @@ export type Protocol = {

export type ConfiguratorAndProtocol = {
configurator: Configurator;
configuratorProxy: TransparentUpgradeableConfiguratorProxy;
configuratorProxy: ConfiguratorProxy;
proxyAdmin: CometProxyAdmin;
cometFactory: CometFactory;
cometProxy: TransparentUpgradeableProxy;
Expand Down Expand Up @@ -408,7 +408,7 @@ export async function makeConfigurator(opts: ProtocolOpts = {}): Promise<Configu

// Deploy Configurator proxy
const initializeCalldata = (await configurator.populateTransaction.initialize(governor.address, cometFactory.address, configuration)).data;
const ConfiguratorProxy = (await ethers.getContractFactory('TransparentUpgradeableConfiguratorProxy')) as TransparentUpgradeableConfiguratorProxy__factory;
const ConfiguratorProxy = (await ethers.getContractFactory('ConfiguratorProxy')) as ConfiguratorProxy__factory;
const configuratorProxy = await ConfiguratorProxy.deploy(
configurator.address,
proxyAdmin.address,
Expand Down