From 2890b4680d766ab204c3b1f4314aabd161a608db Mon Sep 17 00:00:00 2001 From: Michael Kim Date: Wed, 3 Apr 2024 14:58:13 +0900 Subject: [PATCH] [Contract] Change token name KIOS to LYT --- active_contracts.json | 48 ++----------------- packages/contracts-lib/package.json | 4 +- packages/contracts/contracts/Reference.sol | 2 +- .../token/{TestKIOS.sol => TestLYT.sol} | 4 +- .../deploy/main_chain_devnet/deploy.ts | 12 ++--- .../deploy/side_chain_devnet/deploy.ts | 21 ++++---- packages/contracts/package.json | 4 +- packages/contracts/src/utils/ContractUtils.ts | 2 +- packages/contracts/test/00-Validator.test.ts | 2 +- .../contracts/test/01-CurrencyRate.test.ts | 16 +++---- packages/contracts/test/03-Shop.test.ts | 4 +- packages/contracts/test/04-Ledger.test.ts | 18 +++---- packages/contracts/test/05-Bridge.test.ts | 4 +- packages/contracts/test/06-ShopId.test.ts | 2 +- packages/contracts/test/helper/Deployments.ts | 36 +++++++------- packages/faker/contracts/Reference.sol | 2 +- packages/faker/package.json | 4 +- packages/faker/scripts/createShopId.ts | 2 +- packages/faker/src/utils/ContractUtils.ts | 2 +- packages/relay/contracts/Reference.sol | 4 +- packages/relay/package.json | 4 +- packages/relay/src/utils/ContractUtils.ts | 2 +- packages/relay/test/Approval.test.ts | 4 +- packages/relay/test/Bridge.test.ts | 2 +- packages/relay/test/DelegatedTransfer.test.ts | 2 +- packages/relay/test/DelegatorApproval.test.ts | 6 +-- packages/relay/test/Endpoints.test.ts | 12 ++--- packages/relay/test/ForcedClose.test.ts | 8 ++-- packages/relay/test/LoyaltyBridge.test.ts | 2 +- packages/relay/test/LoyaltyTransfer.test.ts | 2 +- packages/relay/test/Payment.test.ts | 42 ++++++++-------- packages/relay/test/Shop.test.ts | 6 +-- packages/relay/test/ShopWithdraw.test.ts | 6 +-- packages/relay/test/TempararyAccount.test.ts | 6 +-- packages/relay/test/helper/Deployments.ts | 48 +++++++++---------- yarn.lock | 8 ++-- 36 files changed, 153 insertions(+), 200 deletions(-) rename packages/contracts/contracts/token/{TestKIOS.sol => TestLYT.sol} (77%) diff --git a/active_contracts.json b/active_contracts.json index fcda03c1..d9882389 100644 --- a/active_contracts.json +++ b/active_contracts.json @@ -1,5 +1,5 @@ { - "bosagora_mainnet": { + "loyalty_mainnet": { "LoyaltyToken": "0xB1A90a5C6e30d64Ab6f64C30eD392F46eDBcb022", "Validator": "0x4Ca91738C7cD24895467c6d550D96BE8dC4b33AA", "CurrencyRate": "0x979a62090BDCff36F2e140F6915fbAdA7510cb6a", @@ -13,49 +13,7 @@ "Shop": "0xB4B0d4D6aAd2f963CC2FaeCBb4B8C94C3eeE6DB8", "Ledger": "0xcAde85D03A2ABd41b608004BBB25440D28C64912" }, - "bosagora_testnet": { - "LoyaltyToken": "0xB1A90a5C6e30d64Ab6f64C30eD392F46eDBcb022", - "Validator": "0x4Ca91738C7cD24895467c6d550D96BE8dC4b33AA", - "CurrencyRate": "0x979a62090BDCff36F2e140F6915fbAdA7510cb6a", - "LoyaltyBurner": "0x5B4f8F9566706D4dB7f5E3020cE0485f96415749", - "LoyaltyProvider": "0xDD91A65534847537c290FEbc721cf8457f860744", - "LoyaltyConsumer": "0xb9CE93eeb00a74Deeec319cBCD37938b5aAE6314", - "LoyaltyExchanger": "0x1ae7b2564Ae7a7Fb1E7976F3F71cAF43ef49ac6F", - "LoyaltyTransfer": "0xcAE5A9f266991dcEdc62bb9291f15E112f212820", - "BridgeValidator": "0xE7D4f38Fad1C1C5EAA8A1280678B860a7A9519c1", - "LoyaltyBridge": "0xd73e6a2f2e47236F1Ff737E72497f598652122F9", - "Shop": "0xB4B0d4D6aAd2f963CC2FaeCBb4B8C94C3eeE6DB8", - "Ledger": "0xcAde85D03A2ABd41b608004BBB25440D28C64912" - }, - "bosagora_devnet": { - "LoyaltyToken": "0xB1A90a5C6e30d64Ab6f64C30eD392F46eDBcb022", - "Validator": "0x4Ca91738C7cD24895467c6d550D96BE8dC4b33AA", - "CurrencyRate": "0x979a62090BDCff36F2e140F6915fbAdA7510cb6a", - "LoyaltyBurner": "0x5B4f8F9566706D4dB7f5E3020cE0485f96415749", - "LoyaltyProvider": "0xDD91A65534847537c290FEbc721cf8457f860744", - "LoyaltyConsumer": "0xb9CE93eeb00a74Deeec319cBCD37938b5aAE6314", - "LoyaltyExchanger": "0x1ae7b2564Ae7a7Fb1E7976F3F71cAF43ef49ac6F", - "LoyaltyTransfer": "0xcAE5A9f266991dcEdc62bb9291f15E112f212820", - "BridgeValidator": "0xE7D4f38Fad1C1C5EAA8A1280678B860a7A9519c1", - "LoyaltyBridge": "0xd73e6a2f2e47236F1Ff737E72497f598652122F9", - "Shop": "0xB4B0d4D6aAd2f963CC2FaeCBb4B8C94C3eeE6DB8", - "Ledger": "0xcAde85D03A2ABd41b608004BBB25440D28C64912" - }, - "kios_mainnet": { - "LoyaltyToken": "0xB1A90a5C6e30d64Ab6f64C30eD392F46eDBcb022", - "Validator": "0x4Ca91738C7cD24895467c6d550D96BE8dC4b33AA", - "CurrencyRate": "0x979a62090BDCff36F2e140F6915fbAdA7510cb6a", - "LoyaltyBurner": "0x5B4f8F9566706D4dB7f5E3020cE0485f96415749", - "LoyaltyProvider": "0xDD91A65534847537c290FEbc721cf8457f860744", - "LoyaltyConsumer": "0xb9CE93eeb00a74Deeec319cBCD37938b5aAE6314", - "LoyaltyExchanger": "0x1ae7b2564Ae7a7Fb1E7976F3F71cAF43ef49ac6F", - "LoyaltyTransfer": "0xcAE5A9f266991dcEdc62bb9291f15E112f212820", - "BridgeValidator": "0xE7D4f38Fad1C1C5EAA8A1280678B860a7A9519c1", - "LoyaltyBridge": "0xd73e6a2f2e47236F1Ff737E72497f598652122F9", - "Shop": "0xB4B0d4D6aAd2f963CC2FaeCBb4B8C94C3eeE6DB8", - "Ledger": "0xcAde85D03A2ABd41b608004BBB25440D28C64912" - }, - "kios_testnet": { + "loyalty_testnet": { "LoyaltyToken": "0x3A90432BBfd5Bd87788f397F46c24685492fb30E", "Validator": "0x7265F4D550AEdc3Ed97a6ae6dDAf4289eDFaC0C5", "CurrencyRate": "0xE2EE763820443c6953B7e9c4bD3D729509524a4D", @@ -69,7 +27,7 @@ "Shop": "0x011BD972Ee1724a300250Bf614ACE1ddC5DEe37E", "Ledger": "0x2fD2Cdae46578dCa6AB208feCb247E5B25876309" }, - "kios_devnet": { + "loyalty_devnet": { "LoyaltyToken": "0xB1A90a5C6e30d64Ab6f64C30eD392F46eDBcb022", "Validator": "0x4Ca91738C7cD24895467c6d550D96BE8dC4b33AA", "CurrencyRate": "0x979a62090BDCff36F2e140F6915fbAdA7510cb6a", diff --git a/packages/contracts-lib/package.json b/packages/contracts-lib/package.json index dca3ab7b..349123c2 100644 --- a/packages/contracts-lib/package.json +++ b/packages/contracts-lib/package.json @@ -1,6 +1,6 @@ { "name": "dms-osx-lib", - "version": "2.10.3", + "version": "2.11.0", "description": "", "main": "dist/bundle-cjs.js", "module": "dist/bundle-esm.js", @@ -10,7 +10,7 @@ }, "scripts": { "build:contracts": "cd ../contracts && yarn build", - "build": "find ../contracts/artifacts/contracts/ ../contracts/artifacts/loyalty-tokens/contracts/ -name '*.json' -type f | grep -v '.dbg.json' | xargs typechain --target=ethers-v5 --out-dir ./types", + "build": "find ../contracts/artifacts/contracts/ ../contracts/artifacts/loyalty-tokens/contracts/ ../contracts/artifacts/dms-bridge-contracts/contracts/ -name '*.json' -type f | grep -v '.dbg.json' | xargs typechain --target=ethers-v5 --out-dir ./types", "build:npm": "rollup --config rollup.config.ts" }, "repository": { diff --git a/packages/contracts/contracts/Reference.sol b/packages/contracts/contracts/Reference.sol index 79a20393..a2927baf 100644 --- a/packages/contracts/contracts/Reference.sol +++ b/packages/contracts/contracts/Reference.sol @@ -6,7 +6,7 @@ import "multisig-wallet-contracts/contracts/MultiSigWalletFactory.sol"; import "multisig-wallet-contracts/contracts/MultiSigWallet.sol"; import "loyalty-tokens/contracts/LoyaltyToken.sol"; -import "loyalty-tokens/contracts/KIOS.sol"; +import "loyalty-tokens/contracts/LYT.sol"; import "dms-bridge-contracts/contracts/interfaces/IBridge.sol"; import "dms-bridge-contracts/contracts/interfaces/IBridgeLiquidity.sol"; diff --git a/packages/contracts/contracts/token/TestKIOS.sol b/packages/contracts/contracts/token/TestLYT.sol similarity index 77% rename from packages/contracts/contracts/token/TestKIOS.sol rename to packages/contracts/contracts/token/TestLYT.sol index f5c57b98..0de22ae0 100644 --- a/packages/contracts/contracts/token/TestKIOS.sol +++ b/packages/contracts/contracts/token/TestLYT.sol @@ -3,8 +3,8 @@ pragma solidity ^0.8.2; import "loyalty-tokens/contracts/BIP20/BIP20DelegatedTransfer.sol"; -contract TestKIOS is BIP20DelegatedTransfer { - constructor(address owner) BIP20DelegatedTransfer("KIOS", "KIOS") { +contract TestLYT is BIP20DelegatedTransfer { + constructor(address owner) BIP20DelegatedTransfer("LYT", "LYT") { _mint(owner, 1e10 * 1e18); } diff --git a/packages/contracts/deploy/main_chain_devnet/deploy.ts b/packages/contracts/deploy/main_chain_devnet/deploy.ts index 6e33d10e..6b7e73da 100644 --- a/packages/contracts/deploy/main_chain_devnet/deploy.ts +++ b/packages/contracts/deploy/main_chain_devnet/deploy.ts @@ -14,18 +14,16 @@ import fs from "fs"; import * as hre from "hardhat"; import { ethers, upgrades } from "hardhat"; -const network = "bosagora_devnet"; +const network = "main_chain_devnet"; export const MULTI_SIG_WALLET_ADDRESSES: { [key: string]: string } = { - bosagora_mainnet: "0x6d9493FB6D8c8bD3534a3E1F4163921161BEf187", - bosagora_testnet: "0x6d9493FB6D8c8bD3534a3E1F4163921161BEf187", - bosagora_devnet: "0x6d9493FB6D8c8bD3534a3E1F4163921161BEf187", + main_chain_devnet: "0x6d9493FB6D8c8bD3534a3E1F4163921161BEf187", + side_chain_devnet: "0x6d9493FB6D8c8bD3534a3E1F4163921161BEf187", }; export const LOYALTY_TOKEN_ADDRESSES: { [key: string]: string } = { - bosagora_mainnet: "0xB1A90a5C6e30d64Ab6f64C30eD392F46eDBcb022", - bosagora_testnet: "0xB1A90a5C6e30d64Ab6f64C30eD392F46eDBcb022", - bosagora_devnet: "0xB1A90a5C6e30d64Ab6f64C30eD392F46eDBcb022", + main_chain_devnet: "0xB1A90a5C6e30d64Ab6f64C30eD392F46eDBcb022", + side_chain_devnet: "0xB1A90a5C6e30d64Ab6f64C30eD392F46eDBcb022", }; interface IDeployedContract { diff --git a/packages/contracts/deploy/side_chain_devnet/deploy.ts b/packages/contracts/deploy/side_chain_devnet/deploy.ts index c0cd32e9..c9b77b4e 100644 --- a/packages/contracts/deploy/side_chain_devnet/deploy.ts +++ b/packages/contracts/deploy/side_chain_devnet/deploy.ts @@ -20,7 +20,7 @@ import { MultiSigWallet, PhoneLinkCollection, Shop, - TestKIOS, + TestLYT, Validator, } from "../../typechain-types"; @@ -30,24 +30,21 @@ import fs from "fs"; import * as hre from "hardhat"; -const network = "bosagora_devnet"; +const network = "side_chain_devnet"; export const PHONE_LINK_COLLECTION_ADDRESSES: { [key: string]: string } = { - bosagora_mainnet: "0xaE7018CaF086EB2Ca62eAA7b91B61dDA6b046F70", - bosagora_testnet: "0xaE7018CaF086EB2Ca62eAA7b91B61dDA6b046F70", - bosagora_devnet: "0xaE7018CaF086EB2Ca62eAA7b91B61dDA6b046F70", + main_chain_devnet: "0xaE7018CaF086EB2Ca62eAA7b91B61dDA6b046F70", + side_chain_devnet: "0xaE7018CaF086EB2Ca62eAA7b91B61dDA6b046F70", }; export const MULTI_SIG_WALLET_ADDRESSES: { [key: string]: string } = { - bosagora_mainnet: "0x6d9493FB6D8c8bD3534a3E1F4163921161BEf187", - bosagora_testnet: "0x6d9493FB6D8c8bD3534a3E1F4163921161BEf187", - bosagora_devnet: "0x6d9493FB6D8c8bD3534a3E1F4163921161BEf187", + main_chain_devnet: "0x6d9493FB6D8c8bD3534a3E1F4163921161BEf187", + side_chain_devnet: "0x6d9493FB6D8c8bD3534a3E1F4163921161BEf187", }; export const LOYALTY_TOKEN_ADDRESSES: { [key: string]: string } = { - bosagora_mainnet: "0xB1A90a5C6e30d64Ab6f64C30eD392F46eDBcb022", - bosagora_testnet: "0xB1A90a5C6e30d64Ab6f64C30eD392F46eDBcb022", - bosagora_devnet: "0xB1A90a5C6e30d64Ab6f64C30eD392F46eDBcb022", + main_chain_devnet: "0xB1A90a5C6e30d64Ab6f64C30eD392F46eDBcb022", + side_chain_devnet: "0xB1A90a5C6e30d64Ab6f64C30eD392F46eDBcb022", }; interface IDeployedContract { @@ -928,7 +925,7 @@ async function deploySideChainBridge(accounts: IAccount, deployment: Deployments const chainId = (await hre.ethers.provider.getNetwork()).chainId; { - const tokenContract = (await deployment.getContract("LoyaltyToken")) as TestKIOS; + const tokenContract = (await deployment.getContract("LoyaltyToken")) as TestLYT; const tokenId = ContractUtils.getTokenId(await tokenContract.name(), await tokenContract.symbol()); await contract.connect(accounts.deployer).registerToken(tokenId, tokenContract.address); const assetAmount = Amount.make(500_000_000, 18).value; diff --git a/packages/contracts/package.json b/packages/contracts/package.json index 4456a3b2..dee3f008 100644 --- a/packages/contracts/package.json +++ b/packages/contracts/package.json @@ -1,6 +1,6 @@ { "name": "dms-osx-artifacts", - "version": "2.10.3", + "version": "2.11.0", "description": "Smart contracts that decentralized point systems", "files": [ "**/*.sol" @@ -69,6 +69,6 @@ "del-osx-artifacts": "^2.3.0", "dms-bridge-contracts": "^1.2.3", "multisig-wallet-contracts": "^1.1.0", - "loyalty-tokens": "^1.0.7" + "loyalty-tokens": "^1.1.0" } } diff --git a/packages/contracts/src/utils/ContractUtils.ts b/packages/contracts/src/utils/ContractUtils.ts index 2ed85777..3310fe58 100644 --- a/packages/contracts/src/utils/ContractUtils.ts +++ b/packages/contracts/src/utils/ContractUtils.ts @@ -24,7 +24,7 @@ import { verifyMessage } from "@ethersproject/wallet"; import * as hre from "hardhat"; export enum LoyaltyNetworkID { - KIOS, + LYT, PNB, } diff --git a/packages/contracts/test/00-Validator.test.ts b/packages/contracts/test/00-Validator.test.ts index 5b5ea7ec..e00afff2 100644 --- a/packages/contracts/test/00-Validator.test.ts +++ b/packages/contracts/test/00-Validator.test.ts @@ -25,7 +25,7 @@ describe("Test for Validator", () => { before(async () => { await deployments.doDeployToken(); - tokenContract = deployments.getContract("TestKIOS") as ERC20; + tokenContract = deployments.getContract("TestLYT") as ERC20; for (const elem of deployments.accounts.validators) { await tokenContract.connect(deployments.accounts.owner).transfer(elem.address, amount.value); diff --git a/packages/contracts/test/01-CurrencyRate.test.ts b/packages/contracts/test/01-CurrencyRate.test.ts index bcabd28d..d0561d90 100644 --- a/packages/contracts/test/01-CurrencyRate.test.ts +++ b/packages/contracts/test/01-CurrencyRate.test.ts @@ -25,7 +25,7 @@ describe("Test for CurrencyRate", () => { before(async () => { await deployments.doDeployValidator(); - tokenContract = deployments.getContract("TestKIOS") as ERC20; + tokenContract = deployments.getContract("TestLYT") as ERC20; validatorContract = deployments.getContract("Validator") as Validator; const currencyRateFactory = await ethers.getContractFactory("CurrencyRate"); @@ -58,7 +58,7 @@ describe("Test for CurrencyRate", () => { rate: multiple.mul(1), }, { - symbol: "KIOS", + symbol: "LYT", rate: multiple.mul(150), }, ]; @@ -86,7 +86,7 @@ describe("Test for CurrencyRate", () => { rate: multiple.mul(1), }, { - symbol: "KIOS", + symbol: "LYT", rate: multiple.mul(150), }, ]; @@ -116,7 +116,7 @@ describe("Test for CurrencyRate", () => { rate: multiple.mul(1), }, { - symbol: "KIOS", + symbol: "LYT", rate: multiple.mul(150), }, ]; @@ -146,7 +146,7 @@ describe("Test for CurrencyRate", () => { rate: multiple.mul(1), }, { - symbol: "KIOS", + symbol: "LYT", rate: multiple.mul(150), }, ]; @@ -176,7 +176,7 @@ describe("Test for CurrencyRate", () => { rate: multiple.mul(1), }, { - symbol: "KIOS", + symbol: "LYT", rate: multiple.mul(150), }, ]; @@ -212,7 +212,7 @@ describe("Test for CurrencyRate", () => { rate: multiple.mul(1), }, { - symbol: "KIOS", + symbol: "LYT", rate: multiple.mul(150), }, ]; @@ -245,7 +245,7 @@ describe("Test for CurrencyRate", () => { rate: multiple.mul(1), }, { - symbol: "KIOS", + symbol: "LYT", rate: multiple.mul(150), }, ]; diff --git a/packages/contracts/test/03-Shop.test.ts b/packages/contracts/test/03-Shop.test.ts index a737332f..27ea5cb7 100644 --- a/packages/contracts/test/03-Shop.test.ts +++ b/packages/contracts/test/03-Shop.test.ts @@ -28,7 +28,7 @@ describe("Test for Shop", () => { const deployAllContract = async () => { await deployments.doDeployCurrencyRate(); - tokenContract = deployments.getContract("TestKIOS") as ERC20; + tokenContract = deployments.getContract("TestLYT") as ERC20; validatorContract = deployments.getContract("Validator") as Validator; currencyContract = deployments.getContract("CurrencyRate") as CurrencyRate; }; @@ -107,7 +107,7 @@ describe("Test for Shop", () => { before("Set Shop ID", async () => { for (const elem of shopData) { - elem.shopId = ContractUtils.getShopId(elem.wallet.address, LoyaltyNetworkID.KIOS); + elem.shopId = ContractUtils.getShopId(elem.wallet.address, LoyaltyNetworkID.LYT); } }); diff --git a/packages/contracts/test/04-Ledger.test.ts b/packages/contracts/test/04-Ledger.test.ts index 30731e22..e508e9f7 100644 --- a/packages/contracts/test/04-Ledger.test.ts +++ b/packages/contracts/test/04-Ledger.test.ts @@ -93,7 +93,7 @@ describe("Test for Ledger", () => { const deployAllContract = async (shopData: IShopData[]) => { await deployments.doDeployAll(); - tokenContract = deployments.getContract("TestKIOS") as ERC20; + tokenContract = deployments.getContract("TestLYT") as ERC20; validatorContract = deployments.getContract("Validator") as Validator; currencyContract = deployments.getContract("CurrencyRate") as CurrencyRate; @@ -237,7 +237,7 @@ describe("Test for Ledger", () => { before("Set Shop ID", async () => { for (const elem of shopData) { - elem.shopId = ContractUtils.getShopId(elem.wallet.address, LoyaltyNetworkID.KIOS); + elem.shopId = ContractUtils.getShopId(elem.wallet.address, LoyaltyNetworkID.LYT); } }); @@ -1853,7 +1853,7 @@ describe("Test for Ledger", () => { before("Set Shop ID", async () => { for (const elem of shopData) { - elem.shopId = ContractUtils.getShopId(elem.wallet.address, LoyaltyNetworkID.KIOS); + elem.shopId = ContractUtils.getShopId(elem.wallet.address, LoyaltyNetworkID.LYT); } }); @@ -2012,7 +2012,7 @@ describe("Test for Ledger", () => { before("Set Shop ID", async () => { for (const elem of shopData) { - elem.shopId = ContractUtils.getShopId(elem.wallet.address, LoyaltyNetworkID.KIOS); + elem.shopId = ContractUtils.getShopId(elem.wallet.address, LoyaltyNetworkID.LYT); } }); @@ -2199,7 +2199,7 @@ describe("Test for Ledger", () => { before("Set Shop ID", async () => { for (const elem of shopData) { - elem.shopId = ContractUtils.getShopId(elem.wallet.address, LoyaltyNetworkID.KIOS); + elem.shopId = ContractUtils.getShopId(elem.wallet.address, LoyaltyNetworkID.LYT); } }); @@ -2650,7 +2650,7 @@ describe("Test for Ledger", () => { before("Set Shop ID", async () => { for (const elem of shopData) { - elem.shopId = ContractUtils.getShopId(elem.wallet.address, LoyaltyNetworkID.KIOS); + elem.shopId = ContractUtils.getShopId(elem.wallet.address, LoyaltyNetworkID.LYT); } }); @@ -2883,7 +2883,7 @@ describe("Test for Ledger", () => { before("Set Shop ID", async () => { for (const elem of shopData) { - elem.shopId = ContractUtils.getShopId(elem.wallet.address, LoyaltyNetworkID.KIOS); + elem.shopId = ContractUtils.getShopId(elem.wallet.address, LoyaltyNetworkID.LYT); } }); @@ -3257,7 +3257,7 @@ describe("Test for Ledger", () => { before("Set Shop ID", async () => { for (const elem of shopData) { - elem.shopId = ContractUtils.getShopId(elem.wallet.address, LoyaltyNetworkID.KIOS); + elem.shopId = ContractUtils.getShopId(elem.wallet.address, LoyaltyNetworkID.LYT); } }); @@ -3466,7 +3466,7 @@ describe("Test for Ledger", () => { before("Set Shop ID", async () => { for (const elem of shopData) { - elem.shopId = ContractUtils.getShopId(elem.wallet.address, LoyaltyNetworkID.KIOS); + elem.shopId = ContractUtils.getShopId(elem.wallet.address, LoyaltyNetworkID.LYT); } }); diff --git a/packages/contracts/test/05-Bridge.test.ts b/packages/contracts/test/05-Bridge.test.ts index c77857be..0ec365a7 100644 --- a/packages/contracts/test/05-Bridge.test.ts +++ b/packages/contracts/test/05-Bridge.test.ts @@ -17,7 +17,7 @@ import { LoyaltyTransfer, PhoneLinkCollection, Shop, - TestKIOS, + TestLYT, Validator, } from "../typechain-types"; @@ -71,7 +71,7 @@ describe("Test for Ledger", () => { const deployAllContract = async (shopData: IShopData[]) => { await deployments.doDeployAll(); - tokenContract = deployments.getContract("TestKIOS") as BIP20DelegatedTransfer; + tokenContract = deployments.getContract("TestLYT") as BIP20DelegatedTransfer; validatorContract = deployments.getContract("Validator") as Validator; currencyContract = deployments.getContract("CurrencyRate") as CurrencyRate; diff --git a/packages/contracts/test/06-ShopId.test.ts b/packages/contracts/test/06-ShopId.test.ts index aa25bda6..b257741d 100644 --- a/packages/contracts/test/06-ShopId.test.ts +++ b/packages/contracts/test/06-ShopId.test.ts @@ -5,7 +5,7 @@ import { ContractUtils, LoyaltyNetworkID } from "../src/utils/ContractUtils"; describe("Test for ShopId", () => { it("Shop ID", async () => { - const id = ContractUtils.getShopId("0xeDBFECF2D2D30fDd7b6D1D0975D679976954fF25", LoyaltyNetworkID.KIOS); + const id = ContractUtils.getShopId("0xeDBFECF2D2D30fDd7b6D1D0975D679976954fF25", LoyaltyNetworkID.LYT); console.log(id); }); }); diff --git a/packages/contracts/test/helper/Deployments.ts b/packages/contracts/test/helper/Deployments.ts index ca9f2ff3..5cb7051d 100644 --- a/packages/contracts/test/helper/Deployments.ts +++ b/packages/contracts/test/helper/Deployments.ts @@ -22,7 +22,7 @@ import { LoyaltyTransfer, PhoneLinkCollection, Shop, - TestKIOS, + TestLYT, Validator, } from "../../typechain-types"; @@ -319,17 +319,17 @@ async function deployPhoneLink(accounts: IAccount, deployment: Deployments) { } async function deployToken(accounts: IAccount, deployment: Deployments) { - const contractName = "TestKIOS"; + const contractName = "TestLYT"; console.log(`Deploy ${contractName}...`); - const factory = await ethers.getContractFactory("TestKIOS"); - const contract = (await factory.connect(accounts.deployer).deploy(accounts.owner.address)) as TestKIOS; + const factory = await ethers.getContractFactory("TestLYT"); + const contract = (await factory.connect(accounts.deployer).deploy(accounts.owner.address)) as TestLYT; await contract.deployed(); await contract.deployTransaction.wait(); const balance = await contract.balanceOf(accounts.owner.address); - console.log(`TestKIOS token's owner: ${accounts.owner.address}`); - console.log(`TestKIOS token's balance of owner: ${new BOACoin(balance).toDisplayString(true, 2)}`); + console.log(`TestLYT token's owner: ${accounts.owner.address}`); + console.log(`TestLYT token's balance of owner: ${new BOACoin(balance).toDisplayString(true, 2)}`); deployment.addContract(contractName, contract.address, contract); console.log(`Deployed ${contractName} to ${contract.address}`); @@ -360,7 +360,7 @@ async function deployToken(accounts: IAccount, deployment: Deployments) { async function deployValidator(accounts: IAccount, deployment: Deployments) { const contractName = "Validator"; console.log(`Deploy ${contractName}...`); - if (deployment.getContract("TestKIOS") === undefined) { + if (deployment.getContract("TestLYT") === undefined) { console.error("Contract is not deployed!"); return; } @@ -368,7 +368,7 @@ async function deployValidator(accounts: IAccount, deployment: Deployments) { const factory = await ethers.getContractFactory("Validator"); const contract = (await upgrades.deployProxy( factory.connect(accounts.deployer), - [await deployment.getContractAddress("TestKIOS"), accounts.validators.map((m) => m.address)], + [await deployment.getContractAddress("TestLYT"), accounts.validators.map((m) => m.address)], { initializer: "initialize", kind: "uups", @@ -384,13 +384,13 @@ async function deployValidator(accounts: IAccount, deployment: Deployments) { const depositedToken = Amount.make(100_000, 18); for (const elem of accounts.validators) { - const tx1 = await (deployment.getContract("TestKIOS") as TestKIOS) + const tx1 = await (deployment.getContract("TestLYT") as TestLYT) .connect(accounts.owner) .transfer(elem.address, amount.value); console.log(`Transfer token to validator (tx: ${tx1.hash})...`); await tx1.wait(); - const tx2 = await (deployment.getContract("TestKIOS") as TestKIOS) + const tx2 = await (deployment.getContract("TestLYT") as TestLYT) .connect(elem) .approve(contract.address, depositedToken.value); console.log(`Approve validator's amount (tx: ${tx2.hash})...`); @@ -406,7 +406,7 @@ async function deployValidator(accounts: IAccount, deployment: Deployments) { async function deployCurrencyRate(accounts: IAccount, deployment: Deployments) { const contractName = "CurrencyRate"; console.log(`Deploy ${contractName}...`); - if (deployment.getContract("Validator") === undefined || deployment.getContract("TestKIOS") === undefined) { + if (deployment.getContract("Validator") === undefined || deployment.getContract("TestLYT") === undefined) { console.error("Contract is not deployed!"); return; } @@ -416,7 +416,7 @@ async function deployCurrencyRate(accounts: IAccount, deployment: Deployments) { factory.connect(accounts.deployer), [ await deployment.getContractAddress("Validator"), - await (deployment.getContract("TestKIOS") as TestKIOS).symbol(), + await (deployment.getContract("TestLYT") as TestLYT).symbol(), ], { initializer: "initialize", @@ -433,7 +433,7 @@ async function deployCurrencyRate(accounts: IAccount, deployment: Deployments) { const height = 0; const rates = [ { - symbol: "KIOS", + symbol: "LYT", rate: multiple.mul(150), }, { @@ -618,7 +618,7 @@ async function deployBridge(accounts: IAccount, deployment: Deployments) { console.log(`Deployed ${contractName} to ${contract.address}`); { - const tokenContract = (await deployment.getContract("TestKIOS")) as TestKIOS; + const tokenContract = (await deployment.getContract("TestLYT")) as TestLYT; const tokenId = ContractUtils.getTokenId(await tokenContract.name(), await tokenContract.symbol()); await contract.connect(accounts.deployer).registerToken(tokenId, tokenContract.address); const assetAmount = Amount.make(1_000_000_000, 18).value; @@ -715,7 +715,7 @@ async function deployLedger(accounts: IAccount, deployment: Deployments) { const contractName = "Ledger"; console.log(`Deploy ${contractName}...`); if ( - deployment.getContract("TestKIOS") === undefined || + deployment.getContract("TestLYT") === undefined || deployment.getContract("PhoneLinkCollection") === undefined || deployment.getContract("CurrencyRate") === undefined || deployment.getContract("LoyaltyProvider") === undefined || @@ -741,7 +741,7 @@ async function deployLedger(accounts: IAccount, deployment: Deployments) { txFee: accounts.txFee.address, }, { - token: await deployment.getContractAddress("TestKIOS"), + token: await deployment.getContractAddress("TestLYT"), phoneLink: await deployment.getContractAddress("PhoneLinkCollection"), currencyRate: await deployment.getContractAddress("CurrencyRate"), provider: await deployment.getContractAddress("LoyaltyProvider"), @@ -801,7 +801,7 @@ async function deployLedger(accounts: IAccount, deployment: Deployments) { { const assetAmount = Amount.make(100_000_000, 18); - const tx11 = await (deployment.getContract("TestKIOS") as TestKIOS) + const tx11 = await (deployment.getContract("TestLYT") as TestLYT) .connect(accounts.foundation) .approve(contract.address, assetAmount.value); console.log(`Approve foundation's amount (tx: ${tx11.hash})...`); @@ -812,7 +812,7 @@ async function deployLedger(accounts: IAccount, deployment: Deployments) { await tx12.wait(); } { - const tokenContract = (await deployment.getContract("TestKIOS")) as TestKIOS; + const tokenContract = (await deployment.getContract("TestLYT")) as TestLYT; const tokenId = ContractUtils.getTokenId(await tokenContract.name(), await tokenContract.symbol()); const assetAmount = Amount.make(1_000_000_000, 18).value; const nonce = await tokenContract.nonceOf(accounts.owner.address); diff --git a/packages/faker/contracts/Reference.sol b/packages/faker/contracts/Reference.sol index f6252208..019016d3 100644 --- a/packages/faker/contracts/Reference.sol +++ b/packages/faker/contracts/Reference.sol @@ -12,7 +12,7 @@ import "del-osx-artifacts/contracts/PhoneLinkCollection.sol"; import "dms-osx-artifacts/contracts/ledger/Ledger.sol"; import "dms-osx-artifacts/contracts/shop/Shop.sol"; import "dms-osx-artifacts/contracts/validator/Validator.sol"; -import "dms-osx-artifacts/contracts/token/TestKIOS.sol"; +import "dms-osx-artifacts/contracts/token/TestLYT.sol"; import "dms-bridge-contracts/contracts/bridge/Bridge.sol"; import "dms-bridge-contracts/contracts/bridge/BridgeValidator.sol"; diff --git a/packages/faker/package.json b/packages/faker/package.json index b313d9e0..df7706c2 100644 --- a/packages/faker/package.json +++ b/packages/faker/package.json @@ -52,7 +52,7 @@ "chai": "^4.3.7", "del-osx-artifacts": "^2.3.0", "dms-bridge-contracts": "^1.2.3", - "dms-osx-artifacts": "^2.10.3", + "dms-osx-artifacts": "^2.11.0", "dotenv": "^10.0.0", "ethereum-waffle": "^4.0.10", "ethers": "5.7.0", @@ -60,7 +60,7 @@ "hardhat": "^2.12.7", "hardhat-gas-reporter": "^1.0.7", "ip": "^1.1.5", - "loyalty-tokens": "^1.0.7", + "loyalty-tokens": "^1.1.0", "multisig-wallet-contracts": "^1.1.0", "node-cron": "^3.0.0", "prettier": "^2.5.1", diff --git a/packages/faker/scripts/createShopId.ts b/packages/faker/scripts/createShopId.ts index 25cc6b35..16d6d1f2 100644 --- a/packages/faker/scripts/createShopId.ts +++ b/packages/faker/scripts/createShopId.ts @@ -5,7 +5,7 @@ import { IShopData } from "../src/types"; async function main() { const shops = JSON.parse(fs.readFileSync("./src/data/shops.json", "utf8")) as IShopData[]; for (const shop of shops) { - shop.shopId = ContractUtils.getShopId(shop.address, LoyaltyNetworkID.KIOS); + shop.shopId = ContractUtils.getShopId(shop.address, LoyaltyNetworkID.LYT); } console.log(JSON.stringify(shops)); } diff --git a/packages/faker/src/utils/ContractUtils.ts b/packages/faker/src/utils/ContractUtils.ts index 219aec87..8bc11a66 100644 --- a/packages/faker/src/utils/ContractUtils.ts +++ b/packages/faker/src/utils/ContractUtils.ts @@ -24,7 +24,7 @@ import { verifyMessage } from "@ethersproject/wallet"; import * as hre from "hardhat"; export enum LoyaltyNetworkID { - KIOS, + LYT, PNB, } diff --git a/packages/relay/contracts/Reference.sol b/packages/relay/contracts/Reference.sol index 41e1d112..17468e6e 100644 --- a/packages/relay/contracts/Reference.sol +++ b/packages/relay/contracts/Reference.sol @@ -13,11 +13,11 @@ import "del-osx-artifacts/contracts/PhoneLinkCollection.sol"; import "dms-osx-artifacts/contracts/ledger/Ledger.sol"; import "dms-osx-artifacts/contracts/shop/Shop.sol"; import "dms-osx-artifacts/contracts/validator/Validator.sol"; -import "dms-osx-artifacts/contracts/token/TestKIOS.sol"; +import "dms-osx-artifacts/contracts/token/TestLYT.sol"; import "multisig-wallet-contracts/contracts/MultiSigWalletFactory.sol"; import "multisig-wallet-contracts/contracts/MultiSigWallet.sol"; -import "loyalty-tokens/contracts/KIOS.sol"; +import "loyalty-tokens/contracts/LYT.sol"; import "dms-bridge-contracts/contracts/bridge/Bridge.sol"; import "dms-bridge-contracts/contracts/bridge/BridgeValidator.sol"; diff --git a/packages/relay/package.json b/packages/relay/package.json index e839c9d1..f26560b6 100644 --- a/packages/relay/package.json +++ b/packages/relay/package.json @@ -71,7 +71,7 @@ "cors": "^2.8.5", "del-osx-artifacts": "^2.3.0", "dms-bridge-contracts": "^1.2.3", - "dms-osx-artifacts": "^2.10.3", + "dms-osx-artifacts": "^2.11.0", "dotenv": "^10.0.0", "ethereum-waffle": "^4.0.10", "ethereumjs-util": "^7.1.5", @@ -84,7 +84,7 @@ "hardhat": "^2.12.7", "hardhat-gas-reporter": "^1.0.7", "ip": "^1.1.5", - "loyalty-tokens": "^1.0.7", + "loyalty-tokens": "^1.1.0", "multisig-wallet-contracts": "^1.1.0", "mybatis-mapper": "^0.7.1", "node-cron": "^3.0.0", diff --git a/packages/relay/src/utils/ContractUtils.ts b/packages/relay/src/utils/ContractUtils.ts index 96128ee7..079888a1 100644 --- a/packages/relay/src/utils/ContractUtils.ts +++ b/packages/relay/src/utils/ContractUtils.ts @@ -27,7 +27,7 @@ import * as hre from "hardhat"; import { ethers } from "hardhat"; export enum LoyaltyNetworkID { - KIOS, + LYT, PNB, } export class ContractUtils { diff --git a/packages/relay/test/Approval.test.ts b/packages/relay/test/Approval.test.ts index 2228c20e..9166a70e 100644 --- a/packages/relay/test/Approval.test.ts +++ b/packages/relay/test/Approval.test.ts @@ -130,7 +130,7 @@ describe("Test of Server", function () { await deployments.doDeploy(); validatorContract = deployments.getContract("Validator") as Validator; - tokenContract = deployments.getContract("TestKIOS") as BIP20DelegatedTransfer; + tokenContract = deployments.getContract("TestLYT") as BIP20DelegatedTransfer; ledgerContract = deployments.getContract("Ledger") as Ledger; linkContract = deployments.getContract("PhoneLinkCollection") as PhoneLinkCollection; consumerContract = deployments.getContract("LoyaltyConsumer") as LoyaltyConsumer; @@ -141,7 +141,7 @@ describe("Test of Server", function () { }); before("Create Config", async () => { - config.contracts.sideChain.tokenAddress = deployments.getContractAddress("TestKIOS") || ""; + config.contracts.sideChain.tokenAddress = deployments.getContractAddress("TestLYT") || ""; config.contracts.sideChain.currencyRateAddress = deployments.getContractAddress("CurrencyRate") || ""; config.contracts.sideChain.phoneLinkerAddress = deployments.getContractAddress("PhoneLinkCollection") || ""; config.contracts.sideChain.ledgerAddress = deployments.getContractAddress("Ledger") || ""; diff --git a/packages/relay/test/Bridge.test.ts b/packages/relay/test/Bridge.test.ts index 913558f1..e0378c89 100644 --- a/packages/relay/test/Bridge.test.ts +++ b/packages/relay/test/Bridge.test.ts @@ -50,7 +50,7 @@ describe("Test of Bridge", function () { }); before("Create Config", async () => { - config.contracts.sideChain.tokenAddress = deployments.getContractAddress("TestKIOS") || ""; + config.contracts.sideChain.tokenAddress = deployments.getContractAddress("TestLYT") || ""; config.contracts.sideChain.currencyRateAddress = deployments.getContractAddress("CurrencyRate") || ""; config.contracts.sideChain.phoneLinkerAddress = deployments.getContractAddress("PhoneLinkCollection") || ""; config.contracts.sideChain.ledgerAddress = deployments.getContractAddress("Ledger") || ""; diff --git a/packages/relay/test/DelegatedTransfer.test.ts b/packages/relay/test/DelegatedTransfer.test.ts index 8b3a8ee8..68ccf26c 100644 --- a/packages/relay/test/DelegatedTransfer.test.ts +++ b/packages/relay/test/DelegatedTransfer.test.ts @@ -50,7 +50,7 @@ describe("Test of delegated transfer", function () { }); before("Create Config", async () => { - config.contracts.sideChain.tokenAddress = deployments.getContractAddress("TestKIOS") || ""; + config.contracts.sideChain.tokenAddress = deployments.getContractAddress("TestLYT") || ""; config.contracts.sideChain.currencyRateAddress = deployments.getContractAddress("CurrencyRate") || ""; config.contracts.sideChain.phoneLinkerAddress = deployments.getContractAddress("PhoneLinkCollection") || ""; config.contracts.sideChain.ledgerAddress = deployments.getContractAddress("Ledger") || ""; diff --git a/packages/relay/test/DelegatorApproval.test.ts b/packages/relay/test/DelegatorApproval.test.ts index af891489..ff9b98be 100644 --- a/packages/relay/test/DelegatorApproval.test.ts +++ b/packages/relay/test/DelegatorApproval.test.ts @@ -121,7 +121,7 @@ describe("Test of Delegator", function () { context("Test delegator approval", () => { before("Set Shop ID", async () => { for (const elem of shopData) { - elem.shopId = ContractUtils.getShopId(elem.wallet.address, LoyaltyNetworkID.KIOS); + elem.shopId = ContractUtils.getShopId(elem.wallet.address, LoyaltyNetworkID.LYT); } }); @@ -130,7 +130,7 @@ describe("Test of Delegator", function () { await deployments.doDeploy(); validatorContract = deployments.getContract("Validator") as Validator; - tokenContract = deployments.getContract("TestKIOS") as BIP20DelegatedTransfer; + tokenContract = deployments.getContract("TestLYT") as BIP20DelegatedTransfer; ledgerContract = deployments.getContract("Ledger") as Ledger; linkContract = deployments.getContract("PhoneLinkCollection") as PhoneLinkCollection; consumerContract = deployments.getContract("LoyaltyConsumer") as LoyaltyConsumer; @@ -141,7 +141,7 @@ describe("Test of Delegator", function () { }); before("Create Config", async () => { - config.contracts.sideChain.tokenAddress = deployments.getContractAddress("TestKIOS") || ""; + config.contracts.sideChain.tokenAddress = deployments.getContractAddress("TestLYT") || ""; config.contracts.sideChain.currencyRateAddress = deployments.getContractAddress("CurrencyRate") || ""; config.contracts.sideChain.phoneLinkerAddress = deployments.getContractAddress("PhoneLinkCollection") || ""; config.contracts.sideChain.ledgerAddress = deployments.getContractAddress("Ledger") || ""; diff --git a/packages/relay/test/Endpoints.test.ts b/packages/relay/test/Endpoints.test.ts index 701aa5cb..25e69cdb 100644 --- a/packages/relay/test/Endpoints.test.ts +++ b/packages/relay/test/Endpoints.test.ts @@ -140,7 +140,7 @@ describe("Test of Server", function () { context("Test token & point relay endpoints", () => { before("Set Shop ID", async () => { for (const elem of shopData) { - elem.shopId = ContractUtils.getShopId(elem.wallet.address, LoyaltyNetworkID.KIOS); + elem.shopId = ContractUtils.getShopId(elem.wallet.address, LoyaltyNetworkID.LYT); } }); @@ -149,7 +149,7 @@ describe("Test of Server", function () { await deployments.doDeploy(); validatorContract = deployments.getContract("Validator") as Validator; - tokenContract = deployments.getContract("TestKIOS") as BIP20DelegatedTransfer; + tokenContract = deployments.getContract("TestLYT") as BIP20DelegatedTransfer; ledgerContract = deployments.getContract("Ledger") as Ledger; linkContract = deployments.getContract("PhoneLinkCollection") as PhoneLinkCollection; consumerContract = deployments.getContract("LoyaltyConsumer") as LoyaltyConsumer; @@ -160,7 +160,7 @@ describe("Test of Server", function () { }); before("Create Config", async () => { - config.contracts.sideChain.tokenAddress = deployments.getContractAddress("TestKIOS") || ""; + config.contracts.sideChain.tokenAddress = deployments.getContractAddress("TestLYT") || ""; config.contracts.sideChain.currencyRateAddress = deployments.getContractAddress("CurrencyRate") || ""; config.contracts.sideChain.phoneLinkerAddress = deployments.getContractAddress("PhoneLinkCollection") || ""; config.contracts.sideChain.ledgerAddress = deployments.getContractAddress("Ledger") || ""; @@ -288,7 +288,7 @@ describe("Test of Server", function () { await deployments.doDeploy(); validatorContract = deployments.getContract("Validator") as Validator; - tokenContract = deployments.getContract("TestKIOS") as BIP20DelegatedTransfer; + tokenContract = deployments.getContract("TestLYT") as BIP20DelegatedTransfer; ledgerContract = deployments.getContract("Ledger") as Ledger; linkContract = deployments.getContract("PhoneLinkCollection") as PhoneLinkCollection; consumerContract = deployments.getContract("LoyaltyConsumer") as LoyaltyConsumer; @@ -455,7 +455,7 @@ describe("Test of Server", function () { await deployments.doDeploy(); validatorContract = deployments.getContract("Validator") as Validator; - tokenContract = deployments.getContract("TestKIOS") as BIP20DelegatedTransfer; + tokenContract = deployments.getContract("TestLYT") as BIP20DelegatedTransfer; ledgerContract = deployments.getContract("Ledger") as Ledger; linkContract = deployments.getContract("PhoneLinkCollection") as PhoneLinkCollection; consumerContract = deployments.getContract("LoyaltyConsumer") as LoyaltyConsumer; @@ -466,7 +466,7 @@ describe("Test of Server", function () { }); before("Create Config", async () => { - config.contracts.sideChain.tokenAddress = deployments.getContractAddress("TestKIOS") || ""; + config.contracts.sideChain.tokenAddress = deployments.getContractAddress("TestLYT") || ""; config.contracts.sideChain.currencyRateAddress = deployments.getContractAddress("CurrencyRate") || ""; config.contracts.sideChain.phoneLinkerAddress = deployments.getContractAddress("PhoneLinkCollection") || ""; config.contracts.sideChain.ledgerAddress = deployments.getContractAddress("Ledger") || ""; diff --git a/packages/relay/test/ForcedClose.test.ts b/packages/relay/test/ForcedClose.test.ts index d45c5b82..f546a6bc 100644 --- a/packages/relay/test/ForcedClose.test.ts +++ b/packages/relay/test/ForcedClose.test.ts @@ -122,7 +122,7 @@ describe("Test of Server", function () { await deployments.doDeploy(); validatorContract = deployments.getContract("Validator") as Validator; - tokenContract = deployments.getContract("TestKIOS") as BIP20DelegatedTransfer; + tokenContract = deployments.getContract("TestLYT") as BIP20DelegatedTransfer; ledgerContract = deployments.getContract("Ledger") as Ledger; linkContract = deployments.getContract("PhoneLinkCollection") as PhoneLinkCollection; consumerContract = deployments.getContract("LoyaltyConsumer") as LoyaltyConsumer; @@ -133,7 +133,7 @@ describe("Test of Server", function () { }); before("Create Config", async () => { - config.contracts.sideChain.tokenAddress = deployments.getContractAddress("TestKIOS") || ""; + config.contracts.sideChain.tokenAddress = deployments.getContractAddress("TestLYT") || ""; config.contracts.sideChain.currencyRateAddress = deployments.getContractAddress("CurrencyRate") || ""; config.contracts.sideChain.phoneLinkerAddress = deployments.getContractAddress("PhoneLinkCollection") || ""; config.contracts.sideChain.ledgerAddress = deployments.getContractAddress("Ledger") || ""; @@ -330,7 +330,7 @@ describe("Test of Server", function () { await deployments.doDeploy(); validatorContract = deployments.getContract("Validator") as Validator; - tokenContract = deployments.getContract("TestKIOS") as BIP20DelegatedTransfer; + tokenContract = deployments.getContract("TestLYT") as BIP20DelegatedTransfer; ledgerContract = deployments.getContract("Ledger") as Ledger; linkContract = deployments.getContract("PhoneLinkCollection") as PhoneLinkCollection; consumerContract = deployments.getContract("LoyaltyConsumer") as LoyaltyConsumer; @@ -341,7 +341,7 @@ describe("Test of Server", function () { }); before("Create Config", async () => { - config.contracts.sideChain.tokenAddress = deployments.getContractAddress("TestKIOS") || ""; + config.contracts.sideChain.tokenAddress = deployments.getContractAddress("TestLYT") || ""; config.contracts.sideChain.currencyRateAddress = deployments.getContractAddress("CurrencyRate") || ""; config.contracts.sideChain.phoneLinkerAddress = deployments.getContractAddress("PhoneLinkCollection") || ""; config.contracts.sideChain.ledgerAddress = deployments.getContractAddress("Ledger") || ""; diff --git a/packages/relay/test/LoyaltyBridge.test.ts b/packages/relay/test/LoyaltyBridge.test.ts index d342a690..eb957b87 100644 --- a/packages/relay/test/LoyaltyBridge.test.ts +++ b/packages/relay/test/LoyaltyBridge.test.ts @@ -50,7 +50,7 @@ describe("Test of LoyaltyBridge", function () { }); before("Create Config", async () => { - config.contracts.sideChain.tokenAddress = deployments.getContractAddress("TestKIOS") || ""; + config.contracts.sideChain.tokenAddress = deployments.getContractAddress("TestLYT") || ""; config.contracts.sideChain.currencyRateAddress = deployments.getContractAddress("CurrencyRate") || ""; config.contracts.sideChain.phoneLinkerAddress = deployments.getContractAddress("PhoneLinkCollection") || ""; config.contracts.sideChain.ledgerAddress = deployments.getContractAddress("Ledger") || ""; diff --git a/packages/relay/test/LoyaltyTransfer.test.ts b/packages/relay/test/LoyaltyTransfer.test.ts index 06abf7de..d92a7d8d 100644 --- a/packages/relay/test/LoyaltyTransfer.test.ts +++ b/packages/relay/test/LoyaltyTransfer.test.ts @@ -50,7 +50,7 @@ describe("Test of LoyaltyTransfer", function () { }); before("Create Config", async () => { - config.contracts.sideChain.tokenAddress = deployments.getContractAddress("TestKIOS") || ""; + config.contracts.sideChain.tokenAddress = deployments.getContractAddress("TestLYT") || ""; config.contracts.sideChain.currencyRateAddress = deployments.getContractAddress("CurrencyRate") || ""; config.contracts.sideChain.phoneLinkerAddress = deployments.getContractAddress("PhoneLinkCollection") || ""; config.contracts.sideChain.ledgerAddress = deployments.getContractAddress("Ledger") || ""; diff --git a/packages/relay/test/Payment.test.ts b/packages/relay/test/Payment.test.ts index e247e765..b4918416 100644 --- a/packages/relay/test/Payment.test.ts +++ b/packages/relay/test/Payment.test.ts @@ -156,7 +156,7 @@ describe("Test of Server", function () { context("Test point relay endpoints", () => { before("Set Shop ID", async () => { for (const elem of shopData) { - elem.shopId = ContractUtils.getShopId(elem.wallet.address, LoyaltyNetworkID.KIOS); + elem.shopId = ContractUtils.getShopId(elem.wallet.address, LoyaltyNetworkID.LYT); } }); @@ -165,7 +165,7 @@ describe("Test of Server", function () { await deployments.doDeploy(); validatorContract = deployments.getContract("Validator") as Validator; - tokenContract = deployments.getContract("TestKIOS") as BIP20DelegatedTransfer; + tokenContract = deployments.getContract("TestLYT") as BIP20DelegatedTransfer; ledgerContract = deployments.getContract("Ledger") as Ledger; linkContract = deployments.getContract("PhoneLinkCollection") as PhoneLinkCollection; consumerContract = deployments.getContract("LoyaltyConsumer") as LoyaltyConsumer; @@ -176,7 +176,7 @@ describe("Test of Server", function () { }); before("Create Config", async () => { - config.contracts.sideChain.tokenAddress = deployments.getContractAddress("TestKIOS") || ""; + config.contracts.sideChain.tokenAddress = deployments.getContractAddress("TestLYT") || ""; config.contracts.sideChain.currencyRateAddress = deployments.getContractAddress("CurrencyRate") || ""; config.contracts.sideChain.phoneLinkerAddress = deployments.getContractAddress("PhoneLinkCollection") || ""; config.contracts.sideChain.ledgerAddress = deployments.getContractAddress("Ledger") || ""; @@ -626,7 +626,7 @@ describe("Test of Server", function () { context("Test point relay endpoints - Cancel Confirm", () => { before("Set Shop ID", async () => { for (const elem of shopData) { - elem.shopId = ContractUtils.getShopId(elem.wallet.address, LoyaltyNetworkID.KIOS); + elem.shopId = ContractUtils.getShopId(elem.wallet.address, LoyaltyNetworkID.LYT); } }); @@ -635,7 +635,7 @@ describe("Test of Server", function () { await deployments.doDeploy(); validatorContract = deployments.getContract("Validator") as Validator; - tokenContract = deployments.getContract("TestKIOS") as BIP20DelegatedTransfer; + tokenContract = deployments.getContract("TestLYT") as BIP20DelegatedTransfer; ledgerContract = deployments.getContract("Ledger") as Ledger; linkContract = deployments.getContract("PhoneLinkCollection") as PhoneLinkCollection; consumerContract = deployments.getContract("LoyaltyConsumer") as LoyaltyConsumer; @@ -646,7 +646,7 @@ describe("Test of Server", function () { }); before("Create Config", async () => { - config.contracts.sideChain.tokenAddress = deployments.getContractAddress("TestKIOS") || ""; + config.contracts.sideChain.tokenAddress = deployments.getContractAddress("TestLYT") || ""; config.contracts.sideChain.currencyRateAddress = deployments.getContractAddress("CurrencyRate") || ""; config.contracts.sideChain.phoneLinkerAddress = deployments.getContractAddress("PhoneLinkCollection") || ""; config.contracts.sideChain.ledgerAddress = deployments.getContractAddress("Ledger") || ""; @@ -1021,7 +1021,7 @@ describe("Test of Server", function () { context("Test point relay endpoints - Cancel Deny", () => { before("Set Shop ID", async () => { for (const elem of shopData) { - elem.shopId = ContractUtils.getShopId(elem.wallet.address, LoyaltyNetworkID.KIOS); + elem.shopId = ContractUtils.getShopId(elem.wallet.address, LoyaltyNetworkID.LYT); } }); @@ -1030,7 +1030,7 @@ describe("Test of Server", function () { await deployments.doDeploy(); validatorContract = deployments.getContract("Validator") as Validator; - tokenContract = deployments.getContract("TestKIOS") as BIP20DelegatedTransfer; + tokenContract = deployments.getContract("TestLYT") as BIP20DelegatedTransfer; ledgerContract = deployments.getContract("Ledger") as Ledger; linkContract = deployments.getContract("PhoneLinkCollection") as PhoneLinkCollection; consumerContract = deployments.getContract("LoyaltyConsumer") as LoyaltyConsumer; @@ -1041,7 +1041,7 @@ describe("Test of Server", function () { }); before("Create Config", async () => { - config.contracts.sideChain.tokenAddress = deployments.getContractAddress("TestKIOS") || ""; + config.contracts.sideChain.tokenAddress = deployments.getContractAddress("TestLYT") || ""; config.contracts.sideChain.currencyRateAddress = deployments.getContractAddress("CurrencyRate") || ""; config.contracts.sideChain.phoneLinkerAddress = deployments.getContractAddress("PhoneLinkCollection") || ""; config.contracts.sideChain.ledgerAddress = deployments.getContractAddress("Ledger") || ""; @@ -1380,7 +1380,7 @@ describe("Test of Server", function () { context("Test token relay endpoints", () => { before("Set Shop ID", async () => { for (const elem of shopData) { - elem.shopId = ContractUtils.getShopId(elem.wallet.address, LoyaltyNetworkID.KIOS); + elem.shopId = ContractUtils.getShopId(elem.wallet.address, LoyaltyNetworkID.LYT); } }); @@ -1389,7 +1389,7 @@ describe("Test of Server", function () { await deployments.doDeploy(); validatorContract = deployments.getContract("Validator") as Validator; - tokenContract = deployments.getContract("TestKIOS") as BIP20DelegatedTransfer; + tokenContract = deployments.getContract("TestLYT") as BIP20DelegatedTransfer; ledgerContract = deployments.getContract("Ledger") as Ledger; linkContract = deployments.getContract("PhoneLinkCollection") as PhoneLinkCollection; consumerContract = deployments.getContract("LoyaltyConsumer") as LoyaltyConsumer; @@ -1400,7 +1400,7 @@ describe("Test of Server", function () { }); before("Create Config", async () => { - config.contracts.sideChain.tokenAddress = deployments.getContractAddress("TestKIOS") || ""; + config.contracts.sideChain.tokenAddress = deployments.getContractAddress("TestLYT") || ""; config.contracts.sideChain.currencyRateAddress = deployments.getContractAddress("CurrencyRate") || ""; config.contracts.sideChain.phoneLinkerAddress = deployments.getContractAddress("PhoneLinkCollection") || ""; config.contracts.sideChain.ledgerAddress = deployments.getContractAddress("Ledger") || ""; @@ -1651,7 +1651,7 @@ describe("Test of Server", function () { context("Test token relay endpoints - Cancel Confirm", () => { before("Set Shop ID", async () => { for (const elem of shopData) { - elem.shopId = ContractUtils.getShopId(elem.wallet.address, LoyaltyNetworkID.KIOS); + elem.shopId = ContractUtils.getShopId(elem.wallet.address, LoyaltyNetworkID.LYT); } }); @@ -1660,7 +1660,7 @@ describe("Test of Server", function () { await deployments.doDeploy(); validatorContract = deployments.getContract("Validator") as Validator; - tokenContract = deployments.getContract("TestKIOS") as BIP20DelegatedTransfer; + tokenContract = deployments.getContract("TestLYT") as BIP20DelegatedTransfer; ledgerContract = deployments.getContract("Ledger") as Ledger; linkContract = deployments.getContract("PhoneLinkCollection") as PhoneLinkCollection; consumerContract = deployments.getContract("LoyaltyConsumer") as LoyaltyConsumer; @@ -1671,7 +1671,7 @@ describe("Test of Server", function () { }); before("Create Config", async () => { - config.contracts.sideChain.tokenAddress = deployments.getContractAddress("TestKIOS") || ""; + config.contracts.sideChain.tokenAddress = deployments.getContractAddress("TestLYT") || ""; config.contracts.sideChain.currencyRateAddress = deployments.getContractAddress("CurrencyRate") || ""; config.contracts.sideChain.phoneLinkerAddress = deployments.getContractAddress("PhoneLinkCollection") || ""; config.contracts.sideChain.ledgerAddress = deployments.getContractAddress("Ledger") || ""; @@ -2040,7 +2040,7 @@ describe("Test of Server", function () { context("Test token relay endpoints - Cancel Deny", () => { before("Set Shop ID", async () => { for (const elem of shopData) { - elem.shopId = ContractUtils.getShopId(elem.wallet.address, LoyaltyNetworkID.KIOS); + elem.shopId = ContractUtils.getShopId(elem.wallet.address, LoyaltyNetworkID.LYT); } }); @@ -2049,7 +2049,7 @@ describe("Test of Server", function () { await deployments.doDeploy(); validatorContract = deployments.getContract("Validator") as Validator; - tokenContract = deployments.getContract("TestKIOS") as BIP20DelegatedTransfer; + tokenContract = deployments.getContract("TestLYT") as BIP20DelegatedTransfer; ledgerContract = deployments.getContract("Ledger") as Ledger; linkContract = deployments.getContract("PhoneLinkCollection") as PhoneLinkCollection; consumerContract = deployments.getContract("LoyaltyConsumer") as LoyaltyConsumer; @@ -2060,7 +2060,7 @@ describe("Test of Server", function () { }); before("Create Config", async () => { - config.contracts.sideChain.tokenAddress = deployments.getContractAddress("TestKIOS") || ""; + config.contracts.sideChain.tokenAddress = deployments.getContractAddress("TestLYT") || ""; config.contracts.sideChain.currencyRateAddress = deployments.getContractAddress("CurrencyRate") || ""; config.contracts.sideChain.phoneLinkerAddress = deployments.getContractAddress("PhoneLinkCollection") || ""; config.contracts.sideChain.ledgerAddress = deployments.getContractAddress("Ledger") || ""; @@ -2494,7 +2494,7 @@ describe("Test of Server", function () { before("Set Shop ID", async () => { for (const elem of shopData) { - elem.shopId = ContractUtils.getShopId(elem.wallet.address, LoyaltyNetworkID.KIOS); + elem.shopId = ContractUtils.getShopId(elem.wallet.address, LoyaltyNetworkID.LYT); } }); @@ -2503,7 +2503,7 @@ describe("Test of Server", function () { await deployments.doDeploy(); validatorContract = deployments.getContract("Validator") as Validator; - tokenContract = deployments.getContract("TestKIOS") as BIP20DelegatedTransfer; + tokenContract = deployments.getContract("TestLYT") as BIP20DelegatedTransfer; ledgerContract = deployments.getContract("Ledger") as Ledger; linkContract = deployments.getContract("PhoneLinkCollection") as PhoneLinkCollection; consumerContract = deployments.getContract("LoyaltyConsumer") as LoyaltyConsumer; @@ -2514,7 +2514,7 @@ describe("Test of Server", function () { }); before("Create Config", async () => { - config.contracts.sideChain.tokenAddress = deployments.getContractAddress("TestKIOS") || ""; + config.contracts.sideChain.tokenAddress = deployments.getContractAddress("TestLYT") || ""; config.contracts.sideChain.currencyRateAddress = deployments.getContractAddress("CurrencyRate") || ""; config.contracts.sideChain.phoneLinkerAddress = deployments.getContractAddress("PhoneLinkCollection") || ""; config.contracts.sideChain.ledgerAddress = deployments.getContractAddress("Ledger") || ""; diff --git a/packages/relay/test/Shop.test.ts b/packages/relay/test/Shop.test.ts index e08ee917..23bbb720 100644 --- a/packages/relay/test/Shop.test.ts +++ b/packages/relay/test/Shop.test.ts @@ -114,7 +114,7 @@ describe("Test for Shop", function () { before("Set Shop ID", async () => { for (const elem of shopData) { - elem.shopId = ContractUtils.getShopId(elem.wallet.address, LoyaltyNetworkID.KIOS); + elem.shopId = ContractUtils.getShopId(elem.wallet.address, LoyaltyNetworkID.LYT); } }); @@ -122,7 +122,7 @@ describe("Test for Shop", function () { await deployments.doDeploy(); validatorContract = deployments.getContract("Validator") as Validator; - tokenContract = deployments.getContract("TestKIOS") as BIP20DelegatedTransfer; + tokenContract = deployments.getContract("TestLYT") as BIP20DelegatedTransfer; ledgerContract = deployments.getContract("Ledger") as Ledger; linkContract = deployments.getContract("PhoneLinkCollection") as PhoneLinkCollection; consumerContract = deployments.getContract("LoyaltyConsumer") as LoyaltyConsumer; @@ -133,7 +133,7 @@ describe("Test for Shop", function () { }); before("Create Config", async () => { - config.contracts.sideChain.tokenAddress = deployments.getContractAddress("TestKIOS") || ""; + config.contracts.sideChain.tokenAddress = deployments.getContractAddress("TestLYT") || ""; config.contracts.sideChain.currencyRateAddress = deployments.getContractAddress("CurrencyRate") || ""; config.contracts.sideChain.phoneLinkerAddress = deployments.getContractAddress("PhoneLinkCollection") || ""; config.contracts.sideChain.ledgerAddress = deployments.getContractAddress("Ledger") || ""; diff --git a/packages/relay/test/ShopWithdraw.test.ts b/packages/relay/test/ShopWithdraw.test.ts index 8809acd7..8d8ce007 100644 --- a/packages/relay/test/ShopWithdraw.test.ts +++ b/packages/relay/test/ShopWithdraw.test.ts @@ -208,7 +208,7 @@ describe("Test for Shop", () => { before("Set Shop ID", async () => { for (const elem of shopData) { - elem.shopId = ContractUtils.getShopId(elem.wallet.address, LoyaltyNetworkID.KIOS); + elem.shopId = ContractUtils.getShopId(elem.wallet.address, LoyaltyNetworkID.LYT); } }); @@ -217,7 +217,7 @@ describe("Test for Shop", () => { await deployments.doDeploy(); validatorContract = deployments.getContract("Validator") as Validator; - tokenContract = deployments.getContract("TestKIOS") as BIP20DelegatedTransfer; + tokenContract = deployments.getContract("TestLYT") as BIP20DelegatedTransfer; ledgerContract = deployments.getContract("Ledger") as Ledger; linkContract = deployments.getContract("PhoneLinkCollection") as PhoneLinkCollection; consumerContract = deployments.getContract("LoyaltyConsumer") as LoyaltyConsumer; @@ -228,7 +228,7 @@ describe("Test for Shop", () => { }); before("Create Config", async () => { - config.contracts.sideChain.tokenAddress = deployments.getContractAddress("TestKIOS") || ""; + config.contracts.sideChain.tokenAddress = deployments.getContractAddress("TestLYT") || ""; config.contracts.sideChain.currencyRateAddress = deployments.getContractAddress("CurrencyRate") || ""; config.contracts.sideChain.phoneLinkerAddress = deployments.getContractAddress("PhoneLinkCollection") || ""; config.contracts.sideChain.ledgerAddress = deployments.getContractAddress("Ledger") || ""; diff --git a/packages/relay/test/TempararyAccount.test.ts b/packages/relay/test/TempararyAccount.test.ts index 0ba175eb..fb10c7b2 100644 --- a/packages/relay/test/TempararyAccount.test.ts +++ b/packages/relay/test/TempararyAccount.test.ts @@ -157,7 +157,7 @@ describe("Test of Server", function () { context("Test point relay endpoints", () => { before("Set Shop ID", async () => { for (const elem of shopData) { - elem.shopId = ContractUtils.getShopId(elem.wallet.address, LoyaltyNetworkID.KIOS); + elem.shopId = ContractUtils.getShopId(elem.wallet.address, LoyaltyNetworkID.LYT); } }); @@ -166,7 +166,7 @@ describe("Test of Server", function () { await deployments.doDeploy(); validatorContract = deployments.getContract("Validator") as Validator; - tokenContract = deployments.getContract("TestKIOS") as BIP20DelegatedTransfer; + tokenContract = deployments.getContract("TestLYT") as BIP20DelegatedTransfer; ledgerContract = deployments.getContract("Ledger") as Ledger; linkContract = deployments.getContract("PhoneLinkCollection") as PhoneLinkCollection; consumerContract = deployments.getContract("LoyaltyConsumer") as LoyaltyConsumer; @@ -177,7 +177,7 @@ describe("Test of Server", function () { }); before("Create Config", async () => { - config.contracts.sideChain.tokenAddress = deployments.getContractAddress("TestKIOS") || ""; + config.contracts.sideChain.tokenAddress = deployments.getContractAddress("TestLYT") || ""; config.contracts.sideChain.currencyRateAddress = deployments.getContractAddress("CurrencyRate") || ""; config.contracts.sideChain.phoneLinkerAddress = deployments.getContractAddress("PhoneLinkCollection") || ""; config.contracts.sideChain.ledgerAddress = deployments.getContractAddress("Ledger") || ""; diff --git a/packages/relay/test/helper/Deployments.ts b/packages/relay/test/helper/Deployments.ts index 03dbb87d..8d9fe182 100644 --- a/packages/relay/test/helper/Deployments.ts +++ b/packages/relay/test/helper/Deployments.ts @@ -21,7 +21,7 @@ import { LoyaltyTransfer, PhoneLinkCollection, Shop, - TestKIOS, + TestLYT, Validator, } from "../../typechain-types"; @@ -263,18 +263,18 @@ async function deployPhoneLink(accounts: IAccount, deployment: Deployments) { } async function deployToken(accounts: IAccount, deployment: Deployments) { - const contractName = "TestKIOS"; + const contractName = "TestLYT"; console.log(`Deploy ${contractName}...`); await hre.changeNetwork(deployment.config.contracts.sideChain.network); - const factory = await hre.ethers.getContractFactory("TestKIOS"); - const contract = (await factory.connect(accounts.deployer).deploy(accounts.owner.address)) as TestKIOS; + const factory = await hre.ethers.getContractFactory("TestLYT"); + const contract = (await factory.connect(accounts.deployer).deploy(accounts.owner.address)) as TestLYT; await contract.deployed(); await contract.deployTransaction.wait(); const balance = await contract.balanceOf(accounts.owner.address); - console.log(`TestKIOS token's owner: ${accounts.owner.address}`); - console.log(`TestKIOS token's balance of owner: ${new BOACoin(balance).toDisplayString(true, 2)}`); + console.log(`TestLYT token's owner: ${accounts.owner.address}`); + console.log(`TestLYT token's balance of owner: ${new BOACoin(balance).toDisplayString(true, 2)}`); deployment.addContract(contractName, contract.address, contract); console.log(`Deployed ${contractName} to ${contract.address}`); @@ -305,7 +305,7 @@ async function deployToken(accounts: IAccount, deployment: Deployments) { async function deployValidator(accounts: IAccount, deployment: Deployments) { const contractName = "Validator"; console.log(`Deploy ${contractName}...`); - if (deployment.getContract("TestKIOS") === undefined) { + if (deployment.getContract("TestLYT") === undefined) { console.error("Contract is not deployed!"); return; } @@ -314,7 +314,7 @@ async function deployValidator(accounts: IAccount, deployment: Deployments) { const factory = await hre.ethers.getContractFactory("Validator"); const contract = (await hre.upgrades.deployProxy( factory.connect(accounts.deployer), - [await deployment.getContractAddress("TestKIOS"), accounts.validators.map((m) => m.address)], + [await deployment.getContractAddress("TestLYT"), accounts.validators.map((m) => m.address)], { initializer: "initialize", kind: "uups", @@ -330,13 +330,13 @@ async function deployValidator(accounts: IAccount, deployment: Deployments) { const depositedToken = Amount.make(100_000, 18); for (const elem of accounts.validators) { - const tx1 = await (deployment.getContract("TestKIOS") as TestKIOS) + const tx1 = await (deployment.getContract("TestLYT") as TestLYT) .connect(accounts.owner) .transfer(elem.address, amount.value); console.log(`Transfer token to validator (tx: ${tx1.hash})...`); await tx1.wait(); - const tx2 = await (deployment.getContract("TestKIOS") as TestKIOS) + const tx2 = await (deployment.getContract("TestLYT") as TestLYT) .connect(elem) .approve(contract.address, depositedToken.value); console.log(`Approve validator's amount (tx: ${tx2.hash})...`); @@ -352,7 +352,7 @@ async function deployValidator(accounts: IAccount, deployment: Deployments) { async function deployCurrencyRate(accounts: IAccount, deployment: Deployments) { const contractName = "CurrencyRate"; console.log(`Deploy ${contractName}...`); - if (deployment.getContract("Validator") === undefined || deployment.getContract("TestKIOS") === undefined) { + if (deployment.getContract("Validator") === undefined || deployment.getContract("TestLYT") === undefined) { console.error("Contract is not deployed!"); return; } @@ -363,7 +363,7 @@ async function deployCurrencyRate(accounts: IAccount, deployment: Deployments) { factory.connect(accounts.deployer), [ await deployment.getContractAddress("Validator"), - await (deployment.getContract("TestKIOS") as TestKIOS).symbol(), + await (deployment.getContract("TestLYT") as TestLYT).symbol(), ], { initializer: "initialize", @@ -380,7 +380,7 @@ async function deployCurrencyRate(accounts: IAccount, deployment: Deployments) { const height = 0; const rates = [ { - symbol: "KIOS", + symbol: "LYT", rate: multiple.mul(150), }, { @@ -574,11 +574,11 @@ async function deploySideChainBridge(accounts: IAccount, deployment: Deployments const chainId = (await hre.ethers.provider.getNetwork()).chainId; { - const tokenContract = (await deployment.getContract("TestKIOS")) as TestKIOS; + const tokenContract = (await deployment.getContract("TestLYT")) as TestLYT; const tokenId = ContractUtils.getTokenId(await tokenContract.name(), await tokenContract.symbol()); await contract.connect(accounts.deployer).registerToken(tokenId, tokenContract.address); const assetAmount = Amount.make(1_000_000_000, 18).value; - const nonce = await (deployment.getContract("TestKIOS") as TestKIOS).nonceOf(accounts.owner.address); + const nonce = await (deployment.getContract("TestLYT") as TestLYT).nonceOf(accounts.owner.address); const message = ContractUtils.getTransferMessage( accounts.owner.address, contract.address, @@ -679,7 +679,7 @@ async function deployLedger(accounts: IAccount, deployment: Deployments) { const contractName = "Ledger"; console.log(`Deploy ${contractName}...`); if ( - deployment.getContract("TestKIOS") === undefined || + deployment.getContract("TestLYT") === undefined || deployment.getContract("PhoneLinkCollection") === undefined || deployment.getContract("CurrencyRate") === undefined || deployment.getContract("LoyaltyProvider") === undefined || @@ -705,7 +705,7 @@ async function deployLedger(accounts: IAccount, deployment: Deployments) { txFee: accounts.txFee.address, }, { - token: await deployment.getContractAddress("TestKIOS"), + token: await deployment.getContractAddress("TestLYT"), phoneLink: await deployment.getContractAddress("PhoneLinkCollection"), currencyRate: await deployment.getContractAddress("CurrencyRate"), provider: await deployment.getContractAddress("LoyaltyProvider"), @@ -765,7 +765,7 @@ async function deployLedger(accounts: IAccount, deployment: Deployments) { { const assetAmount = Amount.make(100_000_000, 18); - const tx11 = await (deployment.getContract("TestKIOS") as TestKIOS) + const tx11 = await (deployment.getContract("TestLYT") as TestLYT) .connect(accounts.foundation) .approve(contract.address, assetAmount.value); console.log(`Approve foundation's amount (tx: ${tx11.hash})...`); @@ -777,10 +777,10 @@ async function deployLedger(accounts: IAccount, deployment: Deployments) { } const chainId = (await hre.ethers.provider.getNetwork()).chainId; { - const tokenContract = (await deployment.getContract("TestKIOS")) as TestKIOS; + const tokenContract = (await deployment.getContract("TestLYT")) as TestLYT; const tokenId = ContractUtils.getTokenId(await tokenContract.name(), await tokenContract.symbol()); const assetAmount = Amount.make(1_000_000_000, 18).value; - const nonce = await (deployment.getContract("TestKIOS") as TestKIOS).nonceOf(accounts.owner.address); + const nonce = await (deployment.getContract("TestLYT") as TestLYT).nonceOf(accounts.owner.address); const message = ContractUtils.getTransferMessage( accounts.owner.address, contract.address, @@ -800,8 +800,8 @@ async function deployMainChainToken(accounts: IAccount, deployment: Deployments) console.log(`Deploy ${contractName}...`); await hre.changeNetwork(deployment.config.contracts.mainChain.network); - const factory = await hre.ethers.getContractFactory("TestKIOS"); - const contract = (await factory.connect(accounts.deployer).deploy(accounts.owner.address)) as TestKIOS; + const factory = await hre.ethers.getContractFactory("TestLYT"); + const contract = (await factory.connect(accounts.deployer).deploy(accounts.owner.address)) as TestLYT; await contract.deployed(); await contract.deployTransaction.wait(); @@ -856,7 +856,7 @@ async function deployMainChainBridge(accounts: IAccount, deployment: Deployments const chainId = (await hre.ethers.provider.getNetwork()).chainId; { - const tokenContract = (await deployment.getContract("MainChainKIOS")) as TestKIOS; + const tokenContract = (await deployment.getContract("MainChainKIOS")) as TestLYT; const tokenId = ContractUtils.getTokenId(await tokenContract.name(), await tokenContract.symbol()); await contract.connect(accounts.deployer).registerToken(tokenId, tokenContract.address); const assetAmount = Amount.make(8_000_000_000, 18).value; @@ -901,7 +901,7 @@ async function deployMainChainLoyaltyBridge(accounts: IAccount, deployment: Depl const chainId = (await hre.ethers.provider.getNetwork()).chainId; { - const tokenContract = (await deployment.getContract("MainChainKIOS")) as TestKIOS; + const tokenContract = (await deployment.getContract("MainChainKIOS")) as TestLYT; const tokenId = ContractUtils.getTokenId(await tokenContract.name(), await tokenContract.symbol()); await contract.connect(accounts.deployer).registerToken(tokenId, tokenContract.address); const assetAmount = Amount.make(1_000_000_000, 18).value; diff --git a/yarn.lock b/yarn.lock index e1d60c6b..46c245de 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6002,10 +6002,10 @@ loupe@^2.3.1: dependencies: get-func-name "^2.0.0" -loyalty-tokens@^1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/loyalty-tokens/-/loyalty-tokens-1.0.7.tgz#e2fdee4068fa401de91161c3ce90079081fef2e5" - integrity sha512-ZYRSUBc3DuBTipUHyncQeYGUsgev0E5py083XgIf0tFS3y6mpq2/lV3RKeHkpMv3bZ3CqU3YhfkL8BlZr7tX8g== +loyalty-tokens@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/loyalty-tokens/-/loyalty-tokens-1.1.0.tgz#466d5afb299699201b241674247dbbbb5087edb5" + integrity sha512-AtWw5Jc/rBy76TF9Dqo+LGBzSBC4Qlz7Z0xnKRKqsWUxlG29YjuaJ6uoZhkBNthx2HxbDD7RCDgFdAO9G9aSKA== lru-cache@^5.1.1: version "5.1.1"