Skip to content

Commit

Permalink
feat: add _postCheck internal function
Browse files Browse the repository at this point in the history
  • Loading branch information
TuDo1403 committed Dec 14, 2023
1 parent ed44275 commit b82b320
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 78 deletions.
5 changes: 4 additions & 1 deletion script/extensions/ScriptExtended.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ abstract contract ScriptExtended is Script, StdAssertions, IScriptExtended {
console.log("> ", StdStyle.blue(fnName), "...");
_;
}

modifier onlyOn(TNetwork networkType) {
require(network() == networkType, string.concat("ScriptExtended: Only allowed on ", CONFIG.getAlias(networkType)));
_;
Expand All @@ -33,10 +33,13 @@ abstract contract ScriptExtended is Script, StdAssertions, IScriptExtended {

function _configByteCode() internal virtual returns (bytes memory);

function _postCheck() internal virtual { }

function run(bytes calldata callData, string calldata command) public virtual {
CONFIG.resolveCommand(command);
(bool success, bytes memory data) = address(this).delegatecall(callData);
success.handleRevert(msg.sig, data);
_postCheck();
}

function network() public view virtual returns (TNetwork) {
Expand Down
2 changes: 1 addition & 1 deletion src/WNT.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity ^0.8.17;

import { ERC20 } from "../lib/openzeppelin-contracts/contracts/token/ERC20/ERC20.sol";
import { IWNT } from "./interfaces/IWNT.sol";
import { LibNativeTransfer } from "./libraries/LibNativeTransfer.sol";
import { LibNativeTransfer } from "contract-libs/transfers/LibNativeTransfer.sol";

/// @notice Minimalist and modern Wrapped Ether implementation.
/// @author Solmate
Expand Down
40 changes: 0 additions & 40 deletions src/libraries/LibErrorHandler.sol

This file was deleted.

36 changes: 0 additions & 36 deletions src/libraries/LibNativeTransfer.sol

This file was deleted.

0 comments on commit b82b320

Please sign in to comment.