Skip to content

Commit 32351d8

Browse files
authored
feat: hybrid hardhat foundry (#11)
1 parent 71e2a5a commit 32351d8

24 files changed

+11829
-5938
lines changed

.env.example

Lines changed: 0 additions & 5 deletions
This file was deleted.

.github/workflows/branch.yml

Lines changed: 0 additions & 127 deletions
This file was deleted.

.github/workflows/solidity.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Branch
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
push:
8+
branches:
9+
- main
10+
tags:
11+
- 'v*'
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
permissions:
18+
actions: write
19+
checks: write
20+
contents: write
21+
deployments: write
22+
id-token: write
23+
issues: write
24+
discussions: write
25+
packages: write
26+
pages: write
27+
pull-requests: write
28+
repository-projects: write
29+
security-events: write
30+
statuses: write
31+
32+
jobs:
33+
ci:
34+
name: CI
35+
uses: settlemint/smart-contracts-actions/.github/workflows/solidity.yml@main
36+
secrets:
37+
TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
with:
39+
docker-image-name: solidity-token-erc721a
40+
runs-on: solidity-token-erc721a
41+
ignition-module: 'ignition/modules/ExampleERC721a.ts'
42+
subgraph-contract-address-key: 'ExampleERC721aModule#ExampleERC721a'

.gitignore

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
1+
node_modules
2+
.env
3+
4+
# Hardhat files
5+
/cache
6+
/artifacts
7+
8+
# TypeChain files
9+
/typechain
10+
/typechain-types
11+
12+
# solidity-coverage files
13+
/coverage
14+
/coverage.json
15+
lcov.info
16+
17+
# Hardhat Ignition default folder for deployments against a local node
18+
ignition/deployments/chain-31337
19+
120
# Compiler files
2-
cache/
21+
cache_forge/
322
out/
423

524
# Ignores development broadcast logs
@@ -14,11 +33,7 @@ docs/
1433
.env
1534

1635
# Subgraphs
17-
deployment.txt
18-
deployment-anvil.txt
19-
subgraph/subgraph.config.json
20-
subgraph/node_modules
21-
subgraph/generated
22-
subgraph/build
36+
generated
37+
build
2338

2439
.pnpm

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
url = https://github.com/foundry-rs/forge-std
44
[submodule "lib/openzeppelin-contracts"]
55
path = lib/openzeppelin-contracts
6-
url = https://github.com/openzeppelin/openzeppelin-contracts
6+
url = https://github.com/OpenZeppelin/openzeppelin-contracts
77
[submodule "lib/ERC721A"]
88
path = lib/ERC721A
99
url = https://github.com/chiru-labs/ERC721A

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.yaml

.solhint.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "solhint:recommended"
3+
}

.vscode/tasks.json

Lines changed: 35 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -2,113 +2,84 @@
22
"version": "2.0.0",
33
"tasks": [
44
{
5-
"label": "build",
5+
"label": "Foundry - Build",
66
"type": "shell",
7-
"command": "make build",
7+
"command": "btp-scs foundry build",
88
"group": {
99
"kind": "build",
1010
"isDefault": true
1111
},
1212
"problemMatcher": []
1313
},
1414
{
15-
"label": "test",
15+
"label": "Hardhat - Build",
1616
"type": "shell",
17-
"command": "make test",
18-
"group": "test",
19-
"problemMatcher": []
20-
},
21-
{
22-
"label": "format",
23-
"type": "shell",
24-
"command": "make format",
25-
"problemMatcher": []
26-
},
27-
{
28-
"label": "snapshot",
29-
"type": "shell",
30-
"command": "make snapshot",
17+
"command": "btp-scs hardhat build",
18+
"group": {
19+
"kind": "build",
20+
"isDefault": false
21+
},
3122
"problemMatcher": []
3223
},
3324
{
34-
"label": "anvil",
25+
"label": "Foundry - Test",
3526
"type": "shell",
36-
"command": "make anvil",
27+
"command": "btp-scs foundry test",
28+
"group": "test",
3729
"problemMatcher": []
3830
},
3931
{
40-
"label": "deploy-anvil",
32+
"label": "Hardhat - Test",
4133
"type": "shell",
42-
"command": "make deploy-anvil",
34+
"command": "btp-scs hardhat test",
35+
"group": "test",
4336
"problemMatcher": []
4437
},
4538
{
46-
"label": "deploy",
39+
"label": "Foundry - Format",
4740
"type": "shell",
48-
"command": "EXTRA_ARGS=\"${input:extra-deployment-verify} ${input:extra-deployment-other}\" make deploy",
41+
"command": "btp-scs foundry format",
4942
"problemMatcher": []
5043
},
5144
{
52-
"label": "script-anvil",
45+
"label": "Foundry - Start network",
5346
"type": "shell",
54-
"command": "EXTRA_ARGS=\"${input:extra-script-broadcast} ${input:extra-script-other}\" make script-anvil",
55-
"problemMatcher": []
47+
"command": "btp-scs foundry network",
48+
"problemMatcher": [],
49+
"isBackground": true
5650
},
5751
{
58-
"label": "script",
52+
"label": "Hardhat - Start network",
5953
"type": "shell",
60-
"command": "EXTRA_ARGS=\"${input:extra-script-broadcast} ${input:extra-script-other}\" make script",
61-
"problemMatcher": []
54+
"command": "btp-scs hardhat network",
55+
"problemMatcher": [],
56+
"isBackground": true,
6257
},
6358
{
64-
"label": "cast",
59+
"label": "Hardhat - Deploy to local network",
6560
"type": "shell",
66-
"command": "make cast",
61+
"command": "btp-scs hardhat deploy local -m ${input:deployment-module}",
6762
"problemMatcher": []
6863
},
6964
{
70-
"label": "subgraph",
65+
"label": "Hardhat - Deploy to platform network",
7166
"type": "shell",
72-
"command": "make subgraph",
67+
"command": "btp-scs hardhat deploy remote -m ${input:deployment-module}",
7368
"problemMatcher": []
7469
},
7570
{
76-
"label": "help",
71+
"label": "The Graph - Deploy or update the subgraph",
7772
"type": "shell",
78-
"command": "make help",
73+
"command": "btp-scs subgraph deploy",
7974
"problemMatcher": []
8075
}
8176
],
8277
"inputs": [
8378
{
84-
"id": "extra-deployment-verify",
85-
"description": "Extra deployment options?",
86-
"default": "",
87-
"type": "pickString",
88-
"options": [
89-
"",
90-
"--verify --verifier sourcify",
91-
"--verify --verifier etherscan --etherscan-api-key ${ETHERSCAN_API_KEY}"
92-
]
93-
},
94-
{
95-
"id": "extra-deployment-other",
96-
"description": "Other extra deployment options?",
97-
"default": "",
98-
"type": "promptString"
99-
},
100-
{
101-
"id": "extra-script-broadcast",
102-
"description": "Broadcast?",
103-
"default": "",
104-
"type": "pickString",
105-
"options": ["", "--broadcast"]
106-
},
107-
{
108-
"id": "extra-script-other",
109-
"description": "Other extra script options?",
110-
"default": "",
111-
"type": "promptString"
79+
"id": "deployment-module",
80+
"description": "Hardhat Ignition Module",
81+
"type": "promptString",
82+
"default": "ignition/modules/ExampleERC721a.ts"
11283
}
11384
]
114-
}
85+
}

0 commit comments

Comments
 (0)