packageethimport("errors""fmt""math""math/big""github.com/ethereum/go-ethereum/accounts/abi""github.com/ethereum/go-ethereum/params")funcGweiToWei(gweifloat64)(*big.Int,error){ifmath.IsNaN(gwei)||math.IsInf(gwei,0){returnnil,fmt.Errorf("invalid gwei value: %v",gwei)}// convert float GWei value into integer Wei valuewei,_:=new(big.Float).Mul(big.NewFloat(gwei),big.NewFloat(params.GWei)).Int(nil)ifwei.Cmp(abi.MaxUint256)==1{returnnil,errors.New("gwei value larger than max uint256")}returnwei,nil}