Compare commits

..

4 Commits

10 changed files with 543 additions and 206 deletions

@ -2,23 +2,21 @@
### Changes / effect description
- Change owner of ENS domains [staking-rewards.contract.tornadocash.eth](https://app.ens.domains/staking-rewards.contract.tornadocash.eth), [governance-impl.contract.tornadocash.eth](https://app.ens.domains/governance-impl.contract.tornadocash.eth) and [contract.tornadocash.eth](https://app.ens.domains/contract.tornadocash.eth) to Tornado Cash Governance
- Change address on staking-rewards.contract.tornadocash.eth and governance-impl.contract.tornadocash.eth to new addresses (has been changed in [proposal 22](https://tornado.ws/governance/22))
- Update IPFS content hashes on ENS domains for docs (docs.tornadocash.eth), Classic UI (tornadocash.eth), Nova UI (nova.tornadocash.eth) and relayers UI (relayers-network.tornadocash.eth)
- Create new `tornadocash.eth` subdomains written in [`contants.ts`](scripts/constants.ts) and set Governance as owner for all
- Assign corresponding IPFS contenthash to each domain
### Requirements
- Rust ([Need only for Windows](https://doc.rust-lang.org/cargo/getting-started/installation.html))
- Foundryup ([Windows](https://github.com/altugbakan/foundryup-windows), [Linux](https://book.getfoundry.sh/getting-started/installation))
- Node 14 or higher ([Windows](https://github.com/coreybutler/nvm-windows), [Linux](https://github.com/nvm-sh/nvm))
- Node 16 or higher ([Windows](https://github.com/coreybutler/nvm-windows), [Linux](https://github.com/nvm-sh/nvm))
### Installation
```text
git clone --recurse-submodules https://git.tornado.ws/Theo/proposal-29-update-ipfs.git
cd proposal-29-update-ipfs
git clone --recurse-submodules https://git.tornado.ws/Theo/proposal-30-decentralize-sources
cd proposal-30-decentralize-sources
npm install
npm run init
```
### Testing
@ -35,9 +33,9 @@ npm run test:linux
### Contracts
Proposal deployed contract: [0xaF0AbcF236D495AEfDA9f9e1DF5bECE0D132da66](https://etherscan.io/address/0xaf0abcf236d495aefda9f9e1df5bece0d132da66#code)
Proposal deployed contract: [0x775Cf01c12D3E4296c7c9b52C8B835c071068F51](https://etherscan.io/address/0x775cf01c12d3e4296c7c9b52c8b835c071068f51#code)
Goerli test contract: [0x0b70c06d7a4D52cbE9CC4C9FCb4Df2B024F4fFd8](https://goerli.etherscan.io/address/0x0b70c06d7a4d52cbe9cc4c9fcb4df2b024f4ffd8#code)
Goerli test ENS address: [`tornadotest.eth`](https://app.ens.domains/tornadotest.eth) (to see content, you need to connect wallet and switch to Goerli Testnet on app.ens.domains)
### Verification
@ -51,15 +49,15 @@ Since the proposal code can be confusing because it relies on numerous specifica
Result data: [ensNodesDeclarations.txt](data/ensNodesDeclarations.txt)
2. Verification of the transformation of IPFS CIDs to ENS [content hashes](https://eips.ethereum.org/EIPS/eip-1577)
2. Verification of the transformation of IPFS CIDs to ENS [content hashes](https://eips.ethereum.org/EIPS/eip-1577)
Script source: [calculateIPFSContenthashes.ts](scripts/calculateIPFSContenthashes.ts)
Command to run: `npm run calculateIPFS`
Command to run: `npm run calculateIpfs`
Result data: [ensDomainsIPFSContenthashes.txt](data/ensDomainsIPFSContenthashes.txt)
3. Verification of the equality [IPFS CIDs](https://docs.ipfs.tech/concepts/content-addressing/) v0 with v1 (because ENS on its interface shows v1 CIDs, but Pinata and contenthash library uses v0)
3. Verification of the equality [IPFS CIDs](https://docs.ipfs.tech/concepts/content-addressing/) v0 with v1 (because ENS on its interface shows v1 CIDs, but Pinata and contenthash library uses v0)
Script source: [calculateIpfsV1Cids.ts](scripts/calculateIpfsV1Cids.ts)

@ -1,4 +1,25 @@
bytes memory classicUiIPFSContenthash = hex"e301017012203c89ba6bfdeb8d7209463006e620ee6dcb34675cf3202f20919e3a5f9919070d";
bytes memory novaUiIPFSContenthash = hex"e3010170122069648b09fb7ed9a89ca153a000bc8c1bf82a779195a640609e1510dc36c28bb7";
bytes memory relayersUiIPFSContenthash = hex"e301017012203d61bed0641d7c53d5f036b6448f9d455ae6e0ceda44563009536a12e51d52cf";
bytes memory docsIPFSContenthash = hex"e301017012201e6facc47ac27a4072b3ba19e716c0db37cbd29b40b23f3af8a85412ef45be08";
bytes memory downloadInstructionsHtmlContenthash = hex"e30101701220810e2b756845f89793b616c56a0b5ab9689da7f6e7fdf93280d05a0969a4902c";
bytes memory downloadScriptSourceContenthash = hex"e301017012208d6f8f48d3c2bcb6eaafae3110ad59b5aa2137010d827996ea1b87f39266b4f5";
bytes memory classicUiSourceContenthash = hex"e30101701220b674829af0777f2b89ed96020184ee6f04f6cfd2eb176ad2b653b1f2a5563d98";
bytes memory classicRelayerSourceContenthash = hex"e301017012205ad0c59d5fcc60e4866ab37f063480ffa305eb84da143894be5baeff2bb8e931";
bytes memory novaRelayerSourceContenthash = hex"e30101701220c9106227570ab16e639adb5f05ccde1b367b004f582e0700a00dfb54f914068c";
bytes memory relayersUiSourceContenthash = hex"e3010170122046847feae11b2774438df322e014e04652fe029ba59b79df90fafba040ba6550";
bytes memory novaUiSourceContenthash = hex"e30101701220b554eed2a9ba47011b6790ff6d23d0480419de78abf723ea7ada55e1664f5976";
bytes memory docsSourceContenthash = hex"e30101701220a140c7c35f6f2cc72f77d69b73dbab14ac0ccd6ba611a394282ac29f05b89951";
bytes memory tornadoCliSourceContenthash = hex"e30101701220cb1d7ca2be9c5d7ddba48d5c2b5bb027359ac4c0cf077327a14c9ffe1db057e6";
bytes memory infoPageSourceContenthash = hex"e30101701220269c131010a479474d82d7926cc14394d01c41bfb4cda23c26aa3defd65ad4fe";
bytes memory classicUiMinifiedContenthash = hex"e301017012201cbffa16ff8f8bd88f2600f1826648aead1ad513b2f3b1118ef873db9f2add59";
bytes memory novaUiMinifiedContenthash = hex"e30101701220f1e9f532b9a96e8d808f983d4471da7c261daeacbd9d8e76f82d04875d5ad9fa";
bytes memory tornadoCliMinifiedContenthash = hex"e3010170122057be20935fa635689427856a462b288fe353df7b588dcb30ff1b7e6cbffe0d9c";
bytes memory tornTokenSourceContenthash = hex"e30101701220fdee0b6906de7f60179c44103dc0bfd4600233f3737c48eb2e7279850970fd92";
bytes memory merkleRootUpdaterPackageContenthash = hex"e301017012204c9d433771e8e97cece783366a16c6cd4357b6fb94c6602a90d98e54c4179a3d";
bytes memory gasPriceOraclePackageContenthash = hex"e3010170122073e0f65b60d455058aff4fd9b2d0ba2b87f62fb59069433439810dad2d54e615";
bytes memory tornadoOraclesPackageContenthash = hex"e30101701220968d7fb0c0b8981bc8ec464e27ad2a90ef0dbcf67df5990498d94718fa9c6361";
bytes memory snarkjsPackageContenthash = hex"e30101701220e5d69d83d296c8623aa1b1ff5f9ddc3242914df2bd5f20c1682f07ee095dc6d4";
bytes memory websnarkPackageContenthash = hex"e3010170122033fa876a2752cc124fec5c61ebedaf623b42ac50ff348322f8f08183c5aabb8f";
bytes memory circomlibPackageContenthash = hex"e30101701220663529c784c5702922344a1035884949317cd59a529160cfb4571709df9c7059";
bytes memory txManagerPackageContenthash = hex"e30101701220952a5880f8b175e2206e7502b9891710876e2c970031616b7ede68ce994dea4b";
bytes memory fixedMerkleTreePackageContenthash = hex"e30101701220615d9d0986e8fd6a233615d792a70cf5125e188aa82c7493816a5d83c384b924";
bytes memory tornadoTreesPackageContenthash = hex"e30101701220b8ea77533cc9b2f434bac48d96d8bc48183cc335fd726b8c5edf11dfa36a78dc";
bytes memory anonymityMiningPackageContenthash = hex"e301017012204f3d3a8f0a8a183261288f6012844f74605fd7813d9adc5200784125fb1f671c";
bytes memory tornadoConfigPackageContenthash = hex"e301017012202d419e8834b28e8aafabe3dfe39e3d71f2c07c3911c856248a6e6587bfec195a";

@ -1,11 +1,57 @@
bytes32 rootTornadoENSNode = 0xe6ae31d630cc7a8279c0f1c7cbe6e7064814c47d1785fa2703d9ae511ee2be0c;
bytes32 tornadoContractENSNode = 0xe7e1d618367ebadd8e172150a43cfc839fd19022c2be81a6e8d45e06aa1011cd;
bytes32 stakingRewardsENSNode = 0x3da4b79cd8c20d2fafb1c7cb37a62be8668f543393f6636d421fba0be735e68f;
bytes32 governanceImplENSNode = 0x092359a5505072470ce8b86eebed5b4b6f001fe6bd08dbcf723c97073a360cfc;
bytes32 novaENSNode = 0xc3964c598b56aeaee4c253283fb1ebb12510b95db00960589cdc62807a2537a0;
bytes32 docsENSNode = 0xd7b8aac14a9b2507ab99b5fde3060197fddb9735afa9bf38b1f7e34923cb935e;
bytes32 relayersUIENSNode = 0x4e37047f2c961db41dfb7d38cf79ca745faf134a8392cfb834d3a93330b9108d;
bytes32 internal constant rootTornadoDomainNode = 0xe6ae31d630cc7a8279c0f1c7cbe6e7064814c47d1785fa2703d9ae511ee2be0c;
bytes32 internal constant sourcesDomainNode = 0x4e5775b58e8aeaa32fc2b429c9485da9de5a1c6fead70b8704ce0f970a6f127d;
bytes32 internal constant minifiedSourcesDomainNode = 0xe0df66963d3ee12f2f360e193f0443eaffb41afc582166678b806d25b9941ce2;
bytes32 internal constant packagesDomainNode = 0x205450e4bb0700adede3b5117ed52080e8433e9287815066aea78582107db04e;
bytes32 internal constant downloadScriptSourceDomainNode = 0x4a6bb62eaa2524f194a206df4c15dcc8e9a93036119d40516dab5b7c021fa43b;
bytes32 internal constant classicUISourceDomainNode = 0xc0048472a571cb1a08f3ab829dc02e499a23802da54cc5a9a621d96f08acb124;
bytes32 internal constant novaUISourceDomainNode = 0xa53a41e448ef36a88eb023695dd2e4db15897f6b6e02ce7cb81fe7603da1d860;
bytes32 internal constant docsSourceDomainNode = 0xdd158a78d03e8c953fe2b54edcf9f9919efaec1d782a6603b3f8f5871107672c;
bytes32 internal constant relayersUISourceDomainNode = 0x0315c3730f5894b97933d148a24f1b29f823c6a64caadc4a55b5600b510234b2;
bytes32 internal constant tornTokenSourceDomainNode = 0xd817f80f72b6a337289ab88b44ba896365e52c5a08e816baef170fde21297ad9;
bytes32 internal constant classicRelayerSoftwareSourceDomainNode = 0x28fe01fe7f28555b980620b2b69388adec9a8879ecc9648d8c32cd4107697408;
bytes32 internal constant novaRelayerSoftwareSourceDomainNode = 0xdb0f46e0901b38c81ac357482fb43ea4c4da6655cade719cc228ccdedea39504;
bytes32 internal constant tornadoCliSourceDomainNode = 0xccf6a9a7714d27164199e07b6443821e152be908ec362e4b16af8acc6bd47950;
bytes32 internal constant infoPageSourceDomainNode = 0xb1735298044f249ea99f70f266979643a3a3ba2c6c7902fbb5aadcca6a04923c;
bytes32 internal constant classicUIMinifiedDomainNode = 0x394177cecfcf0a9fdc53ffac572e0ad8d40448784e39f40442242e52dc405c8d;
bytes32 internal constant novaMinifiedDomainNode = 0xb9d9bd7ba34401e9c30df77f171da6fbdb9acf16601d6b822c0f8ebb4e6fb34c;
bytes32 internal constant tornadoCliMinifiedDomainNode = 0x8994773ddc1fa2e11e4b86dbe1e0905f8744bfe12d9760cd781b4b836b946d8b;
bytes32 internal constant websnarkPackageDomainNode = 0x09a48ede99da7705e43c9fde7ec88ffb4fb61c77b8adb3a682f3d16849d708da;
bytes32 internal constant circomlibPackageDomainNode = 0xc49cefe6742a807155aeb894fb982bef5ac0b7c64fcb383d4b54e7408dbf3e74;
bytes32 internal constant snarkjsPackageDomainNode = 0xa5981a1a101fb57b405ec65007bfcc2d966f0cea15fa5720d288db7edb08160c;
bytes32 internal constant tornadoOraclesPackageDomainNode = 0xa25976ac1e06a4cd62256c85d7eeb4721e011881d831a5fdf213b640e8c6ab0f;
bytes32 internal constant gasPriceOraclePackageDomainNode = 0xb1eb7029ca628d908ee8f8de858985817e7d3003c8cb2c24d353822b7dde96f2;
bytes32 internal constant tornadoConfigPackageDomainNode = 0xcb97b63094a6ffae96dca34ba12a51d9d4bce5c805dcbcc9f96267acc80c56b0;
bytes32 internal constant anonymityMiningPackageDomainNode = 0x246e925f01d12a5dd0240023bebf85db3d64345941bfd5a0a1eb391cabfe04b0;
bytes32 internal constant tornadoTreesPackageDomainNode = 0xde4753a77b1a26aa43bac29de191be4a48ed63b4d2232e91754cfe08bbf758ae;
bytes32 internal constant fixedMerkleTreePackageDomainNode = 0x6f21b84dba16087fcd3620e24e632716a38eb0e39513bf540818bf2d5edea44e;
bytes32 internal constant txManagerPackageDomainNode = 0xedb16516abf2f454740bab0349fc287887cc4395eb691873a6f4533ae5c5913a;
bytes32 internal constant merkleRootUpdaterPackageDomainNode = 0xb4d53f6fa2f2ca1006da4c94cd391b54d98eacdf09bef972e0146e8735b21c4f;
bytes32 tornadoContractENSLabelhash = 0x7f6dd79f0020bee2024a097aaa5d32ab7ca31126fa375538de047e7475fa8572;
bytes32 stakingRewardsENSLabelhash = 0x15826fcf9999635849b273bcd226f436dc42a8fabf43049b60971ab51d8d6b8f;
bytes32 governanceImplENSLabelhash = 0x6583a22765d3d6a6ca97b21440f79fecaf21bb8bcaa4fb694483e63d821ba50d;
bytes32 internal constant rootTornadoDomainLabelhash = 0xe5b71d8431579082519dd1ae04b9f23df1cecbfd6f54a6cd9ae12eb0ab7f96f3;
bytes32 internal constant sourcesDomainLabelhash = 0x6ee89d35dcb4b9803f51dc5e513c1c1714149cf0821537078d8ad61616e49f2b;
bytes32 internal constant minifiedSourcesDomainLabelhash = 0x26403be8dc5694ba56b8d49945b813cff19140637d1fa38a3187a07faf4ee073;
bytes32 internal constant packagesDomainLabelhash = 0x89c4c51c9264344cbc2ab3aa255b085918a2841af8ffaa3133ceabee961afffd;
bytes32 internal constant downloadScriptSourceDomainLabelhash = 0xedb311f245ef85f918a5790470448cf17c7d06961f4dfa42cc41616de7f8c2e1;
bytes32 internal constant classicUISourceDomainLabelhash = 0x4e27b2a330e4a0d8d8521393df67e9a24fb2ab5f10f9e640c244d504874322bc;
bytes32 internal constant novaUISourceDomainLabelhash = 0xc90e7e9184dce6e0d7fff2e19e72ffa35430aca54bd634ada091bef2d2bb0635;
bytes32 internal constant docsSourceDomainLabelhash = 0x6bf9054545420e9e9f4aa4f353a32c7d0d52c11dbcdda56c53be8375cafeebb1;
bytes32 internal constant relayersUISourceDomainLabelhash = 0xea7c97223b0629f1c3bea11a57dd6179a12e9cc4bbdf8f69fb999c4051c682cf;
bytes32 internal constant tornTokenSourceDomainLabelhash = 0x5d8fec99a5792d7772f788343c7991bf1049b821dcd1b0b900f86e6b7fe7fb25;
bytes32 internal constant classicRelayerSoftwareSourceDomainLabelhash = 0x7bece1009df269e16c3552ea6ced49b1d66c22438cda5caf73f55ac74bcadea9;
bytes32 internal constant novaRelayerSoftwareSourceDomainLabelhash = 0xe01bed58384f9ee9a9dccf26a4236eca42aa8b767efe27c5d191a51885118e5b;
bytes32 internal constant tornadoCliSourceDomainLabelhash = 0x92c0fea2a18f1747f48f5503806e5f24d5ccb2c360ef56a462ce254707afa64a;
bytes32 internal constant infoPageSourceDomainLabelhash = 0x41c8b7e0e9650ab5d1f55454c8ad68d9d4c6d42f1a8a14878b77e92e9794e610;
bytes32 internal constant classicUIMinifiedDomainLabelhash = 0x4e27b2a330e4a0d8d8521393df67e9a24fb2ab5f10f9e640c244d504874322bc;
bytes32 internal constant novaMinifiedDomainLabelhash = 0xc90e7e9184dce6e0d7fff2e19e72ffa35430aca54bd634ada091bef2d2bb0635;
bytes32 internal constant tornadoCliMinifiedDomainLabelhash = 0x92c0fea2a18f1747f48f5503806e5f24d5ccb2c360ef56a462ce254707afa64a;
bytes32 internal constant websnarkPackageDomainLabelhash = 0x50d1752a9b1f31ebf05378927a112194d33596cc02a04c06970477bd8a40c931;
bytes32 internal constant circomlibPackageDomainLabelhash = 0x68dc231d08143bcf7cf261e63071bdcb7d606e41dec696e34482f6d1068c4afa;
bytes32 internal constant snarkjsPackageDomainLabelhash = 0x31df71a9eb77699aba0f0e6d565af942889afef76e60ee8a9f80c27f2e946065;
bytes32 internal constant tornadoOraclesPackageDomainLabelhash = 0xb7a48206cd37ed309fdcdf62fe4b65d6871298645d5e41942f0cd89c08a65cbf;
bytes32 internal constant gasPriceOraclePackageDomainLabelhash = 0x05048648c60bebc220ad5a82188a966f910539a7e1947cc8a9ac0ec1cd99ca40;
bytes32 internal constant tornadoConfigPackageDomainLabelhash = 0x0b49c88cd3d1ba3c99fdd9a41ced95ec8629bda85e80b6c506c15db62ab8f761;
bytes32 internal constant anonymityMiningPackageDomainLabelhash = 0xc3520c36e06133299b24abf819a008b22bc3e9adfa39a38bbccd5cf829831d48;
bytes32 internal constant tornadoTreesPackageDomainLabelhash = 0xef1496a9cbb93e123ce8e3a0868374bda8446faafa4c2eb7fce3c7a9465be8df;
bytes32 internal constant fixedMerkleTreePackageDomainLabelhash = 0x37441881d8c14192cbe636eb3d4318346c6af80d92971e1357419a1a94e8a2e2;
bytes32 internal constant txManagerPackageDomainLabelhash = 0x0d3be7866f858f24a43fd40d3844a410405b3d6abd2255102d8327fa242a4ff3;
bytes32 internal constant merkleRootUpdaterPackageDomainLabelhash = 0x1b162702ef4549cb2e6522252d90c0d44fcce15b939897373cfa4f829488cab4;

@ -1,4 +1,24 @@
const classicUiIpfsCid = "bafybeib4rg5gx7plrvzasrrqa3tcb3tnzm2goxhteaxsbem6hjpzsgihbu";
const novaUiIpfsCid = "bafybeidjmsfqt6363gujziktuaalzda37avhpemvuzagbhqvcdodnqulw4";
const relayersUiIpfsCid = "bafybeib5mg7naza5prj5l4bwwzci7hkflltobtw2irldacktnijokhksz4";
const docsIpfsCid = "bafybeia6n6wmi6wcpjahfm52dhtrnqg3g7f5fg2awi7tv6fikqjo6rn6ba";
const downloadScriptSourceIpfsCid = "bafybeienn6huru6cxs3ovl5ogeik2wnvviqtoainqj4zn2q3q7zzezvu6u";
const classicUiSourceIpfsCid = "bafybeifwosbjv4dxp4vyt3mwaiayj3tpat3m7uxlc5vnfnstwhzkkvr5ta";
const classicRelayerSourceIpfsCid = "bafybeic22dcz2x6mmdsim2vtp4ddjah7umc6xbg2cq4jjps3v37sxohjge";
const novaRelayerSourceIpfsCid = "bafybeigjcbrcovykwfxghgw3l4c4zxq3gz5qat2yfydqbian7nkpsfagrq";
const relayersUiSourceIpfsCid = "bafybeicgqr76vyi3e52ehdptelqbjycgkl7afg5ftn457eh27oqebotfka";
const novaUiSourceIpfsCid = "bafybeifvktxnfkn2i4arwz4q75wshuciaqm546fl64r6u6w2kxqwmt2zoy";
const docsSourceIpfsCid = "bafybeifbidd4gx3pftds656wtnz5xkyuvqgm225gcgrzikbkykpqloezke";
const tornadoCliSourceIpfsCid = "bafybeigldv6kfpu4lv65xjenlqvvxmbhgwnmjqgpa5zspikmt77b3mcx4y";
const infoPageSourceIpfsCid = "bafybeibgtqjraefepfdu3awxsjwmcq4u2aoedp5uzwrdyjvkhxx5mwwu7y";
const classicUiMinifiedIpfsCid = "bafybeia4x75bn74prpmi6jqa6gbgmsfovunnke5s6oyrddxyopnz6kw5le";
const novaUiMinifiedIpfsCid = "bafybeihr5h2tfonjn2gybd4yhvchdwt4eyo25lf5twhhn6bnasdv2wwz7i";
const tornadoCliMinifiedIpfsCid = "bafybeicxxyqjgx5ggvujij4fnjdcwkep4nj5662yrxftb7y3pzwl77qntq";
const tornTokenSourceIpfsCid = "bafybeih55yfwsbw6p5qbphceca64bp6umabdh43tpreowltspgcqs4h5si";
const merkleRootUpdaterPackageIpfsCid = "bafybeicmtvbto4pi5f6ozz4dgzvbnrwninl3n64uyzqcvegzrzkmif42hu";
const gasPriceOraclePackageIpfsCid = "bafybeidt4d3fwygukucyv72p3gznborlq73c7nmqnfbtiombbwws2vhgcu";
const tornadoOraclesPackageIpfsCid = "bafybeiewrv73bqfytan4r3cgjyt22kuq54g3z5t56wmqjggzi4mpvhddme";
const snarkjsPackageIpfsCid = "bafybeihf22oyhuuwzbrdvinr75pz3xbsikiu34v5l4qmc2bpa7xasxog2q";
const websnarkPackageIpfsCid = "bafybeibt7kdwuj2szqje73c4mhv63l3chnbkyuh7gsbsf6hqqgb4lkv3r4";
const circomlibPackageIpfsCid = "bafybeidgguu4pbgfoausenckca2yqskjgf6nlgsssfqm7ncxc4e57hdqle";
const txManagerPackageIpfsCid = "bafybeievfjmib6froxrca3tvak4ysfyqq5xczfyagfqww7w6ndhjstpkjm";
const fixedMerkleTreePackageIpfsCid = "bafybeidblwoqtbxi7vvcgnqv26jkodhvcjpbrcvifr2jhalklwb4hbfzeq";
const tornadoTreesPackageIpfsCid = "bafybeify5j3vgpgjwl2djowerwlnrpcida6mgnp5ojvyyxw7chp2g2ty3q";
const anonymityMiningPackageIpfsCid = "bafybeicphu5i6cukdazgckepmajiit3umbp5paj5tlofeadyies7wh3hdq";
const tornadoConfigPackageIpfsCid = "bafybeibnigpiqnfsr2fk7k7d37rz4plr6lahyoirzblcjctomwd373azli";

@ -0,0 +1,57 @@
bytes32 internal constant rootTornadoDomainNode = 0xa8f2228d0331c20e8d36b0bf33b102b5b8d8d416db25502b04e5b854d7a5c556;
bytes32 internal constant sourcesDomainNode = 0x857d0c409cbb3112c1b9a6a2c1fb1ac516630d9c263cb04bf3d5a32407b936d5;
bytes32 internal constant minifiedSourcesDomainNode = 0x0b7a6db16524d96c9c45252b05191330e5cd76af1a65e883f15a6b0df143ea72;
bytes32 internal constant packagesDomainNode = 0xcc0d5182bef33b3ece771ca070bdff76ab80c3af59951aa41995e0ddd1a307f1;
bytes32 internal constant downloadScriptSourceDomainNode = 0x3ca990173243a16600a2c480447f5506291f48aaccc152c6ceb05ab13b26dd1a;
bytes32 internal constant classicUISourceDomainNode = 0x0b5e06d4c6e76faae426647aceda719067818b62a53350ad34f73792e8850254;
bytes32 internal constant novaUISourceDomainNode = 0x38676e6f1e375cea26d79df47f589850623e84cf77426cdccd8e8e50c964dfdf;
bytes32 internal constant docsSourceDomainNode = 0x2c6d4d7c3f94987894b9893d813e5f15447b2e63534f423cbdf97490ceccd57c;
bytes32 internal constant relayersUISourceDomainNode = 0x1e0e78434fb4ccd771715e5ef7cb66253591943a3d863d3d75f2be3418904dea;
bytes32 internal constant tornTokenSourceDomainNode = 0x3a17690a58fe5f6b5b33eef2d2998114a332b4feb3e8f06f818542f4d528e3eb;
bytes32 internal constant classicRelayerSoftwareSourceDomainNode = 0x0e30230d2c81771372c21b8c82b957bf8a44cbb48a3a0396e3a7bc593577d72e;
bytes32 internal constant novaRelayerSoftwareSourceDomainNode = 0x1c1bc2a95e6db3a336aca1f33ebaae0af0343c5a2b0ca9cb03f56fd8631557f0;
bytes32 internal constant tornadoCliSourceDomainNode = 0x8fd0043a38548a5022a557c3e196e2aa9de038f2f6036ad565e842f43565af21;
bytes32 internal constant infoPageSourceDomainNode = 0x51c628ee8a039a17cfc4509e671da25e2832ce9d496c0dce2525e67ab14c4b06;
bytes32 internal constant classicUIMinifiedDomainNode = 0xbf189e20cf74064173ac3d9b572f36268de3a74416c0743b80f80a72e77c39c5;
bytes32 internal constant novaMinifiedDomainNode = 0xaba43caec785b400d898195b430e1d67e9c242d0873b24c51e0988a7b7c4c3ec;
bytes32 internal constant tornadoCliMinifiedDomainNode = 0xeb5a0c348b96ea0a86ffba4cc09329cafed4e7858a3b09b9e4951fc45b155051;
bytes32 internal constant websnarkPackageDomainNode = 0xd5dc0d0f67049b9973792539efbc65c74f1ccfa34bcacc245d95fef528348f31;
bytes32 internal constant circomlibPackageDomainNode = 0x5c0d325132700969f3a5d9cc29362934547c6b547d9f2de89667cf25976d4030;
bytes32 internal constant snarkjsPackageDomainNode = 0x68d17fc00031d0a157958a4a4aac1f51431ebe1ad3b907649a746fad227934c1;
bytes32 internal constant tornadoOraclesPackageDomainNode = 0xd1678f13f0fc6712edd4d8a8ccad982e75df07403c96e65ce1ef2e0df6ccd72c;
bytes32 internal constant gasPriceOraclePackageDomainNode = 0xfbe0717768964b98ff37c4d89db1e305e42914fbebd8722bb5b113aa2e34a8b5;
bytes32 internal constant tornadoConfigPackageDomainNode = 0xca98d0d3c988c445e30fa8a49981008d16a41f006cd5d1730a90790cf5a5f638;
bytes32 internal constant anonymityMiningPackageDomainNode = 0x5627f29b5f86fea22182dd2a20d2a747be3ad0f204e7d8637e60ce2a8505a74f;
bytes32 internal constant tornadoTreesPackageDomainNode = 0xb812eb01e6f49f624c16f227ce6680e639476057ad26fe4ec559b08f461a8a3d;
bytes32 internal constant fixedMerkleTreePackageDomainNode = 0xea4f316afeb12220db9b9737341ca13329fa73557841cdf344fb895eefeaaecc;
bytes32 internal constant txManagerPackageDomainNode = 0x91e6d11b11e5c0a98be4130f69446eb9460afeaae935dbfa6ef7b2361120c75d;
bytes32 internal constant merkleRootUpdaterPackageDomainNode = 0xa9f9472a40c96dc4c30470e180df2fd94b75f19161fb5610bff0b4ef2ddf06ab;
bytes32 internal constant rootTornadoDomainLabelhash = 0x28d5131e4f60044a3e4d52eb398a7f8f08b6b7e01040696e895a1f81029fca83;
bytes32 internal constant sourcesDomainLabelhash = 0x6ee89d35dcb4b9803f51dc5e513c1c1714149cf0821537078d8ad61616e49f2b;
bytes32 internal constant minifiedSourcesDomainLabelhash = 0x26403be8dc5694ba56b8d49945b813cff19140637d1fa38a3187a07faf4ee073;
bytes32 internal constant packagesDomainLabelhash = 0x89c4c51c9264344cbc2ab3aa255b085918a2841af8ffaa3133ceabee961afffd;
bytes32 internal constant downloadScriptSourceDomainLabelhash = 0xedb311f245ef85f918a5790470448cf17c7d06961f4dfa42cc41616de7f8c2e1;
bytes32 internal constant classicUISourceDomainLabelhash = 0x4e27b2a330e4a0d8d8521393df67e9a24fb2ab5f10f9e640c244d504874322bc;
bytes32 internal constant novaUISourceDomainLabelhash = 0xc90e7e9184dce6e0d7fff2e19e72ffa35430aca54bd634ada091bef2d2bb0635;
bytes32 internal constant docsSourceDomainLabelhash = 0x6bf9054545420e9e9f4aa4f353a32c7d0d52c11dbcdda56c53be8375cafeebb1;
bytes32 internal constant relayersUISourceDomainLabelhash = 0xea7c97223b0629f1c3bea11a57dd6179a12e9cc4bbdf8f69fb999c4051c682cf;
bytes32 internal constant tornTokenSourceDomainLabelhash = 0x5d8fec99a5792d7772f788343c7991bf1049b821dcd1b0b900f86e6b7fe7fb25;
bytes32 internal constant classicRelayerSoftwareSourceDomainLabelhash = 0x7bece1009df269e16c3552ea6ced49b1d66c22438cda5caf73f55ac74bcadea9;
bytes32 internal constant novaRelayerSoftwareSourceDomainLabelhash = 0xe01bed58384f9ee9a9dccf26a4236eca42aa8b767efe27c5d191a51885118e5b;
bytes32 internal constant tornadoCliSourceDomainLabelhash = 0x92c0fea2a18f1747f48f5503806e5f24d5ccb2c360ef56a462ce254707afa64a;
bytes32 internal constant infoPageSourceDomainLabelhash = 0x41c8b7e0e9650ab5d1f55454c8ad68d9d4c6d42f1a8a14878b77e92e9794e610;
bytes32 internal constant classicUIMinifiedDomainLabelhash = 0x4e27b2a330e4a0d8d8521393df67e9a24fb2ab5f10f9e640c244d504874322bc;
bytes32 internal constant novaMinifiedDomainLabelhash = 0xc90e7e9184dce6e0d7fff2e19e72ffa35430aca54bd634ada091bef2d2bb0635;
bytes32 internal constant tornadoCliMinifiedDomainLabelhash = 0x92c0fea2a18f1747f48f5503806e5f24d5ccb2c360ef56a462ce254707afa64a;
bytes32 internal constant websnarkPackageDomainLabelhash = 0x50d1752a9b1f31ebf05378927a112194d33596cc02a04c06970477bd8a40c931;
bytes32 internal constant circomlibPackageDomainLabelhash = 0x68dc231d08143bcf7cf261e63071bdcb7d606e41dec696e34482f6d1068c4afa;
bytes32 internal constant snarkjsPackageDomainLabelhash = 0x31df71a9eb77699aba0f0e6d565af942889afef76e60ee8a9f80c27f2e946065;
bytes32 internal constant tornadoOraclesPackageDomainLabelhash = 0xb7a48206cd37ed309fdcdf62fe4b65d6871298645d5e41942f0cd89c08a65cbf;
bytes32 internal constant gasPriceOraclePackageDomainLabelhash = 0x05048648c60bebc220ad5a82188a966f910539a7e1947cc8a9ac0ec1cd99ca40;
bytes32 internal constant tornadoConfigPackageDomainLabelhash = 0x0b49c88cd3d1ba3c99fdd9a41ced95ec8629bda85e80b6c506c15db62ab8f761;
bytes32 internal constant anonymityMiningPackageDomainLabelhash = 0xc3520c36e06133299b24abf819a008b22bc3e9adfa39a38bbccd5cf829831d48;
bytes32 internal constant tornadoTreesPackageDomainLabelhash = 0xef1496a9cbb93e123ce8e3a0868374bda8446faafa4c2eb7fce3c7a9465be8df;
bytes32 internal constant fixedMerkleTreePackageDomainLabelhash = 0x37441881d8c14192cbe636eb3d4318346c6af80d92971e1357419a1a94e8a2e2;
bytes32 internal constant txManagerPackageDomainLabelhash = 0x0d3be7866f858f24a43fd40d3844a410405b3d6abd2255102d8327fa242a4ff3;
bytes32 internal constant merkleRootUpdaterPackageDomainLabelhash = 0x1b162702ef4549cb2e6522252d90c0d44fcce15b939897373cfa4f829488cab4;

@ -6,50 +6,162 @@ import { IGovernance } from "@interfaces/IGovernance.sol";
import { IENSRegistry } from "@interfaces/IENSRegistry.sol";
import { IENSResolver } from "@interfaces/IENSResolver.sol";
import { TornadoAddresses } from "@proprietary/TornadoAddresses.sol";
contract UpdateENSDataProposal {
address constant governanceAddress = 0x5efda50f22d34F262c29268506C5Fa42cB56A1Ce;
address constant ensResolverAddress = 0x4976fb03C32e5B8cfe2b6cCB31c09Ba78EBaBa41;
address constant ensRegistryAddress = 0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e;
IENSRegistry internal constant ensRegistry = IENSRegistry(ensRegistryAddress);
IENSResolver internal constant ensResolver = IENSResolver(ensResolverAddress);
bytes32 internal constant rootTornadoDomainNode = 0xe6ae31d630cc7a8279c0f1c7cbe6e7064814c47d1785fa2703d9ae511ee2be0c;
bytes32 internal constant sourcesDomainNode = 0x4e5775b58e8aeaa32fc2b429c9485da9de5a1c6fead70b8704ce0f970a6f127d;
bytes32 internal constant minifiedSourcesDomainNode = 0xe0df66963d3ee12f2f360e193f0443eaffb41afc582166678b806d25b9941ce2;
bytes32 internal constant packagesDomainNode = 0x205450e4bb0700adede3b5117ed52080e8433e9287815066aea78582107db04e;
bytes32 internal constant downloadScriptSourceDomainNode = 0x4a6bb62eaa2524f194a206df4c15dcc8e9a93036119d40516dab5b7c021fa43b;
bytes32 internal constant classicUISourceDomainNode = 0xc0048472a571cb1a08f3ab829dc02e499a23802da54cc5a9a621d96f08acb124;
bytes32 internal constant novaUISourceDomainNode = 0xa53a41e448ef36a88eb023695dd2e4db15897f6b6e02ce7cb81fe7603da1d860;
bytes32 internal constant docsSourceDomainNode = 0xdd158a78d03e8c953fe2b54edcf9f9919efaec1d782a6603b3f8f5871107672c;
bytes32 internal constant relayersUISourceDomainNode = 0x0315c3730f5894b97933d148a24f1b29f823c6a64caadc4a55b5600b510234b2;
bytes32 internal constant tornTokenSourceDomainNode = 0xd817f80f72b6a337289ab88b44ba896365e52c5a08e816baef170fde21297ad9;
bytes32 internal constant classicRelayerSoftwareSourceDomainNode = 0x28fe01fe7f28555b980620b2b69388adec9a8879ecc9648d8c32cd4107697408;
bytes32 internal constant novaRelayerSoftwareSourceDomainNode = 0xdb0f46e0901b38c81ac357482fb43ea4c4da6655cade719cc228ccdedea39504;
bytes32 internal constant tornadoCliSourceDomainNode = 0xccf6a9a7714d27164199e07b6443821e152be908ec362e4b16af8acc6bd47950;
bytes32 internal constant infoPageSourceDomainNode = 0xb1735298044f249ea99f70f266979643a3a3ba2c6c7902fbb5aadcca6a04923c;
bytes32 internal constant classicUIMinifiedDomainNode = 0x394177cecfcf0a9fdc53ffac572e0ad8d40448784e39f40442242e52dc405c8d;
bytes32 internal constant novaMinifiedDomainNode = 0xb9d9bd7ba34401e9c30df77f171da6fbdb9acf16601d6b822c0f8ebb4e6fb34c;
bytes32 internal constant tornadoCliMinifiedDomainNode = 0x8994773ddc1fa2e11e4b86dbe1e0905f8744bfe12d9760cd781b4b836b946d8b;
bytes32 internal constant websnarkPackageDomainNode = 0x09a48ede99da7705e43c9fde7ec88ffb4fb61c77b8adb3a682f3d16849d708da;
bytes32 internal constant circomlibPackageDomainNode = 0xc49cefe6742a807155aeb894fb982bef5ac0b7c64fcb383d4b54e7408dbf3e74;
bytes32 internal constant snarkjsPackageDomainNode = 0xa5981a1a101fb57b405ec65007bfcc2d966f0cea15fa5720d288db7edb08160c;
bytes32 internal constant tornadoOraclesPackageDomainNode = 0xa25976ac1e06a4cd62256c85d7eeb4721e011881d831a5fdf213b640e8c6ab0f;
bytes32 internal constant gasPriceOraclePackageDomainNode = 0xb1eb7029ca628d908ee8f8de858985817e7d3003c8cb2c24d353822b7dde96f2;
bytes32 internal constant tornadoConfigPackageDomainNode = 0xcb97b63094a6ffae96dca34ba12a51d9d4bce5c805dcbcc9f96267acc80c56b0;
bytes32 internal constant anonymityMiningPackageDomainNode = 0x246e925f01d12a5dd0240023bebf85db3d64345941bfd5a0a1eb391cabfe04b0;
bytes32 internal constant tornadoTreesPackageDomainNode = 0xde4753a77b1a26aa43bac29de191be4a48ed63b4d2232e91754cfe08bbf758ae;
bytes32 internal constant fixedMerkleTreePackageDomainNode = 0x6f21b84dba16087fcd3620e24e632716a38eb0e39513bf540818bf2d5edea44e;
bytes32 internal constant txManagerPackageDomainNode = 0xedb16516abf2f454740bab0349fc287887cc4395eb691873a6f4533ae5c5913a;
bytes32 internal constant merkleRootUpdaterPackageDomainNode = 0xb4d53f6fa2f2ca1006da4c94cd391b54d98eacdf09bef972e0146e8735b21c4f;
bytes32 internal constant rootTornadoDomainLabelhash = 0xe5b71d8431579082519dd1ae04b9f23df1cecbfd6f54a6cd9ae12eb0ab7f96f3;
bytes32 internal constant sourcesDomainLabelhash = 0x6ee89d35dcb4b9803f51dc5e513c1c1714149cf0821537078d8ad61616e49f2b;
bytes32 internal constant minifiedSourcesDomainLabelhash = 0x26403be8dc5694ba56b8d49945b813cff19140637d1fa38a3187a07faf4ee073;
bytes32 internal constant packagesDomainLabelhash = 0x89c4c51c9264344cbc2ab3aa255b085918a2841af8ffaa3133ceabee961afffd;
bytes32 internal constant downloadScriptSourceDomainLabelhash = 0xedb311f245ef85f918a5790470448cf17c7d06961f4dfa42cc41616de7f8c2e1;
bytes32 internal constant classicUISourceDomainLabelhash = 0x4e27b2a330e4a0d8d8521393df67e9a24fb2ab5f10f9e640c244d504874322bc;
bytes32 internal constant novaUISourceDomainLabelhash = 0xc90e7e9184dce6e0d7fff2e19e72ffa35430aca54bd634ada091bef2d2bb0635;
bytes32 internal constant docsSourceDomainLabelhash = 0x6bf9054545420e9e9f4aa4f353a32c7d0d52c11dbcdda56c53be8375cafeebb1;
bytes32 internal constant relayersUISourceDomainLabelhash = 0xea7c97223b0629f1c3bea11a57dd6179a12e9cc4bbdf8f69fb999c4051c682cf;
bytes32 internal constant tornTokenSourceDomainLabelhash = 0x5d8fec99a5792d7772f788343c7991bf1049b821dcd1b0b900f86e6b7fe7fb25;
bytes32 internal constant classicRelayerSoftwareSourceDomainLabelhash =
0x7bece1009df269e16c3552ea6ced49b1d66c22438cda5caf73f55ac74bcadea9;
bytes32 internal constant novaRelayerSoftwareSourceDomainLabelhash = 0xe01bed58384f9ee9a9dccf26a4236eca42aa8b767efe27c5d191a51885118e5b;
bytes32 internal constant tornadoCliSourceDomainLabelhash = 0x92c0fea2a18f1747f48f5503806e5f24d5ccb2c360ef56a462ce254707afa64a;
bytes32 internal constant infoPageSourceDomainLabelhash = 0x41c8b7e0e9650ab5d1f55454c8ad68d9d4c6d42f1a8a14878b77e92e9794e610;
bytes32 internal constant classicUIMinifiedDomainLabelhash = 0x4e27b2a330e4a0d8d8521393df67e9a24fb2ab5f10f9e640c244d504874322bc;
bytes32 internal constant novaMinifiedDomainLabelhash = 0xc90e7e9184dce6e0d7fff2e19e72ffa35430aca54bd634ada091bef2d2bb0635;
bytes32 internal constant tornadoCliMinifiedDomainLabelhash = 0x92c0fea2a18f1747f48f5503806e5f24d5ccb2c360ef56a462ce254707afa64a;
bytes32 internal constant websnarkPackageDomainLabelhash = 0x50d1752a9b1f31ebf05378927a112194d33596cc02a04c06970477bd8a40c931;
bytes32 internal constant circomlibPackageDomainLabelhash = 0x68dc231d08143bcf7cf261e63071bdcb7d606e41dec696e34482f6d1068c4afa;
bytes32 internal constant snarkjsPackageDomainLabelhash = 0x31df71a9eb77699aba0f0e6d565af942889afef76e60ee8a9f80c27f2e946065;
bytes32 internal constant tornadoOraclesPackageDomainLabelhash = 0xb7a48206cd37ed309fdcdf62fe4b65d6871298645d5e41942f0cd89c08a65cbf;
bytes32 internal constant gasPriceOraclePackageDomainLabelhash = 0x05048648c60bebc220ad5a82188a966f910539a7e1947cc8a9ac0ec1cd99ca40;
bytes32 internal constant tornadoConfigPackageDomainLabelhash = 0x0b49c88cd3d1ba3c99fdd9a41ced95ec8629bda85e80b6c506c15db62ab8f761;
bytes32 internal constant anonymityMiningPackageDomainLabelhash = 0xc3520c36e06133299b24abf819a008b22bc3e9adfa39a38bbccd5cf829831d48;
bytes32 internal constant tornadoTreesPackageDomainLabelhash = 0xef1496a9cbb93e123ce8e3a0868374bda8446faafa4c2eb7fce3c7a9465be8df;
bytes32 internal constant fixedMerkleTreePackageDomainLabelhash = 0x37441881d8c14192cbe636eb3d4318346c6af80d92971e1357419a1a94e8a2e2;
bytes32 internal constant txManagerPackageDomainLabelhash = 0x0d3be7866f858f24a43fd40d3844a410405b3d6abd2255102d8327fa242a4ff3;
bytes32 internal constant merkleRootUpdaterPackageDomainLabelhash = 0x1b162702ef4549cb2e6522252d90c0d44fcce15b939897373cfa4f829488cab4;
contract UpdateENSDataProposal is TornadoAddresses {
function executeProposal() public {
address ensResolverAddress = 0x4976fb03C32e5B8cfe2b6cCB31c09Ba78EBaBa41;
address ensRegistryAddress = 0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e;
address governanceImplementationAddress = 0xBa178126C28F50Ee60322a82f5EbCd6b3711e101;
// Register all subnodes, set Governance as an owner
ensRegistry.setSubnodeRecord(rootTornadoDomainNode, sourcesDomainLabelhash, governanceAddress, ensResolverAddress, 0);
ensRegistry.setSubnodeRecord(sourcesDomainNode, minifiedSourcesDomainLabelhash, governanceAddress, ensResolverAddress, 0);
ensRegistry.setSubnodeRecord(sourcesDomainNode, packagesDomainLabelhash, governanceAddress, ensResolverAddress, 0);
IENSRegistry ensRegistry = IENSRegistry(ensRegistryAddress);
IENSResolver ensResolver = IENSResolver(ensResolverAddress);
ensRegistry.setSubnodeRecord(sourcesDomainNode, downloadScriptSourceDomainLabelhash, governanceAddress, ensResolverAddress, 0);
// From data/ensNodesDeclarations.txt, calculated via scripts/calculateENSNodes.ts
bytes32 rootTornadoENSNode = 0xe6ae31d630cc7a8279c0f1c7cbe6e7064814c47d1785fa2703d9ae511ee2be0c;
bytes32 tornadoContractENSNode = 0xe7e1d618367ebadd8e172150a43cfc839fd19022c2be81a6e8d45e06aa1011cd;
bytes32 stakingRewardsENSNode = 0x3da4b79cd8c20d2fafb1c7cb37a62be8668f543393f6636d421fba0be735e68f;
bytes32 governanceImplENSNode = 0x092359a5505072470ce8b86eebed5b4b6f001fe6bd08dbcf723c97073a360cfc;
bytes32 novaENSNode = 0xc3964c598b56aeaee4c253283fb1ebb12510b95db00960589cdc62807a2537a0;
bytes32 docsENSNode = 0xd7b8aac14a9b2507ab99b5fde3060197fddb9735afa9bf38b1f7e34923cb935e;
bytes32 relayersUIENSNode = 0x4e37047f2c961db41dfb7d38cf79ca745faf134a8392cfb834d3a93330b9108d;
ensRegistry.setSubnodeRecord(sourcesDomainNode, classicUISourceDomainLabelhash, governanceAddress, ensResolverAddress, 0);
ensRegistry.setSubnodeRecord(sourcesDomainNode, novaUISourceDomainLabelhash, governanceAddress, ensResolverAddress, 0);
ensRegistry.setSubnodeRecord(sourcesDomainNode, docsSourceDomainLabelhash, governanceAddress, ensResolverAddress, 0);
ensRegistry.setSubnodeRecord(sourcesDomainNode, relayersUISourceDomainLabelhash, governanceAddress, ensResolverAddress, 0);
ensRegistry.setSubnodeRecord(sourcesDomainNode, tornTokenSourceDomainLabelhash, governanceAddress, ensResolverAddress, 0);
ensRegistry.setSubnodeRecord(sourcesDomainNode, novaRelayerSoftwareSourceDomainLabelhash, governanceAddress, ensResolverAddress, 0);
ensRegistry.setSubnodeRecord(
sourcesDomainNode, classicRelayerSoftwareSourceDomainLabelhash, governanceAddress, ensResolverAddress, 0
);
ensRegistry.setSubnodeRecord(sourcesDomainNode, tornadoCliSourceDomainLabelhash, governanceAddress, ensResolverAddress, 0);
ensRegistry.setSubnodeRecord(sourcesDomainNode, infoPageSourceDomainLabelhash, governanceAddress, ensResolverAddress, 0);
bytes32 tornadoContractENSLabelhash = 0x7f6dd79f0020bee2024a097aaa5d32ab7ca31126fa375538de047e7475fa8572;
bytes32 stakingRewardsENSLabelhash = 0x15826fcf9999635849b273bcd226f436dc42a8fabf43049b60971ab51d8d6b8f;
bytes32 governanceImplENSLabelhash = 0x6583a22765d3d6a6ca97b21440f79fecaf21bb8bcaa4fb694483e63d821ba50d;
ensRegistry.setSubnodeRecord(minifiedSourcesDomainNode, classicUIMinifiedDomainLabelhash, governanceAddress, ensResolverAddress, 0);
ensRegistry.setSubnodeRecord(minifiedSourcesDomainNode, novaMinifiedDomainLabelhash, governanceAddress, ensResolverAddress, 0);
ensRegistry.setSubnodeRecord(minifiedSourcesDomainNode, tornadoCliMinifiedDomainLabelhash, governanceAddress, ensResolverAddress, 0);
// At first change owner of subdomain contract.tornadocash.eth and then staking-rewards.contract.tornadocash.eth
// and governance-impl.contract.tornadocash.eth to Governance
ensRegistry.setSubnodeOwner(rootTornadoENSNode, tornadoContractENSLabelhash, governanceAddress);
ensRegistry.setSubnodeOwner(tornadoContractENSNode, stakingRewardsENSLabelhash, governanceAddress);
ensRegistry.setSubnodeOwner(tornadoContractENSNode, governanceImplENSLabelhash, governanceAddress);
// Update staking address, that has been changed in proposal 22: https://tornado.ws/governance/22
ensResolver.setAddr(stakingRewardsENSNode, stakingAddress);
// Update Governance implementation (logic) address on ENS, that has been changed in proposal 22: https://tornado.ws/governance/22
ensResolver.setAddr(governanceImplENSNode, governanceImplementationAddress);
ensRegistry.setSubnodeRecord(packagesDomainNode, websnarkPackageDomainLabelhash, governanceAddress, ensResolverAddress, 0);
ensRegistry.setSubnodeRecord(packagesDomainNode, circomlibPackageDomainLabelhash, governanceAddress, ensResolverAddress, 0);
ensRegistry.setSubnodeRecord(packagesDomainNode, snarkjsPackageDomainLabelhash, governanceAddress, ensResolverAddress, 0);
ensRegistry.setSubnodeRecord(packagesDomainNode, tornadoOraclesPackageDomainLabelhash, governanceAddress, ensResolverAddress, 0);
ensRegistry.setSubnodeRecord(packagesDomainNode, gasPriceOraclePackageDomainLabelhash, governanceAddress, ensResolverAddress, 0);
ensRegistry.setSubnodeRecord(packagesDomainNode, tornadoConfigPackageDomainLabelhash, governanceAddress, ensResolverAddress, 0);
ensRegistry.setSubnodeRecord(packagesDomainNode, anonymityMiningPackageDomainLabelhash, governanceAddress, ensResolverAddress, 0);
ensRegistry.setSubnodeRecord(packagesDomainNode, tornadoTreesPackageDomainLabelhash, governanceAddress, ensResolverAddress, 0);
ensRegistry.setSubnodeRecord(packagesDomainNode, fixedMerkleTreePackageDomainLabelhash, governanceAddress, ensResolverAddress, 0);
ensRegistry.setSubnodeRecord(packagesDomainNode, txManagerPackageDomainLabelhash, governanceAddress, ensResolverAddress, 0);
ensRegistry.setSubnodeRecord(packagesDomainNode, merkleRootUpdaterPackageDomainLabelhash, governanceAddress, ensResolverAddress, 0);
// From data/ensDomainsIPFSContenthashes.txt, calculated via scripts/calculateIPFSContenthashes.ts
bytes memory classicUiIPFSContenthash = hex"e301017012203c89ba6bfdeb8d7209463006e620ee6dcb34675cf3202f20919e3a5f9919070d";
bytes memory novaUiIPFSContenthash = hex"e3010170122069648b09fb7ed9a89ca153a000bc8c1bf82a779195a640609e1510dc36c28bb7";
bytes memory relayersUiIPFSContenthash = hex"e301017012203d61bed0641d7c53d5f036b6448f9d455ae6e0ceda44563009536a12e51d52cf";
bytes memory docsIPFSContenthash = hex"e301017012201e6facc47ac27a4072b3ba19e716c0db37cbd29b40b23f3af8a85412ef45be08";
bytes memory downloadInstructionsHtmlContenthash = hex"e30101701220810e2b756845f89793b616c56a0b5ab9689da7f6e7fdf93280d05a0969a4902c";
bytes memory downloadScriptSourceContenthash = hex"e301017012208d6f8f48d3c2bcb6eaafae3110ad59b5aa2137010d827996ea1b87f39266b4f5";
bytes memory classicUiSourceContenthash = hex"e30101701220b674829af0777f2b89ed96020184ee6f04f6cfd2eb176ad2b653b1f2a5563d98";
bytes memory classicRelayerSourceContenthash = hex"e301017012205ad0c59d5fcc60e4866ab37f063480ffa305eb84da143894be5baeff2bb8e931";
bytes memory novaRelayerSourceContenthash = hex"e30101701220c9106227570ab16e639adb5f05ccde1b367b004f582e0700a00dfb54f914068c";
bytes memory relayersUiSourceContenthash = hex"e3010170122046847feae11b2774438df322e014e04652fe029ba59b79df90fafba040ba6550";
bytes memory novaUiSourceContenthash = hex"e30101701220b554eed2a9ba47011b6790ff6d23d0480419de78abf723ea7ada55e1664f5976";
bytes memory docsSourceContenthash = hex"e30101701220a140c7c35f6f2cc72f77d69b73dbab14ac0ccd6ba611a394282ac29f05b89951";
bytes memory tornadoCliSourceContenthash = hex"e30101701220cb1d7ca2be9c5d7ddba48d5c2b5bb027359ac4c0cf077327a14c9ffe1db057e6";
bytes memory infoPageSourceContenthash = hex"e30101701220269c131010a479474d82d7926cc14394d01c41bfb4cda23c26aa3defd65ad4fe";
bytes memory classicUiMinifiedContenthash = hex"e301017012201cbffa16ff8f8bd88f2600f1826648aead1ad513b2f3b1118ef873db9f2add59";
bytes memory novaUiMinifiedContenthash = hex"e30101701220f1e9f532b9a96e8d808f983d4471da7c261daeacbd9d8e76f82d04875d5ad9fa";
bytes memory tornadoCliMinifiedContenthash = hex"e3010170122057be20935fa635689427856a462b288fe353df7b588dcb30ff1b7e6cbffe0d9c";
bytes memory tornTokenSourceContenthash = hex"e30101701220fdee0b6906de7f60179c44103dc0bfd4600233f3737c48eb2e7279850970fd92";
bytes memory merkleRootUpdaterPackageContenthash = hex"e301017012204c9d433771e8e97cece783366a16c6cd4357b6fb94c6602a90d98e54c4179a3d";
bytes memory gasPriceOraclePackageContenthash = hex"e3010170122073e0f65b60d455058aff4fd9b2d0ba2b87f62fb59069433439810dad2d54e615";
bytes memory tornadoOraclesPackageContenthash = hex"e30101701220968d7fb0c0b8981bc8ec464e27ad2a90ef0dbcf67df5990498d94718fa9c6361";
bytes memory snarkjsPackageContenthash = hex"e30101701220e5d69d83d296c8623aa1b1ff5f9ddc3242914df2bd5f20c1682f07ee095dc6d4";
bytes memory websnarkPackageContenthash = hex"e3010170122033fa876a2752cc124fec5c61ebedaf623b42ac50ff348322f8f08183c5aabb8f";
bytes memory circomlibPackageContenthash = hex"e30101701220663529c784c5702922344a1035884949317cd59a529160cfb4571709df9c7059";
bytes memory txManagerPackageContenthash = hex"e30101701220952a5880f8b175e2206e7502b9891710876e2c970031616b7ede68ce994dea4b";
bytes memory fixedMerkleTreePackageContenthash = hex"e30101701220615d9d0986e8fd6a233615d792a70cf5125e188aa82c7493816a5d83c384b924";
bytes memory tornadoTreesPackageContenthash = hex"e30101701220b8ea77533cc9b2f434bac48d96d8bc48183cc335fd726b8c5edf11dfa36a78dc";
bytes memory anonymityMiningPackageContenthash = hex"e301017012204f3d3a8f0a8a183261288f6012844f74605fd7813d9adc5200784125fb1f671c";
bytes memory tornadoConfigPackageContenthash = hex"e301017012202d419e8834b28e8aafabe3dfe39e3d71f2c07c3911c856248a6e6587bfec195a";
ensResolver.setContenthash(rootTornadoENSNode, classicUiIPFSContenthash);
ensResolver.setContenthash(novaENSNode, novaUiIPFSContenthash);
ensResolver.setContenthash(docsENSNode, docsIPFSContenthash);
ensResolver.setContenthash(relayersUIENSNode, relayersUiIPFSContenthash);
// Set IPFS Cids in ENS subdomain contenthashes
ensResolver.setContenthash(sourcesDomainNode, downloadInstructionsHtmlContenthash);
ensResolver.setContenthash(downloadScriptSourceDomainNode, downloadScriptSourceContenthash);
ensResolver.setContenthash(classicUISourceDomainNode, classicUiSourceContenthash);
ensResolver.setContenthash(novaUISourceDomainNode, novaUiSourceContenthash);
ensResolver.setContenthash(docsSourceDomainNode, docsSourceContenthash);
ensResolver.setContenthash(relayersUISourceDomainNode, relayersUiSourceContenthash);
ensResolver.setContenthash(tornTokenSourceDomainNode, tornTokenSourceContenthash);
ensResolver.setContenthash(classicRelayerSoftwareSourceDomainNode, classicRelayerSourceContenthash);
ensResolver.setContenthash(novaRelayerSoftwareSourceDomainNode, novaRelayerSourceContenthash);
ensResolver.setContenthash(tornadoCliSourceDomainNode, tornadoCliSourceContenthash);
ensResolver.setContenthash(infoPageSourceDomainNode, infoPageSourceContenthash);
ensResolver.setContenthash(classicUIMinifiedDomainNode, classicUiMinifiedContenthash);
ensResolver.setContenthash(tornadoCliMinifiedDomainNode, tornadoCliMinifiedContenthash);
ensResolver.setContenthash(websnarkPackageDomainNode, websnarkPackageContenthash);
ensResolver.setContenthash(circomlibPackageDomainNode, circomlibPackageContenthash);
ensResolver.setContenthash(novaMinifiedDomainNode, novaUiMinifiedContenthash);
ensResolver.setContenthash(snarkjsPackageDomainNode, snarkjsPackageContenthash);
ensResolver.setContenthash(tornadoOraclesPackageDomainNode, tornadoOraclesPackageContenthash);
ensResolver.setContenthash(gasPriceOraclePackageDomainNode, gasPriceOraclePackageContenthash);
ensResolver.setContenthash(tornadoConfigPackageDomainNode, tornadoConfigPackageContenthash);
ensResolver.setContenthash(anonymityMiningPackageDomainNode, anonymityMiningPackageContenthash);
ensResolver.setContenthash(tornadoTreesPackageDomainNode, tornadoTreesPackageContenthash);
ensResolver.setContenthash(fixedMerkleTreePackageDomainNode, fixedMerkleTreePackageContenthash);
ensResolver.setContenthash(txManagerPackageDomainNode, txManagerPackageContenthash);
ensResolver.setContenthash(merkleRootUpdaterPackageDomainNode, merkleRootUpdaterPackageContenthash);
}
}

@ -0,0 +1,50 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import { IENSResolver } from "@interfaces/IENSResolver.sol";
import { IENSRegistry } from "@interfaces/IENSRegistry.sol";
import { ENSNamehash } from "./ENSNamehash.sol";
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";
contract GoerliDomainOwner is Ownable, ERC1155Holder {
address internal ensResolverAddress = 0xd7a4F6473f32aC2Af804B3686AE8F1932bC35750; // goerli ENS resolver
address internal ensRegistryAddress = 0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e;
IENSResolver ensResolver = IENSResolver(ensResolverAddress);
IENSRegistry ensRegistry = IENSRegistry(ensRegistryAddress);
function transferDomainOwnership(string memory domain, address to) public onlyOwner {
_transferDomainOwnership(ENSNamehash.namehash(bytes(domain)), to);
}
function _transferDomainOwnership(bytes32 domainNode, address to) private {
require(ensRegistry.owner(domainNode) == address(this), "This test contract must be an owner of domain");
ensRegistry.setOwner(domainNode, to);
}
function calculateSubdomainLabelhash(string memory subdomainLabel) internal pure returns (bytes32) {
return keccak256(bytes(subdomainLabel));
}
function isContract(address _addr) private view returns (bool) {
uint32 size;
assembly {
size := extcodesize(_addr)
}
return (size > 0);
}
function execute(address proposal) public onlyOwner {
require(isContract(proposal), "not a contract");
(bool success, bytes memory data) = proposal.delegatecall(abi.encodeWithSignature("executeProposal()"));
if (!success) {
if (data.length > 0) {
revert(string(data));
} else {
revert("Proposal execution failed");
}
}
}
}

@ -1,100 +0,0 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import { IENSResolver } from "@interfaces/IENSResolver.sol";
import { IENSRegistry } from "@interfaces/IENSRegistry.sol";
import { ENSNamehash } from "./ENSNamehash.sol";
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
import { TornadoAddresses } from "@proprietary/TornadoAddresses.sol";
contract GoerliTestProposal is Ownable, TornadoAddresses {
address internal ensResolverAddress = 0xd7a4F6473f32aC2Af804B3686AE8F1932bC35750; // goerli ENS resolver
address internal ensRegistryAddress = 0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e;
string testDomain = "tornadotest.eth";
bytes32 testNode = calculateDomainNode(testDomain);
IENSResolver ensResolver = IENSResolver(ensResolverAddress);
IENSRegistry ensRegistry = IENSRegistry(ensRegistryAddress);
function transferDomainOwnership(address to) public onlyOwner {
_transferDomainOwnership(testNode, to);
}
function transferSubdomainOwnership(string memory domain, string memory subdomainLabel, address to) public onlyOwner {
_transferSubdomainOwnership(domain, subdomainLabel, to);
}
function registerSubname(string memory domain, string memory subdomainLabel) public onlyOwner {
bytes32 rootNode = calculateDomainNode(domain);
address rootResolver = ensRegistry.resolver(rootNode);
bytes32 subdomainLabelhash = calculateSubdomainLabelhash(subdomainLabel);
ensRegistry.setSubnodeRecord(rootNode, subdomainLabelhash, address(this), rootResolver, 0);
}
function _transferDomainOwnership(bytes32 domainNode, address to) private {
require(ensRegistry.owner(domainNode) == address(this), "This test contract must be an owner of domain");
ensRegistry.setOwner(domainNode, to);
}
function _transferSubdomainOwnership(string memory domain, string memory subdomainLabel, address to) private {
bytes32 rootNode = calculateDomainNode(domain);
bytes32 subdomainLabelhash = calculateSubdomainLabelhash(subdomainLabel);
bytes32 subdomainNode = keccak256(abi.encodePacked(rootNode, subdomainLabelhash));
require(ensRegistry.recordExists(subdomainNode), "Subdomain not registered");
require(ensRegistry.owner(rootNode) == address(this), "This test contract must be an owner of domain");
ensRegistry.setSubnodeOwner(rootNode, subdomainLabelhash, to);
}
function setNewDomain(string memory newDomain) public onlyOwner {
bytes32 newNode = ENSNamehash.namehash(bytes(newDomain));
require(ensRegistry.recordExists(newNode), "Node doesn't exist");
require(ensRegistry.owner(newNode) == address(this), "Contract is not an owner of new ENS name");
transferDomainOwnership(owner());
testDomain = newDomain;
testNode = newNode;
}
function calculateDomainNode(string memory domain) internal pure returns (bytes32) {
return ENSNamehash.namehash(bytes(domain));
}
function calculateSubdomainLabelhash(string memory subdomainLabel) internal pure returns (bytes32) {
return keccak256(bytes(subdomainLabel));
}
function ownSubdomain(string memory domain, string memory subdomainLabel) public {
_transferSubdomainOwnership(domain, subdomainLabel, address(this));
}
function setClassicUiIpfs() public {
bytes memory classicUiIPFSContenthash = hex"e301017012203c89ba6bfdeb8d7209463006e620ee6dcb34675cf3202f20919e3a5f9919070d";
ensResolver.setContenthash(testNode, classicUiIPFSContenthash);
}
function setNovaIpfs() public {
bytes memory novaUiIPFSContenthash = hex"e3010170122069648b09fb7ed9a89ca153a000bc8c1bf82a779195a640609e1510dc36c28bb7";
ensResolver.setContenthash(testNode, novaUiIPFSContenthash);
}
function setRelayersNetworkIpfs() public {
bytes memory relayersUiIPFSContenthash = hex"e301017012203d61bed0641d7c53d5f036b6448f9d455ae6e0ceda44563009536a12e51d52cf";
ensResolver.setContenthash(testNode, relayersUiIPFSContenthash);
}
function setDocsIpfs() public {
bytes memory docsIPFSContenthash = hex"e301017012201e6facc47ac27a4072b3ba19e716c0db37cbd29b40b23f3af8a85412ef45be08";
ensResolver.setContenthash(testNode, docsIPFSContenthash);
}
function setStakingAddress(string memory domain) public {
ensResolver.setAddr(calculateDomainNode(domain), stakingAddress);
}
}

167
test/GoerliTestProposal.sol Normal file

@ -0,0 +1,167 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import { IGovernance } from "@interfaces/IGovernance.sol";
import { IENSRegistry } from "@interfaces/IENSRegistry.sol";
import { IENSResolver } from "@interfaces/IENSResolver.sol";
contract GoerliTestProposal {
address constant governanceAddress = 0xa749409476A540B463d165AFcD92CcE28AB3d2a7;
address constant ensResolverAddress = 0xd7a4F6473f32aC2Af804B3686AE8F1932bC35750;
address constant ensRegistryAddress = 0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e;
IENSRegistry internal constant ensRegistry = IENSRegistry(ensRegistryAddress);
IENSResolver internal constant ensResolver = IENSResolver(ensResolverAddress);
bytes32 internal constant rootTornadoDomainNode = 0xa8f2228d0331c20e8d36b0bf33b102b5b8d8d416db25502b04e5b854d7a5c556;
bytes32 internal constant sourcesDomainNode = 0x857d0c409cbb3112c1b9a6a2c1fb1ac516630d9c263cb04bf3d5a32407b936d5;
bytes32 internal constant minifiedSourcesDomainNode = 0x0b7a6db16524d96c9c45252b05191330e5cd76af1a65e883f15a6b0df143ea72;
bytes32 internal constant packagesDomainNode = 0xcc0d5182bef33b3ece771ca070bdff76ab80c3af59951aa41995e0ddd1a307f1;
bytes32 internal constant downloadScriptSourceDomainNode = 0x3ca990173243a16600a2c480447f5506291f48aaccc152c6ceb05ab13b26dd1a;
bytes32 internal constant classicUISourceDomainNode = 0x0b5e06d4c6e76faae426647aceda719067818b62a53350ad34f73792e8850254;
bytes32 internal constant novaUISourceDomainNode = 0x38676e6f1e375cea26d79df47f589850623e84cf77426cdccd8e8e50c964dfdf;
bytes32 internal constant docsSourceDomainNode = 0x2c6d4d7c3f94987894b9893d813e5f15447b2e63534f423cbdf97490ceccd57c;
bytes32 internal constant relayersUISourceDomainNode = 0x1e0e78434fb4ccd771715e5ef7cb66253591943a3d863d3d75f2be3418904dea;
bytes32 internal constant tornTokenSourceDomainNode = 0x3a17690a58fe5f6b5b33eef2d2998114a332b4feb3e8f06f818542f4d528e3eb;
bytes32 internal constant classicRelayerSoftwareSourceDomainNode = 0x0e30230d2c81771372c21b8c82b957bf8a44cbb48a3a0396e3a7bc593577d72e;
bytes32 internal constant novaRelayerSoftwareSourceDomainNode = 0x1c1bc2a95e6db3a336aca1f33ebaae0af0343c5a2b0ca9cb03f56fd8631557f0;
bytes32 internal constant tornadoCliSourceDomainNode = 0x8fd0043a38548a5022a557c3e196e2aa9de038f2f6036ad565e842f43565af21;
bytes32 internal constant infoPageSourceDomainNode = 0x51c628ee8a039a17cfc4509e671da25e2832ce9d496c0dce2525e67ab14c4b06;
bytes32 internal constant classicUIMinifiedDomainNode = 0xbf189e20cf74064173ac3d9b572f36268de3a74416c0743b80f80a72e77c39c5;
bytes32 internal constant novaMinifiedDomainNode = 0xaba43caec785b400d898195b430e1d67e9c242d0873b24c51e0988a7b7c4c3ec;
bytes32 internal constant tornadoCliMinifiedDomainNode = 0xeb5a0c348b96ea0a86ffba4cc09329cafed4e7858a3b09b9e4951fc45b155051;
bytes32 internal constant websnarkPackageDomainNode = 0xd5dc0d0f67049b9973792539efbc65c74f1ccfa34bcacc245d95fef528348f31;
bytes32 internal constant circomlibPackageDomainNode = 0x5c0d325132700969f3a5d9cc29362934547c6b547d9f2de89667cf25976d4030;
bytes32 internal constant snarkjsPackageDomainNode = 0x68d17fc00031d0a157958a4a4aac1f51431ebe1ad3b907649a746fad227934c1;
bytes32 internal constant tornadoOraclesPackageDomainNode = 0xd1678f13f0fc6712edd4d8a8ccad982e75df07403c96e65ce1ef2e0df6ccd72c;
bytes32 internal constant gasPriceOraclePackageDomainNode = 0xfbe0717768964b98ff37c4d89db1e305e42914fbebd8722bb5b113aa2e34a8b5;
bytes32 internal constant tornadoConfigPackageDomainNode = 0xca98d0d3c988c445e30fa8a49981008d16a41f006cd5d1730a90790cf5a5f638;
bytes32 internal constant anonymityMiningPackageDomainNode = 0x5627f29b5f86fea22182dd2a20d2a747be3ad0f204e7d8637e60ce2a8505a74f;
bytes32 internal constant tornadoTreesPackageDomainNode = 0xb812eb01e6f49f624c16f227ce6680e639476057ad26fe4ec559b08f461a8a3d;
bytes32 internal constant fixedMerkleTreePackageDomainNode = 0xea4f316afeb12220db9b9737341ca13329fa73557841cdf344fb895eefeaaecc;
bytes32 internal constant txManagerPackageDomainNode = 0x91e6d11b11e5c0a98be4130f69446eb9460afeaae935dbfa6ef7b2361120c75d;
bytes32 internal constant merkleRootUpdaterPackageDomainNode = 0xa9f9472a40c96dc4c30470e180df2fd94b75f19161fb5610bff0b4ef2ddf06ab;
bytes32 internal constant rootTornadoDomainLabelhash = 0x28d5131e4f60044a3e4d52eb398a7f8f08b6b7e01040696e895a1f81029fca83;
bytes32 internal constant sourcesDomainLabelhash = 0x6ee89d35dcb4b9803f51dc5e513c1c1714149cf0821537078d8ad61616e49f2b;
bytes32 internal constant minifiedSourcesDomainLabelhash = 0x26403be8dc5694ba56b8d49945b813cff19140637d1fa38a3187a07faf4ee073;
bytes32 internal constant packagesDomainLabelhash = 0x89c4c51c9264344cbc2ab3aa255b085918a2841af8ffaa3133ceabee961afffd;
bytes32 internal constant downloadScriptSourceDomainLabelhash = 0xedb311f245ef85f918a5790470448cf17c7d06961f4dfa42cc41616de7f8c2e1;
bytes32 internal constant classicUISourceDomainLabelhash = 0x4e27b2a330e4a0d8d8521393df67e9a24fb2ab5f10f9e640c244d504874322bc;
bytes32 internal constant novaUISourceDomainLabelhash = 0xc90e7e9184dce6e0d7fff2e19e72ffa35430aca54bd634ada091bef2d2bb0635;
bytes32 internal constant docsSourceDomainLabelhash = 0x6bf9054545420e9e9f4aa4f353a32c7d0d52c11dbcdda56c53be8375cafeebb1;
bytes32 internal constant relayersUISourceDomainLabelhash = 0xea7c97223b0629f1c3bea11a57dd6179a12e9cc4bbdf8f69fb999c4051c682cf;
bytes32 internal constant tornTokenSourceDomainLabelhash = 0x5d8fec99a5792d7772f788343c7991bf1049b821dcd1b0b900f86e6b7fe7fb25;
bytes32 internal constant classicRelayerSoftwareSourceDomainLabelhash =
0x7bece1009df269e16c3552ea6ced49b1d66c22438cda5caf73f55ac74bcadea9;
bytes32 internal constant novaRelayerSoftwareSourceDomainLabelhash = 0xe01bed58384f9ee9a9dccf26a4236eca42aa8b767efe27c5d191a51885118e5b;
bytes32 internal constant tornadoCliSourceDomainLabelhash = 0x92c0fea2a18f1747f48f5503806e5f24d5ccb2c360ef56a462ce254707afa64a;
bytes32 internal constant infoPageSourceDomainLabelhash = 0x41c8b7e0e9650ab5d1f55454c8ad68d9d4c6d42f1a8a14878b77e92e9794e610;
bytes32 internal constant classicUIMinifiedDomainLabelhash = 0x4e27b2a330e4a0d8d8521393df67e9a24fb2ab5f10f9e640c244d504874322bc;
bytes32 internal constant novaMinifiedDomainLabelhash = 0xc90e7e9184dce6e0d7fff2e19e72ffa35430aca54bd634ada091bef2d2bb0635;
bytes32 internal constant tornadoCliMinifiedDomainLabelhash = 0x92c0fea2a18f1747f48f5503806e5f24d5ccb2c360ef56a462ce254707afa64a;
bytes32 internal constant websnarkPackageDomainLabelhash = 0x50d1752a9b1f31ebf05378927a112194d33596cc02a04c06970477bd8a40c931;
bytes32 internal constant circomlibPackageDomainLabelhash = 0x68dc231d08143bcf7cf261e63071bdcb7d606e41dec696e34482f6d1068c4afa;
bytes32 internal constant snarkjsPackageDomainLabelhash = 0x31df71a9eb77699aba0f0e6d565af942889afef76e60ee8a9f80c27f2e946065;
bytes32 internal constant tornadoOraclesPackageDomainLabelhash = 0xb7a48206cd37ed309fdcdf62fe4b65d6871298645d5e41942f0cd89c08a65cbf;
bytes32 internal constant gasPriceOraclePackageDomainLabelhash = 0x05048648c60bebc220ad5a82188a966f910539a7e1947cc8a9ac0ec1cd99ca40;
bytes32 internal constant tornadoConfigPackageDomainLabelhash = 0x0b49c88cd3d1ba3c99fdd9a41ced95ec8629bda85e80b6c506c15db62ab8f761;
bytes32 internal constant anonymityMiningPackageDomainLabelhash = 0xc3520c36e06133299b24abf819a008b22bc3e9adfa39a38bbccd5cf829831d48;
bytes32 internal constant tornadoTreesPackageDomainLabelhash = 0xef1496a9cbb93e123ce8e3a0868374bda8446faafa4c2eb7fce3c7a9465be8df;
bytes32 internal constant fixedMerkleTreePackageDomainLabelhash = 0x37441881d8c14192cbe636eb3d4318346c6af80d92971e1357419a1a94e8a2e2;
bytes32 internal constant txManagerPackageDomainLabelhash = 0x0d3be7866f858f24a43fd40d3844a410405b3d6abd2255102d8327fa242a4ff3;
bytes32 internal constant merkleRootUpdaterPackageDomainLabelhash = 0x1b162702ef4549cb2e6522252d90c0d44fcce15b939897373cfa4f829488cab4;
function executeProposal() public {
// Register all subnodes, set Governance as an owner
ensRegistry.setSubnodeRecord(rootTornadoDomainNode, sourcesDomainLabelhash, governanceAddress, ensResolverAddress, 0);
ensRegistry.setSubnodeRecord(sourcesDomainNode, minifiedSourcesDomainLabelhash, governanceAddress, ensResolverAddress, 0);
ensRegistry.setSubnodeRecord(sourcesDomainNode, packagesDomainLabelhash, governanceAddress, ensResolverAddress, 0);
ensRegistry.setSubnodeRecord(sourcesDomainNode, downloadScriptSourceDomainLabelhash, governanceAddress, ensResolverAddress, 0);
ensRegistry.setSubnodeRecord(sourcesDomainNode, classicUISourceDomainLabelhash, governanceAddress, ensResolverAddress, 0);
ensRegistry.setSubnodeRecord(sourcesDomainNode, novaUISourceDomainLabelhash, governanceAddress, ensResolverAddress, 0);
ensRegistry.setSubnodeRecord(sourcesDomainNode, docsSourceDomainLabelhash, governanceAddress, ensResolverAddress, 0);
ensRegistry.setSubnodeRecord(sourcesDomainNode, relayersUISourceDomainLabelhash, governanceAddress, ensResolverAddress, 0);
ensRegistry.setSubnodeRecord(sourcesDomainNode, tornTokenSourceDomainLabelhash, governanceAddress, ensResolverAddress, 0);
ensRegistry.setSubnodeRecord(sourcesDomainNode, novaRelayerSoftwareSourceDomainLabelhash, governanceAddress, ensResolverAddress, 0);
ensRegistry.setSubnodeRecord(
sourcesDomainNode, classicRelayerSoftwareSourceDomainLabelhash, governanceAddress, ensResolverAddress, 0
);
ensRegistry.setSubnodeRecord(sourcesDomainNode, tornadoCliSourceDomainLabelhash, governanceAddress, ensResolverAddress, 0);
ensRegistry.setSubnodeRecord(sourcesDomainNode, infoPageSourceDomainLabelhash, governanceAddress, ensResolverAddress, 0);
ensRegistry.setSubnodeRecord(minifiedSourcesDomainNode, classicUIMinifiedDomainLabelhash, governanceAddress, ensResolverAddress, 0);
ensRegistry.setSubnodeRecord(minifiedSourcesDomainNode, novaMinifiedDomainLabelhash, governanceAddress, ensResolverAddress, 0);
ensRegistry.setSubnodeRecord(minifiedSourcesDomainNode, tornadoCliMinifiedDomainLabelhash, governanceAddress, ensResolverAddress, 0);
ensRegistry.setSubnodeRecord(packagesDomainNode, websnarkPackageDomainLabelhash, governanceAddress, ensResolverAddress, 0);
ensRegistry.setSubnodeRecord(packagesDomainNode, circomlibPackageDomainLabelhash, governanceAddress, ensResolverAddress, 0);
ensRegistry.setSubnodeRecord(packagesDomainNode, snarkjsPackageDomainLabelhash, governanceAddress, ensResolverAddress, 0);
ensRegistry.setSubnodeRecord(packagesDomainNode, tornadoOraclesPackageDomainLabelhash, governanceAddress, ensResolverAddress, 0);
ensRegistry.setSubnodeRecord(packagesDomainNode, gasPriceOraclePackageDomainLabelhash, governanceAddress, ensResolverAddress, 0);
ensRegistry.setSubnodeRecord(packagesDomainNode, tornadoConfigPackageDomainLabelhash, governanceAddress, ensResolverAddress, 0);
ensRegistry.setSubnodeRecord(packagesDomainNode, anonymityMiningPackageDomainLabelhash, governanceAddress, ensResolverAddress, 0);
ensRegistry.setSubnodeRecord(packagesDomainNode, tornadoTreesPackageDomainLabelhash, governanceAddress, ensResolverAddress, 0);
ensRegistry.setSubnodeRecord(packagesDomainNode, fixedMerkleTreePackageDomainLabelhash, governanceAddress, ensResolverAddress, 0);
ensRegistry.setSubnodeRecord(packagesDomainNode, txManagerPackageDomainLabelhash, governanceAddress, ensResolverAddress, 0);
ensRegistry.setSubnodeRecord(packagesDomainNode, merkleRootUpdaterPackageDomainLabelhash, governanceAddress, ensResolverAddress, 0);
// From data/ensDomainsIPFSContenthashes.txt, calculated via scripts/calculateIPFSContenthashes.ts
bytes memory downloadInstructionsHtmlContenthash = hex"e30101701220810e2b756845f89793b616c56a0b5ab9689da7f6e7fdf93280d05a0969a4902c";
bytes memory downloadScriptSourceContenthash = hex"e301017012208d6f8f48d3c2bcb6eaafae3110ad59b5aa2137010d827996ea1b87f39266b4f5";
bytes memory classicUiSourceContenthash = hex"e30101701220b674829af0777f2b89ed96020184ee6f04f6cfd2eb176ad2b653b1f2a5563d98";
bytes memory classicRelayerSourceContenthash = hex"e301017012205ad0c59d5fcc60e4866ab37f063480ffa305eb84da143894be5baeff2bb8e931";
bytes memory novaRelayerSourceContenthash = hex"e30101701220c9106227570ab16e639adb5f05ccde1b367b004f582e0700a00dfb54f914068c";
bytes memory relayersUiSourceContenthash = hex"e3010170122046847feae11b2774438df322e014e04652fe029ba59b79df90fafba040ba6550";
bytes memory novaUiSourceContenthash = hex"e30101701220b554eed2a9ba47011b6790ff6d23d0480419de78abf723ea7ada55e1664f5976";
bytes memory docsSourceContenthash = hex"e30101701220a140c7c35f6f2cc72f77d69b73dbab14ac0ccd6ba611a394282ac29f05b89951";
bytes memory tornadoCliSourceContenthash = hex"e30101701220cb1d7ca2be9c5d7ddba48d5c2b5bb027359ac4c0cf077327a14c9ffe1db057e6";
bytes memory infoPageSourceContenthash = hex"e30101701220269c131010a479474d82d7926cc14394d01c41bfb4cda23c26aa3defd65ad4fe";
bytes memory classicUiMinifiedContenthash = hex"e301017012201cbffa16ff8f8bd88f2600f1826648aead1ad513b2f3b1118ef873db9f2add59";
bytes memory novaUiMinifiedContenthash = hex"e30101701220f1e9f532b9a96e8d808f983d4471da7c261daeacbd9d8e76f82d04875d5ad9fa";
bytes memory tornadoCliMinifiedContenthash = hex"e3010170122057be20935fa635689427856a462b288fe353df7b588dcb30ff1b7e6cbffe0d9c";
bytes memory tornTokenSourceContenthash = hex"e30101701220fdee0b6906de7f60179c44103dc0bfd4600233f3737c48eb2e7279850970fd92";
bytes memory merkleRootUpdaterPackageContenthash = hex"e301017012204c9d433771e8e97cece783366a16c6cd4357b6fb94c6602a90d98e54c4179a3d";
bytes memory gasPriceOraclePackageContenthash = hex"e3010170122073e0f65b60d455058aff4fd9b2d0ba2b87f62fb59069433439810dad2d54e615";
bytes memory tornadoOraclesPackageContenthash = hex"e30101701220968d7fb0c0b8981bc8ec464e27ad2a90ef0dbcf67df5990498d94718fa9c6361";
bytes memory snarkjsPackageContenthash = hex"e30101701220e5d69d83d296c8623aa1b1ff5f9ddc3242914df2bd5f20c1682f07ee095dc6d4";
bytes memory websnarkPackageContenthash = hex"e3010170122033fa876a2752cc124fec5c61ebedaf623b42ac50ff348322f8f08183c5aabb8f";
bytes memory circomlibPackageContenthash = hex"e30101701220663529c784c5702922344a1035884949317cd59a529160cfb4571709df9c7059";
bytes memory txManagerPackageContenthash = hex"e30101701220952a5880f8b175e2206e7502b9891710876e2c970031616b7ede68ce994dea4b";
bytes memory fixedMerkleTreePackageContenthash = hex"e30101701220615d9d0986e8fd6a233615d792a70cf5125e188aa82c7493816a5d83c384b924";
bytes memory tornadoTreesPackageContenthash = hex"e30101701220b8ea77533cc9b2f434bac48d96d8bc48183cc335fd726b8c5edf11dfa36a78dc";
bytes memory anonymityMiningPackageContenthash = hex"e301017012204f3d3a8f0a8a183261288f6012844f74605fd7813d9adc5200784125fb1f671c";
bytes memory tornadoConfigPackageContenthash = hex"e301017012202d419e8834b28e8aafabe3dfe39e3d71f2c07c3911c856248a6e6587bfec195a";
// Set IPFS Cids in ENS subdomain contenthashes
ensResolver.setContenthash(sourcesDomainNode, downloadInstructionsHtmlContenthash);
ensResolver.setContenthash(downloadScriptSourceDomainNode, downloadScriptSourceContenthash);
ensResolver.setContenthash(classicUISourceDomainNode, classicUiSourceContenthash);
ensResolver.setContenthash(novaUISourceDomainNode, novaUiSourceContenthash);
ensResolver.setContenthash(docsSourceDomainNode, docsSourceContenthash);
ensResolver.setContenthash(relayersUISourceDomainNode, relayersUiSourceContenthash);
ensResolver.setContenthash(tornTokenSourceDomainNode, tornTokenSourceContenthash);
ensResolver.setContenthash(classicRelayerSoftwareSourceDomainNode, classicRelayerSourceContenthash);
ensResolver.setContenthash(novaRelayerSoftwareSourceDomainNode, novaRelayerSourceContenthash);
ensResolver.setContenthash(tornadoCliSourceDomainNode, tornadoCliSourceContenthash);
ensResolver.setContenthash(infoPageSourceDomainNode, infoPageSourceContenthash);
ensResolver.setContenthash(classicUIMinifiedDomainNode, classicUiMinifiedContenthash);
ensResolver.setContenthash(tornadoCliMinifiedDomainNode, tornadoCliMinifiedContenthash);
ensResolver.setContenthash(websnarkPackageDomainNode, websnarkPackageContenthash);
ensResolver.setContenthash(circomlibPackageDomainNode, circomlibPackageContenthash);
ensResolver.setContenthash(novaMinifiedDomainNode, novaUiMinifiedContenthash);
ensResolver.setContenthash(snarkjsPackageDomainNode, snarkjsPackageContenthash);
ensResolver.setContenthash(tornadoOraclesPackageDomainNode, tornadoOraclesPackageContenthash);
ensResolver.setContenthash(gasPriceOraclePackageDomainNode, gasPriceOraclePackageContenthash);
ensResolver.setContenthash(tornadoConfigPackageDomainNode, tornadoConfigPackageContenthash);
ensResolver.setContenthash(anonymityMiningPackageDomainNode, anonymityMiningPackageContenthash);
ensResolver.setContenthash(tornadoTreesPackageDomainNode, tornadoTreesPackageContenthash);
ensResolver.setContenthash(fixedMerkleTreePackageDomainNode, fixedMerkleTreePackageContenthash);
ensResolver.setContenthash(txManagerPackageDomainNode, txManagerPackageContenthash);
ensResolver.setContenthash(merkleRootUpdaterPackageDomainNode, merkleRootUpdaterPackageContenthash);
}
}

@ -15,13 +15,6 @@ contract TestExampleProposal is ProposalUtils {
IENSResolver internal ensResolver = IENSResolver(0x4976fb03C32e5B8cfe2b6cCB31c09Ba78EBaBa41);
IENSRegistry ensRegistry = IENSRegistry(ENSAddress);
string internal tornadoContractENSDomain = "contract.tornadocash.eth";
string internal governanceImplementationENSDomain = "governance-impl.contract.tornadocash.eth";
string internal stakingRewardsENSDomain = "staking-rewards.contract.tornadocash.eth";
bytes32 internal tornadoContractsENSNode = calculateDomainNode(tornadoContractENSDomain);
bytes32 internal stakingRewardsENSNode = calculateDomainNode(stakingRewardsENSDomain);
bytes32 internal governanceImplENSNode = calculateDomainNode(governanceImplementationENSDomain);
modifier executeCurrentProposalBefore() {
createAndExecuteProposal();
@ -38,34 +31,7 @@ contract TestExampleProposal is ProposalUtils {
proposeAndExecute(proposalAddress);
}
function testStakingAddressChanged() public executeCurrentProposalBefore {
address stakingAddressAfterProposal = ensResolver.addr(stakingRewardsENSNode);
console2.log("Address on staking ENS Tornado subdomain (staking-rewards.contract.tornadocash.eth): %s", stakingAddressAfterProposal);
require(stakingAddressAfterProposal == stakingAddress);
}
function testGovernanceImplAddressChanged() public executeCurrentProposalBefore {
address expectedGovernanceImplAddress = 0xBa178126C28F50Ee60322a82f5EbCd6b3711e101;
address governanceImplAddressAfterProposal = ensResolver.addr(governanceImplENSNode);
console2.log(
"Address on governance implementation ENS Tornado subdomain (governance-impl.contract.tornadocash.eth): %s",
governanceImplAddressAfterProposal
);
require(expectedGovernanceImplAddress == governanceImplAddressAfterProposal);
}
function testENSSubdomainOwnerChanged() public executeCurrentProposalBefore {
address tornadoContractsENSDomainOwner = ensRegistry.owner(tornadoContractsENSNode);
address governanceImplENSNodeOwner = ensRegistry.owner(governanceImplENSNode);
address stakingRewardsENSNodeOwner = ensRegistry.owner(stakingRewardsENSNode);
console2.log("Tornado contracts ENS domain owner after proposal execution: %s", tornadoContractsENSDomainOwner);
console2.log("Staking rewards ENS domain owner after proposal execution: %s", stakingRewardsENSNodeOwner);
console2.log("Governance implementation ENS domain owner after proposal execution: %s", governanceImplENSNodeOwner);
require(stakingRewardsENSNodeOwner == governanceAddress, "Staking rewards ENS domain owner is not governance");
require(tornadoContractsENSDomainOwner == governanceAddress, "Tornado contracts ENS domain owner is not governance");
require(governanceImplENSNodeOwner == governanceAddress, "Governance implementation ENS domain owner is not governance");
function test() public {
createAndExecuteProposal();
}
}