0

I'm using the latest Plutus-Stater project with this script

module FreeMinting where

import           Control.Monad          hiding (fmap)
import           Data.Aeson             (ToJSON, FromJSON)
import           Data.Text              (Text)
import           Data.Void              (Void)
import           GHC.Generics           (Generic)
import           Plutus.Contract        as Contract
import           Plutus.Trace.Emulator  as Emulator
import qualified PlutusTx
import           PlutusTx.Prelude       hiding (Semigroup(..), unless)
import           Ledger                 hiding (mint, singleton)
import           Ledger.Constraints     as Constraints
import qualified Ledger.Typed.Scripts   as Scripts
import           Ledger.Value           as Value
import           Playground.Contract    (printJson, printSchemas, ensureKnownCurrencies, stage, ToSchema)
import           Playground.TH          (mkKnownCurrencies, mkSchemaDefinitions)
import           Playground.Types       (KnownCurrency (..))
import           Prelude                (IO, Show (..), String)
import           Text.Printf            (printf)
import           Wallet.Emulator.Wallet

--ON-CHAIN

{-# INLINABLE freeMintingPolicy #-}
freeMintingPolicy :: () -> ScriptContext -> Bool
freeMintingPolicy _ _ = True

policy :: Scripts.MintingPolicy
policy = mkMintingPolicyScript $$(PlutusTx.compile [|| Scripts.wrapMintingPolicy freeMintingPolicy ||]) --unTypedValidator

curSymbol :: CurrencySymbol --aka PolicyID
curSymbol = scriptCurrencySymbol policy 

But now scriptCurrencySymbol does not exists

Any tips on its substitute?

1 Answer 1

0

You should use

import Plutus.Script.Utils.V1.Scripts qualified as Scripts

-- ...

curSymbol = Scripts.scriptCurrencySymbol policy 

You need to modify the cabal.project file to use v0.1.0 of plutus-apps which has Plutus.Script.Utils.V1.Scripts module

-- Plutus apps revision from 2022-04-06
source-repository-package
  type: git
  location: https://github.com/input-output-hk/plutus-apps.git
  tag: v0.1.0

Ref: Plutus.Script.Utils.V1.Scripts code

2
  • thanks a lot... still trying to get how documentation works with Cardano/Plutus ;) Sep 22 at 9:17
  • my solution is copy the function which is not existed, and search on input-output-hk github (scope organization). There is some commit or code related to the function we need. in this case the function is scriptCurrencySymbol, then we infer to the correct module ;)
    – Kỳ Anh
    Sep 22 at 9:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.