Skip to content

Commit

Permalink
Merge pull request #503 from tablelandnetwork/dtb/add-base
Browse files Browse the repository at this point in the history
feat: add base chain support
  • Loading branch information
dtbuchholz authored Jun 3, 2024
2 parents 89687b1 + 6b9034c commit 2ed51dd
Show file tree
Hide file tree
Showing 5 changed files with 207 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ OPTIMISM_SEPOLIA_PRIVATE_KEY=0xfixme
OPTIMISM_SEPOLIA_API_KEY=fixme
ARBITRUM_SEPOLIA_PRIVATE_KEY=0xfixme
ARBITRUM_SEPOLIA_API_KEY=fixme
BASE_SEPOLIA_PRIVATE_KEY=0xfixme
BASE_SEPOLIA_API_KEY=fixme
POLYGON_AMOY_PRIVATE_KEY=0xfixme
POLYGON_AMOY_API_KEY=fixme
FILECOIN_CALIBRATION_PRIVATE_KEY=0xfixme
Expand All @@ -32,6 +34,7 @@ ETHERSCAN_API_KEY=fixme
OPTIMISM_ETHERSCAN_API_KEY=fixme
ARBISCAN_API_KEY=fixme
ARBISCAN_NOVA_API_KEY=fixme
BASESCAN_API_KEY=fixme
POLYSCAN_API_KEY=fixme
FILFOX_API_KEY=fixme
# hardhat
Expand Down
173 changes: 173 additions & 0 deletions .openzeppelin/base-sepolia.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
{
"manifestVersion": "3.2",
"proxies": [
{
"address": "0xA85aAE9f0Aec5F5638E5F13840797303Ab29c9f9",
"txHash": "0x6e6051db7a495fccdd9efaf31e02145cb52150eb1c58d28035b343a0ba5691f0",
"kind": "uups"
}
],
"impls": {
"f81fdad50c4628dce7f1a7ebf243ab81c2f61f18d2d7ff651bb95a932120d900": {
"address": "0xf3A896bF78Ce6A4EF15f9a5B326F657B4221af07",
"txHash": "0xb3dcfa0beb3e28cd7779282189990b7cce84c5ff6e3e1ea3651c698090eb19e8",
"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": {}
}
}
}
}
7 changes: 7 additions & 0 deletions contracts/utils/TablelandDeployments.sol
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ library TablelandDeployments {
// TablelandTables address on Arbitrum Sepolia.
address internal constant ARBITRUM_SEPOLIA =
0x223A74B8323914afDC3ff1e5005564dC17231d6e;
// TablelandTables address on Base Sepolia.
address internal constant BASE_SEPOLIA =
0xA85aAE9f0Aec5F5638E5F13840797303Ab29c9f9;
// TablelandTables address on Polygon Amoy.
address internal constant POLYGON_AMOY =
0x170fb206132b693e38adFc8727dCfa303546Cec1;
Expand Down Expand Up @@ -84,6 +87,8 @@ library TablelandDeployments {
return TablelandTablesImpl(OPTIMISM_SEPOLIA);
} else if (block.chainid == 421614) {
return TablelandTablesImpl(ARBITRUM_SEPOLIA);
} else if (block.chainid == 84532) {
return TablelandTablesImpl(BASE_SEPOLIA);
} else if (block.chainid == 80002) {
return TablelandTablesImpl(POLYGON_AMOY);
} else if (block.chainid == 314159) {
Expand Down Expand Up @@ -123,6 +128,8 @@ library TablelandDeployments {
return "https://testnets.tableland.network/api/v1/";
} else if (block.chainid == 421614) {
return "https://testnets.tableland.network/api/v1/";
} else if (block.chainid == 84532) {
return "https://testnets.tableland.network/api/v1/";
} else if (block.chainid == 80002) {
return "https://testnets.tableland.network/api/v1/";
} else if (block.chainid == 314159) {
Expand Down
20 changes: 20 additions & 0 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ const config: HardhatUserConfig = {
arbitrumNova: process.env.ARBISCAN_NOVA_API_KEY || "",
arbitrumSepolia: process.env.ARBISCAN_API_KEY || "",

// base
baseSepolia: process.env.BASESCAN_API_KEY || "",

// polygon
polygon: process.env.POLYSCAN_API_KEY || "",
polygonAmoy: process.env.POLYSCAN_API_KEY || "",
Expand Down Expand Up @@ -95,6 +98,14 @@ const config: HardhatUserConfig = {
browserURL: "https://sepolia.arbiscan.io/",
},
},
{
network: "baseSepolia",
chainId: 84532,
urls: {
apiURL: "https://api-sepolia.basescan.org/api",
browserURL: "https://sepolia.basescan.org/",
},
},
{
network: "polygonAmoy",
chainId: 80002,
Expand Down Expand Up @@ -182,6 +193,15 @@ const config: HardhatUserConfig = {
? [process.env.ARBITRUM_SEPOLIA_PRIVATE_KEY]
: [],
},
"base-sepolia": {
url: `https://base-sepolia.g.alchemy.com/v2/${
process.env.BASE_SEPOLIA_API_KEY ?? ""
}`,
accounts:
process.env.BASE_SEPOLIA_PRIVATE_KEY !== undefined
? [process.env.BASE_SEPOLIA_PRIVATE_KEY]
: [],
},
"polygon-amoy": {
url: `https://polygon-amoy.g.alchemy.com/v2/${
process.env.POLYGON_AMOY_API_KEY ?? ""
Expand Down
4 changes: 4 additions & 0 deletions network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export interface TablelandNetworkConfig {
sepolia: string | number;
"optimism-sepolia": string | number;
"arbitrum-sepolia": string | number;
"base-sepolia": string | number;
"polygon-amoy": string | number;
"filecoin-calibration": string | number;
// tableland testnet devnets (uncomment when needed for admin)
Expand All @@ -35,6 +36,7 @@ export const proxies: TablelandNetworkConfig = {
sepolia: "0xc50C62498448ACc8dBdE43DA77f8D5D2E2c7597D",
"optimism-sepolia": "0x68A2f4423ad3bf5139Db563CF3bC80aA09ed7079",
"arbitrum-sepolia": "0x223A74B8323914afDC3ff1e5005564dC17231d6e",
"base-sepolia": "0xA85aAE9f0Aec5F5638E5F13840797303Ab29c9f9",
"polygon-amoy": "0x170fb206132b693e38adFc8727dCfa303546Cec1",
"filecoin-calibration": "0x030BCf3D50cad04c2e57391B12740982A9308621",
// devnets (uncomment when needed for admin)
Expand Down Expand Up @@ -63,6 +65,7 @@ export const baseURIs: TablelandNetworkConfig = {
"https://testnets.tableland.network/api/v1/tables/11155420/",
"arbitrum-sepolia":
"https://testnets.tableland.network/api/v1/tables/421614/",
"base-sepolia": "https://testnets.tableland.network/api/v1/tables/84532/",
"polygon-amoy": "https://testnets.tableland.network/api/v1/tables/80002/",
"filecoin-calibration":
"https://testnets.tableland.network/api/v1/tables/314159/",
Expand Down Expand Up @@ -92,6 +95,7 @@ export const validatorPollingTimeouts: TablelandNetworkConfig = {
sepolia: 40_000,
"optimism-sepolia": 10_000,
"arbitrum-sepolia": 10_000,
"base-sepolia": 10_000,
"polygon-amoy": 15_000,
"filecoin-calibration": 210_000,
// devnets (uncomment when needed for admin)
Expand Down

0 comments on commit 2ed51dd

Please sign in to comment.