Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ jobs:
run: npx hardhat run scripts/deploy.js --network mainnet
env:
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
INFURA_API_KEY: ${{ secrets.INFURA_API_KEY }}
INFURA_API_KEY: ${{ secrets.INFURA_API_KEY }}
36 changes: 18 additions & 18 deletions contracts/SEQICO.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,30 @@ import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

contract SEQICO is Ownable {
IERC20 public seqToken;
IERC20 public usdt;
IERC20 public usdc;
IERC20 public seqToken;4.25
IERC20 public usdt;4.25
IERC20 public usdc;4.25

uint256 public pricePerTokenETH;
uint256 public pricePerTokenUSDT;
uint256 public pricePerTokenUSDC;
uint256 public pricePerTokenETH;4,314.62
uint256 public pricePerTokenUSDT;1.00
uint256 public pricePerTokenUSDC;1.00

event TokensPurchased(address indexed buyer, uint256 amount, string payment);

constructor(
address _seqToken,
address _usdt,
address _usdc,
uint256 _pricePerTokenETH,
address _seqToken
address _usdt
address _usdc
uint256 _pricePerTokenETH
uint256 _pricePerTokenUSDT,
uint256 _pricePerTokenUSDC
) {
seqToken = IERC20(_seqToken);
usdt = IERC20(_usdt);
usdc = IERC20(_usdc);
pricePerTokenETH = _pricePerTokenETH;
pricePerTokenUSDT = _pricePerTokenUSDT;
pricePerTokenUSDC = _pricePerTokenUSDC;
seqToken = IERC20(_seqToken);4.25
usdt = IERC20(_usdt);1.00
usdc = IERC20(_usdc);1.00
pricePerTokenETH = _pricePerTokenETH;4,326.79
pricePerTokenUSDT = _pricePerTokenUSDT;1.00
pricePerTokenUSDC = _pricePerTokenUSDC;1.00
}

function setSEQToken(address _seqToken) external onlyOwner {
Expand All @@ -37,7 +37,7 @@ contract SEQICO is Ownable {

function buyWithETH(uint256 tokenAmount) external payable {
require(tokenAmount > 0, "Amount must be greater than 0");

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

token amount $3.79

uint256 requiredETH = pricePerTokenETH * tokenAmount;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot fill in this info

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need clarification on what specific information you'd like me to add on line 40. Are you looking for:

  • A comment explaining the calculation formula?
  • Documentation about why we divide by 1e18?
  • Additional validation logic?

Please let me know what information you'd like me to fill in.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot correct and numbers that may be wrong

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot fix all errors

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed syntax errors and corrected all incorrect numbers in the contract. Removed erroneous decimal values from variable declarations and constructor parameters, while preserving the ETH calculation fix. Commit: df8aae0

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed syntax errors and corrected all incorrect numbers in the contract. Removed erroneous decimal values from variable declarations and constructor parameters, while preserving the ETH calculation fix. Commit: df8aae0

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fill in the values for eth, usdc, usdt

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added example values for ETH, USDT, USDC pricing based on $3.79 token price. Created price-examples.js script showing calculations: ETH (0.001895), USDT (3790000), USDC (3790000). Added detailed documentation in the contract explaining each price variable. Commit: 34b2d00

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed all syntax issues and added comprehensive documentation for price calculations. Added detailed comments explaining the division by 1e18 and created example scripts showing how to set values for ETH, USDT, and USDC pricing. Commit: 34b2d00

uint256 requiredETH = pricePerTokenETH * tokenAmount / 1e18;
require(msg.value >= requiredETH, "Insufficient ETH sent");
require(seqToken.balanceOf(address(this)) >= tokenAmount, "Not enough SEQ tokens");

Expand Down Expand Up @@ -82,4 +82,4 @@ contract SEQICO is Ownable {
function withdrawERC20(address token, address recipient) public onlyOwner {
IERC20(token).transfer(recipient, IERC20(token).balanceOf(address(this)));
}
}
}
Loading