This commit is contained in:
aozhiwei 2024-10-15 17:47:46 +08:00
commit ea36a05b14

View File

@ -1,12 +1,12 @@
package service
import (
"q5"
"f5"
"sync"
"strings"
"main/constant"
"math/big"
"q5"
"strings"
"sync"
)
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 {
@ -202,7 +202,7 @@ func (this *vip) RecalcEsCecConvert(accountAddress string) error {
if lastDeposit != nil {
if 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)
bnInterest := bnTmp.Div(bnTmp, bnTotalTime)
bnTotal = bnTotal.Sub(bnTotal, bnInterest)