Merge branch 'master' into next-v5.0
This commit is contained in:
@ -3,13 +3,14 @@
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
/**
|
||||
* @dev Implementation contract with an admin() function made to clash with
|
||||
* @dev TransparentUpgradeableProxy's to test correct functioning of the
|
||||
* @dev Transparent Proxy feature.
|
||||
* @dev Implementation contract with a payable changeAdmin(address) function made to clash with
|
||||
* TransparentUpgradeableProxy's to test correct functioning of the Transparent Proxy feature.
|
||||
*/
|
||||
contract ClashingImplementation {
|
||||
function admin() external pure returns (address) {
|
||||
return 0x0000000000000000000000000000000011111142;
|
||||
event ClashingImplementationCall();
|
||||
|
||||
function changeAdmin(address) external payable {
|
||||
emit ClashingImplementationCall();
|
||||
}
|
||||
|
||||
function delegatedFunction() external pure returns (bool) {
|
||||
|
||||
@ -44,11 +44,11 @@ contract UUPSUpgradeableLegacyMock is UUPSUpgradeableMock {
|
||||
}
|
||||
|
||||
// hooking into the old mechanism
|
||||
function upgradeTo(address newImplementation) external override {
|
||||
function upgradeTo(address newImplementation) public override {
|
||||
_upgradeToAndCallSecureLegacyV1(newImplementation, bytes(""), false);
|
||||
}
|
||||
|
||||
function upgradeToAndCall(address newImplementation, bytes memory data) external payable override {
|
||||
function upgradeToAndCall(address newImplementation, bytes memory data) public payable override {
|
||||
_upgradeToAndCallSecureLegacyV1(newImplementation, data, false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -23,11 +23,11 @@ contract UUPSUpgradeableMock is NonUpgradeableMock, UUPSUpgradeable {
|
||||
}
|
||||
|
||||
contract UUPSUpgradeableUnsafeMock is UUPSUpgradeableMock {
|
||||
function upgradeTo(address newImplementation) external override {
|
||||
function upgradeTo(address newImplementation) public override {
|
||||
ERC1967Upgrade._upgradeToAndCall(newImplementation, bytes(""), false);
|
||||
}
|
||||
|
||||
function upgradeToAndCall(address newImplementation, bytes memory data) external payable override {
|
||||
function upgradeToAndCall(address newImplementation, bytes memory data) public payable override {
|
||||
ERC1967Upgrade._upgradeToAndCall(newImplementation, data, false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user