Skip to content

Commit

Permalink
make sure policy only has a single SPL token transfer
Browse files Browse the repository at this point in the history
  • Loading branch information
omkarshanbhag committed Dec 13, 2024
1 parent c2f41ca commit d47f48e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/with-solana/src/allowTokenTransferPolicy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,12 +338,12 @@ async function createTokenPolicy() {
defaultOrganizationId: organizationId,
});

// Create policy to allow non root user to send SPL tokens to the Token account address for Warchest
// Create policy to allow non root user to send a Solana transaction that only conains a SINGLE instruction --> one SPL token transfer to the Token account address for Warchest
await createPolicy(
rootUserClient.apiClient(),
`Let non root user send SPL transfers to the ATA of WARCHEST: ${ataWarchest.toString()}`,
"EFFECT_ALLOW",
`approvers.any(user, user.id == '${nonRootUserID}')`,
`solana.tx.spl_transfers.any(transfer, transfer.to == '${ataWarchest.toString()}')`
`solana.tx.instructions.count() == 1 && solana.tx.spl_transfers.any(transfer, transfer.to == '${ataWarchest.toString()}')`
);
}

0 comments on commit d47f48e

Please sign in to comment.