Skip to content

Commit

Permalink
deploy: fucking real kucocoin
Browse files Browse the repository at this point in the history
  • Loading branch information
kuco23 committed Nov 22, 2024
1 parent 76c30a8 commit 3dd0418
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 28 deletions.
4 changes: 2 additions & 2 deletions packages/contracts/network-info.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions packages/contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions packages/contracts/src/KucoCoin.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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(
Expand Down
8 changes: 6 additions & 2 deletions packages/contracts/test/kucocoin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
22 changes: 11 additions & 11 deletions packages/contracts/tools/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
14 changes: 7 additions & 7 deletions packages/frontend/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,9 @@ <h2>Buying KucoCoin</h2>
Buying KucoCoin enables you to do many things - from reporting your period on the blockchain,
to supporting the LGBTQ community by performing trans actions.
<investment>
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 <a id="scroll-to-investment">form</a>.
You can invest by filling <a id="scroll-to-investment">this form</a>, then claim your KUCO after January 20th.
</investment>
<trading>
Unfortunately, the deep state prevented us from creating a trading interface here, so you'll have to go to
Expand Down Expand Up @@ -484,17 +484,17 @@ <h2>The Distribution Model</h2>
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 <span class="code">LP</span>,
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.
</div>
</div>

<div class="col-2 icon-block wow fadeIn" data-wow-delay="0.5s">
<h4>1. Investing AVAX liquidity</h4>
<div class="text-content">
The pool <span class="code">LP</span> has initial liquidity of a billion KUCO tokens and some AVAX deposited by our team.
The pool <span class="code">LP</span> 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 <span class="underline">refundable AVAX investment</span>,
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.
</div>
</div>

Expand Down Expand Up @@ -570,8 +570,8 @@ <h4>2. Collecting minted KUCO</h4>

<div class="col-1 icon-block wow fadeIn" data-wow-delay="0.3s">
<div class="text-content">
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
<span class="underline">reconsider</span>.
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/ts/config/token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 3dd0418

Please sign in to comment.