From 45bcddf9a5716dfe6df2793023f4ed29ad261227 Mon Sep 17 00:00:00 2001 From: Drygin Date: Fri, 29 Jul 2022 20:02:55 +0300 Subject: [PATCH] TC-128 ransferAdminship --- README.md | 12 ++++++------ contracts/InstanceFactory.sol | 9 +++++++++ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index e1041e6..8d984d5 100644 --- a/README.md +++ b/README.md @@ -61,12 +61,12 @@ Check config.js for actual values. With `salt` = `0x0000000000000000000000000000000000000000000000000000000047941987` address must be: -1. `SidechainInstanceFactory` - `0xE24B853247B37375A080553082a5385Dda95E8cf` -2. `SidechainInstanceFactory proxy` - `0x168de886aC22e73b3306e234579794340a0eb746` -3. `InstanceFactory` - `0x8B85eB475Ac8D286DcF307346a6EAE9E9c93665d` -4. `InstanceFactory proxy` - `0xf30827C1588b17ABAeF855DF92bf6B60615F3e9C` -5. `InstanceProposalCreator` - `0xe1FcF99262F00cCbe2CE6cC70CE956C7e5728C10` -6. `InstanceProposalCreator proxy` - `0xa9189801C88fe8222001d2ee962A6A4150DB6026` +1. `SidechainInstanceFactory` - `0x3D36D4b204E68e8A1431ec31Bea1fFbA3eC04590` +2. `SidechainInstanceFactory proxy` - `0x9d5C91ccF5c58b312896C4B4De45426fA128b001` +3. `InstanceFactory` - `0x83216783423500116723884F70dB44fB7BBb855b` +4. `InstanceFactory proxy` - `0x300aF836C74c1Af73f4353130AC1314Ed59B6a0A` +5. `InstanceProposalCreator` - `0x2b73b3555F1904CB8042cA6703734438eD4F28a0` +6. `InstanceProposalCreator proxy` - `0x84E013c8699Cb115906929B68b1Dc5ca5B2Fc46c` Check addresses with current config: diff --git a/contracts/InstanceFactory.sol b/contracts/InstanceFactory.sol index 968a80c..ffaad77 100644 --- a/contracts/InstanceFactory.sol +++ b/contracts/InstanceFactory.sol @@ -102,4 +102,13 @@ contract InstanceFactory is Initializable { nativeCurImpl = address(new ETHTornadoCloneable(_verifier, _hasher)); emit NewImplementationSet(ERC20Impl, nativeCurImpl, _verifier, _hasher); } + + /** + * @dev Transfers adminship of the contract to a new account (`newAdmin`). + * Can only be called by the current admin. + */ + function transferAdminship(address newAdmin) external onlyAdmin { + require(newAdmin != address(0), "IF: new owner is the zero address"); + admin = newAdmin; + } }