New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

interaction-control-contract

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

interaction-control-contract

InteractionControl combines different smart contracts to grant total control of your functions if desired. From who calls them to in which order and even with which inputs' values.

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

InteractionControl Contract

Combines different smart contracts to grant total control of your functions if desired. From who calls them to in which order and even with which inputs' values.

💽Testing and implementation example repo => (click) 💽

💽NPM repo => (click) 💽

If further elaboration or development please mention me in your work.

😉 https://github.com/CarlosAlegreUr 😉

🤖 General usecase explanation 🤖

InteractionControl can be used to have total control of your functions if desired.

From who calls them to in which order and even with which inputs' values.

✨ How to use ✨

  • Make your contract inherit InteractionControl and add the isAllowedInteraction() modifier in the functions you desire to fully control.

    The isAllowedInteraction() has 3 parameters:

    1.1 => function selector of the function where it's being applied: bytes4(keccak256(bytes("funcSignatureAsString")))

    1.2 => msg.sender => to know who is calling.

    1.3 => a unique identifier of the inputs and it's values: keccak256(abi.encode(_newNumber))

    Btw it's essential you use abi.enconde() and not abi.encodePakced() because abi.encodePakced() can give the same output to different inputs.

  • Additionally you can override callAllowInputsFor() or and callAllowFuncCallsFor() if you please mixing this InteractionControl with, for example, other useful ones like Ownable or AccessControl contracts from OpenZeppelin.

As InteractionControl inherits from CallOrderControl.sol and InputControl.sol you can use just their modifier directly in a function if pleased.

Check a simple implemented example at UseCaseContract.sol.

⚙️ DEPENDENCIES ⚙️

npm packages

  • InputControl

  • CallOrderControl

🎉 FUTURE IMPROVEMENTS 🎉

  • Improve and review (static analysis, audit...) code's tests.
  • Test in testnet.

📨 Contact 📨

Carlos Alegre Urquizú - calegreu@gmail.com

☕ Buy me a CryptoCoffee ☕

Buy me a crypto coffe in ETH, MATIC or BNB ☕🧐☕ (or tokens if you please :p )

0x2365bf29236757bcfD141Fdb5C9318183716d866

📜 License 📜

Distributed under the MIT License. See LICENSE in the repository for more information.

Keywords

solidity

FAQs

Package last updated on 04 Jun 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts