Skip to content

Commit

Permalink
refactor: Spoke Registrar
Browse files Browse the repository at this point in the history
  • Loading branch information
deluca-mike committed Aug 17, 2024
1 parent 3aa73eb commit 3efe228
Show file tree
Hide file tree
Showing 135 changed files with 114 additions and 21,141 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/certora_verification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ jobs:

- name: Install solc
run: |
wget https://github.com/ethereum/solidity/releases/download/v0.8.23/solc-static-linux
wget https://github.com/ethereum/solidity/releases/download/v0.8.26/solc-static-linux
chmod +x solc-static-linux
sudo mv solc-static-linux /usr/local/bin/solc8.23
sudo mv solc-static-linux /usr/local/bin/solc8.26
- name: Verify
run: |
sh certora/munge.sh
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- spoke
pull_request:

permissions: write-all
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-fuzz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- spoke
pull_request:

permissions: write-all
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-gas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- spoke
pull_request:

permissions: write-all
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- spoke
pull_request:

permissions: write-all
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-invariant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- spoke
pull_request:

permissions: write-all
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
path = lib/forge-std
url = git@github.com:foundry-rs/forge-std.git
branch = v1
[submodule "lib/erc20-helper"]
path = lib/erc20-helper
url = git@github.com:maple-labs/erc20-helper.git
[submodule "lib/common"]
path = lib/common
url = git@github.com:MZero-Labs/common.git
6 changes: 4 additions & 2 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
"plugins": ["prettier-plugin-solidity"],
"plugins": [
"prettier-plugin-solidity"
],
"overrides": [
{
"files": "*.sol",
"options": {
"compiler": "0.8.23",
"compiler": "0.8.26",
"parser": "solidity-parse",
"tabWidth": 4,
"singleQuote": false,
Expand Down
29 changes: 23 additions & 6 deletions .solhint.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,32 @@
{
"extends": ["solhint:recommended"],
"extends": [
"solhint:recommended"
],
"plugins": [],
"rules": {
"not-rely-on-time": "off",
"no-inline-assembly": "off",
"code-complexity": ["warn", 10],
"function-max-lines": ["warn", 100],
"max-line-length": ["warn", 120],
"code-complexity": [
"warn",
10
],
"function-max-lines": [
"warn",
100
],
"max-line-length": [
"warn",
120
],
"contract-name-camelcase": "warn",
"no-unused-vars": "warn",
"no-global-import": "warn",
"no-unused-import": "warn",
"comprehensive-interface": "off",
"quotes": ["error", "double"],
"quotes": [
"error",
"double"
],
"const-name-snakecase": "off",
"event-name-camelcase": "warn",
"func-name-mixedcase": "off",
Expand All @@ -29,7 +43,10 @@
"imports-on-top": "error",
"ordering": "warn",
"visibility-modifier-order": "error",
"compiler-version": ["warn", "0.8.23"],
"compiler-version": [
"warn",
"0.8.26"
],
"func-visibility": [
"warn",
{
Expand Down
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# TTG (Two Token Governance)
# M^0 Spoke Registrar

A TTG, "Two Token Governance" is a governance mechanism that uses token voting to maintain lists and manage communal property. As its name implies, it primarily optimizes for token holder participation. A TTG is primarily used for **permissioning actors** and should not be used for funding/financing decisions.
An immutable book of arbitrary key-value pairs and lists.

## Development

Expand Down Expand Up @@ -97,7 +97,3 @@ yarn doc
```

The command will generate the documentation in the `docs` folder and spinup a local server on port `4000` to view the documentation.

## TTG Smart Contract Architecture

<img width="1098" alt="ttg" src="https://github.com/MZero-Labs/ttg/assets/1220854/58866111-26f6-495d-8949-9cef00783f7c">
Binary file removed assets/SC-architecture-June2023-v1.png
Binary file not shown.
Binary file removed assets/spog-arch-2nd-version.png
Binary file not shown.
16 changes: 0 additions & 16 deletions certora/Makefile
Original file line number Diff line number Diff line change
@@ -1,31 +1,15 @@
default: help

PATCH = applyHarness.patch
MUNGED_DIR = ./munged
CONTRACTS_DIR = ../contracts/src
file1_origin = ../src/StandardGovernor.sol
file1_munged = ./munged/StandardGovernor.sol
file1_copy = ./munged/StandardGovernor_origin.sol

help:
@echo "usage:"
@echo " make clean: remove all generated files (those ignored by git)"
@echo " make $(MUNGED_DIR): create $(MUNGED_DIR) directory by applying the patch file to $(CONTRACTS_DIR)"
@echo " make record: record a new patch file capturing the differences between $(file1_munged) and $(file1_origin)"

munge:
mkdir -p $(MUNGED_DIR)
cp $(file1_origin) $(file1_munged)
cp $(file1_origin) $(file1_copy)
patch -d $(MUNGED_DIR) < $(PATCH)
mv $(file1_munged) $(file1_origin)

record:
diff -uN $(file1_origin) $(file1_munged) | sed 's+\$(file1_origin)/++g' | sed 's+$(file1_munged)++g' > $(PATCH)

revert:
cp $(file1_origin) $(file1_munged)
mv $(file1_copy) $(file1_origin)

clean:
git clean -fdX
Expand Down
22 changes: 0 additions & 22 deletions certora/applyHarness.patch

This file was deleted.

21 changes: 0 additions & 21 deletions certora/confs/PowerToken.conf

This file was deleted.

25 changes: 0 additions & 25 deletions certora/confs/StandardGovernor.conf

This file was deleted.

15 changes: 0 additions & 15 deletions certora/confs/ZeroToken.conf

This file was deleted.

78 changes: 0 additions & 78 deletions certora/harness/PowerTokenHarness.sol

This file was deleted.

Loading

0 comments on commit 3efe228

Please sign in to comment.