@@ -103,7 +103,7 @@ 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(0x7f53449251EF28991C99EA25698B37BC13b173B8 );
106+ __d.loan = PWNLoan (0xc58791ec351349a82036aE712976109C10e34217 );
107107 __e.aave = IAaveLike (address (0x6Ae43d3271ff6888e7Fc43Fd7321a503ff738951 ));
108108 __d.hub = PWNHub (0x37807A2F031b3B44081F4b21500E5D70EbaDAdd5 );
109109 __d.revokedNonce = PWNRevokedNonce (0x972204fF33348ee6889B2d0A3967dB67d7b08e4c );
@@ -118,19 +118,21 @@ forge script script/PWN.s.sol:Deploy --sig "deploy()" \
118118 __d.config = PWNConfig (0xd52a2898d61636bB3eEF0d145f05352FF543bdCC );
119119 __d.categoryRegistry = MultiTokenCategoryRegistry (0xbB2168d5546A94AE2DA9254e63D88F7f137B2534 );
120120
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- );
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));
134136
135137 // __d.products.installments = PWNInstallmentsProduct(
136138 // _deploy(
@@ -149,95 +151,51 @@ forge script script/PWN.s.sol:Deploy --sig "deploy()" \
149151 // )
150152 // );
151153
152- console2.log ("PWNLoan: " , address (__d.loan));
153154 // console2.log("PWNInstallmentsProduct:", address(__d.products.installments));
154- // console2.log("Aave:", address(__e.aave));
155155
156- // address[] memory addrs = new address[](2 );
156+ // address[] memory addrs = new address[](1 );
157157 // addrs[0] = address(__d.loan);
158- // addrs[1] = address(__d.products.installments);
159158
160- address [] memory addrs = new address [](1 );
161- addrs[0 ] = address (__d.loan);
162-
163- // bytes32[] memory tags = new bytes32[](2);
159+ // bytes32[] memory tags = new bytes32[](1);
164160 // tags[0] = PWNHubTags.ACTIVE_LOAN;
165- // tags[1] = PWNHubTags.LOAN_PROPOSAL;
166-
167- bytes32 [] memory tags = new bytes32 [](1 );
168- tags[0 ] = PWNHubTags.ACTIVE_LOAN;
169161
170- // // TODO on what contract this should be called?
171- console2.logBytes (abi.encodeWithSignature ("setTags(address[],bytes32[],bool) " , addrs, tags, true ));
162+ // note: this should be called on the protocolTimelock contract and use `schedule` and then `execute`
163+ // functions where the target arg is the PWNHub and the data is the encoded bytes logged below
164+ // note 2: when setting tags for proposal, it needs to have both LOAN_PROPOSAL and NONCE_MANAGER
165+ // tags in order to work fully correctly
166+ // console2.logBytes(abi.encodeWithSignature("setTags(address[],bytes32[],bool)", addrs, tags, true));
172167
173168 address [] memory feedIntermediaryDenominations = new address [](1 );
174169 feedIntermediaryDenominations[0 ] = address (0x0000000000000000000000000000000000000348 );
175- // USDC / USD feed + ETH / USD feed
176- // feedIntermediaryDenominations[0] = address(840); // USD representation in chainlink
177- // LINK / ETH feed
178- // feedIntermediaryDenominations[0] = address(0x42585eD362B3f1BCa95c640FdFf35Ef899212734);
179- // EUR / ETH feed
180- // feedIntermediaryDenominations[0] = address(0x1a81afB8146aeFfCFc5E50e8479e826E7D55b910);
181170 bool [] memory feedInvertFlags = new bool [](2 );
182171 feedInvertFlags[0 ] = false ;
183172 feedInvertFlags[1 ] = true ;
184- // feedInvertFlags[0] = false;
185- // feedInvertFlags[1] = true;
186173
174+ __d.loan = PWNLoan (0xc58791ec351349a82036aE712976109C10e34217 );
175+ __d.products.installments = PWNInstallmentsProduct (0x68669e7ec29070e3dfa684cb4893282Cd4C9E608 );
176+ __e.aave = IAaveLike (address (0x6Ae43d3271ff6888e7Fc43Fd7321a503ff738951 ));
187177
188178 __d.crowdsourceLenderVault = PWNCrowdsourceLenderVault (
189179 _deploy (
190180 PWNContractDeployerSalt.CROWDSOURCE_LENDER_VAULT,
191181 abi.encodePacked (
192182 type (PWNCrowdsourceLenderVault).creationCode,
193- // TODO Terms terms parameter
194183 abi.encode (
195184 address (__d.loan),
196185 address (__d.products.installments),
197186 address (__e.aave),
198187 "PWNInstallmentsProduct " ,
199188 "PWNInstallmentsProduct " ,
200- // USDC CREDIT on Sepolia
201- // PWNCrowdsourceLenderVault.Terms({
202- // collateralAddress: address(0x7b79995e5f793A07Bc00c21412e50Ecae098E7f9),
203- // creditAddress: address(0x94a9D9AC8a22534E3FaCa9F4e7F2E2cf85d5E4C8),
204- // feedIntermediaryDenominations: feedIntermediaryDenominations,
205- // feedInvertFlags: feedInvertFlags,
206- // loanToValue: 7500, // 75%
207- // interestAPR: 1000, // 10%
208- // postponement: 2592000, // 30 days in seconds
209- // duration: 63072000, // 730 days (2 years) in seconds
210- // minCreditAmount: 5000000000, // 5000 tokens (assuming 6 decimals)
211- // expiration: block.timestamp + 10368000 // 120 days from now
212- // })
213- // LINK CREDIT on Sepolia
214- // PWNCrowdsourceLenderVault.Terms({
215- // collateralAddress: address(0x7b79995e5f793A07Bc00c21412e50Ecae098E7f9),
216- // creditAddress: address(0xf8Fb3713D459D7C1018BD0A49D19b4C44290EBE5),
217- // feedIntermediaryDenominations: feedIntermediaryDenominations,
218- // feedInvertFlags: feedInvertFlags,
219- // loanToValue: 7500, // 75%
220- // interestAPR: 1000, // 10%
221- // postponement: 2592000, // 30 days in seconds
222- // duration: 63072000, // 730 days (2 years) in seconds
223- // minCreditAmount: 500000000000000000000,
224- // expiration: block.timestamp + 10368000 // 120 days from now
225- // })
226- // EURS CREDIT on Sepolia
227189 PWNCrowdsourceLenderVault.Terms ({
228190 collateralAddress: address (0x7b79995e5f793A07Bc00c21412e50Ecae098E7f9 ),
229191 creditAddress: address (0x6d906e526a4e2Ca02097BA9d0caA3c382F52278E ),
230192 feedIntermediaryDenominations: feedIntermediaryDenominations,
231193 feedInvertFlags: feedInvertFlags,
232194 loanToValue: 7500 , // 75%
233195 interestAPR: 1000 , // 10%
234- // postponement: 2592000, // 30 days in seconds
235196 postponement: 1200 , // 20 minutes in seconds
236- // duration: 63072000, // 730 days (2 years) in seconds
237197 duration: 7200 , // 2 hours in seconds
238- // minCreditAmount: 50000, // 500 EURS
239198 minCreditAmount: 10000 , // 100 EURS
240- // expiration: block.timestamp + 10368000 // 120 days from now
241199 expiration: block .timestamp + 36000 // 10 hours from now
242200 })
243201 )
@@ -247,8 +205,6 @@ forge script script/PWN.s.sol:Deploy --sig "deploy()" \
247205
248206 console2.log ("PWNCrowdsourceLenderVault: " , address (__d.crowdsourceLenderVault));
249207
250- // TODO anything else to do here?
251-
252208 vm.stopBroadcast ();
253209 }
254210
0 commit comments