Full Code of gakonst/dapptools-template for AI

master f5db6aeeff58 cached
9 files
3.7 KB
1.2k tokens
1 requests
Download .txt
Repository: gakonst/dapptools-template
Branch: master
Commit: f5db6aeeff58
Files: 9
Total size: 3.7 KB

Directory structure:
gitextract_lxuhaalh/

├── .gas-snapshot
├── .github/
│   └── workflows/
│       └── ci.yml
├── .gitignore
├── .gitmodules
├── LICENSE
├── README.md
├── foundry.toml
├── src/
│   └── Contract.sol
└── test/
    └── Contract.t.sol

================================================
FILE CONTENTS
================================================

================================================
FILE: .gas-snapshot
================================================
TestContract:testBar() (gas: 401)


================================================
FILE: .github/workflows/ci.yml
================================================
name: CI
on:
  push:
    branches:
      - master
  pull_request:

env:
  FOUNDRY_PROFILE: ci

jobs:
  run-ci:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2

      - name: Install Foundry
        uses: foundry-rs/foundry-toolchain@v1
        with:
          version: nightly

      - name: Install deps
        run: forge install

      - name: Check gas snapshots
        run: forge snapshot --check

      - name: Run tests
        run: forge test


================================================
FILE: .gitignore
================================================
cache/
out/


================================================
FILE: .gitmodules
================================================
[submodule "lib/forge-std"]
	path = lib/forge-std
	url = https://github.com/foundry-rs/forge-std


================================================
FILE: LICENSE
================================================
This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.

In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to <http://unlicense.org/>


================================================
FILE: README.md
================================================
# <h1 align="center"> Forge Template </h1>

**Template repository for getting started quickly with Foundry projects**

![Github Actions](https://github.com/foundry-rs/forge-template/workflows/CI/badge.svg)

## Getting Started

Click "Use this template" on [GitHub](https://github.com/foundry-rs/forge-template) to create a new repository with this repo as the initial state.

Or, if your repo already exists, run:
```sh
forge init
forge build
forge test
```

## Writing your first test

All you need is to `import forge-std/Test.sol` and then inherit it from your test contract. Forge-std's Test contract comes with a pre-instatiated [cheatcodes environment](https://book.getfoundry.sh/cheatcodes/), the `vm`. It also has support for [ds-test](https://book.getfoundry.sh/reference/ds-test.html)-style logs and assertions. Finally, it supports Hardhat's [console.log](https://github.com/brockelmore/forge-std/blob/master/src/console.sol). The logging functionalities require `-vvvv`.

```solidity
pragma solidity 0.8.10;

import "forge-std/Test.sol";

contract ContractTest is Test {
    function testExample() public {
        vm.roll(100);
        console.log(1);
        emit log("hi");
        assertTrue(true);
    }
}
```

## Development

This project uses [Foundry](https://getfoundry.sh). See the [book](https://book.getfoundry.sh/getting-started/installation.html) for instructions on how to install and use Foundry.


================================================
FILE: foundry.toml
================================================
[profile.ci.fuzz]
runs = 10_000


================================================
FILE: src/Contract.sol
================================================
// SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.13;

contract Contract { }


================================================
FILE: test/Contract.t.sol
================================================
// SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.13;

import "forge-std/Test.sol";

import "src/Contract.sol";

contract TestContract is Test {
    Contract c;

    function setUp() public {
        c = new Contract();
    }

    function testBar() public {
        assertEq(uint256(1), uint256(1), "ok");
    }

    function testFoo(uint256 x) public {
        vm.assume(x < type(uint128).max);
        assertEq(x + x, x * 2);
    }
}
Download .txt
gitextract_lxuhaalh/

├── .gas-snapshot
├── .github/
│   └── workflows/
│       └── ci.yml
├── .gitignore
├── .gitmodules
├── LICENSE
├── README.md
├── foundry.toml
├── src/
│   └── Contract.sol
└── test/
    └── Contract.t.sol
Condensed preview — 9 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (4K chars).
[
  {
    "path": ".gas-snapshot",
    "chars": 34,
    "preview": "TestContract:testBar() (gas: 401)\n"
  },
  {
    "path": ".github/workflows/ci.yml",
    "chars": 476,
    "preview": "name: CI\non:\n  push:\n    branches:\n      - master\n  pull_request:\n\nenv:\n  FOUNDRY_PROFILE: ci\n\njobs:\n  run-ci:\n    runs-"
  },
  {
    "path": ".gitignore",
    "chars": 12,
    "preview": "cache/\nout/\n"
  },
  {
    "path": ".gitmodules",
    "chars": 97,
    "preview": "[submodule \"lib/forge-std\"]\n\tpath = lib/forge-std\n\turl = https://github.com/foundry-rs/forge-std\n"
  },
  {
    "path": "LICENSE",
    "chars": 1211,
    "preview": "This is free and unencumbered software released into the public domain.\n\nAnyone is free to copy, modify, publish, use, c"
  },
  {
    "path": "README.md",
    "chars": 1425,
    "preview": "# <h1 align=\"center\"> Forge Template </h1>\n\n**Template repository for getting started quickly with Foundry projects**\n\n!"
  },
  {
    "path": "foundry.toml",
    "chars": 32,
    "preview": "[profile.ci.fuzz]\nruns = 10_000\n"
  },
  {
    "path": "src/Contract.sol",
    "chars": 86,
    "preview": "// SPDX-License-Identifier: Unlicense\npragma solidity ^0.8.13;\n\ncontract Contract { }\n"
  },
  {
    "path": "test/Contract.t.sol",
    "chars": 446,
    "preview": "// SPDX-License-Identifier: Unlicense\npragma solidity ^0.8.13;\n\nimport \"forge-std/Test.sol\";\n\nimport \"src/Contract.sol\";"
  }
]

About this extraction

This page contains the full source code of the gakonst/dapptools-template GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 9 files (3.7 KB), approximately 1.2k tokens. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!