Skip to content

Commit 3d76d24

Browse files
committed
chore(PWN.s.sol): update deploy script for mainnet deploy
1 parent 8e842be commit 3d76d24

1 file changed

Lines changed: 74 additions & 65 deletions

File tree

script/PWN.s.sol

Lines changed: 74 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -103,77 +103,86 @@ forge script script/PWN.s.sol:Deploy --sig "deploy()" \
103103

104104
// !!! TODO LOADING ADDRESSES FROM JSON DOES NOT WORK SOMEHOW, SO I AM JUST HARDCODING THE ADDRESSES HERE !!!
105105

106-
__d.loan = PWNLoan(0xc58791ec351349a82036aE712976109C10e34217);
107-
__e.aave = IAaveLike(address(0x6Ae43d3271ff6888e7Fc43Fd7321a503ff738951));
106+
__d.loanToken = PWNLOAN(0x4440C069272cC34b80C7B11bEE657D0349Ba9C23);
107+
__d.config = PWNConfig(0xd52a2898d61636bB3eEF0d145f05352FF543bdCC);
108+
__d.categoryRegistry = MultiTokenCategoryRegistry(0xbB2168d5546A94AE2DA9254e63D88F7f137B2534);
109+
110+
__d.loan = PWNLoan(
111+
_deploy(
112+
PWNContractDeployerSalt.LOAN,
113+
abi.encodePacked(
114+
type(PWNLoan).creationCode,
115+
abi.encode(
116+
address(__d.loanToken),
117+
address(__d.config),
118+
address(__d.categoryRegistry)
119+
)
120+
)
121+
)
122+
);
123+
124+
console2.log("PWNLoan:", address(__d.loan));
125+
108126
__d.hub = PWNHub(0x37807A2F031b3B44081F4b21500E5D70EbaDAdd5);
109127
__d.revokedNonce = PWNRevokedNonce(0x972204fF33348ee6889B2d0A3967dB67d7b08e4c);
110128
__d.utilizedCredit = PWNUtilizedCredit(0x8E6F44DEa3c11d69C63655BDEcbA25Fa986BCE9D);
111129
__d.chainlinkFeedRegistry = IChainlinkFeedRegistryLike(0x8D5e90706E52a52853dA9A14fA1c63889a412851);
112130
__e.chainlinkL2SequencerUptimeFeed = address(0x0000000000000000000000000000000000000000);
113-
__e.weth = address(0x7b79995e5f793A07Bc00c21412e50Ecae098E7f9);
114-
__d.products.installments = PWNInstallmentsProduct(0x68669e7ec29070e3dfa684cb4893282Cd4C9E608);
131+
__e.weth = address(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2);
115132

133+
__d.products.installments = PWNInstallmentsProduct(
134+
_deploy(
135+
PWNContractDeployerSalt.INSTALLMENTS_PRODUCT,
136+
abi.encodePacked(
137+
type(PWNInstallmentsProduct).creationCode,
138+
abi.encode(
139+
address(__d.hub),
140+
address(__d.revokedNonce),
141+
address(__d.utilizedCredit),
142+
address(__d.chainlinkFeedRegistry),
143+
__e.chainlinkL2SequencerUptimeFeed,
144+
__e.weth
145+
)
146+
)
147+
)
148+
);
116149

117-
__d.loanToken = PWNLOAN(0x4440C069272cC34b80C7B11bEE657D0349Ba9C23);
118-
__d.config = PWNConfig(0xd52a2898d61636bB3eEF0d145f05352FF543bdCC);
119-
__d.categoryRegistry = MultiTokenCategoryRegistry(0xbB2168d5546A94AE2DA9254e63D88F7f137B2534);
150+
console2.log("PWNInstallmentsProduct:", address(__d.products.installments));
151+
152+
address[] memory addrs = new address[](3);
153+
addrs[0] = address(__d.loan);
154+
addrs[1] = address(__d.products.installments);
155+
addrs[2] = address(__d.products.installments);
120156

121-
// __d.loan = PWNLoan(
122-
// _deploy(
123-
// PWNContractDeployerSalt.LOAN,
124-
// abi.encodePacked(
125-
// type(PWNLoan).creationCode,
126-
// abi.encode(
127-
// address(__d.loanToken),
128-
// address(__d.config),
129-
// address(__d.categoryRegistry)
130-
// )
131-
// )
132-
// )
133-
// );
134-
135-
// console2.log("PWNLoan:", address(__d.loan));
136-
137-
// __d.products.installments = PWNInstallmentsProduct(
138-
// _deploy(
139-
// PWNContractDeployerSalt.INSTALLMENTS_PRODUCT,
140-
// abi.encodePacked(
141-
// type(PWNInstallmentsProduct).creationCode,
142-
// abi.encode(
143-
// address(__d.hub),
144-
// address(__d.revokedNonce),
145-
// address(__d.utilizedCredit),
146-
// address(__d.chainlinkFeedRegistry),
147-
// __e.chainlinkL2SequencerUptimeFeed,
148-
// __e.weth
149-
// )
150-
// )
151-
// )
152-
// );
153-
154-
// console2.log("PWNInstallmentsProduct:", address(__d.products.installments));
155-
156-
// address[] memory addrs = new address[](1);
157-
// addrs[0] = address(__d.loan);
158-
159-
// bytes32[] memory tags = new bytes32[](1);
160-
// tags[0] = PWNHubTags.ACTIVE_LOAN;
157+
bytes32[] memory tags = new bytes32[](3);
158+
tags[0] = PWNHubTags.ACTIVE_LOAN;
159+
tags[1] = PWNHubTags.LOAN_PROPOSAL;
160+
tags[2] = PWNHubTags.NONCE_MANAGER;
161161

