func CreaterawtxOpreturn(rawtx, payload string) (string, error) {
	mtx, err := decodeRawtx2mtx(rawtx)
	if err != nil {
		return rawtx, fmt.Errorf("could not decode rawtx, %v", err)
	}
	b, err := hex.DecodeString(omniHex + payload)
	if err != nil {
		return rawtx, fmt.Errorf("could not decode payload, %v", err)
	}
	opreturnScript, err := txscript.NullDataScript(b)
	if err != nil {
		return rawtx, fmt.Errorf("failed to create opreturn data, %v", err)
	}
	mtx.AddTxOut(wire.NewTxOut(0, opreturnScript))
	return hexEncodeBTCTx(mtx)
}
CreaterawtxOpreturn Impl: https://github.com/OmniLayer/omnicore/blob/master/src/omnicore/doc/rpc-api.md#omni_createrawtx_opreturn
package omni
import (
	"bytes"
	"encoding/hex"
	"fmt"
	"github.com/btcsuite/btcd/btcjson"
	"github.com/btcsuite/btcd/chaincfg"
	"github.com/btcsuite/btcd/txscript"
	"github.com/btcsuite/btcd/wire"
	"github.com/btcsuite/btcutil"
)
func UtilCreatePayloadSimpleSend(propertyID uint, amount float64, divisible bool) (string, error) {
	var intPart int64
	if divisible {
		amt, err := btcutil.NewAmount(amount)
		if err != nil {
			return "", err
		}
		intPart = int64(amt)
	} else {
		intPart = int64(amount)
	}
	return fmt.Sprintf("%016x%016x", propertyID, intPart), nil
}
func GetClassCOpreturnDataScript(propertyID uint, amount float64, divisible bool) ([]byte, error) {
	payload, err := UtilCreatePayloadSimpleSend(propertyID, amount, divisible)
	if err != nil {
		return nil, err
	}
	b, err := hex.DecodeString(omniHex + payload)
	if err != nil {
		return nil, fmt.Errorf("could not decode payload, %v", err)
	}
	opreturnScript, err := txscript.NullDataScript(b)
	if err != nil {
		return nil, fmt.Errorf("failed to create opreturn data, %v", err)
	}
	return opreturnScript, nil
}