Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New release #550

Merged
merged 21 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
3c460d7
Merge pull request #541 from VenusProtocol/main
chechu Dec 18, 2024
7def41f
feat: deployed irm for bscmainnet
web3rover Dec 26, 2024
30b5160
feat: updating deployment files
web3rover Dec 26, 2024
6af507c
feat: deployed two kinks IRM on bsc mainnet
web3rover Dec 26, 2024
60c87ff
Merge branch 'feat/ven-2975' of github.com:VenusProtocol/venus-protoc…
web3rover Dec 26, 2024
ffede77
feat: updating deployment files
web3rover Dec 26, 2024
b7efd4e
Merge pull request #542 from VenusProtocol/feat/ven-2975
web3rover Dec 31, 2024
64d1396
chore(release): 9.5.0-dev.1 [skip ci]
toolsvenus Dec 31, 2024
2702ab6
refactor: consolidate forked tests env vars
coreyar Dec 30, 2024
05ea2ab
fix: update contract/ artifact paths and imports
coreyar Dec 30, 2024
4065726
refactor: reimport testnet token deployments
coreyar Dec 31, 2024
dd76350
feat: updating deployment files
coreyar Dec 31, 2024
a3baefb
feat: add fork deployment
coreyar Dec 30, 2024
79b9230
chore: relock
coreyar Dec 31, 2024
438d7c6
Merge pull request #543 from VenusProtocol/add-fork-deployments
coreyar Jan 2, 2025
3ad387f
Merge pull request #544 from VenusProtocol/import-missing-tesetnet-to…
coreyar Jan 2, 2025
bf5cf88
chore(release): 9.5.0-dev.2 [skip ci]
toolsvenus Jan 2, 2025
363a26c
feat: add THE market to the Core pool
kkirka Jan 27, 2025
3d14331
feat: updating deployment files
kkirka Jan 27, 2025
d2901b4
Merge pull request #549 from VenusProtocol/feat/the-market
kkirka Jan 29, 2025
18bb0e9
chore(release): 9.5.0-dev.3 [skip ci]
toolsvenus Jan 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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