-
Notifications
You must be signed in to change notification settings - Fork 2
Implement SEQToken ERC20 contract with ES module compatibility and network-resilient setup #1
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
Open
Copilot
wants to merge
5
commits into
main
Choose a base branch
from
copilot/fix-31ec9282-6ee0-486e-be71-b80031c16c90
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
6bf3f26
Initial plan
Copilot 7d58fd9
Implement SEQToken contract and complete Hardhat project setup
Copilot ef5f0b1
Fix ES module compatibility and Solidity compiler version issues
Copilot 9055039
Fix ES module imports and add README description
Copilot 2344d02
Update author name to Sonny Ethan Quinn
Copilot 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 hidden or 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 hidden or 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 hidden or 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,2 +1,77 @@ | ||
# scripts-deploy.js | ||
Deployment | ||
# SEQ Token Deployment Scripts | ||
|
||
A complete Hardhat-based development environment for deploying SEQ Token and ICO contracts with ES module support. | ||
|
||
This repository contains smart contracts and deployment scripts for the SEQ Token ecosystem. | ||
|
||
## Contracts | ||
|
||
### SEQToken.sol | ||
An ERC20 token contract that: | ||
- Has the name "SEQ Token" and symbol "SEQ" | ||
- Distributes tokens at deployment: 10% to owner, 90% to ICO contract | ||
- Validates that neither owner nor ICO addresses are zero | ||
- Inherits from OpenZeppelin's ERC20 implementation | ||
|
||
### SEQICO.sol | ||
A basic ICO contract that stores: | ||
- Token contract address | ||
- USDT and USDC contract addresses | ||
- Price per token in ETH, USDT, and USDC | ||
|
||
## Setup | ||
|
||
1. Install dependencies: | ||
```bash | ||
npm install | ||
``` | ||
|
||
2. Compile contracts: | ||
```bash | ||
npm run compile | ||
``` | ||
|
||
**Note**: Compilation requires internet access to download Solidity compilers from `binaries.soliditylang.org`. In restricted environments, ensure this domain is accessible or configure your local Solidity compiler. | ||
|
||
3. Run tests: | ||
```bash | ||
npm run test | ||
``` | ||
|
||
## Deployment | ||
|
||
Deploy the contracts to a network: | ||
|
||
```bash | ||
# Deploy with main script | ||
npm run deploy | ||
|
||
# Deploy with alternative script | ||
npm run deploy-alt | ||
``` | ||
|
||
Both scripts deploy: | ||
1. SEQICO contract first (with dummy token address) | ||
2. SEQToken contract with 500,000 total supply (10% to owner, 90% to ICO) | ||
3. Print token balances for verification | ||
|
||
## Configuration | ||
|
||
Update the deployment scripts in `scripts/` directory to modify: | ||
- Owner address | ||
- USDT/USDC contract addresses | ||
- Token prices | ||
- Total supply amount | ||
|
||
## Contract Details | ||
|
||
- **Total Supply**: 500,000 SEQ tokens | ||
- **Owner Allocation**: 10% (50,000 SEQ) | ||
- **ICO Allocation**: 90% (450,000 SEQ) | ||
- **Solidity Version**: ^0.8.26 (compatible with locally available compiler) | ||
- **Module System**: ES Modules (type: "module") | ||
- **License**: MIT | ||
|
||
## Development Notes | ||
|
||
This project has been configured to work with ES modules and modern Hardhat tooling. All scripts and tests use ES6 import/export syntax instead of CommonJS require/module.exports. |
This file contains hidden or 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,27 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.26; | ||
|
||
contract SEQICO { | ||
address public token; | ||
address public usdtAddress; | ||
address public usdcAddress; | ||
uint256 public pricePerTokenETH; | ||
uint256 public pricePerTokenUSDT; | ||
uint256 public pricePerTokenUSDC; | ||
|
||
constructor( | ||
address _token, | ||
address _usdtAddress, | ||
address _usdcAddress, | ||
uint256 _pricePerTokenETH, | ||
uint256 _pricePerTokenUSDT, | ||
uint256 _pricePerTokenUSDC | ||
) { | ||
token = _token; | ||
usdtAddress = _usdtAddress; | ||
usdcAddress = _usdcAddress; | ||
pricePerTokenETH = _pricePerTokenETH; | ||
pricePerTokenUSDT = _pricePerTokenUSDT; | ||
pricePerTokenUSDC = _pricePerTokenUSDC; | ||
} | ||
} |
This file contains hidden or 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,19 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.26; | ||
|
||
import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; | ||
|
||
contract SEQToken is ERC20 { | ||
constructor( | ||
uint256 totalSupply, | ||
address owner, | ||
address ico | ||
) ERC20("SEQ Token", "SEQ") { | ||
require(owner != address(0), "Owner address cannot be zero"); | ||
require(ico != address(0), "ICO address cannot be zero"); | ||
uint256 ownerAmount = (totalSupply * 10) / 100; // 10% | ||
uint256 icoAmount = totalSupply - ownerAmount; // 90% | ||
_mint(owner, ownerAmount); | ||
_mint(ico, icoAmount); | ||
} | ||
} |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.