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

[VEN-2848] Set TwoKinksInterestRateModel in the vBNB market #523

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
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.5", 18),
parseUnits("0.1", 18),
parseUnits("0.7", 18),
parseUnits("6.8", 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": "0xc9Be85a8851348f40A6f4773E0fAbC5459E38611",
"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
Loading