Add smart gate contract to allow only tribe members to jump
This commit is contained in:
commit
65582d2c11
11 changed files with 4096 additions and 0 deletions
27
scripts/ConfigureGate.s.sol
Normal file
27
scripts/ConfigureGate.s.sol
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
pragma solidity ^0.8.24;
|
||||
|
||||
import {console} from "forge-std/src/console.sol";
|
||||
import {Script} from "forge-std/src/Script.sol";
|
||||
import {StoreSwitch} from "@latticexyz/store/src/StoreSwitch.sol";
|
||||
import {ResourceId} from "@latticexyz/store/src/ResourceId.sol";
|
||||
import {WorldResourceIdLib} from "@latticexyz/world/src/WorldResourceId.sol";
|
||||
import {RESOURCE_SYSTEM} from "@latticexyz/world/src/worldResourceTypes.sol";
|
||||
import {SmartGateSystem, smartGateSystem} from "@eveworld/world-v2/src/namespaces/evefrontier/codegen/systems/SmartGateSystemLib.sol";
|
||||
|
||||
contract ConfigureSmartGate is Script {
|
||||
function run(uint256 smartGateId) public {
|
||||
address worldAddress = vm.envAddress("WORLD_ADDRESS");
|
||||
string memory namespace = vm.envString("MUD_NAMESPACE");
|
||||
|
||||
StoreSwitch.setStoreAddress(worldAddress);
|
||||
ResourceId systemId = WorldResourceIdLib.encode({
|
||||
typeId: RESOURCE_SYSTEM,
|
||||
namespace: bytes14(bytes(namespace)),
|
||||
name: "TribeGateSystem"
|
||||
});
|
||||
console.logBytes32(systemId.unwrap());
|
||||
vm.startBroadcast();
|
||||
smartGateSystem.configureGate(smartGateId, systemId);
|
||||
vm.stopBroadcast();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue