Skip to content

Commit

Permalink
refactor: moved contract addresses from json to constant ts file
Browse files Browse the repository at this point in the history
  • Loading branch information
Debugger022 committed Sep 1, 2023
1 parent 94ecdeb commit dc60a00
Show file tree
Hide file tree
Showing 15 changed files with 1,937 additions and 718 deletions.
27 changes: 5 additions & 22 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,11 @@ const config: HardhatUserConfig = {
],
},
networks: {
hardhat: isFork(),
hardhat: {
allowUnlimitedContractSize: true,
loggingEnabled: false,
live: false,
},
development: {
url: "http://127.0.0.1:8545/",
chainId: 31337,
Expand Down Expand Up @@ -215,25 +219,4 @@ const config: HardhatUserConfig = {
},
};

function isFork() {
return process.env.FORK_MAINNET === "true"
? {
allowUnlimitedContractSize: false,
loggingEnabled: false,
forking: {
url: `https://white-ultra-silence.bsc.discover.quiknode.pro/${process.env.QUICK_NODE_KEY}/`,
blockNumber: 21068448,
},
accounts: {
accountsBalance: "1000000000000000000",
},
live: false,
}
: {
allowUnlimitedContractSize: true,
loggingEnabled: false,
live: false,
};
}

export default config;
5 changes: 2 additions & 3 deletions tests/hardhat/Fork/RewardsForkTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ import {
VToken,
VToken__factory,
} from "../../../typechain";
import CONTRACT_ADDRESSES from "./constants/Contracts.json";
import { initMainnetUser, setForkBlock } from "./utils";
import { getContractAddresses, initMainnetUser, setForkBlock } from "./utils";

const { expect } = chai;
chai.use(smock.matchers);
Expand All @@ -42,7 +41,7 @@ const {
BLOCK_NUMBER,
REWARD_DISTRIBUTOR1,
BINANCE_ORACLE,
} = CONTRACT_ADDRESSES[network as string];
} = getContractAddresses(network as string);

const MANTISSA_ONE = convertToUnit(1, 18);

Expand Down
Loading

0 comments on commit dc60a00

Please sign in to comment.