From 3155370f33d99b7723f312891011aab7bfa5facd Mon Sep 17 00:00:00 2001 From: degencodebeast Date: Tue, 21 Nov 2023 03:06:14 +0100 Subject: [PATCH] integrated join community function --- abis/Community.json | 1112 +++++++++++++++++ abis/NutritionistNFT.json | 472 +++++++ abis/Treasury.json | 85 ++ abis/UserNFT.json | 472 +++++++ abis/index.ts | 1108 ++++++++++++++++ contracts/contracts/Community.sol | 576 --------- contracts/contracts/NutritionistNFT.sol | 93 -- contracts/contracts/SBT.sol | 298 ----- contracts/contracts/Treasury.sol | 18 - contracts/contracts/UserNFT.sol | 94 -- contracts/contracts/built.txt | 10 - .../contracts/interfaces/INutritionistNFT.sol | 20 - contracts/contracts/interfaces/ISBT.sol | 13 - contracts/contracts/interfaces/IUserNFT.sol | 21 - .../interfaces/KeeperRegistrarInterface.sol | 17 - contracts/scripts/deployContracts.ts | 126 -- contracts/scripts/deployed.txt | 9 - contracts/scripts/predictor.ts | 22 - contracts/scripts/prompts.ts | 87 -- package.json | 1 + src/components/dashboard-sidebar/index.tsx | 3 +- src/components/header/index.tsx | 66 +- src/components/new-user-type/index.tsx | 87 +- src/components/register-form/index.tsx | 830 +++++++----- src/context/state.tsx | 108 +- src/helpers/prompt.ts | 23 +- src/hooks/useDebounce.ts | 15 + src/pages/community/[id]/index.tsx | 26 +- src/pages/community/index.tsx | 120 +- src/types/state.d.ts | 12 + src/utils/constants/index.ts | 1 + 31 files changed, 4042 insertions(+), 1903 deletions(-) create mode 100644 abis/Community.json create mode 100644 abis/NutritionistNFT.json create mode 100644 abis/Treasury.json create mode 100644 abis/UserNFT.json create mode 100644 abis/index.ts delete mode 100644 contracts/contracts/Community.sol delete mode 100644 contracts/contracts/NutritionistNFT.sol delete mode 100644 contracts/contracts/SBT.sol delete mode 100644 contracts/contracts/Treasury.sol delete mode 100644 contracts/contracts/UserNFT.sol delete mode 100644 contracts/contracts/built.txt delete mode 100644 contracts/contracts/interfaces/INutritionistNFT.sol delete mode 100644 contracts/contracts/interfaces/ISBT.sol delete mode 100644 contracts/contracts/interfaces/IUserNFT.sol delete mode 100644 contracts/contracts/interfaces/KeeperRegistrarInterface.sol delete mode 100644 contracts/scripts/deployContracts.ts delete mode 100644 contracts/scripts/deployed.txt delete mode 100644 contracts/scripts/predictor.ts delete mode 100644 contracts/scripts/prompts.ts create mode 100644 src/hooks/useDebounce.ts diff --git a/abis/Community.json b/abis/Community.json new file mode 100644 index 0000000..d1468d3 --- /dev/null +++ b/abis/Community.json @@ -0,0 +1,1112 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "Community", + "sourceName": "contracts/Community.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_treasury", + "type": "address" + }, + { + "internalType": "contract LinkTokenInterface", + "name": "_link", + "type": "address" + }, + { + "internalType": "address", + "name": "_registrar", + "type": "address" + }, + { + "internalType": "contract AutomationRegistryInterface", + "name": "_registry", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "AlreadyAMember", + "type": "error" + }, + { + "inputs": [], + "name": "AlreadyANutrionist", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientPayment", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidApplicant", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidDeadline", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidSubStatus", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "message", + "type": "string" + } + ], + "name": "UnauthorizedApplication", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "UnauthorizedMember", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "UnauthorizedNutritionist", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "applicant", + "type": "address" + } + ], + "name": "ApplicationApproved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "applicant", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "dataURI", + "type": "string" + } + ], + "name": "NewApplication", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "dataURI", + "type": "string" + } + ], + "name": "NewSignUp", + "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" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "allArticles", + "outputs": [ + { + "internalType": "string", + "name": "title", + "type": "string" + }, + { + "internalType": "address", + "name": "author", + "type": "address" + }, + { + "internalType": "string", + "name": "authorName", + "type": "string" + }, + { + "internalType": "string", + "name": "content", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "allFitnessPlans", + "outputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "fitnessDescription", + "type": "string" + }, + { + "internalType": "address", + "name": "creator", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "allMealPlans", + "outputs": [ + { + "internalType": "string", + "name": "mealName", + "type": "string" + }, + { + "internalType": "string", + "name": "mealDescription", + "type": "string" + }, + { + "internalType": "address", + "name": "creator", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "allNutritionists", + "outputs": [ + { + "internalType": "string", + "name": "nutritionistPersonalData", + "type": "string" + }, + { + "internalType": "address", + "name": "nutritionistAddress", + "type": "address" + }, + { + "components": [ + { + "internalType": "address", + "name": "consultant", + "type": "address" + }, + { + "internalType": "string", + "name": "consultationDescription", + "type": "string" + } + ], + "internalType": "struct Community.ConsultationServices", + "name": "consultationServices", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "allNutritionistsAddresses", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "allNutritionistsApplicants", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "allNutritionistsApplications", + "outputs": [ + { + "internalType": "string", + "name": "dataURI", + "type": "string" + }, + { + "internalType": "address", + "name": "nutritionistAddress", + "type": "address" + }, + { + "internalType": "enum Community.NutritionistApplicationStatus", + "name": "applicationStatus", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "allUserAddresses", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "allUsers", + "outputs": [ + { + "internalType": "address", + "name": "userAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "userPersonalData", + "type": "string" + }, + { + "internalType": "enum Community.UserSubscriptionStatus", + "name": "subStatus", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "subDeadline", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "applicantToIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "dataURI", + "type": "string" + } + ], + "name": "applyForNutritionistRole", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "applicant", + "type": "address" + }, + { + "internalType": "string", + "name": "nutritionistNfturi", + "type": "string" + } + ], + "name": "approveNutritionistRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "cancelNutritionistApplication", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "checkUpkeep", + "outputs": [ + { + "internalType": "bool", + "name": "upkeepNeeded", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "performData", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_consultationDesc", + "type": "string" + } + ], + "name": "createConsultation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_fitnessName", + "type": "string" + }, + { + "internalType": "string", + "name": "fitnessDesc", + "type": "string" + } + ], + "name": "createFitnessPlan", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_mealName", + "type": "string" + }, + { + "internalType": "string", + "name": "mealPlanDesc", + "type": "string" + } + ], + "name": "createMealPlan", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getAllMembers", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "userAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "userPersonalData", + "type": "string" + }, + { + "internalType": "enum Community.UserSubscriptionStatus", + "name": "subStatus", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "subDeadline", + "type": "uint256" + } + ], + "internalType": "struct Community.User[]", + "name": "_users", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAllNutritionists", + "outputs": [ + { + "components": [ + { + "internalType": "string", + "name": "nutritionistPersonalData", + "type": "string" + }, + { + "components": [ + { + "internalType": "string", + "name": "mealName", + "type": "string" + }, + { + "internalType": "string", + "name": "mealDescription", + "type": "string" + }, + { + "internalType": "address", + "name": "creator", + "type": "address" + } + ], + "internalType": "struct Community.MealPlans[]", + "name": "nutritionistMealplans", + "type": "tuple[]" + }, + { + "internalType": "address", + "name": "nutritionistAddress", + "type": "address" + }, + { + "components": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "fitnessDescription", + "type": "string" + }, + { + "internalType": "address", + "name": "creator", + "type": "address" + } + ], + "internalType": "struct Community.FitnessPlans[]", + "name": "fitnessPlans", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "address", + "name": "consultant", + "type": "address" + }, + { + "internalType": "string", + "name": "consultationDescription", + "type": "string" + } + ], + "internalType": "struct Community.ConsultationServices", + "name": "consultationServices", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "string", + "name": "title", + "type": "string" + }, + { + "internalType": "address", + "name": "author", + "type": "address" + }, + { + "internalType": "string", + "name": "authorName", + "type": "string" + }, + { + "internalType": "string", + "name": "content", + "type": "string" + } + ], + "internalType": "struct Community.Articles[]", + "name": "nutritionistArticles", + "type": "tuple[]" + } + ], + "internalType": "struct Community.Nutritionist[]", + "name": "_nutritionists", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "i_link", + "outputs": [ + { + "internalType": "contract LinkTokenInterface", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "i_registry", + "outputs": [ + { + "internalType": "contract AutomationRegistryInterface", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_userData", + "type": "string" + }, + { + "internalType": "string", + "name": "nftUri", + "type": "string" + } + ], + "name": "joinCommunity", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "nutritionistApplicationFee", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "nutritionistApplicationStatus", + "outputs": [ + { + "internalType": "enum Community.NutritionistApplicationStatus", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "nutritionistApplications", + "outputs": [ + { + "internalType": "string", + "name": "dataURI", + "type": "string" + }, + { + "internalType": "address", + "name": "nutritionistAddress", + "type": "address" + }, + { + "internalType": "enum Community.NutritionistApplicationStatus", + "name": "applicationStatus", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "nutritionistNFT", + "outputs": [ + { + "internalType": "contract INutritionistNFT", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "nutritionists", + "outputs": [ + { + "internalType": "string", + "name": "nutritionistPersonalData", + "type": "string" + }, + { + "internalType": "address", + "name": "nutritionistAddress", + "type": "address" + }, + { + "components": [ + { + "internalType": "address", + "name": "consultant", + "type": "address" + }, + { + "internalType": "string", + "name": "consultationDescription", + "type": "string" + } + ], + "internalType": "struct Community.ConsultationServices", + "name": "consultationServices", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "performData", + "type": "bytes" + } + ], + "name": "performUpkeep", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_title", + "type": "string" + }, + { + "internalType": "string", + "name": "_authorName", + "type": "string" + }, + { + "internalType": "string", + "name": "_content", + "type": "string" + } + ], + "name": "publishArticle", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "bytes", + "name": "encryptedEmail", + "type": "bytes" + }, + { + "internalType": "address", + "name": "upkeepContract", + "type": "address" + }, + { + "internalType": "uint32", + "name": "gasLimit", + "type": "uint32" + }, + { + "internalType": "address", + "name": "adminAddress", + "type": "address" + }, + { + "internalType": "bytes", + "name": "checkData", + "type": "bytes" + }, + { + "internalType": "uint96", + "name": "amount", + "type": "uint96" + }, + { + "internalType": "uint8", + "name": "source", + "type": "uint8" + } + ], + "name": "registerAndPredictID", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "registrar", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "applicant", + "type": "address" + } + ], + "name": "rejectNutritionistRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renewSubscription", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_member", + "type": "address" + } + ], + "name": "revokeUser", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_userNFT", + "type": "address" + }, + { + "internalType": "address", + "name": "_nutritionistNFT", + "type": "address" + } + ], + "name": "setNFTs", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "subscriptionDuration", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "treasury", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "userApplicationFee", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "userNFT", + "outputs": [ + { + "internalType": "contract IUserNFT", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "userToIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "bytecode": "0x6101006040526000805463ffffffff60a01b1916631b2ceb3360a11b17905562278d006007553480156200003257600080fd5b5060405162004d3b38038062004d3b8339810160408190526200005591620000ec565b620000603362000083565b6001600160a01b0393841660e052918316608052821660a0521660c05262000154565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0381168114620000e957600080fd5b50565b600080600080608085870312156200010357600080fd5b84516200011081620000d3565b60208601519094506200012381620000d3565b60408601519093506200013681620000d3565b60608601519092506200014981620000d3565b939692955090935050565b60805160a05160c05160e051614b7c620001bf6000396000818161047801528181610ee5015261226a015260008181610381015281816108b501528181610a660152610b300152600081816103b501526109b101526000818161055101526109820152614b7c6000f3fe60806040526004361061025c5760003560e01c80638ce1118d11610144578063d0e4b8f6116100b6578063e52f011c1161007a578063e52f011c146107c5578063ec04cfa9146107e7578063ef097fc414610807578063f11c85a814610827578063f2fde38b14610847578063f621f9aa1461086757600080fd5b8063d0e4b8f61461071a578063d49f077e1461074a578063d7465f201461076a578063dd4320c814610785578063dd96a186146107a557600080fd5b80639f191e08116101085780639f191e081461064f578063a2bdedf41461066f578063a862c3e31461069f578063b4d2fd1e146106ba578063b5aacf84146106da578063ca5da7af146106ed57600080fd5b80638ce1118d146105935780638d5091ad146105c25780638da5cb5b146105e25780638fc64e5d14610600578063935ca0f31461062f57600080fd5b80635b2656eb116101dd57806370309b4c116101a157806370309b4c146104dd578063715018a6146104f25780637a94a633146105075780637c0f6b351461051d5780637d253aff1461053f5780637f6c7f101461057357600080fd5b80635b2656eb1461042657806361647b5b1461044657806361d027b3146104665780636e04ff0d1461049a5780636e307981146104c857600080fd5b80631ff74bc0116102245780631ff74bc01461035c5780632a6636061461036f5780632b20e397146103a3578063447cc936146103d75780634585e33b1461040657600080fd5b806308505d571461026157806312f8a6ab146102a7578063167d05ff146102df57806318a9fb8a1461031a5780631c4e1dc71461033c575b600080fd5b34801561026d57600080fd5b5061029161027c3660046139c0565b600f6020526000908152604090205460ff1681565b60405161029e9190613a0e565b60405180910390f35b3480156102b357600080fd5b506102c76102c2366004613a22565b610887565b6040516001600160a01b03909116815260200161029e565b3480156102eb57600080fd5b5061030c6102fa3660046139c0565b60056020526000908152604090205481565b60405190815260200161029e565b34801561032657600080fd5b5061033a610335366004613bd1565b6108b1565b005b34801561034857600080fd5b506102c7610357366004613a22565b610bd7565b61033a61036a366004613cbb565b610be7565b34801561037b57600080fd5b506102c77f000000000000000000000000000000000000000000000000000000000000000081565b3480156103af57600080fd5b506102c77f000000000000000000000000000000000000000000000000000000000000000081565b3480156103e357600080fd5b506103f76103f2366004613a22565b610f71565b60405161029e93929190613d4c565b34801561041257600080fd5b5061033a610421366004613cbb565b6110c4565b34801561043257600080fd5b5061033a610441366004613d8a565b61113f565b34801561045257600080fd5b506004546102c7906001600160a01b031681565b34801561047257600080fd5b506102c77f000000000000000000000000000000000000000000000000000000000000000081565b3480156104a657600080fd5b506104ba6104b5366004613cbb565b6112cc565b60405161029e929190613e11565b3480156104d457600080fd5b5061033a6114ef565b3480156104e957600080fd5b5061033a611718565b3480156104fe57600080fd5b5061033a611862565b34801561051357600080fd5b5061030c60075481565b34801561052957600080fd5b50610532611876565b60405161029e9190613e44565b34801561054b57600080fd5b506102c77f000000000000000000000000000000000000000000000000000000000000000081565b34801561057f57600080fd5b5061033a61058e366004613ee4565b6119ba565b34801561059f57600080fd5b506105b36105ae366004613a22565b6119f0565b60405161029e93929190613f1d565b3480156105ce57600080fd5b506102c76105dd366004613a22565b611ac2565b3480156105ee57600080fd5b506000546001600160a01b03166102c7565b34801561060c57600080fd5b5061062061061b3660046139c0565b611ad2565b60405161029e93929190613f75565b34801561063b57600080fd5b5061062061064a366004613a22565b611c34565b34801561065b57600080fd5b5061033a61066a366004613fb3565b611c67565b34801561067b57600080fd5b5061068f61068a366004613a22565b611d31565b60405161029e9493929190614016565b3480156106ab57600080fd5b5061030c662386f26fc1000081565b3480156106c657600080fd5b5061033a6106d53660046139c0565b611e03565b61033a6106e8366004613fb3565b611ec0565b3480156106f957600080fd5b5061030c6107083660046139c0565b60066020526000908152604090205481565b34801561072657600080fd5b5061073a610735366004613a22565b6122f5565b60405161029e9493929190614058565b34801561075657600080fd5b5061033a6107653660046140ab565b6124dc565b34801561077657600080fd5b5061030c6611c37937e0800081565b34801561079157600080fd5b5061033a6107a03660046140f0565b6128b9565b3480156107b157600080fd5b506103f76107c0366004613a22565b61293d565b3480156107d157600080fd5b506107da61294d565b60405161029e9190614265565b3480156107f357600080fd5b506105b36108023660046139c0565b61305d565b34801561081357600080fd5b5061033a6108223660046139c0565b613078565b34801561083357600080fd5b5061033a610842366004613fb3565b613439565b34801561085357600080fd5b5061033a6108623660046139c0565b6134be565b34801561087357600080fd5b506003546102c7906001600160a01b031681565b6008818154811061089757600080fd5b6000918252602090912001546001600160a01b0316905081565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316631865c57d6040518163ffffffff1660e01b8152600401600060405180830381865afa158015610911573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610939919081019061447b565b5050805160405191925063ffffffff169060009061096f908e908e908e908e908e908e908e908e908e908e903090602001614613565b60405160208183030381529060405290507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316634000aea07f000000000000000000000000000000000000000000000000000000000000000087600060149054906101000a900460e01b856040516020016109f39291906146a9565b6040516020818303038152906040526040518463ffffffff1660e01b8152600401610a20939291906146da565b6020604051808303816000875af1158015610a3f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a639190614716565b507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316631865c57d6040518163ffffffff1660e01b8152600401600060405180830381865afa158015610ac2573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610aea919081019061447b565b5050805190935063ffffffff16610b0283600161474e565b8103610b82576000610b15600143614761565b60408051914060208301526bffffffffffffffffffffffff197f000000000000000000000000000000000000000000000000000000000000000060601b16908201526001600160e01b031960e086901b16605482015260580160408051601f198184030190525250610bc7565b60405162461bcd60e51b8152602060048201526015602482015274185d5d1bcb585c1c1c9bdd9948191a5cd8589b1959605a1b60448201526064015b60405180910390fd5b5050505050505050505050505050565b600a818154811061089757600080fd5b336000908152600c602052604090205460ff1615610c185760405163773aeddd60e11b815260040160405180910390fd5b6000610c2360015490565b336000908152600f602052604090205490915060ff166001816004811115610c4d57610c4d6139e4565b1480610c6a57506002816004811115610c6857610c686139e4565b145b15610cc35760405163157a0b0f60e31b815260206004820152602260248201527f436f6d6d756e6974793a20616c7265616479206170706c6965642f70656e64696044820152616e6760f01b6064820152608401610bbe565b6611c37937e08000341015610ceb5760405163cd1c886760e01b815260040160405180910390fd5b506040805160806020601f86018190040282018101909252606081018481526001926000929182918890889081908501838280828437600092019190915250505090825250336020820152604001836004811115610d4b57610d4b6139e4565b9052336000908152600560209081526040808320879055600f90915290208054919250839160ff19166001836004811115610d8857610d886139e4565b021790555033600090815260106020526040902081518291908190610dad90826147f9565b5060208201516001820180546001600160a01b039092166001600160a01b03198316811782556040850151926001600160a81b03191617600160a01b836004811115610dfb57610dfb6139e4565b021790555050600a805460018181019092557fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a80180546001600160a01b03191633179055601180549182018155600052825183925060029091027f31ecc21a745e3968a04e9570e4425bc18fa8019c68028196b546d1669c200c6801908190610e8490826147f9565b5060208201516001820180546001600160a01b039092166001600160a01b03198316811782556040850151926001600160a81b03191617600160a01b836004811115610ed257610ed26139e4565b0217905550506040516001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001691503480156108fc02916000818181858888f19350505050158015610f2e573d6000803e3d6000fd5b507f61d9c1c60d18166430e232b0032dc6dca6b6f8ecb9fae9972cd57989dd88020f338686604051610f62939291906148b8565b60405180910390a15050505050565b60128181548110610f8157600080fd5b9060005260206000209060030201600091509050806000018054610fa490614774565b80601f0160208091040260200160405190810160405280929190818152602001828054610fd090614774565b801561101d5780601f10610ff25761010080835404028352916020019161101d565b820191906000526020600020905b81548152906001019060200180831161100057829003601f168201915b50505050509080600101805461103290614774565b80601f016020809104026020016040519081016040528092919081815260200182805461105e90614774565b80156110ab5780601f10611080576101008083540402835291602001916110ab565b820191906000526020600020905b81548152906001019060200180831161108e57829003601f168201915b505050600290930154919250506001600160a01b031683565b60006110d2828401846148dd565b905060005b81518161ffff161015611139576000828261ffff16815181106110fc576110fc6149f8565b6020026020010151905060008160000151905081606001514211156111245761112481613078565b5050808061113190614a0e565b9150506110d7565b50505050565b611147613537565b336000908152600c602052604090205460ff166111795760405163349b3f2f60e21b8152336004820152602401610bbe565b336000818152600e602090815260408083208151608081018352888152808401959095529084018690526060840185905260068101805460018101825590845291909220835192939283926004029091019081906111d790826147f9565b5060208201516001820180546001600160a01b0319166001600160a01b039092169190911790556040820151600282019061121290826147f9565b506060820151600382019061122790826147f9565b505060168054600181018255600091909152825183925060049091027fd833147d7dc355ba459fc788f669e58cfaf9dc25ddcd0702e87d69c7b51242890190819061127290826147f9565b5060208201516001820180546001600160a01b0319166001600160a01b03909216919091179055604082015160028201906112ad90826147f9565b50606082015160038201906112c290826147f9565b5050505050505050565b600060606000806014805490506001600160401b038111156112f0576112f0613a3b565b60405190808252806020026020018201604052801561134c57816020015b6113396040805160808101825260008082526060602083015290918201908152602001600081525090565b81526020019060019003908161130e5790505b50905060005b60145461ffff821610156114c057600060148261ffff1681548110611379576113796149f8565b6000918252602091829020604080516080810190915260049092020180546001600160a01b0316825260018101805492939192918401916113b990614774565b80601f01602080910402602001604051908101604052809291908181526020018280546113e590614774565b80156114325780601f1061140757610100808354040283529160200191611432565b820191906000526020600020905b81548152906001019060200180831161141557829003601f168201915b505050918352505060028281015460209092019160ff1690811115611459576114596139e4565b600281111561146a5761146a6139e4565b8152602001600382015481525050905080606001514211156114ad5780838361ffff168151811061149d5761149d6149f8565b6020026020010181905250600193505b50806114b881614a0e565b915050611352565b50819350806040516020016114d59190613e44565b604051602081830303815290604052925050509250929050565b336000908152600b602052604090205460ff16156115225760405163bfadfc2760e01b8152336004820152602401610bbe565b336000818152600d60205260409020600301544281111561155657604051631da7447960e21b815260040160405180910390fd5b336000908152600d6020908152604080832081516080810190925280546001600160a01b03168252600181018054929391929184019161159590614774565b80601f01602080910402602001604051908101604052809291908181526020018280546115c190614774565b801561160e5780601f106115e35761010080835404028352916020019161160e565b820191906000526020600020905b8154815290600101906020018083116115f157829003601f168201915b505050918352505060028281015460209092019160ff1690811115611635576116356139e4565b6002811115611646576116466139e4565b815260039190910154602090910152905060028160400151600281111561166f5761166f6139e4565b1461168d57604051631294a20560e01b815260040160405180910390fd5b60016040828101829052336000908152600d6020908152919020835181546001600160a01b0319166001600160a01b039091161781559083015183928201906116d690826147f9565b5060408201518160020160006101000a81548160ff02191690836002811115611701576117016139e4565b021790555060608201518160030155905050505050565b336000908152600c602052604090205460ff1661174a5760405163349b3f2f60e21b8152336004820152602401610bbe565b336000818152600f602052604090205460ff166001816004811115611771576117716139e4565b1461178f5760405163b824136960e01b815260040160405180910390fd5b336000908152600c602052604090205460ff16156117c05760405163773aeddd60e11b815260040160405180910390fd5b336000818152600f602052604081205460ff16916117dd90613591565b9050600a81815481106117f2576117f26149f8565b6000918252602080832090910180546001600160a01b031916905533825260109052604081209061182382826136af565b50600190810180546001600160a81b0319169055336000908152600f60205260409020805460049450849260ff1990911690835b021790555050505050565b61186a613537565b61187460006135ff565b565b60606014805480602002602001604051908101604052809291908181526020016000905b828210156119b157600084815260209081902060408051608081019091526004850290910180546001600160a01b0316825260018101805492939192918401916118e390614774565b80601f016020809104026020016040519081016040528092919081815260200182805461190f90614774565b801561195c5780601f106119315761010080835404028352916020019161195c565b820191906000526020600020905b81548152906001019060200180831161193f57829003601f168201915b505050918352505060028281015460209092019160ff1690811115611983576119836139e4565b6002811115611994576119946139e4565b81526020016003820154815250508152602001906001019061189a565b50505050905090565b6119c2613537565b600480546001600160a01b039384166001600160a01b03199182161790915560038054929093169116179055565b60118181548110611a0057600080fd5b9060005260206000209060020201600091509050806000018054611a2390614774565b80601f0160208091040260200160405190810160405280929190818152602001828054611a4f90614774565b8015611a9c5780601f10611a7157610100808354040283529160200191611a9c565b820191906000526020600020905b815481529060010190602001808311611a7f57829003601f168201915b505050600190930154919250506001600160a01b0381169060ff600160a01b9091041683565b6009818154811061089757600080fd5b600e60205260009081526040902080548190611aed90614774565b80601f0160208091040260200160405190810160405280929190818152602001828054611b1990614774565b8015611b665780601f10611b3b57610100808354040283529160200191611b66565b820191906000526020600020905b815481529060010190602001808311611b4957829003601f168201915b5050506002840154604080518082019091526004860180546001600160a01b03908116835260058801805497989190941696909550919350916020840191611bad90614774565b80601f0160208091040260200160405190810160405280929190818152602001828054611bd990614774565b8015611c265780601f10611bfb57610100808354040283529160200191611c26565b820191906000526020600020905b815481529060010190602001808311611c0957829003601f168201915b505050505081525050905083565b60158181548110611c4457600080fd5b9060005260206000209060070201600091509050806000018054611aed90614774565b336000908152600c602052604090205460ff16611c995760405163349b3f2f60e21b8152336004820152602401610bbe565b336000818152600e6020908152604080832081516060810183528781528084018790529182019490945260038085018054600181018255908552929093208151919384930201908190611cec90826147f9565b5060208201516001820190611d0190826147f9565b5060409190910151600290910180546001600160a01b0319166001600160a01b0390921691909117905550505050565b60148181548110611d4157600080fd5b6000918252602090912060049091020180546001820180546001600160a01b03909216935090611d7090614774565b80601f0160208091040260200160405190810160405280929190818152602001828054611d9c90614774565b8015611de95780601f10611dbe57610100808354040283529160200191611de9565b820191906000526020600020905b815481529060010190602001808311611dcc57829003601f168201915b505050506002830154600390930154919260ff1691905084565b611e0b613537565b6001600160a01b0381166000908152600f6020526040902054819060ff166001816004811115611e3d57611e3d6139e4565b14611e5b5760405163b824136960e01b815260040160405180910390fd5b6001600160a01b0383166000908152600c602052604090205460ff1615611e955760405163773aeddd60e11b815260040160405180910390fd5b6001600160a01b0383166000908152600f602052604090208054600391829160ff1916600183611857565b336000908152600b602052604090205460ff1615611ef15760405163a929afd160e01b815260040160405180910390fd5b662386f26fc10000341015611f195760405163cd1c886760e01b815260040160405180910390fd5b6000611f2460025490565b336000908152600b60209081526040808320805460ff19166001908117909155600d835281842082516080810190935280546001600160a01b031683529081018054959650939491939092840191611f7b90614774565b80601f0160208091040260200160405190810160405280929190818152602001828054611fa790614774565b8015611ff45780601f10611fc957610100808354040283529160200191611ff4565b820191906000526020600020905b815481529060010190602001808311611fd757829003601f168201915b505050918352505060028281015460209092019160ff169081111561201b5761201b6139e4565b600281111561202c5761202c6139e4565b81526003919091015460209182015233825281018590526001604082015260075490915061205a904261474e565b6060820152336000908152600d60209081526040909120825181546001600160a01b0319166001600160a01b039091161781559082015182919060018201906120a390826147f9565b5060408201518160020160006101000a81548160ff021916908360028111156120ce576120ce6139e4565b021790555060609190910151600390910155336000908152600660209081526040822084905560148054600181018255925282517fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ec600490930292830180546001600160a01b0319166001600160a01b039092169190911781559083015183927fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ed019061217b90826147f9565b5060408201518160020160006101000a81548160ff021916908360028111156121a6576121a66139e4565b021790555060609190910151600390910155600880546001810182556000919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30180546001600160a01b031916339081179091556004805460405163d0def52160e01b81526001600160a01b03919091169263d0def5219261222d92889101614a2f565b600060405180830381600087803b15801561224757600080fd5b505af115801561225b573d6000803e3d6000fd5b50506040516001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001692503480156108fc029250906000818181858888f193505050501580156122b5573d6000803e3d6000fd5b507f8772c8819e99ebb9f69fe72d9a60c78de13a367140e9360b1a4f2fbe59d7204b33856040516122e7929190614a2f565b60405180910390a150505050565b6016818154811061230557600080fd5b906000526020600020906004020160009150905080600001805461232890614774565b80601f016020809104026020016040519081016040528092919081815260200182805461235490614774565b80156123a15780601f10612376576101008083540402835291602001916123a1565b820191906000526020600020905b81548152906001019060200180831161238457829003601f168201915b505050600184015460028501805494956001600160a01b039092169491935091506123cb90614774565b80601f01602080910402602001604051908101604052809291908181526020018280546123f790614774565b80156124445780601f1061241957610100808354040283529160200191612444565b820191906000526020600020905b81548152906001019060200180831161242757829003601f168201915b50505050509080600301805461245990614774565b80601f016020809104026020016040519081016040528092919081815260200182805461248590614774565b80156124d25780601f106124a7576101008083540402835291602001916124d2565b820191906000526020600020905b8154815290600101906020018083116124b557829003601f168201915b5050505050905084565b6124e4613537565b6001600160a01b0382166000908152600f6020526040902054829060ff166001816004811115612516576125166139e4565b146125345760405163b824136960e01b815260040160405180910390fd5b6001600160a01b0384166000908152600c602052604090205460ff161561256e5760405163773aeddd60e11b815260040160405180910390fd5b6001600160a01b0384166000908152600f602090815260408083208054600260ff199182168117909255600c84528285208054909116600117905560109092528083208151606081019092528054929392829082906125cc90614774565b80601f01602080910402602001604051908101604052809291908181526020018280546125f890614774565b80156126455780601f1061261a57610100808354040283529160200191612645565b820191906000526020600020905b81548152906001019060200180831161262857829003601f168201915b505050918352505060018201546001600160a01b0381166020830152604090910190600160a01b900460ff166004811115612682576126826139e4565b6004811115612693576126936139e4565b9052506001600160a01b038781166000908152600e60209081526040909120908301516002820180546001600160a01b031916919093161790915581519192509081906126e090826147f9565b506015805460018101825560009190915281906007027f55f448fdea98c4d29eb340757ef0a66cd03dbb9538908a6a81d96026b71ec47501806127238382614a53565b506001828101805461273892840191906136e9565b5060028281015490820180546001600160a01b0319166001600160a01b03909216919091179055600380830180546127739284019190613782565b506004828101805491830180546001600160a01b0319166001600160a01b03909316929092178255906005808401906127ae90860182614a53565b505050600682810180546127c59284019190613817565b5050600980546001810182556000919091527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af0180546001600160a01b0319166001600160a01b038a81169190911790915560035460405163d0def52160e01b81529116915063d0def521906128419033908a90600401614a2f565b600060405180830381600087803b15801561285b57600080fd5b505af115801561286f573d6000803e3d6000fd5b50506040516001600160a01b038a1681527f6ca6150407f26e90367ff690c8b617cad626020aa12080384e3b31479c0442fb9250602001905060405180910390a150505050505050565b336000908152600c602052604090205460ff166128eb5760405163349b3f2f60e21b8152336004820152602401610bbe565b336000818152600e602090815260409182902082518084019093528383529082018490526004810180546001600160a01b03191690931783559181906005840161293586826147f9565b505050505050565b60138181548110610f8157600080fd5b60606015805480602002602001604051908101604052809291908181526020016000905b828210156119b157838290600052602060002090600702016040518060c00160405290816000820180546129a490614774565b80601f01602080910402602001604051908101604052809291908181526020018280546129d090614774565b8015612a1d5780601f106129f257610100808354040283529160200191612a1d565b820191906000526020600020905b815481529060010190602001808311612a0057829003601f168201915b5050505050815260200160018201805480602002602001604051908101604052809291908181526020016000905b82821015612bb75783829060005260206000209060030201604051806060016040529081600082018054612a7e90614774565b80601f0160208091040260200160405190810160405280929190818152602001828054612aaa90614774565b8015612af75780601f10612acc57610100808354040283529160200191612af7565b820191906000526020600020905b815481529060010190602001808311612ada57829003601f168201915b50505050508152602001600182018054612b1090614774565b80601f0160208091040260200160405190810160405280929190818152602001828054612b3c90614774565b8015612b895780601f10612b5e57610100808354040283529160200191612b89565b820191906000526020600020905b815481529060010190602001808311612b6c57829003601f168201915b5050509183525050600291909101546001600160a01b03166020918201529082526001929092019101612a4b565b5050509082525060028201546001600160a01b0316602080830191909152600383018054604080518285028101850182528281529401939260009084015b82821015612d615783829060005260206000209060030201604051806060016040529081600082018054612c2890614774565b80601f0160208091040260200160405190810160405280929190818152602001828054612c5490614774565b8015612ca15780601f10612c7657610100808354040283529160200191612ca1565b820191906000526020600020905b815481529060010190602001808311612c8457829003601f168201915b50505050508152602001600182018054612cba90614774565b80601f0160208091040260200160405190810160405280929190818152602001828054612ce690614774565b8015612d335780601f10612d0857610100808354040283529160200191612d33565b820191906000526020600020905b815481529060010190602001808311612d1657829003601f168201915b5050509183525050600291909101546001600160a01b03166020918201529082526001929092019101612bf5565b50505090825250604080518082019091526004830180546001600160a01b0316825260058401805460209485019484019190612d9c90614774565b80601f0160208091040260200160405190810160405280929190818152602001828054612dc890614774565b8015612e155780601f10612dea57610100808354040283529160200191612e15565b820191906000526020600020905b815481529060010190602001808311612df857829003601f168201915b505050505081525050815260200160068201805480602002602001604051908101604052809291908181526020016000905b828210156130465783829060005260206000209060040201604051806080016040529081600082018054612e7a90614774565b80601f0160208091040260200160405190810160405280929190818152602001828054612ea690614774565b8015612ef35780601f10612ec857610100808354040283529160200191612ef3565b820191906000526020600020905b815481529060010190602001808311612ed657829003601f168201915b505050918352505060018201546001600160a01b03166020820152600282018054604090920191612f2390614774565b80601f0160208091040260200160405190810160405280929190818152602001828054612f4f90614774565b8015612f9c5780601f10612f7157610100808354040283529160200191612f9c565b820191906000526020600020905b815481529060010190602001808311612f7f57829003601f168201915b50505050508152602001600382018054612fb590614774565b80601f0160208091040260200160405190810160405280929190818152602001828054612fe190614774565b801561302e5780601f106130035761010080835404028352916020019161302e565b820191906000526020600020905b81548152906001019060200180831161301157829003601f168201915b50505050508152505081526020019060010190612e47565b505050508152505081526020019060010190612971565b601060205260009081526040902080548190611a2390614774565b6001600160a01b0381166000908152600d60205260409020600301548190428111156130b757604051631da7447960e21b815260040160405180910390fd5b6001600160a01b0383166000908152600b602052604090205460ff166130fb5760405163bfadfc2760e01b81526001600160a01b0384166004820152602401610bbe565b6001600160a01b038084166000908152600d602090815260408083208151608081019092528054909416815260018401805493949193919284019161313f90614774565b80601f016020809104026020016040519081016040528092919081815260200182805461316b90614774565b80156131b85780601f1061318d576101008083540402835291602001916131b8565b820191906000526020600020905b81548152906001019060200180831161319b57829003601f168201915b505050918352505060028281015460209092019160ff16908111156131df576131df6139e4565b60028111156131f0576131f06139e4565b81526020016003820154815250509050806060015142111561321b5760026040820152600060608201525b6001600160a01b038481166000908152600d60209081526040909120835181546001600160a01b0319169316929092178255820151829190600182019061326290826147f9565b5060408201518160020160006101000a81548160ff0219169083600281111561328d5761328d6139e4565b02179055506060820151816003015590505060006132aa8561364f565b905081601482815481106132c0576132c06149f8565b600091825260209182902083516004929092020180546001600160a01b0319166001600160a01b0390921691909117815590820151600182019061330490826147f9565b5060408201518160020160006101000a81548160ff0219169083600281111561332f5761332f6139e4565b021790555060609190910151600390910155600480548351604051639c85cd6b60e01b81526001600160a01b0391821693810193909352600092911690639c85cd6b90602401602060405180830381865afa158015613392573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133b69190614b2d565b600480548551604051632770a7eb60e21b81529394506001600160a01b0390911692639dc29fac926133ff92918691016001600160a01b03929092168252602082015260400190565b600060405180830381600087803b15801561341957600080fd5b505af115801561342d573d6000803e3d6000fd5b50505050505050505050565b336000908152600c602052604090205460ff1661346b5760405163349b3f2f60e21b8152336004820152602401610bbe565b336000818152600e6020908152604080832081516060810183528781528084018790529182019490945260018085018054918201815584529190922082518392600302909101908190611cec90826147f9565b6134c6613537565b6001600160a01b03811661352b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610bbe565b613534816135ff565b50565b6000546001600160a01b031633146118745760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610bbe565b6001600160a01b0381166000908152600f6020526040812054829060ff1660018160048111156135c3576135c36139e4565b146135e15760405163b824136960e01b815260040160405180910390fd5b5050506001600160a01b031660009081526005602052604090205490565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0381166000908152600b602052604081205460ff166136935760405163bfadfc2760e01b81526001600160a01b0383166004820152602401610bbe565b506001600160a01b031660009081526006602052604090205490565b5080546136bb90614774565b6000825580601f106136cb575050565b601f01602090049060005260206000209081019061353491906138c1565b8280548282559060005260206000209060030281019282156137725760005260206000209160030282015b82811115613772578282806137298382614a53565b5060018181019061373c90840182614a53565b50600291820154910180546001600160a01b0319166001600160a01b039092169190911790556003928301929190910190613714565b5061377e9291506138d6565b5090565b82805482825590600052602060002090600302810192821561380b5760005260206000209160030282015b8281111561380b578282806137c28382614a53565b506001818101906137d590840182614a53565b50600291820154910180546001600160a01b0319166001600160a01b0390921691909117905560039283019291909101906137ad565b5061377e929150613913565b8280548282559060005260206000209060040281019282156138b55760005260206000209160040282015b828111156138b5578282806138578382614a53565b5060018281015490820180546001600160a01b0319166001600160a01b0390921691909117905560028082019061389090840182614a53565b506003818101906138a390840182614a53565b50505091600401919060040190613842565b5061377e929150613950565b5b8082111561377e57600081556001016138c2565b8082111561377e5760006138ea82826136af565b6138f86001830160006136af565b506002810180546001600160a01b03191690556003016138d6565b8082111561377e57600061392782826136af565b6139356001830160006136af565b506002810180546001600160a01b0319169055600301613913565b8082111561377e57600061396482826136af565b6001820180546001600160a01b03191690556139846002830160006136af565b6139926003830160006136af565b50600401613950565b6001600160a01b038116811461353457600080fd5b80356139bb8161399b565b919050565b6000602082840312156139d257600080fd5b81356139dd8161399b565b9392505050565b634e487b7160e01b600052602160045260246000fd5b60058110613a0a57613a0a6139e4565b9052565b60208101613a1c82846139fa565b92915050565b600060208284031215613a3457600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b60405161018081016001600160401b0381118282101715613a7457613a74613a3b565b60405290565b604051608081016001600160401b0381118282101715613a7457613a74613a3b565b604051601f8201601f191681016001600160401b0381118282101715613ac457613ac4613a3b565b604052919050565b600082601f830112613add57600080fd5b81356001600160401b03811115613af657613af6613a3b565b613b09601f8201601f1916602001613a9c565b818152846020838601011115613b1e57600080fd5b816020850160208301376000918101602001919091529392505050565b60008083601f840112613b4d57600080fd5b5081356001600160401b03811115613b6457600080fd5b602083019150836020828501011115613b7c57600080fd5b9250929050565b63ffffffff8116811461353457600080fd5b80356139bb81613b83565b6001600160601b038116811461353457600080fd5b80356139bb81613ba0565b803560ff811681146139bb57600080fd5b6000806000806000806000806000806101008b8d031215613bf157600080fd5b8a356001600160401b0380821115613c0857600080fd5b613c148e838f01613acc565b9b5060208d0135915080821115613c2a57600080fd5b613c368e838f01613b3b565b909b509950899150613c4a60408e016139b0565b9850613c5860608e01613b95565b9750613c6660808e016139b0565b965060a08d0135915080821115613c7c57600080fd5b50613c898d828e01613b3b565b9095509350613c9c905060c08c01613bb5565b9150613caa60e08c01613bc0565b90509295989b9194979a5092959850565b60008060208385031215613cce57600080fd5b82356001600160401b03811115613ce457600080fd5b613cf085828601613b3b565b90969095509350505050565b60005b83811015613d17578181015183820152602001613cff565b50506000910152565b60008151808452613d38816020860160208601613cfc565b601f01601f19169290920160200192915050565b606081526000613d5f6060830186613d20565b8281036020840152613d718186613d20565b91505060018060a01b0383166040830152949350505050565b600080600060608486031215613d9f57600080fd5b83356001600160401b0380821115613db657600080fd5b613dc287838801613acc565b94506020860135915080821115613dd857600080fd5b613de487838801613acc565b93506040860135915080821115613dfa57600080fd5b50613e0786828701613acc565b9150509250925092565b8215158152604060208201526000613e2c6040830184613d20565b949350505050565b60038110613a0a57613a0a6139e4565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b83811015613ed657888303603f19018552815180516001600160a01b0316845287810151608089860181905290613ea482870182613d20565b91505087820151613eb789870182613e34565b5060609182015194909101939093529386019390860190600101613e6b565b509098975050505050505050565b60008060408385031215613ef757600080fd5b8235613f028161399b565b91506020830135613f128161399b565b809150509250929050565b606081526000613f306060830186613d20565b6001600160a01b03851660208401529050613e2c60408301846139fa565b60018060a01b0381511682526000602082015160406020850152613e2c6040850182613d20565b606081526000613f886060830186613d20565b6001600160a01b03851660208401528281036040840152613fa98185613f4e565b9695505050505050565b60008060408385031215613fc657600080fd5b82356001600160401b0380821115613fdd57600080fd5b613fe986838701613acc565b93506020850135915080821115613fff57600080fd5b5061400c85828601613acc565b9150509250929050565b6001600160a01b038516815260806020820181905260009061403a90830186613d20565b90506140496040830185613e34565b82606083015295945050505050565b60808152600061406b6080830187613d20565b6001600160a01b0386166020840152828103604084015261408c8186613d20565b905082810360608401526140a08185613d20565b979650505050505050565b600080604083850312156140be57600080fd5b82356140c98161399b565b915060208301356001600160401b038111156140e457600080fd5b61400c85828601613acc565b60006020828403121561410257600080fd5b81356001600160401b0381111561411857600080fd5b613e2c84828501613acc565b60008151606084526141396060850182613d20565b9050602083015184820360208601526141528282613d20565b6040948501516001600160a01b03169590940194909452509092915050565b600081518084526020808501808196508360051b8101915082860160005b858110156141b95782840389526141a7848351614124565b9885019893509084019060010161418f565b5091979650505050505050565b600081518084526020808501808196508360051b8101915082860160005b858110156141b957828403895281516080815181875261420682880182613d20565b838901516001600160a01b0316888a0152604080850151898303828b015291935091506142338382613d20565b92505050606080830151925086820381880152506142518183613d20565b9a87019a95505050908401906001016141e4565b602080825282518282018190526000919060409081850190600581811b8701840188860187805b8581101561438e57603f198b8503018752825160c081518187526142b282880182613d20565b838d0151888203898f015280518083529193508d0191508c830190808a1b84018e01875b8281101561430957601f198683030184526142f2828651614124565b91508f850194508f840193506001810190506142d6565b508d86015194506143248e8b01866001600160a01b03169052565b60609450848601519350898103858b015261433f8185614171565b9450505050506080808301518783038289015261435c8382613f4e565b9250505060a0808301519250868203818801525061437a81836141c6565b988b0198955050509188019160010161428c565b50919a9950505050505050505050565b80516139bb81613b83565b80516139bb81613ba0565b805162ffffff811681146139bb57600080fd5b805161ffff811681146139bb57600080fd5b80516139bb8161399b565b60006001600160401b038211156143fd576143fd613a3b565b5060051b60200190565b600082601f83011261441857600080fd5b8151602061442d614428836143e4565b613a9c565b82815260059290921b8401810191818101908684111561444c57600080fd5b8286015b848110156144705780516144638161399b565b8352918301918301614450565b509695505050505050565b600080600083850361022081121561449257600080fd5b60808112156144a057600080fd5b6144a8613a7a565b85516144b381613b83565b815260208601516144c381613ba0565b602082015260408681015190820152606080870151908201529350610180607f1982018113156144f257600080fd5b6144fa613a51565b91506145086080870161439e565b825261451660a0870161439e565b602083015261452760c087016143b4565b604083015261453860e0870161439e565b606083015261010061454b8188016143b4565b608084015261012061455e8189016143c7565b60a0850152610140614571818a016143a9565b60c0860152610160614584818b0161439e565b60e0870152848a0151848701526101a08a0151838701526145a86101c08b016143d9565b828701526145b96101e08b016143d9565b90860152505050506102008501519092506001600160401b038111156145de57600080fd5b613e0786828701614407565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60006101208083526146278184018f613d20565b9050828103602084015261463c818d8f6145ea565b6001600160a01b038c8116604086015263ffffffff8c1660608601528a8116608086015284820360a086015290915061467682898b6145ea565b6001600160601b039790971660c085015260ff9590951660e0840152505091166101009091015298975050505050505050565b6001600160e01b03198316815281516000906146cc816004850160208701613cfc565b919091016004019392505050565b6001600160a01b03841681526001600160601b038316602082015260606040820181905260009061470d90830184613d20565b95945050505050565b60006020828403121561472857600080fd5b815180151581146139dd57600080fd5b634e487b7160e01b600052601160045260246000fd5b80820180821115613a1c57613a1c614738565b81810381811115613a1c57613a1c614738565b600181811c9082168061478857607f821691505b6020821081036147a857634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156147f457600081815260208120601f850160051c810160208610156147d55750805b601f850160051c820191505b81811015612935578281556001016147e1565b505050565b81516001600160401b0381111561481257614812613a3b565b614826816148208454614774565b846147ae565b602080601f83116001811461485b57600084156148435750858301515b600019600386901b1c1916600185901b178555612935565b600085815260208120601f198616915b8281101561488a5788860151825594840194600190910190840161486b565b50858210156148a85787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6001600160a01b038416815260406020820181905260009061470d90830184866145ea565b600060208083850312156148f057600080fd5b82356001600160401b038082111561490757600080fd5b818501915085601f83011261491b57600080fd5b8135614929614428826143e4565b81815260059190911b8301840190848101908883111561494857600080fd5b8585015b838110156149eb578035858111156149645760008081fd5b86016080818c03601f190181131561497c5760008081fd5b614984613a7a565b898301356149918161399b565b8152604083810135898111156149a75760008081fd5b6149b58f8d83880101613acc565b8c84015250606080850135600381106149ce5760008081fd5b91830191909152919092013590820152835291860191860161494c565b5098975050505050505050565b634e487b7160e01b600052603260045260246000fd5b600061ffff808316818103614a2557614a25614738565b6001019392505050565b6001600160a01b0383168152604060208201819052600090613e2c90830184613d20565b818103614a5e575050565b614a688254614774565b6001600160401b03811115614a7f57614a7f613a3b565b614a8d816148208454614774565b6000601f821160018114614ac15760008315614aa95750848201545b600019600385901b1c1916600184901b178455614b26565b600085815260209020601f19841690600086815260209020845b83811015614afb5782860154825560019586019590910190602001614adb565b5085831015614b195781850154600019600388901b60f8161c191681555b50505060018360011b0184555b5050505050565b600060208284031215614b3f57600080fd5b505191905056fea2646970667358221220622ae0bfb84927b356b40e207183f6f64ec09a965120e58e0497840e84cf01fd64736f6c63430008110033", + "deployedBytecode": "0x60806040526004361061025c5760003560e01c80638ce1118d11610144578063d0e4b8f6116100b6578063e52f011c1161007a578063e52f011c146107c5578063ec04cfa9146107e7578063ef097fc414610807578063f11c85a814610827578063f2fde38b14610847578063f621f9aa1461086757600080fd5b8063d0e4b8f61461071a578063d49f077e1461074a578063d7465f201461076a578063dd4320c814610785578063dd96a186146107a557600080fd5b80639f191e08116101085780639f191e081461064f578063a2bdedf41461066f578063a862c3e31461069f578063b4d2fd1e146106ba578063b5aacf84146106da578063ca5da7af146106ed57600080fd5b80638ce1118d146105935780638d5091ad146105c25780638da5cb5b146105e25780638fc64e5d14610600578063935ca0f31461062f57600080fd5b80635b2656eb116101dd57806370309b4c116101a157806370309b4c146104dd578063715018a6146104f25780637a94a633146105075780637c0f6b351461051d5780637d253aff1461053f5780637f6c7f101461057357600080fd5b80635b2656eb1461042657806361647b5b1461044657806361d027b3146104665780636e04ff0d1461049a5780636e307981146104c857600080fd5b80631ff74bc0116102245780631ff74bc01461035c5780632a6636061461036f5780632b20e397146103a3578063447cc936146103d75780634585e33b1461040657600080fd5b806308505d571461026157806312f8a6ab146102a7578063167d05ff146102df57806318a9fb8a1461031a5780631c4e1dc71461033c575b600080fd5b34801561026d57600080fd5b5061029161027c3660046139c0565b600f6020526000908152604090205460ff1681565b60405161029e9190613a0e565b60405180910390f35b3480156102b357600080fd5b506102c76102c2366004613a22565b610887565b6040516001600160a01b03909116815260200161029e565b3480156102eb57600080fd5b5061030c6102fa3660046139c0565b60056020526000908152604090205481565b60405190815260200161029e565b34801561032657600080fd5b5061033a610335366004613bd1565b6108b1565b005b34801561034857600080fd5b506102c7610357366004613a22565b610bd7565b61033a61036a366004613cbb565b610be7565b34801561037b57600080fd5b506102c77f000000000000000000000000000000000000000000000000000000000000000081565b3480156103af57600080fd5b506102c77f000000000000000000000000000000000000000000000000000000000000000081565b3480156103e357600080fd5b506103f76103f2366004613a22565b610f71565b60405161029e93929190613d4c565b34801561041257600080fd5b5061033a610421366004613cbb565b6110c4565b34801561043257600080fd5b5061033a610441366004613d8a565b61113f565b34801561045257600080fd5b506004546102c7906001600160a01b031681565b34801561047257600080fd5b506102c77f000000000000000000000000000000000000000000000000000000000000000081565b3480156104a657600080fd5b506104ba6104b5366004613cbb565b6112cc565b60405161029e929190613e11565b3480156104d457600080fd5b5061033a6114ef565b3480156104e957600080fd5b5061033a611718565b3480156104fe57600080fd5b5061033a611862565b34801561051357600080fd5b5061030c60075481565b34801561052957600080fd5b50610532611876565b60405161029e9190613e44565b34801561054b57600080fd5b506102c77f000000000000000000000000000000000000000000000000000000000000000081565b34801561057f57600080fd5b5061033a61058e366004613ee4565b6119ba565b34801561059f57600080fd5b506105b36105ae366004613a22565b6119f0565b60405161029e93929190613f1d565b3480156105ce57600080fd5b506102c76105dd366004613a22565b611ac2565b3480156105ee57600080fd5b506000546001600160a01b03166102c7565b34801561060c57600080fd5b5061062061061b3660046139c0565b611ad2565b60405161029e93929190613f75565b34801561063b57600080fd5b5061062061064a366004613a22565b611c34565b34801561065b57600080fd5b5061033a61066a366004613fb3565b611c67565b34801561067b57600080fd5b5061068f61068a366004613a22565b611d31565b60405161029e9493929190614016565b3480156106ab57600080fd5b5061030c662386f26fc1000081565b3480156106c657600080fd5b5061033a6106d53660046139c0565b611e03565b61033a6106e8366004613fb3565b611ec0565b3480156106f957600080fd5b5061030c6107083660046139c0565b60066020526000908152604090205481565b34801561072657600080fd5b5061073a610735366004613a22565b6122f5565b60405161029e9493929190614058565b34801561075657600080fd5b5061033a6107653660046140ab565b6124dc565b34801561077657600080fd5b5061030c6611c37937e0800081565b34801561079157600080fd5b5061033a6107a03660046140f0565b6128b9565b3480156107b157600080fd5b506103f76107c0366004613a22565b61293d565b3480156107d157600080fd5b506107da61294d565b60405161029e9190614265565b3480156107f357600080fd5b506105b36108023660046139c0565b61305d565b34801561081357600080fd5b5061033a6108223660046139c0565b613078565b34801561083357600080fd5b5061033a610842366004613fb3565b613439565b34801561085357600080fd5b5061033a6108623660046139c0565b6134be565b34801561087357600080fd5b506003546102c7906001600160a01b031681565b6008818154811061089757600080fd5b6000918252602090912001546001600160a01b0316905081565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316631865c57d6040518163ffffffff1660e01b8152600401600060405180830381865afa158015610911573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610939919081019061447b565b5050805160405191925063ffffffff169060009061096f908e908e908e908e908e908e908e908e908e908e903090602001614613565b60405160208183030381529060405290507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316634000aea07f000000000000000000000000000000000000000000000000000000000000000087600060149054906101000a900460e01b856040516020016109f39291906146a9565b6040516020818303038152906040526040518463ffffffff1660e01b8152600401610a20939291906146da565b6020604051808303816000875af1158015610a3f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a639190614716565b507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316631865c57d6040518163ffffffff1660e01b8152600401600060405180830381865afa158015610ac2573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610aea919081019061447b565b5050805190935063ffffffff16610b0283600161474e565b8103610b82576000610b15600143614761565b60408051914060208301526bffffffffffffffffffffffff197f000000000000000000000000000000000000000000000000000000000000000060601b16908201526001600160e01b031960e086901b16605482015260580160408051601f198184030190525250610bc7565b60405162461bcd60e51b8152602060048201526015602482015274185d5d1bcb585c1c1c9bdd9948191a5cd8589b1959605a1b60448201526064015b60405180910390fd5b5050505050505050505050505050565b600a818154811061089757600080fd5b336000908152600c602052604090205460ff1615610c185760405163773aeddd60e11b815260040160405180910390fd5b6000610c2360015490565b336000908152600f602052604090205490915060ff166001816004811115610c4d57610c4d6139e4565b1480610c6a57506002816004811115610c6857610c686139e4565b145b15610cc35760405163157a0b0f60e31b815260206004820152602260248201527f436f6d6d756e6974793a20616c7265616479206170706c6965642f70656e64696044820152616e6760f01b6064820152608401610bbe565b6611c37937e08000341015610ceb5760405163cd1c886760e01b815260040160405180910390fd5b506040805160806020601f86018190040282018101909252606081018481526001926000929182918890889081908501838280828437600092019190915250505090825250336020820152604001836004811115610d4b57610d4b6139e4565b9052336000908152600560209081526040808320879055600f90915290208054919250839160ff19166001836004811115610d8857610d886139e4565b021790555033600090815260106020526040902081518291908190610dad90826147f9565b5060208201516001820180546001600160a01b039092166001600160a01b03198316811782556040850151926001600160a81b03191617600160a01b836004811115610dfb57610dfb6139e4565b021790555050600a805460018181019092557fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a80180546001600160a01b03191633179055601180549182018155600052825183925060029091027f31ecc21a745e3968a04e9570e4425bc18fa8019c68028196b546d1669c200c6801908190610e8490826147f9565b5060208201516001820180546001600160a01b039092166001600160a01b03198316811782556040850151926001600160a81b03191617600160a01b836004811115610ed257610ed26139e4565b0217905550506040516001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001691503480156108fc02916000818181858888f19350505050158015610f2e573d6000803e3d6000fd5b507f61d9c1c60d18166430e232b0032dc6dca6b6f8ecb9fae9972cd57989dd88020f338686604051610f62939291906148b8565b60405180910390a15050505050565b60128181548110610f8157600080fd5b9060005260206000209060030201600091509050806000018054610fa490614774565b80601f0160208091040260200160405190810160405280929190818152602001828054610fd090614774565b801561101d5780601f10610ff25761010080835404028352916020019161101d565b820191906000526020600020905b81548152906001019060200180831161100057829003601f168201915b50505050509080600101805461103290614774565b80601f016020809104026020016040519081016040528092919081815260200182805461105e90614774565b80156110ab5780601f10611080576101008083540402835291602001916110ab565b820191906000526020600020905b81548152906001019060200180831161108e57829003601f168201915b505050600290930154919250506001600160a01b031683565b60006110d2828401846148dd565b905060005b81518161ffff161015611139576000828261ffff16815181106110fc576110fc6149f8565b6020026020010151905060008160000151905081606001514211156111245761112481613078565b5050808061113190614a0e565b9150506110d7565b50505050565b611147613537565b336000908152600c602052604090205460ff166111795760405163349b3f2f60e21b8152336004820152602401610bbe565b336000818152600e602090815260408083208151608081018352888152808401959095529084018690526060840185905260068101805460018101825590845291909220835192939283926004029091019081906111d790826147f9565b5060208201516001820180546001600160a01b0319166001600160a01b039092169190911790556040820151600282019061121290826147f9565b506060820151600382019061122790826147f9565b505060168054600181018255600091909152825183925060049091027fd833147d7dc355ba459fc788f669e58cfaf9dc25ddcd0702e87d69c7b51242890190819061127290826147f9565b5060208201516001820180546001600160a01b0319166001600160a01b03909216919091179055604082015160028201906112ad90826147f9565b50606082015160038201906112c290826147f9565b5050505050505050565b600060606000806014805490506001600160401b038111156112f0576112f0613a3b565b60405190808252806020026020018201604052801561134c57816020015b6113396040805160808101825260008082526060602083015290918201908152602001600081525090565b81526020019060019003908161130e5790505b50905060005b60145461ffff821610156114c057600060148261ffff1681548110611379576113796149f8565b6000918252602091829020604080516080810190915260049092020180546001600160a01b0316825260018101805492939192918401916113b990614774565b80601f01602080910402602001604051908101604052809291908181526020018280546113e590614774565b80156114325780601f1061140757610100808354040283529160200191611432565b820191906000526020600020905b81548152906001019060200180831161141557829003601f168201915b505050918352505060028281015460209092019160ff1690811115611459576114596139e4565b600281111561146a5761146a6139e4565b8152602001600382015481525050905080606001514211156114ad5780838361ffff168151811061149d5761149d6149f8565b6020026020010181905250600193505b50806114b881614a0e565b915050611352565b50819350806040516020016114d59190613e44565b604051602081830303815290604052925050509250929050565b336000908152600b602052604090205460ff16156115225760405163bfadfc2760e01b8152336004820152602401610bbe565b336000818152600d60205260409020600301544281111561155657604051631da7447960e21b815260040160405180910390fd5b336000908152600d6020908152604080832081516080810190925280546001600160a01b03168252600181018054929391929184019161159590614774565b80601f01602080910402602001604051908101604052809291908181526020018280546115c190614774565b801561160e5780601f106115e35761010080835404028352916020019161160e565b820191906000526020600020905b8154815290600101906020018083116115f157829003601f168201915b505050918352505060028281015460209092019160ff1690811115611635576116356139e4565b6002811115611646576116466139e4565b815260039190910154602090910152905060028160400151600281111561166f5761166f6139e4565b1461168d57604051631294a20560e01b815260040160405180910390fd5b60016040828101829052336000908152600d6020908152919020835181546001600160a01b0319166001600160a01b039091161781559083015183928201906116d690826147f9565b5060408201518160020160006101000a81548160ff02191690836002811115611701576117016139e4565b021790555060608201518160030155905050505050565b336000908152600c602052604090205460ff1661174a5760405163349b3f2f60e21b8152336004820152602401610bbe565b336000818152600f602052604090205460ff166001816004811115611771576117716139e4565b1461178f5760405163b824136960e01b815260040160405180910390fd5b336000908152600c602052604090205460ff16156117c05760405163773aeddd60e11b815260040160405180910390fd5b336000818152600f602052604081205460ff16916117dd90613591565b9050600a81815481106117f2576117f26149f8565b6000918252602080832090910180546001600160a01b031916905533825260109052604081209061182382826136af565b50600190810180546001600160a81b0319169055336000908152600f60205260409020805460049450849260ff1990911690835b021790555050505050565b61186a613537565b61187460006135ff565b565b60606014805480602002602001604051908101604052809291908181526020016000905b828210156119b157600084815260209081902060408051608081019091526004850290910180546001600160a01b0316825260018101805492939192918401916118e390614774565b80601f016020809104026020016040519081016040528092919081815260200182805461190f90614774565b801561195c5780601f106119315761010080835404028352916020019161195c565b820191906000526020600020905b81548152906001019060200180831161193f57829003601f168201915b505050918352505060028281015460209092019160ff1690811115611983576119836139e4565b6002811115611994576119946139e4565b81526020016003820154815250508152602001906001019061189a565b50505050905090565b6119c2613537565b600480546001600160a01b039384166001600160a01b03199182161790915560038054929093169116179055565b60118181548110611a0057600080fd5b9060005260206000209060020201600091509050806000018054611a2390614774565b80601f0160208091040260200160405190810160405280929190818152602001828054611a4f90614774565b8015611a9c5780601f10611a7157610100808354040283529160200191611a9c565b820191906000526020600020905b815481529060010190602001808311611a7f57829003601f168201915b505050600190930154919250506001600160a01b0381169060ff600160a01b9091041683565b6009818154811061089757600080fd5b600e60205260009081526040902080548190611aed90614774565b80601f0160208091040260200160405190810160405280929190818152602001828054611b1990614774565b8015611b665780601f10611b3b57610100808354040283529160200191611b66565b820191906000526020600020905b815481529060010190602001808311611b4957829003601f168201915b5050506002840154604080518082019091526004860180546001600160a01b03908116835260058801805497989190941696909550919350916020840191611bad90614774565b80601f0160208091040260200160405190810160405280929190818152602001828054611bd990614774565b8015611c265780601f10611bfb57610100808354040283529160200191611c26565b820191906000526020600020905b815481529060010190602001808311611c0957829003601f168201915b505050505081525050905083565b60158181548110611c4457600080fd5b9060005260206000209060070201600091509050806000018054611aed90614774565b336000908152600c602052604090205460ff16611c995760405163349b3f2f60e21b8152336004820152602401610bbe565b336000818152600e6020908152604080832081516060810183528781528084018790529182019490945260038085018054600181018255908552929093208151919384930201908190611cec90826147f9565b5060208201516001820190611d0190826147f9565b5060409190910151600290910180546001600160a01b0319166001600160a01b0390921691909117905550505050565b60148181548110611d4157600080fd5b6000918252602090912060049091020180546001820180546001600160a01b03909216935090611d7090614774565b80601f0160208091040260200160405190810160405280929190818152602001828054611d9c90614774565b8015611de95780601f10611dbe57610100808354040283529160200191611de9565b820191906000526020600020905b815481529060010190602001808311611dcc57829003601f168201915b505050506002830154600390930154919260ff1691905084565b611e0b613537565b6001600160a01b0381166000908152600f6020526040902054819060ff166001816004811115611e3d57611e3d6139e4565b14611e5b5760405163b824136960e01b815260040160405180910390fd5b6001600160a01b0383166000908152600c602052604090205460ff1615611e955760405163773aeddd60e11b815260040160405180910390fd5b6001600160a01b0383166000908152600f602052604090208054600391829160ff1916600183611857565b336000908152600b602052604090205460ff1615611ef15760405163a929afd160e01b815260040160405180910390fd5b662386f26fc10000341015611f195760405163cd1c886760e01b815260040160405180910390fd5b6000611f2460025490565b336000908152600b60209081526040808320805460ff19166001908117909155600d835281842082516080810190935280546001600160a01b031683529081018054959650939491939092840191611f7b90614774565b80601f0160208091040260200160405190810160405280929190818152602001828054611fa790614774565b8015611ff45780601f10611fc957610100808354040283529160200191611ff4565b820191906000526020600020905b815481529060010190602001808311611fd757829003601f168201915b505050918352505060028281015460209092019160ff169081111561201b5761201b6139e4565b600281111561202c5761202c6139e4565b81526003919091015460209182015233825281018590526001604082015260075490915061205a904261474e565b6060820152336000908152600d60209081526040909120825181546001600160a01b0319166001600160a01b039091161781559082015182919060018201906120a390826147f9565b5060408201518160020160006101000a81548160ff021916908360028111156120ce576120ce6139e4565b021790555060609190910151600390910155336000908152600660209081526040822084905560148054600181018255925282517fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ec600490930292830180546001600160a01b0319166001600160a01b039092169190911781559083015183927fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ed019061217b90826147f9565b5060408201518160020160006101000a81548160ff021916908360028111156121a6576121a66139e4565b021790555060609190910151600390910155600880546001810182556000919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30180546001600160a01b031916339081179091556004805460405163d0def52160e01b81526001600160a01b03919091169263d0def5219261222d92889101614a2f565b600060405180830381600087803b15801561224757600080fd5b505af115801561225b573d6000803e3d6000fd5b50506040516001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001692503480156108fc029250906000818181858888f193505050501580156122b5573d6000803e3d6000fd5b507f8772c8819e99ebb9f69fe72d9a60c78de13a367140e9360b1a4f2fbe59d7204b33856040516122e7929190614a2f565b60405180910390a150505050565b6016818154811061230557600080fd5b906000526020600020906004020160009150905080600001805461232890614774565b80601f016020809104026020016040519081016040528092919081815260200182805461235490614774565b80156123a15780601f10612376576101008083540402835291602001916123a1565b820191906000526020600020905b81548152906001019060200180831161238457829003601f168201915b505050600184015460028501805494956001600160a01b039092169491935091506123cb90614774565b80601f01602080910402602001604051908101604052809291908181526020018280546123f790614774565b80156124445780601f1061241957610100808354040283529160200191612444565b820191906000526020600020905b81548152906001019060200180831161242757829003601f168201915b50505050509080600301805461245990614774565b80601f016020809104026020016040519081016040528092919081815260200182805461248590614774565b80156124d25780601f106124a7576101008083540402835291602001916124d2565b820191906000526020600020905b8154815290600101906020018083116124b557829003601f168201915b5050505050905084565b6124e4613537565b6001600160a01b0382166000908152600f6020526040902054829060ff166001816004811115612516576125166139e4565b146125345760405163b824136960e01b815260040160405180910390fd5b6001600160a01b0384166000908152600c602052604090205460ff161561256e5760405163773aeddd60e11b815260040160405180910390fd5b6001600160a01b0384166000908152600f602090815260408083208054600260ff199182168117909255600c84528285208054909116600117905560109092528083208151606081019092528054929392829082906125cc90614774565b80601f01602080910402602001604051908101604052809291908181526020018280546125f890614774565b80156126455780601f1061261a57610100808354040283529160200191612645565b820191906000526020600020905b81548152906001019060200180831161262857829003601f168201915b505050918352505060018201546001600160a01b0381166020830152604090910190600160a01b900460ff166004811115612682576126826139e4565b6004811115612693576126936139e4565b9052506001600160a01b038781166000908152600e60209081526040909120908301516002820180546001600160a01b031916919093161790915581519192509081906126e090826147f9565b506015805460018101825560009190915281906007027f55f448fdea98c4d29eb340757ef0a66cd03dbb9538908a6a81d96026b71ec47501806127238382614a53565b506001828101805461273892840191906136e9565b5060028281015490820180546001600160a01b0319166001600160a01b03909216919091179055600380830180546127739284019190613782565b506004828101805491830180546001600160a01b0319166001600160a01b03909316929092178255906005808401906127ae90860182614a53565b505050600682810180546127c59284019190613817565b5050600980546001810182556000919091527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af0180546001600160a01b0319166001600160a01b038a81169190911790915560035460405163d0def52160e01b81529116915063d0def521906128419033908a90600401614a2f565b600060405180830381600087803b15801561285b57600080fd5b505af115801561286f573d6000803e3d6000fd5b50506040516001600160a01b038a1681527f6ca6150407f26e90367ff690c8b617cad626020aa12080384e3b31479c0442fb9250602001905060405180910390a150505050505050565b336000908152600c602052604090205460ff166128eb5760405163349b3f2f60e21b8152336004820152602401610bbe565b336000818152600e602090815260409182902082518084019093528383529082018490526004810180546001600160a01b03191690931783559181906005840161293586826147f9565b505050505050565b60138181548110610f8157600080fd5b60606015805480602002602001604051908101604052809291908181526020016000905b828210156119b157838290600052602060002090600702016040518060c00160405290816000820180546129a490614774565b80601f01602080910402602001604051908101604052809291908181526020018280546129d090614774565b8015612a1d5780601f106129f257610100808354040283529160200191612a1d565b820191906000526020600020905b815481529060010190602001808311612a0057829003601f168201915b5050505050815260200160018201805480602002602001604051908101604052809291908181526020016000905b82821015612bb75783829060005260206000209060030201604051806060016040529081600082018054612a7e90614774565b80601f0160208091040260200160405190810160405280929190818152602001828054612aaa90614774565b8015612af75780601f10612acc57610100808354040283529160200191612af7565b820191906000526020600020905b815481529060010190602001808311612ada57829003601f168201915b50505050508152602001600182018054612b1090614774565b80601f0160208091040260200160405190810160405280929190818152602001828054612b3c90614774565b8015612b895780601f10612b5e57610100808354040283529160200191612b89565b820191906000526020600020905b815481529060010190602001808311612b6c57829003601f168201915b5050509183525050600291909101546001600160a01b03166020918201529082526001929092019101612a4b565b5050509082525060028201546001600160a01b0316602080830191909152600383018054604080518285028101850182528281529401939260009084015b82821015612d615783829060005260206000209060030201604051806060016040529081600082018054612c2890614774565b80601f0160208091040260200160405190810160405280929190818152602001828054612c5490614774565b8015612ca15780601f10612c7657610100808354040283529160200191612ca1565b820191906000526020600020905b815481529060010190602001808311612c8457829003601f168201915b50505050508152602001600182018054612cba90614774565b80601f0160208091040260200160405190810160405280929190818152602001828054612ce690614774565b8015612d335780601f10612d0857610100808354040283529160200191612d33565b820191906000526020600020905b815481529060010190602001808311612d1657829003601f168201915b5050509183525050600291909101546001600160a01b03166020918201529082526001929092019101612bf5565b50505090825250604080518082019091526004830180546001600160a01b0316825260058401805460209485019484019190612d9c90614774565b80601f0160208091040260200160405190810160405280929190818152602001828054612dc890614774565b8015612e155780601f10612dea57610100808354040283529160200191612e15565b820191906000526020600020905b815481529060010190602001808311612df857829003601f168201915b505050505081525050815260200160068201805480602002602001604051908101604052809291908181526020016000905b828210156130465783829060005260206000209060040201604051806080016040529081600082018054612e7a90614774565b80601f0160208091040260200160405190810160405280929190818152602001828054612ea690614774565b8015612ef35780601f10612ec857610100808354040283529160200191612ef3565b820191906000526020600020905b815481529060010190602001808311612ed657829003601f168201915b505050918352505060018201546001600160a01b03166020820152600282018054604090920191612f2390614774565b80601f0160208091040260200160405190810160405280929190818152602001828054612f4f90614774565b8015612f9c5780601f10612f7157610100808354040283529160200191612f9c565b820191906000526020600020905b815481529060010190602001808311612f7f57829003601f168201915b50505050508152602001600382018054612fb590614774565b80601f0160208091040260200160405190810160405280929190818152602001828054612fe190614774565b801561302e5780601f106130035761010080835404028352916020019161302e565b820191906000526020600020905b81548152906001019060200180831161301157829003601f168201915b50505050508152505081526020019060010190612e47565b505050508152505081526020019060010190612971565b601060205260009081526040902080548190611a2390614774565b6001600160a01b0381166000908152600d60205260409020600301548190428111156130b757604051631da7447960e21b815260040160405180910390fd5b6001600160a01b0383166000908152600b602052604090205460ff166130fb5760405163bfadfc2760e01b81526001600160a01b0384166004820152602401610bbe565b6001600160a01b038084166000908152600d602090815260408083208151608081019092528054909416815260018401805493949193919284019161313f90614774565b80601f016020809104026020016040519081016040528092919081815260200182805461316b90614774565b80156131b85780601f1061318d576101008083540402835291602001916131b8565b820191906000526020600020905b81548152906001019060200180831161319b57829003601f168201915b505050918352505060028281015460209092019160ff16908111156131df576131df6139e4565b60028111156131f0576131f06139e4565b81526020016003820154815250509050806060015142111561321b5760026040820152600060608201525b6001600160a01b038481166000908152600d60209081526040909120835181546001600160a01b0319169316929092178255820151829190600182019061326290826147f9565b5060408201518160020160006101000a81548160ff0219169083600281111561328d5761328d6139e4565b02179055506060820151816003015590505060006132aa8561364f565b905081601482815481106132c0576132c06149f8565b600091825260209182902083516004929092020180546001600160a01b0319166001600160a01b0390921691909117815590820151600182019061330490826147f9565b5060408201518160020160006101000a81548160ff0219169083600281111561332f5761332f6139e4565b021790555060609190910151600390910155600480548351604051639c85cd6b60e01b81526001600160a01b0391821693810193909352600092911690639c85cd6b90602401602060405180830381865afa158015613392573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133b69190614b2d565b600480548551604051632770a7eb60e21b81529394506001600160a01b0390911692639dc29fac926133ff92918691016001600160a01b03929092168252602082015260400190565b600060405180830381600087803b15801561341957600080fd5b505af115801561342d573d6000803e3d6000fd5b50505050505050505050565b336000908152600c602052604090205460ff1661346b5760405163349b3f2f60e21b8152336004820152602401610bbe565b336000818152600e6020908152604080832081516060810183528781528084018790529182019490945260018085018054918201815584529190922082518392600302909101908190611cec90826147f9565b6134c6613537565b6001600160a01b03811661352b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610bbe565b613534816135ff565b50565b6000546001600160a01b031633146118745760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610bbe565b6001600160a01b0381166000908152600f6020526040812054829060ff1660018160048111156135c3576135c36139e4565b146135e15760405163b824136960e01b815260040160405180910390fd5b5050506001600160a01b031660009081526005602052604090205490565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0381166000908152600b602052604081205460ff166136935760405163bfadfc2760e01b81526001600160a01b0383166004820152602401610bbe565b506001600160a01b031660009081526006602052604090205490565b5080546136bb90614774565b6000825580601f106136cb575050565b601f01602090049060005260206000209081019061353491906138c1565b8280548282559060005260206000209060030281019282156137725760005260206000209160030282015b82811115613772578282806137298382614a53565b5060018181019061373c90840182614a53565b50600291820154910180546001600160a01b0319166001600160a01b039092169190911790556003928301929190910190613714565b5061377e9291506138d6565b5090565b82805482825590600052602060002090600302810192821561380b5760005260206000209160030282015b8281111561380b578282806137c28382614a53565b506001818101906137d590840182614a53565b50600291820154910180546001600160a01b0319166001600160a01b0390921691909117905560039283019291909101906137ad565b5061377e929150613913565b8280548282559060005260206000209060040281019282156138b55760005260206000209160040282015b828111156138b5578282806138578382614a53565b5060018281015490820180546001600160a01b0319166001600160a01b0390921691909117905560028082019061389090840182614a53565b506003818101906138a390840182614a53565b50505091600401919060040190613842565b5061377e929150613950565b5b8082111561377e57600081556001016138c2565b8082111561377e5760006138ea82826136af565b6138f86001830160006136af565b506002810180546001600160a01b03191690556003016138d6565b8082111561377e57600061392782826136af565b6139356001830160006136af565b506002810180546001600160a01b0319169055600301613913565b8082111561377e57600061396482826136af565b6001820180546001600160a01b03191690556139846002830160006136af565b6139926003830160006136af565b50600401613950565b6001600160a01b038116811461353457600080fd5b80356139bb8161399b565b919050565b6000602082840312156139d257600080fd5b81356139dd8161399b565b9392505050565b634e487b7160e01b600052602160045260246000fd5b60058110613a0a57613a0a6139e4565b9052565b60208101613a1c82846139fa565b92915050565b600060208284031215613a3457600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b60405161018081016001600160401b0381118282101715613a7457613a74613a3b565b60405290565b604051608081016001600160401b0381118282101715613a7457613a74613a3b565b604051601f8201601f191681016001600160401b0381118282101715613ac457613ac4613a3b565b604052919050565b600082601f830112613add57600080fd5b81356001600160401b03811115613af657613af6613a3b565b613b09601f8201601f1916602001613a9c565b818152846020838601011115613b1e57600080fd5b816020850160208301376000918101602001919091529392505050565b60008083601f840112613b4d57600080fd5b5081356001600160401b03811115613b6457600080fd5b602083019150836020828501011115613b7c57600080fd5b9250929050565b63ffffffff8116811461353457600080fd5b80356139bb81613b83565b6001600160601b038116811461353457600080fd5b80356139bb81613ba0565b803560ff811681146139bb57600080fd5b6000806000806000806000806000806101008b8d031215613bf157600080fd5b8a356001600160401b0380821115613c0857600080fd5b613c148e838f01613acc565b9b5060208d0135915080821115613c2a57600080fd5b613c368e838f01613b3b565b909b509950899150613c4a60408e016139b0565b9850613c5860608e01613b95565b9750613c6660808e016139b0565b965060a08d0135915080821115613c7c57600080fd5b50613c898d828e01613b3b565b9095509350613c9c905060c08c01613bb5565b9150613caa60e08c01613bc0565b90509295989b9194979a5092959850565b60008060208385031215613cce57600080fd5b82356001600160401b03811115613ce457600080fd5b613cf085828601613b3b565b90969095509350505050565b60005b83811015613d17578181015183820152602001613cff565b50506000910152565b60008151808452613d38816020860160208601613cfc565b601f01601f19169290920160200192915050565b606081526000613d5f6060830186613d20565b8281036020840152613d718186613d20565b91505060018060a01b0383166040830152949350505050565b600080600060608486031215613d9f57600080fd5b83356001600160401b0380821115613db657600080fd5b613dc287838801613acc565b94506020860135915080821115613dd857600080fd5b613de487838801613acc565b93506040860135915080821115613dfa57600080fd5b50613e0786828701613acc565b9150509250925092565b8215158152604060208201526000613e2c6040830184613d20565b949350505050565b60038110613a0a57613a0a6139e4565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b83811015613ed657888303603f19018552815180516001600160a01b0316845287810151608089860181905290613ea482870182613d20565b91505087820151613eb789870182613e34565b5060609182015194909101939093529386019390860190600101613e6b565b509098975050505050505050565b60008060408385031215613ef757600080fd5b8235613f028161399b565b91506020830135613f128161399b565b809150509250929050565b606081526000613f306060830186613d20565b6001600160a01b03851660208401529050613e2c60408301846139fa565b60018060a01b0381511682526000602082015160406020850152613e2c6040850182613d20565b606081526000613f886060830186613d20565b6001600160a01b03851660208401528281036040840152613fa98185613f4e565b9695505050505050565b60008060408385031215613fc657600080fd5b82356001600160401b0380821115613fdd57600080fd5b613fe986838701613acc565b93506020850135915080821115613fff57600080fd5b5061400c85828601613acc565b9150509250929050565b6001600160a01b038516815260806020820181905260009061403a90830186613d20565b90506140496040830185613e34565b82606083015295945050505050565b60808152600061406b6080830187613d20565b6001600160a01b0386166020840152828103604084015261408c8186613d20565b905082810360608401526140a08185613d20565b979650505050505050565b600080604083850312156140be57600080fd5b82356140c98161399b565b915060208301356001600160401b038111156140e457600080fd5b61400c85828601613acc565b60006020828403121561410257600080fd5b81356001600160401b0381111561411857600080fd5b613e2c84828501613acc565b60008151606084526141396060850182613d20565b9050602083015184820360208601526141528282613d20565b6040948501516001600160a01b03169590940194909452509092915050565b600081518084526020808501808196508360051b8101915082860160005b858110156141b95782840389526141a7848351614124565b9885019893509084019060010161418f565b5091979650505050505050565b600081518084526020808501808196508360051b8101915082860160005b858110156141b957828403895281516080815181875261420682880182613d20565b838901516001600160a01b0316888a0152604080850151898303828b015291935091506142338382613d20565b92505050606080830151925086820381880152506142518183613d20565b9a87019a95505050908401906001016141e4565b602080825282518282018190526000919060409081850190600581811b8701840188860187805b8581101561438e57603f198b8503018752825160c081518187526142b282880182613d20565b838d0151888203898f015280518083529193508d0191508c830190808a1b84018e01875b8281101561430957601f198683030184526142f2828651614124565b91508f850194508f840193506001810190506142d6565b508d86015194506143248e8b01866001600160a01b03169052565b60609450848601519350898103858b015261433f8185614171565b9450505050506080808301518783038289015261435c8382613f4e565b9250505060a0808301519250868203818801525061437a81836141c6565b988b0198955050509188019160010161428c565b50919a9950505050505050505050565b80516139bb81613b83565b80516139bb81613ba0565b805162ffffff811681146139bb57600080fd5b805161ffff811681146139bb57600080fd5b80516139bb8161399b565b60006001600160401b038211156143fd576143fd613a3b565b5060051b60200190565b600082601f83011261441857600080fd5b8151602061442d614428836143e4565b613a9c565b82815260059290921b8401810191818101908684111561444c57600080fd5b8286015b848110156144705780516144638161399b565b8352918301918301614450565b509695505050505050565b600080600083850361022081121561449257600080fd5b60808112156144a057600080fd5b6144a8613a7a565b85516144b381613b83565b815260208601516144c381613ba0565b602082015260408681015190820152606080870151908201529350610180607f1982018113156144f257600080fd5b6144fa613a51565b91506145086080870161439e565b825261451660a0870161439e565b602083015261452760c087016143b4565b604083015261453860e0870161439e565b606083015261010061454b8188016143b4565b608084015261012061455e8189016143c7565b60a0850152610140614571818a016143a9565b60c0860152610160614584818b0161439e565b60e0870152848a0151848701526101a08a0151838701526145a86101c08b016143d9565b828701526145b96101e08b016143d9565b90860152505050506102008501519092506001600160401b038111156145de57600080fd5b613e0786828701614407565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60006101208083526146278184018f613d20565b9050828103602084015261463c818d8f6145ea565b6001600160a01b038c8116604086015263ffffffff8c1660608601528a8116608086015284820360a086015290915061467682898b6145ea565b6001600160601b039790971660c085015260ff9590951660e0840152505091166101009091015298975050505050505050565b6001600160e01b03198316815281516000906146cc816004850160208701613cfc565b919091016004019392505050565b6001600160a01b03841681526001600160601b038316602082015260606040820181905260009061470d90830184613d20565b95945050505050565b60006020828403121561472857600080fd5b815180151581146139dd57600080fd5b634e487b7160e01b600052601160045260246000fd5b80820180821115613a1c57613a1c614738565b81810381811115613a1c57613a1c614738565b600181811c9082168061478857607f821691505b6020821081036147a857634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156147f457600081815260208120601f850160051c810160208610156147d55750805b601f850160051c820191505b81811015612935578281556001016147e1565b505050565b81516001600160401b0381111561481257614812613a3b565b614826816148208454614774565b846147ae565b602080601f83116001811461485b57600084156148435750858301515b600019600386901b1c1916600185901b178555612935565b600085815260208120601f198616915b8281101561488a5788860151825594840194600190910190840161486b565b50858210156148a85787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6001600160a01b038416815260406020820181905260009061470d90830184866145ea565b600060208083850312156148f057600080fd5b82356001600160401b038082111561490757600080fd5b818501915085601f83011261491b57600080fd5b8135614929614428826143e4565b81815260059190911b8301840190848101908883111561494857600080fd5b8585015b838110156149eb578035858111156149645760008081fd5b86016080818c03601f190181131561497c5760008081fd5b614984613a7a565b898301356149918161399b565b8152604083810135898111156149a75760008081fd5b6149b58f8d83880101613acc565b8c84015250606080850135600381106149ce5760008081fd5b91830191909152919092013590820152835291860191860161494c565b5098975050505050505050565b634e487b7160e01b600052603260045260246000fd5b600061ffff808316818103614a2557614a25614738565b6001019392505050565b6001600160a01b0383168152604060208201819052600090613e2c90830184613d20565b818103614a5e575050565b614a688254614774565b6001600160401b03811115614a7f57614a7f613a3b565b614a8d816148208454614774565b6000601f821160018114614ac15760008315614aa95750848201545b600019600385901b1c1916600184901b178455614b26565b600085815260209020601f19841690600086815260209020845b83811015614afb5782860154825560019586019590910190602001614adb565b5085831015614b195781850154600019600388901b60f8161c191681555b50505060018360011b0184555b5050505050565b600060208284031215614b3f57600080fd5b505191905056fea2646970667358221220622ae0bfb84927b356b40e207183f6f64ec09a965120e58e0497840e84cf01fd64736f6c63430008110033", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/abis/NutritionistNFT.json b/abis/NutritionistNFT.json new file mode 100644 index 0000000..5bbdd30 --- /dev/null +++ b/abis/NutritionistNFT.json @@ -0,0 +1,472 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "NutritionistNFT", + "sourceName": "contracts/NutritionistNFT.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "address", + "name": "_owner", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "SBT_ApprovalNotSupported", + "type": "error" + }, + { + "inputs": [], + "name": "SBT__TransferNotSupported", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "approved", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "ApprovalForAll", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "member", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "BurnNutritionistNFT", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "nutritionist", + "type": "address" + } + ], + "name": "MintNutritionistNFT", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "nutritionist", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_tokenId", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "getApproved", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "getTokenIdOfOwner", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isApprovedForAll", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "nutritionist", + "type": "address" + }, + { + "internalType": "string", + "name": "uri", + "type": "string" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "ownerOf", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "safeTransferFrom", + "outputs": [], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "safeTransferFrom", + "outputs": [], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "name": "setApprovalForAll", + "outputs": [], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "tokenURI", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [], + "stateMutability": "pure", + "type": "function" + } + ], + "bytecode": "0x60806040523480156200001157600080fd5b506040516200161e3803806200161e833981016040819052620000349162000145565b8282600162000044838262000261565b50600262000053828262000261565b5050600880546001600160a01b0319166001600160a01b039390931692909217909155506200032d915050565b634e487b7160e01b600052604160045260246000fd5b600082601f830112620000a857600080fd5b81516001600160401b0380821115620000c557620000c562000080565b604051601f8301601f19908116603f01168101908282118183101715620000f057620000f062000080565b816040528381526020925086838588010111156200010d57600080fd5b600091505b8382101562000131578582018301518183018401529082019062000112565b600093810190920192909252949350505050565b6000806000606084860312156200015b57600080fd5b83516001600160401b03808211156200017357600080fd5b620001818783880162000096565b945060208601519150808211156200019857600080fd5b50620001a78682870162000096565b604086015190935090506001600160a01b0381168114620001c757600080fd5b809150509250925092565b600181811c90821680620001e757607f821691505b6020821081036200020857634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200025c57600081815260208120601f850160051c81016020861015620002375750805b601f850160051c820191505b81811015620002585782815560010162000243565b5050505b505050565b81516001600160401b038111156200027d576200027d62000080565b62000295816200028e8454620001d2565b846200020e565b602080601f831160018114620002cd5760008415620002b45750858301515b600019600386901b1c1916600185901b17855562000258565b600085815260208120601f198616915b82811015620002fe57888601518255948401946001909101908401620002dd565b50858210156200031d5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6112e1806200033d6000396000f3fe608060405234801561001057600080fd5b506004361061010b5760003560e01c80638da5cb5b116100a2578063a22cb46511610071578063a22cb4651461022c578063b88d4fde1461023a578063c87b56dd14610248578063d0def5211461025b578063e985e9c51461026e57600080fd5b80638da5cb5b146101d557806395d89b41146101e85780639c85cd6b146101f05780639dc29fac1461021957600080fd5b806323b872dd116100de57806323b872dd1461018e57806342842e0e1461018e5780636352211e146101a157806370a08231146101b457600080fd5b806301ffc9a71461011057806306fdde0314610138578063081812fc1461014d578063095ea7b314610179575b600080fd5b61012361011e366004610da8565b610284565b60405190151581526020015b60405180910390f35b6101406102bb565b60405161012f9190610df6565b61016161015b366004610e29565b50600090565b6040516001600160a01b03909116815260200161012f565b61018c610187366004610e5e565b61034d565b005b61018c61019c366004610e88565b610366565b6101616101af366004610e29565b61037f565b6101c76101c2366004610ec4565b6103e4565b60405190815260200161012f565b600854610161906001600160a01b031681565b61014061046a565b6101c76101fe366004610ec4565b6001600160a01b031660009081526005602052604090205490565b61018c610227366004610e5e565b610479565b61018c610187366004610edf565b61018c61019c366004610f1b565b610140610256366004610e29565b61054d565b61018c610269366004610fcc565b61065d565b61012361027c36600461108e565b600092915050565b60006001600160e01b031982166380ac58cd60e01b14806102b557506301ffc9a760e01b6001600160e01b03198316145b92915050565b6060600180546102ca906110c1565b80601f01602080910402602001604051908101604052809291908181526020018280546102f6906110c1565b80156103435780601f1061031857610100808354040283529160200191610343565b820191906000526020600020905b81548152906001019060200180831161032657829003601f168201915b5050505050905090565b604051631e507fd160e31b815260040160405180910390fd5b6040516335b3f76960e21b815260040160405180910390fd5b6000818152600360205260408120546001600160a01b0316806102b55760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064015b60405180910390fd5b60006001600160a01b03821661044e5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b60648201526084016103db565b506001600160a01b031660009081526004602052604090205490565b6060600280546102ca906110c1565b6008546001600160a01b031633146104c65760405162461bcd60e51b815260206004820152601060248201526f31b0b63632b9103737ba1037bbb732b960811b60448201526064016103db565b6104d08282610719565b600081815260066020526040902080546104e9906110c1565b15905061050757600081815260066020526040812061050791610d5a565b604080516001600160a01b0384168152602081018390527f2a4ffdf34772175e4a9b997092588ad7054bb1648da71f0cc58a9003378994a3910160405180910390a15050565b6060610558826108a5565b60008281526006602052604081208054610571906110c1565b80601f016020809104026020016040519081016040528092919081815260200182805461059d906110c1565b80156105ea5780601f106105bf576101008083540402835291602001916105ea565b820191906000526020600020905b8154815290600101906020018083116105cd57829003601f168201915b50505050509050600061060860408051602081019091526000815290565b9050805160000361061a575092915050565b81511561064c5780826040516020016106349291906110fb565b60405160208183030381529060405292505050919050565b610655846108f8565b949350505050565b6008546001600160a01b031633146106aa5760405162461bcd60e51b815260206004820152601060248201526f31b0b63632b9103737ba1037bbb732b960811b60448201526064016103db565b6106b38261096c565b6106c1600780546001019055565b60006106cc60075490565b90506106d881836109a5565b6040516001600160a01b03841681527f0ab9796d16d678cf5c93deba248913fea3b0e77e28d787314744147043d416669060200160405180910390a1505050565b6001600160a01b03821661077d5760405162461bcd60e51b815260206004820152602560248201527f4552433732313a2066726f6d2063616e6e6f742062652061207a65726f206164604482015264647265737360d81b60648201526084016103db565b61078681610a2e565b6107de5760405162461bcd60e51b815260206004820152602360248201527f4552433732313a20746f6b656e206964206e6565647320746f206265206d696e6044820152621d195960ea1b60648201526084016103db565b6107ec826000836001610a4b565b6107f581610a2e565b6108115760405162461bcd60e51b81526004016103db9061112a565b6001600160a01b038216600081815260046020908152604080832080546000190190558483526003825280832080546001600160a01b031916905582805260059091527f05b8ccbb9d4d8fb16ea74ce3c29a41f1b461fbdaff4714a0d9a8eb05499746bc849055518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6108ae81610a2e565b6108f55760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016103db565b50565b6060610903826108a5565b600061091a60408051602081019091526000815290565b9050600081511161093a5760405180602001604052806000815250610965565b8061094484610ad4565b6040516020016109559291906110fb565b6040516020818303038152906040525b9392505050565b61097a600080546001019055565b600080546001600160a01b0383168252600560205260409091208190556109a18282610b67565b5050565b6109ae82610a2e565b610a115760405162461bcd60e51b815260206004820152602e60248201527f45524337323155524953746f726167653a2055524920736574206f66206e6f6e60448201526d32bc34b9ba32b73a103a37b5b2b760911b60648201526084016103db565b6000828152600660205260409020610a2982826111af565b505050565b6000908152600360205260409020546001600160a01b0316151590565b6001811115610ace576001600160a01b03841615610a91576001600160a01b03841660009081526004602052604081208054839290610a8b908490611285565b90915550505b6001600160a01b03831615610ace576001600160a01b03831660009081526004602052604081208054839290610ac8908490611298565b90915550505b50505050565b60606000610ae183610c82565b600101905060008167ffffffffffffffff811115610b0157610b01610fb6565b6040519080825280601f01601f191660200182016040528015610b2b576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084610b3557509392505050565b6001600160a01b038216610bbd5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016103db565b610bc681610a2e565b15610be35760405162461bcd60e51b81526004016103db9061112a565b610bf1600083836001610a4b565b610bfa81610a2e565b15610c175760405162461bcd60e51b81526004016103db9061112a565b6001600160a01b038216600081815260046020908152604080832080546001019055848352600390915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310610cc15772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310610ced576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310610d0b57662386f26fc10000830492506010015b6305f5e1008310610d23576305f5e100830492506008015b6127108310610d3757612710830492506004015b60648310610d49576064830492506002015b600a83106102b55760010192915050565b508054610d66906110c1565b6000825580601f10610d76575050565b601f0160209004906000526020600020908101906108f591905b80821115610da45760008155600101610d90565b5090565b600060208284031215610dba57600080fd5b81356001600160e01b03198116811461096557600080fd5b60005b83811015610ded578181015183820152602001610dd5565b50506000910152565b6020815260008251806020840152610e15816040850160208701610dd2565b601f01601f19169190910160400192915050565b600060208284031215610e3b57600080fd5b5035919050565b80356001600160a01b0381168114610e5957600080fd5b919050565b60008060408385031215610e7157600080fd5b610e7a83610e42565b946020939093013593505050565b600080600060608486031215610e9d57600080fd5b610ea684610e42565b9250610eb460208501610e42565b9150604084013590509250925092565b600060208284031215610ed657600080fd5b61096582610e42565b60008060408385031215610ef257600080fd5b610efb83610e42565b915060208301358015158114610f1057600080fd5b809150509250929050565b600080600080600060808688031215610f3357600080fd5b610f3c86610e42565b9450610f4a60208701610e42565b935060408601359250606086013567ffffffffffffffff80821115610f6e57600080fd5b818801915088601f830112610f8257600080fd5b813581811115610f9157600080fd5b896020828501011115610fa357600080fd5b9699959850939650602001949392505050565b634e487b7160e01b600052604160045260246000fd5b60008060408385031215610fdf57600080fd5b610fe883610e42565b9150602083013567ffffffffffffffff8082111561100557600080fd5b818501915085601f83011261101957600080fd5b81358181111561102b5761102b610fb6565b604051601f8201601f19908116603f0116810190838211818310171561105357611053610fb6565b8160405282815288602084870101111561106c57600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b600080604083850312156110a157600080fd5b6110aa83610e42565b91506110b860208401610e42565b90509250929050565b600181811c908216806110d557607f821691505b6020821081036110f557634e487b7160e01b600052602260045260246000fd5b50919050565b6000835161110d818460208801610dd2565b835190830190611121818360208801610dd2565b01949350505050565b6020808252601c908201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604082015260600190565b601f821115610a2957600081815260208120601f850160051c810160208610156111885750805b601f850160051c820191505b818110156111a757828155600101611194565b505050505050565b815167ffffffffffffffff8111156111c9576111c9610fb6565b6111dd816111d784546110c1565b84611161565b602080601f83116001811461121257600084156111fa5750858301515b600019600386901b1c1916600185901b1785556111a7565b600085815260208120601f198616915b8281101561124157888601518255948401946001909101908401611222565b508582101561125f5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052601160045260246000fd5b818103818111156102b5576102b561126f565b808201808211156102b5576102b561126f56fea264697066735822122063cc69cb680b5375c4d3bbb0cd8d4469cf3c1e331a775f367efa10f79437e14864736f6c63430008110033", + "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061010b5760003560e01c80638da5cb5b116100a2578063a22cb46511610071578063a22cb4651461022c578063b88d4fde1461023a578063c87b56dd14610248578063d0def5211461025b578063e985e9c51461026e57600080fd5b80638da5cb5b146101d557806395d89b41146101e85780639c85cd6b146101f05780639dc29fac1461021957600080fd5b806323b872dd116100de57806323b872dd1461018e57806342842e0e1461018e5780636352211e146101a157806370a08231146101b457600080fd5b806301ffc9a71461011057806306fdde0314610138578063081812fc1461014d578063095ea7b314610179575b600080fd5b61012361011e366004610da8565b610284565b60405190151581526020015b60405180910390f35b6101406102bb565b60405161012f9190610df6565b61016161015b366004610e29565b50600090565b6040516001600160a01b03909116815260200161012f565b61018c610187366004610e5e565b61034d565b005b61018c61019c366004610e88565b610366565b6101616101af366004610e29565b61037f565b6101c76101c2366004610ec4565b6103e4565b60405190815260200161012f565b600854610161906001600160a01b031681565b61014061046a565b6101c76101fe366004610ec4565b6001600160a01b031660009081526005602052604090205490565b61018c610227366004610e5e565b610479565b61018c610187366004610edf565b61018c61019c366004610f1b565b610140610256366004610e29565b61054d565b61018c610269366004610fcc565b61065d565b61012361027c36600461108e565b600092915050565b60006001600160e01b031982166380ac58cd60e01b14806102b557506301ffc9a760e01b6001600160e01b03198316145b92915050565b6060600180546102ca906110c1565b80601f01602080910402602001604051908101604052809291908181526020018280546102f6906110c1565b80156103435780601f1061031857610100808354040283529160200191610343565b820191906000526020600020905b81548152906001019060200180831161032657829003601f168201915b5050505050905090565b604051631e507fd160e31b815260040160405180910390fd5b6040516335b3f76960e21b815260040160405180910390fd5b6000818152600360205260408120546001600160a01b0316806102b55760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064015b60405180910390fd5b60006001600160a01b03821661044e5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b60648201526084016103db565b506001600160a01b031660009081526004602052604090205490565b6060600280546102ca906110c1565b6008546001600160a01b031633146104c65760405162461bcd60e51b815260206004820152601060248201526f31b0b63632b9103737ba1037bbb732b960811b60448201526064016103db565b6104d08282610719565b600081815260066020526040902080546104e9906110c1565b15905061050757600081815260066020526040812061050791610d5a565b604080516001600160a01b0384168152602081018390527f2a4ffdf34772175e4a9b997092588ad7054bb1648da71f0cc58a9003378994a3910160405180910390a15050565b6060610558826108a5565b60008281526006602052604081208054610571906110c1565b80601f016020809104026020016040519081016040528092919081815260200182805461059d906110c1565b80156105ea5780601f106105bf576101008083540402835291602001916105ea565b820191906000526020600020905b8154815290600101906020018083116105cd57829003601f168201915b50505050509050600061060860408051602081019091526000815290565b9050805160000361061a575092915050565b81511561064c5780826040516020016106349291906110fb565b60405160208183030381529060405292505050919050565b610655846108f8565b949350505050565b6008546001600160a01b031633146106aa5760405162461bcd60e51b815260206004820152601060248201526f31b0b63632b9103737ba1037bbb732b960811b60448201526064016103db565b6106b38261096c565b6106c1600780546001019055565b60006106cc60075490565b90506106d881836109a5565b6040516001600160a01b03841681527f0ab9796d16d678cf5c93deba248913fea3b0e77e28d787314744147043d416669060200160405180910390a1505050565b6001600160a01b03821661077d5760405162461bcd60e51b815260206004820152602560248201527f4552433732313a2066726f6d2063616e6e6f742062652061207a65726f206164604482015264647265737360d81b60648201526084016103db565b61078681610a2e565b6107de5760405162461bcd60e51b815260206004820152602360248201527f4552433732313a20746f6b656e206964206e6565647320746f206265206d696e6044820152621d195960ea1b60648201526084016103db565b6107ec826000836001610a4b565b6107f581610a2e565b6108115760405162461bcd60e51b81526004016103db9061112a565b6001600160a01b038216600081815260046020908152604080832080546000190190558483526003825280832080546001600160a01b031916905582805260059091527f05b8ccbb9d4d8fb16ea74ce3c29a41f1b461fbdaff4714a0d9a8eb05499746bc849055518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6108ae81610a2e565b6108f55760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016103db565b50565b6060610903826108a5565b600061091a60408051602081019091526000815290565b9050600081511161093a5760405180602001604052806000815250610965565b8061094484610ad4565b6040516020016109559291906110fb565b6040516020818303038152906040525b9392505050565b61097a600080546001019055565b600080546001600160a01b0383168252600560205260409091208190556109a18282610b67565b5050565b6109ae82610a2e565b610a115760405162461bcd60e51b815260206004820152602e60248201527f45524337323155524953746f726167653a2055524920736574206f66206e6f6e60448201526d32bc34b9ba32b73a103a37b5b2b760911b60648201526084016103db565b6000828152600660205260409020610a2982826111af565b505050565b6000908152600360205260409020546001600160a01b0316151590565b6001811115610ace576001600160a01b03841615610a91576001600160a01b03841660009081526004602052604081208054839290610a8b908490611285565b90915550505b6001600160a01b03831615610ace576001600160a01b03831660009081526004602052604081208054839290610ac8908490611298565b90915550505b50505050565b60606000610ae183610c82565b600101905060008167ffffffffffffffff811115610b0157610b01610fb6565b6040519080825280601f01601f191660200182016040528015610b2b576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084610b3557509392505050565b6001600160a01b038216610bbd5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016103db565b610bc681610a2e565b15610be35760405162461bcd60e51b81526004016103db9061112a565b610bf1600083836001610a4b565b610bfa81610a2e565b15610c175760405162461bcd60e51b81526004016103db9061112a565b6001600160a01b038216600081815260046020908152604080832080546001019055848352600390915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310610cc15772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310610ced576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310610d0b57662386f26fc10000830492506010015b6305f5e1008310610d23576305f5e100830492506008015b6127108310610d3757612710830492506004015b60648310610d49576064830492506002015b600a83106102b55760010192915050565b508054610d66906110c1565b6000825580601f10610d76575050565b601f0160209004906000526020600020908101906108f591905b80821115610da45760008155600101610d90565b5090565b600060208284031215610dba57600080fd5b81356001600160e01b03198116811461096557600080fd5b60005b83811015610ded578181015183820152602001610dd5565b50506000910152565b6020815260008251806020840152610e15816040850160208701610dd2565b601f01601f19169190910160400192915050565b600060208284031215610e3b57600080fd5b5035919050565b80356001600160a01b0381168114610e5957600080fd5b919050565b60008060408385031215610e7157600080fd5b610e7a83610e42565b946020939093013593505050565b600080600060608486031215610e9d57600080fd5b610ea684610e42565b9250610eb460208501610e42565b9150604084013590509250925092565b600060208284031215610ed657600080fd5b61096582610e42565b60008060408385031215610ef257600080fd5b610efb83610e42565b915060208301358015158114610f1057600080fd5b809150509250929050565b600080600080600060808688031215610f3357600080fd5b610f3c86610e42565b9450610f4a60208701610e42565b935060408601359250606086013567ffffffffffffffff80821115610f6e57600080fd5b818801915088601f830112610f8257600080fd5b813581811115610f9157600080fd5b896020828501011115610fa357600080fd5b9699959850939650602001949392505050565b634e487b7160e01b600052604160045260246000fd5b60008060408385031215610fdf57600080fd5b610fe883610e42565b9150602083013567ffffffffffffffff8082111561100557600080fd5b818501915085601f83011261101957600080fd5b81358181111561102b5761102b610fb6565b604051601f8201601f19908116603f0116810190838211818310171561105357611053610fb6565b8160405282815288602084870101111561106c57600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b600080604083850312156110a157600080fd5b6110aa83610e42565b91506110b860208401610e42565b90509250929050565b600181811c908216806110d557607f821691505b6020821081036110f557634e487b7160e01b600052602260045260246000fd5b50919050565b6000835161110d818460208801610dd2565b835190830190611121818360208801610dd2565b01949350505050565b6020808252601c908201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604082015260600190565b601f821115610a2957600081815260208120601f850160051c810160208610156111885750805b601f850160051c820191505b818110156111a757828155600101611194565b505050505050565b815167ffffffffffffffff8111156111c9576111c9610fb6565b6111dd816111d784546110c1565b84611161565b602080601f83116001811461121257600084156111fa5750858301515b600019600386901b1c1916600185901b1785556111a7565b600085815260208120601f198616915b8281101561124157888601518255948401946001909101908401611222565b508582101561125f5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052601160045260246000fd5b818103818111156102b5576102b561126f565b808201808211156102b5576102b561126f56fea264697066735822122063cc69cb680b5375c4d3bbb0cd8d4469cf3c1e331a775f367efa10f79437e14864736f6c63430008110033", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/abis/Treasury.json b/abis/Treasury.json new file mode 100644 index 0000000..afbd0f1 --- /dev/null +++ b/abis/Treasury.json @@ -0,0 +1,85 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "Treasury", + "sourceName": "contracts/Treasury.sol", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_recipient", + "type": "address" + } + ], + "name": "withdrawFunds", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "bytecode": "0x608060405234801561001057600080fd5b5061001a3361001f565b61006f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6103388061007e6000396000f3fe6080604052600436106100435760003560e01c8063715018a61461004f578063744bfe61146100665780638da5cb5b14610086578063f2fde38b146100b257600080fd5b3661004a57005b600080fd5b34801561005b57600080fd5b506100646100d2565b005b34801561007257600080fd5b506100646100813660046102b4565b6100e6565b34801561009257600080fd5b50600054604080516001600160a01b039092168252519081900360200190f35b3480156100be57600080fd5b506100646100cd3660046102e0565b610175565b6100da6101ee565b6100e46000610248565b565b6100ee6101ee565b4782111561013a5760405162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e742062616c616e636560601b60448201526064015b60405180910390fd5b6040516001600160a01b0382169083156108fc029084906000818181858888f19350505050158015610170573d6000803e3d6000fd5b505050565b61017d6101ee565b6001600160a01b0381166101e25760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610131565b6101eb81610248565b50565b6000546001600160a01b031633146100e45760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610131565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80356001600160a01b03811681146102af57600080fd5b919050565b600080604083850312156102c757600080fd5b823591506102d760208401610298565b90509250929050565b6000602082840312156102f257600080fd5b6102fb82610298565b939250505056fea26469706673582212202c51aa9b2a1c31f8fa19afc2275e1ee655310aee35269902995a56622c03c76564736f6c63430008110033", + "deployedBytecode": "0x6080604052600436106100435760003560e01c8063715018a61461004f578063744bfe61146100665780638da5cb5b14610086578063f2fde38b146100b257600080fd5b3661004a57005b600080fd5b34801561005b57600080fd5b506100646100d2565b005b34801561007257600080fd5b506100646100813660046102b4565b6100e6565b34801561009257600080fd5b50600054604080516001600160a01b039092168252519081900360200190f35b3480156100be57600080fd5b506100646100cd3660046102e0565b610175565b6100da6101ee565b6100e46000610248565b565b6100ee6101ee565b4782111561013a5760405162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e742062616c616e636560601b60448201526064015b60405180910390fd5b6040516001600160a01b0382169083156108fc029084906000818181858888f19350505050158015610170573d6000803e3d6000fd5b505050565b61017d6101ee565b6001600160a01b0381166101e25760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610131565b6101eb81610248565b50565b6000546001600160a01b031633146100e45760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610131565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80356001600160a01b03811681146102af57600080fd5b919050565b600080604083850312156102c757600080fd5b823591506102d760208401610298565b90509250929050565b6000602082840312156102f257600080fd5b6102fb82610298565b939250505056fea26469706673582212202c51aa9b2a1c31f8fa19afc2275e1ee655310aee35269902995a56622c03c76564736f6c63430008110033", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/abis/UserNFT.json b/abis/UserNFT.json new file mode 100644 index 0000000..9132560 --- /dev/null +++ b/abis/UserNFT.json @@ -0,0 +1,472 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "UserNFT", + "sourceName": "contracts/UserNFT.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "address", + "name": "_owner", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "SBT_ApprovalNotSupported", + "type": "error" + }, + { + "inputs": [], + "name": "SBT__TransferNotSupported", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "approved", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "ApprovalForAll", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "member", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "BurnUserNFT", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "member", + "type": "address" + } + ], + "name": "MintUserNFT", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "nutritionist", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_tokenId", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "getApproved", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "getTokenIdOfOwner", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isApprovedForAll", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "nutritionist", + "type": "address" + }, + { + "internalType": "string", + "name": "uri", + "type": "string" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "ownerOf", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "safeTransferFrom", + "outputs": [], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "safeTransferFrom", + "outputs": [], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "name": "setApprovalForAll", + "outputs": [], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "tokenURI", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [], + "stateMutability": "pure", + "type": "function" + } + ], + "bytecode": "0x60806040523480156200001157600080fd5b506040516200161e3803806200161e833981016040819052620000349162000145565b8282600162000044838262000261565b50600262000053828262000261565b5050600880546001600160a01b0319166001600160a01b039390931692909217909155506200032d915050565b634e487b7160e01b600052604160045260246000fd5b600082601f830112620000a857600080fd5b81516001600160401b0380821115620000c557620000c562000080565b604051601f8301601f19908116603f01168101908282118183101715620000f057620000f062000080565b816040528381526020925086838588010111156200010d57600080fd5b600091505b8382101562000131578582018301518183018401529082019062000112565b600093810190920192909252949350505050565b6000806000606084860312156200015b57600080fd5b83516001600160401b03808211156200017357600080fd5b620001818783880162000096565b945060208601519150808211156200019857600080fd5b50620001a78682870162000096565b604086015190935090506001600160a01b0381168114620001c757600080fd5b809150509250925092565b600181811c90821680620001e757607f821691505b6020821081036200020857634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200025c57600081815260208120601f850160051c81016020861015620002375750805b601f850160051c820191505b81811015620002585782815560010162000243565b5050505b505050565b81516001600160401b038111156200027d576200027d62000080565b62000295816200028e8454620001d2565b846200020e565b602080601f831160018114620002cd5760008415620002b45750858301515b600019600386901b1c1916600185901b17855562000258565b600085815260208120601f198616915b82811015620002fe57888601518255948401946001909101908401620002dd565b50858210156200031d5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6112e1806200033d6000396000f3fe608060405234801561001057600080fd5b506004361061010b5760003560e01c80638da5cb5b116100a2578063a22cb46511610071578063a22cb4651461022c578063b88d4fde1461023a578063c87b56dd14610248578063d0def5211461025b578063e985e9c51461026e57600080fd5b80638da5cb5b146101d557806395d89b41146101e85780639c85cd6b146101f05780639dc29fac1461021957600080fd5b806323b872dd116100de57806323b872dd1461018e57806342842e0e1461018e5780636352211e146101a157806370a08231146101b457600080fd5b806301ffc9a71461011057806306fdde0314610138578063081812fc1461014d578063095ea7b314610179575b600080fd5b61012361011e366004610da8565b610284565b60405190151581526020015b60405180910390f35b6101406102bb565b60405161012f9190610df6565b61016161015b366004610e29565b50600090565b6040516001600160a01b03909116815260200161012f565b61018c610187366004610e5e565b61034d565b005b61018c61019c366004610e88565b610366565b6101616101af366004610e29565b61037f565b6101c76101c2366004610ec4565b6103e4565b60405190815260200161012f565b600854610161906001600160a01b031681565b61014061046a565b6101c76101fe366004610ec4565b6001600160a01b031660009081526005602052604090205490565b61018c610227366004610e5e565b610479565b61018c610187366004610edf565b61018c61019c366004610f1b565b610140610256366004610e29565b61054d565b61018c610269366004610fcc565b61065d565b61012361027c36600461108e565b600092915050565b60006001600160e01b031982166380ac58cd60e01b14806102b557506301ffc9a760e01b6001600160e01b03198316145b92915050565b6060600180546102ca906110c1565b80601f01602080910402602001604051908101604052809291908181526020018280546102f6906110c1565b80156103435780601f1061031857610100808354040283529160200191610343565b820191906000526020600020905b81548152906001019060200180831161032657829003601f168201915b5050505050905090565b604051631e507fd160e31b815260040160405180910390fd5b6040516335b3f76960e21b815260040160405180910390fd5b6000818152600360205260408120546001600160a01b0316806102b55760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064015b60405180910390fd5b60006001600160a01b03821661044e5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b60648201526084016103db565b506001600160a01b031660009081526004602052604090205490565b6060600280546102ca906110c1565b6008546001600160a01b031633146104c65760405162461bcd60e51b815260206004820152601060248201526f31b0b63632b9103737ba1037bbb732b960811b60448201526064016103db565b6104d08282610719565b600081815260066020526040902080546104e9906110c1565b15905061050757600081815260066020526040812061050791610d5a565b604080516001600160a01b0384168152602081018390527f74f581770b06ed28ebf946534f134d696d03e9b3caf5d2c2c742d8d8836646aa910160405180910390a15050565b6060610558826108a5565b60008281526006602052604081208054610571906110c1565b80601f016020809104026020016040519081016040528092919081815260200182805461059d906110c1565b80156105ea5780601f106105bf576101008083540402835291602001916105ea565b820191906000526020600020905b8154815290600101906020018083116105cd57829003601f168201915b50505050509050600061060860408051602081019091526000815290565b9050805160000361061a575092915050565b81511561064c5780826040516020016106349291906110fb565b60405160208183030381529060405292505050919050565b610655846108f8565b949350505050565b6008546001600160a01b031633146106aa5760405162461bcd60e51b815260206004820152601060248201526f31b0b63632b9103737ba1037bbb732b960811b60448201526064016103db565b6106b38261096c565b6106c1600780546001019055565b60006106cc60075490565b90506106d881836109a5565b6040516001600160a01b03841681527f09bbbe39472e2a184034964811afbbb7e4dd4b82a67549b37881ec491f8b1a5e9060200160405180910390a1505050565b6001600160a01b03821661077d5760405162461bcd60e51b815260206004820152602560248201527f4552433732313a2066726f6d2063616e6e6f742062652061207a65726f206164604482015264647265737360d81b60648201526084016103db565b61078681610a2e565b6107de5760405162461bcd60e51b815260206004820152602360248201527f4552433732313a20746f6b656e206964206e6565647320746f206265206d696e6044820152621d195960ea1b60648201526084016103db565b6107ec826000836001610a4b565b6107f581610a2e565b6108115760405162461bcd60e51b81526004016103db9061112a565b6001600160a01b038216600081815260046020908152604080832080546000190190558483526003825280832080546001600160a01b031916905582805260059091527f05b8ccbb9d4d8fb16ea74ce3c29a41f1b461fbdaff4714a0d9a8eb05499746bc849055518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6108ae81610a2e565b6108f55760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016103db565b50565b6060610903826108a5565b600061091a60408051602081019091526000815290565b9050600081511161093a5760405180602001604052806000815250610965565b8061094484610ad4565b6040516020016109559291906110fb565b6040516020818303038152906040525b9392505050565b61097a600080546001019055565b600080546001600160a01b0383168252600560205260409091208190556109a18282610b67565b5050565b6109ae82610a2e565b610a115760405162461bcd60e51b815260206004820152602e60248201527f45524337323155524953746f726167653a2055524920736574206f66206e6f6e60448201526d32bc34b9ba32b73a103a37b5b2b760911b60648201526084016103db565b6000828152600660205260409020610a2982826111af565b505050565b6000908152600360205260409020546001600160a01b0316151590565b6001811115610ace576001600160a01b03841615610a91576001600160a01b03841660009081526004602052604081208054839290610a8b908490611285565b90915550505b6001600160a01b03831615610ace576001600160a01b03831660009081526004602052604081208054839290610ac8908490611298565b90915550505b50505050565b60606000610ae183610c82565b600101905060008167ffffffffffffffff811115610b0157610b01610fb6565b6040519080825280601f01601f191660200182016040528015610b2b576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084610b3557509392505050565b6001600160a01b038216610bbd5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016103db565b610bc681610a2e565b15610be35760405162461bcd60e51b81526004016103db9061112a565b610bf1600083836001610a4b565b610bfa81610a2e565b15610c175760405162461bcd60e51b81526004016103db9061112a565b6001600160a01b038216600081815260046020908152604080832080546001019055848352600390915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310610cc15772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310610ced576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310610d0b57662386f26fc10000830492506010015b6305f5e1008310610d23576305f5e100830492506008015b6127108310610d3757612710830492506004015b60648310610d49576064830492506002015b600a83106102b55760010192915050565b508054610d66906110c1565b6000825580601f10610d76575050565b601f0160209004906000526020600020908101906108f591905b80821115610da45760008155600101610d90565b5090565b600060208284031215610dba57600080fd5b81356001600160e01b03198116811461096557600080fd5b60005b83811015610ded578181015183820152602001610dd5565b50506000910152565b6020815260008251806020840152610e15816040850160208701610dd2565b601f01601f19169190910160400192915050565b600060208284031215610e3b57600080fd5b5035919050565b80356001600160a01b0381168114610e5957600080fd5b919050565b60008060408385031215610e7157600080fd5b610e7a83610e42565b946020939093013593505050565b600080600060608486031215610e9d57600080fd5b610ea684610e42565b9250610eb460208501610e42565b9150604084013590509250925092565b600060208284031215610ed657600080fd5b61096582610e42565b60008060408385031215610ef257600080fd5b610efb83610e42565b915060208301358015158114610f1057600080fd5b809150509250929050565b600080600080600060808688031215610f3357600080fd5b610f3c86610e42565b9450610f4a60208701610e42565b935060408601359250606086013567ffffffffffffffff80821115610f6e57600080fd5b818801915088601f830112610f8257600080fd5b813581811115610f9157600080fd5b896020828501011115610fa357600080fd5b9699959850939650602001949392505050565b634e487b7160e01b600052604160045260246000fd5b60008060408385031215610fdf57600080fd5b610fe883610e42565b9150602083013567ffffffffffffffff8082111561100557600080fd5b818501915085601f83011261101957600080fd5b81358181111561102b5761102b610fb6565b604051601f8201601f19908116603f0116810190838211818310171561105357611053610fb6565b8160405282815288602084870101111561106c57600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b600080604083850312156110a157600080fd5b6110aa83610e42565b91506110b860208401610e42565b90509250929050565b600181811c908216806110d557607f821691505b6020821081036110f557634e487b7160e01b600052602260045260246000fd5b50919050565b6000835161110d818460208801610dd2565b835190830190611121818360208801610dd2565b01949350505050565b6020808252601c908201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604082015260600190565b601f821115610a2957600081815260208120601f850160051c810160208610156111885750805b601f850160051c820191505b818110156111a757828155600101611194565b505050505050565b815167ffffffffffffffff8111156111c9576111c9610fb6565b6111dd816111d784546110c1565b84611161565b602080601f83116001811461121257600084156111fa5750858301515b600019600386901b1c1916600185901b1785556111a7565b600085815260208120601f198616915b8281101561124157888601518255948401946001909101908401611222565b508582101561125f5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052601160045260246000fd5b818103818111156102b5576102b561126f565b808201808211156102b5576102b561126f56fea2646970667358221220f52ea87d3e38c4be57f8318b85f5fc87af455cba177bc74fd9ff2be1b2c8e98264736f6c63430008110033", + "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061010b5760003560e01c80638da5cb5b116100a2578063a22cb46511610071578063a22cb4651461022c578063b88d4fde1461023a578063c87b56dd14610248578063d0def5211461025b578063e985e9c51461026e57600080fd5b80638da5cb5b146101d557806395d89b41146101e85780639c85cd6b146101f05780639dc29fac1461021957600080fd5b806323b872dd116100de57806323b872dd1461018e57806342842e0e1461018e5780636352211e146101a157806370a08231146101b457600080fd5b806301ffc9a71461011057806306fdde0314610138578063081812fc1461014d578063095ea7b314610179575b600080fd5b61012361011e366004610da8565b610284565b60405190151581526020015b60405180910390f35b6101406102bb565b60405161012f9190610df6565b61016161015b366004610e29565b50600090565b6040516001600160a01b03909116815260200161012f565b61018c610187366004610e5e565b61034d565b005b61018c61019c366004610e88565b610366565b6101616101af366004610e29565b61037f565b6101c76101c2366004610ec4565b6103e4565b60405190815260200161012f565b600854610161906001600160a01b031681565b61014061046a565b6101c76101fe366004610ec4565b6001600160a01b031660009081526005602052604090205490565b61018c610227366004610e5e565b610479565b61018c610187366004610edf565b61018c61019c366004610f1b565b610140610256366004610e29565b61054d565b61018c610269366004610fcc565b61065d565b61012361027c36600461108e565b600092915050565b60006001600160e01b031982166380ac58cd60e01b14806102b557506301ffc9a760e01b6001600160e01b03198316145b92915050565b6060600180546102ca906110c1565b80601f01602080910402602001604051908101604052809291908181526020018280546102f6906110c1565b80156103435780601f1061031857610100808354040283529160200191610343565b820191906000526020600020905b81548152906001019060200180831161032657829003601f168201915b5050505050905090565b604051631e507fd160e31b815260040160405180910390fd5b6040516335b3f76960e21b815260040160405180910390fd5b6000818152600360205260408120546001600160a01b0316806102b55760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064015b60405180910390fd5b60006001600160a01b03821661044e5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b60648201526084016103db565b506001600160a01b031660009081526004602052604090205490565b6060600280546102ca906110c1565b6008546001600160a01b031633146104c65760405162461bcd60e51b815260206004820152601060248201526f31b0b63632b9103737ba1037bbb732b960811b60448201526064016103db565b6104d08282610719565b600081815260066020526040902080546104e9906110c1565b15905061050757600081815260066020526040812061050791610d5a565b604080516001600160a01b0384168152602081018390527f74f581770b06ed28ebf946534f134d696d03e9b3caf5d2c2c742d8d8836646aa910160405180910390a15050565b6060610558826108a5565b60008281526006602052604081208054610571906110c1565b80601f016020809104026020016040519081016040528092919081815260200182805461059d906110c1565b80156105ea5780601f106105bf576101008083540402835291602001916105ea565b820191906000526020600020905b8154815290600101906020018083116105cd57829003601f168201915b50505050509050600061060860408051602081019091526000815290565b9050805160000361061a575092915050565b81511561064c5780826040516020016106349291906110fb565b60405160208183030381529060405292505050919050565b610655846108f8565b949350505050565b6008546001600160a01b031633146106aa5760405162461bcd60e51b815260206004820152601060248201526f31b0b63632b9103737ba1037bbb732b960811b60448201526064016103db565b6106b38261096c565b6106c1600780546001019055565b60006106cc60075490565b90506106d881836109a5565b6040516001600160a01b03841681527f09bbbe39472e2a184034964811afbbb7e4dd4b82a67549b37881ec491f8b1a5e9060200160405180910390a1505050565b6001600160a01b03821661077d5760405162461bcd60e51b815260206004820152602560248201527f4552433732313a2066726f6d2063616e6e6f742062652061207a65726f206164604482015264647265737360d81b60648201526084016103db565b61078681610a2e565b6107de5760405162461bcd60e51b815260206004820152602360248201527f4552433732313a20746f6b656e206964206e6565647320746f206265206d696e6044820152621d195960ea1b60648201526084016103db565b6107ec826000836001610a4b565b6107f581610a2e565b6108115760405162461bcd60e51b81526004016103db9061112a565b6001600160a01b038216600081815260046020908152604080832080546000190190558483526003825280832080546001600160a01b031916905582805260059091527f05b8ccbb9d4d8fb16ea74ce3c29a41f1b461fbdaff4714a0d9a8eb05499746bc849055518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6108ae81610a2e565b6108f55760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016103db565b50565b6060610903826108a5565b600061091a60408051602081019091526000815290565b9050600081511161093a5760405180602001604052806000815250610965565b8061094484610ad4565b6040516020016109559291906110fb565b6040516020818303038152906040525b9392505050565b61097a600080546001019055565b600080546001600160a01b0383168252600560205260409091208190556109a18282610b67565b5050565b6109ae82610a2e565b610a115760405162461bcd60e51b815260206004820152602e60248201527f45524337323155524953746f726167653a2055524920736574206f66206e6f6e60448201526d32bc34b9ba32b73a103a37b5b2b760911b60648201526084016103db565b6000828152600660205260409020610a2982826111af565b505050565b6000908152600360205260409020546001600160a01b0316151590565b6001811115610ace576001600160a01b03841615610a91576001600160a01b03841660009081526004602052604081208054839290610a8b908490611285565b90915550505b6001600160a01b03831615610ace576001600160a01b03831660009081526004602052604081208054839290610ac8908490611298565b90915550505b50505050565b60606000610ae183610c82565b600101905060008167ffffffffffffffff811115610b0157610b01610fb6565b6040519080825280601f01601f191660200182016040528015610b2b576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084610b3557509392505050565b6001600160a01b038216610bbd5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016103db565b610bc681610a2e565b15610be35760405162461bcd60e51b81526004016103db9061112a565b610bf1600083836001610a4b565b610bfa81610a2e565b15610c175760405162461bcd60e51b81526004016103db9061112a565b6001600160a01b038216600081815260046020908152604080832080546001019055848352600390915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310610cc15772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310610ced576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310610d0b57662386f26fc10000830492506010015b6305f5e1008310610d23576305f5e100830492506008015b6127108310610d3757612710830492506004015b60648310610d49576064830492506002015b600a83106102b55760010192915050565b508054610d66906110c1565b6000825580601f10610d76575050565b601f0160209004906000526020600020908101906108f591905b80821115610da45760008155600101610d90565b5090565b600060208284031215610dba57600080fd5b81356001600160e01b03198116811461096557600080fd5b60005b83811015610ded578181015183820152602001610dd5565b50506000910152565b6020815260008251806020840152610e15816040850160208701610dd2565b601f01601f19169190910160400192915050565b600060208284031215610e3b57600080fd5b5035919050565b80356001600160a01b0381168114610e5957600080fd5b919050565b60008060408385031215610e7157600080fd5b610e7a83610e42565b946020939093013593505050565b600080600060608486031215610e9d57600080fd5b610ea684610e42565b9250610eb460208501610e42565b9150604084013590509250925092565b600060208284031215610ed657600080fd5b61096582610e42565b60008060408385031215610ef257600080fd5b610efb83610e42565b915060208301358015158114610f1057600080fd5b809150509250929050565b600080600080600060808688031215610f3357600080fd5b610f3c86610e42565b9450610f4a60208701610e42565b935060408601359250606086013567ffffffffffffffff80821115610f6e57600080fd5b818801915088601f830112610f8257600080fd5b813581811115610f9157600080fd5b896020828501011115610fa357600080fd5b9699959850939650602001949392505050565b634e487b7160e01b600052604160045260246000fd5b60008060408385031215610fdf57600080fd5b610fe883610e42565b9150602083013567ffffffffffffffff8082111561100557600080fd5b818501915085601f83011261101957600080fd5b81358181111561102b5761102b610fb6565b604051601f8201601f19908116603f0116810190838211818310171561105357611053610fb6565b8160405282815288602084870101111561106c57600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b600080604083850312156110a157600080fd5b6110aa83610e42565b91506110b860208401610e42565b90509250929050565b600181811c908216806110d557607f821691505b6020821081036110f557634e487b7160e01b600052602260045260246000fd5b50919050565b6000835161110d818460208801610dd2565b835190830190611121818360208801610dd2565b01949350505050565b6020808252601c908201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604082015260600190565b601f821115610a2957600081815260208120601f850160051c810160208610156111885750805b601f850160051c820191505b818110156111a757828155600101611194565b505050505050565b815167ffffffffffffffff8111156111c9576111c9610fb6565b6111dd816111d784546110c1565b84611161565b602080601f83116001811461121257600084156111fa5750858301515b600019600386901b1c1916600185901b1785556111a7565b600085815260208120601f198616915b8281101561124157888601518255948401946001909101908401611222565b508582101561125f5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052601160045260246000fd5b818103818111156102b5576102b561126f565b808201808211156102b5576102b561126f56fea2646970667358221220f52ea87d3e38c4be57f8318b85f5fc87af455cba177bc74fd9ff2be1b2c8e98264736f6c63430008110033", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/abis/index.ts b/abis/index.ts new file mode 100644 index 0000000..3160a4c --- /dev/null +++ b/abis/index.ts @@ -0,0 +1,1108 @@ +//import {abi as communityAbi} from "./Community.json"; +// import {abi as treasuryAbi} from "./Treasury.json"; +// import {abi as nutritionistNftAbi} from "./NutritionistNFT.json"; +// import {abi as userNftAbi} from "./UserNFT.json"; + +export const communityAbi = [ + { + "inputs": [ + { + "internalType": "address", + "name": "_treasury", + "type": "address" + }, + { + "internalType": "contract LinkTokenInterface", + "name": "_link", + "type": "address" + }, + { + "internalType": "address", + "name": "_registrar", + "type": "address" + }, + { + "internalType": "contract AutomationRegistryInterface", + "name": "_registry", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "AlreadyAMember", + "type": "error" + }, + { + "inputs": [], + "name": "AlreadyANutrionist", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientPayment", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidApplicant", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidDeadline", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidSubStatus", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "message", + "type": "string" + } + ], + "name": "UnauthorizedApplication", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "UnauthorizedMember", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "UnauthorizedNutritionist", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "applicant", + "type": "address" + } + ], + "name": "ApplicationApproved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "applicant", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "dataURI", + "type": "string" + } + ], + "name": "NewApplication", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "dataURI", + "type": "string" + } + ], + "name": "NewSignUp", + "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" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "allArticles", + "outputs": [ + { + "internalType": "string", + "name": "title", + "type": "string" + }, + { + "internalType": "address", + "name": "author", + "type": "address" + }, + { + "internalType": "string", + "name": "authorName", + "type": "string" + }, + { + "internalType": "string", + "name": "content", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "allFitnessPlans", + "outputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "fitnessDescription", + "type": "string" + }, + { + "internalType": "address", + "name": "creator", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "allMealPlans", + "outputs": [ + { + "internalType": "string", + "name": "mealName", + "type": "string" + }, + { + "internalType": "string", + "name": "mealDescription", + "type": "string" + }, + { + "internalType": "address", + "name": "creator", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "allNutritionists", + "outputs": [ + { + "internalType": "string", + "name": "nutritionistPersonalData", + "type": "string" + }, + { + "internalType": "address", + "name": "nutritionistAddress", + "type": "address" + }, + { + "components": [ + { + "internalType": "address", + "name": "consultant", + "type": "address" + }, + { + "internalType": "string", + "name": "consultationDescription", + "type": "string" + } + ], + "internalType": "struct Community.ConsultationServices", + "name": "consultationServices", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "allNutritionistsAddresses", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "allNutritionistsApplicants", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "allNutritionistsApplications", + "outputs": [ + { + "internalType": "string", + "name": "dataURI", + "type": "string" + }, + { + "internalType": "address", + "name": "nutritionistAddress", + "type": "address" + }, + { + "internalType": "enum Community.NutritionistApplicationStatus", + "name": "applicationStatus", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "allUserAddresses", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "allUsers", + "outputs": [ + { + "internalType": "address", + "name": "userAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "userPersonalData", + "type": "string" + }, + { + "internalType": "enum Community.UserSubscriptionStatus", + "name": "subStatus", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "subDeadline", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "applicantToIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "dataURI", + "type": "string" + } + ], + "name": "applyForNutritionistRole", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "applicant", + "type": "address" + }, + { + "internalType": "string", + "name": "nutritionistNfturi", + "type": "string" + } + ], + "name": "approveNutritionistRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "cancelNutritionistApplication", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "checkUpkeep", + "outputs": [ + { + "internalType": "bool", + "name": "upkeepNeeded", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "performData", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_consultationDesc", + "type": "string" + } + ], + "name": "createConsultation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_fitnessName", + "type": "string" + }, + { + "internalType": "string", + "name": "fitnessDesc", + "type": "string" + } + ], + "name": "createFitnessPlan", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_mealName", + "type": "string" + }, + { + "internalType": "string", + "name": "mealPlanDesc", + "type": "string" + } + ], + "name": "createMealPlan", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getAllMembers", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "userAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "userPersonalData", + "type": "string" + }, + { + "internalType": "enum Community.UserSubscriptionStatus", + "name": "subStatus", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "subDeadline", + "type": "uint256" + } + ], + "internalType": "struct Community.User[]", + "name": "_users", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAllNutritionists", + "outputs": [ + { + "components": [ + { + "internalType": "string", + "name": "nutritionistPersonalData", + "type": "string" + }, + { + "components": [ + { + "internalType": "string", + "name": "mealName", + "type": "string" + }, + { + "internalType": "string", + "name": "mealDescription", + "type": "string" + }, + { + "internalType": "address", + "name": "creator", + "type": "address" + } + ], + "internalType": "struct Community.MealPlans[]", + "name": "nutritionistMealplans", + "type": "tuple[]" + }, + { + "internalType": "address", + "name": "nutritionistAddress", + "type": "address" + }, + { + "components": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "fitnessDescription", + "type": "string" + }, + { + "internalType": "address", + "name": "creator", + "type": "address" + } + ], + "internalType": "struct Community.FitnessPlans[]", + "name": "fitnessPlans", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "address", + "name": "consultant", + "type": "address" + }, + { + "internalType": "string", + "name": "consultationDescription", + "type": "string" + } + ], + "internalType": "struct Community.ConsultationServices", + "name": "consultationServices", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "string", + "name": "title", + "type": "string" + }, + { + "internalType": "address", + "name": "author", + "type": "address" + }, + { + "internalType": "string", + "name": "authorName", + "type": "string" + }, + { + "internalType": "string", + "name": "content", + "type": "string" + } + ], + "internalType": "struct Community.Articles[]", + "name": "nutritionistArticles", + "type": "tuple[]" + } + ], + "internalType": "struct Community.Nutritionist[]", + "name": "_nutritionists", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "i_link", + "outputs": [ + { + "internalType": "contract LinkTokenInterface", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "i_registry", + "outputs": [ + { + "internalType": "contract AutomationRegistryInterface", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_userData", + "type": "string" + }, + { + "internalType": "string", + "name": "nftUri", + "type": "string" + } + ], + "name": "joinCommunity", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "nutritionistApplicationFee", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "nutritionistApplicationStatus", + "outputs": [ + { + "internalType": "enum Community.NutritionistApplicationStatus", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "nutritionistApplications", + "outputs": [ + { + "internalType": "string", + "name": "dataURI", + "type": "string" + }, + { + "internalType": "address", + "name": "nutritionistAddress", + "type": "address" + }, + { + "internalType": "enum Community.NutritionistApplicationStatus", + "name": "applicationStatus", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "nutritionistNFT", + "outputs": [ + { + "internalType": "contract INutritionistNFT", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "nutritionists", + "outputs": [ + { + "internalType": "string", + "name": "nutritionistPersonalData", + "type": "string" + }, + { + "internalType": "address", + "name": "nutritionistAddress", + "type": "address" + }, + { + "components": [ + { + "internalType": "address", + "name": "consultant", + "type": "address" + }, + { + "internalType": "string", + "name": "consultationDescription", + "type": "string" + } + ], + "internalType": "struct Community.ConsultationServices", + "name": "consultationServices", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "performData", + "type": "bytes" + } + ], + "name": "performUpkeep", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_title", + "type": "string" + }, + { + "internalType": "string", + "name": "_authorName", + "type": "string" + }, + { + "internalType": "string", + "name": "_content", + "type": "string" + } + ], + "name": "publishArticle", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "bytes", + "name": "encryptedEmail", + "type": "bytes" + }, + { + "internalType": "address", + "name": "upkeepContract", + "type": "address" + }, + { + "internalType": "uint32", + "name": "gasLimit", + "type": "uint32" + }, + { + "internalType": "address", + "name": "adminAddress", + "type": "address" + }, + { + "internalType": "bytes", + "name": "checkData", + "type": "bytes" + }, + { + "internalType": "uint96", + "name": "amount", + "type": "uint96" + }, + { + "internalType": "uint8", + "name": "source", + "type": "uint8" + } + ], + "name": "registerAndPredictID", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "registrar", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "applicant", + "type": "address" + } + ], + "name": "rejectNutritionistRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renewSubscription", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_member", + "type": "address" + } + ], + "name": "revokeUser", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_userNFT", + "type": "address" + }, + { + "internalType": "address", + "name": "_nutritionistNFT", + "type": "address" + } + ], + "name": "setNFTs", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "subscriptionDuration", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "treasury", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "userApplicationFee", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "userNFT", + "outputs": [ + { + "internalType": "contract IUserNFT", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "userToIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/contracts/contracts/Community.sol b/contracts/contracts/Community.sol deleted file mode 100644 index c5d2507..0000000 --- a/contracts/contracts/Community.sol +++ /dev/null @@ -1,576 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity 0.8.17; - -//import "@openzeppelin/contracts/utils/Checkpoints.sol"; -import "@openzeppelin/contracts/access/Ownable.sol"; -import "@openzeppelin/contracts/utils/Counters.sol"; - -import {AutomationRegistryInterface, State, Config} from "@chainlink/contracts/src/v0.8/automation/interfaces/v1_2/AutomationRegistryInterface1_2.sol"; -import {LinkTokenInterface} from "@chainlink/contracts/src/v0.8/shared/interfaces/LinkTokenInterface.sol"; -import {KeeperRegistrarInterface} from "./interfaces/KeeperRegistrarInterface.sol"; -import {IUserNFT} from "./interfaces/IUserNFT.sol"; -import {INutritionistNFT} from "./interfaces/INutritionistNFT.sol"; - -error AlreadyAMember(); - -error AlreadyANutrionist(); - -error InsufficientPayment(); - -error InvalidApplicant(); - -error UnauthorizedApplication(string message); - -error UnauthorizedNutritionist(address caller); - -error UnauthorizedMember(address caller); - -error InvalidDeadline(); - -error InvalidSubStatus(); - -contract Community is Ownable { - LinkTokenInterface public immutable i_link; - address public immutable registrar; - AutomationRegistryInterface public immutable i_registry; - bytes4 registerSig = KeeperRegistrarInterface.register.selector; - //mapping(uint256 => uint256) public counterToUpkeepID; - - using Counters for Counters.Counter; - - Counters.Counter private _applicantIndexCounter; - Counters.Counter private _userIndexCounter; - - INutritionistNFT public nutritionistNFT; - - IUserNFT public userNFT; - - mapping(address => uint256) public applicantToIndex; - - mapping(address => uint256) public userToIndex; - - uint256 public constant userApplicationFee = 0.01 ether; - - uint256 public constant nutritionistApplicationFee = 0.005 ether; - - uint256 public subscriptionDuration = 2592000; - - address public immutable treasury; - - address[] public allUserAddresses; - - address[] public allNutritionistsAddresses; - - address[] public allNutritionistsApplicants; //delete from here - - mapping(address => bool) isMember; - - mapping(address => bool) isNutritionist; - - mapping(address => User) users; //update users here - - mapping(address => Nutritionist) public nutritionists; - - mapping(address => NutritionistApplicationStatus) //change to cancelled - public nutritionistApplicationStatus; - - mapping(address => NutritionistApplication) public nutritionistApplications; //delete from here - - event NewApplication(address applicant, string dataURI); - - event NewSignUp(address user, string dataURI); - - event ApplicationApproved(address applicant); - - enum NutritionistApplicationStatus { - NotApplied, - Pending, - Accepted, - Rejected, - Canceled - } - - enum UserSubscriptionStatus { - NotActive, - Active, - Expired - } - - struct NutritionistApplication { - string dataURI; - address nutritionistAddress; - NutritionistApplicationStatus applicationStatus; - } - - NutritionistApplication[] public allNutritionistsApplications; - - struct MealPlans { - string mealName; - string mealDescription; - address creator; - } - - MealPlans[] public allMealPlans; - - struct FitnessPlans { - string name; - string fitnessDescription; - address creator; - } - - FitnessPlans[] public allFitnessPlans; - - struct ConsultationServices { - address consultant; - string consultationDescription; - } - - struct User { - address userAddress; - string userPersonalData; //needs to be encrypted before storing - UserSubscriptionStatus subStatus; - uint256 subDeadline; - } - - User[] public allUsers; //update users here - - struct Nutritionist { - string nutritionistPersonalData; //needs to be encrypted before storing - MealPlans[] nutritionistMealplans; - address nutritionistAddress; - FitnessPlans[] fitnessPlans; - ConsultationServices consultationServices; - Articles[] nutritionistArticles; - } - - Nutritionist[] public allNutritionists; - - struct Articles { - string title; - address author; - string authorName; - string content; - } - - Articles[] public allArticles; - - constructor( - address _treasury, - LinkTokenInterface _link, - address _registrar, - AutomationRegistryInterface _registry - ) { - treasury = _treasury; - i_link = _link; - registrar = _registrar; - i_registry = _registry; - } - - /// @notice Restrict access to trusted `nutritionists` - modifier onlyNutritionists() { - if (!isNutritionist[msg.sender]) { - revert UnauthorizedNutritionist(msg.sender); - } - _; - } - - /// @notice Restrict access to trusted `members` - modifier onlyMembers() { - if (isMember[msg.sender]) { - revert UnauthorizedMember(msg.sender); - } - _; - } - - modifier applicantExists(address _applicant) { - NutritionistApplicationStatus applicationStatus = nutritionistApplicationStatus[ - _applicant - ]; - - if (applicationStatus != NutritionistApplicationStatus.Pending) { - revert InvalidApplicant(); - } - _; - } - - modifier deadlinePassed(address _member) { - uint256 deadline = users[_member].subDeadline; - - if (block.timestamp < deadline) { - revert InvalidDeadline(); - } - _; - } - - function setNFTs( - address _userNFT, - address _nutritionistNFT - ) public onlyOwner { - userNFT = IUserNFT(_userNFT); - nutritionistNFT = INutritionistNFT(_nutritionistNFT); - } - - function joinCommunity( - string memory _userData, - string memory nftUri - ) external payable { - // Check that sender isn't a member already - if (isMember[msg.sender]) { - revert AlreadyAMember(); - } - - if (msg.value < userApplicationFee) { - revert InsufficientPayment(); - } - - uint256 index = _userIndexCounter.current(); - isMember[msg.sender] = true; - User memory user = users[msg.sender]; - user.userAddress = msg.sender; - user.userPersonalData = _userData; - user.subStatus = UserSubscriptionStatus.Active; - user.subDeadline = block.timestamp + subscriptionDuration; - users[msg.sender] = user; - userToIndex[msg.sender] = index; - allUsers.push(user); - allUserAddresses.push(msg.sender); - - //mint userNft for the user - userNFT.mint(msg.sender, nftUri); - payable(treasury).transfer(msg.value); - - // Emit event - emit NewSignUp(msg.sender, _userData); - } - - //should be called by automation - function revokeUser( - address _member - ) public /*onlyChainlink*/ deadlinePassed(_member) { - // This function can only be called by the owner after the deadline has passed - - if (!isMember[_member]) { - revert UnauthorizedMember(_member); - } - - User memory user = users[_member]; - //isMember[_member] = false; - if (block.timestamp > user.subDeadline) { - user.subStatus = UserSubscriptionStatus.Expired; - user.subDeadline = 0; - } - users[_member] = user; - uint256 userIndex = _getUserIndex(_member); - allUsers[userIndex] = user; - uint256 userTokenId = userNFT.getTokenIdOfOwner(user.userAddress); - - userNFT.burn(user.userAddress, userTokenId); - } - - /// @notice Function used to apply to community - function applyForNutritionistRole( - string calldata dataURI - ) external payable { - // Check that sender isn't a nutritionist already - if (isNutritionist[msg.sender]) { - revert AlreadyANutrionist(); - } - - uint256 index = _applicantIndexCounter.current(); - NutritionistApplicationStatus applicationStatus = nutritionistApplicationStatus[ - msg.sender - ]; - - if ( - applicationStatus == NutritionistApplicationStatus.Pending || - applicationStatus == NutritionistApplicationStatus.Accepted - ) { - revert UnauthorizedApplication( - "Community: already applied/pending" - ); - } - - if (msg.value < nutritionistApplicationFee) { - revert InsufficientPayment(); - } - - applicationStatus = NutritionistApplicationStatus.Pending; - NutritionistApplication memory application = NutritionistApplication( - dataURI, - msg.sender, - applicationStatus - ); - applicantToIndex[msg.sender] = index; - nutritionistApplicationStatus[msg.sender] = applicationStatus; - nutritionistApplications[msg.sender] = application; - allNutritionistsApplicants.push(msg.sender); - allNutritionistsApplications.push(application); - - payable(treasury).transfer(msg.value); - - // Emit event - emit NewApplication(msg.sender, dataURI); - } - - function cancelNutritionistApplication() - external - onlyNutritionists - applicantExists(msg.sender) - { - // Check that sender isn't a nutritionist already - if (isNutritionist[msg.sender]) { - revert AlreadyANutrionist(); - } - - NutritionistApplicationStatus applicationStatus = nutritionistApplicationStatus[ - msg.sender - ]; - - // if (applicationStatus != NutritionistApplicationStatus.Pending) { - // revert InvalidApplicant(); - // } - - uint256 applicantIndex = _getApplicantIndex(msg.sender); - delete allNutritionistsApplicants[applicantIndex]; - delete nutritionistApplications[msg.sender]; - - applicationStatus = NutritionistApplicationStatus.Canceled; - nutritionistApplicationStatus[msg.sender] = applicationStatus; - } - - /// @notice Function for community members to approve acceptance of new member to community - function approveNutritionistRole( - address applicant, - string memory nutritionistNfturi - ) external onlyOwner applicantExists(applicant) { - // Check that sender isn't a nutritionist already - if (isNutritionist[applicant]) { - revert AlreadyANutrionist(); - } - - NutritionistApplicationStatus applicationStatus = nutritionistApplicationStatus[ - applicant - ]; - - // if (applicationStatus != NutritionistApplicationStatus.Pending) { - // revert InvalidApplicant(); - // } - - applicationStatus = NutritionistApplicationStatus.Accepted; - nutritionistApplicationStatus[applicant] = applicationStatus; - - isNutritionist[applicant] = true; - NutritionistApplication - memory _nutritionistApplication = nutritionistApplications[ - applicant - ]; - Nutritionist storage nutritionist = nutritionists[applicant]; - nutritionist.nutritionistAddress = _nutritionistApplication - .nutritionistAddress; - nutritionist.nutritionistPersonalData = _nutritionistApplication - .dataURI; - - allNutritionists.push(nutritionist); - allNutritionistsAddresses.push(applicant); - - nutritionistNFT.mint(msg.sender, nutritionistNfturi); - - // Emit event - emit ApplicationApproved(applicant); - } - - function _getApplicantIndex( - address _applicant - ) internal view applicantExists(_applicant) returns (uint256 _index) { - _index = applicantToIndex[_applicant]; - } - - function _getUserIndex( - address _user - ) internal view returns (uint256 _index) { - if (!isMember[_user]) { - revert UnauthorizedMember(_user); - } - _index = userToIndex[_user]; - } - - function rejectNutritionistRole( - address applicant - ) external onlyOwner applicantExists(applicant) { - // Check that sender isn't a nutritionist already - if (isNutritionist[applicant]) { - revert AlreadyANutrionist(); - } - - NutritionistApplicationStatus applicationStatus = nutritionistApplicationStatus[ - applicant - ]; - - applicationStatus = NutritionistApplicationStatus.Rejected; - nutritionistApplicationStatus[applicant] = applicationStatus; - } - - function renewSubscription() - external - onlyMembers - deadlinePassed(msg.sender) - { - User memory user = users[msg.sender]; - if (user.subStatus != UserSubscriptionStatus.Expired) { - revert InvalidSubStatus(); - } - user.subStatus = UserSubscriptionStatus.Active; - //isMember[msg.sender] = true; - users[msg.sender] = user; - - } - - function getAllMembers() external view returns (User[] memory _users) { - _users = allUsers; - } - - function getAllNutritionists() - external - view - returns (Nutritionist[] memory _nutritionists) - { - _nutritionists = allNutritionists; - } - - function createMealPlan( - string memory _mealName, - string memory mealPlanDesc - ) external onlyNutritionists { - Nutritionist storage _nutritionist = nutritionists[msg.sender]; - MealPlans memory mealPlan = MealPlans( - _mealName, - mealPlanDesc, - msg.sender - ); - _nutritionist.nutritionistMealplans.push(mealPlan); - } - - function createFitnessPlan( - string memory _fitnessName, - string memory fitnessDesc - ) external onlyNutritionists { - Nutritionist storage _nutritionist = nutritionists[msg.sender]; - FitnessPlans memory fitnessPlan = FitnessPlans( - _fitnessName, - fitnessDesc, - msg.sender - ); - _nutritionist.fitnessPlans.push(fitnessPlan); - } - - function createConsultation( - string memory _consultationDesc - ) external onlyNutritionists { - Nutritionist storage _nutritionist = nutritionists[msg.sender]; - ConsultationServices memory consultationService = ConsultationServices( - msg.sender, - _consultationDesc - ); - _nutritionist.consultationServices = consultationService; - } - - function publishArticle( - string memory _title, - string memory _authorName, - string memory _content - ) external onlyOwner onlyNutritionists { - Nutritionist storage _nutritionist = nutritionists[msg.sender]; - Articles memory article = Articles( - _title, - msg.sender, - _authorName, - _content - ); - _nutritionist.nutritionistArticles.push(article); - allArticles.push(article); - } - - function registerAndPredictID( - string memory name, //upkeep name - bytes calldata encryptedEmail, // '0x' - address upkeepContract, //address(this) - uint32 gasLimit, //500000 - address adminAddress, //address(msg.sender) - bytes calldata checkData, //0x - ABI-encoded, it is fixed and specified at Upkeep registration and used in every checkUpkeep. Can be empty (0x) - uint96 amount, //5 link - 5000000000000000000 wei - uint8 source //0 - ) public { - (State memory state, , ) = i_registry.getState(); - uint256 oldNonce = state.nonce; //number representing current upkeep - bytes memory payload = abi.encode( - name, - encryptedEmail, - upkeepContract, - gasLimit, - adminAddress, - checkData, - amount, - source, - address(this) - ); - i_link.transferAndCall( - registrar, - amount, - bytes.concat(registerSig, payload) - ); - (state, , ) = i_registry.getState(); - uint256 newNonce = state.nonce; - if (newNonce == oldNonce + 1) { - uint256 upkeepID = uint256( - keccak256( - abi.encodePacked( - blockhash(block.number - 1), - address(i_registry), - uint32(oldNonce) - ) - ) - ); - // DEV - Use the upkeepID however you see fit - //counterToUpkeepID[counterID] = upkeepID; - } else { - revert("auto-approve disabled"); - } - } - - function checkUpkeep( - bytes calldata /* checkData */ - ) external view returns (bool upkeepNeeded, bytes memory performData) { - //decode check data if you using it - //if interval has passed then return true - - bool status; - User[] memory newUserArr = new User[](allUsers.length); - for (uint16 i = 0; i < allUsers.length; i++) { - User memory user = allUsers[i]; - if (block.timestamp > user.subDeadline) { - // user.subStatus = UserSubscriptionStatus.Expired; - // user.subDeadline = 0; - newUserArr[i] = user; - status = true; - } - } - //upkeepNeeded = (block.timestamp - lastTimeStamp) > interval; - upkeepNeeded = status; - performData = abi.encode(newUserArr); - //pass checkData through to performData - } - - function performUpkeep(bytes calldata performData) external { - //We highly recommend revalidating the upkeep in the performUpkeep function - User[] memory usersArr = abi.decode(performData, (User[])); - for (uint16 i = 0; i < usersArr.length; i++) { - User memory user = usersArr[i]; - address userAddress = user.userAddress; - if (block.timestamp > user.subDeadline) { - revokeUser(userAddress); - } - } - // We don't use the performData in this example. The performData is generated by the Automation Node's call to your checkUpkeep function - } -} \ No newline at end of file diff --git a/contracts/contracts/NutritionistNFT.sol b/contracts/contracts/NutritionistNFT.sol deleted file mode 100644 index a8b4b7a..0000000 --- a/contracts/contracts/NutritionistNFT.sol +++ /dev/null @@ -1,93 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity 0.8.17; - -import "./interfaces/INutritionistNFT.sol"; -import {SBT} from "./SBT.sol"; -import "@openzeppelin/contracts/utils/Strings.sol"; -import "@openzeppelin/contracts/utils/Address.sol"; -import "@openzeppelin/contracts/utils/Counters.sol"; - -contract NutritionistNFT is INutritionistNFT, SBT { - using Strings for uint256; - - using Counters for Counters.Counter; - - // Optional mapping for token URIs - mapping(uint256 => string) private _tokenURIs; - - Counters.Counter private tokenUriIds; - - address public owner; - - constructor( - string memory name, - string memory symbol, - address _owner - ) SBT(name, symbol) { - owner = _owner; - } - - // FUNCTIONS - function mint(address nutritionist, string memory uri) external override { - require(msg.sender == owner, "caller not owner"); - _mintUsingAutomaticTokenId(nutritionist); - tokenUriIds.increment(); - uint256 tokenUriId = tokenUriIds.current(); - - _setTokenURI(tokenUriId, uri); - - emit MintNutritionistNFT(nutritionist); - } - - function burn(address nutritionist, uint256 _tokenId) external override { - require(msg.sender == owner, "caller not owner"); - _burn(nutritionist, _tokenId); - - if (bytes(_tokenURIs[_tokenId]).length != 0) { - delete _tokenURIs[_tokenId]; - } - emit BurnNutritionistNFT(nutritionist, _tokenId); - } - - /** - * @dev See {IERC721Metadata-tokenURI}. - */ - function tokenURI( - uint256 tokenId - ) public view virtual override returns (string memory) { - _requireMinted(tokenId); - - string memory _tokenURI = _tokenURIs[tokenId]; - string memory base = _baseURI(); - - // If there is no base URI, return the token URI. - if (bytes(base).length == 0) { - return _tokenURI; - } - // If both are set, concatenate the baseURI and tokenURI (via abi.encodePacked). - if (bytes(_tokenURI).length > 0) { - return string(abi.encodePacked(base, _tokenURI)); - } - - return super.tokenURI(tokenId); - } - - /** - * @dev Sets `_tokenURI` as the tokenURI of `tokenId`. - * - * Requirements: - * - * - `tokenId` must exist. - */ - function _setTokenURI( - uint256 tokenId, - string memory _tokenURI - ) internal virtual { - require( - _exists(tokenId), - "ERC721URIStorage: URI set of nonexistent token" - ); - _tokenURIs[tokenId] = _tokenURI; - } -} diff --git a/contracts/contracts/SBT.sol b/contracts/contracts/SBT.sol deleted file mode 100644 index 653d014..0000000 --- a/contracts/contracts/SBT.sol +++ /dev/null @@ -1,298 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity 0.8.17; - -import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; -import "@openzeppelin/contracts/utils/Address.sol"; -import "@openzeppelin/contracts/utils/Context.sol"; -import "@openzeppelin/contracts/utils/Strings.sol"; -import "@openzeppelin/contracts/utils/introspection/ERC165.sol"; -import "@openzeppelin/contracts/utils/Counters.sol"; -import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol"; - -import "./interfaces/ISBT.sol"; - -contract SBT is Context, ERC165, IERC721, ISBT, IERC721Metadata { - error SBT__TransferNotSupported(); - error SBT_ApprovalNotSupported(); - - using Counters for Counters.Counter; - using Address for address; - using Strings for uint256; - - Counters.Counter private s_tokenIds; - - // Token name - string private _name; - - // Token symbol - string private _symbol; - - // Mapping from token ID to owner address - mapping(uint256 => address) private _owners; - - // Mapping owner address to token count - mapping(address => uint256) private _balances; - - mapping(address => uint256) private s_ownerToTokenId; - - /** - * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. - */ - constructor(string memory name_, string memory symbol_) { - _name = name_; - _symbol = symbol_; - } - - function _mintUsingAutomaticTokenId(address to) internal { - s_tokenIds.increment(); - uint256 tokenId = s_tokenIds.current(); - - s_ownerToTokenId[to] = tokenId; - _mint(to, tokenId); - } - - /** - * @dev See {IERC165-supportsInterface}. - */ - function supportsInterface( - bytes4 interfaceId - ) public view virtual override(ERC165, IERC165) returns (bool) { - return - interfaceId == type(IERC721).interfaceId || - super.supportsInterface(interfaceId); - } - - /** - * @dev See {IERC721-balanceOf}. - */ - function balanceOf( - address owner - ) public view virtual override returns (uint256) { - require( - owner != address(0), - "ERC721: address zero is not a valid owner" - ); - return _balances[owner]; - } - - /** - * @dev See {IERC721-ownerOf}. - */ - function ownerOf( - uint256 tokenId - ) public view virtual override returns (address) { - address owner = _ownerOf(tokenId); - require(owner != address(0), "ERC721: invalid token ID"); - return owner; - } - - function getTokenIdOfOwner(address owner) public view returns (uint256) { - return s_ownerToTokenId[owner]; - } - - /** - * @dev See {IERC721Metadata-name}. - */ - function name() public view virtual returns (string memory) { - return _name; - } - - /** - * @dev See {IERC721Metadata-symbol}. - */ - function symbol() public view virtual returns (string memory) { - return _symbol; - } - - /** - * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist - */ - function _ownerOf(uint256 tokenId) internal view virtual returns (address) { - return _owners[tokenId]; - } - - /** - * @dev Returns whether `tokenId` exists. - * - * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. - * - * Tokens start existing when they are minted (`_mint`) - */ - function _exists(uint256 tokenId) internal view virtual returns (bool) { - return _ownerOf(tokenId) != address(0); - } - - /** - * @dev Mints `tokenId` and transfers it to `to`. - * - * Requirements: - * - * - `tokenId` must not exist. - * - `to` cannot be the zero address. - * - * Emits a {Transfer} event. - */ - function _mint(address to, uint256 tokenId) internal virtual { - require(to != address(0), "ERC721: mint to the zero address"); - require(!_exists(tokenId), "ERC721: token already minted"); - - _beforeTokenTransfer(address(0), to, tokenId, 1); - - // Check that tokenId was not minted by `_beforeTokenTransfer` hook - require(!_exists(tokenId), "ERC721: token already minted"); - - unchecked { - // Will not overflow unless all 2**256 token ids are minted to the same owner. - // Given that tokens are minted one by one, it is impossible in practice that - // this ever happens. Might change if we allow batch minting. - // The ERC fails to describe this case. - _balances[to] += 1; - } - - _owners[tokenId] = to; - - emit Transfer(address(0), to, tokenId); - } - - - /** - * @dev burns `tokenId` and transfers it to `zero address`. - * - * Requirements: - * - * - `tokenId` must exist. - * - `from` cannot be the zero address. - * - * Emits a {Transfer} event. - */ - function _burn(address from, uint256 tokenId) internal virtual { - require(from != address(0), "ERC721: from cannot be a zero address"); - require(_exists(tokenId), "ERC721: token id needs to be minted"); - - // When `from` is zero, the tokens will be minted for `to`. - //When `to` is zero, ``from``'s tokens will be burned. - - _beforeTokenTransfer(from, address(0), tokenId, 1); - - // Check that tokenId was not burned by `_beforeTokenTransfer` hook - require(_exists(tokenId), "ERC721: token already minted"); - - unchecked { - // Will not overflow unless all 2**256 token ids are minted to the same owner. - // Given that tokens are minted one by one, it is impossible in practice that - // this ever happens. Might change if we allow batch minting. - // The ERC fails to describe this case. - _balances[from] -= 1; - } - - _owners[tokenId] = address(0); - s_ownerToTokenId[address(0)] = tokenId; - - emit Transfer(from, address(0), tokenId); - } - - /** - * @dev Reverts if the `tokenId` has not been minted yet. - */ - function _requireMinted(uint256 tokenId) internal view virtual { - require(_exists(tokenId), "ERC721: invalid token ID"); - } - - /** - * @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is - * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1. - * - * Calling conditions: - * - * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`. - * - When `from` is zero, the tokens will be minted for `to`. - * - When `to` is zero, ``from``'s tokens will be burned. - * - `from` and `to` are never both zero. - * - `batchSize` is non-zero. - * - * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. - */ - function _beforeTokenTransfer( - address from, - address to, - uint256 /* firstTokenId */, - uint256 batchSize - ) internal virtual { - if (batchSize > 1) { - if (from != address(0)) { - _balances[from] -= batchSize; - } - if (to != address(0)) { - _balances[to] += batchSize; - } - } - } - - /// @dev Transfer and Allowance function disabling overrides - - /// @dev Function is disabled to make token soulbound - function safeTransferFrom( - address, - address, - uint256 - ) external pure override { - revert SBT__TransferNotSupported(); - } - - /// @dev Function is disabled to make token soulbound - function safeTransferFrom( - address, - address, - uint256, - bytes calldata - ) external pure override { - revert SBT__TransferNotSupported(); - } - - /// @dev Function is disabled to make token soulbound - function transferFrom(address, address, uint256) external pure override { - revert SBT__TransferNotSupported(); - } - - /// @dev Function is disabled to make token soulbound - function approve(address, uint256) external pure override { - revert SBT_ApprovalNotSupported(); - } - - /// @dev Function is disabled to make token soulbound - function setApprovalForAll(address, bool) external pure override { - revert SBT_ApprovalNotSupported(); - } - - /// @dev Function is disabled to make token soulbound - function getApproved(uint256) external pure override returns (address) { - return address(0x0); - } - - /// @dev Function is disabled to make token soulbound - function isApprovedForAll( - address, - address - ) external pure override returns (bool) { - return false; - } - - /** - * @dev See {IERC721Metadata-tokenURI}. - */ - function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { - _requireMinted(tokenId); - - string memory baseURI = _baseURI(); - return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; - } - - /** - * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each - * token will be the concatenation of the `baseURI` and the `tokenId`. Empty - * by default, can be overridden in child contracts. - */ - function _baseURI() internal view virtual returns (string memory) { - return ""; - } -} diff --git a/contracts/contracts/Treasury.sol b/contracts/contracts/Treasury.sol deleted file mode 100644 index fa48e8d..0000000 --- a/contracts/contracts/Treasury.sol +++ /dev/null @@ -1,18 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity 0.8.17; - -// import "../libraries/Authorizable.sol"; -// import "../interfaces/IERC20.sol"; -import "@openzeppelin/contracts/access/Ownable.sol"; - -contract Treasury is Ownable { - ///@param _amount The amount of ETH to send. - ///@param _recipient The recipient of this value. - function withdrawFunds(uint256 _amount, address _recipient) external onlyOwner { - require(_amount <= address(this).balance, "Insufficient balance"); - payable(_recipient).transfer(_amount); - } - - receive() external payable {} -} diff --git a/contracts/contracts/UserNFT.sol b/contracts/contracts/UserNFT.sol deleted file mode 100644 index 378b6b3..0000000 --- a/contracts/contracts/UserNFT.sol +++ /dev/null @@ -1,94 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity 0.8.17; - -import "./interfaces/IUserNFT.sol"; -import {SBT} from "./SBT.sol"; -import "@openzeppelin/contracts/utils/Strings.sol"; -import "@openzeppelin/contracts/utils/Address.sol"; -import "@openzeppelin/contracts/utils/Counters.sol"; - -contract UserNFT is IUserNFT, SBT { - using Strings for uint256; - - using Counters for Counters.Counter; - - // Optional mapping for token URIs - mapping(uint256 => string) private _tokenURIs; - - Counters.Counter private tokenUriIds; - - address public owner; - - constructor( - string memory name, - string memory symbol, - address _owner - ) SBT(name, symbol) { - owner = _owner; - } - - // FUNCTIONS - function mint(address nutritionist, string memory uri) external override { - require(msg.sender == owner, "caller not owner"); - _mintUsingAutomaticTokenId(nutritionist); - tokenUriIds.increment(); - uint256 tokenUriId = tokenUriIds.current(); - - _setTokenURI(tokenUriId, uri); - - emit MintUserNFT(nutritionist); - } - - function burn(address nutritionist, uint256 _tokenId) external override { - require(msg.sender == owner, "caller not owner"); - _burn(nutritionist, _tokenId); - - if (bytes(_tokenURIs[_tokenId]).length != 0) { - delete _tokenURIs[_tokenId]; - } - - emit BurnUserNFT(nutritionist, _tokenId); - } - - /** - * @dev See {IERC721Metadata-tokenURI}. - */ - function tokenURI( - uint256 tokenId - ) public view virtual override returns (string memory) { - _requireMinted(tokenId); - - string memory _tokenURI = _tokenURIs[tokenId]; - string memory base = _baseURI(); - - // If there is no base URI, return the token URI. - if (bytes(base).length == 0) { - return _tokenURI; - } - // If both are set, concatenate the baseURI and tokenURI (via abi.encodePacked). - if (bytes(_tokenURI).length > 0) { - return string(abi.encodePacked(base, _tokenURI)); - } - - return super.tokenURI(tokenId); - } - - /** - * @dev Sets `_tokenURI` as the tokenURI of `tokenId`. - * - * Requirements: - * - * - `tokenId` must exist. - */ - function _setTokenURI( - uint256 tokenId, - string memory _tokenURI - ) internal virtual { - require( - _exists(tokenId), - "ERC721URIStorage: URI set of nonexistent token" - ); - _tokenURIs[tokenId] = _tokenURI; - } -} diff --git a/contracts/contracts/built.txt b/contracts/contracts/built.txt deleted file mode 100644 index 3c07edb..0000000 --- a/contracts/contracts/built.txt +++ /dev/null @@ -1,10 +0,0 @@ -We built the first community blockchain based project powered to promote healthy living around the world. People are becoming obsessed with living longer, but they don't know how, they are spending so much money on drugs and supplements, but we don't think they're approaching this correctly, so that's why we at RejuvenateAI have come up with this idea to focus on nutrition and fitness. Our project consists of user and nutrionist NFTs which will be minted for you depending on whatever option you sign up as, either as a user or nutritionist, we charge users a subscription fee to access our platform and enjoy our services, which include fitness and premium meal plans as well as consultation with nutritionists, when a nutritionist wants to sign up, they upload their credentials securely which we verify to see if they're legitimate before onboarding them, we also collate data from users to get the rate at which they age. Nutritionists can also create meal & fitness plans and write articles. - -We plan to continue building and possibly turn the project into a fully fledged startup and start reaching out to nutritionists on social media, and actively start looking for our first set of users. - - - - -// We built the first community blockchain based project powered to promote healthy living and achieve healthy locations where people live to a 100 years all around the world. -// People are becoming obsessed with living longer, but they don't know how, they are spending so much money on drugs and supplements, but are they really doing it correctly? We don't think so, so that's why we at RejuvenateAI have come up with this idea to focus on nutrition and fitness. We bring together people from all around the world and build healthy communities, where people engage in healthy living all around the world. -// Our project consists of user and nutrionist NFTs which will be minted for you depending on whatever option you sign up as, we charge users a subscription fee to access our platform diff --git a/contracts/contracts/interfaces/INutritionistNFT.sol b/contracts/contracts/interfaces/INutritionistNFT.sol deleted file mode 100644 index f618c25..0000000 --- a/contracts/contracts/interfaces/INutritionistNFT.sol +++ /dev/null @@ -1,20 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity 0.8.17; - -import "./ISBT.sol"; - -/** - * @title IERC4671 - * @dev Interface implementation for {https://eips.ethereum.org/EIPS/eip-4671} - */ -interface INutritionistNFT is ISBT { - - event MintNutritionistNFT(address nutritionist); - - event BurnNutritionistNFT(address member, uint256 tokenId); - - function mint(address nutritionist, string memory uri) external; - - function burn(address nutritionist, uint256 _tokenId) external; -} diff --git a/contracts/contracts/interfaces/ISBT.sol b/contracts/contracts/interfaces/ISBT.sol deleted file mode 100644 index 17f4111..0000000 --- a/contracts/contracts/interfaces/ISBT.sol +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity 0.8.17; - -import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; - -/** - * @title IERC4671 - * @dev Interface implementation for {https://eips.ethereum.org/EIPS/eip-4671} - */ -interface ISBT is IERC721 { - function getTokenIdOfOwner(address owner) external view returns (uint256); -} diff --git a/contracts/contracts/interfaces/IUserNFT.sol b/contracts/contracts/interfaces/IUserNFT.sol deleted file mode 100644 index fa266dc..0000000 --- a/contracts/contracts/interfaces/IUserNFT.sol +++ /dev/null @@ -1,21 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity 0.8.17; - -import "./ISBT.sol"; - -/** - * @title IERC4671 - * @dev Interface implementation for {https://eips.ethereum.org/EIPS/eip-4671} - */ -interface IUserNFT is ISBT { - - event MintUserNFT(address member); - - event BurnUserNFT(address member, uint256 tokenId); - - function mint(address member, string memory uri) external; - - function burn(address member, uint256 _tokenId) external; - -} diff --git a/contracts/contracts/interfaces/KeeperRegistrarInterface.sol b/contracts/contracts/interfaces/KeeperRegistrarInterface.sol deleted file mode 100644 index 0e288e8..0000000 --- a/contracts/contracts/interfaces/KeeperRegistrarInterface.sol +++ /dev/null @@ -1,17 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity 0.8.17; - -interface KeeperRegistrarInterface { - function register( - string memory name, - bytes calldata encryptedEmail, - address upkeepContract, - uint32 gasLimit, - address adminAddress, - bytes calldata checkData, - uint96 amount, - uint8 source, - address sender - ) external; -} \ No newline at end of file diff --git a/contracts/scripts/deployContracts.ts b/contracts/scripts/deployContracts.ts deleted file mode 100644 index de310d9..0000000 --- a/contracts/scripts/deployContracts.ts +++ /dev/null @@ -1,126 +0,0 @@ -import { Wallet, getDefaultProvider } from "ethers"; -//require('dotenv').config() -import { ethers } from "hardhat"; -import { NutritionistNFT__factory, UserNFT__factory, Treasury__factory, Community__factory } from "../typechain-types"; - -//const PRIVATE_KEY = process.env.PRIVATE_KEY || ""; -//const wallet = new ethers.Wallet(PRIVATE_KEY, ethers.provider); - -const privateKey = process.env.PRIVATE_KEY as string; -const wallet = new Wallet(privateKey); - -const arbitrumRpc = "https://goerli-rollup.arbitrum.io/rpc" -const registryAddr = "0x37D9dC70bfcd8BC77Ec2858836B923c560E891D1" -const registrarAddr = "0x1433C1BDfCF1b2E1CE843Ede6FcC5d6e409fE56E" -const linkAddr = "0xd14838A68E8AFBAdE5efb411d5871ea0011AFd28" - -async function main() { - //await deployCommunityContracts(); - - await setupNFTs(); -} - -async function deployTreasury() { - //console.log("Deploying Treasury...."); - - //const provider = getDefaultProvider(rpc) - //const connectedWallet = wallet.connect(provider); - //const TreasuryFactory = new Treasury__factory(connectedWallet); - - const TreasuryFactory: Treasury__factory = await ethers.getContractFactory("Treasury"); - const treasury = await TreasuryFactory.deploy(); - await treasury.deployed(); - console.log("---- Treasury Contract was deployed to: ---- ", treasury.address); - return treasury.address; -} - -async function deployUserNFT(_communityAddr: any) { - //console.log("Deploying UserNFT...."); - const UserNFTFactory: UserNFT__factory = await ethers.getContractFactory("UserNFT"); - const userNFT = await UserNFTFactory.deploy("User NFT", "UST", _communityAddr); - await userNFT.deployed(); - console.log("---- UserNFT Contract was deployed to: ---- ", userNFT.address); - return userNFT.address; -} - -async function deployNutritionistNFT(_communityAddr: any) { - //console.log("Deploying NutrionistNFT...."); - const NutritionistNFTFactory: NutritionistNFT__factory = await ethers.getContractFactory("NutritionistNFT"); - const nutritionistNFT = await NutritionistNFTFactory.deploy("Nutritionist NFT", "NUT", _communityAddr); - await nutritionistNFT.deployed(); - console.log("---- NutritionistNFT Contract was deployed to: ---- ", nutritionistNFT.address); - return nutritionistNFT.address; -} - -async function setupNFTs() { - let userNFTAddr = "0x6D919b8dC30BEf41b56Aa8b18b2052c9459F8E9A" - let nutritionistNFTAddr = "0xA39d26482B5c226Fd02A5f3e159C72ee03d63Fc0" - let communityAddr = "0x3a65168B746766066288B83417329a7F901b5569" - - const provider = getDefaultProvider(arbitrumRpc); - const connectedWallet = wallet.connect(provider); - - const communityFactory = new Community__factory(connectedWallet); - const community = communityFactory.attach(communityAddr); - - try { - console.log("Setting up NFTs for Arbitrum") - const tx = await community.setNFTs(userNFTAddr, nutritionistNFTAddr); - await tx.wait(); - console.log("NFTs setup successful") - } - - catch (error) { - console.log(`[source] community.setNFTs ERROR!`); - console.log(`[source]`, error); - - } -} - - -async function deployCommunityContracts() { - console.log("Deploying Contracts for Arbitrum...."); - let treasuryAddr; - let communityAddr; - try { - console.log("Deploying treasury for Arbitrum"); - treasuryAddr = await deployTreasury(); - - const CommunityFactory: Community__factory = await ethers.getContractFactory("Community"/*, wallet*/); - - console.log("Deploying Community contract for Arbitrum"); - const community = await CommunityFactory.deploy(treasuryAddr, linkAddr, registrarAddr, registryAddr); - await community.deployed(); - communityAddr = community.address; - console.log("---- Community Contract for Arbitrum was deployed to Arbitrum testnet at this address: ---- ", community.address); - } - catch (error) { - console.error("Error deploying Community for Arbitrum:", error); - throw error; - } - - console.log("Deploying UserNFT for Arbitrum...."); - let userNFT; - try { - userNFT = await deployUserNFT(communityAddr); - } - catch (error) { - console.error("Error User NFT for Arbitrum:", error); - throw error; - } - - console.log("Deploying NutritionistNFT for Arbitrum...."); - let nutritionistNFT; - try { - nutritionistNFT = await deployNutritionistNFT(communityAddr); - } - catch (error) { - console.error("Error Nutritionist NFT for Arbitrum:", error); - throw error; - } -} - -main().catch((error) => { - console.error(error) - process.exitCode = 1 -}) diff --git a/contracts/scripts/deployed.txt b/contracts/scripts/deployed.txt deleted file mode 100644 index 4545a86..0000000 --- a/contracts/scripts/deployed.txt +++ /dev/null @@ -1,9 +0,0 @@ -Deploying Contracts for Arbitrum.... -Deploying treasury for Arbitrum ----- Treasury Contract was deployed to: ---- 0x9E1eF5A92C9Bf97460Cd00C0105979153EA45b27 -Deploying Community contract for Arbitrum ----- Community Contract for Arbitrum was deployed to Arbitrum testnet at this address: ---- 0x3a65168B746766066288B83417329a7F901b5569 -Deploying UserNFT for Arbitrum.... ----- UserNFT Contract was deployed to: ---- 0x6D919b8dC30BEf41b56Aa8b18b2052c9459F8E9A -Deploying NutritionistNFT for Arbitrum.... ----- NutritionistNFT Contract was deployed to: ---- 0xA39d26482B5c226Fd02A5f3e159C72ee03d63Fc0 \ No newline at end of file diff --git a/contracts/scripts/predictor.ts b/contracts/scripts/predictor.ts deleted file mode 100644 index 4f25767..0000000 --- a/contracts/scripts/predictor.ts +++ /dev/null @@ -1,22 +0,0 @@ -import OpenAI from 'openai'; -require("dotenv").config(); - - -import {initial_condition, prompt1} from "./prompts" -const openai = new OpenAI({ - apiKey: process.env.OPENAI_API_KEY // defaults to process.env["OPENAI_API_KEY"] -}); - -async function main() { - const completion = await openai.chat.completions.create({ - messages: [ - { role: 'assistant', content: initial_condition }, - { role: 'user', content: prompt1 }, - ], - model: 'gpt-3.5-turbo', - }); - - console.log(completion['choices'][0]['message']); -} - -main(); \ No newline at end of file diff --git a/contracts/scripts/prompts.ts b/contracts/scripts/prompts.ts deleted file mode 100644 index 508c70d..0000000 --- a/contracts/scripts/prompts.ts +++ /dev/null @@ -1,87 +0,0 @@ -const data = { - "What's your date of birth": [], - "What's your biological sex": ["Male", "Female"], - "What's your weight?": [], - "What's your height in inches?": [], - "Tell us about your diet?": [ - "I eat 5 or more servings of vegetables per day", - "I eat two or more servings of fruit per day", - "I have two or more servings of dairy (or equivalent) per day", - "My cereals are mostly whole grains", - "I eat fast lean protein every day", - "I eat fast food once per week or less", - "I eat pastries or cakes once a week or less", - "I have less than 1 teaspoon of salt per day", - "I have 2 or less alcholic drinks on any day", - "I drink at least 2 litres of water per day", - ], - "How active are you on an average week?": [ - "Inactive", - "active", - "very active", - ], - "How many hours a day are you sitting": [ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 24, - ], - "How much alchohol do you drink": [ - "0 - 10 drinks a week", - "10 - 20 drinks a week", - "greater than 20 drinks a week", - ], - "Do you smoke?": ["Never smoked", "Ex smoker", "Current smoker"], - "If you are an ex-smoker, how many months ago did you stop?": [ - "less than 6 months ago", - "six to twelve months ago", - "more than twelve months ago", - ], - "If you are a current smoker, how many cigarettes do you smoke per day?": [ - "less than 5 cigarettes", - "5 to 10 cigarettes", - "11 to 20 cigarettes", - "above 20 cigarettes", - ], - "How many hours of sleep do you get per day?": [ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, - ], - "Rate your overall Health": [ - "Excellent", - "Very good", - "Good", - "Fair", - "Poor", - ], -}; - -export const initial_condition = ` - You are a robot built by rejuvenateAI. Your goal is to predict the rate of aging of users. - You must respond with the following json output and nothing else. (Reverse, Fast, Moderate, Slow) - example: {"aging": "Fast"} - - These outputs depend on the input data provided. - An input data is a json object, with questions as keys and the possible answers as values. - Note the values are a list of strings. - - example ${data} -` - -export const prompt1 = ` - Given the following: - - Date of Birth: 10 August 1990 - Sex: Female - Weight: 80kg - Height: 5ft 5 - Diet: "I eat fast food once per week or less" and "I have less than 1 teaspoon of salt per day" - Physical Activity: Inactive - Hours Sitting Per Day: 10 hours - Alcohol Rate: Greater than 20 drinks a week - Smoking: Current smoker (11 to 20 cigarettes per day) - Sleep Per Day: 4 hours - Overall Health Rating: Poor - - Calculate my rate of aging? - Ensure to respond with the output option on the initial condition. - I know you don't have enough data but use your best understanding. - Respond with either Reverse, Fast, Moderate, or Slow. Remember as a json object. -` \ No newline at end of file diff --git a/package.json b/package.json index 01a836a..9919d0d 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "name": "my-project", "version": "0.1.0", "private": true, + "scripts": { "dev": "next dev", "build": "next build", diff --git a/src/components/dashboard-sidebar/index.tsx b/src/components/dashboard-sidebar/index.tsx index 7938ae5..a72924f 100644 --- a/src/components/dashboard-sidebar/index.tsx +++ b/src/components/dashboard-sidebar/index.tsx @@ -29,7 +29,8 @@ export default function DashboardSideBar(props: { : 'text-secondaryGray' }`} > - { - const { isOpen, onOpen, onClose } = useDisclosure() +const Header = ({ bg = 'transparent' }: { bg?: string }) => { + const { isOpen, onOpen, onClose } = useDisclosure(); - const { setAddress } = useAppContext(); - const { address } = useAccount(); - const { isConnected } = useAccount(); + const { setAddress, setIsUserConnected } = useAppContext(); + const { address, isConnected } = useAccount(); const { openConnectModal } = useConnectModal(); + useEffect(() => { setAddress(`${address}`); - }, [address, setAddress]); + setIsUserConnected(isConnected); + }, [address, setAddress, isConnected, setIsUserConnected]); return ( <> -
-
- - - -
- - {address && ( +
+
+ + + +
+ + {address && isConnected && ( <> - - + )} - {!address && - - } - {/* */} - - -
+ {!address && !isConnected && ( + + )} + {/* */} +
- ); }; diff --git a/src/components/new-user-type/index.tsx b/src/components/new-user-type/index.tsx index 75ba074..d742066 100644 --- a/src/components/new-user-type/index.tsx +++ b/src/components/new-user-type/index.tsx @@ -1,43 +1,48 @@ -import { Box, Button, Radio, RadioGroup, Stack, Text } from "@chakra-ui/react" -import { useState } from "react" +import { Box, Button, Radio, RadioGroup, Stack, Text } from '@chakra-ui/react'; +import { useState } from 'react'; -export type RegisterType='individual'|'nutritionist' -export const NewUserType=({onClick,getValue}:{onClick?:()=>void,getValue?:(val:RegisterType)=>void})=>{ -const [value,setValue]=useState('individual'); -const handleRadioChange=(val:RegisterType)=>{ -setValue(val); -getValue?.(val) -} - return - - - - - - - -Individual - - - -I want to join a community - - - - - - - -Nutritionist - - - -I want to contribute as a nutritionist - - - - - - +export type RegisterType = 'individual' | 'nutritionist'; +export const NewUserType = ({ + onClick, + getValue, +}: { + onClick?: () => void; + getValue?: (val: RegisterType) => void; +}) => { + const [value, setValue] = useState('individual'); + const handleRadioChange = (val: RegisterType) => { + setValue(val); + getValue?.(val); + }; + return ( + + + + + + + Individual + + + I want to join a community + + + + + + + Nutritionist + + + I want to contribute as a nutritionist + + + + + + -} \ No newline at end of file + ); +}; diff --git a/src/components/register-form/index.tsx b/src/components/register-form/index.tsx index cba9639..db77e77 100644 --- a/src/components/register-form/index.tsx +++ b/src/components/register-form/index.tsx @@ -1,33 +1,63 @@ 'use client'; -import React, { RefObject, useRef, useState } from 'react'; +import React, { RefObject, useRef, useState, forwardRef } from 'react'; //import { useRouter } from 'next/navigation'; import { useRouter } from 'next/router'; -import { useForm } from 'react-hook-form'; +import { useForm, FormProvider, useFormState } from 'react-hook-form'; import { yupResolver } from '@hookform/resolvers/yup'; +import { useAppContext } from '@/context/state'; +import { + useContractWrite, + usePrepareContractWrite, + useWaitForTransaction, +} from 'wagmi'; +import { ethers } from 'ethers'; import * as Yup from 'yup'; -import { Stack, +import { + Stack, Modal, ModalOverlay, ModalContent, ModalHeader, ModalFooter, ModalBody, - ModalCloseButton, Button, Box, HStack, Input, Select } from '@chakra-ui/react'; + ModalCloseButton, + Button, + Box, + HStack, + Input, + Select, +} from '@chakra-ui/react'; import { NewUserType, RegisterType } from '../new-user-type'; //import { useAuth } from "near-social-bridge"; -import {Swiper,SwiperRef,SwiperSlide} from 'swiper/react'; +import { Swiper, SwiperRef, SwiperSlide } from 'swiper/react'; import SwiperMain from 'swiper'; import Icon from '../Icon'; import NutritionistForm from '../nutritionist-form'; - - -const RegisterForm = ({isOpen,onClose}:{isOpen:boolean,onClose:()=>void}) => { +import { useAccount } from 'wagmi'; +import { putJSONandGetHash } from '@/helpers/prompt'; +import { useDebounce } from '@/hooks/useDebounce'; +import { communityAbi } from '../../../abis'; +import { communityAddr } from '@/utils/constants'; + +const RegisterForm = ({ + isOpen, + onClose, +}: { + isOpen: boolean; + onClose: () => void; +}) => { //const auth = useAuth() + const { address } = useAccount(); const router = useRouter(); -const swiperRef=useRef() -const swiperNestedRef=useRef() -const [activeSlideIndex,setActiveSlideIndex]=useState(0); -const [SelectedUserType,setSelectedUserType]=useState('individual') + const swiperRef = useRef(); + const swiperNestedRef = useRef(); + const [activeSlideIndex, setActiveSlideIndex] = useState(0); + const [SelectedUserType, setSelectedUserType] = + useState('individual'); + const { user, setUser, allTokensData } = useAppContext(); + const [amount, setAmount] = useState('0.01'); + const debouncedAmount = useDebounce(amount, 500); + // form validation rules const validationSchema = Yup.object().shape({ fullName: Yup.string().required('Field is required'), @@ -49,355 +79,472 @@ const [SelectedUserType,setSelectedUserType]=useState('individual' // get functions to build form with useForm() hook const { register, handleSubmit, reset, formState } = useForm(formOptions); - const { errors,isValid } = formState; + const { errors, isValid } = formState; + const [cid, setCid] = useState(''); + + const { config } = usePrepareContractWrite({ + //@ts-ignore + address: communityAddr, + abi: communityAbi, + functionName: 'joinCommunity', + args: [cid, allTokensData.userNftUri], + //@ts-ignore + value: ethers.utils.parseEther(debouncedAmount || '0'), + }); - const onValidSubmit = async (data: any) => { - // const cid = await uploadPromptToIpfs(data); - if(isValid) { + const { write: joinCommunity, data } = useContractWrite(config); + const { isLoading } = useWaitForTransaction({ + hash: data?.hash, + onSuccess(tx) { + console.log(tx); router.push('/member/dashboard'); + }, + }); + + const onValidSubmit = async (data: any) => { + if (isValid) { + // Serialize the form data into a JSON object + const formDataObject = { + fullName: data.fullName, + sex: data.sex, + weight: data.weight, + height: data.height, + diet: data.diet, + active: data.active, + sitting: data.sitting, + alcohol: data.alcohol, + smoke: data.smoke, + sleepLength: data.sleepLength, + overallHealth: data.overallHealth, + birthDate: data.birthDate, + smokingStopped: data.smokingStopped, + smokingLength: data.smokingLength, + }; + + const cid = await putJSONandGetHash(formDataObject); + + setCid(cid); + setUser({ + ...user, + userAddress: address, + userCidData: cid, + name: data.fullName, + }); + + joinCommunity?.(); } }; -// const onInvalidSubmit = (errors:any,event:BaseSyntheticEvent) => { -// event.preventDefault() -// // const cid = await uploadPromptToIpfs(data); - -// }; - const dietOptions = [ - 'I eat 5 or more servings of vegetables per day', - 'I eat two or more servings of fruit per day', - 'I have two or more servings of dairy (or equivalent) per day', - 'My cereals are mostly whole grains', - 'I eat fast lean protein every day', - 'I eat fast food once per week or less', - 'I eat pastries or cakes once a week or less', - 'I have less than 1 teaspoon of salt per day', - 'I have 2 or less alcoholic drinks on any day', - 'I drink at least 2 litres of water per day', - ]; + // const onInvalidSubmit = (errors:any,event:BaseSyntheticEvent) => { + // event.preventDefault() + // // const cid = await uploadPromptToIpfs(data); + // }; + const dietOptions = [ + 'I eat 5 or more servings of vegetables per day', + 'I eat two or more servings of fruit per day', + 'I have two or more servings of dairy (or equivalent) per day', + 'My cereals are mostly whole grains', + 'I eat fast lean protein every day', + 'I eat fast food once per week or less', + 'I eat pastries or cakes once a week or less', + 'I have less than 1 teaspoon of salt per day', + 'I have 2 or less alcoholic drinks on any day', + 'I drink at least 2 litres of water per day', + ]; - const swiperNestedNext=()=>{ - swiperNestedRef.current?.swiper.slideNext() - } - const swiperNestedPrev=()=>{ - swiperNestedRef.current?.swiper.slidePrev() - } + const swiperNestedNext = () => { + swiperNestedRef.current?.swiper.slideNext(); + }; + const swiperNestedPrev = () => { + swiperNestedRef.current?.swiper.slidePrev(); + }; const overallHealthOptions = [ - 'Excellent', - 'Very good', - 'Good', - 'Fair', - 'Poor' + 'Excellent', + 'Very good', + 'Good', + 'Fair', + 'Poor', ]; const smokingOptions = [ - 'less than 5 cigarettes', - '5 to 10 cigarettes', - '11 to 20 cigarettes', - 'above 20 cigarettes' + 'less than 5 cigarettes', + '5 to 10 cigarettes', + '11 to 20 cigarettes', + 'above 20 cigarettes', ]; return ( -
- - +
+ - - -{activeSlideIndex===1 && - -} - - - Register - + + + {activeSlideIndex === 1 && ( + + )} + Register - + - {setActiveSlideIndex(swiper.activeIndex)}} ref={swiperRef as RefObject} allowTouchMove={false}> - - - swiperRef.current?.swiper.slideNext()} getValue={setSelectedUserType}/> - - -{SelectedUserType=='individual' && - -
- - }> - - - -
- - -
{errors.fullName?.message}
-
-
- -
{errors.birthDate?.message}
-
-
- -
{errors.sex?.message}
-
-
- - - - - -
- - - -
- -
{errors.weight?.message}
-
-
- -
{errors.height?.message}
-
-
- -
{errors.diet?.message}
-
-
- -
{errors.active?.message}
-
-
- - - - - - - - -
- - - -
- -
{errors.sitting?.message}
-
-
- -
{errors.alcohol?.message}
-
-
- -
{errors.smoke?.message}
-
-
- -
-
- - - - - - - - -
- - - -
- -
-
- -
{errors.sleepLength?.message}
-
-
- -
{errors.overallHealth?.message}
-
-
- - - - - - - -
-
- - -
- - - -} -{SelectedUserType==='nutritionist' && - - - -} - -
+ + swiperRef.current?.swiper.slideNext()} + getValue={setSelectedUserType} + /> + + + {SelectedUserType == 'individual' && ( +
+ } + > + + +
+ +
+ {errors.fullName?.message} +
+
+
+ +
+ {errors.birthDate?.message} +
+
+
+ +
+ {errors.sex?.message} +
+
+
+ + + + +
+ + + +
+ +
+ {errors.weight?.message} +
+
+
+ +
+ {errors.height?.message} +
+
+
+ +
+ {errors.diet?.message} +
+
+
+ +
+ {errors.active?.message} +
+
+
+ + + + + +
+ + +
+ +
+ {errors.sitting?.message} +
+
+
+ +
+ {errors.alcohol?.message} +
+
+
+ +
+ {errors.smoke?.message} +
+
+
+ +
+
+ + + + + +
+ + +
+ +
+
+ +
+ {errors.sleepLength?.message} +
+
+
+ +
+ {errors.overallHealth?.message} +
+
+
+ + + + + + +
+
+
+ )} + {SelectedUserType === 'nutritionist' && ( + + + + )} +
-
@@ -408,7 +555,6 @@ const [SelectedUserType,setSelectedUserType]=useState('individual'
-
); }; diff --git a/src/context/state.tsx b/src/context/state.tsx index 39e5644..33e8086 100644 --- a/src/context/state.tsx +++ b/src/context/state.tsx @@ -1,32 +1,7 @@ 'use client'; import { createContext, useContext, useState } from 'react'; import { stateContextType } from '../types/state'; -// import { WagmiConfig, createConfig } from "wagmi"; -// import { -// ConnectKitProvider, -// getDefaultConfig, -// } from "connectkit"; -// import { mainnet, polygon, optimism, arbitrum } from "wagmi/chains"; - -// const chains = [mainnet, polygon, optimism, arbitrum]; - -// const config = createConfig( -// getDefaultConfig({ -// // Required API Keys -// alchemyId: process.env.ALCHEMY_ID, // or infuraId -// walletConnectProjectId: "", -// chains, - -// // Required -// appName: "Your App Name", - -// // Optional -// appDescription: "Your App Description", -// appUrl: "https://family.co", // your app's url -// appIcon: "https://family.co/logo.png", // your app's icon, no bigger than 1024x1024px (max. 1MB) -// }) -// ); - +import { useAccount, useNetwork, useWalletClient } from "wagmi"; const contextDefaultValue: stateContextType = { allTokensData: {}, @@ -35,6 +10,10 @@ const contextDefaultValue: stateContextType = { setAddress: () => null, loading: false, setLoading: () => null, + isUserConnected: false, + setIsUserConnected: () => null, + user: {}, + setUser: () => null }; type StateContextProviderProps = { @@ -44,9 +23,26 @@ type StateContextProviderProps = { const AppContext = createContext(contextDefaultValue); export function AppWrapper({ children }: StateContextProviderProps) { - const [allTokensData, setAllTokenData] = useState(); + const [allTokensData, setAllTokenData] = useState({ + userNftUri: "bafkreihfweuclvhaozl7q6zsjjyrkh262vlbzqyd5m3lijrnjefh6pxy3i", + nutritionistNftUri: "" + }); const [address, setAddress] = useState(''); const [loading, setLoading] = useState(false); + const [isUserConnected, setIsUserConnected] = useState(false); + // const [step, setStep] = useState(1); + + const [user, setUser] = useState( + { + userAddress: "", + name: "", + userCidData: "", + startDate: "", + endDate: "", + amount: "" + } + ) + const [nutritionist, setNutritionist] = useState("") let sharedState = { allTokensData, @@ -55,6 +51,10 @@ export function AppWrapper({ children }: StateContextProviderProps) { setAddress, loading, setLoading, + isUserConnected, + setIsUserConnected, + user, + setUser }; return ( @@ -70,3 +70,57 @@ export function AppWrapper({ children }: StateContextProviderProps) { export function useAppContext() { return useContext(AppContext); } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +// import { WagmiConfig, createConfig } from "wagmi"; +// import { +// ConnectKitProvider, +// getDefaultConfig, +// } from "connectkit"; +// import { mainnet, polygon, optimism, arbitrum } from "wagmi/chains"; + +// const chains = [mainnet, polygon, optimism, arbitrum]; + +// const config = createConfig( +// getDefaultConfig({ +// // Required API Keys +// alchemyId: process.env.ALCHEMY_ID, // or infuraId +// walletConnectProjectId: "", +// chains, + +// // Required +// appName: "Your App Name", + +// // Optional +// appDescription: "Your App Description", +// appUrl: "https://family.co", // your app's url +// appIcon: "https://family.co/logo.png", // your app's icon, no bigger than 1024x1024px (max. 1MB) +// }) +// ); diff --git a/src/helpers/prompt.ts b/src/helpers/prompt.ts index 43f1c05..4d6031c 100644 --- a/src/helpers/prompt.ts +++ b/src/helpers/prompt.ts @@ -24,9 +24,18 @@ export function maskHexAddress(address:string) { } +// function makeStorageClient() { +// return new Web3Storage({ token: getAccessToken() }); +// } + function makeStorageClient() { - return new Web3Storage({ token: getAccessToken() }); + const token = getAccessToken() as string; + return new Web3Storage({ + token: + 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJkaWQ6ZXRocjoweDhmOWMxOTNjODJlODMzMjVDMThkNWM4NzRCM2Q2NGM5ZjI5NDdEOUQiLCJpc3MiOiJ3ZWIzLXN0b3JhZ2UiLCJpYXQiOjE2ODM2NTY1NzExNjEsIm5hbWUiOiJLb2lpIn0.qZJmInvmwLCkq_7T3h2gfm4Hs84MNKEVooOuAFfbIXI', + }); } + export const uploadPromptToIpfs = async (data: any) => { const client = makeStorageClient(); const prompt = { @@ -130,3 +139,15 @@ export const uploadPromptToIpfs = async (data: any) => { console.log(res); return res; }; + +export const putJSONandGetHash = async (json: any) => { + const client = makeStorageClient(); + const content = new Blob([JSON.stringify(json)], { + type: 'application/json', + }); + const fileObj = new File([content], 'file.json', { + type: 'application/json', + }); + const res = await client.put([fileObj]); + return res; +}; \ No newline at end of file diff --git a/src/hooks/useDebounce.ts b/src/hooks/useDebounce.ts new file mode 100644 index 0000000..2b32a74 --- /dev/null +++ b/src/hooks/useDebounce.ts @@ -0,0 +1,15 @@ +import { useEffect, useState } from "react"; + +export function useDebounce(value: T, delay?: number): T { + const [debouncedValue, setDebouncedValue] = useState(value); + + useEffect(() => { + const timer = setTimeout(() => setDebouncedValue(value), delay || 500); + + return () => { + clearTimeout(timer); + }; + }, [value, delay]); + + return debouncedValue; +} diff --git a/src/pages/community/[id]/index.tsx b/src/pages/community/[id]/index.tsx index b36bdad..8bc37bb 100644 --- a/src/pages/community/[id]/index.tsx +++ b/src/pages/community/[id]/index.tsx @@ -1,12 +1,18 @@ -'use client' -import { Box, Flex } from "@chakra-ui/react" +'use client'; +import { Box, Flex } from '@chakra-ui/react'; -export default function CommunityViewPage(){ - - - return - -Community - +export default function CommunityViewPage() { + return ( + + + Community + -} \ No newline at end of file + ); +} diff --git a/src/pages/community/index.tsx b/src/pages/community/index.tsx index f12aacf..bc6b559 100644 --- a/src/pages/community/index.tsx +++ b/src/pages/community/index.tsx @@ -23,7 +23,7 @@ import { } from '@chakra-ui/react'; import { format } from 'date-fns'; import { useEffect, useState } from 'react'; -import RandomAvatar from 'boring-avatars' +import RandomAvatar from 'boring-avatars'; //@ts-ignore import DatePicker from 'react-datepicker'; type Community = { @@ -32,25 +32,44 @@ type Community = { cover: string; membersCount: number; id: number; - slug: string;members:object[] + slug: string; + members: object[]; }; -const communities=[{ - name:'All for good',id:1,slug:'all-for-good-erd4',membersCount:20,members:[{ - - }],cover:'',description:'Join a movement that goes beyond personal well-being. In the "All for Good" nutrition community, we believe in the power of nutrition to create positive change. Share your journey towards a healthier you, engage in impactful discussions about sustainable eating, and explore how good nutrition can contribute to a better world. Every meal counts, and together, we\'re making choices that are "All for Good."' -},{ - name:'Live life to fullness',id:2,slug:'live-life-to-fullness-fed3',membersCount:10,members:[{ - - }],cover:'',description:'Experience a community that encourages you to savor every bite and live life to the fullest through mindful nutrition. In "Live Life to Fullness," we embrace a holistic approach to well-being, celebrating the pleasures of nourishing both body and soul. Discover a wealth of resources, connect with fellow members on a journey to vitality, and learn how to make every aspect of your life more fulfilling through balanced and joyful nutrition.' -},{ - name:'Meet your faves',id:3,slug:'meet-your-faves-acd2',membersCount:45,members:[{ - - }],cover:'',description:'Discover a vibrant community where nutrition enthusiasts unite to share their favorite recipes, wellness tips, and success stories. Connect with like-minded individuals, learn from nutrition experts, and celebrate the joy of nourishing your body. In "Meet Your Faves," we believe that building a supportive network is key to embracing a healthier lifestyle together.' -}] +const communities = [ + { + name: 'All for good', + id: 1, + slug: 'all-for-good-erd4', + membersCount: 20, + members: [{}], + cover: '', + description: + 'Join a movement that goes beyond personal well-being. In the "All for Good" nutrition community, we believe in the power of nutrition to create positive change. Share your journey towards a healthier you, engage in impactful discussions about sustainable eating, and explore how good nutrition can contribute to a better world. Every meal counts, and together, we\'re making choices that are "All for Good."', + }, + { + name: 'Live life to fullness', + id: 2, + slug: 'live-life-to-fullness-fed3', + membersCount: 10, + members: [{}], + cover: '', + description: + 'Experience a community that encourages you to savor every bite and live life to the fullest through mindful nutrition. In "Live Life to Fullness," we embrace a holistic approach to well-being, celebrating the pleasures of nourishing both body and soul. Discover a wealth of resources, connect with fellow members on a journey to vitality, and learn how to make every aspect of your life more fulfilling through balanced and joyful nutrition.', + }, + { + name: 'Meet your faves', + id: 3, + slug: 'meet-your-faves-acd2', + membersCount: 45, + members: [{}], + cover: '', + description: + 'Discover a vibrant community where nutrition enthusiasts unite to share their favorite recipes, wellness tips, and success stories. Connect with like-minded individuals, learn from nutrition experts, and celebrate the joy of nourishing your body. In "Meet Your Faves," we believe that building a supportive network is key to embracing a healthier lifestyle together.', + }, +]; const sectionTimes = [30, 45, 60, 90, 120]; export default function NutritionistPage() { - const toast = useToast({ duration: 3000, position: 'top', @@ -58,8 +77,9 @@ export default function NutritionistPage() { title: 'Your appointment was booked successfully', }); const { isOpen, onOpen, onClose } = useDisclosure(); - const [selectedCommunity, setSelectedCommunity] = - useState(null); + const [selectedCommunity, setSelectedCommunity] = useState( + null + ); const [bookingDate, setBookingDate] = useState(new Date()); const [isSubmitting, setIsSubmitting] = useState(false); const [showBookingDetails, setShowBookingDetails] = useState(false); @@ -68,11 +88,9 @@ export default function NutritionistPage() { const minsToMillisec = (mins: number) => +mins * 1000 * 60; const handleJoin = (community: Community) => { - setSelectedCommunity(community); }; - function handleBookingSubmit() { setIsSubmitting(true); @@ -97,8 +115,9 @@ export default function NutritionistPage() { {communities.map((c, i) => { return ( - - {c.cover && - - } - {!c.cover && } + {c.cover && } + {!c.cover && ( + + )} {c.name} - + {c.membersCount} members @@ -135,28 +169,26 @@ export default function NutritionistPage() { Join Community - {c.description && - - - Description - - - {c.description} - - - } + {c.description && ( + + + Description + + + {c.description} + + + )} ); })} - - ); } diff --git a/src/types/state.d.ts b/src/types/state.d.ts index 0ab4a68..0c3e5b4 100644 --- a/src/types/state.d.ts +++ b/src/types/state.d.ts @@ -9,11 +9,23 @@ export interface IAddressData { address: string; } +export interface User { + userAddress: string, + name: string, + description: string, + startDate: string, + endDate: string, +} + export type stateContextType = { address: string; allTokensData: any; loading: boolean; + isUserConnected: boolean; setAllTokenData: (data: any) => void; setAddress: (data: string) => void; setLoading: (data: boolean) => void; + setIsUserConnected: (data: boolean) => void; + user: any; + setUser: (data: any) => void; }; diff --git a/src/utils/constants/index.ts b/src/utils/constants/index.ts index 6505fde..6cb1e3c 100644 --- a/src/utils/constants/index.ts +++ b/src/utils/constants/index.ts @@ -1 +1,2 @@ export const appName = 'REJUVENATE_AI'; +export const communityAddr = "0x3a65168B746766066288B83417329a7F901b5569" \ No newline at end of file