Skip to content

Commit 861e27f

Browse files
committed
feat: deploy USDCTreasuryConverter
1 parent 55b693f commit 861e27f

File tree

4 files changed

+113
-20
lines changed

4 files changed

+113
-20
lines changed

deploy/004-single-token-converter.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,5 +108,6 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
108108
};
109109

110110
func.tags = ["SingleTokenConverter", "Converters"];
111+
func.id = "xvs-and-prime-converters"; // id required to prevent re-execution
111112

112113
export default func;
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import { parseUnits } from "ethers/lib/utils";
2+
import { ethers } from "hardhat";
3+
import { DeployFunction } from "hardhat-deploy/types";
4+
import { HardhatRuntimeEnvironment } from "hardhat/types";
5+
import { ADDRESS_ONE } from "../helpers/utils";
6+
7+
const MIN_AMOUNT_TO_CONVERT = parseUnits("10", 18).toString();
8+
9+
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
10+
const { deployments, getNamedAccounts } = hre;
11+
const { deploy } = deployments;
12+
const { deployer } = await getNamedAccounts();
13+
14+
const usdcAddress = (await ethers.getContractOrNull("USDC"))?.address || ADDRESS_ONE;
15+
16+
const acmAddress = (await ethers.getContractOrNull("AccessControlManager"))?.address || ADDRESS_ONE;
17+
const oracleAddress = (await ethers.getContractOrNull("ResilientOracle"))?.address || ADDRESS_ONE;
18+
const singleTokenConverterBeacon = await ethers.getContract("SingleTokenConverterBeacon")!;
19+
20+
const SingleTokenConverter = await ethers.getContractFactory("SingleTokenConverter");
21+
22+
const destinationAddress = (await ethers.getContractOrNull("VTreasury"))?.address || ADDRESS_ONE;
23+
24+
const args: string[] = [acmAddress, oracleAddress, destinationAddress, usdcAddress, MIN_AMOUNT_TO_CONVERT];
25+
26+
await deploy("USDCTreasuryConverter", {
27+
from: deployer,
28+
contract: "BeaconProxy",
29+
args: [singleTokenConverterBeacon.address, SingleTokenConverter.interface.encodeFunctionData("initialize", args)],
30+
log: true,
31+
autoMine: true,
32+
});
33+
};
34+
35+
func.tags = ["SingleTokenConverter"];
36+
func.id = "usdc-treasury-converter"; // id required to prevent re-execution
37+
38+
export default func;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"xvs-and-prime-converters": true
3+
}

yarn.lock

Lines changed: 71 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3146,7 +3146,7 @@ __metadata:
31463146
languageName: node
31473147
linkType: hard
31483148

3149-
"@venusprotocol/governance-contracts@npm:^1.4.0-dev.1":
3149+
"@venusprotocol/governance-contracts@npm:^1.4.0, @venusprotocol/governance-contracts@npm:^1.4.0-dev.1":
31503150
version: 1.4.0
31513151
resolution: "@venusprotocol/governance-contracts@npm:1.4.0"
31523152
dependencies:
@@ -3206,7 +3206,42 @@ __metadata:
32063206
languageName: node
32073207
linkType: hard
32083208

3209-
"@venusprotocol/protocol-reserve@^2.0.0, @venusprotocol/protocol-reserve@workspace:.":
3209+
"@venusprotocol/protocol-reserve@npm:^1.1.0, @venusprotocol/protocol-reserve@npm:^1.4.0":
3210+
version: 1.5.0
3211+
resolution: "@venusprotocol/protocol-reserve@npm:1.5.0"
3212+
dependencies:
3213+
"@nomiclabs/hardhat-ethers": ^2.2.3
3214+
"@openzeppelin/contracts": ^4.8.3
3215+
"@openzeppelin/contracts-upgradeable": ^4.8.3
3216+
"@openzeppelin/hardhat-upgrades": ^1.21.0
3217+
"@solidity-parser/parser": ^0.13.2
3218+
"@venusprotocol/solidity-utilities": ^1.3.0
3219+
ethers: ^5.7.0
3220+
hardhat-deploy: ^0.11.14
3221+
module-alias: ^2.2.2
3222+
checksum: 813bc162103ab756e84bbb0e65fd416ed105cb4a06f9fe55d4a2a066af5bd63b11ca9f2c791376148114ce2b469970c8fe29c85ee1d47f9da9841f2eac8b01e0
3223+
languageName: node
3224+
linkType: hard
3225+
3226+
"@venusprotocol/protocol-reserve@npm:^2.0.0":
3227+
version: 2.2.0
3228+
resolution: "@venusprotocol/protocol-reserve@npm:2.2.0"
3229+
dependencies:
3230+
"@nomiclabs/hardhat-ethers": ^2.2.3
3231+
"@openzeppelin/contracts": ^4.8.3
3232+
"@openzeppelin/contracts-upgradeable": ^4.8.3
3233+
"@openzeppelin/hardhat-upgrades": ^1.21.0
3234+
"@solidity-parser/parser": ^0.13.2
3235+
"@venusprotocol/solidity-utilities": ^2.0.0
3236+
"@venusprotocol/venus-protocol": ^7.5.0
3237+
ethers: ^5.7.0
3238+
hardhat-deploy: ^0.11.14
3239+
module-alias: ^2.2.2
3240+
checksum: ae875b95c1adabcc73ca52f74bf3f875c15e8a29cc6cbdf08038542692e5c397d986424194f1e1819659b0bc17d53770e75e7f74304ecbee24e9e84dd4ef79ed
3241+
languageName: node
3242+
linkType: hard
3243+
3244+
"@venusprotocol/protocol-reserve@workspace:.":
32103245
version: 0.0.0-use.local
32113246
resolution: "@venusprotocol/protocol-reserve@workspace:."
32123247
dependencies:
@@ -3268,23 +3303,6 @@ __metadata:
32683303
languageName: unknown
32693304
linkType: soft
32703305

