Skip to content

Commit

Permalink
event hash calculation based on string. renamed file
Browse files Browse the repository at this point in the history
  • Loading branch information
NanezX committed Nov 17, 2023
1 parent 0cb26f1 commit 7c1e668
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 16 deletions.
15 changes: 0 additions & 15 deletions subgraph/src/utils/constants/index.ts

This file was deleted.

2 changes: 1 addition & 1 deletion subgraph/src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export * from "./entity/create";
export * from "./entity/get";
export * from "./bigNumbers";
export * from "./constants";
export * from "./topics";
export * from "./entityString";
export * from "./contentMeta";
26 changes: 26 additions & 0 deletions subgraph/src/utils/topics/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { Bytes } from "@graphprotocol/graph-ts";
import { getKeccak256FromBytes } from "@rainprotocol/subgraph-utils";

// Orderbook: TakeOrder
export let TAKE_ORDER_EVENT_TOPIC = getKeccak256FromBytes(
Bytes.fromUTF8(
"TakeOrder(address,((address,bool,(address,address,address),(address,uint8,uint256)[],(address,uint8,uint256)[]),uint256,uint256,(address,uint256[],bytes)[]),uint256,uint256)"
)
).toHexString();

// Orderbook: Clear
export let CLEAR_EVENT_TOPIC = getKeccak256FromBytes(
Bytes.fromUTF8(
"Clear(address,(address,bool,(address,address,address),(address,uint8,uint256)[],(address,uint8,uint256)[]),(address,bool,(address,address,address),(address,uint8,uint256)[],(address,uint8,uint256)[]),(uint256,uint256,uint256,uint256,uint256,uint256))"
)
).toHexString();

// Orderbook: AfterClear
export let AFTER_CLEAR_EVENT_TOPIC = getKeccak256FromBytes(
Bytes.fromUTF8("AfterClear(address,(uint256,uint256,uint256,uint256))")
).toHexString();

// ExpressionDeployer: NewExpression
export let NEW_EXPRESSION_EVENT_TOPIC = getKeccak256FromBytes(
Bytes.fromUTF8("NewExpression(address,bytes,uint256[],uint256[])")
).toHexString();

0 comments on commit 7c1e668

Please sign in to comment.