@steve_kite in ton-compiler, how can I add a fift library during compilation for a contract? My code requires TonUtil.fif but since its missing compileFunc fails.
Jan 17, 2023, 12:04 PM
what is impossible
the ton-compiler error or impossible to add such lib
i only need Gram, which is defined in TonUtil.fif, and ton-compiler gives me error
Jan 17, 2023, 12:07 PM
Isn't it Gram without comma, word that pushes 10^9 to the stack?
Jan 17, 2023, 12:08 PM
yes, but i need Gram,
Jan 17, 2023, 12:09 PM
Well, I see definition of Gram, as well. Have you included TonUtil.fif in your file?
If it still doesn't work, you could try to add instruction definition to your main.fif:
{ -1 { 1+ 2dup 8 * ufits } until
rot over 4 u, -rot 8 * u, } : Gram,
If it still doesn't work, you could try to add instruction definition to your main.fif:
{ -1 { 1+ 2dup 8 * ufits } until
rot over 4 u, -rot 8 * u, } : Gram,
Jan 17, 2023, 12:12 PM
as I wrote above, the problem is that ton-compiler doesnt include it and compilation fails
im adding definition manually but the code wont be so readable
Jan 17, 2023, 12:12 PM
"TonUtil.fif" include
Jan 17, 2023, 12:13 PM
No, this works only to output. The problem is that toncompiler runs fift for checking and doesn't output anything if it fails
it works but its really a bad idea for readability
Jan 17, 2023, 12:20 PM