Documentation ¶
Index ¶
- Constants
- Variables
- func CreateTellorTx(ctx context.Context, prvKey *ecdsa.PrivateKey, to common.Address, ...) (*types.Transaction, string, error)
- func GetTellorAddress(netID int64) (common.Address, error)
- func LastSubmit(contract TellorCaller, reporter common.Address) (time.Duration, *time.Time, error)
- func ReporterStatusName(statusID int64) string
- func Slot(caller TellorCaller) (*big.Int, error)
- type DisputeLog
- type ITellor
- func (self *ITellor) Abi() abi.ABI
- func (self *ITellor) AbiRaw() string
- func (self *ITellor) Addr() common.Address
- func (self *ITellor) DisputeUnlockWindow() time.Duration
- func (self *ITellor) DisputeVotingWindow() time.Duration
- func (self *ITellor) NetID() int64
- func (self *ITellor) UnpackLog(out interface{}, event string, log types.Log) error
- func (self *ITellor) WatchLogs(opts *bind.WatchOpts, name string, query ...[]interface{}) (chan types.Log, event.Subscription, error)
- type ITellorFilterer
- type ITellorProxy
- type ITellorTest
- type NewTellorAddress
- type Params
- type RewardQuerier
- type SubmitBlock
- type TellorCaller
- type TellorDisputeVoteTallied
- type TellorNewChallenge
- type TellorNewDispute
- type TellorNewValue
- type TellorNonceSubmitted
- type TellorTransferred
- type TellorVoted
Constants ¶
View Source
const ( TellorAddress = "0x88dF592F8eb5D7Bd38bFeF7dEb0fBc02cf3778a0" TellorAddressRinkeby = TellorAddress TellorAddressGoerli = "0xe5e09e1C64Eab3cA8bCAD722b0966B69931879ae" TellorAddressGoerliProxy = "0x84Ec18B070D84e347eE6B7D5fA2d9fcFfbf759bA" // Proxy contract for testing. TellorAddressHardhat = "0x8920050E1126125a27A4EaC5122AD3586c056E51" WithdrawStakeGasLimit = 50_000 RequestStakingWithdrawGasLimit = 100_000 TallyGasLimit = 150_000 DepositStakeGasLimit = 160_000 UnlockFeeGasLimit = 300_000 VoteGasUSage = 200_000 NewDisputeGasLimit = 700_000 SubmitMiningSolutionGasLimit = 3_000_000 MethodNameSubmit = "submitMiningSolution" MethodNameNewDispute = "beginDispute" EventNameNewTask = "NewChallenge" EventNameNewSubmit = "NonceSubmitted" EventNameNewValue = "NewValue" EventNameTally = "DisputeVoteTallied" EventNameNewDispute = "NewDispute" // When creating the bindings the Transfer event is aliased as Trasnfered // because it collides with the same function name. EventNameTransfer = "Transferred" EventNameNewVote = "Voted" EventNameContractUpgrade = "NewTellorAddress" DefaultDisputeVotingWindow = 24 * 2 * time.Hour // 2 days to vote for a dispute. DefaultDisputeUnlockWindow = 24 * time.Hour // 1 day to wait after a dispute before can get the dispute fee. )
Variables ¶
View Source
var ( BPoolABI = balancer.BPoolABI BTokenABI = balancer.BTokenABI IERC20ABI = uniswap.IERC20ABI IUniswapV2PairABI = uniswap.IUniswapV2PairABI TellorABI = tellor.ITellorABI )
View Source
var DefaultParams = Params{ DisputeVotingWindow: DefaultDisputeVotingWindow, DisputeUnlockWindow: DefaultDisputeUnlockWindow, }
Functions ¶
func CreateTellorTx ¶ added in v0.3.0
func LastSubmit ¶
func ReporterStatusName ¶ added in v0.2.0
Types ¶
type DisputeLog ¶
type DisputeLog struct { ID int64 DataID int64 DataVal float64 DataTime time.Time Executed bool Passed bool Disputer common.Address Disputed common.Address DisputedSlot uint64 Tally float64 Votes uint64 Created time.Time Ends time.Time Fee float64 TxHash common.Hash }
func GetDisputeInfo ¶
func GetDisputeInfo(ctx context.Context, disputeID *big.Int, contract TellorCaller) (*DisputeLog, error)
func GetDisputeLogs ¶
func GetDisputeLogs( ctx context.Context, client *ethclient.Client, contract TellorCaller, lookBackDuration time.Duration, ) ([]*DisputeLog, error)
type ITellor ¶
func NewITellor ¶
func (*ITellor) DisputeUnlockWindow ¶
func (*ITellor) DisputeVotingWindow ¶
type ITellorFilterer ¶
type ITellorFilterer struct { *tellor.TellorFilterer *tellor.ExtensionFilterer }
func NewITellorFilterer ¶
type ITellorProxy ¶ added in v0.3.0
type ITellorProxy struct { *tellor_proxy.Reporter Address common.Address }
type ITellorTest ¶
type ITellorTest struct { *tellor_testing.ITellor Address common.Address }
type NewTellorAddress ¶
type NewTellorAddress = tellor.ExtensionNewTellorAddress
type RewardQuerier ¶
type SubmitBlock ¶
type SubmitBlock struct { Timestamp *big.Int DataIDs [5]*big.Int FinalValues map[int64]*big.Int Reporters map[int64][5]common.Address Values map[int64][5]*big.Int }
func GetSubmitLogs ¶
func GetSubmitLogs( ctx context.Context, client *ethclient.Client, contract TellorCaller, from int64, lookBackDuration time.Duration, ) ([]SubmitBlock, error)
func NewSubmitBlock ¶
func NewSubmitBlock() SubmitBlock
type TellorCaller ¶ added in v0.3.0
type TellorCaller interface { GetUintVar(opts *bind.CallOpts, _data [32]byte) (*big.Int, error) SubmitMiningSolution(opts *bind.TransactOpts, _nonce string, _requestId [5]*big.Int, _value [5]*big.Int) (*types.Transaction, error) GetStakerInfo(opts *bind.CallOpts, _staker common.Address) (*big.Int, *big.Int, error) GetNewCurrentVariables(opts *bind.CallOpts) (struct { Challenge [32]byte RequestIds [5]*big.Int Difficulty *big.Int Tip *big.Int }, error) Addr() common.Address NetID() int64 Abi() abi.ABI AbiRaw() string BalanceOf(opts *bind.CallOpts, _user common.Address) (*big.Int, error) GetAllDisputeVars(opts *bind.CallOpts, _disputeId *big.Int) ([32]byte, bool, bool, bool, common.Address, common.Address, common.Address, [9]*big.Int, *big.Int, error) GetDisputeUintVars(opts *bind.CallOpts, _disputeId *big.Int, _data [32]byte) (*big.Int, error) TallyVotes(opts *bind.TransactOpts, _disputeId *big.Int) (*types.Transaction, error) UnlockDisputeFee(opts *bind.TransactOpts, _disputeId *big.Int) (*types.Transaction, error) DepositStake(opts *bind.TransactOpts) (*types.Transaction, error) UnpackLog(out interface{}, event string, log types.Log) error WatchLogs(opts *bind.WatchOpts, name string, query ...[]interface{}) (chan types.Log, event.Subscription, error) DisputeVotingWindow() time.Duration DisputeUnlockWindow() time.Duration GetMinersByRequestIdAndTimestamp(opts *bind.CallOpts, _requestId *big.Int, _timestamp *big.Int) ([5]common.Address, error) GetSubmissionsByTimestamp(opts *bind.CallOpts, _requestId *big.Int, _timestamp *big.Int) ([5]*big.Int, error) GetNewValueCountbyRequestId(opts *bind.CallOpts, _requestId *big.Int) (*big.Int, error) GetTimestampbyRequestIDandIndex(opts *bind.CallOpts, _requestID *big.Int, _index *big.Int) (*big.Int, error) GetRequestUintVars(opts *bind.CallOpts, _requestId *big.Int, _data [32]byte) (*big.Int, error) BeginDispute(opts *bind.TransactOpts, _requestId *big.Int, _timestamp *big.Int, _minerIndex *big.Int) (*types.Transaction, error) DidVote(opts *bind.CallOpts, _disputeId *big.Int, _address common.Address) (bool, error) Vote(opts *bind.TransactOpts, _disputeId *big.Int, _supportsDispute bool) (*types.Transaction, error) WithdrawStake(opts *bind.TransactOpts) (*types.Transaction, error) RequestStakingWithdraw(opts *bind.TransactOpts) (*types.Transaction, error) Transfer(*bind.TransactOpts, common.Address, *big.Int) (*types.Transaction, error) Approve(opts *bind.TransactOpts, dst common.Address, amt *big.Int) (*types.Transaction, error) }
type TellorDisputeVoteTallied ¶
type TellorDisputeVoteTallied = tellor.ExtensionDisputeVoteTallied
func GetTallyLogs ¶
func GetTallyLogs( ctx context.Context, client *ethclient.Client, contract TellorCaller, lookBackDuration time.Duration, ) ([]*TellorDisputeVoteTallied, error)
type TellorNewChallenge ¶
type TellorNewChallenge = tellor.TellorNewChallenge
type TellorNewDispute ¶
type TellorNewDispute = tellor.TellorNewDispute
type TellorNewValue ¶
type TellorNewValue = tellor.TellorNewValue
type TellorNonceSubmitted ¶
type TellorNonceSubmitted = tellor.TellorNonceSubmitted
type TellorTransferred ¶
type TellorTransferred = tellor.TellorTransferred
type TellorVoted ¶
type TellorVoted = tellor.TellorVoted
Click to show internal directories.
Click to hide internal directories.