Build a STX pc

Description

A helper function that creates a post-condition for STX token transfers using the Pc builder class, ensuring exact amounts are transferred as expected.

Use Cases

  • Securing STX token transfers with transfer amount validation

  • Protecting users from unexpected token transfers

  • Ensuring contract interactions behave as expected

Key Concepts

  • Pc.principal() - Specify the principal that will send tokens

  • .willSendEq() - Ensure exactly this amount is sent (also supports willSendGte, willSendLte, willSendGt, willSendLt)

  • .ustx() - Specify the token type (micro-STX)

Last updated

Was this helpful?