diff --git a/deploy/03_delegatecall.ts b/deploy/03_delegatecall.ts new file mode 100644 index 00000000..401ef762 --- /dev/null +++ b/deploy/03_delegatecall.ts @@ -0,0 +1,28 @@ +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) + +import { HardhatRuntimeEnvironment } from "hardhat/types"; +import { DeployFunction, DeployOptions } from "hardhat-deploy/types"; + +const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { + const { deployments, getNamedAccounts, network } = hre; + const { deployer } = await getNamedAccounts(); + + // IoTeX doesn't have support yet, see https://github.com/safe-global/safe-singleton-factory/issues/199 + // Chiado is not working, see https://github.com/safe-global/safe-singleton-factory/issues/201 + const nonDeterministicNetworks = ["iotex_testnet", "chiado"]; + const deterministicDeployment = !nonDeterministicNetworks.includes( + network.name, + ); + + const opts: DeployOptions = { + deterministicDeployment, + from: deployer, + log: true, + }; + + await deployments.deploy("SafeERC20Transfer", opts); +}; + +export default func; +func.tags = ["Delegatecall"];