Skip to content

Commit

Permalink
rename to selective pausable
Browse files Browse the repository at this point in the history
  • Loading branch information
uintgroup committed Aug 10, 2023
1 parent 394e7fc commit bc5ba89
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 68 deletions.
68 changes: 4 additions & 64 deletions README.md
Original file line number Diff line number Diff line change
@@ -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 <your_rpc_url> --private-key <your_private_key>
```

### Cast

```shell
$ cast <subcommand>
```

### Help

```shell
$ forge --help
$ anvil --help
$ cast --help
```
This contract is in development and should only be used after performing independent testing.
4 changes: 2 additions & 2 deletions src/Counter.sol
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions src/SelectivePause.sol → src/SelectivePausable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit bc5ba89

Please sign in to comment.