Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The policy validator tool is not working with NFTs minted with plutus scripts #14

Open
AngelCastilloB opened this issue Oct 19, 2021 · 1 comment
Labels
feature request New feature or request

Comments

@AngelCastilloB
Copy link

I am minting the NFTs of my project using the following Plutus minting policy script:

{-# INLINABLE mkNFTPolicy #-}
mkNFTPolicy :: TokenName -> TxOutRef -> BuiltinData -> ScriptContext -> Bool
mkNFTPolicy tn utxo _ ctx = traceIfFalse "UTxO not consumed"   hasUTxO           &&
                            traceIfFalse "wrong amount minted" checkMintedAmount
  where
    info :: TxInfo
    info = scriptContextTxInfo ctx

    hasUTxO :: Bool
    hasUTxO = any (\i -> txInInfoOutRef i == utxo) $ txInfoInputs info

    checkMintedAmount :: Bool
    checkMintedAmount = case flattenValue (txInfoMint info) of
        [(_, tn', amt)] -> tn' == tn && amt == 1
        _               -> False

For example, the output script for the following NFT:

https://pool.pm/b431bb2eb71bbf88c86da85e9eafa609cc62dd9efda2562f345f31ee.Horrocube00000

is as follows:

{"type":"PlutusScriptV1","description":"","cborHex":"590bea590be7010000333232323322333222332232333222333222333222333333332222222233223333322222333322223322332233223332223322332233223322332232323233223232323232323322323232323232323233223232323232323232323232323232323232323232323232323232323232323232223355038350030132232323303433023491115554784f206e6f7420636f6e73756d656400335503c335502b3035120012333503403c302300100630215001330234911357726f6e6720616d6f756e74206d696e746564005335350703024302050011300216221353555029002222533535075004133039333503802f00200b333503802e00148008884c024584c0f000881a848888c014cc00cc010008c01800494cd4c18c00441a04d4060d4c19ccd5ce2481025064000684988c8c8c8c8c8c8cccd5cd19b8735573aa00a90001280112803a4c266078a002a0042600c6ae8540084c050d5d09aba25001135573ca00226ea80084d405d262323232323232323232323232323232323232323232323333573466e1cd55cea80aa40004a0044a02e9309999999999826a800a8012801a8022802a8032803a8042804a805099a81080b1aba15012133502001635742a0202666aa032eb94060d5d0a8070999aa80c3ae501735742a018266a03a0426ae8540284cd4070cd54078085d69aba15008133501675a6ae8540184cd4069d71aba150041335019335501b75c0346ae8540084c080d5d09aba25001135744a00226ae8940044d5d1280089aba25001135744a00226ae8940044d5d1280089aba25001135573ca00226ea80084d40592623232323232323333573466e1cd55cea802a40004a0044a00e9309981f2800a8010980b9aba1500213005357426ae8940044d55cf280089baa0021350154988c8c8c8c8c8c8c8c8cccd5cd19b8735573aa00e90001280112804a4c2666082a002a004a006260106ae8540104ccd54029d728049aba15002133500775c6ae84d5d1280089aba25001135573ca00226ea80084d40512623232323232323333573466e1cd55cea802a40004a0044a00e930998202800a8010980a1aba150021335005012357426ae8940044d55cf280089baa002135013498488c8c8c8c8c8c8cccd5cd19b87500448000940089401126135043500113006357426aae79400c4cccd5cd19b87500148008941049401126135573aa00226ea80084d404d261335500175ceb444888c8c8c004dd58019a80090008918009aa83491191919191919191999aab9f0085506a2530021200106c350022200135001220023555507012223300321300a357440124266a0dea00aa600624002266aa0daa002a004260106aae7540084c018d55cf280089aba10011223232323232323333573466e1cd55cea802a40004a0044a00e93099a8212800a801099a8038031aba150021335007005357426ae8940044d55cf280089baa002135010498488c8c8c8c8c8c8cccd5cd19b8735573aa00a90001280112803a4c266a08aa002a004266a01000c6ae8540084c020d5d09aba25001135573ca00226ea80084d403d261223232323232323333573466e1cd55cea802a40004a0044a00e93099a8212800a801099a8038031aba1500213007357426ae8940044d55cf280089baa00213500e498488c8c8c8c8c8c8c8cccd5cd19b8750054801094120940092613333573466e1d4011200225002250044984d411d40044c018d5d09aab9e500313333573466e1d4005200025045250044984d55cea80089baa00213500d4988c8c8c8cccd5cd19b875002480088170940092613333573466e1d40052000205a250034984d55ce9baa00213500b498488c8c8c004dd60019a80090008918009aa831111999aab9f00125062233506130063574200460066ae88008178800444888c8c8c8c8c8c8cccd5cd19b8735573aa00a90001280112803a4c266aa0c8a002a0042600e6ae8540084c014d5d09aba25001135573ca00226ea80084d402926232323232323232323232323232323333573466e1d4029200625002250044984c13940044c038d5d09aab9e500b13333573466e1d401d200425002250044984c12540044c030d5d09aab9e500813333573466e1d4011200225002250044984c11540044c02cd5d09aab9e500513333573466e1d4005200025003250064984d55cea80189821a80089bae357426aae7940044dd500109a803a4c4646464646464646464646464646464646464646464646464646666ae68cdc3a80aa401840c04a0049309999ab9a3370ea028900510301280124c26666ae68cdc3a809a40104a0044a00c9309982d2800a80109bae35742a00426eb4d5d09aba25001135573ca02426666ae68cdc3a8072400c4a0044a00c9309982b2800a80109bae35742a00426eb8d5d09aba25001135573ca01a26666ae68cdc3a804a40084a0044a00c9309982aa800a801098069aba150021375c6ae84d5d1280089aab9e500813333573466e1d4011200225002250044984c14540044c020d5d09aab9e500513333573466e1d4005200025003250064984d55cea80189825a800898021aba135573ca00226ea80084d40192623232323232323232323232323333573466e1d4021200225002250084984ccc15940054009400c4dd69aba150041375a6ae8540084dd69aba135744a00226ae8940044d55cf280289999ab9a3370ea0029000128019280324c26aae75400c4c13d40044c010d5d09aab9e50011375400426a00a93119191919191919191999ab9a3370ea0089001128011280224c260a8a00226eb8d5d09aab9e500513333573466e1d4005200025003250064984d55cea80189828a80089bae357426aae7940044dd500109a80224c46464646464646666ae68cdc39aab9d500548000940089401d26133044500150021300635742a00426eb4d5d09aba25001135573ca00226ea80084d400d2623232323333573466e1cd55cea801240004a0044a0089309bae357426aae7940044dd500109a80124c24c46a6042002444444444400e46a6040002444444444401446a60420024400444a66a60920022096266ae700081288d4008488ccd5401488d4d5415000888ccd5402488d4d54160008894cd4c144ccd5cd19b870014800014c148400c4cc028ccd55403c01800800400c00c00400400c48cd4005413541384488c8c8004d4004800448c004d54148894cd4d413c0044010884cc01c008c01000444488848ccc00401000c008444800488ccd5cd19b8700200104504422333573466e3c00800411010c448c88cd5400d40080044d4009401448cd403c88ccd401400c008004d400800448d4d40140048800448d4d4010004880084cd400c0040f0894cd4c0f000840f8400448848cc00400c0084800448004894cd4c0e0008400440e4d4004800448c004d5410088448c8894cd4d41040044d4020010884cd4014c010008ccd54c020480040180100044d401800448d4d400c0048800448d4d40080048800848848cc00400c00848004894cd4c0c4ccd5cd19b8f35302100222002353021001220020330321333573466e1cd4c08400888004d4c084004880040cc0c840c84488c0080048d4c008004880088848cc00400c0088004888888888848cccccccccc00402c02802402001c01801401000c00880048848cc00400c008800488848ccc00401000c00880048848cc00400c008800448488c00800c44880044800448848cc00400c0084800448848cc00400c0084800448848cc00400c00848004484888c00c010448880084488800448004848888c010014848888c00c014848888c008014848888c00401480048848cc00400c0088004848888888c01c0208848888888cc018024020848888888c014020488888880104888888800c8848888888cc0080240208848888888cc00402402080048488c00800c888488ccc00401401000c80048488c00800c8488c00400c8004488008488004800444940184800480044488008488488cc00401000c48004448848cc00400c008448004448c8c00400488cc00cc00800800444448cd4008848cc0048d400c88c00800c8d400c88c00400c00448c8c8c00400488cc00cc0080080048848d4c01048d4c01000cd400c00400522010e486F72726F637562653030303030003322330024892000f825ada869a5379362af53d0f859882ba10053d4aa4821b5f01d3739c684c900480008848cc00400c0088005"}

Running the following command:

cardano-cli transaction policyid --script-file script.plutus

Where script.plutus is a file with the previous policy script as content returns:

b431bb2eb71bbf88c86da85e9eafa609cc62dd9efda2562f345f31ee

Which matches the policy id listed on the website:

https://pool.pm/policy/b431bb2eb71bbf88c86da85e9eafa609cc62dd9efda2562f345f31ee

However, if I try to place the script in the text box when the website immediately rejects it as "invalid policy".

@AngelCastilloB AngelCastilloB changed the title The policy validator tool is not working with NFTs mintedwith plutus scripts The policy validator tool is not working with NFTs minted with plutus scripts Oct 19, 2021
@SmaugPool SmaugPool added bug Something isn't working feature request New feature or request labels Oct 21, 2021
@SmaugPool
Copy link
Owner

Policies with PlutusScriptV1 scripts are not supported yet indeed.

Thank you for reporting.

@SmaugPool SmaugPool removed the bug Something isn't working label Jun 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants