Skip to content

Releases: scale-it/algo-builder

Algo Builder v6.0.0

04 Nov 15:05
295ee27
Compare
Choose a tag to compare

Highlights

  • AVM v7 support
  • Lot of work related to dealing with multisignatures:
    • multisig verification for Runtime (your test framework)
    • few high level functions to create and sign multisig in the web package
    • see our Multisignature guide
  • Support for foreign app account access in Runtime
  • Interface for rekeyed accounts in Runtime and Algob

Updated docs, worth to check:

DAO App

We also created a DAO webapp, a service to create new DAOs, browse existing DAOs, make proposals and voting. The DAO app requires indexer to discover DAOs and automatically manage your gov tokens (staking) and proposals. This is a huge step towards communit DAOs.

Feel free to clone it or deploy it by your own and contribute. It's an open source project and we hope to see community engaging into it. Next sprint we will deploy it on testnet.

What's Changed

Changelog

List of Commits:

New Contributors

Read more

Algo Builder v5.0.1

11 Jul 09:17
8a0d12e
Compare
Choose a tag to compare

This is a small bug fix release. Adds missing dependency (debug) to the @algo-builder/web package.

Algo Builder v5.0.0

08 Jul 13:53
f5c48a5
Compare
Choose a tag to compare

Highlights

This is a stability release with few small improvements and API unification. Currently we focus on bringing SigmaDAO: a dapp for our DAO template smart contract. We developed an indexer for SigmaDAO and will be improving the flows. Soon we will start tests and looking for community members who will like to test it and give us more feedback. Please contact us if you would like to engage.

