Events

Events emitted by Totems contracts. Use these to index activity, build notifications, or trigger off-chain processes.

Totems Contract

TotemCreated

Emitted when a new Totem is created.

event TotemCreated(string ticker, address indexed creator);
ParameterDescription
tickerThe Totem’s ticker symbol
creatorAddress that created the Totem

TotemTransferred

Emitted on every Totem transfer.

event TotemTransferred(string ticker, address indexed from, address indexed to, uint256 amount);
ParameterDescription
tickerThe Totem’s ticker symbol
fromSender address
toRecipient address
amountNumber of Totems transferred

TotemMinted

Emitted when Totems are minted.

event TotemMinted(string ticker, address indexed minter, address mod, uint256 minted, uint256 payment);
ParameterDescription
tickerThe Totem’s ticker symbol
minterAddress that initiated the mint
modMinter mod address used
mintedActual number of Totems minted
paymentNative currency paid (in wei)

TotemBurned

Emitted when Totems are burned.

event TotemBurned(string ticker, address indexed owner, uint256 amount);
ParameterDescription
tickerThe Totem’s ticker symbol
ownerAddress that burned the Totems
amountNumber of Totems burned

RelayAuthorized

Emitted when a relay is added to a Totem.

event RelayAuthorized(string ticker, address indexed relay);
ParameterDescription
tickerThe Totem’s ticker symbol
relayThe relay contract address

RelayRevoked

Emitted when a relay is removed from a Totem.

event RelayRevoked(string ticker, address indexed relay);
ParameterDescription
tickerThe Totem’s ticker symbol
relayThe relay contract address

TotemOwnershipTransferred

Emitted when a totem’s ownership is transferred to a new address.

event TotemOwnershipTransferred(string ticker, address indexed previousOwner, address indexed newOwner);
ParameterDescription
tickerThe totem’s ticker symbol
previousOwnerAddress of the previous creator/owner
newOwnerAddress of the new creator/owner

Market Contract

ModPublished

Emitted when a mod is published to the marketplace.

event ModPublished(address indexed mod);
ParameterDescription
modThe mod contract address

ModUpdated

Emitted when a mod’s price or details are updated.

event ModUpdated(address indexed mod);
ParameterDescription
modThe mod contract address

Relay Factory

RelayCreated

Emitted when a new relay is created via a factory.

event RelayCreated(string indexed ticker, address indexed relayContract);
ParameterDescription
tickerThe totem’s ticker symbol
relayContractThe deployed relay contract address

Listening to Events

Ethers.js

const totems = new ethers.Contract(address, abi, provider);

// Listen for transfers
totems.on("TotemTransferred", (ticker, from, to, amount) => {
    console.log(`${amount} ${ticker} transferred from ${from} to ${to}`);
});

// Listen for mints
totems.on("TotemMinted", (ticker, minter, mod, minted, payment) => {
    console.log(`${minter} minted ${minted} ${ticker}`);
});

// Query historical events
const filter = totems.filters.TotemTransferred();
const events = await totems.queryFilter(filter, fromBlock, toBlock);

Viem

const unwatch = publicClient.watchContractEvent({
    address: totemsAddress,
    abi: totemsAbi,
    eventName: 'TotemTransferred',
    onLogs: (logs) => {
        for (const log of logs) {
            console.log(log.args);
        }
    }
});
<-
Contract Addresses
Errors
->