-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fixed based on feedback from @unknownunknown1, bumped hardhat-de…
…ploy to pick up this merged PR wighawag/hardhat-deploy#479
- Loading branch information
Showing
13 changed files
with
51 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,35 @@ | ||
import { DeployResult, DeployOptions } from "hardhat-deploy/types"; | ||
import { HardhatRuntimeEnvironment } from "hardhat/types"; | ||
|
||
export function deployUpgradable( | ||
export const deployUpgradable = async ( | ||
hre: HardhatRuntimeEnvironment, | ||
contract: string, | ||
options: DeployOptions | ||
): Promise<DeployResult> { | ||
): Promise<DeployResult> => { | ||
const { deploy } = hre.deployments; | ||
const { args, ...otherOptions } = options; | ||
// Rationale: https://github.com/kleros/kleros-v2/pull/1214#issue-1879116629 | ||
return deploy(contract, { | ||
proxy: { | ||
proxyContract: "UUPSProxy", | ||
proxyArgs: ["{implementation}", "{data}"], | ||
checkProxyAdmin: false, | ||
checkABIConflict: false, | ||
checkProxyAdmin: false, // Not relevant for UUPSProxy | ||
checkABIConflict: false, // Not relevant for UUPSProxy | ||
upgradeFunction: { | ||
methodName: "upgradeToAndCall", | ||
upgradeArgs: ["{implementation}", "{data}"], | ||
}, | ||
execute: { | ||
init: { | ||
methodName: "initialize", | ||
args: args ?? [], | ||
}, | ||
onUpgrade: { | ||
methodName: "governor", | ||
args: [], | ||
methodName: "initialize", | ||
args: args ?? [], | ||
}, | ||
}, | ||
}, | ||
...otherOptions, | ||
}); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters