Deploying a stateful smart contract with the JS SDK

Struggling to find a complete example of how to do this, specifically what format/encoding the approval/clearState programs should be. I’ve tried reading them from the filesystem encoded as utf-8 → encoding as base64 → converting to a UInt8Array but I get an error when submitting the transaction saying:

check failed on ApprovalProgram: program version 35 greater than max supported version 5

Which is not the case. Both programs are using #pragma version 5

Have you followed Interact with smart contracts - Algorand Developer Portal ?

Note that you need to compile the TEAL codes.

Thanks @fabrice. I was missing the compilation step

1 Like