diff --git a/pkgs/frontend/abi/bigbang.ts b/pkgs/frontend/abi/bigbang.ts index 8db4a89..96fde08 100644 --- a/pkgs/frontend/abi/bigbang.ts +++ b/pkgs/frontend/abi/bigbang.ts @@ -1,228 +1,228 @@ export const BIGBANG_ABI = [ - { - inputs: [ - { - internalType: "address", - name: "_trustedForwarder", - type: "address", - }, - { - internalType: "address", - name: "_hatsAddress", - type: "address", - }, - { - internalType: "address", - name: "_hatsModuleFactory", - type: "address", - }, - { - internalType: "address", - name: "_hatsTimeFrameModule_IMPL", - type: "address", - }, - { - internalType: "address", - name: "_splitsCreatorFactory", - type: "address", - }, - { - internalType: "address", - name: "_splitFactoryV2", - type: "address", - }, - { - internalType: "address", - name: "_fractionToken", - type: "address", - }, - ], - stateMutability: "nonpayable", - type: "constructor", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "owner", - type: "address", - }, - { - indexed: true, - internalType: "uint256", - name: "topHatId", - type: "uint256", - }, - { - indexed: false, - internalType: "address", - name: "hatsTimeFrameModule", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "splitCreator", - type: "address", - }, - ], - name: "Executed", - type: "event", - }, - { - inputs: [], - name: "Hats", - outputs: [ - { - internalType: "contract IHats", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "HatsModuleFactory", - outputs: [ - { - internalType: "contract IHatsModuleFactory", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "HatsTimeFrameModule_IMPL", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "SplitsCreatorFactory", - outputs: [ - { - internalType: "contract ISplitsCreatorFactory", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "_owner", - type: "address", - }, - { - internalType: "string", - name: "_topHatDetails", - type: "string", - }, - { - internalType: "string", - name: "_topHatImageURI", - type: "string", - }, - { - internalType: "string", - name: "_hatterHatDetails", - type: "string", - }, - { - internalType: "string", - name: "_hatterHatImageURI", - type: "string", - }, - { - internalType: "address", - name: "_trustedForwarder", - type: "address", - }, - ], - name: "bigbang", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "fractionToken", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "forwarder", - type: "address", - }, - ], - name: "isTrustedForwarder", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "splitFactoryV2", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "trustedForwarder", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, + { + inputs: [ + { + internalType: "address", + name: "_trustedForwarder", + type: "address", + }, + { + internalType: "address", + name: "_hatsAddress", + type: "address", + }, + { + internalType: "address", + name: "_hatsModuleFactory", + type: "address", + }, + { + internalType: "address", + name: "_hatsTimeFrameModule_IMPL", + type: "address", + }, + { + internalType: "address", + name: "_splitsCreatorFactory", + type: "address", + }, + { + internalType: "address", + name: "_splitFactoryV2", + type: "address", + }, + { + internalType: "address", + name: "_fractionToken", + type: "address", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "owner", + type: "address", + }, + { + indexed: true, + internalType: "uint256", + name: "topHatId", + type: "uint256", + }, + { + indexed: false, + internalType: "address", + name: "hatsTimeFrameModule", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "splitCreator", + type: "address", + }, + ], + name: "Executed", + type: "event", + }, + { + inputs: [], + name: "Hats", + outputs: [ + { + internalType: "contract IHats", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "HatsModuleFactory", + outputs: [ + { + internalType: "contract IHatsModuleFactory", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "HatsTimeFrameModule_IMPL", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "SplitsCreatorFactory", + outputs: [ + { + internalType: "contract ISplitsCreatorFactory", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_owner", + type: "address", + }, + { + internalType: "string", + name: "_topHatDetails", + type: "string", + }, + { + internalType: "string", + name: "_topHatImageURI", + type: "string", + }, + { + internalType: "string", + name: "_hatterHatDetails", + type: "string", + }, + { + internalType: "string", + name: "_hatterHatImageURI", + type: "string", + }, + { + internalType: "address", + name: "_trustedForwarder", + type: "address", + }, + ], + name: "bigbang", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "fractionToken", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "forwarder", + type: "address", + }, + ], + name: "isTrustedForwarder", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "splitFactoryV2", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "trustedForwarder", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, ] as const; diff --git a/pkgs/frontend/abi/fractiontoken.ts b/pkgs/frontend/abi/fractiontoken.ts index a88416f..c404c86 100644 --- a/pkgs/frontend/abi/fractiontoken.ts +++ b/pkgs/frontend/abi/fractiontoken.ts @@ -1,634 +1,634 @@ export const FRACTION_TOKEN_ABI = [ - { - inputs: [ - { - internalType: "string", - name: "_uri", - type: "string", - }, - { - internalType: "uint256", - name: "_tokenSupply", - type: "uint256", - }, - { - internalType: "address", - name: "_hatsAddress", - type: "address", - }, - { - internalType: "address", - name: "_trustedForwarderAddress", - type: "address", - }, - ], - stateMutability: "nonpayable", - type: "constructor", - }, - { - inputs: [ - { - internalType: "address", - name: "sender", - type: "address", - }, - { - internalType: "uint256", - name: "balance", - type: "uint256", - }, - { - internalType: "uint256", - name: "needed", - type: "uint256", - }, - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "ERC1155InsufficientBalance", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "approver", - type: "address", - }, - ], - name: "ERC1155InvalidApprover", - type: "error", - }, - { - inputs: [ - { - internalType: "uint256", - name: "idsLength", - type: "uint256", - }, - { - internalType: "uint256", - name: "valuesLength", - type: "uint256", - }, - ], - name: "ERC1155InvalidArrayLength", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "operator", - type: "address", - }, - ], - name: "ERC1155InvalidOperator", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "receiver", - type: "address", - }, - ], - name: "ERC1155InvalidReceiver", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "sender", - type: "address", - }, - ], - name: "ERC1155InvalidSender", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "operator", - type: "address", - }, - { - internalType: "address", - name: "owner", - type: "address", - }, - ], - name: "ERC1155MissingApprovalForAll", - type: "error", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "account", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "operator", - type: "address", - }, - { - indexed: false, - internalType: "bool", - name: "approved", - type: "bool", - }, - ], - name: "ApprovalForAll", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "operator", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "from", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "to", - type: "address", - }, - { - indexed: false, - internalType: "uint256[]", - name: "ids", - type: "uint256[]", - }, - { - indexed: false, - internalType: "uint256[]", - name: "values", - type: "uint256[]", - }, - ], - name: "TransferBatch", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "operator", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "from", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "to", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "id", - type: "uint256", - }, - { - indexed: false, - internalType: "uint256", - name: "value", - type: "uint256", - }, - ], - name: "TransferSingle", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "string", - name: "value", - type: "string", - }, - { - indexed: true, - internalType: "uint256", - name: "id", - type: "uint256", - }, - ], - name: "URI", - type: "event", - }, - { - inputs: [], - name: "TOKEN_SUPPLY", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "account", - type: "address", - }, - { - internalType: "uint256", - name: "id", - type: "uint256", - }, - ], - name: "balanceOf", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "account", - type: "address", - }, - { - internalType: "address", - name: "wearer", - type: "address", - }, - { - internalType: "uint256", - name: "hatId", - type: "uint256", - }, - ], - name: "balanceOf", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address[]", - name: "accounts", - type: "address[]", - }, - { - internalType: "address[]", - name: "wearers", - type: "address[]", - }, - { - internalType: "uint256[]", - name: "hatIds", - type: "uint256[]", - }, - ], - name: "balanceOfBatch", - outputs: [ - { - internalType: "uint256[]", - name: "", - type: "uint256[]", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address[]", - name: "accounts", - type: "address[]", - }, - { - internalType: "uint256[]", - name: "ids", - type: "uint256[]", - }, - ], - name: "balanceOfBatch", - outputs: [ - { - internalType: "uint256[]", - name: "", - type: "uint256[]", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "from", - type: "address", - }, - { - internalType: "address", - name: "wearer", - type: "address", - }, - { - internalType: "uint256", - name: "hatId", - type: "uint256", - }, - { - internalType: "uint256", - name: "value", - type: "uint256", - }, - ], - name: "burn", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "hatId", - type: "uint256", - }, - { - internalType: "address", - name: "account", - type: "address", - }, - ], - name: "getTokenId", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "pure", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "getTokenRecipients", - outputs: [ - { - internalType: "address[]", - name: "", - type: "address[]", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "account", - type: "address", - }, - { - internalType: "address", - name: "operator", - type: "address", - }, - ], - name: "isApprovedForAll", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "forwarder", - type: "address", - }, - ], - name: "isTrustedForwarder", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "hatId", - type: "uint256", - }, - { - internalType: "address", - name: "account", - type: "address", - }, - ], - name: "mint", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "from", - type: "address", - }, - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256[]", - name: "tokenIds", - type: "uint256[]", - }, - { - internalType: "uint256[]", - name: "amounts", - type: "uint256[]", - }, - { - internalType: "bytes", - name: "data", - type: "bytes", - }, - ], - name: "safeBatchTransferFrom", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "from", - type: "address", - }, - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { - internalType: "bytes", - name: "data", - type: "bytes", - }, - ], - name: "safeTransferFrom", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "operator", - type: "address", - }, - { - internalType: "bool", - name: "approved", - type: "bool", - }, - ], - name: "setApprovalForAll", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes4", - name: "interfaceId", - type: "bytes4", - }, - ], - name: "supportsInterface", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "trustedForwarder", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "uri", - outputs: [ - { - internalType: "string", - name: "", - type: "string", - }, - ], - stateMutability: "view", - type: "function", - }, + { + inputs: [ + { + internalType: "string", + name: "_uri", + type: "string", + }, + { + internalType: "uint256", + name: "_tokenSupply", + type: "uint256", + }, + { + internalType: "address", + name: "_hatsAddress", + type: "address", + }, + { + internalType: "address", + name: "_trustedForwarderAddress", + type: "address", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + inputs: [ + { + internalType: "address", + name: "sender", + type: "address", + }, + { + internalType: "uint256", + name: "balance", + type: "uint256", + }, + { + internalType: "uint256", + name: "needed", + type: "uint256", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "ERC1155InsufficientBalance", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "approver", + type: "address", + }, + ], + name: "ERC1155InvalidApprover", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "idsLength", + type: "uint256", + }, + { + internalType: "uint256", + name: "valuesLength", + type: "uint256", + }, + ], + name: "ERC1155InvalidArrayLength", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "operator", + type: "address", + }, + ], + name: "ERC1155InvalidOperator", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "receiver", + type: "address", + }, + ], + name: "ERC1155InvalidReceiver", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "sender", + type: "address", + }, + ], + name: "ERC1155InvalidSender", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "operator", + type: "address", + }, + { + internalType: "address", + name: "owner", + type: "address", + }, + ], + name: "ERC1155MissingApprovalForAll", + type: "error", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "account", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "operator", + type: "address", + }, + { + indexed: false, + internalType: "bool", + name: "approved", + type: "bool", + }, + ], + name: "ApprovalForAll", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "operator", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "from", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "to", + type: "address", + }, + { + indexed: false, + internalType: "uint256[]", + name: "ids", + type: "uint256[]", + }, + { + indexed: false, + internalType: "uint256[]", + name: "values", + type: "uint256[]", + }, + ], + name: "TransferBatch", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "operator", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "from", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "to", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "id", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "value", + type: "uint256", + }, + ], + name: "TransferSingle", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "string", + name: "value", + type: "string", + }, + { + indexed: true, + internalType: "uint256", + name: "id", + type: "uint256", + }, + ], + name: "URI", + type: "event", + }, + { + inputs: [], + name: "TOKEN_SUPPLY", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "uint256", + name: "id", + type: "uint256", + }, + ], + name: "balanceOf", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "address", + name: "wearer", + type: "address", + }, + { + internalType: "uint256", + name: "hatId", + type: "uint256", + }, + ], + name: "balanceOf", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address[]", + name: "accounts", + type: "address[]", + }, + { + internalType: "address[]", + name: "wearers", + type: "address[]", + }, + { + internalType: "uint256[]", + name: "hatIds", + type: "uint256[]", + }, + ], + name: "balanceOfBatch", + outputs: [ + { + internalType: "uint256[]", + name: "", + type: "uint256[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address[]", + name: "accounts", + type: "address[]", + }, + { + internalType: "uint256[]", + name: "ids", + type: "uint256[]", + }, + ], + name: "balanceOfBatch", + outputs: [ + { + internalType: "uint256[]", + name: "", + type: "uint256[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "wearer", + type: "address", + }, + { + internalType: "uint256", + name: "hatId", + type: "uint256", + }, + { + internalType: "uint256", + name: "value", + type: "uint256", + }, + ], + name: "burn", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "hatId", + type: "uint256", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "getTokenId", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "pure", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "getTokenRecipients", + outputs: [ + { + internalType: "address[]", + name: "", + type: "address[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "address", + name: "operator", + type: "address", + }, + ], + name: "isApprovedForAll", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "forwarder", + type: "address", + }, + ], + name: "isTrustedForwarder", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "hatId", + type: "uint256", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "mint", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256[]", + name: "tokenIds", + type: "uint256[]", + }, + { + internalType: "uint256[]", + name: "amounts", + type: "uint256[]", + }, + { + internalType: "bytes", + name: "data", + type: "bytes", + }, + ], + name: "safeBatchTransferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + internalType: "bytes", + name: "data", + type: "bytes", + }, + ], + name: "safeTransferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "operator", + type: "address", + }, + { + internalType: "bool", + name: "approved", + type: "bool", + }, + ], + name: "setApprovalForAll", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes4", + name: "interfaceId", + type: "bytes4", + }, + ], + name: "supportsInterface", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "trustedForwarder", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "uri", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + }, ] as const; diff --git a/pkgs/frontend/abi/hats.ts b/pkgs/frontend/abi/hats.ts index f7faf1a..37fd1d7 100644 --- a/pkgs/frontend/abi/hats.ts +++ b/pkgs/frontend/abi/hats.ts @@ -1,924 +1,924 @@ export const HATS_ABI = [ - { - inputs: [ - { internalType: "string", name: "_name", type: "string" }, - { internalType: "string", name: "_baseImageURI", type: "string" }, - ], - stateMutability: "nonpayable", - type: "constructor", - }, - { - inputs: [{ internalType: "uint256", name: "hatId", type: "uint256" }], - name: "AllHatsWorn", - type: "error", - }, - { - inputs: [ - { internalType: "address", name: "wearer", type: "address" }, - { internalType: "uint256", name: "hatId", type: "uint256" }, - ], - name: "AlreadyWearingHat", - type: "error", - }, - { inputs: [], name: "BatchArrayLengthMismatch", type: "error" }, - { inputs: [], name: "CircularLinkage", type: "error" }, - { inputs: [], name: "CrossTreeLinkage", type: "error" }, - { - inputs: [{ internalType: "uint256", name: "hatId", type: "uint256" }], - name: "HatDoesNotExist", - type: "error", - }, - { inputs: [], name: "HatNotActive", type: "error" }, - { inputs: [], name: "Immutable", type: "error" }, - { inputs: [], name: "InvalidHatId", type: "error" }, - { inputs: [], name: "InvalidUnlink", type: "error" }, - { inputs: [], name: "LinkageNotRequested", type: "error" }, - { inputs: [], name: "MaxLevelsReached", type: "error" }, - { inputs: [], name: "MaxLevelsReached", type: "error" }, - { inputs: [], name: "NewMaxSupplyTooLow", type: "error" }, - { - inputs: [ - { internalType: "address", name: "user", type: "address" }, - { internalType: "uint256", name: "hatId", type: "uint256" }, - ], - name: "NotAdmin", - type: "error", - }, - { inputs: [], name: "NotAdminOrWearer", type: "error" }, - { inputs: [], name: "NotEligible", type: "error" }, - { inputs: [], name: "NotHatWearer", type: "error" }, - { inputs: [], name: "NotHatsEligibility", type: "error" }, - { inputs: [], name: "NotHatsToggle", type: "error" }, - { inputs: [], name: "StringTooLong", type: "error" }, - { inputs: [], name: "ZeroAddress", type: "error" }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "owner", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "operator", - type: "address", - }, - { indexed: false, internalType: "bool", name: "approved", type: "bool" }, - ], - name: "ApprovalForAll", - type: "event", - }, - { - anonymous: false, - inputs: [ - { indexed: false, internalType: "uint256", name: "id", type: "uint256" }, - { - indexed: false, - internalType: "string", - name: "details", - type: "string", - }, - { - indexed: false, - internalType: "uint32", - name: "maxSupply", - type: "uint32", - }, - { - indexed: false, - internalType: "address", - name: "eligibility", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "toggle", - type: "address", - }, - { indexed: false, internalType: "bool", name: "mutable_", type: "bool" }, - { - indexed: false, - internalType: "string", - name: "imageURI", - type: "string", - }, - ], - name: "HatCreated", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint256", - name: "hatId", - type: "uint256", - }, - { - indexed: false, - internalType: "string", - name: "newDetails", - type: "string", - }, - ], - name: "HatDetailsChanged", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint256", - name: "hatId", - type: "uint256", - }, - { - indexed: false, - internalType: "address", - name: "newEligibility", - type: "address", - }, - ], - name: "HatEligibilityChanged", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint256", - name: "hatId", - type: "uint256", - }, - { - indexed: false, - internalType: "string", - name: "newImageURI", - type: "string", - }, - ], - name: "HatImageURIChanged", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint256", - name: "hatId", - type: "uint256", - }, - { - indexed: false, - internalType: "uint32", - name: "newMaxSupply", - type: "uint32", - }, - ], - name: "HatMaxSupplyChanged", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint256", - name: "hatId", - type: "uint256", - }, - ], - name: "HatMutabilityChanged", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint256", - name: "hatId", - type: "uint256", - }, - { indexed: false, internalType: "bool", name: "newStatus", type: "bool" }, - ], - name: "HatStatusChanged", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint256", - name: "hatId", - type: "uint256", - }, - { - indexed: false, - internalType: "address", - name: "newToggle", - type: "address", - }, - ], - name: "HatToggleChanged", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint32", - name: "domain", - type: "uint32", - }, - { - indexed: false, - internalType: "uint256", - name: "newAdmin", - type: "uint256", - }, - ], - name: "TopHatLinkRequested", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint32", - name: "domain", - type: "uint32", - }, - { - indexed: false, - internalType: "uint256", - name: "newAdmin", - type: "uint256", - }, - ], - name: "TopHatLinked", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "operator", - type: "address", - }, - { indexed: true, internalType: "address", name: "from", type: "address" }, - { indexed: true, internalType: "address", name: "to", type: "address" }, - { - indexed: false, - internalType: "uint256[]", - name: "ids", - type: "uint256[]", - }, - { - indexed: false, - internalType: "uint256[]", - name: "amounts", - type: "uint256[]", - }, - ], - name: "TransferBatch", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "operator", - type: "address", - }, - { indexed: true, internalType: "address", name: "from", type: "address" }, - { indexed: true, internalType: "address", name: "to", type: "address" }, - { indexed: false, internalType: "uint256", name: "id", type: "uint256" }, - { - indexed: false, - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - name: "TransferSingle", - type: "event", - }, - { - anonymous: false, - inputs: [ - { indexed: false, internalType: "string", name: "value", type: "string" }, - { indexed: true, internalType: "uint256", name: "id", type: "uint256" }, - ], - name: "URI", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint256", - name: "hatId", - type: "uint256", - }, - { - indexed: false, - internalType: "address", - name: "wearer", - type: "address", - }, - { - indexed: false, - internalType: "bool", - name: "wearerStanding", - type: "bool", - }, - ], - name: "WearerStandingChanged", - type: "event", - }, - { - inputs: [ - { internalType: "uint32", name: "_topHatDomain", type: "uint32" }, - { internalType: "uint256", name: "_newAdminHat", type: "uint256" }, - { internalType: "address", name: "_eligibility", type: "address" }, - { internalType: "address", name: "_toggle", type: "address" }, - { internalType: "string", name: "_details", type: "string" }, - { internalType: "string", name: "_imageURI", type: "string" }, - ], - name: "approveLinkTopHatToTree", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { internalType: "uint256", name: "", type: "uint256" }, - { internalType: "address", name: "", type: "address" }, - ], - name: "badStandings", - outputs: [{ internalType: "bool", name: "", type: "bool" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { internalType: "address", name: "_wearer", type: "address" }, - { internalType: "uint256", name: "_hatId", type: "uint256" }, - ], - name: "balanceOf", - outputs: [{ internalType: "uint256", name: "balance", type: "uint256" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { internalType: "address[]", name: "_wearers", type: "address[]" }, - { internalType: "uint256[]", name: "_hatIds", type: "uint256[]" }, - ], - name: "balanceOfBatch", - outputs: [ - { internalType: "uint256[]", name: "balances", type: "uint256[]" }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "baseImageURI", - outputs: [{ internalType: "string", name: "", type: "string" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { internalType: "uint256[]", name: "_admins", type: "uint256[]" }, - { internalType: "string[]", name: "_details", type: "string[]" }, - { internalType: "uint32[]", name: "_maxSupplies", type: "uint32[]" }, - { - internalType: "address[]", - name: "_eligibilityModules", - type: "address[]", - }, - { internalType: "address[]", name: "_toggleModules", type: "address[]" }, - { internalType: "bool[]", name: "_mutables", type: "bool[]" }, - { internalType: "string[]", name: "_imageURIs", type: "string[]" }, - ], - name: "batchCreateHats", - outputs: [{ internalType: "bool", name: "success", type: "bool" }], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { internalType: "uint256[]", name: "_hatIds", type: "uint256[]" }, - { internalType: "address[]", name: "_wearers", type: "address[]" }, - ], - name: "batchMintHats", - outputs: [{ internalType: "bool", name: "success", type: "bool" }], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { internalType: "uint256", name: "_admin", type: "uint256" }, - { internalType: "uint16", name: "_newHat", type: "uint16" }, - ], - name: "buildHatId", - outputs: [{ internalType: "uint256", name: "id", type: "uint256" }], - stateMutability: "pure", - type: "function", - }, - { - inputs: [ - { internalType: "uint256", name: "_hatId", type: "uint256" }, - { internalType: "string", name: "_newDetails", type: "string" }, - ], - name: "changeHatDetails", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { internalType: "uint256", name: "_hatId", type: "uint256" }, - { internalType: "address", name: "_newEligibility", type: "address" }, - ], - name: "changeHatEligibility", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { internalType: "uint256", name: "_hatId", type: "uint256" }, - { internalType: "string", name: "_newImageURI", type: "string" }, - ], - name: "changeHatImageURI", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { internalType: "uint256", name: "_hatId", type: "uint256" }, - { internalType: "uint32", name: "_newMaxSupply", type: "uint32" }, - ], - name: "changeHatMaxSupply", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { internalType: "uint256", name: "_hatId", type: "uint256" }, - { internalType: "address", name: "_newToggle", type: "address" }, - ], - name: "changeHatToggle", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [{ internalType: "uint256", name: "_hatId", type: "uint256" }], - name: "checkHatStatus", - outputs: [{ internalType: "bool", name: "toggled", type: "bool" }], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { internalType: "uint256", name: "_hatId", type: "uint256" }, - { internalType: "address", name: "_wearer", type: "address" }, - ], - name: "checkHatWearerStatus", - outputs: [{ internalType: "bool", name: "updated", type: "bool" }], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { internalType: "uint256", name: "_admin", type: "uint256" }, - { internalType: "string", name: "_details", type: "string" }, - { internalType: "uint32", name: "_maxSupply", type: "uint32" }, - { internalType: "address", name: "_eligibility", type: "address" }, - { internalType: "address", name: "_toggle", type: "address" }, - { internalType: "bool", name: "_mutable", type: "bool" }, - { internalType: "string", name: "_imageURI", type: "string" }, - ], - name: "createHat", - outputs: [{ internalType: "uint256", name: "newHatId", type: "uint256" }], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { internalType: "uint256", name: "_hatId", type: "uint256" }, - { internalType: "uint32", name: "_level", type: "uint32" }, - ], - name: "getAdminAtLevel", - outputs: [{ internalType: "uint256", name: "admin", type: "uint256" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { internalType: "uint256", name: "_hatId", type: "uint256" }, - { internalType: "uint32", name: "_level", type: "uint32" }, - ], - name: "getAdminAtLocalLevel", - outputs: [{ internalType: "uint256", name: "admin", type: "uint256" }], - stateMutability: "pure", - type: "function", - }, - { - inputs: [{ internalType: "uint256", name: "_hatId", type: "uint256" }], - name: "getHatEligibilityModule", - outputs: [ - { internalType: "address", name: "eligibility", type: "address" }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [{ internalType: "uint256", name: "_hatId", type: "uint256" }], - name: "getHatLevel", - outputs: [{ internalType: "uint32", name: "level", type: "uint32" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [{ internalType: "uint256", name: "_hatId", type: "uint256" }], - name: "getHatMaxSupply", - outputs: [{ internalType: "uint32", name: "maxSupply", type: "uint32" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [{ internalType: "uint256", name: "_hatId", type: "uint256" }], - name: "getHatToggleModule", - outputs: [{ internalType: "address", name: "toggle", type: "address" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [{ internalType: "uint256", name: "_hatId", type: "uint256" }], - name: "getImageURIForHat", - outputs: [{ internalType: "string", name: "_uri", type: "string" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [{ internalType: "uint256", name: "_hatId", type: "uint256" }], - name: "getLocalHatLevel", - outputs: [{ internalType: "uint32", name: "level", type: "uint32" }], - stateMutability: "pure", - type: "function", - }, - { - inputs: [{ internalType: "uint256", name: "_admin", type: "uint256" }], - name: "getNextId", - outputs: [{ internalType: "uint256", name: "nextId", type: "uint256" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [{ internalType: "uint32", name: "_topHatDomain", type: "uint32" }], - name: "getTippyTopHatDomain", - outputs: [{ internalType: "uint32", name: "domain", type: "uint32" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [{ internalType: "uint256", name: "_hatId", type: "uint256" }], - name: "getTopHatDomain", - outputs: [{ internalType: "uint32", name: "domain", type: "uint32" }], - stateMutability: "pure", - type: "function", - }, - { - inputs: [{ internalType: "uint256", name: "_hatId", type: "uint256" }], - name: "hatSupply", - outputs: [{ internalType: "uint32", name: "supply", type: "uint32" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [{ internalType: "uint256", name: "_hatId", type: "uint256" }], - name: "isActive", - outputs: [{ internalType: "bool", name: "active", type: "bool" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { internalType: "address", name: "_user", type: "address" }, - { internalType: "uint256", name: "_hatId", type: "uint256" }, - ], - name: "isAdminOfHat", - outputs: [{ internalType: "bool", name: "isAdmin", type: "bool" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { internalType: "address", name: "", type: "address" }, - { internalType: "address", name: "", type: "address" }, - ], - name: "isApprovedForAll", - outputs: [{ internalType: "bool", name: "", type: "bool" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { internalType: "address", name: "_wearer", type: "address" }, - { internalType: "uint256", name: "_hatId", type: "uint256" }, - ], - name: "isEligible", - outputs: [{ internalType: "bool", name: "eligible", type: "bool" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { internalType: "address", name: "_wearer", type: "address" }, - { internalType: "uint256", name: "_hatId", type: "uint256" }, - ], - name: "isInGoodStanding", - outputs: [{ internalType: "bool", name: "standing", type: "bool" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [{ internalType: "uint256", name: "_hatId", type: "uint256" }], - name: "isLocalTopHat", - outputs: [{ internalType: "bool", name: "_isLocalTopHat", type: "bool" }], - stateMutability: "pure", - type: "function", - }, - { - inputs: [{ internalType: "uint256", name: "_hatId", type: "uint256" }], - name: "isTopHat", - outputs: [{ internalType: "bool", name: "_isTopHat", type: "bool" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [{ internalType: "uint256", name: "_hatId", type: "uint256" }], - name: "isValidHatId", - outputs: [{ internalType: "bool", name: "validHatId", type: "bool" }], - stateMutability: "pure", - type: "function", - }, - { - inputs: [ - { internalType: "address", name: "_user", type: "address" }, - { internalType: "uint256", name: "_hatId", type: "uint256" }, - ], - name: "isWearerOfHat", - outputs: [{ internalType: "bool", name: "isWearer", type: "bool" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "lastTopHatId", - outputs: [{ internalType: "uint32", name: "", type: "uint32" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [{ internalType: "uint32", name: "", type: "uint32" }], - name: "linkedTreeAdmins", - outputs: [{ internalType: "uint256", name: "", type: "uint256" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [{ internalType: "uint32", name: "", type: "uint32" }], - name: "linkedTreeRequests", - outputs: [{ internalType: "uint256", name: "", type: "uint256" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [{ internalType: "uint256", name: "_hatId", type: "uint256" }], - name: "makeHatImmutable", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { internalType: "uint256", name: "_hatId", type: "uint256" }, - { internalType: "address", name: "_wearer", type: "address" }, - ], - name: "mintHat", - outputs: [{ internalType: "bool", name: "success", type: "bool" }], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { internalType: "address", name: "_target", type: "address" }, - { internalType: "string", name: "_details", type: "string" }, - { internalType: "string", name: "_imageURI", type: "string" }, - ], - name: "mintTopHat", - outputs: [{ internalType: "uint256", name: "topHatId", type: "uint256" }], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [{ internalType: "bytes[]", name: "data", type: "bytes[]" }], - name: "multicall", - outputs: [{ internalType: "bytes[]", name: "", type: "bytes[]" }], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "name", - outputs: [{ internalType: "string", name: "", type: "string" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { internalType: "uint32", name: "_topHatDomain", type: "uint32" }, - { internalType: "uint256", name: "_linkedAdmin", type: "uint256" }, - ], - name: "noCircularLinkage", - outputs: [{ internalType: "bool", name: "notCircular", type: "bool" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { internalType: "uint32", name: "_topHatDomain", type: "uint32" }, - { internalType: "uint256", name: "_newAdminHat", type: "uint256" }, - { internalType: "address", name: "_eligibility", type: "address" }, - { internalType: "address", name: "_toggle", type: "address" }, - { internalType: "string", name: "_details", type: "string" }, - { internalType: "string", name: "_imageURI", type: "string" }, - ], - name: "relinkTopHatWithinTree", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [{ internalType: "uint256", name: "_hatId", type: "uint256" }], - name: "renounceHat", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { internalType: "uint32", name: "_topHatDomain", type: "uint32" }, - { internalType: "uint256", name: "_requestedAdminHat", type: "uint256" }, - ], - name: "requestLinkTopHatToTree", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { internalType: "address", name: "", type: "address" }, - { internalType: "address", name: "", type: "address" }, - { internalType: "uint256[]", name: "", type: "uint256[]" }, - { internalType: "uint256[]", name: "", type: "uint256[]" }, - { internalType: "bytes", name: "", type: "bytes" }, - ], - name: "safeBatchTransferFrom", - outputs: [], - stateMutability: "pure", - type: "function", - }, - { - inputs: [ - { internalType: "address", name: "", type: "address" }, - { internalType: "address", name: "", type: "address" }, - { internalType: "uint256", name: "", type: "uint256" }, - { internalType: "uint256", name: "", type: "uint256" }, - { internalType: "bytes", name: "", type: "bytes" }, - ], - name: "safeTransferFrom", - outputs: [], - stateMutability: "pure", - type: "function", - }, - { - inputs: [ - { internalType: "uint32", name: "_topHatDomain", type: "uint32" }, - { internalType: "uint256", name: "_newAdminHat", type: "uint256" }, - ], - name: "sameTippyTopHatDomain", - outputs: [{ internalType: "bool", name: "sameDomain", type: "bool" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { internalType: "address", name: "", type: "address" }, - { internalType: "bool", name: "", type: "bool" }, - ], - name: "setApprovalForAll", - outputs: [], - stateMutability: "pure", - type: "function", - }, - { - inputs: [ - { internalType: "uint256", name: "_hatId", type: "uint256" }, - { internalType: "bool", name: "_newStatus", type: "bool" }, - ], - name: "setHatStatus", - outputs: [{ internalType: "bool", name: "toggled", type: "bool" }], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { internalType: "uint256", name: "_hatId", type: "uint256" }, - { internalType: "address", name: "_wearer", type: "address" }, - { internalType: "bool", name: "_eligible", type: "bool" }, - { internalType: "bool", name: "_standing", type: "bool" }, - ], - name: "setHatWearerStatus", - outputs: [{ internalType: "bool", name: "updated", type: "bool" }], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [{ internalType: "bytes4", name: "interfaceId", type: "bytes4" }], - name: "supportsInterface", - outputs: [{ internalType: "bool", name: "", type: "bool" }], - stateMutability: "pure", - type: "function", - }, - { - inputs: [ - { internalType: "uint256", name: "_hatId", type: "uint256" }, - { internalType: "address", name: "_from", type: "address" }, - { internalType: "address", name: "_to", type: "address" }, - ], - name: "transferHat", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { internalType: "uint32", name: "_topHatDomain", type: "uint32" }, - { internalType: "address", name: "_wearer", type: "address" }, - ], - name: "unlinkTopHatFromTree", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [{ internalType: "uint256", name: "id", type: "uint256" }], - name: "uri", - outputs: [{ internalType: "string", name: "_uri", type: "string" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [{ internalType: "uint256", name: "_hatId", type: "uint256" }], - name: "viewHat", - outputs: [ - { internalType: "string", name: "details", type: "string" }, - { internalType: "uint32", name: "maxSupply", type: "uint32" }, - { internalType: "uint32", name: "supply", type: "uint32" }, - { internalType: "address", name: "eligibility", type: "address" }, - { internalType: "address", name: "toggle", type: "address" }, - { internalType: "string", name: "imageURI", type: "string" }, - { internalType: "uint16", name: "lastHatId", type: "uint16" }, - { internalType: "bool", name: "mutable_", type: "bool" }, - { internalType: "bool", name: "active", type: "bool" }, - ], - stateMutability: "view", - type: "function", - }, + { + inputs: [ + { internalType: "string", name: "_name", type: "string" }, + { internalType: "string", name: "_baseImageURI", type: "string" }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + inputs: [{ internalType: "uint256", name: "hatId", type: "uint256" }], + name: "AllHatsWorn", + type: "error", + }, + { + inputs: [ + { internalType: "address", name: "wearer", type: "address" }, + { internalType: "uint256", name: "hatId", type: "uint256" }, + ], + name: "AlreadyWearingHat", + type: "error", + }, + { inputs: [], name: "BatchArrayLengthMismatch", type: "error" }, + { inputs: [], name: "CircularLinkage", type: "error" }, + { inputs: [], name: "CrossTreeLinkage", type: "error" }, + { + inputs: [{ internalType: "uint256", name: "hatId", type: "uint256" }], + name: "HatDoesNotExist", + type: "error", + }, + { inputs: [], name: "HatNotActive", type: "error" }, + { inputs: [], name: "Immutable", type: "error" }, + { inputs: [], name: "InvalidHatId", type: "error" }, + { inputs: [], name: "InvalidUnlink", type: "error" }, + { inputs: [], name: "LinkageNotRequested", type: "error" }, + { inputs: [], name: "MaxLevelsReached", type: "error" }, + { inputs: [], name: "MaxLevelsReached", type: "error" }, + { inputs: [], name: "NewMaxSupplyTooLow", type: "error" }, + { + inputs: [ + { internalType: "address", name: "user", type: "address" }, + { internalType: "uint256", name: "hatId", type: "uint256" }, + ], + name: "NotAdmin", + type: "error", + }, + { inputs: [], name: "NotAdminOrWearer", type: "error" }, + { inputs: [], name: "NotEligible", type: "error" }, + { inputs: [], name: "NotHatWearer", type: "error" }, + { inputs: [], name: "NotHatsEligibility", type: "error" }, + { inputs: [], name: "NotHatsToggle", type: "error" }, + { inputs: [], name: "StringTooLong", type: "error" }, + { inputs: [], name: "ZeroAddress", type: "error" }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "owner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "operator", + type: "address", + }, + { indexed: false, internalType: "bool", name: "approved", type: "bool" }, + ], + name: "ApprovalForAll", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "uint256", name: "id", type: "uint256" }, + { + indexed: false, + internalType: "string", + name: "details", + type: "string", + }, + { + indexed: false, + internalType: "uint32", + name: "maxSupply", + type: "uint32", + }, + { + indexed: false, + internalType: "address", + name: "eligibility", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "toggle", + type: "address", + }, + { indexed: false, internalType: "bool", name: "mutable_", type: "bool" }, + { + indexed: false, + internalType: "string", + name: "imageURI", + type: "string", + }, + ], + name: "HatCreated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "hatId", + type: "uint256", + }, + { + indexed: false, + internalType: "string", + name: "newDetails", + type: "string", + }, + ], + name: "HatDetailsChanged", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "hatId", + type: "uint256", + }, + { + indexed: false, + internalType: "address", + name: "newEligibility", + type: "address", + }, + ], + name: "HatEligibilityChanged", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "hatId", + type: "uint256", + }, + { + indexed: false, + internalType: "string", + name: "newImageURI", + type: "string", + }, + ], + name: "HatImageURIChanged", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "hatId", + type: "uint256", + }, + { + indexed: false, + internalType: "uint32", + name: "newMaxSupply", + type: "uint32", + }, + ], + name: "HatMaxSupplyChanged", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "hatId", + type: "uint256", + }, + ], + name: "HatMutabilityChanged", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "hatId", + type: "uint256", + }, + { indexed: false, internalType: "bool", name: "newStatus", type: "bool" }, + ], + name: "HatStatusChanged", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "hatId", + type: "uint256", + }, + { + indexed: false, + internalType: "address", + name: "newToggle", + type: "address", + }, + ], + name: "HatToggleChanged", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint32", + name: "domain", + type: "uint32", + }, + { + indexed: false, + internalType: "uint256", + name: "newAdmin", + type: "uint256", + }, + ], + name: "TopHatLinkRequested", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint32", + name: "domain", + type: "uint32", + }, + { + indexed: false, + internalType: "uint256", + name: "newAdmin", + type: "uint256", + }, + ], + name: "TopHatLinked", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "operator", + type: "address", + }, + { indexed: true, internalType: "address", name: "from", type: "address" }, + { indexed: true, internalType: "address", name: "to", type: "address" }, + { + indexed: false, + internalType: "uint256[]", + name: "ids", + type: "uint256[]", + }, + { + indexed: false, + internalType: "uint256[]", + name: "amounts", + type: "uint256[]", + }, + ], + name: "TransferBatch", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "operator", + type: "address", + }, + { indexed: true, internalType: "address", name: "from", type: "address" }, + { indexed: true, internalType: "address", name: "to", type: "address" }, + { indexed: false, internalType: "uint256", name: "id", type: "uint256" }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "TransferSingle", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "string", name: "value", type: "string" }, + { indexed: true, internalType: "uint256", name: "id", type: "uint256" }, + ], + name: "URI", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "hatId", + type: "uint256", + }, + { + indexed: false, + internalType: "address", + name: "wearer", + type: "address", + }, + { + indexed: false, + internalType: "bool", + name: "wearerStanding", + type: "bool", + }, + ], + name: "WearerStandingChanged", + type: "event", + }, + { + inputs: [ + { internalType: "uint32", name: "_topHatDomain", type: "uint32" }, + { internalType: "uint256", name: "_newAdminHat", type: "uint256" }, + { internalType: "address", name: "_eligibility", type: "address" }, + { internalType: "address", name: "_toggle", type: "address" }, + { internalType: "string", name: "_details", type: "string" }, + { internalType: "string", name: "_imageURI", type: "string" }, + ], + name: "approveLinkTopHatToTree", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "uint256", name: "", type: "uint256" }, + { internalType: "address", name: "", type: "address" }, + ], + name: "badStandings", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_wearer", type: "address" }, + { internalType: "uint256", name: "_hatId", type: "uint256" }, + ], + name: "balanceOf", + outputs: [{ internalType: "uint256", name: "balance", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address[]", name: "_wearers", type: "address[]" }, + { internalType: "uint256[]", name: "_hatIds", type: "uint256[]" }, + ], + name: "balanceOfBatch", + outputs: [ + { internalType: "uint256[]", name: "balances", type: "uint256[]" }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "baseImageURI", + outputs: [{ internalType: "string", name: "", type: "string" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "uint256[]", name: "_admins", type: "uint256[]" }, + { internalType: "string[]", name: "_details", type: "string[]" }, + { internalType: "uint32[]", name: "_maxSupplies", type: "uint32[]" }, + { + internalType: "address[]", + name: "_eligibilityModules", + type: "address[]", + }, + { internalType: "address[]", name: "_toggleModules", type: "address[]" }, + { internalType: "bool[]", name: "_mutables", type: "bool[]" }, + { internalType: "string[]", name: "_imageURIs", type: "string[]" }, + ], + name: "batchCreateHats", + outputs: [{ internalType: "bool", name: "success", type: "bool" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "uint256[]", name: "_hatIds", type: "uint256[]" }, + { internalType: "address[]", name: "_wearers", type: "address[]" }, + ], + name: "batchMintHats", + outputs: [{ internalType: "bool", name: "success", type: "bool" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "uint256", name: "_admin", type: "uint256" }, + { internalType: "uint16", name: "_newHat", type: "uint16" }, + ], + name: "buildHatId", + outputs: [{ internalType: "uint256", name: "id", type: "uint256" }], + stateMutability: "pure", + type: "function", + }, + { + inputs: [ + { internalType: "uint256", name: "_hatId", type: "uint256" }, + { internalType: "string", name: "_newDetails", type: "string" }, + ], + name: "changeHatDetails", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "uint256", name: "_hatId", type: "uint256" }, + { internalType: "address", name: "_newEligibility", type: "address" }, + ], + name: "changeHatEligibility", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "uint256", name: "_hatId", type: "uint256" }, + { internalType: "string", name: "_newImageURI", type: "string" }, + ], + name: "changeHatImageURI", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "uint256", name: "_hatId", type: "uint256" }, + { internalType: "uint32", name: "_newMaxSupply", type: "uint32" }, + ], + name: "changeHatMaxSupply", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "uint256", name: "_hatId", type: "uint256" }, + { internalType: "address", name: "_newToggle", type: "address" }, + ], + name: "changeHatToggle", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "_hatId", type: "uint256" }], + name: "checkHatStatus", + outputs: [{ internalType: "bool", name: "toggled", type: "bool" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "uint256", name: "_hatId", type: "uint256" }, + { internalType: "address", name: "_wearer", type: "address" }, + ], + name: "checkHatWearerStatus", + outputs: [{ internalType: "bool", name: "updated", type: "bool" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "uint256", name: "_admin", type: "uint256" }, + { internalType: "string", name: "_details", type: "string" }, + { internalType: "uint32", name: "_maxSupply", type: "uint32" }, + { internalType: "address", name: "_eligibility", type: "address" }, + { internalType: "address", name: "_toggle", type: "address" }, + { internalType: "bool", name: "_mutable", type: "bool" }, + { internalType: "string", name: "_imageURI", type: "string" }, + ], + name: "createHat", + outputs: [{ internalType: "uint256", name: "newHatId", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "uint256", name: "_hatId", type: "uint256" }, + { internalType: "uint32", name: "_level", type: "uint32" }, + ], + name: "getAdminAtLevel", + outputs: [{ internalType: "uint256", name: "admin", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "uint256", name: "_hatId", type: "uint256" }, + { internalType: "uint32", name: "_level", type: "uint32" }, + ], + name: "getAdminAtLocalLevel", + outputs: [{ internalType: "uint256", name: "admin", type: "uint256" }], + stateMutability: "pure", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "_hatId", type: "uint256" }], + name: "getHatEligibilityModule", + outputs: [ + { internalType: "address", name: "eligibility", type: "address" }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "_hatId", type: "uint256" }], + name: "getHatLevel", + outputs: [{ internalType: "uint32", name: "level", type: "uint32" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "_hatId", type: "uint256" }], + name: "getHatMaxSupply", + outputs: [{ internalType: "uint32", name: "maxSupply", type: "uint32" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "_hatId", type: "uint256" }], + name: "getHatToggleModule", + outputs: [{ internalType: "address", name: "toggle", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "_hatId", type: "uint256" }], + name: "getImageURIForHat", + outputs: [{ internalType: "string", name: "_uri", type: "string" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "_hatId", type: "uint256" }], + name: "getLocalHatLevel", + outputs: [{ internalType: "uint32", name: "level", type: "uint32" }], + stateMutability: "pure", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "_admin", type: "uint256" }], + name: "getNextId", + outputs: [{ internalType: "uint256", name: "nextId", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "uint32", name: "_topHatDomain", type: "uint32" }], + name: "getTippyTopHatDomain", + outputs: [{ internalType: "uint32", name: "domain", type: "uint32" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "_hatId", type: "uint256" }], + name: "getTopHatDomain", + outputs: [{ internalType: "uint32", name: "domain", type: "uint32" }], + stateMutability: "pure", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "_hatId", type: "uint256" }], + name: "hatSupply", + outputs: [{ internalType: "uint32", name: "supply", type: "uint32" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "_hatId", type: "uint256" }], + name: "isActive", + outputs: [{ internalType: "bool", name: "active", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_user", type: "address" }, + { internalType: "uint256", name: "_hatId", type: "uint256" }, + ], + name: "isAdminOfHat", + outputs: [{ internalType: "bool", name: "isAdmin", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "", type: "address" }, + { internalType: "address", name: "", type: "address" }, + ], + name: "isApprovedForAll", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_wearer", type: "address" }, + { internalType: "uint256", name: "_hatId", type: "uint256" }, + ], + name: "isEligible", + outputs: [{ internalType: "bool", name: "eligible", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_wearer", type: "address" }, + { internalType: "uint256", name: "_hatId", type: "uint256" }, + ], + name: "isInGoodStanding", + outputs: [{ internalType: "bool", name: "standing", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "_hatId", type: "uint256" }], + name: "isLocalTopHat", + outputs: [{ internalType: "bool", name: "_isLocalTopHat", type: "bool" }], + stateMutability: "pure", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "_hatId", type: "uint256" }], + name: "isTopHat", + outputs: [{ internalType: "bool", name: "_isTopHat", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "_hatId", type: "uint256" }], + name: "isValidHatId", + outputs: [{ internalType: "bool", name: "validHatId", type: "bool" }], + stateMutability: "pure", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_user", type: "address" }, + { internalType: "uint256", name: "_hatId", type: "uint256" }, + ], + name: "isWearerOfHat", + outputs: [{ internalType: "bool", name: "isWearer", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "lastTopHatId", + outputs: [{ internalType: "uint32", name: "", type: "uint32" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "uint32", name: "", type: "uint32" }], + name: "linkedTreeAdmins", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "uint32", name: "", type: "uint32" }], + name: "linkedTreeRequests", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "_hatId", type: "uint256" }], + name: "makeHatImmutable", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "uint256", name: "_hatId", type: "uint256" }, + { internalType: "address", name: "_wearer", type: "address" }, + ], + name: "mintHat", + outputs: [{ internalType: "bool", name: "success", type: "bool" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_target", type: "address" }, + { internalType: "string", name: "_details", type: "string" }, + { internalType: "string", name: "_imageURI", type: "string" }, + ], + name: "mintTopHat", + outputs: [{ internalType: "uint256", name: "topHatId", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "bytes[]", name: "data", type: "bytes[]" }], + name: "multicall", + outputs: [{ internalType: "bytes[]", name: "", type: "bytes[]" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "name", + outputs: [{ internalType: "string", name: "", type: "string" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "uint32", name: "_topHatDomain", type: "uint32" }, + { internalType: "uint256", name: "_linkedAdmin", type: "uint256" }, + ], + name: "noCircularLinkage", + outputs: [{ internalType: "bool", name: "notCircular", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "uint32", name: "_topHatDomain", type: "uint32" }, + { internalType: "uint256", name: "_newAdminHat", type: "uint256" }, + { internalType: "address", name: "_eligibility", type: "address" }, + { internalType: "address", name: "_toggle", type: "address" }, + { internalType: "string", name: "_details", type: "string" }, + { internalType: "string", name: "_imageURI", type: "string" }, + ], + name: "relinkTopHatWithinTree", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "_hatId", type: "uint256" }], + name: "renounceHat", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "uint32", name: "_topHatDomain", type: "uint32" }, + { internalType: "uint256", name: "_requestedAdminHat", type: "uint256" }, + ], + name: "requestLinkTopHatToTree", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "", type: "address" }, + { internalType: "address", name: "", type: "address" }, + { internalType: "uint256[]", name: "", type: "uint256[]" }, + { internalType: "uint256[]", name: "", type: "uint256[]" }, + { internalType: "bytes", name: "", type: "bytes" }, + ], + name: "safeBatchTransferFrom", + outputs: [], + stateMutability: "pure", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "", type: "address" }, + { internalType: "address", name: "", type: "address" }, + { internalType: "uint256", name: "", type: "uint256" }, + { internalType: "uint256", name: "", type: "uint256" }, + { internalType: "bytes", name: "", type: "bytes" }, + ], + name: "safeTransferFrom", + outputs: [], + stateMutability: "pure", + type: "function", + }, + { + inputs: [ + { internalType: "uint32", name: "_topHatDomain", type: "uint32" }, + { internalType: "uint256", name: "_newAdminHat", type: "uint256" }, + ], + name: "sameTippyTopHatDomain", + outputs: [{ internalType: "bool", name: "sameDomain", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "", type: "address" }, + { internalType: "bool", name: "", type: "bool" }, + ], + name: "setApprovalForAll", + outputs: [], + stateMutability: "pure", + type: "function", + }, + { + inputs: [ + { internalType: "uint256", name: "_hatId", type: "uint256" }, + { internalType: "bool", name: "_newStatus", type: "bool" }, + ], + name: "setHatStatus", + outputs: [{ internalType: "bool", name: "toggled", type: "bool" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "uint256", name: "_hatId", type: "uint256" }, + { internalType: "address", name: "_wearer", type: "address" }, + { internalType: "bool", name: "_eligible", type: "bool" }, + { internalType: "bool", name: "_standing", type: "bool" }, + ], + name: "setHatWearerStatus", + outputs: [{ internalType: "bool", name: "updated", type: "bool" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "bytes4", name: "interfaceId", type: "bytes4" }], + name: "supportsInterface", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "pure", + type: "function", + }, + { + inputs: [ + { internalType: "uint256", name: "_hatId", type: "uint256" }, + { internalType: "address", name: "_from", type: "address" }, + { internalType: "address", name: "_to", type: "address" }, + ], + name: "transferHat", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "uint32", name: "_topHatDomain", type: "uint32" }, + { internalType: "address", name: "_wearer", type: "address" }, + ], + name: "unlinkTopHatFromTree", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "id", type: "uint256" }], + name: "uri", + outputs: [{ internalType: "string", name: "_uri", type: "string" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "_hatId", type: "uint256" }], + name: "viewHat", + outputs: [ + { internalType: "string", name: "details", type: "string" }, + { internalType: "uint32", name: "maxSupply", type: "uint32" }, + { internalType: "uint32", name: "supply", type: "uint32" }, + { internalType: "address", name: "eligibility", type: "address" }, + { internalType: "address", name: "toggle", type: "address" }, + { internalType: "string", name: "imageURI", type: "string" }, + { internalType: "uint16", name: "lastHatId", type: "uint16" }, + { internalType: "bool", name: "mutable_", type: "bool" }, + { internalType: "bool", name: "active", type: "bool" }, + ], + stateMutability: "view", + type: "function", + }, ] as const; diff --git a/pkgs/frontend/abi/hatsTimeFrameModule.ts b/pkgs/frontend/abi/hatsTimeFrameModule.ts index 4a842b2..ef99157 100644 --- a/pkgs/frontend/abi/hatsTimeFrameModule.ts +++ b/pkgs/frontend/abi/hatsTimeFrameModule.ts @@ -1,217 +1,217 @@ export const HATS_TIME_FRAME_MODULE_ABI = [ - { - inputs: [ - { - internalType: "address", - name: "_trustedForwarder", - type: "address", - }, - { - internalType: "string", - name: "_version", - type: "string", - }, - ], - stateMutability: "nonpayable", - type: "constructor", - }, - { - inputs: [], - name: "InvalidInitialization", - type: "error", - }, - { - inputs: [], - name: "NotInitializing", - type: "error", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint64", - name: "version", - type: "uint64", - }, - ], - name: "Initialized", - type: "event", - }, - { - inputs: [], - name: "HATS", - outputs: [ - { - internalType: "contract IHats", - name: "", - type: "address", - }, - ], - stateMutability: "pure", - type: "function", - }, - { - inputs: [], - name: "IMPLEMENTATION", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "pure", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "wearer", - type: "address", - }, - { - internalType: "uint256", - name: "hatId", - type: "uint256", - }, - ], - name: "getWearingElapsedTime", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "wearer", - type: "address", - }, - { - internalType: "uint256", - name: "hatId", - type: "uint256", - }, - ], - name: "getWoreTime", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "hatId", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "pure", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "forwarder", - type: "address", - }, - ], - name: "isTrustedForwarder", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "hatId", - type: "uint256", - }, - { - internalType: "address", - name: "wearer", - type: "address", - }, - ], - name: "mintHat", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes", - name: "_initData", - type: "bytes", - }, - ], - name: "setUp", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "trustedForwarder", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "version", - outputs: [ - { - internalType: "string", - name: "", - type: "string", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "version_", - outputs: [ - { - internalType: "string", - name: "", - type: "string", - }, - ], - stateMutability: "view", - type: "function", - }, + { + inputs: [ + { + internalType: "address", + name: "_trustedForwarder", + type: "address", + }, + { + internalType: "string", + name: "_version", + type: "string", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + inputs: [], + name: "InvalidInitialization", + type: "error", + }, + { + inputs: [], + name: "NotInitializing", + type: "error", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint64", + name: "version", + type: "uint64", + }, + ], + name: "Initialized", + type: "event", + }, + { + inputs: [], + name: "HATS", + outputs: [ + { + internalType: "contract IHats", + name: "", + type: "address", + }, + ], + stateMutability: "pure", + type: "function", + }, + { + inputs: [], + name: "IMPLEMENTATION", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "pure", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "wearer", + type: "address", + }, + { + internalType: "uint256", + name: "hatId", + type: "uint256", + }, + ], + name: "getWearingElapsedTime", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "wearer", + type: "address", + }, + { + internalType: "uint256", + name: "hatId", + type: "uint256", + }, + ], + name: "getWoreTime", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "hatId", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "pure", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "forwarder", + type: "address", + }, + ], + name: "isTrustedForwarder", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "hatId", + type: "uint256", + }, + { + internalType: "address", + name: "wearer", + type: "address", + }, + ], + name: "mintHat", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes", + name: "_initData", + type: "bytes", + }, + ], + name: "setUp", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "trustedForwarder", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "version", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "version_", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + }, ] as const; diff --git a/pkgs/frontend/app/components/CommonDialog.tsx b/pkgs/frontend/app/components/CommonDialog.tsx deleted file mode 100644 index b1d2730..0000000 --- a/pkgs/frontend/app/components/CommonDialog.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import { - DialogContent, - DialogRoot, - DialogTrigger, -} from "~/components/ui/dialog"; - -interface CommonDialogProps { - dialogTriggerReactNode?: React.ReactNode; - children?: React.ReactNode; -} - -export const CommonDialog = ({ - dialogTriggerReactNode, - children, -}: CommonDialogProps) => { - return ( - - {dialogTriggerReactNode} - {children} - - ); -}; diff --git a/pkgs/frontend/app/components/Header.tsx b/pkgs/frontend/app/components/Header.tsx new file mode 100644 index 0000000..f3f3314 --- /dev/null +++ b/pkgs/frontend/app/components/Header.tsx @@ -0,0 +1,96 @@ +import { useState, useEffect } from "react"; +import { Box, Text } from "@chakra-ui/react"; +import { WorkspaceIcon } from "./WorkspaceIcon"; +import { UserIcon } from "./UserIcon"; +import { useLocation } from "@remix-run/react"; + +const NO_HEADER_PATHS: string[] = ["/login"]; // 適宜ヘッダーが不要なページのパスを追加 +const HEADER_SIZE: number = 12; // 偶数のnumberだとアイコンが対応しているため望ましい + +const headerTextStyle = { + my: "auto", + wordBreak: "break-word", + flex: "1", +}; + +enum HeaderType { + NonHeader = "NonHeader", + UserIconOnly = "UserIconOnly", + WorkspaceAndUserIcons = "WorkspaceAndUserIcons", +} + +export const Header = () => { + const [headerType, setHeaderType] = useState( + HeaderType.NonHeader + ); + + const { pathname } = useLocation(); + + // ToDo: ページのパスや hooks で柔軟にロジックを実装する(切り替えてテストできます) + const isWalletConnected = true; + const isUserTobanEnsFound = true; + const isWorkspaceSelected = true; + + // ToDo: ユーザーやワークスペースごとの各種データを取得するロジックを実装する + const userImageUrl: string | undefined = undefined; + const workspaceName: string | undefined = "Workspace Name"; + const workspaceImageUrl: string | undefined = undefined; + + useEffect(() => { + const determineHeaderType = () => { + if ( + !NO_HEADER_PATHS.includes(pathname) && + isWalletConnected && + isUserTobanEnsFound + ) { + return isWorkspaceSelected && workspaceName + ? HeaderType.WorkspaceAndUserIcons + : HeaderType.UserIconOnly; + } + return HeaderType.NonHeader; + }; + + setHeaderType(determineHeaderType()); + }, [ + pathname, + isWalletConnected, + isUserTobanEnsFound, + isWorkspaceSelected, + workspaceName, + ]); + + return ( + + {headerType !== HeaderType.NonHeader && ( + <> + + {headerType === HeaderType.UserIconOnly && ( + + Workspaces + + )} + {headerType === HeaderType.WorkspaceAndUserIcons && ( + <> + + + {workspaceName} + + + )} + + + + )} + + ); +}; diff --git a/pkgs/frontend/app/components/UserIcon.tsx b/pkgs/frontend/app/components/UserIcon.tsx new file mode 100644 index 0000000..d6472a2 --- /dev/null +++ b/pkgs/frontend/app/components/UserIcon.tsx @@ -0,0 +1,21 @@ +import { FaCircleUser } from "react-icons/fa6"; +import { CommonIcon } from "./common/CommonIcon"; + +interface UserIconProps { + userImageUrl: string | undefined; + size: number; +} + +export const UserIcon = ({ userImageUrl, size }: UserIconProps) => { + return ( + + } + /> + ); +}; diff --git a/pkgs/frontend/app/components/WorkspaceIcon.tsx b/pkgs/frontend/app/components/WorkspaceIcon.tsx new file mode 100644 index 0000000..2fa32fa --- /dev/null +++ b/pkgs/frontend/app/components/WorkspaceIcon.tsx @@ -0,0 +1,28 @@ +import { FaPeopleGroup } from "react-icons/fa6"; +import { CommonIcon } from "./common/CommonIcon"; + +interface WorkspaceIconProps { + workspaceImageUrl?: string; + size: number; +} + +export const WorkspaceIcon = ({ + workspaceImageUrl, + size, +}: WorkspaceIconProps) => { + return ( + + } + /> + ); +}; diff --git a/pkgs/frontend/app/components/CommonButton.tsx b/pkgs/frontend/app/components/common/CommonButton.tsx similarity index 100% rename from pkgs/frontend/app/components/CommonButton.tsx rename to pkgs/frontend/app/components/common/CommonButton.tsx diff --git a/pkgs/frontend/app/components/common/CommonDialog.tsx b/pkgs/frontend/app/components/common/CommonDialog.tsx new file mode 100644 index 0000000..4e31b63 --- /dev/null +++ b/pkgs/frontend/app/components/common/CommonDialog.tsx @@ -0,0 +1,22 @@ +import { + DialogContent, + DialogRoot, + DialogTrigger, +} from "~/components/ui/dialog"; + +interface CommonDialogProps { + dialogTriggerReactNode?: React.ReactNode; + children?: React.ReactNode; +} + +export const CommonDialog = ({ + dialogTriggerReactNode, + children, +}: CommonDialogProps) => { + return ( + + {dialogTriggerReactNode} + {children} + + ); +}; diff --git a/pkgs/frontend/app/components/common/CommonIcon.tsx b/pkgs/frontend/app/components/common/CommonIcon.tsx new file mode 100644 index 0000000..2a94a5c --- /dev/null +++ b/pkgs/frontend/app/components/common/CommonIcon.tsx @@ -0,0 +1,45 @@ +import { useState, useEffect, ReactNode } from "react"; +import { Box, Image } from "@chakra-ui/react"; + +interface CommonIconProps { + imageUrl: string | undefined; + size: number; + fallbackIconComponent?: ReactNode; +} + +export const CommonIcon = ({ + size, + imageUrl, + fallbackIconComponent, +}: CommonIconProps) => { + const [showFallbackIcon, setShowFallbackIcon] = useState(!imageUrl); + + useEffect(() => { + setShowFallbackIcon(!imageUrl); + }, [imageUrl]); + + return ( + + {!showFallbackIcon ? ( + setShowFallbackIcon(true)} + /> + ) : ( + fallbackIconComponent || null + )} + + ); +}; diff --git a/pkgs/frontend/app/components/CommonInput.tsx b/pkgs/frontend/app/components/common/CommonInput.tsx similarity index 57% rename from pkgs/frontend/app/components/CommonInput.tsx rename to pkgs/frontend/app/components/common/CommonInput.tsx index df992c5..7ed24d7 100644 --- a/pkgs/frontend/app/components/CommonInput.tsx +++ b/pkgs/frontend/app/components/common/CommonInput.tsx @@ -1,10 +1,10 @@ import { Input, InputProps } from "@chakra-ui/react"; interface CommonInputProps extends Omit { - value: string | number; - onChange: (event: React.ChangeEvent) => void; + value: string | number; + onChange: (event: React.ChangeEvent) => void; } export const CommonInput = ({ value, onChange }: CommonInputProps) => { - return ; + return ; }; diff --git a/pkgs/frontend/app/components/CommonTextarea.tsx b/pkgs/frontend/app/components/common/CommonTextarea.tsx similarity index 59% rename from pkgs/frontend/app/components/CommonTextarea.tsx rename to pkgs/frontend/app/components/common/CommonTextarea.tsx index 5704cad..6691c6c 100644 --- a/pkgs/frontend/app/components/CommonTextarea.tsx +++ b/pkgs/frontend/app/components/common/CommonTextarea.tsx @@ -1,10 +1,10 @@ import { Textarea, TextareaProps } from "@chakra-ui/react"; interface CommonTextAreaProps extends Omit { - value: string; - onChange: (event: React.ChangeEvent) => void; + value: string; + onChange: (event: React.ChangeEvent) => void; } export const CommonTextArea = ({ value, onChange }: CommonTextAreaProps) => { - return