Skip to content

Commit 8e842be

Browse files
committed
chore: update v1.5 addresses in deployment json, remove commented code from PWN.s.sol
1 parent 0317036 commit 8e842be

2 files changed

Lines changed: 29 additions & 73 deletions

File tree

deployments/protocol/v1.5.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"chainlinkFeedRegistry": "0x8D5e90706E52a52853dA9A14fA1c63889a412851",
55
"config": "0xd52a2898d61636bB3eEF0d145f05352FF543bdCC",
66
"configSingleton": "0x1f5febF0efA3aD487508b6Cc7f39a0a54DE9De72",
7-
"crowdsourceLenderVault": "0x533373013Fd978C0c98Cd1Cb0e1684D6142055FB",
7+
"crowdsourceLenderVault": "0x2474d856d1463435932866de8118CC40Ed3c01d8",
88
"hooks": {
99
"compoundLender": "",
1010
"directLenderRepayment": "",
@@ -13,11 +13,11 @@
1313
"aaveLender": ""
1414
},
1515
"hub": "0x37807A2F031b3B44081F4b21500E5D70EbaDAdd5",
16-
"loan": "0x7f53449251EF28991C99EA25698B37BC13b173B8",
16+
"loan": "0xc58791ec351349a82036aE712976109C10e34217",
1717
"loanToken": "0x4440C069272cC34b80C7B11bEE657D0349Ba9C23",
1818
"products": {
1919
"stable": "",
20-
"installments": "0xEc22A11214567f580ef0f1eD8541c6Ff10d1880d",
20+
"installments": "0x68669e7ec29070e3dfa684cb4893282Cd4C9E608",
2121
"fixed": "",
2222
"uniswapV3Individual": "",
2323
"uniswapV3Set": ""

script/PWN.s.sol

Lines changed: 26 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)