diff --git a/contracts/.openzeppelin/unknown-421614.json b/contracts/.openzeppelin/unknown-421614.json new file mode 100644 index 00000000..96d8a6f2 --- /dev/null +++ b/contracts/.openzeppelin/unknown-421614.json @@ -0,0 +1,378 @@ +{ + "manifestVersion": "3.2", + "proxies": [ + { + "address": "0x0A00a2f09cd37B24E7429c5238323bfebCfF3Ed9", + "txHash": "0xc6346fed4b5d47105450a833d50d6a195d24895fb58325313bebc27b0dbfdbd5", + "kind": "uups" + } + ], + "impls": { + "125db54394ee349f18c5e7b6f717dff5868c4ccab68a96eeef38a6321b3f05b2": { + "address": "0x689587461AA3103D3D7975c5e4B352Ab711C14C2", + "txHash": "0x631c2b653b540d3ab9aad9d6a61afab7b704d8e7862949f73d049762724a84a4", + "layout": { + "solcVersion": "0.8.17", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol:62", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol:67" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol:36" + }, + { + "label": "__gap", + "offset": 0, + "slot": "51", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC165Upgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/utils/introspection/ERC165Upgradeable.sol:41" + }, + { + "label": "_balances", + "offset": 0, + "slot": "101", + "type": "t_mapping(t_uint256,t_mapping(t_address,t_uint256))", + "contract": "ERC1155Upgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/token/ERC1155/ERC1155Upgradeable.sol:25" + }, + { + "label": "_operatorApprovals", + "offset": 0, + "slot": "102", + "type": "t_mapping(t_address,t_mapping(t_address,t_bool))", + "contract": "ERC1155Upgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/token/ERC1155/ERC1155Upgradeable.sol:28" + }, + { + "label": "_uri", + "offset": 0, + "slot": "103", + "type": "t_string_storage", + "contract": "ERC1155Upgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/token/ERC1155/ERC1155Upgradeable.sol:31" + }, + { + "label": "__gap", + "offset": 0, + "slot": "104", + "type": "t_array(t_uint256)47_storage", + "contract": "ERC1155Upgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/token/ERC1155/ERC1155Upgradeable.sol:528" + }, + { + "label": "__gap", + "offset": 0, + "slot": "151", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC1155BurnableUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/token/ERC1155/extensions/ERC1155BurnableUpgradeable.sol:52" + }, + { + "label": "_baseURI", + "offset": 0, + "slot": "201", + "type": "t_string_storage", + "contract": "ERC1155URIStorageUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/token/ERC1155/extensions/ERC1155URIStorageUpgradeable.sol:27" + }, + { + "label": "_tokenURIs", + "offset": 0, + "slot": "202", + "type": "t_mapping(t_uint256,t_string_storage)", + "contract": "ERC1155URIStorageUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/token/ERC1155/extensions/ERC1155URIStorageUpgradeable.sol:30" + }, + { + "label": "__gap", + "offset": 0, + "slot": "203", + "type": "t_array(t_uint256)48_storage", + "contract": "ERC1155URIStorageUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/token/ERC1155/extensions/ERC1155URIStorageUpgradeable.sol:77" + }, + { + "label": "_owner", + "offset": 0, + "slot": "251", + "type": "t_address", + "contract": "OwnableUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "252", + "type": "t_array(t_uint256)49_storage", + "contract": "OwnableUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol:94" + }, + { + "label": "__gap", + "offset": 0, + "slot": "301", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC1967UpgradeUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol:211" + }, + { + "label": "__gap", + "offset": 0, + "slot": "351", + "type": "t_array(t_uint256)50_storage", + "contract": "UUPSUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/UUPSUpgradeable.sol:107" + }, + { + "label": "typeCounter", + "offset": 0, + "slot": "401", + "type": "t_uint256", + "contract": "SemiFungible1155", + "src": "src/protocol/SemiFungible1155.sol:27" + }, + { + "label": "owners", + "offset": 0, + "slot": "402", + "type": "t_mapping(t_uint256,t_address)", + "contract": "SemiFungible1155", + "src": "src/protocol/SemiFungible1155.sol:38" + }, + { + "label": "creators", + "offset": 0, + "slot": "403", + "type": "t_mapping(t_uint256,t_address)", + "contract": "SemiFungible1155", + "src": "src/protocol/SemiFungible1155.sol:41" + }, + { + "label": "tokenValues", + "offset": 0, + "slot": "404", + "type": "t_mapping(t_uint256,t_uint256)", + "contract": "SemiFungible1155", + "src": "src/protocol/SemiFungible1155.sol:44" + }, + { + "label": "maxIndex", + "offset": 0, + "slot": "405", + "type": "t_mapping(t_uint256,t_uint256)", + "contract": "SemiFungible1155", + "src": "src/protocol/SemiFungible1155.sol:47" + }, + { + "label": "__gap", + "offset": 0, + "slot": "406", + "type": "t_array(t_uint256)25_storage", + "contract": "SemiFungible1155", + "src": "src/protocol/SemiFungible1155.sol:648" + }, + { + "label": "merkleRoots", + "offset": 0, + "slot": "431", + "type": "t_mapping(t_uint256,t_bytes32)", + "contract": "AllowlistMinter", + "src": "src/protocol/AllowlistMinter.sol:17" + }, + { + "label": "hasBeenClaimed", + "offset": 0, + "slot": "432", + "type": "t_mapping(t_uint256,t_mapping(t_bytes32,t_bool))", + "contract": "AllowlistMinter", + "src": "src/protocol/AllowlistMinter.sol:18" + }, + { + "label": "maxUnits", + "offset": 0, + "slot": "433", + "type": "t_mapping(t_uint256,t_uint256)", + "contract": "AllowlistMinter", + "src": "src/protocol/AllowlistMinter.sol:19" + }, + { + "label": "minted", + "offset": 0, + "slot": "434", + "type": "t_mapping(t_uint256,t_uint256)", + "contract": "AllowlistMinter", + "src": "src/protocol/AllowlistMinter.sol:20" + }, + { + "label": "__gap", + "offset": 0, + "slot": "435", + "type": "t_array(t_uint256)26_storage", + "contract": "AllowlistMinter", + "src": "src/protocol/AllowlistMinter.sol:75" + }, + { + "label": "_paused", + "offset": 0, + "slot": "461", + "type": "t_bool", + "contract": "PausableUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/security/PausableUpgradeable.sol:29" + }, + { + "label": "__gap", + "offset": 0, + "slot": "462", + "type": "t_array(t_uint256)49_storage", + "contract": "PausableUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/security/PausableUpgradeable.sol:116" + }, + { + "label": "typeRestrictions", + "offset": 0, + "slot": "511", + "type": "t_mapping(t_uint256,t_enum(TransferRestrictions)19595)", + "contract": "HypercertMinter", + "src": "src/protocol/HypercertMinter.sol:20" + }, + { + "label": "__gap", + "offset": 0, + "slot": "512", + "type": "t_array(t_uint256)29_storage", + "contract": "HypercertMinter", + "src": "src/protocol/HypercertMinter.sol:258" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)25_storage": { + "label": "uint256[25]", + "numberOfBytes": "800" + }, + "t_array(t_uint256)26_storage": { + "label": "uint256[26]", + "numberOfBytes": "832" + }, + "t_array(t_uint256)29_storage": { + "label": "uint256[29]", + "numberOfBytes": "928" + }, + "t_array(t_uint256)47_storage": { + "label": "uint256[47]", + "numberOfBytes": "1504" + }, + "t_array(t_uint256)48_storage": { + "label": "uint256[48]", + "numberOfBytes": "1536" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_enum(TransferRestrictions)19595": { + "label": "enum IHypercertToken.TransferRestrictions", + "members": [ + "AllowAll", + "DisallowAll", + "FromCreatorOnly" + ], + "numberOfBytes": "1" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_mapping(t_address,t_bool))": { + "label": "mapping(address => mapping(address => bool))", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_uint256)": { + "label": "mapping(address => uint256)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_bool)": { + "label": "mapping(bytes32 => bool)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_address)": { + "label": "mapping(uint256 => address)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_bytes32)": { + "label": "mapping(uint256 => bytes32)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_enum(TransferRestrictions)19595)": { + "label": "mapping(uint256 => enum IHypercertToken.TransferRestrictions)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_mapping(t_address,t_uint256))": { + "label": "mapping(uint256 => mapping(address => uint256))", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_mapping(t_bytes32,t_bool))": { + "label": "mapping(uint256 => mapping(bytes32 => bool))", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_string_storage)": { + "label": "mapping(uint256 => string)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_uint256)": { + "label": "mapping(uint256 => uint256)", + "numberOfBytes": "32" + }, + "t_string_storage": { + "label": "string", + "numberOfBytes": "32" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + }, + "namespaces": {} + } + } + } +} diff --git a/contracts/RELEASE.md b/contracts/RELEASE.md index e8b1a9ac..ce72ed0f 100644 --- a/contracts/RELEASE.md +++ b/contracts/RELEASE.md @@ -1,3 +1,8 @@ +# 2.0.0 + +- Marketplace contracts +- Arbitrum testnet + # 1.1.2 - Add Base and Base Sepolia to types diff --git a/contracts/foundry.toml b/contracts/foundry.toml index df710d19..2b0c1e76 100644 --- a/contracts/foundry.toml +++ b/contracts/foundry.toml @@ -33,12 +33,14 @@ goerli = { key = "${ETHERSCAN_API_KEY}" } optimism = { key = "${OPTIMISTIC_ETHERSCAN_API_KEY}" } sepolia = { key = "${ETHERSCAN_API_KEY}" } celo = { key = "${CELOSCAN_API_KEY}" } +arb_sepolia = { key = "${API_KEY_ARBISCAN}", url = "https://api-sepolia.arbiscan.io/api" } [rpc_endpoints] mainnet = "https://eth-pokt.nodies.app" goerli = "https://eth-goerli.g.alchemy.com/v2/${ALCHEMY_API_KEY}" optimism = "https://opt-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}" sepolia = "https://sepolia.infura.io/v3/${INFURA_API_KEY}" +arb_sepolia = "https://arb-sepolia.g.alchemy.com/v2/${ALCHEMY_API_KEY}" celo = "https://forno.celo.org" [fmt] diff --git a/contracts/hardhat.config.cts b/contracts/hardhat.config.cts index 2409755c..b75fdc8a 100644 --- a/contracts/hardhat.config.cts +++ b/contracts/hardhat.config.cts @@ -4,8 +4,8 @@ import "@nomicfoundation/hardhat-chai-matchers"; import "@nomicfoundation/hardhat-ethers"; import "@nomicfoundation/hardhat-viem"; import "@openzeppelin/hardhat-upgrades"; -import '@typechain/hardhat' -import '@nomicfoundation/hardhat-ethers' +import "@typechain/hardhat"; +import "@nomicfoundation/hardhat-ethers"; import "@primitivefi/hardhat-dodoc"; import { config as dotenvConfig } from "dotenv"; @@ -51,6 +51,7 @@ const OPTIMISTIC_ETHERSCAN_API_KEY = requireEnv( ); const CELOSCAN_API_KEY = requireEnv(process.env.CELOSCAN_API_KEY, "CELOSCAN_API_KEY"); const BASESCAN_API_KEY = requireEnv(process.env.BASESCAN_API_KEY, "BASESCAN_API_KEY"); +const ARBISCAN_API_KEY = requireEnv(process.env.ARBISCAN_API_KEY, "ARBISCAN_API_KEY"); /** * Maps a key to the chain ID @@ -67,6 +68,9 @@ const chainIds = { // Base "base-sepolia": 84532, "base-mainnet": 8453, + // Arbitrum + "arb-sepolia": 421614, + "arb-mainnet": 42161, }; function getChainConfig(chain: keyof typeof chainIds) { @@ -102,6 +106,20 @@ function getChainConfig(chain: keyof typeof chainIds) { }; } + if (chain === "arb-sepolia") { + config = { + ...config, + url: `https://arb-sepolia.g.alchemy.com/v2/${ALCHEMY_API_KEY}`, + }; + } + + if (chain === "arb-mainnet") { + config = { + ...config, + url: `https://arb-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}`, + }; + } + if (chain === "celo-mainnet") { config = { ...config, @@ -150,6 +168,8 @@ const config: HardhatUserConfig = { celo: CELOSCAN_API_KEY!, base: BASESCAN_API_KEY!, "base-sepolia": BASESCAN_API_KEY!, + "arb-sepolia": ARBISCAN_API_KEY!, + "arb-mainnet": ARBISCAN_API_KEY!, }, customChains: [ { @@ -168,6 +188,14 @@ const config: HardhatUserConfig = { browserURL: "https://sepolia.basescan.org", }, }, + { + network: "arb-sepolia", + chainId: 421614, + urls: { + apiURL: "https://api-sepolia.arbiscan.io/api", + browserURL: "https://sepolia.arbiscan.io/", + }, + }, ], }, networks: { @@ -194,6 +222,8 @@ const config: HardhatUserConfig = { "optimism-mainnet": getChainConfig("optimism-mainnet"), "base-sepolia": getChainConfig("base-sepolia"), "base-mainnet": getChainConfig("base-mainnet"), + "arb-sepolia": getChainConfig("arb-sepolia"), + "arb-mainnet": getChainConfig("arb-mainnet"), }, paths: { cache: "./cache_hardhat", // Use a different cache for Hardhat than Foundry diff --git a/contracts/package.json b/contracts/package.json index 707e3cff..b01ff99b 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -1,7 +1,7 @@ { "name": "@hypercerts-org/contracts", "description": "EVM compatible protocol for managing impact claims", - "version": "2.0.0-alpha.1", + "version": "2.0.0-alpha.2", "author": { "name": "Hypercerts Foundation", "url": "https://github.com/hypercerts-org/hypercerts" diff --git a/contracts/src/deployments/deployments-protocol.json b/contracts/src/deployments/deployments-protocol.json index 4d27e671..6740f84c 100644 --- a/contracts/src/deployments/deployments-protocol.json +++ b/contracts/src/deployments/deployments-protocol.json @@ -18,5 +18,9 @@ "8453": { "HypercertMinterUUPS": "0xC2d179166bc9dbB00A03686a5b17eCe2224c2704", "HypercertMinterImplementation": "0xa16DFb32Eb140a6f3F2AC68f41dAd8c7e83C4941" + }, + "421614": { + "HypercertMinterUUPS": "0x0A00a2f09cd37B24E7429c5238323bfebCfF3Ed9", + "HypercertMinterImplementation": "0x689587461AA3103D3D7975c5e4B352Ab711C14C2" } } diff --git a/contracts/src/index.ts b/contracts/src/index.ts index 093539e4..5c2a6c0b 100644 --- a/contracts/src/index.ts +++ b/contracts/src/index.ts @@ -75,6 +75,9 @@ const deployments = { 8453: { ...DEPLOYMENTS.protocol["8453"], }, + 421614: { + ...DEPLOYMENTS.protocol["421614"], + }, } as Record; const asDeployedChain = (chainId: string | number) => {