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-2323] Unlist Market #349

Merged
merged 41 commits into from
Sep 5, 2024
Merged
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
9999eda
fix: added unlist function
web3rover Jan 22, 2024
99e8dd8
fix: updates getAssetsIn
web3rover Jan 22, 2024
bba744b
fix: fixed compile error
web3rover Jan 22, 2024
8ad5761
fix: tests for unlist
web3rover Jan 22, 2024
ac789d2
fix: deployed comptroller in bsctestnet
web3rover Jan 25, 2024
5959aed
feat: updating deployment files
Narayanprusty Jan 25, 2024
e36b799
fix: deployed on sepolia and opbnb testnet
web3rover Jan 25, 2024
f4d2f23
Merge branch 'feat/unlist-market' of github.com:VenusProtocol/isolate…
web3rover Jan 25, 2024
6ee64eb
feat: updating deployment files
Narayanprusty Jan 25, 2024
622cb17
fix: added indexed to event
web3rover Jan 29, 2024
dddcd83
fix: fix CI
web3rover Jan 30, 2024
1b21f05
fix: resolved conflict
web3rover Jan 30, 2024
7e1902a
fix: optimised getAssetsIn
web3rover Feb 19, 2024
6dacce2
fix: rebased
web3rover Mar 4, 2024
b03cb62
fix: fixed yarn.lock
web3rover Mar 4, 2024
0b3a26b
fix: only unlist without updating state
web3rover Mar 4, 2024
f038e3e
fix: VPB-05
web3rover Mar 14, 2024
9fd7543
fix: CVP-01
web3rover Mar 14, 2024
144cb97
fix: VPB-01
web3rover Mar 18, 2024
9584519
fix: change storage to memory
web3rover Mar 21, 2024
f85f96e
fix: resolved conflict
web3rover Mar 29, 2024
97871b8
fix: test description
web3rover Mar 29, 2024
cb1826e
fix: removed unwanted deployment file
web3rover Mar 29, 2024
3e957f1
fix: fixed lint
web3rover Mar 29, 2024
d2a0403
fix: updated yarn lock
web3rover Mar 29, 2024
a4d470c
feat: updating deployment files
Narayanprusty Mar 29, 2024
5fd036c
fix: removed deployments
web3rover Mar 29, 2024
26070c2
fix: resolved conflict
web3rover Jun 6, 2024
ebed4aa
fix: deployment on testnets - wip
web3rover Jun 6, 2024
43cda83
feat: updating deployment files
Narayanprusty Jun 6, 2024
e25fc16
fix: deployed on arb sepolia
web3rover Jun 6, 2024
ae3c021
Merge branch 'feat/unlist-market' of github.com:VenusProtocol/isolate…
web3rover Jun 6, 2024
2e64131
feat: updating deployment files
Narayanprusty Jun 6, 2024
0d4f2e3
fix: added missing solcinputs
web3rover Jun 10, 2024
e2d1bf8
Merge branch 'feat/unlist-market' of github.com:VenusProtocol/isolate…
web3rover Jun 10, 2024
89dc5f4
fix: resolved conflict
web3rover Aug 28, 2024
54ad9ee
fix: resolved conflict
web3rover Aug 28, 2024
03519d6
fix: redeployed contracts
web3rover Aug 30, 2024
7d25caf
feat: updating deployment files
Narayanprusty Aug 30, 2024
c5d4db7
fix: deployed on ethereum and arbitrumone
web3rover Sep 2, 2024
581c592
feat: updating deployment files
Narayanprusty Sep 2, 2024
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
Prev Previous commit
Next Next commit
fix: resolved conflict
  • Loading branch information
web3rover committed Mar 29, 2024
commit f85f96e85b571ba2ec6103c2217640c2be001ab8
26 changes: 26 additions & 0 deletions contracts/Comptroller.sol
Original file line number Diff line number Diff line change
@@ -100,6 +100,8 @@ contract Comptroller is

/// @notice Emitted when a market is unlisted
event MarketUnlisted(address indexed vToken);
/// @notice Emitted when the borrowing or redeeming delegate rights are updated for an account
event DelegateUpdated(address indexed approver, address indexed delegate, bool approved);

/// @notice Thrown when collateral factor exceeds the upper bound
error InvalidCollateralFactor();
@@ -320,6 +322,30 @@ contract Comptroller is

return NO_ERROR;
}

/**
* @notice Grants or revokes the borrowing or redeeming delegate rights to / from an account
* If allowed, the delegate will be able to borrow funds on behalf of the sender
* Upon a delegated borrow, the delegate will receive the funds, and the borrower
* will see the debt on their account
* Upon a delegated redeem, the delegate will receive the redeemed amount and the approver
* will see a deduction in his vToken balance
* @param delegate The address to update the rights for
* @param approved Whether to grant (true) or revoke (false) the borrowing or redeeming rights
* @custom:event DelegateUpdated emits on success
* @custom:error ZeroAddressNotAllowed is thrown when delegate address is zero
* @custom:error DelegationStatusUnchanged is thrown if approval status is already set to the requested value
* @custom:access Not restricted
*/
function updateDelegate(address delegate, bool approved) external {
ensureNonzeroAddress(delegate);
if (approvedDelegates[msg.sender][delegate] == approved) {
revert DelegationStatusUnchanged();
}

approvedDelegates[msg.sender][delegate] = approved;
emit DelegateUpdated(msg.sender, delegate, approved);
}