3271-
"@venusprotocol/protocol-reserve@npm:^1.1.0":
3272-
version: 1.5.0
3273-
resolution: "@venusprotocol/protocol-reserve@npm:1.5.0"
3274-
dependencies:
3275-
"@nomiclabs/hardhat-ethers": ^2.2.3
3276-
"@openzeppelin/contracts": ^4.8.3
3277-
"@openzeppelin/contracts-upgradeable": ^4.8.3
3278-
"@openzeppelin/hardhat-upgrades": ^1.21.0
3279-
"@solidity-parser/parser": ^0.13.2
3280-
"@venusprotocol/solidity-utilities": ^1.3.0
3281-
ethers: ^5.7.0
3282-
hardhat-deploy: ^0.11.14
3283-
module-alias: ^2.2.2
3284-
checksum: 813bc162103ab756e84bbb0e65fd416ed105cb4a06f9fe55d4a2a066af5bd63b11ca9f2c791376148114ce2b469970c8fe29c85ee1d47f9da9841f2eac8b01e0
3285-
languageName: node
3286-
linkType: hard
3287-
32883306
"@venusprotocol/solidity-utilities@npm:2.0.0, @venusprotocol/solidity-utilities@npm:^2.0.0":
32893307
version: 2.0.0
32903308
resolution: "@venusprotocol/solidity-utilities@npm:2.0.0"
@@ -3299,7 +3317,7 @@ __metadata:
32993317
languageName: node
33003318
linkType: hard
33013319

3302-
"@venusprotocol/solidity-utilities@npm:^1.3.0":
3320+
"@venusprotocol/solidity-utilities@npm:^1.2.0, @venusprotocol/solidity-utilities@npm:^1.3.0":
33033321
version: 1.3.0
33043322
resolution: "@venusprotocol/solidity-utilities@npm:1.3.0"
33053323
checksum: d1109365a5e01959c47b25fb129373db93792e60bf1bc0ed324b63c2a64f6e4a7878ebf016cfade94bc41a2c1245d3e861fdc6b8c5844ac210ed1d73e7307e72
@@ -3313,6 +3331,21 @@ __metadata:
33133331
languageName: node
33143332
linkType: hard
33153333

3334+
"@venusprotocol/token-bridge@npm:^1.1.0":
3335+
version: 1.1.0
3336+
resolution: "@venusprotocol/token-bridge@npm:1.1.0"
3337+
dependencies:
3338+
"@layerzerolabs/solidity-examples": ^1.0.0
3339+
"@openzeppelin/contracts": ^4.8.3
3340+
"@openzeppelin/contracts-upgradeable": ^4.8.3
3341+
"@openzeppelin/hardhat-upgrades": ^1.21.0
3342+
"@solidity-parser/parser": ^0.13.2
3343+
ethers: ^5.7.0
3344+
module-alias: ^2.2.2
3345+
checksum: 86c0e758491b63ce7da57aacf764a4d040a54fdc89994c92a79363e4cbb33b84cd1db38630e76cbcc26f6f7a5a676b3ac96871ad98486701982ea4699bdc15f1
3346+
languageName: node
3347+
linkType: hard
3348+
33163349
"@venusprotocol/token-bridge@npm:^2.0.0":
33173350
version: 2.1.0
33183351
resolution: "@venusprotocol/token-bridge@npm:2.1.0"
@@ -3343,6 +3376,24 @@ __metadata:
33433376
languageName: node
33443377
linkType: hard
33453378

3379+
"@venusprotocol/venus-protocol@npm:^7.5.0":
3380+
version: 7.5.0
3381+
resolution: "@venusprotocol/venus-protocol@npm:7.5.0"
3382+
dependencies:
3383+
"@nomicfoundation/hardhat-ethers": ^3.0.0
3384+
"@openzeppelin/contracts": 4.9.3
3385+
"@openzeppelin/contracts-upgradeable": ^4.8.0
3386+
"@venusprotocol/governance-contracts": ^1.4.0
3387+
"@venusprotocol/protocol-reserve": ^1.4.0
3388+
"@venusprotocol/solidity-utilities": ^1.2.0
3389+
"@venusprotocol/token-bridge": ^1.1.0
3390+
bignumber.js: ^9.1.2
3391+
dotenv: ^16.0.1
3392+
module-alias: ^2.2.2
3393+
checksum: 0a39304b6f2e0db05a20dacf6d678f3245be878a121e7d1ddeb503c28974dea9cbec0228be3d03f77abb97d1adb8e6e8ad8708cb730a5833e62c4e6735fb6eea
3394+
languageName: node
3395+
linkType: hard
3396+
33463397
"@venusprotocol/venus-protocol@npm:^9.1.0":
33473398
version: 9.1.0
33483399
resolution: "@venusprotocol/venus-protocol@npm:9.1.0"

0 commit comments

Comments
 (0)