Commit 37fedc4
committed
Merge #200: Add the possibility to insert .args files for compiling complex contracts
3c384e1 Add the possibility to insert .args files for compiling complex contracts (Illia Kripaka)
Pull request description:
This pr adds `--args` field for compiling complex programs.
You can use the CLI to compile contracts such as those written in https://github.com/BlockstreamResearch/simplicity-contracts.
* add `--args` for `.args` file
* move default second witness file parameter to `--wit`
For example, arguments for `option.simf`
```json
{
"TAKER_FUNDING_START_TIME": {
"value": "1769163845",
"type": "u32"
}, "SETTLEMENT_ASSET_ID": {
"value": "0xa5502895799e276b4af246c821423b4ed5ec5e6b4e6df7a861606939d9a2fc38",
"type": "u256"
}, "FEE_BASIS_POINTS": {
"value": "0",
"type": "u64"
}, "EARLY_TERMINATION_END_TIME": {
"value": "1769163835",
"type": "u32"
}, "FILLER_PER_SETTLEMENT_COLLATERAL": {
"value": "11",
"type": "u64"
}, "INCENTIVE_BASIS_POINTS": {
"value": "1000",
"type": "u64"
}, "GRANTOR_SETTLEMENT_TOKEN_ASSET": {
"value": "0x1f58afc32aa70a012a9ebf30a543148be00aec1b371f9793a153c274acce2de5",
"type": "u256"
}, "COLLATERAL_ASSET_ID": {
"value": "0x6d521c38ec1ea15734ae22b7c46064412829c0d0579f0a713d1c04ede979026f",
"type": "u256"
},"FILLER_PER_SETTLEMENT_ASSET": {
"value": "110",
"type": "u64"
}, "FILLER_PER_PRINCIPAL_COLLATERAL": {
"value": "10",
"type": "u64"
}, "GRANTOR_SETTLEMENT_PER_DEPOSITED_ASSET": {
"value": "110",
"type": "u64"
}, "GRANTOR_PER_SETTLEMENT_COLLATERAL": {
"value": "11",
"type": "u64"
}, "ORACLE_PK": {
"value": "0x531fe6068134503d2723133227c867ac8fa6c83c537e9a44c3c5bdbdcb1fe337",
"type": "u256"
}, "GRANTOR_COLLATERAL_PER_DEPOSITED_COLLATERAL": {
"value": "1",
"type": "u64"
}, "SETTLEMENT_HEIGHT": {
"value": "0",
"type": "u32"
}, "FILLER_TOKEN_ASSET": {
"value": "0x3c3fe87795809f74ed54005e0e50395fdc3b2862048641f439bd4ba6ca009502",
"type": "u256"
},"GRANTOR_PER_SETTLEMENT_ASSET": {
"value": "110",
"type": "u64"
},"FEE_SCRIPT_HASH": {
"value": "0x0000000000000000000000000000000000000000000000000000000000000000",
"type": "u256"
}, "TAKER_FUNDING_END_TIME": {
"value": "1769163855",
"type": "u32"
}, "CONTRACT_EXPIRY_TIME": {
"value": "1769163865",
"type": "u32"
}, "STRIKE_PRICE": {
"value": "10",
"type": "u64"
},"GRANTOR_COLLATERAL_TOKEN_ASSET": {
"value": "0x1c01566a1e789e1a3f84c73b2c04352d30008eb30d905a0f22ba3e1a5a835b6f",
"type": "u256"
}
}
```
Partially related to these issues #196, #157.
PS
This PR does not intend to rewrite the CLI build using clap macros. It simply adds new functionality.
ACKs for top commit:
apoelstra:
ACK 3c384e1; successfully ran local tests
Tree-SHA512: f00d115384c891cf5abf24220012e16cff4971c519e6e6d8ec90983b8383c1f788f0e939c2a02c56d6980a804a0123d0d194ec953230cfd16cd87049a9d0f2f31 file changed
Lines changed: 37 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
50 | 60 | | |
51 | 61 | | |
52 | 62 | | |
| |||
69 | 79 | | |
70 | 80 | | |
71 | 81 | | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
80 | 108 | | |
81 | 109 | | |
82 | 110 | | |
| |||
0 commit comments