Skip to content

Commit cdd4f0c

Browse files
dante4rtYour Name
authored andcommitted
docs: add readme
0 parents  commit cdd4f0c

14 files changed

Lines changed: 569 additions & 0 deletions

‎.DS_Store‎

6 KB
Binary file not shown.

‎.env.example‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
PRIVATE_KEY=0x
2+
RPC_URL="halorei"
3+
ETHERSCAN_API_KEY=
4+
VERIFIER_URL=

‎.github/workflows/test.yml‎

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
workflow_dispatch:
7+
8+
env:
9+
FOUNDRY_PROFILE: ci
10+
11+
jobs:
12+
check:
13+
strategy:
14+
fail-fast: true
15+
matrix:
16+
version: [1]
17+
18+
name: Foundry project
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
with:
23+
submodules: recursive
24+
25+
- name: Install Foundry
26+
uses: foundry-rs/foundry-toolchain@v1
27+
28+
- name: Install Deps
29+
run: |
30+
forge install https://github.com/foundry-rs/forge-std https://github.com/OpenZeppelin/openzeppelin-contracts
31+
32+
- name: Show Forge version
33+
run: |
34+
forge --version
35+
36+
- name: Run Forge fmt
37+
run: |
38+
forge fmt --check
39+
id: fmt
40+
41+
- name: Run Forge build
42+
run: |
43+
forge build --sizes
44+
id: build
45+
46+
- name: Run Forge tests
47+
run: |
48+
forge test -vvv
49+
id: test

‎.gitignore‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Compiler files
2+
cache/
3+
out/
4+
5+
# Ignores development broadcast logs
6+
!/broadcast
7+
/broadcast/*/31337/
8+
/broadcast/**/dry-run/
9+
10+
# Docs
11+
docs/
12+
13+
# Dotenv file
14+
.env
15+
16+
lib/
17+
node_modules/
18+
broadcast/

‎.gitmodules‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[submodule "lib/forge-std"]
2+
path = lib/forge-std
3+
url = https://github.com/foundry-rs/forge-std
4+
[submodule "lib/openzeppelin-contracts"]
5+
path = lib/openzeppelin-contracts
6+
url = https://github.com/OpenZeppelin/openzeppelin-contracts

‎Makefile‎

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
.PHONY: test
2+
test:
3+
forge test
4+
5+
.PHONY: debug
6+
debug:
7+
forge test -vv
8+
9+
.PHONY: trace
10+
trace:
11+
forge test -vvvv
12+
13+
.PHONY: coverage
14+
coverage:
15+
forge coverage
16+
17+
.PHONY: deploy
18+
deploy:
19+
set +a; \
20+
source .env; \
21+
set -a; \
22+
forge script \
23+
script/SugarDonation.s.sol:DeploySugarDonation \
24+
--rpc-url $$RPC_URL \
25+
--private-key $$PRIVATE_KEY \
26+
--broadcast \
27+
--verify \
28+
--etherscan-api-key $$ETHERSCAN_API_KEY
29+
30+
.PHONY: deploy-bs
31+
deploy-bs:
32+
set +a; \
33+
source .env; \
34+
set -a; \
35+
forge script \
36+
script/SugarDonation.s.sol:DeploySugarDonation \
37+
--rpc-url $$RPC_URL \
38+
--private-key $$PRIVATE_KEY \
39+
--broadcast \
40+
--optimize \
41+
--optimizer-runs 100 \
42+
--skip-simulation \
43+
--verify \
44+
--verifier-url https://sepolia-blockscout.lisk.com/api \
45+
--verifier blockscout
46+
47+
.PHONY: install
48+
install:
49+
forge install foundry-rs/forge-std OpenZeppelin/openzeppelin-contracts --no-commit

‎README.md‎

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Sugar Contracts
2+
3+
Smart contracts for Sugar, a Web3-native platform empowering streamers and communities to connect, collaborate, and monetize transparently.
4+
5+
## ⚙️ Tech Stack
6+
7+
- **Foundry** – Fast, modular testing and deployment framework for Solidity
8+
- **Forge Std** – Testing utilities and cheatcodes
9+
- **OpenZeppelin Contracts** – Secure, audited smart contract libraries
10+
11+
## 🔨 Setup
12+
13+
1. Install Foundry:
14+
15+
```bash
16+
curl -L https://foundry.paradigm.xyz | bash
17+
foundryup
18+
````
19+
20+
1. Install dependencies:
21+
22+
```bash
23+
npm install
24+
```
25+
26+
## 🚀 Scripts
27+
28+
- Run tests:
29+
30+
```bash
31+
forge test
32+
```
33+
34+
- Run a script (e.g., deploy):
35+
36+
```bash
37+
forge script script/SugarDonation.s.sol --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast
38+
```
39+
40+
## 👥 Team
41+
42+
Built with ❤️ by:
43+
44+
- **Rei Yan**
45+
- **Jo**
46+
- **Rama**
47+
48+
Part of the Sugar project: [github.com/sugar-space](https://github.com/sugar-space)

‎foundry.toml‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[profile.default]
2+
src = "src"
3+
out = "out"
4+
libs = ["lib"]
5+
solc = '0.8.20'
6+
7+
# See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options

‎package-lock.json‎

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"dependencies": {
3+
"@openzeppelin/contracts": "^5.2.0"
4+
}
5+
}

0 commit comments

Comments
 (0)