-
Notifications
You must be signed in to change notification settings - Fork 286
Custom Deployments #273
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
base: master
Are you sure you want to change the base?
Custom Deployments #273
Changes from 1 commit
cf991ce
3901829
2eed04f
da68e95
8b724d9
8d7fba2
67b95de
fb3acd6
ca259db
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,18 @@ | ||
| import type { ContractFactory, ContractTransaction } from 'ethers'; | ||
| import type { Deployment } from '@openzeppelin/upgrades-core'; | ||
| import type { ContractFactory } from 'ethers'; | ||
| export interface DeploymentExecutor { | ||
| (factory: ContractFactory): Promise<HardhatDeployment>; | ||
|
||
| } | ||
|
|
||
| export interface HardhatDeployment { | ||
| address: string; | ||
| deployTransaction: ContractTransaction; | ||
| } | ||
|
|
||
| export function defaultDeploy(factory: ContractFactory, args: unknown[]): Promise<HardhatDeployment> { | ||
| return factory.deploy(...args); | ||
| } | ||
|
|
||
| export async function deploy(factory: ContractFactory): Promise<Deployment> { | ||
| const { address, deployTransaction } = await factory.deploy(); | ||
| const txHash = deployTransaction.hash; | ||
| return { address, txHash }; | ||
| export function intoCoreDeployment({ address, deployTransaction }: HardhatDeployment): Deployment { | ||
| return { address, txHash: deployTransaction.hash }; | ||
| } | ||
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.
I think this should be a "tx executor" and not only a deployment executor.
I'm thinking that for
upgradeProxyit should also take care of sending theupgradefunction call. What do you think?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.
Seems legit, I will look into this!