From 2d2e50f77d3afdf6a21df5d6cad1d830865e7b41 Mon Sep 17 00:00:00 2001 From: bitbeckers Date: Fri, 1 Mar 2024 17:37:06 +0100 Subject: [PATCH 1/6] chore(deploy): deploy to base sepolia --- contracts/.env.example | 1 + contracts/.openzeppelin/unknown-84532.json | 378 ++++++++++++++++++ contracts/hardhat.config.ts | 24 +- contracts/package.json | 2 + .../src/deployments/deployments-protocol.json | 4 + .../tasks/{deploy.ts => deploy-minter.ts} | 17 +- contracts/tasks/index.ts | 2 +- 7 files changed, 419 insertions(+), 9 deletions(-) create mode 100644 contracts/.openzeppelin/unknown-84532.json rename contracts/tasks/{deploy.ts => deploy-minter.ts} (83%) diff --git a/contracts/.env.example b/contracts/.env.example index 235bb631..3aa2b8d9 100644 --- a/contracts/.env.example +++ b/contracts/.env.example @@ -12,6 +12,7 @@ OPENZEPPELIN_SECRET_KEY="zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz" ETHERSCAN_API_KEY="zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz" OPTIMISTIC_ETHERSCAN_API_KEY="zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz" CELOSCAN_API_KEY="zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz" +BASESCAN_API_KEY="zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz" # Unused, ignore below REPORT_GAS=false diff --git a/contracts/.openzeppelin/unknown-84532.json b/contracts/.openzeppelin/unknown-84532.json new file mode 100644 index 00000000..37f47dd9 --- /dev/null +++ b/contracts/.openzeppelin/unknown-84532.json @@ -0,0 +1,378 @@ +{ + "manifestVersion": "3.2", + "proxies": [ + { + "address": "0xC2d179166bc9dbB00A03686a5b17eCe2224c2704", + "txHash": "0x7f1b46f64cf2613a972fcf8689092db973c9810bcca5327b79ecc9499f4e64be", + "kind": "uups" + } + ], + "impls": { + "125db54394ee349f18c5e7b6f717dff5868c4ccab68a96eeef38a6321b3f05b2": { + "address": "0xa16DFb32Eb140a6f3F2AC68f41dAd8c7e83C4941", + "txHash": "0x19770fd36c9cfc6e3c7d8e8a59222bc96d93c2e8054bbfaac18b12b736a3b206", + "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)19459)", + "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)19459": { + "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)19459)": { + "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/hardhat.config.ts b/contracts/hardhat.config.ts index 739dde7e..0b4fab8c 100644 --- a/contracts/hardhat.config.ts +++ b/contracts/hardhat.config.ts @@ -48,6 +48,7 @@ const OPTIMISTIC_ETHERSCAN_API_KEY = requireEnv( "OPTIMISTIC_ETHERSCAN_API_KEY", ); 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 OPENZEPPELIN_API_KEY = requireEnv(process.env.OPENZEPPELIN_API_KEY, "OPENZEPPELIN_API_KEY"); const OPENZEPPELIN_SECRET_KEY = requireEnv(process.env.OPENZEPPELIN_SECRET_KEY, "OPENZEPPELIN_SECRET_KEY"); @@ -66,6 +67,9 @@ const chainIds = { "optimism-goerli": 420, // Celo "celo-mainnet": 42220, + // Base + "base-sepolia": 84532, + base: 8453, }; function getChainConfig(chain: keyof typeof chainIds) { @@ -87,6 +91,13 @@ function getChainConfig(chain: keyof typeof chainIds) { }; } + if (chain === "base-sepolia") { + config = { + ...config, + url: `https://base-sepolia.g.alchemy.com/v2/${ALCHEMY_API_KEY}`, + }; + } + if (chain === "celo-mainnet") { config = { ...config, @@ -141,6 +152,8 @@ const config: HardhatUserConfig = { sepolia: ETHERSCAN_API_KEY!, optimisticEthereum: OPTIMISTIC_ETHERSCAN_API_KEY!, celo: CELOSCAN_API_KEY!, + base: BASESCAN_API_KEY!, + "base-sepolia": BASESCAN_API_KEY!, }, customChains: [ { @@ -151,6 +164,14 @@ const config: HardhatUserConfig = { browserURL: "https://celoscan.io/", }, }, + { + network: "base-sepolia", + chainId: 84532, + urls: { + apiURL: "https://api-sepolia.basescan.org/api", + browserURL: "https://sepolia.basescan.io", + }, + }, ], }, networks: { @@ -165,7 +186,7 @@ const config: HardhatUserConfig = { }, chainId: chainIds.hardhat, forking: { - url: `https://eth-goerli.g.alchemy.com/v2/${ALCHEMY_API_KEY}`, + url: `https://eth-sepolia.g.alchemy.com/v2/${ALCHEMY_API_KEY}`, }, }, localhost: { @@ -181,6 +202,7 @@ const config: HardhatUserConfig = { mainnet: getChainConfig("mainnet"), "optimism-goerli": getChainConfig("optimism-goerli"), "optimism-mainnet": getChainConfig("optimism-mainnet"), + "base-sepolia": getChainConfig("base-sepolia"), }, paths: { cache: "./cache_hardhat", // Use a different cache for Hardhat than Foundry diff --git a/contracts/package.json b/contracts/package.json index 08946ccc..865c526d 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -95,6 +95,8 @@ "build:forge": "pnpm clean && forge build", "clean": "rimraf abi artifacts build cache cache_hardhat dist out types", "deploy:marketplace:dryrun": "pnpm hardhat deploy-marketplace", + "deploy:protocol:dryrun": "pnpm hardhat deploy-minter", + "deploy:protocol": "pnpm hardhat deploy-minter", "docs": "hardhat dodoc", "lint": "pnpm lint:sol && pnpm prettier:check", "lint:sol": "forge fmt && solhint \"./{src,test/foundry/protocol,test/foundry/marketplace}/**/*.sol\"", diff --git a/contracts/src/deployments/deployments-protocol.json b/contracts/src/deployments/deployments-protocol.json index 2cad766f..d78ee567 100644 --- a/contracts/src/deployments/deployments-protocol.json +++ b/contracts/src/deployments/deployments-protocol.json @@ -10,5 +10,9 @@ "42220": { "HypercertMinterUUPS": "0x16bA53B74c234C870c61EFC04cD418B8f2865959", "HypercertMinterImplementation": "0x620257e9301a813be7cc5b75aae8dda3f6a926d2" + }, + "84532": { + "HypercertMinterUUPS": "0xC2d179166bc9dbB00A03686a5b17eCe2224c2704", + "HypercertMinterImplementation": "0xa16DFb32Eb140a6f3F2AC68f41dAd8c7e83C4941" } } diff --git a/contracts/tasks/deploy.ts b/contracts/tasks/deploy-minter.ts similarity index 83% rename from contracts/tasks/deploy.ts rename to contracts/tasks/deploy-minter.ts index 28767a74..a689f20a 100644 --- a/contracts/tasks/deploy.ts +++ b/contracts/tasks/deploy-minter.ts @@ -4,24 +4,27 @@ import { writeFile } from "node:fs/promises"; task("deploy-minter", "Deploy contracts and verify") .addOptionalParam("output", "write the details of the deployment to this file if this is set") .setAction(async ({ output }, { ethers, upgrades, network, run }) => { - console.log("Using address: ", await ethers.getSigners().then((res) => res[0])); + console.log("Using address: ", await ethers.getSigners().then((res) => res[0].address)); const HypercertMinter = await ethers.getContractFactory("HypercertMinter"); const hypercertMinter = await upgrades.deployProxy(HypercertMinter, { kind: "uups", unsafeAllow: ["constructor"], }); - const contract = await hypercertMinter.deployed(); - console.log(`HypercertMinter is deployed to proxy address: ${hypercertMinter.address}`); + await hypercertMinter.waitForDeployment(); + + const address = await hypercertMinter.getAddress(); + + console.log(`HypercertMinter is deployed to proxy address: ${address}`); // If the `deploymentFile` option is set then write the deployed address to // a json object on disk. This is intended to be deliberate with how we // output the contract address and other contract information. if (output) { - const txReceipt = await contract.provider.getTransactionReceipt(hypercertMinter.deployTransaction.hash); + const txReceipt = await hypercertMinter.provider.getTransactionReceipt(hypercertMinter.deployTransaction.hash); await writeFile( output, JSON.stringify({ - address: hypercertMinter.address, + address, blockNumber: txReceipt.blockNumber, }), "utf-8", @@ -30,13 +33,13 @@ task("deploy-minter", "Deploy contracts and verify") if (network.name !== "hardhat" && network.name !== "localhost") { try { - const code = await hypercertMinter.instance?.provider.getCode(hypercertMinter.address); + const code = await hypercertMinter.instance?.provider.getCode(address); if (code === "0x") { console.log(`${hypercertMinter.name} contract deployment has not completed. waiting to verify...`); await hypercertMinter.instance?.deployed(); } await run("verify:verify", { - address: hypercertMinter.address, + address, }); } catch (error) { const errorMessage = (error as Error).message; diff --git a/contracts/tasks/index.ts b/contracts/tasks/index.ts index 2a84bc1b..01b8fd7e 100644 --- a/contracts/tasks/index.ts +++ b/contracts/tasks/index.ts @@ -1,4 +1,4 @@ -export * from "./deploy"; +export * from "./deploy-minter"; export * from "./deploy-implementation"; export * from "./force-import"; export * from "./generate-address"; From 68d15d2cc43a6a5edec125679b6349cff146f786 Mon Sep 17 00:00:00 2001 From: bitbeckers Date: Fri, 1 Mar 2024 17:45:53 +0100 Subject: [PATCH 2/6] chore(admin): transfer ownership to safe --- README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 801cf77c..1e481118 100644 --- a/README.md +++ b/README.md @@ -15,12 +15,13 @@ For more details, check out our [website](https://hypercerts.org/). - Manually deployed via hardhat tasks - Note: This is not currently on CI/CD - | Network | HypercertMinter (UUPS Proxy) | Safe | - | -------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | - | Goerli | [0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07](https://goerli.etherscan.io/address/0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07) | [0x8CD35a62fF56A91485eBF97491612F1552dbc1c9](https://goerli.etherscan.io/address/0x8CD35a62fF56A91485eBF97491612F1552dbc1c9) | - | Sepolia | [0xa16DFb32Eb140a6f3F2AC68f41dAd8c7e83C4941](https://goerli.etherscan.io/address/0xa16DFb32Eb140a6f3F2AC68f41dAd8c7e83C4941) | TBD | - | Celo | [0x16bA53B74c234C870c61EFC04cD418B8f2865959](https://celoscan.io/address/0x16bA53B74c234C870c61EFC04cD418B8f2865959) | TBD | - | Optimism | [0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07](https://optimistic.etherscan.io/address/0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07) | [0x560adA72a80b4707e493cA8c3B7B7528930E7Be5](https://optimistic.etherscan.io/address/0x560adA72a80b4707e493cA8c3B7B7528930E7Be5) | + | Network | HypercertMinter (UUPS Proxy) | Safe | + | ------------ | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | + | Goerli | [0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07](https://goerli.etherscan.io/address/0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07) | [0x8CD35a62fF56A91485eBF97491612F1552dbc1c9](https://goerli.etherscan.io/address/0x8CD35a62fF56A91485eBF97491612F1552dbc1c9) | + | Sepolia | [0xa16DFb32Eb140a6f3F2AC68f41dAd8c7e83C4941](https://goerli.etherscan.io/address/0xa16DFb32Eb140a6f3F2AC68f41dAd8c7e83C4941) | TBD | + | Celo | [0x16bA53B74c234C870c61EFC04cD418B8f2865959](https://celoscan.io/address/0x16bA53B74c234C870c61EFC04cD418B8f2865959) | TBD | + | Optimism | [0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07](https://optimistic.etherscan.io/address/0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07) | [0x560adA72a80b4707e493cA8c3B7B7528930E7Be5](https://optimistic.etherscan.io/address/0x560adA72a80b4707e493cA8c3B7B7528930E7Be5) | + | Base Sepolia | [0xC2d179166bc9dbB00A03686a5b17eCe2224c2704](https://sepolia.basescan.org/address/0xC2d179166bc9dbB00A03686a5b17eCe2224c2704) | [0xA2Cb9D926b090577AD45fC0F40C753BF369B82Ff](https://sepolia.basescan.org/address/0xA2Cb9D926b090577AD45fC0F40C753BF369B82Ff) | - `/cors-proxy`: CORS proxy for Cloudflare Workers - [via GitHub actions](https://github.com/hypercerts-org/hypercerts/actions/workflows/deploy-cors-proxy.yml) From 64ac9dd73fa683f0b9d6b74e08cb748af2b5e6e0 Mon Sep 17 00:00:00 2001 From: bitbeckers Date: Fri, 1 Mar 2024 18:23:44 +0100 Subject: [PATCH 3/6] chore(publish): contract 1.1.1 --- README.md | 1 + contracts/.openzeppelin/unknown-8453.json | 378 ++++++++++++++++++ contracts/RELEASE.md | 1 + contracts/hardhat.config.ts | 12 +- contracts/package.json | 2 +- .../src/deployments/deployments-protocol.json | 4 + 6 files changed, 395 insertions(+), 3 deletions(-) create mode 100644 contracts/.openzeppelin/unknown-8453.json diff --git a/README.md b/README.md index 1e481118..2df6d154 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ For more details, check out our [website](https://hypercerts.org/). | Celo | [0x16bA53B74c234C870c61EFC04cD418B8f2865959](https://celoscan.io/address/0x16bA53B74c234C870c61EFC04cD418B8f2865959) | TBD | | Optimism | [0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07](https://optimistic.etherscan.io/address/0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07) | [0x560adA72a80b4707e493cA8c3B7B7528930E7Be5](https://optimistic.etherscan.io/address/0x560adA72a80b4707e493cA8c3B7B7528930E7Be5) | | Base Sepolia | [0xC2d179166bc9dbB00A03686a5b17eCe2224c2704](https://sepolia.basescan.org/address/0xC2d179166bc9dbB00A03686a5b17eCe2224c2704) | [0xA2Cb9D926b090577AD45fC0F40C753BF369B82Ff](https://sepolia.basescan.org/address/0xA2Cb9D926b090577AD45fC0F40C753BF369B82Ff) | + | Base Sepolia | [0xC2d179166bc9dbB00A03686a5b17eCe2224c2704](https://basescan.org/address/0xC2d179166bc9dbB00A03686a5b17eCe2224c2704) | [0x1FD06FD7743dB499a2d5bfBeD33A9Dc559a8D360](https://basescan.org/address/0x1FD06FD7743dB499a2d5bfBeD33A9Dc559a8D360) | - `/cors-proxy`: CORS proxy for Cloudflare Workers - [via GitHub actions](https://github.com/hypercerts-org/hypercerts/actions/workflows/deploy-cors-proxy.yml) diff --git a/contracts/.openzeppelin/unknown-8453.json b/contracts/.openzeppelin/unknown-8453.json new file mode 100644 index 00000000..1983706b --- /dev/null +++ b/contracts/.openzeppelin/unknown-8453.json @@ -0,0 +1,378 @@ +{ + "manifestVersion": "3.2", + "proxies": [ + { + "address": "0xC2d179166bc9dbB00A03686a5b17eCe2224c2704", + "txHash": "0x5dd944ab78414f59db05dc091acdd69d3680e26d2f068e83c42746606574f261", + "kind": "uups" + } + ], + "impls": { + "125db54394ee349f18c5e7b6f717dff5868c4ccab68a96eeef38a6321b3f05b2": { + "address": "0xa16DFb32Eb140a6f3F2AC68f41dAd8c7e83C4941", + "txHash": "0x7c121121cdd56fb81d2527bac9c53aefaa5eb5637b77181cfd6606b55f2ecde4", + "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)19459)", + "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)19459": { + "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)19459)": { + "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 3ddf00ec..4764bcec 100644 --- a/contracts/RELEASE.md +++ b/contracts/RELEASE.md @@ -1,6 +1,7 @@ # 1.1.1 - Improve ESM support by exporting `index.mjs` instead of `index.js`. @baumstern +- Deployed to Base and Base Sepolia networks ## New contributors diff --git a/contracts/hardhat.config.ts b/contracts/hardhat.config.ts index 0b4fab8c..54f635b3 100644 --- a/contracts/hardhat.config.ts +++ b/contracts/hardhat.config.ts @@ -69,7 +69,7 @@ const chainIds = { "celo-mainnet": 42220, // Base "base-sepolia": 84532, - base: 8453, + "base-mainnet": 8453, }; function getChainConfig(chain: keyof typeof chainIds) { @@ -98,6 +98,13 @@ function getChainConfig(chain: keyof typeof chainIds) { }; } + if (chain === "base-mainnet") { + config = { + ...config, + url: `https://base-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}`, + }; + } + if (chain === "celo-mainnet") { config = { ...config, @@ -169,7 +176,7 @@ const config: HardhatUserConfig = { chainId: 84532, urls: { apiURL: "https://api-sepolia.basescan.org/api", - browserURL: "https://sepolia.basescan.io", + browserURL: "https://sepolia.basescan.org", }, }, ], @@ -203,6 +210,7 @@ const config: HardhatUserConfig = { "optimism-goerli": getChainConfig("optimism-goerli"), "optimism-mainnet": getChainConfig("optimism-mainnet"), "base-sepolia": getChainConfig("base-sepolia"), + "base-mainnet": getChainConfig("base-mainnet"), }, paths: { cache: "./cache_hardhat", // Use a different cache for Hardhat than Foundry diff --git a/contracts/package.json b/contracts/package.json index 865c526d..163fe79d 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": "1.1.1-alpha.1", + "version": "1.1.1", "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 d78ee567..4d27e671 100644 --- a/contracts/src/deployments/deployments-protocol.json +++ b/contracts/src/deployments/deployments-protocol.json @@ -14,5 +14,9 @@ "84532": { "HypercertMinterUUPS": "0xC2d179166bc9dbB00A03686a5b17eCe2224c2704", "HypercertMinterImplementation": "0xa16DFb32Eb140a6f3F2AC68f41dAd8c7e83C4941" + }, + "8453": { + "HypercertMinterUUPS": "0xC2d179166bc9dbB00A03686a5b17eCe2224c2704", + "HypercertMinterImplementation": "0xa16DFb32Eb140a6f3F2AC68f41dAd8c7e83C4941" } } From ca5b687b32af69ef160a59dfb558b76fe4c67a1c Mon Sep 17 00:00:00 2001 From: bitbeckers Date: Fri, 1 Mar 2024 18:29:04 +0100 Subject: [PATCH 4/6] chore(defender): add base networks --- defender/package.json | 10 +++---- defender/src/networks.ts | 13 +++++++++ pnpm-lock.yaml | 60 +++++++++++++++++++++++++--------------- 3 files changed, 56 insertions(+), 27 deletions(-) diff --git a/defender/package.json b/defender/package.json index 48454fc8..13d05a93 100644 --- a/defender/package.json +++ b/defender/package.json @@ -15,11 +15,11 @@ }, "dependencies": { "@graphql-mesh/cache-localforage": "^0.95.7", - "@hypercerts-org/contracts": "1.1.0", - "@openzeppelin/defender-autotask-client": "1.50.0", - "@openzeppelin/defender-autotask-utils": "1.50.0", - "@openzeppelin/defender-base-client": "1.49.0", - "@openzeppelin/defender-sentinel-client": "1.49.0", + "@hypercerts-org/contracts": "1.1.1", + "@openzeppelin/defender-autotask-client": "1.54.1", + "@openzeppelin/defender-autotask-utils": "1.54.1", + "@openzeppelin/defender-base-client": "1.54.1", + "@openzeppelin/defender-sentinel-client": "1.54.1", "@openzeppelin/merkle-tree": "^1.0.2", "@supabase/supabase-js": "^2.4.1", "@types/lodash": "^4.14.199", diff --git a/defender/src/networks.ts b/defender/src/networks.ts index db9b3fb0..1321b812 100644 --- a/defender/src/networks.ts +++ b/defender/src/networks.ts @@ -33,6 +33,13 @@ export const NETWORKS: SupportedNetworks = { chainId: 11155111, rpc: "https://rpc.sepolia.org", }, + { + networkKey: "base-sepolia", + hypercertMinterContractAddress: deployments["84532"].HypercertMinterUUPS, + hypercertExchangeContractAddress: deployments["84532"].HypercertExchange, + chainId: 84532, + rpc: "https://base-sepolia-rpc.publicnode.com", + }, ], PROD: [ { @@ -47,6 +54,12 @@ export const NETWORKS: SupportedNetworks = { chainId: 42220, rpc: "https://forno.celo.org", }, + { + networkKey: "base", + hypercertMinterContractAddress: deployments["8453"].HypercertMinterUUPS, + chainId: 8453, + rpc: "https://mainnet.base.org", + }, ], }; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8d922a2b..41ea00db 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -205,20 +205,20 @@ importers: specifier: ^0.95.7 version: 0.95.8(@graphql-mesh/types@0.95.8)(@graphql-mesh/utils@0.95.8)(graphql@16.8.1)(tslib@2.6.2) '@hypercerts-org/contracts': - specifier: 1.1.0 - version: 1.1.0(ts-node@10.9.1)(typescript@4.9.5) + specifier: 1.1.1 + version: 1.1.1(ts-node@10.9.1)(typescript@4.9.5) '@openzeppelin/defender-autotask-client': - specifier: 1.50.0 - version: 1.50.0 + specifier: 1.54.1 + version: 1.54.1 '@openzeppelin/defender-autotask-utils': - specifier: 1.50.0 - version: 1.50.0 + specifier: 1.54.1 + version: 1.54.1 '@openzeppelin/defender-base-client': - specifier: 1.49.0 - version: 1.49.0(debug@4.3.4) + specifier: 1.54.1 + version: 1.54.1 '@openzeppelin/defender-sentinel-client': - specifier: 1.49.0 - version: 1.49.0 + specifier: 1.54.1 + version: 1.54.1 '@openzeppelin/merkle-tree': specifier: ^1.0.2 version: 1.0.5 @@ -7311,8 +7311,8 @@ packages: /@humanwhocodes/object-schema@2.0.1: resolution: {integrity: sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==} - /@hypercerts-org/contracts@1.1.0(ts-node@10.9.1)(typescript@4.9.5): - resolution: {integrity: sha512-iEEJP9LQTfgcFjnJj82AwkAob3kfFcTmxm6AGrCXFzt7CU3Xo2odCFKZ81UPFV9C4PyI8tPTSGd12NmUzjLlqA==} + /@hypercerts-org/contracts@1.1.1(ts-node@10.9.1)(typescript@4.9.5): + resolution: {integrity: sha512-TxzArJFWMzBh6EsBj9WQCO4CHjzWZFSMpltzFheUMCYp8TIBXBKC0zNViX68hbI7gEJQoA4xvPDVEqAkY1E8ig==} dependencies: hardhat: 2.19.1(ts-node@10.9.1)(typescript@4.9.5) transitivePeerDependencies: @@ -8956,11 +8956,12 @@ packages: - utf-8-validate dev: true - /@openzeppelin/defender-autotask-client@1.50.0: - resolution: {integrity: sha512-QWob3F6xuOu8r8oPy0Y2XLfAL1PTuKE2F4nC4wGeu3JJT8/pJz3xnHX5DgUYwiGIMqnkitUNUoBcmi4CPI31yw==} + /@openzeppelin/defender-autotask-client@1.54.1: + resolution: {integrity: sha512-Qn16qaP8djTB/1OGpd3red4H0srlu4mfnAyoLE+xeZ4R3iIvCGMq0mJB9KzDAdmB183EzdtVAxB5QvQe3X8elA==} + hasBin: true dependencies: - '@openzeppelin/defender-base-client': 1.50.0(debug@4.3.4) - axios: 1.5.1(debug@4.3.4) + '@openzeppelin/defender-base-client': 1.54.1 + axios: 1.6.2(debug@4.3.4) dotenv: 10.0.0 glob: 7.2.3 jszip: 3.10.1 @@ -8971,8 +8972,8 @@ packages: - encoding dev: false - /@openzeppelin/defender-autotask-utils@1.50.0: - resolution: {integrity: sha512-wuhm5idjsIiC7hdLj+z5ewDmyKx5q0tRXKHp05K9X8uo1CyLdHV2kKZjBrWzGE9qxVhJ79f9PzHZrLcyPHNDOg==} + /@openzeppelin/defender-autotask-utils@1.54.1: + resolution: {integrity: sha512-VWE6YrMy0mi4wkrigoR0oulJv3t5lWtNlT7831fRa8lIeKJTFScMqBVN515CKZfPfCn4YFXBAh8FZoe4q9e4rQ==} dev: false /@openzeppelin/defender-base-client@1.49.0(debug@4.3.4): @@ -8986,6 +8987,7 @@ packages: transitivePeerDependencies: - debug - encoding + dev: true /@openzeppelin/defender-base-client@1.50.0(debug@4.3.4): resolution: {integrity: sha512-V5uJ4t3kr9ex1RrqGH2DwsHuyW7/hl3VK0sSkq3VVbAewtcsW3cdg/UkXd5ITu6mtz76RoYkvUBHtkYUm0nb+w==} @@ -8998,6 +9000,20 @@ packages: transitivePeerDependencies: - debug - encoding + dev: true + + /@openzeppelin/defender-base-client@1.54.1: + resolution: {integrity: sha512-DRGz/7KN3ZQwu28YWMOaojrC7jjPkz/uCwkC8/C8B11qwZhA5qIVvyhYHhhFOCl0J84+E3TNdvkPD2q3p2WaJw==} + dependencies: + amazon-cognito-identity-js: 6.3.6 + async-retry: 1.3.3 + axios: 1.6.2(debug@4.3.4) + lodash: 4.17.21 + node-fetch: 2.7.0 + transitivePeerDependencies: + - debug + - encoding + dev: false /@openzeppelin/defender-sdk-account-client@1.4.0: resolution: {integrity: sha512-R3jJOh/Wirp+UtD/YYHzC1LYqdXsIPl77z7ZlJLdQDdWHZbIHpHCUlTrj1zZ/0+XovJ23ItiZqivnkVLqV62LQ==} @@ -9173,12 +9189,12 @@ packages: - web3-utils dev: true - /@openzeppelin/defender-sentinel-client@1.49.0: - resolution: {integrity: sha512-fr39U1GRWvJP1fWgwqjTYCz7uhfVfXJReWcivwxMeaoyMl+jYFxj8NkMhqkkbmI6O4TUyNMsmAQ34qFf0IS0/A==} + /@openzeppelin/defender-sentinel-client@1.54.1: + resolution: {integrity: sha512-Zy4GswU2+giAKL649CEpQXGk8AH2l7fvHWcdLHdKp88T96d4XhemZ5P7C1kWv2kdoHdRzLhIy2WKFKAigCOJdQ==} dependencies: '@ethersproject/abi': 5.7.0 - '@openzeppelin/defender-base-client': 1.49.0(debug@4.3.4) - axios: 1.5.1(debug@4.3.4) + '@openzeppelin/defender-base-client': 1.54.1 + axios: 1.6.2(debug@4.3.4) lodash: 4.17.21 node-fetch: 2.7.0 transitivePeerDependencies: From 30e175a9d79d339396694c6b93a1a138e598216e Mon Sep 17 00:00:00 2001 From: bitbeckers Date: Fri, 1 Mar 2024 18:32:19 +0100 Subject: [PATCH 5/6] chore(graph): add base deploys --- graph/package.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/graph/package.json b/graph/package.json index f983c57d..6eba6b35 100644 --- a/graph/package.json +++ b/graph/package.json @@ -9,11 +9,13 @@ "build": "pnpm build:graph && pnpm build:codegen", "build:graph": "graph build", "build:codegen": "graph codegen", - "deploy:test": "pnpm auth && pnpm deploy:sepolia", - "deploy:prod": "pnpm auth && pnpm deploy:optimism && pnpm deploy:celo", + "deploy:test": "pnpm auth && pnpm deploy:sepolia && pnpm deploy:base-sepolia", + "deploy:prod": "pnpm auth && pnpm deploy:optimism && pnpm deploy:celo && pnpm deploy:base", + "deploy:base": "graph deploy --node https://api.thegraph.com/deploy/ --network base hypercerts-admin/hypercerts-base-mainnet", "deploy:celo": "graph deploy --node https://api.thegraph.com/deploy/ --network celo hypercerts-admin/hypercerts-celo", "deploy:optimism": "graph deploy --node https://api.thegraph.com/deploy/ --network optimism hypercerts-admin/hypercerts-optimism-mainnet", "deploy:sepolia": "graph deploy --node https://api.thegraph.com/deploy/ --network sepolia hypercerts-admin/hypercerts-sepolia", + "deploy:base-sepolia": "graph deploy --node https://api.thegraph.com/deploy/ --network base-sepolia hypercerts-admin/hypercerts-base-sepolia", "create-local": "graph create --node http://localhost:8020/ hypercerts-admin/hypercerts-testnet", "remove-local": "graph remove --node http://localhost:8020/ hypercerts-admin/hypercerts-testnet", "deploy-local": "graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 hypercerts-admin/hypercerts-testnet", From 74f9186b8ba83aed727e1a94091f170c3b4af018 Mon Sep 17 00:00:00 2001 From: bitbeckers Date: Fri, 1 Mar 2024 19:12:28 +0100 Subject: [PATCH 6/6] feat(mint): mint on base sepolia in fe --- contracts/RELEASE.md | 4 +++ contracts/package.json | 2 +- contracts/src/index.ts | 6 +++++ defender/package.json | 2 +- frontend/components/dapp-context.tsx | 6 ++--- frontend/hooks/hypercerts-client.ts | 2 +- frontend/package.json | 4 +-- pnpm-lock.yaml | 38 ++++++++++++++-------------- sdk/RELEASE.md | 5 ++++ sdk/package.json | 4 +-- sdk/src/constants.ts | 10 ++++++++ sdk/src/indexer/gql/graphql.ts | 5 ++++ sdk/src/types/client.ts | 4 +-- sdk/src/utils/config.ts | 6 +++-- 14 files changed, 65 insertions(+), 33 deletions(-) diff --git a/contracts/RELEASE.md b/contracts/RELEASE.md index 4764bcec..e8b1a9ac 100644 --- a/contracts/RELEASE.md +++ b/contracts/RELEASE.md @@ -1,3 +1,7 @@ +# 1.1.2 + +- Add Base and Base Sepolia to types + # 1.1.1 - Improve ESM support by exporting `index.mjs` instead of `index.js`. @baumstern diff --git a/contracts/package.json b/contracts/package.json index 163fe79d..f155217d 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": "1.1.1", + "version": "1.1.2", "author": { "name": "Hypercerts Foundation", "url": "https://github.com/hypercerts-org/hypercerts" diff --git a/contracts/src/index.ts b/contracts/src/index.ts index 147ce320..9ae6d333 100644 --- a/contracts/src/index.ts +++ b/contracts/src/index.ts @@ -72,6 +72,12 @@ const deployments = { ...DEPLOYMENTS.protocol["11155111"], ...DEPLOYMENTS.marketplace["11155111"], }, + 84532: { + ...DEPLOYMENTS.protocol["84532"], + }, + 8453: { + ...DEPLOYMENTS.protocol["8453"], + }, } as Record; const asDeployedChain = (chainId: string | number) => { diff --git a/defender/package.json b/defender/package.json index 13d05a93..2ff45321 100644 --- a/defender/package.json +++ b/defender/package.json @@ -15,7 +15,7 @@ }, "dependencies": { "@graphql-mesh/cache-localforage": "^0.95.7", - "@hypercerts-org/contracts": "1.1.1", + "@hypercerts-org/contracts": "1.1.2", "@openzeppelin/defender-autotask-client": "1.54.1", "@openzeppelin/defender-autotask-utils": "1.54.1", "@openzeppelin/defender-base-client": "1.54.1", diff --git a/frontend/components/dapp-context.tsx b/frontend/components/dapp-context.tsx index bed7f318..69a461c4 100644 --- a/frontend/components/dapp-context.tsx +++ b/frontend/components/dapp-context.tsx @@ -31,7 +31,7 @@ import { import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; import { ReactQueryDevtools } from "@tanstack/react-query-devtools"; import React, { ReactNode, useEffect } from "react"; -import { celo, Chain, optimism, sepolia } from "viem/chains"; +import { celo, Chain, optimism, sepolia, baseSepolia, base } from "viem/chains"; import { configureChains, WagmiConfig, createConfig } from "wagmi"; import { publicProvider } from "wagmi/providers/public"; @@ -44,8 +44,8 @@ import { const queryClient = new QueryClient(); -const TEST_CHAINS = [sepolia]; -const PROD_CHAINS = [optimism, celo]; +const TEST_CHAINS = [sepolia, baseSepolia]; +const PROD_CHAINS = [optimism, celo, base]; export const CHAINS = (isProduction ? PROD_CHAINS : TEST_CHAINS) as Chain[]; diff --git a/frontend/hooks/hypercerts-client.ts b/frontend/hooks/hypercerts-client.ts index 1d3dd052..fafcae20 100644 --- a/frontend/hooks/hypercerts-client.ts +++ b/frontend/hooks/hypercerts-client.ts @@ -4,7 +4,7 @@ import { HypercertClient, HypercertClientConfig } from "@hypercerts-org/sdk"; import { useWalletClient, useNetwork } from "wagmi"; const isSupportedChain = (chainId: number) => { - const supportedChainIds = [10, 42220, 11155111]; // Replace with actual chain IDs + const supportedChainIds = [10, 42220, 11155111, 84532, 8453]; // Replace with actual chain IDs return supportedChainIds.includes(chainId); }; diff --git a/frontend/package.json b/frontend/package.json index 14c037dd..0f149720 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -23,9 +23,9 @@ "@emotion/react": "^11.10.5", "@emotion/styled": "^11.10.5", "@graphprotocol/client-cli": "^2.2.16", - "@hypercerts-org/contracts": "1.1.1-alpha.0", + "@hypercerts-org/contracts": "1.1.2", "@hypercerts-org/observabletreemap": "workspace: *", - "@hypercerts-org/sdk": "1.4.2-alpha.0", + "@hypercerts-org/sdk": "1.4.3", "@mui/icons-material": "^5.11.9", "@mui/material": "^5.11.2", "@mui/x-date-pickers": "^5.0.12", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 41ea00db..8ba87458 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -205,8 +205,8 @@ importers: specifier: ^0.95.7 version: 0.95.8(@graphql-mesh/types@0.95.8)(@graphql-mesh/utils@0.95.8)(graphql@16.8.1)(tslib@2.6.2) '@hypercerts-org/contracts': - specifier: 1.1.1 - version: 1.1.1(ts-node@10.9.1)(typescript@4.9.5) + specifier: 1.1.2 + version: 1.1.2(ts-node@10.9.1)(typescript@4.9.5) '@openzeppelin/defender-autotask-client': specifier: 1.54.1 version: 1.54.1 @@ -345,14 +345,14 @@ importers: specifier: ^2.2.16 version: 2.2.22(@babel/core@7.23.5)(@envelop/core@3.0.6)(@graphql-mesh/cross-helpers@0.3.4)(@graphql-mesh/store@0.93.1)(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.93.2)(@graphql-tools/delegate@9.0.35)(@graphql-tools/merge@8.4.2)(@graphql-tools/utils@9.2.1)(@graphql-tools/wrap@9.4.2)(@types/node@18.18.7)(graphql-tag@2.12.6)(graphql@16.8.1)(react-native@0.72.6) '@hypercerts-org/contracts': - specifier: 1.1.1-alpha.0 - version: 1.1.1-alpha.0(typescript@5.1.6) + specifier: 1.1.2 + version: 1.1.2(typescript@5.1.6) '@hypercerts-org/observabletreemap': specifier: 'workspace: *' version: link:../vendor/observabletreemap '@hypercerts-org/sdk': - specifier: 1.4.2-alpha.0 - version: 1.4.2-alpha.0(react@18.2.0)(typescript@5.1.6)(zod@3.22.4) + specifier: 1.4.3 + version: 1.4.3(react@18.2.0)(typescript@5.1.6)(zod@3.22.4) '@mui/icons-material': specifier: ^5.11.9 version: 5.14.15(@mui/material@5.14.15)(@types/react@18.2.33)(react@18.2.0) @@ -568,8 +568,8 @@ importers: specifier: ^3.2.0 version: 3.2.0(graphql@16.8.1) '@hypercerts-org/contracts': - specifier: 1.1.1-alpha.1 - version: 1.1.1-alpha.1(ts-node@10.9.1)(typescript@5.3.2) + specifier: 1.1.2 + version: 1.1.2(ts-node@10.9.1)(typescript@5.3.2) '@openzeppelin/merkle-tree': specifier: ^1.0.5 version: 1.0.5 @@ -7311,8 +7311,8 @@ packages: /@humanwhocodes/object-schema@2.0.1: resolution: {integrity: sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==} - /@hypercerts-org/contracts@1.1.1(ts-node@10.9.1)(typescript@4.9.5): - resolution: {integrity: sha512-TxzArJFWMzBh6EsBj9WQCO4CHjzWZFSMpltzFheUMCYp8TIBXBKC0zNViX68hbI7gEJQoA4xvPDVEqAkY1E8ig==} + /@hypercerts-org/contracts@1.1.2(ts-node@10.9.1)(typescript@4.9.5): + resolution: {integrity: sha512-+Y7TD1LX1c2FyU7OYuQ/NUFfcKaW5fIZ9R/Xr+DhNUbi7KstHhhdVEl1hmSExuvySbAD3wNKFaQWdlBRxT520Q==} dependencies: hardhat: 2.19.1(ts-node@10.9.1)(typescript@4.9.5) transitivePeerDependencies: @@ -7323,10 +7323,10 @@ packages: - utf-8-validate dev: false - /@hypercerts-org/contracts@1.1.1-alpha.0(typescript@5.1.6): - resolution: {integrity: sha512-3bypIOuTMLM/5KXopzOCOxcR+nUImFf/phPtZ/PoHceAx4CZZe1ygnK8l+GHaBxOX7/HcAp/9D7NBbcnJjHYcw==} + /@hypercerts-org/contracts@1.1.2(ts-node@10.9.1)(typescript@5.3.2): + resolution: {integrity: sha512-+Y7TD1LX1c2FyU7OYuQ/NUFfcKaW5fIZ9R/Xr+DhNUbi7KstHhhdVEl1hmSExuvySbAD3wNKFaQWdlBRxT520Q==} dependencies: - hardhat: 2.19.1(typescript@5.1.6) + hardhat: 2.19.1(ts-node@10.9.1)(typescript@5.3.2) transitivePeerDependencies: - bufferutil - supports-color @@ -7335,10 +7335,10 @@ packages: - utf-8-validate dev: false - /@hypercerts-org/contracts@1.1.1-alpha.1(ts-node@10.9.1)(typescript@5.3.2): - resolution: {integrity: sha512-M7cNYEf+i6rT2jSOT4sob/oIlKalT2zSweBQq6iP1wCA16Vhf0Y5JDhwLH64z4XENJfOKKSO0TmDDF2kKvHReg==} + /@hypercerts-org/contracts@1.1.2(typescript@5.1.6): + resolution: {integrity: sha512-+Y7TD1LX1c2FyU7OYuQ/NUFfcKaW5fIZ9R/Xr+DhNUbi7KstHhhdVEl1hmSExuvySbAD3wNKFaQWdlBRxT520Q==} dependencies: - hardhat: 2.19.1(ts-node@10.9.1)(typescript@5.3.2) + hardhat: 2.19.1(typescript@5.1.6) transitivePeerDependencies: - bufferutil - supports-color @@ -7347,13 +7347,13 @@ packages: - utf-8-validate dev: false - /@hypercerts-org/sdk@1.4.2-alpha.0(react@18.2.0)(typescript@5.1.6)(zod@3.22.4): - resolution: {integrity: sha512-VT8cd0dfbREKbD8YyQrmoyBLUrVerLwdzLqet6f+LO4yh0dtKHwKIuJJNqbhao5vwzn/iSyob08xIFmGu8rivA==} + /@hypercerts-org/sdk@1.4.3(react@18.2.0)(typescript@5.1.6)(zod@3.22.4): + resolution: {integrity: sha512-9K/2dY/r5dXZiFPlM9rg06P36aH49grpetsvisi9HxJMJYTIQy6ZKvB/ix3zC7LS+zSv8fhz13AEoQVlmP3Svw==} dependencies: '@ethereum-attestation-service/eas-sdk': 1.3.7(typescript@5.1.6) '@ethersproject/abstract-signer': 5.7.0 '@graphql-typed-document-node/core': 3.2.0(graphql@16.8.1) - '@hypercerts-org/contracts': 1.1.1-alpha.0(typescript@5.1.6) + '@hypercerts-org/contracts': 1.1.2(typescript@5.1.6) '@openzeppelin/merkle-tree': 1.0.5 '@urql/core': 4.2.0(graphql@16.8.1) '@whatwg-node/fetch': 0.9.14 diff --git a/sdk/RELEASE.md b/sdk/RELEASE.md index 5f65a06f..e97c8e8a 100644 --- a/sdk/RELEASE.md +++ b/sdk/RELEASE.md @@ -1,11 +1,16 @@ # Release notes +## 1.4.3 + +- Add Base and Base Sepolia to supported chains in config + ## 1.4.2 - Improve ESM support by exporting `index.mjs` instead of `index.js`. @baumstern - Added dweb IPFS gateway links and use `Promise.any` call to try and fetch data from multiple gateways. - Expose timeout on HTTP requests from storage layer up to client wrapper methods as optional config. - Default timeout on calls of 0 ms (no timeout) to avoid issues with large files or multiple IPFS calls. +- Updated contracts package to support Base and Base Sepolia ## New contributors diff --git a/sdk/package.json b/sdk/package.json index e9d327d4..3ac4d84b 100644 --- a/sdk/package.json +++ b/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@hypercerts-org/sdk", - "version": "1.4.2-alpha.2", + "version": "1.4.3", "description": "SDK for hypercerts protocol", "repository": "git@github.com:hypercerts-org/hypercerts.git", "author": "Hypercerts team", @@ -24,7 +24,7 @@ "@ethereum-attestation-service/eas-sdk": "1.3.7", "@ethersproject/abstract-signer": "^5.7.0", "@graphql-typed-document-node/core": "^3.2.0", - "@hypercerts-org/contracts": "1.1.1-alpha.1", + "@hypercerts-org/contracts": "1.1.2", "@openzeppelin/merkle-tree": "^1.0.5", "@urql/core": "^4.2.0", "@whatwg-node/fetch": "^0.9.13", diff --git a/sdk/src/constants.ts b/sdk/src/constants.ts index dffe3011..b6956c20 100644 --- a/sdk/src/constants.ts +++ b/sdk/src/constants.ts @@ -31,6 +31,16 @@ const DEPLOYMENTS: { [key in SupportedChainIds]: Partial } = { graphName: "hypercerts-sepolia", graphUrl: `${DEFAULT_GRAPH_BASE_URL}/hypercerts-sepolia`, } as const, + 84532: { + addresses: deployments[84532], + graphName: "hypercerts-base-sepolia", + graphUrl: `${DEFAULT_GRAPH_BASE_URL}/hypercerts-base-sepolia`, + } as const, + 8453: { + addresses: deployments[8453], + graphName: "hypercerts-base-mainnet", + graphUrl: `${DEFAULT_GRAPH_BASE_URL}/hypercerts-base-mainnet`, + } as const, }; // Example schema on Sepolia diff --git a/sdk/src/indexer/gql/graphql.ts b/sdk/src/indexer/gql/graphql.ts index 26091837..16905658 100644 --- a/sdk/src/indexer/gql/graphql.ts +++ b/sdk/src/indexer/gql/graphql.ts @@ -103,6 +103,11 @@ export enum AcceptedToken_OrderBy { TokenSymbol = "token__symbol", } +export enum Aggregation_Interval { + Day = "day", + Hour = "hour", +} + export type Allowlist = { __typename?: "Allowlist"; claim: Claim; diff --git a/sdk/src/types/client.ts b/sdk/src/types/client.ts index d0c498a6..fab055bc 100644 --- a/sdk/src/types/client.ts +++ b/sdk/src/types/client.ts @@ -10,9 +10,9 @@ import { HypercertMinterAbi } from "@hypercerts-org/contracts"; /** * Enum to verify the supported chainIds * - * @note 10 = Optimism, 42220 = Celo, 11155111 = Sepolia + * @note 10 = Optimism, 42220 = Celo, 11155111 = Sepolia, 84532 = Base Sepolia, 8453 = Base Mainnet */ -export type SupportedChainIds = 10 | 42220 | 11155111; +export type SupportedChainIds = 10 | 42220 | 11155111 | 84532 | 8453; export type SupportedOverrides = ContractOverrides & StorageConfigOverrides; diff --git a/sdk/src/utils/config.ts b/sdk/src/utils/config.ts index 3f2dec35..7ac30a8e 100644 --- a/sdk/src/utils/config.ts +++ b/sdk/src/utils/config.ts @@ -1,4 +1,4 @@ -import { sepolia, optimism, celo, Chain } from "viem/chains"; +import { sepolia, optimism, celo, Chain, baseSepolia, base } from "viem/chains"; import { DEPLOYMENTS } from "../constants"; import { @@ -25,6 +25,8 @@ import { deployments } from "../../src"; * - 10: Optimism * - 42220: Celo * - 11155111: Sepolia + * - 84532: Base Sepolia + * - 8453: Base Mainnet * * @param {Partial} overrides - An object containing any configuration values to override. This should be a partial HypercertClientConfig object. * @returns {Partial} The final configuration object for the Hypercert client. @@ -181,7 +183,7 @@ const getEasContractAddress = (overrides: Partial) => { }; const getDefaultChain = (chainId: number) => { - const _chains = [sepolia, optimism, celo]; + const _chains = [sepolia, optimism, celo, base, baseSepolia]; for (const chain of Object.values(_chains)) { if ("id" in chain) {