Skip to content

Commit 2b1a008

Browse files
committed
add: libs and readme
1 parent 7f37e00 commit 2b1a008

File tree

6 files changed

+35
-109
lines changed

6 files changed

+35
-109
lines changed

README.md

Lines changed: 22 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,37 @@
1-
## Foundry
1+
# 📈 PolySwap Smart Contracts
22

3-
**Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.**
3+
**Automated DeFi swaps triggered by on-chain prediction market outcomes.**
44

5-
Foundry consists of:
5+
This repository contains the core smart contracts of **PolySwap**, a protocol that allows users to create conditional swap intents based on prediction markets like [Polymarket](https://polymarket.com/).
66

7-
- **Forge**: Ethereum testing framework (like Truffle, Hardhat and DappTools).
8-
- **Cast**: Swiss army knife for interacting with EVM smart contracts, sending transactions and getting chain data.
9-
- **Anvil**: Local Ethereum node, akin to Ganache, Hardhat Network.
10-
- **Chisel**: Fast, utilitarian, and verbose solidity REPL.
7+
## 🛠️ What It Does
118

12-
## Documentation
9+
PolySwap lets users define CoW Swap orders that become valid only when a specific prediction market condition is met.
10+
The contract checks the status of a Polymarket order and activates the swap only if that order has been fully filled (indicating the prediction condition was reached).
1311

14-
https://book.getfoundry.sh/
12+
## 🧱 Contract Overview (not finished yet)
1513

16-
## Usage
14+
* `IConditionalOrderGenerator`: Interface for condition-based CoW Swap orders.
15+
* `PolySwapOrderVerifier`: Verifies whether the Polymarket condition (order filled) is satisfied.
1716

18-
### Build
17+
The core logic uses the Polymarket `CTFExchange` contract to check if:
1918

20-
```shell
21-
$ forge build
22-
```
19+
* the order is filled or cancelled, and
20+
* the remaining amount is `0`.
2321

24-
### Test
22+
## 🧪 Stack
2523

26-
```shell
27-
$ forge test
28-
```
24+
* [Solidity](https://soliditylang.org)
25+
* [Foundry](https://book.getfoundry.sh/) for development and testing
26+
* [Polygon PoS](https://polygon.technology) as the initial deployment network
2927

30-
### Format
28+
## 🚀 Deployment
3129

32-
```shell
33-
$ forge fmt
34-
```
30+
All contracts are deployed on **Polygon** for compatibility with Polymarket's on-chain infrastructure.
3531

36-
### Gas Snapshots
32+
Contract Address: `0xdeadbeef`
3733

38-
```shell
39-
$ forge snapshot
40-
```
34+
## 🧑‍💻 Authors
4135

42-
### Anvil
43-
44-
```shell
45-
$ anvil
46-
```
47-
48-
### Deploy
49-
50-
```shell
51-
$ forge script script/Counter.s.sol:CounterScript --rpc-url <your_rpc_url> --private-key <your_private_key>
52-
```
53-
54-
### Cast
55-
56-
```shell
57-
$ cast <subcommand>
58-
```
59-
60-
### Help
61-
62-
```shell
63-
$ forge --help
64-
$ anvil --help
65-
$ cast --help
66-
```
36+
| [<img src="https://github.com/Intermarch3.png?size=85" width=85><br><sub>Lucas Leclerc</sub>](https://github.com/Intermarch3) | [<img src="https://github.com/Pybast.png?size=85" width=85><br><sub>Baptiste Florentin</sub>](https://github.com/Pybast)
37+
| :---: | :---: |

remappings.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1-
@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/
1+
@openzeppelin/=lib/composable-cow/lib/@openzeppelin/
2+
composable-cow/=lib/composable-cow/
3+
cowprotocol/=lib/composable-cow/lib/cowprotocol/src/
4+
ds-test/=lib/composable-cow/lib/forge-std/lib/ds-test/src/
25
erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/
36
forge-std/=lib/forge-std/src/
47
halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/
8+
murky/=lib/composable-cow/lib/murky/src/
59
openzeppelin-contracts/=lib/openzeppelin-contracts/
10+
openzeppelin/=lib/composable-cow/lib/@openzeppelin/contracts/
11+
safe/=lib/composable-cow/lib/safe/

script/Counter.s.sol

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/Counter.sol

Lines changed: 0 additions & 14 deletions
This file was deleted.

src/Polyswap.sol

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// SPDX-License-Identifier: UNLICENSED
2+
pragma solidity >=0.8.0 <0.9.0;
3+
4+
contract Polyswap {
5+
6+
}

test/Counter.t.sol

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)