Message Board
Loading…
Post a message (no ABI file)
Pay at least the asking price (—). Overpay is allowed. No refund. The next price is 2× the amount you pay.
You only need Foundry cast and a private key. You do not need the contract ABI JSON. post(string) is enough for encoding.
Mainsail block time is milliseconds. This V1 contract uses Solidity 7 days (= 604800). Against millisecond time, the hold is about 10 minutes, then the price falls for about 10 minutes to 10 ARK.
- Get test DARK from the faucet.
- Use
--legacyand--gas-price 5gwei. This RPC does not supporteth_sendTransaction;cast sendstill works because it sends a raw tx. - Post a short message (set
--value≥ asking price):
cast send --rpc-url https://testnet.mainsailhq.com/rpc/api \ --private-key <key> --legacy --gas-price 5gwei --gas-limit 500000 \ --value 10ether \ 0x5A45367DE62D59dfF38B79Efd2e92d89E25fAdBF \ "post(string)" "hello board"
For ASCII art, put the text in art.txt (keep it under about 7 KB), then:
cast send --rpc-url https://testnet.mainsailhq.com/rpc/api \ --private-key <key> --legacy --gas-price 5gwei --gas-limit 4000000 \ --value 10ether \ 0x5A45367DE62D59dfF38B79Efd2e92d89E25fAdBF \ "post(string)" "$(cat art.txt)"
Read the live price with no ABI (selector askingPrice() = 0x1a7ac726):
curl -s https://testnet.mainsailhq.com/rpc/api -X POST -H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"eth_call","params":[{"to":"0x5A45367DE62D59dfF38B79Efd2e92d89E25fAdBF","data":"0x1a7ac726"},"latest"]}'
The result is a 32-byte hex integer (wei). Divide by 1018 for ARK. If cast send fails on receipt parse, the tx can still land — refresh this page.
Post with mainsail-tx-tester
This path needs the MessageBoard ABI in the tester config.
- In
mainsail-tx-tester/config/networks/testnet.js, setsenderPassphrase. - From
mainsail-tx-testerrunpnpm run start. Find the number next to MessageBoard. That is<n>. - Post (last number is wei; it must be ≥ asking price):
pnpm run start <n> 1 '["your message"]' 10000000000000000000
Function index 1 is post. Index 3 is askingPrice. Do not use 0 (that deploys a new copy).