@@ -50,6 +50,13 @@ import {
50
50
import { CommissionSharesSold , ExitedCommissionShares } from '../generated/templates/ERC1155/Liquid1155' ;
51
51
import { getOrCreateBalance } from './vPool.mapping' ;
52
52
import { pushEntryToSummaries } from './utils/rewards' ;
53
+ import { Upgraded } from '../generated/templates/TUPProxy/TUPProxy' ;
54
+ import { IntegrationChannel } from '../generated/schema' ;
55
+ import {
56
+ CHANNEL_LIQUID_20_A_vPOOL_BYTES32 ,
57
+ CHANNEL_LIQUID_20_C_vPOOL_BYTES32 ,
58
+ CHANNEL_NATIVE_20_vPOOL_BYTES32
59
+ } from './utils/IntegrationChannel.utils' ;
53
60
54
61
function snapshotSupply ( event : ethereum . Event ) : void {
55
62
const blockId = event . block . number ;
@@ -703,3 +710,18 @@ export function handleSetPoolPercentages(event: SetPoolPercentages): void {
703
710
pool ! . save ( ) ;
704
711
}
705
712
}
713
+
714
+ export function handleUpgraded ( event : Upgraded ) : void {
715
+ const erc20 = ERC20 . load ( event . address ) ;
716
+
717
+ if ( event . params . implementation . equals ( IntegrationChannel . load ( CHANNEL_NATIVE_20_vPOOL_BYTES32 ) . implementation ) ) {
718
+ erc20 ! . type = 'Native20' ;
719
+ } else if ( event . params . implementation . equals ( IntegrationChannel . load ( CHANNEL_LIQUID_20_A_vPOOL_BYTES32 ) . implementation ) ) {
720
+ erc20 ! . type = 'Liquid20A' ;
721
+ } else if ( event . params . implementation . equals ( IntegrationChannel . load ( CHANNEL_LIQUID_20_C_vPOOL_BYTES32 ) . implementation ) ) {
722
+ erc20 ! . type = 'Liquid20C' ;
723
+ }
724
+ erc20 ! . editedAt = event . block . timestamp ;
725
+ erc20 ! . editedAtBlock = event . block . number ;
726
+ erc20 ! . save ( ) ;
727
+ }
0 commit comments