Coder Social home page Coder Social logo

lipuu / security-toolkit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from emilianobonassi/security-toolkit

0.0 0.0 0.0 37 KB

A collection of smart contracts for implementing security controls and guardrails. Useful for OpSec and educational purposes.

License: MIT License

Shell 0.34% Python 34.24% Solidity 65.43%

security-toolkit's Introduction

Security Toolkit

A collection of smart contracts for implementing security controls and guardrails. Useful for OpSec and educational purposes.

NB: It IS NOT AUDITED/REVIEWED. Do Your Own Research and Use At Your Own Risk

Levels

Security 1

Simple two role model, operator and governance. Operator can be updated by governance. Governance can be updated by itself but requires acceptance from the new one.

Operator can pause all the smart contract operation via SCRAM(). Only governance can unpause.

When paused, governance can withdraw any asset via the respective methods: emergencyWithdrawERC20ETH, emergencyWithdrawERC721, emergencyBatchWithdrawERC721, emergencyWithdrawERC1155, emergencyBatchWithdrawERC1155.

You can annotate methods via these modifiers:

  • whenPaused and whenNotPaused
  • onlyGovernance
  • onlyOperatorOrGovernance

Security 2

Extends Security 1 model.

Adds possibility for governance to execute any tx on behalf of the contract via emergencyExecute when paused.

Security 3

Extends Security 2 model.

When paused, all the methods annotated with whenPausedthenProxy fallback to an external emergencyImplementation. Useful to override specific methods with an upgradable failsafe contract.

Security 4

Extends Scurity 3 model.

Add an allowlist, any method annotated with onlyAllowlisted can be execute only by allowed users when allowlisting is in place.

Only governance can enable/disable the feature.

Operators or governance can enable a user with allow, only governance can disable via disallow.

Contribute

Feel free to open issues, fork and share your practices!

security-toolkit's People

Contributors

emilianobonassi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.