Skip to content

Commit

Permalink
0.15.0 (#51)
Browse files Browse the repository at this point in the history
* storage prefix

* 0.13.0

* remove accidental import

* 0.14.0 - Tuple refactor (#45)

* replace err() with throw Error()

* subroutines for processing tuple elements

* remove scratch.oldTupleElement

* add tsconfig to tests/contracts/

* use Address instead of Account

* remove empty create

* WIP with a lot of TODOs

* getElementEnd WIP

* saving work WIP

* dynamicArrayInMiddleOfTuple

* DynamicArrayInMiddleOfTupl

* namedTuple

* staticStringArrayArg

* nestedTuple, es2020

* better dryrun()

* getTupleElement

* getElementHead

* save WIP

* save progress WIP

* passing literal access, non-update tests

* move dynamic element access

* updateDynamicElementInTupleWithSameLength

* updateDynamicArrayInMiddleOfTuple

* passing all update tests

* passing all tests

* remove dead code

* compile/run examples, add pre-commit script

* accessDynamicStringArray

* properly specify arrayType for custom types

* 0.14.0

* recompile contacts app

* artifacts dir for tests

* compile on localnet

* Test refactor and algokit migration (#47)

* refactor ABI tests

* use jest

* move around deps

* remove beaker-ts from tests

* examples: beaker-ts -> algokit

* remove some eslint disable lines

* increase jest timeout

* seperate test-coverage

* Run example tests

* ABITestTxnTypes

* Source mapping (#48)

* srcMap

* new src_map.json

* frameInfo

* use source-mapping standard

* fix typo

* ufixed support

* ufixed test, test refactor

* add ufixed types to global.d.ts

* StaticArray, uint, ufixed refactor (#49)

* StaticArray and uint/ufixed refactor

* update docs

* fix bad find/replaces

* storage refactor (#50)

* update nfd link

* fix typos in global

* 0.15.0

* fix itxn fields

* \n -> ;
  • Loading branch information
joe-p authored Jun 20, 2023
1 parent ed24564 commit 4718d07
Show file tree
Hide file tree
Showing 460 changed files with 35,623 additions and 30,667 deletions.
2 changes: 0 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ module.exports = {
},
extends: [
'airbnb-base',
'plugin:mocha/recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
Expand All @@ -18,7 +17,6 @@ module.exports = {
},
plugins: [
'@typescript-eslint',
'mocha',
],
rules: {
'@typescript-eslint/no-explicit-any': 'error',
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ jobs:
- name: Run tests
run: yarn test

- name: Run example artifact tests
run: yarn run test-example-artifacts
- name: Run example tests
run: yarn jest examples/

- name: Install ARC12 test dependencies
run: pip3 install -r ./examples/arc12/tests/requirements.txt
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ __pycache__/
.venv/
!.eslintrc.js
coverage/
.nyc_output/
.DS_Store
yarn-error.log
docs/
*.tgz
*.tgz
!jest.config.js
1 change: 0 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ tests/
src/
.github/
coverage/
.nyc_output/
.eslintrc.js
*.tgz
docs/
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ TEALScript is a TypeScript compiler for generating TEAL. The goal is to enable d

## Documentation

The documentation for the latest release can be viewed at [tealscript.netlify.app](https://tealscript.netlify.app/pages/getting_started.html) and can be generated locally with `yarn docs`
The documentation for the latest release can be viewed at [tealscript.algo.xyz](https://tealscript.algo.xyz) and can be generated locally with `yarn docs`

## Status

Expand Down
10 changes: 5 additions & 5 deletions examples/amm/amm.algo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ const FEE = 5;

// eslint-disable-next-line no-unused-vars
class ConstantProductAMM extends Contract {
governor = new GlobalReference<Address>({ key: 'g' });
governor = new GlobalStateKey<Address>({ key: 'g' });

assetA = new GlobalReference<Asset>({ key: 'a' });
assetA = new GlobalStateKey<Asset>({ key: 'a' });

assetB = new GlobalReference<Asset>({ key: 'b' });
assetB = new GlobalStateKey<Asset>({ key: 'b' });

poolToken = new GlobalReference<Asset>({ key: 'p' });
poolToken = new GlobalStateKey<Asset>({ key: 'p' });

ratio = new GlobalReference<uint64>({ key: 'r' });
ratio = new GlobalStateKey<uint64>({ key: 'r' });

@handle.createApplication
create(): void {
Expand Down
2 changes: 1 addition & 1 deletion examples/amm/beaker_artifacts/approval.teal
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pushbytes 0x08a956f7 // "set_governor(account)void"
==
bnz main_l11
txna ApplicationArgs 0
pushbytes 0x6b59d965 // "bootstrap(pay,asset,asset)uint64"
pushbytes 0x6b59d965 // "bootstrap(pay,asset,asset)uint<64>"
==
bnz main_l10
txna ApplicationArgs 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ bare_route_create:
==
&&
assert

// no dupn needed
callsub create
int 1
return
Expand Down Expand Up @@ -121,6 +123,7 @@ doOptIn:

// examples/amm/amm.algo.ts:48
// this.doAxfer(this.app.address, asset, 0)
// no dupn needed
int 0
frame_dig -1 // asset: asset
txna Applications 0
Expand Down Expand Up @@ -300,6 +303,8 @@ abi_route_set_governor:
!=
&&
assert

// no dupn needed
txna ApplicationArgs 1
btoi
txnas Accounts
Expand Down Expand Up @@ -334,6 +339,8 @@ abi_route_bootstrap:
!=
&&
assert

// no dupn needed
txna ApplicationArgs 2
btoi
txnas Assets
Expand Down Expand Up @@ -405,18 +412,22 @@ bootstrap:
// examples/amm/amm.algo.ts:104
// this.poolToken.put(this.doCreatePoolToken(aAsset, bAsset))
byte "p"

// no dupn needed
frame_dig -3 // bAsset: asset
frame_dig -2 // aAsset: asset
callsub doCreatePoolToken
app_global_put

// examples/amm/amm.algo.ts:106
// this.doOptIn(aAsset)
// no dupn needed
frame_dig -2 // aAsset: asset
callsub doOptIn

// examples/amm/amm.algo.ts:107
// this.doOptIn(bAsset)
// no dupn needed
frame_dig -3 // bAsset: asset
callsub doOptIn

Expand Down Expand Up @@ -590,6 +601,7 @@ skip_and1:
// if0_consequent
// examples/amm/amm.algo.ts:139
// this.tokensToMintIntial(aXfer.assetAmount, bXfer.assetAmount)
// no dupn needed
frame_dig -2 // bXfer: axfer
gtxns AssetAmount
frame_dig -1 // aXfer: axfer
Expand Down Expand Up @@ -644,6 +656,7 @@ if0_else:

// examples/amm/amm.algo.ts:151
// this.doAxfer(this.txn.sender, poolAsset, toMint)
// no dupn needed
frame_dig -6 // toMint: uint64
frame_dig -3 // poolAsset: asset
txn Sender
Expand Down Expand Up @@ -767,6 +780,7 @@ burn:

// examples/amm/amm.algo.ts:177
// aAmt = this.tokensToBurn(
// no dupn needed
frame_dig -1 // poolXfer: axfer
gtxns AssetAmount
txna Applications 0
Expand All @@ -781,6 +795,7 @@ burn:

// examples/amm/amm.algo.ts:183
// bAmt = this.tokensToBurn(
// no dupn needed
frame_dig -1 // poolXfer: axfer
gtxns AssetAmount
txna Applications 0
Expand All @@ -795,13 +810,15 @@ burn:

// examples/amm/amm.algo.ts:189
// this.doAxfer(this.txn.sender, aAsset, aAmt)
// no dupn needed
frame_dig -6 // aAmt: uint64
frame_dig -3 // aAsset: asset
txn Sender
callsub doAxfer

// examples/amm/amm.algo.ts:190
// this.doAxfer(this.txn.sender, bAsset, bAmt)
// no dupn needed
frame_dig -7 // bAmt: uint64
frame_dig -4 // bAsset: asset
txn Sender
Expand All @@ -810,6 +827,8 @@ burn:
// examples/amm/amm.algo.ts:192
// this.ratio.put(this.computeRatio())
byte "r"

// no dupn needed
callsub computeRatio
app_global_put
retsub
Expand Down Expand Up @@ -946,6 +965,7 @@ ternary1_end:

// examples/amm/amm.algo.ts:219
// this.doAxfer(this.txn.sender, outId, toSwap)
// no dupn needed
frame_dig -6 // toSwap: uint64
frame_dig -4 // outId: asset
txn Sender
Expand All @@ -954,6 +974,8 @@ ternary1_end:
// examples/amm/amm.algo.ts:221
// this.ratio.put(this.computeRatio())
byte "r"

// no dupn needed
callsub computeRatio
app_global_put
retsub
Expand All @@ -973,4 +995,5 @@ route_abi:
method "burn(axfer,asset,asset,asset)void"
method "swap(axfer,asset,asset)void"
txna ApplicationArgs 0
match abi_route_set_governor abi_route_bootstrap abi_route_mint abi_route_burn abi_route_swap
match abi_route_set_governor abi_route_bootstrap abi_route_mint abi_route_burn abi_route_swap
err
2 changes: 1 addition & 1 deletion examples/amm/tealscript_artifacts/ConstantProductAMM.json

Large diffs are not rendered by default.

Loading

0 comments on commit 4718d07

Please sign in to comment.