-
Notifications
You must be signed in to change notification settings - Fork 200
[REF ONLY] Add BadDebtHelper for atomic bad debt repayment (VIP-604) #666
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
Draft
Debugger022
wants to merge
20
commits into
develop
Choose a base branch
from
feat/VPD-854
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
9c45b3a
feat: add BadDebtHelper for atomic bad debt repayment (VIP-690)
Debugger022 a30ddc7
test: add fork test for BadDebtHelper against BSC mainnet
Debugger022 898ef2e
refactor: simplify BadDebtHelper to plain contract and fix some issues
Debugger022 2695fb3
feat: add deployment script for BadDebtHelper
Debugger022 abf6b42
chore: add BadDebtHelper deployment artifacts for BSC mainnet
Debugger022 022ad22
feat: updating deployment files
Debugger022 984237b
fix(BadDebtHelper): use borrowBalanceCurrent for BNB repayments
Debugger022 0c633af
feat(BadDebtHelper): add sweep function for emergency token recovery
Debugger022 8fbb8c8
feat(BadDebtHelper): return all remaining tokens to timelock after ex…
Debugger022 7425796
test(BadDebtHelper): update fork test for dynamic BNB repayment amounts
Debugger022 b78c003
fix(BadDebtHelper): send remaining tokens to treasury instead of time…
Debugger022 edc087a
refactor(BadDebtHelper): replace misleading event with generic Tokens…
Debugger022 aaa0be2
feat: updating deployment files
Debugger022 8a8e83b
feat: updating deployment files
Debugger022 c880669
feat(BadDebtHelper): cap total THE sweep to 4.05M to preserve vTHE ex…
Debugger022 a533010
feat: redeploy BadDebtHelper to bscmainnet
Debugger022 95c5c2b
feat: updating deployment files
Debugger022 133aeb3
fix(BadDebtHelper): send remaining tokens to treasury instead of time…
Debugger022 915275f
feat: update badDebtHelper deployment
Debugger022 e46feaa
feat: updating deployment files
Debugger022 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| import { DeployFunction } from "hardhat-deploy/types"; | ||
| import { HardhatRuntimeEnvironment } from "hardhat/types"; | ||
|
|
||
| import { skipRemoteNetworks } from "../helpers/deploymentConfig"; | ||
|
|
||
| const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { | ||
| const { deployments, getNamedAccounts } = hre; | ||
| const { deploy } = deployments; | ||
| const { deployer } = await getNamedAccounts(); | ||
|
|
||
| await deploy("BadDebtHelper", { | ||
| contract: "BadDebtHelper", | ||
| from: deployer, | ||
| args: [], | ||
| log: true, | ||
| autoMine: true, | ||
| skipIfAlreadyDeployed: false, | ||
| }); | ||
|
|
||
| return hre.network.live; | ||
| }; | ||
|
|
||
| func.id = "bad_debt_helper_deploy"; | ||
| func.tags = ["BadDebtHelper"]; | ||
| func.skip = skipRemoteNetworks(); | ||
|
|
||
| export default func; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Narrow this deploy to mainnet-only.
Line 24 reuses
skipRemoteNetworks(), which still allowsbsctestnetandhardhat. This helper is wired to BSC mainnet markets/borrowers, so a testnet deployment would produce a contract that looks valid but points at the wrong pool state and timelock. Please gate this script tobscmainnetonly, or explicitly to forkedhardhatif you need local smoke deployments.🤖 Prompt for AI Agents