Files
openzeppelin-contracts/contracts/mocks/UUPS/UUPSUpgradeableMock.sol
Hadrien Croubois e192fac276 Simplify UUPSUpgradeable along the lines of ERC1822 (#3021)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2022-01-13 15:46:55 -03:00

22 lines
781 B
Solidity

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../CountersImpl.sol";
import "../../proxy/utils/UUPSUpgradeable.sol";
contract UUPSUpgradeableMock is CountersImpl, UUPSUpgradeable {
// Not having any checks in this function is dangerous! Do not do this outside tests!
function _authorizeUpgrade(address) internal virtual override {}
}
contract UUPSUpgradeableUnsafeMock is UUPSUpgradeableMock {
function upgradeTo(address newImplementation) external virtual override {
ERC1967Upgrade._upgradeToAndCall(newImplementation, bytes(""), false);
}
function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual override {
ERC1967Upgrade._upgradeToAndCall(newImplementation, data, false);
}
}