Few community members reached out to us with questions about multisig support in Algo Builder. Currently we have a basic CLI support. Alternative is to use the goal tool. Unfortunately, both are not are friendly for an average internet user with a web wallet. We see a big need for a web based multisig tool integrated with web wallets.
Here we go: SigmaWallet: a webapp to facilitate generic transaction signing, creating multisig objects, merging signatures into a multisig, and broadcasting signed transactions (eg: use case when you sign transaction using a cold wallet, but don't have a running node to broadcast the transaction). It's still work in progress. Stay tuned - this will finally enable a user friendly flow for multisig usage and broadcasting signed transactions using the web wallet!

We are continuing working on making the executeTx more powerful especially when combined with runtime package for testing and simulations with updates coming in the next release.

Finally, we partnered with CMTA to certifying our Permissioned Token template as a smart contract complaint with Swiss Regulations. Few updates are coming to the template.

Algob

  • algob.balanceOf(deployer, accountAddr, assetID): if assetID is undefined then the function will return ALGO account balance.

  • deployer.executeTx returns list of TxnReceipt, which extends ConfirmedTxInfo. This is to add a useful txID attribute, needed in various scripts.

    export interface TxnReceipt extends ConfirmedTxInfo {
    	txID: string;
    }

Runtime

  • 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.

Examples

Bug Fixes

  • Fix: missing schebang to run algob as an app directly. BTW, we recommend running algob through yarn 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 when fromAccountAddr appear in execParams.
  • Receipt confirmed txn have inner-txns and txn field.

Breaking Changes

  • Renamed optIntoAsa to optInToAsa bringing naming convention consistency across the project.
  • Renamed sendTransaction to sendAndWait in WebMode and parameter is updated to accept string to bring consistency with other wallets class.

Template Updates

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.
  • various cosmetic updates in templates (non api breaking).

Full Changelog: v4.0.0...v5.0.0

Algo Builder v4.0.0

24 May 13:14
05ed9d4
Compare
Choose a tag to compare

Higlights

  • We reworked how the apps are deployed. Specifically, the executeTx and it's parameters. We simplified the type and brought better compatibility with the SDK. You can easily use SDK transactions in all modes (algob, runtime and web)
    This change is targeted to our big goal: use same scripts in algob, runtime and web and make it user friendly. We welcome you freedback in Algob Algorand Discord channel.
  • exeucteTx is now a method of an Executor (base type of Deployer) available in all modes (algob, runtime, web). Previously it was a global function, which made it harder to nicely integrate with the whole framework.
  • TEAL v6 + partial v7 support.

Features

Core:

  • Added support for saving smart contract template params in ASCCache.
  • uselogger from debug package for logging utility in place of all console calls.
  • The compile.ts has been updated and now the tealCode is stored in cache when scTmplParams are used to compile TEAL with hardcoded params.
  • Added following functions in deployer API
    • getDeployedASC: returns cached program (from artifacts/cache) ASCCache object by name. Supports both App and Lsig.
  • You can initialize an new algob project with infrastructure 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 and runtime.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 and divw(##605).
    • Add new opcode gloadss(#606).
    • Add new opcode acct_params_get(#618).
    • Add new opcode itxn_next(#626).
    • Add new opcode gitxn, gitxna and gitxnas.(#628).
    • Contract to contract calls. However we limit c2c call with only AppCall(NoOpt) transactions.(#611)
    • Full support for inner transactions: itxn, itxna and itxnas
  • Teal v7 support:

    • opcode base64decode (##653)
  • algob test now runs tests recursively in test 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

Template improvements

  • 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.

API breaking

  • Improved the smart contract deployment process. We changed the DeployASAParam and DeployASCParam to make it more explicit. The deployer.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 use deployer.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 to closeProposal,
    • Renamed clear_proposal to close_proposal,
    • Renamed mkClearProposalTx to mkCloseProposalTx.
  • 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 to getAppByFile(approval.py, clear.py).
      • New getApp(appName) function queries app info using the app name.
    • Smart signatures:

      • Existing getDelegatedLsig(lsig.py), getContractLsig(lsig.py) have been removed. Use getLsig 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 to fundLsigByFile(lsig.py, ..). Now `fun...
Read more

Algo Builder v3.2.0

03 Feb 19:57
Compare
Choose a tag to compare

Features

  • Added following functions in deployer API
    • Add bitlen and app_params_get opcode support to the Runtime (#563)
    • compileASC: alias to deloyer.ensureCompiled. The latter is now marked deprecated and compileASC should be used instead.
    • getDeployedASC: returns cached program (from artifacts/cache) ASCCache object.
  • Added sandbox-up-dev and sandbox-reset commands into Makefile in infrastructure/.
  • 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 to v1.13.1

Bug Fixes

  • Int Pseudo-Ops can't start with 0x(hex) or 0(oct) prefix. (#562)
  • Add missing opcode bitlen and app_params_get.
  • In the inner transaction, snd always the application address. However, it can be set to an arbitrary address. Fixed in #569.

Notes

We continue to use yarn v3. Please share your feedback about it. Hope this improved your workflow.

Full Changelog: v3.1.0...v3.2.0

Algo Builder v3.1.0

25 Jan 14:32
Compare
Choose a tag to compare

Package Manager Update

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

Improvements

  • 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)
  • updated dependencies to the latest version (notably: algosdk, typescirpt, eslint, mocha)

Bug Fixes

  • Runtime wrongly required that an address used in acfg ItxnField refers to an existing account. However, addresses used in acfg 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)

New Contributors

Full Changelog: v3.0.0...v3.1.0

Algo Builder v3.0.0

21 Dec 23:37
Compare
Choose a tag to compare

This is our next major release which is focused on AVM v1.0 (TEALv5) full support and many improvements requested by the community.

Improvements

  • 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 running algob 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. Add runtime.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 to deployer.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 use session.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() and runtime.updateApp take one more optional argument: scTmplParams: SCParams to be compatible with deployApp 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 in artifacts/cache, for eg during deployer.fundLsig). This avoid re-compilation (and passing scTmplParams) each time(s) user wants to load an lsig.

  • Updated TealDbg method to load already compiled TEAL code from artifacts/cache. Compilation is forced only when a) TEAL is not cached OR b) scInitParam (template parameters) are passed with tealFile.

  • Adding @algo-builder/web.status.getAssetHolding function which queries account asset holding.

Infrastructure

  • Updated private-net setup, sandbox & indexer scripts to run in dev mode.

Breaking changes

@algo-builder/runtime:

  • Renamed Runtime.getLogicSig to Runtime.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 and runtime.addApp are deprecated.
    Please use runtime.deployASA, runtime.deployASADef and runtime.deployAdd instead of the above functions.

  • Update runtime.deloyApp to be compatible with deployer.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 pass scTmplParams (smart contract template parameters).

Bug Fixes

  • Fix bug substring3 opcode pop wrong order /#505, contribution: @vuvth.
  • Fix bug: runtime.optinToApp updating state even after opt-in fails. Reported by @patrick

v2.1.0 Release

22 Oct 10:44
Compare
Choose a tag to compare

Algo Builder v2.1.0 Release Notes

Improvements

  • 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

Bug Fixes

  • @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

v2.0.1 Release

18 Oct 11:15
Compare
Choose a tag to compare

Algo Builder v2.0.1 Release Notes

Bug Fixes

  • [web] Fixed metadataHash attribute verification for ASADefSchema and consequently deployASA and updated the ASADef.

Examples

  • [examples/asa] Added more in 0-gold-asa.js script we added an example how to correctly provide metadataHash for an ASA.

Check v2.0.0 Release Notes.

v2.0.0 Release

30 Sep 16:22
Compare
Choose a tag to compare

Hightlights

  • Updates our examples / templates. Especially head out to the DAO and permissioned token examples which allows you easily to run a DAO and security token respectively.
  • TEALv4 support in our testing framework and runtime
  • executeTranasction function rework. Now it supports the SDK Transaction object. Check our updated Execute Transaction Guide.

Improvements

  • Added shared space between contracts
  • Added tealv4 opcodes (gload and gloads)
  • Added Tealv4 opcodes (callsub and retsub)
  • Added loop support in runtime
  • TEALv4 support in @algo-builder/runtime:
    • Added shared space between contracts (opcodes gload and gloads)
    • 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. For tx.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)
  • Updated all examples & tests to use TEALv4 (#pragma version 4)
  • Added support for querying indexer in an algob script (accessable via deployer.indexerClient). You can pass indexerCfg in your network's config in algob.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.

Bug Fixes

  • Fixed yarn add @algo-builder/web (was failing because of missing dependency zod 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 in algob.config.js.

Testing framework bug fixes

  • Fix random address for logic sig, creating two times an lsig account from the same TEAL code should return the same address.

API Breaking

  • Migrate from LogicSig to LogicSigAccount(Note: Loading lsig from file uses LogicSig, because goal stores it in LogicSig type format)
  • Rename CallNoOpSSC to CallApp.
  • Rename optInAcountToASA to optInAccountToASA (typo)
  • Rename readLocalStateSSC to readAppLocalState, readGlobalStateSSC to readAppGlobalState.

Dependencies

  • Upgraded pyTEAL version 0.9.0 in pipfile.
  • Upgraded indexer binary version to 2.6.1 in /infrastructure/Makefile.

Examples

  • Added new template DAO, with flow tests. Read the specification here.