Skip to content

Commit

Permalink
Merge pull request #4 from algorandfoundation/fix/tealscript_contract
Browse files Browse the repository at this point in the history
fix discrepancies in TEALScript contract
  • Loading branch information
joe-p authored Nov 12, 2024
2 parents b2942cb + cbcc532 commit bb44d33
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tealscript_contracts/kitchen-sink-tealscript.algo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import { Contract } from "@algorandfoundation/tealscript";

export class KitchenSinkContract extends Contract {
globalInt = GlobalStateKey<uint64>();
globalString = GlobalStateKey<string>();
globalString = GlobalStateKey<string>({ key: "customKey" });

localBigInt = LocalStateKey<uint<512>>();

boxOfArray = BoxKey<uint64[]>({ key: "b" });
boxMap = BoxMap<Address, uint64>({ prefix: "" });
boxRef = BoxKey<bytes>({ key: "ff" });
boxMap = BoxMap<Address, bytes>({ prefix: "" });
boxRef = BoxKey<bytes>({ key: "FF" });

useState(a: uint64, b: string, c: uint64) {
this.globalInt.value *= a;
Expand All @@ -22,7 +22,7 @@ export class KitchenSinkContract extends Contract {
}
}

createApp() {
createApplication() {
this.globalInt.value = 4;
this.globalInt.value = this.app.id;
}
Expand All @@ -31,13 +31,13 @@ export class KitchenSinkContract extends Contract {

addToBox(x: uint64) {
if (!this.boxOfArray.exists) {
this.boxOfArray.value = [];
this.boxOfArray.value = [x];
} else {
this.boxOfArray.value.push(x);
}
}

addToBoxMap(x: uint64) {
addToBoxMap(x: string) {
this.boxMap(this.txn.sender).value = x;
}

Expand Down

0 comments on commit bb44d33

Please sign in to comment.