Skip to content

Commit

Permalink
re-generate files
Browse files Browse the repository at this point in the history
  • Loading branch information
LEV Bot committed Sep 1, 2023
1 parent 3c290a0 commit fc046e9
Show file tree
Hide file tree
Showing 110 changed files with 65 additions and 18,231 deletions.
18 changes: 4 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
1. bind-attack
2. cargo test -p attack -- --nocapture
3. deploy-levels (перед этим анвил остановить, который крутит блокчейн) //нужно, если set up изменена
ps axu | grep anvil
anvil --steps-tracing --state state.json

4. cargo build (если удалить папку target) //не трогать

cast disassemble /ввести байткод/

# DEX OFFENDER

A compilation of smart contract wargames (currently only Ethernaut and DamnVulnerableDeFi). You can find the levels in `./contracts/$GAME_NAME` and add your solution to `./attack/src/$GAME_NAME/hack*.rs`.
Expand Down Expand Up @@ -108,7 +98,7 @@ impl ctf::Exploit for Exploit {
// This is how you "connect" to a deployed contract. You can see how it was deployed
// in ./ctf/src/ethernaut/lvl01_fallback.rs
let contract =
Fallback::new(target.address, offender.clone());
Fallback::new(target.contract_address, offender.clone());

// This is how you call a contract function with no arguments:
contract.contribute().value(1).send().await?.await?;
Expand All @@ -132,7 +122,7 @@ impl ctf::Exploit for Exploit {

If you then run `cargo test -p attack -- --nocapture` you should see something like this

```text
``` text
$ cargo test -p attack -- --nocapture
Compiling attack v0.1.0 (/home/gleb/code/0xgleb/data-cartel/dex-offender/attack)
Finished test [unoptimized + debuginfo] target(s) in 6.83s
Expand Down Expand Up @@ -171,7 +161,7 @@ test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; fini

If you're using the dev container then you already have a local blockchain running in one of the VS code terminals. If not, you can start it by running `anvil`. I would recommend turning on tracing to make debugging easier.

```sh
``` sh
anvil --steps-tracing --load-state state.json
```

Expand Down Expand Up @@ -320,7 +310,7 @@ $ cast rpc trace_transaction 0x6d2ec4f84ff1308695afd6a0ef130af5bde3f26eefc112b22

This is hard to read. Let's pipe it thorugh `jq`.

```sh
``` sh
$ cast rpc trace_transaction 0x6d2ec4f84ff1308695afd6a0ef130af5bde3f26eefc112b22d39840502528635 | jq .
[
{
Expand Down
48 changes: 0 additions & 48 deletions attack/contracts/ethernaut/AlienCodexExploit.sol

This file was deleted.

60 changes: 0 additions & 60 deletions attack/contracts/ethernaut/CoinFlipExploit.sol

This file was deleted.

65 changes: 0 additions & 65 deletions attack/contracts/ethernaut/DenialExploit.sol

This file was deleted.

44 changes: 0 additions & 44 deletions attack/contracts/ethernaut/ElevatorExploit.sol

This file was deleted.

40 changes: 0 additions & 40 deletions attack/contracts/ethernaut/ForceExploit.sol

This file was deleted.

62 changes: 0 additions & 62 deletions attack/contracts/ethernaut/GatekeeperOneExploit.sol

This file was deleted.

Loading

0 comments on commit fc046e9

Please sign in to comment.