A drop-in replacement for `dapp` and `seth` in Rust

Overview

dapptools.rs

Rust port of DappTools

Github Actions

dapp example Usage

Run Solidity tests

Any contract that contains a function starting with test is being tested. The glob passed to --contracts must be wrapped with quotes so that it gets passed to the internal command without being expanded by your shell.

$ cargo r --bin dapp test --contracts './**/*.sol'
    Finished dev [unoptimized + debuginfo] target(s) in 0.21s
     Running `target/debug/dapp test --contracts './**/*.sol'`
Running 1 tests for Foo
[PASS] testX (gas: 267)

Running 1 tests for GmTest
[PASS] testGm (gas: 25786)

Running 1 tests for FooBar
[PASS] testX (gas: 267)

Running 3 tests for GreeterTest
[PASS] testIsolation (gas: 3702)
[PASS] testFailGreeting (gas: 26299)
[PASS] testGreeting (gas: 26223)

You can optionally specify a regular expresion, to only run matching functions:

$ cargo r --bin dapp test --contracts './**/*.sol' -m testG
    Finished dev [unoptimized + debuginfo] target(s) in 0.26s
     Running `target/debug/dapp test --contracts './**/*.sol' -m testG`
Running 1 tests for GreeterTest
[PASS] testGreeting (gas: 26223)

Running 1 tests for GmTest
[PASS] testGm (gas: 25786)

Test output as JSON

In order to compose with other commands, you may print the results as JSON via the --json flag

$ ./target/release/dapp test -c "./**/*.sol" --json
{"GreeterTest":{"testIsolation":{"success":true,"gas_used":3702},"testFailGreeting":{"success":true,"gas_used":26299},"testGreeting":{"success":true,"gas_used":26223}},"FooBar":{"testX":{"success":true,"gas_used":267}},"Foo":{"testX":{"success":true,"gas_used":267}},"GmTest":{"testGm":{"success":true,"gas_used":25786}}}

Build the contracts

You can build the contracts by running, which will by default output the compilation artifacts of all contracts under src/ at out/dapp.sol.json:

$ ./target/release/dapp build

You can specify an alternative path for your contracts and libraries with --remappings, --lib-path and --contracts. We default to importing libraries from ./lib, but you still need to manually set your remappings.

In the example below, we see that this also works for importing libraries from different paths (e.g. having a DappTools-style import under lib/ and an NPM-style import under node_modules)

Notably, we need 1 remapping and 1 lib path for each import. Given that this can be tedious, you can do set remappings via the env var DAPP_REMAPPINGS, by setting your remapping 1 in each line

$ dapp build --out out.json \
    --remappings ds-test/=lib/ds-test/src/ \
    --lib-paths ./lib/
    --remappings @openzeppelin/=node_modules/@openzeppelin/ \
    --lib-path ./node_modules/@openzeppelin
$ echo $DAPP_REMAPPINGS
@openzeppelin/=lib/openzeppelin-contracts/
ds-test/=lib/ds-test/src/
$ dapp build --out out.json \
    --lib-paths ./lib/ \
    --lib-paths ./node_modules/@openzeppelin

Development

Rust Toolchain

We use the stable Rust toolchain. Install by running: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Building & testing

cargo check
cargo test
cargo doc --open
cargo build [--release]

Tip: If you encounter the following error when building the project, please update your Rust toolchain with rustup update.

error[E0658]: use of unstable library feature 'map_into_keys_values'

CLI Help

The CLI options can be seen below. You can fully customize the initial blockchain context. As an example, if you pass the flag --block-number, then the EVM's NUMBER opcode will always return the supplied value. This can be useful for testing.

Build

$ cargo r --bin dapp build --help
   Compiling dapptools v0.1.0
    Finished dev [unoptimized + debuginfo] target(s) in 3.45s
     Running `target/debug/dapp build --help`
dapp-build 0.1.0
build your smart contracts

USAGE:
    dapp build [FLAGS] [OPTIONS] [--] [remappings-env]

FLAGS:
    -h, --help          Prints help information
    -n, --no-compile    skip re-compilation
    -V, --version       Prints version information

OPTIONS:
    -c, --contracts <contracts>         glob path to your smart contracts [default: ./src/**/*.sol]
        --evm-version <evm-version>     choose the evm version [default: berlin]
        --lib-path <lib-path>           the path where your libraries are installed
    -o, --out <out-path>                path to where the contract artifacts are stored [default: ./out/dapp.sol.json]
    -r, --remappings <remappings>...    the remappings

ARGS:
    <remappings-env>     [env: DAPP_REMAPPINGS=]

Test

