There is a 30 day period to deposit CHAOS coins.
There is a 30 day period to switch and withdraw WEWE coins.
The killswitch allows users to deposit, then withdraw (after Cliff) at 100% conversion (1:1) ratio.
Linear, so after 15 days, it's only 50% conversion (1:0.5).
After 30 days, 0% conversion (1:0)
Implementation
Owner
wewe.approveAndCall(merge.deposit(balance, chaosCoinAddress) // deposit a balance for users with CHAOS
merge.setKillPeriod() // set the 30 day killswitch
merge.start() // start the killswitch (implies owner waits 30 days)
Users
chaos.approveAndCall(merge.deposit(balance)) // deposit CHAOS into merge contract
merge.claim() claim share of un-allocated tokens // claim the share of un-allocated tokens
merge.withdraw() withdraws Tokens, sends WEWE to user, sends CHAOS to JP
merge.withdrawAndStake() withdraws and stakes in the stakingContract.
Logic
users that don't deposit, lose the linear killswitch on tokens
kill switch is 1:1 going to 1:0 after 30 days
lost tokens can be claimed (pro-rata) by user still in the merge contract, pressing CLAIM
CHAOS coins are sent to JP when user finally withdraws
Count the allocate coins when a user deposits in a mapping
mapping availableCoins -> 256 // the original deposit of WEWE
mapping userAllocation address -> uint256 // map the allocated WEWE per user
mapping totalAllocatedCoins -> uint256 // add up the total allocated, each time user deposits
mapping userLastClaimSecondsAgo address -> uint256 // when the user last claimed
When users deposit, the coins will be allocated, as per killswitch. If not all users deposit in time, there will forever be "un-allocated coins".
the difference between (totalAllocatedCoins - availableCoins) is thus the un-allocated coins, that can be "shared" with the users remains in the contract.
Each time a users claims the unallocated coins, the availableCoins should decrement. But, the last time they claimed, should be factored in, so they don't double-claim other's coins.
Overview
There is a 30 day period to deposit CHAOS coins. There is a 30 day period to switch and withdraw WEWE coins.
The killswitch allows users to deposit, then withdraw (after Cliff) at 100% conversion (1:1) ratio. Linear, so after 15 days, it's only 50% conversion (1:0.5). After 30 days, 0% conversion (1:0)
Implementation
Owner
wewe.approveAndCall(merge.deposit(balance, chaosCoinAddress)
// deposit a balance for users with CHAOSmerge.setKillPeriod()
// set the 30 day killswitchmerge.start()
// start the killswitch (implies owner waits 30 days)Users
chaos.approveAndCall(merge.deposit(balance))
// deposit CHAOS into merge contractmerge.claim()
claim share of un-allocated tokens // claim the share of un-allocated tokensmerge.withdraw()
withdraws Tokens, sends WEWE to user, sends CHAOS to JPmerge.withdrawAndStake()
withdraws and stakes in the stakingContract.Logic
Count the allocate coins when a user deposits in a mapping
When users deposit, the coins will be allocated, as per killswitch. If not all users deposit in time, there will forever be "un-allocated coins".
the difference between
(totalAllocatedCoins - availableCoins)
is thus the un-allocated coins, that can be "shared" with the users remains in the contract.Each time a users claims the unallocated coins, the
availableCoins
should decrement. But, the last time they claimed, should be factored in, so they don't double-claim other's coins.