From 4d546bdff3d53d099d2189db6422e1317623adac Mon Sep 17 00:00:00 2001 From: Ahmed Bouchriha Date: Mon, 19 Feb 2024 15:36:32 +0100 Subject: [PATCH] deploy on vercel --- README.md | 4 +++- backend/contracts/Aqua.sol | 3 ++- backend/scripts/deploy.js | 14 +++++++------- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index cfdb948..749efae 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,10 @@ Aqua is a liquid ETH staking application that allows users to stake their ETH and receive Interest Bearing Tokens (aqETH) in return. aqETH tokens represent a staked position in the ETH pool and accrue interest over time, offering a profitable and liquid staking solution. +## Live demo +https://aqua-kappa-six.vercel.app/ -## Description Readme +## Description [Backend README](./backend/README.md) diff --git a/backend/contracts/Aqua.sol b/backend/contracts/Aqua.sol index 05e7a6c..6946a16 100644 --- a/backend/contracts/Aqua.sol +++ b/backend/contracts/Aqua.sol @@ -16,6 +16,7 @@ contract Aqua is ERC20, Ownable { mapping(address => uint256) public gainedInterests; uint256 private constant INITIAL_EXCHANGE_RATE = 99; // Initial 1 ETH = 1 aqETH for simplicity uint256 private constant EXCHANGE_RATE_BASE = 100; // Base value for calculations + uint256 private constant MINIMUM_EXCHANGE_RATE = 100; uint256 private ASSET_STEP = 10e21; // 1,000 ETH in wei for rate adjustment uint256 private RATE_DECREASE_PER_STEP = 1; // Decrease rate by 0.01 aqETH per ASSET_STEP @@ -50,7 +51,7 @@ contract Aqua is ERC20, Ownable { if (currentRate < 80) { - currentRate = minimumRate; + currentRate = MINIMUM_EXCHANGE_RATE; } return currentRate; diff --git a/backend/scripts/deploy.js b/backend/scripts/deploy.js index 0110fa8..8cf490d 100644 --- a/backend/scripts/deploy.js +++ b/backend/scripts/deploy.js @@ -12,11 +12,11 @@ async function deployAqETHTokenContract() { return aqETH; } -async function deployAquaContract(aqETHAddress) { +async function deployAquaContract() { - console.log(`Start deploying Aqua staking contract...`, aqETHAddress); + console.log(`Start deploying Aqua staking contract...`); - const aqua = await hre.ethers.deployContract("Aqua", [aqETHAddress]); + const aqua = await hre.ethers.deployContract("Aqua"); await aqua.waitForDeployment(); console.log(`Aqua contract is deployed to ${aqua.target}`); @@ -27,10 +27,10 @@ async function deployAquaContract(aqETHAddress) { async function main() { - const aqua = await deployAquaContract(aqETH.target); - -aqua.setAssetStep(10e21) -aqua.setRateDecreasePerStep(1) + const aqua = await deployAquaContract(); + const assetStep = ethers.parseEther("1000"); + aqua.setAssetStep(assetStep); + aqua.setRateDecreasePerStep(1); }