How does PlutusTx target plutus core?

https://plutus.readthedocs.io/en/latest/plutus/tutorials/plutus-tx.html https://playground.plutus.iohkdev.io/tutorial/haddock/plutus-tx/html/Language-PlutusTx.html

The compile function produces CompiledCode.

Plutus Core can be extracted from that using getPlc.

Trying it out

  1. Clone plutus-starter
  2. We are going to compile Plutus.Contracts.Game. You can find it in examples/src/Plutus/Contract/Game.hs.
  3. Since it is available as a library we can import it. The on-chain parts are indicated by PlutusTx.compile. These are the validateGuess, wrap. For now we will try validateGuess.