This forum is a read-only archive. Posting, replying and signing in are disabled.

AssetParam not working pyteal

ncoin

I need to run Assert(AssetParam.clawback(assetid) == verifiedaddr),, but it’s not working. Why is this?

✔ Solved by humblefool in post #6
humblefool

You need to pass assetId in foreign assets and then pass the index of it to AssetParam.

EX:
clawbackExpr = AssetParam.clawback(Int(0))
clawbackAddr = clawbackExpr.value()

make sure the assetId is passed in the foreign assets.

Here is the doc link:
clawbackExpr

ncoin

Thanks for your advice, but that’s what I have done so far - could you please explain what the value does and how to use it in an Assert?

ncoin

When I do Assert(AssetParam.clawback(assetid).value() == verifiedaddr), it throws the error pyteal.TealCompileError: Scratch slot load occurs before store. Thank you for your help so far.

humblefool
assetClawbackExpr = AssetParam.clawback(Int(0))
    assetClawbackAddr = Seq([
        assetClawbackExpr,
        assetClawbackExpr.value()
    ])
Assert(assetClawbackAddr == verifiedaddr)
✔ Solution