- Fixed
pre-commit
script that did not work properly and skipped thelint-staged
part.
Algob:
- Add
parseABIContractFile(pathToFilePath)
method toRuntime
andDeployer
. If the currently used network is defined in the ABI file additional fieldappID
will be added to a contract. - Added arguments feature in
yarn algob run
CLI. The new format isyarn alob run scripts/script1.js <args_as_json_object>
. Example of 2 arguments passed to the script1:yarn alob run scripts/script1.js '{"arg1": 1, "arg2": "string"}'
. See more details in #850.
Runtime:
- Add
TxFieldEnum
for transaction fields inruntime
. - Add enums for opcode fields in
runtime
. - Add one batch for each package in GitHub action which uses reusable workflow.
- Add guide about blocks in
Runtime
. - Remove limits from
Runtime
for amount of apps/assets one account can create/opt-in to. - Add support for TEAL v8 opcode execution in runtime. The
MaxTEALVersion
is now8
. - Allow user to query foreign applications accounts using the
appID
field. Runtime
now supports both string and index argument opcode
TEAL v8:
- Support for
switch
opcode.
Web:
- Add
mainnetGenesisHash
,testnetGenesisHash
,betanetGenesisHash
,runtimeGenesisHash
constants. - Added
allowMultipleAccounts
parameter toconnectToMyAlgo
method ofWebMode
to give user the flexibility to allow multi accounts login using MyAlgo Wallet. - Add
tx.mkMultisigEncodedTx
helper function to create multisig encoded transaction. - Add
getGenesisHashFromName(name: string)
utility function to@algo-builder/web
. signLogicSigTx
is added to all three wallet class ofweb
package to sign transaction using logic signature.signLogic
is added toMyAlgo Wallet
class where tealSign creates a signature compatible withed25519verify
opcode from contract address
CI:
- Add reusable workflow in GitHub action.
- /examples/DAO has been moved to https://github.com/scale-it/sigmadao
Guide:
- Added tutorials about lsig and msig management with Algo Builder.
Others:
- Update
yarn
tov3.3.0
- The method
Runtime.produceBlock
has been renamed toRuntime.produceBlocks(numberOfBlocks=1)
and now accepts optional parameter that allows user to specify the number of blocks that will be produced. appendSignMultisigTransaction
is renamed tosignMsigTx
which expectsEncodedSignedTransaction
as first argument and returns an object containing a blob key encoded in base64.
- Updated yarn to v3.2.1
- Changed default sample project license to ISC
- Fix
txn AssetSender
should return zero address by default. - Add unit tests for all transaction types in runtime executeTx.
- Add support loadLogic for *.teal program and SCParam.
- Replace arrow functions with normal functions in all unit test which is recommended by
mocha
- Added support of
getProgram
which can get program string fromassetPath
(relative or absolute path) path. - Add
paths
toalgob.config.js
to specify list of paths. - Added error handling when a python module is not found and suggest solution to install the python module.
- Add
--npm
flag toalgob init
andalgob unbox
. Note: by default we will useyarn
. - Improved
algob/project-dev-script.sh
which is script setting up a local project. - Add
Uint8Array
as a supported type forTxParams.note
- Added
sendSignedTransaction(signedTransaction)
toRuntime
. Method takes 'SignedTransaction
type fromalgosdk
and sends it to the network. - Added support for
SignedTransaction
object inexecuteTx
method inRuntime
. - Added verification for secret key signatures in
Runtime
. - Added replace2 and replace3 opcode to
runtime
. - Added sha3_256 opcode to
Runtime
- Added ed25519verify_bare opcode to
Runtime
- Added json_ref opcode to
Runtime
- Added support for foreign app account access in
Runtime
- Added guide for multisignature and signedTransaction usage in
Runtime
. - Added multisignatue verification in
Runtime
. - Added support for rekey account to multisignature in
Runtime
. - Added support to withdraw from account rekeyed to multisignature in
Runtime
. - Added new section in
Deployer
guide about helper methods across all deployers. - Added
SignTx
,makeTx
,makeAndSignTx
,sendTxAndWait
helper methods inRuntime
andDeployer
. - Added support for teal v7 in
Runtime
and a test case. - Added support for new txn opcode fileds
ApprovalProgramPages
,ClearProgramStatePages
,NumApprovalProgramPages
,NumClearProgramStatePages
. - Added additional checks for the
maxStackByteElementSize
andmaxProgramLength
inRuntime
. - Added partial support for
bn254
opcodes. The full support delyed until the official release ofTEALv8/v9
. - Added a new pre-commit hook to check if there are any
.only
in tests . If there are any it will display error in which files/lines the problem was found. - Added support for
vrf_verify
opcode toRuntime
. IMPORTANT: the opcode assumes the proof is always valid thus it will always return 1. - Added program length check on app deploy on the basis of extra pages in
runtime
. - Added logic signature and arguments size check in
runtime
. - Added support for
block
opcode toRuntime
. - Added blocks to
Runtime
. It simulates the block generation by using radnom bytes generator as the first seed. The following seeds are MD5 hash of the seed from the previous block. - Added support for
secp256r1
curve toecdsa_verify
andecdsa_pk_decompress
opcodes. - Added support for
FirstValidTime
field for transactions opcode. - Added program length check on app update on the basis of extra pages in
runtime
. - Added support for
Runtime
to add account fromconfig
file.
- Added support for logic signature to
executeTx
method ofWebmode
for AlgoSigner, MyAlgo Wallet and Wallet Connect. - Added
appendSignMultisigTransaction
function toWebMode
for appending signature to multisig transaction in the algosigner. - Added
MultiSignature
support inexecuteTx
method forAlgoSigner
. - Added
SignTx
,makeTx
,makeAndSignTx
,sendTxAndWait
helper methods in all webmodes. - Added
MultiSignature
support for all methodsMyAlgo Wallet
. - Added support for unfunded accounts in
Runtime
. - Added
waitRounds
as second param tosendAndWait
method. It is optional and has a default value of 10. - Added support for to generate the
algob.config.ts
file generation via algob (yarn run algob . --typescript
) and read the algob.config.ts` file, if present in root directory.
- Fix
txn AssetSender
should return zero address by default. - Fix
KMDCredentialsFromEnv
loading using KMD_DATA. Algob was trying to useenv.$KMD_DATA
instead ofenv.KMD_DATA
- Fix
gitxna 1 Logs 0
opcode. Previously any attempt to use this opcode would result in a "Not supported" error. - Fix
TxParams.noteb64
encoding - should use base64 decoder rather than TextEncoder. - Fix
ed25519verify
opcode implementation. Previously the signature was only checked against the data not the concatenation of "ProgData"||program||data. Additionally test scenarios was added to check the correct implementation. - Fix
global CallerApplicationID
opcode. Previously the opcode get the wrong caller application ID798.
executeTx
now returns TxnReceipt instead ofTxReceipt[]
.fundLsig
now returns TxnReceipt instead ofTxReceipt[]
.
executeTx
,sendAndWait
,waitForConfirmation
,sendTxAndWait
promise now returns TxnReceipt instead ofalgosdk.modelsv2.PendingTransactionResponse
.
sendAndWait
,waitForConfirmation
,executeSignedTxnFromFile
,sendTxAndWait
promise now returnsTxnReceipt
instead ofConfirmedTxInfo
.logTx
second argument oftxConfirmation
now expects type ofTxnReceipt
instead ofConfirmedTxInfo
.
- Added secret key to all accounts that are signing transactions in examples.
- Add
add_proposal_with_asset.js
script use for create proposal with asset funds. - Increase test coverage
- added missing dependency (
debug
) to packages.
-
algob.balanceOf(deployer, accountAddr, assetID)
: if assetID is undefined then the function will return ALGO account balance. -
deployer.executeTx
returns list ofTxnReceipt
, which extendsConfirmedTxInfo
. This is to add a usefultxID
attribute, needed in various scripts.export interface TxnReceipt extends ConfirmedTxInfo { txID: string; }
- Add
Runtime.getAppByName(appName)
: gets app info based on the name declared in appDefinition. - Better warning/error when deploying ASA. Throws an error when ASA definition is wrong or when ASA is not found in asa.yaml, eg when Runtime needs to query ASA.
- Add
Runtime.getAppByName(appName)
. We can get application in Runtime now. - Teal v6 support:
- Add
Txn LastLog
opcode. - Add
Txn StateProofPK
opcode.
- Add
- Add new example Trampoline
- Fix: missing schebang to run
algob
as an app directly. BTW, we recommend running algob throughyarn algob
in your project. - Fix: max number of transactions in one call should be 256 (include inner and atomic transaction).
- Fix: Web mode (algo-builder/web) cannot sign by
fromAccount
whenfromAccountAddr
appear inexecParams
. - Receipt confirmed txn have
inner-txns
andtxn
field.
ensureCompiled
is deprecated and removed andcompileASC
should be used.loadLogicFromCache
is deprecated and removed andgetLsigFromCache
should be used.executeTransaction
is deprecated and removed andexecuteTx
should be used.
addAsset
is deprecated and removed anddeployASA
should be used.addApp
is deprecated and removed anddeployAdd
should be used.addASADef
is deprecated and removed anddeployASADef
should be used.- Renamed
optIntoAsa
tooptInToAsa
to remain naming convention consistency across the project.
executeTransaction
is deprecated and removed andexecuteTx
should be used.- Renamed
sendTransaction
tosendAndWait
in WebMode and parameter is updated to acceptstring
to bring consistency with other wallets class.
- Updated indexer version to
2.12.4
ininfrastructure/makefile
DAO template:
- [breaking] moved template parameter (
gov_token_id
) to the global state. This is to assure constant bytecode fir each deployment. We need it to build an efficient indexer and UI.- Subsequently,
gov_token_id
is required when deploying new DAO approval program.
- Subsequently,
- use
logger
fromdebug
package for logging utility in place of all console calls.
Core:
- Added support for saving smart contract template params in ASCCache.
- The
compile.ts
has been updated and now the tealCode is stored in cache whenscTmplParams
are used to compile TEAL with hardcoded params. - Added following functions in
deployer
APIgetDeployedASC
: returns cached program (from artifacts/cache)ASCCache
object by name. Supports both App and Lsig.
- You can initialize an new
algob
project withinfrastructure
scripts (a copy the/infrastructure
directory in repository) by adding the--infrastructure
flag. Example:algob init --infrastructure
- Return list of receipts for each txn in group txn. Example:
const receipts = deployer.executeTx([txn0, txn1]);
console.log("txn0 information: ", receipts[0]);
console.log("txn1 information: ", receipts[2]);
JS Runtime and testing features:
-
runtime.defaultAccounts
- a list of pre-generated 16 accounts with pre-defined addresses and keys, each with 1e8 microAlgos (100 Algos) -
runtime.resetDefaultAccounts()
- will recreate the default accounts (reset their state). -
unit tests that cover new scenarios when
runtime.defaultAccounts
andruntime.resetDefaultAccounts()
are used.bond-token-flow
test to also use runtime.defaultAccounts. (see example)
-
Support execution of algo-sdk-js
transactionAndSign
in Runtime #601. -
Added support for checking against opcode their execution mode in runtime. For eg.
arg
can only be run in signature mode, and parser will reject the execution if run in application mode. -
Support RekeyTo field in the inner transaction for TEAL v6.
-
Support
keyreg
transaction in inner transaction in JS runtime. -
Enable transfer ALGO to a not regeistred account.
-
Every opcode class has been updated and now their
execute
method returns its cost. -
Teal V6 support:
- Add new opcode
bsqrt
anddivw
(##605). - Add new opcode
gloadss
(#606). - Add new opcode
acct_params_get
(#618). - Add new opcode
itxn_next
(#626). - Add new opcode
gitxn
,gitxna
andgitxnas
.(#628). - Contract to contract calls. However we limit c2c call with only AppCall(NoOpt) transactions.(#611)
- Full support for inner transactions:
itxn
,itxna
anditxnas
- Add new opcode
-
Teal v7 support:
- opcode
base64decode
(##653)
- opcode
-
algob test
now runs tests recursively intest
directory and subdirectories. Before only the files inside the test directory where run.
Dependencies:
- Upgraded PyTEAL version
0.13.0
in Pipfile. - Upgraded JS SDK to v1.16.0
- Improved the smart contract deployment process. We changed the
DeployASAParam
andDeployASCParam
to make it more explicit. Thedeployer.deploy*
also got improvemetns with a cost of API breaking. We created the following types to describe the smart-contract to be deplyed:
// from file
type SourceFile = {
metaType: MetaType.FILE;
approvalProgramFilename: string;
clearProgramFilename: string;
};
// from teal source code (string).
type SourceCode = {
metaType: MetaType.SOURCE_CODE;
approvalProgramCode: string;
clearProgramCode: string;
};
// from compiled source code.
type SourceCompiled = {
metaType: MetaType.BYTES;
approvalProgramBytes: Uint8Array;
clearProgramBytes: Uint8Array;
};
And the following types are added for the Smart Contract definition
export type AppDefinitionFromFile = StorageConfig & AppOptionalFlags & SourceFile;
export type AppDefinitionFromSource = StorageConfig & AppOptionalFlags & SourceCode;
export type AppDefinitionFromSourceCompiled = StorageConfig & AppOptionalFlags & SourceCompiled;
export type AppDefinition =
| AppDefinitionFromFile
| AppDefinitionFromSource
| AppDefinitionFromSourceCompiled;
export type DeployAppParam = BasicParams & {
type: TransactionType.DeployApp;
appDefinition: AppDefinition;
};
See packages/web/src/types.ts for more details.
- We have updated parameters of
deployApp
method:
/// old
/**
* deploy a new application and returns application id
* @param approvalProgram application approval program (TEAL code or program filename)
* @param clearProgram application clear program (TEAL code or program filename)
* @param flags SSCDeployment flags
* @param payFlags Transaction parameters
* @param scTmplParams Smart Contract template parameters
* @param debugStack: if passed then TEAL Stack is logged to console after
* each opcode execution (upto depth = debugStack)
*/
deployApp(
approvalProgram: string,
clearProgram: string,
flags: AppDeploymentFlags,
payFlags: types.TxParams,
scTmplParams?: SCParams,
debugStack?: number
): {...}
/// new
/**
* deploy a new application and returns application id
* @param payFlags Transaction parameters
* @param appDefinition app definition
* @param scTmplParams Smart Contract template parameters
* @param debugStack: if passed then TEAL Stack is logged to console after
* each opcode execution (upto depth = debugStack)
*/
deployApp(
sender: AccountSDK,
appDefinition: types.AppDefinition,
payFlags: types.TxParams,
scTmplParams?: SCParams,
debugStack?: number
):
- We have changed the parameters of
updateApp
method. Details:
// old
/**
* Update application
* @param senderAddr sender address
* @param appID application Id
* @param approvalProgram new approval program (TEAL code or program filename)
* @param clearProgram new clear program (TEAL code or program filename)
* @param payFlags Transaction parameters
* @param flags Stateful smart contract transaction optional parameters (accounts, args..)
* @param debugStack: if passed then TEAL Stack is logged to console after
* each opcode execution (upto depth = debugStack)
*/
updateApp(
senderAddr: string,
appID: number,
approvalProgram: string,
clearProgram: string,
payFlags: types.TxParams,
flags: AppOptionalFlags,
scTmplParams?: SCParams,
debugStack?: number
)
// new
/**
* Update application
* @param appName application Name. Note in runtime application name just placeholder params
* @param senderAddr sender address
* @param appID application Id
* @param newAppCode new application source code
* @param payFlags Transaction parameters
* @param flags Stateful smart contract transaction optional parameters (accounts, args..)
* @param debugStack: if passed then TEAL Stack is logged to console after
* each opcode execution (upto depth = debugStack)
*/
updateApp(
appName: string,
senderAddr: string,
appID: number,
newAppCode: types.SmartContract,
payFlags: types.TxParams,
flags: AppOptionalFlags,
scTmplParams?: SCParams,
debugStack?: number
)
-
The
appName
field is required now. We can usedeployer.getApp(appName)
to get checkpoint data of application. In web-mode, you can set it empty. -
We removed
runtime.addApp
,deployer.getAppByFile
methods. -
We have changed the naming convention for the clearing proposal part of the DAO:
- Renamed
clearProposal
tocloseProposal
, - Renamed
clear_proposal
toclose_proposal
, - Renamed
mkClearProposalTx
tomkCloseProposalTx
.
- Renamed
-
We have updated the default behavior of algob deployer for loading data from checkpoint to be queried by "app/lsig" name (note: passing name is required). The existing functionality has been moved to
<func>ByFile
functions (legacy functions based on file querying):-
Application:
- Previous
getApp(approval.py, clear.py)
has been changed togetAppByFile(approval.py, clear.py)
. - New
getApp(appName)
function queries app info using the app name.
- Previous
-
Smart signatures:
- Existing
getDelegatedLsig(lsig.py)
,getContractLsig(lsig.py)
have been removed. UsegetLsig
function to query logic signature from name or filename in a checkpoint. - New
getApp(appName)
function queries app info using the app name. - Existing
fundLsig(lsig.py, ..)
function has been changed tofundLsigByFile(lsig.py, ..)
. NowfundLsig(lsigName, ..)
will take lsig name. - Existing
mkDelegatedLsig(fileName, signer, ..)
,mkContractLsig(fileName, ..)
have been updated to take the lsigName as a required parameter (first parameter passed to function):mkDelegatedLsig(lsigName, fileName, signer)
mkContractLsig(lsigName, fileName)
. HerefileName
represent the name of smart contract file (eg.treasury-lsig.teal
), andlsigName
represents the "name" you want to assign to this lsig (eg.treasuryLsig
).
- Existing
For reference you can check out
examples/asa
. -
-
Updated
getLsig
,getDelegatedLsigByFile
,getContractLsigByFile
,getApp
to throw an error if information against checkpoint (by name or file) is not found. -
Updated
TxReceipts
for runtimes'deployApp
,deployASA
to use same types as algob (AppInfo
,ASAInfo
). -
Updated
txId
key in returned App/ASA info totxID
. -
printLocalStateSCC
renamed toprintLocalStateApp
. -
printGlobalStateSCC
renamed toprintGlobalStateApp
. -
The
PyASCCache
has been merged toASCCache
and is not used anymore. -
Only use list transaction in executeTx.
-
Rename the executeTransaction to executeTx
-
The
Deployer
interface now contains a new methodexecuteTx
while the old function is still supporoted it is recommended to use the method fromDeployer
rather than the function dirrectly. -
executeTx
method fromWebMode
class now returnsPromise<algosdk.modelsv2.PendingTransactionResponse>
.
- Return error when closeRemainderTo and fromAccountAddr is the same.
- When close account should remove auth/spend address. Fixed in #575.
- Approval program and clear program should throw error if they are mismatch version. Fixed in #620
- Allow token to be empty.
- Throw error when issue inner transactions in clear program. Fixed in #667.
- Parameters in
extract*
opcodes can greater than uint8. Fixed in #666. - Wallet constructor come from a parameter walletURL(token, server, port)
- Restrict duplicate transaction in group transaction.
- Updated
setup-master-account
andsandbox-setup-master-account
commands to run multiple times.
- We updated the examples/DAO design. We removed treasury Smart Signature to simplify deposit management. Now a DAO app is managing voting, deposits and treasury.
- Enabled PyTEAL Optimizer option in all our examples.
- Added following functions in
deployer
APIcompileASC
: alias todeloyer.ensureCompiled
. The latter is now marked deprecated andcompileASC
should be used instead.getDeployedASC
: returns cached program (from artifacts/cache)ASCCache
object by name.
- Added
sandbox-up-dev
andsandbox-reset
commands into Makefile ininfrastructure/
. - Use strict parsing rules when decoding PyTEAL teamplate parameters using
algobpy
. Previously, on decode failure, the script was continuing with partially updated template params, now we fail with an exception.
Dependencies:
- Updated
algosdk
tov1.13.1
- Int Pseudo-Ops can't start with 0x(hex) or 0(oct) prefix. (#562)
- Add missing opcode
bitlen
andapp_params_get
. - In the inner transaction,
snd
always the application address. However, it can be set to an arbitrary address. Fixed in #569.
We continue to use yarn v3. Please share your feedback about it. Hope this improved your workflow.
Full Changelog: https://github.com/scale-it/algo-builder/compare/v3.1.0...v3.2.0
In this release we migrated to yarn v3. It speed up package management a lot.
We use node-modules node linker, because this is required
npm
or yarn v1
still works, but to have the best experience with algob
,
you should install and use yarn v3:
yarn set version stable
yarn install
- Beta support for rekeying transactions in
@algo-builder/runtime
/ testing. - Added integration to
tealer
tool into pipenv. - updated sample-project (the one after
algob init
) - migrate to use yarn v3
- updated dependencies to the latest version (notably: algosdk, typescirpt, eslint, mocha)
Runtime
wrongly required that an address used inacfg
ItxnField refers to an existing account. However, addresses used inacfg
or create asset transactions may refer to a not existing account. PR. Reported by @patrick- Can't get LogicSigAccount from
deployer.getDelegatedLsig
. uncover
opcode push/pop wrong order.- example/nft: fixed script (related to api breaking change).
- problem with calculating gas when a program starts with label (#547)
- TEALv5 support in
@algo-builder/runtime
AVM 1.0:- Cover, Uncover opcodes
- Loads, Stores opcodes
- Extract, Extract3 opcodes
- ExtractUint16, ExtractUint32, ExtractUint64 opcodes
- Txn, Global fields
- Added application account (a smart contract now has an escrow account). Updated checkpoint structure to store
applicationAccount
while runningalgob
scripts. - Support Inner Transactions:
Payment
,AssetTransfer
,AssetFreeze
,AssetRevoke
,AssetDeploy
,AssetModify
,AssetDelete
. - Support Pooled opcode budget
- Txnas, Gtxnas, Gtxnsas, Args, Log (logs are stored in txReceipt)
- Update all transaction functions (eg.
executeTx
,addAsset
,addApp
..etc) to return a transaction receipt. Addruntime.getTxReceipt
in@algo-builder/runtime
to query transaction info.
-
Add Asset Name to
assetDefinition
in@algo-builder/runtime
. -
Updated App, Asset counters in runtime from 0, to 8. This means that the newly created App/Asset Index will be 9 (instead of 1).
-
Added
runtime.loadLogic(..)
function (similar todeployer.loadLogic
API) which simplifies the testing and script flow (we can use the same code in tests and scripts). User should do the following migration:// from const daoFundLsigProg = getProgram("dao-fund-lsig.py", scInitParam); daoFundLsig = runtime.createLsigAccount(daoFundLsigProg, []); // to (mute logs) daoFundLsig = runtime.loadLogic("dao-fund-lsig.py", scInitParam, false);
For information about loading checkpoint(s) data using
@algo-builder/web
in a webapp, read here. -
Added
WallectConnectSession
class to create & manage wallect connect session. User can usesession.executeTransaction()
to execute algob transactions using wallet connect. -
Updated
getProgram
,loadLogic
to pass an optional argument:logs (true/false)
. By default logs will be displayed on console during compilation.// logs == false const daoFundLsigProg = getProgram("dao-fund-lsig.py", {}, false);
-
Updated
deployer.deployApp(...)
&deployer.updateApp(...)
to take one more optional parameter:appName
. This will also save in a checkpoint the compiled app by name. -
deployer.updateApp()
andruntime.updateApp
take one more optional argument:scTmplParams: SCParams
to be compatible withdeployApp
and be able to use template parameters. -
Added new function
getAppByName(name: string)
to query checkpoint information by app name. -
Added
deployer.loadLogicFromCache
to load a logic signature from already compiled TEAL codes (stored inartifacts/cache
, for eg duringdeployer.fundLsig
). This avoid re-compilation (and passingscTmplParams
) each time(s) user wants to load an lsig. -
Updated
TealDbg
method to load already compiled TEAL code fromartifacts/cache
. Compilation is forced only when a) TEAL is not cached OR b)scInitParam
(template parameters) are passed withtealFile
. -
Adding
@algo-builder/web.status.getAssetHolding
function which queries account asset holding.
- Updated private-net setup, sandbox & indexer scripts to run in
dev
mode.
@algo-builder/runtime
:
-
Renamed
Runtime.getLogicSig
toRuntime.createLsigAccount
#506. -
runtime.addAsset(..)
,runtime.addApp(..)
return a tx receipt object, which contains the newly created appID/assetID.- Migration: Example code:
// from const appID = runtime.addApp(flags, {}, approvalProgram, clearProgram); // to const receipt = runtime.addApp(flags, {}, approvalProgram, clearProgram); const appID = receipt.appID;
-
getProgram
is moved to@algo-builder/runtime
from@algo-builder/algob
. -
runtime.addAsset
,runtime.addAssetDef
andruntime.addApp
are deprecated. Please useruntime.deployASA
,runtime.deployASADef
andruntime.deployAdd
instead of the above functions. -
Update
runtime.deloyApp
to be compatible withdeployer.deployApp
. -
balanceOf
in@algo-builder/algob
package now return amount (number) of asset account holding and won't print them. If the account does not hold an asset it will return 0. To query asset holding, please use a new@algo-builder/web.status.getAssetHolding
function. -
Updated
deployer.deployApp
to passscTmplParams
(smart contract template parameters).
- Fix bug substring3 opcode pop wrong order /#505, contribution: @vuvth.
- Fix bug:
runtime.optinToApp
updating state even after opt-in fails. Reported by @patrick
- Upgrade indexer version
- TEALv5 support (part1) in
@algo-builder/runtime
:- Ecdsa opcodes: ecdsa_verify, ecdsa_pk_decompress, ecdsa_pk_recover
- Update Algorand indexer to v2.6.4
@algo-builder/runtime
support return smart-contract return values in Interpreter. Credits: Ashley Davis- Upgrade Algorand JS-SDK to v1.12
@algo-builder/runtime
:runtime.optInToApp
should throw error if an account is already opted-in to the App.- Fix
ALGORAND_DATA
environment variable use and documentation. @algo-builder/runtime
: Accept ASA deployment with total supply == 0
- [web] Fixed
metadataHash
attribute verification forASADefSchema
and consequentlydeployASA
and updated theASADef
.
- [examples/asa] Added more in
0-gold-asa.js
script we added an example how to correctly providemetadataHash
for an ASA.
- Added shared space between contracts
- Added tealv4 opcodes (
gload
andgloads
) - Added Tealv4 opcodes (
callsub
andretsub
) - Added loop support in runtime
- TEALv4 support in
@algo-builder/runtime
:- Added shared space between contracts (opcodes
gload
andgloads
) - Dynamic Opcode Cost Evaluation
- Transaction Array changes
a) array length assertions for
tx.ForeignAssets
,tx.Accounts
,tx.ForeignApps
, b) User can pass id/offset for app/asset in for array references. Fortx.Accounts
you can pass address directly in teal code. - Byteslice arithmetic ops (
b+
,b-
,b*
,b/
,b%
,b<
,b>
,b<=
,b>=
,b==
,b!=
,b\
,b&
,b^
,b~
,bzero
). - Additional mathematical opcodes:
divmodw
,exp
,expw
,shl
,shr
,sqrt
- More Versatile Global and Local Storage (combination of upto 128 bytes allowed between key-value).
- Asset URL change (max size increased till 96 bytes).
- gaid, gaids opcodes (knowable creatable id)
- Added shared space between contracts (opcodes
- Updated all examples & tests to use TEALv4 (
#pragma version 4
) - Added support for querying indexer in an
algob
script (accessable viadeployer.indexerClient
). You can passindexerCfg
in your network's config inalgob.config.js
. Added docs. - Add function to store checkpoint for contract logic signature (
mkContractLsig
). - Add support for algosdk.Transaction object in executeTranasction
- Add
signTransactions
functions: It signs transaction object(s) and returns raw signed transaction.
- Fixed
yarn add @algo-builder/web
(was failing because of missing dependencyzod
in packages/web). - Fix metadatahash type
- Fix init project-name bug(
algob init <project-name>
command was not working properly) - Fix zod package was missing from runtime(but zod was being used in runtime)
- Added support for passing http token as an
object
as well. User can now use{ "X-Algo-API-Token": <token> }
notation for passing token inalgob.config.js
.
- Fix random address for logic sig, creating two times an lsig account from the same TEAL code should return the same address.
- Migrate from
LogicSig
toLogicSigAccount
(Note: Loading lsig from file usesLogicSig
, becausegoal
stores it in LogicSig type format) - Rename
CallNoOpSSC
toCallApp
. - Rename
optInAcountToASA
tooptInAccountToASA
(typo) - Rename
readLocalStateSSC
toreadAppLocalState
,readGlobalStateSSC
toreadAppGlobalState
.
- Upgraded pyTEAL version
0.9.0
in pipfile. - Upgraded indexer binary version to
2.6.1
in/infrastructure/Makefile
.
- Fix
algob init <project-name>
.
-
Moved error lists, BuilderError, mkTransaction to
@algo-builder/web
package. Re exportmkTransaction
,errors
in algob and runtime from@algo-builder/web
for backward compatibility. -
Added
algob init --typescript
flag to initialize a typescript project. Usage:algob init <location> --typescript
. -
Support pooled transaction fees in algob and runtime - now one transaction can pay for other transaction fees in a group.
-
Added
flatFee
toTxParams
. -
Added support for teal debugger (get dryrun response or start debugger using
tealdbg
in chrome) inalgob
scripts. -
User can initialize & use accounts by name in
@algo-builder/runtime
, similar to algob ('john', 'bob' etc) -
Updates to
algob sign-multisig
:- Creating a new multisigned transaction (requires multisig metadata:
v, thr, addrs
) - Support for signing in a group transaction (loaded from file).
- Check usage in our guide
- Creating a new multisigned transaction (requires multisig metadata:
-
Added
deployASADef
function to deploy ASA without using/assets/asa.yaml
. -
Added
yarn run test:watch
command. NOTE: it will spawn multiple process in the same terminal session. So if you want to stop the all processes the best solution is to kill the terminal session. -
Added new package
@algo-builder/web
. It can be used in Dapps to interact with ASAs and Stateful applications. Main features:- Compatible with
algosigner
. - Support algob's high level function:
executeTransaction
in a webapp as well (note: currentlydeployASA
&deployApp
transactions are not supported, as we don't load data from checkpoints OR/assets
). - Support group transactions.
- The
executeTransaction
takes transactions parameters (single/group) as input, triggers an algosigner prompt for signature, sends transaction to network and return it's response. Documentation can be found here.
- Compatible with
- Added new template
/shop
to demonstrate a react component (payment widget) to make a purchase and triggerAlgoSigner
for signing a transaction.
Examples
- Permissioned Token Added
cease
function and a script to change permissions app_id.
Tutorials:
- We published a Securities and Permissioned Tokens solution (implemeted using
algob
): https://developer.algorand.org/solutions/securities-and-permissioned-tokens/. - Published fifth tutorial in the
@algo-builder
series, on how to usealgob console
to quickly and easily interact with ASA and smart contracts: https://developer.algorand.org/tutorials/algo-builder-tutorial-part-5-algob-console/.
- Added github workflows/examples.yaml to execute
/examples
on a private net, on pushing new commit todevelop
/master
branch OR creating a pull request that target these branches.
- Added new make commands:
setup-reach
- sets up reach executable file in~/.algorand-reach
directoryremove-reach
- halts any dockerized devnets, kills & removes docker instances and containers, remove reach bash file from~/.algorand-reach
.restart-private-net
: restarts private-net.indexer-docker-up
,indexer-docker-down
: Docker based setup for indexer. Runs in read-only mode, without connecting to local algod node.make setup-postgresql
: Installpostgresql
database on a local linux system and setup a new user & database.make start-indexer
: Add local indexer binary (downloaded in~/.algorand-indexer-download
) and start the indexer by connecting to database and local algod node.make recreate-indexer
: resets the indexer database and runsstart-indexer
.make remove-indexer
: Removes~/.algorand-indexer-download
directory from system.
- Rename
SSC
toApp
- This will affect deployment and all calls made to stateful smart contracts(SSC) orApp
- OptInSSC -> OptInToASA
- DeleteSSC -> DeleteApp
- DeploySSC -> DeployApp
- SSCDeploymentFlags -> AppDeploymentFlags
- SSCOptionalFlags -> AppOptionalFlags
- Import are changed to scoped imports
- instead of stringToBytes, you can import a
convert
namespace (from@algo-builder/algob
), and then useconvert.stringToBytes
- instead of stringToBytes, you can import a
- Types imports for
ExecParams
,TransactionTypes
,SignType
moved to new package@algo-builder/web
- Migrate to algorand/js-sdk types from
@algo-builder/types-algosdk
.
- Fixed dependency issues while installing algob using
yarn add @algo-builder/algob
&npm install @algo-builder/algob
. web
:- Added missing
fromAccount?
attribute to theSign
type. - Remove TxParams type from runtime package(it is duplicated in runtime)
- Added missing
@algorand-builder/runtime
* #409 Added missing fromAccount
attribute to SignWithLsig
type.
- updated
algob test
command to run mocha in typescript project as well.
@algorand-builder/runtime
* fixed bug when trying to optIn to asset using asset transfer transaction with amount 0n.
- Updated
algob test
command to run mocha in typescript project as well.
@algorand-builder/runtime
- fixed bug when trying to optIn to asset using asset transfer transaction with amount 0n.
Highlights:
- TEALv3 support
- improved documentation and guide
- better handling in
executeTransaction
- checkpoint can be market invalid if they are substituted (eg by redeploying same asset).
- Move
updateApp
function todeployer
-
Rename
parseArgs
toparse_params
-
For External support of parameters user should replace TMPL_ prefix in their smart contracts, and only use it when using pyteal.tmpl(..)
-
Rename
appId
toappID
in all places. (previously some of SSC params were takingappId
and other were takingappID
, this was inconsistent)
- Replaced dependency
find-up
withfindup-sync
inalgob
. - Added
algopy
in@algo-builder/algob/sample-project
, which enables users to pass template parameters to PyTEAL contracts. Updated docs. - Store checkpoints in nested form for SSC, added tests.
- Added support for sub directories in assets folder, with tests.
- Update runtime to process execParams.deployASA, deployApp, OptInToASA, OptIntoSSC
- Exported
@algorand-builder/algob
,@algorand-builder/runtime
error types and make it accessible for API documentation. - Added
debugStack
option inruntime.executeTx()
to print stack (upto depth = debugStack) after each opcode execution. - TEALv3 support in
@algo-builder/runtime
. - Transpile TEAL code to substitute the TMPL placeholders
- Mark not valid checkpoints (in case of
deleteApp
/DestroyAsset
) usingdeleted
boolean
@algorand-builder/runtime
_ Remove asset holding from account if closeRemainderTo
is specified.
_ Asset creator should not be able to close it's holding to another account.
- fixed temporal files handling.
- Update how error is displayed to a user
- Add Update stateful smart contracts using execute transaction in runtime
Runtime:
- added
updateApp
method.
- Added missing dependency:
find-up
- Fixed dependency for
@algo-builder/algob
.
New website: https://scale-it.github.io/algo-builder
- Removed Algob prefix in deployer (eg. renamed
AlgobDeployer
toDeployer
) - Updated
execParams
structure & typings (input parameters forexecuteTransaction
)- Migration: If
SignType
isLogicSignature
then changefromAccount
tofromAccountAddr
and just pass from address instead of complete account.
- Migration: If
- Changed the way we pass arguments to stateless smart contract - moved assignment from when we load smart contract (using
loadLogic
,mkDelegatedLsig
,fundLsig
) to when we create transaction execution parameters.- Migration: assign stateless args in txParams to
executeTransaction
. Egawait deployer.loadLogic('htlc.py', [arg1]); // remove scTmplParams from here const txnParams: rtypes.AlgoTransferParam = { .. } txnParams.args = [arg1]; // assign here now await executeTransaction(deployer, txnParams);
- Migration: assign stateless args in txParams to
- Added more tests for the crowdfunding example project using
@algo-builder/runtime
- Happy paths and Failing paths. - Integrated user documentation with
jekyll
. - Added new function
signLogicSigMultiSig
to sign logic signature by multisig. - Updated ASA deployment (
deployASA
function) to pass custom params and save deployed asset definition in checkpoint. - Support deployment and optIn methods in a transaction group (along with all other methods, using
executeTransaction
). - Renamed
loadBinaryMultiSig
toloadBinaryLsig
(load signed logic signature from file in scripts). - New opt-in functions and updates. Check the deployer API for information about all opt-in functions.
deployer.optIn
are now available both in DEPLOY mode to RUN mode.- Extended
deployer.optIn*
functions to support ASA by ID. Previously we only accepted ASA by name (based on the name inassets/asa.yaml
file). - Added
deployer.optInLsigToApp
anddeployer.optInLsigToASA
to easily opt-in stateless smart contract (lsig) account to stateful smart contract and ASA.
- Asset related
execParams
(transaction parameters forexecuteTransaction
) support ASA by name and by ID (previously only ASA ID was supported). Example. - cleaned test suite log (when developing Algo Builder itself). Our test suite has 884 tests.
We added new commands:
algob test
(runs mocha in project root).algob unbox-template <name> <destination>
to quickly unbox a dapp template fromscale-it/algo-builder-templates
.algob sign-multisig --account <acc> --file <input> --out <out-file>
to append user's signature to signed multisig file using accounts managed byalgob
.algob sign-lsig --account <acc> --file <input> --out <out-file>
to sign logic signature using accounts managed byalgob
.
- Added new templates:
- Updated
examples/asa
: added new use-case to deploy and control ASA by a smart contract.
- We created a new repository with dapp templates. It's a new project line of Algo Builder. Dapp Templates are webapps operating with Algorand blockchain with
algob
support. For the moment we only have React templates. Anyone can contribute with a new template or by improving the pre-existing ones by creating a pull request. - Added
algob unbox-template
command to download a template and setup the project.
- Added new make commands:
setup-private-net
- creates and starts private network, setups master account and shows network status.recreate-private-net
- stops and removes the private network, and re-setup.
- fixed bugs
- in group tx flow
- in opcodes: asset_params_get, txn GroupIndex, concat
- closing asset using clawback should be denied
Renaming the organization and package names to @algo-builder
.
General:
- Added documentation (in
/docs/testing-teal.md
) to test TEAL using@algorand-builder/runtime
- [breaking] Added support for ASA OptIn for contract account (eg. escrow) represented by logic signature. Changed
optInToASA
tooptInAcountToASA
(for optIn using account) andoptInLsigToASA
(for optIn using logic signature account). - Use
bigint
for all numeric values inruntime
andalgob
to support integers upto 64 bit(uint64
).
@algorand-builder/runtime:
- Full support for asset related transaction (create, opt-in, transfer, modify, freeze, revoke, destroy)
- Support for group transactions
Infrastructure:
- Support Sandbox in
/infrastructure
to quickly set up the private net - [breaking] Changed default network config and the private-net for compatibility with Sandbox:
- port = 4001
- token = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
- Updated the default token and endpoint port. For compatibility with Sandbox we use the sandbox token and port (4001) in all examples and sample project. If you run an algorand node using our private node setup then either recreate the network (stop, remove node_data and create it again), or update the
node_data/PrimaryNode/config.json
and set:"EndpointAddress": "127.0.0.1:4001"
- Renamed
@algorand-builder/algorand-js
to@algorand-builder/runtime
- Added new example project - Crowdfunding Application
@algorand-builder/runtime
: added support for transactions: payment, app creation, opt-in, stateful (application call, clear, delete, close).- Added support for arguments in stateful smart contracts similar to goal (eg.
str:abc
, 'int:12') - Logic signature validation for stateless teal in runtime
- Introduced versioning of TEAL opcodes in runtime with max cost assertion
- Added a Typescript example project -
htlc-pyteal-ts
Moved package into @algorand-builder
NPM organization. So all imports and install commands require to change algob
to @algorand-builder/algob
.
- Reproducible, declarative Algorand Network setup using scripts in
/infrastructure
. - Re-organized examples. Now all examples share same config. Users are able to provide their own
- We ported all developer.algorand reference templates
- Reworked smart contract handling.
- API documentation improvements
- Added lot of new TypeScript typings for
algosdk-js
- As a user I can compile and run PyTeal Files
- As a user I can access accounts from an ENV variable
- As a user I can load ALGOD and KMD credentials from ENV variable
- As a user I can load a multisig directly from /assets and execute transactions
- As a user I can use CLI to run an JS Node REPL with async/await suppport on the top level
Deployer
smart-contracts API changes. Please refer to our API documentation to check available functions and attributes.