From 74f4980c8846e1477a13e8b25832dcc05e9f8a9b Mon Sep 17 00:00:00 2001 From: Jacob Homanics Date: Wed, 7 Feb 2024 18:23:12 -0600 Subject: [PATCH] added support for double deployments --- package.json | 1 + packages/foundry/package.json | 1 + packages/foundry/script/Deploy.s.sol | 31 +- packages/foundry/script/Deploy2.s.sol | 209 ++ packages/foundry/script/generateTsAbis2.js | 146 + .../nextjs/contracts/deployedContracts.ts | 3112 +---------------- packages/nextjs/scaffold.config.ts | 2 +- 7 files changed, 388 insertions(+), 3114 deletions(-) create mode 100644 packages/foundry/script/Deploy2.s.sol create mode 100644 packages/foundry/script/generateTsAbis2.js diff --git a/package.json b/package.json index 8475360..bb135de 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "chain": "yarn workspace @se-2/foundry chain", "compile": "yarn workspace @se-2/foundry compile", "deploy": "yarn workspace @se-2/foundry deploy", + "deploy2": "yarn workspace @se-2/foundry deploy2", "deploy:verify": "yarn workspace @se-2/foundry deploy:verify", "fork": "yarn workspace @se-2/foundry fork", "foundry:lint": "yarn workspace @se-2/foundry lint", diff --git a/packages/foundry/package.json b/packages/foundry/package.json index 9471ed9..8616dc2 100644 --- a/packages/foundry/package.json +++ b/packages/foundry/package.json @@ -5,6 +5,7 @@ "account": "node script/ListAccount.js", "chain": "anvil --config-out localhost.json", "compile": "forge compile", + "deploy2": "forge build --build-info --build-info-path out/build-info/ && forge script script/Deploy2.s.sol --rpc-url ${1:-default_network} --broadcast --legacy && node script/generateTsAbis2.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", diff --git a/packages/foundry/script/Deploy.s.sol b/packages/foundry/script/Deploy.s.sol index f370a22..c3ed6ad 100644 --- a/packages/foundry/script/Deploy.s.sol +++ b/packages/foundry/script/Deploy.s.sol @@ -4,7 +4,6 @@ pragma solidity ^0.8.19; import {console} from "forge-std/console.sol"; import {ScaffoldETHDeploy} from "./DeployHelpers.s.sol"; -// import {DeployRepTokensInstanceWithData} from "./DeployRepTokensInstanceWithData.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"; @@ -26,13 +25,14 @@ contract DeployScript is ScaffoldETHDeploy { } vm.startBroadcast(deployerPrivateKey); - address[] memory admins = new address[](3); + address[] memory admins = new address[](4); admins[0] = 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266; admins[1] = 0x62286D694F89a1B12c0214bfcD567bb6c2951491; admins[2] = 0x2643658817324C6536E3A027a15Cd11576Fa5884; + admins[3] = 0x3bEc6a181d6Ef7239F699DAf2fAa5FE3A5f01Edf; ReputationTokensStandalone instance = new ReputationTokensStandalone( - 0x2643658817324C6536E3A027a15Cd11576Fa5884, + 0x3bEc6a181d6Ef7239F699DAf2fAa5FE3A5f01Edf, admins ); @@ -111,6 +111,31 @@ contract DeployScript is ScaffoldETHDeploy { 0x2643658817324C6536E3A027a15Cd11576Fa5884 ); + instance.grantRole( + instance.TOKEN_CREATOR_ROLE(), + 0x3bEc6a181d6Ef7239F699DAf2fAa5FE3A5f01Edf + ); + + instance.grantRole( + instance.TOKEN_UPDATER_ROLE(), + 0x3bEc6a181d6Ef7239F699DAf2fAa5FE3A5f01Edf + ); + + instance.grantRole( + instance.TOKEN_URI_SETTER_ROLE(), + 0x3bEc6a181d6Ef7239F699DAf2fAa5FE3A5f01Edf + ); + + instance.grantRole( + instance.MINTER_ROLE(), + 0x3bEc6a181d6Ef7239F699DAf2fAa5FE3A5f01Edf + ); + + instance.grantRole( + instance.DISTRIBUTOR_ROLE(), + 0x3bEc6a181d6Ef7239F699DAf2fAa5FE3A5f01Edf + ); + TokensPropertiesStorage.TokenProperties memory tokenProperties = TokensPropertiesStorage.TokenProperties( false, diff --git a/packages/foundry/script/Deploy2.s.sol b/packages/foundry/script/Deploy2.s.sol new file mode 100644 index 0000000..b122291 --- /dev/null +++ b/packages/foundry/script/Deploy2.s.sol @@ -0,0 +1,209 @@ +//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"; + +contract DeployScript is ScaffoldETHDeploy { + error InvalidPrivateKey(string); + + uint256 maxMintAmount = 100; + string BASE_URI = + "ipfs://bafybeiaz55w6kf7ar2g5vzikfbft2qoexknstfouu524l7q3mliutns2u4/"; + + function run() external { + uint256 deployerPrivateKey = setupLocalhostEnv(); + if (deployerPrivateKey == 0) { + revert InvalidPrivateKey( + "You don't have a deployer account. Make sure you have set DEPLOYER_PRIVATE_KEY in .env or use `yarn generate` to generate a new random account" + ); + } + + vm.startBroadcast(deployerPrivateKey); + address[] memory admins = new address[](4); + admins[0] = 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266; + admins[1] = 0x62286D694F89a1B12c0214bfcD567bb6c2951491; + admins[2] = 0x2643658817324C6536E3A027a15Cd11576Fa5884; + admins[3] = 0x3bEc6a181d6Ef7239F699DAf2fAa5FE3A5f01Edf; + + ReputationTokensStandalone instance = new ReputationTokensStandalone( + 0x3bEc6a181d6Ef7239F699DAf2fAa5FE3A5f01Edf, + admins + ); + + instance.grantRole( + instance.TOKEN_CREATOR_ROLE(), + 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 + ); + + instance.grantRole( + instance.TOKEN_UPDATER_ROLE(), + 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 + ); + + instance.grantRole( + instance.TOKEN_URI_SETTER_ROLE(), + 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 + ); + + instance.grantRole( + instance.MINTER_ROLE(), + 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 + ); + + instance.grantRole( + instance.DISTRIBUTOR_ROLE(), + 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 + ); + + instance.grantRole( + instance.TOKEN_CREATOR_ROLE(), + 0x62286D694F89a1B12c0214bfcD567bb6c2951491 + ); + + instance.grantRole( + instance.TOKEN_UPDATER_ROLE(), + 0x62286D694F89a1B12c0214bfcD567bb6c2951491 + ); + + instance.grantRole( + instance.TOKEN_URI_SETTER_ROLE(), + 0x62286D694F89a1B12c0214bfcD567bb6c2951491 + ); + + instance.grantRole( + instance.MINTER_ROLE(), + 0x62286D694F89a1B12c0214bfcD567bb6c2951491 + ); + + instance.grantRole( + instance.DISTRIBUTOR_ROLE(), + 0x62286D694F89a1B12c0214bfcD567bb6c2951491 + ); + + instance.grantRole( + instance.TOKEN_CREATOR_ROLE(), + 0x2643658817324C6536E3A027a15Cd11576Fa5884 + ); + + instance.grantRole( + instance.TOKEN_UPDATER_ROLE(), + 0x2643658817324C6536E3A027a15Cd11576Fa5884 + ); + + instance.grantRole( + instance.TOKEN_URI_SETTER_ROLE(), + 0x2643658817324C6536E3A027a15Cd11576Fa5884 + ); + + instance.grantRole( + instance.MINTER_ROLE(), + 0x2643658817324C6536E3A027a15Cd11576Fa5884 + ); + + instance.grantRole( + instance.DISTRIBUTOR_ROLE(), + 0x2643658817324C6536E3A027a15Cd11576Fa5884 + ); + + instance.grantRole( + instance.TOKEN_CREATOR_ROLE(), + 0x3bEc6a181d6Ef7239F699DAf2fAa5FE3A5f01Edf + ); + + instance.grantRole( + instance.TOKEN_UPDATER_ROLE(), + 0x3bEc6a181d6Ef7239F699DAf2fAa5FE3A5f01Edf + ); + + instance.grantRole( + instance.TOKEN_URI_SETTER_ROLE(), + 0x3bEc6a181d6Ef7239F699DAf2fAa5FE3A5f01Edf + ); + + instance.grantRole( + instance.MINTER_ROLE(), + 0x3bEc6a181d6Ef7239F699DAf2fAa5FE3A5f01Edf + ); + + instance.grantRole( + instance.DISTRIBUTOR_ROLE(), + 0x3bEc6a181d6Ef7239F699DAf2fAa5FE3A5f01Edf + ); + + TokensPropertiesStorage.TokenProperties + memory tokenProperties = TokensPropertiesStorage.TokenProperties( + false, + 100 + ); + + instance.createToken(tokenProperties); + + TokensPropertiesStorage.TokenProperties + memory tokenProperties2 = TokensPropertiesStorage.TokenProperties( + true, + 100 + ); + + instance.createToken(tokenProperties2); + + instance.setTokenURI(0, string.concat(BASE_URI, "0")); + instance.setTokenURI(1, string.concat(BASE_URI, "1")); + + IReputationTokensInternal.TokensOperations memory mintOperations; + mintOperations.to = 0x62286D694F89a1B12c0214bfcD567bb6c2951491; + + mintOperations + .operations = new IReputationTokensInternal.TokenOperation[](2); + mintOperations.operations[0] = IReputationTokensInternal.TokenOperation( + 0, + 90 + ); + mintOperations.operations[1] = IReputationTokensInternal.TokenOperation( + 1, + 45 + ); + instance.mint(mintOperations); + + IReputationTokensInternal.TokensOperations memory mintOperations2; + mintOperations2.to = 0x2643658817324C6536E3A027a15Cd11576Fa5884; + + mintOperations2 + .operations = new IReputationTokensInternal.TokenOperation[](2); + mintOperations2.operations[0] = IReputationTokensInternal + .TokenOperation(0, 90); + mintOperations2.operations[1] = IReputationTokensInternal + .TokenOperation(1, 45); + instance.mint(mintOperations2); + + // Hats hatsInstance = new Hats("Hats", "ipfs"); + + // uint256 topHatId = hatsInstance.mintTopHat( + // 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266, + // "", + // "" + // ); + + // uint256 newHatId = hatsInstance.createHat( + // topHatId, + // "Details...", + // 100, + // 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266, + // 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266, + // true, + // "" + // ); + + // console.log(topHatId); + // console.log(newHatId); + + vm.stopBroadcast(); + + exportDeployments(); + } +} diff --git a/packages/foundry/script/generateTsAbis2.js b/packages/foundry/script/generateTsAbis2.js new file mode 100644 index 0000000..7c34a7c --- /dev/null +++ b/packages/foundry/script/generateTsAbis2.js @@ -0,0 +1,146 @@ +const fs = require("fs"); +const path = require("path"); +//@ts-expect-error This script runs after `forge deploy` therefore its deterministic that it will present +// const deployments = require("../deployments.json"); +const prettier = require("prettier"); + +const generatedContractComment = ` +/** + * This file is autogenerated by Scaffold-ETH. + * You should not edit it manually or your changes might be overwritten. + */ +`; + +function getDirectories(path) { + return fs.readdirSync(path).filter(function (file) { + return fs.statSync(path + "/" + file).isDirectory(); + }); +} +function getFiles(path) { + return fs.readdirSync(path).filter(function (file) { + return fs.statSync(path + "/" + file).isFile(); + }); +} +function getArtifactOfContract(contractName) { + const current_path_to_artifacts = path.join( + __dirname, + "..", + `out/${contractName}.sol` + ); + const artifactJson = JSON.parse( + fs.readFileSync(`${current_path_to_artifacts}/${contractName}.json`) + ); + + return artifactJson; +} + +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 + ); + } + } + } + return inheritedFromContracts; +} + +function getInheritedFunctions(mainArtifact) { + const inheritedFromContracts = getInheritedFromContracts(mainArtifact); + const inheritedFunctions = {}; + for (const inheritanceContractName of inheritedFromContracts) { + const { + abi, + ast: { absolutePath }, + } = getArtifactOfContract(inheritanceContractName); + for (const abiEntry of abi) { + if (abiEntry.type == "function") { + inheritedFunctions[abiEntry.name] = absolutePath; + } + } + } + return inheritedFunctions; +} + +function main() { + const current_path_to_broadcast = path.join( + __dirname, + "..", + "broadcast/Deploy2.s.sol" + ); + const current_path_to_deployments = path.join(__dirname, "..", "deployments"); + + const chains = getDirectories(current_path_to_broadcast); + const Deploymentchains = getFiles(current_path_to_deployments); + + const deployments = {}; + + Deploymentchains.forEach((chain) => { + if (!chain.endsWith(".json")) return; + chain = chain.slice(0, -5); + var deploymentObject = JSON.parse( + fs.readFileSync(`${current_path_to_deployments}/${chain}.json`) + ); + deployments[chain] = deploymentObject; + }); + + const allGeneratedContracts = {}; + + chains.forEach((chain) => { + allGeneratedContracts[chain] = {}; + const broadCastObject = JSON.parse( + fs.readFileSync(`${current_path_to_broadcast}/${chain}/run-latest.json`) + ); + const transactionsCreate = broadCastObject.transactions.filter( + (transaction) => transaction.transactionType == "CREATE" + ); + transactionsCreate.forEach((transaction) => { + const artifact = getArtifactOfContract(transaction.contractName); + allGeneratedContracts[chain][ + deployments[chain][transaction.contractAddress] || + transaction.contractName + ] = { + address: transaction.contractAddress, + abi: artifact.abi, + inheritedFunctions: getInheritedFunctions(artifact), + }; + }); + }); + + const TARGET_DIR = "../nextjs/contracts/"; + + const fileContent = Object.entries(allGeneratedContracts).reduce( + (content, [chainId, chainConfig]) => { + return `${content}${parseInt(chainId).toFixed(0)}:${JSON.stringify( + chainConfig, + null, + 2 + )},`; + }, + "" + ); + + if (!fs.existsSync(TARGET_DIR)) { + fs.mkdirSync(TARGET_DIR); + } + fs.writeFileSync( + `${TARGET_DIR}deployedContracts.ts`, + prettier.format( + `${generatedContractComment} import { GenericContractsDeclaration } from "~~/utils/scaffold-eth/contract"; \n\n + const deployedContracts = {${fileContent}} as const; \n\n export default deployedContracts satisfies GenericContractsDeclaration`, + { + parser: "typescript", + } + ) + ); +} + +try { + main(); +} catch (error) { + console.error(error); + process.exitCode = 1; +} diff --git a/packages/nextjs/contracts/deployedContracts.ts b/packages/nextjs/contracts/deployedContracts.ts index 87136ac..41c5bbc 100644 --- a/packages/nextjs/contracts/deployedContracts.ts +++ b/packages/nextjs/contracts/deployedContracts.ts @@ -5,3117 +5,9 @@ import { GenericContractsDeclaration } from "~~/utils/scaffold-eth/contract"; const deployedContracts = { - 5: { - ReputationTokensStandalone: { - address: "0x456CDB742e1Bda13fC3F5DbB6cde9B1F01F2B459", - 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[]", - }, - ], - stateMutability: "view", - }, - { - type: "function", - name: "batchCreateTokens", - inputs: [ - { - 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: "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", - }, - }, - }, - 31337: { - ReputationTokensStandalone: { - address: "0x5FbDB2315678afecb367f032d93F642f64180aa3", - 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[]", - }, - ], - stateMutability: "view", - }, - { - type: "function", - name: "batchCreateTokens", - inputs: [ - { - 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: "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: { + 31337: { ReputationTokensStandalone: { - address: "0x5F9e2765DdB28372dF0D67D3B5554143f5Ccd921", + address: "0x2a810409872AfC346F9B5b26571Fd6eC42EA4849", abi: [ { type: "constructor", diff --git a/packages/nextjs/scaffold.config.ts b/packages/nextjs/scaffold.config.ts index 55ac641..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.goerli, 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)