docs: add Arc Transaction Memo integration example with Multi-Agent O…#182
Conversation
|
Great work documenting this — we've been integrating the Memo precompile into Arc Swap (a token swap + gasless payment DApp on Arc Testnet) and have some findings that might be useful. The function name is
|
Alternative pattern: embed memo in the contract rather than using the Memo precompileGreat PR — having Why a third pattern is neededWe originally tried the self-call memo approach — encode a UTF-8 string as calldata and send from the user address to itself. This fails on Arc at the consensus level with: This is a different error from the gas-estimation bug in issue #189 — the transaction is rejected at block inclusion, not during estimation, so passing an explicit Pattern 3 — memo as a contract function parameterAdd // BatchTransfer.sol — deployed on Arc Testnet
// 0x76d5dd51ad28D607cD8804dc5230cAE93403eD3d (source-verified)
event BatchExecuted(
address indexed sender,
address indexed token,
uint256 totalAmount,
uint256 count,
string memo // stored in the event log, decoded by name on ArcScan
);
function batchTransfer(
address token,
address[] calldata recipients,
uint256[] calldata amounts,
string calldata memo // caller passes the memo string directly
) external {
// ... ERC-20 transfer loop ...
emit BatchExecuted(msg.sender, token, total, recipients.length, memo);
}Frontend call (viem): await walletClient.writeContract({
address: "0x76d5dd51ad28D607cD8804dc5230cAE93403eD3d",
abi: BATCH_TRANSFER_ABI,
functionName: "batchTransfer",
args: [tokenAddr, recipients, amounts, "Invoice MR"],
gas: 80_000n + BigInt(recipients.length) * 60_000n,
});Because the contract is source-verified on ArcScan, the Live example — memo Decision guide for builders
The self-call restriction is filed separately as a standalone issue for documentation purposes. Happy to provide a full working example for Pattern 3 if it would be a useful addition to this PR. |
Summary
This PR adds an example showing how to integrate Arc's newly announced Transaction Memos feature (June 18, 2026) with an existing contract, without modifying it.
What's included
Live Verification
Tested against the MultiAgentOrchestrator contract from arc-multi-agent:
Note on signature derivation
Since the official ABI wasn't published in docs.arc.io at the time of writing, the function signature was reverse-engineered by inspecting the Memo contract bytecode dispatcher and decoding a real on-chain transaction's calldata.
Related PRs
This is the 9th example added to this series:
1-8. Foundry, X402, ERC-8004, ERC-8183, Unified Flow, Dashboard, MCP Server, Multi-Agent
9. Transaction Memo integration (this PR)