$ cargo r --bin dapp test --help
    Finished dev [unoptimized + debuginfo] target(s) in 0.31s
     Running `target/debug/dapp test --help`
dapp-test 0.1.0
build your smart contracts

USAGE:
    dapp test [FLAGS] [OPTIONS] [--] [remappings-env]

FLAGS:
    -h, --help          Prints help information
    -j, --json          print the test results in json format
    -n, --no-compile    skip re-compilation
    -V, --version       Prints version information

OPTIONS:
        --block-coinbase <block-coinbase>
            the block.coinbase value during EVM execution [default: 0x0000000000000000000000000000000000000000]

        --block-difficulty <block-difficulty>    the block.difficulty value during EVM execution [default: 0]
        --block-gas-limit <block-gas-limit>      the block.gaslimit value during EVM execution
        --block-number <block-number>            the block.number value during EVM execution [default: 0]
        --block-timestamp <block-timestamp>      the block.timestamp value during EVM execution [default: 0]
        --chain-id <chain-id>                    the chainid opcode value [default: 1]
    -c, --contracts <contracts>                  glob path to your smart contracts [default: ./src/**/*.sol]
        --evm-version <evm-version>              choose the evm version [default: berlin]
        --gas-limit <gas-limit>                  the block gas limit [default: 25000000]
        --gas-price <gas-price>                  the tx.gasprice value during EVM execution [default: 0]
        --lib-path <lib-path>                    the path where your libraries are installed
    -o, --out <out-path>
            path to where the contract artifacts are stored [default: ./out/dapp.sol.json]

    -m, --match <pattern>                        only run test methods matching regex [default: .*]
    -r, --remappings <remappings>...             the remappings
        --tx-origin <tx-origin>
            the tx.origin value during EVM execution [default: 0x0000000000000000000000000000000000000000]


ARGS:
    <remappings-env>     [env: DAPP_REMAPPINGS=]

Features

  • seth
    • --from-ascii
    • --to-hex
    • --to-checksum-address
    • --to-bytes32
    • block
    • call (partial)
    • send (partial)
    • balance
    • ens
  • dapp
    • test
      • simple unit tests
        • Gas costs
        • DappTools style test output
        • JSON test output
        • matching on regex
        • DSTest-style assertions support
      • fuzzing
      • symbolic execution
      • coverage
      • HEVM-style Solidity cheatcodes
      • structured tracing with abi decoding
      • per-line gas profiling
      • forking mode
      • automatic solc selection
    • build
      • can read DappTools-style .sol.json artifacts
      • manual remappings
      • automatic remappings
      • multiple compiler versions
      • incremental compilation
      • can read Hardhat-style artifacts
      • can read Truffle-style artifacts
    • debug
    • CLI Tracing with RUST_LOG=dapp=trace

Tested Against

This repository has been tested against the following DappTools repos: *

