ionio-lang / ivy-elements

Fork of Ivy Language to write Elements Smart Contracts
https://ionio-lang.org
MIT License
0 stars 3 forks source link

Add introspection opcodes #13

Open altafan opened 2 years ago

altafan commented 2 years ago

Opcodes to retrieve info about the transaction:

Previously OP_SUCCESS199-OP_SUCCESS214.

tiero commented 2 years ago

Suggest how each of them should look like in terms of syntax on the high level, plus how you see it divided on ast level and parsing, some of them are "nullary" expressions, others "unary" and maybe some other can be "call" expressions

tiero commented 2 years ago

Some opcode is returning/populating more than one element on the stack, like OP_INSPECTOUTPUTASSET push 2 elements in the stack for example or OP_INSPECTINPUTISSUANCE pushes 4 elements

This needs tweaking to the createTypeSignature function that now only returns a single Type.

Returing a tuple may be ok for two elements (ie. OP_INSPECTOUTPUTASSET) but looks like OP_INSPECTINPUTISSUANCE should return a vector/struct/object type.