Leveraging Context Variables in ErgoScript
Context-dependent predicates add an extra layer of flexibility to ErgoScript contracts. Consider the following script that can be spent by anyone, but only if the current block height is less than 4,000,000:
HEIGHT < 4000000This script maps to the address
2Z4YBkDsDvQj8BX7xiySFewjitqp2ge9c99jfes2whbtKitZTxdBYqbrVZUvZvKv6aqn9by4kp3LE1c26LCyosFnVnki6rKyTNwYX.Beyond
HEIGHT, there are other context variables available such as OUTPUTS, INPUTS, and minerPubKey.