An open API service indexing awesome lists of open source software.

https://github.com/carlosalegreur/inputcontrol-smartcontract-testing

In this repo you will find the tests and a simple implementation of my other repo => InputControl-SmartContract-DesignPattern
https://github.com/carlosalegreur/inputcontrol-smartcontract-testing

Last synced: 4 months ago
JSON representation

In this repo you will find the tests and a simple implementation of my other repo => InputControl-SmartContract-DesignPattern

Awesome Lists containing this project

README

        

# [**Input Control Contract**](https://github.com/CarlosAlegreUr/InputControl-SmartContract-DesignPattern)

---

## Tests for the **different InputControl implementations**.

- πŸ“ Check the contracts' code [here](https://github.com/CarlosAlegreUr/InputControl-SmartContract-DesignPattern)
- πŸ“¦ Check the npm repo [here](https://www.npmjs.com/package/input-control-contract)

> πŸ“˜ **Note**: If you further elaborate, develop, or test, kindly consider [mentioning me](https://github.com/CarlosAlegreUr) in your work or opening PRs to this repo.

## Types of **InputControls implementations** πŸ‘ͺ

Types Legend ℹ️

### Input Control (IC)

#### Owned:

- Inheritance (ICI)
- Composite (ICC)

#### Public:

- Public (ICP)

---

## **Input Control Current Tests' State** πŸ“‘

> **`Legend`**:
>
> 🟒 => High coverage, but there's always room for improvement!
>
> πŸ”΅ => Needs revision, but has high or near high coverage.
>
> 🟑 => Currently being updated.
>
> πŸ”΄ => Yet to be started.

---

| InputControl Implementation | Unit Testing | Fuzz Testing | Invariant Testing | Testnet testing | Audited |
| :-------------------------: | :----------: | :----------: | :---------------: | :-------------: | :-----: |
| ICI | πŸ”΅ | πŸ”΄ | πŸ”΄ | πŸ”΄ | πŸ”΄ |
| ICC | πŸ”΅ | πŸ”΅ | πŸ”΄ | πŸ”΄ | πŸ”΄ |
| ICP | 🟒 | 🟒 | 🟑 | πŸ”΄ | πŸ”΄ |

---

## Last Changes πŸ“°

- πŸ”„ All code has been **refactored**: Admin based (centralized) or non-admin based (decentralized public infrastructure) versions.
- βœ… New updated **foundry tests** created.

---

## **FUTURE IMPROVEMENTS** πŸŽ‰

- Write tests for hash with `bytes32(0)` value. Whether for inputs or permission ids.
- **Test in testnet**.
- Protect against **DoS attacks** by abusing the contract's storage in the public version.
- **Self-audit** with automated tools.
- **Third-party Audit/s**.
- Old hardhat tests might be updated to the refactored code.
- Add new **feature**. Now, if granted new input permissions, old ones get overwritten. Design it so users can modify existing ones without overwriting.

---

## Contact πŸ“¨

Carlos Alegre UrquizΓΊ - [[email protected]](mailto:[email protected])

---

## **Buy me a CryptoCoffee** β˜•

Buy me a crypto coffee in ETH, MATIC, or BNB β˜•πŸ§β˜• (or any token if you fancy)
`0x2365bf29236757bcfD141Fdb5C9318183716d866`

---

## **License** πŸ“œ

Distributed under the MIT License. See [LICENSE](https://github.com/CarlosAlegreUr/InputControl-SmartContract-DesignPattern/blob/main/LICENSE) in the repository for more details.