Skip to content

Commit

Permalink
aderyn.toml env test
Browse files Browse the repository at this point in the history
  • Loading branch information
TilakMaddy committed Mar 10, 2025
1 parent eb8656d commit 8910b4b
Show file tree
Hide file tree
Showing 15 changed files with 246 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,9 @@
[submodule "tests/2024-07-templegold"]
path = tests/2024-07-templegold
url = https://github.com/Cyfrin/2024-07-templegold.git
[submodule "tests/foundry-nft-f23-icm/lib/forge-std"]
path = tests/foundry-nft-f23-icm/lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "tests/foundry-nft-f23-icm/lib/openzeppelin-contracts"]
path = tests/foundry-nft-f23-icm/lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts
37 changes: 37 additions & 0 deletions reports/nft-report-icm.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions tests/foundry-nft-f23-icm/.github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: test

on: workflow_dispatch

env:
FOUNDRY_PROFILE: ci

jobs:
check:
strategy:
fail-fast: true

name: Foundry project
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

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

- name: Run Forge build
run: |
forge --version
forge build --sizes
id: build

- name: Run Forge tests
run: |
forge test -vvv
id: test
15 changes: 15 additions & 0 deletions tests/foundry-nft-f23-icm/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Compiler files
cache/
out/

# Ignores development broadcast logs
!/broadcast
/broadcast/*/31337/
/broadcast/**/dry-run/

# Docs
docs/

# Dotenv file
.env
broadcast
66 changes: 66 additions & 0 deletions tests/foundry-nft-f23-icm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
## Foundry

**Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.**

Foundry consists of:

- **Forge**: Ethereum testing framework (like Truffle, Hardhat and DappTools).
- **Cast**: Swiss army knife for interacting with EVM smart contracts, sending transactions and getting chain data.
- **Anvil**: Local Ethereum node, akin to Ganache, Hardhat Network.
- **Chisel**: Fast, utilitarian, and verbose solidity REPL.

## Documentation

https://book.getfoundry.sh/

## Usage

### Build

```shell
$ forge build
```

### Test

```shell
$ forge test
```

### Format

```shell
$ forge fmt
```

### Gas Snapshots

```shell
$ forge snapshot
```

### Anvil

```shell
$ anvil
```

### Deploy

```shell
$ forge script script/Counter.s.sol:CounterScript --rpc-url <your_rpc_url> --private-key <your_private_key>
```

### Cast

```shell
$ cast <subcommand>
```

### Help

```shell
$ forge --help
$ anvil --help
$ cast --help
```
8 changes: 8 additions & 0 deletions tests/foundry-nft-f23-icm/aderyn.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Aderyn Configuration File
# Help Aderyn work with more granular control

# DO NOT CHANGE version below. As of now, only 1 is supported
version = 1

[env]
FOUNDRY_PROFILE = "icm"
13 changes: 13 additions & 0 deletions tests/foundry-nft-f23-icm/foundry.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[profile.default]
src = "src"
out = "out"
libs = ["lib"]
remappings = ["@oz/contracts=lib/openzeppelin-contracts/contracts", "icm/=src/inner-core-modules"]

[profile.icm]
src = "src/inner-core-modules"
out = "out"
libs = ["lib"]
remappings = ["@oz/contracts=lib/openzeppelin-contracts/contracts", "icm/=src/inner-core-modules"]

# See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options
1 change: 1 addition & 0 deletions tests/foundry-nft-f23-icm/lib/forge-std
Submodule forge-std added at 3b20d6
1 change: 1 addition & 0 deletions tests/foundry-nft-f23-icm/lib/openzeppelin-contracts
Submodule openzeppelin-contracts added at acd4ff
7 changes: 7 additions & 0 deletions tests/foundry-nft-f23-icm/remappings
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@oz/contracts/=lib/openzeppelin-contracts/contracts/
icm/=src/inner-core-modules/
@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/
ds-test/=lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/
erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/
forge-std/=lib/forge-std/src/
openzeppelin-contracts/=lib/openzeppelin-contracts/
23 changes: 23 additions & 0 deletions tests/foundry-nft-f23-icm/src/BasicNft.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.25;

import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "icm/ICM.sol"; // icm is remapped to src/inner-core-modules
import "./Initializer.sol";

contract BasicNft is ICM, ERC721 {

uint256 public s_tokenId;

constructor() ERC721(PROJECT_NAME, PROJECT_SYMBOL) {
Initializer initializer = new Initializer();
s_tokenId = initializer.get_start_token_id();
}

function mint() public {
_safeMint(msg.sender, s_tokenId);
s_tokenId++;
}

}
9 changes: 9 additions & 0 deletions tests/foundry-nft-f23-icm/src/F1.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.10;

import "./F2.sol";

contract F1 {

}
7 changes: 7 additions & 0 deletions tests/foundry-nft-f23-icm/src/F2.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.21;

contract F2 {

}
11 changes: 11 additions & 0 deletions tests/foundry-nft-f23-icm/src/Initializer.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.25;

import "@oz/contracts/token/ERC721/ERC721.sol";

contract Initializer {
function get_start_token_id() public pure returns(uint256) {
return 10;
}
}
8 changes: 8 additions & 0 deletions tests/foundry-nft-f23-icm/src/inner-core-modules/ICM.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.25;

contract ICM {
string public PROJECT_NAME = "Dogie";
string public PROJECT_SYMBOL = "DOG";
}

0 comments on commit 8910b4b

Please sign in to comment.