diff --git a/package.json b/package.json index d714f27..8475360 100644 --- a/package.json +++ b/package.json @@ -11,8 +11,8 @@ "account": "yarn workspace @se-2/foundry account", "chain": "yarn workspace @se-2/foundry chain", "compile": "yarn workspace @se-2/foundry compile", - "deployDemo": "yarn workspace @se-2/foundry deployDemo", - "deployDemo:verify": "yarn workspace @se-2/foundry deployDemo:verify", + "deploy": "yarn workspace @se-2/foundry deploy", + "deploy:verify": "yarn workspace @se-2/foundry deploy:verify", "fork": "yarn workspace @se-2/foundry fork", "foundry:lint": "yarn workspace @se-2/foundry lint", "foundry:test": "yarn workspace @se-2/foundry test", diff --git a/packages/foundry/lib/reputation b/packages/foundry/lib/reputation index 7efa886..bf0938b 160000 --- a/packages/foundry/lib/reputation +++ b/packages/foundry/lib/reputation @@ -1 +1 @@ -Subproject commit 7efa886be58bfcfeb720cab7f6b68261232a9aa8 +Subproject commit bf0938bac656aa7c03f3ae94b66beebda1ae45fc diff --git a/packages/foundry/package.json b/packages/foundry/package.json index 0293f26..9471ed9 100644 --- a/packages/foundry/package.json +++ b/packages/foundry/package.json @@ -5,8 +5,8 @@ "account": "node script/ListAccount.js", "chain": "anvil --config-out localhost.json", "compile": "forge compile", - "deployDemo": "forge build --build-info --build-info-path out/build-info/ && forge script script/DeployDemo.s.sol --rpc-url ${1:-default_network} --broadcast --legacy && node script/generateTsAbis__deployDemo.js", - "deployDemo:verify": "forge build --build-info --build-info-path out/build-info/ && forge script script/DeployDemo.s.sol --rpc-url ${1:-default_network} --broadcast --legacy --verify ; node script/generateTsAbis__deployDemo.js", + "deploy": "forge build --build-info --build-info-path out/build-info/ && forge script script/Deploy.s.sol --rpc-url ${1:-default_network} --broadcast --legacy && node script/generateTsAbis.js", + "deploy:verify": "forge build --build-info --build-info-path out/build-info/ && forge script script/Deploy.s.sol --rpc-url ${1:-default_network} --broadcast --legacy --verify ; node script/generateTsAbis.js", "fork": "anvil --fork-url ${0:-mainnet} --chain-id 31337 --config-out localhost.json", "generate": "node script/generateAccount.js", "lint": "forge fmt", diff --git a/packages/foundry/remappings.txt b/packages/foundry/remappings.txt index 8bac1ba..2444cfe 100644 --- a/packages/foundry/remappings.txt +++ b/packages/foundry/remappings.txt @@ -1,2 +1,2 @@ @openzeppelin/contracts/=lib/openzeppelin-contracts/contracts -@atxdao/contracts/reputation=lib/reputation/src \ No newline at end of file +@atxdao/contracts/reputation=lib/reputation/contracts \ No newline at end of file diff --git a/packages/foundry/script/Deploy.s.sol b/packages/foundry/script/Deploy.s.sol new file mode 100644 index 0000000..54bc798 --- /dev/null +++ b/packages/foundry/script/Deploy.s.sol @@ -0,0 +1,25 @@ +//SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +import {console} from "forge-std/console.sol"; + +import {ScaffoldETHDeploy} from "./DeployHelpers.s.sol"; +import {ReputationTokensStandalone} from "@atxdao/contracts/reputation/ReputationTokensStandalone.sol"; +import {TokensPropertiesStorage} from "@atxdao/contracts/reputation/storage/TokensPropertiesStorage.sol"; +import {IReputationTokensInternal} from "@atxdao/contracts/reputation/interfaces/IReputationTokensInternal.sol"; +import {Hats} from "../contracts/Hats/Hats.sol"; + +import {DeployDemoScript} from "./DeployDemo.s.sol"; + +contract DeployScript is ScaffoldETHDeploy { + error InvalidPrivateKey(string); + + address controller = 0x62286D694F89a1B12c0214bfcD567bb6c2951491; //replace with burner or other address from wallet! + + function run() external { + DeployDemoScript deployer = new DeployDemoScript(); + deployer.run(); + + exportDeployments(); + } +} diff --git a/packages/foundry/script/DeployDemo.s.sol b/packages/foundry/script/DeployDemo.s.sol index eeeb07d..776ef5a 100644 --- a/packages/foundry/script/DeployDemo.s.sol +++ b/packages/foundry/script/DeployDemo.s.sol @@ -12,7 +12,7 @@ import {Hats} from "../contracts/Hats/Hats.sol"; contract DeployDemoScript is ScaffoldETHDeploy { error InvalidPrivateKey(string); - address controller = 0x62286D694F89a1B12c0214bfcD567bb6c2951491; //replace with burner or other address from wallet! + address controller = 0x4161f8A8DfF60aEdB63baFb7d5843b0988393eC9; //replace with burner or other address from wallet! function run() external { uint256 deployerPrivateKey = setupLocalhostEnv(); @@ -64,8 +64,6 @@ contract DeployDemoScript is ScaffoldETHDeploy { // console.log(newHatId); vm.stopBroadcast(); - - exportDeployments(); } /////////////////////////////////// @@ -87,19 +85,27 @@ contract DeployDemoScript is ScaffoldETHDeploy { function batchCreateTokens(ReputationTokensStandalone instance) public { TokensPropertiesStorage.TokenProperties[] memory tokensProperties = new TokensPropertiesStorage.TokenProperties[]( - 2 + 3 ); tokensProperties[0] = TokensPropertiesStorage.TokenProperties( + true, false, 100 ); tokensProperties[1] = TokensPropertiesStorage.TokenProperties( + true, true, 100 ); + tokensProperties[2] = TokensPropertiesStorage.TokenProperties( + false, + false, + 100 + ); + instance.batchCreateTokens(tokensProperties); } @@ -109,6 +115,10 @@ contract DeployDemoScript is ScaffoldETHDeploy { instance.setTokenURI(0, string.concat(BASE_URI, "0")); instance.setTokenURI(1, string.concat(BASE_URI, "1")); + instance.setTokenURI( + 2, + "ipfs://bafkreiheocygb3ty4uo3znjw2wz2asjzavn56owlqjoz4cvxvspg64egtq" + ); } function batchMint(ReputationTokensStandalone instance) public { @@ -116,15 +126,21 @@ contract DeployDemoScript is ScaffoldETHDeploy { mintOperations.to = controller; mintOperations - .operations = new IReputationTokensInternal.TokenOperation[](2); + .operations = new IReputationTokensInternal.TokenOperation[](3); mintOperations.operations[0] = IReputationTokensInternal.TokenOperation( 0, 50 ); mintOperations.operations[1] = IReputationTokensInternal.TokenOperation( 1, - 50 + 25 ); + + mintOperations.operations[2] = IReputationTokensInternal.TokenOperation( + 2, + 75 + ); + instance.mint(mintOperations); } } diff --git a/packages/foundry/script/generateTsAbis__deployDemo.js b/packages/foundry/script/generateTsAbis.js similarity index 92% rename from packages/foundry/script/generateTsAbis__deployDemo.js rename to packages/foundry/script/generateTsAbis.js index 2f7e543..562acf7 100644 --- a/packages/foundry/script/generateTsAbis__deployDemo.js +++ b/packages/foundry/script/generateTsAbis.js @@ -36,15 +36,18 @@ function getArtifactOfContract(contractName) { function getInheritedFromContracts(artifact) { let inheritedFromContracts = []; - for (const astNode of artifact.ast.nodes) { - if (astNode.nodeType == "ContractDefinition") { - if (astNode.baseContracts.length > 0) { - inheritedFromContracts = astNode.baseContracts.map( - ({ baseName }) => baseName.name - ); + if (artifact.ast) { + for (const astNode of artifact.ast.nodes) { + if (astNode.nodeType == "ContractDefinition") { + if (astNode.baseContracts.length > 0) { + inheritedFromContracts = astNode.baseContracts.map( + ({ baseName }) => baseName.name + ); + } } } } + return inheritedFromContracts; } @@ -69,7 +72,7 @@ function main() { const current_path_to_broadcast = path.join( __dirname, "..", - "broadcast/DeployDemo.s.sol" + "broadcast/Deploy.s.sol" ); const current_path_to_deployments = path.join(__dirname, "..", "deployments"); diff --git a/packages/nextjs/app/rep-tokens-demo/_components/RepTokensDemo.tsx b/packages/nextjs/app/rep-tokens-demo/_components/RepTokensDemo.tsx index 78813ca..769d098 100644 --- a/packages/nextjs/app/rep-tokens-demo/_components/RepTokensDemo.tsx +++ b/packages/nextjs/app/rep-tokens-demo/_components/RepTokensDemo.tsx @@ -5,7 +5,8 @@ import { addressConfigProps } from "./configs/values/AddressCardConfig"; import { balanceConfigProps } from "./configs/values/BalanceCardConfig"; import { descriptionConfigProps } from "./configs/values/DescriptionCardConfig"; import { imageConfigProps } from "./configs/values/ImageCardConfig"; -import { isTradeableConfigProps } from "./configs/values/IsTradeableCardConfig"; +import { isRedeemableConfigProps } from "./configs/values/IsRedeemableCardConfig"; +import { isSoulboundConfigProps } from "./configs/values/IsSoulboundCardConfig"; import { maxMintAmountConfigProps } from "./configs/values/MaxMintAmountCardConfig"; import { nameConfigProps } from "./configs/values/NameCardConfig"; import { useAccount } from "wagmi"; @@ -44,29 +45,6 @@ export function RepTokensDemo() { ////// Card Creation ///// - // Individual Components - const balanceProps = buildBalanceCard(tokensData?.tokens[0]?.balance, balanceConfigProps); - const nameProps = buildStringCard(tokensData?.tokens[0]?.name, nameConfigProps); - const descriptionsProps = buildStringCard(tokensData?.tokens[0]?.description, descriptionConfigProps); - const imageProps = buildImageCard(tokensData?.tokens[0]?.image, imageConfigProps); - const addressProps = buildStringCard(tokensData?.address, addressConfigProps); - - const isTradeableProps = buildStringCard( - tokensData?.tokens[0]?.properties?.isTradeable !== undefined - ? `Is Tradeable: ${tokensData?.tokens[0]?.properties.isTradeable}` - : undefined, - isTradeableConfigProps, - ); - const maxMintAmountProps = buildStringCard( - tokensData?.tokens[0]?.properties?.maxMintAmountPerTx !== undefined - ? `Max Mint Amount Per Tx: ${tokensData?.tokens[0]?.properties.maxMintAmountPerTx}` - : undefined, - maxMintAmountConfigProps, - ); - - // Single Card - const singleCard = buildTokenCard(tokensData?.tokens[0], tokensData.address, singleCardConfig); - // Multi-card const mainTokenCards = buildTokenCards( tokensData.tokens, @@ -116,9 +94,52 @@ export function RepTokensDemo() { navBarTokenGroupCardProps.addressOutput =
; } + // Single Card + const singleCard = buildTokenCard(tokensData?.tokens[0], tokensData.address, singleCardConfig); + + // Individual Components + const balanceProps = buildBalanceCard(tokensData?.tokens[0]?.balance, balanceConfigProps); + const nameProps = buildStringCard(tokensData?.tokens[0]?.name, nameConfigProps); + const descriptionsProps = buildStringCard(tokensData?.tokens[0]?.description, descriptionConfigProps); + const imageProps = buildImageCard(tokensData?.tokens[0]?.image, imageConfigProps); + const addressProps = buildStringCard(tokensData?.address, addressConfigProps); + + const isSoulboundProps = buildStringCard( + tokensData?.tokens[0]?.properties?.isSoulbound !== undefined + ? `Is Soulbound: ${tokensData?.tokens[0]?.properties.isSoulbound}` + : undefined, + isSoulboundConfigProps, + ); + + const isRedeemableProps = buildStringCard( + tokensData?.tokens[0]?.properties?.isRedeemable !== undefined + ? `Is Redeemable: ${tokensData?.tokens[0]?.properties.isRedeemable}` + : undefined, + isRedeemableConfigProps, + ); + + const maxMintAmountProps = buildStringCard( + tokensData?.tokens[0]?.properties?.maxMintAmountPerTx !== undefined + ? `Max Mint Amount Per Tx: ${tokensData?.tokens[0]?.properties.maxMintAmountPerTx}` + : undefined, + maxMintAmountConfigProps, + ); + return ( <>
+

