-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathdeploy_plugin.ts
41 lines (35 loc) · 1.46 KB
/
deploy_plugin.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { DeployFunction } from "hardhat-deploy/types";
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { getGelatoAddress } from "@gelatonetwork/relay-context";
import { ZeroAddress } from "ethers";
const deploy: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const { deployments, getNamedAccounts } = hre;
const { deployer, recoverer } = await getNamedAccounts();
const { deploy } = deployments;
// execTransaction(address,uint256,bytes,uint8,uint256,uint256,uint256,address,address,bytes)
// https://www.4byte.directory/signatures/?bytes4_signature=0x6a761202
const relayMethod = "0x6a761202"
// We don't use a trusted origin right now to make it easier to test.
// For production networks it is strongly recommended to set one to avoid potential fee extraction.
const trustedOrigin = ZeroAddress // hre.network.name === "hardhat" ? ZeroAddress : getGelatoAddress(hre.network.name)
await deploy("RelayPlugin", {
from: deployer,
args: [trustedOrigin, relayMethod],
log: true,
deterministicDeployment: true,
});
await deploy("WhitelistPlugin", {
from: deployer,
args: [],
log: true,
deterministicDeployment: true,
});
await deploy("RecoveryWithDelayPlugin", {
from: deployer,
args: [recoverer],
log: true,
deterministicDeployment: true,
});
};
deploy.tags = ["plugins"];
export default deploy;