@@ -13,10 +13,14 @@ This project contains:
1313
1414### SEQICO Contract
1515- Buy SEQ tokens with ETH, USDT, or USDC
16- - Configurable pricing for each payment method
16+ - Configurable pricing for each payment method with ** minimum price validation **
1717- Owner-only functions for token management and fund withdrawal
1818- Automatic ETH refunds for overpayments
1919- Event logging for all purchases
20+ - ** Price validation** : Minimum price requirements enforced:
21+ - ETH: minimum 3 ether (3 × 10¹⁸ wei)
22+ - USDT: minimum 3,000,000 units (equivalent to $3 with 6 decimals)
23+ - USDC: minimum 3,000,000 units (equivalent to $3 with 6 decimals)
2024
2125### SEQToken Contract
2226- Standard ERC20 token
@@ -44,24 +48,52 @@ npx hardhat run scripts/deploy.js
4448npx hardhat run scripts/deploy-DE.js
4549```
4650
51+ ## Dependencies
52+
53+ This project uses Hardhat v3 with the following key dependencies:
54+ - ` @nomicfoundation/hardhat-toolbox-mocha-ethers ` - Hardhat toolbox for v3+
55+ - ` @nomicfoundation/hardhat-ethers@^4.0.0 ` - Ethers integration
56+ - ` @nomicfoundation/hardhat-ethers-chai-matchers@^3.0.0 ` - Chai matchers for testing
57+ - ` chai@^5.1.2 ` - Testing framework
58+
59+ ### Dependency Updates (January 2025)
60+
61+ The project has been updated to resolve dependency conflicts with the new Hardhat architecture:
62+ - Migrated from ` @nomicfoundation/hardhat-chai-matchers@2.1.0 ` to ` @nomicfoundation/hardhat-ethers-chai-matchers@3.0.0 `
63+ - Updated to use ` @nomicfoundation/hardhat-toolbox-mocha-ethers@3.0.0 ` compatible with Hardhat v3
64+ - Updated Chai to v5.1.2 for compatibility
65+
4766## Contract Functions
4867
4968### SEQICO Contract
5069- ` buyWithETH(uint256 tokenAmount) ` : Purchase tokens with ETH
5170- ` buyWithUSDT(uint256 tokenAmount) ` : Purchase tokens with USDT
5271- ` buyWithUSDC(uint256 tokenAmount) ` : Purchase tokens with USDC
72+ - ` setPricePerTokenETH(uint256 _pricePerTokenETH) ` : Set ETH price per token (owner only, ≥ 3 ETH)
73+ - ` setPricePerTokenUSDT(uint256 _pricePerTokenUSDT) ` : Set USDT price per token (owner only, ≥ 3,000,000)
74+ - ` setPricePerTokenUSDC(uint256 _pricePerTokenUSDC) ` : Set USDC price per token (owner only, ≥ 3,000,000)
5375- ` setSEQToken(address _seqToken) ` : Update SEQ token address (owner only)
5476- ` withdrawETH(address payable recipient) ` : Withdraw collected ETH (owner only)
5577- ` withdrawERC20(address token, address recipient) ` : Withdraw ERC20 tokens (owner only)
5678
79+ ## Price Validation Policy
80+
81+ All pricing functions enforce a minimum $3 equivalent:
82+ - ETH prices must be ≥ 3 ether (3000000000000000000 wei)
83+ - USDT/USDC prices must be ≥ 3,000,000 units (equivalent to $3 with 6 decimal places)
84+
85+ Attempts to set prices below these thresholds will revert with: ` "Price must be greater than or equal to $3" `
86+
5787## Configuration
5888
5989The deployment scripts include configurable parameters:
6090- Owner address
6191- USDT/USDC contract addresses
62- - Token pricing for ETH, USDT, and USDC
92+ - Token pricing for ETH, USDT, and USDC (must meet minimum validation requirements)
6393- Total supply (500,000 SEQ tokens)
6494
95+ ** Note** : When deploying, ensure all price parameters meet the minimum validation requirements, or the deployment will fail.
96+
6597## License
6698
6799MIT
0 commit comments