warp

package
v1.14.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 1, 2025 License: BSD-3-Clause Imports: 20 Imported by: 0

Documentation

Overview

Copyright (C) 2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.

Copyright (C) 2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.

Copyright (C) 2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.

Copyright (C) 2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.

Copyright (C) 2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildContracts

func BuildContracts(
	app *application.Lux,
) error

func DeployERC20Home

func DeployERC20Home(
	srcDir string,
	rpcURL string,
	privateKey string,
	warpRegistryAddress common.Address,
	warpManagerAddress common.Address,
	erc20TokenAddress common.Address,
	erc20TokenDecimals uint8,
) (common.Address, error)

func DeployERC20Remote

func DeployERC20Remote(
	srcDir string,
	rpcURL string,
	privateKey string,
	warpRegistryAddress common.Address,
	warpManagerAddress common.Address,
	tokenHomeBlockchainID [32]byte,
	tokenHomeAddress common.Address,
	tokenHomeDecimals uint8,
	tokenRemoteName string,
	tokenRemoteSymbol string,
	tokenRemoteDecimals uint8,
) (common.Address, error)

func DeployNativeHome

func DeployNativeHome(
	srcDir string,
	rpcURL string,
	privateKey string,
	warpRegistryAddress common.Address,
	warpManagerAddress common.Address,
	wrappedNativeTokenAddress common.Address,
) (common.Address, error)

func DeployNativeRemote

func DeployNativeRemote(
	srcDir string,
	rpcURL string,
	privateKey string,
	warpRegistryAddress common.Address,
	warpManagerAddress common.Address,
	tokenHomeBlockchainID [32]byte,
	tokenHomeAddress common.Address,
	tokenHomeDecimals uint8,
	nativeAssetSymbol string,
	initialReserveImbalance *big.Int,
	burnedFeesReportingRewardPercentage *big.Int,
) (common.Address, error)

func DeployWrappedNativeToken

func DeployWrappedNativeToken(
	srcDir string,
	rpcURL string,
	privateKey string,
	tokenSymbol string,
) (common.Address, error)

func DownloadRepo

func DownloadRepo(
	app *application.Lux,
	version string,
) error

func ERC20TokenHomeAddCollateral

func ERC20TokenHomeAddCollateral(
	rpcURL string,
	homeAddress common.Address,
	privateKey string,
	remoteBlockchainID [32]byte,
	remoteAddress common.Address,
	amount *big.Int,
) error

func ERC20TokenHomeGetTokenAddress

func ERC20TokenHomeGetTokenAddress(
	rpcURL string,
	address common.Address,
) (common.Address, error)

func ERC20TokenHomeSend

func ERC20TokenHomeSend(
	rpcURL string,
	homeAddress common.Address,
	privateKey string,
	destinationBlockchainID ids.ID,
	destinationWarpEndpoint common.Address,
	amountRecipient common.Address,
	amount *big.Int,
) (*types.Receipt, *types.Receipt, error)

func ERC20TokenRemoteGetTokenHomeAddress

func ERC20TokenRemoteGetTokenHomeAddress(
	rpcURL string,
	address common.Address,
) (common.Address, error)

func ERC20TokenRemoteSend

func ERC20TokenRemoteSend(
	rpcURL string,
	remoteAddress common.Address,
	privateKey string,
	destinationBlockchainID ids.ID,
	destinationWarpEndpoint common.Address,
	amountRecipient common.Address,
	amount *big.Int,
) (*types.Receipt, *types.Receipt, error)

func FoundryIsInstalled

func FoundryIsInstalled() bool

func GetForgePath

func GetForgePath() (string, error)

func GetTokenDecimals

func GetTokenDecimals(endpoint string, tokenAddress common.Address) (uint8, error)

func GetTokenParams

func GetTokenParams(endpoint string, tokenAddress common.Address) (string, string, uint8, error)

func InstallFoundry

func InstallFoundry() error

func NativeTokenHomeAddCollateral

func NativeTokenHomeAddCollateral(
	rpcURL string,
	homeAddress common.Address,
	privateKey string,
	remoteBlockchainID [32]byte,
	remoteAddress common.Address,
	amount *big.Int,
) error

func NativeTokenHomeGetTokenAddress

func NativeTokenHomeGetTokenAddress(
	rpcURL string,
	address common.Address,
) (common.Address, error)

func NativeTokenHomeSend

func NativeTokenHomeSend(
	rpcURL string,
	homeAddress common.Address,
	privateKey string,
	destinationBlockchainID ids.ID,
	destinationWarpEndpoint common.Address,
	amountRecipient common.Address,
	amount *big.Int,
) (*types.Receipt, error)

func NativeTokenRemoteGetTotalNativeAssetSupply

func NativeTokenRemoteGetTotalNativeAssetSupply(
	rpcURL string,
	address common.Address,
) (*big.Int, error)

func NativeTokenRemoteSend

func NativeTokenRemoteSend(
	rpcURL string,
	remoteAddress common.Address,
	privateKey string,
	destinationBlockchainID ids.ID,
	destinationWarpEndpoint common.Address,
	amountRecipient common.Address,
	amount *big.Int,
) (*types.Receipt, error)

func RegisterRemote

func RegisterRemote(
	rpcURL string,
	privateKey string,
	remoteAddress common.Address,
) error

func RepoDir

func RepoDir(
	app *application.Lux,
) (string, error)

func Send

func Send(
	rpcURL string,
	address common.Address,
	privateKey string,
	destinationBlockchainID ids.ID,
	destinationAddress common.Address,
	amountRecipient common.Address,
	amount *big.Int,
) (*types.Receipt, *types.Receipt, error)

func TokenHomeAddCollateral

func TokenHomeAddCollateral(
	rpcURL string,
	homeAddress common.Address,
	privateKey string,
	remoteBlockchainID [32]byte,
	remoteAddress common.Address,
	amount *big.Int,
) error

func TokenHomeGetDecimals

func TokenHomeGetDecimals(
	rpcURL string,
	address common.Address,
) (uint8, error)

func TokenRemoteIsCollateralized

func TokenRemoteIsCollateralized(
	rpcURL string,
	address common.Address,
) (bool, error)

Types

type EndpointKind

type EndpointKind int64
const (
	Undefined EndpointKind = iota
	ERC20TokenHome
	NativeTokenHome
	ERC20TokenRemote
	NativeTokenRemote
)

func GetEndpointKind

func GetEndpointKind(
	rpcURL string,
	address common.Address,
) (EndpointKind, error)

type RegisteredRemote

type RegisteredRemote struct {
	Registered       bool
	CollateralNeeded *big.Int
	TokenMultiplier  *big.Int
	MultiplyOnRemote bool
}

func TokenHomeGetRegisteredRemote

func TokenHomeGetRegisteredRemote(
	rpcURL string,
	address common.Address,
	remoteBlockchainID [32]byte,
	remoteAddress common.Address,
) (RegisteredRemote, error)

type TokenRemoteSettings

type TokenRemoteSettings struct {
	WarpRegistryAddress   common.Address
	WarpManager           common.Address
	TokenHomeBlockchainID [32]byte
	TokenHomeAddress      common.Address
	TokenHomeDecimals     uint8
}

type WarpFeeInfo

type WarpFeeInfo struct {
	FeeTokenAddress common.Address
	Amount          *big.Int
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL