Skip to content

Commit

Permalink
Merge pull request #523 from VenusProtocol/feat/ven-2848
Browse files Browse the repository at this point in the history
[VEN-2848] Set TwoKinksInterestRateModel in the vBNB market
  • Loading branch information
web3rover authored Oct 21, 2024
2 parents e261040 + 8581e06 commit 5cd14ae
Show file tree
Hide file tree
Showing 12 changed files with 1,633 additions and 287 deletions.
Binary file added audits/113_twoKinks_certik_20240731.pdf
Binary file not shown.
Binary file added audits/114_twoKinks_fairyproof_20240804.pdf
Binary file not shown.
Binary file added audits/115_twoKinks_quantstamp_20240819.pdf
Binary file not shown.
18 changes: 14 additions & 4 deletions deploy/002-interest-rate-model.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { parseUnits } from "ethers/lib/utils";
import { DeployFunction } from "hardhat-deploy/types";
import { HardhatRuntimeEnvironment } from "hardhat/types";

Expand Down Expand Up @@ -25,18 +26,27 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
});
}

if (network.name === "bscmainnet") {
if (network.name === "bscmainnet" || network.name === "bsctestnet") {
await deploy("InterestRateModelVBNB", {
contract: "JumpRateModel",
contract: "TwoKinksInterestRateModel",
from: deployer,
log: true,
autoMine: true,
args: [0, "225000000000000000", "6800000000000000000", "500000000000000000"],
args: [
0,
parseUnits("0.225", 18),
parseUnits("0.4", 18),
parseUnits("0.35", 18),
parseUnits("0.21", 18),
parseUnits("0.7", 18),
parseUnits("5", 18),
],
});
}
};

func.tags = ["InterestRateModel"];
func.skip = async hre => hre.network.name !== "hardhat" && hre.network.name !== "bscmainnet";
func.skip = async hre =>
hre.network.name !== "hardhat" && hre.network.name !== "bscmainnet" && hre.network.name !== "bsctestnet";

export default func;
240 changes: 140 additions & 100 deletions deployments/bscmainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -6498,98 +6498,190 @@
]
},
"InterestRateModelVBNB": {
"address": "0xDb8347b96c94Be24B9c077A4CDDAAD074F6480cf",
"address": "0xC682145a767ca98B743B895f1Bd2D4696bC9C2eC",
"abi": [
{
"inputs": [
{
"internalType": "uint256",
"name": "baseRatePerYear",
"type": "uint256"
"internalType": "int256",
"name": "baseRatePerYear_",
"type": "int256"
},
{
"internalType": "uint256",
"name": "multiplierPerYear",
"type": "uint256"
"internalType": "int256",
"name": "multiplierPerYear_",
"type": "int256"
},
{
"internalType": "uint256",
"name": "jumpMultiplierPerYear",
"type": "uint256"
"internalType": "int256",
"name": "kink1_",
"type": "int256"
},
{
"internalType": "uint256",
"name": "kink_",
"type": "uint256"
"internalType": "int256",
"name": "multiplier2PerYear_",
"type": "int256"
},
{
"internalType": "int256",
"name": "baseRate2PerYear_",
"type": "int256"
},
{
"internalType": "int256",
"name": "kink2_",
"type": "int256"
},
{
"internalType": "int256",
"name": "jumpMultiplierPerYear_",
"type": "int256"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
"inputs": [],
"name": "InvalidKink",
"type": "error"
},
{
"inputs": [],
"name": "NegativeValueNotAllowed",
"type": "error"
},
{
"inputs": [],
"name": "BASE_RATE_2_PER_BLOCK",
"outputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "baseRatePerBlock",
"type": "uint256"
},
"internalType": "int256",
"name": "",
"type": "int256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "BASE_RATE_PER_BLOCK",
"outputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "multiplierPerBlock",
"type": "uint256"
},
"internalType": "int256",
"name": "",
"type": "int256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "BLOCKS_PER_YEAR",
"outputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "jumpMultiplierPerBlock",
"type": "uint256"
},
"internalType": "int256",
"name": "",
"type": "int256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "JUMP_MULTIPLIER_PER_BLOCK",
"outputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "kink",
"type": "uint256"
"internalType": "int256",
"name": "",
"type": "int256"
}
],
"name": "NewInterestParams",
"type": "event"
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "baseRatePerBlock",
"name": "KINK_1",
"outputs": [
{
"internalType": "uint256",
"internalType": "int256",
"name": "",
"type": "uint256"
"type": "int256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "blocksPerYear",
"name": "KINK_2",
"outputs": [
{
"internalType": "uint256",
"internalType": "int256",
"name": "",
"type": "uint256"
"type": "int256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "MULTIPLIER_2_PER_BLOCK",
"outputs": [
{
"internalType": "int256",
"name": "",
"type": "int256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "MULTIPLIER_PER_BLOCK",
"outputs": [
{
"internalType": "int256",
"name": "",
"type": "int256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "RATE_1",
"outputs": [
{
"internalType": "int256",
"name": "",
"type": "int256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "RATE_2",
"outputs": [
{
"internalType": "int256",
"name": "",
"type": "int256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "uint256",
Expand All @@ -6615,12 +6707,10 @@
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "uint256",
Expand Down Expand Up @@ -6651,12 +6741,10 @@
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "isInterestRateModel",
"outputs": [
Expand All @@ -6666,57 +6754,10 @@
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "jumpMultiplierPerBlock",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "kink",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "multiplierPerBlock",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "uint256",
Expand All @@ -6742,7 +6783,6 @@
"type": "uint256"
}
],
"payable": false,
"stateMutability": "pure",
"type": "function"
}
Expand Down
Loading

0 comments on commit 5cd14ae

Please sign in to comment.