I copied the Plutus starter template, Plutus Platform starter project, and created a file, BasicPlutusTx.hs
(and added it under exposed-modules
in the .cabal
file).
Then I started copying over all the code from the introductory tutorial, Using Plutus Tx.
When I added the code,
functions :: CompiledCode Integer
functions = $$(compile [|| myProgram ||])
it caused Visual Studio Code to complain, giving an error at the top of the file:
Program error: GHC Core to PLC plugin: E043:Error: Reference to a name which is not a local, a builtin, or an external INLINABLE function: Variable PlutusTx.Builtins.addInteger
No unfolding
Context: Compiling expr: PlutusTx.Builtins.addInteger
Context: Compiling expr: PlutusTx.Builtins.addInteger
(PlutusTx.Builtins.addInteger 1 1)
Context: Compiling expr: PlutusTx.Builtins.addInteger
(PlutusTx.Builtins.addInteger 1 1) (BasicPlutusTx.plusOne 1)
Context: Compiling definition of: BasicPlutusTx.myProgram
Context: Compiling expr: BasicPlutusTx.myProgram
Context: Compiling expr at "main:BasicPlutusTx:(76,16)-(76,41)"compile
However, cabal build
still works.
nix-shell
and then callingcode
from there