-
Notifications
You must be signed in to change notification settings - Fork 45
Add test verifying deterministic deployment of proxy #398
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bit of type magic!
A refinement of my previous incantation - it was because |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, fancy stuff! Very nice!
@@ -1,6 +1,7 @@ | |||
import { expect } from "chai"; | |||
import { Contract, Wallet } from "ethers"; | |||
import { artifacts } from "hardhat"; | |||
import Proxy from "hardhat-deploy/extendedArtifacts/EIP173Proxy.json"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is Key!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
|
||
EnumerableSet.AddressSet private solvers; | ||
|
||
// solhint-disable-next-line no-empty-blocks | ||
constructor(address initialOwner) CustomInitiallyOwnable(initialOwner) {} | ||
function initializeManager(address _manager) external { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why separate this from the constructor? I assume because EIP173 only works with empty constructors? Would the Ownable base contract now work again instead of implementing it ourselves?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This because the base branch was merged right before you
Why separate this from the constructor?
Its now a "proxy upgrade function" since proxied contracts cant have constructors.
182e296
to
56e0d71
Compare
Add a unit test that verifies that the authenticator proxy is at a deterministically deployed.
Test Plan
It is a test!