Hi guys!
I have the same predicate code as OTC swap in my project
It uses the same way to define constants in forc.toml
as OTC sway
But after updating my forc to v0.37.0 it does not build with an error
error
--> /Users/alexey/projects/fuel/limit_orders/services/predicate-orders-builder/order-template/src/main.sw:28:16
|
26 |
27 | const ASK_TOKEN = ContractId {
28 | value: ASK_TOKEN_CONFIG,
| ^^^^^^^^^^^^^^^^ Variable "ASK_TOKEN_CONFIG" does not exist in this scope.
29 | };
30 | const RECEIVER = Address::from(RECEIVER_CONFIG);
|
____
error
--> /Users/alexey/projects/fuel/limit_orders/services/predicate-orders-builder/order-template/src/main.sw:30:36
|
28 |
29 | };
30 | const RECEIVER = Address::from(RECEIVER_CONFIG);
| ^^^^^^^^^^^^^^^ Variable "RECEIVER_CONFIG" does not exist in this scope.
31 |
32 | // Check if the transaction contains a single input coin from the receiver, to cancel their own order (in addition to this predicate)
|
____
error
--> /Users/alexey/projects/fuel/limit_orders/services/predicate-orders-builder/order-template/src/main.sw:58:36
|
56 |
57 | // Evaluate the predicate
58 | (to == RECEIVER) && (amount == ASK_AMOUNT) && (asset_id == ASK_TOKEN)
| ^^^^^^^^^^ Variable "ASK_AMOUNT" does not exist in this scope.
59 | }
|
____
Aborting due to 3 errors.
Error: Failed to compile swap-predicate
How to provide constants on forc v0.37.0?