Contract Details:
- Address:
ST2EX94QMG4FEHYV9KRJRX9BGM313YJ9DAYKZKWFN - Name:
haiku-basic - Network: Stacks Testnet
- Status: ✅ Deployed and Ready
To test the contract functions, you need your private key (not the mnemonic):
-
Hiro Wallet:
- Open Hiro Wallet
- Go to Settings → Security
- Export Private Key
- Copy the private key (starts with letters/numbers)
-
Xverse Wallet:
- Open Xverse
- Go to Settings → Security
- Export Private Key
- Copy the private key
-
Update the test script:
cd backend nano test-full-contract.js -
Replace
YOUR_PRIVATE_KEY_HEREwith your actual private key -
Uncomment the transaction code in the script
-
Run the test:
node test-full-contract.js
You can also test the contract manually:
-
Test Functions:
initialize- Initialize the contract (call once)fund-stx- Fund contract with STXcreate-haiku- Create haiku paymentclaim-with-haiku- Claim payment using haikuemergency-withdraw- Withdraw all funds
(initialize)- Purpose: Initialize the contract (can only be called once)
- Caller: Contract owner only
- Cost: ~0.001 STX
(fund-stx amount)- Purpose: Add STX to the contract
- Parameters:
amount(in microSTX) - Caller: Funder only
- Cost: ~0.001 STX + amount
(create-haiku haiku-hash stx-amount)- Purpose: Create a haiku-protected payment
- Parameters:
haiku-hash: SHA-256 hash of the haikustx-amount: Amount in microSTX
- Caller: Funder only
- Cost: ~0.001 STX
(claim-with-haiku haiku-hash)- Purpose: Claim payment using the correct haiku
- Parameters:
haiku-hash: SHA-256 hash of the haiku - Caller: Anyone with correct haiku
- Cost: ~0.001 STX
(emergency-withdraw)- Purpose: Withdraw all remaining funds
- Caller: Funder only
- Cost: ~0.001 STX
- Initialize the contract (once)
- Fund the contract with STX
- Create a haiku payment
- Claim the payment using the haiku
- Test emergency withdrawal
- Contract Explorer: https://explorer.stacks.co/contract/ST2EX94QMG4FEHYV9KRJRX9BGM313YJ9DAYKZKWFN.haiku-basic?chain=testnet
- Testnet Faucet: https://explorer.stacks.co/sandbox/faucet
- Testnet Explorer: https://explorer.stacks.co/?chain=testnet
After testing the contract functions:
- Integrate with Frontend: Connect the frontend to the deployed contract
- Test Full Flow: Create haikus through the frontend
- Deploy to Mainnet: When ready for production
- Testnet Only: This contract is on testnet - use testnet STX only
- Private Key Security: Never share your private key
- Gas Fees: Each transaction costs ~0.001 STX in fees
- One-Time Init: Contract can only be initialized once