diff --git a/models/contract_register/on_log.go b/models/contract_register/on_log.go index 7712c52a..cb14165e 100644 --- a/models/contract_register/on_log.go +++ b/models/contract_register/on_log.go @@ -2,6 +2,7 @@ package contract_register import ( "github.com/Gearbox-protocol/sdk-go/core" + "github.com/Gearbox-protocol/sdk-go/log" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" @@ -11,6 +12,16 @@ import ( func (mdl *ContractRegister) OnLog(txLog types.Log) { blockNum := int64(txLog.BlockNumber) + if core.GetChainId(mdl.Client) != 1337 && (core.Topic("NewPoolAdded(address)") == txLog.Topics[0] || + core.Topic("NewCreditManagerAdded(address)") == txLog.Topics[0]) { + + address := common.HexToAddress(txLog.Topics[1].Hex()) + version := core.FetchVersionOptimized(address, 0, mdl.Client) + log.Info(version) + if version.MoreThanEq(core.NewVersion(300)) { + return + } + } switch txLog.Topics[0] { case core.Topic("NewPoolAdded(address)"): address := common.HexToAddress(txLog.Topics[1].Hex()).Hex()