Documentation ¶
Index ¶
- Constants
- Variables
- func ConstructErc20DepositData(destRecipient []byte, amount *big.Int) []byte
- func ConstructErc721DepositData(tokenId *big.Int, destRecipient []byte) []byte
- func ConstructGenericDepositData(metadata []byte) []byte
- func DeployAndMintErc20(client *Client, amount *big.Int) (common.Address, error)
- func DeployAssetStore(client *Client) (common.Address, error)
- func DeployMintApproveErc20(client *Client, erc20Handler common.Address, amount *big.Int) (common.Address, error)
- func Erc20AddMinter(client *Client, erc20Contract, handler common.Address) error
- func Erc20Approve(client *Client, erc20Contract, recipient common.Address, amount *big.Int) error
- func Erc20GetAllowance(client *Client, erc20Contract, owner, spender common.Address) (*big.Int, error)
- func Erc20GetBalance(client *Client, erc20Contract, account common.Address) (*big.Int, error)
- func Erc20GetResourceId(client *Client, handler common.Address, rId types.ResourceId) (common.Address, error)
- func Erc20Mint(client *Client, erc20Address, recipient common.Address, amount *big.Int) error
- func FundErc20Handler(client *Client, handlerAddress, erc20Address common.Address, amount *big.Int) error
- func GetDepositNonce(client *Client, bridgeCounter common.Address, chain types.ChainId) (uint64, error)
- func HashExists(client *Client, hash [32]byte, contract common.Address) (bool, error)
- func IsActive(status uint8) bool
- func IsExecuted(status uint8) bool
- func IsFinalized(status uint8) bool
- func RegisterResource(client *Client, bridge, handler common.Address, rId types.ResourceId, ...) error
- func SetBurnable(client *Client, bridge, contract common.Address, resourceId [32]byte) error
- func UpdateNonce(client *Client) error
- func WaitForTx(client *Client, tx *ethtypes.Transaction) error
- type Client
- type DeployedContracts
- type EventSig
- type ProposalStatus
Constants ¶
View Source
const DefaultGasLimit = 6721975
View Source
const DefaultMaxGasPrice = 20000000000
Variables ¶
View Source
var ( RelayerAddresses = []common.Address{ common.HexToAddress(keystore.TestKeyRing.EthereumKeys[keystore.AliceKey].Address()), common.HexToAddress(keystore.TestKeyRing.EthereumKeys[keystore.BobKey].Address()), common.HexToAddress(keystore.TestKeyRing.EthereumKeys[keystore.CharlieKey].Address()), common.HexToAddress(keystore.TestKeyRing.EthereumKeys[keystore.DaveKey].Address()), common.HexToAddress(keystore.TestKeyRing.EthereumKeys[keystore.EveKey].Address()), } ZeroAddress = common.HexToAddress("0x0000000000000000000000000000000000000000") )
View Source
var ExpectedBlockTime = time.Second
Functions ¶
func ConstructErc20DepositData ¶
constructErc20Data constructs the data field to be passed into a n erc20 deposit call
func ConstructErc721DepositData ¶
constructErc20Data constructs the data field to be passed into an erc721 deposit call
func DeployAndMintErc20 ¶
func DeployMintApproveErc20 ¶
func DeployMintApproveErc20(client *Client, erc20Handler common.Address, amount *big.Int) (common.Address, error)
DeployMintAndApprove deploys a new erc20 contract, mints to the deployer, and approves the erc20 handler to transfer those token.
func Erc20AddMinter ¶
func Erc20Approve ¶
func Erc20GetAllowance ¶
func Erc20GetBalance ¶
func Erc20GetResourceId ¶
func FundErc20Handler ¶
func GetDepositNonce ¶
func HashExists ¶
func IsExecuted ¶
func IsFinalized ¶
func RegisterResource ¶
func SetBurnable ¶
func UpdateNonce ¶
Types ¶
type Client ¶
type Client struct { Client *ethclient.Client Opts *bind.TransactOpts CallOpts *bind.CallOpts // contains filtered or unexported fields }
func (*Client) LockNonceAndUpdate ¶
func (*Client) UnlockNonce ¶
func (c *Client) UnlockNonce()
type DeployedContracts ¶
func DeployContracts ¶
func DeployContracts(client *Client, chainID uint8, initialRelayerThreshold *big.Int) (*DeployedContracts, error)
DeployContracts deploys Bridge, Relayer, ERC20Handler, ERC721Handler and CentrifugeAssetHandler and returns the addresses
type ProposalStatus ¶
type ProposalStatus int
const ( Inactive ProposalStatus = iota Active Passed Executed Cancelled )
Source Files ¶
Click to show internal directories.
Click to hide internal directories.