Compare commits
No commits in common. "45dcb16c89bf6c2e0f733930c95a7aef29a180d8" and "b7ea254974eeaac5c3314e6f3fb52ba5374ff8b5" have entirely different histories.
45dcb16c89
...
b7ea254974
@ -1,11 +1,9 @@
|
||||
bytes32 rootTornadoENSNode = 0xe6ae31d630cc7a8279c0f1c7cbe6e7064814c47d1785fa2703d9ae511ee2be0c;
|
||||
bytes32 tornadoContractENSNode = 0xe7e1d618367ebadd8e172150a43cfc839fd19022c2be81a6e8d45e06aa1011cd;
|
||||
bytes32 stakingRewardsENSNode = 0x3da4b79cd8c20d2fafb1c7cb37a62be8668f543393f6636d421fba0be735e68f;
|
||||
bytes32 governanceImplENSNode = 0x092359a5505072470ce8b86eebed5b4b6f001fe6bd08dbcf723c97073a360cfc;
|
||||
bytes32 novaENSNode = 0xc3964c598b56aeaee4c253283fb1ebb12510b95db00960589cdc62807a2537a0;
|
||||
bytes32 docsENSNode = 0xd7b8aac14a9b2507ab99b5fde3060197fddb9735afa9bf38b1f7e34923cb935e;
|
||||
bytes32 relayersUIENSNode = 0x4e37047f2c961db41dfb7d38cf79ca745faf134a8392cfb834d3a93330b9108d;
|
||||
|
||||
bytes32 tornadoContractENSLabelhash = 0x7f6dd79f0020bee2024a097aaa5d32ab7ca31126fa375538de047e7475fa8572;
|
||||
bytes32 stakingRewardsENSLabelhash = 0x15826fcf9999635849b273bcd226f436dc42a8fabf43049b60971ab51d8d6b8f;
|
||||
bytes32 governanceImplENSLabelhash = 0x6583a22765d3d6a6ca97b21440f79fecaf21bb8bcaa4fb694483e63d821ba50d;
|
||||
|
@ -8,7 +8,6 @@ import { DeclCalculator } from "./utils";
|
||||
|
||||
const rootTornadoDomain = "tornadocash.eth";
|
||||
const stakingDomain = "staking-rewards.contract.tornadocash.eth";
|
||||
const governanceImplDomain = "governance-impl.contract.tornadocash.eth";
|
||||
const novaUIDomain = "nova.tornadocash.eth";
|
||||
const docsDomain = "docs.tornadocash.eth";
|
||||
const relayersUIDomain = "relayers-network.tornadocash.eth";
|
||||
@ -17,7 +16,6 @@ const tornadoContractDomain = "contract.tornadocash.eth";
|
||||
const rootTornadoENSNode = hash(rootTornadoDomain);
|
||||
const tornadoContractENSNode = hash(tornadoContractDomain);
|
||||
const stakingRewardsENSNode = hash(stakingDomain);
|
||||
const governanceImplENSNode = hash(governanceImplDomain);
|
||||
const novaENSNode = hash(novaUIDomain);
|
||||
const docsENSNode = hash(docsDomain);
|
||||
const relayersUIENSNode = hash(relayersUIDomain);
|
||||
@ -25,20 +23,17 @@ const relayersUIENSNode = hash(relayersUIDomain);
|
||||
const getLabelhashFromDomain = (ensDomain: string) => "0x" + keccak_256(ensDomain.split(".")[0]);
|
||||
const tornadoContractENSLabelhash = getLabelhashFromDomain(tornadoContractDomain);
|
||||
const stakingRewardsENSLabelhash = getLabelhashFromDomain(stakingDomain);
|
||||
const governanceImplENSLabelhash = getLabelhashFromDomain(governanceImplDomain);
|
||||
|
||||
const { calculateDecl } = new DeclCalculator("bytes32");
|
||||
const solidityCode =
|
||||
calculateDecl({ rootTornadoENSNode }) +
|
||||
calculateDecl({ tornadoContractENSNode }) +
|
||||
calculateDecl({ stakingRewardsENSNode }) +
|
||||
calculateDecl({ governanceImplENSNode }) +
|
||||
calculateDecl({ novaENSNode }) +
|
||||
calculateDecl({ docsENSNode }) +
|
||||
calculateDecl({ relayersUIENSNode }) +
|
||||
"\n" +
|
||||
calculateDecl({ tornadoContractENSLabelhash }) +
|
||||
calculateDecl({ stakingRewardsENSLabelhash }) +
|
||||
calculateDecl({ governanceImplENSLabelhash });
|
||||
calculateDecl({ stakingRewardsENSLabelhash });
|
||||
|
||||
fs.writeFileSync(path.join("data", "ensNodesDeclarations.txt"), solidityCode);
|
||||
|
@ -12,7 +12,6 @@ contract UpdateENSDataProposal is TornadoAddresses {
|
||||
function executeProposal() public {
|
||||
address ensResolverAddress = 0x4976fb03C32e5B8cfe2b6cCB31c09Ba78EBaBa41;
|
||||
address ensRegistryAddress = 0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e;
|
||||
address governanceImplementationAddress = 0xBa178126C28F50Ee60322a82f5EbCd6b3711e101;
|
||||
|
||||
IENSRegistry ensRegistry = IENSRegistry(ensRegistryAddress);
|
||||
IENSResolver ensResolver = IENSResolver(ensResolverAddress);
|
||||
@ -21,25 +20,19 @@ contract UpdateENSDataProposal is TornadoAddresses {
|
||||
bytes32 rootTornadoENSNode = 0xe6ae31d630cc7a8279c0f1c7cbe6e7064814c47d1785fa2703d9ae511ee2be0c;
|
||||
bytes32 tornadoContractENSNode = 0xe7e1d618367ebadd8e172150a43cfc839fd19022c2be81a6e8d45e06aa1011cd;
|
||||
bytes32 stakingRewardsENSNode = 0x3da4b79cd8c20d2fafb1c7cb37a62be8668f543393f6636d421fba0be735e68f;
|
||||
bytes32 governanceImplENSNode = 0x092359a5505072470ce8b86eebed5b4b6f001fe6bd08dbcf723c97073a360cfc;
|
||||
bytes32 novaENSNode = 0xc3964c598b56aeaee4c253283fb1ebb12510b95db00960589cdc62807a2537a0;
|
||||
bytes32 docsENSNode = 0xd7b8aac14a9b2507ab99b5fde3060197fddb9735afa9bf38b1f7e34923cb935e;
|
||||
bytes32 relayersUIENSNode = 0x4e37047f2c961db41dfb7d38cf79ca745faf134a8392cfb834d3a93330b9108d;
|
||||
|
||||
bytes32 tornadoContractENSLabelhash = 0x7f6dd79f0020bee2024a097aaa5d32ab7ca31126fa375538de047e7475fa8572;
|
||||
bytes32 stakingRewardsENSLabelhash = 0x15826fcf9999635849b273bcd226f436dc42a8fabf43049b60971ab51d8d6b8f;
|
||||
bytes32 governanceImplENSLabelhash = 0x6583a22765d3d6a6ca97b21440f79fecaf21bb8bcaa4fb694483e63d821ba50d;
|
||||
|
||||
// At first change owner of subdomain contract.tornadocash.eth and then staking-rewards.contract.tornadocash.eth
|
||||
// and governance-impl.contract.tornadocash.eth to Governance
|
||||
// At first change owner of subdomain contract.tornadocash.eth and then staking-rewards.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);
|
||||
|
||||
// From data/ensDomainsIPFSContenthashes.txt, calculated via scripts/calculateIPFSContenthashes.ts
|
||||
bytes memory classicUiIPFSContenthash = hex"e301017012203c89ba6bfdeb8d7209463006e620ee6dcb34675cf3202f20919e3a5f9919070d";
|
||||
|
@ -6,32 +6,15 @@ import { UpdateENSDataProposal } from "@root/UpdateENSDataProposal.sol";
|
||||
|
||||
import { console2 } from "@forge-std/console2.sol";
|
||||
import { IENSResolver } from "@interfaces/IENSResolver.sol";
|
||||
import { IENSRegistry } from "@interfaces/IENSRegistry.sol";
|
||||
|
||||
import { ENSNamehash } from "./ENSNamehash.sol";
|
||||
|
||||
contract TestExampleProposal is ProposalUtils {
|
||||
using ENSNamehash for bytes;
|
||||
|
||||
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);
|
||||
IENSResolver ensResolver = IENSResolver(0x4976fb03C32e5B8cfe2b6cCB31c09Ba78EBaBa41);
|
||||
|
||||
modifier executeCurrentProposalBefore() {
|
||||
createAndExecuteProposal();
|
||||
_;
|
||||
}
|
||||
|
||||
function calculateDomainNode(string memory domain) internal pure returns (bytes32) {
|
||||
return ENSNamehash.namehash(bytes(domain));
|
||||
}
|
||||
|
||||
function createAndExecuteProposal() public {
|
||||
address proposalAddress = address(new UpdateENSDataProposal());
|
||||
|
||||
@ -39,33 +22,10 @@ contract TestExampleProposal is ProposalUtils {
|
||||
}
|
||||
|
||||
function testStakingAddressChanged() public executeCurrentProposalBefore {
|
||||
bytes32 stakingRewardsENSNode = 0x3da4b79cd8c20d2fafb1c7cb37a62be8668f543393f6636d421fba0be735e68f;
|
||||
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");
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user