Skip to content

Commit 7215ed7

Browse files
authored
Merge pull request #105 from Uniswap/deploy-v0
feat: Initial Deployments
2 parents 1574c97 + 79b6a55 commit 7215ed7

File tree

11 files changed

+31799
-35390
lines changed

11 files changed

+31799
-35390
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,26 @@ Ethereum Mainnet
157157

158158
> Crosschain system coming at a later date
159159
160+
## Deployed Addresses
161+
162+
### Ethereum Mainnet (Chain ID: 1)
163+
164+
| Contract | Address |
165+
|----------|---------|
166+
| MainnetDeployer | [`0xd0457dfABEf856bCb5eCaF3681E78F94b0639e8c`](https://etherscan.io/address/0xd0457dfABEf856bCb5eCaF3681E78F94b0639e8c) |
167+
| TokenJar | [`0x13d1687CA0FD1a5Ac3fDFB1269b6dbD2E25F7777`](https://etherscan.io/address/0x13d1687CA0FD1a5Ac3fDFB1269b6dbD2E25F7777) |
168+
| Releaser (Firepit) | [`0x6531E445D742a5d8cA28aE3CBD344042fE604AfF`](https://etherscan.io/address/0x6531E445D742a5d8cA28aE3CBD344042fE604AfF) |
169+
| V3FeeAdapter | [`0x927b985a90AbE651D74Bbe76DC4071092A28b4A2`](https://etherscan.io/address/0x927b985a90AbE651D74Bbe76DC4071092A28b4A2) |
170+
| UNI Vesting | [`0xF32d53AE98c4D6aB04d4b870fF9a97f37a724F79`](https://etherscan.io/address/0xF32d53AE98c4D6aB04d4b870fF9a97f37a724F79) |
171+
172+
### Unichain (Chain ID: 130)
173+
174+
| Contract | Address |
175+
|----------|---------|
176+
| UnichainDeployer | [`0xD16c47bf3ae22e0B2BAc5925D990b81416f18dea`](https://uniscan.xyz/address/0xD16c47bf3ae22e0B2BAc5925D990b81416f18dea) |
177+
| TokenJar | [`0xD576BDF6b560079a4c204f7644e556DbB19140b5`](https://uniscan.xyz/address/0xD576BDF6b560079a4c204f7644e556DbB19140b5) |
178+
| Releaser (OptimismBridgedResourceFirepit) | [`0xe0A780E9105aC10Ee304448224Eb4A2b11A77eeB`](https://uniscan.xyz/address/0xe0A780E9105aC10Ee304448224Eb4A2b11A77eeB) |
179+
160180
## Development
161181

162182
### Prerequisites

merkle-generator/data/merkle-tree.json

Lines changed: 16017 additions & 33405 deletions
Large diffs are not rendered by default.

merkle-generator/data/raw.csv

Lines changed: 15539 additions & 0 deletions
Large diffs are not rendered by default.

merkle-generator/data/token-pairs.csv

Lines changed: 0 additions & 1932 deletions
Large diffs are not rendered by default.

merkle-generator/proof.json

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
{
2+
"root": "0xdbc884abb1e0cfedd01db2ea427d6b8df7be2e63edcc701475387a28edb9a23e",
3+
"pairs": [
4+
{
5+
"token0": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
6+
"token1": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
7+
},
8+
{
9+
"token0": "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599",
10+
"token1": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
11+
}
12+
],
13+
"multiProof": {
14+
"leaves": [
15+
[
16+
"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
17+
"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
18+
],
19+
[
20+
"0x2260fac5e5542a773aa44fbcfedf7c193bc2c599",
21+
"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
22+
]
23+
],
24+
"proof": [
25+
"0x64701c9d6df20883102b4515d64953bf39ee59f3069bbb679d1507d8ed141094",
26+
"0xebe503100b6f442e8fc9c3a88b20c2ab46230de463f3979281a03fe582e02b35",
27+
"0xf06032377c885016664b258e117b5163e3609e532b129e2ba3b66858c24f9889",
28+
"0x1ba2f8601dc46cf2749ef039f27a70910cf925e57e23b4984e4bb19225c11099",
29+
"0x3c51f66c15458221ac9963a9d574e61160ecb8e66decb19a8246aac08adc9354",
30+
"0xd5a6a0c83b99e0da6befae76bbaea274622433e73c7a40b605ddb2fdf093fbe4",
31+
"0x71d40c8eacf44542626e7dce1bd1edcc197f8de627879f0e68dc19281004ef55",
32+
"0xf3c97348efd75483909898c9bcf563a16afaa1ced605c753adb2e684d8374546",
33+
"0x3e5ee723f1d8bc4b7980214b050d0fd8c7437937ccaf1464cc1bf79a7012198f",
34+
"0x039e11de6ee037d54be0d93bbd710f3d278430a4c43f1f0f75da3b320126f030",
35+
"0x460625c5bf45d5312c2afc4fdb0977135c8188624f9bfd5635db628e1866553a",
36+
"0xa1f0c468b4035d7f6a10eade0c1d6a96f3b265fe6a857ce2532f12ebb8830def",
37+
"0xb3a361e8e5cc08a64a724efe50643874da0b4b537871607e02b597a0cde605f8",
38+
"0xcdcddb5c974b65f576d39cd91a23a6791349db8b17deb50201f1426e225907c6",
39+
"0x7fc77f680964afa66598f98cba163bf9b508dc3c0ddc38a3fca74d69016f26a6",
40+
"0xc8f85d9bf23cd7894a0a34d3f6cf71b7916cea62a51a7cae14fc8ea1026f723d",
41+
"0x3908366418e98d71e2fc20b99865d1ed75ae093a03242ac6f49f34cb0122a8bd",
42+
"0x373722d492d5d2e45864d991439089e5f781a23025b2bd35af9cd0f1cd59634d",
43+
"0xb2224a08e832916a5b6c7275020ec7b095aa83e1f8a867a7a0e070b180c11a3b",
44+
"0x7681fd79562f8f6d0dd64e124a734b61f7eb06e9d1ccc71ca09a8234410d7018",
45+
"0x364acd3000cff9daa7fc419b53e7c352a696a7e8ab222cf410b82e1b1159d296",
46+
"0x0c95736773f2b7f44aa6442abdec9f6cd0414777e47cc58cff4f10fd33db7161",
47+
"0x035b0f1ff844997b364e73e1783babb476c599824cd398a23c484f9c480e0188",
48+
"0xd66e35b63e56a201fef4bd81d2ea4e31c395fab8d7578d1193d1155c790ff2ad"
49+
],
50+
"proofFlags": [
51+
false,
52+
false,
53+
false,
54+
false,
55+
false,
56+
false,
57+
false,
58+
false,
59+
false,
60+
false,
61+
false,
62+
false,
63+
false,
64+
false,
65+
false,
66+
false,
67+
false,
68+
false,
69+
false,
70+
false,
71+
false,
72+
false,
73+
false,
74+
false,
75+
true
76+
]
77+
},
78+
"valid": true,
79+
"usage": {
80+
"description": "Use this multi-proof for batch verification of multiple token pairs",
81+
"note": "The order of leaves may differ from input order - they are reordered by the tree"
82+
}
83+
}

merkle-generator/src/cli.ts

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,4 +307,86 @@ program
307307
}
308308
});
309309

310+
// Parse-pools command - extracts token pairs from raw SQL output
311+
program
312+
.command('parse-pools')
313+
.description('Parse raw SQL pool data and extract unique token pairs')
314+
.argument('[input-file]', 'Path to raw CSV file from SQL query', './data/raw.csv')
315+
.option('-o, --output <file>', 'Output file for token pairs', './data/token-pairs.csv')
316+
.action(async (inputFile, options) => {
317+
try {
318+
console.log('Parsing pool data from:', inputFile);
319+
320+
// Read raw CSV
321+
const content = readFileSync(inputFile, 'utf-8');
322+
323+
// Use csv-parse to handle quoted fields with commas
324+
const { parse } = await import('csv-parse/sync');
325+
const records = parse(content, {
326+
columns: true,
327+
skip_empty_lines: true,
328+
trim: true,
329+
relax_quotes: true,
330+
}) as Record<string, string>[];
331+
332+
if (records.length === 0) {
333+
throw new Error('CSV file has no data rows');
334+
}
335+
336+
// Verify unique_key column exists
337+
if (!('unique_key' in records[0])) {
338+
throw new Error('Could not find "unique_key" column in CSV header');
339+
}
340+
341+
console.log(`Processing ${records.length} rows`);
342+
343+
// Extract unique token pairs
344+
const pairsSet = new Set<string>();
345+
346+
for (let i = 0; i < records.length; i++) {
347+
const uniqueKey = records[i].unique_key?.trim();
348+
if (!uniqueKey || uniqueKey === '') {
349+
console.warn(`Skipping row ${i + 2}: empty unique_key`);
350+
continue;
351+
}
352+
353+
// unique_key format: token0-token1
354+
const tokens = uniqueKey.split('-');
355+
if (tokens.length !== 2) {
356+
console.warn(`Skipping row ${i + 2}: invalid unique_key format "${uniqueKey}"`);
357+
continue;
358+
}
359+
360+
const [token0, token1] = tokens;
361+
362+
// Validate addresses
363+
if (!/^0x[a-fA-F0-9]{40}$/.test(token0) || !/^0x[a-fA-F0-9]{40}$/.test(token1)) {
364+
console.warn(`Skipping row ${i + 2}: invalid address format in "${uniqueKey}"`);
365+
continue;
366+
}
367+
368+
// Sort and normalize addresses
369+
const sorted = sortTokenPair(token0, token1);
370+
pairsSet.add(`${sorted[0]},${sorted[1]}`);
371+
}
372+
373+
const pairs = Array.from(pairsSet).sort();
374+
console.log(`\nExtracted ${pairs.length} unique token pairs`);
375+
376+
// Write output CSV
377+
const outputLines = [
378+
'# Token pairs extracted from pools.csv',
379+
'# Format: token0,token1',
380+
...pairs,
381+
];
382+
writeFileSync(options.output, outputLines.join('\n') + '\n');
383+
384+
console.log('Token pairs written to:', options.output);
385+
}
386+
catch (error) {
387+
console.error('Error parsing pools:', error instanceof Error ? error.message : String(error));
388+
process.exit(1);
389+
}
390+
});
391+
310392
program.parse();

remappings.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
solmate/=lib/solmate/
22
@eth-optimism-bedrock/=lib/optimism/packages/contracts-bedrock
33
eas-contracts/=lib/dao-signer/lib/eas-contracts/contracts/
4+
scripts/libraries/Config.sol=lib/optimism/packages/contracts-bedrock/scripts/libraries/Config.sol
5+
src/AgreementAnchorFactory.sol=lib/dao-signer/src/AgreementAnchorFactory.sol
6+
src/AgreementAnchor.sol=lib/dao-signer/src/AgreementAnchor.sol
7+
src/interfaces/IAgreementAnchorFactory.sol=lib/dao-signer/src/interfaces/IAgreementAnchorFactory.sol

script/01_DeployMainnet.s.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ contract DeployMainnet is Script {
1313

1414
vm.startBroadcast();
1515

16-
MainnetDeployer deployer = new MainnetDeployer();
16+
MainnetDeployer deployer = new MainnetDeployer{salt: bytes32(uint256(1))}();
1717
console2.log("Deployed Deployer at:", address(deployer));
1818
console2.log("TOKEN_JAR at:", address(deployer.TOKEN_JAR()));
1919
console2.log("RELEASER at:", address(deployer.RELEASER()));

script/02_DeployUnichain.s.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ contract DeployUnichain is Script {
1414

1515
vm.startBroadcast();
1616

17-
UnichainDeployer deployer = new UnichainDeployer();
17+
UnichainDeployer deployer = new UnichainDeployer{salt: bytes32(uint256(1))}();
1818
console2.log("Deployed Deployer at:", address(deployer));
1919
console2.log("TOKEN_JAR at:", address(deployer.TOKEN_JAR()));
2020
console2.log("RELEASER at:", address(deployer.RELEASER()));

script/deployers/MainnetDeployer.sol

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,8 @@ contract MainnetDeployer {
4646
address public constant LABS_UNI_RECIPIENT = 0xaBA63748c4b4DeF4a3319C3A29fE4829029D926F;
4747

4848
// Using the real merkle root from the generated merkle tree in ./merkle-generator
49-
// TODO: Regenerate the merkle tree
5049
bytes32 constant INITIAL_MERKLE_ROOT =
51-
bytes32(0x472c8960ea78de635eb7e32c5085f9fb963e626b5a68c939bfad24e022383b3a);
50+
bytes32(0xdbc884abb1e0cfedd01db2ea427d6b8df7be2e63edcc701475387a28edb9a23e);
5251

5352
uint8 constant DEFAULT_FEE_100 = 4 << 4 | 4; // default fee for 0.01% tier
5453
uint8 constant DEFAULT_FEE_500 = 4 << 4 | 4; // default fee for 0.05% tier

0 commit comments

Comments
 (0)