eth

package
v0.4.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2021 License: BlueOak-1.0.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

View Source
const ETHSwapRuntimeBin = "" /* 5104-byte string literal not displayed */

Variables

View Source
var ETHSwapABI = ETHSwapMetaData.ABI

ETHSwapABI is the input ABI used to generate the binding from. Deprecated: Use ETHSwapMetaData.ABI instead.

View Source
var ETHSwapBin = ETHSwapMetaData.Bin

ETHSwapBin is the compiled bytecode used for deploying new contracts. Deprecated: Use ETHSwapMetaData.Bin instead.

View Source
var ETHSwapFuncSigs = ETHSwapMetaData.Sigs

Deprecated: Use ETHSwapMetaData.Sigs instead. ETHSwapFuncSigs maps the 4-byte function signature to its string representation.

View Source
var ETHSwapMetaData = &bind.MetaData{
	ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"refundTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"secretHash\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"participant\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"internalType\":\"structETHSwap.Initiation[]\",\"name\":\"initiations\",\"type\":\"tuple[]\"}],\"name\":\"initiate\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"secretHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"secret\",\"type\":\"bytes32\"}],\"name\":\"isRedeemable\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"secret\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"secretHash\",\"type\":\"bytes32\"}],\"internalType\":\"structETHSwap.Redemption[]\",\"name\":\"redemptions\",\"type\":\"tuple[]\"}],\"name\":\"redeem\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"secretHash\",\"type\":\"bytes32\"}],\"name\":\"refund\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"secretHash\",\"type\":\"bytes32\"}],\"name\":\"swap\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"secret\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"initBlockNumber\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"refundBlockTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"initiator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"participant\",\"type\":\"address\"},{\"internalType\":\"enumETHSwap.State\",\"name\":\"state\",\"type\":\"uint8\"}],\"internalType\":\"structETHSwap.Swap\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"swaps\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"secret\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"initBlockNumber\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"refundBlockTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"initiator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"participant\",\"type\":\"address\"},{\"internalType\":\"enumETHSwap.State\",\"name\":\"state\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]",
	Sigs: map[string]string{
		"a8793f94": "initiate((uint256,bytes32,address,uint256)[])",
		"bfd2fd97": "isRedeemable(bytes32,bytes32)",
		"f4fd17f9": "redeem((bytes32,bytes32)[])",
		"7249fbb6": "refund(bytes32)",
		"76467cbd": "swap(bytes32)",
		"eb84e7f2": "swaps(bytes32)",
	},
	Bin: "0x608060405234801561001057600080fd5b506109f8806100206000396000f3fe6080604052600436106100555760003560e01c80637249fbb61461005a57806376467cbd1461007c578063a8793f94146100b2578063bfd2fd97146100c5578063eb84e7f2146100f5578063f4fd17f914610171575b600080fd5b34801561006657600080fd5b5061007a6100753660046107eb565b610191565b005b34801561008857600080fd5b5061009c6100973660046107eb565b6102a6565b6040516100a991906108e8565b60405180910390f35b61007a6100c0366004610713565b610381565b3480156100d157600080fd5b506100e56100e036600461081d565b6104ad565b60405190151581526020016100a9565b34801561010157600080fd5b5061015e6101103660046107eb565b60006020819052908152604090208054600182015460028301546003840154600485015460059095015493949293919290916001600160a01b0391821691811690600160a01b900460ff1687565b6040516100a9979695949392919061089c565b34801561017d57600080fd5b5061007a61018c366004610788565b610584565b32331461019d57600080fd5b806001600082815260208190526040902060050154600160a01b900460ff1660038111156101cd576101cd610996565b146101d757600080fd5b6000818152602081905260409020600401546001600160a01b031633146101fd57600080fd5b6000818152602081905260409020600301544281111561021c57600080fd5b60008381526020819052604080822060058101805460ff60a01b1916600360a01b1790556001015490513391905b60006040518083038185875af1925050503d8060008114610287576040519150601f19603f3d011682016040523d82523d6000602084013e61028c565b606091505b50909150506001811515146102a057600080fd5b50505050565b6102e36040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a081018290529060c082015290565b60008281526020818152604091829020825160e08101845281548152600182015492810192909252600281015492820192909252600380830154606083015260048301546001600160a01b039081166080840152600584015490811660a084015291929160c0840191600160a01b90910460ff169081111561036757610367610996565b600381111561037857610378610996565b90525092915050565b32331461038d57600080fd5b6000805b8281101561049b57368484838181106103ac576103ac6109ac565b9050608002019050600080600083602001358152602001908152602001600020905060008260600135116103df57600080fd5b81356103ea57600080fd5b60006005820154600160a01b900460ff16600381111561040c5761040c610996565b1461041657600080fd5b436002820155813560038201556004810180546001600160a01b0319163317905561044760608301604084016106ea565b6005820180546060850135600185018190556001600160a01b03939093166001600160a81b031990911617600160a01b179055610484908561094d565b93505050808061049390610965565b915050610391565b503481146104a857600080fd5b505050565b60006001600084815260208190526040902060050154600160a01b900460ff1660038111156104de576104de610996565b14801561050457506000838152602081905260409020600501546001600160a01b031633145b801561057d57508260028360405160200161052191815260200190565b60408051601f198184030181529082905261053b91610861565b602060405180830381855afa158015610558573d6000803e3d6000fd5b5050506040513d601f19601f8201168201806040525081019061057b9190610804565b145b9392505050565b32331461059057600080fd5b6000805b828110156106d457368484838181106105af576105af6109ac565b6020604091820293909301838101356000908152938490529220919250600190506005820154600160a01b900460ff1660038111156105f0576105f0610996565b146105fa57600080fd5b60058101546001600160a01b0316331461061357600080fd5b81602001356002836000013560405160200161063191815260200190565b60408051601f198184030181529082905261064b91610861565b602060405180830381855afa158015610668573d6000803e3d6000fd5b5050506040513d601f19601f8201168201806040525081019061068b9190610804565b1461069557600080fd5b60058101805460ff60a01b1916600160a11b1790558135815560018101546106bd908561094d565b9350505080806106cc90610965565b915050610594565b506000336001600160a01b03168260405161024a565b6000602082840312156106fc57600080fd5b81356001600160a01b038116811461057d57600080fd5b6000806020838503121561072657600080fd5b823567ffffffffffffffff8082111561073e57600080fd5b818501915085601f83011261075257600080fd5b81358181111561076157600080fd5b8660208260071b850101111561077657600080fd5b60209290920196919550909350505050565b6000806020838503121561079b57600080fd5b823567ffffffffffffffff808211156107b357600080fd5b818501915085601f8301126107c757600080fd5b8135818111156107d657600080fd5b8660208260061b850101111561077657600080fd5b6000602082840312156107fd57600080fd5b5035919050565b60006020828403121561081657600080fd5b5051919050565b6000806040838503121561083057600080fd5b50508035926020909101359150565b6004811061085d57634e487b7160e01b600052602160045260246000fd5b9052565b6000825160005b818110156108825760208186018101518583015201610868565b81811115610891576000828501525b509190910192915050565b8781526020810187905260408101869052606081018590526001600160a01b038481166080830152831660a082015260e081016108dc60c083018461083f565b98975050505050505050565b600060e08201905082518252602083015160208301526040830151604083015260608301516060830152608083015160018060a01b0380821660808501528060a08601511660a0850152505060c083015161094660c084018261083f565b5092915050565b6000821982111561096057610960610980565b500190565b600060001982141561097957610979610980565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603260045260246000fdfea2646970667358221220aabe46bd3b24f22b9df02893c3ee5bf05defb2833d18f954ba6014f5dbb9d2ee64736f6c63430008060033",
}

ETHSwapMetaData contains all meta data concerning the ETHSwap contract.

View Source
var UnitInfo = dex.UnitInfo{
	AtomicUnit: "gwei",
	Conventional: dex.Denomination{
		Unit:             "ETH",
		ConversionFactor: 1e9,
	},
}

Functions

This section is empty.

Types

type ETHSwap

type ETHSwap struct {
	ETHSwapCaller     // Read-only binding to the contract
	ETHSwapTransactor // Write-only binding to the contract
	ETHSwapFilterer   // Log filterer for contract events
}

ETHSwap is an auto generated Go binding around an Ethereum contract.

func DeployETHSwap

func DeployETHSwap(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *ETHSwap, error)

DeployETHSwap deploys a new Ethereum contract, binding an instance of ETHSwap to it.

func NewETHSwap

func NewETHSwap(address common.Address, backend bind.ContractBackend) (*ETHSwap, error)

NewETHSwap creates a new instance of ETHSwap, bound to a specific deployed contract.

type ETHSwapCaller

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

ETHSwapCaller is an auto generated read-only Go binding around an Ethereum contract.

func NewETHSwapCaller

func NewETHSwapCaller(address common.Address, caller bind.ContractCaller) (*ETHSwapCaller, error)

NewETHSwapCaller creates a new read-only instance of ETHSwap, bound to a specific deployed contract.

