Event signature · Lending

Repay (Morpho Blue) event signature and topic0

The topic0 of the Repay (Morpho Blue) event is 0x52acb05cebbd3cd39715469f22afbf5a17496295ef3bc9bb5944056c63ccaa09, the keccak-256 hash of Repay(bytes32,address,address,uint256,uint256); 3 of its 5 arguments are indexed. Debt repaid on a Morpho Blue market.

Anatomy of a Repay (Morpho Blue) log

Topics

  • topic00x52acb05cebbd3cd39715469f22afbf5a17496295ef3bc9bb5944056c63ccaa09keccak256("Repay(bytes32,address,address,uint256,uint256)")
  • topic1id (bytes32)indexed: filterable
  • topic2caller (address)indexed: filterable
  • topic3onBehalf (address)indexed: filterable

Data

  • dataassets (uint256), shares (uint256)ABI-encoded, decoded with the ABI
Parameters

Arguments and where they sit in the log

Indexed arguments travel as topics and can be filtered cheaply; the others are ABI-encoded together in the data.

NameTypeIn the log
idbytes32topic1
calleraddresstopic2
onBehalfaddresstopic3
assetsuint256data
sharesuint256data

Solidity declaration

event Repay(bytes32 indexed id, address indexed caller, address indexed onBehalf, uint256 assets, uint256 shares);

Canonical signature

Repay(bytes32,address,address,uint256,uint256)

topic0

0x52acb05cebbd3cd39715469f22afbf5a17496295ef3bc9bb5944056c63ccaa09

Ready-made alerts

Get an alert on Repay

Each rule opens with the contract and the conditions filled in. Sign in, pick your chat and click Create.

Who emits it

Contracts we list that emit Repay

Any other contract with the same signature emits a log with the same topic0.

Code

Read Repay logs in code

The same filter in viem, ethers and plain JSON-RPC, and the Solidity that emits it. The address is Morpho Blue, a contract we list that emits it.

viem
import { createPublicClient, http, parseAbiItem } from "viem"
import { mainnet } from "viem/chains"

const client = createPublicClient({ chain: mainnet, transport: http() })

const logs = await client.getLogs({
  address: "0xbbbbbbbbbb9cc5e90e3b3af64bdaf62c37eeffcb",
  event: parseAbiItem("event Repay(bytes32 indexed id, address indexed caller, address indexed onBehalf, uint256 assets, uint256 shares)"),
  fromBlock: "latest",
})

for (const log of logs) console.log(log.args) // { id, caller, onBehalf, assets, shares }
ethers v6
import { Interface, JsonRpcProvider } from "ethers"

const provider = new JsonRpcProvider(process.env.RPC_URL)
const iface = new Interface(["event Repay(bytes32 indexed id, address indexed caller, address indexed onBehalf, uint256 assets, uint256 shares)"])

const logs = await provider.getLogs({
  address: "0xbbbbbbbbbb9cc5e90e3b3af64bdaf62c37eeffcb",
  topics: [iface.getEvent("Repay")!.topicHash],
})

for (const log of logs) console.log(iface.parseLog(log)?.args)
JSON-RPC (eth_getLogs)
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "eth_getLogs",
  "params": [
    {
      "address": "0xbbbbbbbbbb9cc5e90e3b3af64bdaf62c37eeffcb",
      "topics": [
        "0x52acb05cebbd3cd39715469f22afbf5a17496295ef3bc9bb5944056c63ccaa09"
      ],
      "fromBlock": "latest"
    }
  ]
}
Solidity
event Repay(bytes32 indexed id, address indexed caller, address indexed onBehalf, uint256 assets, uint256 shares);

// inside a function:
emit Repay(id, caller, onBehalf, assets, shares);
Example

An example Repay log, encoded and decoded

Placeholder values, not a real transaction: how each argument is stored in the topics and the data, and what decoding gives back.

Encoded (as the node returns it)
  • topic0keccak256("Repay(bytes32,address,address,uint256,uint256)")0x52acb05cebbd3cd39715469f22afbf5a17496295ef3bc9bb5944056c63ccaa09
  • topic1id0xabababababababababababababababababababababababababababababababab
  • topic2caller0x0000000000000000000000002222222222222222222222222222222222222222
  • topic3onBehalf0x0000000000000000000000003333333333333333333333333333333333333333
  • data0x0000000000000000000000000000000000000000000000000000000000000fa00000000000000000000000000000000000000000000000000000000000001388
Decoded with the ABI
  • idbytes32 · indexed0xabababababababababababababababababababababababababababababababab
  • calleraddress · indexed0x2222222222222222222222222222222222222222
  • onBehalfaddress · indexed0x3333333333333333333333333333333333333333
  • assetsuint2564000
  • sharesuint2565000
FAQ

Frequently asked questions

What is the topic0 of the Repay (Morpho Blue) event?

0x52acb05cebbd3cd39715469f22afbf5a17496295ef3bc9bb5944056c63ccaa09: the keccak-256 hash of Repay(bytes32,address,address,uint256,uint256).

Which Repay (Morpho Blue) arguments are indexed?

id, caller, onBehalf are indexed and sit in the log's topics; assets, shares are in the data.

How do I get an alert when a contract emits Repay (Morpho Blue)?

Open one of the ready-made rules on this page, or add any contract and pick Repay (Morpho Blue) from the event list. Conditions can be set on indexed and non-indexed arguments, and each alert names the contract and links to the transaction.

Keep exploring

More event signatures and tools

Know the moment a contract emits it

The Beta plan is free: one wallet and one contract, no credit card.