Skip to content

Commit

Permalink
Merge pull request #2 from kaiachain/feat/kaiachanges
Browse files Browse the repository at this point in the history
Feat/kaiachanges
  • Loading branch information
praveen-kaia authored Aug 8, 2024
2 parents 837169d + 993b507 commit 082a59c
Show file tree
Hide file tree
Showing 30 changed files with 664 additions and 1,170 deletions.
File renamed without changes.
21 changes: 14 additions & 7 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
# Make sure the first address is funded with Test KAIA faucets https://developer.kaia.io/faucet
MNEMONIC=<Paste your mnemonic here>

# Params for Hahrdhat network forking
FORKING=<true/false> # whether start an instance of Hardhat Network that forks a network usign provided fork url below or not
FORKING_URL=<archive node RPC endpoint> # url of the archive node to fork in case if FORKING is true
# The following url https://cypress.fandom.finance/archive can be used to fork Klaytn Cypress Mainnet
REPORT_GAS=<true/false> # whether gas reporter should be enabled for tests or not
# FORKING - whether start an instance of Hardhat Network that forks a network usign provided fork url below or not
FORKING=<true/false>
# FORKING_URL - url of the archive node to fork in case if FORKING is true
FORKING_URL=<archive node RPC endpoint>
# The following url https://archive-en-kairos.node.kaia.io can be used to fork Kaia Mainnet. For more info check here https://docs.kaia.io/references/public-en/
# REPORT_GAS - whether gas reporter should be enabled for tests or not
REPORT_GAS=<true/false>

# The following parameters are to be set in case of deploying
ADMIN_LIST=["<address0>", "<address1>", "<address2>"] # list of admin addresses for multisig contract
SIG_REQUIRED=<x> # number of signatures required for multisig contract(ex: 2), should be less than or equal to the number of # admin addresses in <ADMIN_LIST>
REWARD_PER_BLOCK=<x> # reward per block for farming contract, param should be set in wei
# ADMIN_LIST - list of admin addresses for multisig contract
ADMIN_LIST=["<address0>", "<address1>", "<address2>"]
# SIG_REQUIRED - number of signatures required for multisig contract(ex: 2), should be less than or equal to the number of # admin addresses in <ADMIN_LIST>
SIG_REQUIRED=<x>
# REWARD_PER_BLOCK - reward per block for farming contract, param should be set in wei
REWARD_PER_BLOCK=<x>
9 changes: 3 additions & 6 deletions .github/workflows/CLA.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ on:
jobs:
CLAssistant:
runs-on: ubuntu-latest
permissions:
actions: write
pull-requests: write
steps:
- name: "CLA Assistant"
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
Expand All @@ -20,7 +17,7 @@ jobs:
PERSONAL_ACCESS_TOKEN: ${{ secrets.CLA_PERSONAL_ACCESS_TOKEN }}
with:
path-to-signatures: "${{ github.event.repository.name }}/signatures/version1/cla.json"
path-to-document: "https://gist.github.com/e78f99e1c527225637e269cff1bc7e49" # Klaytn Gist
branch: "master"
path-to-document: "https://gist.github.com/kaiachain-dev/bbf65cc330275c057463c4c94ce787a6" # Kaia Gist
branch: "main"
allowlist: dependabot[bot]
remote-repository-name: ${{ secrets.CLA_REPOSITORY }}
remote-repository-name: ${{ secrets.CLA_REPOSITORY }}
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
16.20.2
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ representative at an online or offline event.
## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the project maintainers responsible for enforcement at developer@klaytn.foundation.
reported to the project maintainers responsible for enforcement at developer@kaia.io.
All complaints will be reviewed and investigated promptly and fairly.

All project maintainers are obligated to respect the privacy and security of the
Expand Down
18 changes: 9 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Contributing Guidelines

Thank you for your interest in contributing to Klaytn. As an open source project, Klaytn is always open to the developer community and we welcome your contribution to help more developer onboarding resources for the Klaytn developer community. Please read the guideline below and follow it in all interactions with the project.
Thank you for your interest in contributing to Kaia. As an open source project, Kaia is always open to the developer community and we welcome your contribution to help more developer onboarding resources for the Kaia developer community. Please read the guideline below and follow it in all interactions with the project.

## How to Contribute on Klaytn
## How to Contribute on Kaia

