Skip to content

Commit 23f622a

Browse files
committed
feat: upgraded to puya-ts 1.0.1 & fixed a registration bug with the escrow factory
1 parent 49a473a commit 23f622a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+85554
-63604
lines changed

assets/arc-0058/projects/arc-0058/package-lock.json

Lines changed: 32 additions & 95 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/arc-0058/projects/arc-0058/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "Smart contract deployer",
55
"main": "smart_contracts/index.ts",
66
"scripts": {
7-
"build": "algokit compile ts smart_contracts --output-source-map --out-dir artifacts && algokit generate client smart_contracts/artifacts --output {app_spec_dir}/{contract_name}Client.ts",
7+
"build": "algokit compile ts smart_contracts --puya-path=puya --output-source-map --out-dir artifacts && algokit generate client smart_contracts/artifacts --output {app_spec_dir}/{contract_name}Client.ts",
88
"deploy": "ts-node-dev --transpile-only --watch .env -r dotenv/config smart_contracts/index.ts",
99
"deploy:ci": "ts-node --transpile-only -r dotenv/config smart_contracts/index.ts",
1010
"lint": "eslint smart_contracts",
@@ -21,7 +21,7 @@
2121
"npm": ">=9.0"
2222
},
2323
"dependencies": {
24-
"@algorandfoundation/algorand-typescript": "1.0.0-alpha.75",
24+
"@algorandfoundation/algorand-typescript": "^1.0.1",
2525
"@jest/globals": "^29.7.0",
2626
"jest": "^29.7.0",
2727
"ts-jest": "^29.4.0"
@@ -30,8 +30,8 @@
3030
"@algorandfoundation/algokit-client-generator": "^6.0.1-beta.2",
3131
"@algorandfoundation/algokit-utils": "^9.1.2",
3232
"@algorandfoundation/algokit-utils-debug": "^1.0.4",
33-
"@algorandfoundation/algorand-typescript-testing": "~1.0.0-beta.30 <1.0.0",
34-
"@algorandfoundation/puya-ts": "1.0.0-alpha.75",
33+
"@algorandfoundation/algorand-typescript-testing": "^1.0.1",
34+
"@algorandfoundation/puya-ts": "^1.0.1",
3535
"@eslint/js": "^9.18.0",
3636
"@rollup/plugin-typescript": "^12.1.2",
3737
"@tsconfig/node22": "^22.0.0",

assets/arc-0058/projects/arc-0058/smart_contracts/abstracted_account/constants.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ export const DynamicOffsetAndLength: uint64 = 4
2323
export const DynamicOffset: uint64 = 2
2424
export const DynamicLength: uint64 = 2
2525

26-
export const MinPluginMBR: uint64 = 36_100
27-
export const MinNamedPluginMBR: uint64 = 18_900
28-
export const MinEscrowsMBR: uint64 = 6_100
26+
export const MinPluginMBR: uint64 = 38_900
27+
export const MinNamedPluginMBR: uint64 = 21_700
28+
export const MinEscrowsMBR: uint64 = 6_500
2929
export const MinAllowanceMBR: uint64 = 27_700
3030
export const MinExecutionsMBR: uint64 = 20_500

assets/arc-0058/projects/arc-0058/smart_contracts/abstracted_account/contract.algo.ts

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -91,20 +91,17 @@ export class AbstractedAccount extends Contract {
9191
.submit()
9292
}
9393

94-
const id = abiCall(
95-
EscrowFactory.prototype.new,
96-
{
97-
sender: this.controlledAddress.value,
98-
appId: this.escrowFactory.value,
99-
args: [
100-
itxn.payment({
101-
sender: this.controlledAddress.value,
102-
amount: NewCostForARC58 + Global.minBalance,
103-
receiver: this.escrowFactory.value.address
104-
}),
105-
]
106-
}
107-
).returnValue
94+
const id = abiCall<typeof EscrowFactory.prototype.new>({
95+
sender: this.controlledAddress.value,
96+
appId: this.escrowFactory.value,
97+
args: [
98+
itxn.payment({
99+
sender: this.controlledAddress.value,
100+
amount: NewCostForARC58 + Global.minBalance,
101+
receiver: this.escrowFactory.value.address
102+
}),
103+
]
104+
}).returnValue
108105

109106
this.escrows(escrow).value = { id, locked: false }
110107

@@ -438,19 +435,16 @@ export class AbstractedAccount extends Contract {
438435
app = this.escrows(escrow).value.id
439436
}
440437

441-
abiCall(
442-
EscrowFactory.prototype.register,
443-
{
444-
appId: this.escrowFactory.value,
445-
args: [
446-
itxn.payment({
447-
receiver: this.escrowFactory.value.address,
448-
amount: ARC58WalletIDsByAccountsMbr
449-
}),
450-
app
451-
]
452-
}
453-
)
438+
abiCall<typeof EscrowFactory.prototype.register>({
439+
appId: this.escrowFactory.value,
440+
args: [
441+
itxn.payment({
442+
receiver: this.escrowFactory.value.address,
443+
amount: ARC58WalletIDsByAccountsMbr
444+
}),
445+
app
446+
]
447+
})
454448
}
455449

456450
/**
@@ -1000,7 +994,7 @@ export class AbstractedAccount extends Contract {
1000994

1001995
assert(this.plugins(key).exists, ERR_PLUGIN_DOES_NOT_EXIST)
1002996
assert(this.escrows(escrow).exists, ERR_ESCROW_DOES_NOT_EXIST)
1003-
assert(this.escrows(escrow).value.locked, ERR_ESCROW_LOCKED)
997+
assert(!this.escrows(escrow).value.locked, ERR_ESCROW_LOCKED)
1004998

1005999
const escrowID = this.escrows(escrow).value.id
10061000

0 commit comments

Comments
 (0)