Skip to content

Commit

Permalink
Merge pull request #550 from VenusProtocol/develop
Browse files Browse the repository at this point in the history
New release
  • Loading branch information
chechu authored Jan 29, 2025
2 parents 5972bfd + 18bb0e9 commit 1b6d83f
Show file tree
Hide file tree
Showing 65 changed files with 79,823 additions and 15,761 deletions.
4 changes: 1 addition & 3 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# true or false
FORK=false
FORKED_NETWORK=bscmainnet

MNEMONIC="here is where your twelve words mnemonic should be put my friend"
Expand All @@ -24,4 +22,4 @@ DEPLOYER_PRIVATE_KEY=
#ARCHIVE_NODE_basemainnet=https://open-platform.nodereal.io/<YOUR_KEY_HERE>/base

ETHERSCAN_API_KEY=
REPORT_GAS=
REPORT_GAS=
2 changes: 1 addition & 1 deletion .eslinttsconfigrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"extends": "./tsconfig.json",
"include": ["./typechain", "./deploy", "./tests", "./script", "./scenario", "saddle.config.js", "docgen-templates", "commitlint.config.js", "./hardhat.config.zksync.ts"]
"include": ["./typechain", "./deploy", "./tests", "./script", "./scenario", "saddle.config.js", "docgen-templates", "commitlint.config.js", "./hardhat.config.zksync.ts", "type-extensions.ts"]
}
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,34 @@
## [9.5.0-dev.3](https://github.com/VenusProtocol/venus-protocol/compare/v9.5.0-dev.2...v9.5.0-dev.3) (2025-01-29)


### Features

