withdraw

package
v0.73.12 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: MIT Imports: 17 Imported by: 0

README

Withdraw tokens from ERC20 Bridge contract

This command is used to impersonate validators in the eyes of the ERC20 Bridge contract, so it allows withdrawing funds. This command ends up being handy when a network has crashed or is being reset but people didn't have time to withdraw their funds.

This requires private keys for all validators, and is meant for testnet ONLY.

Help

make build
./build/vegatools unsafe_withdraw_impersonate_validators --help

Running

Create the file validator-privkeys.json:

[
  "1111111111111111111111111111111111111111111111111111111111111111",
  "2222222222222222222222222222222222222222222222222222222222222222",
  "3333333333333333333333333333333333333333333333333333333333333333"
]

Then run:

make build
./build/vegatools unsafe_withdraw_impersonate_validators \
    --amount 100000 \
    --asset-address 0xaa... \
    --bridge-address 0xbb... \
    --priv-keys validator-privkeys.json

Then open a browser and:

  1. Open https://www.myetherwallet.com/
  2. Click "Access My Wallet"
  3. Click "MEW CX", accept terms and conditions, click "Access My Wallet"
  4. In the left nav, click "Contract", then "Interact with Contract"
  5. Contract address: the address of the ERC20 Bridge contract
  6. ABI JSON: Paste content from MultisigControl: ERC20_Bridge_Logic_ABI.json
  7. Select contract function: withdraw_asset
  8. Copy the command output values into the function parameters list
  9. Click "Write"

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PullWithdraw added in v0.53.0

func PullWithdraw(nodeAddress, outfile string) error

PullWithdraw ...

func UnsafeWithdrawImpersonateValidators

func UnsafeWithdrawImpersonateValidators(
	privKeys []string,
	receiverAddress string,
	ethereumAssetID string,
	bridgeAddress string,
	amountStr string,
) error

UnsafeWithdrawImpersonateValidators is the main function of `withdraw` package

Types

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store holds information about Key Store

func NewStore

func NewStore() *Store

NewStore creates new instance of Store

func (*Store) Import

func (s *Store) Import(privKey, passphrase string) (string, error)

Import gets account address from Key Store

func (*Store) SignWithPassphrase

func (s *Store) SignWithPassphrase(address, passphrase string, data []byte) ([]byte, error)

SignWithPassphrase sign to the Key Store

Jump to

Keyboard shortcuts

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