Skip to content

Commit 3dc3f1a

Browse files
committed
chore: adjust deployment for solo crowdsource lender vault deployment, add addresses to v1.5.json
1 parent e3154ac commit 3dc3f1a

2 files changed

Lines changed: 68 additions & 38 deletions

File tree

deployments/protocol/v1.5.json

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,23 @@
44
"chainlinkFeedRegistry": "0x8D5e90706E52a52853dA9A14fA1c63889a412851",
55
"config": "0xd52a2898d61636bB3eEF0d145f05352FF543bdCC",
66
"configSingleton": "0x1f5febF0efA3aD487508b6Cc7f39a0a54DE9De72",
7-
"crowdsourceLenderVault": "",
7+
"crowdsourceLenderVault": "0x533373013Fd978C0c98Cd1Cb0e1684D6142055FB",
88
"hooks": {
99
"compoundLender": "",
1010
"directLenderRepayment": "",
11-
"refinanceBorrowerCreate": ""
11+
"refinanceBorrowerCreate": "",
12+
"vaultLender": "",
13+
"aaveLender": ""
1214
},
1315
"hub": "0x37807A2F031b3B44081F4b21500E5D70EbaDAdd5",
14-
"loan": "",
16+
"loan": "0x7f53449251EF28991C99EA25698B37BC13b173B8",
1517
"loanToken": "0x4440C069272cC34b80C7B11bEE657D0349Ba9C23",
1618
"products": {
17-
"installments": ""
19+
"stable": "",
20+
"installments": "0xEc22A11214567f580ef0f1eD8541c6Ff10d1880d",
21+
"fixed": "",
22+
"uniswapV3Individual": "",
23+
"uniswapV3Set": ""
1824
},
1925
"revokedNonce": "0x972204fF33348ee6889B2d0A3967dB67d7b08e4c",
2026
"utilizedCredit": "0x8E6F44DEa3c11d69C63655BDEcbA25Fa986BCE9D"

script/PWN.s.sol

Lines changed: 58 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ import {
2121
MultiTokenCategoryRegistry,
2222
IChainlinkFeedRegistryLike,
2323
PWNStableProduct,
24-
PWNInstallmentsProduct
24+
PWNInstallmentsProduct,
25+
IAaveLike
2526
} from "pwn/Deployments.sol";
2627

2728
import { PWNCrowdsourceLenderVault } from "pwn/periphery/crowdsource/PWNCrowdsourceLenderVault.sol";
@@ -100,46 +101,55 @@ forge script script/PWN.s.sol:Deploy --sig "deploy()" \
100101
_loadDeployedAddresses();
101102
vm.startBroadcast();
102103

103-
__d.loan = PWNLoan(
104-
_deploy(
105-
PWNContractDeployerSalt.LOAN,
106-
abi.encodePacked(
107-
type(PWNLoan).creationCode,
108-
abi.encode(address(__d.loanToken), address(__d.config), address(__d.categoryRegistry))
109-
)
110-
)
111-
);
112-
113-
__d.products.installments = PWNInstallmentsProduct(
114-
_deploy(
115-
PWNContractDeployerSalt.INSTALLMENTS_PRODUCT,
116-
abi.encodePacked(
117-
type(PWNInstallmentsProduct).creationCode,
118-
abi.encode(address(__d.hub), address(__d.revokedNonce), address(__d.utilizedCredit), address(__d.chainlinkFeedRegistry), __e.chainlinkL2SequencerUptimeFeed, __e.weth)
119-
)
120-
)
121-
);
104+
// __d.loan = PWNLoan(
105+
// _deploy(
106+
// PWNContractDeployerSalt.LOAN,
107+
// abi.encodePacked(
108+
// type(PWNLoan).creationCode,
109+
// abi.encode(address(__d.loanToken), address(__d.config), address(__d.categoryRegistry))
110+
// )
111+
// )
112+
// );
113+
114+
// __d.products.installments = PWNInstallmentsProduct(
115+
// _deploy(
116+
// PWNContractDeployerSalt.INSTALLMENTS_PRODUCT,
117+
// abi.encodePacked(
118+
// type(PWNInstallmentsProduct).creationCode,
119+
// abi.encode(address(__d.hub), address(__d.revokedNonce), address(__d.utilizedCredit), address(__d.chainlinkFeedRegistry), __e.chainlinkL2SequencerUptimeFeed, __e.weth)
120+
// )
121+
// )
122+
// );
123+
124+
// !!! LOADING ADDRESSES FROM JSON DOES NOT WORK SOMEHOW, SO I AM JUST HARDCODING THE ADDRESSES HERE !!!
125+
126+
__d.loan = PWNLoan(0x7f53449251EF28991C99EA25698B37BC13b173B8);
127+
__d.products.installments = PWNInstallmentsProduct(address(0xEc22A11214567f580ef0f1eD8541c6Ff10d1880d));
128+
__e.aave = IAaveLike(address(0x6Ae43d3271ff6888e7Fc43Fd7321a503ff738951));
122129

