mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 21:31:37 +00:00
- Solidity Upgraded up to v0.8.0 - Fixed and Added eth_chainId - Fix error in TransactionRecipet - Reward halving issue fixed
42 lines
1.4 KiB
Go
42 lines
1.4 KiB
Go
package XDCx
|
|
|
|
import (
|
|
"math/big"
|
|
|
|
"github.com/XinFinOrg/XDPoSChain/accounts/abi/bind"
|
|
"github.com/XinFinOrg/XDPoSChain/common"
|
|
"github.com/XinFinOrg/XDPoSChain/contracts/XDCx/contract"
|
|
)
|
|
|
|
type RelayerRegistration struct {
|
|
*contract.RelayerRegistrationSession
|
|
contractBackend bind.ContractBackend
|
|
}
|
|
|
|
func NewRelayerRegistration(transactOpts *bind.TransactOpts, contractAddr common.Address, contractBackend bind.ContractBackend) (*RelayerRegistration, error) {
|
|
smartContract, err := contract.NewRelayerRegistration(contractAddr, contractBackend)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return &RelayerRegistration{
|
|
&contract.RelayerRegistrationSession{
|
|
Contract: smartContract,
|
|
TransactOpts: *transactOpts,
|
|
},
|
|
contractBackend,
|
|
}, nil
|
|
}
|
|
|
|
func DeployRelayerRegistration(transactOpts *bind.TransactOpts, contractBackend bind.ContractBackend, XDCxListing common.Address, maxRelayers *big.Int, maxTokenList *big.Int, minDeposit *big.Int) (common.Address, *RelayerRegistration, error) {
|
|
contractAddr, _, _, err := contract.DeployRelayerRegistration(transactOpts, contractBackend, XDCxListing, maxRelayers, maxTokenList, minDeposit)
|
|
if err != nil {
|
|
return contractAddr, nil, err
|
|
}
|
|
smartContract, err := NewRelayerRegistration(transactOpts, contractAddr, contractBackend)
|
|
if err != nil {
|
|
return contractAddr, nil, err
|
|
}
|
|
|
|
return contractAddr, smartContract, nil
|
|
}
|