162162
// note: this should be called on the protocolTimelock contract and use `schedule` and then `execute`
163163
// functions where the target arg is the PWNHub and the data is the encoded bytes logged below
164164
// note 2: when setting tags for proposal, it needs to have both LOAN_PROPOSAL and NONCE_MANAGER
165165
// tags in order to work fully correctly
166-
// console2.logBytes(abi.encodeWithSignature("setTags(address[],bytes32[],bool)", addrs, tags, true));
167-
168-
address[] memory feedIntermediaryDenominations = new address[](1);
169-
feedIntermediaryDenominations[0] = address(0x0000000000000000000000000000000000000348);
170-
bool[] memory feedInvertFlags = new bool[](2);
166+
console2.logBytes(abi.encodeWithSignature("setTags(address[],bytes32[],bool)", addrs, tags, true));
167+
168+
/*
169+
USDC --> rETH route
170+
1) USDC --> USD ( 0x8fFfFfd4AfB6115b954Bd326cbe7B4BA576818f6 , non inverted )
171+
2) USD --> ETH ( 0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419 , inverted )
172+
3) eth --> rETH ( 0x536218f9E9Eb48863970252233c8F271f554C2d0 , inverted )
173+
*/
174+
175+
address[] memory feedIntermediaryDenominations = new address[](2);
176+
feedIntermediaryDenominations[0] = address(0x0000000000000000000000000000000000000348); // USD
177+
feedIntermediaryDenominations[1] = address(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE); // ETH
178+
bool[] memory feedInvertFlags = new bool[](3);
171179
feedInvertFlags[0] = false;
172180
feedInvertFlags[1] = true;
181+
feedInvertFlags[2] = true;
173182

174-
__d.loan = PWNLoan(0xc58791ec351349a82036aE712976109C10e34217);
175-
__d.products.installments = PWNInstallmentsProduct(0x68669e7ec29070e3dfa684cb4893282Cd4C9E608);
176-
__e.aave = IAaveLike(address(0x6Ae43d3271ff6888e7Fc43Fd7321a503ff738951));
183+
// __d.loan = PWNLoan(0xc58791ec351349a82036aE712976109C10e34217);
184+
// __d.products.installments = PWNInstallmentsProduct(0x68669e7ec29070e3dfa684cb4893282Cd4C9E608);
185+
__e.aave = IAaveLike(address(0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2));
177186

178187
__d.crowdsourceLenderVault = PWNCrowdsourceLenderVault(
179188
_deploy(
@@ -183,20 +192,20 @@ forge script script/PWN.s.sol:Deploy --sig "deploy()" \
183192
abi.encode(
184193
address(__d.loan),
185194
address(__d.products.installments),
186-
address(__e.aave),
187-
"PWNInstallmentsProduct",
188-
"PWNInstallmentsProduct",
195+
address(__e.aave),
196+
"BordelMortgageVaultShare",
197+
"BORDEL",
189198
PWNCrowdsourceLenderVault.Terms({
190-
collateralAddress: address(0x7b79995e5f793A07Bc00c21412e50Ecae098E7f9),
191-
creditAddress: address(0x6d906e526a4e2Ca02097BA9d0caA3c382F52278E),
199+
collateralAddress: address(0xae78736Cd615f374D3085123A210448E74Fc6393), // rETH
200+
creditAddress: address(0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48), // USDC
192201
feedIntermediaryDenominations: feedIntermediaryDenominations,
193202
feedInvertFlags: feedInvertFlags,
194203
loanToValue: 7500, // 75%
195-
interestAPR: 1000, // 10%
196-
postponement: 1200, // 20 minutes in seconds
197-
duration: 7200, // 2 hours in seconds
198-
minCreditAmount: 10000, // 100 EURS
199-
expiration: block.timestamp + 36000 // 10 hours from now
204+
interestAPR: 200, // 2%
205+
postponement: 15780000, // 6 months in seconds
206+
duration: 157800000, // 5 years in seconds
207+
minCreditAmount: 180000000000, // 180 000 USDC (6 decimals)
208+
expiration: block.timestamp + 8640000 // 100 days from now
200209
})
201210
)
202211
)

0 commit comments

Comments
 (0)