From 3dd04188f3d65850e7d1b53a0d4dc741920fc9db Mon Sep 17 00:00:00 2001 From: kuco23 Date: Fri, 22 Nov 2024 20:54:37 +0100 Subject: [PATCH] deploy: fucking real kucocoin --- packages/contracts/network-info.json | 4 ++-- packages/contracts/package.json | 6 +++--- packages/contracts/src/KucoCoin.sol | 4 ++-- packages/contracts/test/kucocoin.test.ts | 8 ++++++-- packages/contracts/tools/cli.ts | 22 +++++++++++----------- packages/frontend/src/index.html | 14 +++++++------- packages/frontend/src/ts/config/token.ts | 2 +- 7 files changed, 32 insertions(+), 28 deletions(-) diff --git a/packages/contracts/network-info.json b/packages/contracts/network-info.json index e65dd81..248c14b 100644 --- a/packages/contracts/network-info.json +++ b/packages/contracts/network-info.json @@ -21,8 +21,8 @@ }, "avalanche": { "kucocoin": { - "address": "0x6323C8D0B431c5fAe077ad7f6Aac2724Da18C7Ba", - "params": ["0x4752ba5dbc23f44d87826276bf6fd6b1c372ad24", "500", "1725645600", "1000", "1725991200"] + "address": "0xD9560c2CD07A61e46D4eEaf5A2BB61C57FD2BE7A", + "params": ["0x4752ba5dbc23f44d87826276bf6fd6b1c372ad24", "500", "1737331200", "500", "1740009600"] }, "uniswapV2Router": { "address": "0x4752ba5dbc23f44d87826276bf6fd6b1c372ad24", diff --git a/packages/contracts/package.json b/packages/contracts/package.json index 4901f2f..c135529 100644 --- a/packages/contracts/package.json +++ b/packages/contracts/package.json @@ -21,9 +21,9 @@ "fork-avalanche": "yarn hardhat node --fork https://api.avax.network/ext/bc/C/rpc", "---------- live ----------": "---------- live ----------", "cli": "yarn ts-node tools/cli.ts", - "kucocoin-deploy": "yarn cli deploy 500 1725645600 1000 1725991200", - "kucocoin-init": "yarn cli init 1000000000000000000000000 10000000000000000", - "verify": "yarn hardhat verify 0x6323C8D0B431c5fAe077ad7f6Aac2724Da18C7Ba 0x4752ba5dbc23f44d87826276bf6fd6b1c372ad24 500 1725645600 1000 1725991200" + "kucocoin-deploy": "yarn cli deploy 500 1737331200 500 1740009600", + "kucocoin-init": "yarn cli init 1000000000000000000000000 10000000000000000000", + "verify": "yarn hardhat verify 0xD9560c2CD07A61e46D4eEaf5A2BB61C57FD2BE7A 0x4752ba5dbc23f44d87826276bf6fd6b1c372ad24 500 1737331200 500 1740009600" }, "devDependencies": { "@ethersproject/keccak256": "^5.7.0", diff --git a/packages/contracts/src/KucoCoin.sol b/packages/contracts/src/KucoCoin.sol index 13d22e6..82c3191 100644 --- a/packages/contracts/src/KucoCoin.sol +++ b/packages/contracts/src/KucoCoin.sol @@ -482,8 +482,8 @@ contract KucoCoin is IKucoCoin, ERC20, Ownable { function reportPeriod() external { - _takeKucoCoinFeatureFee(REPORT_PERIOD_FEE); _periodOf[msg.sender].entry[_periodOf[msg.sender].index++] = uint64(block.timestamp); + _takeKucoCoinFeatureFee(REPORT_PERIOD_FEE); } function periodHistory() @@ -520,8 +520,8 @@ contract KucoCoin is IKucoCoin, ERC20, Ownable { ) external { - _takeKucoCoinFeatureFee(TRANS_ACTION_FEE); _transfer(msg.sender, _to, _amount); + _takeKucoCoinFeatureFee(TRANS_ACTION_FEE); } function _takeKucoCoinFeatureFee( diff --git a/packages/contracts/test/kucocoin.test.ts b/packages/contracts/test/kucocoin.test.ts index 5861fb5..e8788f9 100644 --- a/packages/contracts/test/kucocoin.test.ts +++ b/packages/contracts/test/kucocoin.test.ts @@ -481,9 +481,13 @@ describe("KucoCoin", () => { // fund sender with KUCO await initKucoCoin(admin) await fundAccountWithKuco(sender, invested) - // execute transfer + // first execute reverted transfer due to insufficient funds const senderKucoBalance = await kucocoin.balanceOf(sender) - const amountTransActedKuco = senderKucoBalance - KUCOCOIN_FEATURE_FEE + let amountTransActedKuco = senderKucoBalance + await expect(kucocoin.connect(sender).makeTransAction(receiver, amountTransActedKuco)).to.be.revertedWith( + 'KucoCoin: not enough funds for feature fee') + // execute transfer + amountTransActedKuco -= KUCOCOIN_FEATURE_FEE await kucocoin.connect(sender).makeTransAction(receiver, amountTransActedKuco) expect(await kucocoin.balanceOf(sender)).to.equal(senderKucoBalance - amountTransActedKuco - KUCOCOIN_FEATURE_FEE) expect(await kucocoin.balanceOf(receiver)).to.equal(amountTransActedKuco) diff --git a/packages/contracts/tools/cli.ts b/packages/contracts/tools/cli.ts index 81a3638..74db16c 100644 --- a/packages/contracts/tools/cli.ts +++ b/packages/contracts/tools/cli.ts @@ -23,35 +23,35 @@ program }) program .command("deploy").description("deploy KucoCoin") - .argument("investment interest (bips)", "factor at which to return the investment value") - .argument("investment duration (seconds)", "duration of the investment phase") - .argument("retract fee (bips)", "fee to be paid when retracting the investment") - .argument("retract duration (seconds)", "duration of the retract phase") + .argument("investment interest (bips)", "interest of the initial investment returned in KUCO") + .argument("investment phase start (seconds)", "start of the investment phase") + .argument("retract fee (bips)", "paid fee if retracting the investment") + .argument("retract phase end (seconds)", "end of the retract phase") .action(async ( investmentInterestBips: number, - investmentDuration: string, + investmentPhaseStart: string, retractFeeBips: number, - retractDuration: string, + retractPhaseEnd: string, _options: OptionValues ) => { const kucocoinAddress = await deployKucocoin( info.uniswapV2, investmentInterestBips, - BigInt(investmentDuration), + BigInt(investmentPhaseStart), retractFeeBips, - BigInt(retractDuration), + BigInt(retractPhaseEnd), signer ) console.log(`KucoCoin deployed at ${kucocoinAddress}`) storeKucoCoinDeploy( kucocoinAddress, program.opts().network, info.uniswapV2, - investmentInterestBips, investmentDuration, - retractFeeBips, retractDuration + investmentInterestBips, investmentPhaseStart, + retractFeeBips, retractPhaseEnd ) }) program .command("init").description("initialize KucoCoin") - .argument("liquidity kuco", "amount of Kuco to provide as liquidity") + .argument("liquidity kuco", "amount of KUCO to provide as liquidity") .argument("liquidity nat", "amount of NAT to provide as liquidity") .action(async (liquidityKuco: string, liquidityNat: string, _options: OptionValues) => { const kucocoin = readKucoCoinDeploy(program.opts().network) diff --git a/packages/frontend/src/index.html b/packages/frontend/src/index.html index 8ff8a41..35cb1f1 100644 --- a/packages/frontend/src/index.html +++ b/packages/frontend/src/index.html @@ -260,9 +260,9 @@

Buying KucoCoin

Buying KucoCoin enables you to do many things - from reporting your period on the blockchain, to supporting the LGBTQ community by performing trans actions. - KucoCoin is in investment stage until December 5th, 00:00 (CET), and can't be traded yet. + KucoCoin is in investment stage until January 20th, 00:00 UTC, with trading disabled until that date. Instead, it is possible to invest AVAX and be rewarded with KUCO after the investment stage. - Invest by filling up this form. + You can invest by filling this form, then claim your KUCO after January 20th. Unfortunately, the deep state prevented us from creating a trading interface here, so you'll have to go to @@ -484,17 +484,17 @@

The Distribution Model

By discovering a trick in the mathematics of uniswap's constant product, we devised a way to make everyone profit out of their investment. Below we describe the tokenomics of KUCO distribution. The model assumes a fixed Uniswap-V2 liquidity pool, denoted LP, - that holds initially fixed deposit of a billion KUCO tokens, and collects user-invested AVAX. + that holds initially fixed deposit of a million KUCO tokens, and collects user-invested AVAX.

1. Investing AVAX liquidity

- The pool LP has initial liquidity of a billion KUCO tokens and some AVAX deposited by our team. + The pool LP has initial liquidity of a million KUCO tokens and 10 AVAX deposited by our team. Users can invest in KucoCoin by providing AVAX liquidity, with liquidity pool tokens deposited to the KucoCoin contract. Note that liquidity pool tokens are not burned to enable a refundable AVAX investment, - which is called "retraction" and possible after the investment phase for a 10% fee. + which is called "retraction" and possible after the investment phase for a 5% fee.
@@ -570,8 +570,8 @@

2. Collecting minted KUCO

- Please note that retracting your investment incurs a fee of 10% of the invested amount. - This option is available for up to one week following the start of the trading period. + Please note that retracting your investment incurs a fee of 5% of the invested amount. + This option is available for up to one month following the start of the trading period. During that time, the non-claimed retractable AVAX is protected from withdrawal in the liquidity pool. If not convinced by the above arguments, stare at the below spiral for 5 minutes and reconsider. diff --git a/packages/frontend/src/ts/config/token.ts b/packages/frontend/src/ts/config/token.ts index 0317802..98fd98c 100644 --- a/packages/frontend/src/ts/config/token.ts +++ b/packages/frontend/src/ts/config/token.ts @@ -4,7 +4,7 @@ import { KUCOCOIN_ABI as _KUCOCOIN_ABI } from './abi' export const KUCOCOIN_ABI = _KUCOCOIN_ABI export const KUCOCOIN_SYMBOL = "KUCO" export const KUCOCOIN_DECIMALS = 18 -export const KUCOCOIN_LOGO_URL = 'https://github.com/kuco23/kucocoin/blob/monorepo/logo.png' +export const KUCOCOIN_LOGO_URL = '' export const avalancheforkToken = { kucocoin: avalanchefork.kucocoin.address,