func (*ETHSwapCaller) IsRedeemable

func (_ETHSwap *ETHSwapCaller) IsRedeemable(opts *bind.CallOpts, secretHash [32]byte, secret [32]byte) (bool, error)

IsRedeemable is a free data retrieval call binding the contract method 0xbfd2fd97.

Solidity: function isRedeemable(bytes32 secretHash, bytes32 secret) view returns(bool)

func (*ETHSwapCaller) Swap

func (_ETHSwap *ETHSwapCaller) Swap(opts *bind.CallOpts, secretHash [32]byte) (ETHSwapSwap, error)

Swap is a free data retrieval call binding the contract method 0x76467cbd.

Solidity: function swap(bytes32 secretHash) view returns((bytes32,uint256,uint256,uint256,address,address,uint8))

func (*ETHSwapCaller) Swaps

func (_ETHSwap *ETHSwapCaller) Swaps(opts *bind.CallOpts, arg0 [32]byte) (struct {
	Secret               [32]byte
	Value                *big.Int
	InitBlockNumber      *big.Int
	RefundBlockTimestamp *big.Int
	Initiator            common.Address
	Participant          common.Address
	State                uint8
}, error)

Swaps is a free data retrieval call binding the contract method 0xeb84e7f2.

Solidity: function swaps(bytes32 ) view returns(bytes32 secret, uint256 value, uint256 initBlockNumber, uint256 refundBlockTimestamp, address initiator, address participant, uint8 state)

type ETHSwapCallerRaw

type ETHSwapCallerRaw struct {
	Contract *ETHSwapCaller // Generic read-only contract binding to access the raw methods on
}

ETHSwapCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.

func (*ETHSwapCallerRaw) Call

