Skip to content

Commit

Permalink
update merge
Browse files Browse the repository at this point in the history
  • Loading branch information
cherry-yl-sh committed May 21, 2024
1 parent 37e82f1 commit 0b9f00f
Showing 1 changed file with 0 additions and 39 deletions.
39 changes: 0 additions & 39 deletions service/dashboard_service/dashboard_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,44 +203,6 @@ func GetSuitableStrategy(entryPointVersion global_const.EntrypointVersion, chain
},
Erc20TokenType: gasUseToken,
}
// GetSuitableStrategy get suitable strategy by entryPointVersion, chain,
//
// For Offical StrategyConfig,
func GetSuitableStrategy(entryPointVersion global_const.EntrypointVersion, chain global_const.Network, gasUseToken global_const.TokenType) (*model.Strategy, error) {
if entryPointVersion == "" {
entryPointVersion = global_const.EntrypointV06
}
gasToken := config.GetGasToken(chain)
entryPointAddress := config.GetEntrypointAddress(chain, entryPointVersion)
paymasterAddress := config.GetPaymasterAddress(chain, entryPointVersion)
payType := global_const.PayTypeVerifying
isPerc20Enable := false
if gasUseToken != "" {
payType = global_const.PayTypeERC20
if config.IsPErc20Token(gasUseToken) {
isPerc20Enable = true
}
}

strategy := &model.Strategy{
NetWorkInfo: &model.NetWorkInfo{
NetWork: chain,
GasToken: gasToken,
},
EntryPointInfo: &model.EntryPointInfo{
EntryPointVersion: entryPointVersion,
EntryPointAddress: entryPointAddress,
},
PaymasterInfo: &model.PaymasterInfo{
PayMasterAddress: paymasterAddress,
PayType: payType,
IsProjectErc20PayEnable: isPerc20Enable,
},
Erc20TokenType: gasUseToken,
}
if strategy == nil {
return nil, errors.New("strategy not found")
}
return strategy, nil
}

Expand All @@ -261,7 +223,6 @@ func IsPayMasterSupport(address string, chain global_const.Network) bool {
}

type ApiKeyDbModel struct {

model.BaseData
UserId int64 `gorm:"column:user_id;type:integer" json:"user_id"`
Disable bool `gorm:"column:disable;type:bool" json:"disable"`
Expand Down

0 comments on commit 0b9f00f

Please sign in to comment.