-
Notifications
You must be signed in to change notification settings - Fork 2
Add dynamic price configuration system with environment variable support to SEQICO smart contract #24
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
7
commits into
main
Choose a base branch
from
copilot/fix-be71c7b9-9309-4e44-a22e-680e3e5e8389
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
Add dynamic price configuration system with environment variable support to SEQICO smart contract #24
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
3a70449
Initial plan
Copilot 4bbdbae
Initial commit: Set up plan for SEQICO price-setting functionality
Copilot 31c98d8
Add price-setting functions with $3 minimum validation and update dep…
Copilot e379117
Add demo script and final verification - all requirements complete
Copilot bfe290a
Apply suggestion from @Copilot
sonnyquinn24 cf9bbcc
Apply suggestion from @Copilot
sonnyquinn24 847e05c
Implement dynamic price generation and environment variable configura…
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.24; | ||
|
||
import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; | ||
|
||
contract MockERC20 is ERC20 { | ||
uint8 private _decimals; | ||
|
||
constructor( | ||
string memory name, | ||
string memory symbol, | ||
uint8 decimals_ | ||
) ERC20(name, symbol) { | ||
_decimals = decimals_; | ||
_mint(msg.sender, 1000000 * 10**decimals_); // Mint 1M tokens to deployer | ||
} | ||
|
||
function decimals() public view virtual override returns (uint8) { | ||
return _decimals; | ||
} | ||
|
||
function mint(address to, uint256 amount) public { | ||
_mint(to, amount); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/bin/bash | ||
|
||
# SEQICO Price Setting Demo Script | ||
# This script demonstrates the price-setting functionality | ||
|
||
echo "🚀 SEQICO Price Setting Functionality Demo" | ||
echo "==========================================" | ||
echo | ||
|
||
echo "📋 What this implementation provides:" | ||
echo " ✅ setPriceETH() - Set ETH price per token (min 0.001 ETH)" | ||
echo " ✅ setPriceUSDT() - Set USDT price per token (min \$3.00)" | ||
echo " ✅ setPriceUSDC() - Set USDC price per token (min \$3.00)" | ||
echo " ✅ Price validation enforcing \$3 minimum" | ||
echo " ✅ Owner-only access control" | ||
echo " ✅ Event logging for price changes" | ||
echo " ✅ Constructor validation" | ||
echo | ||
|
||
echo "💰 Price Floor Policy:" | ||
echo " • USDT/USDC minimum: 3,000,000 (representing \$3.00 with 6 decimals)" | ||
echo " • ETH minimum: 0.001 ETH (assuming ETH > \$3,000)" | ||
echo | ||
|
||
echo "📁 Files Added/Modified:" | ||
echo " 📄 contracts/SEQICO.sol - Added price setter functions" | ||
echo " 📄 test/SEQICO.test.js - Comprehensive test suite" | ||
echo " 📄 scripts/set-prices.js - Price setting utility script" | ||
echo " 📄 scripts/deploy.js - Updated with validation" | ||
echo " 📄 scripts/deploy-DE.js - Updated with validation" | ||
echo " 📄 README.md - Updated documentation" | ||
echo | ||
|
||
echo "🔧 Usage Examples:" | ||
echo | ||
echo "1. Deploy with validation:" | ||
echo " npx hardhat run scripts/deploy.js" | ||
echo | ||
echo "2. Set new prices after deployment:" | ||
echo " # Edit SEQICO_ADDRESS in set-prices.js first" | ||
echo " npx hardhat run scripts/set-prices.js" | ||
echo | ||
echo "3. Test the functionality:" | ||
echo " npx hardhat test" | ||
echo | ||
|
||
echo "⚠️ Important Notes:" | ||
echo " • All price updates must be done by contract owner" | ||
echo " • Prices below \$3 minimum will be rejected" | ||
echo " • Price changes emit PriceUpdated events" | ||
echo " • Initial deployment validates all prices" | ||
echo | ||
|
||
echo "🎉 Implementation Complete!" | ||
echo "The SEQICO contract now supports dynamic price setting with proper validation." |
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
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.