Skip to content

Commit 38d9491

Browse files
committed
feat: deploy Uniswap v3 proposals to Sepolia
1 parent b3adee7 commit 38d9491

File tree

2 files changed

+59
-22
lines changed

2 files changed

+59
-22
lines changed

deployments/protocol/v1.4.json

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
11
{
2-
2+
"11155111": {
3+
"chainlinkFeedRegistry": "0x8D5e90706E52a52853dA9A14fA1c63889a412851",
4+
"categoryRegistry": "0xbB2168d5546A94AE2DA9254e63D88F7f137B2534",
5+
"configSingleton": "0x1f5febF0efA3aD487508b6Cc7f39a0a54DE9De72",
6+
"config": "0xd52a2898d61636bB3eEF0d145f05352FF543bdCC",
7+
"hub": "0x37807A2F031b3B44081F4b21500E5D70EbaDAdd5",
8+
"loanToken": "0x4440C069272cC34b80C7B11bEE657D0349Ba9C23",
9+
"revokedNonce": "0x972204fF33348ee6889B2d0A3967dB67d7b08e4c",
10+
"utilizedCredit": "0x8E6F44DEa3c11d69C63655BDEcbA25Fa986BCE9D",
11+
"simpleLoan": "0x719A69d0dc67bd3Aa7648D4694081B3c87952797",
12+
"simpleLoanSimpleProposal": "0xe624E7D33baC728bE2bdB606Da0018B6E05A84D9",
13+
"simpleLoanListProposal": "0x7160Ec33788Df9AFb8AAEe777e7Ae21151B51eDd",
14+
"simpleLoanElasticChainlinkProposal": "0x39fd308D651F5add5A4826D12Bf92d9D91E732AC",
15+
"simpleLoanElasticProposal": "0xeC6390D4B22FFfD22E5C5FDB56DaF653C3Cd0626",
16+
"simpleLoanDutchAuctionProposal": "0x1b1394F436cAeaE139131E9bca6f5d5A2A7e1369",
17+
"simpleLoanUniswapV3LPIndividualProposal": "0xF966696BE0623447679AC830FC5bB7bDB15FEAB4",
18+
"simpleLoanUniswapV3LPSetProposal": "0x4D067c921AC90cC4b1e962ea0e743Ef8d85Fb0E9"
19+
}
320
}

script/PWN.s.sol

