From d6455be83b6f266644683ce13bc2ef83c4eeea8a Mon Sep 17 00:00:00 2001 From: Jakub Dzikowski Date: Wed, 7 Oct 2026 11:38:53 +0200 Subject: [PATCH] Fix: Limit vesting token creation in the SDK template Creating a vesting token uses the same curator gate as creating a token class. Co-authored-by: Cursor --- .../chaincode-template/e2e/__snapshots__/api.spec.ts.snap | 2 +- .../chaincode-template/src/token/GalaChainTokenContract.ts | 3 ++- .../src/token/__snapshots__/api.spec.ts.snap | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/chain-cli/chaincode-template/e2e/__snapshots__/api.spec.ts.snap b/chain-cli/chaincode-template/e2e/__snapshots__/api.spec.ts.snap index 51395b7e6b..7755dd520c 100644 --- a/chain-cli/chaincode-template/e2e/__snapshots__/api.spec.ts.snap +++ b/chain-cli/chaincode-template/e2e/__snapshots__/api.spec.ts.snap @@ -3298,7 +3298,7 @@ The key is generated by the caller and should be unique for each DTO. You can us }, }, { - "description": " Transaction updates the chain (submit). Allowed roles: SUBMIT.", + "description": " Transaction updates the chain (submit). Allowed roles: CURATOR.", "dtoSchema": { "description": "Contains properties of vesting token to be created.", "properties": { diff --git a/chain-cli/chaincode-template/src/token/GalaChainTokenContract.ts b/chain-cli/chaincode-template/src/token/GalaChainTokenContract.ts index 8b4325f479..56bddd8393 100644 --- a/chain-cli/chaincode-template/src/token/GalaChainTokenContract.ts +++ b/chain-cli/chaincode-template/src/token/GalaChainTokenContract.ts @@ -822,7 +822,8 @@ export default class GalaChainTokenContract extends GalaContract { @Submit({ in: CreateVestingTokenDto, - out: VestingToken + out: VestingToken, + ...requireCuratorAuth }) public async CreateVestingToken(ctx: GalaChainContext, dto: CreateVestingTokenDto): Promise { const authorities = dto.tokenClass.authorities diff --git a/chain-cli/chaincode-template/src/token/__snapshots__/api.spec.ts.snap b/chain-cli/chaincode-template/src/token/__snapshots__/api.spec.ts.snap index 428330fd92..d74807f0e5 100644 --- a/chain-cli/chaincode-template/src/token/__snapshots__/api.spec.ts.snap +++ b/chain-cli/chaincode-template/src/token/__snapshots__/api.spec.ts.snap @@ -1817,7 +1817,7 @@ The key is generated by the caller and should be unique for each DTO. You can us }, }, { - "description": " Transaction updates the chain (submit). Allowed roles: SUBMIT.", + "description": " Transaction updates the chain (submit). Allowed roles: CURATOR.", "dtoSchema": { "description": "Contains properties of vesting token to be created.", "properties": {