Post-conditions and Clarity 3 deployment limitations
Summary
Two related issues are preventing proper contract deployment and testing on the Hiro platform:
- Post-condition restriction blocks token transfers during deployment
- 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
- Deploy a contract with initialization code that transfers tokens
- Contract deployment fails due to post-condition mismatch
- 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
- Attempt to deploy a contract using Clarity 3 features in sandbox
- Functions like
get-tenure-info?are not recognized - 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:
- Updating post-condition handling for contract deployments
- Upgrading sandbox to support Clarity 3
- Providing better documentation on post-condition management for complex deployments
Hi @Rapha-btc
The Explorer Sandbox supports deployments of Clarity 3 projects after this PR was merged.
I'll tag @beguene for Platform