fix: remove account with uma (#4548)

Signed-off-by: Pablo Maldonado <pablo@umaproject.org>
This commit is contained in:
Pablo Maldonado
2023-05-05 09:31:51 +01:00
committed by GitHub
parent b0f3e22836
commit 5fdd2fe0c5
3 changed files with 17 additions and 21 deletions
+7 -9
View File
@@ -14,7 +14,7 @@ import { BigNumber, BigNumberish, BytesLike, Signer } from "ethers";
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
import { OptimisticOracleRequestStatesEnum, PriceRequestStatusEnum } from "@uma/common";
import { OptimisticOracleV2Ethers, StoreEthers } from "@uma/contracts-node";
import { OptimisticOracleV2Ethers, StoreEthers, getAddress } from "@uma/contracts-node";
import { REQUIRED_SIGNER_ADDRESSES, SECONDS_PER_DAY } from "../utils/constants";
import { getContractInstance } from "../utils/contracts";
@@ -41,7 +41,6 @@ interface RewardTrackers {
}
const foundationAddress = REQUIRED_SIGNER_ADDRESSES.foundation;
const accountWithUma = REQUIRED_SIGNER_ADDRESSES.account_with_uma;
const zeroBigNumber = hre.ethers.BigNumber.from(0);
@@ -199,16 +198,15 @@ async function main() {
const finalFee = (await store.computeFinalFee(votingToken.address)).rawValue;
console.log(" 1. Funding foundation account...");
// Consolidate foundation balance with other large UMA holder account to be able to fund simulated voters.
// Make sure both accounts have enough ETH to pay for gas.
const etherAmount = hre.ethers.utils.parseEther("10.0").toHexString();
await hre.network.provider.send("hardhat_setBalance", [accountWithUma, etherAmount]);
await hre.network.provider.send("hardhat_setBalance", [foundationAddress, etherAmount]);
const accountWithUmaSigner = await hre.ethers.getImpersonatedSigner(accountWithUma);
const foundationSigner = await hre.ethers.getImpersonatedSigner(foundationAddress);
await votingToken
.connect(accountWithUmaSigner)
.transfer(foundationAddress, await votingToken.balanceOf(accountWithUma));
const votingV2Address = await getAddress("VotingV2", 1);
await hre.network.provider.send("hardhat_setBalance", [votingV2Address, etherAmount]);
const votingMinterSigner = await hre.ethers.getImpersonatedSigner(votingV2Address);
await votingToken.connect(votingMinterSigner).mint(foundationAddress, hre.ethers.utils.parseEther("50000000"));
let foundationBalance = await votingToken.balanceOf(foundationAddress);
console.log(` 2. Foundation has ${formatEther(foundationBalance)} UMA, funding requester and voters...`);
-1
View File
@@ -2,7 +2,6 @@
const REQUIRED_SIGNER_ADDRESSES = {
deployer: "0x2bAaA41d155ad8a4126184950B31F50A1513cE25",
foundation: "0x8180d59b7175d4064bdfa8138a58e9babffda44a",
account_with_uma: "0xc19B1ac01eb8c9d75b996B030110353C8F09d1Af",
};
// Net ID that this script should simulate with.
@@ -4,6 +4,7 @@ const { toWei } = Web3.utils;
const { getContract, web3 } = hre;
const { _getContractAddressByName } = require("./index.js");
const { REQUIRED_SIGNER_ADDRESSES } = require("./constants");
const { getAddress } = require("@uma/contracts-node");
const ExpandedERC20 = getContract("ExpandedERC20");
@@ -21,18 +22,16 @@ async function _seedProposerWithUma(proposer, amountToSend = toWei("50000")) {
.send({ from: REQUIRED_SIGNER_ADDRESSES["foundation"] });
console.log(`Transaction: ${txn?.transactionHash}`);
await web3.eth.sendTransaction({
from: accounts[0],
to: REQUIRED_SIGNER_ADDRESSES["account_with_uma"],
value: toWei("1"),
const votingV2Address = await getAddress("VotingV2", 1);
const etherAmount = hre.ethers.utils.parseEther("10.0").toHexString();
await hre.network.provider.send("hardhat_setBalance", [votingV2Address, etherAmount]);
await hre.network.provider.request({
method: "hardhat_impersonateAccount",
params: [votingV2Address],
});
await uma.methods.mint(REQUIRED_SIGNER_ADDRESSES["foundation"], toWei("50000000")).send({
from: votingV2Address,
});
await uma.methods
.transfer(
REQUIRED_SIGNER_ADDRESSES["foundation"],
await uma.methods.balanceOf(REQUIRED_SIGNER_ADDRESSES["account_with_uma"]).call()
)
.send({ from: REQUIRED_SIGNER_ADDRESSES["account_with_uma"] });
console.log(
"Balance UMA foundation wallet:",