devnet

package
v0.0.0-...-a8a8cbe Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2021 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

package devnet contains constants and helper functions for the local deterministic devnet. See "Devnet addresses" in DEVELOP.md. Created by setup scripts/migrations.

Index

Constants

View Source
const (
	// id.json account filled by faucet.
	SolanaCLIAccount = "6sbzC1eH4FTujJXWj51eQe25cYvr4xfXbJ1vAj7j2k5J"

	// Hardcoded contract addresses.
	SolanaBridgeContract = "Bridge1p5gheXUvJ6jGWGeCsgPKgnE3YgdGKRVCMY9o"
	SolanaTokenContract  = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"

	// Native SPL token
	SolanaExampleToken              = "6qRhs8oAuZYLd4zzaNnQHqdRyknrQQWDWQhALEN8UA7M"
	SolanaExampleTokenOwningAccount = "3C3m4tjTy4nSMkkYdqCDSiCWEgpDa6whvprvABdFGBiW"

	// Wrapped ERC20 token
	SolanaExampleWrappedERCToken              = "85kW19uNvETzH43p3AfpyqPaQS5rWouq4x9rGiKUvihf"
	SolanaExampleWrappedERCTokenOwningAccount = "7EFk3VrWeb29SWJPQs5cUyqcY3fQd33S9gELkGybRzeu"

	// Wrapped CW20 token
	SolanaExampleWrappedCWToken              = "9ESkHLgJH4zqbG7fvhpC9u2ZeHMoLJznCHtaRLviEVRh"
	SolanaExampleWrappedCWTokenOwningAccount = "EERzaqe8Agm8p1ZkGQFq9zKpP7MDW29FX1pC1vEw9Yfv"

	// Lamports per SOL.
	SolanaDefaultPrecision = 1e9

	// ERC20 default precision.
	ERC20DefaultPrecision = 1e18

	// CW20 default precision.
	TerraDefaultPrecision = 1e8

	// Terra LCD url
	TerraLCDURL = "http://localhost:1317"

	// Terra test chain ID
	TerraChainID = "localterra"

	// Terra main test address to send/receive tokens
	TerraMainTestAddress    = "terra1x46rqay4d3cssq8gxxvqz8xt6nwlz4td20k38v"
	TerraMainTestAddressHex = "00000000000000000000000035743074956c710800e83198011ccbd4ddf1556d"

	// Terra token address
	TerraTokenAddress = "terra18vd8fpwxzck93qlwghaj6arh4p7c5n896xzem5"

	// Terra bridge contract address
	TerraBridgeAddress = "terra18eezxhys9jwku67cm4w84xhnzt4xjj77w2qt62"

	// Terra devnet fee payer mnemonic
	TerraFeePayerKey = "" /* 146-byte string literal not displayed */
)

Variables

View Source
var (
	// Ganache RPC URL
	GanacheRPCURL = "ws://localhost:8545"

	// Address of the first account, which is used as the default client account.
	GanacheClientDefaultAccountAddress = common.HexToAddress("0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1")

	// Contracts (deployed by "truffle migrate" on a deterministic devnet)
	GanacheBridgeContractAddress = common.HexToAddress("0xC89Ce4735882C9F0f0FE26686c53074E09B0D550")

	// ERC20 example tokens.
	GanacheExampleERC20Token        = common.HexToAddress("0xCfEB869F69431e42cdB54A4F4f105C19C080A601")
	GanacheExampleERC20WrappedSOL   = common.HexToAddress("0xf5b1d8fab1054b9cf7db274126972f97f9d42a11")
	GanacheExampleERC20WrappedTerra = common.HexToAddress("0x62b47a23cd900da982bdbe75aeb891d3ed18cc36")
)

Functions

func DeriveAccount

func DeriveAccount(accountIndex uint) accounts.Account

func DeterministicEcdsaKeyByIndex

func DeterministicEcdsaKeyByIndex(c elliptic.Curve, idx uint64) *ecdsa.PrivateKey

DeterministicEcdsaKeyByIndex generates a deterministic ecdsa.PrivateKey from a given index.

func DeterministicP2PPrivKeyByIndex

func DeterministicP2PPrivKeyByIndex(idx int64) crypto.PrivKey

DeterministicP2PPrivKeyByIndex generates a deterministic libp2p crypto.PrivateKey from a given index.

func DevnetGuardianSetVSS

func DevnetGuardianSetVSS(n uint) *vaa.VAA

DevnetGuardianSetVSS returns a VAA signed by guardian-0 that adds all n validators.

func GetDevnetIndex

func GetDevnetIndex() (int, error)

GetDevnetIndex returns the current host's devnet index (i.e. 0 for guardian-0).

func GetKeyedTransactor

func GetKeyedTransactor(ctx context.Context) *bind.TransactOpts

GetKeyedTransactor returns a transaction signer with the deterministic devnet key.

func MustBase58ToEthAddress

func MustBase58ToEthAddress(address string) (res vaa.Address)

Base58ToEthAddress converts a Solana base58 address to a 32-byte vaa.Address. Panics if the input data is invalid - intended for use on constants.

func SubmitVAA

func SubmitVAA(ctx context.Context, rpcURL string, vaa *vaa.VAA) (*types.Transaction, error)

SubmitVAA submits a VAA to the devnet chain using well-known accounts and contract addresses.

func Wallet

func Wallet() *hdwallet.Wallet

Types

This section is empty.

Jump to

Keyboard shortcuts

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