@@ -2,6 +2,7 @@ package cm_v3
22
33import (
44 "math/big"
5+ "math/rand/v2"
56
67 "github.com/Gearbox-protocol/sdk-go/core"
78 "github.com/Gearbox-protocol/sdk-go/core/schemas"
@@ -37,10 +38,10 @@ func NewCMv3(addr string, client core.ClientI, repo ds.RepositoryI, discoveredAt
3738 }
3839 mdl .SetParams (params )
3940 mdl .addCreditConfiguratorAdapter (mdl .GetDetailsByKey ("configurator" ))
40- mdl .Repo .UpdateFees (0 , "" , mdl .GetDetailsByKey ("configurator" ), params )
41+ mdl .Repo .UpdateFees (10000 + uint ( rand . Int ()) , "" , mdl .GetDetailsByKey ("configurator" ), params )
4142 configurator := mdl .GetDetailsByKey ("configurator" )
4243 tokenHash := common .HexToHash (mdl .GetUnderlyingToken ())
43- ltData , err := core .CallFuncGetSingleValue (mdl .Client , "0x78327438" , common .HexToAddress (configurator ), discoveredAt , tokenHash [:])
44+ ltData , err := core .CallFuncGetSingleValue (mdl .Client , "0x78327438" , common .HexToAddress (mdl . Address ), discoveredAt , tokenHash [:])
4445 if err == nil {
4546 lt := new (big.Int ).SetBytes (ltData )
4647 mdl .Repo .AddAllowedTokenV2 (0 , "" , configurator , & schemas.AllowedToken {
@@ -53,7 +54,7 @@ func NewCMv3(addr string, client core.ClientI, repo ds.RepositoryI, discoveredAt
5354 })
5455 log .Infof ("Liquidation threshold for cm %s is set to %s" , mdl .GetAddress (), lt )
5556 } else {
56- log .Warnf ("Liquidation threshold data is not set for cm %s, using default value %v." , mdl .GetAddress (), err )
57+ log .Fatalf ("Liquidation threshold data is not set for cm %s, using default value %v." , mdl .GetAddress (), err )
5758 }
5859 return mdl
5960}
0 commit comments