Skip to content
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
14 changes: 14 additions & 0 deletions .github/workflows/example-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
19 changes: 9 additions & 10 deletions smart-assembly-scaffold/packages/client/src/mud/wagmiConfig.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -14,7 +14,7 @@ import {

const transports = {
[anvil.id]: webSocket(),
[pyrope.id]: http(),
[optimismSepolia.id]: http(),
[garnet.id]: http(),
[redstone.id]: http(),
} as const;
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
},
Expand Down
6 changes: 3 additions & 3 deletions smart-assembly-scaffold/packages/contracts/foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion smart-assembly-scaffold/packages/contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
12 changes: 6 additions & 6 deletions smart-assembly-scaffold/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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.

---

Expand Down
6 changes: 3 additions & 3 deletions smart-gate/packages/contracts/foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion smart-gate/packages/contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions smart-gate/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions smart-gate/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions smart-storage-unit/packages/contracts/foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion smart-storage-unit/packages/contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions smart-storage-unit/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions smart-storage-unit/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions smart-turret/packages/contracts/foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion smart-turret/packages/contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
29 changes: 15 additions & 14 deletions smart-turret/packages/contracts/test/SmartTurretTest.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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){
Expand All @@ -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();
}

Expand All @@ -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,
Expand Down Expand Up @@ -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");

Expand Down
2 changes: 2 additions & 0 deletions smart-turret/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions smart-turret/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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.
Expand Down