Documentation ¶
Index ¶
- Constants
- Variables
- func ApproveErc721(client *Client, contractAddress, recipient common.Address, tokenId *big.Int) error
- func ConstructErc20DepositData(destRecipient []byte, amount *big.Int) []byte
- func ConstructErc721DepositData(tokenId *big.Int, destRecipient []byte) []byte
- func ConstructGenericDepositData(metadata []byte) []byte
- func CreateFunctionSignature(sig string) [4]byte
- func DeployAndMintErc20(client *Client, amount *big.Int) (common.Address, error)
- func DeployAssetStore(client *Client) (common.Address, error)
- func DeployErc721(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 msg.ResourceId) (common.Address, error)
- func Erc20Mint(client *Client, erc20Address, recipient common.Address, amount *big.Int) error
- func Erc721AddMinter(client *Client, erc721Contract common.Address, minter common.Address) error
- func Erc721GetTokenURI(client *Client, erc721Contract common.Address, tokenId *big.Int) (string, error)
- func Erc721Mint(client *Client, erc721Contract common.Address, id *big.Int, metadata []byte) error
- func FundErc20Handler(client *Client, handlerAddress, erc20Address common.Address, amount *big.Int) error
- func FundErc721Handler(client *Client, handlerAddress, erc721Address common.Address, tokenId *big.Int) error
- func GetDepositNonce(client *Client, bridge common.Address, chain msg.ChainId) (uint64, error)
- func GetGenericResourceAddress(client *Client, handler common.Address, rId msg.ResourceId) (common.Address, error)
- func Hash(data []byte) [32]byte
- func HashExists(client *Client, hash [32]byte, contract common.Address) (bool, error)
- func IDAndNonce(srcId msg.ChainId, nonce msg.Nonce) *big.Int
- func IsActive(status uint8) bool
- func IsExecuted(status uint8) bool
- func IsFinalized(status uint8) bool
- func OwnerOf(client *Client, erc721Contract common.Address, tokenId *big.Int) (common.Address, error)
- func RegisterGenericResource(client *Client, bridge, handler common.Address, rId msg.ResourceId, ...) error
- func RegisterResource(client *Client, bridge, handler common.Address, rId msg.ResourceId, ...) error
- func SetBurnable(client *Client, bridge, handler, contract common.Address) 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 DefaultGasMultiplier = 1
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
View Source
var StoreFunctionSig = CreateFunctionSignature("store(bytes32)")
Functions ¶
func ApproveErc721 ¶
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 CreateFunctionSignature ¶
CreateFunctionSignature hashes the function signature and returns the first 4 bytes
func DeployAndMintErc20 ¶
func DeployErc721 ¶
DeployMintAndApprove deploys a new erc721 contract, mints to the deployer, and approves the erc20 handler to transfer those token.
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 Erc721AddMinter ¶
func Erc721GetTokenURI ¶
func Erc721Mint ¶
func FundErc20Handler ¶
func FundErc721Handler ¶
func GetDepositNonce ¶
func HashExists ¶
func IsExecuted ¶
func IsFinalized ¶
func RegisterGenericResource ¶
func RegisterResource ¶
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 ¶
type DeployedContracts struct { BridgeAddress common.Address ERC20HandlerAddress common.Address ERC721HandlerAddress common.Address GenericHandlerAddress common.Address }
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.