Documentation
¶
Index ¶
- Constants
- Variables
- func CreateApproveERC20Txn(amount *big.Int, spender, rootERC20Token types.Address) (*ethgo.Transaction, error)
- func CreateMintTxn(receiver, rootTokenAddr types.Address, amount *big.Int) (*ethgo.Transaction, error)
- func GetECDSAKey(privateKey, accountDir, accountConfig string) (ethgo.Key, error)
- func GetRootchainID() (string, error)
- func GetRootchainPrivateKey(rawKey string) (ethgo.Key, error)
- func GetValidatorInfo(validatorAddr ethgo.Address, ...) (*polybft.ValidatorInfo, error)
- func ReadRootchainIP() (string, error)
Constants ¶
View Source
const ( TestAccountPrivKey = "aa75e9a7d427efc732f8e4f1a5b7646adcc61fd5bae40f80d13c8419c9f43d6d" TestModeFlag = "test" SupernetManagerFlag = "supernet-manager" SupernetManagerFlagDesc = "address of supernet manager contract" StakeManagerFlag = "stake-manager" StakeManagerFlagDesc = "address of stake manager contract" NativeRootTokenFlag = "native-root-token" NativeRootTokenFlagDesc = "address of native root token" GenesisPathFlag = "genesis" GenesisPathFlagDesc = "genesis file path, which contains chain configuration" DefaultGenesisPath = "./genesis.json" )
Variables ¶
View Source
var ( ErrRootchainNotFound = errors.New("rootchain not found") ErrRootchainPortBind = errors.New("port 8545 is not bind with localhost") )
Functions ¶
func CreateApproveERC20Txn ¶ added in v0.9.0
func CreateApproveERC20Txn(amount *big.Int, spender, rootERC20Token types.Address) (*ethgo.Transaction, error)
CreateApproveERC20Txn sends approve transaction to ERC20 token for spender so that it is able to spend given tokens
func CreateMintTxn ¶ added in v0.9.0
func CreateMintTxn(receiver, rootTokenAddr types.Address, amount *big.Int) (*ethgo.Transaction, error)
CreateMintTxn encodes parameters for mint function on rootchain token contract
func GetECDSAKey ¶ added in v0.9.0
GetECDSAKey returns the key based on provided parameters If private key is provided, it will return that key if not, it will return the key from the secrets manager
func GetRootchainID ¶
func GetRootchainPrivateKey ¶ added in v0.8.1
GetRootchainPrivateKey initializes a private key from provided raw private key
func GetValidatorInfo ¶ added in v0.9.0
func GetValidatorInfo(validatorAddr ethgo.Address, supernetManagerAddr, stakeManagerAddr types.Address, chainID int64, txRelayer txrelayer.TxRelayer) (*polybft.ValidatorInfo, error)
GetValidatorInfo queries SupernetManager smart contract on root and retrieves validator info for given address
func ReadRootchainIP ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.