Skip to content

Commit

Permalink
Change the token KIOS to LYT
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelKim20 committed Apr 3, 2024
1 parent e95d841 commit 3a84301
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Introduction

This project contains the smart contract source code of the loyalty tokens and the codes related to the distribution
This project contains the smart contract source code of the loyalty coin(LYT)

## Install NodeJS

Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Introduction

This project contains the smart contract source code of the loyalty tokens and the codes related to the distribution
This project contains the smart contract source code of the loyalty coin(LYT)

## Install NodeJS

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ pragma solidity ^0.8.2;

import "./LoyaltyToken.sol";

contract KIOS is LoyaltyToken {
contract LYT is LoyaltyToken {
/*
* Public functions
*/
constructor(address account_) LoyaltyToken("KIOS", "KIOS", account_, 1e10 * 1e18) {}
constructor(address account_) LoyaltyToken("Loyalty Coin", "LYT", account_, 1e10 * 1e18) {}
}
12 changes: 6 additions & 6 deletions packages/contracts/deploy/main_chain_devnet/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ethers } from "hardhat";
import { HardhatAccount } from "../../src/HardhatAccount";
import { BOACoin } from "../../src/utils/Amount";
import { ContractUtils } from "../../src/utils/ContractUtils";
import { KIOS, MultiSigWallet, MultiSigWalletFactory } from "../../typechain-types";
import { LYT, MultiSigWallet, MultiSigWalletFactory } from "../../typechain-types";

import { BaseContract, Contract, Wallet } from "ethers";

Expand Down Expand Up @@ -186,24 +186,24 @@ async function deployMultiSigWallet(accounts: IAccount, deployment: Deployments)
}

async function deployToken(accounts: IAccount, deployment: Deployments) {
const contractName = "KIOS";
const contractName = "LYT";
console.log(`Deploy ${contractName}...`);
if (deployment.getContract("MultiSigWallet") === undefined) {
console.error("Contract is not deployed!");
return;
}

const factory = await ethers.getContractFactory("KIOS");
const factory = await ethers.getContractFactory("LYT");
const contract = (await factory
.connect(accounts.deployer)
.deploy(deployment.getContractAddress("MultiSigWallet"))) as KIOS;
.deploy(deployment.getContractAddress("MultiSigWallet"))) as LYT;
await contract.deployed();
await contract.deployTransaction.wait();

const owner = await contract.getOwner();
const balance = await contract.balanceOf(owner);
console.log(`KIOS token's owner: ${owner}`);
console.log(`KIOS token's balance of owner: ${new BOACoin(balance).toDisplayString(true, 2)}`);
console.log(`LYT token's owner: ${owner}`);
console.log(`LYT token's balance of owner: ${new BOACoin(balance).toDisplayString(true, 2)}`);

deployment.addContract(contractName, contract.address, contract);
console.log(`Deployed ${contractName} to ${contract.address}`);
Expand Down
12 changes: 6 additions & 6 deletions packages/contracts/deploy/side_chain_devnet/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ethers } from "hardhat";
import { HardhatAccount } from "../../src/HardhatAccount";
import { BOACoin } from "../../src/utils/Amount";
import { ContractUtils } from "../../src/utils/ContractUtils";
import { KIOS, MultiSigWallet, MultiSigWalletFactory } from "../../typechain-types";
import { LYT, MultiSigWallet, MultiSigWalletFactory } from "../../typechain-types";

import { BaseContract, Contract, Wallet } from "ethers";

Expand Down Expand Up @@ -186,24 +186,24 @@ async function deployMultiSigWallet(accounts: IAccount, deployment: Deployments)
}

async function deployToken(accounts: IAccount, deployment: Deployments) {
const contractName = "KIOS";
const contractName = "LYT";
console.log(`Deploy ${contractName}...`);
if (deployment.getContract("MultiSigWallet") === undefined) {
console.error("Contract is not deployed!");
return;
}

const factory = await ethers.getContractFactory("KIOS");
const factory = await ethers.getContractFactory("LYT");
const contract = (await factory
.connect(accounts.deployer)
.deploy(deployment.getContractAddress("MultiSigWallet"))) as KIOS;
.deploy(deployment.getContractAddress("MultiSigWallet"))) as LYT;
await contract.deployed();
await contract.deployTransaction.wait();

