diff --git a/pkgs/contract/contracts/thankstoken/IThanksToken.sol b/pkgs/contract/contracts/thankstoken/IThanksToken.sol
index 2db86f3..6118e02 100644
--- a/pkgs/contract/contracts/thankstoken/IThanksToken.sol
+++ b/pkgs/contract/contracts/thankstoken/IThanksToken.sol
@@ -18,12 +18,14 @@ interface IThanksToken is IERC20 {
* @param to The address to mint tokens to
* @param amount The amount of tokens to mint
* @param relatedRoles Array of roles related to the sender
+ * @param data Additional data with no specified format
* @return success Whether the operation was successful
*/
function mint(
address to,
uint256 amount,
- RelatedRole[] memory relatedRoles
+ RelatedRole[] memory relatedRoles,
+ bytes memory data
) external returns (bool);
/**
@@ -31,12 +33,14 @@ interface IThanksToken is IERC20 {
* @param to Array of addresses to mint tokens to
* @param amounts Array of amounts of tokens to mint
* @param relatedRoles Array of roles related to the sender
+ * @param data Additional data with no specified format
* @return success Whether the operation was successful
*/
function batchMint(
address[] memory to,
uint256[] memory amounts,
- RelatedRole[] memory relatedRoles
+ RelatedRole[] memory relatedRoles,
+ bytes memory data
) external returns (bool);
/**
@@ -81,5 +85,10 @@ interface IThanksToken is IERC20 {
* @param to The recipient of the minted tokens
* @param amount The amount of tokens minted
*/
- event TokenMinted(address indexed from, address indexed to, uint256 amount);
+ event TokenMinted(
+ address indexed from,
+ address indexed to,
+ uint256 amount,
+ bytes data
+ );
}
diff --git a/pkgs/contract/contracts/thankstoken/ThanksToken.sol b/pkgs/contract/contracts/thankstoken/ThanksToken.sol
index b9b5b32..dc5ddaf 100644
--- a/pkgs/contract/contracts/thankstoken/ThanksToken.sol
+++ b/pkgs/contract/contracts/thankstoken/ThanksToken.sol
@@ -108,7 +108,8 @@ contract ThanksToken is Clone, ERC20("", ""), IThanksToken {
function mint(
address to,
uint256 amount,
- RelatedRole[] memory relatedRoles
+ RelatedRole[] memory relatedRoles,
+ bytes memory data
) public override returns (bool) {
require(to != msg.sender, "Cannot mint to yourself");
require(amount > 0, "Amount must be greater than 0");
@@ -131,7 +132,7 @@ contract ThanksToken is Clone, ERC20("", ""), IThanksToken {
_isParticipant[to] = true;
}
- emit TokenMinted(msg.sender, to, amount);
+ emit TokenMinted(msg.sender, to, amount, data);
return true;
}
@@ -139,7 +140,8 @@ contract ThanksToken is Clone, ERC20("", ""), IThanksToken {
function batchMint(
address[] memory to,
uint256[] memory amounts,
- RelatedRole[] memory relatedRoles
+ RelatedRole[] memory relatedRoles,
+ bytes memory data
) public override returns (bool) {
require(to.length == amounts.length, "Arrays length mismatch");
@@ -165,7 +167,7 @@ contract ThanksToken is Clone, ERC20("", ""), IThanksToken {
_isParticipant[to[i]] = true;
}
- emit TokenMinted(msg.sender, to[i], amounts[i]);
+ emit TokenMinted(msg.sender, to[i], amounts[i], data);
}
if (!_isParticipant[msg.sender]) {
diff --git a/pkgs/contract/scripts/deploy/thankstoken.ts b/pkgs/contract/scripts/deploy/thankstoken.ts
new file mode 100644
index 0000000..3e0f2b8
--- /dev/null
+++ b/pkgs/contract/scripts/deploy/thankstoken.ts
@@ -0,0 +1,60 @@
+import { ethers, network } from "hardhat";
+import type { Address } from "viem";
+import {
+ deployThanksToken,
+ deployThanksTokenFactory,
+} from "../../helpers/deploy/ThanksToken";
+
+const deploy = async () => {
+ console.log(
+ "##################################### [Create2 Deploy START] #####################################",
+ );
+
+ const [deployerSigner] = await ethers.getSigners();
+ const deployerAddress = await deployerSigner.getAddress();
+
+ console.log("Deploying ThanksToken...");
+ const { ThanksToken } = await deployThanksToken();
+ const thanksTokenAddress = ThanksToken.address;
+
+ console.log("Deploying ThanksTokenFactory...");
+
+ const {
+ ThanksTokenFactory,
+ ThanksTokenFactoryImplAddress,
+ ThanksTokenFactoryInitData,
+ } = await deployThanksTokenFactory({
+ initialOwner: deployerAddress as Address,
+ implementation: thanksTokenAddress,
+ hatsAddress: process.env.HATS_ADDRESS as Address,
+ });
+ const thanksTokenFactoryAddress = ThanksTokenFactory.address;
+
+ // Set bigbang address to thanks token factory
+ const ThanksTokenFactoryContract = await ethers.getContractAt(
+ "ThanksTokenFactory",
+ thanksTokenFactoryAddress,
+ );
+ await ThanksTokenFactoryContract.setBigBang(
+ "0xfB4FA9Dbb82a36566154A038e5f3865fbAC92422",
+ );
+
+ console.log("Successfully deployed contracts!π");
+ console.log("Verify contract with these commands...\n");
+
+ console.log(
+ "ThanksToken:\n",
+ `pnpm contract hardhat verify ${thanksTokenAddress} --network ${network.name}\n`,
+ );
+ console.log(
+ "ThanksTokenFactory:\n",
+ `pnpm contract hardhat verify ${ThanksTokenFactoryImplAddress} --network ${network.name} &&`,
+ `pnpm contract hardhat verify ${thanksTokenFactoryAddress} ${ThanksTokenFactoryImplAddress} ${ThanksTokenFactoryInitData} --network ${network.name}\n`,
+ );
+
+ console.log(
+ "\n##################################### [Create2 Deploy END] #####################################",
+ );
+};
+
+deploy();
diff --git a/pkgs/contract/test/IntegrationTest.ts b/pkgs/contract/test/IntegrationTest.ts
index 0072f52..0609f90 100644
--- a/pkgs/contract/test/IntegrationTest.ts
+++ b/pkgs/contract/test/IntegrationTest.ts
@@ -436,6 +436,7 @@ describe("IntegrationTest", () => {
wearer: address1.account?.address!,
},
],
+ "0x",
],
{ account: address1.account },
);
diff --git a/pkgs/contract/test/SplitsCreator.ts b/pkgs/contract/test/SplitsCreator.ts
index 50908ea..2b805f8 100644
--- a/pkgs/contract/test/SplitsCreator.ts
+++ b/pkgs/contract/test/SplitsCreator.ts
@@ -1938,7 +1938,7 @@ describe("CreateSplit with thanks token weight", () => {
expect(Number(mintableAmount1)).to.be.greaterThan(0);
await ThanksToken.write.mint(
- [address2.account?.address!, mintableAmount1 / 2n, relatedRoles1],
+ [address2.account?.address!, mintableAmount1 / 2n, relatedRoles1, "0x"],
{ account: address1.account },
);
@@ -1951,7 +1951,7 @@ describe("CreateSplit with thanks token weight", () => {
expect(Number(mintableAmount2)).to.be.greaterThan(0);
await ThanksToken.write.mint(
- [address3.account?.address!, mintableAmount2 / 2n, relatedRoles2],
+ [address3.account?.address!, mintableAmount2 / 2n, relatedRoles2, "0x"],
{ account: address2.account },
);
diff --git a/pkgs/contract/test/ThanksToken.ts b/pkgs/contract/test/ThanksToken.ts
index 6d60276..d61795b 100644
--- a/pkgs/contract/test/ThanksToken.ts
+++ b/pkgs/contract/test/ThanksToken.ts
@@ -397,7 +397,7 @@ describe("ThanksToken", () => {
expect(Number(mintableAmount)).to.be.equal(600000000000000000000);
await DeployedThanksToken.write.mint(
- [address2Validated, mintableAmount / 2n, relatedRoles],
+ [address2Validated, mintableAmount / 2n, relatedRoles, "0x"],
{
account: address1.account,
},
@@ -542,7 +542,7 @@ describe("ThanksToken", () => {
try {
await DeployedThanksToken.write.mint(
- [address2Validated, amountToMint, relatedRoles],
+ [address2Validated, amountToMint, relatedRoles, "0x"],
{ account: address1.account },
);
} catch (error: any) {
@@ -678,7 +678,7 @@ describe("ThanksToken", () => {
try {
await DeployedThanksToken.write.mint(
- [address1Validated, 1n, relatedRoles],
+ [address1Validated, 1n, relatedRoles, "0x"],
{ account: address1.account },
);
// If we get here, the mint succeeded when it should have failed
@@ -697,7 +697,7 @@ describe("ThanksToken", () => {
];
try {
await DeployedThanksToken.write.mint(
- [address2Validated, 1000000n, relatedRoles],
+ [address2Validated, 1000000n, relatedRoles, "0x"],
{ account: address1.account },
);
// If we get here, the mint succeeded when it should have failed
@@ -735,7 +735,7 @@ describe("ThanksToken", () => {
// Mint from address1 to address3, who is a new participant
await DeployedThanksToken.write.mint(
- [address3Validated, mintableAmount, relatedRoles],
+ [address3Validated, mintableAmount, relatedRoles, "0x"],
{ account: address1.account },
);
@@ -757,7 +757,7 @@ describe("ThanksToken", () => {
expect(mintableAmount2 > 0n).to.be.true;
await DeployedThanksToken.write.mint(
- [address2Validated, mintableAmount2, relatedRoles],
+ [address2Validated, mintableAmount2, relatedRoles, "0x"],
{ account: address1.account },
);
diff --git a/pkgs/frontend/abi/thankstoken.ts b/pkgs/frontend/abi/thankstoken.ts
index e05a663..88ff680 100644
--- a/pkgs/frontend/abi/thankstoken.ts
+++ b/pkgs/frontend/abi/thankstoken.ts
@@ -131,6 +131,12 @@ export const THANKS_TOKEN_ABI = [
name: "amount",
type: "uint256",
},
+ {
+ indexed: false,
+ internalType: "bytes",
+ name: "data",
+ type: "bytes",
+ },
],
name: "TokenMinted",
type: "event",
@@ -353,6 +359,11 @@ export const THANKS_TOKEN_ABI = [
name: "relatedRoles",
type: "tuple[]",
},
+ {
+ internalType: "bytes",
+ name: "data",
+ type: "bytes",
+ },
],
name: "batchMint",
outputs: [
@@ -433,6 +444,11 @@ export const THANKS_TOKEN_ABI = [
name: "relatedRoles",
type: "tuple[]",
},
+ {
+ internalType: "bytes",
+ name: "data",
+ type: "bytes",
+ },
],
name: "mint",
outputs: [
diff --git a/pkgs/frontend/app/components/assistcredit/AmountSelector.tsx b/pkgs/frontend/app/components/assistcredit/AmountSelector.tsx
index 59ab89b..527af4e 100644
--- a/pkgs/frontend/app/components/assistcredit/AmountSelector.tsx
+++ b/pkgs/frontend/app/components/assistcredit/AmountSelector.tsx
@@ -1,4 +1,12 @@
-import { Box, Flex, HStack, Stack, Text, VStack } from "@chakra-ui/react";
+import {
+ Box,
+ Flex,
+ HStack,
+ Stack,
+ Text,
+ Textarea,
+ VStack,
+} from "@chakra-ui/react";
import { Slider, useSlider } from "@chakra-ui/react/slider";
import type { NameData } from "namestone-sdk";
import { useEffect, useState } from "react";
@@ -24,6 +32,8 @@ const getNearestEmoji = (amount: number): number => {
interface AmountSelectorProps {
amount: number;
setAmount: (amount: number) => void;
+ data?: string;
+ setData?: (data: string) => void;
onNext: () => void;
isLoading: boolean;
me?: NameData;
@@ -36,6 +46,8 @@ interface AmountSelectorProps {
const AmountSelector = ({
amount,
setAmount,
+ data,
+ setData,
onNext,
isLoading,
me,
@@ -166,6 +178,19 @@ const AmountSelector = ({
+
+ {setData && (
+
+
+ )}
{
interface SendConfirmationProps {
amount: number;
+ data?: string;
me?: NameData;
receiver?: NameData;
receivers?: NameData[];
@@ -44,6 +45,7 @@ const SWIPE_THRESHOLD = 200;
const SendConfirmation: FC = ({
amount,
+ data,
me,
receiver,
receivers,
@@ -82,12 +84,7 @@ const SendConfirmation: FC = ({
overflow="hidden"
>
- γΉγ―γ€γγγ¦
-
- {["144", "175", "780"].includes(treeId || "")
- ? "γ±γ’γγ€γ³γ"
- : "γγΌγ«γ·γ§γ’"}
- γιγ
+ γΉγ―γ€γγγ¦ιγ
@@ -280,52 +277,56 @@ const SendConfirmation: FC = ({
)}
-
-
-
- {me?.name}
-
-
- {amount}
-
-
-
- {receivers && receivers.length > 0 ? (
- <>
-
- {receivers.slice(0, 3).map((user) => (
-
-
-
- ))}
- {receivers.length > 3 && (
- +{receivers.length - 3}
- )}
-
- {receivers.length}δΊΊ
- >
- ) : receiver ? (
- <>
-
-
- {receiver?.name || abbreviateAddress(receiver?.address || "")}
-
- >
- ) : null}
-
-
+
+
+
+
+ {me?.name}
+
+
+ {amount}
+
+
+
+ {receivers && receivers.length > 0 ? (
+ <>
+
+ {receivers.slice(0, 3).map((user) => (
+
+
+
+ ))}
+ {receivers.length > 3 && (
+ +{receivers.length - 3}
+ )}
+
+ {receivers.length}δΊΊ
+ >
+ ) : receiver ? (
+ <>
+
+
+ {receiver?.name || abbreviateAddress(receiver?.address || "")}
+
+ >
+ ) : null}
+
+
+
+ {data}
+
);
};
diff --git a/pkgs/frontend/app/components/thankstoken/History.tsx b/pkgs/frontend/app/components/thankstoken/History.tsx
index c1ba5ce..f17f402 100644
--- a/pkgs/frontend/app/components/thankstoken/History.tsx
+++ b/pkgs/frontend/app/components/thankstoken/History.tsx
@@ -7,7 +7,7 @@ import { useThanksTokenActivity } from "hooks/useThanksToken";
import { type FC, useMemo } from "react";
import { ipfs2https } from "utils/ipfs";
import { abbreviateAddress } from "utils/wallet";
-import { formatEther } from "viem";
+import { formatEther, hexToString } from "viem";
import { UserIcon } from "../icon/UserIcon";
interface Props {
@@ -43,6 +43,10 @@ const ThanksTokenActivityItem: FC = ({
return names?.[1]?.[0];
}, [names]);
+ const message = useMemo(() => {
+ return hexToString(activity.data || "0x");
+ }, [activity.data]);
+
return (
= ({
+ {message && (
+
+ {message}
+
+ )}
);
};
diff --git a/pkgs/frontend/app/routes/$treeId_.thankstoken.send.tsx b/pkgs/frontend/app/routes/$treeId_.thankstoken.send.tsx
index ad3465d..ab28b40 100644
--- a/pkgs/frontend/app/routes/$treeId_.thankstoken.send.tsx
+++ b/pkgs/frontend/app/routes/$treeId_.thankstoken.send.tsx
@@ -10,7 +10,7 @@ import { useThanksToken } from "hooks/useThanksToken";
import type { NameData } from "namestone-sdk";
import { type FC, useCallback, useEffect, useMemo, useState } from "react";
import { toast } from "react-toastify";
-import { type Address, formatEther, parseEther } from "viem";
+import { type Address, formatEther, parseEther, stringToHex } from "viem";
import { BasicButton } from "~/components/BasicButton";
import { PageHeader } from "~/components/PageHeader";
import AmountSelector from "~/components/assistcredit/AmountSelector";
@@ -27,6 +27,8 @@ const ThanksTokenSend: FC = () => {
const [selectedUsers, setSelectedUsers] = useState([]);
const [amount, setAmount] = useState(0);
+ const [data, setData] = useState("");
+
const [isSend, setIsSend] = useState(false);
const [showAmountSelector, setShowAmountSelector] = useState(false);
@@ -86,11 +88,14 @@ const ThanksTokenSend: FC = () => {
const send = useCallback(async () => {
if (selectedUsers.length === 0 || isLoading) return;
+ const bytesData = data ? stringToHex(data) : undefined;
+
try {
if (selectedUsers.length === 1) {
const res = await mintThanksToken(
selectedUsers[0].address as Address,
parseEther(amount.toString()),
+ bytesData,
);
if (res?.error) throw new Error(res.error);
} else {
@@ -115,6 +120,7 @@ const ThanksTokenSend: FC = () => {
isLoading,
treeId,
navigate,
+ data,
]);
return (
@@ -158,6 +164,7 @@ const ThanksTokenSend: FC = () => {
{isSend ? (
{
setIsSend(true)}
isLoading={isLoading}
me={me.identity}
diff --git a/pkgs/frontend/codegen.ts b/pkgs/frontend/codegen.ts
index 50b0530..b4e3fce 100644
--- a/pkgs/frontend/codegen.ts
+++ b/pkgs/frontend/codegen.ts
@@ -3,7 +3,7 @@ import type { CodegenConfig } from "@graphql-codegen/cli";
const config: CodegenConfig = {
overwrite: true,
schema:
- "https://api.goldsky.com/api/public/project_cm9v3lkp35fui01yx8k3k0xxj/subgraphs/toban-sepolia/1.0.3/gn",
+ "https://api.goldsky.com/api/public/project_cm4r39viziqcd01wo6y96c1r6/subgraphs/toban-base/0.0.1/gn",
documents: ["./**/*.ts", "!./node_modules/**/*", "!./hooks/useHats.ts"],
generates: {
"./gql/": {
diff --git a/pkgs/frontend/gql/gql.ts b/pkgs/frontend/gql/gql.ts
index 25a7612..6eceec0 100644
--- a/pkgs/frontend/gql/gql.ts
+++ b/pkgs/frontend/gql/gql.ts
@@ -17,7 +17,7 @@ const documents = {
"\n query GetTransferFractionTokens($where: TransferFractionToken_filter = {}, $orderBy: TransferFractionToken_orderBy, $orderDirection: OrderDirection = asc, $first: Int = 10) {\n transferFractionTokens(\n where: $where\n orderBy: $orderBy\n orderDirection: $orderDirection\n first: $first\n ) {\n id\n from\n to\n tokenId\n workspaceId\n blockTimestamp\n blockNumber\n amount\n hatsFractionTokenModule {\n id\n }\n }\n }\n": types.GetTransferFractionTokensDocument,
"\n query BalanceOfFractionTokens($where: BalanceOfFractionToken_filter = {}, $orderBy: BalanceOfFractionToken_orderBy, $orderDirection: OrderDirection = asc, $first: Int = 100) {\n balanceOfFractionTokens(where: $where, orderBy: $orderBy, orderDirection: $orderDirection, first: $first) {\n tokenId\n balance\n owner\n workspaceId\n hatId\n id\n updatedAt\n wearer\n }\n }\n": types.BalanceOfFractionTokensDocument,
"\n query GetThanksTokenBalances($where: BalanceOfThanksToken_filter = {}, $orderBy: BalanceOfThanksToken_orderBy, $orderDirection: OrderDirection = asc, $first: Int = 100) {\n balanceOfThanksTokens(\n where: $where\n orderBy: $orderBy\n orderDirection: $orderDirection\n first: $first\n ) {\n id\n thanksToken {\n id\n workspaceId\n }\n owner\n balance\n workspaceId\n updatedAt\n }\n }\n": types.GetThanksTokenBalancesDocument,
- "\n query GetThanksTokenMints($where: MintThanksToken_filter = {}, $orderBy: MintThanksToken_orderBy, $orderDirection: OrderDirection = asc, $first: Int = 10) {\n mintThanksTokens(\n where: $where\n orderBy: $orderBy\n orderDirection: $orderDirection\n first: $first\n ) {\n id\n thanksToken {\n id\n workspaceId\n }\n from\n to\n amount\n workspaceId\n blockTimestamp\n blockNumber\n }\n }\n": types.GetThanksTokenMintsDocument,
+ "\n query GetThanksTokenMints($where: MintThanksToken_filter = {}, $orderBy: MintThanksToken_orderBy, $orderDirection: OrderDirection = asc, $first: Int = 10) {\n mintThanksTokens(\n where: $where\n orderBy: $orderBy\n orderDirection: $orderDirection\n first: $first\n ) {\n id\n thanksToken {\n id\n workspaceId\n }\n from\n to\n data\n amount\n workspaceId\n blockTimestamp\n blockNumber\n }\n }\n": types.GetThanksTokenMintsDocument,
"\n query GetThanksTokenTransfers($where: TransferThanksToken_filter = {}, $orderBy: TransferThanksToken_orderBy, $orderDirection: OrderDirection = asc, $first: Int = 10) {\n transferThanksTokens(\n where: $where\n orderBy: $orderBy\n orderDirection: $orderDirection\n first: $first\n ) {\n id\n thanksToken {\n id\n workspaceId\n }\n from\n to\n amount\n workspaceId\n blockTimestamp\n blockNumber\n }\n }\n": types.GetThanksTokenTransfersDocument,
"\n query GetThanksTokens($where: ThanksToken_filter, $first: Int = 100) {\n thanksTokens(\n where: $where\n first: $first\n ) {\n workspaceId\n }\n }\n": types.GetThanksTokensDocument,
"\n query GetWorkspace($workspaceId: ID!) {\n workspace(id: $workspaceId) {\n id\n minterHatId\n operatorHatId\n owner\n splitCreator\n topHatId\n hatterHatId\n hatsTimeFrameModule\n hatsHatCreatorModule\n creator\n creatorHatId\n blockTimestamp\n blockNumber\n hatsFractionTokenModule {\n id\n }\n thanksToken {\n id\n }\n }\n }\n": types.GetWorkspaceDocument,
@@ -53,7 +53,7 @@ export function graphql(source: "\n query GetThanksTokenBalances($where: Balanc
/**
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
*/
-export function graphql(source: "\n query GetThanksTokenMints($where: MintThanksToken_filter = {}, $orderBy: MintThanksToken_orderBy, $orderDirection: OrderDirection = asc, $first: Int = 10) {\n mintThanksTokens(\n where: $where\n orderBy: $orderBy\n orderDirection: $orderDirection\n first: $first\n ) {\n id\n thanksToken {\n id\n workspaceId\n }\n from\n to\n amount\n workspaceId\n blockTimestamp\n blockNumber\n }\n }\n"): (typeof documents)["\n query GetThanksTokenMints($where: MintThanksToken_filter = {}, $orderBy: MintThanksToken_orderBy, $orderDirection: OrderDirection = asc, $first: Int = 10) {\n mintThanksTokens(\n where: $where\n orderBy: $orderBy\n orderDirection: $orderDirection\n first: $first\n ) {\n id\n thanksToken {\n id\n workspaceId\n }\n from\n to\n amount\n workspaceId\n blockTimestamp\n blockNumber\n }\n }\n"];
+export function graphql(source: "\n query GetThanksTokenMints($where: MintThanksToken_filter = {}, $orderBy: MintThanksToken_orderBy, $orderDirection: OrderDirection = asc, $first: Int = 10) {\n mintThanksTokens(\n where: $where\n orderBy: $orderBy\n orderDirection: $orderDirection\n first: $first\n ) {\n id\n thanksToken {\n id\n workspaceId\n }\n from\n to\n data\n amount\n workspaceId\n blockTimestamp\n blockNumber\n }\n }\n"): (typeof documents)["\n query GetThanksTokenMints($where: MintThanksToken_filter = {}, $orderBy: MintThanksToken_orderBy, $orderDirection: OrderDirection = asc, $first: Int = 10) {\n mintThanksTokens(\n where: $where\n orderBy: $orderBy\n orderDirection: $orderDirection\n first: $first\n ) {\n id\n thanksToken {\n id\n workspaceId\n }\n from\n to\n data\n amount\n workspaceId\n blockTimestamp\n blockNumber\n }\n }\n"];
/**
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
*/
diff --git a/pkgs/frontend/gql/graphql.ts b/pkgs/frontend/gql/graphql.ts
index db7a7db..110f68a 100644
--- a/pkgs/frontend/gql/graphql.ts
+++ b/pkgs/frontend/gql/graphql.ts
@@ -585,6 +585,7 @@ export type MintThanksToken = {
amount: Scalars['BigInt']['output'];
blockNumber: Scalars['BigInt']['output'];
blockTimestamp: Scalars['BigInt']['output'];
+ data: Scalars['Bytes']['output'];
from: Scalars['String']['output'];
id: Scalars['ID']['output'];
thanksToken: ThanksToken;
@@ -620,6 +621,16 @@ export type MintThanksToken_Filter = {
blockTimestamp_lte?: InputMaybe;
blockTimestamp_not?: InputMaybe;
blockTimestamp_not_in?: InputMaybe>;
+ data?: InputMaybe;
+ data_contains?: InputMaybe;
+ data_gt?: InputMaybe;
+ data_gte?: InputMaybe;
+ data_in?: InputMaybe>;
+ data_lt?: InputMaybe;
+ data_lte?: InputMaybe;
+ data_not?: InputMaybe;
+ data_not_contains?: InputMaybe;
+ data_not_in?: InputMaybe>;
from?: InputMaybe;
from_contains?: InputMaybe;
from_contains_nocase?: InputMaybe;
@@ -704,6 +715,7 @@ export enum MintThanksToken_OrderBy {
Amount = 'amount',
BlockNumber = 'blockNumber',
BlockTimestamp = 'blockTimestamp',
+ Data = 'data',
From = 'from',
Id = 'id',
ThanksToken = 'thanksToken',
@@ -1505,11 +1517,12 @@ export type Workspace = {
blockTimestamp: Scalars['BigInt']['output'];
creator: Scalars['String']['output'];
creatorHatId: Scalars['BigInt']['output'];
- hatsFractionTokenModule?: Maybe;
+ hatsFractionTokenModule: HatsFractionTokenModule;
hatsHatCreatorModule: Scalars['String']['output'];
hatsTimeFrameModule: Scalars['String']['output'];
hatterHatId: Scalars['BigInt']['output'];
id: Scalars['ID']['output'];
+ memberHatId: Scalars['BigInt']['output'];
minterHatId: Scalars['BigInt']['output'];
operatorHatId: Scalars['BigInt']['output'];
owner: Scalars['String']['output'];
@@ -1643,6 +1656,14 @@ export type Workspace_Filter = {
id_lte?: InputMaybe;
id_not?: InputMaybe;
id_not_in?: InputMaybe>;
+ memberHatId?: InputMaybe;
+ memberHatId_gt?: InputMaybe;
+ memberHatId_gte?: InputMaybe;
+ memberHatId_in?: InputMaybe>;
+ memberHatId_lt?: InputMaybe;
+ memberHatId_lte?: InputMaybe;
+ memberHatId_not?: InputMaybe;
+ memberHatId_not_in?: InputMaybe>;
minterHatId?: InputMaybe;
minterHatId_gt?: InputMaybe;
minterHatId_gte?: InputMaybe;
@@ -1743,6 +1764,7 @@ export enum Workspace_OrderBy {
HatsTimeFrameModule = 'hatsTimeFrameModule',
HatterHatId = 'hatterHatId',
Id = 'id',
+ MemberHatId = 'memberHatId',
MinterHatId = 'minterHatId',
OperatorHatId = 'operatorHatId',
Owner = 'owner',
@@ -1827,7 +1849,7 @@ export type GetThanksTokenMintsQueryVariables = Exact<{
}>;
-export type GetThanksTokenMintsQuery = { __typename?: 'Query', mintThanksTokens: Array<{ __typename?: 'MintThanksToken', id: string, from: string, to: string, amount: any, workspaceId: string, blockTimestamp: any, blockNumber: any, thanksToken: { __typename?: 'ThanksToken', id: string, workspaceId: string } }> };
+export type GetThanksTokenMintsQuery = { __typename?: 'Query', mintThanksTokens: Array<{ __typename?: 'MintThanksToken', id: string, from: string, to: string, data: any, amount: any, workspaceId: string, blockTimestamp: any, blockNumber: any, thanksToken: { __typename?: 'ThanksToken', id: string, workspaceId: string } }> };
export type GetThanksTokenTransfersQueryVariables = Exact<{
where?: InputMaybe;
@@ -1852,7 +1874,7 @@ export type GetWorkspaceQueryVariables = Exact<{
}>;
-export type GetWorkspaceQuery = { __typename?: 'Query', workspace?: { __typename?: 'Workspace', id: string, minterHatId: any, operatorHatId: any, owner: string, splitCreator: string, topHatId: any, hatterHatId: any, hatsTimeFrameModule: string, hatsHatCreatorModule: string, creator: string, creatorHatId: any, blockTimestamp: any, blockNumber: any, hatsFractionTokenModule?: { __typename?: 'HatsFractionTokenModule', id: string } | null, thanksToken: { __typename?: 'ThanksToken', id: string } } | null };
+export type GetWorkspaceQuery = { __typename?: 'Query', workspace?: { __typename?: 'Workspace', id: string, minterHatId: any, operatorHatId: any, owner: string, splitCreator: string, topHatId: any, hatterHatId: any, hatsTimeFrameModule: string, hatsHatCreatorModule: string, creator: string, creatorHatId: any, blockTimestamp: any, blockNumber: any, hatsFractionTokenModule: { __typename?: 'HatsFractionTokenModule', id: string }, thanksToken: { __typename?: 'ThanksToken', id: string } } | null };
export type GetWorkspacesQueryVariables = Exact<{
where?: InputMaybe;
@@ -1860,13 +1882,13 @@ export type GetWorkspacesQueryVariables = Exact<{
}>;
-export type GetWorkspacesQuery = { __typename?: 'Query', workspaces: Array<{ __typename?: 'Workspace', id: string, minterHatId: any, operatorHatId: any, owner: string, splitCreator: string, topHatId: any, hatterHatId: any, hatsTimeFrameModule: string, hatsHatCreatorModule: string, creator: string, creatorHatId: any, blockTimestamp: any, blockNumber: any, hatsFractionTokenModule?: { __typename?: 'HatsFractionTokenModule', id: string } | null, thanksToken: { __typename?: 'ThanksToken', id: string } }> };
+export type GetWorkspacesQuery = { __typename?: 'Query', workspaces: Array<{ __typename?: 'Workspace', id: string, minterHatId: any, operatorHatId: any, owner: string, splitCreator: string, topHatId: any, hatterHatId: any, hatsTimeFrameModule: string, hatsHatCreatorModule: string, creator: string, creatorHatId: any, blockTimestamp: any, blockNumber: any, hatsFractionTokenModule: { __typename?: 'HatsFractionTokenModule', id: string }, thanksToken: { __typename?: 'ThanksToken', id: string } }> };
export const GetTransferFractionTokensDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetTransferFractionTokens"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"where"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"TransferFractionToken_filter"}},"defaultValue":{"kind":"ObjectValue","fields":[]}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"TransferFractionToken_orderBy"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"OrderDirection"}},"defaultValue":{"kind":"EnumValue","value":"asc"}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"first"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}},"defaultValue":{"kind":"IntValue","value":"10"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"transferFractionTokens"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"where"},"value":{"kind":"Variable","name":{"kind":"Name","value":"where"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderBy"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderDirection"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}}},{"kind":"Argument","name":{"kind":"Name","value":"first"},"value":{"kind":"Variable","name":{"kind":"Name","value":"first"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"from"}},{"kind":"Field","name":{"kind":"Name","value":"to"}},{"kind":"Field","name":{"kind":"Name","value":"tokenId"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceId"}},{"kind":"Field","name":{"kind":"Name","value":"blockTimestamp"}},{"kind":"Field","name":{"kind":"Name","value":"blockNumber"}},{"kind":"Field","name":{"kind":"Name","value":"amount"}},{"kind":"Field","name":{"kind":"Name","value":"hatsFractionTokenModule"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}}]}}]} as unknown as DocumentNode;
export const BalanceOfFractionTokensDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"BalanceOfFractionTokens"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"where"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"BalanceOfFractionToken_filter"}},"defaultValue":{"kind":"ObjectValue","fields":[]}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"BalanceOfFractionToken_orderBy"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"OrderDirection"}},"defaultValue":{"kind":"EnumValue","value":"asc"}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"first"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}},"defaultValue":{"kind":"IntValue","value":"100"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"balanceOfFractionTokens"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"where"},"value":{"kind":"Variable","name":{"kind":"Name","value":"where"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderBy"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderDirection"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}}},{"kind":"Argument","name":{"kind":"Name","value":"first"},"value":{"kind":"Variable","name":{"kind":"Name","value":"first"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"tokenId"}},{"kind":"Field","name":{"kind":"Name","value":"balance"}},{"kind":"Field","name":{"kind":"Name","value":"owner"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceId"}},{"kind":"Field","name":{"kind":"Name","value":"hatId"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"wearer"}}]}}]}}]} as unknown as DocumentNode;
export const GetThanksTokenBalancesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetThanksTokenBalances"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"where"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"BalanceOfThanksToken_filter"}},"defaultValue":{"kind":"ObjectValue","fields":[]}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"BalanceOfThanksToken_orderBy"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"OrderDirection"}},"defaultValue":{"kind":"EnumValue","value":"asc"}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"first"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}},"defaultValue":{"kind":"IntValue","value":"100"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"balanceOfThanksTokens"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"where"},"value":{"kind":"Variable","name":{"kind":"Name","value":"where"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderBy"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderDirection"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}}},{"kind":"Argument","name":{"kind":"Name","value":"first"},"value":{"kind":"Variable","name":{"kind":"Name","value":"first"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"thanksToken"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceId"}}]}},{"kind":"Field","name":{"kind":"Name","value":"owner"}},{"kind":"Field","name":{"kind":"Name","value":"balance"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceId"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}}]} as unknown as DocumentNode;
-export const GetThanksTokenMintsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetThanksTokenMints"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"where"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"MintThanksToken_filter"}},"defaultValue":{"kind":"ObjectValue","fields":[]}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"MintThanksToken_orderBy"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"OrderDirection"}},"defaultValue":{"kind":"EnumValue","value":"asc"}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"first"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}},"defaultValue":{"kind":"IntValue","value":"10"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"mintThanksTokens"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"where"},"value":{"kind":"Variable","name":{"kind":"Name","value":"where"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderBy"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderDirection"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}}},{"kind":"Argument","name":{"kind":"Name","value":"first"},"value":{"kind":"Variable","name":{"kind":"Name","value":"first"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"thanksToken"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceId"}}]}},{"kind":"Field","name":{"kind":"Name","value":"from"}},{"kind":"Field","name":{"kind":"Name","value":"to"}},{"kind":"Field","name":{"kind":"Name","value":"amount"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceId"}},{"kind":"Field","name":{"kind":"Name","value":"blockTimestamp"}},{"kind":"Field","name":{"kind":"Name","value":"blockNumber"}}]}}]}}]} as unknown as DocumentNode;
+export const GetThanksTokenMintsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetThanksTokenMints"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"where"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"MintThanksToken_filter"}},"defaultValue":{"kind":"ObjectValue","fields":[]}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"MintThanksToken_orderBy"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"OrderDirection"}},"defaultValue":{"kind":"EnumValue","value":"asc"}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"first"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}},"defaultValue":{"kind":"IntValue","value":"10"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"mintThanksTokens"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"where"},"value":{"kind":"Variable","name":{"kind":"Name","value":"where"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderBy"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderDirection"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}}},{"kind":"Argument","name":{"kind":"Name","value":"first"},"value":{"kind":"Variable","name":{"kind":"Name","value":"first"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"thanksToken"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceId"}}]}},{"kind":"Field","name":{"kind":"Name","value":"from"}},{"kind":"Field","name":{"kind":"Name","value":"to"}},{"kind":"Field","name":{"kind":"Name","value":"data"}},{"kind":"Field","name":{"kind":"Name","value":"amount"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceId"}},{"kind":"Field","name":{"kind":"Name","value":"blockTimestamp"}},{"kind":"Field","name":{"kind":"Name","value":"blockNumber"}}]}}]}}]} as unknown as DocumentNode;
export const GetThanksTokenTransfersDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetThanksTokenTransfers"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"where"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"TransferThanksToken_filter"}},"defaultValue":{"kind":"ObjectValue","fields":[]}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"TransferThanksToken_orderBy"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"OrderDirection"}},"defaultValue":{"kind":"EnumValue","value":"asc"}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"first"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}},"defaultValue":{"kind":"IntValue","value":"10"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"transferThanksTokens"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"where"},"value":{"kind":"Variable","name":{"kind":"Name","value":"where"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderBy"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderDirection"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}}},{"kind":"Argument","name":{"kind":"Name","value":"first"},"value":{"kind":"Variable","name":{"kind":"Name","value":"first"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"thanksToken"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceId"}}]}},{"kind":"Field","name":{"kind":"Name","value":"from"}},{"kind":"Field","name":{"kind":"Name","value":"to"}},{"kind":"Field","name":{"kind":"Name","value":"amount"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceId"}},{"kind":"Field","name":{"kind":"Name","value":"blockTimestamp"}},{"kind":"Field","name":{"kind":"Name","value":"blockNumber"}}]}}]}}]} as unknown as DocumentNode;
export const GetThanksTokensDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetThanksTokens"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"where"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"ThanksToken_filter"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"first"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}},"defaultValue":{"kind":"IntValue","value":"100"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"thanksTokens"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"where"},"value":{"kind":"Variable","name":{"kind":"Name","value":"where"}}},{"kind":"Argument","name":{"kind":"Name","value":"first"},"value":{"kind":"Variable","name":{"kind":"Name","value":"first"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"workspaceId"}}]}}]}}]} as unknown as DocumentNode;
export const GetWorkspaceDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetWorkspace"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"workspaceId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"workspace"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"workspaceId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"minterHatId"}},{"kind":"Field","name":{"kind":"Name","value":"operatorHatId"}},{"kind":"Field","name":{"kind":"Name","value":"owner"}},{"kind":"Field","name":{"kind":"Name","value":"splitCreator"}},{"kind":"Field","name":{"kind":"Name","value":"topHatId"}},{"kind":"Field","name":{"kind":"Name","value":"hatterHatId"}},{"kind":"Field","name":{"kind":"Name","value":"hatsTimeFrameModule"}},{"kind":"Field","name":{"kind":"Name","value":"hatsHatCreatorModule"}},{"kind":"Field","name":{"kind":"Name","value":"creator"}},{"kind":"Field","name":{"kind":"Name","value":"creatorHatId"}},{"kind":"Field","name":{"kind":"Name","value":"blockTimestamp"}},{"kind":"Field","name":{"kind":"Name","value":"blockNumber"}},{"kind":"Field","name":{"kind":"Name","value":"hatsFractionTokenModule"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}},{"kind":"Field","name":{"kind":"Name","value":"thanksToken"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}}]}}]} as unknown as DocumentNode;
diff --git a/pkgs/frontend/hooks/useThanksToken.ts b/pkgs/frontend/hooks/useThanksToken.ts
index da3a9c1..988ab68 100644
--- a/pkgs/frontend/hooks/useThanksToken.ts
+++ b/pkgs/frontend/hooks/useThanksToken.ts
@@ -60,6 +60,7 @@ const queryGetThanksTokenMints = gql(`
}
from
to
+ data
amount
workspaceId
blockTimestamp
@@ -259,7 +260,7 @@ export const useThanksToken = (treeId: string) => {
const [isLoading, setIsLoading] = useState(false);
const mintThanksToken = useCallback(
- async (to: Address, amount: bigint) => {
+ async (to: Address, amount: bigint, extraData: `0x${string}` = "0x") => {
if (!wallet || !relatedRoles.length) return;
setIsLoading(true);
@@ -272,7 +273,7 @@ export const useThanksToken = (treeId: string) => {
data?.workspace?.thanksToken.id as `0x${string}`,
),
functionName: "mint",
- args: [to, amount, relatedRoles],
+ args: [to, amount, relatedRoles, extraData],
});
await publicClient.waitForTransactionReceipt({ hash: txHash });
setIsLoading(false);
@@ -287,7 +288,11 @@ export const useThanksToken = (treeId: string) => {
);
const batchMintThanksToken = useCallback(
- async (tos: Address[], amount: bigint[]) => {
+ async (
+ tos: Address[],
+ amount: bigint[],
+ extraData: `0x${string}` = "0x",
+ ) => {
if (!wallet || !relatedRoles.length) return;
setIsLoading(true);
@@ -300,7 +305,7 @@ export const useThanksToken = (treeId: string) => {
data?.workspace?.thanksToken.id as `0x${string}`,
),
functionName: "batchMint",
- args: [tos, amount, relatedRoles],
+ args: [tos, amount, relatedRoles, extraData],
});
await publicClient.waitForTransactionReceipt({ hash: txHash });
setIsLoading(false);
diff --git a/pkgs/subgraph/abis/ThanksToken.json b/pkgs/subgraph/abis/ThanksToken.json
index 6f4c36a..91e4d31 100644
--- a/pkgs/subgraph/abis/ThanksToken.json
+++ b/pkgs/subgraph/abis/ThanksToken.json
@@ -130,6 +130,12 @@
"internalType": "uint256",
"name": "amount",
"type": "uint256"
+ },
+ {
+ "indexed": false,
+ "internalType": "bytes",
+ "name": "data",
+ "type": "bytes"
}
],
"name": "TokenMinted",
@@ -160,19 +166,6 @@
"name": "Transfer",
"type": "event"
},
- {
- "inputs": [],
- "name": "DEFAULT_COEFFICIENT",
- "outputs": [
- {
- "internalType": "uint256",
- "name": "",
- "type": "uint256"
- }
- ],
- "stateMutability": "pure",
- "type": "function"
- },
{
"inputs": [],
"name": "FRACTION_TOKEN",
@@ -337,6 +330,52 @@
"stateMutability": "view",
"type": "function"
},
+ {
+ "inputs": [
+ {
+ "internalType": "address[]",
+ "name": "to",
+ "type": "address[]"
+ },
+ {
+ "internalType": "uint256[]",
+ "name": "amounts",
+ "type": "uint256[]"
+ },
+ {
+ "components": [
+ {
+ "internalType": "uint256",
+ "name": "hatId",
+ "type": "uint256"
+ },
+ {
+ "internalType": "address",
+ "name": "wearer",
+ "type": "address"
+ }
+ ],
+ "internalType": "struct IThanksToken.RelatedRole[]",
+ "name": "relatedRoles",
+ "type": "tuple[]"
+ },
+ {
+ "internalType": "bytes",
+ "name": "data",
+ "type": "bytes"
+ }
+ ],
+ "name": "batchMint",
+ "outputs": [
+ {
+ "internalType": "bool",
+ "name": "",
+ "type": "bool"
+ }
+ ],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
{
"inputs": [],
"name": "decimals",
@@ -404,6 +443,11 @@
"internalType": "struct IThanksToken.RelatedRole[]",
"name": "relatedRoles",
"type": "tuple[]"
+ },
+ {
+ "internalType": "bytes",
+ "name": "data",
+ "type": "bytes"
}
],
"name": "mint",
diff --git a/pkgs/subgraph/config/base.json b/pkgs/subgraph/config/base.json
index 4533789..6a03403 100644
--- a/pkgs/subgraph/config/base.json
+++ b/pkgs/subgraph/config/base.json
@@ -1,6 +1,6 @@
{
"network": "base",
- "startBlock": 34960441,
+ "startBlock": 36218446,
"contracts": [
{
"address": "0xfB4FA9Dbb82a36566154A038e5f3865fbAC92422",
@@ -37,7 +37,7 @@
"entities": [{ "name": "TokenMinted" }, { "name": "Transfer" }],
"handlers": [
{
- "event": "TokenMinted(indexed address,indexed address,uint256)",
+ "event": "TokenMinted(indexed address,indexed address,uint256,bytes)",
"handler": "handleTokenMinted"
},
{
diff --git a/pkgs/subgraph/config/sepolia.json b/pkgs/subgraph/config/sepolia.json
index a2aa7cb..18db209 100644
--- a/pkgs/subgraph/config/sepolia.json
+++ b/pkgs/subgraph/config/sepolia.json
@@ -37,7 +37,7 @@
"entities": [{ "name": "TokenMinted" }, { "name": "Transfer" }],
"handlers": [
{
- "event": "TokenMinted(indexed address,indexed address,uint256)",
+ "event": "TokenMinted(indexed address,indexed address,uint256,bytes)",
"handler": "handleTokenMinted"
},
{
diff --git a/pkgs/subgraph/schema.graphql b/pkgs/subgraph/schema.graphql
index 920553e..ad85f91 100644
--- a/pkgs/subgraph/schema.graphql
+++ b/pkgs/subgraph/schema.graphql
@@ -78,6 +78,7 @@ type MintThanksToken @entity {
from: String!
to: String!
amount: BigInt!
+ data: Bytes!
workspaceId: ID!
blockTimestamp: BigInt!
blockNumber: BigInt!
@@ -111,33 +112,3 @@ type BalanceOfThanksToken @entity {
workspaceId: ID!
updatedAt: BigInt!
}
-
-type ThanksTokenTransfer @entity {
- id: ID!
- thanksToken: ThanksToken!
- from: String!
- to: String!
- amount: BigInt!
- workspaceId: ID!
- blockTimestamp: BigInt!
- blockNumber: BigInt!
-}
-
-type ThanksTokenBalance @entity {
- id: ID!
- thanksToken: ThanksToken!
- owner: String!
- balance: BigInt!
- workspaceId: ID!
- updatedAt: BigInt!
-}
-
-type ThanksTokenMint @entity {
- id: ID!
- thanksToken: ThanksToken!
- to: String!
- amount: BigInt!
- workspaceId: ID!
- blockTimestamp: BigInt!
- blockNumber: BigInt!
-}
diff --git a/pkgs/subgraph/src/thanksTokenMapping.ts b/pkgs/subgraph/src/thanksTokenMapping.ts
index 2e38ee7..7ce86a6 100644
--- a/pkgs/subgraph/src/thanksTokenMapping.ts
+++ b/pkgs/subgraph/src/thanksTokenMapping.ts
@@ -34,6 +34,7 @@ export function handleTokenMinted(ev: TokenMinted): void {
tokenMinted.thanksToken = thanksToken.id;
tokenMinted.from = ev.params.from.toHex();
tokenMinted.to = ev.params.to.toHex();
+ tokenMinted.data = ev.params.data;
tokenMinted.amount = ev.params.amount;
tokenMinted.workspaceId = thanksToken.workspaceId;
tokenMinted.blockTimestamp = ev.block.timestamp;