UUPSUpgradeableMock.sol 757 B

123456789101112131415161718192021
  1. // SPDX-License-Identifier: MIT
  2. pragma solidity ^0.8.0;
  3. import "../CountersImpl.sol";
  4. import "../../proxy/utils/UUPSUpgradeable.sol";
  5. contract UUPSUpgradeableMock is CountersImpl, UUPSUpgradeable {
  6. // Not having any checks in this function is dangerous! Do not do this outside tests!
  7. function _authorizeUpgrade(address) internal override {}
  8. }
  9. contract UUPSUpgradeableUnsafeMock is UUPSUpgradeableMock {
  10. function upgradeTo(address newImplementation) external override {
  11. ERC1967Upgrade._upgradeToAndCall(newImplementation, bytes(""), false);
  12. }
  13. function upgradeToAndCall(address newImplementation, bytes memory data) external payable override {
  14. ERC1967Upgrade._upgradeToAndCall(newImplementation, data, false);
  15. }
  16. }