const owner = await contract.getOwner();
const balance = await contract.balanceOf(owner);
console.log(`KIOS token's owner: ${owner}`);
console.log(`KIOS token's balance of owner: ${new BOACoin(balance).toDisplayString(true, 2)}`);
console.log(`LYT token's owner: ${owner}`);
console.log(`LYT token's balance of owner: ${new BOACoin(balance).toDisplayString(true, 2)}`);

deployment.addContract(contractName, contract.address, contract);
console.log(`Deployed ${contractName} to ${contract.address}`);
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "loyalty-tokens",
"version": "1.0.7",
"version": "1.1.0",
"description": "Smart contracts for the loyalty tokens",
"files": [
"**/*.sol"
Expand Down
12 changes: 6 additions & 6 deletions packages/contracts/test/DelegatedTransfer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import "@nomiclabs/hardhat-waffle";
import { ethers } from "hardhat";

import { HardhatAccount } from "../src/HardhatAccount";
import { KIOS, MultiSigWallet, MultiSigWalletFactory } from "../typechain-types";
import { LYT, MultiSigWallet, MultiSigWalletFactory } from "../typechain-types";

import assert from "assert";
import { BigNumber, Wallet } from "ethers";
Expand Down Expand Up @@ -41,22 +41,22 @@ async function deployMultiSigWallet(
: undefined;
}

async function deployToken(deployer: Wallet, owner: string): Promise<KIOS> {
const factory = await ethers.getContractFactory("KIOS");
const contract = (await factory.connect(deployer).deploy(owner)) as KIOS;
async function deployToken(deployer: Wallet, owner: string): Promise<LYT> {
const factory = await ethers.getContractFactory("LYT");
const contract = (await factory.connect(deployer).deploy(owner)) as LYT;
await contract.deployed();
await contract.deployTransaction.wait();
return contract;
}

describe("Test for KIOS token", () => {
describe("Test for LYT token", () => {
const raws = HardhatAccount.keys.map((m) => new Wallet(m, ethers.provider));
const [deployer, account0, account1, account2, account3, account4, account5] = raws;
const owners1 = [account0, account1, account2];

let multiSigFactory: MultiSigWalletFactory;
let multiSigWallet: MultiSigWallet | undefined;
let token: KIOS;
let token: LYT;
const requiredConfirmations = 2;

before(async () => {
Expand Down
14 changes: 7 additions & 7 deletions packages/contracts/test/MultiSigToken.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import "@nomiclabs/hardhat-waffle";
import { ethers } from "hardhat";

import { HardhatAccount } from "../src/HardhatAccount";
import { KIOS, MultiSigWallet, MultiSigWalletFactory } from "../typechain-types";
import { LYT, MultiSigWallet, MultiSigWalletFactory } from "../typechain-types";

import assert from "assert";
import { BigNumber, Wallet } from "ethers";
Expand Down Expand Up @@ -40,22 +40,22 @@ async function deployMultiSigWallet(
: undefined;
}

async function deployToken(deployer: Wallet, owner: string): Promise<KIOS> {
const factory = await ethers.getContractFactory("KIOS");
const contract = (await factory.connect(deployer).deploy(owner)) as KIOS;
async function deployToken(deployer: Wallet, owner: string): Promise<LYT> {
const factory = await ethers.getContractFactory("LYT");
const contract = (await factory.connect(deployer).deploy(owner)) as LYT;
await contract.deployed();
await contract.deployTransaction.wait();
return contract;
}

describe("Test for KIOS token", () => {
describe("Test for LYT token", () => {
const raws = HardhatAccount.keys.map((m) => new Wallet(m, ethers.provider));
const [deployer, account0, account1, account2, account3, account4] = raws;
const owners1 = [account0, account1, account2];

let multiSigFactory: MultiSigWalletFactory;
let multiSigWallet: MultiSigWallet | undefined;
let token: KIOS;
let token: LYT;
const requiredConfirmations = 2;

before(async () => {
Expand Down Expand Up @@ -83,7 +83,7 @@ describe("Test for KIOS token", () => {
});

it("Create Token, Owner is wallet", async () => {
const factory = await ethers.getContractFactory("KIOS");
const factory = await ethers.getContractFactory("LYT");
await expect(factory.connect(deployer).deploy(account0.address)).to.be.revertedWith(
"function call to a non-contract account"
);
Expand Down

0 comments on commit 3a84301

Please sign in to comment.