Documentation
¶
Index ¶
- Constants
- Variables
- func LoadABI() (abi.ABI, error)
- type GetPriceResponse
- type ISlinky
- type ISlinkyCaller
- type ISlinkyCallerRaw
- type ISlinkyCallerSession
- type ISlinkyFilterer
- type ISlinkyRaw
- func (_ISlinky *ISlinkyRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, ...) error
- func (_ISlinky *ISlinkyRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error)
- func (_ISlinky *ISlinkyRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error)
- type ISlinkySession
- type ISlinkyTransactor
- type ISlinkyTransactorRaw
- type ISlinkyTransactorSession
- type Precompile
- func (*Precompile) Address() common.Address
- func (p Precompile) GetPriceQuery(ctx sdk.Context, origin common.Address, stateDB vm.StateDB, method *abi.Method, ...) ([]byte, error)
- func (*Precompile) IsTransaction(method string) bool
- func (p *Precompile) Logger(ctx sdk.Context) log.Logger
- func (p *Precompile) RequiredGas(input []byte) uint64
- func (p *Precompile) Run(evm *vm.EVM, contract *vm.Contract, readOnly bool) (bz []byte, err error)
- type QuotePrice
Constants ¶
const (
GetPrice = "getPrice"
)
const PrecompileAddress = "0x0000000000000000000000000000000000000902"
PrecompileAddress defines the contract address of the slinky precompile.
Variables ¶
var ISlinkyABI = ISlinkyMetaData.ABI
ISlinkyABI is the input ABI used to generate the binding from. Deprecated: Use ISlinkyMetaData.ABI instead.
var ISlinkyMetaData = &bind.MetaData{
ABI: "[{\"inputs\":[{\"internalType\":\"string\",\"name\":\"base\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"quote\",\"type\":\"string\"}],\"name\":\"getPrice\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"decimals\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"blockHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"blockTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"price\",\"type\":\"uint256\"}],\"internalType\":\"structQuotePrice\",\"name\":\"price\",\"type\":\"tuple\"}],\"internalType\":\"structGetPriceResponse\",\"name\":\"response\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]",
}
ISlinkyMetaData contains all meta data concerning the ISlinky contract.
Functions ¶
Types ¶
type GetPriceResponse ¶
type GetPriceResponse struct { Id uint64 Nonce uint64 Decimals uint64 Price QuotePrice }
GetPriceResponse is an auto generated low-level Go binding around an user-defined struct.
func (*GetPriceResponse) FromResponse ¶
func (o *GetPriceResponse) FromResponse(res *oracletypes.GetPriceResponse) (*GetPriceResponse, error)
type ISlinky ¶
type ISlinky struct { ISlinkyCaller // Read-only binding to the contract ISlinkyTransactor // Write-only binding to the contract ISlinkyFilterer // Log filterer for contract events }
ISlinky is an auto generated Go binding around an Ethereum contract.
func NewISlinky ¶
NewISlinky creates a new instance of ISlinky, bound to a specific deployed contract.
type ISlinkyCaller ¶
type ISlinkyCaller struct {
// contains filtered or unexported fields
}
ISlinkyCaller is an auto generated read-only Go binding around an Ethereum contract.
func NewISlinkyCaller ¶
func NewISlinkyCaller(address common.Address, caller bind.ContractCaller) (*ISlinkyCaller, error)
NewISlinkyCaller creates a new read-only instance of ISlinky, bound to a specific deployed contract.
func (*ISlinkyCaller) GetPrice ¶
func (_ISlinky *ISlinkyCaller) GetPrice(opts *bind.CallOpts, base string, quote string) (GetPriceResponse, error)
GetPrice is a free data retrieval call binding the contract method 0x3d0f34da.
Solidity: function getPrice(string base, string quote) view returns((uint64,uint64,uint64,(uint64,uint256,uint256)) response)
type ISlinkyCallerRaw ¶
type ISlinkyCallerRaw struct {
Contract *ISlinkyCaller // Generic read-only contract binding to access the raw methods on
}
ISlinkyCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.
func (*ISlinkyCallerRaw) Call ¶
func (_ISlinky *ISlinkyCallerRaw) 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 ISlinkyCallerSession ¶
type ISlinkyCallerSession struct { Contract *ISlinkyCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session }
ISlinkyCallerSession is an auto generated read-only Go binding around an Ethereum contract, with pre-set call options.
func (*ISlinkyCallerSession) GetPrice ¶
func (_ISlinky *ISlinkyCallerSession) GetPrice(base string, quote string) (GetPriceResponse, error)
GetPrice is a free data retrieval call binding the contract method 0x3d0f34da.
Solidity: function getPrice(string base, string quote) view returns((uint64,uint64,uint64,(uint64,uint256,uint256)) response)
type ISlinkyFilterer ¶
type ISlinkyFilterer struct {
// contains filtered or unexported fields
}
ISlinkyFilterer is an auto generated log filtering Go binding around an Ethereum contract events.
func NewISlinkyFilterer ¶
func NewISlinkyFilterer(address common.Address, filterer bind.ContractFilterer) (*ISlinkyFilterer, error)
NewISlinkyFilterer creates a new log filterer instance of ISlinky, bound to a specific deployed contract.
type ISlinkyRaw ¶
type ISlinkyRaw struct {
Contract *ISlinky // Generic contract binding to access the raw methods on
}
ISlinkyRaw is an auto generated low-level Go binding around an Ethereum contract.
func (*ISlinkyRaw) Call ¶
func (_ISlinky *ISlinkyRaw) 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 (*ISlinkyRaw) Transact ¶
func (_ISlinky *ISlinkyRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error)
Transact invokes the (paid) contract method with params as input values.
func (*ISlinkyRaw) Transfer ¶
func (_ISlinky *ISlinkyRaw) 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 ISlinkySession ¶
type ISlinkySession struct { Contract *ISlinky // 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 }
ISlinkySession is an auto generated Go binding around an Ethereum contract, with pre-set call and transact options.
func (*ISlinkySession) GetPrice ¶
func (_ISlinky *ISlinkySession) GetPrice(base string, quote string) (GetPriceResponse, error)
GetPrice is a free data retrieval call binding the contract method 0x3d0f34da.
Solidity: function getPrice(string base, string quote) view returns((uint64,uint64,uint64,(uint64,uint256,uint256)) response)
type ISlinkyTransactor ¶
type ISlinkyTransactor struct {
// contains filtered or unexported fields
}
ISlinkyTransactor is an auto generated write-only Go binding around an Ethereum contract.
func NewISlinkyTransactor ¶
func NewISlinkyTransactor(address common.Address, transactor bind.ContractTransactor) (*ISlinkyTransactor, error)
NewISlinkyTransactor creates a new write-only instance of ISlinky, bound to a specific deployed contract.
type ISlinkyTransactorRaw ¶
type ISlinkyTransactorRaw struct {
Contract *ISlinkyTransactor // Generic write-only contract binding to access the raw methods on
}
ISlinkyTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.
func (*ISlinkyTransactorRaw) Transact ¶
func (_ISlinky *ISlinkyTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error)
Transact invokes the (paid) contract method with params as input values.
func (*ISlinkyTransactorRaw) Transfer ¶
func (_ISlinky *ISlinkyTransactorRaw) 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 ISlinkyTransactorSession ¶
type ISlinkyTransactorSession struct { Contract *ISlinkyTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session }
ISlinkyTransactorSession is an auto generated write-only Go binding around an Ethereum contract, with pre-set transact options.
type Precompile ¶
type Precompile struct { cmn.Precompile // contains filtered or unexported fields }
Precompile defines the precompiled contract for slinky.
func NewPrecompile ¶
func NewPrecompile( oraclekee oraclekeeper.Keeper, eventRegistry *precommon.EthEventsRegistry) (*Precompile, error)
func (*Precompile) Address ¶
func (*Precompile) Address() common.Address
Address implements vm.PrecompiledContract.
func (Precompile) GetPriceQuery ¶
func (p Precompile) GetPriceQuery( ctx sdk.Context, origin common.Address, stateDB vm.StateDB, method *abi.Method, args []interface{}, ) ([]byte, error)
GetPriceQuery constructs GetPriceRequest from args, passes it to query server and packs response into corresponding abi output.
func (*Precompile) IsTransaction ¶
func (*Precompile) IsTransaction(method string) bool
IsTransaction checks if the given method name corresponds to a transaction or query.
func (*Precompile) Logger ¶
func (p *Precompile) Logger(ctx sdk.Context) log.Logger
Logger returns a precompile-specific logger.
func (*Precompile) RequiredGas ¶
func (p *Precompile) RequiredGas(input []byte) uint64
RequiredGas returns the required bare minimum gas to execute the precompile. Subtle: this method shadows the method (Precompile).RequiredGas of Precompile.Precompile.