From 81e7c8d5d7d6bd6881fca6c27388a2c2f15f1b41 Mon Sep 17 00:00:00 2001 From: Didi Date: Tue, 24 Sep 2024 12:14:55 +0200 Subject: [PATCH] [ETHEREUM-CONTRACTS] more realistic fUSDC (#2023) * fUSDC with 6 decimals (like the real USDC) * update truffle verification plugin --- packages/ethereum-contracts/CHANGELOG.md | 1 + .../ops-scripts/deploy-test-environment.js | 24 ++++++++++++------- packages/ethereum-contracts/package.json | 2 +- yarn.lock | 8 +++---- 4 files changed, 21 insertions(+), 14 deletions(-) diff --git a/packages/ethereum-contracts/CHANGELOG.md b/packages/ethereum-contracts/CHANGELOG.md index 61135dd11a..9c57537df5 100644 --- a/packages/ethereum-contracts/CHANGELOG.md +++ b/packages/ethereum-contracts/CHANGELOG.md @@ -9,6 +9,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm * `IUserDefinedMacro`: added a method `postCheck()` which allows to verify state changes after running the macro. * `SuperfluidFrameworkDeployer` now also deploys and `MacroForwarder` and enables it as trusted forwarder. +* `deploy-test-environment.js` now deploys fUSDC (the underlying) with 6 decimals (instead of 18) to better resemble the actual USDC. ### Fixed diff --git a/packages/ethereum-contracts/ops-scripts/deploy-test-environment.js b/packages/ethereum-contracts/ops-scripts/deploy-test-environment.js index 9367bca817..aff42e9465 100644 --- a/packages/ethereum-contracts/ops-scripts/deploy-test-environment.js +++ b/packages/ethereum-contracts/ops-scripts/deploy-test-environment.js @@ -57,26 +57,32 @@ module.exports = eval(`(${S.toString()})()`)(async function ( let tokens; if (args.length >= 1) { - tokens = args.pop().split(","); + const tokenSymbols = args.pop().split(","); + tokens = tokenSymbols.map((symbol) => ({ symbol, decimals: 18})); } else { - tokens = ["fDAI", "fUSDC", "fTUSD", config.nativeTokenSymbol]; + tokens = [ + { symbol: "fDAI", decimals: 18 }, + { symbol: "fUSDC", decimals: 6 }, + { symbol: "fTUSD", decimals: 18 }, + { symbol: "ETH", decimals: 18 } + ]; } - console.log("Tokens to be deployed", tokens); + console.log("Super Tokens to be deployed", tokens.map((t) => t.symbol + "x")); console.log("======== Deploying superfluid framework ========"); await deployFramework(errorHandler, options); console.log("==== Superfluid framework deployed ========"); for (let i = 0; i < tokens.length; ++i) { - if (tokens[i] !== deploySuperToken) { // ??? + if (tokens[i].symbol !== config.nativeTokenSymbol) { console.log(`======== Deploying test token ${tokens[i]} ========`); - await deployTestToken(errorHandler, [":", tokens[i]], options); - console.log(`======== Test token ${tokens[i]} deployed ========`); + await deployTestToken(errorHandler, [":", tokens[i].decimals, tokens[i].symbol], options); + console.log(`======== Test token ${tokens[i].symbol} deployed ========`); } - console.log(`======== Creating super token for ${tokens[i]} ========`); - await deploySuperToken(errorHandler, [":", tokens[i]], options); - console.log(`======== Super token for ${tokens[i]} deployed ========`); + console.log(`======== Creating super token for ${tokens[i].symbol} ========`); + await deploySuperToken(errorHandler, [":", tokens[i].symbol], options); + console.log(`======== Super token for ${tokens[i].symbol} deployed ========`); } if (process.env.RESOLVER_ADDRESS) { diff --git a/packages/ethereum-contracts/package.json b/packages/ethereum-contracts/package.json index f7f72e77d7..b5a48bd700 100644 --- a/packages/ethereum-contracts/package.json +++ b/packages/ethereum-contracts/package.json @@ -12,7 +12,7 @@ "hardhat": "2.22.9" }, "devDependencies": { - "@d10r/truffle-plugin-verify": "^0.6.10", + "@d10r/truffle-plugin-verify": "^0.6.11", "@nomiclabs/hardhat-truffle5": "^2.0.7", "@safe-global/safe-core-sdk": "^3.3.5", "@safe-global/safe-service-client": "^2.0.3", diff --git a/yarn.lock b/yarn.lock index 412379766b..b0787bf07c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1009,10 +1009,10 @@ dependencies: "@jridgewell/trace-mapping" "0.3.9" -"@d10r/truffle-plugin-verify@^0.6.10": - version "0.6.10" - resolved "https://registry.yarnpkg.com/@d10r/truffle-plugin-verify/-/truffle-plugin-verify-0.6.10.tgz#f37d0b50ea3ec3e9ce5e8beed4bdb6df59404fd6" - integrity sha512-aCqotcE3usTImVRM9DW9z1nyR6LA+0t5GSlgivTnHYonWpBChkz5rFHAoHwyKsZU9BeJbPwLYwpB9K2ldWojdg== +"@d10r/truffle-plugin-verify@^0.6.11": + version "0.6.11" + resolved "https://registry.yarnpkg.com/@d10r/truffle-plugin-verify/-/truffle-plugin-verify-0.6.11.tgz#d10d1923b1344f14b513c0d7ce831c5cfa1407ba" + integrity sha512-jWn2WpiA2fas05XqjJtTLXcOJ4XRL+etf2A/in86AtqN88tImYbcoPIg+S8TpDp/Qum+PGr9edDof/ui1Q/jCw== dependencies: "@truffle/resolver" "^9.0.35" axios "^0.26.1"