Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add base mainnet support #506

Merged
merged 2 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
173 changes: 173 additions & 0 deletions .openzeppelin/base.json
Original file line number Diff line number Diff line change
@@ -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": {}
}
}
}
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
6 changes: 6 additions & 0 deletions contracts/utils/TablelandDeployments.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down
18 changes: 18 additions & 0 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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 ?? ""
Expand Down
4 changes: 4 additions & 0 deletions network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -30,6 +31,7 @@ export const proxies: TablelandNetworkConfig = {
optimism: "0xfad44BF5B843dE943a09D4f3E84949A11d3aa3e6",
arbitrum: "0x9aBd75E8640871A5a20d3B4eE6330a04c962aFfd",
"arbitrum-nova": "0x1A22854c5b1642760a827f20137a67930AE108d2",
base: "0x8268F7Aba0E152B3A853e8CB4Ab9795Ec66c2b6B",
polygon: "0x5c4e6A9e5C1e1BF445A062006faF19EA6c49aFeA",
filecoin: "0x59EF8Bf2d6c102B4c42AEf9189e1a9F0ABfD652d",
// testnets
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading