From 61702b34b8bffb60ac5d1a162c77f0639895800a Mon Sep 17 00:00:00 2001 From: Daniel Kraft Date: Wed, 20 Jul 2022 16:10:28 +0200 Subject: [PATCH] Update NPM dependencies. Use the actual 1.0.0 (deployed on Polygon) contracts for XayaAccounts and switch to @truffle/contract instead of the deprecated truffle-contract. Both changes together required some tweaks in the other parts of the code, such as deploying also NftMetadata on the Ganache environment. --- eth/solidity/test/movetracking.js | 4 ++-- eth/solidity/truffle-config.js | 3 ++- package.json | 4 ++-- xayax/Makefile.am | 1 + xayax/eth.py | 6 +++++- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/eth/solidity/test/movetracking.js b/eth/solidity/test/movetracking.js index 499d5d0..2f8a84a 100644 --- a/eth/solidity/test/movetracking.js +++ b/eth/solidity/test/movetracking.js @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT -// Copyright (C) 2021 Autonomous Worlds Ltd +// Copyright (C) 2021-2022 Autonomous Worlds Ltd const truffleAssert = require ("truffle-assertions"); -const truffleContract = require ("truffle-contract"); +const truffleContract = require ("@truffle/contract"); const { time } = require ("@openzeppelin/test-helpers"); /* We want to use chai-subset for checking the MoveData structs easily, diff --git a/eth/solidity/truffle-config.js b/eth/solidity/truffle-config.js index 77e0b48..769256f 100644 --- a/eth/solidity/truffle-config.js +++ b/eth/solidity/truffle-config.js @@ -4,7 +4,8 @@ module.exports = { version: "^0.8.4", settings: { optimizer: { - enabled: false + enabled: true, + runs: 100 } } } diff --git a/package.json b/package.json index 93c9395..20e634b 100644 --- a/package.json +++ b/package.json @@ -3,9 +3,9 @@ "chai": "", "chai-subset": "", "truffle-assertions": "", - "truffle-contract": "", "@openzeppelin/test-helpers": "", + "@truffle/contract": "", "@xaya/wchi": "1.0.0", - "@xaya/eth-account-registry": "0.1.2" + "@xaya/eth-account-registry": "1.0.0" } } diff --git a/xayax/Makefile.am b/xayax/Makefile.am index 4f042e9..512fce3 100644 --- a/xayax/Makefile.am +++ b/xayax/Makefile.am @@ -1,5 +1,6 @@ WCHI_CONTRACTS = WCHI.json ACCOUNTS_CONTRACTS = \ + NftMetadata.json \ XayaAccounts.json \ XayaPolicy.json CONTRACTS = $(WCHI_CONTRACTS) $(ACCOUNTS_CONTRACTS) diff --git a/xayax/eth.py b/xayax/eth.py index abaffbc..c853aed 100644 --- a/xayax/eth.py +++ b/xayax/eth.py @@ -324,13 +324,17 @@ class XayaDeployment: wchi = None registry = None policy = None + metadata = None res = XayaDeployment () res.account = self.w3.eth.accounts[0] res.wchi = self.deployContract (res.account, loadJsonData ("WCHI.json")) + res.metadata = self.deployContract (res.account, + loadJsonData ("NftMetadata.json")) res.policy = self.deployContract ( - res.account, loadJsonData ("XayaPolicy.json"), 100_0000) + res.account, loadJsonData ("XayaPolicy.json"), + res.metadata.address, 100_0000) res.registry = self.deployContract ( res.account, loadJsonData ("XayaAccounts.json"), res.wchi.address, res.policy.address)