Skip to content

Commit

Permalink
chore: compile typechain
Browse files Browse the repository at this point in the history
  • Loading branch information
jr-alpaca committed May 9, 2023
1 parent 94b1f6d commit ff7040e
Show file tree
Hide file tree
Showing 8 changed files with 613 additions and 1,168 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ cache/
node_modules/
typechain/

yarn-error.log/
yarn-error.log

broadcast/

Expand Down
46 changes: 34 additions & 12 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -1,40 +1,62 @@
import fs from "fs";
import { HardhatUserConfig } from "hardhat/config";
import { config as dotEnvConfig } from "dotenv";
dotEnvConfig();

import "@openzeppelin/hardhat-upgrades";
import "@nomiclabs/hardhat-ethers";
import "@typechain/hardhat";
import "hardhat-deploy";

function getRemappings() {
return fs
.readFileSync("remappings.txt", "utf8")
.split("\n")
.filter(Boolean)
.map((line) => line.trim().split("="));
}

module.exports = {
defaultNetwork: "hardhat",
networks: {
// rinkeby: {
// url: process.env.RINKEBY_RPC,
// accounts:
// process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [],
// },
mainnet: {
chainId: 56,
url: process.env.BSC_RPC_URL,
accounts: process.env.DEPLOYER_PRIVATE_KEY !== undefined ? [process.env.DEPLOYER_PRIVATE_KEY] : [],
},
},
solidity: {
version: "0.8.13",
version: "0.8.19",
settings: {
optimizer: {
enabled: true,
runs: 200,
runs: 1,
},
evmVersion: "istanbul",
},
},
paths: {
sources: "./contracts",
tests: "./test",
sources: "./solidity/contracts",
tests: "./tests",
cache: "./cache",
artifacts: "./artifacts",
},
typechain: {
outDir: "./typechain",
target: process.env.TYPECHAIN_TARGET || "ethers-v5",
},
mocha: {
timeout: 100000,
// This fully resolves paths for imports in the ./lib directory for Hardhat
preprocess: {
eachLine: (hre: any) => ({
transform: (line: string) => {
if (line.match(/^\s*import /i)) {
getRemappings().forEach(([find, replace]) => {
if (line.match(find)) {
line = line.replace(find, replace);
}
});
}
return line;
},
}),
},
};
19 changes: 10 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{
"name": "@alpaca-finance/alpaca-money-market",
"version": "0.0.1",
"main": "index.js",
"license": "MIT",
"scripts": {
"compile": "hardhat compile && yarn build",
"compile": "hardhat typechain --config hardhat.config.ts",
"build:cjs": "tsc -p tsconfig.cjs.json",
"build": "yarn run build:cjs",
"exec:bsc_mainnet:proxy-admin:deploy": "forge script script/deployments/ProxyAdmin/deploy/ProxyAdmin.s.sol --rpc-url bsc_mainnet --broadcast --slow",
Expand Down Expand Up @@ -57,6 +56,14 @@
"exec:bsc_mainnet:double-slope-model2:deploy": "forge script script/deployments/InterestModels/deploy/MMDoubleSlopeModel2.s.sol --rpc-url bsc_mainnet --broadcast --slow",
"exec:bsc_mainnet:double-slope-model3:deploy": "forge script script/deployments/InterestModels/deploy/MMDoubleSlopeModel3.s.sol --rpc-url bsc_mainnet --broadcast --slow"
},
"devDependencies": {
"@typechain/ethers-v5": "^10.0.0",
"@typechain/hardhat": "^5.0.0",
"@types/mocha": "^9.1.0",
"ts-node": "^10.7.0",
"typescript": "^4.6.2",
"typechain": "^8.0.0"
},
"dependencies": {
"@nomiclabs/hardhat-ethers": "^2.0.5",
"@openzeppelin/hardhat-upgrades": "^1.16.1",
Expand All @@ -65,15 +72,9 @@
"dotenv": "^16.0.0",
"ethers": "^5.6.1",
"hardhat": "^2.9.1",
"hardhat-deploy": "^0.11.10",
"prettier": "^2.6.0",
"prettier-plugin-solidity": "^1.0.0-beta.19",
"commander": "^9.2.0"
},
"devDependencies": {
"@typechain/hardhat": "^5.0.0",
"@types/mocha": "^9.1.0",
"ts-node": "^10.7.0",
"typescript": "^4.6.2",
"typechain": "^8.0.0"
}
}
Loading

0 comments on commit ff7040e

Please sign in to comment.