@@ -3,7 +3,8 @@ package services
33import (
44 "encoding/hex"
55 "reflect"
6- "strings"
6+ "strings"
7+
78 "github.com/Gearbox-protocol/sdk-go/artifacts/multicall"
89 "github.com/Gearbox-protocol/sdk-go/core"
910 "github.com/Gearbox-protocol/sdk-go/log"
@@ -48,7 +49,7 @@ func (ep *ExecuteParser) getMainEvents(call *trace_service.Call, creditFacade co
4849 "e3f46b26" , // liquidateCreditAccount (v3) // v310, v3
4950 "36b2ced3" , // closeCreditAccount(creditAccount,to,skipTokenMask,convertToETH,calls) // v310, v3
5051 // "5d91a0e0", // liquidateCreditAccount
51- // "85589e10", //Partial
52+ // "85589e10", //Partial
5253 "92beab1d" : // openCreditAccount(onBehalfOf,calls,referralCode) // v310, v3
5354 // log.Info("v3 main event", call.Input[2:10])
5455 event , err := getCreditFacadeMainEvent (call .To , call .Input , creditFacadev3Parser )
@@ -79,8 +80,6 @@ func init() {
7980 creditFacadev2Parser = core .GetAbi ("CreditFacade" )
8081 creditFacadev3Parser = core .GetAbi ("CreditFacadev3" )
8182
82-
83-
8483}
8584func getABI (data string ) * abi.ABI {
8685 abi , err := abi .JSON (strings .NewReader (data ))
@@ -89,11 +88,8 @@ func getABI(data string) *abi.ABI {
8988}
9089
9190var pp = "[{\" inputs\" :[{\" internalType\" :\" address\" ,\" name\" :\" creditAccount\" ,\" type\" :\" address\" },{\" internalType\" :\" address\" ,\" name\" :\" token\" ,\" type\" :\" address\" },{\" internalType\" :\" uint256\" ,\" name\" :\" repaidAmount\" ,\" type\" :\" uint256\" },{\" internalType\" :\" uint256\" ,\" name\" :\" minSeizedAmount\" ,\" type\" :\" uint256\" },{\" internalType\" :\" address\" ,\" name\" :\" to\" ,\" type\" :\" address\" },{\" components\" :[{\" internalType\" :\" address\" ,\" name\" :\" priceFeed\" ,\" type\" :\" address\" },{\" internalType\" :\" bytes\" ,\" name\" :\" data\" ,\" type\" :\" bytes\" }],\" internalType\" :\" struct PriceUpdate[]\" ,\" name\" :\" priceUpdates\" ,\" type\" :\" tuple[]\" }],\" name\" :\" partiallyLiquidateCreditAccount\" ,\" outputs\" :[{\" internalType\" :\" uint256\" ,\" name\" :\" seizedAmount\" ,\" type\" :\" uint256\" }],\" stateMutability\" :\" nonpayable\" ,\" type\" :\" function\" }]"
91+
9292func getCreditFacadeMainEvent (contract string , input string , parser * abi.ABI ) (* ds.FacadeCallNameWithMulticall , error ) {
93- a := input [2 :10 ] == "85589e10"
94- if a {
95- parser = getABI (pp )
96- }
9793 hexData , err := hex .DecodeString (input [2 :])
9894 if err != nil {
9995 return nil , err
@@ -112,7 +108,7 @@ parser = getABI(pp)
112108 Target common.Address `json:"target"`
113109 CallData []uint8 `json:"callData"`
114110 })
115- if ! ok && ! a {
111+ if ! ok {
116112 log .Fatal ("calls type is different the creditFacade multicall: " , reflect .TypeOf (data ["calls" ]))
117113 }
118114 multicalls := []multicall.Multicall2Call {}
0 commit comments