Skip to content

Commit 86129a2

Browse files
committed
Update StateFuzzingTest
1 parent db72f78 commit 86129a2

File tree

4 files changed

+6
-15
lines changed

4 files changed

+6
-15
lines changed

devkit/MCTest.sol

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
// SPDX-License-Identifier: MIT
22
pragma solidity ^0.8.24;
33

4+
import {Proxy as OZProxy} from "@oz.ucs/proxy/Proxy.sol";
5+
46
import {System} from "devkit/system/System.sol";
5-
import {DecodeErrorString} from "devkit/system/message/DecodeErrorString.sol";
67
import {Receive} from "mc-std/functions/Receive.sol";
78
import {Formatter} from "devkit/types/Formatter.sol";
89
import {ProxyUtils} from "@ucs.mc/proxy/ProxyUtils.sol";
@@ -23,7 +24,7 @@ abstract contract MCTest is MCTestBase {
2324
}
2425

2526
// 🌟 MC State Fuzzing Test
26-
abstract contract MCStateFuzzingTest is MCTestBase { // solhint-disable-line payable-fallback
27+
abstract contract MCStateFuzzingTest is MCTestBase, OZProxy { // solhint-disable-line payable-fallback
2728
struct Function {
2829
bytes4 selector;
2930
address implementation;
@@ -49,17 +50,10 @@ abstract contract MCStateFuzzingTest is MCTestBase { // solhint-disable-line pay
4950
vm.store(address(this), ProxyUtils.DICTIONARY_SLOT, Formatter.toBytes32(dictionary_));
5051
}
5152

52-
fallback(bytes calldata) external payable returns(bytes memory) {
53-
address funcImpl = implementations[msg.sig];
54-
require(funcImpl != address(0), "Called implementation is not registered.");
55-
(bool success, bytes memory data) = funcImpl.delegatecall(msg.data);
56-
if (success) {
57-
return data;
58-
} else {
59-
// vm.expectRevert needs this.
60-
revert(DecodeErrorString.decodeRevertReasonAndPanicCode(data));
61-
}
53+
function _implementation() internal view override returns (address) {
54+
return implementations[msg.sig];
6255
}
56+
6357
}
6458

6559
// 🌟 MC TEST for DevKit

test/std/functions/Clone.t.sol

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {Clone} from "mc-std/functions/Clone.sol";
99
import {ProxyCreator} from "mc-std/functions/internal/ProxyCreator.sol";
1010
import {ForgeHelper} from "devkit/utils/ForgeHelper.sol";
1111
import {Dummy} from "test/utils/Dummy.sol";
12-
import {StateFuzzing} from "devkit/utils/test/StateFuzzing.sol";
1312

1413
contract CloneTest is MCStateFuzzingTest {
1514
function setUp() public {

test/std/functions/Create.t.sol

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {Create} from "mc-std/functions/Create.sol";
99
import {ProxyCreator} from "mc-std/functions/internal/ProxyCreator.sol";
1010
import {ForgeHelper} from "devkit/utils/ForgeHelper.sol";
1111
import {Dummy} from "test/utils/Dummy.sol";
12-
import {StateFuzzing} from "devkit/utils/test/StateFuzzing.sol";
1312

1413
contract CreateTest is MCStateFuzzingTest {
1514
function setUp() public {

test/std/functions/GetFunctions.t.sol

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import {ForgeHelper} from "devkit/utils/ForgeHelper.sol";
1212
import {Dummy} from "test/utils/Dummy.sol";
1313
import {DummyFunction} from "test/utils/DummyFunction.sol";
1414
import {DummyFacade} from "test/utils/DummyFacade.sol";
15-
import {StateFuzzing} from "devkit/utils/test/StateFuzzing.sol";
1615

1716
contract GetFunctionsTest is MCStateFuzzingTest {
1817
function setUp() public {

0 commit comments

Comments
 (0)