Widget

+ + +

Multi-Card

+ + +

Multi-Card W/ Overlay

+ + +

Single Card

+ +

Individual Components

@@ -126,21 +147,10 @@ export function RepTokensDemo() {
- + +
- -

Single Card

- - -

Multi-Card

- - -

Multi-Card W/ Overlay

- - -

Widget

-
); diff --git a/packages/nextjs/app/rep-tokens-demo/_components/configs/MainTokensCardConfig.ts b/packages/nextjs/app/rep-tokens-demo/_components/configs/MainTokensCardConfig.ts index 56b5a08..7a9b117 100644 --- a/packages/nextjs/app/rep-tokens-demo/_components/configs/MainTokensCardConfig.ts +++ b/packages/nextjs/app/rep-tokens-demo/_components/configs/MainTokensCardConfig.ts @@ -48,7 +48,15 @@ export const addressConfigProps = { }, } as ValueCardConfigProps; -export const isTradeableConfigProps = { +export const isSoulboundConfigProps = { + isRendering: true, + classes: { + card: "rounded-lg bg-slate-300 ", + value: "text-1xl text-center object-center mx-auto font-bold break-all text-black", + }, +} as ValueCardConfigProps; + +export const isRedeemableConfigProps = { isRendering: true, classes: { card: "rounded-lg bg-slate-300 ", @@ -70,7 +78,8 @@ export const tokenCardValuesProps = { nameConfigProps, descriptionConfigProps, addressConfigProps, - isTradeableConfigProps, + isSoulboundConfigProps, + isRedeemableConfigProps, maxMintAmountConfigProps, } as TokenCardValuesConfigProps; diff --git a/packages/nextjs/app/rep-tokens-demo/_components/configs/MainTokensCardWithNumberOverlayConfig.ts b/packages/nextjs/app/rep-tokens-demo/_components/configs/MainTokensCardWithNumberOverlayConfig.ts index 9eca0f9..4546f1f 100644 --- a/packages/nextjs/app/rep-tokens-demo/_components/configs/MainTokensCardWithNumberOverlayConfig.ts +++ b/packages/nextjs/app/rep-tokens-demo/_components/configs/MainTokensCardWithNumberOverlayConfig.ts @@ -48,7 +48,15 @@ export const addressConfigProps = { }, } as ValueCardConfigProps; -export const isTradeableConfigProps = { +export const isSoulboundConfigProps = { + isRendering: true, + classes: { + card: "rounded-lg bg-slate-300 ", + value: "text-1xl text-center object-center mx-auto font-bold break-all text-black", + }, +} as ValueCardConfigProps; + +export const isRedeemableConfigProps = { isRendering: true, classes: { card: "rounded-lg bg-slate-300 ", @@ -70,7 +78,8 @@ export const tokenCardValuesProps = { nameConfigProps, descriptionConfigProps, addressConfigProps, - isTradeableConfigProps, + isSoulboundConfigProps, + isRedeemableConfigProps, maxMintAmountConfigProps, } as TokenCardValuesConfigProps; diff --git a/packages/nextjs/app/rep-tokens-demo/_components/configs/SingleCardConfig.ts b/packages/nextjs/app/rep-tokens-demo/_components/configs/SingleCardConfig.ts index 11fc75e..ee23f50 100644 --- a/packages/nextjs/app/rep-tokens-demo/_components/configs/SingleCardConfig.ts +++ b/packages/nextjs/app/rep-tokens-demo/_components/configs/SingleCardConfig.ts @@ -47,10 +47,18 @@ export const addressConfigProps = { }, } as ValueCardConfigProps; -export const isTradeableConfigProps = { +export const isSoulboundConfigProps = { isRendering: true, classes: { - card: "rounded-lg bg-indigo-300 ", + card: "rounded-lg bg-slate-300 ", + value: "text-1xl text-center object-center mx-auto font-bold break-all text-black", + }, +} as ValueCardConfigProps; + +export const isRedeemableConfigProps = { + isRendering: true, + classes: { + card: "rounded-lg bg-slate-300 ", value: "text-1xl text-center object-center mx-auto font-bold break-all text-black", }, } as ValueCardConfigProps; @@ -69,7 +77,8 @@ export const tokenCardValuesProps = { nameConfigProps, descriptionConfigProps, addressConfigProps, - isTradeableConfigProps, + isSoulboundConfigProps, + isRedeemableConfigProps, maxMintAmountConfigProps, } as TokenCardValuesConfigProps; diff --git a/packages/nextjs/app/rep-tokens-demo/_components/configs/values/IsRedeemableCardConfig.ts b/packages/nextjs/app/rep-tokens-demo/_components/configs/values/IsRedeemableCardConfig.ts new file mode 100644 index 0000000..8df255c --- /dev/null +++ b/packages/nextjs/app/rep-tokens-demo/_components/configs/values/IsRedeemableCardConfig.ts @@ -0,0 +1,13 @@ +import { ValueCardConfigProps } from "~~/components/rep-tokens/types/Types"; + +export const isRedeemableConfigProps = { + isRendering: true, + classes: { + card: "w-64 rounded-lg bg-indigo-300 ", + value: "text-1xl text-center object-center mx-auto font-bold break-all text-black", + }, + isPrettyLoading: { + classes: "text-black text-center", + message: "Loading Is Tradeable...", + }, +} as ValueCardConfigProps; diff --git a/packages/nextjs/app/rep-tokens-demo/_components/configs/values/IsTradeableCardConfig.ts b/packages/nextjs/app/rep-tokens-demo/_components/configs/values/IsSoulboundCardConfig.ts similarity index 90% rename from packages/nextjs/app/rep-tokens-demo/_components/configs/values/IsTradeableCardConfig.ts rename to packages/nextjs/app/rep-tokens-demo/_components/configs/values/IsSoulboundCardConfig.ts index 10cc1fa..045cb20 100644 --- a/packages/nextjs/app/rep-tokens-demo/_components/configs/values/IsTradeableCardConfig.ts +++ b/packages/nextjs/app/rep-tokens-demo/_components/configs/values/IsSoulboundCardConfig.ts @@ -1,6 +1,6 @@ import { ValueCardConfigProps } from "~~/components/rep-tokens/types/Types"; -export const isTradeableConfigProps = { +export const isSoulboundConfigProps = { isRendering: true, classes: { card: "w-64 rounded-lg bg-indigo-300 ", diff --git a/packages/nextjs/components/rep-tokens/cards/token-card/TokenCard.tsx b/packages/nextjs/components/rep-tokens/cards/token-card/TokenCard.tsx index c66c794..d700e58 100644 --- a/packages/nextjs/components/rep-tokens/cards/token-card/TokenCard.tsx +++ b/packages/nextjs/components/rep-tokens/cards/token-card/TokenCard.tsx @@ -10,7 +10,8 @@ export interface ValuesProps { descriptionProps?: StringCardProps; imageProps?: ImageCardProps; addressProps?: StringCardProps; - isTradeableProps?: StringCardProps; + isSoulboundProps?: StringCardProps; + isRedeemableProps?: StringCardProps; maxMintAmountProps?: StringCardProps; } @@ -32,7 +33,8 @@ export const TokenCard = ({ props }: TokenCardInternalProps) => { {props?.valuesProps?.nameProps ? : <>} {props?.valuesProps?.descriptionProps ? : <>} {props?.valuesProps?.addressProps ?
: <>} - {props?.valuesProps?.isTradeableProps ? : <>} + {props?.valuesProps?.isRedeemableProps ? : <>} + {props?.valuesProps?.isSoulboundProps ? : <>} {props?.valuesProps?.maxMintAmountProps ? : <>} ); diff --git a/packages/nextjs/components/rep-tokens/hooks/Hooks.tsx b/packages/nextjs/components/rep-tokens/hooks/Hooks.tsx index 1c9d366..40ceba8 100644 --- a/packages/nextjs/components/rep-tokens/hooks/Hooks.tsx +++ b/packages/nextjs/components/rep-tokens/hooks/Hooks.tsx @@ -72,6 +72,7 @@ export function useGetTokensProperties(repTokensInstance: any, tokenIds: bigint[ const arr = []; for (let i = 0; i < tokenIds.length; i++) { const result = await repTokensInstance.read.getTokenProperties([tokenIds[i]]); + if (result !== undefined) arr.push(result); } @@ -154,7 +155,8 @@ export const useRepTokens = (address?: string) => { const { uris } = useUris(repTokensInstance, tokenIds); for (let i = 0; i < uris.length; i++) { - uris[i] = uris[i].replace("ipfs://", "https://ipfs.io/ipfs/"); + uris[i] = uris[i].replace("ipfs://", "https://nftstorage.link/ipfs/"); + // uris[i] = uris[i].replace("ipfs://", "https://ipfs.io/ipfs/"); } const { responses } = useFetches(uris); diff --git a/packages/nextjs/components/rep-tokens/types/Types.tsx b/packages/nextjs/components/rep-tokens/types/Types.tsx index 39fb814..957393a 100644 --- a/packages/nextjs/components/rep-tokens/types/Types.tsx +++ b/packages/nextjs/components/rep-tokens/types/Types.tsx @@ -27,7 +27,8 @@ export interface TokenCardValuesConfigProps { nameConfigProps?: ValueCardConfigProps; descriptionConfigProps?: ValueCardConfigProps; addressConfigProps?: ValueCardConfigProps; - isTradeableConfigProps?: ValueCardConfigProps; + isSoulboundConfigProps?: ValueCardConfigProps; + isRedeemableConfigProps?: ValueCardConfigProps; maxMintAmountConfigProps?: ValueCardConfigProps; } diff --git a/packages/nextjs/components/rep-tokens/utils/buildTokensCard.tsx b/packages/nextjs/components/rep-tokens/utils/buildTokensCard.tsx index c7c1c54..8908a19 100644 --- a/packages/nextjs/components/rep-tokens/utils/buildTokensCard.tsx +++ b/packages/nextjs/components/rep-tokens/utils/buildTokensCard.tsx @@ -91,11 +91,18 @@ export function buildTokenCard(token: Token, address?: string, tokenCardProps?: if (tokenCardProps?.valuesProps?.addressConfigProps) obj.valuesProps.addressProps = buildStringCard(address, tokenCardProps?.valuesProps?.addressConfigProps); - if (tokenCardProps?.valuesProps?.isTradeableConfigProps) - obj.valuesProps.isTradeableProps = buildStringCard( - `Is Tradeable: ${token.properties.isTradeable}`, - tokenCardProps?.valuesProps?.isTradeableConfigProps, + if (tokenCardProps?.valuesProps?.isSoulboundConfigProps) + obj.valuesProps.isSoulboundProps = buildStringCard( + `Is Soulbound: ${token.properties.isSoulbound}`, + tokenCardProps?.valuesProps?.isSoulboundConfigProps, ); + + if (tokenCardProps?.valuesProps?.isRedeemableConfigProps) + obj.valuesProps.isRedeemableProps = buildStringCard( + `Is Redeemable: ${token.properties.isRedeemable}`, + tokenCardProps?.valuesProps?.isRedeemableConfigProps, + ); + if (tokenCardProps?.valuesProps?.maxMintAmountConfigProps) obj.valuesProps.maxMintAmountProps = buildStringCard( `Max Mint Amount Per Tx: ${token.properties.maxMintAmountPerTx}`, @@ -104,26 +111,6 @@ export function buildTokenCard(token: Token, address?: string, tokenCardProps?: } return obj; - - return { - isPrettyLoading: tokenCardProps?.isPrettyLoading, - cardClasses: tokenCardProps?.cardClasses, - valuesProps: { - balanceProps: buildBalanceCard(token.balance, tokenCardProps?.valuesProps?.balanceConfigProps), - nameProps: buildStringCard(token.name, tokenCardProps?.valuesProps?.nameConfigProps), - descriptionProps: buildStringCard(token.description, tokenCardProps?.valuesProps?.descriptionConfigProps), - imageProps: buildImageCard(token.image, tokenCardProps?.valuesProps?.imageConfigProps), - addressProps: buildStringCard(address, tokenCardProps?.valuesProps?.addressConfigProps), - isTradeableProps: buildStringCard( - `Is Tradeable: ${token.properties.isTradeable}`, - tokenCardProps?.valuesProps?.isTradeableConfigProps, - ), - maxMintAmountProps: buildStringCard( - `Max Mint Amount Per Tx: ${token.properties.maxMintAmountPerTx}`, - tokenCardProps?.valuesProps?.maxMintAmountConfigProps, - ), - }, - }; } export function buildTokenCards(tokens: Token[], address?: string, tokenCardProps?: TokenCardConfigProps) { diff --git a/packages/nextjs/contracts/deployedContracts.ts b/packages/nextjs/contracts/deployedContracts.ts index 476136d..c6845b2 100644 --- a/packages/nextjs/contracts/deployedContracts.ts +++ b/packages/nextjs/contracts/deployedContracts.ts @@ -7,7 +7,7 @@ import { GenericContractsDeclaration } from "~~/utils/scaffold-eth/contract"; const deployedContracts = { 31337: { ReputationTokensStandalone: { - address: "0x5FbDB2315678afecb367f032d93F642f64180aa3", + address: "0xD8a5a9b31c3C0232E196d518E89Fd8bF83AcAd43", abi: [ { type: "constructor", @@ -200,1568 +200,56 @@ const deployedContracts = { internalType: "struct TokensPropertiesStorage.TokenProperties[]", components: [ { - name: "isTradeable", + name: "isSoulbound", type: "bool", internalType: "bool", }, { - name: "maxMintAmountPerTx", - type: "uint256", - internalType: "uint256", - }, - ], - }, - ], - outputs: [], - stateMutability: "nonpayable", - }, - { - type: "function", - name: "batchUpdateTokens", - inputs: [ - { - name: "ids", - type: "uint256[]", - internalType: "uint256[]", - }, - { - name: "tokensProperties", - type: "tuple[]", - internalType: "struct TokensPropertiesStorage.TokenProperties[]", - components: [ - { - name: "isTradeable", - type: "bool", - internalType: "bool", - }, - { - name: "maxMintAmountPerTx", - type: "uint256", - internalType: "uint256", - }, - ], - }, - ], - outputs: [], - stateMutability: "nonpayable", - }, - { - type: "function", - name: "createToken", - inputs: [ - { - name: "tokenProperty", - type: "tuple", - internalType: "struct TokensPropertiesStorage.TokenProperties", - components: [ - { - name: "isTradeable", - type: "bool", - internalType: "bool", - }, - { - name: "maxMintAmountPerTx", - type: "uint256", - internalType: "uint256", - }, - ], - }, - ], - outputs: [], - stateMutability: "nonpayable", - }, - { - type: "function", - name: "distribute", - inputs: [ - { - name: "from", - type: "address", - internalType: "address", - }, - { - name: "tokensOperations", - type: "tuple", - internalType: "struct IReputationTokensInternal.TokensOperations", - components: [ - { - name: "to", - type: "address", - internalType: "address", - }, - { - name: "operations", - type: "tuple[]", - internalType: "struct IReputationTokensInternal.TokenOperation[]", - components: [ - { - name: "id", - type: "uint256", - internalType: "uint256", - }, - { - name: "amount", - type: "uint256", - internalType: "uint256", - }, - ], - }, - ], - }, - { - name: "data", - type: "bytes", - internalType: "bytes", - }, - ], - outputs: [], - stateMutability: "nonpayable", - }, - { - type: "function", - name: "distributeBatch", - inputs: [ - { - name: "from", - type: "address", - internalType: "address", - }, - { - name: "tokensOperations", - type: "tuple[]", - internalType: "struct IReputationTokensInternal.TokensOperations[]", - components: [ - { - name: "to", - type: "address", - internalType: "address", - }, - { - name: "operations", - type: "tuple[]", - internalType: "struct IReputationTokensInternal.TokenOperation[]", - components: [ - { - name: "id", - type: "uint256", - internalType: "uint256", - }, - { - name: "amount", - type: "uint256", - internalType: "uint256", - }, - ], - }, - ], - }, - { - name: "data", - type: "bytes", - internalType: "bytes", - }, - ], - outputs: [], - stateMutability: "nonpayable", - }, - { - type: "function", - name: "getDestinationWallet", - inputs: [ - { - name: "addr", - type: "address", - internalType: "address", - }, - ], - outputs: [ - { - name: "", - type: "address", - internalType: "address", - }, - ], - stateMutability: "view", - }, - { - type: "function", - name: "getMaxMintPerTx", - inputs: [ - { - name: "index", - type: "uint256", - internalType: "uint256", - }, - ], - outputs: [ - { - name: "", - type: "uint256", - internalType: "uint256", - }, - ], - stateMutability: "view", - }, - { - type: "function", - name: "getNumOfTokenTypes", - inputs: [], - outputs: [ - { - name: "", - type: "uint256", - internalType: "uint256", - }, - ], - stateMutability: "view", - }, - { - type: "function", - name: "getRoleAdmin", - inputs: [ - { - name: "role", - type: "bytes32", - internalType: "bytes32", - }, - ], - outputs: [ - { - name: "", - type: "bytes32", - internalType: "bytes32", - }, - ], - stateMutability: "view", - }, - { - type: "function", - name: "getRoleMember", - inputs: [ - { - name: "role", - type: "bytes32", - internalType: "bytes32", - }, - { - name: "index", - type: "uint256", - internalType: "uint256", - }, - ], - outputs: [ - { - name: "", - type: "address", - internalType: "address", - }, - ], - stateMutability: "view", - }, - { - type: "function", - name: "getRoleMemberCount", - inputs: [ - { - name: "role", - type: "bytes32", - internalType: "bytes32", - }, - ], - outputs: [ - { - name: "", - type: "uint256", - internalType: "uint256", - }, - ], - stateMutability: "view", - }, - { - type: "function", - name: "getTokenProperties", - inputs: [ - { - name: "id", - type: "uint256", - internalType: "uint256", - }, - ], - outputs: [ - { - name: "", - type: "tuple", - internalType: "struct TokensPropertiesStorage.TokenProperties", - components: [ - { - name: "isTradeable", - type: "bool", - internalType: "bool", - }, - { - name: "maxMintAmountPerTx", - type: "uint256", - internalType: "uint256", - }, - ], - }, - ], - stateMutability: "view", - }, - { - type: "function", - name: "grantRole", - inputs: [ - { - name: "role", - type: "bytes32", - internalType: "bytes32", - }, - { - name: "account", - type: "address", - internalType: "address", - }, - ], - outputs: [], - stateMutability: "nonpayable", - }, - { - type: "function", - name: "hasRole", - inputs: [ - { - name: "role", - type: "bytes32", - internalType: "bytes32", - }, - { - name: "account", - type: "address", - internalType: "address", - }, - ], - outputs: [ - { - name: "", - type: "bool", - internalType: "bool", - }, - ], - stateMutability: "view", - }, - { - type: "function", - name: "isApprovedForAll", - inputs: [ - { - name: "account", - type: "address", - internalType: "address", - }, - { - name: "operator", - type: "address", - internalType: "address", - }, - ], - outputs: [ - { - name: "", - type: "bool", - internalType: "bool", - }, - ], - stateMutability: "view", - }, - { - type: "function", - name: "migrateOwnershipOfTokens", - inputs: [ - { - name: "from", - type: "address", - internalType: "address", - }, - { - name: "to", - type: "address", - internalType: "address", - }, - ], - outputs: [], - stateMutability: "nonpayable", - }, - { - type: "function", - name: "mint", - inputs: [ - { - name: "tokensOperations", - type: "tuple", - internalType: "struct IReputationTokensInternal.TokensOperations", - components: [ - { - name: "to", - type: "address", - internalType: "address", - }, - { - name: "operations", - type: "tuple[]", - internalType: "struct IReputationTokensInternal.TokenOperation[]", - components: [ - { - name: "id", - type: "uint256", - internalType: "uint256", - }, - { - name: "amount", - type: "uint256", - internalType: "uint256", - }, - ], - }, - ], - }, - ], - outputs: [], - stateMutability: "nonpayable", - }, - { - type: "function", - name: "mintBatch", - inputs: [ - { - name: "tokensOperations", - type: "tuple[]", - internalType: "struct IReputationTokensInternal.TokensOperations[]", - components: [ - { - name: "to", - type: "address", - internalType: "address", - }, - { - name: "operations", - type: "tuple[]", - internalType: "struct IReputationTokensInternal.TokenOperation[]", - components: [ - { - name: "id", - type: "uint256", - internalType: "uint256", - }, - { - name: "amount", - type: "uint256", - internalType: "uint256", - }, - ], - }, - ], - }, - ], - outputs: [], - stateMutability: "nonpayable", - }, - { - type: "function", - name: "nomineeOwner", - inputs: [], - outputs: [ - { - name: "", - type: "address", - internalType: "address", - }, - ], - stateMutability: "view", - }, - { - type: "function", - name: "owner", - inputs: [], - outputs: [ - { - name: "", - type: "address", - internalType: "address", - }, - ], - stateMutability: "view", - }, - { - type: "function", - name: "renounceRole", - inputs: [ - { - name: "role", - type: "bytes32", - internalType: "bytes32", - }, - ], - outputs: [], - stateMutability: "nonpayable", - }, - { - type: "function", - name: "revokeRole", - inputs: [ - { - name: "role", - type: "bytes32", - internalType: "bytes32", - }, - { - name: "account", - type: "address", - internalType: "address", - }, - ], - outputs: [], - stateMutability: "nonpayable", - }, - { - type: "function", - name: "safeBatchTransferFrom", - inputs: [ - { - name: "from", - type: "address", - internalType: "address", - }, - { - name: "to", - type: "address", - internalType: "address", - }, - { - name: "ids", - type: "uint256[]", - internalType: "uint256[]", - }, - { - name: "amounts", - type: "uint256[]", - internalType: "uint256[]", - }, - { - name: "data", - type: "bytes", - internalType: "bytes", - }, - ], - outputs: [], - stateMutability: "nonpayable", - }, - { - type: "function", - name: "safeTransferFrom", - inputs: [ - { - name: "from", - type: "address", - internalType: "address", - }, - { - name: "to", - type: "address", - internalType: "address", - }, - { - name: "id", - type: "uint256", - internalType: "uint256", - }, - { - name: "amount", - type: "uint256", - internalType: "uint256", - }, - { - name: "data", - type: "bytes", - internalType: "bytes", - }, - ], - outputs: [], - stateMutability: "nonpayable", - }, - { - type: "function", - name: "setApprovalForAll", - inputs: [ - { - name: "operator", - type: "address", - internalType: "address", - }, - { - name: "status", - type: "bool", - internalType: "bool", - }, - ], - outputs: [], - stateMutability: "nonpayable", - }, - { - type: "function", - name: "setDestinationWallet", - inputs: [ - { - name: "destination", - type: "address", - internalType: "address", - }, - ], - outputs: [], - stateMutability: "nonpayable", - }, - { - type: "function", - name: "setTokenURI", - inputs: [ - { - name: "tokenId", - type: "uint256", - internalType: "uint256", - }, - { - name: "tokenURI", - type: "string", - internalType: "string", - }, - ], - outputs: [], - stateMutability: "nonpayable", - }, - { - type: "function", - name: "supportsInterface", - inputs: [ - { - name: "interfaceId", - type: "bytes4", - internalType: "bytes4", - }, - ], - outputs: [ - { - name: "", - type: "bool", - internalType: "bool", - }, - ], - stateMutability: "view", - }, - { - type: "function", - name: "tokensByAccount", - inputs: [ - { - name: "account", - type: "address", - internalType: "address", - }, - ], - outputs: [ - { - name: "", - type: "uint256[]", - internalType: "uint256[]", - }, - ], - stateMutability: "view", - }, - { - type: "function", - name: "totalHolders", - inputs: [ - { - name: "id", - type: "uint256", - internalType: "uint256", - }, - ], - outputs: [ - { - name: "", - type: "uint256", - internalType: "uint256", - }, - ], - stateMutability: "view", - }, - { - type: "function", - name: "totalSupply", - inputs: [ - { - name: "id", - type: "uint256", - internalType: "uint256", - }, - ], - outputs: [ - { - name: "", - type: "uint256", - internalType: "uint256", - }, - ], - stateMutability: "view", - }, - { - type: "function", - name: "transferOwnership", - inputs: [ - { - name: "account", - type: "address", - internalType: "address", - }, - ], - outputs: [], - stateMutability: "nonpayable", - }, - { - type: "function", - name: "updateToken", - inputs: [ - { - name: "id", - type: "uint256", - internalType: "uint256", - }, - { - name: "tokenProperties", - type: "tuple", - internalType: "struct TokensPropertiesStorage.TokenProperties", - components: [ - { - name: "isTradeable", - type: "bool", - internalType: "bool", - }, - { - name: "maxMintAmountPerTx", - type: "uint256", - internalType: "uint256", - }, - ], - }, - ], - outputs: [], - stateMutability: "nonpayable", - }, - { - type: "function", - name: "uri", - inputs: [ - { - name: "tokenId", - type: "uint256", - internalType: "uint256", - }, - ], - outputs: [ - { - name: "", - type: "string", - internalType: "string", - }, - ], - stateMutability: "view", - }, - { - type: "event", - name: "ApprovalForAll", - inputs: [ - { - name: "account", - type: "address", - indexed: true, - internalType: "address", - }, - { - name: "operator", - type: "address", - indexed: true, - internalType: "address", - }, - { - name: "approved", - type: "bool", - indexed: false, - internalType: "bool", - }, - ], - anonymous: false, - }, - { - type: "event", - name: "BurnedRedeemable", - inputs: [ - { - name: "from", - type: "address", - indexed: true, - internalType: "address", - }, - { - name: "to", - type: "address", - indexed: true, - internalType: "address", - }, - { - name: "amount", - type: "uint256", - indexed: false, - internalType: "uint256", - }, - ], - anonymous: false, - }, - { - type: "event", - name: "Create", - inputs: [ - { - name: "", - type: "tuple", - indexed: false, - internalType: "struct TokensPropertiesStorage.TokenProperties", - components: [ - { - name: "isTradeable", - type: "bool", - internalType: "bool", - }, - { - name: "maxMintAmountPerTx", - type: "uint256", - internalType: "uint256", - }, - ], - }, - ], - anonymous: false, - }, - { - type: "event", - name: "DestinationWalletSet", - inputs: [ - { - name: "coreAddress", - type: "address", - indexed: true, - internalType: "address", - }, - { - name: "destination", - type: "address", - indexed: true, - internalType: "address", - }, - ], - anonymous: false, - }, - { - type: "event", - name: "Distributed", - inputs: [ - { - name: "from", - type: "address", - indexed: true, - internalType: "address", - }, - { - name: "to", - type: "address", - indexed: true, - internalType: "address", - }, - { - name: "tokens", - type: "tuple[]", - indexed: true, - internalType: "struct IReputationTokensInternal.TokenOperation[]", - components: [ - { - name: "id", - type: "uint256", - internalType: "uint256", - }, - { - name: "amount", - type: "uint256", - internalType: "uint256", - }, - ], - }, - ], - anonymous: false, - }, - { - type: "event", - name: "Mint", - inputs: [ - { - name: "from", - type: "address", - indexed: true, - internalType: "address", - }, - { - name: "to", - type: "address", - indexed: true, - internalType: "address", - }, - { - name: "tokens", - type: "tuple[]", - indexed: true, - internalType: "struct IReputationTokensInternal.TokenOperation[]", - components: [ - { - name: "id", - type: "uint256", - internalType: "uint256", - }, - { - name: "amount", - type: "uint256", - internalType: "uint256", - }, - ], - }, - ], - anonymous: false, - }, - { - type: "event", - name: "OwnershipOfTokensMigrated", - inputs: [ - { - name: "from", - type: "address", - indexed: true, - internalType: "address", - }, - { - name: "to", - type: "address", - indexed: true, - internalType: "address", - }, - { - name: "lifetimeBalance", - type: "uint256", - indexed: false, - internalType: "uint256", - }, - { - name: "redeemableBalance", - type: "uint256", - indexed: false, - internalType: "uint256", - }, - ], - anonymous: false, - }, - { - type: "event", - name: "OwnershipTransferred", - inputs: [ - { - name: "previousOwner", - type: "address", - indexed: true, - internalType: "address", - }, - { - name: "newOwner", - type: "address", - indexed: true, - internalType: "address", - }, - ], - anonymous: false, - }, - { - type: "event", - name: "RoleAdminChanged", - inputs: [ - { - name: "role", - type: "bytes32", - indexed: true, - internalType: "bytes32", - }, - { - name: "previousAdminRole", - type: "bytes32", - indexed: true, - internalType: "bytes32", - }, - { - name: "newAdminRole", - type: "bytes32", - indexed: true, - internalType: "bytes32", - }, - ], - anonymous: false, - }, - { - type: "event", - name: "RoleGranted", - inputs: [ - { - name: "role", - type: "bytes32", - indexed: true, - internalType: "bytes32", - }, - { - name: "account", - type: "address", - indexed: true, - internalType: "address", - }, - { - name: "sender", - type: "address", - indexed: true, - internalType: "address", - }, - ], - anonymous: false, - }, - { - type: "event", - name: "RoleRevoked", - inputs: [ - { - name: "role", - type: "bytes32", - indexed: true, - internalType: "bytes32", - }, - { - name: "account", - type: "address", - indexed: true, - internalType: "address", - }, - { - name: "sender", - type: "address", - indexed: true, - internalType: "address", - }, - ], - anonymous: false, - }, - { - type: "event", - name: "TransferBatch", - inputs: [ - { - name: "operator", - type: "address", - indexed: true, - internalType: "address", - }, - { - name: "from", - type: "address", - indexed: true, - internalType: "address", - }, - { - name: "to", - type: "address", - indexed: true, - internalType: "address", - }, - { - name: "ids", - type: "uint256[]", - indexed: false, - internalType: "uint256[]", - }, - { - name: "values", - type: "uint256[]", - indexed: false, - internalType: "uint256[]", - }, - ], - anonymous: false, - }, - { - type: "event", - name: "TransferSingle", - inputs: [ - { - name: "operator", - type: "address", - indexed: true, - internalType: "address", - }, - { - name: "from", - type: "address", - indexed: true, - internalType: "address", - }, - { - name: "to", - type: "address", - indexed: true, - internalType: "address", - }, - { - name: "id", - type: "uint256", - indexed: false, - internalType: "uint256", - }, - { - name: "value", - type: "uint256", - indexed: false, - internalType: "uint256", - }, - ], - anonymous: false, - }, - { - type: "event", - name: "URI", - inputs: [ - { - name: "value", - type: "string", - indexed: false, - internalType: "string", - }, - { - name: "tokenId", - type: "uint256", - indexed: true, - internalType: "uint256", - }, - ], - anonymous: false, - }, - { - type: "event", - name: "Update", - inputs: [ - { - name: "id", - type: "uint256", - indexed: true, - internalType: "uint256", - }, - { - name: "properties", - type: "tuple", - indexed: true, - internalType: "struct TokensPropertiesStorage.TokenProperties", - components: [ - { - name: "isTradeable", - type: "bool", - internalType: "bool", - }, - { - name: "maxMintAmountPerTx", - type: "uint256", - internalType: "uint256", - }, - ], - }, - ], - anonymous: false, - }, - { - type: "error", - name: "ERC1155Base__ArrayLengthMismatch", - inputs: [], - }, - { - type: "error", - name: "ERC1155Base__BalanceQueryZeroAddress", - inputs: [], - }, - { - type: "error", - name: "ERC1155Base__BurnExceedsBalance", - inputs: [], - }, - { - type: "error", - name: "ERC1155Base__BurnFromZeroAddress", - inputs: [], - }, - { - type: "error", - name: "ERC1155Base__ERC1155ReceiverNotImplemented", - inputs: [], - }, - { - type: "error", - name: "ERC1155Base__ERC1155ReceiverRejected", - inputs: [], - }, - { - type: "error", - name: "ERC1155Base__MintToZeroAddress", - inputs: [], - }, - { - type: "error", - name: "ERC1155Base__NotOwnerOrApproved", - inputs: [], - }, - { - type: "error", - name: "ERC1155Base__SelfApproval", - inputs: [], - }, - { - type: "error", - name: "ERC1155Base__TransferExceedsBalance", - inputs: [], - }, - { - type: "error", - name: "ERC1155Base__TransferToZeroAddress", - inputs: [], - }, - { - type: "error", - name: "ERC165Base__InvalidInterfaceId", - inputs: [], - }, - { - type: "error", - name: "EnumerableSet__IndexOutOfBounds", - inputs: [], - }, - { - type: "error", - name: "Ownable__NotOwner", - inputs: [], - }, - { - type: "error", - name: "Ownable__NotTransitiveOwner", - inputs: [], - }, - { - type: "error", - name: "ReentrancyGuard__ReentrantCall", - inputs: [], - }, - { - type: "error", - name: "ReputationTokens__AttemptingToMintToNonDistributor", - inputs: [], - }, - { - type: "error", - name: "ReputationTokens__AttemptingToMintTooManyTokens", - inputs: [], - }, - { - type: "error", - name: "ReputationTokens__AttemptingToSendIllegalyAsDistributor", - inputs: [], - }, - { - type: "error", - name: "ReputationTokens__AttemptingToSendNonRedeemableTokens", - inputs: [], - }, - { - type: "error", - name: "ReputationTokens__AttemptingToSendToNonBurner", - inputs: [], - }, - { - type: "error", - name: "ReputationTokens__AttemptingToUpdateNonexistentToken", - inputs: [], - }, - { - type: "error", - name: "SafeOwnable__NotNomineeOwner", - inputs: [], - }, - { - type: "error", - name: "UintUtils__InsufficientHexLength", - inputs: [], - }, - ], - inheritedFunctions: { - BURNER_ROLE: "lib/reputation/src/ReputationTokensBase.sol", - DISTRIBUTOR_ROLE: "lib/reputation/src/ReputationTokensBase.sol", - MINTER_ROLE: "lib/reputation/src/ReputationTokensBase.sol", - TOKEN_CREATOR_ROLE: "lib/reputation/src/ReputationTokensBase.sol", - TOKEN_MIGRATOR_ROLE: "lib/reputation/src/ReputationTokensBase.sol", - TOKEN_UPDATER_ROLE: "lib/reputation/src/ReputationTokensBase.sol", - TOKEN_URI_SETTER_ROLE: "lib/reputation/src/ReputationTokensBase.sol", - acceptOwnership: "lib/reputation/src/ReputationTokensBase.sol", - accountsByToken: "lib/reputation/src/ReputationTokensBase.sol", - balanceOf: "lib/reputation/src/ReputationTokensBase.sol", - balanceOfBatch: "lib/reputation/src/ReputationTokensBase.sol", - batchCreateTokens: "lib/reputation/src/ReputationTokensBase.sol", - batchUpdateTokens: "lib/reputation/src/ReputationTokensBase.sol", - createToken: "lib/reputation/src/ReputationTokensBase.sol", - distribute: "lib/reputation/src/ReputationTokensBase.sol", - distributeBatch: "lib/reputation/src/ReputationTokensBase.sol", - getRoleAdmin: "lib/reputation/src/ReputationTokensBase.sol", - getRoleMember: "lib/reputation/src/ReputationTokensBase.sol", - getRoleMemberCount: "lib/reputation/src/ReputationTokensBase.sol", - grantRole: "lib/reputation/src/ReputationTokensBase.sol", - hasRole: "lib/reputation/src/ReputationTokensBase.sol", - isApprovedForAll: "lib/reputation/src/ReputationTokensBase.sol", - migrateOwnershipOfTokens: "lib/reputation/src/ReputationTokensBase.sol", - mint: "lib/reputation/src/ReputationTokensBase.sol", - mintBatch: "lib/reputation/src/ReputationTokensBase.sol", - nomineeOwner: "lib/reputation/src/ReputationTokensBase.sol", - owner: "lib/reputation/src/ReputationTokensBase.sol", - renounceRole: "lib/reputation/src/ReputationTokensBase.sol", - revokeRole: "lib/reputation/src/ReputationTokensBase.sol", - safeBatchTransferFrom: "lib/reputation/src/ReputationTokensBase.sol", - safeTransferFrom: "lib/reputation/src/ReputationTokensBase.sol", - setApprovalForAll: "lib/reputation/src/ReputationTokensBase.sol", - setDestinationWallet: "lib/reputation/src/ReputationTokensBase.sol", - setTokenURI: "lib/reputation/src/ReputationTokensBase.sol", - supportsInterface: "lib/reputation/src/ReputationTokensBase.sol", - tokensByAccount: "lib/reputation/src/ReputationTokensBase.sol", - totalHolders: "lib/reputation/src/ReputationTokensBase.sol", - totalSupply: "lib/reputation/src/ReputationTokensBase.sol", - transferOwnership: "lib/reputation/src/ReputationTokensBase.sol", - updateToken: "lib/reputation/src/ReputationTokensBase.sol", - uri: "lib/reputation/src/ReputationTokensBase.sol", - }, - }, - }, - 11155111: { - ReputationTokensStandalone: { - address: "0x820f78298373ef17675dbc225cEF122ac7867358", - abi: [ - { - type: "constructor", - inputs: [ - { - name: "ownerNominee", - type: "address", - internalType: "address", - }, - { - name: "admins", - type: "address[]", - internalType: "address[]", - }, - ], - stateMutability: "nonpayable", - }, - { - type: "function", - name: "BURNER_ROLE", - inputs: [], - outputs: [ - { - name: "", - type: "bytes32", - internalType: "bytes32", - }, - ], - stateMutability: "view", - }, - { - type: "function", - name: "DISTRIBUTOR_ROLE", - inputs: [], - outputs: [ - { - name: "", - type: "bytes32", - internalType: "bytes32", - }, - ], - stateMutability: "view", - }, - { - type: "function", - name: "MINTER_ROLE", - inputs: [], - outputs: [ - { - name: "", - type: "bytes32", - internalType: "bytes32", - }, - ], - stateMutability: "view", - }, - { - type: "function", - name: "TOKEN_CREATOR_ROLE", - inputs: [], - outputs: [ - { - name: "", - type: "bytes32", - internalType: "bytes32", - }, - ], - stateMutability: "view", - }, - { - type: "function", - name: "TOKEN_MIGRATOR_ROLE", - inputs: [], - outputs: [ - { - name: "", - type: "bytes32", - internalType: "bytes32", - }, - ], - stateMutability: "view", - }, - { - type: "function", - name: "TOKEN_UPDATER_ROLE", - inputs: [], - outputs: [ - { - name: "", - type: "bytes32", - internalType: "bytes32", - }, - ], - stateMutability: "view", - }, - { - type: "function", - name: "TOKEN_URI_SETTER_ROLE", - inputs: [], - outputs: [ - { - name: "", - type: "bytes32", - internalType: "bytes32", - }, - ], - stateMutability: "view", - }, - { - type: "function", - name: "acceptOwnership", - inputs: [], - outputs: [], - stateMutability: "nonpayable", - }, - { - type: "function", - name: "accountsByToken", - inputs: [ - { - name: "id", - type: "uint256", - internalType: "uint256", - }, - ], - outputs: [ - { - name: "", - type: "address[]", - internalType: "address[]", - }, - ], - stateMutability: "view", - }, - { - type: "function", - name: "balanceOf", - inputs: [ - { - name: "account", - type: "address", - internalType: "address", - }, - { - name: "id", - type: "uint256", - internalType: "uint256", - }, - ], - outputs: [ - { - name: "", - type: "uint256", - internalType: "uint256", - }, - ], - stateMutability: "view", - }, - { - type: "function", - name: "balanceOfBatch", - inputs: [ - { - name: "accounts", - type: "address[]", - internalType: "address[]", - }, - { - name: "ids", - type: "uint256[]", - internalType: "uint256[]", - }, - ], - outputs: [ - { - name: "", - type: "uint256[]", - internalType: "uint256[]", + name: "isRedeemable", + type: "bool", + internalType: "bool", + }, + { + name: "maxMintAmountPerTx", + type: "uint256", + internalType: "uint256", + }, + ], }, ], - stateMutability: "view", + outputs: [], + stateMutability: "nonpayable", }, { type: "function", - name: "batchCreateTokens", + name: "batchMint", inputs: [ { - name: "tokensProperties", + name: "tokensOperations", type: "tuple[]", - internalType: "struct TokensPropertiesStorage.TokenProperties[]", + internalType: "struct IReputationTokensInternal.TokensOperations[]", components: [ { - name: "isTradeable", - type: "bool", - internalType: "bool", + name: "to", + type: "address", + internalType: "address", }, { - name: "maxMintAmountPerTx", - type: "uint256", - internalType: "uint256", + name: "operations", + type: "tuple[]", + internalType: "struct IReputationTokensInternal.TokenOperation[]", + components: [ + { + name: "id", + type: "uint256", + internalType: "uint256", + }, + { + name: "amount", + type: "uint256", + internalType: "uint256", + }, + ], }, ], }, @@ -1771,7 +259,7 @@ const deployedContracts = { }, { type: "function", - name: "batchUpdateTokens", + name: "batchUpdateTokensProperties", inputs: [ { name: "ids", @@ -1784,7 +272,12 @@ const deployedContracts = { internalType: "struct TokensPropertiesStorage.TokenProperties[]", components: [ { - name: "isTradeable", + name: "isSoulbound", + type: "bool", + internalType: "bool", + }, + { + name: "isRedeemable", type: "bool", internalType: "bool", }, @@ -1804,12 +297,17 @@ const deployedContracts = { name: "createToken", inputs: [ { - name: "tokenProperty", + name: "tokenProperties", type: "tuple", internalType: "struct TokensPropertiesStorage.TokenProperties", components: [ { - name: "isTradeable", + name: "isSoulbound", + type: "bool", + internalType: "bool", + }, + { + name: "isRedeemable", type: "bool", internalType: "bool", }, @@ -1821,7 +319,13 @@ const deployedContracts = { ], }, ], - outputs: [], + outputs: [ + { + name: "tokenId", + type: "uint256", + internalType: "uint256", + }, + ], stateMutability: "nonpayable", }, { @@ -1918,6 +422,30 @@ const deployedContracts = { outputs: [], stateMutability: "nonpayable", }, + { + type: "function", + name: "getBurnedBalance", + inputs: [ + { + name: "addr", + type: "address", + internalType: "address", + }, + { + name: "tokenId", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "burnedBalance", + type: "uint256", + internalType: "uint256", + }, + ], + stateMutability: "view", + }, { type: "function", name: "getDestinationWallet", @@ -1937,6 +465,30 @@ const deployedContracts = { ], stateMutability: "view", }, + { + type: "function", + name: "getDistributableBalance", + inputs: [ + { + name: "addr", + type: "address", + internalType: "address", + }, + { + name: "tokenId", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "distributableBalance", + type: "uint256", + internalType: "uint256", + }, + ], + stateMutability: "view", + }, { type: "function", name: "getMaxMintPerTx", @@ -2048,7 +600,12 @@ const deployedContracts = { internalType: "struct TokensPropertiesStorage.TokenProperties", components: [ { - name: "isTradeable", + name: "isSoulbound", + type: "bool", + internalType: "bool", + }, + { + name: "isRedeemable", type: "bool", internalType: "bool", }, @@ -2062,6 +619,30 @@ const deployedContracts = { ], stateMutability: "view", }, + { + type: "function", + name: "getTransferrableBalance", + inputs: [ + { + name: "addr", + type: "address", + internalType: "address", + }, + { + name: "tokenId", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "transferrableBalance", + type: "uint256", + internalType: "uint256", + }, + ], + stateMutability: "view", + }, { type: "function", name: "grantRole", @@ -2183,43 +764,6 @@ const deployedContracts = { outputs: [], stateMutability: "nonpayable", }, - { - type: "function", - name: "mintBatch", - inputs: [ - { - name: "tokensOperations", - type: "tuple[]", - internalType: "struct IReputationTokensInternal.TokensOperations[]", - components: [ - { - name: "to", - type: "address", - internalType: "address", - }, - { - name: "operations", - type: "tuple[]", - internalType: "struct IReputationTokensInternal.TokenOperation[]", - components: [ - { - name: "id", - type: "uint256", - internalType: "uint256", - }, - { - name: "amount", - type: "uint256", - internalType: "uint256", - }, - ], - }, - ], - }, - ], - outputs: [], - stateMutability: "nonpayable", - }, { type: "function", name: "nomineeOwner", @@ -2483,7 +1027,7 @@ const deployedContracts = { }, { type: "function", - name: "updateToken", + name: "updateTokenProperties", inputs: [ { name: "id", @@ -2496,7 +1040,12 @@ const deployedContracts = { internalType: "struct TokensPropertiesStorage.TokenProperties", components: [ { - name: "isTradeable", + name: "isSoulbound", + type: "bool", + internalType: "bool", + }, + { + name: "isRedeemable", type: "bool", internalType: "bool", }, @@ -2555,31 +1104,6 @@ const deployedContracts = { ], anonymous: false, }, - { - type: "event", - name: "BurnedRedeemable", - inputs: [ - { - name: "from", - type: "address", - indexed: true, - internalType: "address", - }, - { - name: "to", - type: "address", - indexed: true, - internalType: "address", - }, - { - name: "amount", - type: "uint256", - indexed: false, - internalType: "uint256", - }, - ], - anonymous: false, - }, { type: "event", name: "Create", @@ -2591,7 +1115,12 @@ const deployedContracts = { internalType: "struct TokensPropertiesStorage.TokenProperties", components: [ { - name: "isTradeable", + name: "isSoulbound", + type: "bool", + internalType: "bool", + }, + { + name: "isRedeemable", type: "bool", internalType: "bool", }, @@ -2715,13 +1244,7 @@ const deployedContracts = { internalType: "address", }, { - name: "lifetimeBalance", - type: "uint256", - indexed: false, - internalType: "uint256", - }, - { - name: "redeemableBalance", + name: "balance", type: "uint256", indexed: false, internalType: "uint256", @@ -2933,7 +1456,12 @@ const deployedContracts = { internalType: "struct TokensPropertiesStorage.TokenProperties", components: [ { - name: "isTradeable", + name: "isSoulbound", + type: "bool", + internalType: "bool", + }, + { + name: "isRedeemable", type: "bool", internalType: "bool", }, @@ -3024,37 +1552,37 @@ const deployedContracts = { }, { type: "error", - name: "ReentrancyGuard__ReentrantCall", + name: "ReputationTokens__AttemptingToUpdateNonexistentToken", inputs: [], }, { type: "error", - name: "ReputationTokens__AttemptingToMintToNonDistributor", + name: "ReputationTokens__CanOnlyMintToDistributor", inputs: [], }, { type: "error", - name: "ReputationTokens__AttemptingToMintTooManyTokens", + name: "ReputationTokens__CannotTransferRedeemableToNonBurner", inputs: [], }, { type: "error", - name: "ReputationTokens__AttemptingToSendIllegalyAsDistributor", + name: "ReputationTokens__CannotTransferSoulboundToken", inputs: [], }, { type: "error", - name: "ReputationTokens__AttemptingToSendNonRedeemableTokens", + name: "ReputationTokens__CannotUpdateNonexistentTokenType", inputs: [], }, { type: "error", - name: "ReputationTokens__AttemptingToSendToNonBurner", + name: "ReputationTokens__CantSendThatManyTransferrableTokens", inputs: [], }, { type: "error", - name: "ReputationTokens__AttemptingToUpdateNonexistentToken", + name: "ReputationTokens__MintAmountExceedsLimit", inputs: [], }, { @@ -3064,52 +1592,60 @@ const deployedContracts = { }, { type: "error", - name: "UintUtils__InsufficientHexLength", + name: "UintUtils__InsufficientPadding", + inputs: [], + }, + { + type: "error", + name: "UintUtils__InvalidBase", inputs: [], }, ], inheritedFunctions: { - BURNER_ROLE: "lib/reputation/src/ReputationTokensBase.sol", - DISTRIBUTOR_ROLE: "lib/reputation/src/ReputationTokensBase.sol", - MINTER_ROLE: "lib/reputation/src/ReputationTokensBase.sol", - TOKEN_CREATOR_ROLE: "lib/reputation/src/ReputationTokensBase.sol", - TOKEN_MIGRATOR_ROLE: "lib/reputation/src/ReputationTokensBase.sol", - TOKEN_UPDATER_ROLE: "lib/reputation/src/ReputationTokensBase.sol", - TOKEN_URI_SETTER_ROLE: "lib/reputation/src/ReputationTokensBase.sol", - acceptOwnership: "lib/reputation/src/ReputationTokensBase.sol", - accountsByToken: "lib/reputation/src/ReputationTokensBase.sol", - balanceOf: "lib/reputation/src/ReputationTokensBase.sol", - balanceOfBatch: "lib/reputation/src/ReputationTokensBase.sol", - batchCreateTokens: "lib/reputation/src/ReputationTokensBase.sol", - batchUpdateTokens: "lib/reputation/src/ReputationTokensBase.sol", - createToken: "lib/reputation/src/ReputationTokensBase.sol", - distribute: "lib/reputation/src/ReputationTokensBase.sol", - distributeBatch: "lib/reputation/src/ReputationTokensBase.sol", - getRoleAdmin: "lib/reputation/src/ReputationTokensBase.sol", - getRoleMember: "lib/reputation/src/ReputationTokensBase.sol", - getRoleMemberCount: "lib/reputation/src/ReputationTokensBase.sol", - grantRole: "lib/reputation/src/ReputationTokensBase.sol", - hasRole: "lib/reputation/src/ReputationTokensBase.sol", - isApprovedForAll: "lib/reputation/src/ReputationTokensBase.sol", - migrateOwnershipOfTokens: "lib/reputation/src/ReputationTokensBase.sol", - mint: "lib/reputation/src/ReputationTokensBase.sol", - mintBatch: "lib/reputation/src/ReputationTokensBase.sol", - nomineeOwner: "lib/reputation/src/ReputationTokensBase.sol", - owner: "lib/reputation/src/ReputationTokensBase.sol", - renounceRole: "lib/reputation/src/ReputationTokensBase.sol", - revokeRole: "lib/reputation/src/ReputationTokensBase.sol", - safeBatchTransferFrom: "lib/reputation/src/ReputationTokensBase.sol", - safeTransferFrom: "lib/reputation/src/ReputationTokensBase.sol", - setApprovalForAll: "lib/reputation/src/ReputationTokensBase.sol", - setDestinationWallet: "lib/reputation/src/ReputationTokensBase.sol", - setTokenURI: "lib/reputation/src/ReputationTokensBase.sol", - supportsInterface: "lib/reputation/src/ReputationTokensBase.sol", - tokensByAccount: "lib/reputation/src/ReputationTokensBase.sol", - totalHolders: "lib/reputation/src/ReputationTokensBase.sol", - totalSupply: "lib/reputation/src/ReputationTokensBase.sol", - transferOwnership: "lib/reputation/src/ReputationTokensBase.sol", - updateToken: "lib/reputation/src/ReputationTokensBase.sol", - uri: "lib/reputation/src/ReputationTokensBase.sol", + BURNER_ROLE: "lib/reputation/contracts/ReputationTokensBase.sol", + DISTRIBUTOR_ROLE: "lib/reputation/contracts/ReputationTokensBase.sol", + MINTER_ROLE: "lib/reputation/contracts/ReputationTokensBase.sol", + TOKEN_CREATOR_ROLE: "lib/reputation/contracts/ReputationTokensBase.sol", + TOKEN_MIGRATOR_ROLE: "lib/reputation/contracts/ReputationTokensBase.sol", + TOKEN_UPDATER_ROLE: "lib/reputation/contracts/ReputationTokensBase.sol", + TOKEN_URI_SETTER_ROLE: "lib/reputation/contracts/ReputationTokensBase.sol", + acceptOwnership: "lib/reputation/contracts/ReputationTokensBase.sol", + accountsByToken: "lib/reputation/contracts/ReputationTokensBase.sol", + balanceOf: "lib/reputation/contracts/ReputationTokensBase.sol", + balanceOfBatch: "lib/reputation/contracts/ReputationTokensBase.sol", + batchCreateTokens: "lib/reputation/contracts/ReputationTokensBase.sol", + batchMint: "lib/reputation/contracts/ReputationTokensBase.sol", + batchUpdateTokensProperties: "lib/reputation/contracts/ReputationTokensBase.sol", + createToken: "lib/reputation/contracts/ReputationTokensBase.sol", + distribute: "lib/reputation/contracts/ReputationTokensBase.sol", + distributeBatch: "lib/reputation/contracts/ReputationTokensBase.sol", + getBurnedBalance: "lib/reputation/contracts/ReputationTokensBase.sol", + getDistributableBalance: "lib/reputation/contracts/ReputationTokensBase.sol", + getRoleAdmin: "lib/reputation/contracts/ReputationTokensBase.sol", + getRoleMember: "lib/reputation/contracts/ReputationTokensBase.sol", + getRoleMemberCount: "lib/reputation/contracts/ReputationTokensBase.sol", + getTransferrableBalance: "lib/reputation/contracts/ReputationTokensBase.sol", + grantRole: "lib/reputation/contracts/ReputationTokensBase.sol", + hasRole: "lib/reputation/contracts/ReputationTokensBase.sol", + isApprovedForAll: "lib/reputation/contracts/ReputationTokensBase.sol", + migrateOwnershipOfTokens: "lib/reputation/contracts/ReputationTokensBase.sol", + mint: "lib/reputation/contracts/ReputationTokensBase.sol", + nomineeOwner: "lib/reputation/contracts/ReputationTokensBase.sol", + owner: "lib/reputation/contracts/ReputationTokensBase.sol", + renounceRole: "lib/reputation/contracts/ReputationTokensBase.sol", + revokeRole: "lib/reputation/contracts/ReputationTokensBase.sol", + safeBatchTransferFrom: "lib/reputation/contracts/ReputationTokensBase.sol", + safeTransferFrom: "lib/reputation/contracts/ReputationTokensBase.sol", + setApprovalForAll: "lib/reputation/contracts/ReputationTokensBase.sol", + setDestinationWallet: "lib/reputation/contracts/ReputationTokensBase.sol", + setTokenURI: "lib/reputation/contracts/ReputationTokensBase.sol", + supportsInterface: "lib/reputation/contracts/ReputationTokensBase.sol", + tokensByAccount: "lib/reputation/contracts/ReputationTokensBase.sol", + totalHolders: "lib/reputation/contracts/ReputationTokensBase.sol", + totalSupply: "lib/reputation/contracts/ReputationTokensBase.sol", + transferOwnership: "lib/reputation/contracts/ReputationTokensBase.sol", + updateTokenProperties: "lib/reputation/contracts/ReputationTokensBase.sol", + uri: "lib/reputation/contracts/ReputationTokensBase.sol", }, }, }, diff --git a/packages/nextjs/scaffold.config.ts b/packages/nextjs/scaffold.config.ts index 12d7cfd..1c21295 100644 --- a/packages/nextjs/scaffold.config.ts +++ b/packages/nextjs/scaffold.config.ts @@ -11,7 +11,7 @@ export type ScaffoldConfig = { const scaffoldConfig = { // The networks on which your DApp is live - targetNetworks: [chains.sepolia, chains.foundry], + targetNetworks: [chains.foundry], // The interval at which your front-end polls the RPC servers for new data // it has no effect if you only target the local network (default is 4000) diff --git a/token-jsons/lifetimeToken.json b/token-jsons/lifetimeToken.json new file mode 100644 index 0000000..deed203 --- /dev/null +++ b/token-jsons/lifetimeToken.json @@ -0,0 +1 @@ +{"name":"Lifetime Token","description":"Represents a member's long standing reputation with the DAO and cannot be transferred.","image":"ipfs://bafybeiaywvtmm2rqa2idup57z44s24booowx7ikl5z36gqs2vjoyzrftce/lifetimetoken.jpg","attributes":[{"trait_type":"Transfer Type","value":"Soulbound"}]} \ No newline at end of file diff --git a/token-jsons/redeemableToken.json b/token-jsons/redeemableToken.json new file mode 100644 index 0000000..3ffb7a0 --- /dev/null +++ b/token-jsons/redeemableToken.json @@ -0,0 +1 @@ +{"name":"Redeemable Token","description":"Exchangeable for rewards, event entry, membership discounts, etc.","image":"ipfs://bafybeiaywvtmm2rqa2idup57z44s24booowx7ikl5z36gqs2vjoyzrftce/redeemabletoken.jpg","attributes":[{"trait_type":"Transfer Type","value":"Redeemable"}]} \ No newline at end of file diff --git a/token-jsons/transferableToken.json b/token-jsons/transferableToken.json new file mode 100644 index 0000000..62aa1dd --- /dev/null +++ b/token-jsons/transferableToken.json @@ -0,0 +1 @@ +{"name":"Transferrable Token","description":"Completely transferrable token that can be sold on DEXs, CEXs, and trade freely with speculation.","image":"ipfs://bafkreiee5tkobtfdyhpniyebq4uqoir5bryljg3ldnag6zfyttk2oqzaau","attributes":[{"trait_type":"Transfer Type","value":"Transferrable"}]} \ No newline at end of file