func (_ETHSwap *ETHSwapCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error

Call invokes the (constant) contract method with params as input values and sets the output to result. The result type might be a single field for simple returns, a slice of interfaces for anonymous returns and a struct for named returns.

type ETHSwapCallerSession

type ETHSwapCallerSession struct {
	Contract *ETHSwapCaller // Generic contract caller binding to set the session for
	CallOpts bind.CallOpts  // Call options to use throughout this session
}

ETHSwapCallerSession is an auto generated read-only Go binding around an Ethereum contract, with pre-set call options.

func (*ETHSwapCallerSession) IsRedeemable

func (_ETHSwap *ETHSwapCallerSession) IsRedeemable(secretHash [32]byte, secret [32]byte) (bool, error)

IsRedeemable is a free data retrieval call binding the contract method 0xbfd2fd97.

Solidity: function isRedeemable(bytes32 secretHash, bytes32 secret) view returns(bool)

func (*ETHSwapCallerSession) Swap

func (_ETHSwap *ETHSwapCallerSession) Swap(secretHash [32]byte) (ETHSwapSwap, error)

Swap is a free data retrieval call binding the contract method 0x76467cbd.

Solidity: function swap(bytes32 secretHash) view returns((bytes32,uint256,uint256,uint256,address,address,uint8))

func (*ETHSwapCallerSession) Swaps

func (_ETHSwap *ETHSwapCallerSession) Swaps(arg0 [32]byte) (struct {
	Secret               [32]byte
	Value                *big.Int
	InitBlockNumber      *big.Int
	RefundBlockTimestamp *big.Int
	Initiator            common.Address
	Participant          common.Address
	State                uint8
}, error)

Swaps is a free data retrieval call binding the contract method 0xeb84e7f2.

Solidity: function swaps(bytes32 ) view returns(bytes32 secret, uint256 value, uint256 initBlockNumber, uint256 refundBlockTimestamp, address initiator, address participant, uint8 state)

type ETHSwapFilterer

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

ETHSwapFilterer is an auto generated log filtering Go binding around an Ethereum contract events.

func NewETHSwapFilterer

func NewETHSwapFilterer(address common.Address, filterer bind.ContractFilterer) (*ETHSwapFilterer, error)

NewETHSwapFilterer creates a new log filterer instance of ETHSwap, bound to a specific deployed contract.

type ETHSwapInitiation

type ETHSwapInitiation struct {
	RefundTimestamp *big.Int
	SecretHash      [32]byte
	Participant     common.Address
	Value           *big.Int
}

ETHSwapInitiation is an auto generated low-level Go binding around an user-defined struct.

type ETHSwapRaw

type ETHSwapRaw struct {
	Contract *ETHSwap // Generic contract binding to access the raw methods on
}

ETHSwapRaw is an auto generated low-level Go binding around an Ethereum contract.

func (*ETHSwapRaw) Call

func (_ETHSwap *ETHSwapRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error

Call invokes the (constant) contract method with params as input values and sets the output to result. The result type might be a single field for simple returns, a slice of interfaces for anonymous returns and a struct for named returns.

func (*ETHSwapRaw) Transact

func (_ETHSwap *ETHSwapRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error)

Transact invokes the (paid) contract method with params as input values.

func (*ETHSwapRaw) Transfer

func (_ETHSwap *ETHSwapRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error)

Transfer initiates a plain transaction to move funds to the contract, calling its default method if one is available.

type ETHSwapRedemption

type ETHSwapRedemption struct {
	Secret     [32]byte
	SecretHash [32]byte
}

ETHSwapRedemption is an auto generated low-level Go binding around an user-defined struct.

type ETHSwapSession

type ETHSwapSession struct {
	Contract     *ETHSwap          // Generic contract binding to set the session for
	CallOpts     bind.CallOpts     // Call options to use throughout this session
	TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
}

ETHSwapSession is an auto generated Go binding around an Ethereum contract, with pre-set call and transact options.

func (*ETHSwapSession) Initiate

func (_ETHSwap *ETHSwapSession) Initiate(initiations []ETHSwapInitiation) (*types.Transaction, error)

Initiate is a paid mutator transaction binding the contract method 0xa8793f94.

Solidity: function initiate((uint256,bytes32,address,uint256)[] initiations) payable returns()

func (*ETHSwapSession) IsRedeemable

func (_ETHSwap *ETHSwapSession) IsRedeemable(secretHash [32]byte, secret [32]byte) (bool, error)

IsRedeemable is a free data retrieval call binding the contract method 0xbfd2fd97.

Solidity: function isRedeemable(bytes32 secretHash, bytes32 secret) view returns(bool)

func (*ETHSwapSession) Redeem

func (_ETHSwap *ETHSwapSession) Redeem(redemptions []ETHSwapRedemption) (*types.Transaction, error)

Redeem is a paid mutator transaction binding the contract method 0xf4fd17f9.

Solidity: function redeem((bytes32,bytes32)[] redemptions) returns()

func (*ETHSwapSession) Refund

func (_ETHSwap *ETHSwapSession) Refund(secretHash [32]byte) (*types.Transaction, error)

Refund is a paid mutator transaction binding the contract method 0x7249fbb6.

Solidity: function refund(bytes32 secretHash) returns()

func (*ETHSwapSession) Swap

func (_ETHSwap *ETHSwapSession) Swap(secretHash [32]byte) (ETHSwapSwap, error)

Swap is a free data retrieval call binding the contract method 0x76467cbd.

Solidity: function swap(bytes32 secretHash) view returns((bytes32,uint256,uint256,uint256,address,address,uint8))

func (*ETHSwapSession) Swaps

func (_ETHSwap *ETHSwapSession) Swaps(arg0 [32]byte) (struct {
	Secret               [32]byte
	Value                *big.Int
	InitBlockNumber      *big.Int
	RefundBlockTimestamp *big.Int
	Initiator            common.Address
	Participant          common.Address
	State                uint8
}, error)

Swaps is a free data retrieval call binding the contract method 0xeb84e7f2.

Solidity: function swaps(bytes32 ) view returns(bytes32 secret, uint256 value, uint256 initBlockNumber, uint256 refundBlockTimestamp, address initiator, address participant, uint8 state)

type ETHSwapSwap

type ETHSwapSwap struct {
	Secret               [32]byte
	Value                *big.Int
	InitBlockNumber      *big.Int
	RefundBlockTimestamp *big.Int
	Initiator            common.Address
	Participant          common.Address
	State                uint8
}

ETHSwapSwap is an auto generated low-level Go binding around an user-defined struct.

type ETHSwapTransactor

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

ETHSwapTransactor is an auto generated write-only Go binding around an Ethereum contract.

func NewETHSwapTransactor

func NewETHSwapTransactor(address common.Address, transactor bind.ContractTransactor) (*ETHSwapTransactor, error)

NewETHSwapTransactor creates a new write-only instance of ETHSwap, bound to a specific deployed contract.

func (*ETHSwapTransactor) Initiate

func (_ETHSwap *ETHSwapTransactor) Initiate(opts *bind.TransactOpts, initiations []ETHSwapInitiation) (*types.Transaction, error)

Initiate is a paid mutator transaction binding the contract method 0xa8793f94.

Solidity: function initiate((uint256,bytes32,address,uint256)[] initiations) payable returns()

func (*ETHSwapTransactor) Redeem

func (_ETHSwap *ETHSwapTransactor) Redeem(opts *bind.TransactOpts, redemptions []ETHSwapRedemption) (*types.Transaction, error)

Redeem is a paid mutator transaction binding the contract method 0xf4fd17f9.

Solidity: function redeem((bytes32,bytes32)[] redemptions) returns()

func (*ETHSwapTransactor) Refund

func (_ETHSwap *ETHSwapTransactor) Refund(opts *bind.TransactOpts, secretHash [32]byte) (*types.Transaction, error)

Refund is a paid mutator transaction binding the contract method 0x7249fbb6.

Solidity: function refund(bytes32 secretHash) returns()

type ETHSwapTransactorRaw

type ETHSwapTransactorRaw struct {
	Contract *ETHSwapTransactor // Generic write-only contract binding to access the raw methods on
}

ETHSwapTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.

func (*ETHSwapTransactorRaw) Transact

func (_ETHSwap *ETHSwapTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error)

Transact invokes the (paid) contract method with params as input values.

func (*ETHSwapTransactorRaw) Transfer

func (_ETHSwap *ETHSwapTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error)

Transfer initiates a plain transaction to move funds to the contract, calling its default method if one is available.

type ETHSwapTransactorSession

type ETHSwapTransactorSession struct {
	Contract     *ETHSwapTransactor // Generic contract transactor binding to set the session for
	TransactOpts bind.TransactOpts  // Transaction auth options to use throughout this session
}

ETHSwapTransactorSession is an auto generated write-only Go binding around an Ethereum contract, with pre-set transact options.

func (*ETHSwapTransactorSession) Initiate

func (_ETHSwap *ETHSwapTransactorSession) Initiate(initiations []ETHSwapInitiation) (*types.Transaction, error)

Initiate is a paid mutator transaction binding the contract method 0xa8793f94.

Solidity: function initiate((uint256,bytes32,address,uint256)[] initiations) payable returns()

func (*ETHSwapTransactorSession) Redeem

func (_ETHSwap *ETHSwapTransactorSession) Redeem(redemptions []ETHSwapRedemption) (*types.Transaction, error)

Redeem is a paid mutator transaction binding the contract method 0xf4fd17f9.

Solidity: function redeem((bytes32,bytes32)[] redemptions) returns()

func (*ETHSwapTransactorSession) Refund

func (_ETHSwap *ETHSwapTransactorSession) Refund(secretHash [32]byte) (*types.Transaction, error)

Refund is a paid mutator transaction binding the contract method 0x7249fbb6.

Solidity: function refund(bytes32 secretHash) returns()

Jump to

Keyboard shortcuts

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