Use AdminUpgradeableProxy for Staking
Signed-off-by: AlienTornadosaurusHex <>
This commit is contained in:
parent
5544eca83b
commit
d23fa9dd08
@ -3,9 +3,11 @@
|
|||||||
pragma solidity ^0.6.12;
|
pragma solidity ^0.6.12;
|
||||||
pragma experimental ABIEncoderV2;
|
pragma experimental ABIEncoderV2;
|
||||||
|
|
||||||
import { LoopbackProxy } from "../v1/LoopbackProxy.sol";
|
|
||||||
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
|
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
|
||||||
|
|
||||||
|
import { LoopbackProxy } from "../v1/LoopbackProxy.sol";
|
||||||
|
import { AdminUpgradeableProxy } from "./proxy/AdminUpgradeableProxy.sol";
|
||||||
|
|
||||||
import { GovernancePatchUpgrade } from "./GovernancePatchUpgrade.sol";
|
import { GovernancePatchUpgrade } from "./GovernancePatchUpgrade.sol";
|
||||||
import { TornadoStakingRewards } from "./TornadoStakingRewards.sol";
|
import { TornadoStakingRewards } from "./TornadoStakingRewards.sol";
|
||||||
import { RelayerRegistry } from "./RelayerRegistry.sol";
|
import { RelayerRegistry } from "./RelayerRegistry.sol";
|
||||||
@ -55,8 +57,13 @@ contract PatchProposal {
|
|||||||
// Get the small amount of TORN left
|
// Get the small amount of TORN left
|
||||||
oldStaking.withdrawTorn(TORN.balanceOf(address(oldStaking)));
|
oldStaking.withdrawTorn(TORN.balanceOf(address(oldStaking)));
|
||||||
|
|
||||||
// And create a new staking contract
|
// Just to make compiler stfu
|
||||||
TornadoStakingRewards newStaking = TornadoStakingRewards(deployedStakingContractAddress);
|
bytes memory bempty;
|
||||||
|
|
||||||
|
// And create a new staking contract proxy
|
||||||
|
TornadoStakingRewards newStaking = TornadoStakingRewards(
|
||||||
|
address(new AdminUpgradeableProxy(deployedStakingContractAddress, governanceProxyAddress, bempty))
|
||||||
|
);
|
||||||
|
|
||||||
// Upgrade the registry proxy
|
// Upgrade the registry proxy
|
||||||
Proxy(registryProxyAddress).upgradeTo(deployedRelayerRegistryImplementationAddress);
|
Proxy(registryProxyAddress).upgradeTo(deployedRelayerRegistryImplementationAddress);
|
||||||
|
24
contracts/v4-patch/proxy/AdminUpgradeableProxy.sol
Normal file
24
contracts/v4-patch/proxy/AdminUpgradeableProxy.sol
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
pragma solidity ^0.6.12;
|
||||||
|
|
||||||
|
import "@openzeppelin/contracts/proxy/TransparentUpgradeableProxy.sol";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @dev TransparentUpgradeableProxy where admin is allowed to call implementation methods.
|
||||||
|
*/
|
||||||
|
contract AdminUpgradeableProxy is TransparentUpgradeableProxy {
|
||||||
|
/**
|
||||||
|
* @dev Initializes an upgradeable proxy backed by the implementation at `_logic`.
|
||||||
|
*/
|
||||||
|
constructor(
|
||||||
|
address _logic,
|
||||||
|
address _admin,
|
||||||
|
bytes memory _data
|
||||||
|
) public payable TransparentUpgradeableProxy(_logic, _admin, _data) {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @dev Override to allow admin access the fallback function.
|
||||||
|
*/
|
||||||
|
function _beforeFallback() internal override {}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user