How can i create a smart contract (Teal Version = 6) in algorand sandbox

Hello, bros!
I use pyTeal to write smart contract code, and i compile it to .teal file.
I’m try to use this teal file to create application in sandbox(dev).
But, this console log this following information:

data/core/approval.teal: 1: unsupported version: 6
/data/core/approval.teal: 2: field "ApplicationID" available in version 2. Missed #pragma version?
/data/core/approval.teal: 6: field "OnCompletion" available in version 2. Missed #pragma version?
/data/core/approval.teal: 10: field "OnCompletion" available in version 2. Missed #pragma version?
/data/core/approval.teal: 14: field "OnCompletion" available in version 2. Missed #pragma version?
/data/core/approval.teal: 18: field "OnCompletion" available in version 2. Missed #pragma version?
/data/core/approval.teal: 22: field "OnCompletion" available in version 2. Missed #pragma version?

But my code must use this code, which is supported by Teal v6

TxnField.type_enum: TxnType.ApplicationCall,

I’m trying to find solution (GitHub Issue、Algorand Forum), But don’t find it.

I’m going to try the following:

  1. use this code to create application in testnet

I wonder if this is due to sandbox not supporting Teal V6, Please Help me.

This teal code can be created on test network, but does’t work on sandbox .

Most likely your sandbox version is outdated (git pull in sandbox) or the containers used for your sandbox are outdated (./sandbox clean → this will remove all your accounts/transactions on sandbox and everything you may have done inside the containers).

1 Like

Thank you !
I update my sandbox , this teal code has worked.