diff --git a/governance/.openzeppelin/unknown-84532.json b/governance/.openzeppelin/unknown-84532.json new file mode 100644 index 00000000000..f0b6292b426 --- /dev/null +++ b/governance/.openzeppelin/unknown-84532.json @@ -0,0 +1,280 @@ +{ + "manifestVersion": "3.2", + "proxies": [ + { + "address": "0x259813B665C8f6074391028ef782e27B65840d89", + "txHash": "0x00676bcbd95a7de923bb7ada6008a6863a05d9602721c9d355a82274a30be36f", + "kind": "transparent" + } + ], + "impls": { + "c6d805c82f3f300da2425695b00fbf12dfe20f45dc8ffdf35ed30d444ccd6d60": { + "address": "0xf98D7ADA874D53a75BbDfB05D2A96C1525d426A7", + "txHash": "0x91d7ba08318d557ee0d725745322ee818f2199c91bd694a64171b296d739320e", + "layout": { + "solcVersion": "0.8.21", + "storage": [ + { + "label": "initialized", + "offset": 0, + "slot": "0", + "type": "t_bool", + "contract": "UnlockInitializable", + "src": "contracts/past-versions/UnlockV13.sol:1327" + }, + { + "label": "initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "UnlockInitializable", + "src": "contracts/past-versions/UnlockV13.sol:1332" + }, + { + "label": "______gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "UnlockContextUpgradeable", + "src": "contracts/past-versions/UnlockV13.sol:1406" + }, + { + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address", + "contract": "UnlockOwnable", + "src": "contracts/past-versions/UnlockV13.sol:1435" + }, + { + "label": "______gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)50_storage", + "contract": "UnlockOwnable", + "src": "contracts/past-versions/UnlockV13.sol:1501" + }, + { + "label": "grossNetworkProduct", + "offset": 0, + "slot": "102", + "type": "t_uint256", + "contract": "Unlock", + "src": "contracts/past-versions/UnlockV13.sol:2786" + }, + { + "label": "totalDiscountGranted", + "offset": 0, + "slot": "103", + "type": "t_uint256", + "contract": "Unlock", + "src": "contracts/past-versions/UnlockV13.sol:2788" + }, + { + "label": "locks", + "offset": 0, + "slot": "104", + "type": "t_mapping(t_address,t_struct(LockBalances)3109_storage)", + "contract": "Unlock", + "src": "contracts/past-versions/UnlockV13.sol:2791" + }, + { + "label": "globalBaseTokenURI", + "offset": 0, + "slot": "105", + "type": "t_string_storage", + "contract": "Unlock", + "src": "contracts/past-versions/UnlockV13.sol:2795" + }, + { + "label": "globalTokenSymbol", + "offset": 0, + "slot": "106", + "type": "t_string_storage", + "contract": "Unlock", + "src": "contracts/past-versions/UnlockV13.sol:2799" + }, + { + "label": "publicLockAddress", + "offset": 0, + "slot": "107", + "type": "t_address", + "contract": "Unlock", + "src": "contracts/past-versions/UnlockV13.sol:2802" + }, + { + "label": "uniswapOracles", + "offset": 0, + "slot": "108", + "type": "t_mapping(t_address,t_contract(IUniswapOracleV3)757)", + "contract": "Unlock", + "src": "contracts/past-versions/UnlockV13.sol:2806" + }, + { + "label": "weth", + "offset": 0, + "slot": "109", + "type": "t_address", + "contract": "Unlock", + "src": "contracts/past-versions/UnlockV13.sol:2809" + }, + { + "label": "udt", + "offset": 0, + "slot": "110", + "type": "t_address", + "contract": "Unlock", + "src": "contracts/past-versions/UnlockV13.sol:2812" + }, + { + "label": "estimatedGasForPurchase", + "offset": 0, + "slot": "111", + "type": "t_uint256", + "contract": "Unlock", + "src": "contracts/past-versions/UnlockV13.sol:2815" + }, + { + "label": "chainId", + "offset": 0, + "slot": "112", + "type": "t_uint256", + "contract": "Unlock", + "src": "contracts/past-versions/UnlockV13.sol:2818" + }, + { + "label": "proxyAdminAddress", + "offset": 0, + "slot": "113", + "type": "t_address", + "contract": "Unlock", + "src": "contracts/past-versions/UnlockV13.sol:2821" + }, + { + "label": "proxyAdmin", + "offset": 0, + "slot": "114", + "type": "t_contract(ProxyAdmin)3095", + "contract": "Unlock", + "src": "contracts/past-versions/UnlockV13.sol:2822" + }, + { + "label": "_publicLockVersions", + "offset": 0, + "slot": "115", + "type": "t_mapping(t_address,t_uint16)", + "contract": "Unlock", + "src": "contracts/past-versions/UnlockV13.sol:2825" + }, + { + "label": "_publicLockImpls", + "offset": 0, + "slot": "116", + "type": "t_mapping(t_uint16,t_address)", + "contract": "Unlock", + "src": "contracts/past-versions/UnlockV13.sol:2826" + }, + { + "label": "publicLockLatestVersion", + "offset": 0, + "slot": "117", + "type": "t_uint16", + "contract": "Unlock", + "src": "contracts/past-versions/UnlockV13.sol:2827" + }, + { + "label": "protocolFee", + "offset": 0, + "slot": "118", + "type": "t_uint256", + "contract": "Unlock", + "src": "contracts/past-versions/UnlockV13.sol:2830" + }, + { + "label": "swapBurnerAddress", + "offset": 0, + "slot": "119", + "type": "t_address", + "contract": "Unlock", + "src": "contracts/past-versions/UnlockV13.sol:2833" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(IUniswapOracleV3)757": { + "label": "contract IUniswapOracleV3", + "numberOfBytes": "20" + }, + "t_contract(ProxyAdmin)3095": { + "label": "contract ProxyAdmin", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_contract(IUniswapOracleV3)757)": { + "label": "mapping(address => contract IUniswapOracleV3)", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_struct(LockBalances)3109_storage)": { + "label": "mapping(address => struct Unlock.LockBalances)", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_uint16)": { + "label": "mapping(address => uint16)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint16,t_address)": { + "label": "mapping(uint16 => address)", + "numberOfBytes": "32" + }, + "t_string_storage": { + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(LockBalances)3109_storage": { + "label": "struct Unlock.LockBalances", + "members": [ + { + "label": "deployed", + "type": "t_bool", + "offset": 0, + "slot": "0" + }, + { + "label": "totalSales", + "type": "t_uint256", + "offset": 0, + "slot": "1" + }, + { + "label": "yieldedDiscountTokens", + "type": "t_uint256", + "offset": 0, + "slot": "2" + } + ], + "numberOfBytes": "96" + }, + "t_uint16": { + "label": "uint16", + "numberOfBytes": "2" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + } + }, + "namespaces": {} + } + } + } +} diff --git a/governance/README.md b/governance/README.md index 201fe432990..aa8f451c74c 100644 --- a/governance/README.md +++ b/governance/README.md @@ -23,7 +23,7 @@ yarn workspace @unlock-protocol/networks build ## Add block explorer verification -- add a `` key to the `apiKey` object in [`packages/hardhat-helpers/etherscan.js`](/packages/hardhat-helpers/src/etherscan.js) +- add a `` key to the `apiKey` object in [`packages/hardhat-helpers/src/etherscan.js`](/packages/hardhat-helpers/src/etherscan.js) - optionally can add support for env variable When you are done, rebuild the helpers package with @@ -74,9 +74,25 @@ yarn hardhat set:unlock-config ### Deploy the subgraph -First you will need to create a new graph on [The Graph](https://thegraph.com) studio. +1. First you will need to create a new graph on [The Graph studio](https://thegraph.com/studio). -Then the following commands +2. In the `packages/networks/src/.ts` config file, fill the `subgraph` object as follow: + +```js +subgraph: { + endpoint: '<>', // this is given to you by the graph after deploying + networkName: 'base-sepolia', // the graph name of the network see https://thegraph.com/docs/en/developing/supported-networks/ + studioName: 'unlock-protocol-', // the name of the graph + }, +``` + +3. Rebuild the networks package + +``` +yarn workspace @unlock-protocol/networks build +``` + +4. Deploy the graph by using the following commands ```shell # got to the subgraph folder @@ -85,10 +101,10 @@ cd subgraph # create the subgraph.yaml and generate the files yarn build -yarn deploy:studio +yarn deploy ``` -The graph will now sync. In the `packages/networks/src/.ts` config file, fill the `subgraph` object with a name in `studioEndpoint` and the API url in `endpoint`. +The graph is now deployed. Add the URL that is shown to the network file. ### Verify contracts diff --git a/packages/hardhat-helpers/src/etherscan.js b/packages/hardhat-helpers/src/etherscan.js index 7697f69f144..3b97dc97765 100644 --- a/packages/hardhat-helpers/src/etherscan.js +++ b/packages/hardhat-helpers/src/etherscan.js @@ -16,8 +16,8 @@ const etherscan = { polygonMumbai: 'W9TVEYKW2CDTQ94T3A2V93IX6U3IHQN5Y3', avalanche: 'N4AF8AYN8PXY2MFPUT8PAFSZNVJX5Q814X', celo: '6KBKUFYV3NQR4Y1BQN3Q34S2U7NTZBBPQZ', - baseGoerli: 'YourApiKeyToken', base: 'F9E5R4E8HIJQZMRE9U9IZMP7NVZ2IAXNB8', + baseSepolia: 'F9E5R4E8HIJQZMRE9U9IZMP7NVZ2IAXNB8', linea: 'S66J314Q7PICPB4RP2G117KDFQRBEUYIFX', polygonZkEVM: '8H4ZB9SQBMQ7WA1TCIXFQVCHTVX8DXTY9Y', scroll: 'BZEXNPN6KKKJQ8VIMNXZDZNEX7QQZWZQ3P', @@ -33,11 +33,11 @@ const etherscan = { }, }, { - network: 'baseGoerli', - chainId: 84531, + network: 'baseSepolia', + chainId: 84532, urls: { - apiURL: 'https://api-goerli.basescan.org/api', - browserURL: 'https://goerli.basescan.org/', + apiURL: 'https://api-sepolia.basescan.org/api', + browserURL: 'https://sepolia.basescan.org/', }, }, { diff --git a/packages/networks/src/networks/base-sepolia.ts b/packages/networks/src/networks/base-sepolia.ts new file mode 100644 index 00000000000..d2d6318ce6c --- /dev/null +++ b/packages/networks/src/networks/base-sepolia.ts @@ -0,0 +1,75 @@ +import { NetworkConfig } from '@unlock-protocol/types' + +export const baseSepolia: NetworkConfig = { + blockScan: { + url: (address: string) => `https://blockscan.com/address/${address}`, + }, + chain: 'base-sepolia', + description: 'A public testnet for Base.', + explorer: { + name: 'Base Sepolia Etherscan', + urls: { + address: (address: string) => + `https://sepolia.basescan.org/address/${address}`, + base: `https://sepolia.basescan.org/`, + token: (address: string, holder: string) => + `https://sepolia.basescan.org/token/${address}?a=${holder}`, + transaction: (hash: string) => `https://sepolia.basescan.org/tx/${hash}`, + }, + }, + featured: false, + fullySubsidizedGas: true, + hooks: {}, + id: 84532, + isTestNetwork: true, + keyManagerAddress: '', + maxFreeClaimCost: 1000, + multisig: '0x68F2c5D9009dc4d553f814D689102a53B2b349Cc', + name: 'Base Sepolia', + nativeCurrency: { + coingecko: 'ethereum', + decimals: 18, + name: 'ETH', + symbol: 'ETH', + }, + + previousDeploys: [], + + provider: 'https://rpc.unlock-protocol.com/84532', + + publicLockVersionToDeploy: 14, + + publicProvider: 'https://sepolia.base.org', + + startBlock: 7889118, + subgraph: { + endpoint: + 'https://api.studio.thegraph.com/query/65299/unlock-protocol-base-sepolia/version/latest', + networkName: 'base-sepolia', + studioName: 'unlock-protocol-base-sepolia', + }, + swapPurchaser: '', + tokens: [ + { + address: '0x4200000000000000000000000000000000000006', + decimals: 18, + featured: true, + mainnetAddress: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', + name: 'Wrapped Ether', + symbol: 'WETH', + }, + { + address: '0x036CbD53842c5426634e7929541eC2318f3dCF7e', + decimals: 6, + featured: true, + name: 'USDC', + symbol: 'USDC', + }, + ], + unlockAddress: '0x259813B665C8f6074391028ef782e27B65840d89', + unlockDaoToken: { + address: '', + }, +} + +export default baseSepolia diff --git a/packages/networks/src/networks/index.ts b/packages/networks/src/networks/index.ts index 3208f9d0dd4..40ff37960be 100644 --- a/packages/networks/src/networks/index.ts +++ b/packages/networks/src/networks/index.ts @@ -14,3 +14,4 @@ export * from './sepolia' export * from './zkevm' export * from './scroll' export * from './zksync' +export * from './base-sepolia' diff --git a/provider/src/supportedNetworks.ts b/provider/src/supportedNetworks.ts index 89bbb754510..336ab32c102 100644 --- a/provider/src/supportedNetworks.ts +++ b/provider/src/supportedNetworks.ts @@ -15,7 +15,7 @@ const supportedNetworks = (env: Env, networkId: string): string | undefined => { '42220': env.CELO_PROVIDER, '43114': env.AVALANCHE_PROVIDER, '80001': env.MUMBAI_PROVIDER, - '84531': env.BASE_GOERLI_PROVIDER, + '84532': env.BASE_SEPOLIA_PROVIDER, '8453': env.BASE_PROVIDER, '11155111': env.SEPOLIA_PROVIDER, '59144': env.LINEA_PROVIDER, diff --git a/provider/src/types.ts b/provider/src/types.ts index 3635dd482d4..fe60d1e410e 100644 --- a/provider/src/types.ts +++ b/provider/src/types.ts @@ -11,7 +11,7 @@ export interface Env { OPTIMISM_PROVIDER: string POLYGON_PROVIDER: string ZKSYNC_PROVIDER: string - BASE_GOERLI_PROVIDER: string + BASE_SEPOLIA_PROVIDER: string BASE_PROVIDER: string SEPOLIA_PROVIDER: string LINEA_PROVIDER: string diff --git a/subgraph/introspection.json b/subgraph/introspection.json index 5456443f286..dfbf9ad0f86 100644 --- a/subgraph/introspection.json +++ b/subgraph/introspection.json @@ -1834,6 +1834,12 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "lock__numberOfCancelReceipts", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "tokenId", "description": null, @@ -4589,6 +4595,102 @@ }, "defaultValue": null }, + { + "name": "numberOfCancelReceipts", + "description": null, + "type": { + "kind": "SCALAR", + "name": "BigInt", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "numberOfCancelReceipts_not", + "description": null, + "type": { + "kind": "SCALAR", + "name": "BigInt", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "numberOfCancelReceipts_gt", + "description": null, + "type": { + "kind": "SCALAR", + "name": "BigInt", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "numberOfCancelReceipts_lt", + "description": null, + "type": { + "kind": "SCALAR", + "name": "BigInt", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "numberOfCancelReceipts_gte", + "description": null, + "type": { + "kind": "SCALAR", + "name": "BigInt", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "numberOfCancelReceipts_lte", + "description": null, + "type": { + "kind": "SCALAR", + "name": "BigInt", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "numberOfCancelReceipts_in", + "description": null, + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "BigInt", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "numberOfCancelReceipts_not_in", + "description": null, + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "BigInt", + "ofType": null + } + } + }, + "defaultValue": null + }, { "name": "referrerFees_", "description": null, @@ -4752,6 +4854,12 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "numberOfCancelReceipts", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "referrerFees", "description": null, @@ -6661,6 +6769,222 @@ }, "defaultValue": null }, + { + "name": "recipient", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "recipient_not", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "recipient_gt", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "recipient_lt", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "recipient_gte", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "recipient_lte", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "recipient_in", + "description": null, + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "recipient_not_in", + "description": null, + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "recipient_contains", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "recipient_contains_nocase", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "recipient_not_contains", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "recipient_not_contains_nocase", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "recipient_starts_with", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "recipient_starts_with_nocase", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "recipient_not_starts_with", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "recipient_not_starts_with_nocase", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "recipient_ends_with", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "recipient_ends_with_nocase", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "recipient_not_ends_with", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "recipient_not_ends_with_nocase", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, { "name": "lockAddress", "description": null, @@ -7456,6 +7780,12 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "recipient", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "lockAddress", "description": null, @@ -8268,6 +8598,12 @@ "description": null, "isDeprecated": false, "deprecationReason": null + }, + { + "name": "lock__numberOfCancelReceipts", + "description": null, + "isDeprecated": false, + "deprecationReason": null } ], "possibleTypes": null @@ -9366,6 +9702,16 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "SCALAR", + "name": "Timestamp", + "description": "A string representation of microseconds UNIX timestamp (16 digits)\n", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, { "kind": "OBJECT", "name": "UnlockDailyData", @@ -10972,7 +11318,11 @@ { "name": "skip", "description": null, - "locations": ["FIELD", "FRAGMENT_SPREAD", "INLINE_FRAGMENT"], + "locations": [ + "FIELD", + "FRAGMENT_SPREAD", + "INLINE_FRAGMENT" + ], "args": [ { "name": "if", @@ -10993,7 +11343,11 @@ { "name": "include", "description": null, - "locations": ["FIELD", "FRAGMENT_SPREAD", "INLINE_FRAGMENT"], + "locations": [ + "FIELD", + "FRAGMENT_SPREAD", + "INLINE_FRAGMENT" + ], "args": [ { "name": "if", @@ -11014,13 +11368,17 @@ { "name": "entity", "description": "Marks the GraphQL type as indexable entity. Each type that should be an entity is required to be annotated with this directive.", - "locations": ["OBJECT"], + "locations": [ + "OBJECT" + ], "args": [] }, { "name": "subgraphId", "description": "Defined a Subgraph ID for an object type", - "locations": ["OBJECT"], + "locations": [ + "OBJECT" + ], "args": [ { "name": "id", @@ -11041,7 +11399,9 @@ { "name": "derivedFrom", "description": "creates a virtual field on the entity that may be queried but cannot be set manually through the mappings API.", - "locations": ["FIELD_DEFINITION"], + "locations": [ + "FIELD_DEFINITION" + ], "args": [ { "name": "field",