-
Notifications
You must be signed in to change notification settings - Fork 485
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2090 from blockscout/mud
MUD
- Loading branch information
Showing
87 changed files
with
2,142 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ on: | |
- arbitrum | ||
- base | ||
- celo_alfajores | ||
- garnet | ||
- gnosis | ||
- eth | ||
- eth_sepolia | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -362,6 +362,7 @@ | |
"arbitrum", | ||
"base", | ||
"celo_alfajores", | ||
"garnet", | ||
"gnosis", | ||
"eth", | ||
"eth_goerli", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import type { Feature } from './types'; | ||
|
||
import { getEnvValue } from '../utils'; | ||
import rollup from './rollup'; | ||
|
||
const title = 'MUD framework'; | ||
|
||
const config: Feature<{ isEnabled: true }> = (() => { | ||
if (rollup.isEnabled && rollup.type === 'optimistic' && getEnvValue('NEXT_PUBLIC_HAS_MUD_FRAMEWORK') === 'true') { | ||
return Object.freeze({ | ||
title, | ||
isEnabled: true, | ||
}); | ||
} | ||
|
||
return Object.freeze({ | ||
title, | ||
isEnabled: false, | ||
}); | ||
})(); | ||
|
||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Set of ENVs for Garnet (dev only) | ||
# https://https://explorer.garnetchain.com// | ||
|
||
# app configuration | ||
NEXT_PUBLIC_APP_PROTOCOL=http | ||
NEXT_PUBLIC_APP_HOST=localhost | ||
NEXT_PUBLIC_APP_PORT=3000 | ||
|
||
# blockchain parameters | ||
NEXT_PUBLIC_NETWORK_NAME="Garnet Testnet" | ||
NEXT_PUBLIC_NETWORK_ID=17069 | ||
NEXT_PUBLIC_NETWORK_CURRENCY_NAME=Ether | ||
NEXT_PUBLIC_NETWORK_CURRENCY_SYMBOL=ETH | ||
NEXT_PUBLIC_NETWORK_CURRENCY_DECIMALS=18 | ||
NEXT_PUBLIC_NETWORK_RPC_URL=https://partner-rpc.garnetchain.com/tireless-strand-dreamt-overcome | ||
|
||
# api configuration | ||
NEXT_PUBLIC_API_HOST=explorer.garnetchain.com | ||
NEXT_PUBLIC_API_BASE_PATH=/ | ||
|
||
# ui config | ||
## homepage | ||
NEXT_PUBLIC_HOMEPAGE_CHARTS=['daily_txs'] | ||
## views | ||
NEXT_PUBLIC_CONTRACT_CODE_IDES=[{'title':'Remix IDE','url':'https://remix.ethereum.org/?address={hash}&blockscout={domain}','icon_url':'https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/ide-icons/remix.png'}] | ||
# app features | ||
NEXT_PUBLIC_APP_INSTANCE=local | ||
NEXT_PUBLIC_APP_ENV=development | ||
NEXT_PUBLIC_GRAPHIQL_TRANSACTION=0xf7d4972356e6ae44ae948d0cf19ef2beaf0e574c180997e969a2837da15e349d | ||
NEXT_PUBLIC_IS_ACCOUNT_SUPPORTED=true | ||
NEXT_PUBLIC_AUTH_URL=http://localhost:3000/login | ||
NEXT_PUBLIC_API_WEBSOCKET_PROTOCOL=ws | ||
NEXT_PUBLIC_LOGOUT_URL=https://blockscoutcom.us.auth0.com/v2/logout | ||
NEXT_PUBLIC_VISUALIZE_API_HOST=https://visualizer.services.blockscout.com | ||
NEXT_PUBLIC_TRANSACTION_INTERPRETATION_PROVIDER=blockscout | ||
NEXT_PUBLIC_FEATURED_NETWORKS=https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/featured-networks/redstone-testnet.json | ||
NEXT_PUBLIC_FOOTER_LINKS=https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/footer-links/redstone.json | ||
NEXT_PUBLIC_AD_BANNER_PROVIDER=none | ||
## sidebar | ||
NEXT_PUBLIC_NETWORK_ICON=https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/network-icons/garnet.svg | ||
NEXT_PUBLIC_NETWORK_LOGO=https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/network-logos/garnet.svg | ||
NEXT_PUBLIC_NETWORK_ICON_DARK=https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/network-icons/garnet-dark.svg | ||
NEXT_PUBLIC_NETWORK_LOGO_DARK=https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/network-logos/garnet-dark.svg | ||
NEXT_PUBLIC_HOMEPAGE_PLATE_BACKGROUND=rgb(169, 31, 47) | ||
NEXT_PUBLIC_OG_DESCRIPTION="Redstone is the home for onchain games, worlds, and other MUD applications" | ||
# rollup | ||
NEXT_PUBLIC_ROLLUP_TYPE=optimistic | ||
NEXT_PUBLIC_ROLLUP_L1_BASE_URL=https://eth-holesky.blockscout.com/ | ||
NEXT_PUBLIC_ROLLUP_L2_WITHDRAWAL_URL=https://garnet.qry.live/withdraw | ||
NEXT_PUBLIC_HAS_MUD_FRAMEWORK=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export default function capitalizeFirstLetter(text: string) { | ||
if (!text || !text.length) { | ||
return ''; | ||
} | ||
|
||
return text.charAt(0).toUpperCase() + text.slice(1); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
/* eslint-disable max-len */ | ||
import type { AddressMudRecord, AddressMudRecords, AddressMudRecordsItem, AddressMudTables } from 'types/api/address'; | ||
import type { MudWorldSchema, MudWorldTable } from 'types/api/mudWorlds'; | ||
|
||
export const table1: MudWorldTable = { | ||
table_full_name: 'tb.store.Tables', | ||
table_id: '0x746273746f72650000000000000000005461626c657300000000000000000000', | ||
table_name: 'Tables', | ||
table_namespace: 'store', | ||
table_type: 'onchain', | ||
}; | ||
|
||
export const table2: MudWorldTable = { | ||
table_full_name: 'ot.world.FunctionSignatur', | ||
table_id: '0x6f74776f726c6400000000000000000046756e6374696f6e5369676e61747572', | ||
table_name: 'FunctionSignatur', | ||
table_namespace: 'world', | ||
table_type: 'offchain', | ||
}; | ||
|
||
export const schema1: MudWorldSchema = { | ||
key_names: [ 'moduleAddress', 'argumentsHash' ], | ||
key_types: [ 'address', 'bytes32' ], | ||
value_names: [ 'fieldLayout', 'keySchema', 'valueSchema', 'abiEncodedKeyNames', 'abiEncodedFieldNames' ], | ||
value_types: [ 'bytes32', 'bytes32', 'bytes32', 'bytes', 'bytes' ], | ||
}; | ||
|
||
export const schema2: MudWorldSchema = { | ||
key_names: [], | ||
key_types: [], | ||
value_names: [ 'value' ], | ||
value_types: [ 'address' ], | ||
}; | ||
|
||
export const mudTables: AddressMudTables = { | ||
items: [ | ||
{ | ||
table: table1, | ||
schema: schema1, | ||
}, | ||
{ | ||
table: table2, | ||
schema: schema2, | ||
}, | ||
], | ||
next_page_params: { | ||
items_count: 50, | ||
table_id: '1', | ||
}, | ||
}; | ||
|
||
const record: AddressMudRecordsItem = { | ||
decoded: { | ||
abiEncodedFieldNames: '0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000006706c617965720000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000576616c7565000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000974696d657374616d700000000000000000000000000000000000000000000000', | ||
abiEncodedKeyNames: '0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000026964000000000000000000000000000000000000000000000000000000000000', | ||
goldCosts: [ '100000', '150000', '200000', '250000', '400000', '550000', '700000' ], | ||
prototypeIds: [ | ||
'0x53776f7264736d616e0000000000000000000000000000000000000000000000', | ||
'0x50696b656d616e00000000000000000000000000000000000000000000000000', | ||
'0x50696b656d616e00000000000000000000000000000000000000000000000000', | ||
'0x4172636865720000000000000000000000000000000000000000000000000000', | ||
'0x4b6e696768740000000000000000000000000000000000000000000000000000', | ||
], | ||
keySchema: '0x002001001f000000000000000000000000000000000000000000000000000000', | ||
tableId: '0x6f74000000000000000000000000000044726177557064617465000000000000', | ||
valueSchema: '0x00540300611f1f00000000000000000000000000000000000000000000000000', | ||
}, | ||
id: '0x007a651a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007', | ||
is_deleted: false, | ||
timestamp: '2024-05-09T15:14:32.000000Z', | ||
}; | ||
|
||
export const mudRecords: AddressMudRecords = { | ||
items: [ record, record ], | ||
next_page_params: { | ||
items_count: 50, | ||
key0: '1', | ||
key1: '2', | ||
key_bytes: '3', | ||
}, | ||
schema: { | ||
key_names: [ 'tableId' ], | ||
key_types: [ 'bytes32' ], | ||
value_names: [ 'prototypeIds', 'goldCosts', 'keySchema', 'valueSchema', 'abiEncodedKeyNames', 'abiEncodedFieldNames' ], | ||
value_types: [ 'bytes32[]', 'int32[]', 'bytes32', 'bytes32', 'bytes32', 'bytes', 'bytes' ], | ||
}, | ||
table: table1, | ||
}; | ||
|
||
export const mudRecord: AddressMudRecord = { | ||
record, | ||
schema: mudRecords.schema, | ||
table: table1, | ||
}; |
Oops, something went wrong.