ScorexFoundation / sigmastate-interpreter

ErgoScript compiler and ErgoTree Interpreter implementation for Ergo blockchain
MIT License
62 stars 40 forks source link

GetVar(inputIndex, varId) variant for reading context variable from another input #983

Open kushti opened 3 months ago

kushti commented 3 months ago

In addition to current GetVar(varId) to get input context variable, it is worth to have GetVar(inputIndex, varId) variant for reading context variable from another input. This could be useful for sharing proofs and state ids across inputs.

I think new GetVar variant should be implemented as a method call (only), avoiding introducing new opcodes (so new Context.getInputVar[T](inputIndex: Short, varId: Byte) method.