1
1
# how to
2
2
3
+ ## deploy an oracle adapter
4
+
5
+ ``` sh
6
+ QUESTION_TIMEOUT=3600 \
7
+ MIN_BOND=100000000000000 \
8
+ forge script script/DeployFlatCFMRealityAdapter.s.sol \
9
+ --rpc-url $RPC_URL \
10
+ --broadcast \
11
+ --sender $ADDRESS \
12
+ --private-key $PRIVATE_KEY
13
+ ```
14
+
3
15
## deploy a factory
4
16
5
17
``` sh
@@ -8,20 +20,22 @@ export CONDITIONAL_TOKENS=0xabcd...
8
20
export WRAPPED1155_FACTORY=0x9999...
9
21
forge script script/DeployFlatCFMFactory.s.sol:DeployFlatCFMFactory \
10
22
--rpc-url $RPC_URL \
11
- --private-key $PRIVATE_KEY \
12
- --broadcast
23
+ --broadcast \
24
+ --sender $ADDRESS \
25
+ --private-key $PRIVATE_KEY
13
26
```
14
27
15
28
## deploy a new Flat CFM
16
29
17
30
### using a block explorer
18
31
19
- 1 . Locate the FlatCFMFactory page on the block explorer.
20
- 2 . Connect your wallet.
21
- 3 . Enter fileds.
22
- 4 . Submit and send transaction.
32
+ First deploy the Flat CFM instance:
33
+
34
+ ![ create-flatcfm] ( img/create-flatcfm.png )
35
+
36
+ Then deploy each Conditional Scalar Market, one per outcome:
23
37
24
- ![ factory- create.png ] ( img/factory- create.png .png )
38
+ ![ create-csm ] ( img/create-csm .png )
25
39
26
40
27
41
### using a config file
@@ -31,28 +45,31 @@ First, define a config file (by default, use `./flatcfm.config.json`), like
31
45
``` json
32
46
{
33
47
"factoryAddress" : " 0x1234567890abcdef1234567890abcdef12345678" ,
34
- "roundName" : " Demo Round" ,
35
- "outcomeNames" : [" Project A" , " Project B" ],
36
- "openingTimeDecision" : 1680000000 ,
37
- "metricName" : " Rainfall (mm)" ,
38
- "startDate" : " 2024-05-01" ,
39
- "endDate" : " 2024-05-15" ,
48
+ "oracleAdapterAddress" : " 0x1234567890abcdef1234567890abcdef12345678" ,
49
+ "decisionTemplateId" : 24 ,
50
+ "metricTemplateId" : 42 ,
51
+ "collateralToken" : " 0x1234567890abcdef1234567890abcdef12345678" ,
52
+ "outcomeNames" : [
53
+ " Project A" ,
54
+ " Project B" ,
55
+ " Project C" ,
56
+ " Project D"
57
+ ],
58
+ "openingTimeDecision" : 1737111600 ,
40
59
"minValue" : 0 ,
41
- "maxValue" : 200 ,
42
- "openingTimeMetric" : 1681000000 ,
43
- "collateralToken" : " 0x1234567890abcdef1234567890abcdef12345678"
44
- }
60
+ "maxValue" : 100 ,
61
+ "openingTimeMetric" : 1737457200 ,
62
+ "metadataUri" : " ipfs://1234"
45
63
```
46
64
47
65
then run
48
66
49
67
```sh
50
- export FACTORY_ADDRESS=0x1234β¦
51
- export MARKET_CONFIG_FILE=./somewhere/flatcfm.config.json
52
- forge script script/CreateFlatCFMFromConfig.s.sol:CreateFlatCFMFromConfig \
68
+ forge script script/CreateFlatCFMFromConfig.s.sol \
53
69
--rpc-url $RPC_URL \
54
- --private-key $PRIVATE_KEY \
55
- --broadcast
70
+ --broadcast \
71
+ --sender $ADDRESS \
72
+ --private-key $PRIVATE_KEY
56
73
```
57
74
58
75
# conditional funding markets (CFM)
@@ -65,7 +82,7 @@ The mechanism implemented here is a simplified version of
65
82
66
83
## design
67
84
68
- ` FlatCFM ` represents the condition of funding. It's a market but it won't
85
+ `FlatCFM` represents the condition of funding. It is a market but it won't
69
86
be traded. It creates a `ConditionalScalarMarket` for each outcome it has (apart
70
87
from the special "Invalid" outcome, see below). It prepares an oracle question
71
88
and condition (as in `ConditionalTokens`) during construction.
0 commit comments