Closed rkalis closed 10 months ago
After discussion on Telegram I realised that OP_INPUTINDEX OP_UTXOBYTECODE
only pushes the locking script (not the redeem script). While OP_ACTIVEBYTECODE
pushes the redeem script. So I'll need to include OP_ACTIVEBYTECODE
support in the upcoming next
release. This makes the construction above slightly more tricky since I'll still have to account for the case with and without constructor args.
Now that CashTokens are live, I think the best way to do most state simulation is through NFT commitments. So I'll close this issue.
See comments in #98
We can add an
OP_CODESEPARATOR
between the constructor args and the bytecode. This should make it easier to make "state simulated" contracts. Since thenOP_ACTIVEBYTECODE
would always be the "base" bytecode, and we could add the "new" state in front of that.Example syntax (for a contract with name
ExampleContract
):Then the compiled output for
new ExampleContract(tx.locktime + 100, 1000)
will be something like this:We just need to figure out whether we can dynamically determine the VarInts and how to do that.