anymal-protocol 1.0.123 → 1.0.125
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +367 -24
- package/dist/index.d.ts +367 -24
- package/dist/index.js +1760 -312
- package/dist/index.mjs +1734 -291
- package/package.json +3 -1
package/dist/index.mjs
CHANGED
|
@@ -386,15 +386,1143 @@ function useFetchNotifications() {
|
|
|
386
386
|
);
|
|
387
387
|
}
|
|
388
388
|
|
|
389
|
-
// src/utils/
|
|
389
|
+
// src/utils/coinbase/useSendCoinbaseUserOperation.ts
|
|
390
|
+
import { useCallback as useCallback10 } from "react";
|
|
391
|
+
import { useSendUserOperation } from "@coinbase/cdp-hooks";
|
|
392
|
+
function useSendCoinbaseUserOperation() {
|
|
393
|
+
const { sendUserOperation, data, error, status } = useSendUserOperation();
|
|
394
|
+
const sendOperationFn = useCallback10(
|
|
395
|
+
async (evmAddress, callData, contractAddress) => {
|
|
396
|
+
if (!evmAddress || !callData || !contractAddress) {
|
|
397
|
+
return { success: false, message: "Missing required information" };
|
|
398
|
+
}
|
|
399
|
+
try {
|
|
400
|
+
await sendUserOperation({
|
|
401
|
+
evmSmartAccount: evmAddress,
|
|
402
|
+
network: "base-sepolia",
|
|
403
|
+
useCdpPaymaster: true,
|
|
404
|
+
calls: [{ data: callData, to: contractAddress }]
|
|
405
|
+
});
|
|
406
|
+
return { success: true, message: "Operation submitted." };
|
|
407
|
+
} catch (e) {
|
|
408
|
+
console.error(e);
|
|
409
|
+
return { success: false, message: e.message };
|
|
410
|
+
}
|
|
411
|
+
},
|
|
412
|
+
[sendUserOperation]
|
|
413
|
+
);
|
|
414
|
+
return { sendOperationFn, data, status, error };
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
// src/utils/coinbase/useCoinbaseMintAnymalNFT.ts
|
|
390
418
|
import { encodeFunctionData } from "viem";
|
|
391
419
|
|
|
392
420
|
// src/helpers/BlockchainAbiHelper.tsx
|
|
393
421
|
import { parseAbi } from "viem";
|
|
394
|
-
var PET_NFT_ABI = [{ "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, { "inputs": [], "name": "AccessControlBadConfirmation", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }, { "internalType": "bytes32", "name": "neededRole", "type": "bytes32" }], "name": "AccessControlUnauthorizedAccount", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "target", "type": "address" }], "name": "AddressEmptyCode", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "implementation", "type": "address" }], "name": "ERC1967InvalidImplementation", "type": "error" }, { "inputs": [], "name": "ERC1967NonPayable", "type": "error" }, { "inputs": [], "name": "EnforcedPause", "type": "error" }, { "inputs": [], "name": "ExpectedPause", "type": "error" }, { "inputs": [], "name": "FailedCall", "type": "error" }, { "inputs": [], "name": "InvalidInitialization", "type": "error" }, { "inputs": [], "name": "NotInitializing", "type": "error" }, { "inputs": [], "name": "UUPSUnauthorizedCallContext", "type": "error" }, { "inputs": [{ "internalType": "bytes32", "name": "slot", "type": "bytes32" }], "name": "UUPSUnsupportedProxiableUUID", "type": "error" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint64", "name": "version", "type": "uint64" }], "name": "Initialized", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "user", "type": "address" }, { "indexed": false, "internalType": "string", "name": "pid", "type": "string" }, { "indexed": false, "internalType": "string", "name": "nftId", "type": "string" }, { "indexed": false, "internalType": "string", "name": "metadataURL", "type": "string" }, { "indexed": false, "internalType": "uint256", "name": "campaignId", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "rewardAmount", "type": "uint256" }, { "indexed": false, "internalType": "string", "name": "_anymalTxId", "type": "string" }], "name": "MetadataApproved", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "user", "type": "address" }, { "indexed": false, "internalType": "string", "name": "anymalTxId", "type": "string" }, { "indexed": false, "internalType": "string", "name": "pid", "type": "string" }, { "indexed": false, "internalType": "string", "name": "nftId", "type": "string" }, { "indexed": false, "internalType": "string", "name": "metadataURL", "type": "string" }, { "indexed": false, "internalType": "uint256", "name": "campaignId", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "rewardAmount", "type": "uint256" }, { "indexed": false, "internalType": "string", "name": "_anymalTxId", "type": "string" }], "name": "MetadataRejected", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "user", "type": "address" }, { "indexed": false, "internalType": "string", "name": "pid", "type": "string" }, { "indexed": false, "internalType": "string", "name": "nftId", "type": "string" }, { "indexed": false, "internalType": "string", "name": "metadataURL", "type": "string" }, { "indexed": false, "internalType": "uint256", "name": "campaignId", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "rewardAmount", "type": "uint256" }, { "indexed": false, "internalType": "string", "name": "_anymalTxId", "type": "string" }], "name": "MetadataSubmitted", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "address", "name": "account", "type": "address" }], "name": "Paused", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "user", "type": "address" }, { "indexed": false, "internalType": "string", "name": "pid", "type": "string" }, { "indexed": false, "internalType": "string", "name": "nftId", "type": "string" }, { "indexed": false, "internalType": "uint256", "name": "rewardAmount", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "campaignId", "type": "uint256" }, { "indexed": false, "internalType": "string", "name": "_anymalTxId", "type": "string" }], "name": "RewardDistributed", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "indexed": true, "internalType": "bytes32", "name": "previousAdminRole", "type": "bytes32" }, { "indexed": true, "internalType": "bytes32", "name": "newAdminRole", "type": "bytes32" }], "name": "RoleAdminChanged", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "indexed": true, "internalType": "address", "name": "account", "type": "address" }, { "indexed": true, "internalType": "address", "name": "sender", "type": "address" }], "name": "RoleGranted", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "indexed": true, "internalType": "address", "name": "account", "type": "address" }, { "indexed": true, "internalType": "address", "name": "sender", "type": "address" }], "name": "RoleRevoked", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "address", "name": "account", "type": "address" }], "name": "Unpaused", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "implementation", "type": "address" }], "name": "Upgraded", "type": "event" }, { "inputs": [], "name": "APPROVER_ROLE", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "DEFAULT_ADMIN_ROLE", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "UPGRADE_INTERFACE_VERSION", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_user", "type": "address" }, { "internalType": "string", "name": "_pid", "type": "string" }, { "internalType": "string", "name": "_nftId", "type": "string" }, { "internalType": "string", "name": "_metadataURL", "type": "string" }, { "internalType": "uint256", "name": "_campaignId", "type": "uint256" }, { "internalType": "string", "name": "_anymalTxId", "type": "string" }], "name": "approveMetadata", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "campaignCount", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "name": "campaigns", "outputs": [{ "internalType": "string", "name": "name", "type": "string" }, { "internalType": "uint256", "name": "rewardAmount", "type": "uint256" }, { "internalType": "bool", "name": "isActive", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "string", "name": "_name", "type": "string" }, { "internalType": "uint256", "name": "_rewardAmount", "type": "uint256" }], "name": "createCampaign", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "defaultRewardAmount", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }], "name": "getRoleAdmin", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "internalType": "address", "name": "account", "type": "address" }], "name": "grantRole", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "internalType": "address", "name": "account", "type": "address" }], "name": "hasRole", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "initialOwner", "type": "address" }, { "internalType": "contract IERC20", "name": "_rewardToken", "type": "address" }, { "internalType": "contract IPetToken", "name": "_petToken", "type": "address" }, { "internalType": "uint256", "name": "_defaultRewardAmount", "type": "uint256" }], "name": "initialize", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "pause", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "paused", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "petToken", "outputs": [{ "internalType": "contract IPetToken", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "proxiableUUID", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "internalType": "address", "name": "callerConfirmation", "type": "address" }], "name": "renounceRole", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "internalType": "address", "name": "account", "type": "address" }], "name": "revokeRole", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "rewardToken", "outputs": [{ "internalType": "contract IERC20", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "string", "name": "_pid", "type": "string" }, { "internalType": "string", "name": "_nftId", "type": "string" }, { "internalType": "string", "name": "_metadataURL", "type": "string" }, { "internalType": "uint256", "name": "_campaignId", "type": "uint256" }, { "internalType": "string", "name": "_anymalTxId", "type": "string" }], "name": "submitMetadata", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "string", "name": "_pid", "type": "string" }, { "internalType": "string", "name": "_nftId", "type": "string" }, { "internalType": "string", "name": "_metadataURL", "type": "string" }, { "internalType": "string", "name": "_campaignName", "type": "string" }, { "internalType": "string", "name": "_anymalTxId", "type": "string" }], "name": "submitMetadataByCampaignName", "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": "unpause", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_campaignId", "type": "uint256" }, { "internalType": "uint256", "name": "_rewardAmount", "type": "uint256" }, { "internalType": "bool", "name": "_isActive", "type": "bool" }], "name": "updateCampaign", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_rewardAmount", "type": "uint256" }], "name": "updateDefaultReward", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "newImplementation", "type": "address" }, { "internalType": "bytes", "name": "data", "type": "bytes" }], "name": "upgradeToAndCall", "outputs": [], "stateMutability": "payable", "type": "function" }];
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
var REWARDABLE_ACTIONS_ABI = [{ "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, { "inputs": [], "name": "AccessControlBadConfirmation", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }, { "internalType": "bytes32", "name": "neededRole", "type": "bytes32" }], "name": "AccessControlUnauthorizedAccount", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "target", "type": "address" }], "name": "AddressEmptyCode", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "implementation", "type": "address" }], "name": "ERC1967InvalidImplementation", "type": "error" }, { "inputs": [], "name": "ERC1967NonPayable", "type": "error" }, { "inputs": [], "name": "FailedCall", "type": "error" }, { "inputs": [], "name": "InvalidInitialization", "type": "error" }, { "inputs": [], "name": "NotInitializing", "type": "error" }, { "inputs": [], "name": "ReentrancyGuardReentrantCall", "type": "error" }, { "inputs": [], "name": "UUPSUnauthorizedCallContext", "type": "error" }, { "inputs": [{ "internalType": "bytes32", "name": "slot", "type": "bytes32" }], "name": "UUPSUnsupportedProxiableUUID", "type": "error" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "bytes32", "name": "actionId", "type": "bytes32" }, { "indexed": false, "internalType": "uint256", "name": "rewardAmount", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "maxClaims", "type": "uint256" }], "name": "ActionTypeAdded", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "bytes32", "name": "actionId", "type": "bytes32" }, { "indexed": false, "internalType": "uint256", "name": "newRewardAmount", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "newMaxClaims", "type": "uint256" }], "name": "ActionTypeUpdated", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "bytes32", "name": "actionId", "type": "bytes32" }, { "indexed": true, "internalType": "address", "name": "user", "type": "address" }, { "indexed": true, "internalType": "uint256", "name": "index", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "quantity", "type": "uint256" }, { "indexed": false, "internalType": "uint16", "name": "multiplier", "type": "uint16" }], "name": "ActionValidated", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint64", "name": "version", "type": "uint64" }], "name": "Initialized", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "bytes32", "name": "actionId", "type": "bytes32" }, { "indexed": true, "internalType": "address", "name": "user", "type": "address" }, { "indexed": true, "internalType": "uint256", "name": "index", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }], "name": "RewardClaimedByIndex", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "indexed": true, "internalType": "bytes32", "name": "previousAdminRole", "type": "bytes32" }, { "indexed": true, "internalType": "bytes32", "name": "newAdminRole", "type": "bytes32" }], "name": "RoleAdminChanged", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "indexed": true, "internalType": "address", "name": "account", "type": "address" }, { "indexed": true, "internalType": "address", "name": "sender", "type": "address" }], "name": "RoleGranted", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "indexed": true, "internalType": "address", "name": "account", "type": "address" }, { "indexed": true, "internalType": "address", "name": "sender", "type": "address" }], "name": "RoleRevoked", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "implementation", "type": "address" }], "name": "Upgraded", "type": "event" }, { "inputs": [], "name": "ADMIN_ROLE", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "APPROVER_ROLE", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "DEFAULT_ADMIN_ROLE", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "UPGRADE_INTERFACE_VERSION", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "name": "actionConfigs", "outputs": [{ "internalType": "uint256", "name": "rewardAmount", "type": "uint256" }, { "internalType": "uint256", "name": "maxClaims", "type": "uint256" }, { "internalType": "bool", "name": "exists", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "actionId", "type": "bytes32" }, { "internalType": "uint256", "name": "rewardAmount", "type": "uint256" }, { "internalType": "uint256", "name": "maxClaims", "type": "uint256" }], "name": "addActionType", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "actionId", "type": "bytes32" }, { "internalType": "uint256", "name": "index", "type": "uint256" }], "name": "claimByIndex", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "amount", "type": "uint256" }], "name": "depositRewards", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }], "name": "getRoleAdmin", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "internalType": "address", "name": "account", "type": "address" }], "name": "grantRole", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "internalType": "address", "name": "account", "type": "address" }], "name": "hasRole", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "initialOwner", "type": "address" }, { "internalType": "contract IERC20", "name": "_rewardToken", "type": "address" }], "name": "initialize", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "proxiableUUID", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "internalType": "address", "name": "callerConfirmation", "type": "address" }], "name": "renounceRole", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "internalType": "address", "name": "account", "type": "address" }], "name": "revokeRole", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "rewardToken", "outputs": [{ "internalType": "contract IERC20", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" }], "name": "supportsInterface", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "user", "type": "address" }, { "internalType": "bytes32", "name": "actionId", "type": "bytes32" }], "name": "totalValidatedSlots", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "user", "type": "address" }, { "internalType": "bytes32", "name": "actionId", "type": "bytes32" }], "name": "unclaimedSlots", "outputs": [{ "internalType": "uint256", "name": "count", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "actionId", "type": "bytes32" }, { "internalType": "uint256", "name": "newRewardAmount", "type": "uint256" }, { "internalType": "uint256", "name": "newMaxClaims", "type": "uint256" }], "name": "updateActionType", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "newImplementation", "type": "address" }, { "internalType": "bytes", "name": "data", "type": "bytes" }], "name": "upgradeToAndCall", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "user", "type": "address" }, { "internalType": "bytes32", "name": "actionId", "type": "bytes32" }, { "internalType": "uint256", "name": "quantity", "type": "uint256" }, { "internalType": "uint16", "name": "multiplier", "type": "uint16" }], "name": "validateAction", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }, { "internalType": "address", "name": "", "type": "address" }, { "internalType": "uint256", "name": "", "type": "uint256" }], "name": "validations", "outputs": [{ "internalType": "uint256", "name": "quantity", "type": "uint256" }, { "internalType": "uint16", "name": "multiplier", "type": "uint16" }, { "internalType": "bool", "name": "claimed", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "amount", "type": "uint256" }], "name": "withdrawRewards", "outputs": [], "stateMutability": "nonpayable", "type": "function" }];
|
|
422
|
+
var PET_NFT_ABI = [{ "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, {
|
|
423
|
+
"inputs": [],
|
|
424
|
+
"name": "AccessControlBadConfirmation",
|
|
425
|
+
"type": "error"
|
|
426
|
+
}, {
|
|
427
|
+
"inputs": [{ "internalType": "address", "name": "account", "type": "address" }, {
|
|
428
|
+
"internalType": "bytes32",
|
|
429
|
+
"name": "neededRole",
|
|
430
|
+
"type": "bytes32"
|
|
431
|
+
}],
|
|
432
|
+
"name": "AccessControlUnauthorizedAccount",
|
|
433
|
+
"type": "error"
|
|
434
|
+
}, {
|
|
435
|
+
"inputs": [{ "internalType": "address", "name": "target", "type": "address" }],
|
|
436
|
+
"name": "AddressEmptyCode",
|
|
437
|
+
"type": "error"
|
|
438
|
+
}, {
|
|
439
|
+
"inputs": [{ "internalType": "address", "name": "implementation", "type": "address" }],
|
|
440
|
+
"name": "ERC1967InvalidImplementation",
|
|
441
|
+
"type": "error"
|
|
442
|
+
}, { "inputs": [], "name": "ERC1967NonPayable", "type": "error" }, {
|
|
443
|
+
"inputs": [],
|
|
444
|
+
"name": "EnforcedPause",
|
|
445
|
+
"type": "error"
|
|
446
|
+
}, { "inputs": [], "name": "ExpectedPause", "type": "error" }, {
|
|
447
|
+
"inputs": [],
|
|
448
|
+
"name": "FailedCall",
|
|
449
|
+
"type": "error"
|
|
450
|
+
}, { "inputs": [], "name": "InvalidInitialization", "type": "error" }, {
|
|
451
|
+
"inputs": [],
|
|
452
|
+
"name": "NotInitializing",
|
|
453
|
+
"type": "error"
|
|
454
|
+
}, { "inputs": [], "name": "UUPSUnauthorizedCallContext", "type": "error" }, {
|
|
455
|
+
"inputs": [{
|
|
456
|
+
"internalType": "bytes32",
|
|
457
|
+
"name": "slot",
|
|
458
|
+
"type": "bytes32"
|
|
459
|
+
}],
|
|
460
|
+
"name": "UUPSUnsupportedProxiableUUID",
|
|
461
|
+
"type": "error"
|
|
462
|
+
}, {
|
|
463
|
+
"anonymous": false,
|
|
464
|
+
"inputs": [{ "indexed": false, "internalType": "uint64", "name": "version", "type": "uint64" }],
|
|
465
|
+
"name": "Initialized",
|
|
466
|
+
"type": "event"
|
|
467
|
+
}, {
|
|
468
|
+
"anonymous": false,
|
|
469
|
+
"inputs": [{ "indexed": true, "internalType": "address", "name": "user", "type": "address" }, {
|
|
470
|
+
"indexed": false,
|
|
471
|
+
"internalType": "string",
|
|
472
|
+
"name": "pid",
|
|
473
|
+
"type": "string"
|
|
474
|
+
}, { "indexed": false, "internalType": "string", "name": "nftId", "type": "string" }, {
|
|
475
|
+
"indexed": false,
|
|
476
|
+
"internalType": "string",
|
|
477
|
+
"name": "metadataURL",
|
|
478
|
+
"type": "string"
|
|
479
|
+
}, { "indexed": false, "internalType": "uint256", "name": "campaignId", "type": "uint256" }, {
|
|
480
|
+
"indexed": false,
|
|
481
|
+
"internalType": "uint256",
|
|
482
|
+
"name": "rewardAmount",
|
|
483
|
+
"type": "uint256"
|
|
484
|
+
}, { "indexed": false, "internalType": "string", "name": "_anymalTxId", "type": "string" }],
|
|
485
|
+
"name": "MetadataApproved",
|
|
486
|
+
"type": "event"
|
|
487
|
+
}, {
|
|
488
|
+
"anonymous": false,
|
|
489
|
+
"inputs": [{ "indexed": true, "internalType": "address", "name": "user", "type": "address" }, {
|
|
490
|
+
"indexed": false,
|
|
491
|
+
"internalType": "string",
|
|
492
|
+
"name": "anymalTxId",
|
|
493
|
+
"type": "string"
|
|
494
|
+
}, { "indexed": false, "internalType": "string", "name": "pid", "type": "string" }, {
|
|
495
|
+
"indexed": false,
|
|
496
|
+
"internalType": "string",
|
|
497
|
+
"name": "nftId",
|
|
498
|
+
"type": "string"
|
|
499
|
+
}, { "indexed": false, "internalType": "string", "name": "metadataURL", "type": "string" }, {
|
|
500
|
+
"indexed": false,
|
|
501
|
+
"internalType": "uint256",
|
|
502
|
+
"name": "campaignId",
|
|
503
|
+
"type": "uint256"
|
|
504
|
+
}, { "indexed": false, "internalType": "uint256", "name": "rewardAmount", "type": "uint256" }, {
|
|
505
|
+
"indexed": false,
|
|
506
|
+
"internalType": "string",
|
|
507
|
+
"name": "_anymalTxId",
|
|
508
|
+
"type": "string"
|
|
509
|
+
}],
|
|
510
|
+
"name": "MetadataRejected",
|
|
511
|
+
"type": "event"
|
|
512
|
+
}, {
|
|
513
|
+
"anonymous": false,
|
|
514
|
+
"inputs": [{ "indexed": true, "internalType": "address", "name": "user", "type": "address" }, {
|
|
515
|
+
"indexed": false,
|
|
516
|
+
"internalType": "string",
|
|
517
|
+
"name": "pid",
|
|
518
|
+
"type": "string"
|
|
519
|
+
}, { "indexed": false, "internalType": "string", "name": "nftId", "type": "string" }, {
|
|
520
|
+
"indexed": false,
|
|
521
|
+
"internalType": "string",
|
|
522
|
+
"name": "metadataURL",
|
|
523
|
+
"type": "string"
|
|
524
|
+
}, { "indexed": false, "internalType": "uint256", "name": "campaignId", "type": "uint256" }, {
|
|
525
|
+
"indexed": false,
|
|
526
|
+
"internalType": "uint256",
|
|
527
|
+
"name": "rewardAmount",
|
|
528
|
+
"type": "uint256"
|
|
529
|
+
}, { "indexed": false, "internalType": "string", "name": "_anymalTxId", "type": "string" }],
|
|
530
|
+
"name": "MetadataSubmitted",
|
|
531
|
+
"type": "event"
|
|
532
|
+
}, {
|
|
533
|
+
"anonymous": false,
|
|
534
|
+
"inputs": [{ "indexed": false, "internalType": "address", "name": "account", "type": "address" }],
|
|
535
|
+
"name": "Paused",
|
|
536
|
+
"type": "event"
|
|
537
|
+
}, {
|
|
538
|
+
"anonymous": false,
|
|
539
|
+
"inputs": [{ "indexed": true, "internalType": "address", "name": "user", "type": "address" }, {
|
|
540
|
+
"indexed": false,
|
|
541
|
+
"internalType": "string",
|
|
542
|
+
"name": "pid",
|
|
543
|
+
"type": "string"
|
|
544
|
+
}, { "indexed": false, "internalType": "string", "name": "nftId", "type": "string" }, {
|
|
545
|
+
"indexed": false,
|
|
546
|
+
"internalType": "uint256",
|
|
547
|
+
"name": "rewardAmount",
|
|
548
|
+
"type": "uint256"
|
|
549
|
+
}, { "indexed": false, "internalType": "uint256", "name": "campaignId", "type": "uint256" }, {
|
|
550
|
+
"indexed": false,
|
|
551
|
+
"internalType": "string",
|
|
552
|
+
"name": "_anymalTxId",
|
|
553
|
+
"type": "string"
|
|
554
|
+
}],
|
|
555
|
+
"name": "RewardDistributed",
|
|
556
|
+
"type": "event"
|
|
557
|
+
}, {
|
|
558
|
+
"anonymous": false,
|
|
559
|
+
"inputs": [{ "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, {
|
|
560
|
+
"indexed": true,
|
|
561
|
+
"internalType": "bytes32",
|
|
562
|
+
"name": "previousAdminRole",
|
|
563
|
+
"type": "bytes32"
|
|
564
|
+
}, { "indexed": true, "internalType": "bytes32", "name": "newAdminRole", "type": "bytes32" }],
|
|
565
|
+
"name": "RoleAdminChanged",
|
|
566
|
+
"type": "event"
|
|
567
|
+
}, {
|
|
568
|
+
"anonymous": false,
|
|
569
|
+
"inputs": [{ "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, {
|
|
570
|
+
"indexed": true,
|
|
571
|
+
"internalType": "address",
|
|
572
|
+
"name": "account",
|
|
573
|
+
"type": "address"
|
|
574
|
+
}, { "indexed": true, "internalType": "address", "name": "sender", "type": "address" }],
|
|
575
|
+
"name": "RoleGranted",
|
|
576
|
+
"type": "event"
|
|
577
|
+
}, {
|
|
578
|
+
"anonymous": false,
|
|
579
|
+
"inputs": [{ "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, {
|
|
580
|
+
"indexed": true,
|
|
581
|
+
"internalType": "address",
|
|
582
|
+
"name": "account",
|
|
583
|
+
"type": "address"
|
|
584
|
+
}, { "indexed": true, "internalType": "address", "name": "sender", "type": "address" }],
|
|
585
|
+
"name": "RoleRevoked",
|
|
586
|
+
"type": "event"
|
|
587
|
+
}, {
|
|
588
|
+
"anonymous": false,
|
|
589
|
+
"inputs": [{ "indexed": false, "internalType": "address", "name": "account", "type": "address" }],
|
|
590
|
+
"name": "Unpaused",
|
|
591
|
+
"type": "event"
|
|
592
|
+
}, {
|
|
593
|
+
"anonymous": false,
|
|
594
|
+
"inputs": [{ "indexed": true, "internalType": "address", "name": "implementation", "type": "address" }],
|
|
595
|
+
"name": "Upgraded",
|
|
596
|
+
"type": "event"
|
|
597
|
+
}, {
|
|
598
|
+
"inputs": [],
|
|
599
|
+
"name": "APPROVER_ROLE",
|
|
600
|
+
"outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }],
|
|
601
|
+
"stateMutability": "view",
|
|
602
|
+
"type": "function"
|
|
603
|
+
}, {
|
|
604
|
+
"inputs": [],
|
|
605
|
+
"name": "DEFAULT_ADMIN_ROLE",
|
|
606
|
+
"outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }],
|
|
607
|
+
"stateMutability": "view",
|
|
608
|
+
"type": "function"
|
|
609
|
+
}, {
|
|
610
|
+
"inputs": [],
|
|
611
|
+
"name": "UPGRADE_INTERFACE_VERSION",
|
|
612
|
+
"outputs": [{ "internalType": "string", "name": "", "type": "string" }],
|
|
613
|
+
"stateMutability": "view",
|
|
614
|
+
"type": "function"
|
|
615
|
+
}, {
|
|
616
|
+
"inputs": [{ "internalType": "address", "name": "_user", "type": "address" }, {
|
|
617
|
+
"internalType": "string",
|
|
618
|
+
"name": "_pid",
|
|
619
|
+
"type": "string"
|
|
620
|
+
}, { "internalType": "string", "name": "_nftId", "type": "string" }, {
|
|
621
|
+
"internalType": "string",
|
|
622
|
+
"name": "_metadataURL",
|
|
623
|
+
"type": "string"
|
|
624
|
+
}, { "internalType": "uint256", "name": "_campaignId", "type": "uint256" }, {
|
|
625
|
+
"internalType": "string",
|
|
626
|
+
"name": "_anymalTxId",
|
|
627
|
+
"type": "string"
|
|
628
|
+
}],
|
|
629
|
+
"name": "approveMetadata",
|
|
630
|
+
"outputs": [],
|
|
631
|
+
"stateMutability": "nonpayable",
|
|
632
|
+
"type": "function"
|
|
633
|
+
}, {
|
|
634
|
+
"inputs": [],
|
|
635
|
+
"name": "campaignCount",
|
|
636
|
+
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
637
|
+
"stateMutability": "view",
|
|
638
|
+
"type": "function"
|
|
639
|
+
}, {
|
|
640
|
+
"inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
641
|
+
"name": "campaigns",
|
|
642
|
+
"outputs": [{ "internalType": "string", "name": "name", "type": "string" }, {
|
|
643
|
+
"internalType": "uint256",
|
|
644
|
+
"name": "rewardAmount",
|
|
645
|
+
"type": "uint256"
|
|
646
|
+
}, { "internalType": "bool", "name": "isActive", "type": "bool" }],
|
|
647
|
+
"stateMutability": "view",
|
|
648
|
+
"type": "function"
|
|
649
|
+
}, {
|
|
650
|
+
"inputs": [{ "internalType": "string", "name": "_name", "type": "string" }, {
|
|
651
|
+
"internalType": "uint256",
|
|
652
|
+
"name": "_rewardAmount",
|
|
653
|
+
"type": "uint256"
|
|
654
|
+
}],
|
|
655
|
+
"name": "createCampaign",
|
|
656
|
+
"outputs": [],
|
|
657
|
+
"stateMutability": "nonpayable",
|
|
658
|
+
"type": "function"
|
|
659
|
+
}, {
|
|
660
|
+
"inputs": [],
|
|
661
|
+
"name": "defaultRewardAmount",
|
|
662
|
+
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
663
|
+
"stateMutability": "view",
|
|
664
|
+
"type": "function"
|
|
665
|
+
}, {
|
|
666
|
+
"inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }],
|
|
667
|
+
"name": "getRoleAdmin",
|
|
668
|
+
"outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }],
|
|
669
|
+
"stateMutability": "view",
|
|
670
|
+
"type": "function"
|
|
671
|
+
}, {
|
|
672
|
+
"inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, {
|
|
673
|
+
"internalType": "address",
|
|
674
|
+
"name": "account",
|
|
675
|
+
"type": "address"
|
|
676
|
+
}],
|
|
677
|
+
"name": "grantRole",
|
|
678
|
+
"outputs": [],
|
|
679
|
+
"stateMutability": "nonpayable",
|
|
680
|
+
"type": "function"
|
|
681
|
+
}, {
|
|
682
|
+
"inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, {
|
|
683
|
+
"internalType": "address",
|
|
684
|
+
"name": "account",
|
|
685
|
+
"type": "address"
|
|
686
|
+
}],
|
|
687
|
+
"name": "hasRole",
|
|
688
|
+
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
|
|
689
|
+
"stateMutability": "view",
|
|
690
|
+
"type": "function"
|
|
691
|
+
}, {
|
|
692
|
+
"inputs": [{
|
|
693
|
+
"internalType": "address",
|
|
694
|
+
"name": "initialOwner",
|
|
695
|
+
"type": "address"
|
|
696
|
+
}, {
|
|
697
|
+
"internalType": "contract IERC20",
|
|
698
|
+
"name": "_rewardToken",
|
|
699
|
+
"type": "address"
|
|
700
|
+
}, { "internalType": "contract IPetToken", "name": "_petToken", "type": "address" }, {
|
|
701
|
+
"internalType": "uint256",
|
|
702
|
+
"name": "_defaultRewardAmount",
|
|
703
|
+
"type": "uint256"
|
|
704
|
+
}],
|
|
705
|
+
"name": "initialize",
|
|
706
|
+
"outputs": [],
|
|
707
|
+
"stateMutability": "nonpayable",
|
|
708
|
+
"type": "function"
|
|
709
|
+
}, {
|
|
710
|
+
"inputs": [],
|
|
711
|
+
"name": "pause",
|
|
712
|
+
"outputs": [],
|
|
713
|
+
"stateMutability": "nonpayable",
|
|
714
|
+
"type": "function"
|
|
715
|
+
}, {
|
|
716
|
+
"inputs": [],
|
|
717
|
+
"name": "paused",
|
|
718
|
+
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
|
|
719
|
+
"stateMutability": "view",
|
|
720
|
+
"type": "function"
|
|
721
|
+
}, {
|
|
722
|
+
"inputs": [],
|
|
723
|
+
"name": "petToken",
|
|
724
|
+
"outputs": [{ "internalType": "contract IPetToken", "name": "", "type": "address" }],
|
|
725
|
+
"stateMutability": "view",
|
|
726
|
+
"type": "function"
|
|
727
|
+
}, {
|
|
728
|
+
"inputs": [],
|
|
729
|
+
"name": "proxiableUUID",
|
|
730
|
+
"outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }],
|
|
731
|
+
"stateMutability": "view",
|
|
732
|
+
"type": "function"
|
|
733
|
+
}, {
|
|
734
|
+
"inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, {
|
|
735
|
+
"internalType": "address",
|
|
736
|
+
"name": "callerConfirmation",
|
|
737
|
+
"type": "address"
|
|
738
|
+
}],
|
|
739
|
+
"name": "renounceRole",
|
|
740
|
+
"outputs": [],
|
|
741
|
+
"stateMutability": "nonpayable",
|
|
742
|
+
"type": "function"
|
|
743
|
+
}, {
|
|
744
|
+
"inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, {
|
|
745
|
+
"internalType": "address",
|
|
746
|
+
"name": "account",
|
|
747
|
+
"type": "address"
|
|
748
|
+
}],
|
|
749
|
+
"name": "revokeRole",
|
|
750
|
+
"outputs": [],
|
|
751
|
+
"stateMutability": "nonpayable",
|
|
752
|
+
"type": "function"
|
|
753
|
+
}, {
|
|
754
|
+
"inputs": [],
|
|
755
|
+
"name": "rewardToken",
|
|
756
|
+
"outputs": [{ "internalType": "contract IERC20", "name": "", "type": "address" }],
|
|
757
|
+
"stateMutability": "view",
|
|
758
|
+
"type": "function"
|
|
759
|
+
}, {
|
|
760
|
+
"inputs": [{ "internalType": "string", "name": "_pid", "type": "string" }, {
|
|
761
|
+
"internalType": "string",
|
|
762
|
+
"name": "_nftId",
|
|
763
|
+
"type": "string"
|
|
764
|
+
}, { "internalType": "string", "name": "_metadataURL", "type": "string" }, {
|
|
765
|
+
"internalType": "uint256",
|
|
766
|
+
"name": "_campaignId",
|
|
767
|
+
"type": "uint256"
|
|
768
|
+
}, { "internalType": "string", "name": "_anymalTxId", "type": "string" }],
|
|
769
|
+
"name": "submitMetadata",
|
|
770
|
+
"outputs": [],
|
|
771
|
+
"stateMutability": "nonpayable",
|
|
772
|
+
"type": "function"
|
|
773
|
+
}, {
|
|
774
|
+
"inputs": [{ "internalType": "string", "name": "_pid", "type": "string" }, {
|
|
775
|
+
"internalType": "string",
|
|
776
|
+
"name": "_nftId",
|
|
777
|
+
"type": "string"
|
|
778
|
+
}, { "internalType": "string", "name": "_metadataURL", "type": "string" }, {
|
|
779
|
+
"internalType": "string",
|
|
780
|
+
"name": "_campaignName",
|
|
781
|
+
"type": "string"
|
|
782
|
+
}, { "internalType": "string", "name": "_anymalTxId", "type": "string" }],
|
|
783
|
+
"name": "submitMetadataByCampaignName",
|
|
784
|
+
"outputs": [],
|
|
785
|
+
"stateMutability": "nonpayable",
|
|
786
|
+
"type": "function"
|
|
787
|
+
}, {
|
|
788
|
+
"inputs": [{ "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" }],
|
|
789
|
+
"name": "supportsInterface",
|
|
790
|
+
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
|
|
791
|
+
"stateMutability": "view",
|
|
792
|
+
"type": "function"
|
|
793
|
+
}, {
|
|
794
|
+
"inputs": [],
|
|
795
|
+
"name": "unpause",
|
|
796
|
+
"outputs": [],
|
|
797
|
+
"stateMutability": "nonpayable",
|
|
798
|
+
"type": "function"
|
|
799
|
+
}, {
|
|
800
|
+
"inputs": [{ "internalType": "uint256", "name": "_campaignId", "type": "uint256" }, {
|
|
801
|
+
"internalType": "uint256",
|
|
802
|
+
"name": "_rewardAmount",
|
|
803
|
+
"type": "uint256"
|
|
804
|
+
}, { "internalType": "bool", "name": "_isActive", "type": "bool" }],
|
|
805
|
+
"name": "updateCampaign",
|
|
806
|
+
"outputs": [],
|
|
807
|
+
"stateMutability": "nonpayable",
|
|
808
|
+
"type": "function"
|
|
809
|
+
}, {
|
|
810
|
+
"inputs": [{ "internalType": "uint256", "name": "_rewardAmount", "type": "uint256" }],
|
|
811
|
+
"name": "updateDefaultReward",
|
|
812
|
+
"outputs": [],
|
|
813
|
+
"stateMutability": "nonpayable",
|
|
814
|
+
"type": "function"
|
|
815
|
+
}, {
|
|
816
|
+
"inputs": [{
|
|
817
|
+
"internalType": "address",
|
|
818
|
+
"name": "newImplementation",
|
|
819
|
+
"type": "address"
|
|
820
|
+
}, { "internalType": "bytes", "name": "data", "type": "bytes" }],
|
|
821
|
+
"name": "upgradeToAndCall",
|
|
822
|
+
"outputs": [],
|
|
823
|
+
"stateMutability": "payable",
|
|
824
|
+
"type": "function"
|
|
825
|
+
}];
|
|
826
|
+
var MARKETPLACE_ABI = [{
|
|
827
|
+
"inputs": [{ "internalType": "address", "name": "target", "type": "address" }],
|
|
828
|
+
"name": "AddressEmptyCode",
|
|
829
|
+
"type": "error"
|
|
830
|
+
}, { "inputs": [], "name": "ECDSAInvalidSignature", "type": "error" }, {
|
|
831
|
+
"inputs": [{
|
|
832
|
+
"internalType": "uint256",
|
|
833
|
+
"name": "length",
|
|
834
|
+
"type": "uint256"
|
|
835
|
+
}],
|
|
836
|
+
"name": "ECDSAInvalidSignatureLength",
|
|
837
|
+
"type": "error"
|
|
838
|
+
}, {
|
|
839
|
+
"inputs": [{ "internalType": "bytes32", "name": "s", "type": "bytes32" }],
|
|
840
|
+
"name": "ECDSAInvalidSignatureS",
|
|
841
|
+
"type": "error"
|
|
842
|
+
}, {
|
|
843
|
+
"inputs": [{ "internalType": "address", "name": "implementation", "type": "address" }],
|
|
844
|
+
"name": "ERC1967InvalidImplementation",
|
|
845
|
+
"type": "error"
|
|
846
|
+
}, { "inputs": [], "name": "ERC1967NonPayable", "type": "error" }, {
|
|
847
|
+
"inputs": [],
|
|
848
|
+
"name": "FailedCall",
|
|
849
|
+
"type": "error"
|
|
850
|
+
}, { "inputs": [], "name": "InvalidInitialization", "type": "error" }, {
|
|
851
|
+
"inputs": [],
|
|
852
|
+
"name": "NotInitializing",
|
|
853
|
+
"type": "error"
|
|
854
|
+
}, {
|
|
855
|
+
"inputs": [{ "internalType": "address", "name": "owner", "type": "address" }],
|
|
856
|
+
"name": "OwnableInvalidOwner",
|
|
857
|
+
"type": "error"
|
|
858
|
+
}, {
|
|
859
|
+
"inputs": [{ "internalType": "address", "name": "account", "type": "address" }],
|
|
860
|
+
"name": "OwnableUnauthorizedAccount",
|
|
861
|
+
"type": "error"
|
|
862
|
+
}, { "inputs": [], "name": "UUPSUnauthorizedCallContext", "type": "error" }, {
|
|
863
|
+
"inputs": [{
|
|
864
|
+
"internalType": "bytes32",
|
|
865
|
+
"name": "slot",
|
|
866
|
+
"type": "bytes32"
|
|
867
|
+
}],
|
|
868
|
+
"name": "UUPSUnsupportedProxiableUUID",
|
|
869
|
+
"type": "error"
|
|
870
|
+
}, {
|
|
871
|
+
"anonymous": false,
|
|
872
|
+
"inputs": [{ "indexed": false, "internalType": "uint64", "name": "version", "type": "uint64" }],
|
|
873
|
+
"name": "Initialized",
|
|
874
|
+
"type": "event"
|
|
875
|
+
}, {
|
|
876
|
+
"anonymous": false,
|
|
877
|
+
"inputs": [{
|
|
878
|
+
"indexed": true,
|
|
879
|
+
"internalType": "address",
|
|
880
|
+
"name": "previousOwner",
|
|
881
|
+
"type": "address"
|
|
882
|
+
}, { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" }],
|
|
883
|
+
"name": "OwnershipTransferred",
|
|
884
|
+
"type": "event"
|
|
885
|
+
}, {
|
|
886
|
+
"anonymous": false,
|
|
887
|
+
"inputs": [{ "indexed": true, "internalType": "string", "name": "orderId", "type": "string" }, {
|
|
888
|
+
"indexed": true,
|
|
889
|
+
"internalType": "address",
|
|
890
|
+
"name": "payer",
|
|
891
|
+
"type": "address"
|
|
892
|
+
}, { "indexed": true, "internalType": "string", "name": "pid", "type": "string" }, {
|
|
893
|
+
"indexed": false,
|
|
894
|
+
"internalType": "string",
|
|
895
|
+
"name": "anymalNftId",
|
|
896
|
+
"type": "string"
|
|
897
|
+
}, { "indexed": false, "internalType": "uint256", "name": "amountInTokens", "type": "uint256" }, {
|
|
898
|
+
"indexed": false,
|
|
899
|
+
"internalType": "uint256",
|
|
900
|
+
"name": "timestamp",
|
|
901
|
+
"type": "uint256"
|
|
902
|
+
}],
|
|
903
|
+
"name": "PartialPaymentMade",
|
|
904
|
+
"type": "event"
|
|
905
|
+
}, {
|
|
906
|
+
"anonymous": false,
|
|
907
|
+
"inputs": [{ "indexed": true, "internalType": "string", "name": "orderId", "type": "string" }, {
|
|
908
|
+
"indexed": true,
|
|
909
|
+
"internalType": "address",
|
|
910
|
+
"name": "payer",
|
|
911
|
+
"type": "address"
|
|
912
|
+
}, { "indexed": false, "internalType": "uint256", "name": "amountInTokens", "type": "uint256" }, {
|
|
913
|
+
"indexed": false,
|
|
914
|
+
"internalType": "uint256",
|
|
915
|
+
"name": "timestamp",
|
|
916
|
+
"type": "uint256"
|
|
917
|
+
}],
|
|
918
|
+
"name": "PaymentMade",
|
|
919
|
+
"type": "event"
|
|
920
|
+
}, {
|
|
921
|
+
"anonymous": false,
|
|
922
|
+
"inputs": [{ "indexed": true, "internalType": "string", "name": "orderId", "type": "string" }, {
|
|
923
|
+
"indexed": true,
|
|
924
|
+
"internalType": "address",
|
|
925
|
+
"name": "payer",
|
|
926
|
+
"type": "address"
|
|
927
|
+
}, { "indexed": true, "internalType": "string", "name": "pid", "type": "string" }, {
|
|
928
|
+
"indexed": false,
|
|
929
|
+
"internalType": "uint256",
|
|
930
|
+
"name": "refundedAmount",
|
|
931
|
+
"type": "uint256"
|
|
932
|
+
}, { "indexed": false, "internalType": "uint256", "name": "timestamp", "type": "uint256" }],
|
|
933
|
+
"name": "RefundProcessed",
|
|
934
|
+
"type": "event"
|
|
935
|
+
}, {
|
|
936
|
+
"anonymous": false,
|
|
937
|
+
"inputs": [{ "indexed": false, "internalType": "bool", "name": "enabled", "type": "bool" }],
|
|
938
|
+
"name": "SignatureCheckToggled",
|
|
939
|
+
"type": "event"
|
|
940
|
+
}, {
|
|
941
|
+
"anonymous": false,
|
|
942
|
+
"inputs": [{ "indexed": true, "internalType": "address", "name": "implementation", "type": "address" }],
|
|
943
|
+
"name": "Upgraded",
|
|
944
|
+
"type": "event"
|
|
945
|
+
}, {
|
|
946
|
+
"inputs": [],
|
|
947
|
+
"name": "UPGRADE_INTERFACE_VERSION",
|
|
948
|
+
"outputs": [{ "internalType": "string", "name": "", "type": "string" }],
|
|
949
|
+
"stateMutability": "view",
|
|
950
|
+
"type": "function"
|
|
951
|
+
}, {
|
|
952
|
+
"inputs": [],
|
|
953
|
+
"name": "authorizer",
|
|
954
|
+
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
|
955
|
+
"stateMutability": "view",
|
|
956
|
+
"type": "function"
|
|
957
|
+
}, {
|
|
958
|
+
"inputs": [{ "internalType": "address", "name": "_initialOwner", "type": "address" }, {
|
|
959
|
+
"internalType": "address",
|
|
960
|
+
"name": "_authorizer",
|
|
961
|
+
"type": "address"
|
|
962
|
+
}, { "internalType": "address", "name": "_kibbleToken", "type": "address" }],
|
|
963
|
+
"name": "initialize",
|
|
964
|
+
"outputs": [],
|
|
965
|
+
"stateMutability": "nonpayable",
|
|
966
|
+
"type": "function"
|
|
967
|
+
}, {
|
|
968
|
+
"inputs": [],
|
|
969
|
+
"name": "kibbleToken",
|
|
970
|
+
"outputs": [{ "internalType": "contract IERC20", "name": "", "type": "address" }],
|
|
971
|
+
"stateMutability": "view",
|
|
972
|
+
"type": "function"
|
|
973
|
+
}, {
|
|
974
|
+
"inputs": [],
|
|
975
|
+
"name": "owner",
|
|
976
|
+
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
|
977
|
+
"stateMutability": "view",
|
|
978
|
+
"type": "function"
|
|
979
|
+
}, {
|
|
980
|
+
"inputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }, {
|
|
981
|
+
"internalType": "address",
|
|
982
|
+
"name": "",
|
|
983
|
+
"type": "address"
|
|
984
|
+
}],
|
|
985
|
+
"name": "paidAmounts",
|
|
986
|
+
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
987
|
+
"stateMutability": "view",
|
|
988
|
+
"type": "function"
|
|
989
|
+
}, {
|
|
990
|
+
"inputs": [{ "internalType": "string", "name": "orderId", "type": "string" }, {
|
|
991
|
+
"internalType": "string",
|
|
992
|
+
"name": "anymalNftId",
|
|
993
|
+
"type": "string"
|
|
994
|
+
}, { "internalType": "string", "name": "pid", "type": "string" }, {
|
|
995
|
+
"internalType": "uint256",
|
|
996
|
+
"name": "amountInTokens",
|
|
997
|
+
"type": "uint256"
|
|
998
|
+
}, { "internalType": "uint256", "name": "maxTokenPayment", "type": "uint256" }, {
|
|
999
|
+
"internalType": "bytes32",
|
|
1000
|
+
"name": "nonce",
|
|
1001
|
+
"type": "bytes32"
|
|
1002
|
+
}, { "internalType": "uint256", "name": "deadline", "type": "uint256" }, {
|
|
1003
|
+
"internalType": "bytes",
|
|
1004
|
+
"name": "backendSignature",
|
|
1005
|
+
"type": "bytes"
|
|
1006
|
+
}],
|
|
1007
|
+
"name": "partialPay",
|
|
1008
|
+
"outputs": [],
|
|
1009
|
+
"stateMutability": "nonpayable",
|
|
1010
|
+
"type": "function"
|
|
1011
|
+
}, {
|
|
1012
|
+
"inputs": [],
|
|
1013
|
+
"name": "proxiableUUID",
|
|
1014
|
+
"outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }],
|
|
1015
|
+
"stateMutability": "view",
|
|
1016
|
+
"type": "function"
|
|
1017
|
+
}, {
|
|
1018
|
+
"inputs": [{ "internalType": "string", "name": "orderId", "type": "string" }, {
|
|
1019
|
+
"internalType": "address",
|
|
1020
|
+
"name": "payer",
|
|
1021
|
+
"type": "address"
|
|
1022
|
+
}, { "internalType": "string", "name": "pid", "type": "string" }],
|
|
1023
|
+
"name": "refund",
|
|
1024
|
+
"outputs": [],
|
|
1025
|
+
"stateMutability": "nonpayable",
|
|
1026
|
+
"type": "function"
|
|
1027
|
+
}, {
|
|
1028
|
+
"inputs": [],
|
|
1029
|
+
"name": "renounceOwnership",
|
|
1030
|
+
"outputs": [],
|
|
1031
|
+
"stateMutability": "nonpayable",
|
|
1032
|
+
"type": "function"
|
|
1033
|
+
}, {
|
|
1034
|
+
"inputs": [{ "internalType": "address", "name": "_authorizer", "type": "address" }],
|
|
1035
|
+
"name": "setAuthorizer",
|
|
1036
|
+
"outputs": [],
|
|
1037
|
+
"stateMutability": "nonpayable",
|
|
1038
|
+
"type": "function"
|
|
1039
|
+
}, {
|
|
1040
|
+
"inputs": [{ "internalType": "bool", "name": "enabled", "type": "bool" }],
|
|
1041
|
+
"name": "setSignatureCheckEnabled",
|
|
1042
|
+
"outputs": [],
|
|
1043
|
+
"stateMutability": "nonpayable",
|
|
1044
|
+
"type": "function"
|
|
1045
|
+
}, {
|
|
1046
|
+
"inputs": [],
|
|
1047
|
+
"name": "signatureCheckEnabled",
|
|
1048
|
+
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
|
|
1049
|
+
"stateMutability": "view",
|
|
1050
|
+
"type": "function"
|
|
1051
|
+
}, {
|
|
1052
|
+
"inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }],
|
|
1053
|
+
"name": "transferOwnership",
|
|
1054
|
+
"outputs": [],
|
|
1055
|
+
"stateMutability": "nonpayable",
|
|
1056
|
+
"type": "function"
|
|
1057
|
+
}, {
|
|
1058
|
+
"inputs": [{
|
|
1059
|
+
"internalType": "address",
|
|
1060
|
+
"name": "newImplementation",
|
|
1061
|
+
"type": "address"
|
|
1062
|
+
}, { "internalType": "bytes", "name": "data", "type": "bytes" }],
|
|
1063
|
+
"name": "upgradeToAndCall",
|
|
1064
|
+
"outputs": [],
|
|
1065
|
+
"stateMutability": "payable",
|
|
1066
|
+
"type": "function"
|
|
1067
|
+
}, {
|
|
1068
|
+
"inputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }],
|
|
1069
|
+
"name": "usedNonces",
|
|
1070
|
+
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
|
|
1071
|
+
"stateMutability": "view",
|
|
1072
|
+
"type": "function"
|
|
1073
|
+
}, {
|
|
1074
|
+
"inputs": [{ "internalType": "address", "name": "to", "type": "address" }, {
|
|
1075
|
+
"internalType": "uint256",
|
|
1076
|
+
"name": "amount",
|
|
1077
|
+
"type": "uint256"
|
|
1078
|
+
}],
|
|
1079
|
+
"name": "withdrawKibble",
|
|
1080
|
+
"outputs": [],
|
|
1081
|
+
"stateMutability": "nonpayable",
|
|
1082
|
+
"type": "function"
|
|
1083
|
+
}];
|
|
1084
|
+
var ORGANIZATION_BEACON_ABI = [{
|
|
1085
|
+
"inputs": [{
|
|
1086
|
+
"internalType": "address",
|
|
1087
|
+
"name": "_initialImplementation",
|
|
1088
|
+
"type": "address"
|
|
1089
|
+
}, { "internalType": "address", "name": "_initialOwner", "type": "address" }, {
|
|
1090
|
+
"internalType": "address",
|
|
1091
|
+
"name": "_anymalNFTProxy",
|
|
1092
|
+
"type": "address"
|
|
1093
|
+
}],
|
|
1094
|
+
"stateMutability": "nonpayable",
|
|
1095
|
+
"type": "constructor"
|
|
1096
|
+
}, {
|
|
1097
|
+
"inputs": [{ "internalType": "address", "name": "implementation", "type": "address" }],
|
|
1098
|
+
"name": "BeaconInvalidImplementation",
|
|
1099
|
+
"type": "error"
|
|
1100
|
+
}, {
|
|
1101
|
+
"inputs": [{ "internalType": "address", "name": "owner", "type": "address" }],
|
|
1102
|
+
"name": "OwnableInvalidOwner",
|
|
1103
|
+
"type": "error"
|
|
1104
|
+
}, {
|
|
1105
|
+
"inputs": [{ "internalType": "address", "name": "account", "type": "address" }],
|
|
1106
|
+
"name": "OwnableUnauthorizedAccount",
|
|
1107
|
+
"type": "error"
|
|
1108
|
+
}, {
|
|
1109
|
+
"anonymous": false,
|
|
1110
|
+
"inputs": [{ "indexed": false, "internalType": "string", "name": "pid", "type": "string" }, {
|
|
1111
|
+
"indexed": false,
|
|
1112
|
+
"internalType": "string",
|
|
1113
|
+
"name": "name",
|
|
1114
|
+
"type": "string"
|
|
1115
|
+
}, { "indexed": false, "internalType": "address", "name": "proxyAddress", "type": "address" }, {
|
|
1116
|
+
"indexed": false,
|
|
1117
|
+
"internalType": "address",
|
|
1118
|
+
"name": "networkAdmin",
|
|
1119
|
+
"type": "address"
|
|
1120
|
+
}, { "indexed": false, "internalType": "address", "name": "userAdmin", "type": "address" }],
|
|
1121
|
+
"name": "NewOrganizationCreated",
|
|
1122
|
+
"type": "event"
|
|
1123
|
+
}, {
|
|
1124
|
+
"anonymous": false,
|
|
1125
|
+
"inputs": [{
|
|
1126
|
+
"indexed": true,
|
|
1127
|
+
"internalType": "address",
|
|
1128
|
+
"name": "previousOwner",
|
|
1129
|
+
"type": "address"
|
|
1130
|
+
}, { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" }],
|
|
1131
|
+
"name": "OwnershipTransferred",
|
|
1132
|
+
"type": "event"
|
|
1133
|
+
}, {
|
|
1134
|
+
"anonymous": false,
|
|
1135
|
+
"inputs": [{ "indexed": true, "internalType": "address", "name": "implementation", "type": "address" }],
|
|
1136
|
+
"name": "Upgraded",
|
|
1137
|
+
"type": "event"
|
|
1138
|
+
}, {
|
|
1139
|
+
"inputs": [],
|
|
1140
|
+
"name": "anymalNFTProxy",
|
|
1141
|
+
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
|
1142
|
+
"stateMutability": "view",
|
|
1143
|
+
"type": "function"
|
|
1144
|
+
}, {
|
|
1145
|
+
"inputs": [{ "internalType": "address", "name": "_userAdmin", "type": "address" }, {
|
|
1146
|
+
"internalType": "string",
|
|
1147
|
+
"name": "_orgName",
|
|
1148
|
+
"type": "string"
|
|
1149
|
+
}, { "internalType": "string", "name": "_orgPid", "type": "string" }],
|
|
1150
|
+
"name": "createOrganizationProxy",
|
|
1151
|
+
"outputs": [{ "internalType": "address", "name": "proxyAddress", "type": "address" }],
|
|
1152
|
+
"stateMutability": "nonpayable",
|
|
1153
|
+
"type": "function"
|
|
1154
|
+
}, {
|
|
1155
|
+
"inputs": [],
|
|
1156
|
+
"name": "implementation",
|
|
1157
|
+
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
|
1158
|
+
"stateMutability": "view",
|
|
1159
|
+
"type": "function"
|
|
1160
|
+
}, {
|
|
1161
|
+
"inputs": [],
|
|
1162
|
+
"name": "owner",
|
|
1163
|
+
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
|
1164
|
+
"stateMutability": "view",
|
|
1165
|
+
"type": "function"
|
|
1166
|
+
}, {
|
|
1167
|
+
"inputs": [],
|
|
1168
|
+
"name": "renounceOwnership",
|
|
1169
|
+
"outputs": [],
|
|
1170
|
+
"stateMutability": "nonpayable",
|
|
1171
|
+
"type": "function"
|
|
1172
|
+
}, {
|
|
1173
|
+
"inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }],
|
|
1174
|
+
"name": "transferOwnership",
|
|
1175
|
+
"outputs": [],
|
|
1176
|
+
"stateMutability": "nonpayable",
|
|
1177
|
+
"type": "function"
|
|
1178
|
+
}, {
|
|
1179
|
+
"inputs": [{ "internalType": "address", "name": "newImplementation", "type": "address" }],
|
|
1180
|
+
"name": "upgradeBeaconTo",
|
|
1181
|
+
"outputs": [],
|
|
1182
|
+
"stateMutability": "nonpayable",
|
|
1183
|
+
"type": "function"
|
|
1184
|
+
}, {
|
|
1185
|
+
"inputs": [{ "internalType": "address", "name": "newImplementation", "type": "address" }],
|
|
1186
|
+
"name": "upgradeTo",
|
|
1187
|
+
"outputs": [],
|
|
1188
|
+
"stateMutability": "nonpayable",
|
|
1189
|
+
"type": "function"
|
|
1190
|
+
}];
|
|
1191
|
+
var REWARDABLE_ACTIONS_ABI = [{
|
|
1192
|
+
"inputs": [],
|
|
1193
|
+
"stateMutability": "nonpayable",
|
|
1194
|
+
"type": "constructor"
|
|
1195
|
+
}, { "inputs": [], "name": "AccessControlBadConfirmation", "type": "error" }, {
|
|
1196
|
+
"inputs": [{
|
|
1197
|
+
"internalType": "address",
|
|
1198
|
+
"name": "account",
|
|
1199
|
+
"type": "address"
|
|
1200
|
+
}, { "internalType": "bytes32", "name": "neededRole", "type": "bytes32" }],
|
|
1201
|
+
"name": "AccessControlUnauthorizedAccount",
|
|
1202
|
+
"type": "error"
|
|
1203
|
+
}, {
|
|
1204
|
+
"inputs": [{ "internalType": "address", "name": "target", "type": "address" }],
|
|
1205
|
+
"name": "AddressEmptyCode",
|
|
1206
|
+
"type": "error"
|
|
1207
|
+
}, {
|
|
1208
|
+
"inputs": [{ "internalType": "address", "name": "implementation", "type": "address" }],
|
|
1209
|
+
"name": "ERC1967InvalidImplementation",
|
|
1210
|
+
"type": "error"
|
|
1211
|
+
}, { "inputs": [], "name": "ERC1967NonPayable", "type": "error" }, {
|
|
1212
|
+
"inputs": [],
|
|
1213
|
+
"name": "FailedCall",
|
|
1214
|
+
"type": "error"
|
|
1215
|
+
}, { "inputs": [], "name": "InvalidInitialization", "type": "error" }, {
|
|
1216
|
+
"inputs": [],
|
|
1217
|
+
"name": "NotInitializing",
|
|
1218
|
+
"type": "error"
|
|
1219
|
+
}, { "inputs": [], "name": "ReentrancyGuardReentrantCall", "type": "error" }, {
|
|
1220
|
+
"inputs": [],
|
|
1221
|
+
"name": "UUPSUnauthorizedCallContext",
|
|
1222
|
+
"type": "error"
|
|
1223
|
+
}, {
|
|
1224
|
+
"inputs": [{ "internalType": "bytes32", "name": "slot", "type": "bytes32" }],
|
|
1225
|
+
"name": "UUPSUnsupportedProxiableUUID",
|
|
1226
|
+
"type": "error"
|
|
1227
|
+
}, {
|
|
1228
|
+
"anonymous": false,
|
|
1229
|
+
"inputs": [{ "indexed": true, "internalType": "bytes32", "name": "actionId", "type": "bytes32" }, {
|
|
1230
|
+
"indexed": false,
|
|
1231
|
+
"internalType": "uint256",
|
|
1232
|
+
"name": "rewardAmount",
|
|
1233
|
+
"type": "uint256"
|
|
1234
|
+
}, { "indexed": false, "internalType": "uint256", "name": "maxClaims", "type": "uint256" }],
|
|
1235
|
+
"name": "ActionTypeAdded",
|
|
1236
|
+
"type": "event"
|
|
1237
|
+
}, {
|
|
1238
|
+
"anonymous": false,
|
|
1239
|
+
"inputs": [{ "indexed": true, "internalType": "bytes32", "name": "actionId", "type": "bytes32" }, {
|
|
1240
|
+
"indexed": false,
|
|
1241
|
+
"internalType": "uint256",
|
|
1242
|
+
"name": "newRewardAmount",
|
|
1243
|
+
"type": "uint256"
|
|
1244
|
+
}, { "indexed": false, "internalType": "uint256", "name": "newMaxClaims", "type": "uint256" }],
|
|
1245
|
+
"name": "ActionTypeUpdated",
|
|
1246
|
+
"type": "event"
|
|
1247
|
+
}, {
|
|
1248
|
+
"anonymous": false,
|
|
1249
|
+
"inputs": [{ "indexed": true, "internalType": "bytes32", "name": "actionId", "type": "bytes32" }, {
|
|
1250
|
+
"indexed": true,
|
|
1251
|
+
"internalType": "address",
|
|
1252
|
+
"name": "user",
|
|
1253
|
+
"type": "address"
|
|
1254
|
+
}, { "indexed": true, "internalType": "uint256", "name": "index", "type": "uint256" }, {
|
|
1255
|
+
"indexed": false,
|
|
1256
|
+
"internalType": "uint256",
|
|
1257
|
+
"name": "quantity",
|
|
1258
|
+
"type": "uint256"
|
|
1259
|
+
}, { "indexed": false, "internalType": "uint16", "name": "multiplier", "type": "uint16" }],
|
|
1260
|
+
"name": "ActionValidated",
|
|
1261
|
+
"type": "event"
|
|
1262
|
+
}, {
|
|
1263
|
+
"anonymous": false,
|
|
1264
|
+
"inputs": [{ "indexed": false, "internalType": "uint64", "name": "version", "type": "uint64" }],
|
|
1265
|
+
"name": "Initialized",
|
|
1266
|
+
"type": "event"
|
|
1267
|
+
}, {
|
|
1268
|
+
"anonymous": false,
|
|
1269
|
+
"inputs": [{ "indexed": true, "internalType": "bytes32", "name": "actionId", "type": "bytes32" }, {
|
|
1270
|
+
"indexed": true,
|
|
1271
|
+
"internalType": "address",
|
|
1272
|
+
"name": "user",
|
|
1273
|
+
"type": "address"
|
|
1274
|
+
}, { "indexed": true, "internalType": "uint256", "name": "index", "type": "uint256" }, {
|
|
1275
|
+
"indexed": false,
|
|
1276
|
+
"internalType": "uint256",
|
|
1277
|
+
"name": "amount",
|
|
1278
|
+
"type": "uint256"
|
|
1279
|
+
}],
|
|
1280
|
+
"name": "RewardClaimedByIndex",
|
|
1281
|
+
"type": "event"
|
|
1282
|
+
}, {
|
|
1283
|
+
"anonymous": false,
|
|
1284
|
+
"inputs": [{ "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, {
|
|
1285
|
+
"indexed": true,
|
|
1286
|
+
"internalType": "bytes32",
|
|
1287
|
+
"name": "previousAdminRole",
|
|
1288
|
+
"type": "bytes32"
|
|
1289
|
+
}, { "indexed": true, "internalType": "bytes32", "name": "newAdminRole", "type": "bytes32" }],
|
|
1290
|
+
"name": "RoleAdminChanged",
|
|
1291
|
+
"type": "event"
|
|
1292
|
+
}, {
|
|
1293
|
+
"anonymous": false,
|
|
1294
|
+
"inputs": [{ "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, {
|
|
1295
|
+
"indexed": true,
|
|
1296
|
+
"internalType": "address",
|
|
1297
|
+
"name": "account",
|
|
1298
|
+
"type": "address"
|
|
1299
|
+
}, { "indexed": true, "internalType": "address", "name": "sender", "type": "address" }],
|
|
1300
|
+
"name": "RoleGranted",
|
|
1301
|
+
"type": "event"
|
|
1302
|
+
}, {
|
|
1303
|
+
"anonymous": false,
|
|
1304
|
+
"inputs": [{ "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, {
|
|
1305
|
+
"indexed": true,
|
|
1306
|
+
"internalType": "address",
|
|
1307
|
+
"name": "account",
|
|
1308
|
+
"type": "address"
|
|
1309
|
+
}, { "indexed": true, "internalType": "address", "name": "sender", "type": "address" }],
|
|
1310
|
+
"name": "RoleRevoked",
|
|
1311
|
+
"type": "event"
|
|
1312
|
+
}, {
|
|
1313
|
+
"anonymous": false,
|
|
1314
|
+
"inputs": [{ "indexed": true, "internalType": "address", "name": "implementation", "type": "address" }],
|
|
1315
|
+
"name": "Upgraded",
|
|
1316
|
+
"type": "event"
|
|
1317
|
+
}, {
|
|
1318
|
+
"inputs": [],
|
|
1319
|
+
"name": "ADMIN_ROLE",
|
|
1320
|
+
"outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }],
|
|
1321
|
+
"stateMutability": "view",
|
|
1322
|
+
"type": "function"
|
|
1323
|
+
}, {
|
|
1324
|
+
"inputs": [],
|
|
1325
|
+
"name": "APPROVER_ROLE",
|
|
1326
|
+
"outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }],
|
|
1327
|
+
"stateMutability": "view",
|
|
1328
|
+
"type": "function"
|
|
1329
|
+
}, {
|
|
1330
|
+
"inputs": [],
|
|
1331
|
+
"name": "DEFAULT_ADMIN_ROLE",
|
|
1332
|
+
"outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }],
|
|
1333
|
+
"stateMutability": "view",
|
|
1334
|
+
"type": "function"
|
|
1335
|
+
}, {
|
|
1336
|
+
"inputs": [],
|
|
1337
|
+
"name": "UPGRADE_INTERFACE_VERSION",
|
|
1338
|
+
"outputs": [{ "internalType": "string", "name": "", "type": "string" }],
|
|
1339
|
+
"stateMutability": "view",
|
|
1340
|
+
"type": "function"
|
|
1341
|
+
}, {
|
|
1342
|
+
"inputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }],
|
|
1343
|
+
"name": "actionConfigs",
|
|
1344
|
+
"outputs": [{ "internalType": "uint256", "name": "rewardAmount", "type": "uint256" }, {
|
|
1345
|
+
"internalType": "uint256",
|
|
1346
|
+
"name": "maxClaims",
|
|
1347
|
+
"type": "uint256"
|
|
1348
|
+
}, { "internalType": "bool", "name": "exists", "type": "bool" }],
|
|
1349
|
+
"stateMutability": "view",
|
|
1350
|
+
"type": "function"
|
|
1351
|
+
}, {
|
|
1352
|
+
"inputs": [{ "internalType": "bytes32", "name": "actionId", "type": "bytes32" }, {
|
|
1353
|
+
"internalType": "uint256",
|
|
1354
|
+
"name": "rewardAmount",
|
|
1355
|
+
"type": "uint256"
|
|
1356
|
+
}, { "internalType": "uint256", "name": "maxClaims", "type": "uint256" }],
|
|
1357
|
+
"name": "addActionType",
|
|
1358
|
+
"outputs": [],
|
|
1359
|
+
"stateMutability": "nonpayable",
|
|
1360
|
+
"type": "function"
|
|
1361
|
+
}, {
|
|
1362
|
+
"inputs": [{ "internalType": "bytes32", "name": "actionId", "type": "bytes32" }, {
|
|
1363
|
+
"internalType": "uint256",
|
|
1364
|
+
"name": "index",
|
|
1365
|
+
"type": "uint256"
|
|
1366
|
+
}],
|
|
1367
|
+
"name": "claimByIndex",
|
|
1368
|
+
"outputs": [],
|
|
1369
|
+
"stateMutability": "nonpayable",
|
|
1370
|
+
"type": "function"
|
|
1371
|
+
}, {
|
|
1372
|
+
"inputs": [{ "internalType": "uint256", "name": "amount", "type": "uint256" }],
|
|
1373
|
+
"name": "depositRewards",
|
|
1374
|
+
"outputs": [],
|
|
1375
|
+
"stateMutability": "nonpayable",
|
|
1376
|
+
"type": "function"
|
|
1377
|
+
}, {
|
|
1378
|
+
"inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }],
|
|
1379
|
+
"name": "getRoleAdmin",
|
|
1380
|
+
"outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }],
|
|
1381
|
+
"stateMutability": "view",
|
|
1382
|
+
"type": "function"
|
|
1383
|
+
}, {
|
|
1384
|
+
"inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, {
|
|
1385
|
+
"internalType": "address",
|
|
1386
|
+
"name": "account",
|
|
1387
|
+
"type": "address"
|
|
1388
|
+
}],
|
|
1389
|
+
"name": "grantRole",
|
|
1390
|
+
"outputs": [],
|
|
1391
|
+
"stateMutability": "nonpayable",
|
|
1392
|
+
"type": "function"
|
|
1393
|
+
}, {
|
|
1394
|
+
"inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, {
|
|
1395
|
+
"internalType": "address",
|
|
1396
|
+
"name": "account",
|
|
1397
|
+
"type": "address"
|
|
1398
|
+
}],
|
|
1399
|
+
"name": "hasRole",
|
|
1400
|
+
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
|
|
1401
|
+
"stateMutability": "view",
|
|
1402
|
+
"type": "function"
|
|
1403
|
+
}, {
|
|
1404
|
+
"inputs": [{
|
|
1405
|
+
"internalType": "address",
|
|
1406
|
+
"name": "initialOwner",
|
|
1407
|
+
"type": "address"
|
|
1408
|
+
}, { "internalType": "contract IERC20", "name": "_rewardToken", "type": "address" }],
|
|
1409
|
+
"name": "initialize",
|
|
1410
|
+
"outputs": [],
|
|
1411
|
+
"stateMutability": "nonpayable",
|
|
1412
|
+
"type": "function"
|
|
1413
|
+
}, {
|
|
1414
|
+
"inputs": [],
|
|
1415
|
+
"name": "proxiableUUID",
|
|
1416
|
+
"outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }],
|
|
1417
|
+
"stateMutability": "view",
|
|
1418
|
+
"type": "function"
|
|
1419
|
+
}, {
|
|
1420
|
+
"inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, {
|
|
1421
|
+
"internalType": "address",
|
|
1422
|
+
"name": "callerConfirmation",
|
|
1423
|
+
"type": "address"
|
|
1424
|
+
}],
|
|
1425
|
+
"name": "renounceRole",
|
|
1426
|
+
"outputs": [],
|
|
1427
|
+
"stateMutability": "nonpayable",
|
|
1428
|
+
"type": "function"
|
|
1429
|
+
}, {
|
|
1430
|
+
"inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, {
|
|
1431
|
+
"internalType": "address",
|
|
1432
|
+
"name": "account",
|
|
1433
|
+
"type": "address"
|
|
1434
|
+
}],
|
|
1435
|
+
"name": "revokeRole",
|
|
1436
|
+
"outputs": [],
|
|
1437
|
+
"stateMutability": "nonpayable",
|
|
1438
|
+
"type": "function"
|
|
1439
|
+
}, {
|
|
1440
|
+
"inputs": [],
|
|
1441
|
+
"name": "rewardToken",
|
|
1442
|
+
"outputs": [{ "internalType": "contract IERC20", "name": "", "type": "address" }],
|
|
1443
|
+
"stateMutability": "view",
|
|
1444
|
+
"type": "function"
|
|
1445
|
+
}, {
|
|
1446
|
+
"inputs": [{ "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" }],
|
|
1447
|
+
"name": "supportsInterface",
|
|
1448
|
+
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
|
|
1449
|
+
"stateMutability": "view",
|
|
1450
|
+
"type": "function"
|
|
1451
|
+
}, {
|
|
1452
|
+
"inputs": [{ "internalType": "address", "name": "user", "type": "address" }, {
|
|
1453
|
+
"internalType": "bytes32",
|
|
1454
|
+
"name": "actionId",
|
|
1455
|
+
"type": "bytes32"
|
|
1456
|
+
}],
|
|
1457
|
+
"name": "totalValidatedSlots",
|
|
1458
|
+
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
1459
|
+
"stateMutability": "view",
|
|
1460
|
+
"type": "function"
|
|
1461
|
+
}, {
|
|
1462
|
+
"inputs": [{ "internalType": "address", "name": "user", "type": "address" }, {
|
|
1463
|
+
"internalType": "bytes32",
|
|
1464
|
+
"name": "actionId",
|
|
1465
|
+
"type": "bytes32"
|
|
1466
|
+
}],
|
|
1467
|
+
"name": "unclaimedSlots",
|
|
1468
|
+
"outputs": [{ "internalType": "uint256", "name": "count", "type": "uint256" }],
|
|
1469
|
+
"stateMutability": "view",
|
|
1470
|
+
"type": "function"
|
|
1471
|
+
}, {
|
|
1472
|
+
"inputs": [{ "internalType": "bytes32", "name": "actionId", "type": "bytes32" }, {
|
|
1473
|
+
"internalType": "uint256",
|
|
1474
|
+
"name": "newRewardAmount",
|
|
1475
|
+
"type": "uint256"
|
|
1476
|
+
}, { "internalType": "uint256", "name": "newMaxClaims", "type": "uint256" }],
|
|
1477
|
+
"name": "updateActionType",
|
|
1478
|
+
"outputs": [],
|
|
1479
|
+
"stateMutability": "nonpayable",
|
|
1480
|
+
"type": "function"
|
|
1481
|
+
}, {
|
|
1482
|
+
"inputs": [{
|
|
1483
|
+
"internalType": "address",
|
|
1484
|
+
"name": "newImplementation",
|
|
1485
|
+
"type": "address"
|
|
1486
|
+
}, { "internalType": "bytes", "name": "data", "type": "bytes" }],
|
|
1487
|
+
"name": "upgradeToAndCall",
|
|
1488
|
+
"outputs": [],
|
|
1489
|
+
"stateMutability": "payable",
|
|
1490
|
+
"type": "function"
|
|
1491
|
+
}, {
|
|
1492
|
+
"inputs": [{ "internalType": "address", "name": "user", "type": "address" }, {
|
|
1493
|
+
"internalType": "bytes32",
|
|
1494
|
+
"name": "actionId",
|
|
1495
|
+
"type": "bytes32"
|
|
1496
|
+
}, { "internalType": "uint256", "name": "quantity", "type": "uint256" }, {
|
|
1497
|
+
"internalType": "uint16",
|
|
1498
|
+
"name": "multiplier",
|
|
1499
|
+
"type": "uint16"
|
|
1500
|
+
}],
|
|
1501
|
+
"name": "validateAction",
|
|
1502
|
+
"outputs": [],
|
|
1503
|
+
"stateMutability": "nonpayable",
|
|
1504
|
+
"type": "function"
|
|
1505
|
+
}, {
|
|
1506
|
+
"inputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }, {
|
|
1507
|
+
"internalType": "address",
|
|
1508
|
+
"name": "",
|
|
1509
|
+
"type": "address"
|
|
1510
|
+
}, { "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
1511
|
+
"name": "validations",
|
|
1512
|
+
"outputs": [{ "internalType": "uint256", "name": "quantity", "type": "uint256" }, {
|
|
1513
|
+
"internalType": "uint16",
|
|
1514
|
+
"name": "multiplier",
|
|
1515
|
+
"type": "uint16"
|
|
1516
|
+
}, { "internalType": "bool", "name": "claimed", "type": "bool" }],
|
|
1517
|
+
"stateMutability": "view",
|
|
1518
|
+
"type": "function"
|
|
1519
|
+
}, {
|
|
1520
|
+
"inputs": [{ "internalType": "uint256", "name": "amount", "type": "uint256" }],
|
|
1521
|
+
"name": "withdrawRewards",
|
|
1522
|
+
"outputs": [],
|
|
1523
|
+
"stateMutability": "nonpayable",
|
|
1524
|
+
"type": "function"
|
|
1525
|
+
}];
|
|
398
1526
|
var ORGANIZATION_IMPL_ABI = [
|
|
399
1527
|
{
|
|
400
1528
|
"inputs": [],
|
|
@@ -1205,7 +2333,506 @@ var ORGANIZATION_IMPL_ABI = [
|
|
|
1205
2333
|
"type": "function"
|
|
1206
2334
|
}
|
|
1207
2335
|
];
|
|
1208
|
-
var KIBBLE_TOKEN_ABI = [{ "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, { "inputs": [{ "internalType": "address", "name": "target", "type": "address" }], "name": "AddressEmptyCode", "type": "error" }, { "inputs": [], "name": "CheckpointUnorderedInsertion", "type": "error" }, { "inputs": [], "name": "ECDSAInvalidSignature", "type": "error" }, { "inputs": [{ "internalType": "uint256", "name": "length", "type": "uint256" }], "name": "ECDSAInvalidSignatureLength", "type": "error" }, { "inputs": [{ "internalType": "bytes32", "name": "s", "type": "bytes32" }], "name": "ECDSAInvalidSignatureS", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "implementation", "type": "address" }], "name": "ERC1967InvalidImplementation", "type": "error" }, { "inputs": [], "name": "ERC1967NonPayable", "type": "error" }, { "inputs": [{ "internalType": "uint256", "name": "increasedSupply", "type": "uint256" }, { "internalType": "uint256", "name": "cap", "type": "uint256" }], "name": "ERC20ExceededSafeSupply", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "spender", "type": "address" }, { "internalType": "uint256", "name": "allowance", "type": "uint256" }, { "internalType": "uint256", "name": "needed", "type": "uint256" }], "name": "ERC20InsufficientAllowance", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "sender", "type": "address" }, { "internalType": "uint256", "name": "balance", "type": "uint256" }, { "internalType": "uint256", "name": "needed", "type": "uint256" }], "name": "ERC20InsufficientBalance", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "approver", "type": "address" }], "name": "ERC20InvalidApprover", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "receiver", "type": "address" }], "name": "ERC20InvalidReceiver", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "sender", "type": "address" }], "name": "ERC20InvalidSender", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "spender", "type": "address" }], "name": "ERC20InvalidSpender", "type": "error" }, { "inputs": [{ "internalType": "uint256", "name": "deadline", "type": "uint256" }], "name": "ERC2612ExpiredSignature", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "signer", "type": "address" }, { "internalType": "address", "name": "owner", "type": "address" }], "name": "ERC2612InvalidSigner", "type": "error" }, { "inputs": [{ "internalType": "uint256", "name": "timepoint", "type": "uint256" }, { "internalType": "uint48", "name": "clock", "type": "uint48" }], "name": "ERC5805FutureLookup", "type": "error" }, { "inputs": [], "name": "ERC6372InconsistentClock", "type": "error" }, { "inputs": [], "name": "EnforcedPause", "type": "error" }, { "inputs": [], "name": "ExpectedPause", "type": "error" }, { "inputs": [], "name": "FailedCall", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }, { "internalType": "uint256", "name": "currentNonce", "type": "uint256" }], "name": "InvalidAccountNonce", "type": "error" }, { "inputs": [], "name": "InvalidInitialization", "type": "error" }, { "inputs": [], "name": "NotInitializing", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }], "name": "OwnableInvalidOwner", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], "name": "OwnableUnauthorizedAccount", "type": "error" }, { "inputs": [{ "internalType": "uint8", "name": "bits", "type": "uint8" }, { "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "SafeCastOverflowedUintDowncast", "type": "error" }, { "inputs": [], "name": "UUPSUnauthorizedCallContext", "type": "error" }, { "inputs": [{ "internalType": "bytes32", "name": "slot", "type": "bytes32" }], "name": "UUPSUnsupportedProxiableUUID", "type": "error" }, { "inputs": [{ "internalType": "uint256", "name": "expiry", "type": "uint256" }], "name": "VotesExpiredSignature", "type": "error" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "spender", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "Approval", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "delegator", "type": "address" }, { "indexed": true, "internalType": "address", "name": "fromDelegate", "type": "address" }, { "indexed": true, "internalType": "address", "name": "toDelegate", "type": "address" }], "name": "DelegateChanged", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "delegate", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "previousVotes", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "newVotes", "type": "uint256" }], "name": "DelegateVotesChanged", "type": "event" }, { "anonymous": false, "inputs": [], "name": "EIP712DomainChanged", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint64", "name": "version", "type": "uint64" }], "name": "Initialized", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" }], "name": "OwnershipTransferred", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "address", "name": "account", "type": "address" }], "name": "Paused", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "from", "type": "address" }, { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "Transfer", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "address", "name": "account", "type": "address" }], "name": "Unpaused", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "implementation", "type": "address" }], "name": "Upgraded", "type": "event" }, { "inputs": [], "name": "CLOCK_MODE", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "DOMAIN_SEPARATOR", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "UPGRADE_INTERFACE_VERSION", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "address", "name": "spender", "type": "address" }], "name": "allowance", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "spender", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "approve", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], "name": "balanceOf", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "burn", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "burnFrom", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }, { "internalType": "uint32", "name": "pos", "type": "uint32" }], "name": "checkpoints", "outputs": [{ "components": [{ "internalType": "uint48", "name": "_key", "type": "uint48" }, { "internalType": "uint208", "name": "_value", "type": "uint208" }], "internalType": "struct Checkpoints.Checkpoint208", "name": "", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "clock", "outputs": [{ "internalType": "uint48", "name": "", "type": "uint48" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "decimals", "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "delegatee", "type": "address" }], "name": "delegate", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "delegatee", "type": "address" }, { "internalType": "uint256", "name": "nonce", "type": "uint256" }, { "internalType": "uint256", "name": "expiry", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" }], "name": "delegateBySig", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], "name": "delegates", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "eip712Domain", "outputs": [{ "internalType": "bytes1", "name": "fields", "type": "bytes1" }, { "internalType": "string", "name": "name", "type": "string" }, { "internalType": "string", "name": "version", "type": "string" }, { "internalType": "uint256", "name": "chainId", "type": "uint256" }, { "internalType": "address", "name": "verifyingContract", "type": "address" }, { "internalType": "bytes32", "name": "salt", "type": "bytes32" }, { "internalType": "uint256[]", "name": "extensions", "type": "uint256[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "timepoint", "type": "uint256" }], "name": "getPastTotalSupply", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }, { "internalType": "uint256", "name": "timepoint", "type": "uint256" }], "name": "getPastVotes", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], "name": "getVotes", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "initialOwner", "type": "address" }], "name": "initialize", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" }], "name": "mint", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "name", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }], "name": "nonces", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], "name": "numCheckpoints", "outputs": [{ "internalType": "uint32", "name": "", "type": "uint32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "owner", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "pause", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "paused", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "address", "name": "spender", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" }], "name": "permit", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "proxiableUUID", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "symbol", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "totalSupply", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "transfer", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "transferFrom", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], "name": "transferOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "unpause", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "newImplementation", "type": "address" }, { "internalType": "bytes", "name": "data", "type": "bytes" }], "name": "upgradeToAndCall", "outputs": [], "stateMutability": "payable", "type": "function" }];
|
|
2336
|
+
var KIBBLE_TOKEN_ABI = [{
|
|
2337
|
+
"inputs": [],
|
|
2338
|
+
"stateMutability": "nonpayable",
|
|
2339
|
+
"type": "constructor"
|
|
2340
|
+
}, {
|
|
2341
|
+
"inputs": [{ "internalType": "address", "name": "target", "type": "address" }],
|
|
2342
|
+
"name": "AddressEmptyCode",
|
|
2343
|
+
"type": "error"
|
|
2344
|
+
}, { "inputs": [], "name": "CheckpointUnorderedInsertion", "type": "error" }, {
|
|
2345
|
+
"inputs": [],
|
|
2346
|
+
"name": "ECDSAInvalidSignature",
|
|
2347
|
+
"type": "error"
|
|
2348
|
+
}, {
|
|
2349
|
+
"inputs": [{ "internalType": "uint256", "name": "length", "type": "uint256" }],
|
|
2350
|
+
"name": "ECDSAInvalidSignatureLength",
|
|
2351
|
+
"type": "error"
|
|
2352
|
+
}, {
|
|
2353
|
+
"inputs": [{ "internalType": "bytes32", "name": "s", "type": "bytes32" }],
|
|
2354
|
+
"name": "ECDSAInvalidSignatureS",
|
|
2355
|
+
"type": "error"
|
|
2356
|
+
}, {
|
|
2357
|
+
"inputs": [{ "internalType": "address", "name": "implementation", "type": "address" }],
|
|
2358
|
+
"name": "ERC1967InvalidImplementation",
|
|
2359
|
+
"type": "error"
|
|
2360
|
+
}, { "inputs": [], "name": "ERC1967NonPayable", "type": "error" }, {
|
|
2361
|
+
"inputs": [{
|
|
2362
|
+
"internalType": "uint256",
|
|
2363
|
+
"name": "increasedSupply",
|
|
2364
|
+
"type": "uint256"
|
|
2365
|
+
}, { "internalType": "uint256", "name": "cap", "type": "uint256" }],
|
|
2366
|
+
"name": "ERC20ExceededSafeSupply",
|
|
2367
|
+
"type": "error"
|
|
2368
|
+
}, {
|
|
2369
|
+
"inputs": [{ "internalType": "address", "name": "spender", "type": "address" }, {
|
|
2370
|
+
"internalType": "uint256",
|
|
2371
|
+
"name": "allowance",
|
|
2372
|
+
"type": "uint256"
|
|
2373
|
+
}, { "internalType": "uint256", "name": "needed", "type": "uint256" }],
|
|
2374
|
+
"name": "ERC20InsufficientAllowance",
|
|
2375
|
+
"type": "error"
|
|
2376
|
+
}, {
|
|
2377
|
+
"inputs": [{ "internalType": "address", "name": "sender", "type": "address" }, {
|
|
2378
|
+
"internalType": "uint256",
|
|
2379
|
+
"name": "balance",
|
|
2380
|
+
"type": "uint256"
|
|
2381
|
+
}, { "internalType": "uint256", "name": "needed", "type": "uint256" }],
|
|
2382
|
+
"name": "ERC20InsufficientBalance",
|
|
2383
|
+
"type": "error"
|
|
2384
|
+
}, {
|
|
2385
|
+
"inputs": [{ "internalType": "address", "name": "approver", "type": "address" }],
|
|
2386
|
+
"name": "ERC20InvalidApprover",
|
|
2387
|
+
"type": "error"
|
|
2388
|
+
}, {
|
|
2389
|
+
"inputs": [{ "internalType": "address", "name": "receiver", "type": "address" }],
|
|
2390
|
+
"name": "ERC20InvalidReceiver",
|
|
2391
|
+
"type": "error"
|
|
2392
|
+
}, {
|
|
2393
|
+
"inputs": [{ "internalType": "address", "name": "sender", "type": "address" }],
|
|
2394
|
+
"name": "ERC20InvalidSender",
|
|
2395
|
+
"type": "error"
|
|
2396
|
+
}, {
|
|
2397
|
+
"inputs": [{ "internalType": "address", "name": "spender", "type": "address" }],
|
|
2398
|
+
"name": "ERC20InvalidSpender",
|
|
2399
|
+
"type": "error"
|
|
2400
|
+
}, {
|
|
2401
|
+
"inputs": [{ "internalType": "uint256", "name": "deadline", "type": "uint256" }],
|
|
2402
|
+
"name": "ERC2612ExpiredSignature",
|
|
2403
|
+
"type": "error"
|
|
2404
|
+
}, {
|
|
2405
|
+
"inputs": [{ "internalType": "address", "name": "signer", "type": "address" }, {
|
|
2406
|
+
"internalType": "address",
|
|
2407
|
+
"name": "owner",
|
|
2408
|
+
"type": "address"
|
|
2409
|
+
}],
|
|
2410
|
+
"name": "ERC2612InvalidSigner",
|
|
2411
|
+
"type": "error"
|
|
2412
|
+
}, {
|
|
2413
|
+
"inputs": [{ "internalType": "uint256", "name": "timepoint", "type": "uint256" }, {
|
|
2414
|
+
"internalType": "uint48",
|
|
2415
|
+
"name": "clock",
|
|
2416
|
+
"type": "uint48"
|
|
2417
|
+
}],
|
|
2418
|
+
"name": "ERC5805FutureLookup",
|
|
2419
|
+
"type": "error"
|
|
2420
|
+
}, { "inputs": [], "name": "ERC6372InconsistentClock", "type": "error" }, {
|
|
2421
|
+
"inputs": [],
|
|
2422
|
+
"name": "EnforcedPause",
|
|
2423
|
+
"type": "error"
|
|
2424
|
+
}, { "inputs": [], "name": "ExpectedPause", "type": "error" }, {
|
|
2425
|
+
"inputs": [],
|
|
2426
|
+
"name": "FailedCall",
|
|
2427
|
+
"type": "error"
|
|
2428
|
+
}, {
|
|
2429
|
+
"inputs": [{ "internalType": "address", "name": "account", "type": "address" }, {
|
|
2430
|
+
"internalType": "uint256",
|
|
2431
|
+
"name": "currentNonce",
|
|
2432
|
+
"type": "uint256"
|
|
2433
|
+
}],
|
|
2434
|
+
"name": "InvalidAccountNonce",
|
|
2435
|
+
"type": "error"
|
|
2436
|
+
}, { "inputs": [], "name": "InvalidInitialization", "type": "error" }, {
|
|
2437
|
+
"inputs": [],
|
|
2438
|
+
"name": "NotInitializing",
|
|
2439
|
+
"type": "error"
|
|
2440
|
+
}, {
|
|
2441
|
+
"inputs": [{ "internalType": "address", "name": "owner", "type": "address" }],
|
|
2442
|
+
"name": "OwnableInvalidOwner",
|
|
2443
|
+
"type": "error"
|
|
2444
|
+
}, {
|
|
2445
|
+
"inputs": [{ "internalType": "address", "name": "account", "type": "address" }],
|
|
2446
|
+
"name": "OwnableUnauthorizedAccount",
|
|
2447
|
+
"type": "error"
|
|
2448
|
+
}, {
|
|
2449
|
+
"inputs": [{ "internalType": "uint8", "name": "bits", "type": "uint8" }, {
|
|
2450
|
+
"internalType": "uint256",
|
|
2451
|
+
"name": "value",
|
|
2452
|
+
"type": "uint256"
|
|
2453
|
+
}],
|
|
2454
|
+
"name": "SafeCastOverflowedUintDowncast",
|
|
2455
|
+
"type": "error"
|
|
2456
|
+
}, { "inputs": [], "name": "UUPSUnauthorizedCallContext", "type": "error" }, {
|
|
2457
|
+
"inputs": [{
|
|
2458
|
+
"internalType": "bytes32",
|
|
2459
|
+
"name": "slot",
|
|
2460
|
+
"type": "bytes32"
|
|
2461
|
+
}],
|
|
2462
|
+
"name": "UUPSUnsupportedProxiableUUID",
|
|
2463
|
+
"type": "error"
|
|
2464
|
+
}, {
|
|
2465
|
+
"inputs": [{ "internalType": "uint256", "name": "expiry", "type": "uint256" }],
|
|
2466
|
+
"name": "VotesExpiredSignature",
|
|
2467
|
+
"type": "error"
|
|
2468
|
+
}, {
|
|
2469
|
+
"anonymous": false,
|
|
2470
|
+
"inputs": [{ "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, {
|
|
2471
|
+
"indexed": true,
|
|
2472
|
+
"internalType": "address",
|
|
2473
|
+
"name": "spender",
|
|
2474
|
+
"type": "address"
|
|
2475
|
+
}, { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" }],
|
|
2476
|
+
"name": "Approval",
|
|
2477
|
+
"type": "event"
|
|
2478
|
+
}, {
|
|
2479
|
+
"anonymous": false,
|
|
2480
|
+
"inputs": [{ "indexed": true, "internalType": "address", "name": "delegator", "type": "address" }, {
|
|
2481
|
+
"indexed": true,
|
|
2482
|
+
"internalType": "address",
|
|
2483
|
+
"name": "fromDelegate",
|
|
2484
|
+
"type": "address"
|
|
2485
|
+
}, { "indexed": true, "internalType": "address", "name": "toDelegate", "type": "address" }],
|
|
2486
|
+
"name": "DelegateChanged",
|
|
2487
|
+
"type": "event"
|
|
2488
|
+
}, {
|
|
2489
|
+
"anonymous": false,
|
|
2490
|
+
"inputs": [{ "indexed": true, "internalType": "address", "name": "delegate", "type": "address" }, {
|
|
2491
|
+
"indexed": false,
|
|
2492
|
+
"internalType": "uint256",
|
|
2493
|
+
"name": "previousVotes",
|
|
2494
|
+
"type": "uint256"
|
|
2495
|
+
}, { "indexed": false, "internalType": "uint256", "name": "newVotes", "type": "uint256" }],
|
|
2496
|
+
"name": "DelegateVotesChanged",
|
|
2497
|
+
"type": "event"
|
|
2498
|
+
}, { "anonymous": false, "inputs": [], "name": "EIP712DomainChanged", "type": "event" }, {
|
|
2499
|
+
"anonymous": false,
|
|
2500
|
+
"inputs": [{ "indexed": false, "internalType": "uint64", "name": "version", "type": "uint64" }],
|
|
2501
|
+
"name": "Initialized",
|
|
2502
|
+
"type": "event"
|
|
2503
|
+
}, {
|
|
2504
|
+
"anonymous": false,
|
|
2505
|
+
"inputs": [{
|
|
2506
|
+
"indexed": true,
|
|
2507
|
+
"internalType": "address",
|
|
2508
|
+
"name": "previousOwner",
|
|
2509
|
+
"type": "address"
|
|
2510
|
+
}, { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" }],
|
|
2511
|
+
"name": "OwnershipTransferred",
|
|
2512
|
+
"type": "event"
|
|
2513
|
+
}, {
|
|
2514
|
+
"anonymous": false,
|
|
2515
|
+
"inputs": [{ "indexed": false, "internalType": "address", "name": "account", "type": "address" }],
|
|
2516
|
+
"name": "Paused",
|
|
2517
|
+
"type": "event"
|
|
2518
|
+
}, {
|
|
2519
|
+
"anonymous": false,
|
|
2520
|
+
"inputs": [{ "indexed": true, "internalType": "address", "name": "from", "type": "address" }, {
|
|
2521
|
+
"indexed": true,
|
|
2522
|
+
"internalType": "address",
|
|
2523
|
+
"name": "to",
|
|
2524
|
+
"type": "address"
|
|
2525
|
+
}, { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" }],
|
|
2526
|
+
"name": "Transfer",
|
|
2527
|
+
"type": "event"
|
|
2528
|
+
}, {
|
|
2529
|
+
"anonymous": false,
|
|
2530
|
+
"inputs": [{ "indexed": false, "internalType": "address", "name": "account", "type": "address" }],
|
|
2531
|
+
"name": "Unpaused",
|
|
2532
|
+
"type": "event"
|
|
2533
|
+
}, {
|
|
2534
|
+
"anonymous": false,
|
|
2535
|
+
"inputs": [{ "indexed": true, "internalType": "address", "name": "implementation", "type": "address" }],
|
|
2536
|
+
"name": "Upgraded",
|
|
2537
|
+
"type": "event"
|
|
2538
|
+
}, {
|
|
2539
|
+
"inputs": [],
|
|
2540
|
+
"name": "CLOCK_MODE",
|
|
2541
|
+
"outputs": [{ "internalType": "string", "name": "", "type": "string" }],
|
|
2542
|
+
"stateMutability": "view",
|
|
2543
|
+
"type": "function"
|
|
2544
|
+
}, {
|
|
2545
|
+
"inputs": [],
|
|
2546
|
+
"name": "DOMAIN_SEPARATOR",
|
|
2547
|
+
"outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }],
|
|
2548
|
+
"stateMutability": "view",
|
|
2549
|
+
"type": "function"
|
|
2550
|
+
}, {
|
|
2551
|
+
"inputs": [],
|
|
2552
|
+
"name": "UPGRADE_INTERFACE_VERSION",
|
|
2553
|
+
"outputs": [{ "internalType": "string", "name": "", "type": "string" }],
|
|
2554
|
+
"stateMutability": "view",
|
|
2555
|
+
"type": "function"
|
|
2556
|
+
}, {
|
|
2557
|
+
"inputs": [{ "internalType": "address", "name": "owner", "type": "address" }, {
|
|
2558
|
+
"internalType": "address",
|
|
2559
|
+
"name": "spender",
|
|
2560
|
+
"type": "address"
|
|
2561
|
+
}],
|
|
2562
|
+
"name": "allowance",
|
|
2563
|
+
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
2564
|
+
"stateMutability": "view",
|
|
2565
|
+
"type": "function"
|
|
2566
|
+
}, {
|
|
2567
|
+
"inputs": [{ "internalType": "address", "name": "spender", "type": "address" }, {
|
|
2568
|
+
"internalType": "uint256",
|
|
2569
|
+
"name": "value",
|
|
2570
|
+
"type": "uint256"
|
|
2571
|
+
}],
|
|
2572
|
+
"name": "approve",
|
|
2573
|
+
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
|
|
2574
|
+
"stateMutability": "nonpayable",
|
|
2575
|
+
"type": "function"
|
|
2576
|
+
}, {
|
|
2577
|
+
"inputs": [{ "internalType": "address", "name": "account", "type": "address" }],
|
|
2578
|
+
"name": "balanceOf",
|
|
2579
|
+
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
2580
|
+
"stateMutability": "view",
|
|
2581
|
+
"type": "function"
|
|
2582
|
+
}, {
|
|
2583
|
+
"inputs": [{ "internalType": "uint256", "name": "value", "type": "uint256" }],
|
|
2584
|
+
"name": "burn",
|
|
2585
|
+
"outputs": [],
|
|
2586
|
+
"stateMutability": "nonpayable",
|
|
2587
|
+
"type": "function"
|
|
2588
|
+
}, {
|
|
2589
|
+
"inputs": [{ "internalType": "address", "name": "account", "type": "address" }, {
|
|
2590
|
+
"internalType": "uint256",
|
|
2591
|
+
"name": "value",
|
|
2592
|
+
"type": "uint256"
|
|
2593
|
+
}],
|
|
2594
|
+
"name": "burnFrom",
|
|
2595
|
+
"outputs": [],
|
|
2596
|
+
"stateMutability": "nonpayable",
|
|
2597
|
+
"type": "function"
|
|
2598
|
+
}, {
|
|
2599
|
+
"inputs": [{ "internalType": "address", "name": "account", "type": "address" }, {
|
|
2600
|
+
"internalType": "uint32",
|
|
2601
|
+
"name": "pos",
|
|
2602
|
+
"type": "uint32"
|
|
2603
|
+
}],
|
|
2604
|
+
"name": "checkpoints",
|
|
2605
|
+
"outputs": [{
|
|
2606
|
+
"components": [{
|
|
2607
|
+
"internalType": "uint48",
|
|
2608
|
+
"name": "_key",
|
|
2609
|
+
"type": "uint48"
|
|
2610
|
+
}, { "internalType": "uint208", "name": "_value", "type": "uint208" }],
|
|
2611
|
+
"internalType": "struct Checkpoints.Checkpoint208",
|
|
2612
|
+
"name": "",
|
|
2613
|
+
"type": "tuple"
|
|
2614
|
+
}],
|
|
2615
|
+
"stateMutability": "view",
|
|
2616
|
+
"type": "function"
|
|
2617
|
+
}, {
|
|
2618
|
+
"inputs": [],
|
|
2619
|
+
"name": "clock",
|
|
2620
|
+
"outputs": [{ "internalType": "uint48", "name": "", "type": "uint48" }],
|
|
2621
|
+
"stateMutability": "view",
|
|
2622
|
+
"type": "function"
|
|
2623
|
+
}, {
|
|
2624
|
+
"inputs": [],
|
|
2625
|
+
"name": "decimals",
|
|
2626
|
+
"outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }],
|
|
2627
|
+
"stateMutability": "view",
|
|
2628
|
+
"type": "function"
|
|
2629
|
+
}, {
|
|
2630
|
+
"inputs": [{ "internalType": "address", "name": "delegatee", "type": "address" }],
|
|
2631
|
+
"name": "delegate",
|
|
2632
|
+
"outputs": [],
|
|
2633
|
+
"stateMutability": "nonpayable",
|
|
2634
|
+
"type": "function"
|
|
2635
|
+
}, {
|
|
2636
|
+
"inputs": [{ "internalType": "address", "name": "delegatee", "type": "address" }, {
|
|
2637
|
+
"internalType": "uint256",
|
|
2638
|
+
"name": "nonce",
|
|
2639
|
+
"type": "uint256"
|
|
2640
|
+
}, { "internalType": "uint256", "name": "expiry", "type": "uint256" }, {
|
|
2641
|
+
"internalType": "uint8",
|
|
2642
|
+
"name": "v",
|
|
2643
|
+
"type": "uint8"
|
|
2644
|
+
}, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, {
|
|
2645
|
+
"internalType": "bytes32",
|
|
2646
|
+
"name": "s",
|
|
2647
|
+
"type": "bytes32"
|
|
2648
|
+
}],
|
|
2649
|
+
"name": "delegateBySig",
|
|
2650
|
+
"outputs": [],
|
|
2651
|
+
"stateMutability": "nonpayable",
|
|
2652
|
+
"type": "function"
|
|
2653
|
+
}, {
|
|
2654
|
+
"inputs": [{ "internalType": "address", "name": "account", "type": "address" }],
|
|
2655
|
+
"name": "delegates",
|
|
2656
|
+
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
|
2657
|
+
"stateMutability": "view",
|
|
2658
|
+
"type": "function"
|
|
2659
|
+
}, {
|
|
2660
|
+
"inputs": [],
|
|
2661
|
+
"name": "eip712Domain",
|
|
2662
|
+
"outputs": [{ "internalType": "bytes1", "name": "fields", "type": "bytes1" }, {
|
|
2663
|
+
"internalType": "string",
|
|
2664
|
+
"name": "name",
|
|
2665
|
+
"type": "string"
|
|
2666
|
+
}, { "internalType": "string", "name": "version", "type": "string" }, {
|
|
2667
|
+
"internalType": "uint256",
|
|
2668
|
+
"name": "chainId",
|
|
2669
|
+
"type": "uint256"
|
|
2670
|
+
}, { "internalType": "address", "name": "verifyingContract", "type": "address" }, {
|
|
2671
|
+
"internalType": "bytes32",
|
|
2672
|
+
"name": "salt",
|
|
2673
|
+
"type": "bytes32"
|
|
2674
|
+
}, { "internalType": "uint256[]", "name": "extensions", "type": "uint256[]" }],
|
|
2675
|
+
"stateMutability": "view",
|
|
2676
|
+
"type": "function"
|
|
2677
|
+
}, {
|
|
2678
|
+
"inputs": [{ "internalType": "uint256", "name": "timepoint", "type": "uint256" }],
|
|
2679
|
+
"name": "getPastTotalSupply",
|
|
2680
|
+
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
2681
|
+
"stateMutability": "view",
|
|
2682
|
+
"type": "function"
|
|
2683
|
+
}, {
|
|
2684
|
+
"inputs": [{ "internalType": "address", "name": "account", "type": "address" }, {
|
|
2685
|
+
"internalType": "uint256",
|
|
2686
|
+
"name": "timepoint",
|
|
2687
|
+
"type": "uint256"
|
|
2688
|
+
}],
|
|
2689
|
+
"name": "getPastVotes",
|
|
2690
|
+
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
2691
|
+
"stateMutability": "view",
|
|
2692
|
+
"type": "function"
|
|
2693
|
+
}, {
|
|
2694
|
+
"inputs": [{ "internalType": "address", "name": "account", "type": "address" }],
|
|
2695
|
+
"name": "getVotes",
|
|
2696
|
+
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
2697
|
+
"stateMutability": "view",
|
|
2698
|
+
"type": "function"
|
|
2699
|
+
}, {
|
|
2700
|
+
"inputs": [{ "internalType": "address", "name": "initialOwner", "type": "address" }],
|
|
2701
|
+
"name": "initialize",
|
|
2702
|
+
"outputs": [],
|
|
2703
|
+
"stateMutability": "nonpayable",
|
|
2704
|
+
"type": "function"
|
|
2705
|
+
}, {
|
|
2706
|
+
"inputs": [{ "internalType": "address", "name": "to", "type": "address" }, {
|
|
2707
|
+
"internalType": "uint256",
|
|
2708
|
+
"name": "amount",
|
|
2709
|
+
"type": "uint256"
|
|
2710
|
+
}],
|
|
2711
|
+
"name": "mint",
|
|
2712
|
+
"outputs": [],
|
|
2713
|
+
"stateMutability": "nonpayable",
|
|
2714
|
+
"type": "function"
|
|
2715
|
+
}, {
|
|
2716
|
+
"inputs": [],
|
|
2717
|
+
"name": "name",
|
|
2718
|
+
"outputs": [{ "internalType": "string", "name": "", "type": "string" }],
|
|
2719
|
+
"stateMutability": "view",
|
|
2720
|
+
"type": "function"
|
|
2721
|
+
}, {
|
|
2722
|
+
"inputs": [{ "internalType": "address", "name": "owner", "type": "address" }],
|
|
2723
|
+
"name": "nonces",
|
|
2724
|
+
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
2725
|
+
"stateMutability": "view",
|
|
2726
|
+
"type": "function"
|
|
2727
|
+
}, {
|
|
2728
|
+
"inputs": [{ "internalType": "address", "name": "account", "type": "address" }],
|
|
2729
|
+
"name": "numCheckpoints",
|
|
2730
|
+
"outputs": [{ "internalType": "uint32", "name": "", "type": "uint32" }],
|
|
2731
|
+
"stateMutability": "view",
|
|
2732
|
+
"type": "function"
|
|
2733
|
+
}, {
|
|
2734
|
+
"inputs": [],
|
|
2735
|
+
"name": "owner",
|
|
2736
|
+
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
|
2737
|
+
"stateMutability": "view",
|
|
2738
|
+
"type": "function"
|
|
2739
|
+
}, {
|
|
2740
|
+
"inputs": [],
|
|
2741
|
+
"name": "pause",
|
|
2742
|
+
"outputs": [],
|
|
2743
|
+
"stateMutability": "nonpayable",
|
|
2744
|
+
"type": "function"
|
|
2745
|
+
}, {
|
|
2746
|
+
"inputs": [],
|
|
2747
|
+
"name": "paused",
|
|
2748
|
+
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
|
|
2749
|
+
"stateMutability": "view",
|
|
2750
|
+
"type": "function"
|
|
2751
|
+
}, {
|
|
2752
|
+
"inputs": [{ "internalType": "address", "name": "owner", "type": "address" }, {
|
|
2753
|
+
"internalType": "address",
|
|
2754
|
+
"name": "spender",
|
|
2755
|
+
"type": "address"
|
|
2756
|
+
}, { "internalType": "uint256", "name": "value", "type": "uint256" }, {
|
|
2757
|
+
"internalType": "uint256",
|
|
2758
|
+
"name": "deadline",
|
|
2759
|
+
"type": "uint256"
|
|
2760
|
+
}, { "internalType": "uint8", "name": "v", "type": "uint8" }, {
|
|
2761
|
+
"internalType": "bytes32",
|
|
2762
|
+
"name": "r",
|
|
2763
|
+
"type": "bytes32"
|
|
2764
|
+
}, { "internalType": "bytes32", "name": "s", "type": "bytes32" }],
|
|
2765
|
+
"name": "permit",
|
|
2766
|
+
"outputs": [],
|
|
2767
|
+
"stateMutability": "nonpayable",
|
|
2768
|
+
"type": "function"
|
|
2769
|
+
}, {
|
|
2770
|
+
"inputs": [],
|
|
2771
|
+
"name": "proxiableUUID",
|
|
2772
|
+
"outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }],
|
|
2773
|
+
"stateMutability": "view",
|
|
2774
|
+
"type": "function"
|
|
2775
|
+
}, {
|
|
2776
|
+
"inputs": [],
|
|
2777
|
+
"name": "renounceOwnership",
|
|
2778
|
+
"outputs": [],
|
|
2779
|
+
"stateMutability": "nonpayable",
|
|
2780
|
+
"type": "function"
|
|
2781
|
+
}, {
|
|
2782
|
+
"inputs": [],
|
|
2783
|
+
"name": "symbol",
|
|
2784
|
+
"outputs": [{ "internalType": "string", "name": "", "type": "string" }],
|
|
2785
|
+
"stateMutability": "view",
|
|
2786
|
+
"type": "function"
|
|
2787
|
+
}, {
|
|
2788
|
+
"inputs": [],
|
|
2789
|
+
"name": "totalSupply",
|
|
2790
|
+
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
2791
|
+
"stateMutability": "view",
|
|
2792
|
+
"type": "function"
|
|
2793
|
+
}, {
|
|
2794
|
+
"inputs": [{ "internalType": "address", "name": "to", "type": "address" }, {
|
|
2795
|
+
"internalType": "uint256",
|
|
2796
|
+
"name": "value",
|
|
2797
|
+
"type": "uint256"
|
|
2798
|
+
}],
|
|
2799
|
+
"name": "transfer",
|
|
2800
|
+
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
|
|
2801
|
+
"stateMutability": "nonpayable",
|
|
2802
|
+
"type": "function"
|
|
2803
|
+
}, {
|
|
2804
|
+
"inputs": [{ "internalType": "address", "name": "from", "type": "address" }, {
|
|
2805
|
+
"internalType": "address",
|
|
2806
|
+
"name": "to",
|
|
2807
|
+
"type": "address"
|
|
2808
|
+
}, { "internalType": "uint256", "name": "value", "type": "uint256" }],
|
|
2809
|
+
"name": "transferFrom",
|
|
2810
|
+
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
|
|
2811
|
+
"stateMutability": "nonpayable",
|
|
2812
|
+
"type": "function"
|
|
2813
|
+
}, {
|
|
2814
|
+
"inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }],
|
|
2815
|
+
"name": "transferOwnership",
|
|
2816
|
+
"outputs": [],
|
|
2817
|
+
"stateMutability": "nonpayable",
|
|
2818
|
+
"type": "function"
|
|
2819
|
+
}, {
|
|
2820
|
+
"inputs": [],
|
|
2821
|
+
"name": "unpause",
|
|
2822
|
+
"outputs": [],
|
|
2823
|
+
"stateMutability": "nonpayable",
|
|
2824
|
+
"type": "function"
|
|
2825
|
+
}, {
|
|
2826
|
+
"inputs": [{
|
|
2827
|
+
"internalType": "address",
|
|
2828
|
+
"name": "newImplementation",
|
|
2829
|
+
"type": "address"
|
|
2830
|
+
}, { "internalType": "bytes", "name": "data", "type": "bytes" }],
|
|
2831
|
+
"name": "upgradeToAndCall",
|
|
2832
|
+
"outputs": [],
|
|
2833
|
+
"stateMutability": "payable",
|
|
2834
|
+
"type": "function"
|
|
2835
|
+
}];
|
|
1209
2836
|
var LOCAL_ERRORS = [
|
|
1210
2837
|
...KIBBLE_TOKEN_ABI.filter((item) => item.type === "error"),
|
|
1211
2838
|
...ORGANIZATION_IMPL_ABI.filter((item) => item.type === "error"),
|
|
@@ -1221,8 +2848,42 @@ var OZ_ERROR_FRAGMENTS = [
|
|
|
1221
2848
|
var ERROR_ABI = [...LOCAL_ERRORS, parseAbi([...OZ_ERROR_FRAGMENTS])];
|
|
1222
2849
|
var ORG_FUNCTION = "executeCall";
|
|
1223
2850
|
|
|
2851
|
+
// src/utils/coinbase/useCoinbaseMintAnymalNFT.ts
|
|
2852
|
+
import { useCallback as useCallback11 } from "react";
|
|
2853
|
+
function useCoinbaseMintAnymalNFT() {
|
|
2854
|
+
const { sendOperationFn, status } = useSendCoinbaseUserOperation();
|
|
2855
|
+
return useCallback11(
|
|
2856
|
+
async (evmAddress, pid, nftId, anymalTxId, validationContractAddress) => {
|
|
2857
|
+
if (!nftId || !pid || !validationContractAddress) {
|
|
2858
|
+
return {
|
|
2859
|
+
success: false,
|
|
2860
|
+
message: "Missing authentication token OR NFT ID.",
|
|
2861
|
+
status: "error"
|
|
2862
|
+
};
|
|
2863
|
+
}
|
|
2864
|
+
const functionName = "submitMetadataByCampaignName";
|
|
2865
|
+
const args = [
|
|
2866
|
+
pid,
|
|
2867
|
+
nftId,
|
|
2868
|
+
`https://dev-nft.petastic.com/metadata/${nftId}`,
|
|
2869
|
+
"petastic-signup-campaign-1",
|
|
2870
|
+
anymalTxId
|
|
2871
|
+
];
|
|
2872
|
+
const callData = encodeFunctionData({
|
|
2873
|
+
abi: PET_NFT_ABI,
|
|
2874
|
+
functionName,
|
|
2875
|
+
args
|
|
2876
|
+
});
|
|
2877
|
+
await sendOperationFn(evmAddress, callData, validationContractAddress);
|
|
2878
|
+
return { success: true, message: "Pet Passport Created", status };
|
|
2879
|
+
},
|
|
2880
|
+
[]
|
|
2881
|
+
);
|
|
2882
|
+
}
|
|
2883
|
+
|
|
1224
2884
|
// src/utils/anymals/useMintAnymalNFT.ts
|
|
1225
|
-
import {
|
|
2885
|
+
import { encodeFunctionData as encodeFunctionData2 } from "viem";
|
|
2886
|
+
import { useCallback as useCallback12 } from "react";
|
|
1226
2887
|
|
|
1227
2888
|
// src/helpers/GasEstimateHelper.tsx
|
|
1228
2889
|
async function applyBundlerGasEstimator(account, bundlerClient, options) {
|
|
@@ -1303,7 +2964,7 @@ async function simulateCall(publicClient, target, abi, functionName, args, calle
|
|
|
1303
2964
|
|
|
1304
2965
|
// src/utils/anymals/useMintAnymalNFT.ts
|
|
1305
2966
|
function useMintAnymalNFT() {
|
|
1306
|
-
return
|
|
2967
|
+
return useCallback12(
|
|
1307
2968
|
async (pid, nftId, anymalTxId, dbAuthToken, validationContractAddress, smartAccount, bundlerClient) => {
|
|
1308
2969
|
if (!dbAuthToken || !nftId || !bundlerClient || !smartAccount || !pid || !validationContractAddress) {
|
|
1309
2970
|
return {
|
|
@@ -1319,7 +2980,7 @@ function useMintAnymalNFT() {
|
|
|
1319
2980
|
"petastic-signup-campaign-1",
|
|
1320
2981
|
anymalTxId
|
|
1321
2982
|
];
|
|
1322
|
-
const callData =
|
|
2983
|
+
const callData = encodeFunctionData2({
|
|
1323
2984
|
abi: PET_NFT_ABI,
|
|
1324
2985
|
functionName,
|
|
1325
2986
|
args
|
|
@@ -1354,126 +3015,11 @@ function useMintAnymalNFT() {
|
|
|
1354
3015
|
);
|
|
1355
3016
|
}
|
|
1356
3017
|
|
|
1357
|
-
// src/utils/anymals/useAddAnymalToDatabase.ts
|
|
1358
|
-
import { useCallback as useCallback11 } from "react";
|
|
1359
|
-
function useAddAnymalToDatabase() {
|
|
1360
|
-
return useCallback11(
|
|
1361
|
-
async (dbAuthToken, endpoint, anymalData) => {
|
|
1362
|
-
if (!dbAuthToken) {
|
|
1363
|
-
return {
|
|
1364
|
-
success: false,
|
|
1365
|
-
message: "Authentication token is missing.",
|
|
1366
|
-
_docID: null,
|
|
1367
|
-
dbCid: null
|
|
1368
|
-
};
|
|
1369
|
-
}
|
|
1370
|
-
let anymalDocID = null;
|
|
1371
|
-
let dbCid = null;
|
|
1372
|
-
try {
|
|
1373
|
-
const mutation = `
|
|
1374
|
-
mutation Create_Anymal($input: [AnymalMutationInputArg!]) {
|
|
1375
|
-
create_Anymal(input: $input) {
|
|
1376
|
-
_docID
|
|
1377
|
-
name
|
|
1378
|
-
passportID
|
|
1379
|
-
_version {
|
|
1380
|
-
cid
|
|
1381
|
-
}
|
|
1382
|
-
}
|
|
1383
|
-
}
|
|
1384
|
-
`;
|
|
1385
|
-
const response = await fetch(endpoint, {
|
|
1386
|
-
method: "POST",
|
|
1387
|
-
headers: {
|
|
1388
|
-
"Content-Type": "application/json",
|
|
1389
|
-
Authorization: `Bearer ${dbAuthToken}`
|
|
1390
|
-
},
|
|
1391
|
-
body: JSON.stringify({
|
|
1392
|
-
query: mutation,
|
|
1393
|
-
variables: { input: [anymalData] }
|
|
1394
|
-
})
|
|
1395
|
-
});
|
|
1396
|
-
if (!response.ok) {
|
|
1397
|
-
throw new Error(
|
|
1398
|
-
`Failed to create pet. HTTP status ${response.status}`
|
|
1399
|
-
);
|
|
1400
|
-
}
|
|
1401
|
-
const { data, errors } = await response.json();
|
|
1402
|
-
if (errors) {
|
|
1403
|
-
const errorMessage = JSON.stringify(errors);
|
|
1404
|
-
if (errorMessage.includes("given ID already exists")) {
|
|
1405
|
-
console.warn("Duplicate document ID detected.");
|
|
1406
|
-
anymalDocID = data?.create_Anymal[0]?._docID || null;
|
|
1407
|
-
throw new Error("Document with the given ID already exists.");
|
|
1408
|
-
}
|
|
1409
|
-
throw new Error(`GraphQL error: ${errorMessage}`);
|
|
1410
|
-
}
|
|
1411
|
-
anymalDocID = data.create_Anymal[0]._docID;
|
|
1412
|
-
dbCid = data.create_Anymal[0]._version[0].cid;
|
|
1413
|
-
return {
|
|
1414
|
-
success: true,
|
|
1415
|
-
_docID: anymalDocID,
|
|
1416
|
-
dbCid,
|
|
1417
|
-
message: "Anymal added to account"
|
|
1418
|
-
};
|
|
1419
|
-
} catch (error) {
|
|
1420
|
-
return {
|
|
1421
|
-
success: false,
|
|
1422
|
-
_docID: null,
|
|
1423
|
-
dbCid: null,
|
|
1424
|
-
message: "Error adding anymal to account"
|
|
1425
|
-
};
|
|
1426
|
-
}
|
|
1427
|
-
},
|
|
1428
|
-
[]
|
|
1429
|
-
);
|
|
1430
|
-
}
|
|
1431
|
-
|
|
1432
|
-
// src/utils/anymals/useDeleteAnymalFromDatabase.ts
|
|
1433
|
-
import { useCallback as useCallback12 } from "react";
|
|
1434
|
-
function useDeleteAnymalFromDatabase() {
|
|
1435
|
-
return useCallback12(
|
|
1436
|
-
async (dbAuthToken, endpoint, anymalDocID) => {
|
|
1437
|
-
if (!dbAuthToken || !endpoint || !anymalDocID) return;
|
|
1438
|
-
try {
|
|
1439
|
-
const mutation = `
|
|
1440
|
-
mutation Delete_Anymal($docId: [ID]) {
|
|
1441
|
-
delete_Anymal(docID: $docId) {
|
|
1442
|
-
_docID
|
|
1443
|
-
}
|
|
1444
|
-
}
|
|
1445
|
-
`;
|
|
1446
|
-
const response = await fetch(endpoint, {
|
|
1447
|
-
method: "POST",
|
|
1448
|
-
headers: {
|
|
1449
|
-
"Content-Type": "application/json",
|
|
1450
|
-
Authorization: `Bearer ${dbAuthToken}`
|
|
1451
|
-
},
|
|
1452
|
-
body: JSON.stringify({
|
|
1453
|
-
query: mutation,
|
|
1454
|
-
variables: { docID: [anymalDocID] }
|
|
1455
|
-
})
|
|
1456
|
-
});
|
|
1457
|
-
if (!response.ok)
|
|
1458
|
-
throw new Error(
|
|
1459
|
-
`Failed to delete anymal. HTTP status ${response.status}`
|
|
1460
|
-
);
|
|
1461
|
-
const { errors } = await response.json();
|
|
1462
|
-
if (errors) throw new Error(`GraphQL error: ${JSON.stringify(errors)}`);
|
|
1463
|
-
} catch (error) {
|
|
1464
|
-
console.error("Error deleting anymal from database:", error);
|
|
1465
|
-
throw error;
|
|
1466
|
-
}
|
|
1467
|
-
},
|
|
1468
|
-
[]
|
|
1469
|
-
);
|
|
1470
|
-
}
|
|
1471
|
-
|
|
1472
3018
|
// src/utils/anymals/useSaveAnymalMetadata.ts
|
|
1473
3019
|
import { useCallback as useCallback13 } from "react";
|
|
1474
3020
|
function useSaveAnymalMetadata() {
|
|
1475
3021
|
return useCallback13(
|
|
1476
|
-
async (userPid, anymalTxId, idToken,
|
|
3022
|
+
async (userPid, anymalTxId, idToken, nftMetadataInput, authServiceBaseUrl) => {
|
|
1477
3023
|
const response = await fetch(`${authServiceBaseUrl}/process-nft`, {
|
|
1478
3024
|
method: "POST",
|
|
1479
3025
|
headers: {
|
|
@@ -1481,7 +3027,6 @@ function useSaveAnymalMetadata() {
|
|
|
1481
3027
|
Authorization: "Bearer " + idToken
|
|
1482
3028
|
},
|
|
1483
3029
|
body: JSON.stringify({
|
|
1484
|
-
appPubKey: publicKey,
|
|
1485
3030
|
nftMetadataInput,
|
|
1486
3031
|
pid: userPid,
|
|
1487
3032
|
anymalTxId
|
|
@@ -1500,57 +3045,8 @@ function useSaveAnymalMetadata() {
|
|
|
1500
3045
|
);
|
|
1501
3046
|
}
|
|
1502
3047
|
|
|
1503
|
-
// src/utils/anymals/useUpdateAnymalWithNFT.ts
|
|
1504
|
-
import { useCallback as useCallback14 } from "react";
|
|
1505
|
-
function useUpdateAnymalWithNFT() {
|
|
1506
|
-
return useCallback14(
|
|
1507
|
-
async (anymalPassportId, anymalDocId, dbAuthToken, endpoint) => {
|
|
1508
|
-
if (!dbAuthToken || !anymalPassportId || !anymalDocId || !endpoint) {
|
|
1509
|
-
return {
|
|
1510
|
-
success: false
|
|
1511
|
-
};
|
|
1512
|
-
}
|
|
1513
|
-
try {
|
|
1514
|
-
const mutation = `
|
|
1515
|
-
mutation {
|
|
1516
|
-
update_Anymal(
|
|
1517
|
-
docID: [${JSON.stringify(anymalDocId)}],
|
|
1518
|
-
input: {
|
|
1519
|
-
passportID: "${anymalPassportId}"
|
|
1520
|
-
}
|
|
1521
|
-
) {
|
|
1522
|
-
passportID
|
|
1523
|
-
}
|
|
1524
|
-
}
|
|
1525
|
-
`;
|
|
1526
|
-
const response = await fetch(endpoint, {
|
|
1527
|
-
method: "POST",
|
|
1528
|
-
headers: {
|
|
1529
|
-
"Content-Type": "application/json",
|
|
1530
|
-
Authorization: `Bearer ${dbAuthToken}`
|
|
1531
|
-
},
|
|
1532
|
-
body: JSON.stringify({ query: mutation })
|
|
1533
|
-
});
|
|
1534
|
-
if (!response.ok) {
|
|
1535
|
-
return { success: false };
|
|
1536
|
-
}
|
|
1537
|
-
const { errors } = await response.json();
|
|
1538
|
-
if (errors) {
|
|
1539
|
-
console.log(`GQL error: ${JSON.stringify(errors)}`);
|
|
1540
|
-
return { success: false };
|
|
1541
|
-
}
|
|
1542
|
-
return { success: true };
|
|
1543
|
-
} catch (error) {
|
|
1544
|
-
console.error("Error updating Anymal with NFT ID:", error);
|
|
1545
|
-
return { success: false };
|
|
1546
|
-
}
|
|
1547
|
-
},
|
|
1548
|
-
[]
|
|
1549
|
-
);
|
|
1550
|
-
}
|
|
1551
|
-
|
|
1552
3048
|
// src/utils/anymals/useUploadAnymalImage.ts
|
|
1553
|
-
import { useCallback as
|
|
3049
|
+
import { useCallback as useCallback14 } from "react";
|
|
1554
3050
|
|
|
1555
3051
|
// src/helpers/UploadImageHelper.tsx
|
|
1556
3052
|
function resizeImage(file, maxWidth = 800, maxHeight = 800, quality = 0.7) {
|
|
@@ -1607,8 +3103,8 @@ function toBase64(file) {
|
|
|
1607
3103
|
|
|
1608
3104
|
// src/utils/anymals/useUploadAnymalImage.ts
|
|
1609
3105
|
function useUploadAnymalImage() {
|
|
1610
|
-
return
|
|
1611
|
-
async (imageFile, type, idToken,
|
|
3106
|
+
return useCallback14(
|
|
3107
|
+
async (imageFile, type, idToken, authServiceBaseUrl, petType, breed, lifestage, anymalPid) => {
|
|
1612
3108
|
if (!imageFile || !idToken) {
|
|
1613
3109
|
return {
|
|
1614
3110
|
success: false,
|
|
@@ -1620,7 +3116,6 @@ function useUploadAnymalImage() {
|
|
|
1620
3116
|
try {
|
|
1621
3117
|
const base64Image = await prepareImage(imageFile);
|
|
1622
3118
|
const payload = {
|
|
1623
|
-
appPubKey: publicKey,
|
|
1624
3119
|
imageData: base64Image,
|
|
1625
3120
|
imageName: imageFile.name.split(".")[0],
|
|
1626
3121
|
petType,
|
|
@@ -1668,68 +3163,11 @@ function useUploadAnymalImage() {
|
|
|
1668
3163
|
);
|
|
1669
3164
|
}
|
|
1670
3165
|
|
|
1671
|
-
// src/utils/anymals/useFetchAnymals.ts
|
|
1672
|
-
import { useCallback as useCallback16 } from "react";
|
|
1673
|
-
|
|
1674
|
-
// src/utils/anymals/fetchAnymals.ts
|
|
1675
|
-
async function fetchAnymals({
|
|
1676
|
-
dbAuthToken,
|
|
1677
|
-
endpoint,
|
|
1678
|
-
userPid
|
|
1679
|
-
}) {
|
|
1680
|
-
const query = `
|
|
1681
|
-
query Anymal($filter: AnymalFilterArg, $order: [AnymalOrderArg]) {
|
|
1682
|
-
Anymal(filter: $filter, order: $order) {
|
|
1683
|
-
_docID
|
|
1684
|
-
name
|
|
1685
|
-
breed
|
|
1686
|
-
passportID
|
|
1687
|
-
profileImageUrl
|
|
1688
|
-
caregiverNearId
|
|
1689
|
-
caregiverId
|
|
1690
|
-
lifestage
|
|
1691
|
-
gender
|
|
1692
|
-
petType
|
|
1693
|
-
products
|
|
1694
|
-
timeAddedUtc
|
|
1695
|
-
}
|
|
1696
|
-
}
|
|
1697
|
-
`;
|
|
1698
|
-
const variables = {
|
|
1699
|
-
filter: {
|
|
1700
|
-
caregiverId: { _eq: userPid }
|
|
1701
|
-
},
|
|
1702
|
-
order: [
|
|
1703
|
-
{
|
|
1704
|
-
timeAddedUtc: "ASC"
|
|
1705
|
-
}
|
|
1706
|
-
]
|
|
1707
|
-
};
|
|
1708
|
-
const response = await fetch(endpoint, {
|
|
1709
|
-
method: "POST",
|
|
1710
|
-
headers: {
|
|
1711
|
-
"Content-Type": "application/json",
|
|
1712
|
-
Authorization: `Bearer ${dbAuthToken}`
|
|
1713
|
-
},
|
|
1714
|
-
body: JSON.stringify({ query, variables })
|
|
1715
|
-
});
|
|
1716
|
-
if (!response.ok) {
|
|
1717
|
-
throw new Error(`HTTP error! Status: ${response.status}`);
|
|
1718
|
-
}
|
|
1719
|
-
const data = await response.json();
|
|
1720
|
-
return data?.data?.Anymal ?? [];
|
|
1721
|
-
}
|
|
1722
|
-
|
|
1723
|
-
// src/utils/anymals/useFetchAnymals.ts
|
|
1724
|
-
function useFetchAnymals() {
|
|
1725
|
-
return useCallback16(fetchAnymals, []);
|
|
1726
|
-
}
|
|
1727
|
-
|
|
1728
3166
|
// src/utils/marketplace/useProcessPartialKibblePayment.ts
|
|
1729
|
-
import { useCallback as
|
|
3167
|
+
import { useCallback as useCallback15 } from "react";
|
|
1730
3168
|
|
|
1731
3169
|
// src/helpers/ProcessDirectPartialPayment.tsx
|
|
1732
|
-
import { encodeFunctionData as
|
|
3170
|
+
import { encodeFunctionData as encodeFunctionData3 } from "viem";
|
|
1733
3171
|
|
|
1734
3172
|
// src/helpers/SendUserOpWithRetries.tsx
|
|
1735
3173
|
async function sendUserOpWithRetries(bundlerClient, params, retries = 3, delay = 1e3) {
|
|
@@ -1789,7 +3227,7 @@ async function processDirectPartialPayment(marketplaceContract, smartAccount, bu
|
|
|
1789
3227
|
deadline,
|
|
1790
3228
|
backendSignature
|
|
1791
3229
|
];
|
|
1792
|
-
const partialPayCalldata =
|
|
3230
|
+
const partialPayCalldata = encodeFunctionData3({
|
|
1793
3231
|
abi: MARKETPLACE_ABI,
|
|
1794
3232
|
functionName,
|
|
1795
3233
|
args
|
|
@@ -1826,7 +3264,7 @@ async function processDirectPartialPayment(marketplaceContract, smartAccount, bu
|
|
|
1826
3264
|
|
|
1827
3265
|
// src/utils/marketplace/useProcessPartialKibblePayment.ts
|
|
1828
3266
|
function useProcessPartialKibblePayment() {
|
|
1829
|
-
return
|
|
3267
|
+
return useCallback15(
|
|
1830
3268
|
async (pid, nftId, orderId, dbAuthToken, marketplaceContract, smartAccount, bundlerClient, amountInTokens, maxTokenPayment, nonce, deadline, backendSignature) => {
|
|
1831
3269
|
if (!orderId || !dbAuthToken || !nftId || !bundlerClient || !smartAccount || !pid || !marketplaceContract || !amountInTokens || !maxTokenPayment || !nonce || !deadline) {
|
|
1832
3270
|
return {
|
|
@@ -1882,15 +3320,15 @@ function useProcessPartialKibblePayment() {
|
|
|
1882
3320
|
}
|
|
1883
3321
|
|
|
1884
3322
|
// src/utils/marketplace/useApproveKibbleToken.ts
|
|
1885
|
-
import { useCallback as
|
|
3323
|
+
import { useCallback as useCallback16 } from "react";
|
|
1886
3324
|
|
|
1887
3325
|
// src/helpers/ProcessDirectKibbleApproval.tsx
|
|
1888
|
-
import { encodeFunctionData as
|
|
3326
|
+
import { encodeFunctionData as encodeFunctionData4, erc20Abi } from "viem";
|
|
1889
3327
|
async function processDirectKibbleApproval(kibbleTokenAddress, spenderAddress, smartAccount, bundlerClient, approveAmount) {
|
|
1890
3328
|
try {
|
|
1891
3329
|
const functionName = "approve";
|
|
1892
3330
|
const args = [spenderAddress, approveAmount];
|
|
1893
|
-
const approveCalldata =
|
|
3331
|
+
const approveCalldata = encodeFunctionData4({
|
|
1894
3332
|
abi: erc20Abi,
|
|
1895
3333
|
functionName,
|
|
1896
3334
|
args
|
|
@@ -1927,7 +3365,7 @@ async function processDirectKibbleApproval(kibbleTokenAddress, spenderAddress, s
|
|
|
1927
3365
|
|
|
1928
3366
|
// src/utils/marketplace/useApproveKibbleToken.ts
|
|
1929
3367
|
function useApproveKibbleToken() {
|
|
1930
|
-
return
|
|
3368
|
+
return useCallback16(
|
|
1931
3369
|
async (kibbleTokenAddress, marketplaceContract, amount, smartAccount, bundlerClient) => {
|
|
1932
3370
|
try {
|
|
1933
3371
|
const result = await processDirectKibbleApproval(
|
|
@@ -1954,10 +3392,10 @@ function useApproveKibbleToken() {
|
|
|
1954
3392
|
}
|
|
1955
3393
|
|
|
1956
3394
|
// src/utils/organization/useCreateOrganizationBase.ts
|
|
1957
|
-
import { useCallback as
|
|
1958
|
-
import { decodeEventLog, encodeFunctionData as
|
|
3395
|
+
import { useCallback as useCallback17 } from "react";
|
|
3396
|
+
import { decodeEventLog, encodeFunctionData as encodeFunctionData5 } from "viem";
|
|
1959
3397
|
function useCreateOrganizationBase() {
|
|
1960
|
-
return
|
|
3398
|
+
return useCallback17(
|
|
1961
3399
|
/**
|
|
1962
3400
|
* Creates a new organization on-chain.
|
|
1963
3401
|
*
|
|
@@ -1979,7 +3417,7 @@ function useCreateOrganizationBase() {
|
|
|
1979
3417
|
try {
|
|
1980
3418
|
const functionName = "createOrganizationProxy";
|
|
1981
3419
|
const args = [ownerAddress, orgName, orgPid];
|
|
1982
|
-
const callData =
|
|
3420
|
+
const callData = encodeFunctionData5({
|
|
1983
3421
|
abi: ORGANIZATION_BEACON_ABI,
|
|
1984
3422
|
functionName,
|
|
1985
3423
|
args
|
|
@@ -2053,10 +3491,10 @@ function useCreateOrganizationBase() {
|
|
|
2053
3491
|
}
|
|
2054
3492
|
|
|
2055
3493
|
// src/utils/organization/useApproveOrgKibbleToken.ts
|
|
2056
|
-
import { useCallback as
|
|
3494
|
+
import { useCallback as useCallback18 } from "react";
|
|
2057
3495
|
|
|
2058
3496
|
// src/helpers/ProcessOrgKibbleApproval.tsx
|
|
2059
|
-
import { encodeFunctionData as
|
|
3497
|
+
import { encodeFunctionData as encodeFunctionData6, erc20Abi as erc20Abi3 } from "viem";
|
|
2060
3498
|
|
|
2061
3499
|
// src/helpers/WaitForAllowance.tsx
|
|
2062
3500
|
import { erc20Abi as erc20Abi2 } from "viem";
|
|
@@ -2093,13 +3531,13 @@ async function processOrgKibbleApproval(orgContractAddress, kibbleTokenAddress,
|
|
|
2093
3531
|
if (approveAmount <= 0n) {
|
|
2094
3532
|
return { success: false, message: "Approval amount must be greater than zero." };
|
|
2095
3533
|
}
|
|
2096
|
-
const approveCalldata =
|
|
3534
|
+
const approveCalldata = encodeFunctionData6({
|
|
2097
3535
|
abi: erc20Abi3,
|
|
2098
3536
|
functionName: "approve",
|
|
2099
3537
|
args: [partialPaymentModuleAddress, approveAmount]
|
|
2100
3538
|
});
|
|
2101
3539
|
const args = [kibbleTokenAddress, approveCalldata];
|
|
2102
|
-
const executeApproveCalldata =
|
|
3540
|
+
const executeApproveCalldata = encodeFunctionData6({
|
|
2103
3541
|
abi: ORGANIZATION_IMPL_ABI,
|
|
2104
3542
|
functionName: ORG_FUNCTION,
|
|
2105
3543
|
args
|
|
@@ -2151,7 +3589,7 @@ async function processOrgKibbleApproval(orgContractAddress, kibbleTokenAddress,
|
|
|
2151
3589
|
|
|
2152
3590
|
// src/utils/organization/useApproveOrgKibbleToken.ts
|
|
2153
3591
|
function useApproveOrgPartialPayment() {
|
|
2154
|
-
return
|
|
3592
|
+
return useCallback18(
|
|
2155
3593
|
async (orgContractAddress, kibbleTokenAddress, partialPaymentModuleAddress, managerSmartAccount, bundlerClient, approveAmount) => {
|
|
2156
3594
|
if (!orgContractAddress || !kibbleTokenAddress || !partialPaymentModuleAddress || !managerSmartAccount || !bundlerClient || !approveAmount) {
|
|
2157
3595
|
return {
|
|
@@ -2183,13 +3621,13 @@ function useApproveOrgPartialPayment() {
|
|
|
2183
3621
|
}
|
|
2184
3622
|
|
|
2185
3623
|
// src/utils/organization/useProcessOrgPartialKibblePayment.ts
|
|
2186
|
-
import { useCallback as
|
|
3624
|
+
import { useCallback as useCallback19 } from "react";
|
|
2187
3625
|
|
|
2188
3626
|
// src/helpers/ProcessOrgPartialPayment.tsx
|
|
2189
|
-
import { encodeFunctionData as
|
|
3627
|
+
import { encodeFunctionData as encodeFunctionData7 } from "viem";
|
|
2190
3628
|
async function processOrgPartialPayment(orgContractAddress, partialPaymentModuleAddress, managerSmartAccount, bundlerClient, orderId, anymalNftId, pid, amountInTokens, maxTokenPayment, nonce, deadline, backendSignature) {
|
|
2191
3629
|
try {
|
|
2192
|
-
const partialPayCalldata =
|
|
3630
|
+
const partialPayCalldata = encodeFunctionData7({
|
|
2193
3631
|
abi: MARKETPLACE_ABI,
|
|
2194
3632
|
functionName: "partialPay",
|
|
2195
3633
|
args: [
|
|
@@ -2204,7 +3642,7 @@ async function processOrgPartialPayment(orgContractAddress, partialPaymentModule
|
|
|
2204
3642
|
]
|
|
2205
3643
|
});
|
|
2206
3644
|
const args = [partialPaymentModuleAddress, partialPayCalldata];
|
|
2207
|
-
const executePartialPayCalldata =
|
|
3645
|
+
const executePartialPayCalldata = encodeFunctionData7({
|
|
2208
3646
|
abi: ORGANIZATION_IMPL_ABI,
|
|
2209
3647
|
functionName: ORG_FUNCTION,
|
|
2210
3648
|
args
|
|
@@ -2241,7 +3679,7 @@ async function processOrgPartialPayment(orgContractAddress, partialPaymentModule
|
|
|
2241
3679
|
|
|
2242
3680
|
// src/utils/organization/useProcessOrgPartialKibblePayment.ts
|
|
2243
3681
|
function useProcessOrgPartialKibblePayment() {
|
|
2244
|
-
return
|
|
3682
|
+
return useCallback19(
|
|
2245
3683
|
async (orgContractAddress, partialPaymentModuleAddress, managerSmartAccount, bundlerClient, orderId, anymalNftId, pid, amountInTokens, maxTokenPayment, nonce, deadline, backendSignature) => {
|
|
2246
3684
|
if (!orgContractAddress || !partialPaymentModuleAddress || !managerSmartAccount || !bundlerClient || !orderId || !pid || !nonce || !backendSignature) {
|
|
2247
3685
|
return {
|
|
@@ -2279,9 +3717,9 @@ function useProcessOrgPartialKibblePayment() {
|
|
|
2279
3717
|
}
|
|
2280
3718
|
|
|
2281
3719
|
// src/utils/organization/useUpdateOrgWalletAddress.ts
|
|
2282
|
-
import { useCallback as
|
|
3720
|
+
import { useCallback as useCallback20 } from "react";
|
|
2283
3721
|
function useUpdateOrgWalletAddress() {
|
|
2284
|
-
return
|
|
3722
|
+
return useCallback20(
|
|
2285
3723
|
async (dbAuthToken, docID, baseWalletAddress, endpoint) => {
|
|
2286
3724
|
try {
|
|
2287
3725
|
const mutation = `
|
|
@@ -2320,10 +3758,10 @@ function useUpdateOrgWalletAddress() {
|
|
|
2320
3758
|
}
|
|
2321
3759
|
|
|
2322
3760
|
// src/utils/organization/useMintOrgAnymalNFT.ts
|
|
2323
|
-
import { encodeFunctionData as
|
|
2324
|
-
import { useCallback as
|
|
3761
|
+
import { encodeFunctionData as encodeFunctionData8 } from "viem";
|
|
3762
|
+
import { useCallback as useCallback21 } from "react";
|
|
2325
3763
|
function useMintOrgAnymalNFT() {
|
|
2326
|
-
return
|
|
3764
|
+
return useCallback21(
|
|
2327
3765
|
async (orgContractAddress, pid, nftId, anymalTxId, dbAuthToken, validationContractAddress, managerSmartAccount, bundlerClient) => {
|
|
2328
3766
|
if (!dbAuthToken || !nftId || !bundlerClient || !managerSmartAccount || !pid || !validationContractAddress || !orgContractAddress) {
|
|
2329
3767
|
return {
|
|
@@ -2339,13 +3777,13 @@ function useMintOrgAnymalNFT() {
|
|
|
2339
3777
|
"petastic-signup-campaign-1",
|
|
2340
3778
|
anymalTxId
|
|
2341
3779
|
];
|
|
2342
|
-
const callData =
|
|
3780
|
+
const callData = encodeFunctionData8({
|
|
2343
3781
|
abi: PET_NFT_ABI,
|
|
2344
3782
|
functionName,
|
|
2345
3783
|
args
|
|
2346
3784
|
});
|
|
2347
3785
|
const executeArgs = [validationContractAddress, callData];
|
|
2348
|
-
const executeSubmitMetaCalldata =
|
|
3786
|
+
const executeSubmitMetaCalldata = encodeFunctionData8({
|
|
2349
3787
|
abi: ORGANIZATION_IMPL_ABI,
|
|
2350
3788
|
functionName: ORG_FUNCTION,
|
|
2351
3789
|
args: executeArgs
|
|
@@ -2403,9 +3841,9 @@ async function submitAction(idToken, pid, sourceType, payload, endpointBaseUrl)
|
|
|
2403
3841
|
}
|
|
2404
3842
|
|
|
2405
3843
|
// src/utils/actions/useFetchActions.ts
|
|
2406
|
-
import { useCallback as
|
|
3844
|
+
import { useCallback as useCallback22 } from "react";
|
|
2407
3845
|
function useFetchActions() {
|
|
2408
|
-
return
|
|
3846
|
+
return useCallback22(
|
|
2409
3847
|
async (idToken, actionsServiceBaseUrl, pid, status, limit, offset) => {
|
|
2410
3848
|
const params = new URLSearchParams({ pid });
|
|
2411
3849
|
if (status) params.set("status", status);
|
|
@@ -2434,9 +3872,9 @@ function useFetchActions() {
|
|
|
2434
3872
|
}
|
|
2435
3873
|
|
|
2436
3874
|
// src/utils/actions/useFetchActionDefinitions.ts
|
|
2437
|
-
import { useCallback as
|
|
3875
|
+
import { useCallback as useCallback23 } from "react";
|
|
2438
3876
|
function useFetchActionDefinitions() {
|
|
2439
|
-
return
|
|
3877
|
+
return useCallback23(
|
|
2440
3878
|
async (idToken, actionsServiceBaseUrl) => {
|
|
2441
3879
|
try {
|
|
2442
3880
|
const response = await fetch(
|
|
@@ -2533,10 +3971,10 @@ var convertToMultipleActionRecords = (frs) => frs.map(convertToActionRecord);
|
|
|
2533
3971
|
var convertToMultipleActionDefinitions = (frs) => frs.map(convertToActionDefinition);
|
|
2534
3972
|
|
|
2535
3973
|
// src/utils/application/useCreateUserAppData.ts
|
|
2536
|
-
import { useCallback as
|
|
3974
|
+
import { useCallback as useCallback24 } from "react";
|
|
2537
3975
|
import { v4 as uuid } from "uuid";
|
|
2538
3976
|
function useCreateUserAppData() {
|
|
2539
|
-
return
|
|
3977
|
+
return useCallback24(
|
|
2540
3978
|
async (appId, pid, dbAuthToken, endpoint) => {
|
|
2541
3979
|
if (!dbAuthToken || !pid || !dbAuthToken || !endpoint) return;
|
|
2542
3980
|
const appValues = {
|
|
@@ -2591,10 +4029,10 @@ function useCreateUserAppData() {
|
|
|
2591
4029
|
}
|
|
2592
4030
|
|
|
2593
4031
|
// src/utils/application/useCreateOrganizationAppData.ts
|
|
2594
|
-
import { useCallback as
|
|
4032
|
+
import { useCallback as useCallback25 } from "react";
|
|
2595
4033
|
import { v4 as uuid2 } from "uuid";
|
|
2596
4034
|
function useCreateOrganizationAppData() {
|
|
2597
|
-
return
|
|
4035
|
+
return useCallback25(
|
|
2598
4036
|
async (appId, pid, dbAuthToken, endpoint) => {
|
|
2599
4037
|
if (!dbAuthToken || !pid || !dbAuthToken || !endpoint) return;
|
|
2600
4038
|
const appValues = {
|
|
@@ -2648,10 +4086,10 @@ function useCreateOrganizationAppData() {
|
|
|
2648
4086
|
}
|
|
2649
4087
|
|
|
2650
4088
|
// src/utils/balance/useFetchBalance.ts
|
|
2651
|
-
import { useCallback as
|
|
4089
|
+
import { useCallback as useCallback26 } from "react";
|
|
2652
4090
|
import { erc20Abi as erc20Abi4, getAddress } from "viem";
|
|
2653
4091
|
function useFetchBalance() {
|
|
2654
|
-
return
|
|
4092
|
+
return useCallback26(
|
|
2655
4093
|
async (publicClient, walletAddress, kibbleTokenAddress) => {
|
|
2656
4094
|
try {
|
|
2657
4095
|
const balance = await publicClient.readContract({
|
|
@@ -2670,10 +4108,10 @@ function useFetchBalance() {
|
|
|
2670
4108
|
}
|
|
2671
4109
|
|
|
2672
4110
|
// src/utils/actions/useClaimActionReward.ts
|
|
2673
|
-
import { encodeFunctionData as
|
|
2674
|
-
import { useCallback as
|
|
4111
|
+
import { encodeFunctionData as encodeFunctionData9 } from "viem";
|
|
4112
|
+
import { useCallback as useCallback27 } from "react";
|
|
2675
4113
|
function useClaimActionReward() {
|
|
2676
|
-
return
|
|
4114
|
+
return useCallback27(
|
|
2677
4115
|
async (actionId, claimIndex, rewardableActionContractAddress, smartAccount, bundlerClient) => {
|
|
2678
4116
|
if (!actionId || claimIndex === void 0 || !bundlerClient || !smartAccount || !rewardableActionContractAddress) {
|
|
2679
4117
|
return {
|
|
@@ -2683,7 +4121,7 @@ function useClaimActionReward() {
|
|
|
2683
4121
|
}
|
|
2684
4122
|
const args = [actionId, claimIndex];
|
|
2685
4123
|
const functionName = "claimByIndex";
|
|
2686
|
-
const callData =
|
|
4124
|
+
const callData = encodeFunctionData9({
|
|
2687
4125
|
abi: REWARDABLE_ACTIONS_ABI,
|
|
2688
4126
|
functionName,
|
|
2689
4127
|
args
|
|
@@ -2719,10 +4157,10 @@ function useClaimActionReward() {
|
|
|
2719
4157
|
}
|
|
2720
4158
|
|
|
2721
4159
|
// src/utils/actions/useClaimOrgActionReward.ts
|
|
2722
|
-
import { encodeFunctionData as
|
|
2723
|
-
import { useCallback as
|
|
4160
|
+
import { encodeFunctionData as encodeFunctionData10 } from "viem";
|
|
4161
|
+
import { useCallback as useCallback28 } from "react";
|
|
2724
4162
|
function useClaimOrgActionReward() {
|
|
2725
|
-
return
|
|
4163
|
+
return useCallback28(
|
|
2726
4164
|
async (orgContractAddress, rewardableActionContractAddress, actionId, claimIndex, smartAccount, bundlerClient) => {
|
|
2727
4165
|
if (!orgContractAddress || !actionId || claimIndex === void 0 || !bundlerClient || !smartAccount) {
|
|
2728
4166
|
return {
|
|
@@ -2730,13 +4168,13 @@ function useClaimOrgActionReward() {
|
|
|
2730
4168
|
message: "Missing web3auth account info or contract address."
|
|
2731
4169
|
};
|
|
2732
4170
|
}
|
|
2733
|
-
const claimCallData =
|
|
4171
|
+
const claimCallData = encodeFunctionData10({
|
|
2734
4172
|
abi: REWARDABLE_ACTIONS_ABI,
|
|
2735
4173
|
functionName: "claimByIndex",
|
|
2736
4174
|
args: [actionId, claimIndex]
|
|
2737
4175
|
});
|
|
2738
4176
|
const args = [rewardableActionContractAddress, claimCallData];
|
|
2739
|
-
const executeClaimCalldata =
|
|
4177
|
+
const executeClaimCalldata = encodeFunctionData10({
|
|
2740
4178
|
abi: ORGANIZATION_IMPL_ABI,
|
|
2741
4179
|
functionName: ORG_FUNCTION,
|
|
2742
4180
|
args
|
|
@@ -2772,9 +4210,9 @@ function useClaimOrgActionReward() {
|
|
|
2772
4210
|
}
|
|
2773
4211
|
|
|
2774
4212
|
// src/utils/actions/useSubmitContractAction.ts
|
|
2775
|
-
import { useCallback as
|
|
4213
|
+
import { useCallback as useCallback29 } from "react";
|
|
2776
4214
|
function useSubmitContractAction() {
|
|
2777
|
-
return
|
|
4215
|
+
return useCallback29(
|
|
2778
4216
|
(idToken, pid, source, endpoint, payload) => {
|
|
2779
4217
|
if (!idToken || !pid || !source || !endpoint || !payload) return;
|
|
2780
4218
|
let sourceTypePayload = {};
|
|
@@ -2894,18 +4332,25 @@ export {
|
|
|
2894
4332
|
ActionSourceType,
|
|
2895
4333
|
ActionStatus,
|
|
2896
4334
|
ActionType,
|
|
4335
|
+
ERROR_ABI,
|
|
2897
4336
|
FIREBASE_WEB_API_KEYS,
|
|
2898
4337
|
FIREBASE_WEB_AUTH_API_ENDPOINTS,
|
|
4338
|
+
KIBBLE_TOKEN_ABI,
|
|
4339
|
+
MARKETPLACE_ABI,
|
|
2899
4340
|
MarketplacePaymentType,
|
|
2900
4341
|
NETWORK_HOSTS,
|
|
2901
4342
|
Network,
|
|
4343
|
+
ORGANIZATION_BEACON_ABI,
|
|
4344
|
+
ORGANIZATION_IMPL_ABI,
|
|
4345
|
+
ORG_FUNCTION,
|
|
4346
|
+
PET_NFT_ABI,
|
|
4347
|
+
REWARDABLE_ACTIONS_ABI,
|
|
2902
4348
|
convertToActionDefinition,
|
|
2903
4349
|
convertToActionRecord,
|
|
2904
4350
|
convertToMultipleActionDefinitions,
|
|
2905
4351
|
convertToMultipleActionRecords,
|
|
2906
4352
|
createApp,
|
|
2907
4353
|
createAuthEnvelope,
|
|
2908
|
-
fetchAnymals,
|
|
2909
4354
|
flattenFirestoreData,
|
|
2910
4355
|
generateAppSignature,
|
|
2911
4356
|
generateBytes32Nonce,
|
|
@@ -2920,19 +4365,17 @@ export {
|
|
|
2920
4365
|
sendUserOpWithRetries,
|
|
2921
4366
|
serializePublicKeyCompressed,
|
|
2922
4367
|
submitAction,
|
|
2923
|
-
useAddAnymalToDatabase,
|
|
2924
4368
|
useApproveKibbleToken,
|
|
2925
4369
|
useApproveOrgPartialPayment,
|
|
2926
4370
|
useClaimActionReward,
|
|
2927
4371
|
useClaimOrgActionReward,
|
|
4372
|
+
useCoinbaseMintAnymalNFT,
|
|
2928
4373
|
useCreateOrganizationAppData,
|
|
2929
4374
|
useCreateOrganizationBase,
|
|
2930
4375
|
useCreateUserAppData,
|
|
2931
4376
|
useCreateWeb3Account,
|
|
2932
|
-
useDeleteAnymalFromDatabase,
|
|
2933
4377
|
useFetchActionDefinitions,
|
|
2934
4378
|
useFetchActions,
|
|
2935
|
-
useFetchAnymals,
|
|
2936
4379
|
useFetchBalance,
|
|
2937
4380
|
useFetchNotifications,
|
|
2938
4381
|
useFetchUserData,
|
|
@@ -2941,8 +4384,8 @@ export {
|
|
|
2941
4384
|
useProcessOrgPartialKibblePayment,
|
|
2942
4385
|
useProcessPartialKibblePayment,
|
|
2943
4386
|
useSaveAnymalMetadata,
|
|
4387
|
+
useSendCoinbaseUserOperation,
|
|
2944
4388
|
useSubmitContractAction,
|
|
2945
|
-
useUpdateAnymalWithNFT,
|
|
2946
4389
|
useUpdateOrgWalletAddress,
|
|
2947
4390
|
useUpdateUserAsVerified,
|
|
2948
4391
|
useUpdateUserEmail,
|