dexorder
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
pragma solidity ^0.8.20;
|
||||
|
||||
contract BadBeaconNoImpl {}
|
||||
|
||||
contract BadBeaconNotContract {
|
||||
function implementation() external pure returns (address) {
|
||||
return address(0x1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
pragma solidity ^0.8.20;
|
||||
|
||||
/**
|
||||
* @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 {
|
||||
event ClashingImplementationCall();
|
||||
|
||||
function upgradeToAndCall(address, bytes calldata) external payable {
|
||||
emit ClashingImplementationCall();
|
||||
}
|
||||
|
||||
function delegatedFunction() external pure returns (bool) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
pragma solidity ^0.8.20;
|
||||
|
||||
import {UUPSUpgradeable} from "../../proxy/utils/UUPSUpgradeable.sol";
|
||||
import {ERC1967Utils} from "../../proxy/ERC1967/ERC1967Utils.sol";
|
||||
|
||||
contract NonUpgradeableMock {
|
||||
uint256 internal _counter;
|
||||
|
||||
function current() external view returns (uint256) {
|
||||
return _counter;
|
||||
}
|
||||
|
||||
function increment() external {
|
||||
++_counter;
|
||||
}
|
||||
}
|
||||
|
||||
contract UUPSUpgradeableMock is NonUpgradeableMock, UUPSUpgradeable {
|
||||
// Not having any checks in this function is dangerous! Do not do this outside tests!
|
||||
function _authorizeUpgrade(address) internal override {}
|
||||
}
|
||||
|
||||
contract UUPSUpgradeableUnsafeMock is UUPSUpgradeableMock {
|
||||
function upgradeToAndCall(address newImplementation, bytes memory data) public payable override {
|
||||
ERC1967Utils.upgradeToAndCall(newImplementation, data);
|
||||
}
|
||||
}
|
||||
|
||||
contract UUPSUnsupportedProxiableUUID is UUPSUpgradeableMock {
|
||||
function proxiableUUID() external pure override returns (bytes32) {
|
||||
return keccak256("invalid UUID");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user