Skip to content

Commit

Permalink
added delegatee param in gov input for add new colateral type.
Browse files Browse the repository at this point in the history
  • Loading branch information
MrDeadCe11 committed Jul 11, 2024
1 parent 6dc7908 commit f8664db
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
3 changes: 2 additions & 1 deletion gov-input/mainnet/new-AddCollateral.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"LiquidationEngine_Address": "",
"TaxCollector_Address": "",
"GlobalSettlement_Address": "",
"Delegatee": "0x0000000000000000000000000000000000000000",
"SAFEEngineCollateralParams": {
"collateralDebtCeiling": "500000000000000000000000000000000000000000000000",
"collateralDebtFloor": "100000000000000000000000000000000000000000000000"
Expand All @@ -25,7 +26,7 @@
"taxPercentage": "200000000000000000"
},
"LiquidationEngineCollateralParams": {
"newCAHChild": "0x293b702362918e990Dd5f48a80fB139FeAd64263",
"newCAHChild": "0xb043A91C26b79620aaa06C02Ddcd78F3649b27CF",
"liquidationPenalty": "1000000000000000000",
"liquidationQuantity": "1000000000000000000000000000000000000000000000"
},
Expand Down
2 changes: 1 addition & 1 deletion gov-input/mainnet/new-TargetsAndCalldata.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "add secondary tax receiver for WETH",
"network": "mainnet",
"proposalType": "TargetsAndCalldata",
"ODGovernor_Address": "",
"ODGovernor_Address": "0xf704735CE81165261156b41D33AB18a08803B86F",
"objectArray": [
{
"target": "0xc93F938A95488a03b976A15B20fAcFD52D087fB2",
Expand Down
12 changes: 9 additions & 3 deletions src/contracts/Generate/GenerateAddCollateralProposal.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ contract GenerateAddCollateralProposal is Generator, JSONScript {
address public liquidationEngine;
address public oracleRelayer;
address public newCAddress;
address public delegatee;

ICollateralAuctionHouse.CollateralAuctionHouseParams internal _cahCParams;
ISAFEEngine.SAFEEngineCollateralParams internal _SAFEEngineCollateralParams;
Expand Down Expand Up @@ -97,6 +98,7 @@ contract GenerateAddCollateralProposal is Generator, JSONScript {
taxCollector = json.readAddress(string(abi.encodePacked('.TaxCollector_Address:')));
liquidationEngine = json.readAddress(string(abi.encodePacked('.LiquidationEngine_Address:')));
oracleRelayer = json.readAddress(string(abi.encodePacked('.OracleRelayer_Address:')));
delegatee = json.readAddress(string(abi.encodePacked('.Delegatee')));

_cahCParams.minimumBid = json.readUint(string(abi.encodePacked('.CollateralAuctionHouseParams.minimumBid')));
_cahCParams.minDiscount = json.readUint(string(abi.encodePacked('.CollateralAuctionHouseParams.minDiscount')));
Expand Down Expand Up @@ -158,9 +160,13 @@ contract GenerateAddCollateralProposal is Generator, JSONScript {
// Get calldata for:

bytes[] memory calldatas = new bytes[](7);

calldatas[0] = abi.encodeWithSelector(ICollateralJoinFactory.deployCollateralJoin.selector, newCType, newCAddress);

if (delegatee != address(0)) {
calldatas[0] = abi.encodeWithSelector(
ICollateralJoinFactory.deployDelegatableCollateralJoin.selector, newCType, newCAddress, delegatee
);
} else {
calldatas[0] = abi.encodeWithSelector(ICollateralJoinFactory.deployCollateralJoin.selector, newCType, newCAddress);
}
calldatas[1] = abi.encodeWithSelector(
IModifiablePerCollateral.initializeCollateralType.selector, newCType, abi.encode(_cahCParams)
);
Expand Down

0 comments on commit f8664db

Please sign in to comment.