Skip to content

Commit 22f881b

Browse files
Merge pull request #12 from lazaralex98/prt168-reupload-offsetHelper-mumbai
Prt168 Redeploy OffsetHelper on Mumbai
2 parents 54f4826 + 9335700 commit 22f881b

File tree

4 files changed

+30
-15
lines changed

4 files changed

+30
-15
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ A collection of examples that implement, integrate with or otherwise use Toucan'
66

77
The `OffsetHelper` abstracts the carbon offsetting process offered by Toucan to make it easier. Instead of you manually swapping your USDC for NCT, redeeming the NCT for TCO2, then retiring the TCO2... you can just use the `OffsetHelper` to swiftly do this process in 1-2 transactions.
88

9-
You can find the `OffsetHelper` deployed [here on Polygon mainnet](https://polygonscan.com/address/0x79E63048B355F4FBa192c5b28687B852a5521b31) and [here on Mumbai](https://mumbai.polygonscan.com/address/0x1A38e74D5190bA69938979aBe69ceb7b823209d3), but you are free to deploy your own or even import this contract in your own to extend it.
10-
9+
You can find the `OffsetHelper` deployed [here on Polygon mainnet](https://polygonscan.com/address/0x79E63048B355F4FBa192c5b28687B852a5521b31) and [here on Mumbai](https://mumbai.polygonscan.com/address/0x9910788B676Cee48476B10982DD754B8D55F2c2c), but you are free to deploy your own or even import this contract in your own to extend it.
1110

1211
This contract has 2 main methods that users would interact with: `autoOffset` and `autoOffsetUsingPoolToken`.
1312

scripts/deployOffsetHelper.ts

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,30 @@
1-
import { ethers } from "hardhat";
2-
import addresses from "../utils/addresses";
3-
import tokens from "../utils/tokens";
1+
import { ethers, network } from "hardhat";
2+
import addresses, { mumbaiAddresses } from "../utils/addresses";
3+
import { tokens } from "../utils/tokens";
44

55
async function main() {
66
const OffsetHelper = await ethers.getContractFactory("OffsetHelper");
7-
const oh = await OffsetHelper.deploy(
8-
tokens,
9-
[
7+
if (network.name === "mumbai") {
8+
const oh = await OffsetHelper.deploy(tokens, [
9+
mumbaiAddresses.bct,
10+
mumbaiAddresses.nct,
11+
mumbaiAddresses.usdc,
12+
mumbaiAddresses.weth,
13+
mumbaiAddresses.wmatic,
14+
]);
15+
console.log("OffsetHelper deployed on Mumbai to:", oh.address);
16+
await oh.deployed();
17+
} else {
18+
const oh = await OffsetHelper.deploy(tokens, [
1019
addresses.bct,
1120
addresses.nct,
1221
addresses.usdc,
1322
addresses.weth,
1423
addresses.wmatic,
15-
]
16-
);
17-
18-
await oh.deployed();
19-
20-
console.log("OffsetHelper deployed to:", oh.address);
24+
]);
25+
console.log("OffsetHelper deployed on Polygon to:", oh.address);
26+
await oh.deployed();
27+
}
2128
}
2229

2330
main().catch((error) => {

utils/addresses.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,13 @@ const addresses: IfcAddresses = {
1616
wmatic: "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",
1717
};
1818

19+
export const mumbaiAddresses: IfcAddresses = {
20+
myAddress: "0x721F6f7A29b99CbdE1F18C4AA7D7AEb31eb2923B",
21+
bct: "0xf2438A14f668b1bbA53408346288f3d7C71c10a1",
22+
nct: "0x7beCBA11618Ca63Ead5605DE235f6dD3b25c530E",
23+
usdc: "0xe6b8a5CF854791412c1f6EFC7CAf629f5Df1c747",
24+
weth: "0xA6FA4fB5f76172d178d61B04b0ecd319C5d1C0aa",
25+
wmatic: "0x9c3C9283D3e44854697Cd22D3Faa240Cfb032889",
26+
};
27+
1928
export default addresses;

utils/deployArguments.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import addresses from "./addresses";
2-
import tokens from "./tokens";
2+
import { tokens } from "./tokens";
33

44
module.exports = [
55
tokens,

0 commit comments

Comments
 (0)