Comments
  • forge fails with `GLIBC_2.33' not found (required by forge) in github action CI

    forge fails with `GLIBC_2.33' not found (required by forge) in github action CI

    Component

    Forge

    Have you ensured that all of these are up to date?

    • [X] Foundry
    • [ ] Foundryup

    What version of Foundry are you on?

    nightly-2e99f7fdaef6a7aaeb426b02ef87e052cc14f68b

    What command(s) is the bug in?

    No response

    Operating System

    Linux

    Describe the bug

    We use the foundry-toolchain github action in our CI and it started failing in the last few hours with failures like this:

    forge: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by forge)
    forge: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by forge)
    forge: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by forge)
    

    Is there a problem with the nightly release?

    I didn't include the proper forge --version string, because forge can't even run that in our CI. It started failing after the latest release:

    • latest release broken: https://github.com/foundry-rs/foundry/releases/tag/nightly-2e99f7fdaef6a7aaeb426b02ef87e052cc14f68b
    • previous one is fine: https://github.com/foundry-rs/foundry/tree/nightly-f6361e6ddb6af62bbf6e122d0d8b27d2f5f6b42d
    T-bug A-releases 
    opened by KholdStare 54
  • Lazily iterate over tests instead of collecting

    Lazily iterate over tests instead of collecting

    Instead of collecting here and here, it’d be nice if we could have an iterator which we can stream over

    That'd allow us to then iterate in parallel here for nicer UX & speed

    good first issue 
    opened by gakonst 39
  • feat(forge): Better deployment

    feat(forge): Better deployment

    Add the ability for forge to use a solidity file to create a contract on mainnet and arbitrary deploy scripts by adding a cheatcode. You could do something like:

    contract t {
        function deployMyContract() {
            uint256 input1 = dep.someFunc();
            vm.mainnetDeploy();
            MyContract t = new MyContract(input1);
        }
    }
    T-feature C-forge D-hard 
    opened by brockelmore 38
  • feat: support environment variables in `foundry.toml`

    feat: support environment variables in `foundry.toml`

    Component

    Forge

    Describe the feature you would like

    A common use case is configuring test params with environment variables, with the RPC URL used for forking tests being a popular example. Right now there is now way to specify in the config file to use a certain environment variable for fork URLs, and instead you'd have to pass this in to the test command, e.g. forge test --fork-url $MY_RPC_URL

    Additional context

    No response

    T-feature C-forge P-low 
    opened by mds1 32
  • feat: fmt config

    feat: fmt config

    Component

    Forge

    Describe the feature you would like

    The formatter uses a configuration with hardcoded values. The goal is to define the input format for the configuration (i.e. whether the configuration will be defined in a separate file like fmt.toml or it will become a part of foundry config) and, potentially, expand the options.

    Currently, the supported configuration values are:

    • line_length - maximum line length where formatter will try to wrap the line
    • tab_width - number of spaces per indentation level
    • bracket_spacing - print spaces between brackets

    Additional context

    No response

    T-feature C-forge Cmd-forge-fmt 
    opened by rkrasiuk 31
  • Foundry crashes with `arithmetic operation overflow`

    Foundry crashes with `arithmetic operation overflow`

    Component

    Forge

    Have you ensured that all of these are up to date?

    • [X] Foundry
    • [X] Foundryup

    What version of Foundry are you on?

    forge 0.2.0 (70f4fb5 2022-11-02T00:05:06.592613Z)

    What command(s) is the bug in?

    forge test

    Operating System

    Linux

    Describe the bug

    Hello, after updating forge-std dependency foundry started crashing with arithmetic operation overflow error. The issue is occuring locally on my M1 Macbook as well as in a linux docker container in CI. Here is the code and here is the log of a failing CI pipeline.

    Update

    The bug is not related to forge-std (the forge-std update simply made it occur more frequently). The bug is caused by overflow in smart contract execution.

    T-bug Cmd-forge-test C-forge 
    opened by benesjan 29
  • forge build fails with solc 0.6.12

    forge build fails with solc 0.6.12

    Component

    Forge

    Have you ensured that all of these are up to date?

    • [X] Foundry
    • [X] Foundryup

    What version of Foundry are you on?

    forge 0.2.0 (b951f65 2022-03-26T04:46:06.407207863+00:00)

    What command(s) is the bug in?

    forge build

    Operating System

    Linux

    Describe the bug

    When I open a new project but change the solidity version to 0.6.12 forge build fails:

    $ forge init forge-2
    Initializing $PATH/forge-2...
    Installing ds-test in "$PATH/forge-2/lib/ds-test", (url: https://github.com/dapphub/ds-test, tag: None)
        Installed ds-test
        Initialized forge project.
    $ cd forge-2
    $ forge build
    [⠊] Compiling...
    [⠢] Compiling 3 files with 0.8.10
    Compiler run successful
    $ sed -i 's/0.8.10/0.6.12/' src/Contract.sol 
    $ grep pragma src/Contract.sol
    pragma solidity 0.6.12;
    $ forge build
    [⠢] Compiling...
    Error: 
       0: Solc Error: 
    
    Location:
       cli/src/cmd/utils.rs:40
    
    Backtrace omitted.
    Run with RUST_BACKTRACE=1 environment variable to display it.
    Run with RUST_BACKTRACE=full to include source snippets.
    $ forge --version
    forge 0.2.0 (b951f65 2022-03-26T04:46:06.407207863+00:00)
    
    T-bug C-forge P-high Cmd-forge-build 
    opened by lithp 27
  • Anvil seems to hang/crash when submitting transactions through Metamask on a forked network.

    Anvil seems to hang/crash when submitting transactions through Metamask on a forked network.

    Component

    Anvil

    Have you ensured that all of these are up to date?

    • [X] Foundry
    • [X] Foundryup

    What version of Foundry are you on?

    forge 0.2.0 (dc83894 2022-06-11T00:06:34.928765727Z)

    What command(s) is the bug in?

    anvil

    Operating System

    Linux

    Describe the bug

    I'm trying to test submitting transactions through Metamask connected to anvil (localhost:8545).

    This is the example anvil command I'm running:

    anvil --fork-url="https://eth-mainnet.alchemyapi.io/v2/XXXXXXXXXXXXXXXXXXXXXXXXX" --fork-block-number=14812197 --port=8545 -b=5 --chain-id=1

    Example steps I've done to reproduce:

    1. I fork a specific block, set the block time to be a certain interval
    2. Launch opensea.io and sign in with one of my wallets that has an NFT
    3. List the item and in the process, calling setApprovalForAll on the NFT
    4. Notice that the transaction never goes through and anvil just freezes up (No blocks are getting produced anymore every 5s, it just seems to completely freeze and hang)
    T-bug C-anvil 
    opened by sunwrobert 26
  • feat(forge): Invariant Testing v2

    feat(forge): Invariant Testing v2

    Alright, opening for review since it's growing too much. Let's iterate from here.

    Summary:

    1. Functions should start with invariant. eg: invariant_neverFalse()
    2. Invariants have the following parameters on the config file
        /// The number of runs that must execute for each invariant test group.
        pub invariant_runs: u32,
        /// The number of calls executed to attempt to break invariants in one run.
        pub invariant_depth: u32,
        /// Fails the invariant fuzzing if a reversion occurs
        pub invariant_fail_on_revert: bool,
        /// Allows randomly overriding an external call when running invariant tests
        pub invariant_call_override: bool,
    
    1. An invariant with depth of 15 and 256 invariant_runs will have a total of 3840 calls (excluding the invariant checks), if everything succeeds.
    2. We currently fuzz the sender_address, target_address and calldata. 3.1 This data is generated by different proptest::TestRunner. 3.2 The data is influenced by a dictionary that is filled with new values throughout the runs.
    3. Invariants are checked right after setUp() and before anything is called.
    4. After each call we: 4.1 Collect stack/memory data to add to the fuzzing dictionary. 4.2 Collect newly created contracts and add them as potential target_address. 4.3 Make calls to the test contract invariant* functions. If any fails, we exit the run. 4.4 If all invariants have been broken, then exit asap.

    Filtering

    To better bound the test space there are certain filters that can be used:

    • targetContracts(): address[]: a contract address will be chosen from this list.
    • targetSenders(): address[]: 80% chance that a contract address will be chosen from this list.
    • targetSelectors(): (address, bytes4[])[]: adds to targetContracts list, and only the selectors provided will be called.
    • excludeContracts(): address[]: contract addresses from the setup process which are to be excluded from being targeted.

    Unsafe/External call overriding

    invariant_call_override allows for an external call to be overridden to simulate unsafe calls. This feature is false by default, since it requires some work, although it's already functional. (eg. testdata/fuzz/invariant/InvariantReentrancy.t.sol). More: https://github.com/foundry-rs/foundry/pull/1572#issuecomment-1186479575

    Examples

    testdata/fuzz/invariant/
    ├── InvariantInnerContract.t.sol
    ├── InvariantReentrancy.t.sol
    ├── InvariantTest1.t.sol
    └── target
        ├── ExcludeContracts.t.sol
        ├── TargetContracts.t.sol
        ├── TargetSelectors.t.sol
        └── TargetSenders.t.sol
    
    1 directory, 7 files
    

    Follow-up (in no particular order)

    • [ ] Improve report (https://github.com/foundry-rs/foundry/pull/1572#issuecomment-1191969303, https://github.com/foundry-rs/foundry/pull/1572#issuecomment-1193141900)
    • [ ] Export failures in a friendly format.
    • [ ] Replay (https://github.com/foundry-rs/foundry/issues/991#issuecomment-1107533935)
    • [x] Filter by artifact name. (giving priority here)
    • [ ] Proxy Support
    • [ ] Improve Call override report (current trace/report is a bit misleading)
    • [ ] Time based (just set up a real big invariant_runs for now...)
      • [ ] Parallelize runs if time is infinity
    • [x] Shrinking
    • [ ] Save >1 cases per broken invariant.
    • [ ] User defined weights (https://github.com/foundry-rs/foundry/pull/1572#discussion_r934075997)
    • [ ] Rename fuzz_seed to rng_seed
    old summary However, since the repo diverged quite a bit from the `sputnik` times, I wanted to get some potential feedback, since I'm still getting acquainted with the fuzzing modules, and I'm probably missing some things and/or design choices.

    Missing

    • [ ] forgetest!()
    • [ ] clean-up
    • [ ] ...

    Summary

    • [x] invariant_depth
    • [x] targetContracts(). if not found, then just fuzz every contract created at setUp
    • [x] targetSenders(). if not found, then just fuzz the sender
    • [x] excludeContracts()
    • [x] targetSelectors()
    • [x] invariant_fail_on_revert
    • [x] identify created contracts and fuzz them too

    Future/Now?

    • random msg.value

    ref #849

    T-feature 
    opened by joshieDo 26
  • Dynamic linking not supported in `create` command

    Dynamic linking not supported in `create` command

    Component

    Forge

    Have you ensured that all of these are up to date?

    • [X] Foundry
    • [X] Foundryup

    What version of Foundry are you on?

    forge 0.2.0 (a84a281 2022-04-16T00:15:54.385011+00:00)

    What command(s) is the bug in?

    forge create

    Operating System

    macOS (M1)

    Describe the bug

    Still getting a Dynamic linking not supported in create command error after changing foundry.toml when deploying to a testnet.

    First ran forge create Library which works fine.

    Got the address from that then add the following line to foundry.toml

    libraries= ['./src/lib/LibraryContract.sol:Library:0xaddress']

    I've also tried adding the contract that imports the library:

    libraries= ['./src/Contract.sol:Library:0xaddress']

    T-bug C-forge Cmd-forge-create 
    opened by evmcheb 26
  • Verifying contracts on optimsm doesn't work on Optimism

    Verifying contracts on optimsm doesn't work on Optimism

    Component

    Forge

    Have you ensured that all of these are up to date?

    • [ ] Foundry
    • [X] Foundryup

    What version of Foundry are you on?

    forge 0.2.0 (6130af7 2022-04-06T00:04:11.858449+00:00)

    What command(s) is the bug in?

    forge verify-contract

    Operating System

    macOS (M1)

    Describe the bug

    Trying to verify an optimism contract with:

    forge verify-contract --chain-id 69 --num-of-optimizations 1000000 --constructor-args < abi-encoded-args > --compiler-version v0.8.13+commit.abaa5c0e < contract-address > < path:contract > < etherscan-key >

    does not work. When verifying the verification I get the message below which is not very telling. Not sure what could be wrong, followed the docs very closely.

    Error: 0: Contract verification failed: Response: NOTOK Details: Fail - Unable to verify

    T-bug C-forge Cmd-forge-verify 
    opened by FredCoen 25
  • cast interface changes case of functions from abi

    cast interface changes case of functions from abi

    Component

    Cast

    Have you ensured that all of these are up to date?

    • [X] Foundry
    • [X] Foundryup

    What version of Foundry are you on?

    derrickb@derrick-home:/mnt/src/crypto/SimpleDefiDiamond/tmp$ forge --version forge 0.2.0 (a44159a 2023-01-03T00:04:00.577535633Z) derrickb@derrick-home:/mnt/src/crypto/SimpleDefiDiamond/tmp$ cast --version cast 0.2.0 (a44159a 2023-01-03T00:04:00.577535633Z) derrickb@derrick-home:/mnt/src/crypto/SimpleDefiDiamond/tmp$

    What command(s) is the bug in?

    cast interface

    Operating System

    Linux

    Describe the bug

    When converting an abi to an interface, some of the variables are changing case:

    ABI: struct transHolders Generated Interface: function receiveTranslog(TransHolders memory _th) external;

    Abi: "inputs": [ { "components": [ { "internalType": "bool", "name": "deposit", "type": "bool" }, { "internalType": "uint256", "name": "amount", "type": "uint256" }, { "internalType": "uint256", "name": "timestamp", "type": "uint256" }, { "internalType": "address", "name": "account", "type": "address" } ], "internalType": "struct transHolders", "name": "_th", "type": "tuple" } ], "name": "receiveTranslog", "outputs": [], "stateMutability": "nonpayable", "type": "function" },

    cast interface output: function receiveTranslog(TransHolders memory _th) external;

    I've attached the ABI:

    abiSimpleDefiDiamond.txt

    T-bug 
    opened by snapple42 1
  • error: failed to run custom build command for `svm-rs-builds v0.1.10` - without any explanation why

    error: failed to run custom build command for `svm-rs-builds v0.1.10` - without any explanation why

    Component

    Other (please describe)

    Have you ensured that all of these are up to date?

    • [X] Foundry
    • [ ] Foundryup

    What version of Foundry are you on?

    rev.159f629

    What command(s) is the bug in?

    build

    Operating System

    Linux

    Describe the bug

    See build log.

    I think "svm" refers to "solidity". "solidity" is already installed. The build should just use the installed version instead of rebuilding it.

    FreeBSD 13.1

    T-bug 
    opened by yurivict 2
  • Unable to verify contracts on etherscan

    Unable to verify contracts on etherscan

    Component

    Forge

    Have you ensured that all of these are up to date?

    • [X] Foundry
    • [X] Foundryup

    What version of Foundry are you on?

    forge 0.2.0 (a44159a 2023-01-03T00:04:00.577535633Z)

    What command(s) is the bug in?

    forge verify-contract

    Operating System

    Linux

    Describe the bug

    Cloudflare blocks the polygon smartcontracts verification request. There was a similar issue opened 4 monts ago and already closed but the issue persists. https://github.com/foundry-rs/foundry/issues/3271#issue-1377977325

    The reply:

    that's the Sorry, you have been blocked cloudflare issue, looks like we don't detect that here properly, but it's this: https://community.cloudflare.com/t/sorry-you-have-been-blocked/110790

    Is there any way to solve this issue? Couldn't find any solution about this problem anywhere.

    Output error:

    ONCHAIN EXECUTION COMPLETE & SUCCESSFUL.
    Total Paid: 0.009791964 ETH (4895982 gas * avg 2 gwei)
    ##
    Start verification for (1) contracts
    Start verifying contract `0x52f1d5301a763cba18eb357cbe9e3dbb868fd21f` deployed on polygon-mumbai
    
    Submitting verification for [contracts/core/SoundEditionV1_1.sol:SoundEditionV1_1] "0x52F1d5301A763CBA18Eb357cBe9E3DBb868Fd21F".
    2023-01-04T23:00:37.585427Z ERROR etherscan: Failed to deserialize response: expected value at line 1 column 1 res="<!DOCTYPE html>\n<!--[if lt IE 7]> <html class=\"no-js ie6 oldie\" lang=\"en-US\"> <![endif]-->\n<!--[if IE 7]>    <html class=\"no-js ie7 oldie\" lang=\"en-US\"> <![endif]-->\n<!--[if IE 8]>    <html class=\"no-js ie8 oldie\" lang=\"en-US\"> <![endif]-->\n<!--[if gt IE 8]><!--> <html class=\"no-js\" lang=\"en-US\"> <!--<![endif]-->\n<head>\n<title>Attention Required! | Cloudflare</title>\n<meta charset=\"UTF-8\" />\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=Edge\" />\n<meta name=\"robots\" content=\"noindex, nofollow\" />\n<meta name=\"viewport\" content=\"width=device-width,initial-scale=1\" />\n<link rel=\"stylesheet\" id=\"cf_styles-css\" href=\"/cdn-cgi/styles/cf.errors.css\" />\n<!--[if lt IE 9]><link rel=\"stylesheet\" id='cf_styles-ie-css' href=\"/cdn-cgi/styles/cf.errors.ie.css\" /><![endif]-->\n<style>body{margin:0;padding:0}</style>\n\n\n<!--[if gte IE 10]><!-->\n<script>\n  if (!navigator.cookieEnabled) {\n    window.addEventListener('DOMContentLoaded', function () {\n      var cookieEl = document.getElementById('cookie-alert');\n      cookieEl.style.display = 'block';\n    })\n  }\n</script>\n<!--<![endif]-->\n\n\n</head>\n<body>\n  <div id=\"cf-wrapper\">\n    <div class=\"cf-alert cf-alert-error cf-cookie-error\" id=\"cookie-alert\" data-translate=\"enable_cookies\">Please enable cookies.</div>\n    <div id=\"cf-error-details\" class=\"cf-error-details-wrapper\">\n      <div class=\"cf-wrapper cf-header cf-error-overview\">\n        <h1 data-translate=\"block_headline\">Sorry, you have been blocked</h1>\n        <h2 class=\"cf-subheadline\"><span data-translate=\"unable_to_access\">You are unable to access</span> polygonscan.com</h2>\n      </div><!-- /.header -->\n\n      <div class=\"cf-section cf-highlight\">\n        <div class=\"cf-wrapper\">\n          <div class=\"cf-screenshot-container cf-screenshot-full\">\n            \n              <span class=\"cf-no-screenshot error\"></span>\n            \n          </div>\n        </div>\n      </div><!-- /.captcha-container -->\n\n      <div class=\"cf-section cf-wrapper\">\n        <div class=\"cf-columns two\">\n          <div class=\"cf-column\">\n            <h2 data-translate=\"blocked_why_headline\">Why have I been blocked?</h2>\n\n            <p data-translate=\"blocked_why_detail\">This website is using a security service to protect itself from online attacks. The action you just performed triggered the security solution. There are several actions that could trigger this block including submitting a certain word or phrase, a SQL command or malformed data.</p>\n          </div>\n\n          <div class=\"cf-column\">\n            <h2 data-translate=\"blocked_resolve_headline\">What can I do to resolve this?</h2>\n\n            <p data-translate=\"blocked_resolve_detail\">You can email the site owner to let them know you were blocked. Please include what you were doing when this page came up and the Cloudflare Ray ID found at the bottom of this page.</p>\n          </div>\n        </div>\n      </div><!-- /.section -->\n\n      <div class=\"cf-error-footer cf-wrapper w-240 lg:w-full py-10 sm:py-4 sm:px-8 mx-auto text-center sm:text-left border-solid border-0 border-t border-gray-300\">\n  <p class=\"text-13\">\n    <span class=\"cf-footer-item sm:block sm:mb-1\">Cloudflare Ray ID: <strong class=\"font-semibold\">78479768bb1641c4</strong></span>\n    <span class=\"cf-footer-separator sm:hidden\">&bull;</span>\n    <span id=\"cf-footer-item-ip\" class=\"cf-footer-item hidden sm:block sm:mb-1\">\n      Your IP:\n      <button type=\"button\" id=\"cf-footer-ip-reveal\" class=\"cf-footer-ip-reveal-btn\">Click to reveal</button>\n      <span class=\"hidden\" id=\"cf-footer-ip\">139.47.18.44</span>\n      <span class=\"cf-footer-separator sm:hidden\">&bull;</span>\n    </span>\n    <span class=\"cf-footer-item sm:block sm:mb-1\"><span>Performance &amp; security by</span> <a rel=\"noopener noreferrer\" href=\"https://www.cloudflare.com/5xx-error-landing\" id=\"brand_link\" target=\"_blank\">Cloudflare</a></span>\n    \n  </p>\n  <script>(function(){function d(){var b=a.getElementById(\"cf-footer-item-ip\"),c=a.getElementById(\"cf-footer-ip-reveal\");b&&\"classList\"in b&&(b.classList.remove(\"hidden\"),c.addEventListener(\"click\",function(){c.classList.add(\"hidden\");a.getElementById(\"cf-footer-ip\").classList.remove(\"hidden\")}))}var a=document;document.addEventListener&&a.addEventListener(\"DOMContentLoaded\",d)})();</script>\n</div><!-- /.error-footer -->\n\n\n    </div><!-- /#cf-error-details -->\n  </div><!-- /#cf-wrapper -->\n\n  <script>\n  window._cf_translation = {};\n  \n  \n</script>\n\n</body>\n</html>\n"
    
    T-bug 
    opened by ander-db 0
  • forge flatten duplication of interfaces/contract names #262

    forge flatten duplication of interfaces/contract names #262

    Component

    Forge

    Have you ensured that all of these are up to date?

    • [x] Foundry
    • [ ] Foundryup

    What version of Foundry are you on?

    forge 0.2.0 (a44159a 2023-01-02T00:04:45.597843Z)

    What command(s) is the bug in?

    forge flatten

    Operating System

    macOS (Apple Silicon)

    Describe the bug

    When running forge flatten <file> in a project that the path of files includes multiple interfaces/contracts with the same name, the command can't solve the duplication and just generate the output with the same name repeated. For example if running forge flatten command in this file: https://github.com/makerdao/spells-goerli/blob/solc-0.8/src/DssSpell.sol will generate the result with two OracleLike interfaces. Hevm would have produced OracleLike_1 and OracleLike_2 instead.

    T-bug 
    opened by gbalabasquer 0
  • Preserve state of the anvil fork after the test (`forge test`) has been completed

    Preserve state of the anvil fork after the test (`forge test`) has been completed

    Component

    Forge

    Describe the feature you would like

    Being able to provide a flag to forge test command that turns off fork reset for every test. E.g. forge test --preserve-fork-state

    Additional context

    Thanks for the great project, we love the execution speed and the possibility to write concise solidity-based tests.

    But according to the docs, the blockchain state is being reset between the tests, and it's not possible to overwrite this behaviour (via, let's say --preserve-state flag). The reason it will be helpful: to reuse solidity test code for other purposes.

    • Simple use-case: after executing one specific test the user connects to the (still running) anvil fork via RPC and validates something by hand. Useful for debugging frontend
    • Complex use-case: run hardhat tests on top of the state changes produced by the solidity test. Useful when execution parameters coming off-chain (i.e. routing data)

    One other possible implementation of the same functionality would be via cheat codes that work inside anvil fork, but outside tests. E.g. a user deploys t.sol contract, then executes specific "test" function via RPC to reach desired state. There is no documentation on this, but according to our trials cheat codes don't work outside tests (i.e. when ran by foundry test)

    Please let me know what you think about this functionality and if we're using it wrong!

    T-feature 
    opened by KirillDogadin-std 0
Releases(nightly-a44159a5c23d2699d3a390e6d4889b89a0e5a5e0)
Owner
Georgios Konstantopoulos
blockchain scalability, information security and mechanism design. That Layer 2 guy. Aspiring Rustacean.
Georgios Konstantopoulos
A lightweight, no-fuss, drop-in replacement for Rudderstack

Welcome to Stilgar! Stilgar is a lightweight, no-fuss, drop-in replacement for Rudderstack. Key features: Seamlessly compatible with all Rudderstack c

Withings 4 Jul 21, 2023
Drop-in replacement for the Actix Web HTTP Logger middleware

actix-contrib-logger Logger middleware for the Actix Web framework. Actually it's a copy & paste from the official Logger middleware (original source

Mariano Ruiz 5 Aug 28, 2023
A tiling layout engine for egui with drag-and-drop and resizing

egui_tiles Layouting and docking for egui. Supports: Horizontal and vertical layouts Grid layouts Tabs Drag-and-drop docking Trying it cargo r --examp

rerun.io 83 Jun 5, 2023
Simpler and more powerful replacement for `find`

FindFile (FF) An simple, ergonomic, and powerful replacement for find. Note: this repo is under active development The syntax is (mostly) figured out,

Sam Westerman 4 Jun 20, 2023
Patch binary file using IDA signatures and defined replacement bytes in YAML.

fabricbin Patch binary file using IDA signatures and defined replacement bytes in YAML. Install: cargo install --git https://github.com/makindotcc/fab

makin 3 Oct 24, 2023
procs is a replacement for ps written in Rust.

procs is a replacement for ps written in Rust. Documentation quick links Features Platform Installation Usage Configuration Features Output by t

null 3.6k Dec 30, 2022
A readline replacement written in Rust

A readline replacement written in Rust Basic example // Create a default reedline object to handle user input use reedline::{DefaultPrompt, Reedline,

JT 292 Jan 9, 2023
🦀️atos for linux by rust - A partial replacement for Apple's atos tool for converting addresses within a binary file to symbols.

atosl-rs ??️ atos for linux by rust - A partial replacement for Apple's atos tool for converting addresses within a binary file to symbols. tested on

everettjf 60 Dec 29, 2022
exa is a modern replacement for ls.

exa exa is a modern replacement for ls. README Sections: Options — Installation — Development exa is a modern replacement for the venerable file-listi

Benjamin Sago 20.3k Jan 8, 2023
zoxide is a blazing fast replacement for your cd command

zoxide A smarter cd command for your terminal zoxide is a blazing fast replacement for your cd command, inspired by z and z.lua. It keeps track of the

Ajeet D'Souza 8.7k Dec 31, 2022
fastmod is a fast partial replacement for the codemod tool

fastmod is a fast partial replacement for codemod. Like codemod, it is a tool to assist you with large-scale codebase refactors, and it supports most of codemod's options.

Facebook Incubator 1.4k Dec 29, 2022
Fls - Ferris-LS, a very bad LS replacement. Besides that, proves that I suck at clean & good code.

FLS A handy ls remake, purely for learning. Why FLS? There's no reason, at all, don't use it. I just want to learn Rust :D Usage Flags: -i = Use icons

florida 6 Jan 24, 2022
xcp is a (partial) clone of the Unix cp command. It is not intended as a full replacement

xcp is a (partial) clone of the Unix cp command. It is not intended as a full replacement, but as a companion utility with some more user-friendly feedback and some optimisations that make sense under certain tasks (see below).

Steve Smith 310 Jan 5, 2023
Xcode Neovim Replacement-ish.

An XCode replacement-ish development environment that aims to be your reliable XCode alternative to develop exciting new [apple] software products ??

null 272 Dec 30, 2022
A more convenient `#[target_feature]` replacement

A more convenient #[target_feature] replacement To get good performance out of SIMD everything on the SIMD codepath must be inlined. With how SIMD is

Koute 3 Apr 10, 2023
A modern, maintained replacement for ls

eza eza is a modern, maintained replacement for ls, built on exa. README Sections: Options — Installation — Development eza is a modern, maintained re

eza 13 Aug 7, 2023
Warp is a blazingly fast, Rust-based terminal that makes you and your team more productive at running, debugging, and deploying code and infrastructure.

Warp is a blazingly fast, Rust-based terminal that makes you and your team more productive at running, debugging, and deploying code and infrastructure.

Warp 10.4k Jan 4, 2023
Sets of libraries and tools to write applications and libraries mixing OCaml and Rust

Sets of libraries and tools to write applications and libraries mixing OCaml and Rust. These libraries will help keeping your types and data structures synchronized, and enable seamless exchange between OCaml and Rust

Meta 36 Jan 28, 2023
A comprehensive collection of resources and learning materials for Rust programming, empowering developers to explore and master the modern, safe, and blazingly fast language.

?? Awesome Rust Lang ⛰️ Project Description : Welcome to the Awesome Rust Lang repository! This is a comprehensive collection of resources for Rust, a

Shubham Raj 16 May 29, 2023