Skip to content

Commit

Permalink
Merge pull request #8 from rhinestonewtf/feat/update-forge
Browse files Browse the repository at this point in the history
feat: update deprecated cheatcodes
  • Loading branch information
kopy-kat authored Oct 19, 2024
2 parents bc12896 + 4fd2eeb commit e8f2fa5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# ERC4337 Validation

**A library to validate the [ERC-4337 rules](https://github.com/eth-infinitism/account-abstraction/blob/develop/erc/ERCS/erc-7562.md) within Foundry**
**A library to validate the [ERC-4337 rules](https://eips.ethereum.org/EIPS/eip-7562) within Foundry**

This library allows you to validate:

- [ ] Banned opcodes
- [x] Banned opcodes
- [x] Banned storage locations
- [x] Disallowed `*CALLs`
- [x] Disallowed use of `EXT*` opcodes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rhinestone/erc4337-validation",
"version": "0.0.1-alpha.5",
"version": "0.0.2",
"description": "A library to validate the ERC-4337 rules within Foundry",
"license": "MIT",
"author": {
Expand Down
8 changes: 4 additions & 4 deletions src/Simulator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ import {
} from "./lib/ERC4337.sol";
import { VmSafe } from "forge-std/Vm.sol";
import {
snapshot,
snapshotState,
startMappingRecording,
startDebugTraceRecording,
startStateDiffRecording,
stopAndReturnStateDiff,
stopMappingRecording,
stopAndReturnDebugTraceRecording,
revertTo,
revertToState,
expectRevert

Check warning on line 22 in src/Simulator.sol

View workflow job for this annotation

GitHub Actions / lint / forge-lint

imported name expectRevert is not used
} from "./lib/Vm.sol";
import { ERC4337SpecsParser } from "./SpecsParser.sol";
Expand Down Expand Up @@ -144,7 +144,7 @@ library Simulator {
*/
function _preSimulation() internal {
// Create snapshot to revert to after simulation
uint256 snapShotId = snapshot();
uint256 snapShotId = snapshotState();

// Store the snapshot id so that it can be reverted to after simulation
bytes32 snapShotSlot = keccak256(abi.encodePacked("Simulator.SnapshotId"));
Expand Down Expand Up @@ -183,6 +183,6 @@ library Simulator {
}

// Revert to snapshot
revertTo(snapShotId);
revertToState(snapShotId);
}
}
8 changes: 4 additions & 4 deletions src/lib/Vm.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ function getLabel(address addr) view returns (string memory) {
return Vm(VM_ADDR).getLabel(addr);
}

function snapshot() returns (uint256) {
return Vm(VM_ADDR).snapshot();
function snapshotState() returns (uint256) {
return Vm(VM_ADDR).snapshotState();
}

function revertTo(uint256 id) returns (bool) {
return Vm(VM_ADDR).revertTo(id);
function revertToState(uint256 id) returns (bool) {
return Vm(VM_ADDR).revertToState(id);
}

function startStateDiffRecording() {
Expand Down

0 comments on commit e8f2fa5

Please sign in to comment.