diff --git a/README.md b/README.md index 9265b45..19c21a0 100644 --- a/README.md +++ b/README.md @@ -1,66 +1,6 @@ -## Foundry +# Selective Pausable -**Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.** +A replacement for OpenZeppelin's Pausable.sol contract, which adds the ability to pause/unpause a function +by its selector. -Foundry consists of: - -- **Forge**: Ethereum testing framework (like Truffle, Hardhat and DappTools). -- **Cast**: Swiss army knife for interacting with EVM smart contracts, sending transactions and getting chain data. -- **Anvil**: Local Ethereum node, akin to Ganache, Hardhat Network. -- **Chisel**: Fast, utilitarian, and verbose solidity REPL. - -## Documentation - -https://book.getfoundry.sh/ - -## Usage - -### Build - -```shell -$ forge build -``` - -### Test - -```shell -$ forge test -``` - -### Format - -```shell -$ forge fmt -``` - -### Gas Snapshots - -```shell -$ forge snapshot -``` - -### Anvil - -```shell -$ anvil -``` - -### Deploy - -```shell -$ forge script script/Counter.s.sol:CounterScript --rpc-url --private-key -``` - -### Cast - -```shell -$ cast -``` - -### Help - -```shell -$ forge --help -$ anvil --help -$ cast --help -``` +This contract is in development and should only be used after performing independent testing. diff --git a/src/Counter.sol b/src/Counter.sol index 4e1953f..d32044a 100644 --- a/src/Counter.sol +++ b/src/Counter.sol @@ -1,9 +1,9 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.13; -import {SelectivePause} from "./SelectivePause.sol"; +import {SelectivePausable} from "./SelectivePausable.sol"; -contract Counter { +contract Counter is SelectivePausable { uint256 public number; function setNumber(uint256 newNumber) public whenNotPaused(false) { diff --git a/src/SelectivePause.sol b/src/SelectivePausable.sol similarity index 96% rename from src/SelectivePause.sol rename to src/SelectivePausable.sol index 6f9ebfd..57b0000 100644 --- a/src/SelectivePause.sol +++ b/src/SelectivePausable.sol @@ -2,13 +2,13 @@ pragma solidity ^0.8.21; /** - * @title SelectivePause + * @title SelectivePausable * @author @uintgroup @curi0n-s * @notice pauses contract functions using each function's selector * @dev replaces OpenZeppelin's Pausable.sol (whenNotPaused would conflict) */ -abstract contract SelectivePause { +abstract contract SelectivePausable { // @notice revert with this custom error when array lengths do not match error ArrayLengthMismatch();