diff --git a/.env.example b/.env.example index b0737f3..1f4ad31 100644 --- a/.env.example +++ b/.env.example @@ -7,6 +7,8 @@ ARBITRUM_PRIVATE_KEY=0xfixme ARBITRUM_API_KEY=fixme ARBITRUM_NOVA_PRIVATE_KEY=0xfixme ARBITRUM_NOVA_API_KEY=fixme +BASE_PRIVATE_KEY=0xfixme +BASE_API_KEY=fixme POLYGON_PRIVATE_KEY=0xfixme POLYGON_API_KEY=fixme FILECOIN_PRIVATE_KEY=0xfixme diff --git a/.openzeppelin/base.json b/.openzeppelin/base.json new file mode 100644 index 0000000..b92dfb7 --- /dev/null +++ b/.openzeppelin/base.json @@ -0,0 +1,173 @@ +{ + "manifestVersion": "3.2", + "proxies": [ + { + "address": "0x8268F7Aba0E152B3A853e8CB4Ab9795Ec66c2b6B", + "txHash": "0xcf674908e31d44eba76dbac5b85b7e617a531c8c18f4fbf3ce0c6484d7a5cf9c", + "kind": "uups" + } + ], + "impls": { + "f81fdad50c4628dce7f1a7ebf243ab81c2f61f18d2d7ff651bb95a932120d900": { + "address": "0xBa336Eca67987820f68eC23dd84000685B7bD5B4", + "txHash": "0xc98d4aadf141cae6dabf11c5a448276a6338aa910a70d108773821ee411cdc50", + "layout": { + "solcVersion": "0.8.19", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:63", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:68" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:40" + }, + { + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:94" + }, + { + "label": "_paused", + "offset": 0, + "slot": "101", + "type": "t_bool", + "contract": "PausableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:29" + }, + { + "label": "__gap", + "offset": 0, + "slot": "102", + "type": "t_array(t_uint256)49_storage", + "contract": "PausableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:116" + }, + { + "label": "_status", + "offset": 0, + "slot": "151", + "type": "t_uint256", + "contract": "ReentrancyGuardUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol:38" + }, + { + "label": "__gap", + "offset": 0, + "slot": "152", + "type": "t_array(t_uint256)49_storage", + "contract": "ReentrancyGuardUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol:88" + }, + { + "label": "__gap", + "offset": 0, + "slot": "201", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC1967UpgradeUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol:169" + }, + { + "label": "__gap", + "offset": 0, + "slot": "251", + "type": "t_array(t_uint256)50_storage", + "contract": "UUPSUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol:111" + }, + { + "label": "_baseURIString", + "offset": 0, + "slot": "301", + "type": "t_string_storage", + "contract": "TablelandTables", + "src": "contracts/TablelandTables.sol:27" + }, + { + "label": "_controllers", + "offset": 0, + "slot": "302", + "type": "t_mapping(t_uint256,t_address)", + "contract": "TablelandTables", + "src": "contracts/TablelandTables.sol:29" + }, + { + "label": "_locks", + "offset": 0, + "slot": "303", + "type": "t_mapping(t_uint256,t_bool)", + "contract": "TablelandTables", + "src": "contracts/TablelandTables.sol:31" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "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_mapping(t_uint256,t_address)": { + "label": "mapping(uint256 => address)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_bool)": { + "label": "mapping(uint256 => bool)", + "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/README.md b/README.md index b8ac71d..f3ca36e 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ This is the Tableland Tables EVM contracts and client components. | optimism | 10 | 0xfad44BF5B843dE943a09D4f3E84949A11d3aa3e6 | | arbitrum | 42161 | 0x9aBd75E8640871A5a20d3B4eE6330a04c962aFfd | | arbitrum-nova | 42170 | 0x1A22854c5b1642760a827f20137a67930AE108d2 | +| base | 8453 | 0x8268F7Aba0E152B3A853e8CB4Ab9795Ec66c2b6B | | polygon | 137 | 0x5c4e6A9e5C1e1BF445A062006faF19EA6c49aFeA | | filecoin | 314 | 0x59EF8Bf2d6c102B4c42AEf9189e1a9F0ABfD652d | | sepolia | 11155111 | 0xc50C62498448ACc8dBdE43DA77f8D5D2E2c7597D | diff --git a/contracts/utils/TablelandDeployments.sol b/contracts/utils/TablelandDeployments.sol index 600f98c..d50c3ea 100644 --- a/contracts/utils/TablelandDeployments.sol +++ b/contracts/utils/TablelandDeployments.sol @@ -29,6 +29,8 @@ library TablelandDeployments { // TablelandTables address on Arbitrum Nova. address internal constant ARBITRUM_NOVA = 0x1A22854c5b1642760a827f20137a67930AE108d2; + // TablelandTables address on Base. + address internal constant BASE = 0x8268F7Aba0E152B3A853e8CB4Ab9795Ec66c2b6B; // TablelandTables address on Polygon. address internal constant POLYGON = 0x5c4e6A9e5C1e1BF445A062006faF19EA6c49aFeA; @@ -77,6 +79,8 @@ library TablelandDeployments { return TablelandTablesImpl(ARBITRUM); } else if (block.chainid == 42170) { return TablelandTablesImpl(ARBITRUM_NOVA); + } else if (block.chainid == 8453) { + return TablelandTablesImpl(BASE); } else if (block.chainid == 137) { return TablelandTablesImpl(POLYGON); } else if (block.chainid == 314) { @@ -118,6 +122,8 @@ library TablelandDeployments { return "https://tableland.network/api/v1/"; } else if (block.chainid == 42170) { return "https://tableland.network/api/v1/"; + } else if (block.chainid == 8453) { + return "https://tableland.network/api/v1/"; } else if (block.chainid == 137) { return "https://tableland.network/api/v1/"; } else if (block.chainid == 314) { diff --git a/hardhat.config.ts b/hardhat.config.ts index 17eccc9..9aefc3c 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -67,6 +67,7 @@ const config: HardhatUserConfig = { arbitrumSepolia: process.env.ARBISCAN_API_KEY || "", // base + base: process.env.BASESCAN_API_KEY || "", baseSepolia: process.env.BASESCAN_API_KEY || "", // polygon @@ -98,6 +99,14 @@ const config: HardhatUserConfig = { browserURL: "https://sepolia.arbiscan.io/", }, }, + { + network: "base", + chainId: 8453, + urls: { + apiURL: "https://api.basescan.org/api", + browserURL: "https://basescan.org/", + }, + }, { network: "baseSepolia", chainId: 84532, @@ -147,6 +156,15 @@ const config: HardhatUserConfig = { ? [process.env.ARBITRUM_NOVA_PRIVATE_KEY] : [], }, + base: { + url: `https://base-mainnet.g.alchemy.com/v2/${ + process.env.BASE_API_KEY ?? "" + }`, + accounts: + process.env.BASE_PRIVATE_KEY !== undefined + ? [process.env.BASE_PRIVATE_KEY] + : [], + }, polygon: { url: `https://polygon-mainnet.g.alchemy.com/v2/${ process.env.POLYGON_API_KEY ?? "" diff --git a/network.ts b/network.ts index 4d30b33..2bb2bd2 100644 --- a/network.ts +++ b/network.ts @@ -5,6 +5,7 @@ export interface TablelandNetworkConfig { optimism: string | number; arbitrum: string | number; "arbitrum-nova": string | number; + base: string | number; polygon: string | number; filecoin: string | number; // tableland testnet testnets @@ -30,6 +31,7 @@ export const proxies: TablelandNetworkConfig = { optimism: "0xfad44BF5B843dE943a09D4f3E84949A11d3aa3e6", arbitrum: "0x9aBd75E8640871A5a20d3B4eE6330a04c962aFfd", "arbitrum-nova": "0x1A22854c5b1642760a827f20137a67930AE108d2", + base: "0x8268F7Aba0E152B3A853e8CB4Ab9795Ec66c2b6B", polygon: "0x5c4e6A9e5C1e1BF445A062006faF19EA6c49aFeA", filecoin: "0x59EF8Bf2d6c102B4c42AEf9189e1a9F0ABfD652d", // testnets @@ -57,6 +59,7 @@ export const baseURIs: TablelandNetworkConfig = { optimism: "https://tableland.network/api/v1/tables/10/", arbitrum: "https://tableland.network/api/v1/tables/42161/", "arbitrum-nova": "https://tableland.network/api/v1/tables/42170/", + base: "https://tableland.network/api/v1/tables/8453/", polygon: "https://tableland.network/api/v1/tables/137/", filecoin: "https://tableland.network/api/v1/tables/314/", // testnets @@ -89,6 +92,7 @@ export const validatorPollingTimeouts: TablelandNetworkConfig = { optimism: 10_000, arbitrum: 10_000, "arbitrum-nova": 10_000, + base: 10_000, polygon: 15_000, filecoin: 210_000, // testnets