123130
console2.log("PWNLoan:", address(__d.loan));
124131
console2.log("PWNInstallmentsProduct:", address(__d.products.installments));
125132

126-
address[] memory addrs = new address[](2);
127-
addrs[0] = address(__d.loan);
128-
addrs[1] = address(__d.products.installments);
133+
// address[] memory addrs = new address[](2);
134+
// addrs[0] = address(__d.loan);
135+
// addrs[1] = address(__d.products.installments);
129136

130-
bytes32[] memory tags = new bytes32[](2);
131-
tags[0] = PWNHubTags.ACTIVE_LOAN;
132-
tags[1] = PWNHubTags.LOAN_PROPOSAL;
137+
// bytes32[] memory tags = new bytes32[](2);
138+
// tags[0] = PWNHubTags.ACTIVE_LOAN;
139+
// tags[1] = PWNHubTags.LOAN_PROPOSAL;
133140

134-
// TODO on what contract this should be called?
135-
console2.logBytes(abi.encodeWithSignature("setTags(address[],bytes32[],bool)", addrs, tags, true));
141+
// // TODO on what contract this should be called?
142+
// console2.logBytes(abi.encodeWithSignature("setTags(address[],bytes32[],bool)", addrs, tags, true));
136143

137-
address[] memory feedIntermediaryDenominations = new address[](1);
144+
address[] memory feedIntermediaryDenominations = new address[](0);
138145
// USDC / USD feed + ETH / USD feed
139-
feedIntermediaryDenominations[0] = address(840); // USD representation in chainlink
140-
bool[] memory feedInvertFlags = new bool[](2);
146+
// feedIntermediaryDenominations[0] = address(840); // USD representation in chainlink
147+
// LINK / ETH feed
148+
// feedIntermediaryDenominations[0] = address(0x42585eD362B3f1BCa95c640FdFf35Ef899212734);
149+
bool[] memory feedInvertFlags = new bool[](1);
141150
feedInvertFlags[0] = false;
142-
feedInvertFlags[1] = true;
151+
// feedInvertFlags[0] = false;
152+
// feedInvertFlags[1] = true;
143153

144154
__d.crowdsourceLenderVault = PWNCrowdsourceLenderVault(
145155
_deploy(
@@ -153,16 +163,30 @@ forge script script/PWN.s.sol:Deploy --sig "deploy()" \
153163
address(__e.aave),
154164
"PWNInstallmentsProduct",
155165
"PWNInstallmentsProduct",
166+
// USDC CREDIT on Sepolia
167+
// PWNCrowdsourceLenderVault.Terms({
168+
// collateralAddress: address(0x7b79995e5f793A07Bc00c21412e50Ecae098E7f9),
169+
// creditAddress: address(0x94a9D9AC8a22534E3FaCa9F4e7F2E2cf85d5E4C8),
170+
// feedIntermediaryDenominations: feedIntermediaryDenominations,
171+
// feedInvertFlags: feedInvertFlags,
172+
// loanToValue: 7500, // 75%
173+
// interestAPR: 1000, // 10%
174+
// postponement: 2592000, // 30 days in seconds
175+
// duration: 63072000, // 730 days (2 years) in seconds
176+
// minCreditAmount: 5000000000, // 5000 tokens (assuming 6 decimals)
177+
// expiration: block.timestamp + 10368000 // 120 days from now
178+
// })
179+
// LINK CREDIT on Sepolia
156180
PWNCrowdsourceLenderVault.Terms({
157181
collateralAddress: address(0x7b79995e5f793A07Bc00c21412e50Ecae098E7f9),
158-
creditAddress: address(0x94a9D9AC8a22534E3FaCa9F4e7F2E2cf85d5E4C8),
182+
creditAddress: address(0xf8Fb3713D459D7C1018BD0A49D19b4C44290EBE5),
159183
feedIntermediaryDenominations: feedIntermediaryDenominations,
160184
feedInvertFlags: feedInvertFlags,
161185
loanToValue: 7500, // 75%
162186
interestAPR: 1000, // 10%
163187
postponement: 2592000, // 30 days in seconds
164188
duration: 63072000, // 730 days (2 years) in seconds
165-
minCreditAmount: 5000000000, // 5000 tokens (assuming 6 decimals)
189+
minCreditAmount: 500000000000000000000,
166190
expiration: block.timestamp + 10368000 // 120 days from now
167191
})
168192
)

0 commit comments

Comments
 (0)