Skip to content

Commit

Permalink
Release Dev PRs (2024-05-23) (#26)
Browse files Browse the repository at this point in the history
Co-authored-by: aquariuslt <superaquariuslt@gmail.com>
Co-authored-by: SocLu <95464121+SocratesLu@users.noreply.github.com>
  • Loading branch information
3 people authored May 23, 2024
1 parent 7cbd554 commit ec4700e
Show file tree
Hide file tree
Showing 41 changed files with 2,406 additions and 1,337 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/analyze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,3 @@ jobs:
uses: crytic/slither-action@v0.4.0
continue-on-error: true
id: slither
with:
target: 'contracts/'
32 changes: 32 additions & 0 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
on: [ push, pull_request, workflow_dispatch ]

name: integration-test

jobs:
integration-test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 18 ]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: yarn
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
- id: forge_test
run: forge test -vvv --mc BaseIntegrationTest --fork-url https://mainnet.optimism.io
- name: income simulator
run: mkdir reports && forge test -vv --mp "test/integration/IncomeSimulator.t.sol" --fork-url https://mainnet.optimism.io
continue-on-error: true
- name: Archive Simulator Report
uses: actions/upload-artifact@v4
with:
name: income-simulator-report
path: |
reports/*.txt
24 changes: 24 additions & 0 deletions .github/workflows/invariant-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
on: [ workflow_dispatch ]

name: invariant-test

jobs:
invariant-test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 18 ]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: yarn
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
- id: forge_test
run: forge test -vvv --mc BaseInvariantTest --fork-url https://optimism.llamarpc.com/sk_llama_115e7405eff4c29287d6ff9a0275bf84
continue-on-error: true

5 changes: 2 additions & 3 deletions .github/workflows/summary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@ jobs:
summary:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Run Slither
uses: crytic/slither-action@v0.4.0
continue-on-error: true
id: slither
with:
target: 'src/'
slither-config: 'slither.config.json'
slither-args: '--filter-paths src/test --print contract-summary'
slither-args: '--print contract-summary'
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ jobs:
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
- name: Cache fork requests
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.foundry/cache
key: "${{ runner.os }}-foundry-network-fork-${{ github.sha }}"
restore-keys: |
${{ runner.os }}-foundry-network-fork-
- id: forge_test
run: forge test --fork-url https://mainnet.optimism.io
run: forge test -vvv --mp "test/unit/*.sol" --fork-url https://mainnet.optimism.io
continue-on-error: true
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@ node_modules
.vscode
.DS_Store
coverage.json
lcov.info
lcov.info

report.txt
reports
27 changes: 7 additions & 20 deletions .solhint.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,19 @@
"extends": "solhint:recommended",
"rules": {
"avoid-low-level-calls": "off",
"code-complexity": [
"error",
8
],
"compiler-version": [
"error",
">=0.8.19"
],
"code-complexity": ["error", 8],
"compiler-version": ["error", ">=0.8.19"],
"contract-name-camelcase": "off",
"const-name-snakecase": "off",
"custom-errors": "off",
"func-name-mixedcase": "off",
"func-visibility": [
"error",
{
"ignoreConstructors": true
}
],
"max-line-length": [
"error",
123
],
"func-visibility": ["error", { "ignoreConstructors": true }],
"max-line-length": ["error", 123],
"named-parameters-mapping": "warn",
"no-empty-blocks": "off",
"not-rely-on-time": "off",
"one-contract-per-file": "off",
"var-name-mixedcase": "off"
"var-name-mixedcase": "off",
"gas-custom-errors": "off",
"no-console": "off"
}
}
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"editor.formatOnSave": true,
"editor.formatOnSave": false,
"[solidity]": {
"editor.defaultFormatter": "JuanBlanco.solidity"
},
"solidity.formatter": "forge",
"solidity.compileUsingRemoteVersion": "v0.8.25+commit.b61c2a91",
}
83 changes: 53 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,25 @@
<pre align="center">
<em></em>
<img src="images/banner.png" width="300">
<em></em>
<em>A NEW WAY TO PAY.</em>
<em>Payment via the bonding curve and yield farming.</em>
<em></em>
</pre>

Mest, **a payment protocol designed for creators**. And it's a bridge between creators and fans, where fans can **donate, sponsor, subscribe**, etc. The contract provides a new way to pay where you can stake ETH by a **sigmoid bonding curve** and **yield farming**, buy what you need, and withdraw whenever you want.

- 🐦 For fans, pay early and save more;
- 💵 For creators, long-term income from fees and yield;
- ⚡ Lightweight with flexible curve and yield strategies;
- 🌟 Made for creators like startups, indie hackers and KOLs.
<samp>
<sub><em>Value4Value</em></sub>

<div align="center">

| Features | Mest | FriendtechV1 | Patreon | Coinbase Commerce |
| ------------------ | ----- | ------------ | ------- | ----------------- |
| User Capacity | > 10K | < 100 | N/A | N/A |
| Capital efficiency |||||
| Permissionless |||||
| Tokenization |||||
<div align="center">
<br />
<em>A NEW WAY TO PAY.</em> <br />
<em>Payment via the bonding curve and yield farming.</em>
<br />
</div>
</samp>

##

**A payment protocol designed for creators**, it bridges the gap between creators and fans, where fans can **donate, sponsor, subscribe**, and more, while creators receive **fees and yield**.

- For fans, pay early and earn more;
- For creators, long-term income from fees and yield;
- Lightweight with flexible curve and yield strategies;
- No protocol fee, any client can be charged via referral fee;
- Stake what you need, and withdraw when you want;
- Made for creators like startups, indie hackers and KOLs.

</div>

## How it works?

The contract uses a sigmoid bonding curve for dynamic pricing. When you buy, it mints tokens and drives prices up, then when you sell, it burns tokens and drives prices down. The staked ETH is allocated in an interest-rate market to generate sustainable rewards, which are then redistributed to the creators.
Expand All @@ -33,19 +28,47 @@ The contract uses a sigmoid bonding curve for dynamic pricing. When you buy, it
<img src="images/curve.gif" width="80%">
</div>

## Contracts
## Why it is better?
<div align="center">

| Features | V4V | Friendtech | Patreon | Coinbase Commerce |
|--------------------|-------|------------|---------|-------------------|
| Flexible strategy | ★★★★★ | ★★★☆☆ | ★★★☆☆ | ★☆☆☆☆ |
| Capital efficiency | ★★★☆☆ | ★☆☆☆☆ | ★☆☆☆☆ | ★☆☆☆☆ |
| Permissionless | ★★★★★ | ★★★★★ | ☆☆☆☆☆ | ★★★☆☆ |
| Tokenization | ★★★★★ | ★★★☆☆ | ☆☆☆☆☆ | ☆☆☆☆☆ |
| Protocol Fee | ★★★★☆ | ★★☆☆☆ | ★☆☆☆☆ | ★★★☆☆ |

</div>

## Smart Contracts

### NFT

The token is a standard ERC1155 contract, with NFTs acting as shares in the bonding curve. When you trade shares, NFTs are minted or burned.
> The token is a standard ERC1155 contract, with NFTs acting as shares in the bonding curve. When you trade shares, NFTs are minted or burned.
| Network | Address |
|------------------|--------------------------------------------|
| Optimism Mainnet | N/A |
| Optimism Sepolia | 0x07cB2490DfBFd63613318F87156D935ddAcb62F4 |

### Shares

SharesFactory is the core contract that contains the bonding curve and yield aggregator logic where you can mint, buy, and sell shares, as well as change yield strategies and claim yields.
> SharesFactory is the core contract that contains the bonding curve and yield aggregator logic where you can mint, buy, and sell shares, as well as change yield strategies and claim yields.
| Network | Address |
|------------------|--------------------------------------------|
| Optimism Mainnet | N/A |
| Optimism Sepolia | 0x5F31921A68eA5b350baF141536933Cc7d70EBAEa |

### Yield

YieldAggregator is a yield strategy contract that provides a common interface for SharesFactory to use, such as deposit, withdraw, and claimable. However, the underlying logic can be any yield strategy, such as Aave, Pendle and LRT, or nothing at all.
> YieldAggregator is a yield strategy contract that provides a common interface for SharesFactory to use, such as deposit, withdraw, and claimable. However, the underlying logic can be any yield strategy, such as Aave, Pendle and LRT, or nothing at all.
| Network | Address |
|------------------|--------------------------------------------|
| Optimism Mainnet | N/A |
| Optimism Sepolia | 0x2c1414c3F442AA7a4E531E2891009Dd1a8744b59 |

## Test and Deploy

Expand All @@ -65,4 +88,4 @@ deploy

## Acknowledgement

Thanks to [Simon de la Rouviere](https://docs.google.com/document/d/1VNkBjjGhcZUV9CyC0ccWYbqeOoVKT2maqX0rK3yXB20), whose ideas inspired Mest to combine curated market with bonding curves, and to the ideal S-curve model from [sound protocol](https://github.com/soundxyz/sound-protocol), we’ve also learned the principle of minimalism from [friend tech](https://www.friend.tech) and [bodhi](https://bodhi.wtf).
Thanks to [Simon de la Rouviere](https://docs.google.com/document/d/1VNkBjjGhcZUV9CyC0ccWYbqeOoVKT2maqX0rK3yXB20), whose ideas inspired *V4V* to combine curated market with bonding curves, and to the ideal S-curve model from [sound protocol](https://github.com/soundxyz/sound-protocol), we’ve also learned the principle of minimalism from [friend tech](https://www.friend.tech) and [bodhi](https://bodhi.wtf).
Loading

0 comments on commit ec4700e

Please sign in to comment.