MCPcopy Index your code
hub / github.com/Ethnical/Swek3

github.com/Ethnical/Swek3 @0.0.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.0.1 ↗ · + Follow
3,881 symbols 12,597 edges 244 files 1,476 documented · 38%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Swek the EVM Security Toolbox.

Swek is a Security toolbox focused on EVM written in Rust.

Most of the features are designed to help auditors to get faster in the daily works.

Feel free to contact me to add some features or found any bugs.

If you are intersted in Rust, MeV, Solidity Sec join us here => https://discord.gg/uxqbK7wS

ezgif-4-a87ec11928


Convert Solidity to Interface

Convert Solidity file into an interface using the convert2interface (download the right version of the Solc then compile and extract the interface).

image

Just need to use the --path parameter.


Mempool Watcher

A small Mempool Watcher written in Rust.

  • Need to add lots of features to filter every txs.
  • Next step add a features to simulates txs.

image

Contract-info.

Get informations using AST of the contract. /!\ This doesn't compile the contract /!\ To have a quick overview of the (functions, modifiers, visibility, library etc...) you can use -m for modifiers and -v for the visibility.

Usage : image

Centralisation Risk

  • The -c set to yes will return some crisk ready to share in markdown (need to pass the modifier). image

Usage : swek --path /Users/ethnical/Sec/Rust/oz_implementations/contracts/OffShore.sol -m onlyOwner -c yes


Implemented Features

  • Visibility Checker : Display all functions in red who has _ but not internal visibility.

Upcoming Features.

Contracts Features:

  • [ ] Analyze directly in (etherscan, snowtrace, moonscan, etc).
  • [ ] Add the view pure etc in modifiers.
  • [ ] Add a params for remapping like --remaps @openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/
  • [ ] Display all the contracts names inside the folder.
  • [ ] Display all the externals calls.

Others features:

  • [ ] private key to address.
  • [ ] Converter Wei Gas.
  • [ ] ByteCode ASM deploy.
  • [ ] Get interface from non compile contract
  • [ ] Check the dif between OZ implentation and the implentation inside the sol file.
  • [ ] Reorganise inside a file the interface and the contract to have them in correct order.

TODO

  • [ ] Reuse the Solang lib directly to get the notice through comments.

Extension points exported contracts — how you extend this code

AbiType (Interface)
A trait for types that can be represented in the ethereum ABI. [6 implementers]
ethers-rs/ethers-core/src/abi/mod.rs
JsonRpcClient (Interface)
Trait which must be implemented by data transports to be used with the Ethereum JSON-RPC provider. [7 implementers]
ethers-rs/ethers-providers/src/lib.rs
ArtifactOutput (Interface)
Handler invoked with the output of `solc` Implementers of this trait are expected to take care of [`crate::Contract`] t [5 …
ethers-rs/ethers-solc/src/artifact_output/mod.rs
GasOracle (Interface)
(no doc) [10 implementers]
ethers-rs/ethers-middleware/src/gas_oracle/mod.rs
Signer (Interface)
(no doc) [4 implementers]
ethers-rs/ethers-signers/src/lib.rs
ParseInner (Interface)
Trait that abstracts functionality for inner data that can be parsed and wrapped with a specific `Span`. [2 implementers]
ethers-rs/ethers-contract/ethers-contract-derive/src/spanned.rs
Tokenizable (Interface)
Simplified output type for single value. [14 implementers]
ethers-rs/ethers-core/src/abi/tokens.rs
FromErr (Interface)
(no doc) [9 implementers]
ethers-rs/ethers-providers/src/lib.rs

Core symbols most depended-on inside this repo

unwrap
called by 1207
ethers-rs/ethers-providers/src/call_raw.rs
unwrap
called by 657
ethers-rs/ethers-solc/src/artifacts/contract.rs
map
called by 456
ethers-rs/ethers-providers/src/call_raw.rs
clone
called by 436
ethers-rs/ethers-contract/src/call.rs
join
called by 247
ethers-rs/ethers-solc/src/artifact_output/mod.rs
push
called by 130
ethers-rs/ethers-providers/src/transports/mock.rs
push
called by 91
ethers-rs/ethers-contract/ethers-contract-abigen/src/multi.rs
compile
called by 88
ethers-rs/ethers-solc/src/lib.rs

Shape

Method 2,173
Function 1,059
Class 461
Enum 149
Interface 39

Languages

Rust100%

Modules by API surface

ethers-rs/ethers-core/src/types/i256.rs148 symbols
ethers-rs/ethers-solc/src/artifacts/mod.rs139 symbols
ethers-rs/ethers-providers/src/provider.rs125 symbols
ethers-rs/ethers-solc/src/artifact_output/mod.rs81 symbols
ethers-rs/ethers-providers/src/lib.rs76 symbols
ethers-rs/ethers-solc/src/lib.rs66 symbols
ethers-rs/ethers-solc/src/config.rs62 symbols
ethers-rs/ethers-solc/src/project_util/mod.rs61 symbols
ethers-rs/ethers-core/src/types/filter.rs61 symbols
ethers-rs/ethers-contract/src/multicall/multicall_contract.rs61 symbols
ethers-rs/ethers-solc/src/compile/mod.rs59 symbols
ethers-rs/ethers-core/src/abi/human_readable/lexer.rs58 symbols

For agents

$ claude mcp add Swek3 \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact