Commit d87fbed 1 parent d1844f4 commit d87fbed Copy full SHA for d87fbed
File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import { Pool } from '../@types/schema'
16
16
import { BPool , FixedRateExchange , Dispenser } from '../@types/templates'
17
17
import { addPool , getOPC , getTemplates } from './utils/globalUtils'
18
18
import { weiToDecimal } from './utils/generic'
19
+ import { getToken } from './utils/tokenUtils'
19
20
20
21
export function handleNewPool ( event : NewPool ) : void {
21
22
BPool . create ( event . params . poolAddress )
@@ -74,8 +75,11 @@ export function handleTokenAdded(event: TokenAdded): void {
74
75
let existingTokens : string [ ]
75
76
if ( ! opc . approvedTokens ) existingTokens = [ ]
76
77
else existingTokens = opc . approvedTokens as string [ ]
77
- if ( ! existingTokens . includes ( event . params . token . toHexString ( ) ) )
78
- existingTokens . push ( event . params . token . toHexString ( ) )
78
+ if ( ! existingTokens . includes ( event . params . token . toHexString ( ) ) ) {
79
+ const newToken = getToken ( event . params . token , false )
80
+ existingTokens . push ( newToken . id )
81
+ }
82
+
79
83
opc . approvedTokens = existingTokens
80
84
81
85
opc . save ( )
You can’t perform that action at this time.
0 commit comments