explorer icon indicating copy to clipboard operation
explorer copied to clipboard

Post-conditions and Clarity 3 deployment limitations

Open Rapha-btc opened this issue 5 months ago • 1 comments

Summary

Two related issues are preventing proper contract deployment and testing on the Hiro platform:

  1. Post-condition restriction blocks token transfers during deployment
  2. Sandbox explorer lacks Clarity 3 support

Issue 1: Post-condition prevents contract deployment with token transfers

Description

When deploying contracts that include initialization code to transfer tokens (e.g., funding a contract or executing transfers in the constructor), the platform's default post-condition of "sending 0 STX" causes deployment to fail.

Steps to reproduce

  1. Deploy a contract with initialization code that transfers tokens
  2. Contract deployment fails due to post-condition mismatch
  3. Tokens are transferred during deployment, but post-condition expects 0 STX movement

Expected behavior

The platform should either:

  • Allow modification of post-conditions during contract deployment
  • Automatically detect when contracts will transfer tokens and adjust post-conditions
  • Provide clearer guidance on handling post-conditions for complex deployments

Impact

This prevents deployment of legitimate contracts that need to execute token transfers as part of their initialization logic.

Issue 2: Sandbox explorer doesn't support Clarity 3 deployment

Description

The Hiro explorer's sandbox environment only supports older Clarity versions, preventing testing of contracts that use Clarity 3 features like get-tenure-info?.

Steps to reproduce

  1. Attempt to deploy a contract using Clarity 3 features in sandbox
  2. Functions like get-tenure-info? are not recognized
  3. Contract fails to deploy or execute properly

Expected behavior

Sandbox should support the latest Clarity version (Clarity 3) to enable proper testing of modern contracts.

Impact

Developers cannot test Clarity 3 contracts using the official Hiro tools, forcing them to use third-party solutions or mainnet for testing.

Environment

  • Platform: Hiro Web Platform
  • Browser: [Browser details]
  • Network: Mainnet/Testnet

Workaround

Currently using third-party tools like STXER for proper Clarity 3 contract testing and deployment simulation.

Request

Please consider:

  1. Updating post-condition handling for contract deployments
  2. Upgrading sandbox to support Clarity 3
  3. Providing better documentation on post-condition management for complex deployments

Rapha-btc avatar Aug 16 '25 22:08 Rapha-btc

Hi @Rapha-btc

The Explorer Sandbox supports deployments of Clarity 3 projects after this PR was merged.

I'll tag @beguene for Platform

andresgalante avatar Aug 19 '25 16:08 andresgalante