1324 lines
53 KiB
Go
1324 lines
53 KiB
Go
// Code generated - DO NOT EDIT.
|
|
// This file is a generated binding and any manual changes will be lost.
|
|
|
|
package contracts
|
|
|
|
import (
|
|
"math/big"
|
|
"strings"
|
|
|
|
ethereum "github.com/ethereum/go-ethereum"
|
|
"github.com/ethereum/go-ethereum/accounts/abi"
|
|
"github.com/ethereum/go-ethereum/accounts/abi/bind"
|
|
"github.com/ethereum/go-ethereum/common"
|
|
"github.com/ethereum/go-ethereum/core/types"
|
|
"github.com/ethereum/go-ethereum/event"
|
|
)
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var (
|
|
_ = big.NewInt
|
|
_ = strings.NewReader
|
|
_ = ethereum.NotFound
|
|
_ = bind.Bind
|
|
_ = common.Big1
|
|
_ = types.BloomLookup
|
|
_ = event.NewSubscription
|
|
)
|
|
|
|
// TankChefABI is the input ABI used to generate the binding from.
|
|
const TankChefABI = "[{\"inputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"_depositToken\",\"type\":\"address\"},{\"internalType\":\"contractIERC20\",\"name\":\"_rewardToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_rewardPerBlock\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_startBlock\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_endBlock\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_burnMultiplier\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Deposit\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"EmergencyWithdraw\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Withdraw\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"adjustBlockEnd\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"burnMultiplier\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"deposit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"depositToken\",\"outputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"emergencyRewardWithdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"emergencyWithdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"endBlock\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_from\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_to\",\"type\":\"uint256\"}],\"name\":\"getMultiplier\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_user\",\"type\":\"address\"}],\"name\":\"pendingReward\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"poolInfo\",\"outputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"lastRewardBlock\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"accRewardPerShare\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"rewardPerBlock\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"rewardToken\",\"outputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"startBlock\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"stopReward\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"updatePool\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"userInfo\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"rewardDebt\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]"
|
|
|
|
// TankChef is an auto generated Go binding around an Ethereum contract.
|
|
type TankChef struct {
|
|
TankChefCaller // Read-only binding to the contract
|
|
TankChefTransactor // Write-only binding to the contract
|
|
TankChefFilterer // Log filterer for contract events
|
|
}
|
|
|
|
// TankChefCaller is an auto generated read-only Go binding around an Ethereum contract.
|
|
type TankChefCaller struct {
|
|
contract *bind.BoundContract // Generic contract wrapper for the low level calls
|
|
}
|
|
|
|
// TankChefTransactor is an auto generated write-only Go binding around an Ethereum contract.
|
|
type TankChefTransactor struct {
|
|
contract *bind.BoundContract // Generic contract wrapper for the low level calls
|
|
}
|
|
|
|
// TankChefFilterer is an auto generated log filtering Go binding around an Ethereum contract events.
|
|
type TankChefFilterer struct {
|
|
contract *bind.BoundContract // Generic contract wrapper for the low level calls
|
|
}
|
|
|
|
// TankChefSession is an auto generated Go binding around an Ethereum contract,
|
|
// with pre-set call and transact options.
|
|
type TankChefSession struct {
|
|
Contract *TankChef // 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
|
|
}
|
|
|
|
// TankChefCallerSession is an auto generated read-only Go binding around an Ethereum contract,
|
|
// with pre-set call options.
|
|
type TankChefCallerSession struct {
|
|
Contract *TankChefCaller // Generic contract caller binding to set the session for
|
|
CallOpts bind.CallOpts // Call options to use throughout this session
|
|
}
|
|
|
|
// TankChefTransactorSession is an auto generated write-only Go binding around an Ethereum contract,
|
|
// with pre-set transact options.
|
|
type TankChefTransactorSession struct {
|
|
Contract *TankChefTransactor // Generic contract transactor binding to set the session for
|
|
TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
|
|
}
|
|
|
|
// TankChefRaw is an auto generated low-level Go binding around an Ethereum contract.
|
|
type TankChefRaw struct {
|
|
Contract *TankChef // Generic contract binding to access the raw methods on
|
|
}
|
|
|
|
// TankChefCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.
|
|
type TankChefCallerRaw struct {
|
|
Contract *TankChefCaller // Generic read-only contract binding to access the raw methods on
|
|
}
|
|
|
|
// TankChefTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.
|
|
type TankChefTransactorRaw struct {
|
|
Contract *TankChefTransactor // Generic write-only contract binding to access the raw methods on
|
|
}
|
|
|
|
// NewTankChef creates a new instance of TankChef, bound to a specific deployed contract.
|
|
func NewTankChef(address common.Address, backend bind.ContractBackend) (*TankChef, error) {
|
|
contract, err := bindTankChef(address, backend, backend, backend)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &TankChef{TankChefCaller: TankChefCaller{contract: contract}, TankChefTransactor: TankChefTransactor{contract: contract}, TankChefFilterer: TankChefFilterer{contract: contract}}, nil
|
|
}
|
|
|
|
// NewTankChefCaller creates a new read-only instance of TankChef, bound to a specific deployed contract.
|
|
func NewTankChefCaller(address common.Address, caller bind.ContractCaller) (*TankChefCaller, error) {
|
|
contract, err := bindTankChef(address, caller, nil, nil)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &TankChefCaller{contract: contract}, nil
|
|
}
|
|
|
|
// NewTankChefTransactor creates a new write-only instance of TankChef, bound to a specific deployed contract.
|
|
func NewTankChefTransactor(address common.Address, transactor bind.ContractTransactor) (*TankChefTransactor, error) {
|
|
contract, err := bindTankChef(address, nil, transactor, nil)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &TankChefTransactor{contract: contract}, nil
|
|
}
|
|
|
|
// NewTankChefFilterer creates a new log filterer instance of TankChef, bound to a specific deployed contract.
|
|
func NewTankChefFilterer(address common.Address, filterer bind.ContractFilterer) (*TankChefFilterer, error) {
|
|
contract, err := bindTankChef(address, nil, nil, filterer)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &TankChefFilterer{contract: contract}, nil
|
|
}
|
|
|
|
// bindTankChef binds a generic wrapper to an already deployed contract.
|
|
func bindTankChef(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
|
|
parsed, err := abi.JSON(strings.NewReader(TankChefABI))
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil
|
|
}
|
|
|
|
// 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 (_TankChef *TankChefRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
|
|
return _TankChef.Contract.TankChefCaller.contract.Call(opts, result, method, params...)
|
|
}
|
|
|
|
// Transfer initiates a plain transaction to move funds to the contract, calling
|
|
// its default method if one is available.
|
|
func (_TankChef *TankChefRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
|
|
return _TankChef.Contract.TankChefTransactor.contract.Transfer(opts)
|
|
}
|
|
|
|
// Transact invokes the (paid) contract method with params as input values.
|
|
func (_TankChef *TankChefRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
|
|
return _TankChef.Contract.TankChefTransactor.contract.Transact(opts, method, params...)
|
|
}
|
|
|
|
// 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 (_TankChef *TankChefCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
|
|
return _TankChef.Contract.contract.Call(opts, result, method, params...)
|
|
}
|
|
|
|
// Transfer initiates a plain transaction to move funds to the contract, calling
|
|
// its default method if one is available.
|
|
func (_TankChef *TankChefTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
|
|
return _TankChef.Contract.contract.Transfer(opts)
|
|
}
|
|
|
|
// Transact invokes the (paid) contract method with params as input values.
|
|
func (_TankChef *TankChefTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
|
|
return _TankChef.Contract.contract.Transact(opts, method, params...)
|
|
}
|
|
|
|
// BurnMultiplier is a free data retrieval call binding the contract method 0x3939a897.
|
|
//
|
|
// Solidity: function burnMultiplier() view returns(uint256)
|
|
func (_TankChef *TankChefCaller) BurnMultiplier(opts *bind.CallOpts) (*big.Int, error) {
|
|
var out []interface{}
|
|
err := _TankChef.contract.Call(opts, &out, "burnMultiplier")
|
|
|
|
if err != nil {
|
|
return *new(*big.Int), err
|
|
}
|
|
|
|
out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
|
|
|
|
return out0, err
|
|
|
|
}
|
|
|
|
// BurnMultiplier is a free data retrieval call binding the contract method 0x3939a897.
|
|
//
|
|
// Solidity: function burnMultiplier() view returns(uint256)
|
|
func (_TankChef *TankChefSession) BurnMultiplier() (*big.Int, error) {
|
|
return _TankChef.Contract.BurnMultiplier(&_TankChef.CallOpts)
|
|
}
|
|
|
|
// BurnMultiplier is a free data retrieval call binding the contract method 0x3939a897.
|
|
//
|
|
// Solidity: function burnMultiplier() view returns(uint256)
|
|
func (_TankChef *TankChefCallerSession) BurnMultiplier() (*big.Int, error) {
|
|
return _TankChef.Contract.BurnMultiplier(&_TankChef.CallOpts)
|
|
}
|
|
|
|
// DepositToken is a free data retrieval call binding the contract method 0xc89039c5.
|
|
//
|
|
// Solidity: function depositToken() view returns(address)
|
|
func (_TankChef *TankChefCaller) DepositToken(opts *bind.CallOpts) (common.Address, error) {
|
|
var out []interface{}
|
|
err := _TankChef.contract.Call(opts, &out, "depositToken")
|
|
|
|
if err != nil {
|
|
return *new(common.Address), err
|
|
}
|
|
|
|
out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
|
|
|
|
return out0, err
|
|
|
|
}
|
|
|
|
// DepositToken is a free data retrieval call binding the contract method 0xc89039c5.
|
|
//
|
|
// Solidity: function depositToken() view returns(address)
|
|
func (_TankChef *TankChefSession) DepositToken() (common.Address, error) {
|
|
return _TankChef.Contract.DepositToken(&_TankChef.CallOpts)
|
|
}
|
|
|
|
// DepositToken is a free data retrieval call binding the contract method 0xc89039c5.
|
|
//
|
|
// Solidity: function depositToken() view returns(address)
|
|
func (_TankChef *TankChefCallerSession) DepositToken() (common.Address, error) {
|
|
return _TankChef.Contract.DepositToken(&_TankChef.CallOpts)
|
|
}
|
|
|
|
// EndBlock is a free data retrieval call binding the contract method 0x083c6323.
|
|
//
|
|
// Solidity: function endBlock() view returns(uint256)
|
|
func (_TankChef *TankChefCaller) EndBlock(opts *bind.CallOpts) (*big.Int, error) {
|
|
var out []interface{}
|
|
err := _TankChef.contract.Call(opts, &out, "endBlock")
|
|
|
|
if err != nil {
|
|
return *new(*big.Int), err
|
|
}
|
|
|
|
out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
|
|
|
|
return out0, err
|
|
|
|
}
|
|
|
|
// EndBlock is a free data retrieval call binding the contract method 0x083c6323.
|
|
//
|
|
// Solidity: function endBlock() view returns(uint256)
|
|
func (_TankChef *TankChefSession) EndBlock() (*big.Int, error) {
|
|
return _TankChef.Contract.EndBlock(&_TankChef.CallOpts)
|
|
}
|
|
|
|
// EndBlock is a free data retrieval call binding the contract method 0x083c6323.
|
|
//
|
|
// Solidity: function endBlock() view returns(uint256)
|
|
func (_TankChef *TankChefCallerSession) EndBlock() (*big.Int, error) {
|
|
return _TankChef.Contract.EndBlock(&_TankChef.CallOpts)
|
|
}
|
|
|
|
// GetMultiplier is a free data retrieval call binding the contract method 0x8dbb1e3a.
|
|
//
|
|
// Solidity: function getMultiplier(uint256 _from, uint256 _to) view returns(uint256)
|
|
func (_TankChef *TankChefCaller) GetMultiplier(opts *bind.CallOpts, _from *big.Int, _to *big.Int) (*big.Int, error) {
|
|
var out []interface{}
|
|
err := _TankChef.contract.Call(opts, &out, "getMultiplier", _from, _to)
|
|
|
|
if err != nil {
|
|
return *new(*big.Int), err
|
|
}
|
|
|
|
out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
|
|
|
|
return out0, err
|
|
|
|
}
|
|
|
|
// GetMultiplier is a free data retrieval call binding the contract method 0x8dbb1e3a.
|
|
//
|
|
// Solidity: function getMultiplier(uint256 _from, uint256 _to) view returns(uint256)
|
|
func (_TankChef *TankChefSession) GetMultiplier(_from *big.Int, _to *big.Int) (*big.Int, error) {
|
|
return _TankChef.Contract.GetMultiplier(&_TankChef.CallOpts, _from, _to)
|
|
}
|
|
|
|
// GetMultiplier is a free data retrieval call binding the contract method 0x8dbb1e3a.
|
|
//
|
|
// Solidity: function getMultiplier(uint256 _from, uint256 _to) view returns(uint256)
|
|
func (_TankChef *TankChefCallerSession) GetMultiplier(_from *big.Int, _to *big.Int) (*big.Int, error) {
|
|
return _TankChef.Contract.GetMultiplier(&_TankChef.CallOpts, _from, _to)
|
|
}
|
|
|
|
// Owner is a free data retrieval call binding the contract method 0x8da5cb5b.
|
|
//
|
|
// Solidity: function owner() view returns(address)
|
|
func (_TankChef *TankChefCaller) Owner(opts *bind.CallOpts) (common.Address, error) {
|
|
var out []interface{}
|
|
err := _TankChef.contract.Call(opts, &out, "owner")
|
|
|
|
if err != nil {
|
|
return *new(common.Address), err
|
|
}
|
|
|
|
out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
|
|
|
|
return out0, err
|
|
|
|
}
|
|
|
|
// Owner is a free data retrieval call binding the contract method 0x8da5cb5b.
|
|
//
|
|
// Solidity: function owner() view returns(address)
|
|
func (_TankChef *TankChefSession) Owner() (common.Address, error) {
|
|
return _TankChef.Contract.Owner(&_TankChef.CallOpts)
|
|
}
|
|
|
|
// Owner is a free data retrieval call binding the contract method 0x8da5cb5b.
|
|
//
|
|
// Solidity: function owner() view returns(address)
|
|
func (_TankChef *TankChefCallerSession) Owner() (common.Address, error) {
|
|
return _TankChef.Contract.Owner(&_TankChef.CallOpts)
|
|
}
|
|
|
|
// PendingReward is a free data retrieval call binding the contract method 0xf40f0f52.
|
|
//
|
|
// Solidity: function pendingReward(address _user) view returns(uint256)
|
|
func (_TankChef *TankChefCaller) PendingReward(opts *bind.CallOpts, _user common.Address) (*big.Int, error) {
|
|
var out []interface{}
|
|
err := _TankChef.contract.Call(opts, &out, "pendingReward", _user)
|
|
|
|
if err != nil {
|
|
return *new(*big.Int), err
|
|
}
|
|
|
|
out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
|
|
|
|
return out0, err
|
|
|
|
}
|
|
|
|
// PendingReward is a free data retrieval call binding the contract method 0xf40f0f52.
|
|
//
|
|
// Solidity: function pendingReward(address _user) view returns(uint256)
|
|
func (_TankChef *TankChefSession) PendingReward(_user common.Address) (*big.Int, error) {
|
|
return _TankChef.Contract.PendingReward(&_TankChef.CallOpts, _user)
|
|
}
|
|
|
|
// PendingReward is a free data retrieval call binding the contract method 0xf40f0f52.
|
|
//
|
|
// Solidity: function pendingReward(address _user) view returns(uint256)
|
|
func (_TankChef *TankChefCallerSession) PendingReward(_user common.Address) (*big.Int, error) {
|
|
return _TankChef.Contract.PendingReward(&_TankChef.CallOpts, _user)
|
|
}
|
|
|
|
// PoolInfo is a free data retrieval call binding the contract method 0x5a2f3d09.
|
|
//
|
|
// Solidity: function poolInfo() view returns(address token, uint256 lastRewardBlock, uint256 accRewardPerShare)
|
|
func (_TankChef *TankChefCaller) PoolInfo(opts *bind.CallOpts) (struct {
|
|
Token common.Address
|
|
LastRewardBlock *big.Int
|
|
AccRewardPerShare *big.Int
|
|
}, error) {
|
|
var out []interface{}
|
|
err := _TankChef.contract.Call(opts, &out, "poolInfo")
|
|
|
|
outstruct := new(struct {
|
|
Token common.Address
|
|
LastRewardBlock *big.Int
|
|
AccRewardPerShare *big.Int
|
|
})
|
|
if err != nil {
|
|
return *outstruct, err
|
|
}
|
|
|
|
outstruct.Token = *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
|
|
outstruct.LastRewardBlock = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int)
|
|
outstruct.AccRewardPerShare = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int)
|
|
|
|
return *outstruct, err
|
|
|
|
}
|
|
|
|
// PoolInfo is a free data retrieval call binding the contract method 0x5a2f3d09.
|
|
//
|
|
// Solidity: function poolInfo() view returns(address token, uint256 lastRewardBlock, uint256 accRewardPerShare)
|
|
func (_TankChef *TankChefSession) PoolInfo() (struct {
|
|
Token common.Address
|
|
LastRewardBlock *big.Int
|
|
AccRewardPerShare *big.Int
|
|
}, error) {
|
|
return _TankChef.Contract.PoolInfo(&_TankChef.CallOpts)
|
|
}
|
|
|
|
// PoolInfo is a free data retrieval call binding the contract method 0x5a2f3d09.
|
|
//
|
|
// Solidity: function poolInfo() view returns(address token, uint256 lastRewardBlock, uint256 accRewardPerShare)
|
|
func (_TankChef *TankChefCallerSession) PoolInfo() (struct {
|
|
Token common.Address
|
|
LastRewardBlock *big.Int
|
|
AccRewardPerShare *big.Int
|
|
}, error) {
|
|
return _TankChef.Contract.PoolInfo(&_TankChef.CallOpts)
|
|
}
|
|
|
|
// RewardPerBlock is a free data retrieval call binding the contract method 0x8ae39cac.
|
|
//
|
|
// Solidity: function rewardPerBlock() view returns(uint256)
|
|
func (_TankChef *TankChefCaller) RewardPerBlock(opts *bind.CallOpts) (*big.Int, error) {
|
|
var out []interface{}
|
|
err := _TankChef.contract.Call(opts, &out, "rewardPerBlock")
|
|
|
|
if err != nil {
|
|
return *new(*big.Int), err
|
|
}
|
|
|
|
out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
|
|
|
|
return out0, err
|
|
|
|
}
|
|
|
|
// RewardPerBlock is a free data retrieval call binding the contract method 0x8ae39cac.
|
|
//
|
|
// Solidity: function rewardPerBlock() view returns(uint256)
|
|
func (_TankChef *TankChefSession) RewardPerBlock() (*big.Int, error) {
|
|
return _TankChef.Contract.RewardPerBlock(&_TankChef.CallOpts)
|
|
}
|
|
|
|
// RewardPerBlock is a free data retrieval call binding the contract method 0x8ae39cac.
|
|
//
|
|
// Solidity: function rewardPerBlock() view returns(uint256)
|
|
func (_TankChef *TankChefCallerSession) RewardPerBlock() (*big.Int, error) {
|
|
return _TankChef.Contract.RewardPerBlock(&_TankChef.CallOpts)
|
|
}
|
|
|
|
// RewardToken is a free data retrieval call binding the contract method 0xf7c618c1.
|
|
//
|
|
// Solidity: function rewardToken() view returns(address)
|
|
func (_TankChef *TankChefCaller) RewardToken(opts *bind.CallOpts) (common.Address, error) {
|
|
var out []interface{}
|
|
err := _TankChef.contract.Call(opts, &out, "rewardToken")
|
|
|
|
if err != nil {
|
|
return *new(common.Address), err
|
|
}
|
|
|
|
out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
|
|
|
|
return out0, err
|
|
|
|
}
|
|
|
|
// RewardToken is a free data retrieval call binding the contract method 0xf7c618c1.
|
|
//
|
|
// Solidity: function rewardToken() view returns(address)
|
|
func (_TankChef *TankChefSession) RewardToken() (common.Address, error) {
|
|
return _TankChef.Contract.RewardToken(&_TankChef.CallOpts)
|
|
}
|
|
|
|
// RewardToken is a free data retrieval call binding the contract method 0xf7c618c1.
|
|
//
|
|
// Solidity: function rewardToken() view returns(address)
|
|
func (_TankChef *TankChefCallerSession) RewardToken() (common.Address, error) {
|
|
return _TankChef.Contract.RewardToken(&_TankChef.CallOpts)
|
|
}
|
|
|
|
// StartBlock is a free data retrieval call binding the contract method 0x48cd4cb1.
|
|
//
|
|
// Solidity: function startBlock() view returns(uint256)
|
|
func (_TankChef *TankChefCaller) StartBlock(opts *bind.CallOpts) (*big.Int, error) {
|
|
var out []interface{}
|
|
err := _TankChef.contract.Call(opts, &out, "startBlock")
|
|
|
|
if err != nil {
|
|
return *new(*big.Int), err
|
|
}
|
|
|
|
out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
|
|
|
|
return out0, err
|
|
|
|
}
|
|
|
|
// StartBlock is a free data retrieval call binding the contract method 0x48cd4cb1.
|
|
//
|
|
// Solidity: function startBlock() view returns(uint256)
|
|
func (_TankChef *TankChefSession) StartBlock() (*big.Int, error) {
|
|
return _TankChef.Contract.StartBlock(&_TankChef.CallOpts)
|
|
}
|
|
|
|
// StartBlock is a free data retrieval call binding the contract method 0x48cd4cb1.
|
|
//
|
|
// Solidity: function startBlock() view returns(uint256)
|
|
func (_TankChef *TankChefCallerSession) StartBlock() (*big.Int, error) {
|
|
return _TankChef.Contract.StartBlock(&_TankChef.CallOpts)
|
|
}
|
|
|
|
// UserInfo is a free data retrieval call binding the contract method 0x1959a002.
|
|
//
|
|
// Solidity: function userInfo(address ) view returns(uint256 amount, uint256 rewardDebt)
|
|
func (_TankChef *TankChefCaller) UserInfo(opts *bind.CallOpts, arg0 common.Address) (struct {
|
|
Amount *big.Int
|
|
RewardDebt *big.Int
|
|
}, error) {
|
|
var out []interface{}
|
|
err := _TankChef.contract.Call(opts, &out, "userInfo", arg0)
|
|
|
|
outstruct := new(struct {
|
|
Amount *big.Int
|
|
RewardDebt *big.Int
|
|
})
|
|
if err != nil {
|
|
return *outstruct, err
|
|
}
|
|
|
|
outstruct.Amount = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
|
|
outstruct.RewardDebt = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int)
|
|
|
|
return *outstruct, err
|
|
|
|
}
|
|
|
|
// UserInfo is a free data retrieval call binding the contract method 0x1959a002.
|
|
//
|
|
// Solidity: function userInfo(address ) view returns(uint256 amount, uint256 rewardDebt)
|
|
func (_TankChef *TankChefSession) UserInfo(arg0 common.Address) (struct {
|
|
Amount *big.Int
|
|
RewardDebt *big.Int
|
|
}, error) {
|
|
return _TankChef.Contract.UserInfo(&_TankChef.CallOpts, arg0)
|
|
}
|
|
|
|
// UserInfo is a free data retrieval call binding the contract method 0x1959a002.
|
|
//
|
|
// Solidity: function userInfo(address ) view returns(uint256 amount, uint256 rewardDebt)
|
|
func (_TankChef *TankChefCallerSession) UserInfo(arg0 common.Address) (struct {
|
|
Amount *big.Int
|
|
RewardDebt *big.Int
|
|
}, error) {
|
|
return _TankChef.Contract.UserInfo(&_TankChef.CallOpts, arg0)
|
|
}
|
|
|
|
// AdjustBlockEnd is a paid mutator transaction binding the contract method 0xfd75e1e6.
|
|
//
|
|
// Solidity: function adjustBlockEnd() returns()
|
|
func (_TankChef *TankChefTransactor) AdjustBlockEnd(opts *bind.TransactOpts) (*types.Transaction, error) {
|
|
return _TankChef.contract.Transact(opts, "adjustBlockEnd")
|
|
}
|
|
|
|
// AdjustBlockEnd is a paid mutator transaction binding the contract method 0xfd75e1e6.
|
|
//
|
|
// Solidity: function adjustBlockEnd() returns()
|
|
func (_TankChef *TankChefSession) AdjustBlockEnd() (*types.Transaction, error) {
|
|
return _TankChef.Contract.AdjustBlockEnd(&_TankChef.TransactOpts)
|
|
}
|
|
|
|
// AdjustBlockEnd is a paid mutator transaction binding the contract method 0xfd75e1e6.
|
|
//
|
|
// Solidity: function adjustBlockEnd() returns()
|
|
func (_TankChef *TankChefTransactorSession) AdjustBlockEnd() (*types.Transaction, error) {
|
|
return _TankChef.Contract.AdjustBlockEnd(&_TankChef.TransactOpts)
|
|
}
|
|
|
|
// Deposit is a paid mutator transaction binding the contract method 0xb6b55f25.
|
|
//
|
|
// Solidity: function deposit(uint256 _amount) returns()
|
|
func (_TankChef *TankChefTransactor) Deposit(opts *bind.TransactOpts, _amount *big.Int) (*types.Transaction, error) {
|
|
return _TankChef.contract.Transact(opts, "deposit", _amount)
|
|
}
|
|
|
|
// Deposit is a paid mutator transaction binding the contract method 0xb6b55f25.
|
|
//
|
|
// Solidity: function deposit(uint256 _amount) returns()
|
|
func (_TankChef *TankChefSession) Deposit(_amount *big.Int) (*types.Transaction, error) {
|
|
return _TankChef.Contract.Deposit(&_TankChef.TransactOpts, _amount)
|
|
}
|
|
|
|
// Deposit is a paid mutator transaction binding the contract method 0xb6b55f25.
|
|
//
|
|
// Solidity: function deposit(uint256 _amount) returns()
|
|
func (_TankChef *TankChefTransactorSession) Deposit(_amount *big.Int) (*types.Transaction, error) {
|
|
return _TankChef.Contract.Deposit(&_TankChef.TransactOpts, _amount)
|
|
}
|
|
|
|
// EmergencyRewardWithdraw is a paid mutator transaction binding the contract method 0x3279beab.
|
|
//
|
|
// Solidity: function emergencyRewardWithdraw(uint256 _amount) returns()
|
|
func (_TankChef *TankChefTransactor) EmergencyRewardWithdraw(opts *bind.TransactOpts, _amount *big.Int) (*types.Transaction, error) {
|
|
return _TankChef.contract.Transact(opts, "emergencyRewardWithdraw", _amount)
|
|
}
|
|
|
|
// EmergencyRewardWithdraw is a paid mutator transaction binding the contract method 0x3279beab.
|
|
//
|
|
// Solidity: function emergencyRewardWithdraw(uint256 _amount) returns()
|
|
func (_TankChef *TankChefSession) EmergencyRewardWithdraw(_amount *big.Int) (*types.Transaction, error) {
|
|
return _TankChef.Contract.EmergencyRewardWithdraw(&_TankChef.TransactOpts, _amount)
|
|
}
|
|
|
|
// EmergencyRewardWithdraw is a paid mutator transaction binding the contract method 0x3279beab.
|
|
//
|
|
// Solidity: function emergencyRewardWithdraw(uint256 _amount) returns()
|
|
func (_TankChef *TankChefTransactorSession) EmergencyRewardWithdraw(_amount *big.Int) (*types.Transaction, error) {
|
|
return _TankChef.Contract.EmergencyRewardWithdraw(&_TankChef.TransactOpts, _amount)
|
|
}
|
|
|
|
// EmergencyWithdraw is a paid mutator transaction binding the contract method 0xdb2e21bc.
|
|
//
|
|
// Solidity: function emergencyWithdraw() returns()
|
|
func (_TankChef *TankChefTransactor) EmergencyWithdraw(opts *bind.TransactOpts) (*types.Transaction, error) {
|
|
return _TankChef.contract.Transact(opts, "emergencyWithdraw")
|
|
}
|
|
|
|
// EmergencyWithdraw is a paid mutator transaction binding the contract method 0xdb2e21bc.
|
|
//
|
|
// Solidity: function emergencyWithdraw() returns()
|
|
func (_TankChef *TankChefSession) EmergencyWithdraw() (*types.Transaction, error) {
|
|
return _TankChef.Contract.EmergencyWithdraw(&_TankChef.TransactOpts)
|
|
}
|
|
|
|
// EmergencyWithdraw is a paid mutator transaction binding the contract method 0xdb2e21bc.
|
|
//
|
|
// Solidity: function emergencyWithdraw() returns()
|
|
func (_TankChef *TankChefTransactorSession) EmergencyWithdraw() (*types.Transaction, error) {
|
|
return _TankChef.Contract.EmergencyWithdraw(&_TankChef.TransactOpts)
|
|
}
|
|
|
|
// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6.
|
|
//
|
|
// Solidity: function renounceOwnership() returns()
|
|
func (_TankChef *TankChefTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) {
|
|
return _TankChef.contract.Transact(opts, "renounceOwnership")
|
|
}
|
|
|
|
// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6.
|
|
//
|
|
// Solidity: function renounceOwnership() returns()
|
|
func (_TankChef *TankChefSession) RenounceOwnership() (*types.Transaction, error) {
|
|
return _TankChef.Contract.RenounceOwnership(&_TankChef.TransactOpts)
|
|
}
|
|
|
|
// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6.
|
|
//
|
|
// Solidity: function renounceOwnership() returns()
|
|
func (_TankChef *TankChefTransactorSession) RenounceOwnership() (*types.Transaction, error) {
|
|
return _TankChef.Contract.RenounceOwnership(&_TankChef.TransactOpts)
|
|
}
|
|
|
|
// StopReward is a paid mutator transaction binding the contract method 0x80dc0672.
|
|
//
|
|
// Solidity: function stopReward() returns()
|
|
func (_TankChef *TankChefTransactor) StopReward(opts *bind.TransactOpts) (*types.Transaction, error) {
|
|
return _TankChef.contract.Transact(opts, "stopReward")
|
|
}
|
|
|
|
// StopReward is a paid mutator transaction binding the contract method 0x80dc0672.
|
|
//
|
|
// Solidity: function stopReward() returns()
|
|
func (_TankChef *TankChefSession) StopReward() (*types.Transaction, error) {
|
|
return _TankChef.Contract.StopReward(&_TankChef.TransactOpts)
|
|
}
|
|
|
|
// StopReward is a paid mutator transaction binding the contract method 0x80dc0672.
|
|
//
|
|
// Solidity: function stopReward() returns()
|
|
func (_TankChef *TankChefTransactorSession) StopReward() (*types.Transaction, error) {
|
|
return _TankChef.Contract.StopReward(&_TankChef.TransactOpts)
|
|
}
|
|
|
|
// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b.
|
|
//
|
|
// Solidity: function transferOwnership(address newOwner) returns()
|
|
func (_TankChef *TankChefTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) {
|
|
return _TankChef.contract.Transact(opts, "transferOwnership", newOwner)
|
|
}
|
|
|
|
// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b.
|
|
//
|
|
// Solidity: function transferOwnership(address newOwner) returns()
|
|
func (_TankChef *TankChefSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {
|
|
return _TankChef.Contract.TransferOwnership(&_TankChef.TransactOpts, newOwner)
|
|
}
|
|
|
|
// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b.
|
|
//
|
|
// Solidity: function transferOwnership(address newOwner) returns()
|
|
func (_TankChef *TankChefTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {
|
|
return _TankChef.Contract.TransferOwnership(&_TankChef.TransactOpts, newOwner)
|
|
}
|
|
|
|
// UpdatePool is a paid mutator transaction binding the contract method 0xe3161ddd.
|
|
//
|
|
// Solidity: function updatePool() returns()
|
|
func (_TankChef *TankChefTransactor) UpdatePool(opts *bind.TransactOpts) (*types.Transaction, error) {
|
|
return _TankChef.contract.Transact(opts, "updatePool")
|
|
}
|
|
|
|
// UpdatePool is a paid mutator transaction binding the contract method 0xe3161ddd.
|
|
//
|
|
// Solidity: function updatePool() returns()
|
|
func (_TankChef *TankChefSession) UpdatePool() (*types.Transaction, error) {
|
|
return _TankChef.Contract.UpdatePool(&_TankChef.TransactOpts)
|
|
}
|
|
|
|
// UpdatePool is a paid mutator transaction binding the contract method 0xe3161ddd.
|
|
//
|
|
// Solidity: function updatePool() returns()
|
|
func (_TankChef *TankChefTransactorSession) UpdatePool() (*types.Transaction, error) {
|
|
return _TankChef.Contract.UpdatePool(&_TankChef.TransactOpts)
|
|
}
|
|
|
|
// Withdraw is a paid mutator transaction binding the contract method 0x2e1a7d4d.
|
|
//
|
|
// Solidity: function withdraw(uint256 _amount) returns()
|
|
func (_TankChef *TankChefTransactor) Withdraw(opts *bind.TransactOpts, _amount *big.Int) (*types.Transaction, error) {
|
|
return _TankChef.contract.Transact(opts, "withdraw", _amount)
|
|
}
|
|
|
|
// Withdraw is a paid mutator transaction binding the contract method 0x2e1a7d4d.
|
|
//
|
|
// Solidity: function withdraw(uint256 _amount) returns()
|
|
func (_TankChef *TankChefSession) Withdraw(_amount *big.Int) (*types.Transaction, error) {
|
|
return _TankChef.Contract.Withdraw(&_TankChef.TransactOpts, _amount)
|
|
}
|
|
|
|
// Withdraw is a paid mutator transaction binding the contract method 0x2e1a7d4d.
|
|
//
|
|
// Solidity: function withdraw(uint256 _amount) returns()
|
|
func (_TankChef *TankChefTransactorSession) Withdraw(_amount *big.Int) (*types.Transaction, error) {
|
|
return _TankChef.Contract.Withdraw(&_TankChef.TransactOpts, _amount)
|
|
}
|
|
|
|
// TankChefDepositIterator is returned from FilterDeposit and is used to iterate over the raw logs and unpacked data for Deposit events raised by the TankChef contract.
|
|
type TankChefDepositIterator struct {
|
|
Event *TankChefDeposit // Event containing the contract specifics and raw log
|
|
|
|
contract *bind.BoundContract // Generic contract to use for unpacking event data
|
|
event string // Event name to use for unpacking event data
|
|
|
|
logs chan types.Log // Log channel receiving the found contract events
|
|
sub ethereum.Subscription // Subscription for errors, completion and termination
|
|
done bool // Whether the subscription completed delivering logs
|
|
fail error // Occurred error to stop iteration
|
|
}
|
|
|
|
// Next advances the iterator to the subsequent event, returning whether there
|
|
// are any more events found. In case of a retrieval or parsing error, false is
|
|
// returned and Error() can be queried for the exact failure.
|
|
func (it *TankChefDepositIterator) Next() bool {
|
|
// If the iterator failed, stop iterating
|
|
if it.fail != nil {
|
|
return false
|
|
}
|
|
// If the iterator completed, deliver directly whatever's available
|
|
if it.done {
|
|
select {
|
|
case log := <-it.logs:
|
|
it.Event = new(TankChefDeposit)
|
|
if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
|
|
it.fail = err
|
|
return false
|
|
}
|
|
it.Event.Raw = log
|
|
return true
|
|
|
|
default:
|
|
return false
|
|
}
|
|
}
|
|
// Iterator still in progress, wait for either a data or an error event
|
|
select {
|
|
case log := <-it.logs:
|
|
it.Event = new(TankChefDeposit)
|
|
if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
|
|
it.fail = err
|
|
return false
|
|
}
|
|
it.Event.Raw = log
|
|
return true
|
|
|
|
case err := <-it.sub.Err():
|
|
it.done = true
|
|
it.fail = err
|
|
return it.Next()
|
|
}
|
|
}
|
|
|
|
// Error returns any retrieval or parsing error occurred during filtering.
|
|
func (it *TankChefDepositIterator) Error() error {
|
|
return it.fail
|
|
}
|
|
|
|
// Close terminates the iteration process, releasing any pending underlying
|
|
// resources.
|
|
func (it *TankChefDepositIterator) Close() error {
|
|
it.sub.Unsubscribe()
|
|
return nil
|
|
}
|
|
|
|
// TankChefDeposit represents a Deposit event raised by the TankChef contract.
|
|
type TankChefDeposit struct {
|
|
User common.Address
|
|
Amount *big.Int
|
|
Raw types.Log // Blockchain specific contextual infos
|
|
}
|
|
|
|
// FilterDeposit is a free log retrieval operation binding the contract event 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c.
|
|
//
|
|
// Solidity: event Deposit(address indexed user, uint256 amount)
|
|
func (_TankChef *TankChefFilterer) FilterDeposit(opts *bind.FilterOpts, user []common.Address) (*TankChefDepositIterator, error) {
|
|
|
|
var userRule []interface{}
|
|
for _, userItem := range user {
|
|
userRule = append(userRule, userItem)
|
|
}
|
|
|
|
logs, sub, err := _TankChef.contract.FilterLogs(opts, "Deposit", userRule)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &TankChefDepositIterator{contract: _TankChef.contract, event: "Deposit", logs: logs, sub: sub}, nil
|
|
}
|
|
|
|
// WatchDeposit is a free log subscription operation binding the contract event 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c.
|
|
//
|
|
// Solidity: event Deposit(address indexed user, uint256 amount)
|
|
func (_TankChef *TankChefFilterer) WatchDeposit(opts *bind.WatchOpts, sink chan<- *TankChefDeposit, user []common.Address) (event.Subscription, error) {
|
|
|
|
var userRule []interface{}
|
|
for _, userItem := range user {
|
|
userRule = append(userRule, userItem)
|
|
}
|
|
|
|
logs, sub, err := _TankChef.contract.WatchLogs(opts, "Deposit", userRule)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return event.NewSubscription(func(quit <-chan struct{}) error {
|
|
defer sub.Unsubscribe()
|
|
for {
|
|
select {
|
|
case log := <-logs:
|
|
// New log arrived, parse the event and forward to the user
|
|
event := new(TankChefDeposit)
|
|
if err := _TankChef.contract.UnpackLog(event, "Deposit", log); err != nil {
|
|
return err
|
|
}
|
|
event.Raw = log
|
|
|
|
select {
|
|
case sink <- event:
|
|
case err := <-sub.Err():
|
|
return err
|
|
case <-quit:
|
|
return nil
|
|
}
|
|
case err := <-sub.Err():
|
|
return err
|
|
case <-quit:
|
|
return nil
|
|
}
|
|
}
|
|
}), nil
|
|
}
|
|
|
|
// ParseDeposit is a log parse operation binding the contract event 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c.
|
|
//
|
|
// Solidity: event Deposit(address indexed user, uint256 amount)
|
|
func (_TankChef *TankChefFilterer) ParseDeposit(log types.Log) (*TankChefDeposit, error) {
|
|
event := new(TankChefDeposit)
|
|
if err := _TankChef.contract.UnpackLog(event, "Deposit", log); err != nil {
|
|
return nil, err
|
|
}
|
|
event.Raw = log
|
|
return event, nil
|
|
}
|
|
|
|
// TankChefEmergencyWithdrawIterator is returned from FilterEmergencyWithdraw and is used to iterate over the raw logs and unpacked data for EmergencyWithdraw events raised by the TankChef contract.
|
|
type TankChefEmergencyWithdrawIterator struct {
|
|
Event *TankChefEmergencyWithdraw // Event containing the contract specifics and raw log
|
|
|
|
contract *bind.BoundContract // Generic contract to use for unpacking event data
|
|
event string // Event name to use for unpacking event data
|
|
|
|
logs chan types.Log // Log channel receiving the found contract events
|
|
sub ethereum.Subscription // Subscription for errors, completion and termination
|
|
done bool // Whether the subscription completed delivering logs
|
|
fail error // Occurred error to stop iteration
|
|
}
|
|
|
|
// Next advances the iterator to the subsequent event, returning whether there
|
|
// are any more events found. In case of a retrieval or parsing error, false is
|
|
// returned and Error() can be queried for the exact failure.
|
|
func (it *TankChefEmergencyWithdrawIterator) Next() bool {
|
|
// If the iterator failed, stop iterating
|
|
if it.fail != nil {
|
|
return false
|
|
}
|
|
// If the iterator completed, deliver directly whatever's available
|
|
if it.done {
|
|
select {
|
|
case log := <-it.logs:
|
|
it.Event = new(TankChefEmergencyWithdraw)
|
|
if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
|
|
it.fail = err
|
|
return false
|
|
}
|
|
it.Event.Raw = log
|
|
return true
|
|
|
|
default:
|
|
return false
|
|
}
|
|
}
|
|
// Iterator still in progress, wait for either a data or an error event
|
|
select {
|
|
case log := <-it.logs:
|
|
it.Event = new(TankChefEmergencyWithdraw)
|
|
if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
|
|
it.fail = err
|
|
return false
|
|
}
|
|
it.Event.Raw = log
|
|
return true
|
|
|
|
case err := <-it.sub.Err():
|
|
it.done = true
|
|
it.fail = err
|
|
return it.Next()
|
|
}
|
|
}
|
|
|
|
// Error returns any retrieval or parsing error occurred during filtering.
|
|
func (it *TankChefEmergencyWithdrawIterator) Error() error {
|
|
return it.fail
|
|
}
|
|
|
|
// Close terminates the iteration process, releasing any pending underlying
|
|
// resources.
|
|
func (it *TankChefEmergencyWithdrawIterator) Close() error {
|
|
it.sub.Unsubscribe()
|
|
return nil
|
|
}
|
|
|
|
// TankChefEmergencyWithdraw represents a EmergencyWithdraw event raised by the TankChef contract.
|
|
type TankChefEmergencyWithdraw struct {
|
|
User common.Address
|
|
Amount *big.Int
|
|
Raw types.Log // Blockchain specific contextual infos
|
|
}
|
|
|
|
// FilterEmergencyWithdraw is a free log retrieval operation binding the contract event 0x5fafa99d0643513820be26656b45130b01e1c03062e1266bf36f88cbd3bd9695.
|
|
//
|
|
// Solidity: event EmergencyWithdraw(address indexed user, uint256 amount)
|
|
func (_TankChef *TankChefFilterer) FilterEmergencyWithdraw(opts *bind.FilterOpts, user []common.Address) (*TankChefEmergencyWithdrawIterator, error) {
|
|
|
|
var userRule []interface{}
|
|
for _, userItem := range user {
|
|
userRule = append(userRule, userItem)
|
|
}
|
|
|
|
logs, sub, err := _TankChef.contract.FilterLogs(opts, "EmergencyWithdraw", userRule)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &TankChefEmergencyWithdrawIterator{contract: _TankChef.contract, event: "EmergencyWithdraw", logs: logs, sub: sub}, nil
|
|
}
|
|
|
|
// WatchEmergencyWithdraw is a free log subscription operation binding the contract event 0x5fafa99d0643513820be26656b45130b01e1c03062e1266bf36f88cbd3bd9695.
|
|
//
|
|
// Solidity: event EmergencyWithdraw(address indexed user, uint256 amount)
|
|
func (_TankChef *TankChefFilterer) WatchEmergencyWithdraw(opts *bind.WatchOpts, sink chan<- *TankChefEmergencyWithdraw, user []common.Address) (event.Subscription, error) {
|
|
|
|
var userRule []interface{}
|
|
for _, userItem := range user {
|
|
userRule = append(userRule, userItem)
|
|
}
|
|
|
|
logs, sub, err := _TankChef.contract.WatchLogs(opts, "EmergencyWithdraw", userRule)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return event.NewSubscription(func(quit <-chan struct{}) error {
|
|
defer sub.Unsubscribe()
|
|
for {
|
|
select {
|
|
case log := <-logs:
|
|
// New log arrived, parse the event and forward to the user
|
|
event := new(TankChefEmergencyWithdraw)
|
|
if err := _TankChef.contract.UnpackLog(event, "EmergencyWithdraw", log); err != nil {
|
|
return err
|
|
}
|
|
event.Raw = log
|
|
|
|
select {
|
|
case sink <- event:
|
|
case err := <-sub.Err():
|
|
return err
|
|
case <-quit:
|
|
return nil
|
|
}
|
|
case err := <-sub.Err():
|
|
return err
|
|
case <-quit:
|
|
return nil
|
|
}
|
|
}
|
|
}), nil
|
|
}
|
|
|
|
// ParseEmergencyWithdraw is a log parse operation binding the contract event 0x5fafa99d0643513820be26656b45130b01e1c03062e1266bf36f88cbd3bd9695.
|
|
//
|
|
// Solidity: event EmergencyWithdraw(address indexed user, uint256 amount)
|
|
func (_TankChef *TankChefFilterer) ParseEmergencyWithdraw(log types.Log) (*TankChefEmergencyWithdraw, error) {
|
|
event := new(TankChefEmergencyWithdraw)
|
|
if err := _TankChef.contract.UnpackLog(event, "EmergencyWithdraw", log); err != nil {
|
|
return nil, err
|
|
}
|
|
event.Raw = log
|
|
return event, nil
|
|
}
|
|
|
|
// TankChefOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the TankChef contract.
|
|
type TankChefOwnershipTransferredIterator struct {
|
|
Event *TankChefOwnershipTransferred // Event containing the contract specifics and raw log
|
|
|
|
contract *bind.BoundContract // Generic contract to use for unpacking event data
|
|
event string // Event name to use for unpacking event data
|
|
|
|
logs chan types.Log // Log channel receiving the found contract events
|
|
sub ethereum.Subscription // Subscription for errors, completion and termination
|
|
done bool // Whether the subscription completed delivering logs
|
|
fail error // Occurred error to stop iteration
|
|
}
|
|
|
|
// Next advances the iterator to the subsequent event, returning whether there
|
|
// are any more events found. In case of a retrieval or parsing error, false is
|
|
// returned and Error() can be queried for the exact failure.
|
|
func (it *TankChefOwnershipTransferredIterator) Next() bool {
|
|
// If the iterator failed, stop iterating
|
|
if it.fail != nil {
|
|
return false
|
|
}
|
|
// If the iterator completed, deliver directly whatever's available
|
|
if it.done {
|
|
select {
|
|
case log := <-it.logs:
|
|
it.Event = new(TankChefOwnershipTransferred)
|
|
if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
|
|
it.fail = err
|
|
return false
|
|
}
|
|
it.Event.Raw = log
|
|
return true
|
|
|
|
default:
|
|
return false
|
|
}
|
|
}
|
|
// Iterator still in progress, wait for either a data or an error event
|
|
select {
|
|
case log := <-it.logs:
|
|
it.Event = new(TankChefOwnershipTransferred)
|
|
if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
|
|
it.fail = err
|
|
return false
|
|
}
|
|
it.Event.Raw = log
|
|
return true
|
|
|
|
case err := <-it.sub.Err():
|
|
it.done = true
|
|
it.fail = err
|
|
return it.Next()
|
|
}
|
|
}
|
|
|
|
// Error returns any retrieval or parsing error occurred during filtering.
|
|
func (it *TankChefOwnershipTransferredIterator) Error() error {
|
|
return it.fail
|
|
}
|
|
|
|
// Close terminates the iteration process, releasing any pending underlying
|
|
// resources.
|
|
func (it *TankChefOwnershipTransferredIterator) Close() error {
|
|
it.sub.Unsubscribe()
|
|
return nil
|
|
}
|
|
|
|
// TankChefOwnershipTransferred represents a OwnershipTransferred event raised by the TankChef contract.
|
|
type TankChefOwnershipTransferred struct {
|
|
PreviousOwner common.Address
|
|
NewOwner common.Address
|
|
Raw types.Log // Blockchain specific contextual infos
|
|
}
|
|
|
|
// FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0.
|
|
//
|
|
// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
|
|
func (_TankChef *TankChefFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*TankChefOwnershipTransferredIterator, error) {
|
|
|
|
var previousOwnerRule []interface{}
|
|
for _, previousOwnerItem := range previousOwner {
|
|
previousOwnerRule = append(previousOwnerRule, previousOwnerItem)
|
|
}
|
|
var newOwnerRule []interface{}
|
|
for _, newOwnerItem := range newOwner {
|
|
newOwnerRule = append(newOwnerRule, newOwnerItem)
|
|
}
|
|
|
|
logs, sub, err := _TankChef.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &TankChefOwnershipTransferredIterator{contract: _TankChef.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil
|
|
}
|
|
|
|
// WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0.
|
|
//
|
|
// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
|
|
func (_TankChef *TankChefFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *TankChefOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) {
|
|
|
|
var previousOwnerRule []interface{}
|
|
for _, previousOwnerItem := range previousOwner {
|
|
previousOwnerRule = append(previousOwnerRule, previousOwnerItem)
|
|
}
|
|
var newOwnerRule []interface{}
|
|
for _, newOwnerItem := range newOwner {
|
|
newOwnerRule = append(newOwnerRule, newOwnerItem)
|
|
}
|
|
|
|
logs, sub, err := _TankChef.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return event.NewSubscription(func(quit <-chan struct{}) error {
|
|
defer sub.Unsubscribe()
|
|
for {
|
|
select {
|
|
case log := <-logs:
|
|
// New log arrived, parse the event and forward to the user
|
|
event := new(TankChefOwnershipTransferred)
|
|
if err := _TankChef.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil {
|
|
return err
|
|
}
|
|
event.Raw = log
|
|
|
|
select {
|
|
case sink <- event:
|
|
case err := <-sub.Err():
|
|
return err
|
|
case <-quit:
|
|
return nil
|
|
}
|
|
case err := <-sub.Err():
|
|
return err
|
|
case <-quit:
|
|
return nil
|
|
}
|
|
}
|
|
}), nil
|
|
}
|
|
|
|
// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0.
|
|
//
|
|
// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
|
|
func (_TankChef *TankChefFilterer) ParseOwnershipTransferred(log types.Log) (*TankChefOwnershipTransferred, error) {
|
|
event := new(TankChefOwnershipTransferred)
|
|
if err := _TankChef.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil {
|
|
return nil, err
|
|
}
|
|
event.Raw = log
|
|
return event, nil
|
|
}
|
|
|
|
// TankChefWithdrawIterator is returned from FilterWithdraw and is used to iterate over the raw logs and unpacked data for Withdraw events raised by the TankChef contract.
|
|
type TankChefWithdrawIterator struct {
|
|
Event *TankChefWithdraw // Event containing the contract specifics and raw log
|
|
|
|
contract *bind.BoundContract // Generic contract to use for unpacking event data
|
|
event string // Event name to use for unpacking event data
|
|
|
|
logs chan types.Log // Log channel receiving the found contract events
|
|
sub ethereum.Subscription // Subscription for errors, completion and termination
|
|
done bool // Whether the subscription completed delivering logs
|
|
fail error // Occurred error to stop iteration
|
|
}
|
|
|
|
// Next advances the iterator to the subsequent event, returning whether there
|
|
// are any more events found. In case of a retrieval or parsing error, false is
|
|
// returned and Error() can be queried for the exact failure.
|
|
func (it *TankChefWithdrawIterator) Next() bool {
|
|
// If the iterator failed, stop iterating
|
|
if it.fail != nil {
|
|
return false
|
|
}
|
|
// If the iterator completed, deliver directly whatever's available
|
|
if it.done {
|
|
select {
|
|
case log := <-it.logs:
|
|
it.Event = new(TankChefWithdraw)
|
|
if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
|
|
it.fail = err
|
|
return false
|
|
}
|
|
it.Event.Raw = log
|
|
return true
|
|
|
|
default:
|
|
return false
|
|
}
|
|
}
|
|
// Iterator still in progress, wait for either a data or an error event
|
|
select {
|
|
case log := <-it.logs:
|
|
it.Event = new(TankChefWithdraw)
|
|
if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
|
|
it.fail = err
|
|
return false
|
|
}
|
|
it.Event.Raw = log
|
|
return true
|
|
|
|
case err := <-it.sub.Err():
|
|
it.done = true
|
|
it.fail = err
|
|
return it.Next()
|
|
}
|
|
}
|
|
|
|
// Error returns any retrieval or parsing error occurred during filtering.
|
|
func (it *TankChefWithdrawIterator) Error() error {
|
|
return it.fail
|
|
}
|
|
|
|
// Close terminates the iteration process, releasing any pending underlying
|
|
// resources.
|
|
func (it *TankChefWithdrawIterator) Close() error {
|
|
it.sub.Unsubscribe()
|
|
return nil
|
|
}
|
|
|
|
// TankChefWithdraw represents a Withdraw event raised by the TankChef contract.
|
|
type TankChefWithdraw struct {
|
|
User common.Address
|
|
Amount *big.Int
|
|
Raw types.Log // Blockchain specific contextual infos
|
|
}
|
|
|
|
// FilterWithdraw is a free log retrieval operation binding the contract event 0x884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364.
|
|
//
|
|
// Solidity: event Withdraw(address indexed user, uint256 amount)
|
|
func (_TankChef *TankChefFilterer) FilterWithdraw(opts *bind.FilterOpts, user []common.Address) (*TankChefWithdrawIterator, error) {
|
|
|
|
var userRule []interface{}
|
|
for _, userItem := range user {
|
|
userRule = append(userRule, userItem)
|
|
}
|
|
|
|
logs, sub, err := _TankChef.contract.FilterLogs(opts, "Withdraw", userRule)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &TankChefWithdrawIterator{contract: _TankChef.contract, event: "Withdraw", logs: logs, sub: sub}, nil
|
|
}
|
|
|
|
// WatchWithdraw is a free log subscription operation binding the contract event 0x884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364.
|
|
//
|
|
// Solidity: event Withdraw(address indexed user, uint256 amount)
|
|
func (_TankChef *TankChefFilterer) WatchWithdraw(opts *bind.WatchOpts, sink chan<- *TankChefWithdraw, user []common.Address) (event.Subscription, error) {
|
|
|
|
var userRule []interface{}
|
|
for _, userItem := range user {
|
|
userRule = append(userRule, userItem)
|
|
}
|
|
|
|
logs, sub, err := _TankChef.contract.WatchLogs(opts, "Withdraw", userRule)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return event.NewSubscription(func(quit <-chan struct{}) error {
|
|
defer sub.Unsubscribe()
|
|
for {
|
|
select {
|
|
case log := <-logs:
|
|
// New log arrived, parse the event and forward to the user
|
|
event := new(TankChefWithdraw)
|
|
if err := _TankChef.contract.UnpackLog(event, "Withdraw", log); err != nil {
|
|
return err
|
|
}
|
|
event.Raw = log
|
|
|
|
select {
|
|
case sink <- event:
|
|
case err := <-sub.Err():
|
|
return err
|
|
case <-quit:
|
|
return nil
|
|
}
|
|
case err := <-sub.Err():
|
|
return err
|
|
case <-quit:
|
|
return nil
|
|
}
|
|
}
|
|
}), nil
|
|
}
|
|
|
|
// ParseWithdraw is a log parse operation binding the contract event 0x884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364.
|
|
//
|
|
// Solidity: event Withdraw(address indexed user, uint256 amount)
|
|
func (_TankChef *TankChefFilterer) ParseWithdraw(log types.Log) (*TankChefWithdraw, error) {
|
|
event := new(TankChefWithdraw)
|
|
if err := _TankChef.contract.UnpackLog(event, "Withdraw", log); err != nil {
|
|
return nil, err
|
|
}
|
|
event.Raw = log
|
|
return event, nil
|
|
}
|