1
This commit is contained in:
commit
ea36a05b14
@ -1,12 +1,12 @@
|
|||||||
package service
|
package service
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"q5"
|
|
||||||
"f5"
|
"f5"
|
||||||
"sync"
|
|
||||||
"strings"
|
|
||||||
"main/constant"
|
"main/constant"
|
||||||
"math/big"
|
"math/big"
|
||||||
|
"q5"
|
||||||
|
"strings"
|
||||||
|
"sync"
|
||||||
)
|
)
|
||||||
|
|
||||||
type vip struct {
|
type vip struct {
|
||||||
@ -151,7 +151,7 @@ Withdraw 所有
|
|||||||
|
|
||||||
按时间排序处理事件的先后顺序
|
按时间排序处理事件的先后顺序
|
||||||
|
|
||||||
通过Vester.sol的remainingEsToken方法获取, 如果要本地计算的话, 那就取每次Deposit事件的时间和amount, 加上先前的转换的余额, 再按total * (now - deposit_time) / (365 * 24 * 2600)
|
通过Vester.sol的remainingEsToken方法获取, 如果要本地计算的话, 那就取每次Deposit事件的时间和amount, 加上先前的转换的余额, 再按total * (now - deposit_time) / (365 * 24 * 3600)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
func (this *vip) RecalcEsCecConvert(accountAddress string) error {
|
func (this *vip) RecalcEsCecConvert(accountAddress string) error {
|
||||||
@ -202,7 +202,7 @@ func (this *vip) RecalcEsCecConvert(accountAddress string) error {
|
|||||||
if lastDeposit != nil {
|
if lastDeposit != nil {
|
||||||
if nowTime > lastDeposit.chainTimestamp {
|
if nowTime > lastDeposit.chainTimestamp {
|
||||||
bnPassTime := new(big.Int).SetInt64(int64(nowTime - lastDeposit.chainTimestamp))
|
bnPassTime := new(big.Int).SetInt64(int64(nowTime - lastDeposit.chainTimestamp))
|
||||||
bnTotalTime := new(big.Int).SetInt64(int64(365 * 24 * 2600))
|
bnTotalTime := new(big.Int).SetInt64(int64(365 * 24 * 3600))
|
||||||
bnTmp := bnTotal.Mul(bnTotal, bnPassTime)
|
bnTmp := bnTotal.Mul(bnTotal, bnPassTime)
|
||||||
bnInterest := bnTmp.Div(bnTmp, bnTotalTime)
|
bnInterest := bnTmp.Div(bnTmp, bnTotalTime)
|
||||||
bnTotal = bnTotal.Sub(bnTotal, bnInterest)
|
bnTotal = bnTotal.Sub(bnTotal, bnInterest)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user