* add THE market to the Core pool ([363a26c](https://github.com/VenusProtocol/venus-protocol/commit/363a26c171c39c93feb577fdc916b95cf222f89c))
* updating deployment files ([3d14331](https://github.com/VenusProtocol/venus-protocol/commit/3d14331c2e2de84bf8ff672ed3d3d9fceeae6bf5))

## [9.5.0-dev.2](https://github.com/VenusProtocol/venus-protocol/compare/v9.5.0-dev.1...v9.5.0-dev.2) (2025-01-02)


### Features

* add fork deployment ([a3baefb](https://github.com/VenusProtocol/venus-protocol/commit/a3baefb694a0efb2ad099ac2d4d279a8d91f5046))
* updating deployment files ([dd76350](https://github.com/VenusProtocol/venus-protocol/commit/dd76350d649705549a699ca85dd5d9ebb7297543))


### Bug Fixes

* update contract/ artifact paths and imports ([05ea2ab](https://github.com/VenusProtocol/venus-protocol/commit/05ea2ab863882a04d695f91a93657458275d6ea4))

## [9.5.0-dev.1](https://github.com/VenusProtocol/venus-protocol/compare/v9.4.0...v9.5.0-dev.1) (2024-12-31)


### Features

* deployed irm for bscmainnet ([7def41f](https://github.com/VenusProtocol/venus-protocol/commit/7def41f6b23e264500a0f1fc6cc8ecd736eca21e))
* deployed two kinks IRM on bsc mainnet ([6af507c](https://github.com/VenusProtocol/venus-protocol/commit/6af507c4c362a0262a0397da301fab5493ed98cf))
* updating deployment files ([ffede77](https://github.com/VenusProtocol/venus-protocol/commit/ffede7701698dd2e542a81b4d0fb49c83f802d56))
* updating deployment files ([30b5160](https://github.com/VenusProtocol/venus-protocol/commit/30b51601480bbbe60bfb702bb772282fe5c08b05))

## [9.4.0](https://github.com/VenusProtocol/venus-protocol/compare/v9.3.0...v9.4.0) (2024-12-18)


Expand Down
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Contract tests are defined under the [tests directory](https://github.com/VenusP
```

- To run fork tests add `FORK=true`, `FORKED_NETWORK` and one `ARCHIVE_NODE` var in the `.env` file.
- To run fork tests set the`FORKED_NETWORK` var in the `.env` file. An env variable with the name `ARCHIVE_NODE_<FORKED_NETWORK>` is also required.

## Code Coverage

Expand All @@ -107,6 +107,16 @@ npx hardhat deploy
- In the deployment scripts you have added `tags` for example: - `func.tags = ["MockTokens"];`
- Once this is done, adding `--tags "<tag_name>,<tag_name>..."` to the deployment command will execute only the scripts containing the tags.

### Dry Run / Forked Deployments

To simulate what contracts would be deployed on a given network the deployment scripts support running on a forked network. To run the deployment scripts on a forked network the `HARDHAT_FORK_NETWORK` env variable needs to be set.

For example

```bash
HARDHAT_FORK_NETWORK=ethereum npx hardhat deploy
```

### Deployed Contracts

Contract addresses deployed before `hardhat-deploy` was adopted are available in the `networking` directory in JSON files by network name.
Expand Down
57 changes: 57 additions & 0 deletions deploy/002-interest-rate-model.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import { BigNumber, BigNumberish } from "ethers";
import { parseUnits } from "ethers/lib/utils";
import { DeployFunction } from "hardhat-deploy/types";
import { HardhatRuntimeEnvironment } from "hardhat/types";

const mantissaToBps = (num: BigNumberish) => {
return BigNumber.from(num).div(parseUnits("1", 14)).toString();
};

const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const { deployments, getNamedAccounts, network } = hre;
const { deploy } = deployments;
Expand Down Expand Up @@ -34,6 +39,58 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
autoMine: true,
args: [0, parseUnits("0.03", 18), parseUnits("4.5", 18), parseUnits("0.9", 18)],
});

let baseRatePerYear = parseUnits("0", 18);
let multiplierPerYear = parseUnits("0.175", 18);
let jumpMultiplierPerYear = parseUnits("2.5", 18);
let kink = parseUnits("0.8", 18);
const [b, m, j, k] = [baseRatePerYear, multiplierPerYear, jumpMultiplierPerYear, kink].map(mantissaToBps);
let rateModelName = `JumpRateModel_base${b}bps_slope${m}bps_jump${j}bps_kink${k}bps`;

await deploy(rateModelName, {
contract: "JumpRateModel",
from: deployer,
log: true,
autoMine: true,
args: [baseRatePerYear, multiplierPerYear, jumpMultiplierPerYear, kink],
skipIfAlreadyDeployed: true,
});

baseRatePerYear = parseUnits("0", 18);
multiplierPerYear = parseUnits("0.15", 18);
jumpMultiplierPerYear = parseUnits("3", 18);
kink = parseUnits("0.8", 18);
const baseRatePerYear2 = parseUnits("0", 18);
const multiplierPerYear2 = parseUnits("0.9", 18);
const kink2_ = parseUnits("0.9", 18);

const [b1, m1, k1, m2, b2, k2, j2] = [
baseRatePerYear,
multiplierPerYear,
kink,
multiplierPerYear2,
baseRatePerYear2,
kink2_,
jumpMultiplierPerYear,
].map(mantissaToBps);
rateModelName = `TwoKinks_base${b1}bps_slope${m1}bps_kink${k1}bps_slope2${m2}bps_base2${b2}bps_kink2${k2}bps_jump${j2}bps`;

await deploy(rateModelName, {
contract: "TwoKinksInterestRateModel",
from: deployer,
log: true,
autoMine: true,
args: [
baseRatePerYear,
multiplierPerYear,
kink,
multiplierPerYear2,
baseRatePerYear2,
kink2_,
jumpMultiplierPerYear,
],
skipIfAlreadyDeployed: true,
});
}

if (network.name === "bscmainnet" || network.name === "bsctestnet") {
Expand Down
Loading

0 comments on commit 1b6d83f

Please sign in to comment.