Lines changed: 41 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ import {
2020
PWNSimpleLoanElasticChainlinkProposal,
2121
PWNSimpleLoanListProposal,
2222
PWNSimpleLoanSimpleProposal,
23+
PWNSimpleLoanUniswapV3LPIndividualProposal,
24+
PWNSimpleLoanUniswapV3LPSetProposal,
2325
PWNLOAN,
2426
PWNRevokedNonce,
2527
PWNUtilizedCredit,
@@ -48,6 +50,8 @@ library PWNContractDeployerSalt {
4850
bytes32 internal constant SIMPLE_LOAN_ELASTIC_PROPOSAL = keccak256("PWNSimpleLoanElasticProposal");
4951
bytes32 internal constant SIMPLE_LOAN_ELASTIC_CHAINLINK_PROPOSAL = keccak256("PWNSimpleLoanElasticChainlinkProposal");
5052
bytes32 internal constant SIMPLE_LOAN_DUTCH_AUCTION_PROPOSAL = keccak256("PWNSimpleLoanDutchAuctionProposal");
53+
bytes32 internal constant SIMPLE_LOAN_UNISWAP_V3_INDIVIDUAL_PROPOSAL = keccak256("PWNSimpleLoanUniswapV3LPIndividualProposal");
54+
bytes32 internal constant SIMPLE_LOAN_UNISWAP_V3_SET_PROPOSAL = keccak256("PWNSimpleLoanUniswapV3LPSetProposal");
5155

5256
}
5357

@@ -90,59 +94,75 @@ contract Deploy is Deployments, Script {
9094

9195
/*
9296
forge script script/PWN.s.sol:Deploy \
93-
--sig "redeploySimpleLoanMultichain()" \
97+
--sig "deployUniswapProposalsMultichain()" \
9498
--private-key $PRIVATE_KEY \
9599
--multi --verify --broadcast
96100
*/
97101
/// addresses set in the `deployments/latest.json`.
98-
function redeploySimpleLoanMultichain() external {
99-
string[] memory chains = new string[](8);
100-
chains[0] = "polygon";
101-
chains[1] = "arbitrum";
102-
chains[2] = "base";
103-
chains[3] = "optimism";
104-
chains[4] = "bsc";
105-
chains[5] = "cronos";
106-
chains[6] = "gnosis";
107-
chains[7] = "world";
102+
function deployUniswapProposalsMultichain() external {
103+
string[] memory chains = new string[](0);
104+
108105
// linea - gas estimate is always super low and tx is pending for days -> execute separately
109106

110107
for (uint256 i; i < chains.length; ++i) {
111-
redeploySimpleLoan(chains[i]);
108+
deployUniswapProposals(chains[i]);
112109
}
113110

114111
}
115112

116113
/*
117114
forge script script/PWN.s.sol:Deploy \
118-
--sig "redeploySimpleLoan(string)" "sepolia" \
115+
--sig "deployUniswapProposals(string)" "sepolia" \
119116
--private-key $PRIVATE_KEY \
120117
--with-gas-price $(cast --to-wei 0.3 gwei) \
121118
--verify --broadcast
122119
*/
123-
function redeploySimpleLoan(string memory chain) public {
120+
function deployUniswapProposals(string memory chain) public {
124121
vm.createSelectFork(chain);
125122
_loadDeployedAddresses();
126123

127124
vm.startBroadcast();
128125

129-
__d.simpleLoan = PWNSimpleLoan(_deploy({
130-
salt: PWNContractDeployerSalt.SIMPLE_LOAN,
126+
__d.simpleLoanUniswapV3LPIndividualProposal = PWNSimpleLoanUniswapV3LPIndividualProposal(_deploy({
127+
salt: PWNContractDeployerSalt.SIMPLE_LOAN_UNISWAP_V3_INDIVIDUAL_PROPOSAL,
131128
bytecode: abi.encodePacked(
132-
type(PWNSimpleLoan).creationCode,
129+
type(PWNSimpleLoanUniswapV3LPIndividualProposal).creationCode,
133130
abi.encode(
134131
address(__d.hub),
135-
address(__d.loanToken),
132+
address(__d.revokedNonce),
136133
address(__d.config),
134+
address(__d.utilizedCredit),
135+
address(__e.uniswapV3Factory),
136+
address(__e.uniswapV3NFTPositionManager),
137+
address(__d.chainlinkFeedRegistry),
138+
address(__e.chainlinkL2SequencerUptimeFeed),
139+
address(__e.weth)
140+
)
141+
)
142+
}));
143+
144+
__d.simpleLoanUniswapV3LPSetProposal = PWNSimpleLoanUniswapV3LPSetProposal(_deploy({
145+
salt: PWNContractDeployerSalt.SIMPLE_LOAN_UNISWAP_V3_SET_PROPOSAL,
146+
bytecode: abi.encodePacked(
147+
type(PWNSimpleLoanUniswapV3LPSetProposal).creationCode,
148+
abi.encode(
149+
address(__d.hub),
137150
address(__d.revokedNonce),
138-
address(__d.categoryRegistry)
151+
address(__d.config),
152+
address(__d.utilizedCredit),
153+
address(__e.uniswapV3Factory),
154+
address(__e.uniswapV3NFTPositionManager),
155+
address(__d.chainlinkFeedRegistry),
156+
address(__e.chainlinkL2SequencerUptimeFeed),
157+
address(__e.weth)
139158
)
140159
)
141160
}));
142161

143-
console2.log("------");
144162
console2.log("chain: %s (%s)", chain, block.chainid);
145-
console2.log("PWNSimpleLoan:", address(__d.simpleLoan));
163+
console2.log("PWNSimpleLoanUniswapV3LPIndividualProposal:", address(__d.simpleLoanUniswapV3LPIndividualProposal));
164+
console2.log("PWNSimpleLoanUniswapV3LPSetProposal:", address(__d.simpleLoanUniswapV3LPSetProposal));
165+
console2.log("------");
146166

147167
vm.stopBroadcast();
148168
}

0 commit comments

Comments
 (0)