-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doc for subswap #25
Merged
Merged
Doc for subswap #25
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
105e61e
update
GalaxySciTech ea1ce68
Update README.md
GalaxySciTech 943c88f
Update README.md
GalaxySciTech 00f5a8c
Update simpletokendeploy.js
GalaxySciTech a1ce0b7
Update README.md
GalaxySciTech 4a389c5
Update simpletokendeploy.js
GalaxySciTech e21a9e5
Update simpletokendeploy.js
GalaxySciTech 75d6a76
Update README.md
GalaxySciTech 07eaee0
Update README.md
GalaxySciTech File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Subswap | ||
|
||
Contract Deploy doc in [contract](contract/) | ||
|
||
Frontend doc in [contract](https://github.com/XinFinOrg/subswap-frontend) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,44 @@ | ||
# Subswap contract | ||
# Subswap Contract Deployment Guide | ||
|
||
## Subswap Deployment Guide | ||
This guide provides the steps to check and configure necessary values in the `deploy.config.json` file, and then deploy Subswap and the Subnet Token using Hardhat scripts. | ||
|
||
### Check `deploy.config.json` File | ||
|
||
1. Open the `deploy.config.json` file. | ||
2. Check the values of `parentnetendpoint` and `subnetendpoint`. | ||
## Configuration: `deploy.config.json` | ||
|
||
1. **Open the `deploy.config.json` File** | ||
- Verify the values for `parentnetendpoint` and `subnetendpoint`. | ||
- `parentnetendpoint`: The endpoint contract address on Parentnet. | ||
- `subnetendpoint`: The endpoint contract address on Subnet. | ||
- `subnettoken`: | ||
- `name`: The name of the token. | ||
- `symbol`: The symbol of the token. | ||
- `initSupply`: The initial supply of the token. | ||
|
||
### Deploy Subswap | ||
## Deploying Subswap | ||
|
||
#### Method 1: Using Hardhat Scripts | ||
### Method 1: Using Hardhat Scripts | ||
|
||
1. Install Hardhat and dependencies: | ||
1. **Install Hardhat and Dependencies** | ||
|
||
``` | ||
yarn | ||
``` | ||
```bash | ||
yarn | ||
``` | ||
|
||
2. Deploy the Parentnet Treasury contract: | ||
2. **Deploy the Parentnet Treasury Contract** | ||
|
||
``` | ||
npx hardhat run scripts/parentnettreasurydeploy.js --network xdcparentnet | ||
``` | ||
```bash | ||
npx hardhat run scripts/parentnettreasurydeploy.js --network xdcparentnet | ||
``` | ||
|
||
3. Deploy the Subnet Treasury contract: | ||
3. **Deploy the Subnet Treasury Contract** | ||
|
||
```bash | ||
npx hardhat run scripts/subnettreasurydeploy.js --network xdcsubnet | ||
``` | ||
|
||
## Deploying the Subnet Token | ||
|
||
```bash | ||
npx hardhat run scripts/simpletokendeploy.js --network xdcsubnet | ||
``` | ||
npx hardhat run scripts/subnettreasurydeploy.js --network xdcsubnet | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity =0.8.23; | ||
|
||
import {ERC20Burnable, ERC20} from "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol"; | ||
|
||
contract SimpleToken is ERC20Burnable { | ||
constructor( | ||
string memory name_, | ||
string memory symbol_, | ||
uint256 initSupply | ||
) ERC20(name_, symbol_) { | ||
_mint(msg.sender, initSupply * 1 ether); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"parentnetendpoint": "0x89D933dFBd879DA78643530Bf413c81F94A73c31", | ||
"subnetendpoint": "0x0B1795ccA8E4eC4df02346a082df54D437F8D9aF" | ||
"subnetendpoint": "0x0B1795ccA8E4eC4df02346a082df54D437F8D9aF", | ||
"subnettoken": { "name": "test", "symbol": "test", "initSupply": "1000" } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing the installation cmd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yarn is install cmd