@@ -101,21 +101,21 @@ export function _handleRebind(
101
101
if ( tokenAddress != OCEAN ) {
102
102
pool . datatokenAddress = tokenAddress
103
103
}
104
- pool . tokenCount += BigInt . fromI32 ( 1 )
104
+ pool . tokenCount = pool . tokenCount . plus ( BigInt . fromI32 ( 1 ) )
105
105
const address = Address . fromString ( tokenAddress )
106
106
const denormWeight = hexToDecimal ( denormWeightStr , decimals )
107
107
const poolTokenId = poolId . concat ( '-' ) . concat ( address . toHexString ( ) )
108
108
let poolToken = PoolToken . load ( poolTokenId )
109
109
if ( poolToken == null ) {
110
110
createPoolTokenEntity ( poolTokenId , poolId , address . toHexString ( ) )
111
111
poolToken = PoolToken . load ( poolTokenId )
112
- pool . totalWeight += denormWeight
112
+ pool . totalWeight = pool . totalWeight . plus ( denormWeight )
113
113
} else {
114
114
const oldWeight = poolToken . denormWeight
115
115
if ( denormWeight > oldWeight ) {
116
- pool . totalWeight = pool . totalWeight + ( denormWeight - oldWeight )
116
+ pool . totalWeight = pool . totalWeight . plus ( denormWeight ) . minus ( oldWeight )
117
117
} else {
118
- pool . totalWeight = pool . totalWeight - ( oldWeight - denormWeight )
118
+ pool . totalWeight = pool . totalWeight . minus ( oldWeight ) . minus ( denormWeight )
119
119
}
120
120
}
121
121
@@ -451,9 +451,9 @@ export function handleTransfer(event: Transfer): void {
451
451
createPoolShareEntity ( poolShareToId , poolId , event . params . to . toHex ( ) )
452
452
poolShareTo = PoolShare . load ( poolShareToId )
453
453
}
454
- poolShareTo . balance += value
454
+ poolShareTo . balance = poolShareTo . balance . plus ( value )
455
455
poolShareTo . save ( )
456
- pool . totalShares += value
456
+ pool . totalShares = pool . totalShares . plus ( value )
457
457
if ( poolTx != null ) {
458
458
poolTx . sharesTransferAmount = value
459
459
poolTx . sharesBalance = poolShareTo . balance
@@ -474,11 +474,11 @@ export function handleTransfer(event: Transfer): void {
474
474
createPoolShareEntity ( poolShareFromId , poolId , event . params . from . toHex ( ) )
475
475
poolShareFrom = PoolShare . load ( poolShareFromId )
476
476
}
477
- poolShareFrom . balance -= value
477
+ poolShareFrom . balance = poolShareFrom . balance . minus ( value )
478
478
poolShareFrom . save ( )
479
- pool . totalShares -= value
479
+ pool . totalShares = pool . totalShares . minus ( value )
480
480
if ( poolTx != null ) {
481
- poolTx . sharesTransferAmount = - value
481
+ poolTx . sharesTransferAmount = poolTx . sharesTransferAmount . minus ( value )
482
482
poolTx . sharesBalance = poolShareFrom . balance
483
483
}
484
484
debuglog (
@@ -497,14 +497,14 @@ export function handleTransfer(event: Transfer): void {
497
497
createPoolShareEntity ( poolShareToId , poolId , event . params . to . toHex ( ) )
498
498
poolShareTo = PoolShare . load ( poolShareToId )
499
499
}
500
- poolShareTo . balance . plus ( value )
500
+ poolShareTo . balance = poolShareTo . balance . plus ( value )
501
501
poolShareTo . save ( )
502
502
503
503
if ( poolShareFrom == null ) {
504
504
createPoolShareEntity ( poolShareFromId , poolId , event . params . from . toHex ( ) )
505
505
poolShareFrom = PoolShare . load ( poolShareFromId )
506
506
}
507
- poolShareFrom . balance . minus ( value )
507
+ poolShareFrom . balance = poolShareFrom . balance . minus ( value )
508
508
poolShareFrom . save ( )
509
509
debuglog (
510
510
'pool shares transfer: ' +
@@ -527,15 +527,15 @@ export function handleTransfer(event: Transfer): void {
527
527
poolShareTo . balance . notEqual ( ZERO_BD ) &&
528
528
poolShareToBalance . equals ( ZERO_BD )
529
529
) {
530
- pool . holderCount . plus ( BigInt . fromI32 ( 1 ) )
530
+ pool . holderCount = pool . holderCount . plus ( BigInt . fromI32 ( 1 ) )
531
531
}
532
532
533
533
if (
534
534
poolShareFrom != null &&
535
535
poolShareFrom . balance . equals ( ZERO_BD ) &&
536
536
poolShareFromBalance . notEqual ( ZERO_BD )
537
537
) {
538
- pool . holderCount . plus ( BigInt . fromI32 ( 1 ) )
538
+ pool . holderCount = pool . holderCount . plus ( BigInt . fromI32 ( 1 ) )
539
539
}
540
540
541
541
if ( poolTx != null ) {
0 commit comments