Skip to content

Commit

Permalink
draft: initial implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
amusingaxl committed Feb 4, 2025
0 parents commit 4fcbf31
Show file tree
Hide file tree
Showing 14 changed files with 1,605 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
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

- 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
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Compiler files
cache/
out/

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

# Docs
docs/

# Dotenv file
.env
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "lib/dss-test"]
path = lib/dss-test
url = https://github.com/makerdao/dss-test
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Direct Stability Parameters Change Module (DSPC)

A module for MakerDAO that enables direct changes to stability parameters (duty) for collateral types through a simple, secure interface.

## Overview

The DSPC module provides a streamlined way to modify stability fees for different collateral types in the Maker Protocol. It interfaces directly with the Jug contract and includes proper access controls.

## Features

- Direct stability fee modifications for any collateral type
- Owner-based access control
- Event emission for all parameter changes
- Simple, auditable implementation

## Installation

```bash
forge install
```

## Testing

```bash
forge test
```

## Usage

1. Deploy the contract with the Jug contract address:
```solidity
DSPC dspc = new DSPC(jugAddress);
```

2. Call the `file` function to modify stability fees:
```solidity
dspc.file("ETH-A", 1.05e27); // Sets 5% stability fee for ETH-A
```

## Security

The module implements a simple but effective authorization system where only the owner can make changes. The owner can be transferred to a new address if needed.

## License

AGPL-3.0-or-later
16 changes: 16 additions & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[profile.default]
src = "src"
out = "out"
libs = ["lib"]
solc = "0.8.24"
optimizer = true
optimizer_runs = 200
verbosity = 3

# See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options

[profile.test]
verbosity = 3

[rpc_endpoints]
mainnet = "${ETH_RPC_URL}"
1 change: 1 addition & 0 deletions lib/dss-test
Submodule dss-test added at dd3ff0
1 change: 1 addition & 0 deletions lib/forge-std
Submodule forge-std added at b93cf4
Loading

0 comments on commit 4fcbf31

Please sign in to comment.