Skip to content

Commit 428ca8b

Browse files
committed
chore: deployed swapper
1 parent 9d8632d commit 428ca8b

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ A collection of Solidity contract examples that integrate with or demonstrate th
77
| Contract | Polygon | Mumbai |
88
| ------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------- |
99
| OffsetHelper | [0xFAFcCd01C395e4542BEed819De61f02f5562fAEa](https://polygonscan.com/address/0xFAFcCd01C395e4542BEed819De61f02f5562fAEa) | [0x30dC279166DCFB69F52C91d6A3380dCa75D0fCa7](https://mumbai.polygonscan.com/address/0x30dC279166DCFB69F52C91d6A3380dCa75D0fCa7) |
10+
| Swapper | [0x1C7f2CCa1Cd52Aae8A25B7BA4b7800c153F48D70](https://polygonscan.com/address/0x1C7f2CCa1Cd52Aae8A25B7BA4b7800c153F48D70) | [0xDd052AcA9AC1492a8b4F1432B68f11989903dE4d](https://mumbai.polygonscan.com/address/0xDd052AcA9AC1492a8b4F1432B68f11989903dE4d) |
1011

1112
## OffsetHelper
1213

hardhat.config.ts

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,51 @@ task("deployOffsetHelper", "Deploys and verifies OffsetHelper")
6868
}
6969
});
7070

71+
task("deploySwapper", "Deploys and verifies Swapper")
72+
.addOptionalParam(
73+
"verify",
74+
"Set false to not verify the Swapper after deployment",
75+
true,
76+
boolean
77+
)
78+
.setAction(async (taskArgs, hre) => {
79+
const Swapper = await hre.ethers.getContractFactory("Swapper");
80+
81+
const addressesToUse =
82+
hre.network.name == "mumbai" ? mumbaiAddresses : addresses;
83+
84+
const swapper = await Swapper.deploy(tokens, [
85+
addressesToUse.bct,
86+
addressesToUse.nct,
87+
addressesToUse.usdc,
88+
addressesToUse.weth,
89+
addressesToUse.wmatic,
90+
]);
91+
await swapper.deployed();
92+
console.log(`Swapper deployed on ${hre.network.name} to:`, swapper.address);
93+
94+
if (taskArgs.verify === true) {
95+
await swapper.deployTransaction.wait(5);
96+
await hre.run("verify:verify", {
97+
address: swapper.address,
98+
constructorArguments: [
99+
tokens,
100+
[
101+
addressesToUse.bct,
102+
addressesToUse.nct,
103+
addressesToUse.usdc,
104+
addressesToUse.weth,
105+
addressesToUse.wmatic,
106+
],
107+
],
108+
});
109+
console.log(
110+
`Swapper verified on ${hre.network.name} to:`,
111+
swapper.address
112+
);
113+
}
114+
});
115+
71116
const config: HardhatUserConfig = {
72117
defaultNetwork: "hardhat",
73118
solidity: {

0 commit comments

Comments
 (0)