|
1 | | -## Foundry |
| 1 | +# 📈 PolySwap Smart Contracts |
2 | 2 |
|
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.** |
4 | 4 |
|
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/). |
6 | 6 |
|
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 |
11 | 8 |
|
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). |
13 | 11 |
|
14 | | -https://book.getfoundry.sh/ |
| 12 | +## 🧱 Contract Overview (not finished yet) |
15 | 13 |
|
16 | | -## Usage |
| 14 | +* `IConditionalOrderGenerator`: Interface for condition-based CoW Swap orders. |
| 15 | +* `PolySwapOrderVerifier`: Verifies whether the Polymarket condition (order filled) is satisfied. |
17 | 16 |
|
18 | | -### Build |
| 17 | +The core logic uses the Polymarket `CTFExchange` contract to check if: |
19 | 18 |
|
20 | | -```shell |
21 | | -$ forge build |
22 | | -``` |
| 19 | +* the order is filled or cancelled, and |
| 20 | +* the remaining amount is `0`. |
23 | 21 |
|
24 | | -### Test |
| 22 | +## 🧪 Stack |
25 | 23 |
|
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 |
29 | 27 |
|
30 | | -### Format |
| 28 | +## 🚀 Deployment |
31 | 29 |
|
32 | | -```shell |
33 | | -$ forge fmt |
34 | | -``` |
| 30 | +All contracts are deployed on **Polygon** for compatibility with Polymarket's on-chain infrastructure. |
35 | 31 |
|
36 | | -### Gas Snapshots |
| 32 | +Contract Address: `0xdeadbeef` |
37 | 33 |
|
38 | | -```shell |
39 | | -$ forge snapshot |
40 | | -``` |
| 34 | +## 🧑💻 Authors |
41 | 35 |
|
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 | + | :---: | :---: | |
0 commit comments