Skip to content
montra

Add your code

Your code on the launches your product sends, or a launcher contract of your own: either is how a launch is credited to you. Your desk has these lines with your code already in them.

Your code on a launch

A launch counts for you when its transaction carries your code as an ERC-8021 suffix: your code's ASCII, its length in a byte, the schema (0) and a 16-byte marker, appended after the factory call's calldata. The factory never reads it, so the launch is exactly the same; Montra's indexer reads it from the transaction. Add it to every launch your product sends, the first buy included.

viemTypeScript
import { Attribution } from "ox/erc8021"; // ox comes with viem

// your code as ERC-8021 attribution: 0x6d792d7465726d696e616c0b0080218021802180218021802180218021
const dataSuffix = Attribution.toDataSuffix({ codes: ["my-terminal"] });

// the launch you already send, with the suffix after its calldata
const { request } = await client.simulateContract({
  address: factory, abi: factoryAbi, functionName: "launch", args: [params],
  account, value, dataSuffix,
});
await wallet.writeContract(request);

// or once, for every call a wallet client makes
const tagged = createWalletClient({ account, chain, transport: custom(window.ethereum), dataSuffix });
ethers v6TypeScript
import { Contract, concat } from "ethers";

const DATA_SUFFIX = "0x6d792d7465726d696e616c0b0080218021802180218021802180218021";

const factory = new Contract(factoryAddress, factoryAbi, signer);
const tx = await factory.launch.populateTransaction(params, { value });
tx.data = concat([tx.data, DATA_SUFFIX]); // the code after everything the factory reads
await signer.sendTransaction(tx);
The bytesPlain text
<the launch's calldata>
6d792d7465726d696e616c   // "my-terminal", in ASCII
0b   // its length: 11 bytes
00   // schema 0: codes, joined by commas
80218021802180218021802180218021   // the ERC-8021 marker, last
  • Only a code registered before the launch counts, and one builder is credited for each launch: the first registered code in the calldata, read from its start.
  • A smart wallet that wraps the call (a Safe, an ERC-4337 account) carries the factory's calldata, suffix and all, inside its own: the code is still found.
  • A transaction that launches several tokens is credited only through a launcher contract.
  • Montra's own site puts its own code, montra, on its launches. A launch carrying it is Montra's.

Your own launcher contract

A launch your registered contract sends is yours, with or without a suffix. The factory takes whoever calls it as the token's creator, so through your contract the creator is your contract: be honest with your users about it, name them as the fee recipient, and give them the first buy.

A launcher (sketch)Solidity
// Your contract calls the factory, so it is the token's creator: the factory takes msg.sender as the creator, salts
// the token's address with it and sends the first buy to it. Name your user as the fee recipient and pass the first
// buy on, in the same call.
function launchFor(address user, LaunchFactory.LaunchParams memory p) external payable returns (address token) {
    p.feeRecipients = new address[](1);
    p.feeRecipients[0] = user;
    p.feeShares = new uint16[](1);
    p.feeShares[0] = 10_000;
    (token, ) = factory.launch{value: msg.value}(p);
    uint256 bought = IERC20(token).balanceOf(address(this));
    if (bought != 0) IERC20(token).transfer(user, bought);
}
  • Register the contract as a launcher on your desk. It is proven yours by its deployment transaction (sent from your wallet) or by its owner() being your wallet; otherwise we check it by hand.
  • The token's address is salted with your contract's address, so launches through it never collide with your users' own.
  • A launch whose user is you, or whose fees pay you, earns nothing; a slot of your own in the creator's fee split, at most 20%, is your fee and allowed.

Trading integrations

Everything a trading integration needs is free: the docs, the ABIs, the API and, once it is published, the SDK. Trading volume itself isn't rewarded: the programme pays for the tokens a product brings to Montra, never for the trades it sends.

  • Finding and trusting a pool, reading it, quoting and trading it, and the fee to show: the build docs.
  • Tokens, wallets and the platform's figures as JSON, and live trades as server-sent events: the API docs.
  • Every contract's address and ABI: the contracts docs.

Check it worked

Each launch credited to you shows on your desk within a minute of its block. Paste a launch's transaction there and it says what was read from it, and why it counted or did not.