-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
6 changed files
with
69 additions
and
26 deletions.
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