Skip to content

Commit

Permalink
add location detection of user to submit gem,redeploy contract
Browse files Browse the repository at this point in the history
  • Loading branch information
LidamaoHub committed Dec 11, 2023
1 parent 3cd85f4 commit a8ddb1f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions packages/contracts/script/PostDeploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ contract PostDeploy is Script {

console.log(" ========== PostDeploy ========== ");

address muser = 0x663F3ad617193148711d28f5334eE4Ed07016602;
address mloot = 0x2E983A1Ba5e8b38AAAeC4B440B9dDcFBf72E15d1;
address mplugin = 0x8438Ad1C834623CfF278AB6829a248E37C2D7E3f;
address muser = 0xBC9129Dc0487fc2E169941C75aABC539f208fb01;
address mloot = 0x6e989C01a3e3A94C973A62280a72EC335598490e;
address mplugin = 0xF6168876932289D073567f347121A267095f3DD6;
bytes32 merkleRoot = 0x5df91eca63323dbb115087ef262075c5bcea99b8eaf95f520efb8d48ff447499;

IWorld(worldAddress).Init(muser, mloot, mplugin,merkleRoot);
Expand Down
2 changes: 2 additions & 0 deletions packages/contracts/src/systems/GameSystem.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ import { GameConfig,Player,PlayerSeason } from "../codegen/index.sol";
import { BattleState, Buff, PlayerState } from "../codegen/common.sol";
import { BattleListData, BattleList, Player, PlayerData, PlayerLocationLock, BoxListData, BoxList, RandomList, RandomListData } from "../codegen/index.sol";
import { Position } from "./Common.sol";
import { GAME_CONFIG_KEY, BATTLE_CONFIG_KEY } from "../Constants.sol";

contract GameSystem is System {
bytes32 constant GAME_KEY = keccak256("Game-Key");

function submitGem() external{
address sender = _msgSender();
require(Player.getState(sender) == PlayerState.Preparing, "You should in Preparing state");
uint16 gemBalance = Player.getOreBalance(sender);
uint16 seasonBalance = PlayerSeason.getOreBalance(sender);
PlayerSeason.setOreBalance(sender,seasonBalance+gemBalance);
Expand Down
4 changes: 2 additions & 2 deletions packages/contracts/worlds.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"address": "0xff2c5b47c0e4924fb2917bfbb714db7f616ac000"
},
"33784": {
"address": "0xe233198863b75acc6e1af43daff3f5918e35875e",
"blockNumber": 155549
"address": "0x6e9474e9c83676b9a71133ff96db43e7aa0a4342",
"blockNumber": 273
},
"421613": {
"address": "0x2Bc1034975c3df48D6f3026802f372677844b85d",
Expand Down

0 comments on commit a8ddb1f

Please sign in to comment.