Skip to content

Commit

Permalink
fix(evm): fixes dendreth deployment task
Browse files Browse the repository at this point in the history
  • Loading branch information
allemanfredi committed Aug 22, 2024
1 parent 09a66b0 commit c668622
Showing 1 changed file with 24 additions and 4 deletions.
28 changes: 24 additions & 4 deletions packages/evm/tasks/deploy/adapters/dendreth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,36 @@ import type { DendrETHAdapter } from "../../../types/contracts/adapters/DendrETH
import type { DendrETHAdapter__factory } from "../../../types/factories/contracts/adapters/DendrETH/DendrETHAdapter__factory"
import { verify } from "../index"

const MerklePatriciaAddresses = {
10200: "0x777662E6A65411e0A425E59C496A7D1C0635A935",
}

task("deploy:adapter:DendrETHAdapter")
.addParam("sourceChainId", "Source chain id")
.addParam("dendreth", "address of the DendrETH contract")
.addParam("sourceChainId", "Source chain id")
.addParam("sourceYaho", "address of the source Yaho contract")
.addFlag("verify", "whether to verify the contract on Etherscan")
.setAction(async function (taskArguments: TaskArguments, hre) {
console.log("Deploying DendrETHAdapter...")
const signers: SignerWithAddress[] = await hre.ethers.getSigners()

console.log("Deploying DendrETHAdapter...")
const merklePatriciaAddress = MerklePatriciaAddresses[hre.network.config.chainId]
if (!merklePatriciaAddress) {
throw new Error("MerklePatricia Not Found")
}
const dendrETHAdapterFactory: DendrETHAdapter__factory = <DendrETHAdapter__factory>(
await hre.ethers.getContractFactory("DendrETHAdapter")
await hre.ethers.getContractFactory("DendrETHAdapter", {
libraries: {
MerklePatricia: merklePatriciaAddress,
},
})
)
const constructorArguments = [taskArguments.sourceChainId, taskArguments.dendreth] as const
const constructorArguments = [
taskArguments.dendreth,
taskArguments.sourceChainId,
taskArguments.sourceYaho,
] as const

const dendrETHAdapter: DendrETHAdapter = <DendrETHAdapter>(
await dendrETHAdapterFactory.connect(signers[0]).deploy(...constructorArguments)
)
Expand Down

0 comments on commit c668622

Please sign in to comment.