Skip to content

Commit

Permalink
refactor: stable improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
geolffreym committed Dec 27, 2024
2 parents 7f38dab + 82b6e37 commit 0b2b413
Show file tree
Hide file tree
Showing 140 changed files with 7,367 additions and 6,446 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: CI

on:
push:
pull_request:
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: Show Forge version
run: |
forge --version
- name: Run Forge fmt
run: |
forge fmt --check
id: fmt

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

- name: Run Forge tests
run: |
forge test -vvv
id: test
6 changes: 0 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "lib/openzeppelin-foundry-upgrades"]
path = lib/openzeppelin-foundry-upgrades
url = https://github.com/OpenZeppelin/openzeppelin-foundry-upgrades
[submodule "lib/openzeppelin-contracts-upgradeable"]
path = lib/openzeppelin-contracts-upgradeable
url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable
[submodule "lib/solady"]
path = lib/solady
url = https://github.com/vectorized/solady
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ compile:
.PHONY: generate ## generate contract using abigen
generate:
@abigen --abi ${file}.abi.json --bin ${file}.bin --pkg contracts --type ${contract} --out ${contract}.go
@forge build --extra-output-files bin

.PHONY: force-compile ## compile contracts
force-compile:
Expand Down
76 changes: 55 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,66 @@
## Foundry

[![CI](https://github.com/Synaps3Protocol/protocol-core-v1/actions/workflows/ci.yaml/badge.svg)](https://github.com/Synaps3Protocol/protocol-core-v1/actions/workflows/ci.yaml)
[![COV](https://raw.githubusercontent.com/Synaps3Protocol/protocol-core-v1/main/.github/workflows/cov-badge.svg)](https://github.com/Synaps3Protocol/protocol-core-v1/actions/workflows/ci.yaml)
**Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.**

# Synapse Protocol
Welcome! 🎉 Synapse is redefining how creative IP distribution works. Whether it's films, music, or games, we ensure creators stay in control of their work while earning fairly. With the power of blockchain, Synapse eliminates middlemen and automates licensing, payments, and content delivery through smart contracts. This lets creators focus on their craft, knowing their content is distributed safely and transparently.
Foundry consists of:

![image](https://github.com/user-attachments/assets/59610c00-672d-4eec-88dc-71b4fc8add59)
- **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.

## Join the Fun
Found a bug? Got a cool idea? Open a pull request or start a discussion on GitHub. We’d love to build this together!
## Documentation

## Development
https://book.getfoundry.sh/

Some available capabilities for dev support:
## Usage

* **Run Tests**: `make test`
* **Compile Contracts**: `make compile`
* **Force Compile Contracts**: `make force-compile`
* **Test Coverage Report**: `make coverage`
* **Generate Security Report**: `make secreport`
* **Run Security Tests**: `make sectest`
* **Format Code**: `make format`
* **Lint Code**: `make lint`
### Build

Note: Run `make help` to see additional capabilities.
```shell
$ forge build
```

## References
### Test

- Code Maturity: https://github.com/crytic/building-secure-contracts/blob/master/development-guidelines/code_maturity.md
```shell
$ forge test
```

- Style Guide: https://docs.soliditylang.org/en/latest/style-guide.html
### 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
```
69 changes: 0 additions & 69 deletions broadcast/01_Deploy_Base_Create3.s.sol/80002/run-1732145419.json

This file was deleted.

69 changes: 0 additions & 69 deletions broadcast/01_Deploy_Base_Create3.s.sol/80002/run-latest.json

This file was deleted.

Loading

0 comments on commit 0b2b413

Please sign in to comment.