From 97faf2699d0f9a1293c2656f73adb9195a3fb7fc Mon Sep 17 00:00:00 2001 From: LidamaoHub Date: Tue, 12 Dec 2023 20:26:38 +0800 Subject: [PATCH 1/2] deployed arbitrum version --- packages/client/src/mud/supportedChains.ts | 4 ++-- packages/contracts/foundry.toml | 2 +- packages/contracts/package.json | 2 ++ packages/contracts/script/GameConfigInit.sol | 7 +++---- packages/contracts/script/PostDeploy.s.sol | 6 +++--- packages/contracts/worlds.json | 12 ++++++------ 6 files changed, 17 insertions(+), 16 deletions(-) diff --git a/packages/client/src/mud/supportedChains.ts b/packages/client/src/mud/supportedChains.ts index 5aa85647..11e32cc8 100644 --- a/packages/client/src/mud/supportedChains.ts +++ b/packages/client/src/mud/supportedChains.ts @@ -13,8 +13,8 @@ import { MUDChain, latticeTestnet, mudFoundry } from "@latticexyz/common/chains"; import { sepolia, arbitrumGoerli } from 'viem/chains' -arbitrumGoerli.rpcUrls.default.http = ['https://arbitrum-goerli.infura.io/v3/5ca372516740427e97512d4dfefd9c47']; -arbitrumGoerli.rpcUrls.default.webSocket = [ 'wss://arbitrum-goerli.infura.io/ws/v3/5ca372516740427e97512d4dfefd9c47']; +arbitrumGoerli.rpcUrls.default.http = ['https://arbitrum-goerli.publicnode.com']; +arbitrumGoerli.rpcUrls.default.webSocket = [ 'wss://arbitrum-goerli.publicnode.com']; const testnet = { name: "Mississippi testnet", diff --git a/packages/contracts/foundry.toml b/packages/contracts/foundry.toml index 58497e60..fc126ce7 100644 --- a/packages/contracts/foundry.toml +++ b/packages/contracts/foundry.toml @@ -27,7 +27,7 @@ eth_rpc_url = "https://follower.testnet-chain.linfra.xyz" [profile.arb-testnet] -eth_rpc_url = "https://arbitrum-goerli.infura.io/v3/5ca372516740427e97512d4dfefd9c47" +eth_rpc_url = "https://arbitrum-goerli.publicnode.com" optimizer = true optimizer_runs = 3000 diff --git a/packages/contracts/package.json b/packages/contracts/package.json index e54202c1..75be0ad1 100644 --- a/packages/contracts/package.json +++ b/packages/contracts/package.json @@ -11,6 +11,8 @@ "deploy:local": "pnpm run build && mud deploy", "deploy:testnet": "pnpm run build && mud deploy --profile=lattice-testnet", "deploy:lidamao": "pnpm run build && mud deploy --profile=Mississippi-testnet", + "deploy:redstone": "pnpm run build && mud deploy --profile=REDSTONE-HOLESKY", + "deploy:arb": "pnpm run build && mud deploy --profile=arb-testnet", "dev": "pnpm mud dev-contracts --rpc http://127.0.0.1:8545", "lint": "pnpm run prettier && pnpm run solhint", diff --git a/packages/contracts/script/GameConfigInit.sol b/packages/contracts/script/GameConfigInit.sol index f7308443..7524de17 100644 --- a/packages/contracts/script/GameConfigInit.sol +++ b/packages/contracts/script/GameConfigInit.sol @@ -7,9 +7,8 @@ import { GameConfig, GameConfigData } from "../src/codegen/index.sol"; import { GAME_CONFIG_KEY } from "../src/Constants.sol"; library GameConfigInit { - function initGameConfig(IWorld _world) internal { + function initGameConfig() internal { console.log(" ========= initGameConfig"); - bytes32 merkleRoot = 0x5df91eca63323dbb115087ef262075c5bcea99b8eaf95f520efb8d48ff447499; // bytes32 merkleRoot = 0xa969691ad8c2e97e3d516e08f5b10ee4decd5f278a5f03ac4fa3532be181c854; GameConfig.setBattleId(GAME_CONFIG_KEY,1); // GameConfig.set( @@ -29,12 +28,12 @@ library GameConfigInit { } - function setInitPosition(IWorld _world) internal { + function setInitPosition() internal { GameConfig.setOriginX(GAME_CONFIG_KEY, 4); GameConfig.setOriginY(GAME_CONFIG_KEY, 4); } - function getPosition(IWorld _world) internal view returns (uint256, uint256) { + function getPosition() internal view returns (uint256, uint256) { uint256 x = GameConfig.getOriginX(GAME_CONFIG_KEY); uint256 y = GameConfig.getOriginY(GAME_CONFIG_KEY); return (x, y); diff --git a/packages/contracts/script/PostDeploy.s.sol b/packages/contracts/script/PostDeploy.s.sol index bb1fca9b..d96bb559 100644 --- a/packages/contracts/script/PostDeploy.s.sol +++ b/packages/contracts/script/PostDeploy.s.sol @@ -19,9 +19,9 @@ contract PostDeploy is Script { console.log(" ========== PostDeploy ========== "); - address muser = 0xBC9129Dc0487fc2E169941C75aABC539f208fb01; - address mloot = 0x6e989C01a3e3A94C973A62280a72EC335598490e; - address mplugin = 0xF6168876932289D073567f347121A267095f3DD6; + address muser = 0x2428109A9e775E4406fe079132F216dc77117333; + address mloot = 0x4A16f2658De79278Bce592258e7e38aB4c222787; + address mplugin = 0xcE34c3d4373A094d6e22ab15f0b0C36c771663cb; bytes32 merkleRoot = 0x5df91eca63323dbb115087ef262075c5bcea99b8eaf95f520efb8d48ff447499; IWorld(worldAddress).Init(muser, mloot, mplugin,merkleRoot); diff --git a/packages/contracts/worlds.json b/packages/contracts/worlds.json index 1acf4167..4d88f263 100644 --- a/packages/contracts/worlds.json +++ b/packages/contracts/worlds.json @@ -1,4 +1,8 @@ { + "17001": { + "address": "0x11f943bd1e3e37eb82216c01dc0a8d537cf4d31a", + "blockNumber": 1505273 + }, "31337": { "address": "0xd5d9aad645671a285d1cadf8e68aef7d74a8a7d0" }, @@ -7,15 +11,11 @@ "blockNumber": 273 }, "421613": { - "address": "0x2Bc1034975c3df48D6f3026802f372677844b85d", - "blockNumber": 46508363 + "address": "0x060f3f0915999fa84886f6e993cd95c4b2046b43", + "blockNumber": 58857166 }, "11155111": { "address": "0xec7F8CF3B3640b1C5E8fD3c208776aad056D4fc3", "blockNumber": 4450305 - }, - "17001": { - "address": "0x050499eBdbBBc1216011dE07A48b5182c983Ae74", - "blockNumber": 1069273 } } \ No newline at end of file From 81f97026a8edd68e97cc55bf38b4a6646cc1aca9 Mon Sep 17 00:00:00 2001 From: vivomo <929992114@qq.com> Date: Wed, 13 Dec 2023 00:45:24 +0800 Subject: [PATCH 2/2] feat: ffa html --- packages/client/src/assets/img/fight-icon.png | Bin 0 -> 1105 bytes packages/client/src/pages/ffa/index.tsx | 72 ++++++++++++++++-- packages/client/src/pages/ffa/styles.scss | 67 ++++++++++++++-- packages/client/src/pages/home/StaticInfo.tsx | 2 - 4 files changed, 126 insertions(+), 15 deletions(-) create mode 100644 packages/client/src/assets/img/fight-icon.png diff --git a/packages/client/src/assets/img/fight-icon.png b/packages/client/src/assets/img/fight-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..c83f71ee263eccf328c5329dbe483d05688ec080 GIT binary patch literal 1105 zcmV-X1g`suP)eXqHAd3s4x+rGRXINDzBzRx$gd!Akl<3Gpg>+8$$&n$0Syk*>$;>~hf zqlodAFv{98&Q?oHOV;&(-(}FjTwY#YSg}}SS65dopU<=7<72k6vcmW<$D8nb9NV_p z{{FtuzPY&(vCzK0zC?W2Tp76i{{EKUv^b6fbM{Y+nz5l#4Wqnj9$Ro-jbt*3iCBhO zNh~cbQMn49pP!+Rt>lr3V(jztlZ}s$myGg0iHbQiG*qg#A^;u?b&uf();kKNQi%-= z3=|Pi6$rrW>gp=Ky}eNxE!fuvF_yw+j0)}y0r|XERfHf+MOg_6Jn(r*RU~n6a6rci zve~RKLb<)YWo>P31yw|)ySuya@bEyV2`y;qKn37avumk|0%7j{{+??30^Z%-v9Yl+arZ%ED9C8H+?X_IR7|A(>FFue z_5$mIhnc##xR7NgtOiCVx4ypa3xHEdEEcN>9%gE1XD6t<)P+}0K0ZG1pUJMTuYG~T zOjRof^^!s6EiW&#?d@$};2={d2kCS=QaPxXJgrqhrjQV`v$HVubNFi#_Uh`YFL;nC z*?)3!A`5Vmiq!)$M`llKW@bhkJjhg`Q1JTZ=H_6|(&*MsPft(YtvA;2@NiMBRrszm zb$NLy>Kd-eb3Aa*aj5bZG~3(T^E6&m%=!6w5!f_MaaN+Jfx+J1o-hOxwBQ10Knt1+ z3k!IH9W-bZQiq3!LJ&fuqoWm1M+M~ob?yEAon8{qWzXeuzutGg|4S;YvbMG+YgC3N z2f&<>kr8h$KI{HVqUO{9SS~EL;lJ|~l0+^gy`e^!0>T&-#&7Hw9FGjmiIZdD8pi16 z)@#grTDrT&CN{#)QI_23at@A5cn`pN?ziSDmJq)?J3A}-41GOn)y>!S88w&_rkRrqq4Wh|8s)M0^!lhd z9=C+}X#8fg-pKy`{=68a5MZiN1RmXcdwa18Wu&pq%}w!c2PP*ck#VLssPULs9mK-1 zNS^hy#_)zL2jH92n$M literal 0 HcmV?d00001 diff --git a/packages/client/src/pages/ffa/index.tsx b/packages/client/src/pages/ffa/index.tsx index 7ab070f2..3a95e8ac 100644 --- a/packages/client/src/pages/ffa/index.tsx +++ b/packages/client/src/pages/ffa/index.tsx @@ -1,20 +1,82 @@ -import React from 'react'; +import React, { useState } from 'react'; import './styles.scss'; import Header from './header'; import UserInfo from './userInfo'; +import fightIcon from '@/assets/img/fight-icon.png'; const FFA = () => { + + const [tab, setTab] = useState('home'); + + return (
-

Home

-

Battle

+

{ + setTab('home') + }} + >Home

+

{ + setTab('battle') + }} + >Battle

- - + { + tab === 'home' && <> + + + + } + + { + tab === 'battle' &&
+
+

Leaderboard

+
+
    +
  • +
    1
    +
    Bob
    +
    0x34..35
    +
    V2
    +
    D6
    +
    + fight +
    +
  • +
+
+
12
+
Tom
+
0x34..35
+
V2
+
D6
+ +
+
+
+
+

My Battle Logs

+
    +
  • +
    I challenged XX Victory
    + +
  • +
  • +
    XX challenged me Lose
    + +
  • +
+
+
+ }
); diff --git a/packages/client/src/pages/ffa/styles.scss b/packages/client/src/pages/ffa/styles.scss index 74f8e7e1..cd4becc3 100644 --- a/packages/client/src/pages/ffa/styles.scss +++ b/packages/client/src/pages/ffa/styles.scss @@ -28,22 +28,73 @@ .switch-item { padding: 10px 12px; - //border: 4px solid; cursor: pointer; border-bottom: 4px solid #BC8C61; - &:not(:first-child) { - //border-left-width: 2px; + &.active { + + color: #FFF5E9; + background: #BC8C61; } + } + } - &:not(:last-child) { - //border-right-width: 2px; + .ffa-battle-wrapper { + display: flex; + justify-content: space-between; + h3 { + margin-bottom: 10px; + } + + .left-content { + width: 570px; + + .leaderboard-list { + flex: 1; + li { + margin-bottom: 6px; + } } - &.active { + .leaderboard-wrapper { + display: flex; + flex-direction: column; + padding: 60px 92px 50px; + height: 380px; + background: url("../../assets/img/user_bg.png") no-repeat center/100% 100%; + } - color: #FFF5E9; - background: #BC8C61; + .rank-row { + display: grid; + grid-template-columns: 1fr 4fr 6fr 2fr 2fr 1fr; + } + + .fight-icon { + img { + width: 19px; + height: 19px; + cursor: pointer; + } + } + + .my-rank-info { + padding-top: 6px; + border-top: 2px solid; + } + } + + .right-content { + width: 580px; + + .ffa-logs-wrapper { + font-size: 12px; + color: #fff; + + li { + display: flex; + justify-content: space-between; + margin-bottom: 6px; + } } } } diff --git a/packages/client/src/pages/home/StaticInfo.tsx b/packages/client/src/pages/home/StaticInfo.tsx index 3a084d83..5092d3ac 100644 --- a/packages/client/src/pages/home/StaticInfo.tsx +++ b/packages/client/src/pages/home/StaticInfo.tsx @@ -1,8 +1,6 @@ import React, { useState } from 'react'; -import { Swiper, SwiperSlide } from 'swiper/react'; import { Mousewheel } from 'swiper/modules'; import SwiperCore from 'swiper'; -import 'swiper/css'; import './staticInfo.scss'; import FAQ from '@/config/faq';