diff --git a/.github/workflows/example-checks.yml b/.github/workflows/example-checks.yml index a62acb55..6808bf00 100644 --- a/.github/workflows/example-checks.yml +++ b/.github/workflows/example-checks.yml @@ -150,6 +150,20 @@ jobs: pnpm configure working-directory: smart-storage-unit/packages/contracts + # Reset Docker to avoid function name collisions between smart-gate and smart-turret + - name: Reset Docker World before Smart Turret + run: | + docker-compose down + docker-compose up -d + + - name: Wait for World Deployer to Finish (Smart Turret) + run: | + echo "Waiting for world-deployer to complete..." + docker compose logs -f world-deployer & + DEPLOYER_PID=$! + docker wait world-deployer + echo "world-deployer has finished" + - name: Set RPC run: | cp ./smart-turret/packages/contracts/.envsample ./smart-turret/packages/contracts/.env diff --git a/smart-assembly-scaffold/packages/client/src/hooks/useSmartAssembly.ts b/smart-assembly-scaffold/packages/client/src/hooks/useSmartAssembly.ts index e4cb09ae..632ea696 100644 --- a/smart-assembly-scaffold/packages/client/src/hooks/useSmartAssembly.ts +++ b/smart-assembly-scaffold/packages/client/src/hooks/useSmartAssembly.ts @@ -114,7 +114,7 @@ export function useSmartAssembly(smartObjectId = 0n) { const worldAddress = await getWorldDeploy(chainID); // sql query from the indexer. - const response = await fetch("https://indexer.mud.pyropechain.com/q", { + const response = await fetch("https://graphql-stillness-internal.live.evefrontier.tech/v1/graphql", { method: "POST", headers: { "Content-Type": "application/json", diff --git a/smart-assembly-scaffold/packages/client/src/hooks/useSmartCharacter.ts b/smart-assembly-scaffold/packages/client/src/hooks/useSmartCharacter.ts index d8f70ac7..ec388e5f 100644 --- a/smart-assembly-scaffold/packages/client/src/hooks/useSmartCharacter.ts +++ b/smart-assembly-scaffold/packages/client/src/hooks/useSmartCharacter.ts @@ -108,7 +108,7 @@ export function useSmartCharacter() { const worldAddress = await getWorldDeploy(chainID); - const response = await fetch("https://indexer.mud.pyropechain.com/q", { + const response = await fetch("https://graphql-stillness-internal.live.evefrontier.tech/v1/graphql", { method: "POST", headers: { "Content-Type": "application/json", diff --git a/smart-assembly-scaffold/packages/client/src/mud/wagmiConfig.ts b/smart-assembly-scaffold/packages/client/src/mud/wagmiConfig.ts index 1d1b9d3b..854efebb 100644 --- a/smart-assembly-scaffold/packages/client/src/mud/wagmiConfig.ts +++ b/smart-assembly-scaffold/packages/client/src/mud/wagmiConfig.ts @@ -1,7 +1,7 @@ import { http, webSocket } from "viem"; -import { anvil } from "viem/chains"; +import { anvil, optimismSepolia } from "viem/chains"; import { getDefaultConfig, Wallet } from "@rainbow-me/rainbowkit"; -import { garnet, redstone, pyrope } from "@latticexyz/common/chains"; +import { garnet, redstone } from "@latticexyz/common/chains"; import { coinbaseWallet, injectedWallet, @@ -14,7 +14,7 @@ import { const transports = { [anvil.id]: webSocket(), - [pyrope.id]: http(), + [optimismSepolia.id]: http(), [garnet.id]: http(), [redstone.id]: http(), } as const; @@ -125,16 +125,15 @@ export const wagmiConfig = getDefaultConfig({ "https://pbs.twimg.com/profile_images/1724553277147131904/cdma6E3g_400x400.jpg", }, { - ...pyrope, + ...optimismSepolia, blockExplorers: { - ...pyrope.blockExplorers, - worldsExplorer: { - name: "MUD Worlds Explorer", - url: "https://explorer.mud.dev/pyrope/worlds", + default: { + name: "OP Sepolia Explorer", + url: "https://sepolia-optimism.etherscan.io", }, }, iconUrl: - "https://explorer.pyropechain.com/assets/configs/network_icon.svg", + "https://optimism.io/images/ecosystem/op-logo.png", }, { ...garnet, @@ -162,7 +161,7 @@ export const wagmiConfig = getDefaultConfig({ transports, pollingInterval: { [anvil.id]: 2000, - [pyrope.id]: 2000, + [optimismSepolia.id]: 2000, [garnet.id]: 2000, [redstone.id]: 2000, }, diff --git a/smart-assembly-scaffold/packages/contracts/foundry.toml b/smart-assembly-scaffold/packages/contracts/foundry.toml index 6840b402..73c310dd 100644 --- a/smart-assembly-scaffold/packages/contracts/foundry.toml +++ b/smart-assembly-scaffold/packages/contracts/foundry.toml @@ -28,9 +28,9 @@ script_execution_protection=false # Local Anvil Instance eth_rpc_url = "http://127.0.0.1:8546" -[profile.pyrope] -# Public Testnet -eth_rpc_url = "https://pyrope-external-sync-node-rpc.live.tech.evefrontier.com" +[profile.sepolia] +# OP Sepolia Testnet +eth_rpc_url = "https://op-sepolia-ext-sync-node-rpc.live.tech.evefrontier.com" [profile.garnet] # Public Garnet Testnet diff --git a/smart-assembly-scaffold/packages/contracts/package.json b/smart-assembly-scaffold/packages/contracts/package.json index 15cd7e7d..bb0757bf 100644 --- a/smart-assembly-scaffold/packages/contracts/package.json +++ b/smart-assembly-scaffold/packages/contracts/package.json @@ -7,7 +7,7 @@ "build": "mud build", "clean": "forge clean", "deploy:local": ". ./.env && pnpm run build && mud deploy --profile=local --worldAddress ${WORLD_ADDRESS:-$1}", - "deploy:pyrope": ". ./.env && pnpm run build && mud deploy --profile=pyrope --worldAddress ${WORLD_ADDRESS:-$1}", + "deploy:sepolia": ". ./.env && pnpm run build && mud deploy --profile=sepolia --worldAddress ${WORLD_ADDRESS:-$1}", "deploy:garnet": ". ./.env && pnpm run build && mud deploy --profile=garnet --worldAddress ${WORLD_ADDRESS:-$1}", "deploy:redstone": ". ./.env && pnpm run build && mud deploy --profile=redstone --worldAddress ${WORLD_ADDRESS:-$1}", "dev": "pnpm mud dev-contracts", diff --git a/smart-assembly-scaffold/readme.md b/smart-assembly-scaffold/readme.md index 7fc66a78..0893d3f7 100644 --- a/smart-assembly-scaffold/readme.md +++ b/smart-assembly-scaffold/readme.md @@ -115,9 +115,9 @@ cp .envsample .env Next, set the following values in the [.env](./packages/contracts/.env) file to direct the scripts to use Stillness: ```bash copy -WORLD_ADDRESS=0x9891ee4bf5f2a9e74e9d81b06b855eec70b78d4f -RPC_URL=https://pyrope-external-sync-node-rpc.live.tech.evefrontier.com -CHAIN_ID=695569 +WORLD_ADDRESS=0x1dacc0b64b7da0cc6e2b2fe1bd72f58ebd37363c +RPC_URL=https://op-sepolia-ext-sync-node-rpc.live.tech.evefrontier.com +CHAIN_ID=11155420 ``` You can also automatically point to Stillness with current values using: @@ -198,12 +198,12 @@ pnpm set-namespace Deploy to Stillness with: ```bash -pnpm deploy:pyrope +pnpm deploy:sepolia ``` **Environment Variables**: -- Ensure that your `.env` files in `packages/contracts` and `packages/client` point to the correct deployed instances. For Pyrope, the `WORLD_ADDRESS` and related RPC endpoints must match the environment you are deploying to. +- Ensure that your `.env` files in `packages/contracts` and `packages/client` point to the correct deployed instances. For OP Sepolia, the `WORLD_ADDRESS` and related RPC endpoints must match the environment you are deploying to. ### Step 2: 🌐 dApp Environment Variables and Considerations @@ -288,7 +288,7 @@ To run the dApp, navigate to the client directory and run: pnpm dev ``` -You can view the dApp at `localhost:3000`. Make sure your wallet is connected to the Pyrope chain to fully interact with the deployed contracts. +You can view the dApp at `localhost:3000`. Make sure your wallet is connected to the OP Sepolia chain to fully interact with the deployed contracts. --- diff --git a/smart-gate/packages/contracts/foundry.toml b/smart-gate/packages/contracts/foundry.toml index 1bbbdc2d..ee904deb 100644 --- a/smart-gate/packages/contracts/foundry.toml +++ b/smart-gate/packages/contracts/foundry.toml @@ -28,9 +28,9 @@ script_execution_protection=false # Local Anvil Instance eth_rpc_url = "http://127.0.0.1:8546" -[profile.pyrope] -# Public Testnet -eth_rpc_url = "https://pyrope-external-sync-node-rpc.live.tech.evefrontier.com" +[profile.sepolia] +# OP Sepolia Testnet +eth_rpc_url = "https://op-sepolia-ext-sync-node-rpc.live.tech.evefrontier.com" [profile.garnet] # Public Garnet Testnet diff --git a/smart-gate/packages/contracts/package.json b/smart-gate/packages/contracts/package.json index 609878cd..cdb534e7 100644 --- a/smart-gate/packages/contracts/package.json +++ b/smart-gate/packages/contracts/package.json @@ -7,7 +7,7 @@ "build": "mud build", "clean": "forge clean && rm -rf src/**/codegen", "deploy:local": ". ./.env && pnpm run build && mud deploy --profile=local --worldAddress ${WORLD_ADDRESS:-$1}", - "deploy:pyrope": ". ./.env && pnpm run build && mud deploy --profile=pyrope --worldAddress ${WORLD_ADDRESS:-$1}", + "deploy:sepolia": ". ./.env && pnpm run build && mud deploy --profile=sepolia --worldAddress ${WORLD_ADDRESS:-$1}", "deploy:garnet": ". ./.env && pnpm run build && mud deploy --profile=garnet --worldAddress ${WORLD_ADDRESS:-$1}", "deploy:redstone": ". ./.env && pnpm run build && mud deploy --profile=redstone --worldAddress ${WORLD_ADDRESS:-$1}", "dev": "mud dev-contracts", diff --git a/smart-gate/pnpm-lock.yaml b/smart-gate/pnpm-lock.yaml index 500825f6..ed472f52 100644 --- a/smart-gate/pnpm-lock.yaml +++ b/smart-gate/pnpm-lock.yaml @@ -8,6 +8,8 @@ overrides: better-sqlite3: ^9.4.3 '@eveworld/smart-object-framework-v2': 0.1.2 react: ^19.0.0 + eslint-config-prettier: 10.1.8 + eslint-plugin-prettier: 4.2.5 importers: diff --git a/smart-gate/readme.md b/smart-gate/readme.md index cab52402..717c8b01 100644 --- a/smart-gate/readme.md +++ b/smart-gate/readme.md @@ -135,9 +135,9 @@ cp .envsample .env Next, set the following values in the [.env](./packages/contracts/.env) file to direct the scripts to use Stillness: ```bash copy -WORLD_ADDRESS=0xcdb380e0cd3949caf70c45c67079f2e27a77fc47 -RPC_URL=https://pyrope-external-sync-node-rpc.live.tech.evefrontier.com -CHAIN_ID=695569 +WORLD_ADDRESS=0x1dacc0b64b7da0cc6e2b2fe1bd72f58ebd37363c +RPC_URL=https://op-sepolia-ext-sync-node-rpc.live.tech.evefrontier.com +CHAIN_ID=11155420 ``` You can also automatically point to Stillness with current values using: @@ -212,7 +212,7 @@ pnpm set-key Then deploy the SSU contracts using: ```bash -pnpm run deploy:pyrope +pnpm run deploy:sepolia ``` Once the deployment is successful, you'll see a screen similar to the one below. diff --git a/smart-storage-unit/packages/contracts/foundry.toml b/smart-storage-unit/packages/contracts/foundry.toml index ebf103c5..6d3882b1 100644 --- a/smart-storage-unit/packages/contracts/foundry.toml +++ b/smart-storage-unit/packages/contracts/foundry.toml @@ -29,9 +29,9 @@ script_execution_protection=false # Local Anvil Instance eth_rpc_url = "http://127.0.0.1:8546" -[profile.pyrope] -# Public Testnet -eth_rpc_url = "https://pyrope-external-sync-node-rpc.live.tech.evefrontier.com" +[profile.sepolia] +# OP Sepolia Testnet +eth_rpc_url = "https://op-sepolia-ext-sync-node-rpc.live.tech.evefrontier.com" [profile.garnet] # Public Garnet Testnet diff --git a/smart-storage-unit/packages/contracts/package.json b/smart-storage-unit/packages/contracts/package.json index 57a01238..3c6ae289 100644 --- a/smart-storage-unit/packages/contracts/package.json +++ b/smart-storage-unit/packages/contracts/package.json @@ -7,7 +7,7 @@ "build": "mud build", "clean": "forge clean && rm -rf src/**/codegen", "deploy:local": ". ./.env && pnpm run build && mud deploy --profile=local --worldAddress ${WORLD_ADDRESS:-$1}", - "deploy:pyrope": ". ./.env && pnpm run build && mud deploy --profile=pyrope --worldAddress ${WORLD_ADDRESS:-$1}", + "deploy:sepolia": ". ./.env && pnpm run build && mud deploy --profile=sepolia --worldAddress ${WORLD_ADDRESS:-$1}", "deploy:garnet": ". ./.env && pnpm run build && mud deploy --profile=garnet --worldAddress ${WORLD_ADDRESS:-$1}", "deploy:redstone": ". ./.env && pnpm run build && mud deploy --profile=redstone --worldAddress ${WORLD_ADDRESS:-$1}", "dev": "pnpm mud dev-contracts", diff --git a/smart-storage-unit/pnpm-lock.yaml b/smart-storage-unit/pnpm-lock.yaml index e426b2c5..12c6a998 100644 --- a/smart-storage-unit/pnpm-lock.yaml +++ b/smart-storage-unit/pnpm-lock.yaml @@ -7,6 +7,8 @@ settings: overrides: better-sqlite3: ^9.4.3 '@eveworld/smart-object-framework-v2': 0.1.2 + eslint-config-prettier: 10.1.8 + eslint-plugin-prettier: 4.2.5 importers: diff --git a/smart-storage-unit/readme.md b/smart-storage-unit/readme.md index 43c893c0..0a4215c3 100644 --- a/smart-storage-unit/readme.md +++ b/smart-storage-unit/readme.md @@ -139,9 +139,9 @@ cp .envsample .env Next, set the following values in the [.env](./packages/contracts/.env) file to direct the scripts to use Stillness: ```bash copy -WORLD_ADDRESS=0xcdb380e0cd3949caf70c45c67079f2e27a77fc47 -RPC_URL=https://pyrope-external-sync-node-rpc.live.tech.evefrontier.com -CHAIN_ID=695569 +WORLD_ADDRESS=0x1dacc0b64b7da0cc6e2b2fe1bd72f58ebd37363c +RPC_URL=https://op-sepolia-ext-sync-node-rpc.live.tech.evefrontier.com +CHAIN_ID=11155420 ``` You can also automatically point to Stillness with current values using: @@ -216,7 +216,7 @@ pnpm set-key Then deploy the SSU contracts using: ```bash -pnpm run deploy:pyrope +pnpm run deploy:sepolia ``` Once the deployment is successful, you'll see a screen similar to the one below. diff --git a/smart-turret/packages/contracts/foundry.toml b/smart-turret/packages/contracts/foundry.toml index 1bbbdc2d..ee904deb 100644 --- a/smart-turret/packages/contracts/foundry.toml +++ b/smart-turret/packages/contracts/foundry.toml @@ -28,9 +28,9 @@ script_execution_protection=false # Local Anvil Instance eth_rpc_url = "http://127.0.0.1:8546" -[profile.pyrope] -# Public Testnet -eth_rpc_url = "https://pyrope-external-sync-node-rpc.live.tech.evefrontier.com" +[profile.sepolia] +# OP Sepolia Testnet +eth_rpc_url = "https://op-sepolia-ext-sync-node-rpc.live.tech.evefrontier.com" [profile.garnet] # Public Garnet Testnet diff --git a/smart-turret/packages/contracts/package.json b/smart-turret/packages/contracts/package.json index b86d10c8..3e1b3714 100644 --- a/smart-turret/packages/contracts/package.json +++ b/smart-turret/packages/contracts/package.json @@ -7,7 +7,7 @@ "build": "mud build", "clean": "forge clean && rm -rf src/**/codegen", "deploy:local": ". ./.env && pnpm run build && mud deploy --profile=local --worldAddress ${WORLD_ADDRESS:-$1}", - "deploy:pyrope": ". ./.env && pnpm run build && mud deploy --profile=pyrope --worldAddress ${WORLD_ADDRESS:-$1}", + "deploy:sepolia": ". ./.env && pnpm run build && mud deploy --profile=sepolia --worldAddress ${WORLD_ADDRESS:-$1}", "deploy:garnet": ". ./.env && pnpm run build && mud deploy --profile=garnet --worldAddress ${WORLD_ADDRESS:-$1}", "deploy:redstone": ". ./.env && pnpm run build && mud deploy --profile=redstone --worldAddress ${WORLD_ADDRESS:-$1}", "dev": "mud dev-contracts", diff --git a/smart-turret/packages/contracts/test/SmartTurretTest.t.sol b/smart-turret/packages/contracts/test/SmartTurretTest.t.sol index 9e3d2232..aa88fd02 100644 --- a/smart-turret/packages/contracts/test/SmartTurretTest.t.sol +++ b/smart-turret/packages/contracts/test/SmartTurretTest.t.sol @@ -101,22 +101,16 @@ contract SmartTurretTest is MudTest { player2 = address(0x23618e81E3f5cdF7f54C3d65f7FBc0aBf5B21E8f); player3 = address(0xa0Ee7A142d267C1f36714E4a8F75612F20a79720); - vm.startPrank(admin); - world.call( - systemId, - abi.encodeCall( - CustomSmartTurretSystem.setAllowedTribe, - (smartTurretId, ALLOWED_TRIBE_ID) - ) - ); - vm.stopPrank(); - vm.startPrank(player, admin); + // Calculate smartTurretId BEFORE using it + smartTurretId = ObjectIdLib.calculateObjectId(tenantId, SOURCE_GATE_ID); adminCharacterSmartId = ObjectIdLib.calculateObjectId(tenantId, ADMIN_CHARACTER_ID); playerCharacterSmartId = ObjectIdLib.calculateObjectId(tenantId, PLAYER_CHARACTER_ID); player2CharacterSmartId = ObjectIdLib.calculateObjectId(tenantId, PLAYER2_CHARACTER_ID); player3CharacterSmartId = ObjectIdLib.calculateObjectId(tenantId, PLAYER3_CHARACTER_ID); + vm.startPrank(player, admin); + safeCreateCharacter(admin, adminCharacterSmartId, ADMIN_CHARACTER_ID, ALLOWED_TRIBE_ID, "adminCharacter"); safeCreateCharacter(player, playerCharacterSmartId, PLAYER_CHARACTER_ID, ALLOWED_TRIBE_ID, "playerCharacter"); safeCreateCharacter(player2, player2CharacterSmartId, PLAYER2_CHARACTER_ID, 123, "player2Character"); @@ -129,8 +123,6 @@ contract SmartTurretTest is MudTest { world.registerDelegation(admin, UNLIMITED_DELEGATION, new bytes(0)); vm.stopPrank(); - smartTurretId = ObjectIdLib.calculateObjectId(tenantId, SOURCE_GATE_ID); - vm.startPrank(player, admin); if(DeployableState.getCurrentState(smartTurretId) != State.NULL){ @@ -139,6 +131,15 @@ contract SmartTurretTest is MudTest { createAnchorAndOnline(smartTurretId, SOURCE_GATE_ID, player); } + // Set allowed tribe AFTER the turret is created (must be called by turret owner = player) + world.call( + systemId, + abi.encodeCall( + CustomSmartTurretSystem.setAllowedTribe, + (smartTurretId, ALLOWED_TRIBE_ID) + ) + ); + vm.stopPrank(); } @@ -154,7 +155,7 @@ contract SmartTurretTest is MudTest { //Test setAllowedTribe function testSetAllowedTribe() public { - vm.startPrank(admin); + vm.startPrank(player); // player is the turret owner world.call( systemId, @@ -191,7 +192,7 @@ contract SmartTurretTest is MudTest { //Test setAllowedTribe function testSetAllowedTribeRevertIfInvalidID() public { - vm.startPrank(admin); + vm.startPrank(player); // player is the turret owner vm.expectRevert("Invalid Tribe ID"); diff --git a/smart-turret/pnpm-lock.yaml b/smart-turret/pnpm-lock.yaml index 5d629ba9..a6a2ed60 100644 --- a/smart-turret/pnpm-lock.yaml +++ b/smart-turret/pnpm-lock.yaml @@ -7,6 +7,8 @@ settings: overrides: better-sqlite3: ^9.4.3 '@eveworld/smart-object-framework-v2': 0.1.2 + eslint-config-prettier: 10.1.8 + eslint-plugin-prettier: 4.2.5 importers: diff --git a/smart-turret/readme.md b/smart-turret/readme.md index 31f9876b..d277fee9 100644 --- a/smart-turret/readme.md +++ b/smart-turret/readme.md @@ -143,9 +143,9 @@ cp .envsample .env Next, set the following values in the [.env](./packages/contracts/.env) file to direct the scripts to use Stillness: ```bash copy -WORLD_ADDRESS=0xcdb380e0cd3949caf70c45c67079f2e27a77fc47 -RPC_URL=https://pyrope-external-sync-node-rpc.live.tech.evefrontier.com -CHAIN_ID=695569 +WORLD_ADDRESS=0x1dacc0b64b7da0cc6e2b2fe1bd72f58ebd37363c +RPC_URL=https://op-sepolia-ext-sync-node-rpc.live.tech.evefrontier.com +CHAIN_ID=11155420 ``` You can also automatically point to Stillness with current values using: @@ -220,7 +220,7 @@ pnpm set-key Then deploy the Smart Turret contracts using: ```bash -pnpm run deploy:pyrope +pnpm run deploy:sepolia ``` Once the deployment is successful, you'll see a screen similar to the one below.