diff --git a/packages/client/src/mud/createSystemCalls.ts b/packages/client/src/mud/createSystemCalls.ts index 53ed722f..8be5feed 100644 --- a/packages/client/src/mud/createSystemCalls.ts +++ b/packages/client/src/mud/createSystemCalls.ts @@ -316,8 +316,10 @@ export function createSystemCalls( const submitGem = async () => { try { + console.log('submitGem', new Date().getTime()); const tx = await worldContract.write.submitGem(); await waitForTransaction(tx); + console.log('submitGem success', new Date().getTime(), tx); return tx } catch (error) { console.log('submitGem', error); diff --git a/packages/client/src/pages/game/index.tsx b/packages/client/src/pages/game/index.tsx index 13c99ce1..c3647c21 100644 --- a/packages/client/src/pages/game/index.tsx +++ b/packages/client/src/pages/game/index.tsx @@ -8,7 +8,7 @@ import Map from "@/components/Map"; import UserAvatar from "@/components/UserAvatar"; import Leaderboard from "@/components/Leaderboard"; import { useLocation, useNavigate } from "react-router-dom"; -import { message } from 'antd'; +import { message, Modal } from 'antd'; import "./styles.scss"; import Rank from "@/components/Rank"; import { CurIdMockData, PlayersMockData, RankMockData, TreasureChestMockData } from "@/mock/data"; @@ -16,7 +16,7 @@ import { IPlayer } from "@/components/Player"; import { useMUD } from "@/mud/MUDContext"; import Battle from "@/components/Battle"; import GameContext from '@/context'; -import useModal from '@/hooks/useModal'; +// import useModal from '@/hooks/useModal'; import TreasureChest from '@/components/TreasureChest'; import UserInfoDialog from '@/components/UserInfoDialog'; import { DELIVERY } from '@/config/map'; @@ -73,10 +73,14 @@ const Game = () => { const [percentage, setPercentage] = useState(0); + const [modalVisible, setModalVisible] = useState(false); + const [modalType, setModalType] = useState(''); + const [gotBox, setGotBox] = useState(null); + const { account } = network; const curId = account; - const { Modal, open, close, setContent } = useModal(); + // const { Modal, open, close, setContent } = useModal(); const mapDataRef = useRef([]); const moveInterval = useRef(); @@ -191,24 +195,9 @@ const Game = () => { } const getCollectionsFun = (box: any) => { - setContent( -
-
- Congrats,you got {box.oreBalance} gems! - -
- -
-
-
- -
-
- ); - open(); + setGotBox(box); + setModalType('getCollections'); + setModalVisible(true); } const boxs = useEntityQuery([Has(BoxList)]).map((entity) => { @@ -291,6 +280,8 @@ const Game = () => { message.error('Waiting for transaction'); return; } + let txFinished = false; + curPlayer.waiting = true; let playerLock = getComponentValue(PlayerLocationLock, encodeEntity({ addr: "address" }, { addr: account})) console.log(playerLock, 'playerLock') if (playerLock && Number(playerLock.lockTime)) { @@ -301,9 +292,10 @@ const Game = () => { timeout = null }, 2000); } + txFinished = true; + curPlayer.waiting = false; return } - let txFinished = false; clearInterval(moveInterval.current); let pathIndex = 0; const timeInterval = ~~(1500 / Number(curPlayer.speed)) @@ -387,8 +379,10 @@ const Game = () => { const goHomeFun = async () => { if (!curPlayer.waiting) { try { + curPlayer.waiting = true; await goHome(); await joinBattlefield() + curPlayer.waiting = false; } catch (error) { console.log(error) } @@ -400,37 +394,44 @@ const Game = () => { } } + const closeUserInfoDialog = () => { + if (curPlayer.waiting) { + message.error('Waiting for transaction'); + return; + } else { + setUserInfoVisible(false); + } + } + const submitGemFun = async () => { setUserInfoVisible(true); try { - goHomeFun() + goHomeFun(); if (curPlayer.oreBalance > 0) { + console.log('submitGem') + setGotBox({oreBalance: curPlayer.oreBalance}); await submitGem(); - setContent( -
-
- Congrats,you submitted {curPlayer.oreBalance} gems! - -
- -
-
-
- -
-
- ); - open(); + console.log(curPlayer) + setModalType('submitGem'); + setModalVisible(true); } } catch (error) { console.log(error) } } + const closeModal = async () => { + if (modalType === 'getCollections') { + await getCollections(gotBox.id, gotBox.oreBalance, gotBox.treasureBalance); + } else if (modalType === 'submitGem') { + curPlayer.oreBalance = 0; + curPlayer.seasonOreBalance = PlayerSeasonData.filter((item) => item.addr.toLocaleLowerCase() == curPlayer.addr.toLocaleLowerCase())[0]?.oreBalance + } + setModalVisible(false); + setGotBox(null); + setModalType(''); + } + const setStartBattle = async (player) => { const paths = bfs(simpleMapData, { x: curPlayer.x, y: curPlayer.y }, {x: player.x, y: player.y}).slice(1); let res = await battleInvitation(player.addr, formatMovePath(paths)); @@ -527,13 +528,33 @@ const Game = () => { } { - setUserInfoVisible(false); - }} + onClose={closeUserInfoDialog} {...userInfoPlayer} /> - + setModalVisible(false)} + > +
+
+ { + modalType === 'submitGem' ?
Congrats,you submitted {gotBox?.oreBalance} gems!
: null + } + { + modalType === 'getCollections' ?
Congrats,you got {gotBox?.oreBalance} gems!
: null + } +
+ +
+
+
+ +
+
+
diff --git a/packages/contracts/out/IWorld.sol/IWorld.json b/packages/contracts/out/IWorld.sol/IWorld.json index e203f182..d90c5678 100644 --- a/packages/contracts/out/IWorld.sol/IWorld.json +++ b/packages/contracts/out/IWorld.sol/IWorld.json @@ -3912,16 +3912,16 @@ 118568, 118556, 71348, - 129912, - 129821, - 129805, - 129808, - 129860, - 173570, - 129850, - 129839, + 129904, + 129813, + 129797, + 129800, + 129852, + 173562, + 129842, + 129831, 64435, - 127078, + 127070, 64393, 64426, 64399, @@ -3932,22 +3932,22 @@ "nameLocation": "798:6:169", "scope": 118826, "usedErrors": [ + 127035, + 127041, 127043, - 127049, + 127045, 127051, - 127053, - 127059, - 127065, - 127071, - 127077, - 173539, - 173543, + 127057, + 127063, + 127069, + 173531, + 173535, + 173541, + 173545, 173549, 173553, 173557, - 173561, - 173565, - 173569 + 173561 ] } ], diff --git a/packages/contracts/out/Loot.sol/MLoot.json b/packages/contracts/out/Loot.sol/MLoot.json index 83426b95..3ed6d316 100644 --- a/packages/contracts/out/Loot.sol/MLoot.json +++ b/packages/contracts/out/Loot.sol/MLoot.json @@ -1636,34 +1636,34 @@ "id": 119867, "exportedSymbols": { "Address": [ - 131449 + 131441 ], "Base64": [ 118883 ], "Context": [ - 131471 + 131463 ], "ERC165": [ - 131495 + 131487 ], "ERC721": [ 72425 ], "IERC165": [ - 173776 + 173768 ], "IERC20": [ 71498 ], "IERC721": [ - 131074 + 131066 ], "IERC721Metadata": [ - 131119 + 131111 ], "IERC721Receiver": [ - 131092 + 131084 ], "MLoot": [ 119866 @@ -1672,10 +1672,10 @@ 120314 ], "Math": [ - 132361 + 132353 ], "SignedMath": [ - 132466 + 132458 ], "Strings": [ 72654 @@ -14325,11 +14325,11 @@ 119866, 120314, 72425, - 131119, - 131074, - 131495, - 173776, - 131471, + 131111, + 131066, + 131487, + 173768, + 131463, 120117 ], "name": "MLoot", diff --git a/packages/contracts/out/Plugin.sol/MPlugin.json b/packages/contracts/out/Plugin.sol/MPlugin.json index 88e4a5b2..0ae7fb2c 100644 --- a/packages/contracts/out/Plugin.sol/MPlugin.json +++ b/packages/contracts/out/Plugin.sol/MPlugin.json @@ -69,13 +69,13 @@ } ], "bytecode": { - "object": "0x608060405234801561001057600080fd5b5060405161041538038061041583398101604081905261002f9161007c565b600080546001600160a01b039384166001600160a01b031991821617909155600180549290931691161790556100af565b80516001600160a01b038116811461007757600080fd5b919050565b6000806040838503121561008f57600080fd5b61009883610060565b91506100a660208401610060565b90509250929050565b610357806100be6000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80630e439326146100515780631b9cb7e81461009a578063d6f0dafc146100af578063e4128fb3146100b7575b600080fd5b6000546100719073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b6100ad6100a83660046102ff565b6100d7565b005b6100ad6101ea565b6001546100719073ffffffffffffffffffffffffffffffffffffffff1681565b6001546000546040517fd5608f9a0000000000000000000000000000000000000000000000000000000081526004810185905273ffffffffffffffffffffffffffffffffffffffff9283169290911690819063d5608f9a90602401600060405180830381600087803b15801561014c57600080fd5b505af1158015610160573d6000803e3d6000fd5b50506040517fd5608f9a0000000000000000000000000000000000000000000000000000000081526004810186905273ffffffffffffffffffffffffffffffffffffffff8516925063d5608f9a9150602401600060405180830381600087803b1580156101cc57600080fd5b505af11580156101e0573d6000803e3d6000fd5b5050505050505050565b6001546000546040517f6a627842000000000000000000000000000000000000000000000000000000008152336004820181905273ffffffffffffffffffffffffffffffffffffffff9384169390921691908390636a62784290602401600060405180830381600087803b15801561026157600080fd5b505af1158015610275573d6000803e3d6000fd5b50506040517f6a62784200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff848116600483015285169250636a6278429150602401600060405180830381600087803b1580156102e257600080fd5b505af11580156102f6573d6000803e3d6000fd5b50505050505050565b6000806040838503121561031257600080fd5b5050803592602090910135915056fea26469706673582212200bbf5350e468b7e62c174d24540f9b39f081823c8d0bddda3e405d369673aa2364736f6c634300080d0033", - "sourceMap": "126:701:174:-:0;;;218:137;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;284:11;:26;;-1:-1:-1;;;;;284:26:174;;;-1:-1:-1;;;;;;284:26:174;;;;;;;;321;;;;;;;;;;;126:701;;14:177:195;93:13;;-1:-1:-1;;;;;135:31:195;;125:42;;115:70;;181:1;178;171:12;115:70;14:177;;;:::o;196:293::-;275:6;283;336:2;324:9;315:7;311:23;307:32;304:52;;;352:1;349;342:12;304:52;375:40;405:9;375:40;:::i;:::-;365:50;;434:49;479:2;468:9;464:18;434:49;:::i;:::-;424:59;;196:293;;;;;:::o;:::-;126:701:174;;;;;;", + "object": "0x608060405234801561001057600080fd5b5060405161041538038061041583398101604081905261002f9161007c565b600080546001600160a01b039384166001600160a01b031991821617909155600180549290931691161790556100af565b80516001600160a01b038116811461007757600080fd5b919050565b6000806040838503121561008f57600080fd5b61009883610060565b91506100a660208401610060565b90509250929050565b610357806100be6000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80630e439326146100515780631b9cb7e81461009a578063d6f0dafc146100af578063e4128fb3146100b7575b600080fd5b6000546100719073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b6100ad6100a83660046102ff565b6100d7565b005b6100ad6101ea565b6001546100719073ffffffffffffffffffffffffffffffffffffffff1681565b6001546000546040517fd5608f9a0000000000000000000000000000000000000000000000000000000081526004810185905273ffffffffffffffffffffffffffffffffffffffff9283169290911690819063d5608f9a90602401600060405180830381600087803b15801561014c57600080fd5b505af1158015610160573d6000803e3d6000fd5b50506040517fd5608f9a0000000000000000000000000000000000000000000000000000000081526004810186905273ffffffffffffffffffffffffffffffffffffffff8516925063d5608f9a9150602401600060405180830381600087803b1580156101cc57600080fd5b505af11580156101e0573d6000803e3d6000fd5b5050505050505050565b6001546000546040517f6a627842000000000000000000000000000000000000000000000000000000008152336004820181905273ffffffffffffffffffffffffffffffffffffffff9384169390921691908390636a62784290602401600060405180830381600087803b15801561026157600080fd5b505af1158015610275573d6000803e3d6000fd5b50506040517f6a62784200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff848116600483015285169250636a6278429150602401600060405180830381600087803b1580156102e257600080fd5b505af11580156102f6573d6000803e3d6000fd5b50505050505050565b6000806040838503121561031257600080fd5b5050803592602090910135915056fea26469706673582212201a5dada106ccc41498df7e8686caea58737043668e522281be891839d2f50f7764736f6c634300080d0033", + "sourceMap": "121:676:174:-:0;;;209:134;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;274:11;:26;;-1:-1:-1;;;;;274:26:174;;;-1:-1:-1;;;;;;274:26:174;;;;;;;;310;;;;;;;;;;;121:676;;14:177:195;93:13;;-1:-1:-1;;;;;135:31:195;;125:42;;115:70;;181:1;178;171:12;115:70;14:177;;;:::o;196:293::-;275:6;283;336:2;324:9;315:7;311:23;307:32;304:52;;;352:1;349;342:12;304:52;375:40;405:9;375:40;:::i;:::-;365:50;;434:49;479:2;468:9;464:18;434:49;:::i;:::-;424:59;;196:293;;;;;:::o;:::-;121:676:174;;;;;;", "linkReferences": {} }, "deployedBytecode": { - "object": "0x608060405234801561001057600080fd5b506004361061004c5760003560e01c80630e439326146100515780631b9cb7e81461009a578063d6f0dafc146100af578063e4128fb3146100b7575b600080fd5b6000546100719073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b6100ad6100a83660046102ff565b6100d7565b005b6100ad6101ea565b6001546100719073ffffffffffffffffffffffffffffffffffffffff1681565b6001546000546040517fd5608f9a0000000000000000000000000000000000000000000000000000000081526004810185905273ffffffffffffffffffffffffffffffffffffffff9283169290911690819063d5608f9a90602401600060405180830381600087803b15801561014c57600080fd5b505af1158015610160573d6000803e3d6000fd5b50506040517fd5608f9a0000000000000000000000000000000000000000000000000000000081526004810186905273ffffffffffffffffffffffffffffffffffffffff8516925063d5608f9a9150602401600060405180830381600087803b1580156101cc57600080fd5b505af11580156101e0573d6000803e3d6000fd5b5050505050505050565b6001546000546040517f6a627842000000000000000000000000000000000000000000000000000000008152336004820181905273ffffffffffffffffffffffffffffffffffffffff9384169390921691908390636a62784290602401600060405180830381600087803b15801561026157600080fd5b505af1158015610275573d6000803e3d6000fd5b50506040517f6a62784200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff848116600483015285169250636a6278429150602401600060405180830381600087803b1580156102e257600080fd5b505af11580156102f6573d6000803e3d6000fd5b50505050505050565b6000806040838503121561031257600080fd5b5050803592602090910135915056fea26469706673582212200bbf5350e468b7e62c174d24540f9b39f081823c8d0bddda3e405d369673aa2364736f6c634300080d0033", - "sourceMap": "126:701:174:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;150:26;;;;;;;;;;;;190:42:195;178:55;;;160:74;;148:2;133:18;150:26:174;;;;;;;581:241;;;;;;:::i;:::-;;:::i;:::-;;365:208;;;:::i;183:26::-;;;;;;;;;581:241;684:11;;667:9;724:11;747:28;;;;;;;;644:25:195;;;684:11:174;;;;;724;;;;;;747:14;;617:18:195;;747:28:174;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;786:28:174;;;;;;;;644:25:195;;;786:14:174;;;;-1:-1:-1;786:14:174;;-1:-1:-1;617:18:195;;786:28:174;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;656:166;;581:241;;:::o;365:208::-;422:11;;405:9;462:11;522:16;;;;;501:10;522:16;;;160:74:195;;;422:11:174;;;;;462;;;;501:10;422:11;;522:9;;133:18:195;;522:16:174;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;549:16:174;;;;;:9;178:55:195;;;549:16:174;;;160:74:195;549:9:174;;;-1:-1:-1;549:9:174;;-1:-1:-1;133:18:195;;549:16:174;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;394:179;;;365:208::o;245:248:195:-;313:6;321;374:2;362:9;353:7;349:23;345:32;342:52;;;390:1;387;380:12;342:52;-1:-1:-1;;413:23:195;;;483:2;468:18;;;455:32;;-1:-1:-1;245:248:195:o", + "object": "0x608060405234801561001057600080fd5b506004361061004c5760003560e01c80630e439326146100515780631b9cb7e81461009a578063d6f0dafc146100af578063e4128fb3146100b7575b600080fd5b6000546100719073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b6100ad6100a83660046102ff565b6100d7565b005b6100ad6101ea565b6001546100719073ffffffffffffffffffffffffffffffffffffffff1681565b6001546000546040517fd5608f9a0000000000000000000000000000000000000000000000000000000081526004810185905273ffffffffffffffffffffffffffffffffffffffff9283169290911690819063d5608f9a90602401600060405180830381600087803b15801561014c57600080fd5b505af1158015610160573d6000803e3d6000fd5b50506040517fd5608f9a0000000000000000000000000000000000000000000000000000000081526004810186905273ffffffffffffffffffffffffffffffffffffffff8516925063d5608f9a9150602401600060405180830381600087803b1580156101cc57600080fd5b505af11580156101e0573d6000803e3d6000fd5b5050505050505050565b6001546000546040517f6a627842000000000000000000000000000000000000000000000000000000008152336004820181905273ffffffffffffffffffffffffffffffffffffffff9384169390921691908390636a62784290602401600060405180830381600087803b15801561026157600080fd5b505af1158015610275573d6000803e3d6000fd5b50506040517f6a62784200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff848116600483015285169250636a6278429150602401600060405180830381600087803b1580156102e257600080fd5b505af11580156102f6573d6000803e3d6000fd5b50505050505050565b6000806040838503121561031257600080fd5b5050803592602090910135915056fea26469706673582212201a5dada106ccc41498df7e8686caea58737043668e522281be891839d2f50f7764736f6c634300080d0033", + "sourceMap": "121:676:174:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;144:26;;;;;;;;;;;;190:42:195;178:55;;;160:74;;148:2;133:18;144:26:174;;;;;;;558:236;;;;;;:::i;:::-;;:::i;:::-;;350:202;;;:::i;176:26::-;;;;;;;;;558:236;660:11;;643:9;699:11;721:28;;;;;;;;644:25:195;;;660:11:174;;;;;699;;;;;;721:14;;617:18:195;;721:28:174;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;759:28:174;;;;;;;;644:25:195;;;759:14:174;;;;-1:-1:-1;759:14:174;;-1:-1:-1;617:18:195;;759:28:174;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;633:161;;558:236;;:::o;350:202::-;406:11;;389:9;445:11;503:16;;;;;483:10;503:16;;;160:74:195;;;406:11:174;;;;;445;;;;483:10;406:11;;503:9;;133:18:195;;503:16:174;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;529:16:174;;;;;:9;178:55:195;;;529:16:174;;;160:74:195;529:9:174;;;-1:-1:-1;529:9:174;;-1:-1:-1;133:18:195;;529:16:174;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;379:173;;;350:202::o;245:248:195:-;313:6;321;374:2;362:9;353:7;349:23;345:32;342:52;;;390:1;387;380:12;342:52;-1:-1:-1;;413:23:195;;;483:2;468:18;;;455:32;;-1:-1:-1;245:248:195:o", "linkReferences": {} }, "methodIdentifiers": { @@ -84,7 +84,7 @@ "multRevealNFT(uint256,uint256)": "1b9cb7e8", "userAddress()": "e4128fb3" }, - "rawMetadata": "{\"compiler\":{\"version\":\"0.8.13+commit.abaa5c0e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_lootAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_userAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"lootAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"multMint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_lootTokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_userTokenId\",\"type\":\"uint256\"}],\"name\":\"multRevealNFT\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"userAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/other/Plugin.sol\":\"MPlugin\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":3000},\"remappings\":[\":@codegen/=src/codegen/\",\":@latticexyz/=node_modules/@latticexyz/\",\":@library/=src/systems/library/\",\":@openzeppelin/=node_modules/@openzeppelin/\",\":@src/=src/\",\":@systems/=src/systems/\",\":ds-test/=node_modules/ds-test/src/\",\":forge-std/=node_modules/forge-std/src/\"]},\"sources\":{\"src/other/Plugin.sol\":{\"keccak256\":\"0x5e1c1235df3705cdce9280805c98a5dbee7387a37e9ea1f888ef407e34e93db1\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://9eebf8c41902bca6f98309e26560a8675a534bab37d7aee90df25e485f841500\",\"dweb:/ipfs/QmZ36tnrNRA7WCcTy2FjAXqjNWudsMbBw7a7pEu6wognSE\"]},\"src/systems/library/Interface.sol\":{\"keccak256\":\"0x2763cfd878f93841505a6fe04b9a30f0f164c7ac1be8e5748202eaa8048a4438\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://fd14f998d986fe8218cb027feb9318809964eddfae9cd1c73f3e6a636f389ab8\",\"dweb:/ipfs/QmYDnJYaVjwYHyc5uRxQ84kwkE2fMEFM6SEt8wRHJk35Qg\"]}},\"version\":1}", + "rawMetadata": "{\"compiler\":{\"version\":\"0.8.13+commit.abaa5c0e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_lootAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_userAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"lootAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"multMint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_lootTokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_userTokenId\",\"type\":\"uint256\"}],\"name\":\"multRevealNFT\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"userAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/other/Plugin.sol\":\"MPlugin\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":3000},\"remappings\":[\":@codegen/=src/codegen/\",\":@latticexyz/=node_modules/@latticexyz/\",\":@library/=src/systems/library/\",\":@openzeppelin/=node_modules/@openzeppelin/\",\":@src/=src/\",\":@systems/=src/systems/\",\":ds-test/=node_modules/ds-test/src/\",\":forge-std/=node_modules/forge-std/src/\"]},\"sources\":{\"src/other/Plugin.sol\":{\"keccak256\":\"0x97abb338aefc1d78621c1b9cb72ea8fad986a64d8f84067b52b5198e3d815c5c\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://57b18625c00036db38b6015a44024415da14a4f8c37ab0dacc7b292ff53c3fb5\",\"dweb:/ipfs/QmTNfWtySH1Yv2sWknZ4txSGrDg6QpQHqFBPbz2sH8k7nh\"]},\"src/systems/library/Interface.sol\":{\"keccak256\":\"0x575834f9bd85b515de6dfd855d93393cfdf29c67a9195b0dae9c1c4d483d2c1d\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://e42a8328248642f46b67fdcf7d3f2caf5c8abd859cea97df8fba7ad270b19009\",\"dweb:/ipfs/QmUXaFVJStEyTG4mKf4u8ezC7EZtJCX57etePkWrSWiqMR\"]}},\"version\":1}", "metadata": { "compiler": { "version": "0.8.13+commit.abaa5c0e" @@ -194,18 +194,18 @@ }, "sources": { "src/other/Plugin.sol": { - "keccak256": "0x5e1c1235df3705cdce9280805c98a5dbee7387a37e9ea1f888ef407e34e93db1", + "keccak256": "0x97abb338aefc1d78621c1b9cb72ea8fad986a64d8f84067b52b5198e3d815c5c", "urls": [ - "bzz-raw://9eebf8c41902bca6f98309e26560a8675a534bab37d7aee90df25e485f841500", - "dweb:/ipfs/QmZ36tnrNRA7WCcTy2FjAXqjNWudsMbBw7a7pEu6wognSE" + "bzz-raw://57b18625c00036db38b6015a44024415da14a4f8c37ab0dacc7b292ff53c3fb5", + "dweb:/ipfs/QmTNfWtySH1Yv2sWknZ4txSGrDg6QpQHqFBPbz2sH8k7nh" ], "license": "MIT" }, "src/systems/library/Interface.sol": { - "keccak256": "0x2763cfd878f93841505a6fe04b9a30f0f164c7ac1be8e5748202eaa8048a4438", + "keccak256": "0x575834f9bd85b515de6dfd855d93393cfdf29c67a9195b0dae9c1c4d483d2c1d", "urls": [ - "bzz-raw://fd14f998d986fe8218cb027feb9318809964eddfae9cd1c73f3e6a636f389ab8", - "dweb:/ipfs/QmYDnJYaVjwYHyc5uRxQ84kwkE2fMEFM6SEt8wRHJk35Qg" + "bzz-raw://e42a8328248642f46b67fdcf7d3f2caf5c8abd859cea97df8fba7ad270b19009", + "dweb:/ipfs/QmUXaFVJStEyTG4mKf4u8ezC7EZtJCX57etePkWrSWiqMR" ], "license": "MIT" } @@ -217,22 +217,22 @@ "id": 120410, "exportedSymbols": { "Loot": [ - 124742 + 124734 ], "MPlugin": [ 120409 ], "User": [ - 124703 + 124695 ] }, "nodeType": "SourceUnit", - "src": "33:794:174", + "src": "32:765:174", "nodes": [ { "id": 120316, "nodeType": "PragmaDirective", - "src": "33:24:174", + "src": "32:24:174", "nodes": [], "literals": [ "solidity", @@ -244,13 +244,13 @@ { "id": 120319, "nodeType": "ImportDirective", - "src": "59:61:174", + "src": "57:61:174", "nodes": [], "absolutePath": "src/systems/library/Interface.sol", "file": "@systems/library/Interface.sol", "nameLocation": "-1:-1:-1", "scope": 120410, - "sourceUnit": 124743, + "sourceUnit": 124735, "symbolAliases": [ { "foreign": { @@ -258,8 +258,8 @@ "name": "User", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 124703, - "src": "68:4:174", + "referencedDeclaration": 124695, + "src": "66:4:174", "typeDescriptions": {} }, "nameLocation": "-1:-1:-1" @@ -270,8 +270,8 @@ "name": "Loot", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 124742, - "src": "74:4:174", + "referencedDeclaration": 124734, + "src": "72:4:174", "typeDescriptions": {} }, "nameLocation": "-1:-1:-1" @@ -282,18 +282,18 @@ { "id": 120409, "nodeType": "ContractDefinition", - "src": "126:701:174", + "src": "121:676:174", "nodes": [ { "id": 120321, "nodeType": "VariableDeclaration", - "src": "150:26:174", + "src": "144:26:174", "nodes": [], "constant": false, "functionSelector": "0e439326", "mutability": "mutable", "name": "lootAddress", - "nameLocation": "165:11:174", + "nameLocation": "159:11:174", "scope": 120409, "stateVariable": true, "storageLocation": "default", @@ -305,7 +305,7 @@ "id": 120320, "name": "address", "nodeType": "ElementaryTypeName", - "src": "150:7:174", + "src": "144:7:174", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", @@ -317,13 +317,13 @@ { "id": 120323, "nodeType": "VariableDeclaration", - "src": "183:26:174", + "src": "176:26:174", "nodes": [], "constant": false, "functionSelector": "e4128fb3", "mutability": "mutable", "name": "userAddress", - "nameLocation": "198:11:174", + "nameLocation": "191:11:174", "scope": 120409, "stateVariable": true, "storageLocation": "default", @@ -335,7 +335,7 @@ "id": 120322, "name": "address", "nodeType": "ElementaryTypeName", - "src": "183:7:174", + "src": "176:7:174", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", @@ -347,12 +347,12 @@ { "id": 120339, "nodeType": "FunctionDefinition", - "src": "218:137:174", + "src": "209:134:174", "nodes": [], "body": { "id": 120338, "nodeType": "Block", - "src": "273:82:174", + "src": "264:79:174", "nodes": [], "statements": [ { @@ -368,7 +368,7 @@ "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 120321, - "src": "284:11:174", + "src": "274:11:174", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -382,13 +382,13 @@ "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 120325, - "src": "298:12:174", + "src": "288:12:174", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, - "src": "284:26:174", + "src": "274:26:174", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -396,7 +396,7 @@ }, "id": 120333, "nodeType": "ExpressionStatement", - "src": "284:26:174" + "src": "274:26:174" }, { "expression": { @@ -411,7 +411,7 @@ "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 120323, - "src": "321:11:174", + "src": "310:11:174", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -425,13 +425,13 @@ "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 120327, - "src": "335:12:174", + "src": "324:12:174", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, - "src": "321:26:174", + "src": "310:26:174", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -439,7 +439,7 @@ }, "id": 120337, "nodeType": "ExpressionStatement", - "src": "321:26:174" + "src": "310:26:174" } ] }, @@ -457,10 +457,10 @@ "id": 120325, "mutability": "mutable", "name": "_lootAddress", - "nameLocation": "238:12:174", + "nameLocation": "229:12:174", "nodeType": "VariableDeclaration", "scope": 120339, - "src": "230:20:174", + "src": "221:20:174", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -471,7 +471,7 @@ "id": 120324, "name": "address", "nodeType": "ElementaryTypeName", - "src": "230:7:174", + "src": "221:7:174", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", @@ -485,10 +485,10 @@ "id": 120327, "mutability": "mutable", "name": "_userAddress", - "nameLocation": "259:12:174", + "nameLocation": "250:12:174", "nodeType": "VariableDeclaration", "scope": 120339, - "src": "251:20:174", + "src": "242:20:174", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -499,7 +499,7 @@ "id": 120326, "name": "address", "nodeType": "ElementaryTypeName", - "src": "251:7:174", + "src": "242:7:174", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", @@ -509,13 +509,13 @@ "visibility": "internal" } ], - "src": "229:43:174" + "src": "220:43:174" }, "returnParameters": { "id": 120329, "nodeType": "ParameterList", "parameters": [], - "src": "273:0:174" + "src": "264:0:174" }, "scope": 120409, "stateMutability": "nonpayable", @@ -525,12 +525,12 @@ { "id": 120374, "nodeType": "FunctionDefinition", - "src": "365:208:174", + "src": "350:202:174", "nodes": [], "body": { "id": 120373, "nodeType": "Block", - "src": "394:179:174", + "src": "379:173:174", "nodes": [], "statements": [ { @@ -543,14 +543,14 @@ "id": 120344, "mutability": "mutable", "name": "user", - "nameLocation": "410:4:174", + "nameLocation": "394:4:174", "nodeType": "VariableDeclaration", "scope": 120373, - "src": "405:9:174", + "src": "389:9:174", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { - "typeIdentifier": "t_contract$_User_$124703", + "typeIdentifier": "t_contract$_User_$124695", "typeString": "contract User" }, "typeName": { @@ -560,13 +560,13 @@ "id": 120342, "name": "User", "nodeType": "IdentifierPath", - "referencedDeclaration": 124703, - "src": "405:4:174" + "referencedDeclaration": 124695, + "src": "389:4:174" }, - "referencedDeclaration": 124703, - "src": "405:4:174", + "referencedDeclaration": 124695, + "src": "389:4:174", "typeDescriptions": { - "typeIdentifier": "t_contract$_User_$124703", + "typeIdentifier": "t_contract$_User_$124695", "typeString": "contract User" } }, @@ -582,7 +582,7 @@ "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 120323, - "src": "422:11:174", + "src": "406:11:174", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -600,10 +600,10 @@ "name": "User", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 124703, - "src": "417:4:174", + "referencedDeclaration": 124695, + "src": "401:4:174", "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_User_$124703_$", + "typeIdentifier": "t_type$_t_contract$_User_$124695_$", "typeString": "type(contract User)" } }, @@ -615,15 +615,15 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "417:17:174", + "src": "401:17:174", "tryCall": false, "typeDescriptions": { - "typeIdentifier": "t_contract$_User_$124703", + "typeIdentifier": "t_contract$_User_$124695", "typeString": "contract User" } }, "nodeType": "VariableDeclarationStatement", - "src": "405:29:174" + "src": "389:29:174" }, { "assignments": [ @@ -635,14 +635,14 @@ "id": 120351, "mutability": "mutable", "name": "loot", - "nameLocation": "450:4:174", + "nameLocation": "433:4:174", "nodeType": "VariableDeclaration", "scope": 120373, - "src": "445:9:174", + "src": "428:9:174", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { - "typeIdentifier": "t_contract$_Loot_$124742", + "typeIdentifier": "t_contract$_Loot_$124734", "typeString": "contract Loot" }, "typeName": { @@ -652,13 +652,13 @@ "id": 120349, "name": "Loot", "nodeType": "IdentifierPath", - "referencedDeclaration": 124742, - "src": "445:4:174" + "referencedDeclaration": 124734, + "src": "428:4:174" }, - "referencedDeclaration": 124742, - "src": "445:4:174", + "referencedDeclaration": 124734, + "src": "428:4:174", "typeDescriptions": { - "typeIdentifier": "t_contract$_Loot_$124742", + "typeIdentifier": "t_contract$_Loot_$124734", "typeString": "contract Loot" } }, @@ -674,7 +674,7 @@ "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 120321, - "src": "462:11:174", + "src": "445:11:174", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -692,10 +692,10 @@ "name": "Loot", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 124742, - "src": "457:4:174", + "referencedDeclaration": 124734, + "src": "440:4:174", "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_Loot_$124742_$", + "typeIdentifier": "t_type$_t_contract$_Loot_$124734_$", "typeString": "type(contract Loot)" } }, @@ -707,15 +707,15 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "457:17:174", + "src": "440:17:174", "tryCall": false, "typeDescriptions": { - "typeIdentifier": "t_contract$_Loot_$124742", + "typeIdentifier": "t_contract$_Loot_$124734", "typeString": "contract Loot" } }, "nodeType": "VariableDeclarationStatement", - "src": "445:29:174" + "src": "428:29:174" }, { "assignments": [ @@ -727,10 +727,10 @@ "id": 120357, "mutability": "mutable", "name": "_user", - "nameLocation": "493:5:174", + "nameLocation": "475:5:174", "nodeType": "VariableDeclaration", "scope": 120373, - "src": "485:13:174", + "src": "467:13:174", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -741,7 +741,7 @@ "id": 120356, "name": "address", "nodeType": "ElementaryTypeName", - "src": "485:7:174", + "src": "467:7:174", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", @@ -759,7 +759,7 @@ "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": -15, - "src": "501:3:174", + "src": "483:3:174", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" @@ -772,14 +772,14 @@ "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", - "src": "501:10:174", + "src": "483:10:174", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "VariableDeclarationStatement", - "src": "485:26:174" + "src": "467:26:174" }, { "expression": { @@ -790,7 +790,7 @@ "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 120357, - "src": "532:5:174", + "src": "513:5:174", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -810,9 +810,9 @@ "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 120344, - "src": "522:4:174", + "src": "503:4:174", "typeDescriptions": { - "typeIdentifier": "t_contract$_User_$124703", + "typeIdentifier": "t_contract$_User_$124695", "typeString": "contract User" } }, @@ -823,8 +823,8 @@ "lValueRequested": false, "memberName": "mint", "nodeType": "MemberAccess", - "referencedDeclaration": 124697, - "src": "522:9:174", + "referencedDeclaration": 124689, + "src": "503:9:174", "typeDescriptions": { "typeIdentifier": "t_function_external_nonpayable$_t_address_$returns$__$", "typeString": "function (address) external" @@ -838,7 +838,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "522:16:174", + "src": "503:16:174", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", @@ -847,7 +847,7 @@ }, "id": 120366, "nodeType": "ExpressionStatement", - "src": "522:16:174" + "src": "503:16:174" }, { "expression": { @@ -858,7 +858,7 @@ "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 120357, - "src": "559:5:174", + "src": "539:5:174", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -878,9 +878,9 @@ "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 120351, - "src": "549:4:174", + "src": "529:4:174", "typeDescriptions": { - "typeIdentifier": "t_contract$_Loot_$124742", + "typeIdentifier": "t_contract$_Loot_$124734", "typeString": "contract Loot" } }, @@ -891,8 +891,8 @@ "lValueRequested": false, "memberName": "mint", "nodeType": "MemberAccess", - "referencedDeclaration": 124736, - "src": "549:9:174", + "referencedDeclaration": 124728, + "src": "529:9:174", "typeDescriptions": { "typeIdentifier": "t_function_external_nonpayable$_t_address_$returns$__$", "typeString": "function (address) external" @@ -906,7 +906,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "549:16:174", + "src": "529:16:174", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", @@ -915,7 +915,7 @@ }, "id": 120372, "nodeType": "ExpressionStatement", - "src": "549:16:174" + "src": "529:16:174" } ] }, @@ -924,18 +924,18 @@ "kind": "function", "modifiers": [], "name": "multMint", - "nameLocation": "374:8:174", + "nameLocation": "359:8:174", "parameters": { "id": 120340, "nodeType": "ParameterList", "parameters": [], - "src": "382:2:174" + "src": "367:2:174" }, "returnParameters": { "id": 120341, "nodeType": "ParameterList", "parameters": [], - "src": "394:0:174" + "src": "379:0:174" }, "scope": 120409, "stateMutability": "nonpayable", @@ -945,12 +945,12 @@ { "id": 120408, "nodeType": "FunctionDefinition", - "src": "581:241:174", + "src": "558:236:174", "nodes": [], "body": { "id": 120407, "nodeType": "Block", - "src": "656:166:174", + "src": "633:161:174", "nodes": [], "statements": [ { @@ -963,14 +963,14 @@ "id": 120383, "mutability": "mutable", "name": "user", - "nameLocation": "672:4:174", + "nameLocation": "648:4:174", "nodeType": "VariableDeclaration", "scope": 120407, - "src": "667:9:174", + "src": "643:9:174", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { - "typeIdentifier": "t_contract$_User_$124703", + "typeIdentifier": "t_contract$_User_$124695", "typeString": "contract User" }, "typeName": { @@ -980,13 +980,13 @@ "id": 120381, "name": "User", "nodeType": "IdentifierPath", - "referencedDeclaration": 124703, - "src": "667:4:174" + "referencedDeclaration": 124695, + "src": "643:4:174" }, - "referencedDeclaration": 124703, - "src": "667:4:174", + "referencedDeclaration": 124695, + "src": "643:4:174", "typeDescriptions": { - "typeIdentifier": "t_contract$_User_$124703", + "typeIdentifier": "t_contract$_User_$124695", "typeString": "contract User" } }, @@ -1002,7 +1002,7 @@ "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 120323, - "src": "684:11:174", + "src": "660:11:174", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -1020,10 +1020,10 @@ "name": "User", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 124703, - "src": "679:4:174", + "referencedDeclaration": 124695, + "src": "655:4:174", "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_User_$124703_$", + "typeIdentifier": "t_type$_t_contract$_User_$124695_$", "typeString": "type(contract User)" } }, @@ -1035,15 +1035,15 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "679:17:174", + "src": "655:17:174", "tryCall": false, "typeDescriptions": { - "typeIdentifier": "t_contract$_User_$124703", + "typeIdentifier": "t_contract$_User_$124695", "typeString": "contract User" } }, "nodeType": "VariableDeclarationStatement", - "src": "667:29:174" + "src": "643:29:174" }, { "assignments": [ @@ -1055,14 +1055,14 @@ "id": 120390, "mutability": "mutable", "name": "loot", - "nameLocation": "712:4:174", + "nameLocation": "687:4:174", "nodeType": "VariableDeclaration", "scope": 120407, - "src": "707:9:174", + "src": "682:9:174", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { - "typeIdentifier": "t_contract$_Loot_$124742", + "typeIdentifier": "t_contract$_Loot_$124734", "typeString": "contract Loot" }, "typeName": { @@ -1072,13 +1072,13 @@ "id": 120388, "name": "Loot", "nodeType": "IdentifierPath", - "referencedDeclaration": 124742, - "src": "707:4:174" + "referencedDeclaration": 124734, + "src": "682:4:174" }, - "referencedDeclaration": 124742, - "src": "707:4:174", + "referencedDeclaration": 124734, + "src": "682:4:174", "typeDescriptions": { - "typeIdentifier": "t_contract$_Loot_$124742", + "typeIdentifier": "t_contract$_Loot_$124734", "typeString": "contract Loot" } }, @@ -1094,7 +1094,7 @@ "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 120321, - "src": "724:11:174", + "src": "699:11:174", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -1112,10 +1112,10 @@ "name": "Loot", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 124742, - "src": "719:4:174", + "referencedDeclaration": 124734, + "src": "694:4:174", "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_Loot_$124742_$", + "typeIdentifier": "t_type$_t_contract$_Loot_$124734_$", "typeString": "type(contract Loot)" } }, @@ -1127,15 +1127,15 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "719:17:174", + "src": "694:17:174", "tryCall": false, "typeDescriptions": { - "typeIdentifier": "t_contract$_Loot_$124742", + "typeIdentifier": "t_contract$_Loot_$124734", "typeString": "contract Loot" } }, "nodeType": "VariableDeclarationStatement", - "src": "707:29:174" + "src": "682:29:174" }, { "expression": { @@ -1146,7 +1146,7 @@ "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 120376, - "src": "762:12:174", + "src": "736:12:174", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -1166,9 +1166,9 @@ "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 120390, - "src": "747:4:174", + "src": "721:4:174", "typeDescriptions": { - "typeIdentifier": "t_contract$_Loot_$124742", + "typeIdentifier": "t_contract$_Loot_$124734", "typeString": "contract Loot" } }, @@ -1179,8 +1179,8 @@ "lValueRequested": false, "memberName": "revealNFT", "nodeType": "MemberAccess", - "referencedDeclaration": 124741, - "src": "747:14:174", + "referencedDeclaration": 124733, + "src": "721:14:174", "typeDescriptions": { "typeIdentifier": "t_function_external_nonpayable$_t_uint256_$returns$__$", "typeString": "function (uint256) external" @@ -1194,7 +1194,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "747:28:174", + "src": "721:28:174", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", @@ -1203,7 +1203,7 @@ }, "id": 120400, "nodeType": "ExpressionStatement", - "src": "747:28:174" + "src": "721:28:174" }, { "expression": { @@ -1214,7 +1214,7 @@ "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 120378, - "src": "801:12:174", + "src": "774:12:174", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -1234,9 +1234,9 @@ "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 120383, - "src": "786:4:174", + "src": "759:4:174", "typeDescriptions": { - "typeIdentifier": "t_contract$_User_$124703", + "typeIdentifier": "t_contract$_User_$124695", "typeString": "contract User" } }, @@ -1247,8 +1247,8 @@ "lValueRequested": false, "memberName": "revealNFT", "nodeType": "MemberAccess", - "referencedDeclaration": 124702, - "src": "786:14:174", + "referencedDeclaration": 124694, + "src": "759:14:174", "typeDescriptions": { "typeIdentifier": "t_function_external_nonpayable$_t_uint256_$returns$__$", "typeString": "function (uint256) external" @@ -1262,7 +1262,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "786:28:174", + "src": "759:28:174", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", @@ -1271,7 +1271,7 @@ }, "id": 120406, "nodeType": "ExpressionStatement", - "src": "786:28:174" + "src": "759:28:174" } ] }, @@ -1280,7 +1280,7 @@ "kind": "function", "modifiers": [], "name": "multRevealNFT", - "nameLocation": "590:13:174", + "nameLocation": "567:13:174", "parameters": { "id": 120379, "nodeType": "ParameterList", @@ -1290,10 +1290,10 @@ "id": 120376, "mutability": "mutable", "name": "_lootTokenId", - "nameLocation": "612:12:174", + "nameLocation": "589:12:174", "nodeType": "VariableDeclaration", "scope": 120408, - "src": "604:20:174", + "src": "581:20:174", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -1304,7 +1304,7 @@ "id": 120375, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "604:7:174", + "src": "581:7:174", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -1317,10 +1317,10 @@ "id": 120378, "mutability": "mutable", "name": "_userTokenId", - "nameLocation": "633:12:174", + "nameLocation": "610:12:174", "nodeType": "VariableDeclaration", "scope": 120408, - "src": "625:20:174", + "src": "602:20:174", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -1331,7 +1331,7 @@ "id": 120377, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "625:7:174", + "src": "602:7:174", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -1340,13 +1340,13 @@ "visibility": "internal" } ], - "src": "603:43:174" + "src": "580:43:174" }, "returnParameters": { "id": 120380, "nodeType": "ParameterList", "parameters": [], - "src": "656:0:174" + "src": "633:0:174" }, "scope": 120409, "stateMutability": "nonpayable", @@ -1364,7 +1364,7 @@ 120409 ], "name": "MPlugin", - "nameLocation": "135:7:174", + "nameLocation": "130:7:174", "scope": 120410, "usedErrors": [] } diff --git a/packages/contracts/out/User.sol/MUser.json b/packages/contracts/out/User.sol/MUser.json index 3b836634..3f3b479f 100644 --- a/packages/contracts/out/User.sol/MUser.json +++ b/packages/contracts/out/User.sol/MUser.json @@ -1426,31 +1426,31 @@ "id": 121069, "exportedSymbols": { "Address": [ - 131449 + 131441 ], "Base64": [ 118883 ], "Context": [ - 131471 + 131463 ], "ERC165": [ - 131495 + 131487 ], "ERC721": [ 72425 ], "IERC165": [ - 173776 + 173768 ], "IERC721": [ - 131074 + 131066 ], "IERC721Metadata": [ - 131119 + 131111 ], "IERC721Receiver": [ - 131092 + 131084 ], "MRandom": [ 120314 @@ -1459,10 +1459,10 @@ 121068 ], "Math": [ - 132361 + 132353 ], "SignedMath": [ - 132466 + 132458 ], "Strings": [ 72654 @@ -9919,11 +9919,11 @@ 121068, 120314, 72425, - 131119, - 131074, - 131495, - 173776, - 131471 + 131111, + 131066, + 131487, + 173768, + 131463 ], "name": "MUser", "nameLocation": "178:5:175", diff --git a/packages/contracts/src/systems/BattleForceSystem.sol b/packages/contracts/src/systems/BattleForceSystem.sol index d9606e0b..f669904f 100644 --- a/packages/contracts/src/systems/BattleForceSystem.sol +++ b/packages/contracts/src/systems/BattleForceSystem.sol @@ -23,11 +23,8 @@ contract BattleForceSystem is System { BattleState oppositeState = _msgSender() == battle.attacker ? battle.defenderState : battle.attackerState; BattleState playerState = _msgSender() == battle.attacker ? battle.attackerState : battle.defenderState; - console.log("battle attacker ", battle.attacker); address oppositer = _msgSender() == battle.attacker ? battle.defender : battle.attacker; - console.log(" opposite state ", uint(oppositeState)); - console.log(" player state ", uint(playerState)); require((oppositeState == BattleState.Inited && playerState == BattleState.Confirmed)||(oppositeState == BattleState.Confirmed && playerState == BattleState.Revealed), "battle state not correct"); diff --git a/packages/contracts/src/systems/BattlePrepareSystem.sol b/packages/contracts/src/systems/BattlePrepareSystem.sol index c0828708..596454ea 100644 --- a/packages/contracts/src/systems/BattlePrepareSystem.sol +++ b/packages/contracts/src/systems/BattlePrepareSystem.sol @@ -21,8 +21,8 @@ contract BattlePrepareSystem is System { //实际上是送到原点 // TODO似乎可以直接通过indexer获取,就不需要再次插入了 - // Player.setX(player, GameConfig.getOriginX(GAME_CONFIG_KEY)); - // Player.setY(player, GameConfig.getOriginY(GAME_CONFIG_KEY)); + Player.setX(player, GameConfig.getOriginX(GAME_CONFIG_KEY)); + Player.setY(player, GameConfig.getOriginY(GAME_CONFIG_KEY)); Player.setState(player, PlayerState.Exploring); } diff --git a/packages/contracts/worlds.json b/packages/contracts/worlds.json index 928d3259..6ccdec98 100644 --- a/packages/contracts/worlds.json +++ b/packages/contracts/worlds.json @@ -4,11 +4,11 @@ "blockNumber": 29582781 }, "31337": { - "address": "0xD28F3246f047Efd4059B24FA1fa587eD9fa3e77F" + "address": "0x65fCA99E7D20e04fEc8bFdD7503eA927d2b890f5" }, "33784": { - "address": "0x2428109A9e775E4406fe079132F216dc77117333", - "blockNumber": 1528 + "address": "0xD1B2087d0317522df980050602CE91Ba37869139", + "blockNumber": 66981 }, "421613": { "address": "0x2Bc1034975c3df48D6f3026802f372677844b85d",