/**
* @notice Removes asset from sender's account liquidity calculation; disabling them as collateral
17 changes: 8 additions & 9 deletions deployments/bsctestnet.json
Original file line number Diff line number Diff line change
@@ -110,7 +110,7 @@
]
},
"ComptrollerImpl": {
"address": "0x3cE617FCeb5e9Ed622F73b483aC7c94053795197",
"address": "0x2CF0e211c99dFd28892cf80D142aA27a9042Dbf4",
"abi": [
{
"inputs": [
@@ -2125,18 +2125,17 @@
"inputs": [
{
"internalType": "address",
"name": "market",
"name": "delegate",
"type": "address"
}
],
"name": "unlistMarket",
"outputs": [
},
{
"internalType": "uint256",
"name": "",
"type": "uint256"
"internalType": "bool",
"name": "approved",
"type": "bool"
}
],
"name": "updateDelegate",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
204 changes: 101 additions & 103 deletions deployments/bsctestnet/ComptrollerImpl.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion deployments/bsctestnet_addresses.json
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
"chainId": "97",
"addresses": {
"ComptrollerBeacon": "0xdDDD7725C073105fB2AbfCbdeC16708fC4c24B74",
"ComptrollerImpl": "0x3cE617FCeb5e9Ed622F73b483aC7c94053795197",
"ComptrollerImpl": "0x2CF0e211c99dFd28892cf80D142aA27a9042Dbf4",
"Comptroller_DeFi": "0x23a73971A6B9f6580c048B9CB188869B2A2aA2aD",
"Comptroller_GameFi": "0x1F4f0989C51f12DAcacD4025018176711f3Bf289",
"Comptroller_LiquidStakedBNB": "0x596B11acAACF03217287939f88d63b51d3771704",
17 changes: 8 additions & 9 deletions deployments/opbnbtestnet.json
Original file line number Diff line number Diff line change
@@ -110,7 +110,7 @@
]
},
"ComptrollerImpl": {
"address": "0x3cE617FCeb5e9Ed622F73b483aC7c94053795197",
"address": "0x17f5D66Fd99FF19B862C831137c39c0B5624e23C",
"abi": [
{
"inputs": [
@@ -2125,18 +2125,17 @@
"inputs": [
{
"internalType": "address",
"name": "market",
"name": "delegate",
"type": "address"
}
],
"name": "unlistMarket",
"outputs": [
},
{
"internalType": "uint256",
"name": "",
"type": "uint256"
"internalType": "bool",
"name": "approved",
"type": "bool"
}
],
"name": "updateDelegate",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
190 changes: 94 additions & 96 deletions deployments/opbnbtestnet/ComptrollerImpl.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion deployments/opbnbtestnet_addresses.json
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
"chainId": "5611",
"addresses": {
"ComptrollerBeacon": "0x2020BDa1F931E07B14C9d346E2f6D5943b4cd56D",
"ComptrollerImpl": "0x3cE617FCeb5e9Ed622F73b483aC7c94053795197",
"ComptrollerImpl": "0x17f5D66Fd99FF19B862C831137c39c0B5624e23C",
"Comptroller_Core": "0x2FCABb31E57F010D623D8d68e1E18Aed11d5A388",
"DefaultProxyAdmin": "0xB1281ADC816fba7df64B798D7A0BC4bd2a6d42f4",
"JumpRateModelV2_base0bps_slope450bps_jump8000bps_kink8000bps": "0x8000eca36201dddf5805Aa4BeFD73d1EB4D23264",
17 changes: 8 additions & 9 deletions deployments/sepolia.json
Original file line number Diff line number Diff line change
@@ -110,7 +110,7 @@
]
},
"ComptrollerImpl": {
"address": "0x3cE617FCeb5e9Ed622F73b483aC7c94053795197",
"address": "0x7b5804A85fB05ebd70f525f06EcF3C238b57f585",
"abi": [
{
"inputs": [
@@ -2125,18 +2125,17 @@
"inputs": [
{
"internalType": "address",
"name": "market",
"name": "delegate",
"type": "address"
}
],
"name": "unlistMarket",
"outputs": [
},
{
"internalType": "uint256",
"name": "",
"type": "uint256"
"internalType": "bool",
"name": "approved",
"type": "bool"
}
],
"name": "updateDelegate",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
196 changes: 97 additions & 99 deletions deployments/sepolia/ComptrollerImpl.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion deployments/sepolia_addresses.json
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
"chainId": "11155111",
"addresses": {
"ComptrollerBeacon": "0x6cE54143a88CC22500D49D744fb6535D66a8294F",
"ComptrollerImpl": "0x3cE617FCeb5e9Ed622F73b483aC7c94053795197",
"ComptrollerImpl": "0x7b5804A85fB05ebd70f525f06EcF3C238b57f585",
"Comptroller_Core": "0x7Aa39ab4BcA897F403425C9C6FDbd0f882Be0D70",
"Comptroller_Curve": "0xD298182D3ACb43e98e32757FF09C91F203e9E67E",
"Comptroller_Liquid Staked ETH": "0xd79CeB8EF8188E44b7Eb899094e8A3A4d7A1e236",
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.