Skip to content

Commit

Permalink
feat: Add task for config of wrapped native token on testnet (#43)
Browse files Browse the repository at this point in the history
bump versions & add task for testnet configurations
  • Loading branch information
miguelmtzinf authored Aug 23, 2023
2 parents f032945 + 2c72c03 commit c76e314
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 35 deletions.
4 changes: 4 additions & 0 deletions deploy/01-after-deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ const func: DeployFunction = async function ({
await hre.run("setup-liquidation-protocol-fee");

if (isTestnetMarket(poolConfig)) {
// Disable faucet minting and borrowing of wrapped native token
await hre.run("disable-faucet-native-testnets");
console.log("- Minting and borrowing of wrapped native token disabled");

// Unpause pool
const poolConfigurator = await getPoolConfiguratorProxy();
await waitForTx(await poolConfigurator.setPoolPause(false));
Expand Down
49 changes: 16 additions & 33 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"main": "dist/helpers/index.js",
"devDependencies": {
"@aave/aave-token": "^1.0.4",
"@aave/core-v3": "^1.17.1",
"@aave/periphery-v3": "^1.23.1",
"@aave/core-v3": "^1.19.0",
"@aave/periphery-v3": "^2.4.1",
"@aave/safety-module": "^1.0.3",
"@nomicfoundation/hardhat-chai-matchers": "^1.0.5",
"@nomicfoundation/hardhat-toolbox": "^2.0.0",
Expand Down
49 changes: 49 additions & 0 deletions tasks/misc/disable-faucet-native-testnets.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { task } from "hardhat/config";
import {
getFaucet,
getWrappedTokenGateway,
getPoolConfiguratorProxy,
} from "../../helpers/contract-getters";
import { waitForTx } from "../../helpers/utilities/tx";

task(
`disable-faucet-native-testnets`,
`Disables faucet of native tokens and borrowing of native tokens`
).setAction(async ({}, hre) => {
const { deployer } = await hre.getNamedAccounts();
const signer = await hre.ethers.getSigner(deployer);

const faucetContract = await getFaucet();

const wrappedTokenGatewayV3 = await getWrappedTokenGateway();

const wrappedTokenAddress = await wrappedTokenGatewayV3.getWETHAddress();

console.log(
`Faucet contract to disable minting for asset ${wrappedTokenAddress}`
);

await waitForTx(
await faucetContract.connect(signer).setMintable(wrappedTokenAddress, false)
);

console.log(
`Faucet contract disabled minting for asset ${wrappedTokenAddress}`
);

const poolConfiguratorProxyContract = await getPoolConfiguratorProxy();

console.log(
`Update reserve for asset ${wrappedTokenAddress} to setReserveBorrowing to false`
);

await waitForTx(
await poolConfiguratorProxyContract
.connect(signer)
.setReserveBorrowing(wrappedTokenAddress, false)
);

console.log(
`Successfully updated reserve for asset ${wrappedTokenAddress} to setReserveBorrowing to false`
);
});

0 comments on commit c76e314

Please sign in to comment.