1. Read this [contributing document](./CONTRIBUTING.md).
2. Sign [Contributor Licensing Agreement (CLA)](#contributor-license-agreement-cla).
Expand All @@ -22,24 +22,24 @@ There are various ways to contribute and participate. Please read the guidelines

### Issues and Bugs

If you find a bug or other issues in klaytn-dex-contracts, please [submit an issue](https://github.com/klaytn/klaytn-dex-contracts/issues). Before submitting an issue, please invest some extra time to figure out that:
If you find a bug or other issues in open-dex-contracts, please [submit an issue](https://github.com/kaiachain/open-dex-contracts/issues). Before submitting an issue, please invest some extra time to figure out that:

- The issue is not a duplicate issue.
- The issue has not been fixed in the latest release of klaytn-dex-contracts.
Please do not use the issue tracker for personal support requests. Use developer@klaytn.foundation for the personal support requests.
- The issue has not been fixed in the latest release of open-dex-contracts.
Please do not use the issue tracker for personal support requests. Use developer@kaia.io for the personal support requests.

When you report a bug, please make sure that your report has the following information.
- Steps to reproduce the issue.
- A clear and complete description of the issue.
- Code and/or screen captures are highly recommended.

After confirming your report meets the above criteria, [submit the issue](https://github.com/klaytn/klaytn-dex-contracts/issues). Please use [labels](#usage-of-labels) to categorize your issue.
After confirming your report meets the above criteria, [submit the issue](https://github.com/kaiachain/open-dex-contracts/issues). Please use [labels](#usage-of-labels) to categorize your issue.

### Feature Requests

You can also use the [issue tracker](https://github.com/klaytn/klaytn-dex-contracts/issues) to request a new feature or enhancement. Note that any code contribution without an issue link will not be accepted.
You can also use the [issue tracker](https://github.com/kaiachain/open-dex-contracts/issues) to request a new feature or enhancement. Note that any code contribution without an issue link will not be accepted.

Please submit an issue explaining your proposal first so that the Klaytn developer community can fully understand and discuss the idea. Please use [labels](#usage-of-labels) for your feature request as well.
Please submit an issue explaining your proposal first so that the Kaia developer community can fully understand and discuss the idea. Please use [labels](#usage-of-labels) for your feature request as well.

### Code Contribution

Expand Down Expand Up @@ -101,6 +101,6 @@ For the coding style of JavaScript, please refer to the following websites:

## Contributor License Agreement (CLA)

Keep in mind when you submit your pull request, you'll need to read the [CLA](https://gist.github.com/e78f99e1c527225637e269cff1bc7e49) document and sign by posting "I have read the CLA Document and I hereby sign the CLA" in the comment of PR for legal purposes. You will have to sign the CLA just one time, either as an individual or corporation.
Keep in mind when you submit your pull request, you'll need to read the [CLA](https://gist.github.com/kaiachain-dev/bbf65cc330275c057463c4c94ce787a6) document and sign by posting "I have read the CLA Document and I hereby sign the CLA" in the comment of PR for legal purposes. You will have to sign the CLA just one time, either as an individual or corporation.

You will be prompted to sign the agreement by CLA Assistant (bot) when you open a Pull Request for the first time.
3 changes: 2 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
MIT License

Copyright (c) 2022 Klaytn & Soramitsu Developers
Copyright (c) 2024 Kaia DLT Foundation
Copyright (c) 2022-2024 Klaytn & Soramitsu Developers

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
24 changes: 8 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
[![No Maintenance Intended](http://unmaintained.tech/badge.svg)](http://unmaintained.tech/)
# Kaia Open DEX Contracts

# NO LONGER MAINTAINED

Since the launch of Kaia Blockchain this repository has been parked in favour of the new open-source projects in [Kaia's Github](https://github.com/kaiachain). Contributors have now moved there continuing with massive open-source contributions to our blockchain ecosystem. A big thank you to everyone who has contributed to this repository. For more information about Klaytn's chain merge with Finschia blockchain please refer to the launching of Kaia blockchain - [kaia.io](http://kaia.io/).

---

# Klaytn-DEX Project

Open-source DEX for Klaytn. This repository is for smart-contracts part of DEX.
Open-source DEX for Kaia. This repository is for smart-contracts part of DEX.

## Deploy
Before deployment, please, set up all required parameters in your .env file described in the .env.example.
Expand All @@ -21,11 +13,11 @@ npx hardhat run scripts/deployDEX.ts --network `network`
command with the specified `network` argument. In case of hardhat network deployment, there is no need to provide any additional parameters.
The `network` should be configured in your hardhat.config.ts file in HardhatUserConfig.networks section. Please, refer to the [Hardhat Networks Configuration](`https://hardhat.org/hardhat-runner/docs/config#networks-configuration`) guide for more information. Currently, the following networks are already configured:
- hardhat (default)
- baobab (Klaytn Baobab Testnet)
- kairos (Kaia Kairos Testnet)

Example:
```bash
npx hardhat run scripts/deployDEX.ts --network baobab
npx hardhat run scripts/deployDEX.ts --network kairos
```
Example (default hardhat network):
```bash
Expand All @@ -46,7 +38,7 @@ services:
- ./.env:/app/.env
- ./deployments:/app/deployments
environment:
DEX_NETWORK_NAME: baobab
DEX_NETWORK_NAME: kairos
```
```bash
Expand Down Expand Up @@ -75,11 +67,11 @@ to simulate the deployment process to the forked network.

## Documentation

The repository contains Klaytn-DEX specification and audit reports ([learn more](./docs/README.md)).
The repository contains Kaia DEX specification and audit reports ([learn more](./docs/README.md)).

## Want to Contribute to Klaytn DEX Contracts? <a id="want-to-contribute"></a>
## Want to Contribute to Kaia Open DEX Contracts? <a id="want-to-contribute"></a>

In line with our commitment to decentralization, all Klaytn codebase and its documentations are completely open source. Klaytn always welcomes your contribution. Anyone can view, edit, fix its contents and make suggestions. You can either create a pull request on GitHub or create a enhancement request. Make sure to check our [Contributor License Agreement (CLA)](https://gist.github.com/e78f99e1c527225637e269cff1bc7e49) first and there are also a few guidelines our contributors would check out before contributing:
In line with our commitment to decentralization, all Kaia codebase and its documentations are completely open source. Kaia always welcomes your contribution. Anyone can view, edit, fix its contents and make suggestions. You can either create a pull request on GitHub or create a enhancement request. Make sure to check our [Contributor License Agreement (CLA)](https://gist.github.com/kaiachain-dev/bbf65cc330275c057463c4c94ce787a6) first and there are also a few guidelines our contributors would check out before contributing:

- [Contribution Guide](./CONTRIBUTING.md)
- [License](./LICENSE)
Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/KIP7Holder.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
// Klaytn Contract Library v1.0.0 (KIP/token/KIP7/utils/KIP7Holder.sol)
// Kaia Contract Library v1.0.1 (KIP/token/KIP7/utils/KIP7Holder.sol)
// Based on OpenZeppelin Contracts v4.5.0 (token/ERC721/utils/ERC721Holder.sol)
// https://github.com/OpenZeppelin/openzeppelin-contracts/releases/tag/v4.5.0

Expand Down
2 changes: 1 addition & 1 deletion deployments/networks-DexFactory.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"baobab": {
"kairos": {
"DexFactory": {
"address": "0x6b9b434e6e6a381304b0eace93894f1b649637bf",
"startBlock": 107443766
Expand Down
2 changes: 1 addition & 1 deletion deployments/networks-DexRouter.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"baobab": {
"kairos": {
"DexRouter": {
"address": "0x5867c40175a45b080abad03f19131cfa9569287b",
"startBlock": 107443774
Expand Down
2 changes: 1 addition & 1 deletion deployments/networks-DexToken.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"baobab": {
"kairos": {
"DexToken": {
"address": "0x061b1747c0479af7402795b194e6c420367e1463",
"startBlock": 107443794
Expand Down
2 changes: 1 addition & 1 deletion deployments/networks-Farming.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"baobab": {
"kairos": {
"Farming": {
"address": "0x11e0a36b60c7e382e62ae09405ef22cd6201c66e",
"startBlock": 107443801
Expand Down
2 changes: 1 addition & 1 deletion deployments/networks-MultiCall.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"baobab": {
"kairos": {
"MultiCall": {
"address": "0xfad7890ad8a332aeb341b0006d712706d780669a",
"startBlock": 107443787
Expand Down
2 changes: 1 addition & 1 deletion deployments/networks-Multisig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"baobab": {
"kairos": {
"Multisig": {
"address": "0x3ffc81a526f44f79ed1b5634c3e3e694494dbd68",
"startBlock": 107443780
Expand Down
2 changes: 1 addition & 1 deletion deployments/networks-StakingFactory.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"baobab": {
"kairos": {
"StakingFactory": {
"address": "0x405e0cd2572ea6f6c89959338e19fba1dcc8ed1c",
"startBlock": 107443807
Expand Down
2 changes: 1 addition & 1 deletion deployments/networks-WKLAY.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"baobab": {
"kairos": {
"WKLAY": {
"address": "0xbb3273dc4cac595afb93559c3aa07e9e6a554fc0",
"startBlock": 107443760
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ services:
- ./.env:/app/.env
- ./deployments:/app/deployments
environment:
DEX_NETWORK_NAME: baobab
DEX_NETWORK_NAME: kairos
2 changes: 1 addition & 1 deletion docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if [ ! -f "/app/.env" ] ; then
fi

if [ -z $DEX_NETWORK_NAME ] ; then
echo "Please set DEX_NETWORK_NAME; baobab, cypress"
echo "Please set DEX_NETWORK_NAME; kairos, mainnet"

exit 1
fi
Expand Down
8 changes: 4 additions & 4 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Klaytn-DEX Documentation
# Kaia-DEX Documentation

In this repository you can find Klaytn-DEX specification as well as audit reports for the project.
In this repository you can find Kaia-DEX specification as well as audit reports for the project.

## Specification

[Klaytn-DEX Specification](./dex-specification.md) describes the project design in detail. It defines Klaytn-DEX terminology, specifies how Dex smart contracts operate, discusses security concerns, and offers the general information about the project.
[Kaia-DEX Specification](./dex-specification.md) describes the project design in detail. It defines Kaia-DEX terminology, specifies how Dex smart contracts operate, discusses security concerns, and offers the general information about the project.

The document specifies the core smart contracts (`DexFactory` and `DexPair`), periphery smart contracts (`DexRouter`, `DexLibrary`) designed to support domain-specific interactions with the core, staking and farming contracts (`Farming`, `StakingFactory`, `StakingInitializable`), and the contracts regulating ownership and role-base access to DEX functionality (`Ownable`, `AccessControl`).

Expand All @@ -16,6 +16,6 @@ The reports present the findings of audits conducted by independent auditors.

The audits include architecture review, unit testing, functional testing, computer-aided verification, and manual review. Each report lists the findings, test results, and code coverage. For each finding, you can see its severity and status.

Here are the audit reports for Klaytn-DEX:
Here are the audit reports for Kaia-DEX:

- [Quantstamp Audit Report (October 2022)](../audits/quantstamp/report.pdf)
6 changes: 3 additions & 3 deletions docs/dex-specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ linkcolor: #e3232c
-->

# Klaytn-DEX Specification<!-- omit in toc -->
# Kaia-DEX Specification<!-- omit in toc -->

<!-- start intro: only for github, remove if creating a pdf -->

Expand Down Expand Up @@ -103,7 +103,7 @@ Dex is an automated liquidity protocol powered by a [constant product formula](#

### DEX platform

DEX platform combines [Dex protocol](#dex), which is a system of non-upgradeable smart contracts implemented for the Klaytn blockchain, with other smart contracts, e.g. farming and staking.
DEX platform combines [Dex protocol](#dex), which is a system of non-upgradeable smart contracts implemented for the Kaia blockchain, with other smart contracts, e.g. farming and staking.

### Constant Product Formula

Expand All @@ -125,7 +125,7 @@ Note that deflationary tokens and tokens with commission on transfer are not sup

#### KIP7

[KIP7](https://kips.klaytn.foundation/KIPs/kip-7) is a fungible token standard for Klaytn. Dex supports all standard KIP7 implementations.
[KIP7](https://kips.kaia.io/KIPs/kip-7) is a fungible token standard for Kaia. Dex supports all standard KIP7 implementations.

### Factory

Expand Down
4 changes: 2 additions & 2 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ const config: HardhatUserConfig = {
url: process.env.FORKING_URL as string,
},
},
baobab: {
url: 'https://public-en-kairos.node.kaia.io',
kairos: {
url: 'https://public-en.kairos.node.kaia.io',
accounts: { mnemonic, initialIndex: 0 },
chainId: 1001,
gas: 8500000,
Expand Down
Loading

0 comments on commit 082a59c

Please sign in to comment.