This package provides a starter template for developing Algorand smart contracts using the TEALScript programming language. It includes scripts for compiling, deploying, and interacting with smart contracts.
Before using this package, ensure that you have the following prerequisites installed:
- Node.js (v18 or later)
- Yarn package manager (v1.22 or later)
- Clone this repository to your local machine.
- Install the package dependencies by running
yarn install
. - Customize the
.env
file with the appropriate environment variables for your deployment. - Edit TEALScript template to your unique use-case.
- Compile the TEALScript contract by running
yarn compile
. - Deploy the contract to the Algorand testnet by running
yarn deploy testnet
. - Interact with the deployed contract using the provided scripts. For example,
you can call a contract method by running
yarn call testnet <app_id> <method_name>
.
yarn run v1.22.19
$ bash ./scripts/compile.sh
Compiling ./Contract.algo.ts...
Compiled files were saved to /build
Done in 0.92s.
yarn run v1.22.19
$ yarn compile && bash ./scripts/deploy.sh testnet 1 1 0 0
$ bash ./scripts/compile.sh
Compiling ./Contract.algo.ts...
Compiled files were saved to /build
Compiled approval program.
Compiled clear program.
Deploying to testnet...
App deployed successfully. App ID:
253077467 (https://testnet.algoscan.app/app/253077467)
Done in 8.22s.
yarn run v1.22.19
$ bash ./scripts/call.sh testnet 253077467 increment
Calling 253077467 on testnet - method "increment" with no arguments.
Call successful.
Done in 6.05s.
yarn run v1.22.19
$ bash ./scripts/call.sh testnet 253077467 delete
App 253077467 deleted successfully.
Done in 7.20s.
The package includes the following scripts:
compile
: Compiles the TEALScript contract and saves the compiled files to thebuild
directory.deploy <network>
: Deploys the contract to the specified network (e.g.local
,testnet
,mainnet
). In order to deploy, you will be asked to specify numGlobalByteSlices etc.call <network> <app_id> <method_name> [args...]
: Calls a method on the deployed contract with the specified network, app ID, method name, and optional arguments.
Please note that you may need to provide additional configuration or parameters depending on your specific use case.
If you encounter any issues or errors during the deployment or interaction process, please refer to the error messages and ensure that you have met the prerequisites and configured the environment variables correctly.
For further assistance, you can consult the official Algorand documentation or seek help from the Algorand community here:
Algorand Discord #TEALScript channel
This package is licensed under the MIT License. Feel free to modify and use it according to your needs.